From 68665809f2e4e2d0331d3f4c82d426050b93e955 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Sat, 30 Sep 2023 00:05:12 +0200 Subject: [PATCH 01/23] remove blank lines right before a `where` --- scripts/blank_line_conventions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/blank_line_conventions.py b/scripts/blank_line_conventions.py index e1ff9862a0..4a39955f11 100755 --- a/scripts/blank_line_conventions.py +++ b/scripts/blank_line_conventions.py @@ -11,7 +11,6 @@ open_tag_pattern = re.compile(r'^```\S+\n', flags=re.MULTILINE) close_tag_pattern = re.compile(r'\n```$', flags=re.MULTILINE) - if __name__ == '__main__': status = 0 @@ -23,6 +22,10 @@ output = re.sub(r'[ \t]+$', '', inputText, flags=re.MULTILINE) output = re.sub(r'\n(\s*\n){2,}', '\n\n', output) + # Remove blank lines before a `where` + output = re.sub(r'\n(\s*\n)+(\s+)where(\s|$)', + r'\n\2where\3', output, flags=re.MULTILINE) + # # Add blank line after `module ... where` # output = re.sub(r'(^([ \t]*)module[\s({][^\n]*\n(\2\s[^\n]*\n)*\2\s([^\n]*[\s)}])?where)\s*\n(?=\s*[^\n\s])', r'\1\n\n', # output, flags=re.MULTILINE) From f7cf33b976db6cb18d74ea93110c504f39e764e1 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Sat, 30 Sep 2023 00:05:26 +0200 Subject: [PATCH 02/23] remove blank lines before a `where` --- src/foundation/russells-paradox.lagda.md | 1 - src/univalent-combinatorics/pi-finite-types.lagda.md | 6 ------ src/univalent-combinatorics/symmetric-difference.lagda.md | 1 - 3 files changed, 8 deletions(-) diff --git a/src/foundation/russells-paradox.lagda.md b/src/foundation/russells-paradox.lagda.md index 2a24d52393..3317c299f2 100644 --- a/src/foundation/russells-paradox.lagda.md +++ b/src/foundation/russells-paradox.lagda.md @@ -100,7 +100,6 @@ paradox-Russell {l} H = no-fixed-points-neg ( R ∈-𝕍 R) ( pair (map-equiv β) (map-inv-equiv β)) - where K : is-small-universe l l diff --git a/src/univalent-combinatorics/pi-finite-types.lagda.md b/src/univalent-combinatorics/pi-finite-types.lagda.md index b084ebfc98..0b666650bd 100644 --- a/src/univalent-combinatorics/pi-finite-types.lagda.md +++ b/src/univalent-combinatorics/pi-finite-types.lagda.md @@ -572,7 +572,6 @@ has-finite-connected-components-Σ-is-0-connected {A = A} {B} C H K = ( is-inhabited-is-0-connected C) ( is-π-finite-Prop zero-ℕ (Σ A B)) ( α) - where α : A → is-π-finite zero-ℕ (Σ A B) α a = @@ -588,7 +587,6 @@ has-finite-connected-components-Σ-is-0-connected {A = A} {B} C H K = ( type-trunc-Set (Σ A B)) ( λ y → is-decidable-Prop (Id-Prop (trunc-Set (Σ A B)) x y)))) ( β)) - where β : (x : Σ A B) (v : type-trunc-Set (Σ A B)) → is-decidable (Id (unit-trunc-Set x) v) @@ -599,7 +597,6 @@ has-finite-connected-components-Σ-is-0-connected {A = A} {B} C H K = ( is-decidable-Prop ( Id-Prop (trunc-Set (Σ A B)) (unit-trunc-Set (pair x y)) u))) ( γ) - where γ : (v : Σ A B) → is-decidable (Id (unit-trunc-Set (pair x y)) (unit-trunc-Set v)) @@ -614,7 +611,6 @@ has-finite-connected-components-Σ-is-0-connected {A = A} {B} C H K = ( is-decidable-Prop ( mere-eq-Prop (pair x y) (pair x' y'))) ( δ)) - where δ : Id a x → is-decidable (mere-eq (pair x y) (pair x' y')) δ refl = @@ -623,7 +619,6 @@ has-finite-connected-components-Σ-is-0-connected {A = A} {B} C H K = ( is-decidable-Prop ( mere-eq-Prop (pair a y) (pair x' y'))) ( ε) - where ε : Id a x' → is-decidable (mere-eq (pair x y) (pair x' y')) ε refl = @@ -632,7 +627,6 @@ has-finite-connected-components-Σ-is-0-connected {A = A} {B} C H K = ( is-finite-Σ ( pr2 H a a) ( λ ω → is-finite-is-decidable-Prop (P ω) (d ω)))) - where ℙ : is-contr ( Σ ( type-hom-Set (trunc-Set (Id a a)) (Prop-Set _)) diff --git a/src/univalent-combinatorics/symmetric-difference.lagda.md b/src/univalent-combinatorics/symmetric-difference.lagda.md index 3625fab642..cda7db8697 100644 --- a/src/univalent-combinatorics/symmetric-difference.lagda.md +++ b/src/univalent-combinatorics/symmetric-difference.lagda.md @@ -35,7 +35,6 @@ module _ {l l1 l2 : Level} (X : UU l) (F : is-finite X) (P : decidable-subtype l1 X) (Q : decidable-subtype l2 X) - where eq-symmetric-difference : From 9ac0c6b28d0490b5366e990d9e9597d701e2b01f Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Sat, 30 Sep 2023 00:23:19 +0200 Subject: [PATCH 03/23] =?UTF-8?q?`=CE=BB=20where`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../category-of-functors.lagda.md | 7 ++++--- ...products-ideals-commutative-rings.lagda.md | 21 ++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/category-theory/category-of-functors.lagda.md b/src/category-theory/category-of-functors.lagda.md index 346c9bb498..6089370a7f 100644 --- a/src/category-theory/category-of-functors.lagda.md +++ b/src/category-theory/category-of-functors.lagda.md @@ -82,9 +82,10 @@ module _ ( ( equiv-iso-functor-natural-isomorphism-Precategory C D F G) ∘e ( extensionality-functor-is-category-Precategory C D is-category-D F G)) - ( λ { refl → - compute-iso-functor-natural-isomorphism-eq-Precategory - C D F G refl}) + ( λ where + refl → + compute-iso-functor-natural-isomorphism-eq-Precategory + C D F G refl) ``` ## Definitions diff --git a/src/commutative-algebra/products-ideals-commutative-rings.lagda.md b/src/commutative-algebra/products-ideals-commutative-rings.lagda.md index cab7a3ee8e..81b286be1b 100644 --- a/src/commutative-algebra/products-ideals-commutative-rings.lagda.md +++ b/src/commutative-algebra/products-ideals-commutative-rings.lagda.md @@ -188,18 +188,19 @@ module _ ( ideal-subset-Commutative-Ring A S) ( ideal-subset-Commutative-Ring A T) ( x)) - ( λ { (s , t , refl) → - contains-product-product-ideal-Commutative-Ring A - ( ideal-subset-Commutative-Ring A S) - ( ideal-subset-Commutative-Ring A T) + ( (λ where + (s , t , refl) → + contains-product-product-ideal-Commutative-Ring A + ( ideal-subset-Commutative-Ring A S) + ( ideal-subset-Commutative-Ring A T) + ( pr1 s) + ( pr1 t) + ( contains-subset-ideal-subset-Commutative-Ring A S ( pr1 s) + ( pr2 s)) + ( contains-subset-ideal-subset-Commutative-Ring A T ( pr1 t) - ( contains-subset-ideal-subset-Commutative-Ring A S - ( pr1 s) - ( pr2 s)) - ( contains-subset-ideal-subset-Commutative-Ring A T - ( pr1 t) - ( pr2 t))})) + ( pr2 t))))) left-backward-inclusion-preserves-product-ideal-subset-Commutative-Ring : {x s y : type-Commutative-Ring A} → From 5b5564970e279bbfd9c78796e459020f2927cea8 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Thu, 5 Oct 2023 16:38:46 +0200 Subject: [PATCH 04/23] formatting --- src/category-theory/category-of-functors.lagda.md | 3 +-- .../products-ideals-commutative-rings.lagda.md | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/category-theory/category-of-functors.lagda.md b/src/category-theory/category-of-functors.lagda.md index 6089370a7f..c2486d1ff0 100644 --- a/src/category-theory/category-of-functors.lagda.md +++ b/src/category-theory/category-of-functors.lagda.md @@ -84,8 +84,7 @@ module _ C D is-category-D F G)) ( λ where refl → - compute-iso-functor-natural-isomorphism-eq-Precategory - C D F G refl) + compute-iso-functor-natural-isomorphism-eq-Precategory C D F G refl) ``` ## Definitions diff --git a/src/commutative-algebra/products-ideals-commutative-rings.lagda.md b/src/commutative-algebra/products-ideals-commutative-rings.lagda.md index 81b286be1b..f666ab6c24 100644 --- a/src/commutative-algebra/products-ideals-commutative-rings.lagda.md +++ b/src/commutative-algebra/products-ideals-commutative-rings.lagda.md @@ -188,7 +188,7 @@ module _ ( ideal-subset-Commutative-Ring A S) ( ideal-subset-Commutative-Ring A T) ( x)) - ( (λ where + ( λ where (s , t , refl) → contains-product-product-ideal-Commutative-Ring A ( ideal-subset-Commutative-Ring A S) @@ -200,7 +200,7 @@ module _ ( pr2 s)) ( contains-subset-ideal-subset-Commutative-Ring A T ( pr1 t) - ( pr2 t))))) + ( pr2 t)))) left-backward-inclusion-preserves-product-ideal-subset-Commutative-Ring : {x s y : type-Commutative-Ring A} → From 7bc7a9fc4b623ea54cd7df430344b20e94b8d4f3 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Sun, 8 Oct 2023 21:57:35 +0200 Subject: [PATCH 05/23] =?UTF-8?q?refactor=20library=20to=20use=20`=CE=BB?= =?UTF-8?q?=20where`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../category-of-maps-categories.lagda.md | 10 +- .../dependent-products-of-categories.lagda.md | 2 +- ...dent-products-of-large-categories.lagda.md | 2 +- .../dirichlet-convolution.lagda.md | 8 +- .../divisibility-integers.lagda.md | 6 +- ...fundamental-theorem-of-arithmetic.lagda.md | 2 +- .../powers-of-two.lagda.md | 6 +- .../orbits-permutations.lagda.md | 66 ++++---- .../transpositions.lagda.md | 26 +-- src/foundation-core/equivalences.lagda.md | 2 +- src/foundation/0-connected-types.lagda.md | 12 +- src/foundation/apartness-relations.lagda.md | 21 +-- src/foundation/connected-types.lagda.md | 2 +- src/foundation/embeddings.lagda.md | 7 +- .../functoriality-coproduct-types.lagda.md | 25 +-- .../functoriality-set-truncation.lagda.md | 57 ++++--- src/foundation/identity-types.lagda.md | 4 +- src/foundation/isolated-points.lagda.md | 2 +- .../pointed-torsorial-type-families.lagda.md | 2 +- ...amental-theorem-of-identity-types.lagda.md | 15 +- src/foundation/surjective-maps.lagda.md | 15 +- .../symmetric-identity-types.lagda.md | 5 +- src/foundation/symmetric-operations.lagda.md | 2 +- .../type-arithmetic-unit-type.lagda.md | 2 +- src/foundation/uniqueness-image.lagda.md | 2 +- .../universal-property-image.lagda.md | 2 +- src/foundation/unordered-pairs.lagda.md | 4 +- src/foundation/vectors-set-quotients.lagda.md | 4 +- src/group-theory.lagda.md | 1 + ...artesian-products-concrete-groups.lagda.md | 15 +- src/group-theory/concrete-groups.lagda.md | 6 +- .../equivalences-group-actions.lagda.md | 2 +- .../generating-elements-groups.lagda.md | 49 +++--- .../images-of-group-homomorphisms.lagda.md | 14 +- ...artesian-products-concrete-groups.lagda.md | 15 +- .../normal-closures-subgroups.lagda.md | 15 +- ...ubstitution-functor-group-actions.lagda.md | 60 ++++--- src/group-theory/trivial-groups.lagda.md | 72 +++++++++ src/linear-algebra/vectors.lagda.md | 11 +- .../decidable-total-preorders.lagda.md | 4 +- src/order-theory/posets.lagda.md | 2 +- src/organic-chemistry/methane.lagda.md | 2 +- src/reflection/group-solver.lagda.md | 2 +- src/ring-theory/cyclic-rings.lagda.md | 64 ++++---- .../homomorphisms-cyclic-rings.lagda.md | 35 ++-- ...ideals-generated-by-subsets-rings.lagda.md | 6 +- ...ideals-generated-by-subsets-rings.lagda.md | 7 +- .../products-subsets-rings.lagda.md | 72 +++++---- ...ideals-generated-by-subsets-rings.lagda.md | 7 +- src/set-theory/countable-sets.lagda.md | 116 +++++++------ src/set-theory/cumulative-hierarchy.lagda.md | 59 +++---- .../coforks.lagda.md | 6 +- .../connected-set-bundles-circle.lagda.md | 2 +- .../dependent-coforks.lagda.md | 6 +- src/trees/directed-trees.lagda.md | 19 +-- .../counting-decidable-subtypes.lagda.md | 2 +- .../cyclic-types.lagda.md | 11 +- .../finitely-presented-types.lagda.md | 2 +- .../pi-finite-types.lagda.md | 153 +++++++++--------- ...al-property-standard-finite-types.lagda.md | 3 +- .../algebraic-theory-of-groups.lagda.md | 147 ++++++++--------- 61 files changed, 692 insertions(+), 608 deletions(-) create mode 100644 src/group-theory/trivial-groups.lagda.md diff --git a/src/category-theory/category-of-maps-categories.lagda.md b/src/category-theory/category-of-maps-categories.lagda.md index 60a307aec2..660aa85375 100644 --- a/src/category-theory/category-of-maps-categories.lagda.md +++ b/src/category-theory/category-of-maps-categories.lagda.md @@ -66,7 +66,8 @@ module _ ( ( distributive-Π-Σ) ∘e ( equiv-Π-equiv-family ( λ x → - extensionality-obj-Category (D , is-category-D) + extensionality-obj-Category + ( D , is-category-D) ( obj-map-Precategory C D F x) ( obj-map-Precategory C D G x)))) ( λ K → @@ -113,10 +114,9 @@ module _ is-equiv-htpy-equiv ( ( equiv-iso-map-natural-isomorphism-map-Precategory C D F G) ∘e ( extensionality-map-is-category-Precategory C D is-category-D F G)) - ( λ - { refl → - compute-iso-map-natural-isomorphism-map-eq-Precategory - C D F G refl}) + ( λ where + refl → + compute-iso-map-natural-isomorphism-map-eq-Precategory C D F G refl) ``` ## Definitions diff --git a/src/category-theory/dependent-products-of-categories.lagda.md b/src/category-theory/dependent-products-of-categories.lagda.md index b5c1aa2c16..6c44867c5b 100644 --- a/src/category-theory/dependent-products-of-categories.lagda.md +++ b/src/category-theory/dependent-products-of-categories.lagda.md @@ -50,7 +50,7 @@ module _ equiv-Π-equiv-family ( λ i → extensionality-obj-Category (C i) (x i) (y i)) ∘e equiv-funext) - ( λ {refl → refl}) + ( λ where refl → refl) Π-Category : Category (l1 ⊔ l2) (l1 ⊔ l3) pr1 Π-Category = Π-Precategory I (precategory-Category ∘ C) diff --git a/src/category-theory/dependent-products-of-large-categories.lagda.md b/src/category-theory/dependent-products-of-large-categories.lagda.md index abb7acd962..3f81e6ee78 100644 --- a/src/category-theory/dependent-products-of-large-categories.lagda.md +++ b/src/category-theory/dependent-products-of-large-categories.lagda.md @@ -53,7 +53,7 @@ module _ ( equiv-Π-equiv-family ( λ i → extensionality-obj-Large-Category (C i) (x i) (y i))) ∘e ( equiv-funext)) - ( λ {refl → refl}) + ( λ where refl → refl) Π-Large-Category : Large-Category (λ l2 → l1 ⊔ α l2) (λ l2 l3 → l1 ⊔ β l2 l3) large-precategory-Large-Category diff --git a/src/elementary-number-theory/dirichlet-convolution.lagda.md b/src/elementary-number-theory/dirichlet-convolution.lagda.md index 737e8537a8..0745ebdfe9 100644 --- a/src/elementary-number-theory/dirichlet-convolution.lagda.md +++ b/src/elementary-number-theory/dirichlet-convolution.lagda.md @@ -39,8 +39,8 @@ module _ bounded-sum-arithmetic-function-Ring R ( succ-ℕ n) ( λ x → div-ℕ-Decidable-Prop (pr1 x) (succ-ℕ n) (pr2 x)) - ( λ { (pair x K) H → - mul-Ring R - ( f ( pair x K)) - ( g ( quotient-div-nonzero-ℕ x (succ-nonzero-ℕ' n) H))}) + ( λ (x , K) H → + mul-Ring R + ( f ( pair x K)) + ( g ( quotient-div-nonzero-ℕ x (succ-nonzero-ℕ' n) H))) ``` diff --git a/src/elementary-number-theory/divisibility-integers.lagda.md b/src/elementary-number-theory/divisibility-integers.lagda.md index b6c1fc7453..e12e952095 100644 --- a/src/elementary-number-theory/divisibility-integers.lagda.md +++ b/src/elementary-number-theory/divisibility-integers.lagda.md @@ -481,7 +481,7 @@ is-zero-sim-unit-ℤ {x} {y} H p = ( λ g → g (inv (β g) ∙ (ap ((u g) *ℤ_) p ∙ right-zero-law-mul-ℤ (u g)))) where K : is-nonzero-ℤ y → presim-unit-ℤ x y - K g = H (λ {(pair u v) → g v}) + K g = H (λ (u , v) → g v) u : is-nonzero-ℤ y → ℤ u g = pr1 (pr1 (K g)) v : is-nonzero-ℤ y → ℤ @@ -546,8 +546,8 @@ transitive-presim-unit-ℤ x y z (pair (pair v K) q) (pair (pair u H) p) = transitive-sim-unit-ℤ : is-transitive sim-unit-ℤ transitive-sim-unit-ℤ x y z K H f = transitive-presim-unit-ℤ x y z - ( K (λ {(p , q) → f (is-zero-sim-unit-ℤ' H p , q)})) - ( H (λ {(p , q) → f (p , is-zero-sim-unit-ℤ K q)})) + ( K (λ (p , q) → f (is-zero-sim-unit-ℤ' H p , q))) + ( H (λ (p , q) → f (p , is-zero-sim-unit-ℤ K q))) ``` ### `sim-unit-ℤ x y` holds if and only if `x|y` and `y|x` diff --git a/src/elementary-number-theory/fundamental-theorem-of-arithmetic.lagda.md b/src/elementary-number-theory/fundamental-theorem-of-arithmetic.lagda.md index 992aa4a2fa..e7058f5a10 100644 --- a/src/elementary-number-theory/fundamental-theorem-of-arithmetic.lagda.md +++ b/src/elementary-number-theory/fundamental-theorem-of-arithmetic.lagda.md @@ -314,7 +314,7 @@ is-nonzero-least-nontrivial-divisor-ℕ n H = ( nat-least-nontrivial-divisor-ℕ n H) ( n) ( div-least-nontrivial-divisor-ℕ n H) - ( λ { refl → H}) + ( λ where refl → H) ``` ### The least nontrivial divisor of a number `> 1` is prime diff --git a/src/elementary-number-theory/powers-of-two.lagda.md b/src/elementary-number-theory/powers-of-two.lagda.md index 9efb3ca6ba..5fb5d25857 100644 --- a/src/elementary-number-theory/powers-of-two.lagda.md +++ b/src/elementary-number-theory/powers-of-two.lagda.md @@ -62,13 +62,13 @@ has-pair-expansion-is-even-or-odd n = ( λ m → (is-even-ℕ m + is-odd-ℕ m) → (pair-expansion m)) ( λ x → (0 , 0) , refl) ( λ k f → - ( λ { + ( λ where ( inl x) → ( let s = has-odd-expansion-is-odd k (is-odd-is-even-succ-ℕ k x) in pair ( 0 , (succ-ℕ (pr1 s))) ( ( ap ((succ-ℕ ∘ succ-ℕ) ∘ succ-ℕ) (left-unit-law-add-ℕ _)) ∙ - ( ( ap (succ-ℕ ∘ succ-ℕ) (pr2 s))))) ; + ( ( ap (succ-ℕ ∘ succ-ℕ) (pr2 s))))) ( inr x) → ( let e : is-even-ℕ k e = is-even-is-odd-succ-ℕ k x @@ -96,7 +96,7 @@ has-pair-expansion-is-even-or-odd n = ( ( ap ( succ-ℕ ∘ succ-ℕ) ( inv (right-two-law-mul-ℕ (pr1 e)))) ∙ - ( ( ap (succ-ℕ ∘ succ-ℕ) (pr2 e))))))))))})) + ( ( ap (succ-ℕ ∘ succ-ℕ) (pr2 e)))))))))))) ( n) has-pair-expansion : (n : ℕ) → pair-expansion n diff --git a/src/finite-group-theory/orbits-permutations.lagda.md b/src/finite-group-theory/orbits-permutations.lagda.md index fb5cbb2b6e..4e75b12bbf 100644 --- a/src/finite-group-theory/orbits-permutations.lagda.md +++ b/src/finite-group-theory/orbits-permutations.lagda.md @@ -463,12 +463,11 @@ module _ apply-universal-property-trunc-Prop ( Q) ( pr1 same-orbits-permutation a c) - ( λ { (k2 , q) → - ( unit-trunc-Prop - ( pair - ( k2 +ℕ k1) - ( (iterate-add-ℕ k2 k1 (map-equiv f) a) ∙ - ( ap (iterate k2 (map-equiv f)) p ∙ q))))})) + ( λ (k2 , q) → + ( unit-trunc-Prop + ( ( k2 +ℕ k1) , + ( (iterate-add-ℕ k2 k1 (map-equiv f) a) ∙ + ( ap (iterate k2 (map-equiv f)) p ∙ q)))))) abstract is-decidable-same-orbits-permutation : @@ -1126,23 +1125,25 @@ module _ (λ pa → lemma2 g (pair (pr1 pa) (inl (pr2 pa))))) ( is-equiv-is-prop is-prop-type-trunc-Prop ( is-prop-type-Prop (coprod-sim-Equivalence-Relation-a-b-Prop g P x)) - ( λ { + ( λ where (inl T) → - apply-universal-property-trunc-Prop T - ( prop-Equivalence-Relation (same-orbits-permutation-count g) x a) - ( λ pa → - lemma3 - ( lemma2 - ( composition-transposition-a-b g) - ( pair (pr1 pa) (inl (pr2 pa))))) ; + apply-universal-property-trunc-Prop T + ( prop-Equivalence-Relation + ( same-orbits-permutation-count g) x a) + ( λ pa → + lemma3 + ( lemma2 + ( composition-transposition-a-b g) + ( pair (pr1 pa) (inl (pr2 pa))))) (inr T) → - apply-universal-property-trunc-Prop T - ( prop-Equivalence-Relation (same-orbits-permutation-count g) x a) - ( λ pa → - lemma3 - ( lemma2 - ( composition-transposition-a-b g) - ( pair (pr1 pa) (inr (pr2 pa)))))})) + apply-universal-property-trunc-Prop T + ( prop-Equivalence-Relation + ( same-orbits-permutation-count g) x a) + ( λ pa → + lemma3 + ( lemma2 + ( composition-transposition-a-b g) + ( (pr1 pa) , (inr (pr2 pa))))))) where minimal-element-iterate-2-a-b : ( g : X ≃ X) → @@ -1170,17 +1171,18 @@ module _ equal-iterate-transposition-same-orbits g pa k ineq = equal-iterate-transposition x g ( λ k' → le-ℕ k' (pr1 (minimal-element-iterate-2-a-b g pa))) - ( λ k' p → pair - ( λ q → - contradiction-le-ℕ k' - ( pr1 (minimal-element-iterate-2-a-b g pa)) - ( p) - ( pr2 (pr2 (minimal-element-iterate-2-a-b g pa)) k' (inl q))) - ( λ r → - contradiction-le-ℕ k' - ( pr1 (minimal-element-iterate-2-a-b g pa)) - ( p) - ( pr2 (pr2 (minimal-element-iterate-2-a-b g pa)) k' (inr r)))) + ( λ k' p → + pair + ( λ q → + contradiction-le-ℕ k' + ( pr1 (minimal-element-iterate-2-a-b g pa)) + ( p) + ( pr2 (pr2 (minimal-element-iterate-2-a-b g pa)) k' (inl q))) + ( λ r → + contradiction-le-ℕ k' + ( pr1 (minimal-element-iterate-2-a-b g pa)) + ( p) + ( pr2 (pr2 (minimal-element-iterate-2-a-b g pa)) k' (inr r)))) ( λ k' ineq' _ → transitive-le-ℕ k' ( succ-ℕ k') diff --git a/src/finite-group-theory/transpositions.lagda.md b/src/finite-group-theory/transpositions.lagda.md index 6e2f1f1ff4..eea267b7ed 100644 --- a/src/finite-group-theory/transpositions.lagda.md +++ b/src/finite-group-theory/transpositions.lagda.md @@ -263,19 +263,19 @@ module _ is-not-identity-swap-2-Element-Type ( 2-element-type-2-Element-Decidable-Subtype P) ( eq-htpy-equiv - ( λ { (pair x p) → - eq-pair-Σ - ( ( ap - ( map-transposition' P x) - ( eq-is-prop - ( is-prop-is-decidable - ( is-prop-is-in-2-Element-Decidable-Subtype P x)) - { y = - is-decidable-subtype-subtype-2-Element-Decidable-Subtype - ( P) - ( x)})) ∙ - ( htpy-eq f x)) - ( eq-is-in-2-Element-Decidable-Subtype P)})) + ( λ (x , p) → + eq-pair-Σ + ( ( ap + ( map-transposition' P x) + ( eq-is-prop + ( is-prop-is-decidable + ( is-prop-is-in-2-Element-Decidable-Subtype P x)) + { y = + is-decidable-subtype-subtype-2-Element-Decidable-Subtype + ( P) + ( x)})) ∙ + ( htpy-eq f x)) + ( eq-is-in-2-Element-Decidable-Subtype P))) ``` ### Any transposition on a type equipped with a counting is a standard transposition diff --git a/src/foundation-core/equivalences.lagda.md b/src/foundation-core/equivalences.lagda.md index 0521f57df2..ef581078a4 100644 --- a/src/foundation-core/equivalences.lagda.md +++ b/src/foundation-core/equivalences.lagda.md @@ -581,7 +581,7 @@ module _ ( inv (coherence-map-inv-is-equiv H x)) ( inv (ap-id p))) ∙ ( nat-htpy (is-section-map-inv-is-equiv H) p)))))) - ( λ {refl → left-inv (is-retraction-map-inv-is-equiv H x)}) + ( λ where refl → left-inv (is-retraction-map-inv-is-equiv H x)) equiv-ap : (e : A ≃ B) (x y : A) → (x = y) ≃ (map-equiv e x = map-equiv e y) diff --git a/src/foundation/0-connected-types.lagda.md b/src/foundation/0-connected-types.lagda.md index 85c43e399e..a9a991125f 100644 --- a/src/foundation/0-connected-types.lagda.md +++ b/src/foundation/0-connected-types.lagda.md @@ -103,7 +103,7 @@ is-surjective-point-is-0-connected a H x = apply-universal-property-trunc-Prop ( mere-eq-is-0-connected H a x) ( trunc-Prop (fiber (point a) x)) - ( λ {refl → unit-trunc-Prop (pair star refl)}) + ( λ where refl → unit-trunc-Prop (star , refl)) is-trunc-map-ev-point-is-connected : {l1 l2 : Level} (k : 𝕋) {A : UU l1} {B : UU l2} (a : A) → @@ -117,7 +117,7 @@ is-trunc-map-ev-point-is-connected k {A} {B} a H K = ( universal-property-contr-is-contr star is-contr-unit B)) ( is-trunc-map-precomp-Π-is-surjective k ( is-surjective-point-is-0-connected a H) - ( λ _ → pair B K)) + ( λ _ → B , K)) equiv-dependent-universal-property-is-0-connected : {l1 : Level} {A : UU l1} (a : A) → is-0-connected A → @@ -140,11 +140,11 @@ abstract is-surjective-fiber-inclusion : {l1 l2 : Level} {A : UU l1} {B : A → UU l2} → is-0-connected A → (a : A) → is-surjective (fiber-inclusion B a) - is-surjective-fiber-inclusion {B = B} C a (pair x b) = + is-surjective-fiber-inclusion {B = B} C a (x , b) = apply-universal-property-trunc-Prop ( mere-eq-is-0-connected C a x) - ( trunc-Prop (fiber (fiber-inclusion B a) (pair x b))) - ( λ { refl → unit-trunc-Prop (pair b refl)}) + ( trunc-Prop (fiber (fiber-inclusion B a) (x , b))) + ( λ where refl → unit-trunc-Prop (b , refl)) abstract mere-eq-is-surjective-fiber-inclusion : @@ -153,7 +153,7 @@ abstract (x : A) → mere-eq a x mere-eq-is-surjective-fiber-inclusion a H x = apply-universal-property-trunc-Prop - ( H (λ x → unit) (pair x star)) + ( H (λ x → unit) (x , star)) ( mere-eq-Prop a x) ( λ u → unit-trunc-Prop (ap pr1 (pr2 u))) diff --git a/src/foundation/apartness-relations.lagda.md b/src/foundation/apartness-relations.lagda.md index cdeaaa2db6..ceffb71118 100644 --- a/src/foundation/apartness-relations.lagda.md +++ b/src/foundation/apartness-relations.lagda.md @@ -199,16 +199,17 @@ module _ ( disj-Prop ( rel-apart-function-into-Type-With-Apartness X Y f h) ( rel-apart-function-into-Type-With-Apartness X Y g h)) - ( λ { (inl b) → - inl-disj-Prop - ( rel-apart-function-into-Type-With-Apartness X Y f h) - ( rel-apart-function-into-Type-With-Apartness X Y g h) - ( unit-trunc-Prop (x , b)) ; - (inr b) → - inr-disj-Prop - ( rel-apart-function-into-Type-With-Apartness X Y f h) - ( rel-apart-function-into-Type-With-Apartness X Y g h) - ( unit-trunc-Prop (x , b))})) + ( λ where + (inl b) → + inl-disj-Prop + ( rel-apart-function-into-Type-With-Apartness X Y f h) + ( rel-apart-function-into-Type-With-Apartness X Y g h) + ( unit-trunc-Prop (x , b)) + (inr b) → + inr-disj-Prop + ( rel-apart-function-into-Type-With-Apartness X Y f h) + ( rel-apart-function-into-Type-With-Apartness X Y g h) + ( unit-trunc-Prop (x , b)))) exp-Type-With-Apartness : Type-With-Apartness (l1 ⊔ l2) (l1 ⊔ l3) pr1 exp-Type-With-Apartness = X → type-Type-With-Apartness Y diff --git a/src/foundation/connected-types.lagda.md b/src/foundation/connected-types.lagda.md index 5aaa57af12..fe2331b54d 100644 --- a/src/foundation/connected-types.lagda.md +++ b/src/foundation/connected-types.lagda.md @@ -106,6 +106,6 @@ module _ ( trunc (succ-𝕋 k) A) ( unit-trunc a) ( unit-trunc x)) - ( λ { refl → refl}) + ( λ where refl → refl) ( center (K a x))))) ``` diff --git a/src/foundation/embeddings.lagda.md b/src/foundation/embeddings.lagda.md index 718e1505c1..e34e6ad4f5 100644 --- a/src/foundation/embeddings.lagda.md +++ b/src/foundation/embeddings.lagda.md @@ -277,9 +277,10 @@ module _ is-emb-equiv-refl-to-refl e p x y = is-equiv-htpy-equiv (inv-equiv (e x y)) - λ { refl → - inv (is-retraction-map-inv-equiv (e x x) refl) ∙ - ap (map-equiv (inv-equiv (e x x))) (p x)} + ( λ where + refl → + inv (is-retraction-map-inv-equiv (e x x) refl) ∙ + ap (map-equiv (inv-equiv (e x x))) (p x)) ``` ### Embeddings are closed under pullback diff --git a/src/foundation/functoriality-coproduct-types.lagda.md b/src/foundation/functoriality-coproduct-types.lagda.md index 0cb0368127..6674df9565 100644 --- a/src/foundation/functoriality-coproduct-types.lagda.md +++ b/src/foundation/functoriality-coproduct-types.lagda.md @@ -247,11 +247,11 @@ module _ is-surjective-map-coprod s s' (inl x) = apply-universal-property-trunc-Prop (s x) ( trunc-Prop (fiber (map-coprod _ _) (inl x))) - ( λ {(a , p) → unit-trunc-Prop (inl a , ap inl p)}) + ( λ (a , p) → unit-trunc-Prop (inl a , ap inl p)) is-surjective-map-coprod s s' (inr x) = apply-universal-property-trunc-Prop (s' x) ( trunc-Prop (fiber (map-coprod _ _) (inr x))) - ( λ {(a , p) → unit-trunc-Prop (inr a , ap inr p)}) + ( λ (a , p) → unit-trunc-Prop (inr a , ap inr p)) ``` ### For any two maps `f : A → B` and `g : C → D`, there is at most one pair of maps `f' : A → B` and `g' : C → D` such that `f' + g' = f + g` @@ -521,16 +521,17 @@ module _ (map-inv-mutually-exclusive-coprod ∘ map-mutually-exclusive-coprod) ~ id is-section-map-inv-mutually-exclusive-coprod e = eq-htpy-equiv ( - λ { (inl p) → - ap - ( pr1) - ( is-retraction-map-inv-equiv-left-summand - ( map-equiv e (inl p) , left-to-left ¬PQ' e (inl p) star)) ; - (inr q) → - ap - ( pr1) - ( is-retraction-map-inv-equiv-right-summand - ( map-equiv e (inr q) , right-to-right ¬P'Q e (inr q) star))}) + λ where + (inl p) → + ap + ( pr1) + ( is-retraction-map-inv-equiv-left-summand + ( map-equiv e (inl p) , left-to-left ¬PQ' e (inl p) star)) + (inr q) → + ap + ( pr1) + ( is-retraction-map-inv-equiv-right-summand + ( map-equiv e (inr q) , right-to-right ¬P'Q e (inr q) star))) equiv-mutually-exclusive-coprod : ((P + Q) ≃ (P' + Q')) ≃ ((P ≃ P') × (Q ≃ Q')) diff --git a/src/foundation/functoriality-set-truncation.lagda.md b/src/foundation/functoriality-set-truncation.lagda.md index 9756288cf2..e1d6cbd8bf 100644 --- a/src/foundation/functoriality-set-truncation.lagda.md +++ b/src/foundation/functoriality-set-truncation.lagda.md @@ -199,11 +199,10 @@ module _ apply-universal-property-trunc-Prop ( H b) ( trunc-Prop (fiber (map-trunc-Set f) (unit-trunc-Set b))) - ( λ { (pair a p) → - unit-trunc-Prop - ( pair - ( unit-trunc-Set a) - ( naturality-unit-trunc-Set f a ∙ ap unit-trunc-Set p))})) + ( λ (a , p) → + unit-trunc-Prop + ( ( unit-trunc-Set a) , + ( naturality-unit-trunc-Set f a ∙ ap unit-trunc-Set p)))) ``` ### If the set truncation of a map `f` is surjective, then `f` is surjective @@ -216,16 +215,17 @@ module _ apply-universal-property-trunc-Prop ( H (unit-trunc-Set b)) ( trunc-Prop (fiber f b)) - ( λ { (pair x p) → - apply-universal-property-trunc-Prop - ( is-surjective-unit-trunc-Set A x) - ( trunc-Prop (fiber f b)) - ( λ { (pair a refl) → - apply-universal-property-trunc-Prop - ( apply-effectiveness-unit-trunc-Set - ( inv (naturality-unit-trunc-Set f a) ∙ p)) - ( trunc-Prop (fiber f b)) - ( λ q → unit-trunc-Prop (pair a q))})}) + ( λ (x , p) → + apply-universal-property-trunc-Prop + ( is-surjective-unit-trunc-Set A x) + ( trunc-Prop (fiber f b)) + ( λ where + (a , refl) → + apply-universal-property-trunc-Prop + ( apply-effectiveness-unit-trunc-Set + ( inv (naturality-unit-trunc-Set f a) ∙ p)) + ( trunc-Prop (fiber f b)) + ( λ q → unit-trunc-Prop (a , q)))) ``` ### Set truncation preserves the image of a map @@ -248,7 +248,8 @@ module _ ( is-injective-is-emb (is-emb-inclusion-im f))) emb-trunc-im-Set : type-trunc-Set (im f) ↪ type-trunc-Set B - emb-trunc-im-Set = pair inclusion-trunc-im-Set is-emb-inclusion-trunc-im-Set + pr1 emb-trunc-im-Set = inclusion-trunc-im-Set + pr2 emb-trunc-im-Set = is-emb-inclusion-trunc-im-Set abstract is-injective-inclusion-trunc-im-Set : is-injective inclusion-trunc-im-Set @@ -265,8 +266,8 @@ module _ ( preserves-comp-map-trunc-Set (inclusion-im f) (map-unit-im f)) hom-slice-trunc-im-Set : hom-slice (map-trunc-Set f) inclusion-trunc-im-Set - hom-slice-trunc-im-Set = - pair map-hom-slice-trunc-im-Set triangle-hom-slice-trunc-im-Set + pr1 hom-slice-trunc-im-Set = map-hom-slice-trunc-im-Set + pr2 hom-slice-trunc-im-Set = triangle-hom-slice-trunc-im-Set abstract is-surjective-map-hom-slice-trunc-im-Set : @@ -361,17 +362,15 @@ module _ unit-im-map-trunc-Set : im f → im (map-trunc-Set f) - unit-im-map-trunc-Set x = - pair - ( unit-trunc-Set (pr1 x)) - ( apply-universal-property-trunc-Prop (pr2 x) - ( trunc-Prop (fiber (map-trunc-Set f) (unit-trunc-Set (pr1 x)))) - ( λ u → - unit-trunc-Prop - ( pair - ( unit-trunc-Set (pr1 u)) - ( naturality-unit-trunc-Set f (pr1 u) ∙ - ap unit-trunc-Set (pr2 u))))) + pr1 (unit-im-map-trunc-Set x) = unit-trunc-Set (pr1 x) + pr2 (unit-im-map-trunc-Set x) = + apply-universal-property-trunc-Prop (pr2 x) + ( trunc-Prop (fiber (map-trunc-Set f) (unit-trunc-Set (pr1 x)))) + ( λ u → + unit-trunc-Prop + ( ( unit-trunc-Set (pr1 u)) , + ( naturality-unit-trunc-Set f (pr1 u) ∙ + ap unit-trunc-Set (pr2 u)))) left-square-unit-im-map-trunc-Set : ( map-unit-im (map-trunc-Set f) ∘ unit-trunc-Set) ~ diff --git a/src/foundation/identity-types.lagda.md b/src/foundation/identity-types.lagda.md index ef44d6ca31..0347d09a5d 100644 --- a/src/foundation/identity-types.lagda.md +++ b/src/foundation/identity-types.lagda.md @@ -103,8 +103,8 @@ module _ pr2 equiv-concat-equiv = is-equiv-is-invertible equiv-concat - (λ { refl → refl}) - (λ e → eq-htpy (λ y → eq-htpy-equiv (λ { refl → right-unit}))) + (λ where refl → refl) + (λ e → eq-htpy (λ y → eq-htpy-equiv (λ where refl → right-unit))) inv-concat' : (x : A) {y z : A} → y = z → x = z → x = y inv-concat' x q = concat' x (inv q) diff --git a/src/foundation/isolated-points.lagda.md b/src/foundation/isolated-points.lagda.md index 1ee694deca..afe5564f19 100644 --- a/src/foundation/isolated-points.lagda.md +++ b/src/foundation/isolated-points.lagda.md @@ -251,7 +251,7 @@ pr1 (pr2 (decidable-emb-isolated-point {l1} {A} a)) = ( is-emb-inclusion-isolated-point A) ( is-emb-is-injective ( is-set-isolated-point A) - ( λ { {star} {star} p → refl})) + ( λ where {star} {star} p → refl)) pr2 (pr2 (decidable-emb-isolated-point {l1} {A} a)) x = is-decidable-prod is-decidable-unit (pr2 a x) ``` diff --git a/src/foundation/pointed-torsorial-type-families.lagda.md b/src/foundation/pointed-torsorial-type-families.lagda.md index 2df25c9047..aca964f20e 100644 --- a/src/foundation/pointed-torsorial-type-families.lagda.md +++ b/src/foundation/pointed-torsorial-type-families.lagda.md @@ -142,7 +142,7 @@ module _ apply-universal-property-trunc-Prop ( mere-eq-is-0-connected H (point-Pointed-Type B) x) ( is-small-Prop l2 (x = y)) - ( λ { refl → (E y , inv-equiv (T y))}) + ( λ where refl → (E y , inv-equiv (T y))) ``` ### The type of pointed torsorial type families of universe level `l` over a pointed connected type is equivalent to the proposition that `B` is locally `l`-small diff --git a/src/foundation/regensburg-extension-fundamental-theorem-of-identity-types.lagda.md b/src/foundation/regensburg-extension-fundamental-theorem-of-identity-types.lagda.md index 5bef830d57..3e8347a4c7 100644 --- a/src/foundation/regensburg-extension-fundamental-theorem-of-identity-types.lagda.md +++ b/src/foundation/regensburg-extension-fundamental-theorem-of-identity-types.lagda.md @@ -94,13 +94,14 @@ module _ apply-universal-property-trunc-Prop ( mere-eq-is-0-connected H a x) ( P _) - ( λ { refl → - is-in-subuniverse-equiv P - ( compute-fiber-map-out-of-identity-type - ( ind-Id a (λ u v → B u) y) - ( x') - ( y')) - ( K (ind-Id a (λ u v → B u) y) x' y')}) + ( λ where + refl → + is-in-subuniverse-equiv P + ( compute-fiber-map-out-of-identity-type + ( ind-Id a (λ u v → B u) y) + ( x') + ( y')) + ( K (ind-Id a (λ u v → B u) y) x' y')) abstract backward-implication-extended-fundamental-theorem-id : diff --git a/src/foundation/surjective-maps.lagda.md b/src/foundation/surjective-maps.lagda.md index b9fdc14f7a..96d2e5c22e 100644 --- a/src/foundation/surjective-maps.lagda.md +++ b/src/foundation/surjective-maps.lagda.md @@ -415,12 +415,12 @@ module _ apply-universal-property-trunc-Prop ( is-surj-g x) ( trunc-Prop (fiber f x)) - ( λ { (b , refl) → - apply-universal-property-trunc-Prop - ( is-surj-h b) - ( trunc-Prop (fiber f (g b))) - ( λ { (a , refl) → - unit-trunc-Prop (a , H a)})}) + ( λ where + (b , refl) → + apply-universal-property-trunc-Prop + ( is-surj-h b) + ( trunc-Prop (fiber f (g b))) + ( λ where (a , refl) → unit-trunc-Prop (a , H a))) is-surjective-comp : {g : B → X} {h : A → B} → @@ -483,8 +483,7 @@ module _ apply-universal-property-trunc-Prop ( is-surj-f x) ( trunc-Prop (fiber g x)) - ( λ { (a , refl) → - unit-trunc-Prop (h a , inv (H a))}) + ( λ where (a , refl) → unit-trunc-Prop (h a , inv (H a))) is-surjective-left-factor : {g : B → X} (h : A → B) → is-surjective (g ∘ h) → is-surjective g diff --git a/src/foundation/symmetric-identity-types.lagda.md b/src/foundation/symmetric-identity-types.lagda.md index 13f4b12391..7b43677a16 100644 --- a/src/foundation/symmetric-identity-types.lagda.md +++ b/src/foundation/symmetric-identity-types.lagda.md @@ -117,8 +117,9 @@ module _ ( map-inv-compute-symmetric-Id (map-compute-symmetric-Id (x , f))) ( x , f) ( ( inv (f (zero-Fin 1))) , - ( λ { ( inl (inr star)) → inv (left-inv (f (zero-Fin 1))) ; - ( inr star) → refl})) + ( λ where + ( inl (inr star)) → inv (left-inv (f (zero-Fin 1))) + ( inr star) → refl)) is-equiv-map-compute-symmetric-Id : is-equiv (map-compute-symmetric-Id) diff --git a/src/foundation/symmetric-operations.lagda.md b/src/foundation/symmetric-operations.lagda.md index 804aa8eaa0..09aef10d24 100644 --- a/src/foundation/symmetric-operations.lagda.md +++ b/src/foundation/symmetric-operations.lagda.md @@ -208,7 +208,7 @@ module _ apply-universal-property-trunc-Prop ( is-surjective-standard-unordered-pair p) ( Id-Prop B (f p) (g p)) - ( λ { (x , y , refl) → H x y}))) + ( λ where (x , y , refl) → H x y))) is-contr-total-htpy-symmetric-operation-Set : is-contr diff --git a/src/foundation/type-arithmetic-unit-type.lagda.md b/src/foundation/type-arithmetic-unit-type.lagda.md index a83bf154ad..21c1952f6c 100644 --- a/src/foundation/type-arithmetic-unit-type.lagda.md +++ b/src/foundation/type-arithmetic-unit-type.lagda.md @@ -166,7 +166,7 @@ module _ is-retraction-map-inv-left-unit-law-Π : ( map-inv-left-unit-law-Π ∘ map-left-unit-law-Π) ~ id - is-retraction-map-inv-left-unit-law-Π f = eq-htpy (λ { star → refl}) + is-retraction-map-inv-left-unit-law-Π f = eq-htpy (λ where star → refl) is-equiv-map-left-unit-law-Π : is-equiv map-left-unit-law-Π is-equiv-map-left-unit-law-Π = diff --git a/src/foundation/uniqueness-image.lagda.md b/src/foundation/uniqueness-image.lagda.md index 9d9a1547f7..935e6f27e2 100644 --- a/src/foundation/uniqueness-image.lagda.md +++ b/src/foundation/uniqueness-image.lagda.md @@ -122,7 +122,7 @@ module _ ( comp-hom-slice f (map-emb i) (map-emb i') (pr1 h) q) ( q')) ( equiv-right-swap-Σ) - ( λ { (pair (pair e E) H) → id-equiv}))) + ( λ ((e , E) , H) → id-equiv))) ( is-contr-equiv ( is-equiv ( map-hom-slice-universal-property-image f i q Hi i' q')) diff --git a/src/foundation/universal-property-image.lagda.md b/src/foundation/universal-property-image.lagda.md index 9670cd212b..b76f1e211b 100644 --- a/src/foundation/universal-property-image.lagda.md +++ b/src/foundation/universal-property-image.lagda.md @@ -200,7 +200,7 @@ module _ {l : Level} (B : subtype l X) → ((a : A) → is-in-subtype B (f a)) → subtype-im f ⊆ B backward-implication-is-image-subtype-subtype-im B H x K = - apply-universal-property-trunc-Prop K (B x) (λ {(a , refl) → H a}) + apply-universal-property-trunc-Prop K (B x) (λ where (a , refl) → H a) is-image-subtype-subtype-im : is-image-subtype f (subtype-im f) pr1 (is-image-subtype-subtype-im B) = diff --git a/src/foundation/unordered-pairs.lagda.md b/src/foundation/unordered-pairs.lagda.md index 1a5794fd7d..874073cb72 100644 --- a/src/foundation/unordered-pairs.lagda.md +++ b/src/foundation/unordered-pairs.lagda.md @@ -539,7 +539,9 @@ is-surjective-standard-unordered-pair (I , a) = ( standard-unordered-pair _ _) ( I , a) ( e) - ( λ { (inl (inr star)) → refl ; (inr star) → refl}))) + ( λ where + (inl (inr star)) → refl + (inr star) → refl))) ``` ### For every unordered pair `p` and every element `i` in its underlying type, `p` is equal to a standard unordered pair diff --git a/src/foundation/vectors-set-quotients.lagda.md b/src/foundation/vectors-set-quotients.lagda.md index f5f074b4f4..ce52820f1b 100644 --- a/src/foundation/vectors-set-quotients.lagda.md +++ b/src/foundation/vectors-set-quotients.lagda.md @@ -271,7 +271,7 @@ pr1 (is-section-inv-precomp-vector-set-quotient n A R X) = inv-precomp-vector-set-quotient n A R X pr2 (is-section-inv-precomp-vector-set-quotient {l} {l1} {l2} zero-ℕ A R X) f = eq-pair-Σ - ( eq-htpy (λ {(map-raise star) → refl})) + ( eq-htpy (λ where (map-raise star) → refl)) ( eq-is-prop ( is-prop-reflects-Equivalence-Relation ( raise-indiscrete-Equivalence-Relation l2 (raise-unit l1)) @@ -319,7 +319,7 @@ is-retraction-inv-precomp-vector-set-quotient : pr1 (is-retraction-inv-precomp-vector-set-quotient n A R X) = inv-precomp-vector-set-quotient n A R X pr2 (is-retraction-inv-precomp-vector-set-quotient zero-ℕ A R X) f = - eq-htpy (λ {(map-raise star) → refl}) + eq-htpy (λ where (map-raise star) → refl) pr2 (is-retraction-inv-precomp-vector-set-quotient (succ-ℕ n) A R X) f = ap (_∘ set-quotient-vector-prod-set-quotient) is-inv-map-inv-equiv-f ∙ lemma-f diff --git a/src/group-theory.lagda.md b/src/group-theory.lagda.md index df97de57bf..09c5170ea6 100644 --- a/src/group-theory.lagda.md +++ b/src/group-theory.lagda.md @@ -169,6 +169,7 @@ open import group-theory.transitive-concrete-group-actions public open import group-theory.transitive-group-actions public open import group-theory.trivial-concrete-groups public open import group-theory.trivial-group-homomorphisms public +open import group-theory.trivial-groups public open import group-theory.trivial-subgroups public open import group-theory.unordered-tuples-of-elements-commutative-monoids public open import group-theory.wild-representations-monoids public diff --git a/src/group-theory/cartesian-products-concrete-groups.lagda.md b/src/group-theory/cartesian-products-concrete-groups.lagda.md index 49b78857e1..0bdd110bcc 100644 --- a/src/group-theory/cartesian-products-concrete-groups.lagda.md +++ b/src/group-theory/cartesian-products-concrete-groups.lagda.md @@ -110,13 +110,14 @@ module _ shape-product-Concrete-Group X) ( is-set-Prop (Id X Y)) - ( λ { refl → - apply-universal-property-trunc-Prop - ( mere-eq-classifying-type-product-Concrete-Group - shape-product-Concrete-Group - Y) - ( is-set-Prop (Id shape-product-Concrete-Group Y)) - ( λ { refl → is-set-type-product-Concrete-Group})}) + ( λ where + refl → + apply-universal-property-trunc-Prop + ( mere-eq-classifying-type-product-Concrete-Group + shape-product-Concrete-Group + Y) + ( is-set-Prop (Id shape-product-Concrete-Group Y)) + ( λ where refl → is-set-type-product-Concrete-Group)) classifying-1-type-product-Concrete-Group : Truncated-Type (l1 ⊔ l2) one-𝕋 classifying-1-type-product-Concrete-Group = diff --git a/src/group-theory/concrete-groups.lagda.md b/src/group-theory/concrete-groups.lagda.md index 00e4cc3604..cb880865e1 100644 --- a/src/group-theory/concrete-groups.lagda.md +++ b/src/group-theory/concrete-groups.lagda.md @@ -93,12 +93,12 @@ module _ apply-universal-property-trunc-Prop ( mere-eq-classifying-type-Concrete-Group shape-Concrete-Group X) ( is-set-Prop (X = Y)) - ( λ - { refl → + ( λ where + refl → apply-universal-property-trunc-Prop ( mere-eq-classifying-type-Concrete-Group shape-Concrete-Group Y) ( is-set-Prop (shape-Concrete-Group = Y)) - ( λ { refl → is-set-type-Concrete-Group})}) + ( λ where refl → is-set-type-Concrete-Group)) classifying-1-type-Concrete-Group : Truncated-Type l one-𝕋 pr1 classifying-1-type-Concrete-Group = diff --git a/src/group-theory/equivalences-group-actions.lagda.md b/src/group-theory/equivalences-group-actions.lagda.md index 81b43dbe6b..4a1a52e144 100644 --- a/src/group-theory/equivalences-group-actions.lagda.md +++ b/src/group-theory/equivalences-group-actions.lagda.md @@ -143,7 +143,7 @@ module _ ( hom-equiv-Abstract-Group-Action G X Y e) ( pr1 f)) ( equiv-right-swap-Σ) - ( λ { (pair (pair f E) H) → id-equiv})) + ( λ ((f , E) , H) → id-equiv)) ( is-contr-total-Eq-subtype ( is-contr-total-htpy-hom-Abstract-Group-Action G X Y ( hom-equiv-Abstract-Group-Action G X Y e)) diff --git a/src/group-theory/generating-elements-groups.lagda.md b/src/group-theory/generating-elements-groups.lagda.md index 2fc67eec29..0898ab9246 100644 --- a/src/group-theory/generating-elements-groups.lagda.md +++ b/src/group-theory/generating-elements-groups.lagda.md @@ -364,13 +364,14 @@ module _ is-normal-image-hom-element-is-emb-ev-element-hom-Group x (y , p) = apply-universal-property-trunc-Prop p ( subset-image-hom-element-Group G g (conjugation-Group G x y)) - ( λ { (k , refl) → - is-closed-under-eq-image-hom-element-Group' G g - ( unit-trunc-Prop (k , refl)) - ( ( preserves-integer-powers-conjugation-Group G k x g) ∙ - ( ap - ( integer-power-Group G k) - ( compute-conjugation-is-emb-ev-element-hom-Group' x)))}) + ( λ where + (k , refl) → + is-closed-under-eq-image-hom-element-Group' G g + ( unit-trunc-Prop (k , refl)) + ( ( preserves-integer-powers-conjugation-Group G k x g) ∙ + ( ap + ( integer-power-Group G k) + ( compute-conjugation-is-emb-ev-element-hom-Group' x)))) private N : Normal-Subgroup l G @@ -423,8 +424,9 @@ module _ ( set-Group H) ( map-hom-Group G H h x) ( map-hom-Group G H k x)) - ( λ { (z , refl) → - eq-integer-power-hom-Group G H h k z g (p ∙ inv q)})))) + ( λ where + (z , refl) → + eq-integer-power-hom-Group G H h k z g (p ∙ inv q))))) is-emb-ev-element-is-generating-element-Group : is-generating-element-Group G g → is-emb-ev-element-hom-Group G g @@ -465,8 +467,9 @@ module _ ( U x) ( U y) ( Id-Prop (set-Group G) (mul-Group G x y) (mul-Group G y x)) - ( λ { (k , refl) (l , refl) → - commute-integer-powers-Group G k l refl}) + ( λ where + (k , refl) (l , refl) → + commute-integer-powers-Group G k l refl) commutative-mul-is-generating-element-Group : (U : is-generating-element-Group G g) → @@ -561,12 +564,13 @@ module _ ( ev-element-hom-Group-With-Generating-Element G ( group-Group-With-Generating-Element G)) ( x)) - ( λ { (k , refl) → - unit-trunc-Prop - ( hom-integer-multiple-Ab - ( abelian-group-Group-With-Generating-Element G) - ( k) , - refl)}) + ( λ where + (k , refl) → + unit-trunc-Prop + ( hom-integer-multiple-Ab + ( abelian-group-Group-With-Generating-Element G) + ( k) , + refl)) is-equiv-ev-element-Group-With-Generating-Element : is-equiv @@ -653,11 +657,12 @@ module _ ( is-surjective-hom-element-Group-With-Generating-Element G x) ( is-surjective-hom-element-Group-With-Generating-Element G y) ( Id-Prop (set-Group-With-Generating-Element G) _ _) - ( λ { (k , refl) (l , refl) → - commute-integer-multiples-diagonal-Ring - ( ring-Group-With-Generating-Element) - ( k) - ( l)}) + ( λ where + (k , refl) (l , refl) → + commute-integer-multiples-diagonal-Ring + ( ring-Group-With-Generating-Element) + ( k) + ( l)) commutative-ring-Group-With-Generating-Element : Commutative-Ring l pr1 commutative-ring-Group-With-Generating-Element = diff --git a/src/group-theory/images-of-group-homomorphisms.lagda.md b/src/group-theory/images-of-group-homomorphisms.lagda.md index dcb55de5c4..922680688d 100644 --- a/src/group-theory/images-of-group-homomorphisms.lagda.md +++ b/src/group-theory/images-of-group-homomorphisms.lagda.md @@ -78,9 +78,10 @@ module _ is-closed-under-multiplication-image-hom-Group x y K L = apply-twice-universal-property-trunc-Prop K L ( subset-image-hom-Group (mul-Group H x y)) - ( λ { (g , refl) (h , refl) → - unit-trunc-Prop - ( mul-Group G g h , preserves-mul-hom-Group G H f g h)}) + ( λ where + (g , refl) (h , refl) → + unit-trunc-Prop + ( mul-Group G g h , preserves-mul-hom-Group G H f g h)) abstract is-closed-under-inverses-image-hom-Group : @@ -88,9 +89,10 @@ module _ is-closed-under-inverses-image-hom-Group x K = apply-universal-property-trunc-Prop K ( subset-image-hom-Group (inv-Group H x)) - ( λ { (g , refl) → - unit-trunc-Prop - ( inv-Group G g , preserves-inv-hom-Group G H f g)}) + ( λ where + (g , refl) → + unit-trunc-Prop + ( inv-Group G g , preserves-inv-hom-Group G H f g)) is-subgroup-image-hom-Group : is-subgroup-subset-Group H subset-image-hom-Group diff --git a/src/group-theory/iterated-cartesian-products-concrete-groups.lagda.md b/src/group-theory/iterated-cartesian-products-concrete-groups.lagda.md index 68fc89f09b..20278df0a5 100644 --- a/src/group-theory/iterated-cartesian-products-concrete-groups.lagda.md +++ b/src/group-theory/iterated-cartesian-products-concrete-groups.lagda.md @@ -121,13 +121,14 @@ module _ shape-iterated-product-Concrete-Group X) ( is-set-Prop (Id X Y)) - ( λ { refl → - apply-universal-property-trunc-Prop - ( mere-eq-classifying-type-iterated-product-Concrete-Group - shape-iterated-product-Concrete-Group - Y) - ( is-set-Prop (Id shape-iterated-product-Concrete-Group Y)) - ( λ { refl → is-set-type-iterated-product-Concrete-Group})}) + ( λ where + refl → + apply-universal-property-trunc-Prop + ( mere-eq-classifying-type-iterated-product-Concrete-Group + shape-iterated-product-Concrete-Group + Y) + ( is-set-Prop (Id shape-iterated-product-Concrete-Group Y)) + ( λ where refl → is-set-type-iterated-product-Concrete-Group)) classifying-1-type-iterated-product-Concrete-Group : Truncated-Type l one-𝕋 classifying-1-type-iterated-product-Concrete-Group = diff --git a/src/group-theory/normal-closures-subgroups.lagda.md b/src/group-theory/normal-closures-subgroups.lagda.md index 29990ecd76..1fd73751fe 100644 --- a/src/group-theory/normal-closures-subgroups.lagda.md +++ b/src/group-theory/normal-closures-subgroups.lagda.md @@ -91,11 +91,12 @@ module _ is-closed-under-conjugation-generating-subset-normal-closure-Subgroup x y s = apply-universal-property-trunc-Prop s ( generating-subset-normal-closure-Subgroup (conjugation-Group G x y)) - ( λ { (z , h , refl) → - unit-trunc-Prop - ( mul-Group G x z , - h , - compute-conjugation-mul-Group G x z (pr1 h))}) + ( λ where + (z , h , refl) → + unit-trunc-Prop + ( mul-Group G x z , + h , + compute-conjugation-mul-Group G x z (pr1 h))) subgroup-normal-closure-Subgroup : Subgroup (l1 ⊔ l2) G subgroup-normal-closure-Subgroup = @@ -192,8 +193,8 @@ module _ contains-generating-subset-normal-closure-Normal-Subgroup N u x g = apply-universal-property-trunc-Prop g ( subset-Normal-Subgroup G N x) - ( λ { (z , (y , h) , refl) → - is-normal-Normal-Subgroup G N z y (u y h)}) + ( λ where + (z , (y , h) , refl) → is-normal-Normal-Subgroup G N z y (u y h)) backward-implication-is-normal-closure-normal-closure-Subgroup : {l : Level} (N : Normal-Subgroup l G) → diff --git a/src/group-theory/substitution-functor-group-actions.lagda.md b/src/group-theory/substitution-functor-group-actions.lagda.md index f707712704..94ff4fc9dd 100644 --- a/src/group-theory/substitution-functor-group-actions.lagda.md +++ b/src/group-theory/substitution-functor-group-actions.lagda.md @@ -158,15 +158,14 @@ module _ ( Equivalence-Relation-obj-left-adjoint-subst-Abstract-Group-Action X) ( h' , x') ( h , x)) - ( λ { (g , p , q) → - intro-∃ - ( inv-Group G g) - ( pair - ( ( ap - ( mul-Group' H h') - ( preserves-inv-hom-Group G H f g)) ∙ - ( inv (transpose-eq-mul-Group' H p))) - ( inv (transpose-eq-mul-Abstract-Group-Action G X g x x' q)))}) + ( λ (g , p , q) → + intro-∃ + ( inv-Group G g) + ( ( ( ap + ( mul-Group' H h') + ( preserves-inv-hom-Group G H f g)) ∙ + ( inv (transpose-eq-mul-Group' H p))) , + ( inv (transpose-eq-mul-Abstract-Group-Action G X g x x' q)))) pr2 ( pr2 ( pr2 @@ -177,28 +176,27 @@ module _ ( Equivalence-Relation-obj-left-adjoint-subst-Abstract-Group-Action X) ( h , x) ( h'' , x'')) - ( λ { (g , p , q) → - apply-universal-property-trunc-Prop d - ( pr1 - ( Equivalence-Relation-obj-left-adjoint-subst-Abstract-Group-Action - ( X)) - ( h , x) - ( h'' , x'')) - ( λ { (g' , p' , q') → - intro-∃ - ( mul-Group G g' g) - ( pair - ( ( ap - ( mul-Group' H h) - ( preserves-mul-hom-Group G H f g' g)) ∙ - ( ( associative-mul-Group H - ( map-hom-Group G H f g') - ( map-hom-Group G H f g) - ( h)) ∙ - ( ( ap (mul-Group H (map-hom-Group G H f g')) p) ∙ - ( p')))) - ( ( preserves-mul-Abstract-Group-Action G X g' g x) ∙ - ( ap (mul-Abstract-Group-Action G X g') q ∙ q')))})}) + ( λ (g , p , q) → + apply-universal-property-trunc-Prop d + ( pr1 + ( Equivalence-Relation-obj-left-adjoint-subst-Abstract-Group-Action + ( X)) + ( h , x) + ( h'' , x'')) + ( λ (g' , p' , q') → + intro-∃ + ( mul-Group G g' g) + ( ( ( ap + ( mul-Group' H h) + ( preserves-mul-hom-Group G H f g' g)) ∙ + ( ( associative-mul-Group H + ( map-hom-Group G H f g') + ( map-hom-Group G H f g) + ( h)) ∙ + ( ( ap (mul-Group H (map-hom-Group G H f g')) p) ∙ + ( p')))) , + ( ( preserves-mul-Abstract-Group-Action G X g' g x) ∙ + ( ap (mul-Abstract-Group-Action G X g') q ∙ q'))))) set-left-adjoint-subst-Abstract-Group-Action : {l3 : Level} → Abstract-Group-Action G l3 → diff --git a/src/group-theory/trivial-groups.lagda.md b/src/group-theory/trivial-groups.lagda.md new file mode 100644 index 0000000000..66840434a0 --- /dev/null +++ b/src/group-theory/trivial-groups.lagda.md @@ -0,0 +1,72 @@ +# Trivial groups + +```agda +module group-theory.trivial-groups where +``` + +
Imports + +```agda +open import foundation.contractible-types +open import foundation.dependent-pair-types +open import foundation.identity-types +open import foundation.propositions +open import foundation.universe-levels + +open import group-theory.groups +open import group-theory.subgroups +open import group-theory.trivial-subgroups +``` + +
+ +## Idea + +A [group](group-theory.groups.md) is said to be **trivial** if its underlying +type is [contractible](foundation-core.contractible-types.md). In other words, a +group is trivial if it consists only of the unit element. + +## Definitions + +### The predicate of being a trivial group + +```agda +module _ + {l1 : Level} (G : Group l1) + where + + is-trivial-prop-Group : Prop l1 + is-trivial-prop-Group = is-contr-Prop (type-Group G) + + is-trivial-Group : UU l1 + is-trivial-Group = type-Prop is-trivial-prop-Group + + is-prop-is-trivial-Group : is-prop is-trivial-Group + is-prop-is-trivial-Group = is-prop-type-Prop is-trivial-prop-Group +``` + +## Properties + +### The type of subgroups of a trivial group is contractible + +```agda +module _ + {l1 : Level} (G : Group l1) + where + + is-contr-subgroup-is-trivial-Group : + is-trivial-Group G → is-contr (Subgroup l1 G) + pr1 (is-contr-subgroup-is-trivial-Group H) = + trivial-Subgroup G + pr2 (is-contr-subgroup-is-trivial-Group H) K = + eq-has-same-elements-Subgroup G + ( trivial-Subgroup G) + ( K) + ( λ x → + ( λ where refl → contains-unit-Subgroup G K) , + ( λ _ → + is-closed-under-eq-Subgroup G + ( trivial-Subgroup G) + ( contains-unit-Subgroup G (trivial-Subgroup G)) + ( eq-is-contr H))) +``` diff --git a/src/linear-algebra/vectors.lagda.md b/src/linear-algebra/vectors.lagda.md index ae492a1cef..0796b8c8a3 100644 --- a/src/linear-algebra/vectors.lagda.md +++ b/src/linear-algebra/vectors.lagda.md @@ -235,11 +235,12 @@ module _ is-retraction-functional-vec-vec zero-ℕ v = eq-htpy (λ ()) is-retraction-functional-vec-vec (succ-ℕ n) v = eq-htpy - ( λ { ( inl x) → - htpy-eq - ( is-retraction-functional-vec-vec n (tail-functional-vec n v)) - ( x) ; - ( inr star) → refl}) + ( λ where + ( inl x) → + htpy-eq + ( is-retraction-functional-vec-vec n (tail-functional-vec n v)) + ( x) + ( inr star) → refl) is-equiv-listed-vec-functional-vec : (n : ℕ) → is-equiv (listed-vec-functional-vec n) diff --git a/src/order-theory/decidable-total-preorders.lagda.md b/src/order-theory/decidable-total-preorders.lagda.md index 490c5e1931..4671f7d26c 100644 --- a/src/order-theory/decidable-total-preorders.lagda.md +++ b/src/order-theory/decidable-total-preorders.lagda.md @@ -125,14 +125,14 @@ module _ inl p helper-is-leq-or-strict-greater-Decidable-Total-Preorder x y (inr p) = inr - ( ( λ {refl → p (refl-leq-Decidable-Total-Preorder x)}) , + ( ( λ where refl → p (refl-leq-Decidable-Total-Preorder x)) , ( apply-universal-property-trunc-Prop ( is-total-Decidable-Total-Preorder y x) ( leq-Decidable-Total-Preorder-Prop y x) ( ind-coprod ( λ _ → leq-Decidable-Total-Preorder y x) ( id) - ( λ q → ex-falso (p q))))) + ( ex-falso ∘ p)))) is-leq-or-strict-greater-Decidable-Total-Preorder : (x y : type-Decidable-Total-Preorder) → diff --git a/src/order-theory/posets.lagda.md b/src/order-theory/posets.lagda.md index 2123e07862..0c945aee5c 100644 --- a/src/order-theory/posets.lagda.md +++ b/src/order-theory/posets.lagda.md @@ -93,7 +93,7 @@ module _ ( λ x y → leq-Poset x y × leq-Poset y x) ( λ x y → is-prop-prod (is-prop-leq-Poset x y) (is-prop-leq-Poset y x)) ( λ x → refl-leq-Poset x , refl-leq-Poset x) - ( λ {x y (H , K) → antisymmetric-leq-Poset x y H K}) + ( λ x y (H , K) → antisymmetric-leq-Poset x y H K) set-Poset : Set l1 pr1 set-Poset = type-Poset diff --git a/src/organic-chemistry/methane.lagda.md b/src/organic-chemistry/methane.lagda.md index ebe63254e6..2c85ac927e 100644 --- a/src/organic-chemistry/methane.lagda.md +++ b/src/organic-chemistry/methane.lagda.md @@ -51,7 +51,7 @@ module _ ( inv ( compute-number-of-elements-is-finite count-empty is-finite-empty)) ( star)) , - ( λ {star star → unit-trunc-Prop refl-walk-Undirected-Graph}) + ( λ where star star → unit-trunc-Prop refl-walk-Undirected-Graph) is-alkane-methane : is-alkane-hydrocarbon methane is-alkane-methane c c' e e' = is-prop-empty e e' diff --git a/src/reflection/group-solver.lagda.md b/src/reflection/group-solver.lagda.md index 9893269ff5..9b2ca9c4d9 100644 --- a/src/reflection/group-solver.lagda.md +++ b/src/reflection/group-solver.lagda.md @@ -45,7 +45,7 @@ finEq zero-Fin (succ-Fin b) = inr (λ ()) finEq (succ-Fin a) zero-Fin = inr (λ ()) finEq (succ-Fin a) (succ-Fin b) with finEq a b ... | inl eq = inl (ap succ-Fin eq) -... | inr neq = inr (λ { refl → neq refl}) +... | inr neq = inr (λ where refl → neq refl) getVec : ∀ {n} {l} {A : UU l} → vec A n → Fin n → A getVec (x ∷ v) zero-Fin = x diff --git a/src/ring-theory/cyclic-rings.lagda.md b/src/ring-theory/cyclic-rings.lagda.md index a9824d826b..623881891c 100644 --- a/src/ring-theory/cyclic-rings.lagda.md +++ b/src/ring-theory/cyclic-rings.lagda.md @@ -341,36 +341,35 @@ module _ ( mul-Cyclic-Ring R g x)) ( trunc-Prop ( fiber (map-initial-hom-Ring (ring-Cyclic-Ring R)) x)) - ( λ { (n , p) (k , q) → - unit-trunc-Prop - ( ( k) , - ( equational-reasoning - integer-multiple-Cyclic-Ring R k - ( one-Cyclic-Ring R) - = integer-multiple-Cyclic-Ring R k - ( integer-multiple-Cyclic-Ring R n g) - by - ap - ( integer-multiple-Cyclic-Ring R k) - ( inv p) - = integer-multiple-Cyclic-Ring R n - ( integer-multiple-Cyclic-Ring R k g) - by - swap-integer-multiple-Cyclic-Ring R k n g - = integer-multiple-Cyclic-Ring R n - ( mul-Cyclic-Ring R g x) - by - ap (integer-multiple-Cyclic-Ring R n) q - = mul-Cyclic-Ring R - ( integer-multiple-Cyclic-Ring R n g) - ( x) - by - inv - ( left-integer-multiple-law-mul-Cyclic-Ring R n g x) - = mul-Cyclic-Ring R (one-Cyclic-Ring R) x - by ap (mul-Cyclic-Ring' R x) p - = x - by left-unit-law-mul-Cyclic-Ring R x))})) + ( λ (n , p) (k , q) → + unit-trunc-Prop + ( ( k) , + ( equational-reasoning + integer-multiple-Cyclic-Ring R k + ( one-Cyclic-Ring R) + = integer-multiple-Cyclic-Ring R k + ( integer-multiple-Cyclic-Ring R n g) + by + ap + ( integer-multiple-Cyclic-Ring R k) + ( inv p) + = integer-multiple-Cyclic-Ring R n + ( integer-multiple-Cyclic-Ring R k g) + by + swap-integer-multiple-Cyclic-Ring R k n g + = integer-multiple-Cyclic-Ring R n + ( mul-Cyclic-Ring R g x) + by + ap (integer-multiple-Cyclic-Ring R n) q + = mul-Cyclic-Ring R + ( integer-multiple-Cyclic-Ring R n g) + ( x) + by + inv (left-integer-multiple-law-mul-Cyclic-Ring R n g x) + = mul-Cyclic-Ring R (one-Cyclic-Ring R) x + by ap (mul-Cyclic-Ring' R x) p + = x + by left-unit-law-mul-Cyclic-Ring R x)))) abstract is-generating-element-one-Cyclic-Ring : @@ -482,8 +481,9 @@ module _ ( is-surjective-initial-hom-Cyclic-Ring R x) ( is-surjective-initial-hom-Cyclic-Ring R y) ( Id-Prop (set-Cyclic-Ring R) _ _) - ( λ { (n , refl) (m , refl) → - commute-integer-multiples-diagonal-Ring (ring-Cyclic-Ring R) n m}) + ( λ where + (n , refl) (m , refl) → + commute-integer-multiples-diagonal-Ring (ring-Cyclic-Ring R) n m) commutative-ring-Cyclic-Ring : Commutative-Ring l pr1 commutative-ring-Cyclic-Ring = ring-Cyclic-Ring R diff --git a/src/ring-theory/homomorphisms-cyclic-rings.lagda.md b/src/ring-theory/homomorphisms-cyclic-rings.lagda.md index 01cb073ae0..1869391bb6 100644 --- a/src/ring-theory/homomorphisms-cyclic-rings.lagda.md +++ b/src/ring-theory/homomorphisms-cyclic-rings.lagda.md @@ -114,27 +114,28 @@ module _ ( set-Ring S) ( map-hom-Ring (ring-Cyclic-Ring R) S f x) ( map-hom-Ring (ring-Cyclic-Ring R) S g x)) - ( λ { (n , refl) → + ( λ where + (n , refl) → + ( preserves-integer-multiples-hom-Ring + ( ring-Cyclic-Ring R) + ( S) + ( f) + ( n) + ( one-Cyclic-Ring R)) ∙ + ( ap + ( integer-multiple-Ring S n) + ( preserves-one-hom-Ring (ring-Cyclic-Ring R) S f)) ∙ + ( inv + ( ap + ( integer-multiple-Ring S n) + ( preserves-one-hom-Ring (ring-Cyclic-Ring R) S g))) ∙ + ( inv ( preserves-integer-multiples-hom-Ring ( ring-Cyclic-Ring R) ( S) - ( f) + ( g) ( n) - ( one-Cyclic-Ring R)) ∙ - ( ap - ( integer-multiple-Ring S n) - ( preserves-one-hom-Ring (ring-Cyclic-Ring R) S f)) ∙ - ( inv - ( ap - ( integer-multiple-Ring S n) - ( preserves-one-hom-Ring (ring-Cyclic-Ring R) S g))) ∙ - ( inv - ( preserves-integer-multiples-hom-Ring - ( ring-Cyclic-Ring R) - ( S) - ( g) - ( n) - ( one-Cyclic-Ring R)))}) + ( one-Cyclic-Ring R)))) all-elements-equal-hom-Cyclic-Ring-Ring : all-elements-equal (hom-Ring (ring-Cyclic-Ring R) S) diff --git a/src/ring-theory/ideals-generated-by-subsets-rings.lagda.md b/src/ring-theory/ideals-generated-by-subsets-rings.lagda.md index ed5a44efae..721476e3d6 100644 --- a/src/ring-theory/ideals-generated-by-subsets-rings.lagda.md +++ b/src/ring-theory/ideals-generated-by-subsets-rings.lagda.md @@ -531,7 +531,7 @@ module _ ( λ x p → apply-universal-property-trunc-Prop p ( subset-ideal-Ring R J x) - ( λ { (i , refl) → H})) + ( λ where (i , refl) → H)) ``` ## Properties @@ -563,8 +563,8 @@ module _ forward-inclusion-idempotent-ideal-subset-Ring x H = apply-universal-property-trunc-Prop H ( subset-ideal-Ring R I x) - ( λ { (l , refl) → - cases-forward-inclusion-idempotent-ideal-subset-Ring l}) + ( λ where + (l , refl) → cases-forward-inclusion-idempotent-ideal-subset-Ring l) backward-inclusion-idempotent-ideal-subset-Ring : leq-ideal-Ring R diff --git a/src/ring-theory/left-ideals-generated-by-subsets-rings.lagda.md b/src/ring-theory/left-ideals-generated-by-subsets-rings.lagda.md index 5a23030247..224578a085 100644 --- a/src/ring-theory/left-ideals-generated-by-subsets-rings.lagda.md +++ b/src/ring-theory/left-ideals-generated-by-subsets-rings.lagda.md @@ -497,7 +497,7 @@ module _ ( λ x p → apply-universal-property-trunc-Prop p ( subset-left-ideal-Ring R J x) - ( λ { (i , refl) → H i})) + ( λ where (i , refl) → H i)) ``` ## Properties @@ -528,8 +528,9 @@ module _ forward-inclusion-idempotent-left-ideal-subset-Ring x H = apply-universal-property-trunc-Prop H ( subset-left-ideal-Ring R I x) - ( λ { (l , refl) → - cases-forward-inclusion-idempotent-left-ideal-subset-Ring l}) + ( λ where + (l , refl) → + cases-forward-inclusion-idempotent-left-ideal-subset-Ring l) backward-inclusion-idempotent-left-ideal-subset-Ring : leq-left-ideal-Ring R diff --git a/src/ring-theory/products-subsets-rings.lagda.md b/src/ring-theory/products-subsets-rings.lagda.md index 8afbf82847..78d71b324e 100644 --- a/src/ring-theory/products-subsets-rings.lagda.md +++ b/src/ring-theory/products-subsets-rings.lagda.md @@ -59,12 +59,13 @@ module _ forward-inclusion-distributive-product-union-family-of-subsets-Ring x p = apply-universal-property-trunc-Prop p ( union-family-of-subtypes (λ i → product-subset-Ring A S (T i)) x) - ( λ { ((s , Hs) , (t , Ht) , refl) → - apply-universal-property-trunc-Prop Ht - ( union-family-of-subtypes (λ i → product-subset-Ring A S (T i)) x) - ( λ (i , Ht') → - unit-trunc-Prop - ( i , unit-trunc-Prop ((s , Hs) , (t , Ht') , refl)))}) + ( λ where + ((s , Hs) , (t , Ht) , refl) → + apply-universal-property-trunc-Prop Ht + ( union-family-of-subtypes (λ i → product-subset-Ring A S (T i)) x) + ( λ (i , Ht') → + unit-trunc-Prop + ( i , unit-trunc-Prop ((s , Hs) , (t , Ht') , refl)))) backward-inclusion-distributive-product-union-family-of-subsets-Ring : union-family-of-subtypes (λ i → product-subset-Ring A S (T i)) ⊆ @@ -75,9 +76,10 @@ module _ ( λ (i , u) → apply-universal-property-trunc-Prop u ( product-subset-Ring A S (union-family-of-subtypes T) x) - ( λ {((s , Hs) , (t , Ht) , refl) → - unit-trunc-Prop - ( (s , Hs) , (t , unit-trunc-Prop (i , Ht)) , refl)})) + ( λ where + ((s , Hs) , (t , Ht) , refl) → + unit-trunc-Prop + ( (s , Hs) , (t , unit-trunc-Prop (i , Ht)) , refl))) distributive-product-union-family-of-subsets-Ring : product-subset-Ring A S (union-family-of-subtypes T) = @@ -112,18 +114,19 @@ module _ ( product-subset-Ring A R ( product-subset-Ring A S T) ( x)) - ( λ { ((u , K) , (t , Ht) , refl) → - apply-universal-property-trunc-Prop K - ( product-subset-Ring A R - ( product-subset-Ring A S T) - ( _)) - ( λ { ((r , Hr) , (s , Hs) , refl) → - unit-trunc-Prop - ( ( r , Hr) , - ( mul-Ring A s t , - unit-trunc-Prop - ( (s , Hs) , (t , Ht) , refl)) , - ( associative-mul-Ring A r s t))})}) + ( λ where + ( ( u , K) , (t , Ht) , refl) → + apply-universal-property-trunc-Prop K + ( product-subset-Ring A R + ( product-subset-Ring A S T) + ( _)) + ( λ where + ( ( r , Hr) , (s , Hs) , refl) → + unit-trunc-Prop + ( ( r , Hr) , + ( ( mul-Ring A s t) , + ( unit-trunc-Prop ((s , Hs) , (t , Ht) , refl))) , + ( associative-mul-Ring A r s t)))) backward-inclusion-associative-product-subset-Ring : ( product-subset-Ring A @@ -138,19 +141,20 @@ module _ ( product-subset-Ring A R S) ( T) ( x)) - ( λ { ((r , Hr) , (v , K) , refl) → - apply-universal-property-trunc-Prop K - ( product-subset-Ring A - ( product-subset-Ring A R S) - ( T) - ( _)) - ( λ { ((s , Hs) , (t , Ht) , refl) → - unit-trunc-Prop - ( ( mul-Ring A r s , - unit-trunc-Prop - ( (r , Hr) , (s , Hs) , refl)) , - ( t , Ht) , - ( inv (associative-mul-Ring A r s t)))})}) + ( λ where + ( ( r , Hr) , (v , K) , refl) → + apply-universal-property-trunc-Prop K + ( product-subset-Ring A + ( product-subset-Ring A R S) + ( T) + ( _)) + ( λ where + ((s , Hs) , (t , Ht) , refl) → + unit-trunc-Prop + ( ( ( mul-Ring A r s) , + ( unit-trunc-Prop ((r , Hr) , (s , Hs) , refl))) , + ( t , Ht) , + ( inv (associative-mul-Ring A r s t))))) associative-product-subset-Ring : product-subset-Ring A diff --git a/src/ring-theory/right-ideals-generated-by-subsets-rings.lagda.md b/src/ring-theory/right-ideals-generated-by-subsets-rings.lagda.md index 1bd74b6b2b..ce19de9531 100644 --- a/src/ring-theory/right-ideals-generated-by-subsets-rings.lagda.md +++ b/src/ring-theory/right-ideals-generated-by-subsets-rings.lagda.md @@ -496,7 +496,7 @@ module _ ( λ x p → apply-universal-property-trunc-Prop p ( subset-right-ideal-Ring R J x) - ( λ { (i , refl) → H i})) + ( λ where (i , refl) → H i)) ``` ## Properties @@ -528,8 +528,9 @@ module _ forward-inclusion-idempotent-right-ideal-subset-Ring x H = apply-universal-property-trunc-Prop H ( subset-right-ideal-Ring R I x) - ( λ { (l , refl) → - cases-forward-inclusion-idempotent-right-ideal-subset-Ring l}) + ( λ where + (l , refl) → + cases-forward-inclusion-idempotent-right-ideal-subset-Ring l) backward-inclusion-idempotent-right-ideal-subset-Ring : leq-right-ideal-Ring R diff --git a/src/set-theory/countable-sets.lagda.md b/src/set-theory/countable-sets.lagda.md index 38b116dc60..bcb86e04f7 100644 --- a/src/set-theory/countable-sets.lagda.md +++ b/src/set-theory/countable-sets.lagda.md @@ -150,18 +150,17 @@ module _ ( is-countable-Prop X) ( λ P → unit-trunc-Prop - ( pair - ( λ { - zero-ℕ → inr star ; - (succ-ℕ n) → inl ((shift-ℕ a (pr1 P)) n)}) - ( λ { + ( ( λ where + zero-ℕ → inr star + (succ-ℕ n) → inl ((shift-ℕ a (pr1 P)) n)) , + ( λ where (inl x) → apply-universal-property-trunc-Prop (pr2 P x) ( trunc-Prop (fiber _ (inl x))) - ( λ { (pair n p) → + ( λ (n , p) → unit-trunc-Prop - ( pair (succ-ℕ (succ-ℕ n)) (ap inl p))}) ; - (inr star) → unit-trunc-Prop (pair zero-ℕ refl)}))) + ( succ-ℕ (succ-ℕ n) , ap inl p)) + (inr star) → unit-trunc-Prop (zero-ℕ , refl)))) ``` ## Properties @@ -177,37 +176,33 @@ module _ decidable-subprojection-ℕ-enumeration : enumeration X → decidable-subprojection-ℕ X - decidable-subprojection-ℕ-enumeration (f , H) = - pair - ( λ n → - ( ¬ ((f n) = (inr star))) , - ( ( is-prop-neg) , - ( is-decidable-is-not-exception-Maybe (f n)))) - ( pair - ( λ {(n , p) → value-is-not-exception-Maybe (f n) p}) - ( λ x → - ( apply-universal-property-trunc-Prop (H (inl x)) - ( trunc-Prop (fiber _ x)) - ( λ (n , p) → - ( unit-trunc-Prop - ( pair - ( pair n - ( is-not-exception-is-value-Maybe - ( f n) (x , inv p))) - ( is-injective-inl - ( ( eq-is-not-exception-Maybe - ( f n) - ( is-not-exception-is-value-Maybe - ( f n) (x , inv p))) ∙ - ( p))))))))) + pr1 (pr1 (decidable-subprojection-ℕ-enumeration (f , H)) n) = + ¬ ((f n) = (inr star)) + pr1 (pr2 (pr1 (decidable-subprojection-ℕ-enumeration (f , H)) n)) = + is-prop-neg + pr2 (pr2 (pr1 (decidable-subprojection-ℕ-enumeration (f , H)) n)) = + is-decidable-is-not-exception-Maybe (f n) + pr1 (pr2 (decidable-subprojection-ℕ-enumeration (f , H))) (n , p) = + value-is-not-exception-Maybe (f n) p + pr2 (pr2 (decidable-subprojection-ℕ-enumeration (f , H))) x = + apply-universal-property-trunc-Prop (H (inl x)) + ( trunc-Prop (fiber _ x)) + ( λ (n , p) → + unit-trunc-Prop + ( ( n , is-not-exception-is-value-Maybe (f n) (x , inv p)) , + ( is-injective-inl + ( ( eq-is-not-exception-Maybe + ( f n) + ( is-not-exception-is-value-Maybe + ( f n) (x , inv p))) ∙ + ( p))))) is-countable'-is-countable : is-countable X → is-countable' X is-countable'-is-countable H = apply-universal-property-trunc-Prop H ( is-countable-Prop' X) - ( λ E → - ( unit-trunc-Prop (decidable-subprojection-ℕ-enumeration E))) + ( λ E → unit-trunc-Prop (decidable-subprojection-ℕ-enumeration E)) ``` Second, we will prove `is-countable' X → is-countable X`. @@ -253,19 +248,20 @@ module _ ( is-surjective map-enumeration-decidable-subprojection-ℕ) is-surjective-map-enumeration-decidable-subprojection-ℕ H (inl x) = ( apply-universal-property-trunc-Prop (H x) - (trunc-Prop (fiber map-enumeration-decidable-subprojection-ℕ (inl x))) - ( λ { ((n , s) , refl) → - ( unit-trunc-Prop - ( succ-ℕ n , - ( ap - ( cases-map-decidable-subtype-ℕ X - ( shift-decidable-subtype-ℕ) - ( map-shift-decidable-subtype-ℕ) - (succ-ℕ n)) - ( pr1 - ( is-prop-is-decidable (pr1 (pr2 (P n))) - ( pr2 (pr2 (P n))) - ( inl s))))))})) + ( trunc-Prop (fiber map-enumeration-decidable-subprojection-ℕ (inl x))) + ( λ where + ( ( n , s) , refl) → + unit-trunc-Prop + ( ( succ-ℕ n) , + ( ap + ( cases-map-decidable-subtype-ℕ X + ( shift-decidable-subtype-ℕ) + ( map-shift-decidable-subtype-ℕ) + (succ-ℕ n)) + ( pr1 + ( is-prop-is-decidable (pr1 (pr2 (P n))) + ( pr2 (pr2 (P n))) + ( inl s))))))) is-surjective-map-enumeration-decidable-subprojection-ℕ H (inr star) = ( unit-trunc-Prop (0 , refl)) @@ -340,11 +336,12 @@ The set of natural numbers ℕ is itself countable. is-countable-ℕ : is-countable ℕ-Set is-countable-ℕ = unit-trunc-Prop - ( pair - ( λ { zero-ℕ → inr star ; (succ-ℕ n) → inl n}) - ( λ { - (inl n) → unit-trunc-Prop (pair (succ-ℕ n) refl) ; - (inr star) → unit-trunc-Prop (pair zero-ℕ refl)})) + ( ( λ where + zero-ℕ → inr star + (succ-ℕ n) → inl n) , + ( λ where + (inl n) → unit-trunc-Prop (succ-ℕ n , refl) + (inr star) → unit-trunc-Prop (zero-ℕ , refl))) ``` The empty set is countable. @@ -352,10 +349,9 @@ The empty set is countable. ```agda is-countable-empty : is-countable empty-Set is-countable-empty = - is-countable-is-countable' empty-Set - (unit-trunc-Prop - ( ( λ x → empty-Decidable-Prop) , - ( λ {()}) , λ {()})) + is-countable-is-countable' + ( empty-Set) + ( unit-trunc-Prop ((λ _ → empty-Decidable-Prop) , (λ ()) , (λ ()))) ``` The unit set is countable. @@ -364,10 +360,12 @@ The unit set is countable. is-countable-unit : is-countable unit-Set is-countable-unit = unit-trunc-Prop - ( ( λ { zero-ℕ → inl star ; (succ-ℕ x) → inr star}) , - ( λ { - ( inl star) → unit-trunc-Prop (0 , refl) ; - ( inr star) → unit-trunc-Prop (1 , refl)})) + ( ( λ where + zero-ℕ → inl star + (succ-ℕ x) → inr star) , + ( λ where + ( inl star) → unit-trunc-Prop (0 , refl) + ( inr star) → unit-trunc-Prop (1 , refl))) ``` If `X` and `Y` are countable sets, then so is their coproduct `X + Y`. diff --git a/src/set-theory/cumulative-hierarchy.lagda.md b/src/set-theory/cumulative-hierarchy.lagda.md index 6ce0932a89..505150de9e 100644 --- a/src/set-theory/cumulative-hierarchy.lagda.md +++ b/src/set-theory/cumulative-hierarchy.lagda.md @@ -633,13 +633,15 @@ needed. pair ( λ H → map-universal-property-trunc-Prop ( trunc-Prop ((v = x) + (v = y))) - ( λ { ( map-raise true , p) → unit-trunc-Prop (inl (inv p)) ; - ( map-raise false , p) → unit-trunc-Prop (inr (inv p))}) + ( λ where + ( map-raise true , p) → unit-trunc-Prop (inl (inv p)) + ( map-raise false , p) → unit-trunc-Prop (inr (inv p))) ( ∈-cumulative-hierarchy-mere-preimage H)) ( λ H → mere-preimage-∈-cumulative-hierarchy ( map-trunc-Prop - ( λ { ( inl p) → (map-raise true , inv p) ; - ( inr p) → (map-raise false , inv p)}) + ( λ where + ( inl p) → (map-raise true , inv p) + ( inr p) → (map-raise false , inv p)) ( H))) ``` @@ -685,8 +687,7 @@ needed. ( λ x H → mere-preimage-∈-cumulative-hierarchy ( map-trunc-Prop - ( λ {((map-raise n) , refl) → - map-raise (succ-ℕ n) , refl}) + ( λ where ((map-raise n) , refl) → (map-raise (succ-ℕ n) , refl)) ( ∈-cumulative-hierarchy-mere-preimage H))) ``` @@ -729,29 +730,31 @@ needed. replacement-cumulative-hierarchy x r = map-universal-property-trunc-Prop ( ∃-Prop (type-pseudo-cumulative-hierarchy V) _) - ( λ {(A , f , refl) → - unit-trunc-Prop - ( pair - ( set-pseudo-cumulative-hierarchy V (r ∘ f)) - ( λ y → - ( pair - ( λ H → - map-trunc-Prop - ( λ {(a , refl) → - pair (f a) - ( pair + ( λ where + (A , f , refl) → + unit-trunc-Prop + ( ( set-pseudo-cumulative-hierarchy V (r ∘ f)) , + ( λ y → + ( pair + ( λ H → + map-trunc-Prop + ( λ where + (a , refl) → + (f a) , ( mere-preimage-∈-cumulative-hierarchy - ( unit-trunc-Prop (a , refl))) - ( refl))}) - ( ∈-cumulative-hierarchy-mere-preimage H)) - ( λ H → mere-preimage-∈-cumulative-hierarchy - ( map-universal-property-trunc-Prop - ( ∃-Prop A _) - ( λ {(z , K , refl) → - ( map-trunc-Prop - ( λ {(a , refl) → (a , refl)}) - ( ∈-cumulative-hierarchy-mere-preimage K))}) - ( H))))))}) + ( unit-trunc-Prop (a , refl))) , + ( refl)) + ( ∈-cumulative-hierarchy-mere-preimage H)) + ( λ H → + mere-preimage-∈-cumulative-hierarchy + ( map-universal-property-trunc-Prop + ( ∃-Prop A _) + ( λ where + (z , K , refl) → + map-trunc-Prop + ( λ where (a , refl) → (a , refl)) + ( ∈-cumulative-hierarchy-mere-preimage K)) + ( H))))))) ( underlying-function-cumulative-hierarchy x) ``` diff --git a/src/synthetic-homotopy-theory/coforks.lagda.md b/src/synthetic-homotopy-theory/coforks.lagda.md index e0d242d305..7031abd3a1 100644 --- a/src/synthetic-homotopy-theory/coforks.lagda.md +++ b/src/synthetic-homotopy-theory/coforks.lagda.md @@ -276,7 +276,7 @@ module _ ( c))) ·r ( inl)) , ( refl-htpy) , - ( λ { + ( λ where (inl a) → inv ( left-inv @@ -284,8 +284,8 @@ module _ ( codiagonal A) ( ind-coprod (λ _ → B) f g) ( c) - ( inl a))) ; - (inr a) → right-unit})) + ( inl a))) + (inr a) → right-unit)) is-equiv-cofork-cocone-codiagonal : is-equiv cofork-cocone-codiagonal diff --git a/src/synthetic-homotopy-theory/connected-set-bundles-circle.lagda.md b/src/synthetic-homotopy-theory/connected-set-bundles-circle.lagda.md index ffbf692036..3ca2085826 100644 --- a/src/synthetic-homotopy-theory/connected-set-bundles-circle.lagda.md +++ b/src/synthetic-homotopy-theory/connected-set-bundles-circle.lagda.md @@ -106,7 +106,7 @@ module _ apply-universal-property-trunc-Prop ( mere-eq-𝕊¹ base-𝕊¹ t) ( trunc-Prop type-connected-set-bundle-𝕊¹) - ( λ { refl → unit-trunc-Prop x})) + ( λ where refl → unit-trunc-Prop x)) inhabited-type-connected-set-bundle-𝕊¹ : Inhabited-Type l pr1 inhabited-type-connected-set-bundle-𝕊¹ = diff --git a/src/synthetic-homotopy-theory/dependent-coforks.lagda.md b/src/synthetic-homotopy-theory/dependent-coforks.lagda.md index 6dbe72ff61..dd54d150a4 100644 --- a/src/synthetic-homotopy-theory/dependent-coforks.lagda.md +++ b/src/synthetic-homotopy-theory/dependent-coforks.lagda.md @@ -350,7 +350,7 @@ module _ ( inl)) , ( refl-htpy) , ( right-unit-htpy ∙h - ( λ { + ( λ where (inl a) → inv ( ( ap @@ -378,7 +378,7 @@ module _ ( cocone-codiagonal-cofork f g e) ( P) ( d) - ( inl a)))) ; + ( inl a)))) (inr a) → ap ( _∙ @@ -398,7 +398,7 @@ module _ ( cocone-codiagonal-cofork f g e) ( P) ( d) - ( inl a))))}))) + ( inl a))))))) is-equiv-dependent-cofork-dependent-cocone-codiagonal : is-equiv dependent-cofork-dependent-cocone-codiagonal diff --git a/src/trees/directed-trees.lagda.md b/src/trees/directed-trees.lagda.md index 629fb4c5bb..8df4c851c0 100644 --- a/src/trees/directed-trees.lagda.md +++ b/src/trees/directed-trees.lagda.md @@ -262,14 +262,15 @@ module _ is-decidable-is-root-walk-Directed-Tree x ( cons-walk-Directed-Graph {.x} {y} e w) = inr - ( λ { refl → - neq-cons-refl-walk-Directed-Graph - ( graph-Directed-Tree T) - ( x) - ( y) - ( e) - ( w) - ( eq-is-contr (unique-walk-to-root-Directed-Tree T x))}) + ( λ where + refl → + neq-cons-refl-walk-Directed-Graph + ( graph-Directed-Tree T) + ( x) + ( y) + ( e) + ( w) + ( eq-is-contr (unique-walk-to-root-Directed-Tree T x))) is-isolated-root-Directed-Tree : is-isolated (root-Directed-Tree T) is-isolated-root-Directed-Tree x = @@ -595,7 +596,7 @@ module _ is-proof-irrelevant (Σ (node-Directed-Tree T) (edge-Directed-Tree T x)) is-proof-irrelevant-direct-successor-Directed-Tree x (y , e) = unique-direct-successor-is-proper-node-Directed-Tree x - ( λ { refl → no-direct-successor-root-Directed-Tree T (y , e)}) + ( λ where refl → no-direct-successor-root-Directed-Tree T (y , e)) is-prop-direct-successor-Directed-Tree : (x : node-Directed-Tree T) → diff --git a/src/univalent-combinatorics/counting-decidable-subtypes.lagda.md b/src/univalent-combinatorics/counting-decidable-subtypes.lagda.md index 113a923e90..967d254a1a 100644 --- a/src/univalent-combinatorics/counting-decidable-subtypes.lagda.md +++ b/src/univalent-combinatorics/counting-decidable-subtypes.lagda.md @@ -97,7 +97,7 @@ count-decidable-subtype' P (succ-ℕ k) e ( λ x → is-in-decidable-subtype P (map-equiv e (inl x)))) ( Σ ( unit) ( λ x → is-in-decidable-subtype P (map-equiv e (inr x)))) - ( λ { (pair star p) → f p})) + ( λ where (star , p) → f p)) ( count-decidable-subtype' ( λ x → P (map-equiv e (inl x))) ( k) diff --git a/src/univalent-combinatorics/cyclic-types.lagda.md b/src/univalent-combinatorics/cyclic-types.lagda.md index f5c1d2adca..404963d5fe 100644 --- a/src/univalent-combinatorics/cyclic-types.lagda.md +++ b/src/univalent-combinatorics/cyclic-types.lagda.md @@ -474,11 +474,12 @@ is-equiv-Eq-equiv-Cyclic-Type k X = apply-universal-property-trunc-Prop ( mere-eq-Cyclic-Type k (ℤ-Mod-Cyclic-Type k) X) ( is-equiv-Prop (Eq-equiv-Cyclic-Type k X)) - ( λ { refl → - is-equiv-is-invertible - ( equiv-Eq-Cyclic-Type k) - ( is-section-equiv-Eq-Cyclic-Type k) - ( is-retraction-equiv-Eq-Cyclic-Type k)}) + ( λ where + refl → + is-equiv-is-invertible + ( equiv-Eq-Cyclic-Type k) + ( is-section-equiv-Eq-Cyclic-Type k) + ( is-retraction-equiv-Eq-Cyclic-Type k)) equiv-compute-Ω-Cyclic-Type : (k : ℕ) → type-Ω (pair (Cyclic-Type lzero k) (ℤ-Mod-Cyclic-Type k)) ≃ ℤ-Mod k diff --git a/src/univalent-combinatorics/finitely-presented-types.lagda.md b/src/univalent-combinatorics/finitely-presented-types.lagda.md index 10aa729402..f5963031c2 100644 --- a/src/univalent-combinatorics/finitely-presented-types.lagda.md +++ b/src/univalent-combinatorics/finitely-presented-types.lagda.md @@ -92,7 +92,7 @@ has-cardinality-components-has-presentation-of-cardinality : has-cardinality-components-has-presentation-of-cardinality {l} k {A} H = apply-universal-property-trunc-Prop H ( has-cardinality-components-Prop k A) - ( λ { (pair f E) → unit-trunc-Prop (pair (unit-trunc-Set ∘ f) E)}) + ( λ (f , E) → unit-trunc-Prop (unit-trunc-Set ∘ f , E)) ``` ### To be finitely presented is a property diff --git a/src/univalent-combinatorics/pi-finite-types.lagda.md b/src/univalent-combinatorics/pi-finite-types.lagda.md index 0b666650bd..5cdc3a0474 100644 --- a/src/univalent-combinatorics/pi-finite-types.lagda.md +++ b/src/univalent-combinatorics/pi-finite-types.lagda.md @@ -368,7 +368,7 @@ pr2 (Fin-π-Finite k n) = is-π-finite-Fin k n ```agda is-π-finite-count : {l : Level} (k : ℕ) {A : UU l} → count A → is-π-finite k A -is-π-finite-count k (pair n e) = +is-π-finite-count k (n , e) = is-π-finite-equiv' k e (is-π-finite-Fin k n) ``` @@ -411,14 +411,14 @@ pr2 (is-π-finite-UU-Fin (succ-ℕ k) n) x y = ( equiv-equiv-eq-UU-Fin n x y) ( is-π-finite-is-finite k ( is-finite-≃ - ( is-finite-has-finite-cardinality (pair n (pr2 x))) - ( is-finite-has-finite-cardinality (pair n (pr2 y))))) + ( is-finite-has-finite-cardinality (n , (pr2 x))) + ( is-finite-has-finite-cardinality (n , (pr2 y))))) is-finite-has-finite-connected-components : {l : Level} {A : UU l} → is-set A → has-finite-connected-components A → is-finite A is-finite-has-finite-connected-components H = - is-finite-equiv' (equiv-unit-trunc-Set (pair _ H)) + is-finite-equiv' (equiv-unit-trunc-Set (_ , H)) has-finite-connected-components-is-π-finite : {l : Level} (k : ℕ) {A : UU l} → @@ -449,7 +449,7 @@ is-finite-is-π-finite : is-π-finite k A → is-finite A is-finite-is-π-finite k H K = is-finite-equiv' - ( equiv-unit-trunc-Set (pair _ H)) + ( equiv-unit-trunc-Set (_ , H)) ( has-finite-connected-components-is-π-finite k K) is-truncated-π-finite-is-π-finite : @@ -466,7 +466,7 @@ is-π-finite-is-truncated-π-finite : is-truncated-π-finite k A → is-π-finite k A is-π-finite-is-truncated-π-finite zero-ℕ H = is-finite-equiv - ( equiv-unit-trunc-Set (pair _ (is-set-is-finite H))) + ( equiv-unit-trunc-Set (_ , (is-set-is-finite H))) ( H) pr1 (is-π-finite-is-truncated-π-finite (succ-ℕ k) H) = pr1 H pr2 (is-π-finite-is-truncated-π-finite (succ-ℕ k) H) x y = @@ -504,7 +504,7 @@ is-locally-finite-Π-Fin {l1} (succ-ℕ k) {B} f = is-locally-finite-Π-count : {l1 l2 : Level} {A : UU l1} {B : A → UU l2} → count A → ((x : A) → is-locally-finite (B x)) → is-locally-finite ((x : A) → B x) -is-locally-finite-Π-count {l1} {l2} {A} {B} (pair k e) g = +is-locally-finite-Π-count {l1} {l2} {A} {B} (k , e) g = is-locally-finite-equiv ( equiv-precomp-Π e B) ( is-locally-finite-Π-Fin k (λ x → g (map-equiv e x))) @@ -553,9 +553,9 @@ is-locally-finite-Σ : {l1 l2 : Level} {A : UU l1} {B : A → UU l2} → is-locally-finite A → ((x : A) → is-locally-finite (B x)) → is-locally-finite (Σ A B) -is-locally-finite-Σ {B = B} H K (pair x y) (pair x' y') = +is-locally-finite-Σ {B = B} H K (x , y) (x' , y') = is-finite-equiv' - ( equiv-pair-eq-Σ (pair x y) (pair x' y')) + ( equiv-pair-eq-Σ (x , y) (x' , y')) ( is-finite-Σ (H x x') (λ p → K x' (tr B p y) y')) ``` @@ -590,37 +590,37 @@ has-finite-connected-components-Σ-is-0-connected {A = A} {B} C H K = where β : (x : Σ A B) (v : type-trunc-Set (Σ A B)) → is-decidable (Id (unit-trunc-Set x) v) - β (pair x y) = + β (x , y) = apply-dependent-universal-property-trunc-Set' ( λ u → set-Prop ( is-decidable-Prop - ( Id-Prop (trunc-Set (Σ A B)) (unit-trunc-Set (pair x y)) u))) + ( Id-Prop (trunc-Set (Σ A B)) (unit-trunc-Set (x , y)) u))) ( γ) where γ : (v : Σ A B) → - is-decidable (Id (unit-trunc-Set (pair x y)) (unit-trunc-Set v)) - γ (pair x' y') = + is-decidable (Id (unit-trunc-Set (x , y)) (unit-trunc-Set v)) + γ (x' , y') = is-decidable-equiv ( is-effective-unit-trunc-Set ( Σ A B) - ( pair x y) - ( pair x' y')) + ( x , y) + ( x' , y')) ( apply-universal-property-trunc-Prop ( mere-eq-is-0-connected C a x) ( is-decidable-Prop - ( mere-eq-Prop (pair x y) (pair x' y'))) + ( mere-eq-Prop (x , y) (x' , y'))) ( δ)) where - δ : Id a x → is-decidable (mere-eq (pair x y) (pair x' y')) + δ : Id a x → is-decidable (mere-eq (x , y) (x' , y')) δ refl = apply-universal-property-trunc-Prop ( mere-eq-is-0-connected C a x') ( is-decidable-Prop - ( mere-eq-Prop (pair a y) (pair x' y'))) + ( mere-eq-Prop (a , y) (x' , y'))) ( ε) where - ε : Id a x' → is-decidable (mere-eq (pair x y) (pair x' y')) + ε : Id a x' → is-decidable (mere-eq (x , y) (x' , y')) ε refl = is-decidable-equiv e ( is-decidable-type-trunc-Prop-is-finite @@ -658,38 +658,38 @@ has-finite-connected-components-Σ-is-0-connected {A = A} {B} C H K = ( unit-trunc-Set y')))) f : type-hom-Prop ( trunc-Prop (Σ (type-trunc-Set (Id a a)) (type-Prop ∘ P))) - ( mere-eq-Prop {A = Σ A B} (pair a y) (pair a y')) + ( mere-eq-Prop {A = Σ A B} (a , y) (a , y')) f t = apply-universal-property-trunc-Prop t - ( mere-eq-Prop (pair a y) (pair a y')) - λ { (pair u v) → - apply-dependent-universal-property-trunc-Set' - ( λ u' → - hom-Set - ( set-Prop (P u')) - ( set-Prop - ( mere-eq-Prop (pair a y) (pair a y')))) - ( λ ω v' → - apply-universal-property-trunc-Prop - ( map-equiv (compute-P ω) v') - ( mere-eq-Prop (pair a y) (pair a y')) - ( λ p → unit-trunc-Prop (eq-pair-Σ ω p))) - ( u) - ( v)} - e : mere-eq {A = Σ A B} (pair a y) (pair a y') ≃ + ( mere-eq-Prop (a , y) (a , y')) + λ (u , v) → + apply-dependent-universal-property-trunc-Set' + ( λ u' → + hom-Set + ( set-Prop (P u')) + ( set-Prop + ( mere-eq-Prop (a , y) (a , y')))) + ( λ ω v' → + apply-universal-property-trunc-Prop + ( map-equiv (compute-P ω) v') + ( mere-eq-Prop (a , y) (a , y')) + ( λ p → unit-trunc-Prop (eq-pair-Σ ω p))) + ( u) + ( v) + e : mere-eq {A = Σ A B} (a , y) (a , y') ≃ type-trunc-Prop (Σ (type-trunc-Set (Id a a)) (type-Prop ∘ P)) e = equiv-iff - ( mere-eq-Prop (pair a y) (pair a y')) + ( mere-eq-Prop (a , y) (a , y')) ( trunc-Prop (Σ (type-trunc-Set (Id a a)) (type-Prop ∘ P))) ( λ t → apply-universal-property-trunc-Prop t ( trunc-Prop _) - ( ( λ { (pair ω r) → + ( ( λ where + (ω , r) → unit-trunc-Prop - ( pair - ( unit-trunc-Set ω) + ( ( unit-trunc-Set ω) , ( map-inv-equiv ( compute-P ω) - ( unit-trunc-Prop r)))}) ∘ + ( unit-trunc-Prop r)))) ∘ ( pair-eq-Σ))) ( f) ``` @@ -717,21 +717,19 @@ module _ is-emb-coprod ( is-emb-inclusion-subtype (λ b → trunc-Prop _)) ( is-emb-inclusion-subtype (λ b → trunc-Prop _)) - ( λ { (pair b1 u) (pair b2 v) → - apply-universal-property-trunc-Prop u - ( function-Prop _ empty-Prop) - ( λ - { (pair x refl) → - apply-universal-property-trunc-Prop v - ( function-Prop _ empty-Prop) - ( λ - { (pair y refl) r → - is-empty-eq-coprod-inl-inr x y - ( is-injective-is-equiv - ( is-equiv-map-equiv e) - ( ( inv (H (inl x))) ∙ - ( ( ap unit-trunc-Set r) ∙ - ( H (inr y)))))})})}) + ( λ (b1 , u) (b2 , v) → + apply-universal-property-trunc-Prop u + ( function-Prop _ empty-Prop) + ( λ where + (x , refl) → + apply-universal-property-trunc-Prop v + ( function-Prop _ empty-Prop) + ( λ where + (y , refl) r → + is-empty-eq-coprod-inl-inr x y + ( is-injective-is-equiv + ( is-equiv-map-equiv e) + ( inv (H (inl x)) ∙ ap unit-trunc-Set r ∙ H (inr y)))))) is-surjective-map-is-coprod-codomain : is-surjective map-is-coprod-codomain is-surjective-map-is-coprod-codomain b = @@ -741,8 +739,7 @@ module _ ( trunc-Prop (fiber map-is-coprod-codomain b)) ( λ p → unit-trunc-Prop - ( pair - ( map-coprod (map-unit-im (f ∘ inl)) (map-unit-im (f ∘ inr)) a) + ( ( map-coprod (map-unit-im (f ∘ inl)) (map-unit-im (f ∘ inr)) a) , ( triangle-is-coprod-codomain a ∙ inv p))) where a = map-inv-equiv e (unit-trunc-Set b) @@ -762,12 +759,13 @@ is-contr-im : {l1 l2 : Level} {A : UU l1} (B : Set l2) {f : A → type-Set B} (a : A) (H : f ~ const A (type-Set B) (f a)) → is-contr (im f) pr1 (is-contr-im B {f} a H) = map-unit-im f a -pr2 (is-contr-im B {f} a H) (pair x u) = +pr2 (is-contr-im B {f} a H) (x , u) = apply-dependent-universal-property-trunc-Prop - ( λ v → Id-Prop (im-Set B f) (map-unit-im f a) (pair x v)) + ( λ v → Id-Prop (im-Set B f) (map-unit-im f a) (x , v)) ( u) - ( λ { (pair a' refl) → - eq-Eq-im f (map-unit-im f a) (map-unit-im f a') (inv (H a'))}) + ( λ where + (a' , refl) → + eq-Eq-im f (map-unit-im f a) (map-unit-im f a') (inv (H a'))) is-0-connected-im : {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A → B) → @@ -797,7 +795,7 @@ is-0-connected-im {l1} {l2} {A} {B} f C = ( trunc-Set B) ( map-trunc-Set f (unit-trunc-Set a')) ( map-trunc-Set f (unit-trunc-Set a))) - ( λ {refl → refl}))))) + ( λ where refl → refl))))) is-0-connected-im-unit : {l1 : Level} {A : UU l1} (f : unit → A) → is-0-connected (im f) @@ -823,7 +821,7 @@ has-finite-connected-components-Σ' {l1} {l2} {A} {B} (succ-ℕ k) e H K = where α : Σ (Fin (succ-ℕ k) → A) (λ f → is-equiv (unit-trunc-Set ∘ f)) → has-finite-connected-components (Σ A B) - α (pair f Eηf) = + α (f , Eηf) = is-finite-equiv ( equiv-trunc-Set g) ( is-finite-equiv' @@ -837,16 +835,13 @@ has-finite-connected-components-Σ' {l1} {l2} {A} {B} (succ-ℕ k) e H K = is-finite-equiv' ( equiv-trunc-Set ( equiv-ap-emb - ( pair pr1 - ( is-emb-inclusion-subtype - ( λ u → trunc-Prop _))))) + ( pr1 , is-emb-inclusion-subtype ( λ u → trunc-Prop _)))) ( H (pr1 x) (pr1 y))) ( λ x → K (pr1 x))) ( has-finite-connected-components-Σ-is-0-connected ( is-0-connected-im (f ∘ inr) is-0-connected-unit) - ( pair - ( is-finite-is-contr - ( is-0-connected-im (f ∘ inr) is-0-connected-unit)) + ( ( is-finite-is-contr + ( is-0-connected-im (f ∘ inr) is-0-connected-unit)) , ( λ x y → is-π-finite-equiv zero-ℕ ( equiv-Eq-eq-im (f ∘ inr) x y) @@ -857,10 +852,9 @@ has-finite-connected-components-Σ' {l1} {l2} {A} {B} (succ-ℕ k) e H K = Σ A B g = ( equiv-Σ B ( is-coprod-codomain f - ( pair (unit-trunc-Set ∘ f) Eηf) + ( unit-trunc-Set ∘ f , Eηf) ( refl-htpy)) - ( λ { (inl x) → id-equiv ; - (inr x) → id-equiv})) ∘e + ( λ { (inl x) → id-equiv ; (inr x) → id-equiv})) ∘e ( inv-equiv ( right-distributive-Σ-coprod ( im (f ∘ inl)) @@ -888,7 +882,7 @@ has-finite-connected-components-Σ' {l1} {l2} {A} {B} (succ-ℕ k) e H K = ( is-emb-is-equiv Eηf) ( is-emb-inl (Fin k) unit)) h : Fin k ≃ type-trunc-Set (im (f ∘ inl)) - h = pair i (is-equiv-is-emb-is-surjective is-surjective-i is-emb-i) + h = i , (is-equiv-is-emb-is-surjective is-surjective-i is-emb-i) has-finite-connected-components-Σ : {l1 l2 : Level} {A : UU l1} {B : A → UU l2} → is-π-finite 1 A → @@ -898,8 +892,9 @@ has-finite-connected-components-Σ {l1} {l2} {A} {B} H K = apply-universal-property-trunc-Prop ( pr1 H) ( has-finite-connected-components-Prop (Σ A B)) - ( λ { (pair k e) → - has-finite-connected-components-Σ' k e (λ x y → pr2 H x y) K}) + ( λ where + (k , e) → + has-finite-connected-components-Σ' k e (λ x y → pr2 H x y) K) is-π-finite-Σ : {l1 l2 : Level} (k : ℕ) {A : UU l1} {B : A → UU l2} → @@ -911,12 +906,12 @@ pr1 (is-π-finite-Σ (succ-ℕ k) H K) = ( is-π-finite-one-is-π-finite-succ-ℕ (succ-ℕ k) H) ( λ x → has-finite-connected-components-is-π-finite (succ-ℕ k) (K x)) -pr2 (is-π-finite-Σ (succ-ℕ k) H K) (pair x u) (pair y v) = +pr2 (is-π-finite-Σ (succ-ℕ k) H K) (x , u) (y , v) = is-π-finite-equiv k - ( equiv-pair-eq-Σ (pair x u) (pair y v)) + ( equiv-pair-eq-Σ (x , u) (y , v)) ( is-π-finite-Σ k ( pr2 H x y) - ( λ { refl → pr2 (K x) u v})) + ( λ where refl → pr2 (K x) u v)) π-Finite-Σ : {l1 l2 : Level} (k : ℕ) (A : π-Finite l1 (succ-ℕ k)) diff --git a/src/univalent-combinatorics/universal-property-standard-finite-types.lagda.md b/src/univalent-combinatorics/universal-property-standard-finite-types.lagda.md index 2126d8134a..414fa68110 100644 --- a/src/univalent-combinatorics/universal-property-standard-finite-types.lagda.md +++ b/src/univalent-combinatorics/universal-property-standard-finite-types.lagda.md @@ -94,8 +94,7 @@ module _ is-retraction-map-inv-ev-zero-one-Fin-two-ℕ : map-inv-ev-zero-one-Fin-two-ℕ ∘ ev-zero-one-Fin-two-ℕ ~ id is-retraction-map-inv-ev-zero-one-Fin-two-ℕ f = - eq-htpy - ( λ { (inl (inr star)) → refl ; (inr star) → refl}) + eq-htpy (λ { (inl (inr star)) → refl ; (inr star) → refl}) dependent-universal-property-Fin-two-ℕ : is-equiv ev-zero-one-Fin-two-ℕ diff --git a/src/universal-algebra/algebraic-theory-of-groups.lagda.md b/src/universal-algebra/algebraic-theory-of-groups.lagda.md index ac491c3c8f..d34b12bcb4 100644 --- a/src/universal-algebra/algebraic-theory-of-groups.lagda.md +++ b/src/universal-algebra/algebraic-theory-of-groups.lagda.md @@ -46,9 +46,10 @@ group-signature : signature lzero group-signature = pair group-ops - ( λ { unit-group-op → 0 ; - mul-group-op → 2 ; - inv-group-op → 1}) + ( λ where + unit-group-op → 0 + mul-group-op → 2 + inv-group-op → 1) data group-laws : UU lzero where associative-l-group-laws : group-laws @@ -58,39 +59,31 @@ data group-laws : UU lzero where idr-r-group-laws : group-laws group-Theory : Theory group-signature lzero -group-Theory = - pair - ( group-laws) - ( λ { associative-l-group-laws → - pair - ( op mul-group-op - ( ( 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 → - pair - ( op mul-group-op - ( op inv-group-op (var 0 ∷ empty-vec) ∷ var 0 ∷ empty-vec)) - (op unit-group-op empty-vec) ; - invr-r-group-laws → - pair - ( op mul-group-op - ( var 0 ∷ op inv-group-op (var 0 ∷ empty-vec) ∷ empty-vec)) - (op unit-group-op empty-vec) ; - idl-l-group-laws → - pair - (op mul-group-op (op unit-group-op empty-vec ∷ var 0 ∷ empty-vec)) - (var 0) ; - idr-r-group-laws → - pair - (op mul-group-op (var 0 ∷ op unit-group-op empty-vec ∷ empty-vec)) - (var 0)}) - where - op = op-Term - var = var-Term +pr1 group-Theory = group-laws +pr2 group-Theory = + λ where + associative-l-group-laws → + ( op mul-group-op + ( ( 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 → + ( op mul-group-op + ( op inv-group-op (var 0 ∷ empty-vec) ∷ var 0 ∷ empty-vec)) , + ( op unit-group-op empty-vec) + invr-r-group-laws → + ( op mul-group-op + ( var 0 ∷ op inv-group-op (var 0 ∷ empty-vec) ∷ empty-vec)) , + ( op unit-group-op empty-vec) + idl-l-group-laws → + ( op mul-group-op (op unit-group-op empty-vec ∷ var 0 ∷ empty-vec)) , + ( var 0) + idr-r-group-laws → + ( op mul-group-op (var 0 ∷ op unit-group-op empty-vec ∷ empty-vec)) , + ( var 0) + where + op = op-Term + var = var-Term group-Algebra : (l : Level) → UU (lsuc l) group-Algebra l = Algebra group-signature group-Theory l @@ -105,29 +98,27 @@ group-Algebra-Group : {l : Level} → Algebra group-signature group-Theory l → Group l -group-Algebra-Group (((A , is-set-A) , models-A) , satisfies-A) = - pair - ( pair - ( pair A is-set-A) - ( pair - ( λ x y → - ( models-A mul-group-op (x ∷ y ∷ empty-vec))) - ( λ x y z → - ( satisfies-A associative-l-group-laws - ( λ { zero-ℕ → x ; - ( succ-ℕ zero-ℕ) → y ; - ( succ-ℕ (succ-ℕ n)) → z}))))) - ( pair - ( pair - ( models-A unit-group-op empty-vec) - ( pair - ( λ x → satisfies-A idl-l-group-laws (λ _ → x)) - ( λ x → satisfies-A idr-r-group-laws (λ _ → x)))) - ( pair - ( λ x → models-A inv-group-op (x ∷ empty-vec)) - ( pair - ( λ x → satisfies-A invl-l-group-laws (λ _ → x)) - ( λ x → satisfies-A invr-r-group-laws (λ _ → x))))) +pr1 (pr1 (group-Algebra-Group ((A-Set , models-A) , satisfies-A))) = A-Set +pr1 (pr2 (pr1 (group-Algebra-Group ((A-Set , models-A) , satisfies-A)))) x y = + models-A mul-group-op (x ∷ y ∷ empty-vec) +pr2 (pr2 (pr1 (group-Algebra-Group ((A-Set , models-A) , satisfies-A)))) x y z = + satisfies-A associative-l-group-laws + ( λ where + zero-ℕ → x + ( succ-ℕ zero-ℕ) → y + ( succ-ℕ (succ-ℕ n)) → z) +pr1 (pr1 (pr2 (group-Algebra-Group ((A-Set , models-A) , satisfies-A)))) = + models-A unit-group-op empty-vec +pr1 (pr2 (pr1 (pr2 (group-Algebra-Group (_ , satisfies-A))))) x = + satisfies-A idl-l-group-laws (λ _ → x) +pr2 (pr2 (pr1 (pr2 (group-Algebra-Group (_ , satisfies-A))))) x = + satisfies-A idr-r-group-laws (λ _ → 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) +pr2 (pr2 (pr2 (pr2 (group-Algebra-Group (_ , satisfies-A))))) x = + satisfies-A invr-r-group-laws (λ _ → x) Group-group-Algebra : {l : Level} → @@ -137,19 +128,21 @@ Group-group-Algebra G = pair ( pair ( ( set-Group G)) - ( λ { unit-group-op v → unit-Group G ; - mul-group-op (x ∷ y ∷ empty-vec) → mul-Group G x y ; - inv-group-op (x ∷ empty-vec) → inv-Group G x})) - ( λ { associative-l-group-laws assign → - associative-mul-Group G (assign 0) (assign 1) (assign 2) ; - 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) ; - idl-l-group-laws assign → - left-unit-law-mul-Group G (assign 0) ; - idr-r-group-laws assign → - right-unit-law-mul-Group G (assign 0)}) + ( λ where + unit-group-op v → unit-Group G + mul-group-op (x ∷ y ∷ empty-vec) → mul-Group G x y + inv-group-op (x ∷ emptsy-vec) → inv-Group G x)) + ( λ where + associative-l-group-laws assign → + associative-mul-Group G (assign 0) (assign 1) (assign 2) + 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) + idl-l-group-laws assign → + left-unit-law-mul-Group G (assign 0) + idr-r-group-laws assign → + right-unit-law-mul-Group G (assign 0)) equiv-group-Algebra-Group : {l : Level} → @@ -165,12 +158,10 @@ pr2 (pr2 (pr2 equiv-group-Algebra-Group)) A = ( eq-pair-Σ ( refl) ( eq-htpy - ( λ { unit-group-op → - ( eq-htpy λ {empty-vec → refl}) ; - mul-group-op → - ( eq-htpy λ { (x ∷ y ∷ empty-vec) → refl}) ; - inv-group-op → - ( eq-htpy λ { (x ∷ empty-vec) → refl})}))) + ( λ where + unit-group-op → eq-htpy (λ where empty-vec → refl) + mul-group-op → eq-htpy (λ where (x ∷ y ∷ empty-vec) → refl) + inv-group-op → eq-htpy (λ where (x ∷ empty-vec) → refl)))) ( eq-is-prop ( is-prop-is-algebra ( group-signature) ( group-Theory) From 7e8bf0473ee95c60113d11f7ee23494be903f149 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Sun, 8 Oct 2023 22:42:02 +0200 Subject: [PATCH 06/23] add space after ( --- ...products-ideals-commutative-rings.lagda.md | 2 +- .../orbits-permutations.lagda.md | 4 ++-- src/foundation/apartness-relations.lagda.md | 4 ++-- .../functoriality-coproduct-types.lagda.md | 4 ++-- .../functoriality-set-truncation.lagda.md | 2 +- src/foundation/surjective-maps.lagda.md | 2 +- src/foundation/unordered-pairs.lagda.md | 4 ++-- .../generating-elements-groups.lagda.md | 10 ++++---- .../images-of-group-homomorphisms.lagda.md | 4 ++-- .../normal-closures-subgroups.lagda.md | 4 ++-- src/organic-chemistry/ethane.lagda.md | 24 +++++++++---------- src/ring-theory/cyclic-rings.lagda.md | 2 +- .../homomorphisms-cyclic-rings.lagda.md | 2 +- ...ideals-generated-by-subsets-rings.lagda.md | 2 +- ...ideals-generated-by-subsets-rings.lagda.md | 2 +- .../products-subsets-rings.lagda.md | 6 ++--- ...ideals-generated-by-subsets-rings.lagda.md | 2 +- src/set-theory/countable-sets.lagda.md | 8 +++---- src/set-theory/cumulative-hierarchy.lagda.md | 6 ++--- .../coforks.lagda.md | 4 ++-- .../dependent-coforks.lagda.md | 4 ++-- .../pi-finite-types.lagda.md | 10 ++++---- 22 files changed, 56 insertions(+), 56 deletions(-) diff --git a/src/commutative-algebra/products-ideals-commutative-rings.lagda.md b/src/commutative-algebra/products-ideals-commutative-rings.lagda.md index f666ab6c24..6637e3d402 100644 --- a/src/commutative-algebra/products-ideals-commutative-rings.lagda.md +++ b/src/commutative-algebra/products-ideals-commutative-rings.lagda.md @@ -189,7 +189,7 @@ module _ ( ideal-subset-Commutative-Ring A T) ( x)) ( λ where - (s , t , refl) → + ( s , t , refl) → contains-product-product-ideal-Commutative-Ring A ( ideal-subset-Commutative-Ring A S) ( ideal-subset-Commutative-Ring A T) diff --git a/src/finite-group-theory/orbits-permutations.lagda.md b/src/finite-group-theory/orbits-permutations.lagda.md index 4e75b12bbf..bf5ed64a50 100644 --- a/src/finite-group-theory/orbits-permutations.lagda.md +++ b/src/finite-group-theory/orbits-permutations.lagda.md @@ -1126,7 +1126,7 @@ module _ ( is-equiv-is-prop is-prop-type-trunc-Prop ( is-prop-type-Prop (coprod-sim-Equivalence-Relation-a-b-Prop g P x)) ( λ where - (inl T) → + ( inl T) → apply-universal-property-trunc-Prop T ( prop-Equivalence-Relation ( same-orbits-permutation-count g) x a) @@ -1135,7 +1135,7 @@ module _ ( lemma2 ( composition-transposition-a-b g) ( pair (pr1 pa) (inl (pr2 pa))))) - (inr T) → + ( inr T) → apply-universal-property-trunc-Prop T ( prop-Equivalence-Relation ( same-orbits-permutation-count g) x a) diff --git a/src/foundation/apartness-relations.lagda.md b/src/foundation/apartness-relations.lagda.md index ceffb71118..2d5d966f79 100644 --- a/src/foundation/apartness-relations.lagda.md +++ b/src/foundation/apartness-relations.lagda.md @@ -200,12 +200,12 @@ module _ ( rel-apart-function-into-Type-With-Apartness X Y f h) ( rel-apart-function-into-Type-With-Apartness X Y g h)) ( λ where - (inl b) → + ( inl b) → inl-disj-Prop ( rel-apart-function-into-Type-With-Apartness X Y f h) ( rel-apart-function-into-Type-With-Apartness X Y g h) ( unit-trunc-Prop (x , b)) - (inr b) → + ( inr b) → inr-disj-Prop ( rel-apart-function-into-Type-With-Apartness X Y f h) ( rel-apart-function-into-Type-With-Apartness X Y g h) diff --git a/src/foundation/functoriality-coproduct-types.lagda.md b/src/foundation/functoriality-coproduct-types.lagda.md index 6674df9565..47b025362b 100644 --- a/src/foundation/functoriality-coproduct-types.lagda.md +++ b/src/foundation/functoriality-coproduct-types.lagda.md @@ -522,12 +522,12 @@ module _ is-section-map-inv-mutually-exclusive-coprod e = eq-htpy-equiv ( λ where - (inl p) → + ( inl p) → ap ( pr1) ( is-retraction-map-inv-equiv-left-summand ( map-equiv e (inl p) , left-to-left ¬PQ' e (inl p) star)) - (inr q) → + ( inr q) → ap ( pr1) ( is-retraction-map-inv-equiv-right-summand diff --git a/src/foundation/functoriality-set-truncation.lagda.md b/src/foundation/functoriality-set-truncation.lagda.md index e1d6cbd8bf..c7bd3f85a4 100644 --- a/src/foundation/functoriality-set-truncation.lagda.md +++ b/src/foundation/functoriality-set-truncation.lagda.md @@ -220,7 +220,7 @@ module _ ( is-surjective-unit-trunc-Set A x) ( trunc-Prop (fiber f b)) ( λ where - (a , refl) → + ( a , refl) → apply-universal-property-trunc-Prop ( apply-effectiveness-unit-trunc-Set ( inv (naturality-unit-trunc-Set f a) ∙ p)) diff --git a/src/foundation/surjective-maps.lagda.md b/src/foundation/surjective-maps.lagda.md index 96d2e5c22e..ec46eebd71 100644 --- a/src/foundation/surjective-maps.lagda.md +++ b/src/foundation/surjective-maps.lagda.md @@ -416,7 +416,7 @@ module _ ( is-surj-g x) ( trunc-Prop (fiber f x)) ( λ where - (b , refl) → + ( b , refl) → apply-universal-property-trunc-Prop ( is-surj-h b) ( trunc-Prop (fiber f (g b))) diff --git a/src/foundation/unordered-pairs.lagda.md b/src/foundation/unordered-pairs.lagda.md index 874073cb72..ab8790ebc9 100644 --- a/src/foundation/unordered-pairs.lagda.md +++ b/src/foundation/unordered-pairs.lagda.md @@ -540,8 +540,8 @@ is-surjective-standard-unordered-pair (I , a) = ( I , a) ( e) ( λ where - (inl (inr star)) → refl - (inr star) → refl))) + ( inl (inr star)) → refl + ( inr star) → refl))) ``` ### For every unordered pair `p` and every element `i` in its underlying type, `p` is equal to a standard unordered pair diff --git a/src/group-theory/generating-elements-groups.lagda.md b/src/group-theory/generating-elements-groups.lagda.md index 0898ab9246..271c672d4f 100644 --- a/src/group-theory/generating-elements-groups.lagda.md +++ b/src/group-theory/generating-elements-groups.lagda.md @@ -365,7 +365,7 @@ module _ apply-universal-property-trunc-Prop p ( subset-image-hom-element-Group G g (conjugation-Group G x y)) ( λ where - (k , refl) → + ( k , refl) → is-closed-under-eq-image-hom-element-Group' G g ( unit-trunc-Prop (k , refl)) ( ( preserves-integer-powers-conjugation-Group G k x g) ∙ @@ -425,7 +425,7 @@ module _ ( map-hom-Group G H h x) ( map-hom-Group G H k x)) ( λ where - (z , refl) → + ( z , refl) → eq-integer-power-hom-Group G H h k z g (p ∙ inv q))))) is-emb-ev-element-is-generating-element-Group : @@ -468,7 +468,7 @@ module _ ( U y) ( Id-Prop (set-Group G) (mul-Group G x y) (mul-Group G y x)) ( λ where - (k , refl) (l , refl) → + ( k , refl) (l , refl) → commute-integer-powers-Group G k l refl) commutative-mul-is-generating-element-Group : @@ -565,7 +565,7 @@ module _ ( group-Group-With-Generating-Element G)) ( x)) ( λ where - (k , refl) → + ( k , refl) → unit-trunc-Prop ( hom-integer-multiple-Ab ( abelian-group-Group-With-Generating-Element G) @@ -658,7 +658,7 @@ module _ ( is-surjective-hom-element-Group-With-Generating-Element G y) ( Id-Prop (set-Group-With-Generating-Element G) _ _) ( λ where - (k , refl) (l , refl) → + ( k , refl) (l , refl) → commute-integer-multiples-diagonal-Ring ( ring-Group-With-Generating-Element) ( k) diff --git a/src/group-theory/images-of-group-homomorphisms.lagda.md b/src/group-theory/images-of-group-homomorphisms.lagda.md index 922680688d..a10218a290 100644 --- a/src/group-theory/images-of-group-homomorphisms.lagda.md +++ b/src/group-theory/images-of-group-homomorphisms.lagda.md @@ -79,7 +79,7 @@ module _ apply-twice-universal-property-trunc-Prop K L ( subset-image-hom-Group (mul-Group H x y)) ( λ where - (g , refl) (h , refl) → + ( g , refl) (h , refl) → unit-trunc-Prop ( mul-Group G g h , preserves-mul-hom-Group G H f g h)) @@ -90,7 +90,7 @@ module _ apply-universal-property-trunc-Prop K ( subset-image-hom-Group (inv-Group H x)) ( λ where - (g , refl) → + ( g , refl) → unit-trunc-Prop ( inv-Group G g , preserves-inv-hom-Group G H f g)) diff --git a/src/group-theory/normal-closures-subgroups.lagda.md b/src/group-theory/normal-closures-subgroups.lagda.md index 1fd73751fe..1025d52816 100644 --- a/src/group-theory/normal-closures-subgroups.lagda.md +++ b/src/group-theory/normal-closures-subgroups.lagda.md @@ -92,7 +92,7 @@ module _ apply-universal-property-trunc-Prop s ( generating-subset-normal-closure-Subgroup (conjugation-Group G x y)) ( λ where - (z , h , refl) → + ( z , h , refl) → unit-trunc-Prop ( mul-Group G x z , h , @@ -194,7 +194,7 @@ module _ apply-universal-property-trunc-Prop g ( subset-Normal-Subgroup G N x) ( λ where - (z , (y , h) , refl) → is-normal-Normal-Subgroup G N z y (u y h)) + ( z , (y , h) , refl) → is-normal-Normal-Subgroup G N z y (u y h)) backward-implication-is-normal-closure-normal-closure-Subgroup : {l : Level} (N : Normal-Subgroup l G) → diff --git a/src/organic-chemistry/ethane.lagda.md b/src/organic-chemistry/ethane.lagda.md index a284da7eff..9e020b25c9 100644 --- a/src/organic-chemistry/ethane.lagda.md +++ b/src/organic-chemistry/ethane.lagda.md @@ -98,8 +98,8 @@ module _ ( λ P → apply-universal-property-trunc-Prop (pr2 P) empty-Prop ( λ where - (inl (inr star) , is-one) → neq-inl-inr (inv is-zero ∙ is-one) - (inr star , is-one) → neq-inl-inr (inv is-zero' ∙ is-one))) + ( inl (inr star) , is-one) → neq-inl-inr (inv is-zero ∙ is-one) + ( inr star , is-one) → neq-inl-inr (inv is-zero' ∙ is-one))) ... | inl is-zero | inr is-one' = inl ( pair @@ -115,8 +115,8 @@ module _ ( λ P → apply-universal-property-trunc-Prop (pr1 P) empty-Prop ( λ where - (inl (inr star) , is-zero) → neq-inl-inr (inv is-zero ∙ is-one) - (inr star , is-zero) → neq-inl-inr (inv is-zero ∙ is-one'))) + ( inl (inr star) , is-zero) → neq-inl-inr (inv is-zero ∙ is-one) + ( inr star , is-zero) → neq-inl-inr (inv is-zero ∙ is-one'))) is-decidable-standard-edge-ethane : (c c' : vertex-ethane) → is-decidable (standard-edge-ethane c c') @@ -162,8 +162,8 @@ module _ ex-falso ( apply-universal-property-trunc-Prop (pr2 P) empty-Prop ( λ where - (inl (inr star) , is-one) → neq-inl-inr is-one - (inr star , is-one) → neq-inl-inr is-one)) + ( inl (inr star) , is-one) → neq-inl-inr is-one + ( inr star , is-one) → neq-inl-inr is-one)) pr2 (is-contr-standard-edge-ethane (inl (inr star))) (inr star , P) = eq-pair-Σ refl ( eq-is-prop @@ -183,8 +183,8 @@ module _ ex-falso ( apply-universal-property-trunc-Prop (pr1 P) empty-Prop ( λ where - (inl (inr star) , is-zero) → neq-inr-inl is-zero - (inr star , is-zero) → neq-inr-inl is-zero)) + ( inl (inr star) , is-zero) → neq-inr-inl is-zero + ( inr star , is-zero) → neq-inr-inl is-zero)) abstract is-emb-bonding-ethane : (c : vertex-ethane) → is-emb (bonding-ethane c) @@ -231,13 +231,13 @@ module _ pr1 (pr2 (pr2 (pr2 ethane))) (inl (inr star)) P = apply-universal-property-trunc-Prop (pr2 P) empty-Prop ( λ where - (inl (inr star) , is-one) → neq-inl-inr is-one - (inr star , is-one) → neq-inl-inr is-one) + ( inl (inr star) , is-one) → neq-inl-inr is-one + ( inr star , is-one) → neq-inl-inr is-one) pr1 (pr2 (pr2 (pr2 ethane))) (inr star) P = apply-universal-property-trunc-Prop (pr1 P) empty-Prop ( λ where - (inl (inr star) , is-zero) → neq-inr-inl is-zero - (inr star , is-zero) → neq-inr-inl is-zero) + ( inl (inr star) , is-zero) → neq-inr-inl is-zero + ( inr star , is-zero) → neq-inr-inl is-zero) pr1 (pr2 (pr2 (pr2 (pr2 ethane)))) c c' = concatenate-eq-leq-ℕ 3 ( inv diff --git a/src/ring-theory/cyclic-rings.lagda.md b/src/ring-theory/cyclic-rings.lagda.md index 623881891c..c91b2430af 100644 --- a/src/ring-theory/cyclic-rings.lagda.md +++ b/src/ring-theory/cyclic-rings.lagda.md @@ -482,7 +482,7 @@ module _ ( is-surjective-initial-hom-Cyclic-Ring R y) ( Id-Prop (set-Cyclic-Ring R) _ _) ( λ where - (n , refl) (m , refl) → + ( n , refl) (m , refl) → commute-integer-multiples-diagonal-Ring (ring-Cyclic-Ring R) n m) commutative-ring-Cyclic-Ring : Commutative-Ring l diff --git a/src/ring-theory/homomorphisms-cyclic-rings.lagda.md b/src/ring-theory/homomorphisms-cyclic-rings.lagda.md index 1869391bb6..9896912b0a 100644 --- a/src/ring-theory/homomorphisms-cyclic-rings.lagda.md +++ b/src/ring-theory/homomorphisms-cyclic-rings.lagda.md @@ -115,7 +115,7 @@ module _ ( map-hom-Ring (ring-Cyclic-Ring R) S f x) ( map-hom-Ring (ring-Cyclic-Ring R) S g x)) ( λ where - (n , refl) → + ( n , refl) → ( preserves-integer-multiples-hom-Ring ( ring-Cyclic-Ring R) ( S) diff --git a/src/ring-theory/ideals-generated-by-subsets-rings.lagda.md b/src/ring-theory/ideals-generated-by-subsets-rings.lagda.md index 721476e3d6..aa9b617ef4 100644 --- a/src/ring-theory/ideals-generated-by-subsets-rings.lagda.md +++ b/src/ring-theory/ideals-generated-by-subsets-rings.lagda.md @@ -564,7 +564,7 @@ module _ apply-universal-property-trunc-Prop H ( subset-ideal-Ring R I x) ( λ where - (l , refl) → cases-forward-inclusion-idempotent-ideal-subset-Ring l) + ( l , refl) → cases-forward-inclusion-idempotent-ideal-subset-Ring l) backward-inclusion-idempotent-ideal-subset-Ring : leq-ideal-Ring R diff --git a/src/ring-theory/left-ideals-generated-by-subsets-rings.lagda.md b/src/ring-theory/left-ideals-generated-by-subsets-rings.lagda.md index 224578a085..f972225adf 100644 --- a/src/ring-theory/left-ideals-generated-by-subsets-rings.lagda.md +++ b/src/ring-theory/left-ideals-generated-by-subsets-rings.lagda.md @@ -529,7 +529,7 @@ module _ apply-universal-property-trunc-Prop H ( subset-left-ideal-Ring R I x) ( λ where - (l , refl) → + ( l , refl) → cases-forward-inclusion-idempotent-left-ideal-subset-Ring l) backward-inclusion-idempotent-left-ideal-subset-Ring : diff --git a/src/ring-theory/products-subsets-rings.lagda.md b/src/ring-theory/products-subsets-rings.lagda.md index 78d71b324e..3ff67238b9 100644 --- a/src/ring-theory/products-subsets-rings.lagda.md +++ b/src/ring-theory/products-subsets-rings.lagda.md @@ -60,7 +60,7 @@ module _ apply-universal-property-trunc-Prop p ( union-family-of-subtypes (λ i → product-subset-Ring A S (T i)) x) ( λ where - ((s , Hs) , (t , Ht) , refl) → + ( ( s , Hs) , (t , Ht) , refl) → apply-universal-property-trunc-Prop Ht ( union-family-of-subtypes (λ i → product-subset-Ring A S (T i)) x) ( λ (i , Ht') → @@ -77,7 +77,7 @@ module _ apply-universal-property-trunc-Prop u ( product-subset-Ring A S (union-family-of-subtypes T) x) ( λ where - ((s , Hs) , (t , Ht) , refl) → + ( ( s , Hs) , (t , Ht) , refl) → unit-trunc-Prop ( (s , Hs) , (t , unit-trunc-Prop (i , Ht)) , refl))) @@ -149,7 +149,7 @@ module _ ( T) ( _)) ( λ where - ((s , Hs) , (t , Ht) , refl) → + ( ( s , Hs) , (t , Ht) , refl) → unit-trunc-Prop ( ( ( mul-Ring A r s) , ( unit-trunc-Prop ((r , Hr) , (s , Hs) , refl))) , diff --git a/src/ring-theory/right-ideals-generated-by-subsets-rings.lagda.md b/src/ring-theory/right-ideals-generated-by-subsets-rings.lagda.md index ce19de9531..9d7b3e32a4 100644 --- a/src/ring-theory/right-ideals-generated-by-subsets-rings.lagda.md +++ b/src/ring-theory/right-ideals-generated-by-subsets-rings.lagda.md @@ -529,7 +529,7 @@ module _ apply-universal-property-trunc-Prop H ( subset-right-ideal-Ring R I x) ( λ where - (l , refl) → + ( l , refl) → cases-forward-inclusion-idempotent-right-ideal-subset-Ring l) backward-inclusion-idempotent-right-ideal-subset-Ring : diff --git a/src/set-theory/countable-sets.lagda.md b/src/set-theory/countable-sets.lagda.md index bcb86e04f7..be612bee8c 100644 --- a/src/set-theory/countable-sets.lagda.md +++ b/src/set-theory/countable-sets.lagda.md @@ -154,13 +154,13 @@ module _ zero-ℕ → inr star (succ-ℕ n) → inl ((shift-ℕ a (pr1 P)) n)) , ( λ where - (inl x) → + ( inl x) → apply-universal-property-trunc-Prop (pr2 P x) ( trunc-Prop (fiber _ (inl x))) ( λ (n , p) → unit-trunc-Prop ( succ-ℕ (succ-ℕ n) , ap inl p)) - (inr star) → unit-trunc-Prop (zero-ℕ , refl)))) + ( inr star) → unit-trunc-Prop (zero-ℕ , refl)))) ``` ## Properties @@ -340,8 +340,8 @@ is-countable-ℕ = zero-ℕ → inr star (succ-ℕ n) → inl n) , ( λ where - (inl n) → unit-trunc-Prop (succ-ℕ n , refl) - (inr star) → unit-trunc-Prop (zero-ℕ , refl))) + ( inl n) → unit-trunc-Prop (succ-ℕ n , refl) + ( inr star) → unit-trunc-Prop (zero-ℕ , refl))) ``` The empty set is countable. diff --git a/src/set-theory/cumulative-hierarchy.lagda.md b/src/set-theory/cumulative-hierarchy.lagda.md index 505150de9e..efdb083423 100644 --- a/src/set-theory/cumulative-hierarchy.lagda.md +++ b/src/set-theory/cumulative-hierarchy.lagda.md @@ -731,7 +731,7 @@ needed. map-universal-property-trunc-Prop ( ∃-Prop (type-pseudo-cumulative-hierarchy V) _) ( λ where - (A , f , refl) → + ( A , f , refl) → unit-trunc-Prop ( ( set-pseudo-cumulative-hierarchy V (r ∘ f)) , ( λ y → @@ -739,7 +739,7 @@ needed. ( λ H → map-trunc-Prop ( λ where - (a , refl) → + ( a , refl) → (f a) , ( mere-preimage-∈-cumulative-hierarchy ( unit-trunc-Prop (a , refl))) , @@ -750,7 +750,7 @@ needed. ( map-universal-property-trunc-Prop ( ∃-Prop A _) ( λ where - (z , K , refl) → + ( z , K , refl) → map-trunc-Prop ( λ where (a , refl) → (a , refl)) ( ∈-cumulative-hierarchy-mere-preimage K)) diff --git a/src/synthetic-homotopy-theory/coforks.lagda.md b/src/synthetic-homotopy-theory/coforks.lagda.md index 7031abd3a1..00aadf444e 100644 --- a/src/synthetic-homotopy-theory/coforks.lagda.md +++ b/src/synthetic-homotopy-theory/coforks.lagda.md @@ -277,7 +277,7 @@ module _ ( inl)) , ( refl-htpy) , ( λ where - (inl a) → + ( inl a) → inv ( left-inv ( coherence-square-cocone @@ -285,7 +285,7 @@ module _ ( ind-coprod (λ _ → B) f g) ( c) ( inl a))) - (inr a) → right-unit)) + ( inr a) → right-unit)) is-equiv-cofork-cocone-codiagonal : is-equiv cofork-cocone-codiagonal diff --git a/src/synthetic-homotopy-theory/dependent-coforks.lagda.md b/src/synthetic-homotopy-theory/dependent-coforks.lagda.md index dd54d150a4..f21a37d7fa 100644 --- a/src/synthetic-homotopy-theory/dependent-coforks.lagda.md +++ b/src/synthetic-homotopy-theory/dependent-coforks.lagda.md @@ -351,7 +351,7 @@ module _ ( refl-htpy) , ( right-unit-htpy ∙h ( λ where - (inl a) → + ( inl a) → inv ( ( ap ( _∙ @@ -379,7 +379,7 @@ module _ ( P) ( d) ( inl a)))) - (inr a) → + ( inr a) → ap ( _∙ coherence-square-dependent-cocone diff --git a/src/univalent-combinatorics/pi-finite-types.lagda.md b/src/univalent-combinatorics/pi-finite-types.lagda.md index 5cdc3a0474..ffb15a871d 100644 --- a/src/univalent-combinatorics/pi-finite-types.lagda.md +++ b/src/univalent-combinatorics/pi-finite-types.lagda.md @@ -684,7 +684,7 @@ has-finite-connected-components-Σ-is-0-connected {A = A} {B} C H K = apply-universal-property-trunc-Prop t ( trunc-Prop _) ( ( λ where - (ω , r) → + ( ω , r) → unit-trunc-Prop ( ( unit-trunc-Set ω) , ( map-inv-equiv @@ -721,11 +721,11 @@ module _ apply-universal-property-trunc-Prop u ( function-Prop _ empty-Prop) ( λ where - (x , refl) → + ( x , refl) → apply-universal-property-trunc-Prop v ( function-Prop _ empty-Prop) ( λ where - (y , refl) r → + ( y , refl) r → is-empty-eq-coprod-inl-inr x y ( is-injective-is-equiv ( is-equiv-map-equiv e) @@ -764,7 +764,7 @@ pr2 (is-contr-im B {f} a H) (x , u) = ( λ v → Id-Prop (im-Set B f) (map-unit-im f a) (x , v)) ( u) ( λ where - (a' , refl) → + ( a' , refl) → eq-Eq-im f (map-unit-im f a) (map-unit-im f a') (inv (H a'))) is-0-connected-im : @@ -893,7 +893,7 @@ has-finite-connected-components-Σ {l1} {l2} {A} {B} H K = ( pr1 H) ( has-finite-connected-components-Prop (Σ A B)) ( λ where - (k , e) → + ( k , e) → has-finite-connected-components-Σ' k e (λ x y → pr2 H x y) K) is-π-finite-Σ : From 2ce0aad06906dde515ece2a7d3a7707aaa0e5804 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Sun, 8 Oct 2023 22:46:41 +0200 Subject: [PATCH 07/23] Apply suggestions from code review Co-authored-by: Egbert Rijke --- src/foundation/0-connected-types.lagda.md | 2 +- src/foundation/identity-types.lagda.md | 4 ++-- src/group-theory/generating-elements-groups.lagda.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/foundation/0-connected-types.lagda.md b/src/foundation/0-connected-types.lagda.md index a9a991125f..f702595cc8 100644 --- a/src/foundation/0-connected-types.lagda.md +++ b/src/foundation/0-connected-types.lagda.md @@ -117,7 +117,7 @@ is-trunc-map-ev-point-is-connected k {A} {B} a H K = ( universal-property-contr-is-contr star is-contr-unit B)) ( is-trunc-map-precomp-Π-is-surjective k ( is-surjective-point-is-0-connected a H) - ( λ _ → B , K)) + ( λ _ → (B , K))) equiv-dependent-universal-property-is-0-connected : {l1 : Level} {A : UU l1} (a : A) → is-0-connected A → diff --git a/src/foundation/identity-types.lagda.md b/src/foundation/identity-types.lagda.md index 0347d09a5d..0b2716fd6b 100644 --- a/src/foundation/identity-types.lagda.md +++ b/src/foundation/identity-types.lagda.md @@ -103,8 +103,8 @@ module _ pr2 equiv-concat-equiv = is-equiv-is-invertible equiv-concat - (λ where refl → refl) - (λ e → eq-htpy (λ y → eq-htpy-equiv (λ where refl → right-unit))) + ( λ where refl → refl) + ( λ e → eq-htpy (λ y → eq-htpy-equiv (λ where refl → right-unit))) inv-concat' : (x : A) {y z : A} → y = z → x = z → x = y inv-concat' x q = concat' x (inv q) diff --git a/src/group-theory/generating-elements-groups.lagda.md b/src/group-theory/generating-elements-groups.lagda.md index 271c672d4f..f3a0ed7a4f 100644 --- a/src/group-theory/generating-elements-groups.lagda.md +++ b/src/group-theory/generating-elements-groups.lagda.md @@ -469,7 +469,7 @@ module _ ( Id-Prop (set-Group G) (mul-Group G x y) (mul-Group G y x)) ( λ where ( k , refl) (l , refl) → - commute-integer-powers-Group G k l refl) + commute-integer-powers-Group G k l refl) commutative-mul-is-generating-element-Group : (U : is-generating-element-Group G g) → From c6a7d4c4db6e2f82227c8c5363e6a5726d88de53 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Mon, 9 Oct 2023 00:31:30 +0200 Subject: [PATCH 08/23] mark `abstract` when pattern matching in subexpression --- ...products-ideals-commutative-rings.lagda.md | 60 ++-- ...fundamental-theorem-of-arithmetic.lagda.md | 17 +- .../powers-of-two.lagda.md | 84 ++--- src/foundation-core/equivalences.lagda.md | 67 ++-- src/foundation/0-connected-types.lagda.md | 17 +- src/foundation/apartness-relations.lagda.md | 49 +-- src/foundation/embeddings.lagda.md | 2 +- .../functoriality-coproduct-types.lagda.md | 31 +- src/foundation/identity-types.lagda.md | 17 +- src/foundation/isolated-points.lagda.md | 29 +- .../pointed-torsorial-type-families.lagda.md | 17 +- .../symmetric-identity-types.lagda.md | 23 +- src/foundation/symmetric-operations.lagda.md | 29 +- .../type-arithmetic-unit-type.lagda.md | 7 +- src/foundation/unordered-pairs.lagda.md | 41 +-- src/foundation/vectors-set-quotients.lagda.md | 336 +++++++++--------- ...artesian-products-concrete-groups.lagda.md | 33 +- .../generating-elements-groups.lagda.md | 69 ++-- ...artesian-products-concrete-groups.lagda.md | 33 +- .../normal-closures-subgroups.lagda.md | 45 +-- src/group-theory/torsion-free-groups.lagda.md | 27 +- src/group-theory/trivial-groups.lagda.md | 31 +- .../transitive-higher-group-actions.lagda.md | 23 +- src/linear-algebra/vectors.lagda.md | 23 +- .../decidable-total-preorders.lagda.md | 33 +- src/organic-chemistry/ethane.lagda.md | 261 +++++++------- src/organic-chemistry/methane.lagda.md | 27 +- ...ideals-generated-by-subsets-rings.lagda.md | 44 +-- ...ideals-generated-by-subsets-rings.lagda.md | 48 +-- .../products-subsets-rings.lagda.md | 162 +++++---- ...ideals-generated-by-subsets-rings.lagda.md | 48 +-- src/set-theory/countable-sets.lagda.md | 118 +++--- src/set-theory/cumulative-hierarchy.lagda.md | 136 +++---- src/trees/directed-trees.lagda.md | 50 +-- .../counting-decidable-subtypes.lagda.md | 111 +++--- .../cyclic-types.lagda.md | 25 +- .../pi-finite-types.lagda.md | 336 +++++++++--------- .../algebraic-theory-of-groups.lagda.md | 63 ++-- 38 files changed, 1314 insertions(+), 1258 deletions(-) diff --git a/src/commutative-algebra/products-ideals-commutative-rings.lagda.md b/src/commutative-algebra/products-ideals-commutative-rings.lagda.md index 6637e3d402..9b7ddaf07d 100644 --- a/src/commutative-algebra/products-ideals-commutative-rings.lagda.md +++ b/src/commutative-algebra/products-ideals-commutative-rings.lagda.md @@ -170,37 +170,39 @@ module _ (S : subset-Commutative-Ring l2 A) (T : subset-Commutative-Ring l3 A) where - forward-inclusion-preserves-product-ideal-subset-Commutative-Ring : - leq-ideal-Commutative-Ring A - ( ideal-subset-Commutative-Ring A (product-subset-Commutative-Ring A S T)) - ( product-ideal-Commutative-Ring A - ( ideal-subset-Commutative-Ring A S) - ( ideal-subset-Commutative-Ring A T)) - forward-inclusion-preserves-product-ideal-subset-Commutative-Ring = - is-ideal-generated-by-subset-ideal-subset-Commutative-Ring A - ( product-subset-Commutative-Ring A S T) - ( product-ideal-Commutative-Ring A - ( ideal-subset-Commutative-Ring A S) - ( ideal-subset-Commutative-Ring A T)) - ( λ x H → - apply-universal-property-trunc-Prop H - ( subset-product-ideal-Commutative-Ring A - ( ideal-subset-Commutative-Ring A S) - ( ideal-subset-Commutative-Ring A T) - ( x)) - ( λ where - ( s , t , refl) → - contains-product-product-ideal-Commutative-Ring A - ( ideal-subset-Commutative-Ring A S) - ( ideal-subset-Commutative-Ring A T) - ( pr1 s) - ( pr1 t) - ( contains-subset-ideal-subset-Commutative-Ring A S + abstract + forward-inclusion-preserves-product-ideal-subset-Commutative-Ring : + leq-ideal-Commutative-Ring A + ( ideal-subset-Commutative-Ring A + ( product-subset-Commutative-Ring A S T)) + ( product-ideal-Commutative-Ring A + ( ideal-subset-Commutative-Ring A S) + ( ideal-subset-Commutative-Ring A T)) + forward-inclusion-preserves-product-ideal-subset-Commutative-Ring = + is-ideal-generated-by-subset-ideal-subset-Commutative-Ring A + ( product-subset-Commutative-Ring A S T) + ( product-ideal-Commutative-Ring A + ( ideal-subset-Commutative-Ring A S) + ( ideal-subset-Commutative-Ring A T)) + ( λ x H → + apply-universal-property-trunc-Prop H + ( subset-product-ideal-Commutative-Ring A + ( ideal-subset-Commutative-Ring A S) + ( ideal-subset-Commutative-Ring A T) + ( x)) + ( λ where + ( s , t , refl) → + contains-product-product-ideal-Commutative-Ring A + ( ideal-subset-Commutative-Ring A S) + ( ideal-subset-Commutative-Ring A T) ( pr1 s) - ( pr2 s)) - ( contains-subset-ideal-subset-Commutative-Ring A T ( pr1 t) - ( pr2 t)))) + ( contains-subset-ideal-subset-Commutative-Ring A S + ( pr1 s) + ( pr2 s)) + ( contains-subset-ideal-subset-Commutative-Ring A T + ( pr1 t) + ( pr2 t)))) left-backward-inclusion-preserves-product-ideal-subset-Commutative-Ring : {x s y : type-Commutative-Ring A} → diff --git a/src/elementary-number-theory/fundamental-theorem-of-arithmetic.lagda.md b/src/elementary-number-theory/fundamental-theorem-of-arithmetic.lagda.md index e7058f5a10..dba98f35f5 100644 --- a/src/elementary-number-theory/fundamental-theorem-of-arithmetic.lagda.md +++ b/src/elementary-number-theory/fundamental-theorem-of-arithmetic.lagda.md @@ -307,14 +307,15 @@ is-minimal-least-nontrivial-divisor-ℕ n H x K d = ### The least nontrivial divisor of a number `> 1` is nonzero ```agda -is-nonzero-least-nontrivial-divisor-ℕ : - (n : ℕ) (H : le-ℕ 1 n) → is-nonzero-ℕ (nat-least-nontrivial-divisor-ℕ n H) -is-nonzero-least-nontrivial-divisor-ℕ n H = - is-nonzero-div-ℕ - ( nat-least-nontrivial-divisor-ℕ n H) - ( n) - ( div-least-nontrivial-divisor-ℕ n H) - ( λ where refl → H) +abstract + is-nonzero-least-nontrivial-divisor-ℕ : + (n : ℕ) (H : le-ℕ 1 n) → is-nonzero-ℕ (nat-least-nontrivial-divisor-ℕ n H) + is-nonzero-least-nontrivial-divisor-ℕ n H = + is-nonzero-div-ℕ + ( nat-least-nontrivial-divisor-ℕ n H) + ( n) + ( div-least-nontrivial-divisor-ℕ n H) + ( λ where refl → H) ``` ### The least nontrivial divisor of a number `> 1` is prime diff --git a/src/elementary-number-theory/powers-of-two.lagda.md b/src/elementary-number-theory/powers-of-two.lagda.md index 5fb5d25857..836612d431 100644 --- a/src/elementary-number-theory/powers-of-two.lagda.md +++ b/src/elementary-number-theory/powers-of-two.lagda.md @@ -55,49 +55,51 @@ is-nonzero-pair-expansion u v = ( is-nonzero-exp-ℕ 2 u is-nonzero-two-ℕ) ( is-nonzero-succ-ℕ _) -has-pair-expansion-is-even-or-odd : - (n : ℕ) → is-even-ℕ n + is-odd-ℕ n → pair-expansion n -has-pair-expansion-is-even-or-odd n = - strong-ind-ℕ - ( λ m → (is-even-ℕ m + is-odd-ℕ m) → (pair-expansion m)) - ( λ x → (0 , 0) , refl) - ( λ k f → - ( λ where - ( inl x) → - ( let s = has-odd-expansion-is-odd k (is-odd-is-even-succ-ℕ k x) - in pair - ( 0 , (succ-ℕ (pr1 s))) - ( ( ap ((succ-ℕ ∘ succ-ℕ) ∘ succ-ℕ) (left-unit-law-add-ℕ _)) ∙ - ( ( ap (succ-ℕ ∘ succ-ℕ) (pr2 s))))) - ( inr x) → - ( let e : is-even-ℕ k - e = is-even-is-odd-succ-ℕ k x - - t : (pr1 e) ≤-ℕ k - t = leq-quotient-div-ℕ' 2 k is-nonzero-two-ℕ e - - s : (pair-expansion (pr1 e)) - s = f (pr1 e) t (is-decidable-is-even-ℕ (pr1 e)) - in - pair - ( succ-ℕ (pr1 (pr1 s)) , pr2 (pr1 s)) - ( ( ap - ( _*ℕ (succ-ℕ ((pr2 (pr1 s)) *ℕ 2))) - ( commutative-mul-ℕ (exp-ℕ 2 (pr1 (pr1 s))) 2)) ∙ - ( ( associative-mul-ℕ 2 - ( exp-ℕ 2 (pr1 (pr1 s))) - ( succ-ℕ ((pr2 (pr1 s)) *ℕ 2))) ∙ - ( ( ap (2 *ℕ_) (pr2 s)) ∙ - ( ( ap succ-ℕ - ( left-successor-law-add-ℕ (0 +ℕ (pr1 e)) (pr1 e))) ∙ - ( ( ap - ( succ-ℕ ∘ succ-ℕ) - ( ap (_+ℕ (pr1 e)) (left-unit-law-add-ℕ (pr1 e)))) ∙ +abstract + has-pair-expansion-is-even-or-odd : + (n : ℕ) → is-even-ℕ n + is-odd-ℕ n → pair-expansion n + has-pair-expansion-is-even-or-odd n = + strong-ind-ℕ + ( λ m → (is-even-ℕ m + is-odd-ℕ m) → (pair-expansion m)) + ( λ x → (0 , 0) , refl) + ( λ k f → + ( λ where + ( inl x) → + ( let s = has-odd-expansion-is-odd k (is-odd-is-even-succ-ℕ k x) + in + pair + ( 0 , (succ-ℕ (pr1 s))) + ( ( ap ((succ-ℕ ∘ succ-ℕ) ∘ succ-ℕ) (left-unit-law-add-ℕ _)) ∙ + ( ( ap (succ-ℕ ∘ succ-ℕ) (pr2 s))))) + ( inr x) → + ( let e : is-even-ℕ k + e = is-even-is-odd-succ-ℕ k x + + t : (pr1 e) ≤-ℕ k + t = leq-quotient-div-ℕ' 2 k is-nonzero-two-ℕ e + + s : (pair-expansion (pr1 e)) + s = f (pr1 e) t (is-decidable-is-even-ℕ (pr1 e)) + in + pair + ( succ-ℕ (pr1 (pr1 s)) , pr2 (pr1 s)) + ( ( ap + ( _*ℕ (succ-ℕ ((pr2 (pr1 s)) *ℕ 2))) + ( commutative-mul-ℕ (exp-ℕ 2 (pr1 (pr1 s))) 2)) ∙ + ( ( associative-mul-ℕ 2 + ( exp-ℕ 2 (pr1 (pr1 s))) + ( succ-ℕ ((pr2 (pr1 s)) *ℕ 2))) ∙ + ( ( ap (2 *ℕ_) (pr2 s)) ∙ + ( ( ap succ-ℕ + ( left-successor-law-add-ℕ (0 +ℕ (pr1 e)) (pr1 e))) ∙ ( ( ap ( succ-ℕ ∘ succ-ℕ) - ( inv (right-two-law-mul-ℕ (pr1 e)))) ∙ - ( ( ap (succ-ℕ ∘ succ-ℕ) (pr2 e)))))))))))) - ( n) + ( ap (_+ℕ (pr1 e)) (left-unit-law-add-ℕ (pr1 e)))) ∙ + ( ( ap + ( succ-ℕ ∘ succ-ℕ) + ( inv (right-two-law-mul-ℕ (pr1 e)))) ∙ + ( ( ap (succ-ℕ ∘ succ-ℕ) (pr2 e)))))))))))) + ( n) has-pair-expansion : (n : ℕ) → pair-expansion n has-pair-expansion n = diff --git a/src/foundation-core/equivalences.lagda.md b/src/foundation-core/equivalences.lagda.md index ef581078a4..fe08804f1a 100644 --- a/src/foundation-core/equivalences.lagda.md +++ b/src/foundation-core/equivalences.lagda.md @@ -548,40 +548,41 @@ module _ {l1 l2 : Level} {A : UU l1} {B : UU l2} where - is-emb-is-equiv : - {f : A → B} → is-equiv f → (x y : A) → is-equiv (ap f {x} {y}) - is-emb-is-equiv {f} H x y = - is-equiv-is-invertible - ( λ p → - ( inv (is-retraction-map-inv-is-equiv H x)) ∙ - ( ( ap (map-inv-is-equiv H) p) ∙ - ( is-retraction-map-inv-is-equiv H y))) - ( λ p → - ( ap-concat f - ( inv (is-retraction-map-inv-is-equiv H x)) - ( ap (map-inv-is-equiv H) p ∙ is-retraction-map-inv-is-equiv H y)) ∙ - ( ( ap-binary - ( λ u v → u ∙ v) - ( ap-inv f (is-retraction-map-inv-is-equiv H x)) - ( ( ap-concat f - ( ap (map-inv-is-equiv H) p) - ( is-retraction-map-inv-is-equiv H y)) ∙ - ( ap-binary - ( λ u v → u ∙ v) - ( inv (ap-comp f (map-inv-is-equiv H) p)) - ( inv (coherence-map-inv-is-equiv H y))))) ∙ - ( inv - ( left-transpose-eq-concat - ( ap f (is-retraction-map-inv-is-equiv H x)) - ( p) - ( ( ap (f ∘ map-inv-is-equiv H) p) ∙ - ( is-section-map-inv-is-equiv H (f y))) - ( ( ap-binary + abstract + is-emb-is-equiv : + {f : A → B} → is-equiv f → (x y : A) → is-equiv (ap f {x} {y}) + is-emb-is-equiv {f} H x y = + is-equiv-is-invertible + ( λ p → + ( inv (is-retraction-map-inv-is-equiv H x)) ∙ + ( ( ap (map-inv-is-equiv H) p) ∙ + ( is-retraction-map-inv-is-equiv H y))) + ( λ p → + ( ap-concat f + ( inv (is-retraction-map-inv-is-equiv H x)) + ( ap (map-inv-is-equiv H) p ∙ is-retraction-map-inv-is-equiv H y)) ∙ + ( ( ap-binary + ( λ u v → u ∙ v) + ( ap-inv f (is-retraction-map-inv-is-equiv H x)) + ( ( ap-concat f + ( ap (map-inv-is-equiv H) p) + ( is-retraction-map-inv-is-equiv H y)) ∙ + ( ap-binary ( λ u v → u ∙ v) - ( inv (coherence-map-inv-is-equiv H x)) - ( inv (ap-id p))) ∙ - ( nat-htpy (is-section-map-inv-is-equiv H) p)))))) - ( λ where refl → left-inv (is-retraction-map-inv-is-equiv H x)) + ( inv (ap-comp f (map-inv-is-equiv H) p)) + ( inv (coherence-map-inv-is-equiv H y))))) ∙ + ( inv + ( left-transpose-eq-concat + ( ap f (is-retraction-map-inv-is-equiv H x)) + ( p) + ( ( ap (f ∘ map-inv-is-equiv H) p) ∙ + ( is-section-map-inv-is-equiv H (f y))) + ( ( ap-binary + ( λ u v → u ∙ v) + ( inv (coherence-map-inv-is-equiv H x)) + ( inv (ap-id p))) ∙ + ( nat-htpy (is-section-map-inv-is-equiv H) p)))))) + ( λ where refl → left-inv (is-retraction-map-inv-is-equiv H x)) equiv-ap : (e : A ≃ B) (x y : A) → (x = y) ≃ (map-equiv e x = map-equiv e y) diff --git a/src/foundation/0-connected-types.lagda.md b/src/foundation/0-connected-types.lagda.md index f702595cc8..021246d291 100644 --- a/src/foundation/0-connected-types.lagda.md +++ b/src/foundation/0-connected-types.lagda.md @@ -96,14 +96,15 @@ is-0-connected-is-surjective-point a H = ( mere-eq-Prop a x) ( λ u → unit-trunc-Prop (pr2 u))) -is-surjective-point-is-0-connected : - {l1 : Level} {A : UU l1} (a : A) → - is-0-connected A → is-surjective (point a) -is-surjective-point-is-0-connected a H x = - apply-universal-property-trunc-Prop - ( mere-eq-is-0-connected H a x) - ( trunc-Prop (fiber (point a) x)) - ( λ where refl → unit-trunc-Prop (star , refl)) +abstract + is-surjective-point-is-0-connected : + {l1 : Level} {A : UU l1} (a : A) → + is-0-connected A → is-surjective (point a) + is-surjective-point-is-0-connected a H x = + apply-universal-property-trunc-Prop + ( mere-eq-is-0-connected H a x) + ( trunc-Prop (fiber (point a) x)) + ( λ where refl → unit-trunc-Prop (star , refl)) is-trunc-map-ev-point-is-connected : {l1 l2 : Level} (k : 𝕋) {A : UU l1} {B : UU l2} (a : A) → diff --git a/src/foundation/apartness-relations.lagda.md b/src/foundation/apartness-relations.lagda.md index 2d5d966f79..b2dcc72e84 100644 --- a/src/foundation/apartness-relations.lagda.md +++ b/src/foundation/apartness-relations.lagda.md @@ -186,30 +186,31 @@ module _ unit-trunc-Prop ( x , symmetric-apart-Type-With-Apartness Y (f x) (g x) a)) - is-cotransitive-apart-function-into-Type-With-Apartness : - is-cotransitive (rel-apart-function-into-Type-With-Apartness X Y) - is-cotransitive-apart-function-into-Type-With-Apartness f g h H = - apply-universal-property-trunc-Prop H - ( disj-Prop - ( rel-apart-function-into-Type-With-Apartness X Y f h) - ( rel-apart-function-into-Type-With-Apartness X Y g h)) - ( λ (x , a) → - apply-universal-property-trunc-Prop - ( cotransitive-apart-Type-With-Apartness Y (f x) (g x) (h x) a) - ( disj-Prop - ( rel-apart-function-into-Type-With-Apartness X Y f h) - ( rel-apart-function-into-Type-With-Apartness X Y g h)) - ( λ where - ( inl b) → - inl-disj-Prop - ( rel-apart-function-into-Type-With-Apartness X Y f h) - ( rel-apart-function-into-Type-With-Apartness X Y g h) - ( unit-trunc-Prop (x , b)) - ( inr b) → - inr-disj-Prop - ( rel-apart-function-into-Type-With-Apartness X Y f h) - ( rel-apart-function-into-Type-With-Apartness X Y g h) - ( unit-trunc-Prop (x , b)))) + abstract + is-cotransitive-apart-function-into-Type-With-Apartness : + is-cotransitive (rel-apart-function-into-Type-With-Apartness X Y) + is-cotransitive-apart-function-into-Type-With-Apartness f g h H = + apply-universal-property-trunc-Prop H + ( disj-Prop + ( rel-apart-function-into-Type-With-Apartness X Y f h) + ( rel-apart-function-into-Type-With-Apartness X Y g h)) + ( λ (x , a) → + apply-universal-property-trunc-Prop + ( cotransitive-apart-Type-With-Apartness Y (f x) (g x) (h x) a) + ( disj-Prop + ( rel-apart-function-into-Type-With-Apartness X Y f h) + ( rel-apart-function-into-Type-With-Apartness X Y g h)) + ( λ where + ( inl b) → + inl-disj-Prop + ( rel-apart-function-into-Type-With-Apartness X Y f h) + ( rel-apart-function-into-Type-With-Apartness X Y g h) + ( unit-trunc-Prop (x , b)) + ( inr b) → + inr-disj-Prop + ( rel-apart-function-into-Type-With-Apartness X Y f h) + ( rel-apart-function-into-Type-With-Apartness X Y g h) + ( unit-trunc-Prop (x , b)))) exp-Type-With-Apartness : Type-With-Apartness (l1 ⊔ l2) (l1 ⊔ l3) pr1 exp-Type-With-Apartness = X → type-Type-With-Apartness Y diff --git a/src/foundation/embeddings.lagda.md b/src/foundation/embeddings.lagda.md index e34e6ad4f5..8d29fe181e 100644 --- a/src/foundation/embeddings.lagda.md +++ b/src/foundation/embeddings.lagda.md @@ -276,7 +276,7 @@ module _ is-emb f is-emb-equiv-refl-to-refl e p x y = is-equiv-htpy-equiv - (inv-equiv (e x y)) + ( inv-equiv (e x y)) ( λ where refl → inv (is-retraction-map-inv-equiv (e x x) refl) ∙ diff --git a/src/foundation/functoriality-coproduct-types.lagda.md b/src/foundation/functoriality-coproduct-types.lagda.md index 47b025362b..ff730932bc 100644 --- a/src/foundation/functoriality-coproduct-types.lagda.md +++ b/src/foundation/functoriality-coproduct-types.lagda.md @@ -517,21 +517,22 @@ module _ (eq-equiv-eq-map-equiv refl) (eq-equiv-eq-map-equiv refl) - is-section-map-inv-mutually-exclusive-coprod : - (map-inv-mutually-exclusive-coprod ∘ map-mutually-exclusive-coprod) ~ id - is-section-map-inv-mutually-exclusive-coprod e = - eq-htpy-equiv ( - λ where - ( inl p) → - ap - ( pr1) - ( is-retraction-map-inv-equiv-left-summand - ( map-equiv e (inl p) , left-to-left ¬PQ' e (inl p) star)) - ( inr q) → - ap - ( pr1) - ( is-retraction-map-inv-equiv-right-summand - ( map-equiv e (inr q) , right-to-right ¬P'Q e (inr q) star))) + abstract + is-section-map-inv-mutually-exclusive-coprod : + (map-inv-mutually-exclusive-coprod ∘ map-mutually-exclusive-coprod) ~ id + is-section-map-inv-mutually-exclusive-coprod e = + eq-htpy-equiv + ( λ where + ( inl p) → + ap + ( pr1) + ( is-retraction-map-inv-equiv-left-summand + ( map-equiv e (inl p) , left-to-left ¬PQ' e (inl p) star)) + ( inr q) → + ap + ( pr1) + ( is-retraction-map-inv-equiv-right-summand + ( map-equiv e (inr q) , right-to-right ¬P'Q e (inr q) star))) equiv-mutually-exclusive-coprod : ((P + Q) ≃ (P' + Q')) ≃ ((P ≃ P') × (Q ≃ Q')) diff --git a/src/foundation/identity-types.lagda.md b/src/foundation/identity-types.lagda.md index 0b2716fd6b..a426d51faa 100644 --- a/src/foundation/identity-types.lagda.md +++ b/src/foundation/identity-types.lagda.md @@ -97,14 +97,15 @@ module _ pr1 (equiv-concat p z) = concat p z pr2 (equiv-concat p z) = is-equiv-concat p z - equiv-concat-equiv : - {x x' : A} → ((y : A) → (x = y) ≃ (x' = y)) ≃ (x' = x) - pr1 (equiv-concat-equiv {x}) e = map-equiv (e x) refl - pr2 equiv-concat-equiv = - is-equiv-is-invertible - equiv-concat - ( λ where refl → refl) - ( λ e → eq-htpy (λ y → eq-htpy-equiv (λ where refl → right-unit))) + abstract + equiv-concat-equiv : + {x x' : A} → ((y : A) → (x = y) ≃ (x' = y)) ≃ (x' = x) + pr1 (equiv-concat-equiv {x}) e = map-equiv (e x) refl + pr2 equiv-concat-equiv = + is-equiv-is-invertible + equiv-concat + ( λ where refl → refl) + ( λ e → eq-htpy (λ y → eq-htpy-equiv (λ where refl → right-unit))) inv-concat' : (x : A) {y z : A} → y = z → x = z → x = y inv-concat' x q = concat' x (inv q) diff --git a/src/foundation/isolated-points.lagda.md b/src/foundation/isolated-points.lagda.md index afe5564f19..72148df23a 100644 --- a/src/foundation/isolated-points.lagda.md +++ b/src/foundation/isolated-points.lagda.md @@ -240,20 +240,21 @@ is-set-isolated-point : is-set-isolated-point A = is-set-has-decidable-equality (has-decidable-equality-isolated-point A) -decidable-emb-isolated-point : - {l1 : Level} {A : UU l1} (a : isolated-point A) → unit ↪ᵈ A -pr1 (decidable-emb-isolated-point {l1} {A} a) = - const unit A (pr1 a) -pr1 (pr2 (decidable-emb-isolated-point {l1} {A} a)) = - is-emb-comp - ( inclusion-isolated-point A) - ( const unit (isolated-point A) a) - ( is-emb-inclusion-isolated-point A) - ( is-emb-is-injective - ( is-set-isolated-point A) - ( λ where {star} {star} p → refl)) -pr2 (pr2 (decidable-emb-isolated-point {l1} {A} a)) x = - is-decidable-prod is-decidable-unit (pr2 a x) +abstract + decidable-emb-isolated-point : + {l1 : Level} {A : UU l1} (a : isolated-point A) → unit ↪ᵈ A + pr1 (decidable-emb-isolated-point {l1} {A} a) = + const unit A (pr1 a) + pr1 (pr2 (decidable-emb-isolated-point {l1} {A} a)) = + is-emb-comp + ( inclusion-isolated-point A) + ( const unit (isolated-point A) a) + ( is-emb-inclusion-isolated-point A) + ( is-emb-is-injective + ( is-set-isolated-point A) + ( λ where {star} {star} p → refl)) + pr2 (pr2 (decidable-emb-isolated-point {l1} {A} a)) x = + is-decidable-prod is-decidable-unit (pr2 a x) ``` ### Types with isolated points can be equipped with a Maybe-structure diff --git a/src/foundation/pointed-torsorial-type-families.lagda.md b/src/foundation/pointed-torsorial-type-families.lagda.md index aca964f20e..bbaf1dd88e 100644 --- a/src/foundation/pointed-torsorial-type-families.lagda.md +++ b/src/foundation/pointed-torsorial-type-families.lagda.md @@ -135,14 +135,15 @@ module _ (T : is-pointed-torsorial-family-of-types B E) where - is-locally-small-is-pointed-torsorial-family-of-types : - is-0-connected (type-Pointed-Type B) → - is-locally-small l2 (type-Pointed-Type B) - is-locally-small-is-pointed-torsorial-family-of-types H x y = - apply-universal-property-trunc-Prop - ( mere-eq-is-0-connected H (point-Pointed-Type B) x) - ( is-small-Prop l2 (x = y)) - ( λ where refl → (E y , inv-equiv (T y))) + abstract + is-locally-small-is-pointed-torsorial-family-of-types : + is-0-connected (type-Pointed-Type B) → + is-locally-small l2 (type-Pointed-Type B) + is-locally-small-is-pointed-torsorial-family-of-types H x y = + apply-universal-property-trunc-Prop + ( mere-eq-is-0-connected H (point-Pointed-Type B) x) + ( is-small-Prop l2 (x = y)) + ( λ where refl → (E y , inv-equiv (T y))) ``` ### The type of pointed torsorial type families of universe level `l` over a pointed connected type is equivalent to the proposition that `B` is locally `l`-small diff --git a/src/foundation/symmetric-identity-types.lagda.md b/src/foundation/symmetric-identity-types.lagda.md index 7b43677a16..94d4b91dd4 100644 --- a/src/foundation/symmetric-identity-types.lagda.md +++ b/src/foundation/symmetric-identity-types.lagda.md @@ -109,17 +109,18 @@ module _ ( map-compute-symmetric-Id ∘ map-inv-compute-symmetric-Id) ~ id is-section-map-inv-compute-symmetric-Id refl = refl - is-retraction-map-inv-compute-symmetric-Id : - ( map-inv-compute-symmetric-Id ∘ map-compute-symmetric-Id) ~ id - is-retraction-map-inv-compute-symmetric-Id (x , f) = - eq-Eq-symmetric-Id - ( standard-unordered-pair a b) - ( map-inv-compute-symmetric-Id (map-compute-symmetric-Id (x , f))) - ( x , f) - ( ( inv (f (zero-Fin 1))) , - ( λ where - ( inl (inr star)) → inv (left-inv (f (zero-Fin 1))) - ( inr star) → refl)) + abstract + is-retraction-map-inv-compute-symmetric-Id : + ( map-inv-compute-symmetric-Id ∘ map-compute-symmetric-Id) ~ id + is-retraction-map-inv-compute-symmetric-Id (x , f) = + eq-Eq-symmetric-Id + ( standard-unordered-pair a b) + ( map-inv-compute-symmetric-Id (map-compute-symmetric-Id (x , f))) + ( x , f) + ( ( inv (f (zero-Fin 1))) , + ( λ where + ( inl (inr star)) → inv (left-inv (f (zero-Fin 1))) + ( inr star) → refl)) is-equiv-map-compute-symmetric-Id : is-equiv (map-compute-symmetric-Id) diff --git a/src/foundation/symmetric-operations.lagda.md b/src/foundation/symmetric-operations.lagda.md index 09aef10d24..78211eaa74 100644 --- a/src/foundation/symmetric-operations.lagda.md +++ b/src/foundation/symmetric-operations.lagda.md @@ -195,20 +195,21 @@ module _ pr1 center-total-htpy-symmetric-operation-Set = f pr2 center-total-htpy-symmetric-operation-Set x y = refl - contraction-total-htpy-symmetric-operation-Set : - ( t : - Σ ( symmetric-operation A (type-Set B)) - ( htpy-symmetric-operation-Set)) → - center-total-htpy-symmetric-operation-Set = t - contraction-total-htpy-symmetric-operation-Set (g , H) = - eq-type-subtype - htpy-symmetric-operation-Set-Prop - ( eq-htpy - ( λ p → - apply-universal-property-trunc-Prop - ( is-surjective-standard-unordered-pair p) - ( Id-Prop B (f p) (g p)) - ( λ where (x , y , refl) → H x y))) + abstract + contraction-total-htpy-symmetric-operation-Set : + ( t : + Σ ( symmetric-operation A (type-Set B)) + ( htpy-symmetric-operation-Set)) → + center-total-htpy-symmetric-operation-Set = t + contraction-total-htpy-symmetric-operation-Set (g , H) = + eq-type-subtype + htpy-symmetric-operation-Set-Prop + ( eq-htpy + ( λ p → + apply-universal-property-trunc-Prop + ( is-surjective-standard-unordered-pair p) + ( Id-Prop B (f p) (g p)) + ( λ where (x , y , refl) → H x y))) is-contr-total-htpy-symmetric-operation-Set : is-contr diff --git a/src/foundation/type-arithmetic-unit-type.lagda.md b/src/foundation/type-arithmetic-unit-type.lagda.md index 21c1952f6c..e7de5e86b9 100644 --- a/src/foundation/type-arithmetic-unit-type.lagda.md +++ b/src/foundation/type-arithmetic-unit-type.lagda.md @@ -164,9 +164,10 @@ module _ ( map-left-unit-law-Π ∘ map-inv-left-unit-law-Π) ~ id is-section-map-inv-left-unit-law-Π a = refl - is-retraction-map-inv-left-unit-law-Π : - ( map-inv-left-unit-law-Π ∘ map-left-unit-law-Π) ~ id - is-retraction-map-inv-left-unit-law-Π f = eq-htpy (λ where star → refl) + abstract + is-retraction-map-inv-left-unit-law-Π : + ( map-inv-left-unit-law-Π ∘ map-left-unit-law-Π) ~ id + is-retraction-map-inv-left-unit-law-Π f = eq-htpy (λ where star → refl) is-equiv-map-left-unit-law-Π : is-equiv map-left-unit-law-Π is-equiv-map-left-unit-law-Π = diff --git a/src/foundation/unordered-pairs.lagda.md b/src/foundation/unordered-pairs.lagda.md index ab8790ebc9..96db918c7c 100644 --- a/src/foundation/unordered-pairs.lagda.md +++ b/src/foundation/unordered-pairs.lagda.md @@ -522,26 +522,27 @@ unordered-distinct-pair A = ### Every unordered pair is merely equal to a standard unordered pair ```agda -is-surjective-standard-unordered-pair : - {l : Level} {A : UU l} (p : unordered-pair A) → - type-trunc-Prop - ( Σ A (λ x → Σ A (λ y → standard-unordered-pair x y = p))) -is-surjective-standard-unordered-pair (I , a) = - apply-universal-property-trunc-Prop - ( has-two-elements-type-2-Element-Type I) - ( trunc-Prop - ( Σ _ (λ x → Σ _ (λ y → standard-unordered-pair x y = (I , a))))) - ( λ e → - unit-trunc-Prop - ( a (map-equiv e (zero-Fin 1)) , - a (map-equiv e (one-Fin 1)) , - eq-Eq-unordered-pair - ( standard-unordered-pair _ _) - ( I , a) - ( e) - ( λ where - ( inl (inr star)) → refl - ( inr star) → refl))) +abstract + is-surjective-standard-unordered-pair : + {l : Level} {A : UU l} (p : unordered-pair A) → + type-trunc-Prop + ( Σ A (λ x → Σ A (λ y → standard-unordered-pair x y = p))) + is-surjective-standard-unordered-pair (I , a) = + apply-universal-property-trunc-Prop + ( has-two-elements-type-2-Element-Type I) + ( trunc-Prop + ( Σ _ (λ x → Σ _ (λ y → standard-unordered-pair x y = (I , a))))) + ( λ e → + unit-trunc-Prop + ( a (map-equiv e (zero-Fin 1)) , + a (map-equiv e (one-Fin 1)) , + eq-Eq-unordered-pair + ( standard-unordered-pair _ _) + ( I , a) + ( e) + ( λ where + ( inl (inr star)) → refl + ( inr star) → refl))) ``` ### For every unordered pair `p` and every element `i` in its underlying type, `p` is equal to a standard unordered pair diff --git a/src/foundation/vectors-set-quotients.lagda.md b/src/foundation/vectors-set-quotients.lagda.md index ce52820f1b..21b42ab3f8 100644 --- a/src/foundation/vectors-set-quotients.lagda.md +++ b/src/foundation/vectors-set-quotients.lagda.md @@ -255,188 +255,190 @@ inv-precomp-vector-set-quotient (succ-ℕ n) A R X f (qa0 , qa) = ( f) ( qa0 , map-equiv (equiv-set-quotient-vector n _ _) qa) -is-section-inv-precomp-vector-set-quotient : - { l l1 l2 : Level} - ( n : ℕ) - ( A : functional-vec (UU l1) n) - ( R : (i : Fin n) → Equivalence-Relation l2 (A i)) → - ( X : Set l) → - ( section - ( precomp-Set-Quotient - ( all-sim-Equivalence-Relation n A R) - ( set-quotient-vector-Set n A R) - ( reflecting-map-quotient-vector-map n A R) - ( X))) -pr1 (is-section-inv-precomp-vector-set-quotient n A R X) = - inv-precomp-vector-set-quotient n A R X -pr2 (is-section-inv-precomp-vector-set-quotient {l} {l1} {l2} zero-ℕ A R X) f = - eq-pair-Σ - ( eq-htpy (λ where (map-raise star) → refl)) - ( eq-is-prop - ( is-prop-reflects-Equivalence-Relation - ( raise-indiscrete-Equivalence-Relation l2 (raise-unit l1)) - ( X) - ( map-reflecting-map-Equivalence-Relation _ f))) -pr2 (is-section-inv-precomp-vector-set-quotient (succ-ℕ n) A R X) f = - eq-pair-Σ - ( eq-htpy - ( λ (a0 , a) → - ( ap - ( inv-precomp-set-quotient-prod-set-quotient - ( R (inr star)) - ( all-sim-Equivalence-Relation n - ( tail-functional-vec n A) - ( λ x → R (inl x))) X f) - ( eq-pair-Σ refl - ( map-equiv-equiv-set-quotient-vector-quotient-map n _ _ a)) ∙ - ( htpy-eq +abstract + is-section-inv-precomp-vector-set-quotient : + { l l1 l2 : Level} + ( n : ℕ) + ( A : functional-vec (UU l1) n) + ( R : (i : Fin n) → Equivalence-Relation l2 (A i)) → + ( X : Set l) → + ( section + ( precomp-Set-Quotient + ( all-sim-Equivalence-Relation n A R) + ( set-quotient-vector-Set n A R) + ( reflecting-map-quotient-vector-map n A R) + ( X))) + pr1 (is-section-inv-precomp-vector-set-quotient n A R X) = + inv-precomp-vector-set-quotient n A R X + pr2 (is-section-inv-precomp-vector-set-quotient {l} {l1} {l2} 0 A R X) f = + eq-pair-Σ + ( eq-htpy (λ where (map-raise star) → refl)) + ( eq-is-prop + ( is-prop-reflects-Equivalence-Relation + ( raise-indiscrete-Equivalence-Relation l2 (raise-unit l1)) + ( X) + ( map-reflecting-map-Equivalence-Relation _ f))) + pr2 (is-section-inv-precomp-vector-set-quotient (succ-ℕ n) A R X) f = + eq-pair-Σ + ( eq-htpy + ( λ (a0 , a) → ( ap - ( map-reflecting-map-Equivalence-Relation _) - ( is-section-inv-precomp-set-quotient-prod-set-quotient + ( inv-precomp-set-quotient-prod-set-quotient ( R (inr star)) ( all-sim-Equivalence-Relation n - ( tail-functional-vec n A) - ( λ x → R (inl x))) X f)) - ( a0 , a))))) - ( eq-is-prop - ( is-prop-reflects-Equivalence-Relation - ( all-sim-Equivalence-Relation (succ-ℕ n) A R) - ( X) - ( map-reflecting-map-Equivalence-Relation _ f))) - -is-retraction-inv-precomp-vector-set-quotient : - { l l1 l2 : Level} - ( n : ℕ) - ( A : functional-vec (UU l1) n) - ( R : (i : Fin n) → Equivalence-Relation l2 (A i)) → - ( X : Set l) → - ( retraction - ( precomp-Set-Quotient - ( all-sim-Equivalence-Relation n A R) - ( set-quotient-vector-Set n A R) - ( reflecting-map-quotient-vector-map n A R) - ( X))) -pr1 (is-retraction-inv-precomp-vector-set-quotient n A R X) = - inv-precomp-vector-set-quotient n A R X -pr2 (is-retraction-inv-precomp-vector-set-quotient zero-ℕ A R X) f = - eq-htpy (λ where (map-raise star) → refl) -pr2 (is-retraction-inv-precomp-vector-set-quotient (succ-ℕ n) A R X) f = - ap (_∘ set-quotient-vector-prod-set-quotient) - is-inv-map-inv-equiv-f ∙ lemma-f - where - precomp-f : - reflecting-map-Equivalence-Relation - ( prod-Equivalence-Relation (R (inr star)) - ( all-sim-Equivalence-Relation n - ( tail-functional-vec n A) - ( λ x → R (inl x)))) - ( type-Set X) - precomp-f = - precomp-Set-Quotient - ( prod-Equivalence-Relation (R (inr star)) - ( all-sim-Equivalence-Relation n - ( tail-functional-vec n A) - ( λ x → R (inl x)))) - ( set-quotient-vector-Set (succ-ℕ n) A R) - ( reflecting-map-quotient-vector-map (succ-ℕ n) A R) X f - - set-quotient-vector-prod-set-quotient : - ( set-quotient-vector (succ-ℕ n) A R) → - ( prod-set-quotient - ( R (inr star)) - ( all-sim-Equivalence-Relation n - ( tail-functional-vec n A) - ( λ x → R (inl x)))) - set-quotient-vector-prod-set-quotient (qa0' , qa') = - (qa0' , map-equiv (equiv-set-quotient-vector n _ _) qa') - - map-inv-equiv-f : - ( prod-set-quotient - ( R (inr star)) - ( all-sim-Equivalence-Relation n - ( tail-functional-vec n A) - ( λ x → R (inl x)))) → - ( type-Set X) - map-inv-equiv-f (qa0 , qa) = - f (qa0 , map-inv-equiv (equiv-set-quotient-vector n _ _) qa) - - lemma-f : (map-inv-equiv-f ∘ set-quotient-vector-prod-set-quotient) = f - lemma-f = - eq-htpy - ( λ (qa0 , qa) → - ( ap f - ( eq-pair-Σ - ( refl) - ( is-retraction-map-inv-equiv - ( equiv-set-quotient-vector n _ _) - ( qa))))) - - is-retraction-inv-precomp-f : - ( inv-precomp-set-quotient-prod-set-quotient - ( R (inr star)) - ( all-sim-Equivalence-Relation n - ( tail-functional-vec n A) - ( λ x → R (inl x))) - ( X) + ( tail-functional-vec n A) + ( λ x → R (inl x))) X f) + ( eq-pair-Σ refl + ( map-equiv-equiv-set-quotient-vector-quotient-map n _ _ a)) ∙ + ( htpy-eq + ( ap + ( map-reflecting-map-Equivalence-Relation _) + ( is-section-inv-precomp-set-quotient-prod-set-quotient + ( R (inr star)) + ( all-sim-Equivalence-Relation n + ( tail-functional-vec n A) + ( λ x → R (inl x))) X f)) + ( a0 , a))))) + ( eq-is-prop + ( is-prop-reflects-Equivalence-Relation + ( all-sim-Equivalence-Relation (succ-ℕ n) A R) + ( X) + ( map-reflecting-map-Equivalence-Relation _ f))) + +abstract + is-retraction-inv-precomp-vector-set-quotient : + { l l1 l2 : Level} + ( n : ℕ) + ( A : functional-vec (UU l1) n) + ( R : (i : Fin n) → Equivalence-Relation l2 (A i)) → + ( X : Set l) → + ( retraction ( precomp-Set-Quotient + ( all-sim-Equivalence-Relation n A R) + ( set-quotient-vector-Set n A R) + ( reflecting-map-quotient-vector-map n A R) + ( X))) + pr1 (is-retraction-inv-precomp-vector-set-quotient n A R X) = + inv-precomp-vector-set-quotient n A R X + pr2 (is-retraction-inv-precomp-vector-set-quotient zero-ℕ A R X) f = + eq-htpy (λ where (map-raise star) → refl) + pr2 (is-retraction-inv-precomp-vector-set-quotient (succ-ℕ n) A R X) f = + ap (_∘ set-quotient-vector-prod-set-quotient) + is-inv-map-inv-equiv-f ∙ lemma-f + where + precomp-f : + reflecting-map-Equivalence-Relation ( prod-Equivalence-Relation (R (inr star)) ( all-sim-Equivalence-Relation n ( tail-functional-vec n A) ( λ x → R (inl x)))) - ( prod-set-quotient-Set - ( R (inr star)) - ( all-sim-Equivalence-Relation n - ( tail-functional-vec n A) - ( λ x → R (inl x)))) - ( reflecting-map-prod-quotient-map (R (inr star)) + ( type-Set X) + precomp-f = + precomp-Set-Quotient + ( prod-Equivalence-Relation (R (inr star)) + ( all-sim-Equivalence-Relation n + ( tail-functional-vec n A) + ( λ x → R (inl x)))) + ( set-quotient-vector-Set (succ-ℕ n) A R) + ( reflecting-map-quotient-vector-map (succ-ℕ n) A R) X f + + set-quotient-vector-prod-set-quotient : + ( set-quotient-vector (succ-ℕ n) A R) → + ( prod-set-quotient + ( R (inr star)) + ( all-sim-Equivalence-Relation n + ( tail-functional-vec n A) + ( λ x → R (inl x)))) + set-quotient-vector-prod-set-quotient (qa0' , qa') = + (qa0' , map-equiv (equiv-set-quotient-vector n _ _) qa') + + map-inv-equiv-f : + ( prod-set-quotient + ( R (inr star)) + ( all-sim-Equivalence-Relation n + ( tail-functional-vec n A) + ( λ x → R (inl x)))) → + ( type-Set X) + map-inv-equiv-f (qa0 , qa) = + f (qa0 , map-inv-equiv (equiv-set-quotient-vector n _ _) qa) + + lemma-f : (map-inv-equiv-f ∘ set-quotient-vector-prod-set-quotient) = f + lemma-f = + eq-htpy + ( λ (qa0 , qa) → + ( ap f + ( eq-pair-Σ + ( refl) + ( is-retraction-map-inv-equiv + ( equiv-set-quotient-vector n _ _) + ( qa))))) + + is-retraction-inv-precomp-f : + ( inv-precomp-set-quotient-prod-set-quotient + ( R (inr star)) + ( all-sim-Equivalence-Relation n + ( tail-functional-vec n A) + ( λ x → R (inl x))) + ( X) + ( precomp-Set-Quotient + ( prod-Equivalence-Relation (R (inr star)) ( all-sim-Equivalence-Relation n ( tail-functional-vec n A) ( λ x → R (inl x)))) - ( X) - ( map-inv-equiv-f))) = - map-inv-equiv-f - is-retraction-inv-precomp-f = - is-retraction-inv-precomp-set-quotient-prod-set-quotient + ( prod-set-quotient-Set + ( R (inr star)) + ( all-sim-Equivalence-Relation n + ( tail-functional-vec n A) + ( λ x → R (inl x)))) + ( reflecting-map-prod-quotient-map (R (inr star)) + ( all-sim-Equivalence-Relation n + ( tail-functional-vec n A) + ( λ x → R (inl x)))) + ( X) + ( map-inv-equiv-f))) = + map-inv-equiv-f + is-retraction-inv-precomp-f = + is-retraction-inv-precomp-set-quotient-prod-set-quotient + ( R (inr star)) + ( all-sim-Equivalence-Relation n + ( tail-functional-vec n A) + ( λ x → R (inl x))) + ( X) + ( map-inv-equiv-f) + + is-inv-map-inv-equiv-f : + ( inv-precomp-set-quotient-prod-set-quotient ( R (inr star)) ( all-sim-Equivalence-Relation n ( tail-functional-vec n A) ( λ x → R (inl x))) - ( X) - ( map-inv-equiv-f) - - is-inv-map-inv-equiv-f : - ( inv-precomp-set-quotient-prod-set-quotient - ( R (inr star)) - ( all-sim-Equivalence-Relation n - ( tail-functional-vec n A) - ( λ x → R (inl x))) - ( X) - ( precomp-f)) = - map-inv-equiv-f - is-inv-map-inv-equiv-f = - ap - ( inv-precomp-set-quotient-prod-set-quotient - ( R (inr star)) - ( all-sim-Equivalence-Relation n (tail-functional-vec n A) - ( λ x → R (inl x))) - ( X)) - ( eq-pair-Σ - ( ap ( _∘ quotient-vector-map _ A R) (inv lemma-f) ∙ - ( ap - ( map-inv-equiv-f ∘_) - ( eq-htpy - ( λ (a0 , a) → - ( eq-pair-Σ - ( refl) - ( map-equiv-equiv-set-quotient-vector-quotient-map - _ _ _ a)))))) - ( eq-is-prop - ( is-prop-reflects-Equivalence-Relation - ( prod-Equivalence-Relation - ( R (inr star)) - ( all-sim-Equivalence-Relation n _ _)) - ( X) _))) ∙ - is-retraction-inv-precomp-f + ( X) + ( precomp-f)) = + map-inv-equiv-f + is-inv-map-inv-equiv-f = + ap + ( inv-precomp-set-quotient-prod-set-quotient + ( R (inr star)) + ( all-sim-Equivalence-Relation n (tail-functional-vec n A) + ( λ x → R (inl x))) + ( X)) + ( eq-pair-Σ + ( ap ( _∘ quotient-vector-map _ A R) (inv lemma-f) ∙ + ( ap + ( map-inv-equiv-f ∘_) + ( eq-htpy + ( λ (a0 , a) → + ( eq-pair-Σ + ( refl) + ( map-equiv-equiv-set-quotient-vector-quotient-map + _ _ _ a)))))) + ( eq-is-prop + ( is-prop-reflects-Equivalence-Relation + ( prod-Equivalence-Relation + ( R (inr star)) + ( all-sim-Equivalence-Relation n _ _)) + ( X) _))) ∙ + is-retraction-inv-precomp-f is-set-quotient-vector-set-quotient : { l l1 l2 : Level} diff --git a/src/group-theory/cartesian-products-concrete-groups.lagda.md b/src/group-theory/cartesian-products-concrete-groups.lagda.md index 0bdd110bcc..5c6deb5bd2 100644 --- a/src/group-theory/cartesian-products-concrete-groups.lagda.md +++ b/src/group-theory/cartesian-products-concrete-groups.lagda.md @@ -102,22 +102,23 @@ module _ set-product-Concrete-Group = pair type-product-Concrete-Group is-set-type-product-Concrete-Group - is-1-type-classifying-type-product-Concrete-Group : - is-trunc one-𝕋 classifying-type-product-Concrete-Group - is-1-type-classifying-type-product-Concrete-Group X Y = - apply-universal-property-trunc-Prop - ( mere-eq-classifying-type-product-Concrete-Group - shape-product-Concrete-Group - X) - ( is-set-Prop (Id X Y)) - ( λ where - refl → - apply-universal-property-trunc-Prop - ( mere-eq-classifying-type-product-Concrete-Group - shape-product-Concrete-Group - Y) - ( is-set-Prop (Id shape-product-Concrete-Group Y)) - ( λ where refl → is-set-type-product-Concrete-Group)) + abstract + is-1-type-classifying-type-product-Concrete-Group : + is-trunc one-𝕋 classifying-type-product-Concrete-Group + is-1-type-classifying-type-product-Concrete-Group X Y = + apply-universal-property-trunc-Prop + ( mere-eq-classifying-type-product-Concrete-Group + shape-product-Concrete-Group + X) + ( is-set-Prop (Id X Y)) + ( λ where + refl → + apply-universal-property-trunc-Prop + ( mere-eq-classifying-type-product-Concrete-Group + shape-product-Concrete-Group + Y) + ( is-set-Prop (Id shape-product-Concrete-Group Y)) + ( λ where refl → is-set-type-product-Concrete-Group)) classifying-1-type-product-Concrete-Group : Truncated-Type (l1 ⊔ l2) one-𝕋 classifying-1-type-product-Concrete-Group = diff --git a/src/group-theory/generating-elements-groups.lagda.md b/src/group-theory/generating-elements-groups.lagda.md index f3a0ed7a4f..2692b16491 100644 --- a/src/group-theory/generating-elements-groups.lagda.md +++ b/src/group-theory/generating-elements-groups.lagda.md @@ -409,24 +409,26 @@ module _ {l : Level} (G : Group l) (g : type-Group G) where - is-prop-map-ev-element-is-generating-element-Group : - is-generating-element-Group G g → is-prop-map-ev-element-hom-Group G g - is-prop-map-ev-element-is-generating-element-Group U H y = - is-prop-all-elements-equal - ( λ (h , p) (k , q) → - eq-type-subtype - ( λ u → Id-Prop (set-Group H) (ev-element-hom-Group G H g u) y) - ( eq-htpy-hom-Group G H - ( λ x → - apply-universal-property-trunc-Prop - ( is-surjective-hom-element-is-generating-element-Group G g U x) - ( Id-Prop - ( set-Group H) - ( map-hom-Group G H h x) - ( map-hom-Group G H k x)) - ( λ where - ( z , refl) → - eq-integer-power-hom-Group G H h k z g (p ∙ inv q))))) + abstract + is-prop-map-ev-element-is-generating-element-Group : + is-generating-element-Group G g → is-prop-map-ev-element-hom-Group G g + is-prop-map-ev-element-is-generating-element-Group U H y = + is-prop-all-elements-equal + ( λ (h , p) (k , q) → + eq-type-subtype + ( λ u → Id-Prop (set-Group H) (ev-element-hom-Group G H g u) y) + ( eq-htpy-hom-Group G H + ( λ x → + apply-universal-property-trunc-Prop + ( is-surjective-hom-element-is-generating-element-Group + G g U x) + ( Id-Prop + ( set-Group H) + ( map-hom-Group G H h x) + ( map-hom-Group G H k x)) + ( λ where + ( z , refl) → + eq-integer-power-hom-Group G H h k z g (p ∙ inv q))))) is-emb-ev-element-is-generating-element-Group : is-generating-element-Group G g → is-emb-ev-element-hom-Group G g @@ -648,21 +650,22 @@ module _ mul-Group-With-Generating-Element = mul-Ring ring-Group-With-Generating-Element - commutative-mul-Group-With-Generating-Element : - (x y : type-Group-With-Generating-Element G) → - mul-Group-With-Generating-Element x y = - mul-Group-With-Generating-Element y x - commutative-mul-Group-With-Generating-Element x y = - apply-twice-universal-property-trunc-Prop - ( is-surjective-hom-element-Group-With-Generating-Element G x) - ( is-surjective-hom-element-Group-With-Generating-Element G y) - ( Id-Prop (set-Group-With-Generating-Element G) _ _) - ( λ where - ( k , refl) (l , refl) → - commute-integer-multiples-diagonal-Ring - ( ring-Group-With-Generating-Element) - ( k) - ( l)) + abstract + commutative-mul-Group-With-Generating-Element : + (x y : type-Group-With-Generating-Element G) → + mul-Group-With-Generating-Element x y = + mul-Group-With-Generating-Element y x + commutative-mul-Group-With-Generating-Element x y = + apply-twice-universal-property-trunc-Prop + ( is-surjective-hom-element-Group-With-Generating-Element G x) + ( is-surjective-hom-element-Group-With-Generating-Element G y) + ( Id-Prop (set-Group-With-Generating-Element G) _ _) + ( λ where + ( k , refl) (l , refl) → + commute-integer-multiples-diagonal-Ring + ( ring-Group-With-Generating-Element) + ( k) + ( l)) commutative-ring-Group-With-Generating-Element : Commutative-Ring l pr1 commutative-ring-Group-With-Generating-Element = diff --git a/src/group-theory/iterated-cartesian-products-concrete-groups.lagda.md b/src/group-theory/iterated-cartesian-products-concrete-groups.lagda.md index 20278df0a5..444472481c 100644 --- a/src/group-theory/iterated-cartesian-products-concrete-groups.lagda.md +++ b/src/group-theory/iterated-cartesian-products-concrete-groups.lagda.md @@ -113,22 +113,23 @@ module _ type-iterated-product-Concrete-Group , is-set-type-iterated-product-Concrete-Group - is-1-type-classifying-type-iterated-product-Concrete-Group : - is-trunc one-𝕋 classifying-type-iterated-product-Concrete-Group - is-1-type-classifying-type-iterated-product-Concrete-Group X Y = - apply-universal-property-trunc-Prop - ( mere-eq-classifying-type-iterated-product-Concrete-Group - shape-iterated-product-Concrete-Group - X) - ( is-set-Prop (Id X Y)) - ( λ where - refl → - apply-universal-property-trunc-Prop - ( mere-eq-classifying-type-iterated-product-Concrete-Group - shape-iterated-product-Concrete-Group - Y) - ( is-set-Prop (Id shape-iterated-product-Concrete-Group Y)) - ( λ where refl → is-set-type-iterated-product-Concrete-Group)) + abstract + is-1-type-classifying-type-iterated-product-Concrete-Group : + is-trunc one-𝕋 classifying-type-iterated-product-Concrete-Group + is-1-type-classifying-type-iterated-product-Concrete-Group X Y = + apply-universal-property-trunc-Prop + ( mere-eq-classifying-type-iterated-product-Concrete-Group + shape-iterated-product-Concrete-Group + X) + ( is-set-Prop (Id X Y)) + ( λ where + refl → + apply-universal-property-trunc-Prop + ( mere-eq-classifying-type-iterated-product-Concrete-Group + shape-iterated-product-Concrete-Group + Y) + ( is-set-Prop (Id shape-iterated-product-Concrete-Group Y)) + ( λ where refl → is-set-type-iterated-product-Concrete-Group)) classifying-1-type-iterated-product-Concrete-Group : Truncated-Type l one-𝕋 classifying-1-type-iterated-product-Concrete-Group = diff --git a/src/group-theory/normal-closures-subgroups.lagda.md b/src/group-theory/normal-closures-subgroups.lagda.md index 1025d52816..86131f9e8d 100644 --- a/src/group-theory/normal-closures-subgroups.lagda.md +++ b/src/group-theory/normal-closures-subgroups.lagda.md @@ -85,18 +85,20 @@ module _ unit-trunc-Prop ( unit-Group G , (x , h) , compute-conjugation-unit-Group G x) - is-closed-under-conjugation-generating-subset-normal-closure-Subgroup : - is-closed-under-conjugation-subset-Group G - generating-subset-normal-closure-Subgroup - is-closed-under-conjugation-generating-subset-normal-closure-Subgroup x y s = - apply-universal-property-trunc-Prop s - ( generating-subset-normal-closure-Subgroup (conjugation-Group G x y)) - ( λ where - ( z , h , refl) → - unit-trunc-Prop - ( mul-Group G x z , - h , - compute-conjugation-mul-Group G x z (pr1 h))) + abstract + is-closed-under-conjugation-generating-subset-normal-closure-Subgroup : + is-closed-under-conjugation-subset-Group G + generating-subset-normal-closure-Subgroup + is-closed-under-conjugation-generating-subset-normal-closure-Subgroup + x y s = + apply-universal-property-trunc-Prop s + ( generating-subset-normal-closure-Subgroup (conjugation-Group G x y)) + ( λ where + ( z , h , refl) → + unit-trunc-Prop + ( mul-Group G x z , + h , + compute-conjugation-mul-Group G x z (pr1 h))) subgroup-normal-closure-Subgroup : Subgroup (l1 ⊔ l2) G subgroup-normal-closure-Subgroup = @@ -186,15 +188,16 @@ module _ ( u) ( contains-subgroup-normal-closure-Subgroup) - contains-generating-subset-normal-closure-Normal-Subgroup : - {l : Level} (N : Normal-Subgroup l G) → - leq-Subgroup G H (subgroup-Normal-Subgroup G N) → - generating-subset-normal-closure-Subgroup ⊆ subset-Normal-Subgroup G N - contains-generating-subset-normal-closure-Normal-Subgroup N u x g = - apply-universal-property-trunc-Prop g - ( subset-Normal-Subgroup G N x) - ( λ where - ( z , (y , h) , refl) → is-normal-Normal-Subgroup G N z y (u y h)) + abstract + contains-generating-subset-normal-closure-Normal-Subgroup : + {l : Level} (N : Normal-Subgroup l G) → + leq-Subgroup G H (subgroup-Normal-Subgroup G N) → + generating-subset-normal-closure-Subgroup ⊆ subset-Normal-Subgroup G N + contains-generating-subset-normal-closure-Normal-Subgroup N u x g = + apply-universal-property-trunc-Prop g + ( subset-Normal-Subgroup G N x) + ( λ where + ( z , (y , h) , refl) → is-normal-Normal-Subgroup G N z y (u y h)) backward-implication-is-normal-closure-normal-closure-Subgroup : {l : Level} (N : Normal-Subgroup l G) → diff --git a/src/group-theory/torsion-free-groups.lagda.md b/src/group-theory/torsion-free-groups.lagda.md index a265dbd1b5..deed7a3d08 100644 --- a/src/group-theory/torsion-free-groups.lagda.md +++ b/src/group-theory/torsion-free-groups.lagda.md @@ -151,17 +151,18 @@ module _ is-torsion-free-has-unique-torsion-element-Group H x k p = ap pr1 (eq-is-contr H {x , intro-∃ k p} {unit-torsion-element-Group G}) - has-unique-torsion-element-is-torsion-free-Group : - is-torsion-free-Group G → has-unique-torsion-element-Group G - has-unique-torsion-element-is-torsion-free-Group H = - fundamental-theorem-id' - ( λ where x refl → is-torsion-element-unit-Group G) - ( λ x → - is-equiv-is-prop - ( is-set-type-Group G _ _) - ( is-prop-is-torsion-element-Group G x) - ( elim-exists-Prop - ( λ k → Id-Prop (set-Group G) _ _) - ( Id-Prop (set-Group G) _ _) - ( λ k p → inv (H x k p)))) + abstract + has-unique-torsion-element-is-torsion-free-Group : + is-torsion-free-Group G → has-unique-torsion-element-Group G + has-unique-torsion-element-is-torsion-free-Group H = + fundamental-theorem-id' + ( λ where x refl → is-torsion-element-unit-Group G) + ( λ x → + is-equiv-is-prop + ( is-set-type-Group G _ _) + ( is-prop-is-torsion-element-Group G x) + ( elim-exists-Prop + ( λ k → Id-Prop (set-Group G) _ _) + ( Id-Prop (set-Group G) _ _) + ( λ k p → inv (H x k p)))) ``` diff --git a/src/group-theory/trivial-groups.lagda.md b/src/group-theory/trivial-groups.lagda.md index 66840434a0..49f9288f18 100644 --- a/src/group-theory/trivial-groups.lagda.md +++ b/src/group-theory/trivial-groups.lagda.md @@ -54,19 +54,20 @@ module _ {l1 : Level} (G : Group l1) where - is-contr-subgroup-is-trivial-Group : - is-trivial-Group G → is-contr (Subgroup l1 G) - pr1 (is-contr-subgroup-is-trivial-Group H) = - trivial-Subgroup G - pr2 (is-contr-subgroup-is-trivial-Group H) K = - eq-has-same-elements-Subgroup G - ( trivial-Subgroup G) - ( K) - ( λ x → - ( λ where refl → contains-unit-Subgroup G K) , - ( λ _ → - is-closed-under-eq-Subgroup G - ( trivial-Subgroup G) - ( contains-unit-Subgroup G (trivial-Subgroup G)) - ( eq-is-contr H))) + abstract + is-contr-subgroup-is-trivial-Group : + is-trivial-Group G → is-contr (Subgroup l1 G) + pr1 (is-contr-subgroup-is-trivial-Group H) = + trivial-Subgroup G + pr2 (is-contr-subgroup-is-trivial-Group H) K = + eq-has-same-elements-Subgroup G + ( trivial-Subgroup G) + ( K) + ( λ x → + ( λ where refl → contains-unit-Subgroup G K) , + ( λ _ → + is-closed-under-eq-Subgroup G + ( trivial-Subgroup G) + ( contains-unit-Subgroup G (trivial-Subgroup G)) + ( eq-is-contr H))) ``` diff --git a/src/higher-group-theory/transitive-higher-group-actions.lagda.md b/src/higher-group-theory/transitive-higher-group-actions.lagda.md index 8114fad3b9..70373a28b8 100644 --- a/src/higher-group-theory/transitive-higher-group-actions.lagda.md +++ b/src/higher-group-theory/transitive-higher-group-actions.lagda.md @@ -187,17 +187,18 @@ module _ ( f (shape-∞-Group G) refl))) ( H) - is-inhabited-is-transitive-action-∞-Group : - is-transitive-action-∞-Group G X → is-inhabited (type-action-∞-Group G X) - is-inhabited-is-transitive-action-∞-Group H = - apply-universal-property-trunc-Prop - ( is-inhabited-is-0-connected H) - ( is-inhabited-Prop _) - ( λ (u , x) → - apply-universal-property-trunc-Prop - ( mere-eq-classifying-type-∞-Group G (shape-∞-Group G) u) - ( is-inhabited-Prop _) - ( λ where refl → unit-trunc-Prop x)) + abstract + is-inhabited-is-transitive-action-∞-Group : + is-transitive-action-∞-Group G X → is-inhabited (type-action-∞-Group G X) + is-inhabited-is-transitive-action-∞-Group H = + apply-universal-property-trunc-Prop + ( is-inhabited-is-0-connected H) + ( is-inhabited-Prop _) + ( λ (u , x) → + apply-universal-property-trunc-Prop + ( mere-eq-classifying-type-∞-Group G (shape-∞-Group G) u) + ( is-inhabited-Prop _) + ( λ where refl → unit-trunc-Prop x)) is-surjective-mul-right-is-transitive-action-∞-Group : is-transitive-action-∞-Group G X → diff --git a/src/linear-algebra/vectors.lagda.md b/src/linear-algebra/vectors.lagda.md index 0796b8c8a3..3a7bb0216b 100644 --- a/src/linear-algebra/vectors.lagda.md +++ b/src/linear-algebra/vectors.lagda.md @@ -230,17 +230,18 @@ module _ is-section-functional-vec-vec .(succ-ℕ _) (a ∷ v) = ap (λ u → a ∷ u) (is-section-functional-vec-vec _ v) - is-retraction-functional-vec-vec : - (n : ℕ) → (functional-vec-vec n ∘ listed-vec-functional-vec n) ~ id - is-retraction-functional-vec-vec zero-ℕ v = eq-htpy (λ ()) - is-retraction-functional-vec-vec (succ-ℕ n) v = - eq-htpy - ( λ where - ( inl x) → - htpy-eq - ( is-retraction-functional-vec-vec n (tail-functional-vec n v)) - ( x) - ( inr star) → refl) + abstract + is-retraction-functional-vec-vec : + (n : ℕ) → (functional-vec-vec n ∘ listed-vec-functional-vec n) ~ id + is-retraction-functional-vec-vec zero-ℕ v = eq-htpy (λ ()) + is-retraction-functional-vec-vec (succ-ℕ n) v = + eq-htpy + ( λ where + ( inl x) → + htpy-eq + ( is-retraction-functional-vec-vec n (tail-functional-vec n v)) + ( x) + ( inr star) → refl) is-equiv-listed-vec-functional-vec : (n : ℕ) → is-equiv (listed-vec-functional-vec n) diff --git a/src/order-theory/decidable-total-preorders.lagda.md b/src/order-theory/decidable-total-preorders.lagda.md index 4671f7d26c..48f671424d 100644 --- a/src/order-theory/decidable-total-preorders.lagda.md +++ b/src/order-theory/decidable-total-preorders.lagda.md @@ -117,22 +117,23 @@ module _ leq-or-strict-greater-Decidable-Preorder x y = leq-Decidable-Total-Preorder x y + le-Decidable-Total-Preorder y x - helper-is-leq-or-strict-greater-Decidable-Total-Preorder : - (x y : type-Decidable-Total-Preorder) → - is-decidable (leq-Decidable-Total-Preorder x y) → - leq-or-strict-greater-Decidable-Preorder x y - helper-is-leq-or-strict-greater-Decidable-Total-Preorder x y (inl p) = - inl p - helper-is-leq-or-strict-greater-Decidable-Total-Preorder x y (inr p) = - inr - ( ( λ where refl → p (refl-leq-Decidable-Total-Preorder x)) , - ( apply-universal-property-trunc-Prop - ( is-total-Decidable-Total-Preorder y x) - ( leq-Decidable-Total-Preorder-Prop y x) - ( ind-coprod - ( λ _ → leq-Decidable-Total-Preorder y x) - ( id) - ( ex-falso ∘ p)))) + abstract + helper-is-leq-or-strict-greater-Decidable-Total-Preorder : + (x y : type-Decidable-Total-Preorder) → + is-decidable (leq-Decidable-Total-Preorder x y) → + leq-or-strict-greater-Decidable-Preorder x y + helper-is-leq-or-strict-greater-Decidable-Total-Preorder x y (inl p) = + inl p + helper-is-leq-or-strict-greater-Decidable-Total-Preorder x y (inr p) = + inr + ( ( λ where refl → p (refl-leq-Decidable-Total-Preorder x)) , + ( apply-universal-property-trunc-Prop + ( is-total-Decidable-Total-Preorder y x) + ( leq-Decidable-Total-Preorder-Prop y x) + ( ind-coprod + ( λ _ → leq-Decidable-Total-Preorder y x) + ( id) + ( ex-falso ∘ p)))) is-leq-or-strict-greater-Decidable-Total-Preorder : (x y : type-Decidable-Total-Preorder) → diff --git a/src/organic-chemistry/ethane.lagda.md b/src/organic-chemistry/ethane.lagda.md index 9e020b25c9..094c030af6 100644 --- a/src/organic-chemistry/ethane.lagda.md +++ b/src/organic-chemistry/ethane.lagda.md @@ -86,37 +86,38 @@ module _ is-prop-standard-edge-ethane c c' = is-prop-type-Prop (standard-edge-ethane-Prop c c') - is-decidable-edge-ethane-eq-Fin-two : - (p : unordered-pair vertex-ethane) → - type-unordered-pair p = Fin 2 → - is-decidable (edge-ethane p) - is-decidable-edge-ethane-eq-Fin-two p refl with - is-zero-or-one-Fin-two-ℕ (element-unordered-pair p (zero-Fin 1)) | - is-zero-or-one-Fin-two-ℕ (element-unordered-pair p (one-Fin 1)) - ... | inl is-zero | inl is-zero' = - inr - ( λ P → - apply-universal-property-trunc-Prop (pr2 P) empty-Prop - ( λ where - ( inl (inr star) , is-one) → neq-inl-inr (inv is-zero ∙ is-one) - ( inr star , is-one) → neq-inl-inr (inv is-zero' ∙ is-one))) - ... | inl is-zero | inr is-one' = - inl - ( pair - ( unit-trunc-Prop (zero-Fin 1 , is-zero)) - ( unit-trunc-Prop (one-Fin 1 , is-one'))) - ... | inr is-one | inl is-zero' = - inl - ( pair - ( unit-trunc-Prop (one-Fin 1 , is-zero')) - ( unit-trunc-Prop (zero-Fin 1 , is-one))) - ... | inr is-one | inr is-one' = - inr - ( λ P → - apply-universal-property-trunc-Prop (pr1 P) empty-Prop - ( λ where - ( inl (inr star) , is-zero) → neq-inl-inr (inv is-zero ∙ is-one) - ( inr star , is-zero) → neq-inl-inr (inv is-zero ∙ is-one'))) + abstract + is-decidable-edge-ethane-eq-Fin-two : + (p : unordered-pair vertex-ethane) → + type-unordered-pair p = Fin 2 → + is-decidable (edge-ethane p) + is-decidable-edge-ethane-eq-Fin-two p refl with + is-zero-or-one-Fin-two-ℕ (element-unordered-pair p (zero-Fin 1)) | + is-zero-or-one-Fin-two-ℕ (element-unordered-pair p (one-Fin 1)) + ... | inl is-zero | inl is-zero' = + inr + ( λ P → + apply-universal-property-trunc-Prop (pr2 P) empty-Prop + ( λ where + ( inl (inr star) , is-one) → neq-inl-inr (inv is-zero ∙ is-one) + ( inr star , is-one) → neq-inl-inr (inv is-zero' ∙ is-one))) + ... | inl is-zero | inr is-one' = + inl + ( pair + ( unit-trunc-Prop (zero-Fin 1 , is-zero)) + ( unit-trunc-Prop (one-Fin 1 , is-one'))) + ... | inr is-one | inl is-zero' = + inl + ( pair + ( unit-trunc-Prop (one-Fin 1 , is-zero')) + ( unit-trunc-Prop (zero-Fin 1 , is-one))) + ... | inr is-one | inr is-one' = + inr + ( λ P → + apply-universal-property-trunc-Prop (pr1 P) empty-Prop + ( λ where + ( inl (inr star) , is-zero) → neq-inl-inr (inv is-zero ∙ is-one) + ( inr star , is-zero) → neq-inl-inr (inv is-zero ∙ is-one'))) is-decidable-standard-edge-ethane : (c c' : vertex-ethane) → is-decidable (standard-edge-ethane c c') @@ -150,41 +151,42 @@ module _ vertex-tetrahedron-in-3-space t bonding-ethane c e = v - is-contr-standard-edge-ethane : - (c : vertex-ethane) → - is-contr (Σ (vertex-ethane) (λ c' → standard-edge-ethane c c')) - pr1 (pr1 (is-contr-standard-edge-ethane (inl (inr star)))) = one-Fin 1 - pr1 (pr2 (pr1 (is-contr-standard-edge-ethane (inl (inr star))))) = - unit-trunc-Prop (zero-Fin 1 , refl) - pr2 (pr2 (pr1 (is-contr-standard-edge-ethane (inl (inr star))))) = - unit-trunc-Prop (one-Fin 1 , refl) - pr2 (is-contr-standard-edge-ethane (inl (inr star))) (inl (inr star) , P) = - ex-falso - ( apply-universal-property-trunc-Prop (pr2 P) empty-Prop - ( λ where - ( inl (inr star) , is-one) → neq-inl-inr is-one - ( inr star , is-one) → neq-inl-inr is-one)) - pr2 (is-contr-standard-edge-ethane (inl (inr star))) (inr star , P) = - eq-pair-Σ refl - ( eq-is-prop - ( is-prop-edge-ethane - ( standard-unordered-pair (inl (inr star)) (inr star)))) - pr1 (pr1 (is-contr-standard-edge-ethane (inr star))) = zero-Fin 1 - pr1 (pr2 (pr1 (is-contr-standard-edge-ethane (inr star)))) = - unit-trunc-Prop (one-Fin 1 , refl) - pr2 (pr2 (pr1 (is-contr-standard-edge-ethane (inr star)))) = - unit-trunc-Prop (zero-Fin 1 , refl) - pr2 (is-contr-standard-edge-ethane (inr star)) (inl (inr star) , P) = - eq-pair-Σ refl - ( eq-is-prop - ( is-prop-edge-ethane - ( standard-unordered-pair (inr star) (inl (inr star))))) - pr2 (is-contr-standard-edge-ethane (inr star)) (inr star , P) = - ex-falso - ( apply-universal-property-trunc-Prop (pr1 P) empty-Prop - ( λ where - ( inl (inr star) , is-zero) → neq-inr-inl is-zero - ( inr star , is-zero) → neq-inr-inl is-zero)) + abstract + is-contr-standard-edge-ethane : + (c : vertex-ethane) → + is-contr (Σ (vertex-ethane) (λ c' → standard-edge-ethane c c')) + pr1 (pr1 (is-contr-standard-edge-ethane (inl (inr star)))) = one-Fin 1 + pr1 (pr2 (pr1 (is-contr-standard-edge-ethane (inl (inr star))))) = + unit-trunc-Prop (zero-Fin 1 , refl) + pr2 (pr2 (pr1 (is-contr-standard-edge-ethane (inl (inr star))))) = + unit-trunc-Prop (one-Fin 1 , refl) + pr2 (is-contr-standard-edge-ethane (inl (inr star))) (inl (inr star) , P) = + ex-falso + ( apply-universal-property-trunc-Prop (pr2 P) empty-Prop + ( λ where + ( inl (inr star) , is-one) → neq-inl-inr is-one + ( inr star , is-one) → neq-inl-inr is-one)) + pr2 (is-contr-standard-edge-ethane (inl (inr star))) (inr star , P) = + eq-pair-Σ refl + ( eq-is-prop + ( is-prop-edge-ethane + ( standard-unordered-pair (inl (inr star)) (inr star)))) + pr1 (pr1 (is-contr-standard-edge-ethane (inr star))) = zero-Fin 1 + pr1 (pr2 (pr1 (is-contr-standard-edge-ethane (inr star)))) = + unit-trunc-Prop (one-Fin 1 , refl) + pr2 (pr2 (pr1 (is-contr-standard-edge-ethane (inr star)))) = + unit-trunc-Prop (zero-Fin 1 , refl) + pr2 (is-contr-standard-edge-ethane (inr star)) (inl (inr star) , P) = + eq-pair-Σ refl + ( eq-is-prop + ( is-prop-edge-ethane + ( standard-unordered-pair (inr star) (inl (inr star))))) + pr2 (is-contr-standard-edge-ethane (inr star)) (inr star , P) = + ex-falso + ( apply-universal-property-trunc-Prop (pr1 P) empty-Prop + ( λ where + ( inl (inr star) , is-zero) → neq-inr-inl is-zero + ( inr star , is-zero) → neq-inr-inl is-zero)) abstract is-emb-bonding-ethane : (c : vertex-ethane) → is-emb (bonding-ethane c) @@ -224,71 +226,72 @@ module _ (inr star) (inr star) = star - ethane : hydrocarbon lzero lzero - pr1 ethane = finite-graph-ethane - pr1 (pr2 ethane) c = t - pr1 (pr2 (pr2 ethane)) = emb-bonding-ethane - pr1 (pr2 (pr2 (pr2 ethane))) (inl (inr star)) P = - apply-universal-property-trunc-Prop (pr2 P) empty-Prop - ( λ where - ( inl (inr star) , is-one) → neq-inl-inr is-one - ( inr star , is-one) → neq-inl-inr is-one) - pr1 (pr2 (pr2 (pr2 ethane))) (inr star) P = - apply-universal-property-trunc-Prop (pr1 P) empty-Prop - ( λ where - ( inl (inr star) , is-zero) → neq-inr-inl is-zero - ( inr star , is-zero) → neq-inr-inl is-zero) - pr1 (pr2 (pr2 (pr2 (pr2 ethane)))) c c' = - concatenate-eq-leq-ℕ 3 - ( inv - ( compute-number-of-elements-is-finite - ( count-standard-edge-ethane c c') - ( is-finite-edge-ethane (standard-unordered-pair c c')))) - (number-of-elements-count-standard-edge-ethane-leq-3 c c') - pr2 (pr2 (pr2 (pr2 (pr2 ethane)))) (inl (inr star)) (inl (inr star)) = - unit-trunc-Prop refl-walk-Undirected-Graph - pr2 (pr2 (pr2 (pr2 (pr2 ethane)))) (inl (inr star)) (inr star) = - unit-trunc-Prop - ( tr - ( λ x → - walk-Undirected-Graph - ( undirected-graph-Undirected-Graph-𝔽 finite-graph-ethane) + abstract + ethane : hydrocarbon lzero lzero + pr1 ethane = finite-graph-ethane + pr1 (pr2 ethane) c = t + pr1 (pr2 (pr2 ethane)) = emb-bonding-ethane + pr1 (pr2 (pr2 (pr2 ethane))) (inl (inr star)) P = + apply-universal-property-trunc-Prop (pr2 P) empty-Prop + ( λ where + ( inl (inr star) , is-one) → neq-inl-inr is-one + ( inr star , is-one) → neq-inl-inr is-one) + pr1 (pr2 (pr2 (pr2 ethane))) (inr star) P = + apply-universal-property-trunc-Prop (pr1 P) empty-Prop + ( λ where + ( inl (inr star) , is-zero) → neq-inr-inl is-zero + ( inr star , is-zero) → neq-inr-inl is-zero) + pr1 (pr2 (pr2 (pr2 (pr2 ethane)))) c c' = + concatenate-eq-leq-ℕ 3 + ( inv + ( compute-number-of-elements-is-finite + ( count-standard-edge-ethane c c') + ( is-finite-edge-ethane (standard-unordered-pair c c')))) + (number-of-elements-count-standard-edge-ethane-leq-3 c c') + pr2 (pr2 (pr2 (pr2 (pr2 ethane)))) (inl (inr star)) (inl (inr star)) = + unit-trunc-Prop refl-walk-Undirected-Graph + pr2 (pr2 (pr2 (pr2 (pr2 ethane)))) (inl (inr star)) (inr star) = + unit-trunc-Prop + ( tr + ( λ x → + walk-Undirected-Graph + ( undirected-graph-Undirected-Graph-𝔽 finite-graph-ethane) + ( zero-Fin 1) + ( element-standard-unordered-pair (zero-Fin 1) (one-Fin 1) x)) + ( compute-swap-2-Element-Type + ( Fin-UU-Fin' 2) + ( zero-Fin 1) + ( one-Fin 1) + ( neq-inl-inr)) + ( cons-walk-Undirected-Graph + ( standard-unordered-pair (zero-Fin 1) (one-Fin 1)) + ( pair + ( unit-trunc-Prop (zero-Fin 1 , refl)) + ( unit-trunc-Prop (one-Fin 1 , refl))) + { zero-Fin 1} + ( refl-walk-Undirected-Graph))) + pr2 (pr2 (pr2 (pr2 (pr2 ethane)))) (inr star) (inl (inr star)) = + unit-trunc-Prop + ( tr + ( λ x → + walk-Undirected-Graph + ( undirected-graph-Undirected-Graph-𝔽 finite-graph-ethane) + ( one-Fin 1) + ( element-standard-unordered-pair (one-Fin 1) (zero-Fin 1) x)) + ( compute-swap-2-Element-Type + ( Fin-UU-Fin' 2) ( zero-Fin 1) - ( element-standard-unordered-pair (zero-Fin 1) (one-Fin 1) x)) - ( compute-swap-2-Element-Type - ( Fin-UU-Fin' 2) - ( zero-Fin 1) - ( one-Fin 1) - ( neq-inl-inr)) - ( cons-walk-Undirected-Graph - ( standard-unordered-pair (zero-Fin 1) (one-Fin 1)) - ( pair - ( unit-trunc-Prop (zero-Fin 1 , refl)) - ( unit-trunc-Prop (one-Fin 1 , refl))) - { zero-Fin 1} - ( refl-walk-Undirected-Graph))) - pr2 (pr2 (pr2 (pr2 (pr2 ethane)))) (inr star) (inl (inr star)) = - unit-trunc-Prop - ( tr - ( λ x → - walk-Undirected-Graph - ( undirected-graph-Undirected-Graph-𝔽 finite-graph-ethane) ( one-Fin 1) - ( element-standard-unordered-pair (one-Fin 1) (zero-Fin 1) x)) - ( compute-swap-2-Element-Type - ( Fin-UU-Fin' 2) - ( zero-Fin 1) - ( one-Fin 1) - ( neq-inl-inr)) - ( cons-walk-Undirected-Graph - ( standard-unordered-pair (one-Fin 1) (zero-Fin 1)) - ( pair - ( unit-trunc-Prop (one-Fin 1 , refl)) - ( unit-trunc-Prop (zero-Fin 1 , refl))) - { zero-Fin 1} - ( refl-walk-Undirected-Graph))) - pr2 (pr2 (pr2 (pr2 (pr2 ethane)))) (inr star) (inr star) = - unit-trunc-Prop refl-walk-Undirected-Graph + ( neq-inl-inr)) + ( cons-walk-Undirected-Graph + ( standard-unordered-pair (one-Fin 1) (zero-Fin 1)) + ( pair + ( unit-trunc-Prop (one-Fin 1 , refl)) + ( unit-trunc-Prop (zero-Fin 1 , refl))) + { zero-Fin 1} + ( refl-walk-Undirected-Graph))) + pr2 (pr2 (pr2 (pr2 (pr2 ethane)))) (inr star) (inr star) = + unit-trunc-Prop refl-walk-Undirected-Graph is-alkane-ethane : is-alkane-hydrocarbon ethane is-alkane-ethane = is-prop-standard-edge-ethane diff --git a/src/organic-chemistry/methane.lagda.md b/src/organic-chemistry/methane.lagda.md index 2c85ac927e..8375a68df0 100644 --- a/src/organic-chemistry/methane.lagda.md +++ b/src/organic-chemistry/methane.lagda.md @@ -30,7 +30,7 @@ open import univalent-combinatorics.finite-types ## Idea -**Methane** is the simpliest hydrocarbon, and the first alkane. +**Methane** is the simplest hydrocarbon, and the first alkane. ## Definition @@ -40,18 +40,19 @@ module _ where methane : hydrocarbon lzero lzero - methane = - ( unit-𝔽 , (λ x → empty-𝔽)) , - ( λ c → t) , - ( λ c → (λ e → ex-falso (pr2 e)) , λ e _ → ex-falso (pr2 e)) , - ( λ c x → x) , - ( λ c c' → - concatenate-eq-leq-ℕ - ( 3) - ( inv - ( compute-number-of-elements-is-finite count-empty is-finite-empty)) - ( star)) , - ( λ where star star → unit-trunc-Prop refl-walk-Undirected-Graph) + pr1 (pr1 methane) = unit-𝔽 + pr2 (pr1 methane) x = empty-𝔽 + pr1 (pr2 methane) c = t + pr1 (pr1 (pr2 (pr2 methane)) c) e = ex-falso (pr2 e) + pr2 (pr1 (pr2 (pr2 methane)) c) e = ex-falso (pr2 e) + pr1 (pr2 (pr2 (pr2 methane))) c x = x + pr1 (pr2 (pr2 (pr2 (pr2 methane)))) c c' = + concatenate-eq-leq-ℕ + ( 3) + ( inv (compute-number-of-elements-is-finite count-empty is-finite-empty)) + ( star) + pr2 (pr2 (pr2 (pr2 (pr2 methane)))) star star = + unit-trunc-Prop refl-walk-Undirected-Graph is-alkane-methane : is-alkane-hydrocarbon methane is-alkane-methane c c' e e' = is-prop-empty e e' diff --git a/src/ring-theory/ideals-generated-by-subsets-rings.lagda.md b/src/ring-theory/ideals-generated-by-subsets-rings.lagda.md index aa9b617ef4..4f72a0479e 100644 --- a/src/ring-theory/ideals-generated-by-subsets-rings.lagda.md +++ b/src/ring-theory/ideals-generated-by-subsets-rings.lagda.md @@ -520,18 +520,19 @@ module _ ( a i) ( unit-trunc-Prop (i , refl)) - is-ideal-generated-by-family-of-elements-ideal-family-of-elements-Ring : - is-ideal-generated-by-family-of-elements-Ring R a - ideal-family-of-elements-Ring - contains-element-ideal-family-of-elements-Ring - is-ideal-generated-by-family-of-elements-ideal-family-of-elements-Ring J H = - is-ideal-generated-by-subset-ideal-subset-Ring R - ( generating-subset-ideal-family-of-elements-Ring) - ( J) - ( λ x p → - apply-universal-property-trunc-Prop p - ( subset-ideal-Ring R J x) - ( λ where (i , refl) → H)) + abstract + is-ideal-generated-by-family-of-elements-ideal-family-of-elements-Ring : + is-ideal-generated-by-family-of-elements-Ring R a + ideal-family-of-elements-Ring + contains-element-ideal-family-of-elements-Ring + is-ideal-generated-by-family-of-elements-ideal-family-of-elements-Ring J H = + is-ideal-generated-by-subset-ideal-subset-Ring R + ( generating-subset-ideal-family-of-elements-Ring) + ( J) + ( λ x p → + apply-universal-property-trunc-Prop p + ( subset-ideal-Ring R J x) + ( λ where (i , refl) → H)) ``` ## Properties @@ -556,15 +557,16 @@ module _ ( is-closed-under-left-multiplication-ideal-Ring R I _ _ (pr2 u))) ( cases-forward-inclusion-idempotent-ideal-subset-Ring l) - forward-inclusion-idempotent-ideal-subset-Ring : - leq-ideal-Ring R - ( ideal-subset-Ring R (subset-ideal-Ring R I)) - ( I) - forward-inclusion-idempotent-ideal-subset-Ring x H = - apply-universal-property-trunc-Prop H - ( subset-ideal-Ring R I x) - ( λ where - ( l , refl) → cases-forward-inclusion-idempotent-ideal-subset-Ring l) + abstract + forward-inclusion-idempotent-ideal-subset-Ring : + leq-ideal-Ring R + ( ideal-subset-Ring R (subset-ideal-Ring R I)) + ( I) + forward-inclusion-idempotent-ideal-subset-Ring x H = + apply-universal-property-trunc-Prop H + ( subset-ideal-Ring R I x) + ( λ where + ( l , refl) → cases-forward-inclusion-idempotent-ideal-subset-Ring l) backward-inclusion-idempotent-ideal-subset-Ring : leq-ideal-Ring R diff --git a/src/ring-theory/left-ideals-generated-by-subsets-rings.lagda.md b/src/ring-theory/left-ideals-generated-by-subsets-rings.lagda.md index f972225adf..a506870555 100644 --- a/src/ring-theory/left-ideals-generated-by-subsets-rings.lagda.md +++ b/src/ring-theory/left-ideals-generated-by-subsets-rings.lagda.md @@ -485,19 +485,20 @@ module _ ( a i) ( unit-trunc-Prop (i , refl)) - is-left-ideal-generated-by-family-of-elements-left-ideal-family-of-elements-Ring : - is-left-ideal-generated-by-family-of-elements-Ring R a - left-ideal-family-of-elements-Ring - contains-element-left-ideal-family-of-elements-Ring - is-left-ideal-generated-by-family-of-elements-left-ideal-family-of-elements-Ring - J H = - is-left-ideal-generated-by-subset-left-ideal-subset-Ring R - ( generating-subset-left-ideal-family-of-elements-Ring) - ( J) - ( λ x p → - apply-universal-property-trunc-Prop p - ( subset-left-ideal-Ring R J x) - ( λ where (i , refl) → H i)) + abstract + is-left-ideal-generated-by-family-of-elements-left-ideal-family-of-elements-Ring : + is-left-ideal-generated-by-family-of-elements-Ring R a + left-ideal-family-of-elements-Ring + contains-element-left-ideal-family-of-elements-Ring + is-left-ideal-generated-by-family-of-elements-left-ideal-family-of-elements-Ring + J H = + is-left-ideal-generated-by-subset-left-ideal-subset-Ring R + ( generating-subset-left-ideal-family-of-elements-Ring) + ( J) + ( λ x p → + apply-universal-property-trunc-Prop p + ( subset-left-ideal-Ring R J x) + ( λ where (i , refl) → H i)) ``` ## Properties @@ -521,16 +522,17 @@ module _ ( is-closed-under-left-multiplication-left-ideal-Ring R I x y u) ( cases-forward-inclusion-idempotent-left-ideal-subset-Ring l) - forward-inclusion-idempotent-left-ideal-subset-Ring : - leq-left-ideal-Ring R - ( left-ideal-subset-Ring R (subset-left-ideal-Ring R I)) - ( I) - forward-inclusion-idempotent-left-ideal-subset-Ring x H = - apply-universal-property-trunc-Prop H - ( subset-left-ideal-Ring R I x) - ( λ where - ( l , refl) → - cases-forward-inclusion-idempotent-left-ideal-subset-Ring l) + abstract + forward-inclusion-idempotent-left-ideal-subset-Ring : + leq-left-ideal-Ring R + ( left-ideal-subset-Ring R (subset-left-ideal-Ring R I)) + ( I) + forward-inclusion-idempotent-left-ideal-subset-Ring x H = + apply-universal-property-trunc-Prop H + ( subset-left-ideal-Ring R I x) + ( λ where + ( l , refl) → + cases-forward-inclusion-idempotent-left-ideal-subset-Ring l) backward-inclusion-idempotent-left-ideal-subset-Ring : leq-left-ideal-Ring R diff --git a/src/ring-theory/products-subsets-rings.lagda.md b/src/ring-theory/products-subsets-rings.lagda.md index 3ff67238b9..157d8910ef 100644 --- a/src/ring-theory/products-subsets-rings.lagda.md +++ b/src/ring-theory/products-subsets-rings.lagda.md @@ -53,33 +53,37 @@ module _ {I : UU l3} (T : I → subset-Ring l4 A) where - forward-inclusion-distributive-product-union-family-of-subsets-Ring : - product-subset-Ring A S (union-family-of-subtypes T) ⊆ - union-family-of-subtypes (λ i → product-subset-Ring A S (T i)) - forward-inclusion-distributive-product-union-family-of-subsets-Ring x p = - apply-universal-property-trunc-Prop p - ( union-family-of-subtypes (λ i → product-subset-Ring A S (T i)) x) - ( λ where - ( ( s , Hs) , (t , Ht) , refl) → - apply-universal-property-trunc-Prop Ht - ( union-family-of-subtypes (λ i → product-subset-Ring A S (T i)) x) - ( λ (i , Ht') → - unit-trunc-Prop - ( i , unit-trunc-Prop ((s , Hs) , (t , Ht') , refl)))) - - backward-inclusion-distributive-product-union-family-of-subsets-Ring : - union-family-of-subtypes (λ i → product-subset-Ring A S (T i)) ⊆ - product-subset-Ring A S (union-family-of-subtypes T) - backward-inclusion-distributive-product-union-family-of-subsets-Ring x p = - apply-universal-property-trunc-Prop p - ( product-subset-Ring A S (union-family-of-subtypes T) x) - ( λ (i , u) → - apply-universal-property-trunc-Prop u - ( product-subset-Ring A S (union-family-of-subtypes T) x) - ( λ where - ( ( s , Hs) , (t , Ht) , refl) → - unit-trunc-Prop - ( (s , Hs) , (t , unit-trunc-Prop (i , Ht)) , refl))) + abstract + forward-inclusion-distributive-product-union-family-of-subsets-Ring : + product-subset-Ring A S (union-family-of-subtypes T) ⊆ + union-family-of-subtypes (λ i → product-subset-Ring A S (T i)) + forward-inclusion-distributive-product-union-family-of-subsets-Ring x p = + apply-universal-property-trunc-Prop p + ( union-family-of-subtypes (λ i → product-subset-Ring A S (T i)) x) + ( λ where + ( ( s , Hs) , (t , Ht) , refl) → + apply-universal-property-trunc-Prop Ht + ( union-family-of-subtypes + ( λ i → product-subset-Ring A S (T i)) + ( x)) + ( λ (i , Ht') → + unit-trunc-Prop + ( i , unit-trunc-Prop ((s , Hs) , (t , Ht') , refl)))) + + abstract + backward-inclusion-distributive-product-union-family-of-subsets-Ring : + union-family-of-subtypes (λ i → product-subset-Ring A S (T i)) ⊆ + product-subset-Ring A S (union-family-of-subtypes T) + backward-inclusion-distributive-product-union-family-of-subsets-Ring x p = + apply-universal-property-trunc-Prop p + ( product-subset-Ring A S (union-family-of-subtypes T) x) + ( λ (i , u) → + apply-universal-property-trunc-Prop u + ( product-subset-Ring A S (union-family-of-subtypes T) x) + ( λ where + ( ( s , Hs) , (t , Ht) , refl) → + unit-trunc-Prop + ( (s , Hs) , (t , unit-trunc-Prop (i , Ht)) , refl))) distributive-product-union-family-of-subsets-Ring : product-subset-Ring A S (union-family-of-subtypes T) = @@ -102,59 +106,61 @@ module _ (T : subset-Ring l4 A) where - forward-inclusion-associative-product-subset-Ring : - ( product-subset-Ring A - ( product-subset-Ring A R S) - ( T)) ⊆ - ( product-subset-Ring A - ( R) - ( product-subset-Ring A S T)) - forward-inclusion-associative-product-subset-Ring x H = - apply-universal-property-trunc-Prop H - ( product-subset-Ring A R - ( product-subset-Ring A S T) - ( x)) - ( λ where - ( ( u , K) , (t , Ht) , refl) → - apply-universal-property-trunc-Prop K - ( product-subset-Ring A R - ( product-subset-Ring A S T) - ( _)) - ( λ where - ( ( r , Hr) , (s , Hs) , refl) → - unit-trunc-Prop - ( ( r , Hr) , - ( ( mul-Ring A s t) , - ( unit-trunc-Prop ((s , Hs) , (t , Ht) , refl))) , - ( associative-mul-Ring A r s t)))) - - backward-inclusion-associative-product-subset-Ring : - ( product-subset-Ring A - ( R) - ( product-subset-Ring A S T)) ⊆ - ( product-subset-Ring A - ( product-subset-Ring A R S) - ( T)) - backward-inclusion-associative-product-subset-Ring x H = - apply-universal-property-trunc-Prop H + abstract + forward-inclusion-associative-product-subset-Ring : ( product-subset-Ring A ( product-subset-Ring A R S) - ( T) - ( x)) - ( λ where - ( ( r , Hr) , (v , K) , refl) → - apply-universal-property-trunc-Prop K - ( product-subset-Ring A - ( product-subset-Ring A R S) - ( T) - ( _)) - ( λ where - ( ( s , Hs) , (t , Ht) , refl) → - unit-trunc-Prop - ( ( ( mul-Ring A r s) , - ( unit-trunc-Prop ((r , Hr) , (s , Hs) , refl))) , - ( t , Ht) , - ( inv (associative-mul-Ring A r s t))))) + ( T)) ⊆ + ( product-subset-Ring A + ( R) + ( product-subset-Ring A S T)) + forward-inclusion-associative-product-subset-Ring x H = + apply-universal-property-trunc-Prop H + ( product-subset-Ring A R + ( product-subset-Ring A S T) + ( x)) + ( λ where + ( ( u , K) , (t , Ht) , refl) → + apply-universal-property-trunc-Prop K + ( product-subset-Ring A R + ( product-subset-Ring A S T) + ( _)) + ( λ where + ( ( r , Hr) , (s , Hs) , refl) → + unit-trunc-Prop + ( ( r , Hr) , + ( ( mul-Ring A s t) , + ( unit-trunc-Prop ((s , Hs) , (t , Ht) , refl))) , + ( associative-mul-Ring A r s t)))) + + abstract + backward-inclusion-associative-product-subset-Ring : + ( product-subset-Ring A + ( R) + ( product-subset-Ring A S T)) ⊆ + ( product-subset-Ring A + ( product-subset-Ring A R S) + ( T)) + backward-inclusion-associative-product-subset-Ring x H = + apply-universal-property-trunc-Prop H + ( product-subset-Ring A + ( product-subset-Ring A R S) + ( T) + ( x)) + ( λ where + ( ( r , Hr) , (v , K) , refl) → + apply-universal-property-trunc-Prop K + ( product-subset-Ring A + ( product-subset-Ring A R S) + ( T) + ( _)) + ( λ where + ( ( s , Hs) , (t , Ht) , refl) → + unit-trunc-Prop + ( ( ( mul-Ring A r s) , + ( unit-trunc-Prop ((r , Hr) , (s , Hs) , refl))) , + ( t , Ht) , + ( inv (associative-mul-Ring A r s t))))) associative-product-subset-Ring : product-subset-Ring A diff --git a/src/ring-theory/right-ideals-generated-by-subsets-rings.lagda.md b/src/ring-theory/right-ideals-generated-by-subsets-rings.lagda.md index 9d7b3e32a4..237aaa0d0a 100644 --- a/src/ring-theory/right-ideals-generated-by-subsets-rings.lagda.md +++ b/src/ring-theory/right-ideals-generated-by-subsets-rings.lagda.md @@ -484,19 +484,20 @@ module _ ( a i) ( unit-trunc-Prop (i , refl)) - is-right-ideal-generated-by-family-of-elements-right-ideal-family-of-elements-Ring : - is-right-ideal-generated-by-family-of-elements-Ring R a - right-ideal-family-of-elements-Ring - contains-element-right-ideal-family-of-elements-Ring - is-right-ideal-generated-by-family-of-elements-right-ideal-family-of-elements-Ring - J H = - is-right-ideal-generated-by-subset-right-ideal-subset-Ring R - ( generating-subset-right-ideal-family-of-elements-Ring) - ( J) - ( λ x p → - apply-universal-property-trunc-Prop p - ( subset-right-ideal-Ring R J x) - ( λ where (i , refl) → H i)) + abstract + is-right-ideal-generated-by-family-of-elements-right-ideal-family-of-elements-Ring : + is-right-ideal-generated-by-family-of-elements-Ring R a + right-ideal-family-of-elements-Ring + contains-element-right-ideal-family-of-elements-Ring + is-right-ideal-generated-by-family-of-elements-right-ideal-family-of-elements-Ring + J H = + is-right-ideal-generated-by-subset-right-ideal-subset-Ring R + ( generating-subset-right-ideal-family-of-elements-Ring) + ( J) + ( λ x p → + apply-universal-property-trunc-Prop p + ( subset-right-ideal-Ring R J x) + ( λ where (i , refl) → H i)) ``` ## Properties @@ -521,16 +522,17 @@ module _ ( is-closed-under-right-multiplication-right-ideal-Ring R I x y u) ( cases-forward-inclusion-idempotent-right-ideal-subset-Ring l) - forward-inclusion-idempotent-right-ideal-subset-Ring : - leq-right-ideal-Ring R - ( right-ideal-subset-Ring R (subset-right-ideal-Ring R I)) - ( I) - forward-inclusion-idempotent-right-ideal-subset-Ring x H = - apply-universal-property-trunc-Prop H - ( subset-right-ideal-Ring R I x) - ( λ where - ( l , refl) → - cases-forward-inclusion-idempotent-right-ideal-subset-Ring l) + abstract + forward-inclusion-idempotent-right-ideal-subset-Ring : + leq-right-ideal-Ring R + ( right-ideal-subset-Ring R (subset-right-ideal-Ring R I)) + ( I) + forward-inclusion-idempotent-right-ideal-subset-Ring x H = + apply-universal-property-trunc-Prop H + ( subset-right-ideal-Ring R I x) + ( λ where + ( l , refl) → + cases-forward-inclusion-idempotent-right-ideal-subset-Ring l) backward-inclusion-idempotent-right-ideal-subset-Ring : leq-right-ideal-Ring R diff --git a/src/set-theory/countable-sets.lagda.md b/src/set-theory/countable-sets.lagda.md index be612bee8c..b80c9c5341 100644 --- a/src/set-theory/countable-sets.lagda.md +++ b/src/set-theory/countable-sets.lagda.md @@ -143,24 +143,25 @@ module _ is-surjective-f : is-surjective f is-surjective-f x = unit-trunc-Prop (pair (inl x) refl) - is-countable-is-directly-countable : - is-directly-countable X → is-countable X - is-countable-is-directly-countable H = - apply-universal-property-trunc-Prop H - ( is-countable-Prop X) - ( λ P → - unit-trunc-Prop - ( ( λ where - zero-ℕ → inr star - (succ-ℕ n) → inl ((shift-ℕ a (pr1 P)) n)) , - ( λ where - ( inl x) → - apply-universal-property-trunc-Prop (pr2 P x) - ( trunc-Prop (fiber _ (inl x))) - ( λ (n , p) → - unit-trunc-Prop - ( succ-ℕ (succ-ℕ n) , ap inl p)) - ( inr star) → unit-trunc-Prop (zero-ℕ , refl)))) + abstract + is-countable-is-directly-countable : + is-directly-countable X → is-countable X + is-countable-is-directly-countable H = + apply-universal-property-trunc-Prop H + ( is-countable-Prop X) + ( λ P → + unit-trunc-Prop + ( ( λ where + zero-ℕ → inr star + (succ-ℕ n) → inl ((shift-ℕ a (pr1 P)) n)) , + ( λ where + ( inl x) → + apply-universal-property-trunc-Prop (pr2 P x) + ( trunc-Prop (fiber _ (inl x))) + ( λ (n , p) → + unit-trunc-Prop + ( succ-ℕ (succ-ℕ n) , ap inl p)) + ( inr star) → unit-trunc-Prop (zero-ℕ , refl)))) ``` ## Properties @@ -243,27 +244,28 @@ module _ ( n) (pr2 (pr2 (shift-decidable-subtype-ℕ n))) - is-surjective-map-enumeration-decidable-subprojection-ℕ : - ( is-surjective f) → - ( is-surjective map-enumeration-decidable-subprojection-ℕ) - is-surjective-map-enumeration-decidable-subprojection-ℕ H (inl x) = - ( apply-universal-property-trunc-Prop (H x) - ( trunc-Prop (fiber map-enumeration-decidable-subprojection-ℕ (inl x))) - ( λ where - ( ( n , s) , refl) → - unit-trunc-Prop - ( ( succ-ℕ n) , - ( ap - ( cases-map-decidable-subtype-ℕ X - ( shift-decidable-subtype-ℕ) - ( map-shift-decidable-subtype-ℕ) - (succ-ℕ n)) - ( pr1 - ( is-prop-is-decidable (pr1 (pr2 (P n))) - ( pr2 (pr2 (P n))) - ( inl s))))))) - is-surjective-map-enumeration-decidable-subprojection-ℕ H (inr star) = - ( unit-trunc-Prop (0 , refl)) + abstract + is-surjective-map-enumeration-decidable-subprojection-ℕ : + ( is-surjective f) → + ( is-surjective map-enumeration-decidable-subprojection-ℕ) + is-surjective-map-enumeration-decidable-subprojection-ℕ H (inl x) = + ( apply-universal-property-trunc-Prop (H x) + ( trunc-Prop (fiber map-enumeration-decidable-subprojection-ℕ (inl x))) + ( λ where + ( ( n , s) , refl) → + unit-trunc-Prop + ( ( succ-ℕ n) , + ( ap + ( cases-map-decidable-subtype-ℕ X + ( shift-decidable-subtype-ℕ) + ( map-shift-decidable-subtype-ℕ) + (succ-ℕ n)) + ( pr1 + ( is-prop-is-decidable (pr1 (pr2 (P n))) + ( pr2 (pr2 (P n))) + ( inl s))))))) + is-surjective-map-enumeration-decidable-subprojection-ℕ H (inr star) = + ( unit-trunc-Prop (0 , refl)) module _ {l : Level} (X : Set l) @@ -333,15 +335,16 @@ module _ The set of natural numbers ℕ is itself countable. ```agda -is-countable-ℕ : is-countable ℕ-Set -is-countable-ℕ = - unit-trunc-Prop - ( ( λ where - zero-ℕ → inr star - (succ-ℕ n) → inl n) , - ( λ where - ( inl n) → unit-trunc-Prop (succ-ℕ n , refl) - ( inr star) → unit-trunc-Prop (zero-ℕ , refl))) +abstract + is-countable-ℕ : is-countable ℕ-Set + is-countable-ℕ = + unit-trunc-Prop + ( ( λ where + zero-ℕ → inr star + (succ-ℕ n) → inl n) , + ( λ where + ( inl n) → unit-trunc-Prop (succ-ℕ n , refl) + ( inr star) → unit-trunc-Prop (zero-ℕ , refl))) ``` The empty set is countable. @@ -357,15 +360,16 @@ is-countable-empty = The unit set is countable. ```agda -is-countable-unit : is-countable unit-Set -is-countable-unit = - unit-trunc-Prop - ( ( λ where - zero-ℕ → inl star - (succ-ℕ x) → inr star) , - ( λ where - ( inl star) → unit-trunc-Prop (0 , refl) - ( inr star) → unit-trunc-Prop (1 , refl))) +abstract + is-countable-unit : is-countable unit-Set + is-countable-unit = + unit-trunc-Prop + ( ( λ where + zero-ℕ → inl star + (succ-ℕ x) → inr star) , + ( λ where + ( inl star) → unit-trunc-Prop (0 , refl) + ( inr star) → unit-trunc-Prop (1 , refl))) ``` If `X` and `Y` are countable sets, then so is their coproduct `X + Y`. diff --git a/src/set-theory/cumulative-hierarchy.lagda.md b/src/set-theory/cumulative-hierarchy.lagda.md index efdb083423..7dae074724 100644 --- a/src/set-theory/cumulative-hierarchy.lagda.md +++ b/src/set-theory/cumulative-hierarchy.lagda.md @@ -625,24 +625,25 @@ needed. bool-map (map-raise true) = x bool-map (map-raise false) = y - pair-axiom-cumulative-hierarchy : - ( x y v : type-pseudo-cumulative-hierarchy V) → - ( ∈-cumulative-hierarchy v (pair-cumulative-hierarchy x y) ↔ - type-trunc-Prop ( (v = x) + (v = y))) - pair-axiom-cumulative-hierarchy x y v = - pair - ( λ H → map-universal-property-trunc-Prop + abstract + pair-axiom-cumulative-hierarchy : + ( x y v : type-pseudo-cumulative-hierarchy V) → + ( ∈-cumulative-hierarchy v (pair-cumulative-hierarchy x y) ↔ + type-trunc-Prop ( (v = x) + (v = y))) + pr1 (pair-axiom-cumulative-hierarchy x y v) H = + map-universal-property-trunc-Prop ( trunc-Prop ((v = x) + (v = y))) ( λ where ( map-raise true , p) → unit-trunc-Prop (inl (inv p)) ( map-raise false , p) → unit-trunc-Prop (inr (inv p))) - ( ∈-cumulative-hierarchy-mere-preimage H)) - ( λ H → mere-preimage-∈-cumulative-hierarchy + ( ∈-cumulative-hierarchy-mere-preimage H) + pr2 (pair-axiom-cumulative-hierarchy x y v) H = + mere-preimage-∈-cumulative-hierarchy ( map-trunc-Prop ( λ where ( inl p) → (map-raise true , inv p) ( inr p) → (map-raise false , inv p)) - ( H))) + ( H)) ``` ### Singleton function @@ -670,25 +671,25 @@ needed. ( ℕ-map (map-raise x)) ( singleton-cumulative-hierarchy (ℕ-map (map-raise x))) - infinity-axiom-cumulative-hierarchy : - ( ∈-cumulative-hierarchy - empty-set-cumulative-hierarchy - infinity-cumulative-hierarchy) × - ( ( x : type-pseudo-cumulative-hierarchy V) → - ∈-cumulative-hierarchy x infinity-cumulative-hierarchy → - ∈-cumulative-hierarchy - ( pair-cumulative-hierarchy x - ( singleton-cumulative-hierarchy x)) - ( infinity-cumulative-hierarchy)) - infinity-axiom-cumulative-hierarchy = - pair - ( mere-preimage-∈-cumulative-hierarchy - ( unit-trunc-Prop (map-raise zero-ℕ , refl))) - ( λ x H → - mere-preimage-∈-cumulative-hierarchy - ( map-trunc-Prop - ( λ where ((map-raise n) , refl) → (map-raise (succ-ℕ n) , refl)) - ( ∈-cumulative-hierarchy-mere-preimage H))) + abstract + infinity-axiom-cumulative-hierarchy : + ( ∈-cumulative-hierarchy + empty-set-cumulative-hierarchy + infinity-cumulative-hierarchy) × + ( ( x : type-pseudo-cumulative-hierarchy V) → + ∈-cumulative-hierarchy x infinity-cumulative-hierarchy → + ∈-cumulative-hierarchy + ( pair-cumulative-hierarchy x + ( singleton-cumulative-hierarchy x)) + ( infinity-cumulative-hierarchy)) + pr1 infinity-axiom-cumulative-hierarchy = + mere-preimage-∈-cumulative-hierarchy + ( unit-trunc-Prop (map-raise zero-ℕ , refl)) + pr2 infinity-axiom-cumulative-hierarchy x H = + mere-preimage-∈-cumulative-hierarchy + ( map-trunc-Prop + ( λ where ((map-raise n) , refl) → (map-raise (succ-ℕ n) , refl)) + ( ∈-cumulative-hierarchy-mere-preimage H)) ``` ### Cumulative hierarchies satisfy the ∈-induction axiom @@ -717,45 +718,46 @@ needed. ### Cumulative hierarchies satisfy the replacement axiom ```agda - replacement-cumulative-hierarchy : - ( x : type-pseudo-cumulative-hierarchy V) → - ( r : type-pseudo-cumulative-hierarchy V → - type-pseudo-cumulative-hierarchy V) → - ∃ ( type-pseudo-cumulative-hierarchy V) - ( λ v → - ( y : type-pseudo-cumulative-hierarchy V) → - ∈-cumulative-hierarchy y v ↔ - ∃ ( type-pseudo-cumulative-hierarchy V) - ( λ z → (∈-cumulative-hierarchy z x) × (y = r z))) - replacement-cumulative-hierarchy x r = - map-universal-property-trunc-Prop - ( ∃-Prop (type-pseudo-cumulative-hierarchy V) _) - ( λ where - ( A , f , refl) → - unit-trunc-Prop - ( ( set-pseudo-cumulative-hierarchy V (r ∘ f)) , - ( λ y → - ( pair - ( λ H → - map-trunc-Prop - ( λ where - ( a , refl) → - (f a) , - ( mere-preimage-∈-cumulative-hierarchy - ( unit-trunc-Prop (a , refl))) , - ( refl)) - ( ∈-cumulative-hierarchy-mere-preimage H)) - ( λ H → - mere-preimage-∈-cumulative-hierarchy - ( map-universal-property-trunc-Prop - ( ∃-Prop A _) + abstract + replacement-cumulative-hierarchy : + ( x : type-pseudo-cumulative-hierarchy V) → + ( r : type-pseudo-cumulative-hierarchy V → + type-pseudo-cumulative-hierarchy V) → + ∃ ( type-pseudo-cumulative-hierarchy V) + ( λ v → + ( y : type-pseudo-cumulative-hierarchy V) → + ∈-cumulative-hierarchy y v ↔ + ∃ ( type-pseudo-cumulative-hierarchy V) + ( λ z → (∈-cumulative-hierarchy z x) × (y = r z))) + replacement-cumulative-hierarchy x r = + map-universal-property-trunc-Prop + ( ∃-Prop (type-pseudo-cumulative-hierarchy V) _) + ( λ where + ( A , f , refl) → + unit-trunc-Prop + ( ( set-pseudo-cumulative-hierarchy V (r ∘ f)) , + ( λ y → + ( pair + ( λ H → + map-trunc-Prop ( λ where - ( z , K , refl) → - map-trunc-Prop - ( λ where (a , refl) → (a , refl)) - ( ∈-cumulative-hierarchy-mere-preimage K)) - ( H))))))) - ( underlying-function-cumulative-hierarchy x) + ( a , refl) → + (f a) , + ( mere-preimage-∈-cumulative-hierarchy + ( unit-trunc-Prop (a , refl))) , + ( refl)) + ( ∈-cumulative-hierarchy-mere-preimage H)) + ( λ H → + mere-preimage-∈-cumulative-hierarchy + ( map-universal-property-trunc-Prop + ( ∃-Prop A _) + ( λ where + ( z , K , refl) → + map-trunc-Prop + ( λ where (a , refl) → (a , refl)) + ( ∈-cumulative-hierarchy-mere-preimage K)) + ( H))))))) + ( underlying-function-cumulative-hierarchy x) ``` ## References diff --git a/src/trees/directed-trees.lagda.md b/src/trees/directed-trees.lagda.md index 8df4c851c0..c006851654 100644 --- a/src/trees/directed-trees.lagda.md +++ b/src/trees/directed-trees.lagda.md @@ -253,24 +253,25 @@ module _ {l1 l2 : Level} (T : Directed-Tree l1 l2) where - is-decidable-is-root-walk-Directed-Tree : - (x : node-Directed-Tree T) - (w : walk-Directed-Tree T x (root-Directed-Tree T)) → - is-decidable (is-root-Directed-Tree T x) - is-decidable-is-root-walk-Directed-Tree ._ refl-walk-Directed-Graph = - inl refl - is-decidable-is-root-walk-Directed-Tree x - ( cons-walk-Directed-Graph {.x} {y} e w) = - inr - ( λ where - refl → - neq-cons-refl-walk-Directed-Graph - ( graph-Directed-Tree T) - ( x) - ( y) - ( e) - ( w) - ( eq-is-contr (unique-walk-to-root-Directed-Tree T x))) + abstract + is-decidable-is-root-walk-Directed-Tree : + (x : node-Directed-Tree T) + (w : walk-Directed-Tree T x (root-Directed-Tree T)) → + is-decidable (is-root-Directed-Tree T x) + is-decidable-is-root-walk-Directed-Tree ._ refl-walk-Directed-Graph = + inl refl + is-decidable-is-root-walk-Directed-Tree x + ( cons-walk-Directed-Graph {.x} {y} e w) = + inr + ( λ where + refl → + neq-cons-refl-walk-Directed-Graph + ( graph-Directed-Tree T) + ( x) + ( y) + ( e) + ( w) + ( eq-is-contr (unique-walk-to-root-Directed-Tree T x))) is-isolated-root-Directed-Tree : is-isolated (root-Directed-Tree T) is-isolated-root-Directed-Tree x = @@ -591,12 +592,13 @@ module _ ( f)) ( unique-direct-successor-Directed-Tree x) - is-proof-irrelevant-direct-successor-Directed-Tree : - (x : node-Directed-Tree T) → - is-proof-irrelevant (Σ (node-Directed-Tree T) (edge-Directed-Tree T x)) - is-proof-irrelevant-direct-successor-Directed-Tree x (y , e) = - unique-direct-successor-is-proper-node-Directed-Tree x - ( λ where refl → no-direct-successor-root-Directed-Tree T (y , e)) + abstract + is-proof-irrelevant-direct-successor-Directed-Tree : + (x : node-Directed-Tree T) → + is-proof-irrelevant (Σ (node-Directed-Tree T) (edge-Directed-Tree T x)) + is-proof-irrelevant-direct-successor-Directed-Tree x (y , e) = + unique-direct-successor-is-proper-node-Directed-Tree x + ( λ where refl → no-direct-successor-root-Directed-Tree T (y , e)) is-prop-direct-successor-Directed-Tree : (x : node-Directed-Tree T) → diff --git a/src/univalent-combinatorics/counting-decidable-subtypes.lagda.md b/src/univalent-combinatorics/counting-decidable-subtypes.lagda.md index 967d254a1a..8739e219ca 100644 --- a/src/univalent-combinatorics/counting-decidable-subtypes.lagda.md +++ b/src/univalent-combinatorics/counting-decidable-subtypes.lagda.md @@ -45,63 +45,64 @@ open import univalent-combinatorics.standard-finite-types ### The elements of a decidable subtype of a type equipped with a counting can be counted ```agda -count-decidable-subtype' : - {l1 l2 : Level} {X : UU l1} (P : decidable-subtype l2 X) → - (k : ℕ) (e : Fin k ≃ X) → count (type-decidable-subtype P) -count-decidable-subtype' P zero-ℕ e = - count-is-empty - ( is-empty-is-zero-number-of-elements-count (pair zero-ℕ e) refl ∘ pr1) -count-decidable-subtype' P (succ-ℕ k) e - with is-decidable-decidable-subtype P (map-equiv e (inr star)) -... | inl p = - count-equiv - ( equiv-Σ (is-in-decidable-subtype P) e (λ x → id-equiv)) - ( count-equiv' - ( right-distributive-Σ-coprod - ( Fin k) - ( unit) - ( λ x → is-in-decidable-subtype P (map-equiv e x))) - ( pair - ( succ-ℕ - ( number-of-elements-count - ( count-decidable-subtype' - ( λ x → P (map-equiv e (inl x))) - ( k) - ( id-equiv)))) - ( equiv-coprod - ( equiv-count - ( count-decidable-subtype' - ( λ x → P (map-equiv e (inl x))) - ( k) - ( id-equiv))) - ( equiv-is-contr - ( is-contr-unit) - ( is-contr-Σ +abstract + count-decidable-subtype' : + {l1 l2 : Level} {X : UU l1} (P : decidable-subtype l2 X) → + (k : ℕ) (e : Fin k ≃ X) → count (type-decidable-subtype P) + count-decidable-subtype' P zero-ℕ e = + count-is-empty + ( is-empty-is-zero-number-of-elements-count (pair zero-ℕ e) refl ∘ pr1) + count-decidable-subtype' P (succ-ℕ k) e + with is-decidable-decidable-subtype P (map-equiv e (inr star)) + ... | inl p = + count-equiv + ( equiv-Σ (is-in-decidable-subtype P) e (λ x → id-equiv)) + ( count-equiv' + ( right-distributive-Σ-coprod + ( Fin k) + ( unit) + ( λ x → is-in-decidable-subtype P (map-equiv e x))) + ( pair + ( succ-ℕ + ( number-of-elements-count + ( count-decidable-subtype' + ( λ x → P (map-equiv e (inl x))) + ( k) + ( id-equiv)))) + ( equiv-coprod + ( equiv-count + ( count-decidable-subtype' + ( λ x → P (map-equiv e (inl x))) + ( k) + ( id-equiv))) + ( equiv-is-contr ( is-contr-unit) - ( star) - ( is-proof-irrelevant-is-prop - ( is-prop-is-in-decidable-subtype P - ( map-equiv e (inr star))) - ( p))))))) -... | inr f = - count-equiv - ( equiv-Σ (is-in-decidable-subtype P) e (λ x → id-equiv)) - ( count-equiv' - ( right-distributive-Σ-coprod - ( Fin k) - ( unit) - ( λ x → is-in-decidable-subtype P (map-equiv e x))) + ( is-contr-Σ + ( is-contr-unit) + ( star) + ( is-proof-irrelevant-is-prop + ( is-prop-is-in-decidable-subtype P + ( map-equiv e (inr star))) + ( p))))))) + ... | inr f = + count-equiv + ( equiv-Σ (is-in-decidable-subtype P) e (λ x → id-equiv)) ( count-equiv' - ( right-unit-law-coprod-is-empty - ( Σ ( Fin k) - ( λ x → is-in-decidable-subtype P (map-equiv e (inl x)))) - ( Σ ( unit) - ( λ x → is-in-decidable-subtype P (map-equiv e (inr x)))) - ( λ where (star , p) → f p)) - ( count-decidable-subtype' - ( λ x → P (map-equiv e (inl x))) - ( k) - ( id-equiv)))) + ( right-distributive-Σ-coprod + ( Fin k) + ( unit) + ( λ x → is-in-decidable-subtype P (map-equiv e x))) + ( count-equiv' + ( right-unit-law-coprod-is-empty + ( Σ ( Fin k) + ( λ x → is-in-decidable-subtype P (map-equiv e (inl x)))) + ( Σ ( unit) + ( λ x → is-in-decidable-subtype P (map-equiv e (inr x)))) + ( λ where (star , p) → f p)) + ( count-decidable-subtype' + ( λ x → P (map-equiv e (inl x))) + ( k) + ( id-equiv)))) count-decidable-subtype : {l1 l2 : Level} {X : UU l1} (P : decidable-subtype l2 X) → diff --git a/src/univalent-combinatorics/cyclic-types.lagda.md b/src/univalent-combinatorics/cyclic-types.lagda.md index ae086043a9..a543df9eea 100644 --- a/src/univalent-combinatorics/cyclic-types.lagda.md +++ b/src/univalent-combinatorics/cyclic-types.lagda.md @@ -493,18 +493,19 @@ is-retraction-equiv-Eq-Cyclic-Type k e = ( ℤ-Mod-Cyclic-Type k) ( e))) -is-equiv-Eq-equiv-Cyclic-Type : - (k : ℕ) (X : Cyclic-Type lzero k) → is-equiv (Eq-equiv-Cyclic-Type k X) -is-equiv-Eq-equiv-Cyclic-Type k X = - apply-universal-property-trunc-Prop - ( mere-eq-Cyclic-Type k (ℤ-Mod-Cyclic-Type k) X) - ( is-equiv-Prop (Eq-equiv-Cyclic-Type k X)) - ( λ where - refl → - is-equiv-is-invertible - ( equiv-Eq-Cyclic-Type k) - ( is-section-equiv-Eq-Cyclic-Type k) - ( is-retraction-equiv-Eq-Cyclic-Type k)) +abstract + is-equiv-Eq-equiv-Cyclic-Type : + (k : ℕ) (X : Cyclic-Type lzero k) → is-equiv (Eq-equiv-Cyclic-Type k X) + is-equiv-Eq-equiv-Cyclic-Type k X = + apply-universal-property-trunc-Prop + ( mere-eq-Cyclic-Type k (ℤ-Mod-Cyclic-Type k) X) + ( is-equiv-Prop (Eq-equiv-Cyclic-Type k X)) + ( λ where + refl → + is-equiv-is-invertible + ( equiv-Eq-Cyclic-Type k) + ( is-section-equiv-Eq-Cyclic-Type k) + ( is-retraction-equiv-Eq-Cyclic-Type k)) equiv-compute-Ω-Cyclic-Type : (k : ℕ) → type-Ω (pair (Cyclic-Type lzero k) (ℤ-Mod-Cyclic-Type k)) ≃ ℤ-Mod k diff --git a/src/univalent-combinatorics/pi-finite-types.lagda.md b/src/univalent-combinatorics/pi-finite-types.lagda.md index ffb15a871d..e51a3e9f56 100644 --- a/src/univalent-combinatorics/pi-finite-types.lagda.md +++ b/src/univalent-combinatorics/pi-finite-types.lagda.md @@ -683,13 +683,12 @@ has-finite-connected-components-Σ-is-0-connected {A = A} {B} C H K = ( λ t → apply-universal-property-trunc-Prop t ( trunc-Prop _) - ( ( λ where - ( ω , r) → - unit-trunc-Prop - ( ( unit-trunc-Set ω) , - ( map-inv-equiv - ( compute-P ω) - ( unit-trunc-Prop r)))) ∘ + ( ( λ ( ω , r) → + unit-trunc-Prop + ( ( unit-trunc-Set ω) , + ( map-inv-equiv + ( compute-P ω) + ( unit-trunc-Prop r)))) ∘ ( pair-eq-Σ))) ( f) ``` @@ -712,24 +711,27 @@ module _ triangle-is-coprod-codomain (inl x) = refl triangle-is-coprod-codomain (inr x) = refl - is-emb-map-is-coprod-codomain : is-emb map-is-coprod-codomain - is-emb-map-is-coprod-codomain = - is-emb-coprod - ( is-emb-inclusion-subtype (λ b → trunc-Prop _)) - ( is-emb-inclusion-subtype (λ b → trunc-Prop _)) - ( λ (b1 , u) (b2 , v) → - apply-universal-property-trunc-Prop u - ( function-Prop _ empty-Prop) - ( λ where - ( x , refl) → - apply-universal-property-trunc-Prop v - ( function-Prop _ empty-Prop) - ( λ where - ( y , refl) r → - is-empty-eq-coprod-inl-inr x y - ( is-injective-is-equiv - ( is-equiv-map-equiv e) - ( inv (H (inl x)) ∙ ap unit-trunc-Set r ∙ H (inr y)))))) + abstract + is-emb-map-is-coprod-codomain : is-emb map-is-coprod-codomain + is-emb-map-is-coprod-codomain = + is-emb-coprod + ( is-emb-inclusion-subtype (λ b → trunc-Prop _)) + ( is-emb-inclusion-subtype (λ b → trunc-Prop _)) + ( λ (b1 , u) (b2 , v) → + apply-universal-property-trunc-Prop u + ( function-Prop _ empty-Prop) + ( λ where + ( x , refl) → + apply-universal-property-trunc-Prop v + ( function-Prop _ empty-Prop) + ( λ where + ( y , refl) r → + is-empty-eq-coprod-inl-inr x y + ( is-injective-is-equiv + ( is-equiv-map-equiv e) + ( ( inv (H (inl x))) ∙ + ( ap unit-trunc-Set r) ∙ + ( H (inr y))))))) is-surjective-map-is-coprod-codomain : is-surjective map-is-coprod-codomain is-surjective-map-is-coprod-codomain b = @@ -755,134 +757,137 @@ is-0-connected-unit : is-0-connected unit is-0-connected-unit = is-contr-equiv' unit equiv-unit-trunc-unit-Set is-contr-unit -is-contr-im : - {l1 l2 : Level} {A : UU l1} (B : Set l2) {f : A → type-Set B} - (a : A) (H : f ~ const A (type-Set B) (f a)) → is-contr (im f) -pr1 (is-contr-im B {f} a H) = map-unit-im f a -pr2 (is-contr-im B {f} a H) (x , u) = - apply-dependent-universal-property-trunc-Prop - ( λ v → Id-Prop (im-Set B f) (map-unit-im f a) (x , v)) - ( u) - ( λ where - ( a' , refl) → - eq-Eq-im f (map-unit-im f a) (map-unit-im f a') (inv (H a'))) - -is-0-connected-im : - {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A → B) → - is-0-connected A → is-0-connected (im f) -is-0-connected-im {l1} {l2} {A} {B} f C = - apply-universal-property-trunc-Prop - ( is-inhabited-is-0-connected C) - ( is-contr-Prop _) - ( λ a → - is-contr-equiv' - ( im (map-trunc-Set f)) - ( equiv-trunc-im-Set f) - ( is-contr-im - ( trunc-Set B) - ( unit-trunc-Set a) - ( apply-dependent-universal-property-trunc-Set' - ( λ x → - set-Prop - ( Id-Prop - ( trunc-Set B) - ( map-trunc-Set f x) - ( map-trunc-Set f (unit-trunc-Set a)))) - ( λ a' → - apply-universal-property-trunc-Prop - ( mere-eq-is-0-connected C a' a) - ( Id-Prop - ( trunc-Set B) - ( map-trunc-Set f (unit-trunc-Set a')) - ( map-trunc-Set f (unit-trunc-Set a))) - ( λ where refl → refl))))) +abstract + is-contr-im : + {l1 l2 : Level} {A : UU l1} (B : Set l2) {f : A → type-Set B} + (a : A) (H : f ~ const A (type-Set B) (f a)) → is-contr (im f) + pr1 (is-contr-im B {f} a H) = map-unit-im f a + pr2 (is-contr-im B {f} a H) (x , u) = + apply-dependent-universal-property-trunc-Prop + ( λ v → Id-Prop (im-Set B f) (map-unit-im f a) (x , v)) + ( u) + ( λ where + ( a' , refl) → + eq-Eq-im f (map-unit-im f a) (map-unit-im f a') (inv (H a'))) + +abstract + is-0-connected-im : + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A → B) → + is-0-connected A → is-0-connected (im f) + is-0-connected-im {l1} {l2} {A} {B} f C = + apply-universal-property-trunc-Prop + ( is-inhabited-is-0-connected C) + ( is-contr-Prop _) + ( λ a → + is-contr-equiv' + ( im (map-trunc-Set f)) + ( equiv-trunc-im-Set f) + ( is-contr-im + ( trunc-Set B) + ( unit-trunc-Set a) + ( apply-dependent-universal-property-trunc-Set' + ( λ x → + set-Prop + ( Id-Prop + ( trunc-Set B) + ( map-trunc-Set f x) + ( map-trunc-Set f (unit-trunc-Set a)))) + ( λ a' → + apply-universal-property-trunc-Prop + ( mere-eq-is-0-connected C a' a) + ( Id-Prop + ( trunc-Set B) + ( map-trunc-Set f (unit-trunc-Set a')) + ( map-trunc-Set f (unit-trunc-Set a))) + ( λ where refl → refl))))) is-0-connected-im-unit : {l1 : Level} {A : UU l1} (f : unit → A) → is-0-connected (im f) is-0-connected-im-unit f = is-0-connected-im f is-0-connected-unit -has-finite-connected-components-Σ' : - {l1 l2 : Level} {A : UU l1} {B : A → UU l2} → - (k : ℕ) → (Fin k ≃ (type-trunc-Set A)) → - ((x y : A) → has-finite-connected-components (Id x y)) → - ((x : A) → has-finite-connected-components (B x)) → - has-finite-connected-components (Σ A B) -has-finite-connected-components-Σ' zero-ℕ e H K = - is-π-finite-is-empty zero-ℕ - ( is-empty-is-empty-trunc-Set (map-inv-equiv e) ∘ pr1) -has-finite-connected-components-Σ' {l1} {l2} {A} {B} (succ-ℕ k) e H K = - apply-universal-property-trunc-Prop - ( has-presentation-of-cardinality-has-cardinality-components - ( succ-ℕ k) - ( unit-trunc-Prop e)) - ( has-finite-connected-components-Prop (Σ A B)) - ( α) - where - α : Σ (Fin (succ-ℕ k) → A) (λ f → is-equiv (unit-trunc-Set ∘ f)) → - has-finite-connected-components (Σ A B) - α (f , Eηf) = - is-finite-equiv - ( equiv-trunc-Set g) - ( is-finite-equiv' - ( equiv-distributive-trunc-coprod-Set - ( Σ (im (f ∘ inl)) (B ∘ pr1)) - ( Σ (im (f ∘ inr)) (B ∘ pr1))) - ( is-finite-coprod - ( has-finite-connected-components-Σ' k - ( h) - ( λ x y → - is-finite-equiv' - ( equiv-trunc-Set - ( equiv-ap-emb - ( pr1 , is-emb-inclusion-subtype ( λ u → trunc-Prop _)))) - ( H (pr1 x) (pr1 y))) - ( λ x → K (pr1 x))) - ( has-finite-connected-components-Σ-is-0-connected - ( is-0-connected-im (f ∘ inr) is-0-connected-unit) - ( ( is-finite-is-contr - ( is-0-connected-im (f ∘ inr) is-0-connected-unit)) , - ( λ x y → - is-π-finite-equiv zero-ℕ - ( equiv-Eq-eq-im (f ∘ inr) x y) - ( H (pr1 x) (pr1 y)))) - ( λ x → K (pr1 x))))) +abstract + has-finite-connected-components-Σ' : + {l1 l2 : Level} {A : UU l1} {B : A → UU l2} → + (k : ℕ) → (Fin k ≃ (type-trunc-Set A)) → + ((x y : A) → has-finite-connected-components (Id x y)) → + ((x : A) → has-finite-connected-components (B x)) → + has-finite-connected-components (Σ A B) + has-finite-connected-components-Σ' zero-ℕ e H K = + is-π-finite-is-empty zero-ℕ + ( is-empty-is-empty-trunc-Set (map-inv-equiv e) ∘ pr1) + has-finite-connected-components-Σ' {l1} {l2} {A} {B} (succ-ℕ k) e H K = + apply-universal-property-trunc-Prop + ( has-presentation-of-cardinality-has-cardinality-components + ( succ-ℕ k) + ( unit-trunc-Prop e)) + ( has-finite-connected-components-Prop (Σ A B)) + ( α) where - g : ((Σ (im (f ∘ inl)) (B ∘ pr1)) + (Σ (im (f ∘ inr)) (B ∘ pr1))) ≃ - Σ A B - g = ( equiv-Σ B - ( is-coprod-codomain f - ( unit-trunc-Set ∘ f , Eηf) - ( refl-htpy)) - ( λ { (inl x) → id-equiv ; (inr x) → id-equiv})) ∘e - ( inv-equiv - ( right-distributive-Σ-coprod - ( im (f ∘ inl)) - ( im (f ∘ inr)) - ( ind-coprod (λ x → UU l2) (B ∘ pr1) (B ∘ pr1)))) - i : Fin k → type-trunc-Set (im (f ∘ inl)) - i = unit-trunc-Set ∘ map-unit-im (f ∘ inl) - is-surjective-i : is-surjective i - is-surjective-i = - is-surjective-comp - ( is-surjective-unit-trunc-Set (im (f ∘ inl))) - ( is-surjective-map-unit-im (f ∘ inl)) - is-emb-i : is-emb i - is-emb-i = - is-emb-right-factor-htpy - ( (unit-trunc-Set ∘ f) ∘ inl) - ( inclusion-trunc-im-Set (f ∘ inl)) - ( i) - ( ( inv-htpy (naturality-unit-trunc-Set (inclusion-im (f ∘ inl)))) ·r - ( map-unit-im (f ∘ inl))) - ( is-emb-inclusion-trunc-im-Set (f ∘ inl)) - ( is-emb-comp - ( unit-trunc-Set ∘ f) - ( inl) - ( is-emb-is-equiv Eηf) - ( is-emb-inl (Fin k) unit)) - h : Fin k ≃ type-trunc-Set (im (f ∘ inl)) - h = i , (is-equiv-is-emb-is-surjective is-surjective-i is-emb-i) + α : Σ (Fin (succ-ℕ k) → A) (λ f → is-equiv (unit-trunc-Set ∘ f)) → + has-finite-connected-components (Σ A B) + α (f , Eηf) = + is-finite-equiv + ( equiv-trunc-Set g) + ( is-finite-equiv' + ( equiv-distributive-trunc-coprod-Set + ( Σ (im (f ∘ inl)) (B ∘ pr1)) + ( Σ (im (f ∘ inr)) (B ∘ pr1))) + ( is-finite-coprod + ( has-finite-connected-components-Σ' k + ( h) + ( λ x y → + is-finite-equiv' + ( equiv-trunc-Set + ( equiv-ap-emb + ( pr1 , is-emb-inclusion-subtype ( λ u → trunc-Prop _)))) + ( H (pr1 x) (pr1 y))) + ( λ x → K (pr1 x))) + ( has-finite-connected-components-Σ-is-0-connected + ( is-0-connected-im (f ∘ inr) is-0-connected-unit) + ( ( is-finite-is-contr + ( is-0-connected-im (f ∘ inr) is-0-connected-unit)) , + ( λ x y → + is-π-finite-equiv zero-ℕ + ( equiv-Eq-eq-im (f ∘ inr) x y) + ( H (pr1 x) (pr1 y)))) + ( λ x → K (pr1 x))))) + where + g : ((Σ (im (f ∘ inl)) (B ∘ pr1)) + (Σ (im (f ∘ inr)) (B ∘ pr1))) ≃ + Σ A B + g = ( equiv-Σ B + ( is-coprod-codomain f + ( unit-trunc-Set ∘ f , Eηf) + ( refl-htpy)) + ( λ { (inl x) → id-equiv ; (inr x) → id-equiv})) ∘e + ( inv-equiv + ( right-distributive-Σ-coprod + ( im (f ∘ inl)) + ( im (f ∘ inr)) + ( ind-coprod (λ x → UU l2) (B ∘ pr1) (B ∘ pr1)))) + i : Fin k → type-trunc-Set (im (f ∘ inl)) + i = unit-trunc-Set ∘ map-unit-im (f ∘ inl) + is-surjective-i : is-surjective i + is-surjective-i = + is-surjective-comp + ( is-surjective-unit-trunc-Set (im (f ∘ inl))) + ( is-surjective-map-unit-im (f ∘ inl)) + is-emb-i : is-emb i + is-emb-i = + is-emb-right-factor-htpy + ( (unit-trunc-Set ∘ f) ∘ inl) + ( inclusion-trunc-im-Set (f ∘ inl)) + ( i) + ( ( inv-htpy (naturality-unit-trunc-Set (inclusion-im (f ∘ inl)))) ·r + ( map-unit-im (f ∘ inl))) + ( is-emb-inclusion-trunc-im-Set (f ∘ inl)) + ( is-emb-comp + ( unit-trunc-Set ∘ f) + ( inl) + ( is-emb-is-equiv Eηf) + ( is-emb-inl (Fin k) unit)) + h : Fin k ≃ type-trunc-Set (im (f ∘ inl)) + h = i , (is-equiv-is-emb-is-surjective is-surjective-i is-emb-i) has-finite-connected-components-Σ : {l1 l2 : Level} {A : UU l1} {B : A → UU l2} → is-π-finite 1 A → @@ -892,26 +897,25 @@ has-finite-connected-components-Σ {l1} {l2} {A} {B} H K = apply-universal-property-trunc-Prop ( pr1 H) ( has-finite-connected-components-Prop (Σ A B)) - ( λ where - ( k , e) → - has-finite-connected-components-Σ' k e (λ x y → pr2 H x y) K) - -is-π-finite-Σ : - {l1 l2 : Level} (k : ℕ) {A : UU l1} {B : A → UU l2} → - is-π-finite (succ-ℕ k) A → ((x : A) → is-π-finite k (B x)) → - is-π-finite k (Σ A B) -is-π-finite-Σ zero-ℕ {A} {B} H K = has-finite-connected-components-Σ H K -pr1 (is-π-finite-Σ (succ-ℕ k) H K) = - has-finite-connected-components-Σ - ( is-π-finite-one-is-π-finite-succ-ℕ (succ-ℕ k) H) - ( λ x → - has-finite-connected-components-is-π-finite (succ-ℕ k) (K x)) -pr2 (is-π-finite-Σ (succ-ℕ k) H K) (x , u) (y , v) = - is-π-finite-equiv k - ( equiv-pair-eq-Σ (x , u) (y , v)) - ( is-π-finite-Σ k - ( pr2 H x y) - ( λ where refl → pr2 (K x) u v)) + ( λ (k , e) → has-finite-connected-components-Σ' k e (λ x y → pr2 H x y) K) + +abstract + is-π-finite-Σ : + {l1 l2 : Level} (k : ℕ) {A : UU l1} {B : A → UU l2} → + is-π-finite (succ-ℕ k) A → ((x : A) → is-π-finite k (B x)) → + is-π-finite k (Σ A B) + is-π-finite-Σ zero-ℕ {A} {B} H K = has-finite-connected-components-Σ H K + pr1 (is-π-finite-Σ (succ-ℕ k) H K) = + has-finite-connected-components-Σ + ( is-π-finite-one-is-π-finite-succ-ℕ (succ-ℕ k) H) + ( λ x → + has-finite-connected-components-is-π-finite (succ-ℕ k) (K x)) + pr2 (is-π-finite-Σ (succ-ℕ k) H K) (x , u) (y , v) = + is-π-finite-equiv k + ( equiv-pair-eq-Σ (x , u) (y , v)) + ( is-π-finite-Σ k + ( pr2 H x y) + ( λ where refl → pr2 (K x) u v)) π-Finite-Σ : {l1 l2 : Level} (k : ℕ) (A : π-Finite l1 (succ-ℕ k)) diff --git a/src/universal-algebra/algebraic-theory-of-groups.lagda.md b/src/universal-algebra/algebraic-theory-of-groups.lagda.md index d34b12bcb4..90bf61b51d 100644 --- a/src/universal-algebra/algebraic-theory-of-groups.lagda.md +++ b/src/universal-algebra/algebraic-theory-of-groups.lagda.md @@ -43,13 +43,10 @@ data group-ops : UU lzero where unit-group-op mul-group-op inv-group-op : group-ops group-signature : signature lzero -group-signature = - pair - group-ops - ( λ where - unit-group-op → 0 - mul-group-op → 2 - inv-group-op → 1) +pr1 group-signature = group-ops +pr2 group-signature unit-group-op = 0 +pr2 group-signature mul-group-op = 2 +pr2 group-signature inv-group-op = 1 data group-laws : UU lzero where associative-l-group-laws : group-laws @@ -103,10 +100,7 @@ pr1 (pr2 (pr1 (group-Algebra-Group ((A-Set , models-A) , satisfies-A)))) x y = models-A mul-group-op (x ∷ y ∷ empty-vec) pr2 (pr2 (pr1 (group-Algebra-Group ((A-Set , models-A) , satisfies-A)))) x y z = satisfies-A associative-l-group-laws - ( λ where - zero-ℕ → x - ( succ-ℕ zero-ℕ) → y - ( succ-ℕ (succ-ℕ n)) → z) + ( λ { 0 → x ; 1 → y ; (succ-ℕ (succ-ℕ n)) → z}) pr1 (pr1 (pr2 (group-Algebra-Group ((A-Set , models-A) , satisfies-A)))) = models-A unit-group-op empty-vec pr1 (pr2 (pr1 (pr2 (group-Algebra-Group (_ , satisfies-A))))) x = @@ -131,7 +125,7 @@ Group-group-Algebra G = ( λ where unit-group-op v → unit-Group G mul-group-op (x ∷ y ∷ empty-vec) → mul-Group G x y - inv-group-op (x ∷ emptsy-vec) → inv-Group G x)) + inv-group-op (x ∷ empty-vec) → inv-Group G x)) ( λ where associative-l-group-laws assign → associative-mul-Group G (assign 0) (assign 1) (assign 2) @@ -144,26 +138,27 @@ Group-group-Algebra G = idr-r-group-laws assign → right-unit-law-mul-Group G (assign 0)) -equiv-group-Algebra-Group : - {l : Level} → - Algebra group-signature group-Theory l ≃ - Group l -pr1 equiv-group-Algebra-Group = group-Algebra-Group -pr1 (pr1 (pr2 equiv-group-Algebra-Group)) = Group-group-Algebra -pr2 (pr1 (pr2 equiv-group-Algebra-Group)) G = - eq-pair-Σ refl (eq-is-prop (is-prop-is-group (semigroup-Group G))) -pr1 (pr2 (pr2 equiv-group-Algebra-Group)) = Group-group-Algebra -pr2 (pr2 (pr2 equiv-group-Algebra-Group)) A = - eq-pair-Σ - ( eq-pair-Σ - ( refl) - ( eq-htpy - ( λ where - unit-group-op → eq-htpy (λ where empty-vec → refl) - mul-group-op → eq-htpy (λ where (x ∷ y ∷ empty-vec) → refl) - inv-group-op → eq-htpy (λ where (x ∷ empty-vec) → refl)))) - ( eq-is-prop - ( is-prop-is-algebra - ( group-signature) ( group-Theory) - ( model-Algebra group-signature group-Theory A))) +abstract + equiv-group-Algebra-Group : + {l : Level} → + Algebra group-signature group-Theory l ≃ + Group l + pr1 equiv-group-Algebra-Group = group-Algebra-Group + pr1 (pr1 (pr2 equiv-group-Algebra-Group)) = Group-group-Algebra + pr2 (pr1 (pr2 equiv-group-Algebra-Group)) G = + eq-pair-Σ refl (eq-is-prop (is-prop-is-group (semigroup-Group G))) + pr1 (pr2 (pr2 equiv-group-Algebra-Group)) = Group-group-Algebra + pr2 (pr2 (pr2 equiv-group-Algebra-Group)) A = + eq-pair-Σ + ( eq-pair-Σ + ( refl) + ( eq-htpy + ( λ where + unit-group-op → eq-htpy (λ where empty-vec → refl) + mul-group-op → eq-htpy (λ where (x ∷ y ∷ empty-vec) → refl) + inv-group-op → eq-htpy (λ where (x ∷ empty-vec) → refl)))) + ( eq-is-prop + ( is-prop-is-algebra + ( group-signature) ( group-Theory) + ( model-Algebra group-signature group-Theory A))) ``` From 06fe5101dc7bba42a8a1630a16d53016e04df48f Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Mon, 9 Oct 2023 00:32:03 +0200 Subject: [PATCH 09/23] new `is-prop-is-empty` --- src/foundation-core/empty-types.lagda.md | 3 +++ src/foundation-core/propositions.lagda.md | 7 +++---- .../coproduct-decompositions-subuniverse.lagda.md | 2 +- src/foundation/empty-types.lagda.md | 10 +++++----- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/foundation-core/empty-types.lagda.md b/src/foundation-core/empty-types.lagda.md index 09db14d352..273b55df60 100644 --- a/src/foundation-core/empty-types.lagda.md +++ b/src/foundation-core/empty-types.lagda.md @@ -101,6 +101,9 @@ abstract empty-Prop : Prop lzero pr1 empty-Prop = empty pr2 empty-Prop = is-prop-empty + +is-prop-is-empty : {l : Level} {A : UU l} → is-empty A → is-prop A +is-prop-is-empty is-empty-A = ex-falso ∘ is-empty-A ``` ### The empty type is a set diff --git a/src/foundation-core/propositions.lagda.md b/src/foundation-core/propositions.lagda.md index fadb971eba..f55b64f2b5 100644 --- a/src/foundation-core/propositions.lagda.md +++ b/src/foundation-core/propositions.lagda.md @@ -160,7 +160,7 @@ module _ abstract is-prop-equiv : A ≃ B → is-prop B → is-prop A - is-prop-equiv (pair f is-equiv-f) = is-prop-is-equiv is-equiv-f + is-prop-equiv (f , is-equiv-f) = is-prop-is-equiv is-equiv-f module _ {l1 l2 : Level} {A : UU l1} {B : UU l2} @@ -173,7 +173,7 @@ module _ abstract is-prop-equiv' : A ≃ B → is-prop A → is-prop B - is-prop-equiv' (pair f is-equiv-f) = is-prop-is-equiv' is-equiv-f + is-prop-equiv' (f , is-equiv-f) = is-prop-is-equiv' is-equiv-f ``` ### Propositions are closed under dependent pair types @@ -250,8 +250,7 @@ abstract ((x : A) → is-prop (B x)) → is-prop ({x : A} → B x) is-prop-Π' {l1} {l2} {A} {B} H = is-prop-equiv - ( pair - ( λ f x → f {x}) + ( ( λ f x → f {x}) , ( is-equiv-is-invertible ( λ g {x} → g x) ( refl-htpy) diff --git a/src/foundation/coproduct-decompositions-subuniverse.lagda.md b/src/foundation/coproduct-decompositions-subuniverse.lagda.md index 16e7edb589..cd0f85fdbe 100644 --- a/src/foundation/coproduct-decompositions-subuniverse.lagda.md +++ b/src/foundation/coproduct-decompositions-subuniverse.lagda.md @@ -511,7 +511,7 @@ module _ ( inclusion-subuniverse P (pr1 x)) ( equiv-is-empty is-empty-raise-empty ( pr2 x))) ( eq-is-prop (is-prop-type-Prop (P _)))) - ( eq-is-prop is-prop-is-empty))) + ( eq-is-prop is-property-is-empty))) ( ( raise-empty l1 , C1) , is-empty-raise-empty)) ∘e ( ( inv-associative-Σ _ _ _) ∘e ( ( equiv-tot (λ _ → commutative-prod)) ∘e diff --git a/src/foundation/empty-types.lagda.md b/src/foundation/empty-types.lagda.md index fdd6b8876b..5f689d7bfa 100644 --- a/src/foundation/empty-types.lagda.md +++ b/src/foundation/empty-types.lagda.md @@ -93,16 +93,16 @@ raise-ex-falso-emb l = ### Being empty is a proposition ```agda -is-prop-is-empty : {l : Level} {A : UU l} → is-prop (is-empty A) -is-prop-is-empty = is-prop-function-type is-prop-empty +is-property-is-empty : {l : Level} {A : UU l} → is-prop (is-empty A) +is-property-is-empty = is-prop-function-type is-prop-empty is-empty-Prop : {l1 : Level} → UU l1 → Prop l1 pr1 (is-empty-Prop A) = is-empty A -pr2 (is-empty-Prop A) = is-prop-is-empty +pr2 (is-empty-Prop A) = is-property-is-empty is-nonempty-Prop : {l1 : Level} → UU l1 → Prop l1 pr1 (is-nonempty-Prop A) = is-nonempty A -pr2 (is-nonempty-Prop A) = is-prop-is-empty +pr2 (is-nonempty-Prop A) = is-property-is-empty ``` ```agda @@ -163,5 +163,5 @@ pr2 (is-contr-type-is-empty l) x = ( equiv-is-empty is-empty-raise-empty ( is-in-subuniverse-inclusion-subuniverse is-empty-Prop x))) - ( eq-is-prop is-prop-is-empty) + ( eq-is-prop is-property-is-empty) ``` From b0b09abbf5a221b22675cc420c6be007e421e8c8 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Mon, 9 Oct 2023 00:46:44 +0200 Subject: [PATCH 10/23] revert `abstract` `ethane` --- src/organic-chemistry/ethane.lagda.md | 125 +++++++++++++------------- 1 file changed, 61 insertions(+), 64 deletions(-) diff --git a/src/organic-chemistry/ethane.lagda.md b/src/organic-chemistry/ethane.lagda.md index 094c030af6..180e7c8d0c 100644 --- a/src/organic-chemistry/ethane.lagda.md +++ b/src/organic-chemistry/ethane.lagda.md @@ -226,72 +226,69 @@ module _ (inr star) (inr star) = star - abstract - ethane : hydrocarbon lzero lzero - pr1 ethane = finite-graph-ethane - pr1 (pr2 ethane) c = t - pr1 (pr2 (pr2 ethane)) = emb-bonding-ethane - pr1 (pr2 (pr2 (pr2 ethane))) (inl (inr star)) P = - apply-universal-property-trunc-Prop (pr2 P) empty-Prop - ( λ where - ( inl (inr star) , is-one) → neq-inl-inr is-one - ( inr star , is-one) → neq-inl-inr is-one) - pr1 (pr2 (pr2 (pr2 ethane))) (inr star) P = - apply-universal-property-trunc-Prop (pr1 P) empty-Prop - ( λ where - ( inl (inr star) , is-zero) → neq-inr-inl is-zero - ( inr star , is-zero) → neq-inr-inl is-zero) - pr1 (pr2 (pr2 (pr2 (pr2 ethane)))) c c' = - concatenate-eq-leq-ℕ 3 - ( inv - ( compute-number-of-elements-is-finite - ( count-standard-edge-ethane c c') - ( is-finite-edge-ethane (standard-unordered-pair c c')))) - (number-of-elements-count-standard-edge-ethane-leq-3 c c') - pr2 (pr2 (pr2 (pr2 (pr2 ethane)))) (inl (inr star)) (inl (inr star)) = - unit-trunc-Prop refl-walk-Undirected-Graph - pr2 (pr2 (pr2 (pr2 (pr2 ethane)))) (inl (inr star)) (inr star) = - unit-trunc-Prop - ( tr - ( λ x → - walk-Undirected-Graph - ( undirected-graph-Undirected-Graph-𝔽 finite-graph-ethane) - ( zero-Fin 1) - ( element-standard-unordered-pair (zero-Fin 1) (one-Fin 1) x)) - ( compute-swap-2-Element-Type - ( Fin-UU-Fin' 2) - ( zero-Fin 1) - ( one-Fin 1) - ( neq-inl-inr)) - ( cons-walk-Undirected-Graph - ( standard-unordered-pair (zero-Fin 1) (one-Fin 1)) - ( pair - ( unit-trunc-Prop (zero-Fin 1 , refl)) - ( unit-trunc-Prop (one-Fin 1 , refl))) - { zero-Fin 1} - ( refl-walk-Undirected-Graph))) - pr2 (pr2 (pr2 (pr2 (pr2 ethane)))) (inr star) (inl (inr star)) = - unit-trunc-Prop - ( tr - ( λ x → - walk-Undirected-Graph - ( undirected-graph-Undirected-Graph-𝔽 finite-graph-ethane) - ( one-Fin 1) - ( element-standard-unordered-pair (one-Fin 1) (zero-Fin 1) x)) - ( compute-swap-2-Element-Type - ( Fin-UU-Fin' 2) + ethane : hydrocarbon lzero lzero + pr1 ethane = finite-graph-ethane + pr1 (pr2 ethane) c = t + pr1 (pr2 (pr2 ethane)) = emb-bonding-ethane + pr1 (pr2 (pr2 (pr2 ethane))) (inl (inr star)) P = + apply-universal-property-trunc-Prop (pr2 P) empty-Prop + ( λ where + ( inl (inr star) , is-one) → neq-inl-inr is-one + ( inr star , is-one) → neq-inl-inr is-one) + pr1 (pr2 (pr2 (pr2 ethane))) (inr star) P = + apply-universal-property-trunc-Prop (pr1 P) empty-Prop + ( λ where + ( inl (inr star) , is-zero) → neq-inr-inl is-zero + ( inr star , is-zero) → neq-inr-inl is-zero) + pr1 (pr2 (pr2 (pr2 (pr2 ethane)))) c c' = + concatenate-eq-leq-ℕ 3 + ( inv + ( compute-number-of-elements-is-finite + ( count-standard-edge-ethane c c') + ( is-finite-edge-ethane (standard-unordered-pair c c')))) + (number-of-elements-count-standard-edge-ethane-leq-3 c c') + pr2 (pr2 (pr2 (pr2 (pr2 ethane)))) (inl (inr star)) (inl (inr star)) = + unit-trunc-Prop refl-walk-Undirected-Graph + pr2 (pr2 (pr2 (pr2 (pr2 ethane)))) (inl (inr star)) (inr star) = + unit-trunc-Prop + ( tr + ( λ x → + walk-Undirected-Graph + ( undirected-graph-Undirected-Graph-𝔽 finite-graph-ethane) ( zero-Fin 1) + ( element-standard-unordered-pair (zero-Fin 1) (one-Fin 1) x)) + ( compute-swap-2-Element-Type + ( Fin-UU-Fin' 2) + ( zero-Fin 1) + ( one-Fin 1) + ( neq-inl-inr)) + ( cons-walk-Undirected-Graph + ( standard-unordered-pair (zero-Fin 1) (one-Fin 1)) + ( ( unit-trunc-Prop (zero-Fin 1 , refl)) , + ( unit-trunc-Prop (one-Fin 1 , refl))) + { zero-Fin 1} + ( refl-walk-Undirected-Graph))) + pr2 (pr2 (pr2 (pr2 (pr2 ethane)))) (inr star) (inl (inr star)) = + unit-trunc-Prop + ( tr + ( λ x → + walk-Undirected-Graph + ( undirected-graph-Undirected-Graph-𝔽 finite-graph-ethane) ( one-Fin 1) - ( neq-inl-inr)) - ( cons-walk-Undirected-Graph - ( standard-unordered-pair (one-Fin 1) (zero-Fin 1)) - ( pair - ( unit-trunc-Prop (one-Fin 1 , refl)) - ( unit-trunc-Prop (zero-Fin 1 , refl))) - { zero-Fin 1} - ( refl-walk-Undirected-Graph))) - pr2 (pr2 (pr2 (pr2 (pr2 ethane)))) (inr star) (inr star) = - unit-trunc-Prop refl-walk-Undirected-Graph + ( element-standard-unordered-pair (one-Fin 1) (zero-Fin 1) x)) + ( compute-swap-2-Element-Type + ( Fin-UU-Fin' 2) + ( zero-Fin 1) + ( one-Fin 1) + ( neq-inl-inr)) + ( cons-walk-Undirected-Graph + ( standard-unordered-pair (one-Fin 1) (zero-Fin 1)) + ( ( unit-trunc-Prop (one-Fin 1 , refl)) , + ( unit-trunc-Prop (zero-Fin 1 , refl))) + { zero-Fin 1} + ( refl-walk-Undirected-Graph))) + pr2 (pr2 (pr2 (pr2 (pr2 ethane)))) (inr star) (inr star) = + unit-trunc-Prop refl-walk-Undirected-Graph is-alkane-ethane : is-alkane-hydrocarbon ethane is-alkane-ethane = is-prop-standard-edge-ethane From 509f32c2f4958246cd9b97f8f21bf8402ef7e993 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Mon, 9 Oct 2023 01:00:13 +0200 Subject: [PATCH 11/23] add lambda expression convention --- CODINGSTYLE.md | 41 +++++++++++++++++++ .../type-arithmetic-unit-type.lagda.md | 7 ++-- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/CODINGSTYLE.md b/CODINGSTYLE.md index e9153c0829..def2d2d11c 100644 --- a/CODINGSTYLE.md +++ b/CODINGSTYLE.md @@ -128,6 +128,47 @@ strategic endeavour to ensure the longevity, vitality, and success of the a = construction-of-a ``` +- **Lambda expressions**: We always wrap lambda expressions in parentheses, even + if it is the last argument of a function and thus isn't strictly required to + be parenthesized. + + There are multiple syntaxes for writing lambda expressions in Agda. Generally, + you have the following options: + + 1. Regular lambda expressions without pattern matching: + + ```agda + λ x → x + ``` + + 2. Pattern matching lambda expressions on record types: + + ```agda + λ (x , y) → x + ``` + + This syntax only applies to record types with $η$-equality. + + 3. Pattern matching lambda expressions with `{...}`: + + ```agda + λ { (inl x) → ... ; (inr y) → ...} + ``` + + 4. Pattern matching lambda expressions using the `where` keyword: + + ```agda + λ where refl → refl + ``` + + All four syntaxes are in use in the library, although when possible we try to + avoid general pattern matching lambdas, i.e. syntaxes 3 and 4. If need be, we + prefer pattern matching using the `where` keyword over the `{...}` syntax. + Note that whenever syntax 3 or 4 appear in a definition, it should be marked + as `abstract`. If computation is necessary for a definition that has these + syntaxes in them, this suggests the relevant lambda expression(s) deserve to + be factored out as separate definitions. + ## Code comments Given that the files in `agda-unimath` are literate Agda markdown files, diff --git a/src/foundation/type-arithmetic-unit-type.lagda.md b/src/foundation/type-arithmetic-unit-type.lagda.md index e7de5e86b9..767358fec4 100644 --- a/src/foundation/type-arithmetic-unit-type.lagda.md +++ b/src/foundation/type-arithmetic-unit-type.lagda.md @@ -164,10 +164,9 @@ module _ ( map-left-unit-law-Π ∘ map-inv-left-unit-law-Π) ~ id is-section-map-inv-left-unit-law-Π a = refl - abstract - is-retraction-map-inv-left-unit-law-Π : - ( map-inv-left-unit-law-Π ∘ map-left-unit-law-Π) ~ id - is-retraction-map-inv-left-unit-law-Π f = eq-htpy (λ where star → refl) + is-retraction-map-inv-left-unit-law-Π : + ( map-inv-left-unit-law-Π ∘ map-left-unit-law-Π) ~ id + is-retraction-map-inv-left-unit-law-Π f = eq-htpy (λ star → refl) is-equiv-map-left-unit-law-Π : is-equiv map-left-unit-law-Π is-equiv-map-left-unit-law-Π = From d038d4f3866fb7aa55347db67c13684517dd6f5b Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Mon, 9 Oct 2023 01:01:11 +0200 Subject: [PATCH 12/23] Update src/finite-group-theory/orbits-permutations.lagda.md Co-authored-by: Egbert Rijke --- src/finite-group-theory/orbits-permutations.lagda.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/finite-group-theory/orbits-permutations.lagda.md b/src/finite-group-theory/orbits-permutations.lagda.md index bf5ed64a50..b3549cb019 100644 --- a/src/finite-group-theory/orbits-permutations.lagda.md +++ b/src/finite-group-theory/orbits-permutations.lagda.md @@ -464,10 +464,10 @@ module _ ( Q) ( pr1 same-orbits-permutation a c) ( λ (k2 , q) → - ( unit-trunc-Prop + unit-trunc-Prop ( ( k2 +ℕ k1) , - ( (iterate-add-ℕ k2 k1 (map-equiv f) a) ∙ - ( ap (iterate k2 (map-equiv f)) p ∙ q)))))) + ( ( iterate-add-ℕ k2 k1 (map-equiv f) a) ∙ + ( ap (iterate k2 (map-equiv f)) p ∙ q))))) abstract is-decidable-same-orbits-permutation : From bbe943e01faae5f2d9b04539378a7232520aebd2 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Mon, 9 Oct 2023 01:17:59 +0200 Subject: [PATCH 13/23] `map-concat-equiv` --- src/foundation/identity-types.lagda.md | 30 ++++++++++++++++++++------ 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/src/foundation/identity-types.lagda.md b/src/foundation/identity-types.lagda.md index a426d51faa..2eda6db84f 100644 --- a/src/foundation/identity-types.lagda.md +++ b/src/foundation/identity-types.lagda.md @@ -97,15 +97,31 @@ module _ pr1 (equiv-concat p z) = concat p z pr2 (equiv-concat p z) = is-equiv-concat p z + map-concat-equiv : {x x' : A} → ((y : A) → (x = y) ≃ (x' = y)) → (x' = x) + map-concat-equiv {x} e = map-equiv (e x) refl + + is-section-equiv-concat : + {x x' : A} → map-concat-equiv {x} {x'} ∘ equiv-concat ~ id + is-section-equiv-concat refl = refl + + abstract + is-retraction-equiv-concat : + {x x' : A} → equiv-concat ∘ map-concat-equiv {x} {x'} ~ id + is-retraction-equiv-concat e = + eq-htpy (λ y → eq-htpy-equiv (λ where refl → right-unit)) + abstract - equiv-concat-equiv : - {x x' : A} → ((y : A) → (x = y) ≃ (x' = y)) ≃ (x' = x) - pr1 (equiv-concat-equiv {x}) e = map-equiv (e x) refl - pr2 equiv-concat-equiv = + is-equiv-map-concat-equiv : {x x' : A} → is-equiv (map-concat-equiv {x} {x'}) + is-equiv-map-concat-equiv = is-equiv-is-invertible - equiv-concat - ( λ where refl → refl) - ( λ e → eq-htpy (λ y → eq-htpy-equiv (λ where refl → right-unit))) + ( equiv-concat) + ( is-section-equiv-concat) + ( is-retraction-equiv-concat) + + equiv-concat-equiv : + {x x' : A} → ((y : A) → (x = y) ≃ (x' = y)) ≃ (x' = x) + pr1 equiv-concat-equiv = map-concat-equiv + pr2 equiv-concat-equiv = is-equiv-map-concat-equiv inv-concat' : (x : A) {y z : A} → y = z → x = z → x = y inv-concat' x q = concat' x (inv q) From e1affd947240c1242bc7c88c7af3bba35d33f469 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Mon, 9 Oct 2023 01:33:55 +0200 Subject: [PATCH 14/23] `decidable-emb-isolated-point` --- src/foundation/identity-types.lagda.md | 3 +- src/foundation/isolated-points.lagda.md | 39 ++++++++++++++++++------- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/foundation/identity-types.lagda.md b/src/foundation/identity-types.lagda.md index 2eda6db84f..6dc9a6a331 100644 --- a/src/foundation/identity-types.lagda.md +++ b/src/foundation/identity-types.lagda.md @@ -111,7 +111,8 @@ module _ eq-htpy (λ y → eq-htpy-equiv (λ where refl → right-unit)) abstract - is-equiv-map-concat-equiv : {x x' : A} → is-equiv (map-concat-equiv {x} {x'}) + is-equiv-map-concat-equiv : + {x x' : A} → is-equiv (map-concat-equiv {x} {x'}) is-equiv-map-concat-equiv = is-equiv-is-invertible ( equiv-concat) diff --git a/src/foundation/isolated-points.lagda.md b/src/foundation/isolated-points.lagda.md index 72148df23a..2612e9f8b2 100644 --- a/src/foundation/isolated-points.lagda.md +++ b/src/foundation/isolated-points.lagda.md @@ -42,8 +42,8 @@ open import foundation-core.transport-along-identifications ## Idea -A point `a : A` is considered to be isolated if `Id a x` is decidable for any -`x`. +A point `a : A` is considered to be **isolated** if `a = x` is +[decidable](foundation.decidable-types.md) for any `x`. ## Definitions @@ -240,21 +240,38 @@ is-set-isolated-point : is-set-isolated-point A = is-set-has-decidable-equality (has-decidable-equality-isolated-point A) -abstract - decidable-emb-isolated-point : - {l1 : Level} {A : UU l1} (a : isolated-point A) → unit ↪ᵈ A - pr1 (decidable-emb-isolated-point {l1} {A} a) = - const unit A (pr1 a) - pr1 (pr2 (decidable-emb-isolated-point {l1} {A} a)) = +module _ + {l1 : Level} {A : UU l1} (a : isolated-point A) + where + + is-emb-map-isolated-point : is-emb (const unit A (point-isolated-point a)) + is-emb-map-isolated-point = is-emb-comp ( inclusion-isolated-point A) ( const unit (isolated-point A) a) ( is-emb-inclusion-isolated-point A) ( is-emb-is-injective ( is-set-isolated-point A) - ( λ where {star} {star} p → refl)) - pr2 (pr2 (decidable-emb-isolated-point {l1} {A} a)) x = - is-decidable-prod is-decidable-unit (pr2 a x) + ( λ {star} {star} p → refl)) + + emb-isolated-point : unit ↪ A + pr1 emb-isolated-point = const unit A (point-isolated-point a) + pr2 emb-isolated-point = is-emb-map-isolated-point + + is-decidable-map-isolated-point : + is-decidable-map (const unit A (point-isolated-point a)) + is-decidable-map-isolated-point x = + is-decidable-prod is-decidable-unit (is-isolated-isolated-point a x) + + is-decidable-emb-map-isolated-point : + is-decidable-emb (const unit A (point-isolated-point a)) + pr1 is-decidable-emb-map-isolated-point = is-emb-map-isolated-point + pr2 is-decidable-emb-map-isolated-point = is-decidable-map-isolated-point + + decidable-emb-isolated-point : unit ↪ᵈ A + pr1 decidable-emb-isolated-point = + const unit A (point-isolated-point a) + pr2 decidable-emb-isolated-point = is-decidable-emb-map-isolated-point ``` ### Types with isolated points can be equipped with a Maybe-structure From 5b29ac1818d8c45924d4fa6dc9f1a9c86cb28a24 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Mon, 9 Oct 2023 01:48:26 +0200 Subject: [PATCH 15/23] rename isolated points to isolated elements --- .../concrete-quaternion-group.lagda.md | 4 +- src/foundation.lagda.md | 2 +- src/foundation/isolated-elements.lagda.md | 392 ++++++++++++++++++ src/foundation/isolated-points.lagda.md | 386 ----------------- ...roducts-unordered-tuples-of-types.lagda.md | 2 +- src/foundation/unordered-tuples.lagda.md | 2 +- src/trees/combinator-directed-trees.lagda.md | 2 +- src/trees/directed-trees.lagda.md | 2 +- src/trees/enriched-directed-trees.lagda.md | 2 +- ...oalgebras-polynomial-endofunctors.lagda.md | 2 +- ...ying-trees-of-elements-of-w-types.lagda.md | 2 +- .../complements-isolated-points.lagda.md | 4 +- src/univalent-combinatorics/cubes.lagda.md | 2 +- .../main-classes-of-latin-hypercubes.lagda.md | 2 +- 14 files changed, 406 insertions(+), 400 deletions(-) create mode 100644 src/foundation/isolated-elements.lagda.md delete mode 100644 src/foundation/isolated-points.lagda.md diff --git a/src/finite-group-theory/concrete-quaternion-group.lagda.md b/src/finite-group-theory/concrete-quaternion-group.lagda.md index d03507a4e9..9087543aad 100644 --- a/src/finite-group-theory/concrete-quaternion-group.lagda.md +++ b/src/finite-group-theory/concrete-quaternion-group.lagda.md @@ -12,11 +12,11 @@ open import elementary-number-theory.natural-numbers open import foundation.dependent-pair-types open import foundation.equivalences open import foundation.identity-types -open import foundation.isolated-points +open import foundation.isolated-elements open import foundation.transport-along-identifications open import foundation.universe-levels -open import univalent-combinatorics.complements-isolated-points +open import univalent-combinatorics.complements-isolated-elements open import univalent-combinatorics.cubes open import univalent-combinatorics.equality-finite-types open import univalent-combinatorics.equivalences-cubes diff --git a/src/foundation.lagda.md b/src/foundation.lagda.md index e243af330c..3e4e87a3c6 100644 --- a/src/foundation.lagda.md +++ b/src/foundation.lagda.md @@ -158,7 +158,7 @@ open import foundation.interchange-law public open import foundation.intersections-subtypes public open import foundation.invertible-maps public open import foundation.involutions public -open import foundation.isolated-points public +open import foundation.isolated-elements public open import foundation.isomorphisms-of-sets public open import foundation.iterated-cartesian-product-types public open import foundation.iterating-automorphisms public diff --git a/src/foundation/isolated-elements.lagda.md b/src/foundation/isolated-elements.lagda.md new file mode 100644 index 0000000000..31fe2e98df --- /dev/null +++ b/src/foundation/isolated-elements.lagda.md @@ -0,0 +1,392 @@ +# Isolated elements + +```agda +module foundation.isolated-elements where +``` + +
Imports + +```agda +open import foundation.action-on-identifications-functions +open import foundation.constant-maps +open import foundation.decidable-embeddings +open import foundation.decidable-equality +open import foundation.decidable-maps +open import foundation.decidable-types +open import foundation.dependent-pair-types +open import foundation.embeddings +open import foundation.fundamental-theorem-of-identity-types +open import foundation.identity-types +open import foundation.maybe +open import foundation.negation +open import foundation.type-arithmetic-unit-type +open import foundation.unit-type +open import foundation.universe-levels + +open import foundation-core.contractible-types +open import foundation-core.coproduct-types +open import foundation-core.decidable-propositions +open import foundation-core.empty-types +open import foundation-core.equivalences +open import foundation-core.function-types +open import foundation-core.functoriality-dependent-pair-types +open import foundation-core.homotopies +open import foundation-core.injective-maps +open import foundation-core.propositions +open import foundation-core.sets +open import foundation-core.subtypes +open import foundation-core.transport-along-identifications +``` + +
+ +## Idea + +An element `a : A` is considered to be **isolated** if `a = x` is +[decidable](foundation.decidable-types.md) for any `x`. + +## Definitions + +### Isolated elements + +```agda +is-isolated : + {l1 : Level} {X : UU l1} (a : X) → UU l1 +is-isolated {l1} {X} a = (x : X) → is-decidable (a = x) + +isolated-element : + {l1 : Level} (X : UU l1) → UU l1 +isolated-element X = Σ X is-isolated + +module _ + {l : Level} {X : UU l} (x : isolated-element X) + where + + element-isolated-element : X + element-isolated-element = pr1 x + + is-isolated-isolated-element : is-isolated element-isolated-element + is-isolated-isolated-element = pr2 x +``` + +### Complements of isolated points + +```agda +complement-isolated-element : + {l1 : Level} (X : UU l1) → isolated-element X → UU l1 +complement-isolated-element X x = + Σ X (λ y → ¬ (element-isolated-element x = y)) +``` + +## Properties + +### A element is decidable if and only if the constant map pointing at it is decidable + +```agda +module _ + {l1 : Level} {A : UU l1} (a : A) + where + + is-decidable-point-is-isolated : + is-isolated a → is-decidable-map (point a) + is-decidable-point-is-isolated d x = + is-decidable-equiv (fiber-const a x) (d x) + + is-isolated-is-decidable-point : + is-decidable-map (point a) → is-isolated a + is-isolated-is-decidable-point d x = + is-decidable-equiv' (fiber-const a x) (d x) + + cases-Eq-isolated-element : + is-isolated a → (x : A) → is-decidable (a = x) → UU lzero + cases-Eq-isolated-element H x (inl p) = unit + cases-Eq-isolated-element H x (inr f) = empty + + abstract + is-prop-cases-Eq-isolated-element : + (d : is-isolated a) (x : A) (dx : is-decidable (a = x)) → + is-prop (cases-Eq-isolated-element d x dx) + is-prop-cases-Eq-isolated-element d x (inl p) = is-prop-unit + is-prop-cases-Eq-isolated-element d x (inr f) = is-prop-empty + + Eq-isolated-element : is-isolated a → A → UU lzero + Eq-isolated-element d x = cases-Eq-isolated-element d x (d x) + + abstract + is-prop-Eq-isolated-element : + (d : is-isolated a) (x : A) → is-prop (Eq-isolated-element d x) + is-prop-Eq-isolated-element d x = + is-prop-cases-Eq-isolated-element d x (d x) + + Eq-isolated-element-Prop : is-isolated a → A → Prop lzero + pr1 (Eq-isolated-element-Prop d x) = Eq-isolated-element d x + pr2 (Eq-isolated-element-Prop d x) = is-prop-Eq-isolated-element d x + + decide-reflexivity : + (d : is-decidable (a = a)) → Σ (a = a) (λ p → inl p = d) + pr1 (decide-reflexivity (inl p)) = p + pr2 (decide-reflexivity (inl p)) = refl + decide-reflexivity (inr f) = ex-falso (f refl) + + abstract + refl-Eq-isolated-element : (d : is-isolated a) → Eq-isolated-element d a + refl-Eq-isolated-element d = + tr + ( cases-Eq-isolated-element d a) + ( pr2 (decide-reflexivity (d a))) + ( star) + + abstract + Eq-eq-isolated-element : + (d : is-isolated a) {x : A} → a = x → Eq-isolated-element d x + Eq-eq-isolated-element d refl = refl-Eq-isolated-element d + + abstract + center-total-Eq-isolated-element : + (d : is-isolated a) → Σ A (Eq-isolated-element d) + pr1 (center-total-Eq-isolated-element d) = a + pr2 (center-total-Eq-isolated-element d) = refl-Eq-isolated-element d + + cases-contraction-total-Eq-isolated-element : + (d : is-isolated a) (x : A) (dx : is-decidable (a = x)) + (e : cases-Eq-isolated-element d x dx) → a = x + cases-contraction-total-Eq-isolated-element d x (inl p) e = p + + contraction-total-Eq-isolated-element : + (d : is-isolated a) (t : Σ A (Eq-isolated-element d)) → + center-total-Eq-isolated-element d = t + contraction-total-Eq-isolated-element d (x , e) = + eq-type-subtype + ( Eq-isolated-element-Prop d) + ( cases-contraction-total-Eq-isolated-element d x (d x) e) + + is-contr-total-Eq-isolated-element : + (d : is-isolated a) → is-contr (Σ A (Eq-isolated-element d)) + pr1 (is-contr-total-Eq-isolated-element d) = center-total-Eq-isolated-element d + pr2 (is-contr-total-Eq-isolated-element d) = + contraction-total-Eq-isolated-element d + + abstract + is-equiv-Eq-eq-isolated-element : + (d : is-isolated a) (x : A) → is-equiv (Eq-eq-isolated-element d {x}) + is-equiv-Eq-eq-isolated-element d = + fundamental-theorem-id + ( is-contr-total-Eq-isolated-element d) + ( λ x → Eq-eq-isolated-element d {x}) + + abstract + equiv-Eq-eq-isolated-element : + (d : is-isolated a) (x : A) → (a = x) ≃ Eq-isolated-element d x + pr1 (equiv-Eq-eq-isolated-element d x) = Eq-eq-isolated-element d + pr2 (equiv-Eq-eq-isolated-element d x) = is-equiv-Eq-eq-isolated-element d x + + abstract + is-prop-eq-isolated-element : (d : is-isolated a) (x : A) → is-prop (a = x) + is-prop-eq-isolated-element d x = + is-prop-equiv + ( equiv-Eq-eq-isolated-element d x) + ( is-prop-Eq-isolated-element d x) + + is-contr-loop-space-isolated-element : + (d : is-isolated a) → is-contr (a = a) + is-contr-loop-space-isolated-element d = + is-proof-irrelevant-is-prop (is-prop-eq-isolated-element d a) refl + + abstract + is-emb-point-is-isolated : is-isolated a → is-emb (point a) + is-emb-point-is-isolated d star = + fundamental-theorem-id + ( is-contr-equiv + ( a = a) + ( left-unit-law-prod) + ( is-proof-irrelevant-is-prop + ( is-prop-eq-isolated-element d a) + ( refl))) + ( λ x → ap (λ y → a)) +``` + +### Being an isolated element is a property + +```agda +is-prop-is-isolated : + {l1 : Level} {A : UU l1} (a : A) → is-prop (is-isolated a) +is-prop-is-isolated a = + is-prop-is-inhabited + ( λ H → + is-prop-Π (λ x → is-prop-is-decidable (is-prop-eq-isolated-element a H x))) + +is-isolated-Prop : + {l1 : Level} {A : UU l1} (a : A) → Prop l1 +pr1 (is-isolated-Prop a) = is-isolated a +pr2 (is-isolated-Prop a) = is-prop-is-isolated a + +inclusion-isolated-element : + {l1 : Level} (A : UU l1) → isolated-element A → A +inclusion-isolated-element A = pr1 + +is-emb-inclusion-isolated-element : + {l1 : Level} (A : UU l1) → is-emb (inclusion-isolated-element A) +is-emb-inclusion-isolated-element A = is-emb-inclusion-subtype is-isolated-Prop + +has-decidable-equality-isolated-element : + {l1 : Level} (A : UU l1) → has-decidable-equality (isolated-element A) +has-decidable-equality-isolated-element A (x , dx) (y , dy) = + is-decidable-equiv + ( equiv-ap-inclusion-subtype is-isolated-Prop) + ( dx y) + +is-set-isolated-element : + {l1 : Level} (A : UU l1) → is-set (isolated-element A) +is-set-isolated-element A = + is-set-has-decidable-equality (has-decidable-equality-isolated-element A) + +module _ + {l1 : Level} {A : UU l1} (a : isolated-element A) + where + + point-isolated-element : unit → A + point-isolated-element = point (element-isolated-element a) + + is-emb-point-isolated-element : is-emb point-isolated-element + is-emb-point-isolated-element = + is-emb-comp + ( inclusion-isolated-element A) + ( const unit (isolated-element A) a) + ( is-emb-inclusion-isolated-element A) + ( is-emb-is-injective + ( is-set-isolated-element A) + ( λ {star} {star} p → refl)) + + emb-point-isolated-element : unit ↪ A + pr1 emb-point-isolated-element = point-isolated-element + pr2 emb-point-isolated-element = is-emb-point-isolated-element + + is-decidable-point-isolated-element : + is-decidable-map point-isolated-element + is-decidable-point-isolated-element x = + is-decidable-prod is-decidable-unit (is-isolated-isolated-element a x) + + is-decidable-emb-point-isolated-element : + is-decidable-emb point-isolated-element + pr1 is-decidable-emb-point-isolated-element = + is-emb-point-isolated-element + pr2 is-decidable-emb-point-isolated-element = + is-decidable-point-isolated-element + + decidable-emb-point-isolated-element : unit ↪ᵈ A + pr1 decidable-emb-point-isolated-element = + point-isolated-element + pr2 decidable-emb-point-isolated-element = + is-decidable-emb-point-isolated-element +``` + +### Types with isolated points can be equipped with a Maybe-structure + +```agda +map-maybe-structure-isolated-element : + {l1 : Level} (X : UU l1) (x : isolated-element X) → + Maybe (complement-isolated-element X x) → X +map-maybe-structure-isolated-element X (x , d) (inl (y , f)) = y +map-maybe-structure-isolated-element X (x , d) (inr star) = x + +cases-map-inv-maybe-structure-isolated-element : + {l1 : Level} (X : UU l1) (x : isolated-element X) → + (y : X) → is-decidable (pr1 x = y) → Maybe (complement-isolated-element X x) +cases-map-inv-maybe-structure-isolated-element X (x , dx) y (inl p) = + inr star +cases-map-inv-maybe-structure-isolated-element X (x , dx) y (inr f) = + inl (y , f) + +map-inv-maybe-structure-isolated-element : + {l1 : Level} (X : UU l1) (x : isolated-element X) → + X → Maybe (complement-isolated-element X x) +map-inv-maybe-structure-isolated-element X (x , d) y = + cases-map-inv-maybe-structure-isolated-element X (x , d) y (d y) + +cases-is-section-map-inv-maybe-structure-isolated-element : + {l1 : Level} (X : UU l1) (x : isolated-element X) → + (y : X) (d : is-decidable (pr1 x = y)) → + ( map-maybe-structure-isolated-element X x + ( cases-map-inv-maybe-structure-isolated-element X x y d)) = + ( y) +cases-is-section-map-inv-maybe-structure-isolated-element X + (x , dx) .x (inl refl) = + refl +cases-is-section-map-inv-maybe-structure-isolated-element X (x , dx) y (inr f) = + refl + +is-section-map-inv-maybe-structure-isolated-element : + {l1 : Level} (X : UU l1) (x : isolated-element X) → + ( map-maybe-structure-isolated-element X x ∘ + map-inv-maybe-structure-isolated-element X x) ~ id +is-section-map-inv-maybe-structure-isolated-element X (x , d) y = + cases-is-section-map-inv-maybe-structure-isolated-element X (x , d) y (d y) + +is-retraction-map-inv-maybe-structure-isolated-element : + {l1 : Level} (X : UU l1) (x : isolated-element X) → + ( map-inv-maybe-structure-isolated-element X x ∘ + map-maybe-structure-isolated-element X x) ~ id +is-retraction-map-inv-maybe-structure-isolated-element X (x , dx) (inl (y , f)) = + ap + ( cases-map-inv-maybe-structure-isolated-element X (x , dx) y) + ( eq-is-prop (is-prop-is-decidable (is-prop-eq-isolated-element x dx y))) +is-retraction-map-inv-maybe-structure-isolated-element X (x , dx) (inr star) = + ap + ( cases-map-inv-maybe-structure-isolated-element X (x , dx) x) + { x = dx (map-maybe-structure-isolated-element X (x , dx) (inr star))} + { y = inl refl} + ( eq-is-prop (is-prop-is-decidable (is-prop-eq-isolated-element x dx x))) + +is-equiv-map-maybe-structure-isolated-element : + {l1 : Level} (X : UU l1) (x : isolated-element X) → + is-equiv (map-maybe-structure-isolated-element X x) +is-equiv-map-maybe-structure-isolated-element X x = + is-equiv-is-invertible + ( map-inv-maybe-structure-isolated-element X x) + ( is-section-map-inv-maybe-structure-isolated-element X x) + ( is-retraction-map-inv-maybe-structure-isolated-element X x) + +equiv-maybe-structure-isolated-element : + {l1 : Level} (X : UU l1) (x : isolated-element X) → + Maybe (complement-isolated-element X x) ≃ X +pr1 (equiv-maybe-structure-isolated-element X x) = + map-maybe-structure-isolated-element X x +pr2 (equiv-maybe-structure-isolated-element X x) = + is-equiv-map-maybe-structure-isolated-element X x + +maybe-structure-isolated-element : + {l1 : Level} {X : UU l1} → isolated-element X → maybe-structure X +pr1 (maybe-structure-isolated-element {l1} {X} x) = + complement-isolated-element X x +pr2 (maybe-structure-isolated-element {l1} {X} x) = + equiv-maybe-structure-isolated-element X x +``` + +```agda +equiv-complement-isolated-element : + {l1 l2 : Level} {X : UU l1} {Y : UU l2} (e : X ≃ Y) (x : isolated-element X) + (y : isolated-element Y) (p : map-equiv e (pr1 x) = pr1 y) → + complement-isolated-element X x ≃ complement-isolated-element Y y +equiv-complement-isolated-element e x y p = + equiv-Σ + ( λ z → ¬ (pr1 y = z)) + ( e) + ( λ z → + equiv-neg + ( equiv-concat (inv p) (map-equiv e z) ∘e (equiv-ap e (pr1 x) z))) +``` + +```agda +inclusion-complement-isolated-element : + {l1 : Level} {X : UU l1} (x : isolated-element X) → + complement-isolated-element X x → X +inclusion-complement-isolated-element x = pr1 + +natural-inclusion-equiv-complement-isolated-element : + {l1 l2 : Level} {X : UU l1} {Y : UU l2} (e : X ≃ Y) (x : isolated-element X) + (y : isolated-element Y) (p : map-equiv e (pr1 x) = pr1 y) → + ( inclusion-complement-isolated-element y ∘ + map-equiv (equiv-complement-isolated-element e x y p)) ~ + ( map-equiv e ∘ inclusion-complement-isolated-element x) +natural-inclusion-equiv-complement-isolated-element e x y p (x' , f) = refl +``` diff --git a/src/foundation/isolated-points.lagda.md b/src/foundation/isolated-points.lagda.md deleted file mode 100644 index 2612e9f8b2..0000000000 --- a/src/foundation/isolated-points.lagda.md +++ /dev/null @@ -1,386 +0,0 @@ -# Isolated points - -```agda -module foundation.isolated-points where -``` - -
Imports - -```agda -open import foundation.action-on-identifications-functions -open import foundation.constant-maps -open import foundation.decidable-embeddings -open import foundation.decidable-equality -open import foundation.decidable-maps -open import foundation.decidable-types -open import foundation.dependent-pair-types -open import foundation.embeddings -open import foundation.fundamental-theorem-of-identity-types -open import foundation.identity-types -open import foundation.maybe -open import foundation.negation -open import foundation.type-arithmetic-unit-type -open import foundation.unit-type -open import foundation.universe-levels - -open import foundation-core.contractible-types -open import foundation-core.coproduct-types -open import foundation-core.decidable-propositions -open import foundation-core.empty-types -open import foundation-core.equivalences -open import foundation-core.function-types -open import foundation-core.functoriality-dependent-pair-types -open import foundation-core.homotopies -open import foundation-core.injective-maps -open import foundation-core.propositions -open import foundation-core.sets -open import foundation-core.subtypes -open import foundation-core.transport-along-identifications -``` - -
- -## Idea - -A point `a : A` is considered to be **isolated** if `a = x` is -[decidable](foundation.decidable-types.md) for any `x`. - -## Definitions - -### Isolated points - -```agda -is-isolated : - {l1 : Level} {X : UU l1} (a : X) → UU l1 -is-isolated {l1} {X} a = (x : X) → is-decidable (a = x) - -isolated-point : - {l1 : Level} (X : UU l1) → UU l1 -isolated-point X = Σ X is-isolated - -module _ - {l : Level} {X : UU l} (x : isolated-point X) - where - - point-isolated-point : X - point-isolated-point = pr1 x - - is-isolated-isolated-point : is-isolated point-isolated-point - is-isolated-isolated-point = pr2 x -``` - -### Complements of isolated points - -```agda -complement-isolated-point : - {l1 : Level} (X : UU l1) → isolated-point X → UU l1 -complement-isolated-point X x = - Σ X (λ y → ¬ (point-isolated-point x = y)) -``` - -## Properties - -### A point is decidable if and only if the constant map pointing at it is decidable - -```agda -module _ - {l1 : Level} {A : UU l1} (a : A) - where - - is-decidable-map-const-is-isolated : - is-isolated a → is-decidable-map (const unit A a) - is-decidable-map-const-is-isolated d x = - is-decidable-equiv (fiber-const a x) (d x) - - is-isolated-is-decidable-map-const : - is-decidable-map (const unit A a) → is-isolated a - is-isolated-is-decidable-map-const d x = - is-decidable-equiv' (fiber-const a x) (d x) - - cases-Eq-isolated-point : - is-isolated a → (x : A) → is-decidable (a = x) → UU lzero - cases-Eq-isolated-point H x (inl p) = unit - cases-Eq-isolated-point H x (inr f) = empty - - abstract - is-prop-cases-Eq-isolated-point : - (d : is-isolated a) (x : A) (dx : is-decidable (a = x)) → - is-prop (cases-Eq-isolated-point d x dx) - is-prop-cases-Eq-isolated-point d x (inl p) = is-prop-unit - is-prop-cases-Eq-isolated-point d x (inr f) = is-prop-empty - - Eq-isolated-point : is-isolated a → A → UU lzero - Eq-isolated-point d x = cases-Eq-isolated-point d x (d x) - - abstract - is-prop-Eq-isolated-point : - (d : is-isolated a) (x : A) → is-prop (Eq-isolated-point d x) - is-prop-Eq-isolated-point d x = - is-prop-cases-Eq-isolated-point d x (d x) - - Eq-isolated-point-Prop : is-isolated a → A → Prop lzero - pr1 (Eq-isolated-point-Prop d x) = Eq-isolated-point d x - pr2 (Eq-isolated-point-Prop d x) = is-prop-Eq-isolated-point d x - - decide-reflexivity : - (d : is-decidable (a = a)) → Σ (a = a) (λ p → inl p = d) - pr1 (decide-reflexivity (inl p)) = p - pr2 (decide-reflexivity (inl p)) = refl - decide-reflexivity (inr f) = ex-falso (f refl) - - abstract - refl-Eq-isolated-point : (d : is-isolated a) → Eq-isolated-point d a - refl-Eq-isolated-point d = - tr - ( cases-Eq-isolated-point d a) - ( pr2 (decide-reflexivity (d a))) - ( star) - - abstract - Eq-eq-isolated-point : - (d : is-isolated a) {x : A} → a = x → Eq-isolated-point d x - Eq-eq-isolated-point d refl = refl-Eq-isolated-point d - - abstract - center-total-Eq-isolated-point : - (d : is-isolated a) → Σ A (Eq-isolated-point d) - pr1 (center-total-Eq-isolated-point d) = a - pr2 (center-total-Eq-isolated-point d) = refl-Eq-isolated-point d - - cases-contraction-total-Eq-isolated-point : - (d : is-isolated a) (x : A) (dx : is-decidable (a = x)) - (e : cases-Eq-isolated-point d x dx) → a = x - cases-contraction-total-Eq-isolated-point d x (inl p) e = p - - contraction-total-Eq-isolated-point : - (d : is-isolated a) (t : Σ A (Eq-isolated-point d)) → - center-total-Eq-isolated-point d = t - contraction-total-Eq-isolated-point d (x , e) = - eq-type-subtype - ( Eq-isolated-point-Prop d) - ( cases-contraction-total-Eq-isolated-point d x (d x) e) - - is-contr-total-Eq-isolated-point : - (d : is-isolated a) → is-contr (Σ A (Eq-isolated-point d)) - pr1 (is-contr-total-Eq-isolated-point d) = center-total-Eq-isolated-point d - pr2 (is-contr-total-Eq-isolated-point d) = - contraction-total-Eq-isolated-point d - - abstract - is-equiv-Eq-eq-isolated-point : - (d : is-isolated a) (x : A) → is-equiv (Eq-eq-isolated-point d {x}) - is-equiv-Eq-eq-isolated-point d = - fundamental-theorem-id - ( is-contr-total-Eq-isolated-point d) - ( λ x → Eq-eq-isolated-point d {x}) - - abstract - equiv-Eq-eq-isolated-point : - (d : is-isolated a) (x : A) → (a = x) ≃ Eq-isolated-point d x - pr1 (equiv-Eq-eq-isolated-point d x) = Eq-eq-isolated-point d - pr2 (equiv-Eq-eq-isolated-point d x) = is-equiv-Eq-eq-isolated-point d x - - abstract - is-prop-eq-isolated-point : (d : is-isolated a) (x : A) → is-prop (a = x) - is-prop-eq-isolated-point d x = - is-prop-equiv - ( equiv-Eq-eq-isolated-point d x) - ( is-prop-Eq-isolated-point d x) - - is-contr-loop-space-isolated-point : - (d : is-isolated a) → is-contr (a = a) - is-contr-loop-space-isolated-point d = - is-proof-irrelevant-is-prop (is-prop-eq-isolated-point d a) refl - - abstract - is-emb-const-is-isolated : is-isolated a → is-emb (const unit A a) - is-emb-const-is-isolated d star = - fundamental-theorem-id - ( is-contr-equiv - ( a = a) - ( left-unit-law-prod) - ( is-proof-irrelevant-is-prop - ( is-prop-eq-isolated-point d a) - ( refl))) - ( λ x → ap (λ y → a)) -``` - -### Being an isolated point is a property - -```agda -is-prop-is-isolated : - {l1 : Level} {A : UU l1} (a : A) → is-prop (is-isolated a) -is-prop-is-isolated a = - is-prop-is-inhabited - ( λ H → - is-prop-Π (λ x → is-prop-is-decidable (is-prop-eq-isolated-point a H x))) - -is-isolated-Prop : - {l1 : Level} {A : UU l1} (a : A) → Prop l1 -pr1 (is-isolated-Prop a) = is-isolated a -pr2 (is-isolated-Prop a) = is-prop-is-isolated a - -inclusion-isolated-point : - {l1 : Level} (A : UU l1) → isolated-point A → A -inclusion-isolated-point A = pr1 - -is-emb-inclusion-isolated-point : - {l1 : Level} (A : UU l1) → is-emb (inclusion-isolated-point A) -is-emb-inclusion-isolated-point A = is-emb-inclusion-subtype is-isolated-Prop - -has-decidable-equality-isolated-point : - {l1 : Level} (A : UU l1) → has-decidable-equality (isolated-point A) -has-decidable-equality-isolated-point A (x , dx) (y , dy) = - is-decidable-equiv - ( equiv-ap-inclusion-subtype is-isolated-Prop) - ( dx y) - -is-set-isolated-point : - {l1 : Level} (A : UU l1) → is-set (isolated-point A) -is-set-isolated-point A = - is-set-has-decidable-equality (has-decidable-equality-isolated-point A) - -module _ - {l1 : Level} {A : UU l1} (a : isolated-point A) - where - - is-emb-map-isolated-point : is-emb (const unit A (point-isolated-point a)) - is-emb-map-isolated-point = - is-emb-comp - ( inclusion-isolated-point A) - ( const unit (isolated-point A) a) - ( is-emb-inclusion-isolated-point A) - ( is-emb-is-injective - ( is-set-isolated-point A) - ( λ {star} {star} p → refl)) - - emb-isolated-point : unit ↪ A - pr1 emb-isolated-point = const unit A (point-isolated-point a) - pr2 emb-isolated-point = is-emb-map-isolated-point - - is-decidable-map-isolated-point : - is-decidable-map (const unit A (point-isolated-point a)) - is-decidable-map-isolated-point x = - is-decidable-prod is-decidable-unit (is-isolated-isolated-point a x) - - is-decidable-emb-map-isolated-point : - is-decidable-emb (const unit A (point-isolated-point a)) - pr1 is-decidable-emb-map-isolated-point = is-emb-map-isolated-point - pr2 is-decidable-emb-map-isolated-point = is-decidable-map-isolated-point - - decidable-emb-isolated-point : unit ↪ᵈ A - pr1 decidable-emb-isolated-point = - const unit A (point-isolated-point a) - pr2 decidable-emb-isolated-point = is-decidable-emb-map-isolated-point -``` - -### Types with isolated points can be equipped with a Maybe-structure - -```agda -map-maybe-structure-isolated-point : - {l1 : Level} (X : UU l1) (x : isolated-point X) → - Maybe (complement-isolated-point X x) → X -map-maybe-structure-isolated-point X (x , d) (inl (y , f)) = y -map-maybe-structure-isolated-point X (x , d) (inr star) = x - -cases-map-inv-maybe-structure-isolated-point : - {l1 : Level} (X : UU l1) (x : isolated-point X) → - (y : X) → is-decidable (pr1 x = y) → Maybe (complement-isolated-point X x) -cases-map-inv-maybe-structure-isolated-point X (x , dx) y (inl p) = - inr star -cases-map-inv-maybe-structure-isolated-point X (x , dx) y (inr f) = - inl (y , f) - -map-inv-maybe-structure-isolated-point : - {l1 : Level} (X : UU l1) (x : isolated-point X) → - X → Maybe (complement-isolated-point X x) -map-inv-maybe-structure-isolated-point X (x , d) y = - cases-map-inv-maybe-structure-isolated-point X (x , d) y (d y) - -cases-is-section-map-inv-maybe-structure-isolated-point : - {l1 : Level} (X : UU l1) (x : isolated-point X) → - (y : X) (d : is-decidable (pr1 x = y)) → - ( map-maybe-structure-isolated-point X x - ( cases-map-inv-maybe-structure-isolated-point X x y d)) = - ( y) -cases-is-section-map-inv-maybe-structure-isolated-point X - (x , dx) .x (inl refl) = - refl -cases-is-section-map-inv-maybe-structure-isolated-point X (x , dx) y (inr f) = - refl - -is-section-map-inv-maybe-structure-isolated-point : - {l1 : Level} (X : UU l1) (x : isolated-point X) → - ( map-maybe-structure-isolated-point X x ∘ - map-inv-maybe-structure-isolated-point X x) ~ id -is-section-map-inv-maybe-structure-isolated-point X (x , d) y = - cases-is-section-map-inv-maybe-structure-isolated-point X (x , d) y (d y) - -is-retraction-map-inv-maybe-structure-isolated-point : - {l1 : Level} (X : UU l1) (x : isolated-point X) → - ( map-inv-maybe-structure-isolated-point X x ∘ - map-maybe-structure-isolated-point X x) ~ id -is-retraction-map-inv-maybe-structure-isolated-point X (x , dx) (inl (y , f)) = - ap - ( cases-map-inv-maybe-structure-isolated-point X (x , dx) y) - ( eq-is-prop (is-prop-is-decidable (is-prop-eq-isolated-point x dx y))) -is-retraction-map-inv-maybe-structure-isolated-point X (x , dx) (inr star) = - ap - ( cases-map-inv-maybe-structure-isolated-point X (x , dx) x) - { x = dx (map-maybe-structure-isolated-point X (x , dx) (inr star))} - { y = inl refl} - ( eq-is-prop (is-prop-is-decidable (is-prop-eq-isolated-point x dx x))) - -is-equiv-map-maybe-structure-isolated-point : - {l1 : Level} (X : UU l1) (x : isolated-point X) → - is-equiv (map-maybe-structure-isolated-point X x) -is-equiv-map-maybe-structure-isolated-point X x = - is-equiv-is-invertible - ( map-inv-maybe-structure-isolated-point X x) - ( is-section-map-inv-maybe-structure-isolated-point X x) - ( is-retraction-map-inv-maybe-structure-isolated-point X x) - -equiv-maybe-structure-isolated-point : - {l1 : Level} (X : UU l1) (x : isolated-point X) → - Maybe (complement-isolated-point X x) ≃ X -pr1 (equiv-maybe-structure-isolated-point X x) = - map-maybe-structure-isolated-point X x -pr2 (equiv-maybe-structure-isolated-point X x) = - is-equiv-map-maybe-structure-isolated-point X x - -maybe-structure-isolated-point : - {l1 : Level} {X : UU l1} → isolated-point X → maybe-structure X -pr1 (maybe-structure-isolated-point {l1} {X} x) = - complement-isolated-point X x -pr2 (maybe-structure-isolated-point {l1} {X} x) = - equiv-maybe-structure-isolated-point X x -``` - -```agda -equiv-complement-isolated-point : - {l1 l2 : Level} {X : UU l1} {Y : UU l2} (e : X ≃ Y) (x : isolated-point X) - (y : isolated-point Y) (p : map-equiv e (pr1 x) = pr1 y) → - complement-isolated-point X x ≃ complement-isolated-point Y y -equiv-complement-isolated-point e x y p = - equiv-Σ - ( λ z → ¬ (pr1 y = z)) - ( e) - ( λ z → - equiv-neg - ( equiv-concat (inv p) (map-equiv e z) ∘e (equiv-ap e (pr1 x) z))) -``` - -```agda -inclusion-complement-isolated-point : - {l1 : Level} {X : UU l1} (x : isolated-point X) → - complement-isolated-point X x → X -inclusion-complement-isolated-point x = pr1 - -natural-inclusion-equiv-complement-isolated-point : - {l1 l2 : Level} {X : UU l1} {Y : UU l2} (e : X ≃ Y) (x : isolated-point X) - (y : isolated-point Y) (p : map-equiv e (pr1 x) = pr1 y) → - ( inclusion-complement-isolated-point y ∘ - map-equiv (equiv-complement-isolated-point e x y p)) ~ - ( map-equiv e ∘ inclusion-complement-isolated-point x) -natural-inclusion-equiv-complement-isolated-point e x y p (x' , f) = refl -``` diff --git a/src/foundation/products-unordered-tuples-of-types.lagda.md b/src/foundation/products-unordered-tuples-of-types.lagda.md index 9fb480d64f..0d38144963 100644 --- a/src/foundation/products-unordered-tuples-of-types.lagda.md +++ b/src/foundation/products-unordered-tuples-of-types.lagda.md @@ -19,7 +19,7 @@ open import foundation.unordered-tuples-of-types open import foundation-core.cartesian-product-types open import foundation-core.equivalences -open import univalent-combinatorics.complements-isolated-points +open import univalent-combinatorics.complements-isolated-elements ``` diff --git a/src/foundation/unordered-tuples.lagda.md b/src/foundation/unordered-tuples.lagda.md index 3f0ce1a080..4693c07116 100644 --- a/src/foundation/unordered-tuples.lagda.md +++ b/src/foundation/unordered-tuples.lagda.md @@ -26,7 +26,7 @@ open import foundation-core.identity-types open import foundation-core.sets open import foundation-core.whiskering-homotopies -open import univalent-combinatorics.complements-isolated-points +open import univalent-combinatorics.complements-isolated-elements open import univalent-combinatorics.equality-finite-types open import univalent-combinatorics.finite-types open import univalent-combinatorics.standard-finite-types diff --git a/src/trees/combinator-directed-trees.lagda.md b/src/trees/combinator-directed-trees.lagda.md index ba130ca49a..8e018d6c5f 100644 --- a/src/trees/combinator-directed-trees.lagda.md +++ b/src/trees/combinator-directed-trees.lagda.md @@ -19,7 +19,7 @@ open import foundation.function-types open import foundation.functoriality-dependent-pair-types open import foundation.homotopies open import foundation.identity-types -open import foundation.isolated-points +open import foundation.isolated-elements open import foundation.maybe open import foundation.negation open import foundation.propositions diff --git a/src/trees/directed-trees.lagda.md b/src/trees/directed-trees.lagda.md index c006851654..612778cc4a 100644 --- a/src/trees/directed-trees.lagda.md +++ b/src/trees/directed-trees.lagda.md @@ -21,7 +21,7 @@ open import foundation.equivalences open import foundation.function-types open import foundation.functoriality-coproduct-types open import foundation.identity-types -open import foundation.isolated-points +open import foundation.isolated-elements open import foundation.negation open import foundation.propositions open import foundation.subtypes diff --git a/src/trees/enriched-directed-trees.lagda.md b/src/trees/enriched-directed-trees.lagda.md index 570286771d..f17320ca15 100644 --- a/src/trees/enriched-directed-trees.lagda.md +++ b/src/trees/enriched-directed-trees.lagda.md @@ -17,7 +17,7 @@ open import foundation.equivalences open import foundation.functoriality-dependent-pair-types open import foundation.homotopies open import foundation.identity-types -open import foundation.isolated-points +open import foundation.isolated-elements open import foundation.negation open import foundation.propositions open import foundation.transport-along-identifications diff --git a/src/trees/underlying-trees-elements-coalgebras-polynomial-endofunctors.lagda.md b/src/trees/underlying-trees-elements-coalgebras-polynomial-endofunctors.lagda.md index 0c7f181af9..d877e5c7cb 100644 --- a/src/trees/underlying-trees-elements-coalgebras-polynomial-endofunctors.lagda.md +++ b/src/trees/underlying-trees-elements-coalgebras-polynomial-endofunctors.lagda.md @@ -20,7 +20,7 @@ open import foundation.functoriality-dependent-pair-types open import foundation.fundamental-theorem-of-identity-types open import foundation.homotopies open import foundation.identity-types -open import foundation.isolated-points +open import foundation.isolated-elements open import foundation.negation open import foundation.propositions open import foundation.transport-along-identifications diff --git a/src/trees/underlying-trees-of-elements-of-w-types.lagda.md b/src/trees/underlying-trees-of-elements-of-w-types.lagda.md index 6579f766cd..434129da4b 100644 --- a/src/trees/underlying-trees-of-elements-of-w-types.lagda.md +++ b/src/trees/underlying-trees-of-elements-of-w-types.lagda.md @@ -16,7 +16,7 @@ open import foundation.equivalences open import foundation.function-types open import foundation.homotopies open import foundation.identity-types -open import foundation.isolated-points +open import foundation.isolated-elements open import foundation.negation open import foundation.propositions open import foundation.transport-along-identifications diff --git a/src/univalent-combinatorics/complements-isolated-points.lagda.md b/src/univalent-combinatorics/complements-isolated-points.lagda.md index 9319f3c6ec..c7e95b4b85 100644 --- a/src/univalent-combinatorics/complements-isolated-points.lagda.md +++ b/src/univalent-combinatorics/complements-isolated-points.lagda.md @@ -1,7 +1,7 @@ # Complements of isolated points of finite types ```agda -module univalent-combinatorics.complements-isolated-points where +module univalent-combinatorics.complements-isolated-elements where ```
Imports @@ -13,7 +13,7 @@ open import foundation.dependent-pair-types open import foundation.equivalences open import foundation.equivalences-maybe open import foundation.identity-types -open import foundation.isolated-points +open import foundation.isolated-elements open import foundation.maybe open import foundation.propositional-truncations open import foundation.universe-levels diff --git a/src/univalent-combinatorics/cubes.lagda.md b/src/univalent-combinatorics/cubes.lagda.md index 921803394c..3481ec791c 100644 --- a/src/univalent-combinatorics/cubes.lagda.md +++ b/src/univalent-combinatorics/cubes.lagda.md @@ -12,7 +12,7 @@ open import elementary-number-theory.natural-numbers open import foundation.dependent-pair-types open import foundation.universe-levels -open import univalent-combinatorics.complements-isolated-points +open import univalent-combinatorics.complements-isolated-elements open import univalent-combinatorics.finite-types ``` diff --git a/src/univalent-combinatorics/main-classes-of-latin-hypercubes.lagda.md b/src/univalent-combinatorics/main-classes-of-latin-hypercubes.lagda.md index cea1c935a0..c09d8837d1 100644 --- a/src/univalent-combinatorics/main-classes-of-latin-hypercubes.lagda.md +++ b/src/univalent-combinatorics/main-classes-of-latin-hypercubes.lagda.md @@ -19,7 +19,7 @@ open import foundation.set-truncations open import foundation.universe-levels open import foundation.unordered-tuples -open import univalent-combinatorics.complements-isolated-points +open import univalent-combinatorics.complements-isolated-elements open import univalent-combinatorics.decidable-subtypes open import univalent-combinatorics.dependent-function-types open import univalent-combinatorics.finite-types From ed1c2adc67dd157f36a13749b8a629077ad2c7a6 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Mon, 9 Oct 2023 01:55:10 +0200 Subject: [PATCH 16/23] `abstract is-section-inv-precomp-vector-set-quotient` --- src/foundation/vectors-set-quotients.lagda.md | 42 +++++++++++++------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/src/foundation/vectors-set-quotients.lagda.md b/src/foundation/vectors-set-quotients.lagda.md index 21b42ab3f8..4d56e123e6 100644 --- a/src/foundation/vectors-set-quotients.lagda.md +++ b/src/foundation/vectors-set-quotients.lagda.md @@ -262,15 +262,14 @@ abstract ( A : functional-vec (UU l1) n) ( R : (i : Fin n) → Equivalence-Relation l2 (A i)) → ( X : Set l) → - ( section - ( precomp-Set-Quotient - ( all-sim-Equivalence-Relation n A R) - ( set-quotient-vector-Set n A R) - ( reflecting-map-quotient-vector-map n A R) - ( X))) - pr1 (is-section-inv-precomp-vector-set-quotient n A R X) = - inv-precomp-vector-set-quotient n A R X - pr2 (is-section-inv-precomp-vector-set-quotient {l} {l1} {l2} 0 A R X) f = + ( precomp-Set-Quotient + ( all-sim-Equivalence-Relation n A R) + ( set-quotient-vector-Set n A R) + ( reflecting-map-quotient-vector-map n A R) + ( X)) ∘ + ( inv-precomp-vector-set-quotient n A R X) ~ + ( id) + is-section-inv-precomp-vector-set-quotient {l} {l1} {l2} 0 A R X f = eq-pair-Σ ( eq-htpy (λ where (map-raise star) → refl)) ( eq-is-prop @@ -278,7 +277,7 @@ abstract ( raise-indiscrete-Equivalence-Relation l2 (raise-unit l1)) ( X) ( map-reflecting-map-Equivalence-Relation _ f))) - pr2 (is-section-inv-precomp-vector-set-quotient (succ-ℕ n) A R X) f = + is-section-inv-precomp-vector-set-quotient (succ-ℕ n) A R X f = eq-pair-Σ ( eq-htpy ( λ (a0 , a) → @@ -296,8 +295,8 @@ abstract ( is-section-inv-precomp-set-quotient-prod-set-quotient ( R (inr star)) ( all-sim-Equivalence-Relation n - ( tail-functional-vec n A) - ( λ x → R (inl x))) X f)) + ( tail-functional-vec n A) + ( λ x → R (inl x))) X f)) ( a0 , a))))) ( eq-is-prop ( is-prop-reflects-Equivalence-Relation @@ -305,6 +304,23 @@ abstract ( X) ( map-reflecting-map-Equivalence-Relation _ f))) +section-precomp-vector-set-quotient : + { l l1 l2 : Level} + ( n : ℕ) + ( A : functional-vec (UU l1) n) + ( R : (i : Fin n) → Equivalence-Relation l2 (A i)) → + ( X : Set l) → + ( section + ( precomp-Set-Quotient + ( all-sim-Equivalence-Relation n A R) + ( set-quotient-vector-Set n A R) + ( reflecting-map-quotient-vector-map n A R) + ( X))) +pr1 (section-precomp-vector-set-quotient n A R X) = + inv-precomp-vector-set-quotient n A R X +pr2 (section-precomp-vector-set-quotient n A R X) = + is-section-inv-precomp-vector-set-quotient n A R X + abstract is-retraction-inv-precomp-vector-set-quotient : { l l1 l2 : Level} @@ -450,7 +466,7 @@ is-set-quotient-vector-set-quotient : ( set-quotient-vector-Set n A R) ( reflecting-map-quotient-vector-map n A R)) pr1 (is-set-quotient-vector-set-quotient n A R X) = - is-section-inv-precomp-vector-set-quotient n A R X + section-precomp-vector-set-quotient n A R X pr2 (is-set-quotient-vector-set-quotient n A R X) = is-retraction-inv-precomp-vector-set-quotient n A R X ``` From 49a26431b2910ee737cc05912f1725a38dc6f706 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Mon, 9 Oct 2023 02:00:59 +0200 Subject: [PATCH 17/23] `complements-isolated-elements`* --- .../concrete-quaternion-group.lagda.md | 6 +- src/foundation/isolated-elements.lagda.md | 7 +- ...roducts-unordered-tuples-of-types.lagda.md | 4 +- src/foundation/unordered-tuples.lagda.md | 6 +- src/univalent-combinatorics.lagda.md | 2 +- ...=> complements-isolated-elements.lagda.md} | 70 +++++++++---------- src/univalent-combinatorics/cubes.lagda.md | 4 +- .../main-classes-of-latin-hypercubes.lagda.md | 2 +- 8 files changed, 51 insertions(+), 50 deletions(-) rename src/univalent-combinatorics/{complements-isolated-points.lagda.md => complements-isolated-elements.lagda.md} (60%) diff --git a/src/finite-group-theory/concrete-quaternion-group.lagda.md b/src/finite-group-theory/concrete-quaternion-group.lagda.md index 9087543aad..c7c9128a36 100644 --- a/src/finite-group-theory/concrete-quaternion-group.lagda.md +++ b/src/finite-group-theory/concrete-quaternion-group.lagda.md @@ -37,7 +37,7 @@ equiv-face-cube : ( map-axis-equiv-cube (succ-ℕ k) X Y e d a)) equiv-face-cube k X Y e d a = pair - ( equiv-complement-point-UU-Fin k + ( equiv-complement-element-UU-Fin k ( pair (dim-cube-UU-Fin (succ-ℕ k) X) d) ( pair ( dim-cube-UU-Fin (succ-ℕ k) Y) @@ -48,7 +48,7 @@ equiv-face-cube k X Y e d a = ( equiv-tr ( axis-cube (succ-ℕ k) Y) ( inv - ( natural-inclusion-equiv-complement-isolated-point + ( natural-inclusion-equiv-complement-isolated-element ( dim-equiv-cube (succ-ℕ k) X Y e) ( pair d ( λ z → @@ -68,7 +68,7 @@ equiv-face-cube k X Y e d a = ( refl) ( d')))) ∘e ( axis-equiv-cube (succ-ℕ k) X Y e - ( inclusion-complement-point-UU-Fin k + ( inclusion-complement-element-UU-Fin k ( pair (dim-cube-UU-Fin (succ-ℕ k) X) d) d'))) cube-with-labeled-faces : diff --git a/src/foundation/isolated-elements.lagda.md b/src/foundation/isolated-elements.lagda.md index 31fe2e98df..56439d9694 100644 --- a/src/foundation/isolated-elements.lagda.md +++ b/src/foundation/isolated-elements.lagda.md @@ -69,7 +69,7 @@ module _ is-isolated-isolated-element = pr2 x ``` -### Complements of isolated points +### Complements of isolated elements ```agda complement-isolated-element : @@ -162,7 +162,8 @@ module _ is-contr-total-Eq-isolated-element : (d : is-isolated a) → is-contr (Σ A (Eq-isolated-element d)) - pr1 (is-contr-total-Eq-isolated-element d) = center-total-Eq-isolated-element d + pr1 (is-contr-total-Eq-isolated-element d) = + center-total-Eq-isolated-element d pr2 (is-contr-total-Eq-isolated-element d) = contraction-total-Eq-isolated-element d @@ -280,7 +281,7 @@ module _ is-decidable-emb-point-isolated-element ``` -### Types with isolated points can be equipped with a Maybe-structure +### Types with isolated elements can be equipped with a Maybe-structure ```agda map-maybe-structure-isolated-element : diff --git a/src/foundation/products-unordered-tuples-of-types.lagda.md b/src/foundation/products-unordered-tuples-of-types.lagda.md index 0d38144963..b0be1de823 100644 --- a/src/foundation/products-unordered-tuples-of-types.lagda.md +++ b/src/foundation/products-unordered-tuples-of-types.lagda.md @@ -53,14 +53,14 @@ equiv-pr-product-unordered-tuple-types : equiv-pr-product-unordered-tuple-types n A i = ( equiv-Π ( element-unordered-tuple (succ-ℕ n) A) - ( equiv-maybe-structure-point-UU-Fin n + ( equiv-maybe-structure-element-UU-Fin n ( type-unordered-tuple-UU-Fin (succ-ℕ n) A) i) ( λ x → id-equiv)) ∘e ( inv-equiv ( equiv-dependent-universal-property-Maybe ( λ j → element-unordered-tuple (succ-ℕ n) A - ( map-equiv (equiv-maybe-structure-point-UU-Fin n + ( map-equiv (equiv-maybe-structure-element-UU-Fin n ( type-unordered-tuple-UU-Fin (succ-ℕ n) A) i) ( j))))) diff --git a/src/foundation/unordered-tuples.lagda.md b/src/foundation/unordered-tuples.lagda.md index 4693c07116..ac5fa9d23b 100644 --- a/src/foundation/unordered-tuples.lagda.md +++ b/src/foundation/unordered-tuples.lagda.md @@ -84,7 +84,7 @@ module _ type-complement-point-unordered-tuple-UU-Fin : UU-Fin lzero n type-complement-point-unordered-tuple-UU-Fin = - complement-point-UU-Fin n + complement-element-UU-Fin n ( pair (type-unordered-tuple-UU-Fin (succ-ℕ n) t) i) type-complement-point-unordered-tuple : UU lzero @@ -94,13 +94,13 @@ module _ inclusion-complement-point-unordered-tuple : type-complement-point-unordered-tuple → type-unordered-tuple (succ-ℕ n) t inclusion-complement-point-unordered-tuple = - inclusion-complement-point-UU-Fin n + inclusion-complement-element-UU-Fin n ( pair (type-unordered-tuple-UU-Fin (succ-ℕ n) t) i) unordered-tuple-complement-point-type-unordered-tuple : unordered-tuple n A pr1 unordered-tuple-complement-point-type-unordered-tuple = - complement-point-UU-Fin n + complement-element-UU-Fin n ( pair (type-unordered-tuple-UU-Fin (succ-ℕ n) t) i) pr2 unordered-tuple-complement-point-type-unordered-tuple = ( element-unordered-tuple (succ-ℕ n) t) ∘ diff --git a/src/univalent-combinatorics.lagda.md b/src/univalent-combinatorics.lagda.md index 9764775769..008ad5b3b2 100644 --- a/src/univalent-combinatorics.lagda.md +++ b/src/univalent-combinatorics.lagda.md @@ -27,7 +27,7 @@ open import univalent-combinatorics.binomial-types public open import univalent-combinatorics.bracelets public open import univalent-combinatorics.cartesian-product-types public open import univalent-combinatorics.classical-finite-types public -open import univalent-combinatorics.complements-isolated-points public +open import univalent-combinatorics.complements-isolated-elements public open import univalent-combinatorics.coproduct-types public open import univalent-combinatorics.counting public open import univalent-combinatorics.counting-decidable-subtypes public diff --git a/src/univalent-combinatorics/complements-isolated-points.lagda.md b/src/univalent-combinatorics/complements-isolated-elements.lagda.md similarity index 60% rename from src/univalent-combinatorics/complements-isolated-points.lagda.md rename to src/univalent-combinatorics/complements-isolated-elements.lagda.md index c7e95b4b85..d0893d63cb 100644 --- a/src/univalent-combinatorics/complements-isolated-points.lagda.md +++ b/src/univalent-combinatorics/complements-isolated-elements.lagda.md @@ -1,4 +1,4 @@ -# Complements of isolated points of finite types +# Complements of isolated elements of finite types ```agda module univalent-combinatorics.complements-isolated-elements where @@ -26,89 +26,89 @@ open import univalent-combinatorics.finite-types ## Idea -For any point `x` in a [finite type](univalent-combinatorics.finite-types.md) +For any element `x` in a [finite type](univalent-combinatorics.finite-types.md) `X` of [cardinality](set-theory.cardinalities.md) `n+1`, we can construct its **complement**, which is a type of cardinality `n`. ## Definition -### The complement of a point in a k-element type of arbitrary universe level +### The complement of a element in a `k`-element type of arbitrary universe level ```agda -isolated-point-UU-Fin : +isolated-element-UU-Fin : {l : Level} (k : ℕ) (X : UU-Fin l (succ-ℕ k)) → type-UU-Fin (succ-ℕ k) X → - isolated-point (type-UU-Fin (succ-ℕ k) X) -pr1 (isolated-point-UU-Fin k X x) = x -pr2 (isolated-point-UU-Fin k X x) = + isolated-element (type-UU-Fin (succ-ℕ k) X) +pr1 (isolated-element-UU-Fin k X x) = x +pr2 (isolated-element-UU-Fin k X x) = has-decidable-equality-has-cardinality ( succ-ℕ k) ( has-cardinality-type-UU-Fin (succ-ℕ k) X) ( x) -type-complement-point-UU-Fin : +type-complement-element-UU-Fin : {l1 : Level} (k : ℕ) → Σ (UU-Fin l1 (succ-ℕ k)) (type-UU-Fin (succ-ℕ k)) → UU l1 -type-complement-point-UU-Fin k (X , x) = - complement-isolated-point +type-complement-element-UU-Fin k (X , x) = + complement-isolated-element ( type-UU-Fin (succ-ℕ k) X) - ( isolated-point-UU-Fin k X x) + ( isolated-element-UU-Fin k X x) -equiv-maybe-structure-point-UU-Fin : +equiv-maybe-structure-element-UU-Fin : {l : Level} (k : ℕ) (X : UU-Fin l (succ-ℕ k)) → (x : type-UU-Fin (succ-ℕ k) X) → - Maybe (type-complement-point-UU-Fin k (pair X x)) ≃ + Maybe (type-complement-element-UU-Fin k (pair X x)) ≃ type-UU-Fin (succ-ℕ k) X -equiv-maybe-structure-point-UU-Fin k X x = - equiv-maybe-structure-isolated-point +equiv-maybe-structure-element-UU-Fin k X x = + equiv-maybe-structure-isolated-element ( type-UU-Fin (succ-ℕ k) X) - ( isolated-point-UU-Fin k X x) + ( isolated-element-UU-Fin k X x) -has-cardinality-type-complement-point-UU-Fin : +has-cardinality-type-complement-element-UU-Fin : {l1 : Level} (k : ℕ) (X : Σ (UU-Fin l1 (succ-ℕ k)) (type-UU-Fin (succ-ℕ k))) → - has-cardinality k (type-complement-point-UU-Fin k X) -has-cardinality-type-complement-point-UU-Fin k (pair (pair X H) x) = + has-cardinality k (type-complement-element-UU-Fin k X) +has-cardinality-type-complement-element-UU-Fin k (pair (pair X H) x) = apply-universal-property-trunc-Prop H ( has-cardinality-Prop k - ( type-complement-point-UU-Fin k (pair (pair X H) x))) + ( type-complement-element-UU-Fin k (pair (pair X H) x))) ( λ e → unit-trunc-Prop ( equiv-equiv-Maybe ( ( inv-equiv - ( equiv-maybe-structure-point-UU-Fin k (pair X H) x)) ∘e + ( equiv-maybe-structure-element-UU-Fin k (pair X H) x)) ∘e ( e)))) -complement-point-UU-Fin : +complement-element-UU-Fin : {l1 : Level} (k : ℕ) → Σ (UU-Fin l1 (succ-ℕ k)) (type-UU-Fin (succ-ℕ k)) → UU-Fin l1 k -pr1 (complement-point-UU-Fin k T) = - type-complement-point-UU-Fin k T -pr2 (complement-point-UU-Fin k T) = - has-cardinality-type-complement-point-UU-Fin k T +pr1 (complement-element-UU-Fin k T) = + type-complement-element-UU-Fin k T +pr2 (complement-element-UU-Fin k T) = + has-cardinality-type-complement-element-UU-Fin k T -inclusion-complement-point-UU-Fin : +inclusion-complement-element-UU-Fin : {l1 : Level} (k : ℕ) (X : Σ (UU-Fin l1 (succ-ℕ k)) (type-UU-Fin (succ-ℕ k))) → - type-complement-point-UU-Fin k X → type-UU-Fin (succ-ℕ k) (pr1 X) -inclusion-complement-point-UU-Fin k X x = pr1 x + type-complement-element-UU-Fin k X → type-UU-Fin (succ-ℕ k) (pr1 X) +inclusion-complement-element-UU-Fin k X x = pr1 x ``` ### The action of equivalences on complements of isolated points ```agda -equiv-complement-point-UU-Fin : +equiv-complement-element-UU-Fin : {l1 : Level} (k : ℕ) (X Y : Σ (UU-Fin l1 (succ-ℕ k)) (type-UU-Fin (succ-ℕ k))) → (e : equiv-UU-Fin (succ-ℕ k) (pr1 X) (pr1 Y)) (p : Id (map-equiv e (pr2 X)) (pr2 Y)) → equiv-UU-Fin k - ( complement-point-UU-Fin k X) - ( complement-point-UU-Fin k Y) -equiv-complement-point-UU-Fin + ( complement-element-UU-Fin k X) + ( complement-element-UU-Fin k Y) +equiv-complement-element-UU-Fin k S T e p = - equiv-complement-isolated-point e + equiv-complement-isolated-element e ( pair x (λ x' → has-decidable-equality-has-cardinality (succ-ℕ k) H x x')) ( pair y (λ y' → has-decidable-equality-has-cardinality (succ-ℕ k) K y y')) ( p) @@ -121,7 +121,7 @@ equiv-complement-point-UU-Fin ## Properties -### The map from a pointed `k+1`-element type to the complement of the point is an equivalence +### The map from a pointed `k+1`-element type to the complement of the element is an equivalence This remains to be shown. [#744](https://github.com/UniMath/agda-unimath/issues/744) diff --git a/src/univalent-combinatorics/cubes.lagda.md b/src/univalent-combinatorics/cubes.lagda.md index 3481ec791c..0c9ea342e7 100644 --- a/src/univalent-combinatorics/cubes.lagda.md +++ b/src/univalent-combinatorics/cubes.lagda.md @@ -106,9 +106,9 @@ face-cube : (k : ℕ) (X : cube (succ-ℕ k)) (d : dim-cube (succ-ℕ k) X) (a : axis-cube (succ-ℕ k) X d) → cube k pr1 (face-cube k X d a) = - complement-point-UU-Fin k (pair (dim-cube-UU-Fin (succ-ℕ k) X) d) + complement-element-UU-Fin k (pair (dim-cube-UU-Fin (succ-ℕ k) X) d) pr2 (face-cube k X d a) d' = axis-cube-UU-2 (succ-ℕ k) X - ( inclusion-complement-point-UU-Fin k + ( inclusion-complement-element-UU-Fin k ( pair (dim-cube-UU-Fin (succ-ℕ k) X) d) d') ``` diff --git a/src/univalent-combinatorics/main-classes-of-latin-hypercubes.lagda.md b/src/univalent-combinatorics/main-classes-of-latin-hypercubes.lagda.md index c09d8837d1..dee4973e2e 100644 --- a/src/univalent-combinatorics/main-classes-of-latin-hypercubes.lagda.md +++ b/src/univalent-combinatorics/main-classes-of-latin-hypercubes.lagda.md @@ -122,7 +122,7 @@ is-π-finite-Main-Class-Latin-Hypercube-of-Order k n m = is-finite-Π ( is-finite-Π ( is-finite-has-cardinality n - ( has-cardinality-type-complement-point-UU-Fin n + ( has-cardinality-type-complement-element-UU-Fin n ( pair (type-unordered-tuple-UU-Fin (succ-ℕ n) A) i))) ( λ j → is-finite-type-UU-Fin m From d1c7049cb42b4ebf445ca731cdf8f4b3b00ed718 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Mon, 9 Oct 2023 02:02:05 +0200 Subject: [PATCH 18/23] Update CODINGSTYLE.md Co-authored-by: Egbert Rijke --- CODINGSTYLE.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CODINGSTYLE.md b/CODINGSTYLE.md index def2d2d11c..13bff0aae6 100644 --- a/CODINGSTYLE.md +++ b/CODINGSTYLE.md @@ -128,9 +128,8 @@ strategic endeavour to ensure the longevity, vitality, and success of the a = construction-of-a ``` -- **Lambda expressions**: We always wrap lambda expressions in parentheses, even - if it is the last argument of a function and thus isn't strictly required to - be parenthesized. +- **Lambda expressions**: When a lambda expression appears as the argument of a function, we always wrap it in parentheses. We do this even if it is the last argument of a function, and thus isn't strictly required to + be parenthesized. Note that in some rare cases, a lambda expression might appear at the top level. In this case we don't require the lambda expression to be parenthesized. There are multiple syntaxes for writing lambda expressions in Agda. Generally, you have the following options: From 8539bfb3a87bad9ff98942336baf95cfffe08955 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Mon, 9 Oct 2023 02:02:27 +0200 Subject: [PATCH 19/23] Update src/foundation/isolated-elements.lagda.md Co-authored-by: Egbert Rijke --- src/foundation/isolated-elements.lagda.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/foundation/isolated-elements.lagda.md b/src/foundation/isolated-elements.lagda.md index 56439d9694..827b418bca 100644 --- a/src/foundation/isolated-elements.lagda.md +++ b/src/foundation/isolated-elements.lagda.md @@ -80,7 +80,7 @@ complement-isolated-element X x = ## Properties -### A element is decidable if and only if the constant map pointing at it is decidable +### An element is isolated if and only if the constant map pointing at it is decidable ```agda module _ From 6567cae0cd4498e9bd868742a023dbe6c49b817a Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Mon, 9 Oct 2023 02:04:41 +0200 Subject: [PATCH 20/23] `isolated-point` --- src/trees/directed-trees.lagda.md | 6 +++--- ...ees-elements-coalgebras-polynomial-endofunctors.lagda.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/trees/directed-trees.lagda.md b/src/trees/directed-trees.lagda.md index 612778cc4a..629b588104 100644 --- a/src/trees/directed-trees.lagda.md +++ b/src/trees/directed-trees.lagda.md @@ -280,7 +280,7 @@ module _ is-prop-is-root-Directed-Tree : (x : node-Directed-Tree T) → is-prop (is-root-Directed-Tree T x) is-prop-is-root-Directed-Tree = - is-prop-eq-isolated-point + is-prop-eq-isolated-element ( root-Directed-Tree T) ( is-isolated-root-Directed-Tree) @@ -292,7 +292,7 @@ module _ is-contr-loop-space-root-Directed-Tree : is-contr (root-Directed-Tree T = root-Directed-Tree T) is-contr-loop-space-root-Directed-Tree = - is-contr-loop-space-isolated-point + is-contr-loop-space-isolated-element ( root-Directed-Tree T) ( is-isolated-root-Directed-Tree) @@ -405,7 +405,7 @@ module _ is-contr-loop-space-root-unique-direct-successor-Directed-Graph : unique-direct-successor-Directed-Graph → is-contr (r = r) is-contr-loop-space-root-unique-direct-successor-Directed-Graph H = - is-contr-loop-space-isolated-point r + is-contr-loop-space-isolated-element r ( is-isolated-root-unique-direct-successor-Directed-Graph H) is-not-root-has-unique-direct-successor-Directed-Graph : diff --git a/src/trees/underlying-trees-elements-coalgebras-polynomial-endofunctors.lagda.md b/src/trees/underlying-trees-elements-coalgebras-polynomial-endofunctors.lagda.md index d877e5c7cb..3a64e11856 100644 --- a/src/trees/underlying-trees-elements-coalgebras-polynomial-endofunctors.lagda.md +++ b/src/trees/underlying-trees-elements-coalgebras-polynomial-endofunctors.lagda.md @@ -165,7 +165,7 @@ module _ ( root-coalgebra w = root-coalgebra w) is-contr-loop-space-root-element-coalgebra w = - is-contr-loop-space-isolated-point + is-contr-loop-space-isolated-element ( root-coalgebra w) ( is-isolated-root-element-coalgebra w) ``` From 6afe2c21d67a26a9d496bee115e59b9f5122d3cb Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Mon, 9 Oct 2023 02:05:34 +0200 Subject: [PATCH 21/23] pre-commit --- CODINGSTYLE.md | 8 ++++++-- src/foundation/isolated-elements.lagda.md | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CODINGSTYLE.md b/CODINGSTYLE.md index 13bff0aae6..2d0417ebda 100644 --- a/CODINGSTYLE.md +++ b/CODINGSTYLE.md @@ -128,8 +128,12 @@ strategic endeavour to ensure the longevity, vitality, and success of the a = construction-of-a ``` -- **Lambda expressions**: When a lambda expression appears as the argument of a function, we always wrap it in parentheses. We do this even if it is the last argument of a function, and thus isn't strictly required to - be parenthesized. Note that in some rare cases, a lambda expression might appear at the top level. In this case we don't require the lambda expression to be parenthesized. +- **Lambda expressions**: When a lambda expression appears as the argument of a + function, we always wrap it in parentheses. We do this even if it is the last + argument of a function, and thus isn't strictly required to be parenthesized. + Note that in some rare cases, a lambda expression might appear at the top + level. In this case we don't require the lambda expression to be + parenthesized. There are multiple syntaxes for writing lambda expressions in Agda. Generally, you have the following options: diff --git a/src/foundation/isolated-elements.lagda.md b/src/foundation/isolated-elements.lagda.md index 827b418bca..db5c06554f 100644 --- a/src/foundation/isolated-elements.lagda.md +++ b/src/foundation/isolated-elements.lagda.md @@ -213,8 +213,7 @@ is-prop-is-isolated : {l1 : Level} {A : UU l1} (a : A) → is-prop (is-isolated a) is-prop-is-isolated a = is-prop-is-inhabited - ( λ H → - is-prop-Π (λ x → is-prop-is-decidable (is-prop-eq-isolated-element a H x))) + ( λ H → is-prop-Π (is-prop-is-decidable ∘ is-prop-eq-isolated-element a H)) is-isolated-Prop : {l1 : Level} {A : UU l1} (a : A) → Prop l1 @@ -327,7 +326,8 @@ is-retraction-map-inv-maybe-structure-isolated-element : {l1 : Level} (X : UU l1) (x : isolated-element X) → ( map-inv-maybe-structure-isolated-element X x ∘ map-maybe-structure-isolated-element X x) ~ id -is-retraction-map-inv-maybe-structure-isolated-element X (x , dx) (inl (y , f)) = +is-retraction-map-inv-maybe-structure-isolated-element + X (x , dx) (inl (y , f)) = ap ( cases-map-inv-maybe-structure-isolated-element X (x , dx) y) ( eq-is-prop (is-prop-is-decidable (is-prop-eq-isolated-element x dx y))) From f81249693448874cc528ab47f3a5966c605d5401 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Mon, 9 Oct 2023 02:09:24 +0200 Subject: [PATCH 22/23] improve wording --- CODINGSTYLE.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/CODINGSTYLE.md b/CODINGSTYLE.md index 2d0417ebda..b02c0b2eb0 100644 --- a/CODINGSTYLE.md +++ b/CODINGSTYLE.md @@ -130,10 +130,9 @@ strategic endeavour to ensure the longevity, vitality, and success of the - **Lambda expressions**: When a lambda expression appears as the argument of a function, we always wrap it in parentheses. We do this even if it is the last - argument of a function, and thus isn't strictly required to be parenthesized. - Note that in some rare cases, a lambda expression might appear at the top - level. In this case we don't require the lambda expression to be - parenthesized. + argument and thus isn't strictly required to be parenthesized. Note that in + some rare cases, a lambda expression might appear at the top level. In this + case we don't require the lambda expression to be parenthesized. There are multiple syntaxes for writing lambda expressions in Agda. Generally, you have the following options: @@ -167,10 +166,10 @@ strategic endeavour to ensure the longevity, vitality, and success of the All four syntaxes are in use in the library, although when possible we try to avoid general pattern matching lambdas, i.e. syntaxes 3 and 4. If need be, we prefer pattern matching using the `where` keyword over the `{...}` syntax. - Note that whenever syntax 3 or 4 appear in a definition, it should be marked - as `abstract`. If computation is necessary for a definition that has these - syntaxes in them, this suggests the relevant lambda expression(s) deserve to - be factored out as separate definitions. + Note that whenever syntax 3 or 4 appear in as part of a construction, the + definition should be marked as `abstract`. If computation is necessary for a + definition that has these syntaxes in them, this suggests the relevant lambda + expression(s) deserve to be factored out as separate definitions. ## Code comments From 660b96ae42b590ff1db021b56a1b82160669fc28 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Mon, 9 Oct 2023 02:18:49 +0200 Subject: [PATCH 23/23] `map-equiv-concat-equiv` --- src/foundation/identity-types.lagda.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/foundation/identity-types.lagda.md b/src/foundation/identity-types.lagda.md index 6dc9a6a331..2d48de1898 100644 --- a/src/foundation/identity-types.lagda.md +++ b/src/foundation/identity-types.lagda.md @@ -97,23 +97,24 @@ module _ pr1 (equiv-concat p z) = concat p z pr2 (equiv-concat p z) = is-equiv-concat p z - map-concat-equiv : {x x' : A} → ((y : A) → (x = y) ≃ (x' = y)) → (x' = x) - map-concat-equiv {x} e = map-equiv (e x) refl + map-equiv-concat-equiv : + {x x' : A} → ((y : A) → (x = y) ≃ (x' = y)) → (x' = x) + map-equiv-concat-equiv {x} e = map-equiv (e x) refl is-section-equiv-concat : - {x x' : A} → map-concat-equiv {x} {x'} ∘ equiv-concat ~ id + {x x' : A} → map-equiv-concat-equiv {x} {x'} ∘ equiv-concat ~ id is-section-equiv-concat refl = refl abstract is-retraction-equiv-concat : - {x x' : A} → equiv-concat ∘ map-concat-equiv {x} {x'} ~ id + {x x' : A} → equiv-concat ∘ map-equiv-concat-equiv {x} {x'} ~ id is-retraction-equiv-concat e = eq-htpy (λ y → eq-htpy-equiv (λ where refl → right-unit)) abstract - is-equiv-map-concat-equiv : - {x x' : A} → is-equiv (map-concat-equiv {x} {x'}) - is-equiv-map-concat-equiv = + is-equiv-map-equiv-concat-equiv : + {x x' : A} → is-equiv (map-equiv-concat-equiv {x} {x'}) + is-equiv-map-equiv-concat-equiv = is-equiv-is-invertible ( equiv-concat) ( is-section-equiv-concat) @@ -121,8 +122,8 @@ module _ equiv-concat-equiv : {x x' : A} → ((y : A) → (x = y) ≃ (x' = y)) ≃ (x' = x) - pr1 equiv-concat-equiv = map-concat-equiv - pr2 equiv-concat-equiv = is-equiv-map-concat-equiv + pr1 equiv-concat-equiv = map-equiv-concat-equiv + pr2 equiv-concat-equiv = is-equiv-map-equiv-concat-equiv inv-concat' : (x : A) {y z : A} → y = z → x = z → x = y inv-concat' x q = concat' x (inv q)