diff --git a/references.bib b/references.bib
index 6d6362376f..5c8da6ab67 100644
--- a/references.bib
+++ b/references.bib
@@ -289,6 +289,15 @@ @online{DavidJaz/Cohesion
howpublished = {{{GitHub}} repository},
}
+@misc{Diener18,
+ title = {Constructive Reverse Mathematics},
+ author = {Hannes Diener},
+ year = 2018,
+ eprint = {1804.05495},
+ archiveprefix = {arXiv},
+ primaryclass = {math.LO},
+}
+
@article{dJE23,
title = {{On Small Types in Univalent Foundations}},
author = {de Jong, Tom and Escardó, Martín Hötzel},
@@ -364,6 +373,20 @@ @article{Esc08
issue = 3,
}
+@article{Esc13,
+ title = {Infinite sets that satisfy the principle of omniscience in any variety of constructive mathematics},
+ author = {Escardó, Martín Hötzel},
+ year = 2013,
+ journal = {The Journal of Symbolic Logic},
+ volume = 78,
+ number = 3,
+ pages = {764--784},
+ issn = {0022-4812,1943-5886},
+ mrclass = {03F50 (03F55)},
+ mrnumber = 3135497,
+ mrreviewer = {Paulo\ Oliva},
+}
+
@online{Esc17YetAnother,
title = {Yet another characterization of univalence},
author = {Escardó, Martín Hötzel},
@@ -471,6 +494,18 @@ @article{GK12
issn = {1469-8064},
}
+@book{Johnstone02,
+ title = {Sketches of an Elephant a Topos Theory Compendium},
+ author = {Johnstone, Peter T},
+ year = 2002,
+ month = sep,
+ date = {2002-09},
+ publisher = {Oxford University Press},
+ doi = {10.1093/oso/9780198515982.001.0001},
+ isbn = {978-0-19-851598-2},
+ abstract = {Topos Theory is a subject that stands at the junction of geometry, mathematical logic and theoretical computer science, and it derives much of its power from the interplay of ideas drawn from these different areas. Because of this, an account of topos theory which approaches the subject from one particular direction can only hope to give a partial picture; the aim of this compendium is to present as comprehensive an account as possible of all the main approaches and thereby to demonstrate the overall unity of the subject. The material is organized in such a way that readers interested in following a particular line of approach may do so by starting at an appropriate point in the text.},
+}
+
@article{KECA17,
title = {{Notions of Anonymous Existence in {{Martin-L\"of}} Type Theory}},
author = {Nicolai Kraus and Martín Escardó and Thierry Coquand and Thorsten Altenkirch},
@@ -626,6 +661,21 @@ @article{Mil84
eprinttype = {jstor},
}
+@book{MM94,
+ title = {Sheaves in {{Geometry}} and {{Logic}}: {{A First Introduction}} to {{Topos Theory}}},
+ shorttitle = {Sheaves in {{Geometry}} and {{Logic}}},
+ author = {Mac Lane, Saunders and Moerdijk, Ieke},
+ year = 1994,
+ location = {New York, NY},
+ publisher = {Springer New York},
+ series = {Universitext},
+ doi = {10.1007/978-1-4612-0927-0},
+ isbn = {978-0-387-97710-2 978-1-4612-0927-0},
+ langid = {english},
+ edition = {1st ed. 1994.},
+ keywords = {Geometry ; K-theory ; Logic Symbolic and mathematical},
+}
+
@article{MP87,
title = {Inverse Semigroups and Extensions of Groups by Semilattices},
author = {Margolis, S. W and Pin, J. E},
diff --git a/src/category-theory/representing-arrow-category.lagda.md b/src/category-theory/representing-arrow-category.lagda.md
index dbdfec5962..b92c75bdbc 100644
--- a/src/category-theory/representing-arrow-category.lagda.md
+++ b/src/category-theory/representing-arrow-category.lagda.md
@@ -12,15 +12,20 @@ open import category-theory.isomorphisms-in-precategories
open import category-theory.precategories
open import foundation.booleans
+open import foundation.decidable-propositions
open import foundation.dependent-pair-types
open import foundation.empty-types
open import foundation.identity-types
+open import foundation.inequality-booleans
open import foundation.logical-equivalences
+open import foundation.logical-operations-booleans
open import foundation.propositions
open import foundation.sets
open import foundation.subtypes
open import foundation.unit-type
open import foundation.universe-levels
+
+open import order-theory.posets
```
@@ -42,9 +47,7 @@ obj-representing-arrow-Category = bool
hom-set-representing-arrow-Category :
obj-representing-arrow-Category → obj-representing-arrow-Category → Set lzero
-hom-set-representing-arrow-Category true true = unit-Set
-hom-set-representing-arrow-Category true false = empty-Set
-hom-set-representing-arrow-Category false _ = unit-Set
+hom-set-representing-arrow-Category x y = set-Prop (leq-bool-Prop x y)
hom-representing-arrow-Category :
obj-representing-arrow-Category → obj-representing-arrow-Category → UU lzero
@@ -60,8 +63,8 @@ comp-hom-representing-arrow-Category :
hom-representing-arrow-Category y z →
hom-representing-arrow-Category x y →
hom-representing-arrow-Category x z
-comp-hom-representing-arrow-Category {true} {true} {true} _ _ = star
-comp-hom-representing-arrow-Category {false} _ _ = star
+comp-hom-representing-arrow-Category {x} {y} {z} =
+ transitive-leq-bool {x} {y} {z}
associative-comp-hom-representing-arrow-Category :
{x y z w : obj-representing-arrow-Category} →
@@ -79,8 +82,7 @@ associative-comp-hom-representing-arrow-Category {false} h g f = refl
id-hom-representing-arrow-Category :
{x : obj-representing-arrow-Category} → hom-representing-arrow-Category x x
-id-hom-representing-arrow-Category {true} = star
-id-hom-representing-arrow-Category {false} = star
+id-hom-representing-arrow-Category {x} = refl-leq-bool {x}
left-unit-law-comp-hom-representing-arrow-Category :
{x y : obj-representing-arrow-Category} →
@@ -101,16 +103,7 @@ right-unit-law-comp-hom-representing-arrow-Category {true} {true} f = refl
right-unit-law-comp-hom-representing-arrow-Category {false} f = refl
representing-arrow-Precategory : Precategory lzero lzero
-representing-arrow-Precategory =
- make-Precategory
- ( obj-representing-arrow-Category)
- ( hom-set-representing-arrow-Category)
- ( λ {x} {y} {z} → comp-hom-representing-arrow-Category {x} {y} {z})
- ( λ x → id-hom-representing-arrow-Category {x})
- ( λ {x} {y} {z} {w} →
- associative-comp-hom-representing-arrow-Category {x} {y} {z} {w})
- ( λ {x} {y} → left-unit-law-comp-hom-representing-arrow-Category {x} {y})
- ( λ {x} {y} → right-unit-law-comp-hom-representing-arrow-Category {x} {y})
+representing-arrow-Precategory = precategory-Poset bool-Poset
```
### The representing arrow category
@@ -118,32 +111,11 @@ representing-arrow-Precategory =
```agda
is-category-representing-arrow-Category :
is-category-Precategory representing-arrow-Precategory
-is-category-representing-arrow-Category true true =
- is-equiv-has-converse-is-prop
- ( is-set-bool true true)
- ( is-prop-type-subtype
- ( is-iso-prop-Precategory representing-arrow-Precategory {true} {true})
- ( is-prop-unit))
- ( λ _ → refl)
-is-category-representing-arrow-Category true false =
- is-equiv-is-empty
- ( iso-eq-Precategory representing-arrow-Precategory true false)
- ( hom-iso-Precategory representing-arrow-Precategory)
-is-category-representing-arrow-Category false true =
- is-equiv-is-empty
- ( iso-eq-Precategory representing-arrow-Precategory false true)
- ( hom-inv-iso-Precategory representing-arrow-Precategory)
-is-category-representing-arrow-Category false false =
- is-equiv-has-converse-is-prop
- ( is-set-bool false false)
- ( is-prop-type-subtype
- ( is-iso-prop-Precategory representing-arrow-Precategory {false} {false})
- ( is-prop-unit))
- ( λ _ → refl)
+is-category-representing-arrow-Category =
+ is-category-precategory-Poset bool-Poset
representing-arrow-Category : Category lzero lzero
-pr1 representing-arrow-Category = representing-arrow-Precategory
-pr2 representing-arrow-Category = is-category-representing-arrow-Category
+representing-arrow-Category = category-Poset bool-Poset
```
## Properties
diff --git a/src/elementary-number-theory/decidable-types.lagda.md b/src/elementary-number-theory/decidable-types.lagda.md
index 047ada9a91..273fc1783c 100644
--- a/src/elementary-number-theory/decidable-types.lagda.md
+++ b/src/elementary-number-theory/decidable-types.lagda.md
@@ -14,6 +14,7 @@ open import elementary-number-theory.upper-bounds-natural-numbers
open import foundation.cartesian-product-types
open import foundation.coproduct-types
+open import foundation.decidable-type-families
open import foundation.decidable-types
open import foundation.dependent-pair-types
open import foundation.empty-types
@@ -35,7 +36,7 @@ decidable.
```agda
is-decidable-Σ-ℕ :
- {l : Level} (m : ℕ) (P : ℕ → UU l) (d : is-decidable-fam P) →
+ {l : Level} (m : ℕ) (P : ℕ → UU l) (d : is-decidable-family P) →
is-decidable (Σ ℕ (λ x → (leq-ℕ m x) × (P x))) → is-decidable (Σ ℕ P)
is-decidable-Σ-ℕ m P d (inl (pair x (pair l p))) = inl (pair x p)
is-decidable-Σ-ℕ zero-ℕ P d (inr f) =
@@ -60,7 +61,7 @@ is-decidable-Σ-ℕ (succ-ℕ m) P d (inr f) with d zero-ℕ
```agda
is-decidable-bounded-Σ-ℕ :
{l1 l2 : Level} (m : ℕ) (P : ℕ → UU l1) (Q : ℕ → UU l2)
- (dP : is-decidable-fam P) (dQ : is-decidable-fam Q)
+ (dP : is-decidable-family P) (dQ : is-decidable-family Q)
(H : is-upper-bound-ℕ P m) → is-decidable (Σ ℕ (λ x → (P x) × (Q x)))
is-decidable-bounded-Σ-ℕ m P Q dP dQ H =
is-decidable-Σ-ℕ
@@ -76,7 +77,7 @@ is-decidable-bounded-Σ-ℕ m P Q dP dQ H =
( pr1 (pr2 p))))
is-decidable-bounded-Σ-ℕ' :
- {l : Level} (m : ℕ) (P : ℕ → UU l) (d : is-decidable-fam P) →
+ {l : Level} (m : ℕ) (P : ℕ → UU l) (d : is-decidable-family P) →
is-decidable (Σ ℕ (λ x → (leq-ℕ x m) × (P x)))
is-decidable-bounded-Σ-ℕ' m P d =
is-decidable-bounded-Σ-ℕ m
@@ -92,7 +93,7 @@ is-decidable-bounded-Σ-ℕ' m P d =
```agda
is-decidable-strictly-bounded-Σ-ℕ :
{l1 l2 : Level} (m : ℕ) (P : ℕ → UU l1) (Q : ℕ → UU l2)
- (dP : is-decidable-fam P) (dQ : is-decidable-fam Q)
+ (dP : is-decidable-family P) (dQ : is-decidable-family Q)
(H : is-strict-upper-bound-ℕ P m) →
is-decidable (Σ ℕ (λ x → (P x) × (Q x)))
is-decidable-strictly-bounded-Σ-ℕ m P Q dP dQ H =
@@ -100,7 +101,7 @@ is-decidable-strictly-bounded-Σ-ℕ m P Q dP dQ H =
( is-upper-bound-is-strict-upper-bound-ℕ P m H)
is-decidable-strictly-bounded-Σ-ℕ' :
- {l : Level} (m : ℕ) (P : ℕ → UU l) (d : is-decidable-fam P) →
+ {l : Level} (m : ℕ) (P : ℕ → UU l) (d : is-decidable-family P) →
is-decidable (Σ ℕ (λ x → (le-ℕ x m) × (P x)))
is-decidable-strictly-bounded-Σ-ℕ' m P d =
is-decidable-strictly-bounded-Σ-ℕ m
@@ -115,7 +116,7 @@ is-decidable-strictly-bounded-Σ-ℕ' m P d =
```agda
is-decidable-Π-ℕ :
- {l : Level} (P : ℕ → UU l) (d : is-decidable-fam P) (m : ℕ) →
+ {l : Level} (P : ℕ → UU l) (d : is-decidable-family P) (m : ℕ) →
is-decidable ((x : ℕ) → (leq-ℕ m x) → P x) → is-decidable ((x : ℕ) → P x)
is-decidable-Π-ℕ P d zero-ℕ (inr nH) = inr (λ f → nH (λ x y → f x))
is-decidable-Π-ℕ P d zero-ℕ (inl H) = inl (λ x → H x (leq-zero-ℕ x))
@@ -136,8 +137,8 @@ is-decidable-Π-ℕ P d (succ-ℕ m) (inl H) with d zero-ℕ
```agda
is-decidable-bounded-Π-ℕ :
- {l1 l2 : Level} (P : ℕ → UU l1) (Q : ℕ → UU l2) (dP : is-decidable-fam P) →
- (dQ : is-decidable-fam Q) (m : ℕ) (H : is-upper-bound-ℕ P m) →
+ {l1 l2 : Level} (P : ℕ → UU l1) (Q : ℕ → UU l2) (dP : is-decidable-family P) →
+ (dQ : is-decidable-family Q) (m : ℕ) (H : is-upper-bound-ℕ P m) →
is-decidable ((x : ℕ) → P x → Q x)
is-decidable-bounded-Π-ℕ P Q dP dQ m H =
is-decidable-Π-ℕ
@@ -147,7 +148,7 @@ is-decidable-bounded-Π-ℕ P Q dP dQ m H =
( inl (λ x l p → ex-falso (contradiction-leq-ℕ x m (H x p) l)))
is-decidable-bounded-Π-ℕ' :
- {l : Level} (P : ℕ → UU l) (d : is-decidable-fam P) (m : ℕ) →
+ {l : Level} (P : ℕ → UU l) (d : is-decidable-family P) (m : ℕ) →
is-decidable ((x : ℕ) → (leq-ℕ x m) → P x)
is-decidable-bounded-Π-ℕ' P d m =
is-decidable-bounded-Π-ℕ
@@ -163,14 +164,14 @@ is-decidable-bounded-Π-ℕ' P d m =
```agda
is-decidable-strictly-bounded-Π-ℕ :
- {l1 l2 : Level} (P : ℕ → UU l1) (Q : ℕ → UU l2) (dP : is-decidable-fam P) →
- (dQ : is-decidable-fam Q) (m : ℕ) (H : is-strict-upper-bound-ℕ P m) →
+ {l1 l2 : Level} (P : ℕ → UU l1) (Q : ℕ → UU l2) (dP : is-decidable-family P) →
+ (dQ : is-decidable-family Q) (m : ℕ) (H : is-strict-upper-bound-ℕ P m) →
is-decidable ((x : ℕ) → P x → Q x)
is-decidable-strictly-bounded-Π-ℕ P Q dP dQ m H =
is-decidable-bounded-Π-ℕ P Q dP dQ m (λ x p → leq-le-ℕ x m (H x p))
is-decidable-strictly-bounded-Π-ℕ' :
- {l : Level} (P : ℕ → UU l) (d : is-decidable-fam P) (m : ℕ) →
+ {l : Level} (P : ℕ → UU l) (d : is-decidable-family P) (m : ℕ) →
is-decidable ((x : ℕ) → le-ℕ x m → P x)
is-decidable-strictly-bounded-Π-ℕ' P d m =
is-decidable-strictly-bounded-Π-ℕ
diff --git a/src/elementary-number-theory/equality-natural-numbers.lagda.md b/src/elementary-number-theory/equality-natural-numbers.lagda.md
index bb335e5e58..1c5fb74ff5 100644
--- a/src/elementary-number-theory/equality-natural-numbers.lagda.md
+++ b/src/elementary-number-theory/equality-natural-numbers.lagda.md
@@ -14,6 +14,7 @@ open import foundation.coproduct-types
open import foundation.decidable-equality
open import foundation.decidable-types
open import foundation.dependent-pair-types
+open import foundation.discrete-types
open import foundation.empty-types
open import foundation.equivalences
open import foundation.function-types
@@ -22,11 +23,11 @@ open import foundation.identity-types
open import foundation.propositions
open import foundation.set-truncations
open import foundation.sets
+open import foundation.tight-apartness-relations
open import foundation.unit-type
open import foundation.universe-levels
open import foundation-core.decidable-propositions
-open import foundation-core.discrete-types
open import foundation-core.torsorial-type-families
```
@@ -179,3 +180,11 @@ is-equiv-Eq-eq-ℕ {m} {n} =
equiv-unit-trunc-ℕ-Set : ℕ ≃ type-trunc-Set ℕ
equiv-unit-trunc-ℕ-Set = equiv-unit-trunc-Set ℕ-Set
```
+
+### The natural numbers have a tight apartness relation
+
+```agda
+ℕ-Type-With-Tight-Apartness : Type-With-Tight-Apartness lzero lzero
+ℕ-Type-With-Tight-Apartness =
+ type-with-tight-apartness-Discrete-Type ℕ-Discrete-Type
+```
diff --git a/src/elementary-number-theory/greatest-common-divisor-natural-numbers.lagda.md b/src/elementary-number-theory/greatest-common-divisor-natural-numbers.lagda.md
index 13347d69ac..bc14f911c8 100644
--- a/src/elementary-number-theory/greatest-common-divisor-natural-numbers.lagda.md
+++ b/src/elementary-number-theory/greatest-common-divisor-natural-numbers.lagda.md
@@ -24,6 +24,7 @@ open import elementary-number-theory.well-ordering-principle-natural-numbers
open import foundation.action-on-identifications-functions
open import foundation.cartesian-product-types
open import foundation.coproduct-types
+open import foundation.decidable-type-families
open import foundation.decidable-types
open import foundation.dependent-pair-types
open import foundation.empty-types
@@ -87,7 +88,7 @@ pr2 (refl-is-common-divisor-ℕ x) = refl-div-ℕ x
```agda
is-decidable-is-common-divisor-ℕ :
- (a b : ℕ) → is-decidable-fam (is-common-divisor-ℕ a b)
+ (a b : ℕ) → is-decidable-family (is-common-divisor-ℕ a b)
is-decidable-is-common-divisor-ℕ a b x =
is-decidable-product
( is-decidable-div-ℕ x a)
@@ -137,7 +138,7 @@ leq-sum-is-common-divisor-ℕ a b d H =
```agda
is-decidable-is-multiple-of-gcd-ℕ :
- (a b : ℕ) → is-decidable-fam (is-multiple-of-gcd-ℕ a b)
+ (a b : ℕ) → is-decidable-family (is-multiple-of-gcd-ℕ a b)
is-decidable-is-multiple-of-gcd-ℕ a b n =
is-decidable-function-type'
( is-decidable-neg (is-decidable-is-zero-ℕ (a +ℕ b)))
diff --git a/src/elementary-number-theory/inequality-natural-numbers.lagda.md b/src/elementary-number-theory/inequality-natural-numbers.lagda.md
index a31c50691d..f536153a61 100644
--- a/src/elementary-number-theory/inequality-natural-numbers.lagda.md
+++ b/src/elementary-number-theory/inequality-natural-numbers.lagda.md
@@ -182,13 +182,16 @@ cases-order-three-elements-ℕ x y z =
order-three-elements-ℕ :
(x y z : ℕ) → cases-order-three-elements-ℕ x y z
-order-three-elements-ℕ zero-ℕ zero-ℕ zero-ℕ = inl (inl (pair star star))
-order-three-elements-ℕ zero-ℕ zero-ℕ (succ-ℕ z) = inl (inl (pair star star))
-order-three-elements-ℕ zero-ℕ (succ-ℕ y) zero-ℕ = inl (inr (pair star star))
+order-three-elements-ℕ zero-ℕ zero-ℕ zero-ℕ =
+ inl (inl (star , star))
+order-three-elements-ℕ zero-ℕ zero-ℕ (succ-ℕ z) =
+ inl (inl (star , star))
+order-three-elements-ℕ zero-ℕ (succ-ℕ y) zero-ℕ =
+ inl (inr (star , star))
order-three-elements-ℕ zero-ℕ (succ-ℕ y) (succ-ℕ z) =
inl (map-coproduct (pair star) (pair star) (linear-leq-ℕ y z))
order-three-elements-ℕ (succ-ℕ x) zero-ℕ zero-ℕ =
- inr (inl (inl (pair star star)))
+ inr (inl (inl (star , star)))
order-three-elements-ℕ (succ-ℕ x) zero-ℕ (succ-ℕ z) =
inr (inl (map-coproduct (pair star) (pair star) (linear-leq-ℕ z x)))
order-three-elements-ℕ (succ-ℕ x) (succ-ℕ y) zero-ℕ =
@@ -362,8 +365,8 @@ leq-add-ℕ' m n =
```agda
subtraction-leq-ℕ : (n m : ℕ) → n ≤-ℕ m → Σ ℕ (λ l → l +ℕ n = m)
-subtraction-leq-ℕ zero-ℕ m p = pair m refl
-subtraction-leq-ℕ (succ-ℕ n) (succ-ℕ m) p = pair (pr1 P) (ap succ-ℕ (pr2 P))
+subtraction-leq-ℕ zero-ℕ m p = (m , refl)
+subtraction-leq-ℕ (succ-ℕ n) (succ-ℕ m) p = (pr1 P , ap succ-ℕ (pr2 P))
where
P : Σ ℕ (λ l' → l' +ℕ n = m)
P = subtraction-leq-ℕ n m p
@@ -450,12 +453,12 @@ leq-mul-ℕ' k x =
leq-mul-is-nonzero-ℕ :
(k x : ℕ) → is-nonzero-ℕ k → x ≤-ℕ (x *ℕ k)
leq-mul-is-nonzero-ℕ k x H with is-successor-is-nonzero-ℕ H
-... | pair l refl = leq-mul-ℕ l x
+... | (l , refl) = leq-mul-ℕ l x
leq-mul-is-nonzero-ℕ' :
(k x : ℕ) → is-nonzero-ℕ k → x ≤-ℕ (k *ℕ x)
leq-mul-is-nonzero-ℕ' k x H with is-successor-is-nonzero-ℕ H
-... | pair l refl = leq-mul-ℕ' l x
+... | (l , refl) = leq-mul-ℕ' l x
```
## See also
diff --git a/src/elementary-number-theory/kolakoski-sequence.lagda.md b/src/elementary-number-theory/kolakoski-sequence.lagda.md
index 602bc2597a..cdc0b8b321 100644
--- a/src/elementary-number-theory/kolakoski-sequence.lagda.md
+++ b/src/elementary-number-theory/kolakoski-sequence.lagda.md
@@ -14,6 +14,7 @@ open import elementary-number-theory.strong-induction-natural-numbers
open import foundation.booleans
open import foundation.cartesian-product-types
open import foundation.dependent-pair-types
+open import foundation.logical-operations-booleans
```
diff --git a/src/elementary-number-theory/negative-integers.lagda.md b/src/elementary-number-theory/negative-integers.lagda.md
index a549a3ae37..7bc2494ac5 100644
--- a/src/elementary-number-theory/negative-integers.lagda.md
+++ b/src/elementary-number-theory/negative-integers.lagda.md
@@ -14,6 +14,7 @@ open import elementary-number-theory.nonzero-integers
open import foundation.action-on-identifications-functions
open import foundation.coproduct-types
open import foundation.decidable-subtypes
+open import foundation.decidable-type-families
open import foundation.decidable-types
open import foundation.dependent-pair-types
open import foundation.empty-types
@@ -96,7 +97,7 @@ neg-one-negative-ℤ = (neg-one-ℤ , star)
### Negativity is decidable
```agda
-is-decidable-is-negative-ℤ : is-decidable-fam is-negative-ℤ
+is-decidable-is-negative-ℤ : is-decidable-family is-negative-ℤ
is-decidable-is-negative-ℤ (inl x) = inl star
is-decidable-is-negative-ℤ (inr x) = inr id
diff --git a/src/elementary-number-theory/nonnegative-integers.lagda.md b/src/elementary-number-theory/nonnegative-integers.lagda.md
index 6f9d446eca..9c06ff7fb4 100644
--- a/src/elementary-number-theory/nonnegative-integers.lagda.md
+++ b/src/elementary-number-theory/nonnegative-integers.lagda.md
@@ -13,6 +13,7 @@ open import elementary-number-theory.natural-numbers
open import foundation.action-on-identifications-functions
open import foundation.coproduct-types
open import foundation.decidable-subtypes
+open import foundation.decidable-type-families
open import foundation.decidable-types
open import foundation.dependent-pair-types
open import foundation.empty-types
@@ -98,7 +99,7 @@ one-nonnegative-ℤ = (one-ℤ , star)
### Nonnegativity is decidable
```agda
-is-decidable-is-nonnegative-ℤ : is-decidable-fam is-nonnegative-ℤ
+is-decidable-is-nonnegative-ℤ : is-decidable-family is-nonnegative-ℤ
is-decidable-is-nonnegative-ℤ (inl x) = inr id
is-decidable-is-nonnegative-ℤ (inr x) = inl star
diff --git a/src/elementary-number-theory/nonpositive-integers.lagda.md b/src/elementary-number-theory/nonpositive-integers.lagda.md
index 423216dbe2..2fb4ab4cb4 100644
--- a/src/elementary-number-theory/nonpositive-integers.lagda.md
+++ b/src/elementary-number-theory/nonpositive-integers.lagda.md
@@ -13,6 +13,7 @@ open import elementary-number-theory.natural-numbers
open import foundation.action-on-identifications-functions
open import foundation.coproduct-types
open import foundation.decidable-subtypes
+open import foundation.decidable-type-families
open import foundation.decidable-types
open import foundation.dependent-pair-types
open import foundation.empty-types
@@ -100,7 +101,7 @@ neg-one-nonpositive-ℤ = (neg-one-ℤ , star)
### Nonpositivity is decidable
```agda
-is-decidable-is-nonpositive-ℤ : is-decidable-fam is-nonpositive-ℤ
+is-decidable-is-nonpositive-ℤ : is-decidable-family is-nonpositive-ℤ
is-decidable-is-nonpositive-ℤ (inl x) = inl star
is-decidable-is-nonpositive-ℤ (inr (inl x)) = inl star
is-decidable-is-nonpositive-ℤ (inr (inr x)) = inr id
diff --git a/src/elementary-number-theory/positive-integers.lagda.md b/src/elementary-number-theory/positive-integers.lagda.md
index e1f9b8dfde..11ba8a6bff 100644
--- a/src/elementary-number-theory/positive-integers.lagda.md
+++ b/src/elementary-number-theory/positive-integers.lagda.md
@@ -15,6 +15,7 @@ open import elementary-number-theory.nonzero-natural-numbers
open import foundation.action-on-identifications-functions
open import foundation.coproduct-types
open import foundation.decidable-subtypes
+open import foundation.decidable-type-families
open import foundation.decidable-types
open import foundation.dependent-pair-types
open import foundation.empty-types
@@ -108,7 +109,7 @@ one-ℤ⁺ = one-positive-ℤ
### Positivity is decidable
```agda
-is-decidable-is-positive-ℤ : is-decidable-fam is-positive-ℤ
+is-decidable-is-positive-ℤ : is-decidable-family is-positive-ℤ
is-decidable-is-positive-ℤ (inl x) = inr id
is-decidable-is-positive-ℤ (inr (inl x)) = inr id
is-decidable-is-positive-ℤ (inr (inr x)) = inl star
diff --git a/src/elementary-number-theory/well-ordering-principle-natural-numbers.lagda.md b/src/elementary-number-theory/well-ordering-principle-natural-numbers.lagda.md
index a72905645f..c17dbcafba 100644
--- a/src/elementary-number-theory/well-ordering-principle-natural-numbers.lagda.md
+++ b/src/elementary-number-theory/well-ordering-principle-natural-numbers.lagda.md
@@ -13,6 +13,7 @@ open import elementary-number-theory.natural-numbers
open import foundation.cartesian-product-types
open import foundation.coproduct-types
+open import foundation.decidable-type-families
open import foundation.decidable-types
open import foundation.dependent-pair-types
open import foundation.empty-types
@@ -66,7 +67,7 @@ module _
pr2 minimal-element-ℕ-Prop = is-prop-minimal-element-ℕ
is-minimal-element-succ-ℕ :
- {l : Level} (P : ℕ → UU l) (d : is-decidable-fam P)
+ {l : Level} (P : ℕ → UU l) (d : is-decidable-family P)
(m : ℕ) (pm : P (succ-ℕ m))
(is-lower-bound-m : is-lower-bound-ℕ (λ x → P (succ-ℕ x)) m) →
¬ (P zero-ℕ) → is-lower-bound-ℕ P (succ-ℕ m)
@@ -80,7 +81,7 @@ is-minimal-element-succ-ℕ
is-lower-bound-m n psuccn
well-ordering-principle-succ-ℕ :
- {l : Level} (P : ℕ → UU l) (d : is-decidable-fam P)
+ {l : Level} (P : ℕ → UU l) (d : is-decidable-family P)
(n : ℕ) (p : P (succ-ℕ n)) →
is-decidable (P zero-ℕ) →
minimal-element-ℕ (λ m → P (succ-ℕ m)) → minimal-element-ℕ P
@@ -90,7 +91,7 @@ well-ordering-principle-succ-ℕ P d n p (inr neg-p0) (m , pm , is-min-m) =
( succ-ℕ m , pm , is-minimal-element-succ-ℕ P d m pm is-min-m neg-p0)
well-ordering-principle-ℕ :
- {l : Level} (P : ℕ → UU l) (d : is-decidable-fam P) →
+ {l : Level} (P : ℕ → UU l) (d : is-decidable-family P) →
Σ ℕ P → minimal-element-ℕ P
pr1 (well-ordering-principle-ℕ P d (pair zero-ℕ p)) = zero-ℕ
pr1 (pr2 (well-ordering-principle-ℕ P d (pair zero-ℕ p))) = p
@@ -103,7 +104,7 @@ well-ordering-principle-ℕ P d (pair (succ-ℕ n) p) =
( pair n p))
number-well-ordering-principle-ℕ :
- {l : Level} (P : ℕ → UU l) (d : is-decidable-fam P) (nP : Σ ℕ P) → ℕ
+ {l : Level} (P : ℕ → UU l) (d : is-decidable-family P) (nP : Σ ℕ P) → ℕ
number-well-ordering-principle-ℕ P d nP =
pr1 (well-ordering-principle-ℕ P d nP)
```
@@ -114,7 +115,7 @@ This is independently of the input `(pair n p) : Σ ℕ P`.
```agda
is-zero-well-ordering-principle-succ-ℕ :
- {l : Level} (P : ℕ → UU l) (d : is-decidable-fam P)
+ {l : Level} (P : ℕ → UU l) (d : is-decidable-family P)
(n : ℕ) (p : P (succ-ℕ n)) (d0 : is-decidable (P zero-ℕ)) →
(x : minimal-element-ℕ (λ m → P (succ-ℕ m))) (p0 : P zero-ℕ) →
pr1 (well-ordering-principle-succ-ℕ P d n p d0 x) = zero-ℕ
@@ -124,7 +125,7 @@ is-zero-well-ordering-principle-succ-ℕ P d n p (inr np0) x q0 =
ex-falso (np0 q0)
is-zero-well-ordering-principle-ℕ :
- {l : Level} (P : ℕ → UU l) (d : is-decidable-fam P) →
+ {l : Level} (P : ℕ → UU l) (d : is-decidable-family P) →
(x : Σ ℕ P) → P zero-ℕ → is-zero-ℕ (number-well-ordering-principle-ℕ P d x)
is-zero-well-ordering-principle-ℕ P d (pair zero-ℕ p) p0 = refl
is-zero-well-ordering-principle-ℕ P d (pair (succ-ℕ m) p) =
diff --git a/src/elementary-number-theory/well-ordering-principle-standard-finite-types.lagda.md b/src/elementary-number-theory/well-ordering-principle-standard-finite-types.lagda.md
index a422c722f0..c8d6c7ef26 100644
--- a/src/elementary-number-theory/well-ordering-principle-standard-finite-types.lagda.md
+++ b/src/elementary-number-theory/well-ordering-principle-standard-finite-types.lagda.md
@@ -15,6 +15,7 @@ open import elementary-number-theory.well-ordering-principle-natural-numbers
open import foundation.cartesian-product-types
open import foundation.coproduct-types
open import foundation.decidable-subtypes
+open import foundation.decidable-type-families
open import foundation.decidable-types
open import foundation.dependent-pair-types
open import foundation.empty-types
@@ -56,7 +57,7 @@ numbers.
```agda
exists-not-not-for-all-Fin :
- {l : Level} (k : ℕ) {P : Fin k → UU l} → (is-decidable-fam P) →
+ {l : Level} (k : ℕ) {P : Fin k → UU l} → (is-decidable-family P) →
¬ ((x : Fin k) → P x) → Σ (Fin k) (λ x → ¬ (P x))
exists-not-not-for-all-Fin {l} zero-ℕ d H = ex-falso (H ind-empty)
exists-not-not-for-all-Fin {l} (succ-ℕ k) {P} d H with d (inr star)
@@ -71,7 +72,7 @@ exists-not-not-for-all-Fin {l} (succ-ℕ k) {P} d H with d (inr star)
exists-not-not-for-all-count :
{l1 l2 : Level} {X : UU l1} (P : X → UU l2) →
- (is-decidable-fam P) → count X →
+ (is-decidable-family P) → count X →
¬ ((x : X) → P x) → Σ X (λ x → ¬ (P x))
exists-not-not-for-all-count {l1} {l2} {X} P p e =
( g) ∘
diff --git a/src/finite-group-theory/orbits-permutations.lagda.md b/src/finite-group-theory/orbits-permutations.lagda.md
index 06919a3b39..835bcc5323 100644
--- a/src/finite-group-theory/orbits-permutations.lagda.md
+++ b/src/finite-group-theory/orbits-permutations.lagda.md
@@ -55,6 +55,8 @@ open import foundation.universe-levels
open import lists.lists
+open import logic.propositionally-decidable-types
+
open import univalent-combinatorics.2-element-decidable-subtypes
open import univalent-combinatorics.2-element-types
open import univalent-combinatorics.counting
@@ -491,7 +493,6 @@ module _
( prop-equivalence-relation same-orbits-permutation a b))
( λ h →
is-decidable-trunc-Prop-is-merely-decidable
- ( Σ ℕ (λ k → Id (iterate k (map-equiv f) a) b))
( unit-trunc-Prop
( is-decidable-iterate-is-decidable-bounded h a b
( is-decidable-bounded-Σ-ℕ n
diff --git a/src/foundation-core.lagda.md b/src/foundation-core.lagda.md
index 9b9dd2512c..ea01876a8c 100644
--- a/src/foundation-core.lagda.md
+++ b/src/foundation-core.lagda.md
@@ -36,6 +36,7 @@ open import foundation-core.homotopies public
open import foundation-core.identity-types public
open import foundation-core.injective-maps public
open import foundation-core.invertible-maps public
+open import foundation-core.iterating-functions public
open import foundation-core.negation public
open import foundation-core.operations-span-diagrams public
open import foundation-core.operations-spans public
diff --git a/src/foundation-core/decidable-propositions.lagda.md b/src/foundation-core/decidable-propositions.lagda.md
index eb48a26b7d..d643fb95ef 100644
--- a/src/foundation-core/decidable-propositions.lagda.md
+++ b/src/foundation-core/decidable-propositions.lagda.md
@@ -12,9 +12,9 @@ open import foundation.decidable-types
open import foundation.dependent-pair-types
open import foundation.double-negation
open import foundation.negation
-open import foundation.propositional-truncations
open import foundation.transport-along-identifications
open import foundation.unit-type
+open import foundation.universal-property-empty-type
open import foundation.universe-levels
open import foundation-core.cartesian-product-types
@@ -23,6 +23,7 @@ open import foundation-core.empty-types
open import foundation-core.function-types
open import foundation-core.functoriality-dependent-pair-types
open import foundation-core.propositions
+open import foundation-core.sets
open import foundation-core.subtypes
```
@@ -116,6 +117,9 @@ module _
is-decidable type-Decidable-Prop
pr2 is-decidable-prop-Decidable-Prop =
is-prop-is-decidable is-prop-type-Decidable-Prop
+
+ set-Decidable-Prop : Set l
+ set-Decidable-Prop = set-Prop prop-Decidable-Prop
```
### The empty type is a decidable proposition
@@ -206,24 +210,25 @@ module _
is-decidable-is-decidable-prop-Σ : is-decidable (Σ P Q)
is-decidable-is-decidable-prop-Σ =
- rec-coproduct
- ( λ x →
- rec-coproduct
- ( λ y → inl (x , y))
- ( λ ny →
- inr
- ( λ xy →
- ny
- ( tr Q
- ( eq-is-prop (is-prop-type-is-decidable-prop H))
- ( pr2 xy))))
- ( is-decidable-type-is-decidable-prop (K x)))
- ( λ nx → inr (λ xy → nx (pr1 xy)))
+ is-decidable-Σ-has-double-negation-dense-equality-base
+ ( λ x y →
+ intro-double-negation (eq-is-prop (is-prop-type-is-decidable-prop H)))
( is-decidable-type-is-decidable-prop H)
+ ( is-decidable-type-is-decidable-prop ∘ K)
is-decidable-prop-Σ : is-decidable-prop (Σ P Q)
is-decidable-prop-Σ =
( is-prop-is-decidable-prop-Σ , is-decidable-is-decidable-prop-Σ)
+
+Σ-Decidable-Prop :
+ {l1 l2 : Level} →
+ (P : Decidable-Prop l1) →
+ (type-Decidable-Prop P → Decidable-Prop l2) → Decidable-Prop (l1 ⊔ l2)
+Σ-Decidable-Prop P Q =
+ ( Σ (type-Decidable-Prop P) (type-Decidable-Prop ∘ Q) ,
+ is-decidable-prop-Σ
+ ( is-decidable-prop-type-Decidable-Prop P)
+ ( is-decidable-prop-type-Decidable-Prop ∘ Q))
```
### The negation operation on decidable propositions
@@ -251,38 +256,75 @@ type-neg-Decidable-Prop :
type-neg-Decidable-Prop P = type-Decidable-Prop (neg-Decidable-Prop P)
```
-### Decidability of a propositional truncation
+### Function types between decidable propositions
+
+```agda
+module _
+ {l1 l2 : Level} {P : UU l1} {Q : UU l2}
+ where
+
+ abstract
+ is-decidable-prop-function-type' :
+ is-decidable P → (P → is-decidable-prop Q) → is-decidable-prop (P → Q)
+ pr1 (is-decidable-prop-function-type' H K) =
+ rec-coproduct
+ ( λ p → is-prop-function-type (is-prop-type-is-decidable-prop (K p)))
+ ( λ np → is-prop-is-contr (universal-property-empty-is-empty P np Q))
+ ( H)
+ pr2 (is-decidable-prop-function-type' H K) =
+ is-decidable-function-type' H (is-decidable-type-is-decidable-prop ∘ K)
+
+ abstract
+ is-decidable-prop-function-type :
+ is-decidable P → is-decidable-prop Q → is-decidable-prop (P → Q)
+ pr1 (is-decidable-prop-function-type H K) =
+ is-prop-function-type (is-prop-type-is-decidable-prop K)
+ pr2 (is-decidable-prop-function-type H K) =
+ is-decidable-function-type H (is-decidable-type-is-decidable-prop K)
+
+hom-Decidable-Prop :
+ {l1 l2 : Level} →
+ Decidable-Prop l1 → Decidable-Prop l2 → Decidable-Prop (l1 ⊔ l2)
+pr1 (hom-Decidable-Prop P Q) = type-Decidable-Prop P → type-Decidable-Prop Q
+pr2 (hom-Decidable-Prop P Q) =
+ is-decidable-prop-function-type
+ ( is-decidable-Decidable-Prop P)
+ ( is-decidable-prop-type-Decidable-Prop Q)
+```
+
+### Dependent products of decidable propositions
```agda
-abstract
- is-prop-is-decidable-trunc-Prop :
- {l : Level} (A : UU l) → is-prop (is-decidable (type-trunc-Prop A))
- is-prop-is-decidable-trunc-Prop A =
- is-prop-is-decidable is-prop-type-trunc-Prop
-
-is-decidable-trunc-Prop : {l : Level} → UU l → Prop l
-pr1 (is-decidable-trunc-Prop A) = is-decidable (type-trunc-Prop A)
-pr2 (is-decidable-trunc-Prop A) = is-prop-is-decidable-trunc-Prop A
-
-is-decidable-trunc-Prop-is-merely-decidable :
- {l : Level} (A : UU l) →
- is-merely-decidable A → is-decidable (type-trunc-Prop A)
-is-decidable-trunc-Prop-is-merely-decidable A =
- map-universal-property-trunc-Prop
- ( is-decidable-trunc-Prop A)
- ( f)
+module _
+ {l1 l2 : Level} {P : UU l1} {Q : P → UU l2}
where
- f : is-decidable A → type-Prop (is-decidable-trunc-Prop A)
- f (inl a) = inl (unit-trunc-Prop a)
- f (inr f) = inr (map-universal-property-trunc-Prop empty-Prop f)
-
-is-merely-decidable-is-decidable-trunc-Prop :
- {l : Level} (A : UU l) →
- is-decidable (type-trunc-Prop A) → is-merely-decidable A
-is-merely-decidable-is-decidable-trunc-Prop A (inl x) =
- apply-universal-property-trunc-Prop x
- ( is-merely-decidable-Prop A)
- ( unit-trunc-Prop ∘ inl)
-is-merely-decidable-is-decidable-trunc-Prop A (inr f) =
- unit-trunc-Prop (inr (f ∘ unit-trunc-Prop))
+
+ is-decidable-Π-is-decidable-prop :
+ is-decidable-prop P →
+ ((x : P) → is-decidable-prop (Q x)) →
+ is-decidable ((x : P) → Q x)
+ is-decidable-Π-is-decidable-prop (H , inl x) K =
+ rec-coproduct
+ ( λ y → inl (λ x' → tr Q (eq-is-prop H) y))
+ ( λ ny → inr (λ f → ny (f x)))
+ ( is-decidable-type-is-decidable-prop (K x))
+ is-decidable-Π-is-decidable-prop (H , inr nx) K =
+ inl (λ x' → ex-falso (nx x'))
+
+ is-decidable-prop-Π :
+ is-decidable-prop P →
+ ((x : P) → is-decidable-prop (Q x)) →
+ is-decidable-prop ((x : P) → Q x)
+ is-decidable-prop-Π H K =
+ ( is-prop-Π (is-prop-type-is-decidable-prop ∘ K)) ,
+ ( is-decidable-Π-is-decidable-prop H K)
+
+Π-Decidable-Prop :
+ {l1 l2 : Level} (P : Decidable-Prop l1) →
+ (type-Decidable-Prop P → Decidable-Prop l2) → Decidable-Prop (l1 ⊔ l2)
+Π-Decidable-Prop P Q =
+ ( (x : type-Decidable-Prop P) → type-Decidable-Prop (Q x)) ,
+ ( is-decidable-prop-Π
+ ( is-decidable-prop-type-Decidable-Prop P)
+ ( is-decidable-prop-type-Decidable-Prop ∘ Q))
```
diff --git a/src/foundation-core/homotopies.lagda.md b/src/foundation-core/homotopies.lagda.md
index 9ddfef0692..b507404937 100644
--- a/src/foundation-core/homotopies.lagda.md
+++ b/src/foundation-core/homotopies.lagda.md
@@ -347,8 +347,7 @@ module _
{H H' : f ~ g}
where
- ap-inv-htpy :
- H ~ H' → inv-htpy H ~ inv-htpy H'
+ ap-inv-htpy : H ~ H' → inv-htpy H ~ inv-htpy H'
ap-inv-htpy K x = ap inv (K x)
```
diff --git a/src/foundation-core/identity-types.lagda.md b/src/foundation-core/identity-types.lagda.md
index 43ebb181d9..d1c48f2836 100644
--- a/src/foundation-core/identity-types.lagda.md
+++ b/src/foundation-core/identity-types.lagda.md
@@ -120,10 +120,19 @@ have the induction principle of the identity type.
ind-Id :
{l1 l2 : Level} {A : UU l1}
(x : A) (B : (y : A) (p : x = y) → UU l2) →
- (B x refl) → (y : A) (p : x = y) → B y p
+ B x refl → (y : A) (p : x = y) → B y p
ind-Id x B b y refl = b
```
+### The recursion principle of identity types
+
+```agda
+rec-Id :
+ {l1 l2 : Level} {A : UU l1} (x : A) {B : A → UU l2} →
+ B x → (y : A) → x = y → B y
+rec-Id x {B} = ind-Id x (λ y p → B y)
+```
+
## Operations on the identity type
The identity types form a weak groupoidal structure on types. Thus they come
diff --git a/src/foundation-core/injective-maps.lagda.md b/src/foundation-core/injective-maps.lagda.md
index 72003be269..86895ecbf7 100644
--- a/src/foundation-core/injective-maps.lagda.md
+++ b/src/foundation-core/injective-maps.lagda.md
@@ -18,6 +18,7 @@ open import foundation-core.function-types
open import foundation-core.homotopies
open import foundation-core.identity-types
open import foundation-core.retractions
+open import foundation-core.retracts-of-types
open import foundation-core.sections
```
@@ -25,7 +26,9 @@ open import foundation-core.sections
## Idea
-A map `f : A → B` is **injective** if `f x = f y` implies `x = y`.
+A map `f : A → B` is
+{{#concept "injective" Disambiguation="map of types" WD="injective function" WDID=Q12047217 Agda=is-injective Agda=injection}},
+also called _left cancellable_, if `f x = f y` implies `x = y`.
## Warning
@@ -42,6 +45,16 @@ is-injective {l1} {l2} {A} {B} f = {x y : A} → f x = f y → x = y
injection : {l1 l2 : Level} (A : UU l1) (B : UU l2) → UU (l1 ⊔ l2)
injection A B = Σ (A → B) is-injective
+
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : injection A B)
+ where
+
+ map-injection : A → B
+ map-injection = pr1 f
+
+ is-injective-injection : is-injective map-injection
+ is-injective-injection = pr2 f
```
## Examples
@@ -100,6 +113,39 @@ module _
is-inj-h (is-inj-g ((inv (H x)) ∙ (p ∙ (H x'))))
```
+### Embeddings are injective
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ is-injective-is-emb : {f : A → B} → is-emb f → is-injective f
+ is-injective-is-emb is-emb-f {x} {y} = map-inv-is-equiv (is-emb-f x y)
+
+ is-injective-emb : (e : A ↪ B) → is-injective (map-emb e)
+ is-injective-emb e {x} {y} = map-inv-is-equiv (is-emb-map-emb e x y)
+
+ injection-emb : A ↪ B → injection A B
+ injection-emb (f , H) = (f , is-injective-is-emb H)
+```
+
+### Retracts are injective
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ is-injective-inclusion-retract :
+ (R : A retract-of B) → is-injective (inclusion-retract R)
+ is-injective-inclusion-retract (i , R) = is-injective-retraction i R
+
+ injection-retract : A retract-of B → injection A B
+ injection-retract R =
+ ( inclusion-retract R , is-injective-inclusion-retract R)
+```
+
### Equivalences are injective
```agda
@@ -137,20 +183,6 @@ module _
is-equiv-is-invertible g G (λ x → H (G (f x)))
```
-### Any embedding is injective
-
-```agda
-module _
- {l1 l2 : Level} {A : UU l1} {B : UU l2}
- where
-
- is-injective-is-emb : {f : A → B} → is-emb f → is-injective f
- is-injective-is-emb is-emb-f {x} {y} = map-inv-is-equiv (is-emb-f x y)
-
- is-injective-emb : (e : A ↪ B) → is-injective (map-emb e)
- is-injective-emb e {x} {y} = map-inv-is-equiv (is-emb-map-emb e x y)
-```
-
### Any map out of a contractible type is injective
```agda
diff --git a/src/foundation-core/iterating-functions.lagda.md b/src/foundation-core/iterating-functions.lagda.md
new file mode 100644
index 0000000000..e17b549215
--- /dev/null
+++ b/src/foundation-core/iterating-functions.lagda.md
@@ -0,0 +1,123 @@
+# Iterating functions
+
+```agda
+module foundation-core.iterating-functions where
+```
+
+Imports
+
+```agda
+open import elementary-number-theory.natural-numbers
+
+open import foundation.action-on-identifications-functions
+open import foundation.subtypes
+open import foundation.universe-levels
+
+open import foundation-core.commuting-squares-of-maps
+open import foundation-core.function-types
+open import foundation-core.homotopies
+open import foundation-core.identity-types
+```
+
+
+
+## Idea
+
+Any map `f : X → X` can be
+{{#concept "iterated" Disambiguation="endo map of types" Agda=iterate Agda=iterate'}}
+by repeatedly applying `f`.
+
+## Definition
+
+### Iterating functions
+
+```agda
+module _
+ {l : Level} {X : UU l}
+ where
+
+ iterate : ℕ → (X → X) → (X → X)
+ iterate zero-ℕ f x = x
+ iterate (succ-ℕ k) f x = f (iterate k f x)
+
+ iterate' : ℕ → (X → X) → (X → X)
+ iterate' zero-ℕ f x = x
+ iterate' (succ-ℕ k) f x = iterate' k f (f x)
+```
+
+### Homotopies of iterating functions
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} (s : A → A) (t : B → B)
+ where
+
+ coherence-square-iterate :
+ {f : A → B} (H : coherence-square-maps f s t f) →
+ (n : ℕ) → coherence-square-maps f (iterate n s) (iterate n t) f
+ coherence-square-iterate {f} H zero-ℕ x = refl
+ coherence-square-iterate {f} H (succ-ℕ n) =
+ pasting-vertical-coherence-square-maps
+ ( f)
+ ( iterate n s)
+ ( iterate n t)
+ ( f)
+ ( s)
+ ( t)
+ ( f)
+ ( coherence-square-iterate H n)
+ ( H)
+```
+
+## Properties
+
+### The two definitions of iterating are homotopic
+
+```agda
+module _
+ {l : Level} {X : UU l}
+ where
+
+ reassociate-iterate-succ-ℕ :
+ (k : ℕ) (f : X → X) (x : X) → iterate (succ-ℕ k) f x = iterate k f (f x)
+ reassociate-iterate-succ-ℕ zero-ℕ f x = refl
+ reassociate-iterate-succ-ℕ (succ-ℕ k) f x =
+ ap f (reassociate-iterate-succ-ℕ k f x)
+
+ reassociate-iterate : (k : ℕ) (f : X → X) → iterate k f ~ iterate' k f
+ reassociate-iterate zero-ℕ f x = refl
+ reassociate-iterate (succ-ℕ k) f x =
+ reassociate-iterate-succ-ℕ k f x ∙ reassociate-iterate k f (f x)
+```
+
+### If `f : X → X` satisfies a property of endofunctions on `X`, and the property is closed under composition then iterates of `f` satisfy the property
+
+```agda
+module _
+ {l1 l2 : Level} {X : UU l1} {f : X → X}
+ (P : subtype l2 (X → X))
+ where
+
+ is-in-subtype-iterate-succ-ℕ :
+ (F : is-in-subtype P f) →
+ ( (h g : X → X) →
+ is-in-subtype P h →
+ is-in-subtype P g →
+ is-in-subtype P (h ∘ g)) →
+ (n : ℕ) → is-in-subtype P (iterate (succ-ℕ n) f)
+ is-in-subtype-iterate-succ-ℕ F H zero-ℕ = F
+ is-in-subtype-iterate-succ-ℕ F H (succ-ℕ n) =
+ H f (iterate (succ-ℕ n) f) F (is-in-subtype-iterate-succ-ℕ F H n)
+
+ is-in-subtype-iterate :
+ (I : is-in-subtype P (id {A = X})) →
+ (F : is-in-subtype P f) →
+ ( (h g : X → X) →
+ is-in-subtype P h →
+ is-in-subtype P g →
+ is-in-subtype P (h ∘ g)) →
+ (n : ℕ) → is-in-subtype P (iterate n f)
+ is-in-subtype-iterate I F H zero-ℕ = I
+ is-in-subtype-iterate I F H (succ-ℕ n) =
+ H f (iterate n f) F (is-in-subtype-iterate I F H n)
+```
diff --git a/src/foundation-core/subtypes.lagda.md b/src/foundation-core/subtypes.lagda.md
index 128f682668..5310ef728e 100644
--- a/src/foundation-core/subtypes.lagda.md
+++ b/src/foundation-core/subtypes.lagda.md
@@ -9,6 +9,7 @@ module foundation-core.subtypes where
```agda
open import foundation.action-on-identifications-functions
open import foundation.dependent-pair-types
+open import foundation.injective-maps
open import foundation.logical-equivalences
open import foundation.subtype-identity-principle
open import foundation.universe-levels
@@ -192,6 +193,9 @@ module _
pr1 emb-subtype = inclusion-subtype B
pr2 emb-subtype = is-emb-inclusion-subtype
+ injection-subtype : injection (type-subtype B) A
+ injection-subtype = injection-emb emb-subtype
+
equiv-ap-inclusion-subtype :
{s t : type-subtype B} →
(s = t) ≃ (inclusion-subtype B s = inclusion-subtype B t)
diff --git a/src/foundation.lagda.md b/src/foundation.lagda.md
index 0a5a201e83..3f6fbd6c0d 100644
--- a/src/foundation.lagda.md
+++ b/src/foundation.lagda.md
@@ -113,6 +113,7 @@ open import foundation.decidable-maps public
open import foundation.decidable-propositions public
open import foundation.decidable-relations public
open import foundation.decidable-subtypes public
+open import foundation.decidable-type-families public
open import foundation.decidable-types public
open import foundation.dependent-binary-homotopies public
open import foundation.dependent-binomial-theorem public
@@ -147,6 +148,9 @@ open import foundation.disjoint-subtypes public
open import foundation.disjunction public
open import foundation.double-arrows public
open import foundation.double-negation public
+open import foundation.double-negation-dense-equality public
+open import foundation.double-negation-dense-equality-maps public
+open import foundation.double-negation-images public
open import foundation.double-negation-modality public
open import foundation.double-negation-stable-equality public
open import foundation.double-negation-stable-propositions public
@@ -227,6 +231,7 @@ open import foundation.global-subuniverses public
open import foundation.globular-type-of-dependent-functions public
open import foundation.globular-type-of-functions public
open import foundation.higher-homotopies-morphisms-arrows public
+open import foundation.hilbert-epsilon-operators-maps public
open import foundation.hilberts-epsilon-operators public
open import foundation.homotopies public
open import foundation.homotopies-morphisms-arrows public
@@ -245,6 +250,7 @@ open import foundation.implicit-function-types public
open import foundation.impredicative-encodings public
open import foundation.impredicative-universes public
open import foundation.induction-principle-propositional-truncation public
+open import foundation.inequality-booleans public
open import foundation.infinitely-coherent-equivalences public
open import foundation.infinity-connected-maps public
open import foundation.infinity-connected-types public
@@ -256,6 +262,7 @@ open import foundation.intersections-subtypes public
open import foundation.inverse-sequential-diagrams public
open import foundation.invertible-maps public
open import foundation.involutions public
+open import foundation.irrefutable-equality public
open import foundation.irrefutable-propositions public
open import foundation.isolated-elements public
open import foundation.isomorphisms-of-sets public
@@ -282,6 +289,7 @@ open import foundation.limited-principle-of-omniscience public
open import foundation.locale-of-propositions public
open import foundation.locally-small-types public
open import foundation.logical-equivalences public
+open import foundation.logical-operations-booleans public
open import foundation.maps-in-global-subuniverses public
open import foundation.maps-in-subuniverses public
open import foundation.maybe public
diff --git a/src/foundation/booleans.lagda.md b/src/foundation/booleans.lagda.md
index f858e0a976..b1e7d99e32 100644
--- a/src/foundation/booleans.lagda.md
+++ b/src/foundation/booleans.lagda.md
@@ -7,6 +7,7 @@ module foundation.booleans where
Imports
```agda
+open import foundation.apartness-relations
open import foundation.decidable-equality
open import foundation.decidable-types
open import foundation.dependent-pair-types
@@ -14,11 +15,13 @@ open import foundation.discrete-types
open import foundation.involutions
open import foundation.negated-equality
open import foundation.raising-universe-levels
+open import foundation.tight-apartness-relations
open import foundation.unit-type
open import foundation.universe-levels
open import foundation-core.constant-maps
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
@@ -38,8 +41,8 @@ open import univalent-combinatorics.standard-finite-types
## Idea
-The type of **booleans** is a
-[2-element type](univalent-combinatorics.2-element-types.md) with elements
+The type of {{#concept "booleans" WD="Boolean domain" WDID=Q3269980 Agda=bool}}
+is a [2-element type](univalent-combinatorics.2-element-types.md) with elements
`true false : bool`, which is used for reasoning with
[decidable propositions](foundation-core.decidable-propositions.md).
@@ -144,34 +147,20 @@ neq-false-true-bool ()
neq-true-false-bool : true ≠ false
neq-true-false-bool ()
-```
-## Structure
+is-decidable-Eq-bool : {x y : bool} → is-decidable (Eq-bool x y)
+is-decidable-Eq-bool {true} {true} = inl star
+is-decidable-Eq-bool {true} {false} = inr id
+is-decidable-Eq-bool {false} {true} = inr id
+is-decidable-Eq-bool {false} {false} = inl star
+```
-### The boolean operators
+### The standard interpretation of booleans as decidable propositions
```agda
-neg-bool : bool → bool
-neg-bool true = false
-neg-bool false = true
-
-conjunction-bool : bool → bool → bool
-conjunction-bool true true = true
-conjunction-bool true false = false
-conjunction-bool false true = false
-conjunction-bool false false = false
-
-disjunction-bool : bool → bool → bool
-disjunction-bool true true = true
-disjunction-bool true false = true
-disjunction-bool false true = true
-disjunction-bool false false = false
-
-implication-bool : bool → bool → bool
-implication-bool true true = true
-implication-bool true false = false
-implication-bool false true = true
-implication-bool false false = true
+decidable-prop-bool : bool → Decidable-Prop lzero
+decidable-prop-bool true = unit-Decidable-Prop
+decidable-prop-bool false = empty-Decidable-Prop
```
## Properties
@@ -212,6 +201,14 @@ bool-Discrete-Type : Discrete-Type lzero
bool-Discrete-Type = bool , has-decidable-equality-bool
```
+### The booleans have a tight apartness relation
+
+```agda
+bool-Type-With-Tight-Apartness : Type-With-Tight-Apartness lzero lzero
+bool-Type-With-Tight-Apartness =
+ type-with-tight-apartness-Discrete-Type bool-Discrete-Type
+```
+
### The "is true" predicate on booleans
```agda
@@ -222,7 +219,14 @@ is-prop-is-true : (b : bool) → is-prop (is-true b)
is-prop-is-true b = is-set-bool b true
is-true-Prop : bool → Prop lzero
-is-true-Prop b = is-true b , is-prop-is-true b
+is-true-Prop b = (is-true b , is-prop-is-true b)
+
+is-decidable-prop-is-true : (b : bool) → is-decidable-prop (is-true b)
+is-decidable-prop-is-true b =
+ ( is-prop-is-true b , has-decidable-equality-bool b true)
+
+is-true-Decidable-Prop : bool → Decidable-Prop lzero
+is-true-Decidable-Prop b = (is-true b , is-decidable-prop-is-true b)
```
### The "is false" predicate on booleans
@@ -236,30 +240,43 @@ is-prop-is-false b = is-set-bool b false
is-false-Prop : bool → Prop lzero
is-false-Prop b = is-false b , is-prop-is-false b
+
+is-decidable-prop-is-false : (b : bool) → is-decidable-prop (is-false b)
+is-decidable-prop-is-false b =
+ ( is-prop-is-false b , has-decidable-equality-bool b false)
+
+is-false-Decidable-Prop : bool → Decidable-Prop lzero
+is-false-Decidable-Prop b = (is-false b , is-decidable-prop-is-false b)
```
### A boolean cannot be both true and false
```agda
-not-is-false-is-true : (x : bool) → is-true x → ¬ (is-false x)
-not-is-false-is-true true t ()
-not-is-false-is-true false () f
+is-not-false-is-true : (x : bool) → is-true x → ¬ (is-false x)
+is-not-false-is-true true t ()
+is-not-false-is-true false () f
-not-is-true-is-false : (x : bool) → is-false x → ¬ (is-true x)
-not-is-true-is-false true () f
-not-is-true-is-false false t ()
-```
+is-not-true-is-false : (x : bool) → is-false x → ¬ (is-true x)
+is-not-true-is-false true () f
+is-not-true-is-false false t ()
-### A boolean must be either true or false
+is-false-is-not-true : (x : bool) → ¬ (is-true x) → is-false x
+is-false-is-not-true true np = ex-falso (np refl)
+is-false-is-not-true false np = refl
-```agda
is-true-is-not-false : (x : bool) → ¬ (is-false x) → is-true x
-is-true-is-not-false true _ = refl
-is-true-is-not-false false ¬false = ex-falso (¬false refl)
-
-is-false-is-not-true : (x : bool) → ¬ (is-true x) → is-false x
-is-false-is-not-true true ¬true = ex-falso (¬true refl)
-is-false-is-not-true false _ = refl
+is-true-is-not-false true np = refl
+is-true-is-not-false false np = ex-falso (np refl)
+
+contrapositive-is-true-bool :
+ {x y : bool} → (is-true x → is-true y) → is-false y → is-false x
+contrapositive-is-true-bool {x} f refl =
+ is-false-is-not-true x (neq-false-true-bool ∘ f)
+
+contrapositive-is-false-bool :
+ {x y : bool} → (is-false x → is-false y) → is-true y → is-true x
+contrapositive-is-false-bool {x} f refl =
+ is-true-is-not-false x (neq-true-false-bool ∘ f)
```
### The type of booleans is equivalent to `Fin 2`
@@ -310,37 +327,6 @@ pr1 bool-Finite-Type = bool
pr2 bool-Finite-Type = is-finite-bool
```
-### Boolean negation has no fixed points
-
-```agda
-neq-neg-bool : (b : bool) → b ≠ neg-bool b
-neq-neg-bool true ()
-neq-neg-bool false ()
-
-neq-neg-bool' : (b : bool) → neg-bool b ≠ b
-neq-neg-bool' b = neq-neg-bool b ∘ inv
-```
-
-### Boolean negation is an involution
-
-```agda
-is-involution-neg-bool : is-involution neg-bool
-is-involution-neg-bool true = refl
-is-involution-neg-bool false = refl
-```
-
-### Boolean negation is an equivalence
-
-```agda
-abstract
- is-equiv-neg-bool : is-equiv neg-bool
- is-equiv-neg-bool = is-equiv-is-involution is-involution-neg-bool
-
-equiv-neg-bool : bool ≃ bool
-pr1 equiv-neg-bool = neg-bool
-pr2 equiv-neg-bool = is-equiv-neg-bool
-```
-
### The constant function `const bool b` is not an equivalence
```agda
diff --git a/src/foundation/cantors-theorem.lagda.md b/src/foundation/cantors-theorem.lagda.md
index 499ebf65d6..1ec52a1179 100644
--- a/src/foundation/cantors-theorem.lagda.md
+++ b/src/foundation/cantors-theorem.lagda.md
@@ -16,16 +16,14 @@ open import foundation.function-extensionality
open import foundation.logical-equivalences
open import foundation.negation
open import foundation.powersets
-open import foundation.propositional-truncations
open import foundation.surjective-maps
open import foundation.universe-levels
-open import foundation-core.empty-types
open import foundation-core.fibers-of-maps
-open import foundation-core.propositions
open import logic.de-morgan-propositions
open import logic.de-morgan-subtypes
+open import logic.double-negation-dense-maps
open import logic.double-negation-stable-subtypes
```
@@ -42,6 +40,11 @@ shows that there is [no](foundation-core.negation.md)
¬ (A ↠ 𝒫(A))
```
+In fact, no map `A → PA` into a
+[complement](foundation.complements-subtypes.md)-closed
+[subset](foundation-core.subtypes.md) `PA` of the powerset may be
+[double negation dense](logic.double-negation-dense-maps.md).
+
## Theorem
**Proof.** The proof is an instance of an argument _by diagonalization_. Given a
@@ -79,15 +82,19 @@ module _
not-in-image-subtype-theorem-Cantor (ξ , α) =
no-fixed-points-neg-Prop (f ξ ξ) (iff-eq (htpy-eq α ξ))
- abstract
+ theorem-double-negation-dense-Cantor : ¬ (is-double-negation-dense-map f)
+ theorem-double-negation-dense-Cantor H =
+ H subtype-theorem-Cantor not-in-image-subtype-theorem-Cantor
+
theorem-Cantor : ¬ (is-surjective f)
- theorem-Cantor H =
- apply-universal-property-trunc-Prop
- ( H subtype-theorem-Cantor)
- ( empty-Prop)
- ( not-in-image-subtype-theorem-Cantor)
+ theorem-Cantor =
+ map-neg
+ ( is-double-negation-dense-map-is-surjective)
+ ( theorem-double-negation-dense-Cantor)
```
+## Alternative statements
+
### Cantor's theorem for the set of decidable subtypes
**Statement.** There is no surjective map from a type `X` to its set of
@@ -109,13 +116,17 @@ module _
( f x x)
( iff-eq (ap prop-Decidable-Prop (htpy-eq α x)))
- abstract
- theorem-decidable-Cantor : ¬ (is-surjective f)
- theorem-decidable-Cantor H =
- apply-universal-property-trunc-Prop
- ( H map-theorem-decidable-Cantor)
- ( empty-Prop)
- ( not-in-image-map-theorem-decidable-Cantor)
+ theorem-double-negation-dense-decidable-Cantor :
+ ¬ (is-double-negation-dense-map f)
+ theorem-double-negation-dense-decidable-Cantor H =
+ H map-theorem-decidable-Cantor not-in-image-map-theorem-decidable-Cantor
+
+ theorem-decidable-Cantor :
+ ¬ (is-surjective f)
+ theorem-decidable-Cantor =
+ map-neg
+ ( is-double-negation-dense-map-is-surjective)
+ ( theorem-double-negation-dense-decidable-Cantor)
```
### Cantor's theorem for the set of double negation stable subtypes
@@ -141,13 +152,18 @@ module _
( f x x)
( iff-eq (ap prop-Double-Negation-Stable-Prop (htpy-eq α x)))
- abstract
- theorem-double-negation-stable-Cantor : ¬ (is-surjective f)
- theorem-double-negation-stable-Cantor H =
- apply-universal-property-trunc-Prop
- ( H map-theorem-double-negation-stable-Cantor)
- ( empty-Prop)
- ( not-in-image-map-theorem-double-negation-stable-Cantor)
+ theorem-double-negation-dense-double-negation-stable-Cantor :
+ ¬ (is-double-negation-dense-map f)
+ theorem-double-negation-dense-double-negation-stable-Cantor H =
+ H map-theorem-double-negation-stable-Cantor
+ not-in-image-map-theorem-double-negation-stable-Cantor
+
+ theorem-double-negation-stable-Cantor :
+ ¬ (is-surjective f)
+ theorem-double-negation-stable-Cantor =
+ map-neg
+ is-double-negation-dense-map-is-surjective
+ theorem-double-negation-dense-double-negation-stable-Cantor
```
### Cantor's theorem for the set of De Morgan subtypes
@@ -171,13 +187,17 @@ module _
( f x x)
( iff-eq (ap prop-De-Morgan-Prop (htpy-eq α x)))
- abstract
- theorem-de-morgan-Cantor : ¬ (is-surjective f)
- theorem-de-morgan-Cantor H =
- apply-universal-property-trunc-Prop
- ( H map-theorem-de-morgan-Cantor)
- ( empty-Prop)
- ( not-in-image-map-theorem-de-morgan-Cantor)
+ theorem-double-negation-dense-de-morgan-Cantor :
+ ¬ (is-double-negation-dense-map f)
+ theorem-double-negation-dense-de-morgan-Cantor H =
+ H map-theorem-de-morgan-Cantor not-in-image-map-theorem-de-morgan-Cantor
+
+ theorem-de-morgan-Cantor :
+ ¬ (is-surjective f)
+ theorem-de-morgan-Cantor =
+ map-neg
+ is-double-negation-dense-map-is-surjective
+ theorem-double-negation-dense-de-morgan-Cantor
```
## References
diff --git a/src/foundation/decidable-dependent-function-types.lagda.md b/src/foundation/decidable-dependent-function-types.lagda.md
index c63c6ddeea..9897f344d7 100644
--- a/src/foundation/decidable-dependent-function-types.lagda.md
+++ b/src/foundation/decidable-dependent-function-types.lagda.md
@@ -7,9 +7,14 @@ module foundation.decidable-dependent-function-types where
Imports
```agda
+open import foundation.decidable-propositions
open import foundation.decidable-types
+open import foundation.dependent-pair-types
open import foundation.functoriality-dependent-function-types
+open import foundation.irrefutable-equality
open import foundation.maybe
+open import foundation.mere-equality
+open import foundation.propositions
open import foundation.uniformly-decidable-type-families
open import foundation.universal-property-coproduct-types
open import foundation.universal-property-maybe
@@ -19,7 +24,8 @@ open import foundation-core.coproduct-types
open import foundation-core.empty-types
open import foundation-core.equivalences
open import foundation-core.function-types
-open import foundation-core.negation
+
+open import logic.propositionally-decidable-types
```
@@ -46,6 +52,29 @@ is-decidable-Π-uniformly-decidable-family (inl a) (inr b) =
inr (λ f → b a (f a))
is-decidable-Π-uniformly-decidable-family (inr na) _ =
inl (ex-falso ∘ na)
+
+abstract
+ is-decidable-prop-Π-uniformly-decidable-family :
+ {l1 l2 : Level} {A : UU l1} {B : A → UU l2} →
+ is-decidable A →
+ is-uniformly-decidable-family B →
+ ((x : A) → is-prop (B x)) →
+ is-decidable-prop ((a : A) → (B a))
+ is-decidable-prop-Π-uniformly-decidable-family dA dB H =
+ ( is-prop-Π H , is-decidable-Π-uniformly-decidable-family dA dB)
+
+abstract
+ is-decidable-prop-Π-uniformly-decidable-family' :
+ {l1 l2 : Level} {A : UU l1} {B : A → UU l2} →
+ is-inhabited-or-empty A →
+ is-uniformly-decidable-family B →
+ ((x : A) → is-prop (B x)) →
+ is-decidable-prop ((a : A) → (B a))
+ is-decidable-prop-Π-uniformly-decidable-family' {A = A} {B} dA dB H =
+ elim-is-inhabited-or-empty-Prop'
+ ( is-decidable-prop-Prop ((a : A) → (B a)))
+ ( λ d → is-decidable-prop-Π-uniformly-decidable-family d dB H)
+ ( dA)
```
### Decidablitilty of dependent products over coproducts
@@ -76,6 +105,53 @@ is-decidable-Π-Maybe {B = B} du de =
( is-decidable-product du de)
```
+### Dependent products of decidable propositions over a base with all elements merely equal are decidable propositions
+
+Assuming that all elements are merely equal in a type `A` then a dependent
+product of decidable propositions over `A` is again a decidable proposition.
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} (B : A → Decidable-Prop l2)
+ where
+
+ is-decidable-Π-all-elements-merely-equal-base :
+ all-elements-merely-equal A →
+ is-decidable A →
+ is-decidable ((x : A) → type-Decidable-Prop (B x))
+ is-decidable-Π-all-elements-merely-equal-base H dA =
+ is-decidable-Π-uniformly-decidable-family dA
+ ( is-uniformly-decidable-family-all-elements-merely-equal-base
+ ( H)
+ ( λ x → is-decidable-Decidable-Prop (B x))
+ ( dA))
+
+ is-decidable-prop-Π-all-elements-merely-equal-base :
+ all-elements-merely-equal A →
+ is-decidable A →
+ is-decidable-prop ((x : A) → type-Decidable-Prop (B x))
+ is-decidable-prop-Π-all-elements-merely-equal-base H dA =
+ is-decidable-prop-Π-uniformly-decidable-family dA
+ ( is-uniformly-decidable-family-all-elements-merely-equal-base
+ ( H)
+ ( λ x → is-decidable-Decidable-Prop (B x))
+ ( dA))
+ ( λ x → is-prop-type-Decidable-Prop (B x))
+
+ is-decidable-prop-Π-all-elements-merely-equal-base' :
+ all-elements-merely-equal A →
+ is-inhabited-or-empty A →
+ is-decidable-prop ((x : A) → type-Decidable-Prop (B x))
+ is-decidable-prop-Π-all-elements-merely-equal-base' H dA =
+ is-decidable-prop-Π-uniformly-decidable-family' dA
+ ( is-uniformly-decidable-family-all-elements-merely-equal-base'
+ ( H)
+ ( λ x → is-decidable-Decidable-Prop (B x))
+ ( dA)
+ ( λ x → is-prop-type-Decidable-Prop (B x)))
+ ( λ x → is-prop-type-Decidable-Prop (B x))
+```
+
### Decidability of dependent products over an equivalence
```agda
diff --git a/src/foundation/decidable-dependent-pair-types.lagda.md b/src/foundation/decidable-dependent-pair-types.lagda.md
index 9bdeaf4e8b..401e13a607 100644
--- a/src/foundation/decidable-dependent-pair-types.lagda.md
+++ b/src/foundation/decidable-dependent-pair-types.lagda.md
@@ -9,7 +9,11 @@ module foundation.decidable-dependent-pair-types where
```agda
open import foundation.decidable-types
open import foundation.dependent-pair-types
+open import foundation.double-negation-dense-equality
+open import foundation.irrefutable-equality
open import foundation.maybe
+open import foundation.propositional-truncations
+open import foundation.transport-along-identifications
open import foundation.type-arithmetic-coproduct-types
open import foundation.type-arithmetic-unit-type
open import foundation.uniformly-decidable-type-families
@@ -20,6 +24,8 @@ open import foundation-core.equivalences
open import foundation-core.function-types
open import foundation-core.functoriality-dependent-pair-types
open import foundation-core.negation
+
+open import logic.propositionally-decidable-types
```
@@ -32,6 +38,21 @@ We describe conditions under which
## Properties
+### Decidability of dependent sums over equivalences
+
+```agda
+module _
+ {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {C : A → UU l3} {D : B → UU l4}
+ (e : A ≃ B) (f : (x : A) → C x ≃ D (map-equiv e x))
+ where
+
+ is-decidable-Σ-equiv : is-decidable (Σ A C) → is-decidable (Σ B D)
+ is-decidable-Σ-equiv = is-decidable-equiv' (equiv-Σ D e f)
+
+ is-decidable-Σ-equiv' : is-decidable (Σ B D) → is-decidable (Σ A C)
+ is-decidable-Σ-equiv' = is-decidable-equiv (equiv-Σ D e f)
+```
+
### Dependent sums of a uniformly decidable family of types
```agda
@@ -66,24 +87,44 @@ is-decidable-Σ-coproduct {A = A} {B} C dA dB =
```agda
is-decidable-Σ-Maybe :
{l1 l2 : Level} {A : UU l1} {B : Maybe A → UU l2} →
- is-decidable (Σ A (B ∘ unit-Maybe)) → is-decidable (B exception-Maybe) →
+ is-decidable (Σ A (B ∘ unit-Maybe)) →
+ is-decidable (B exception-Maybe) →
is-decidable (Σ (Maybe A) B)
is-decidable-Σ-Maybe {A = A} {B} dA de =
is-decidable-Σ-coproduct B dA
( is-decidable-equiv (left-unit-law-Σ (B ∘ inr)) de)
```
-### Decidability of dependent sums over equivalences
+### Decidability of dependent sums over bases with double negation dense equality
+
+This is a special case of the more general fact that a type has decidable sums
+if and only if its totally separated reflection does, and totally separated
+types have double negation stable equality.
+[`TypeTopology.TotallySeparated`](http://martinescardo.github.io/TypeTopology/TypeTopology.TotallySeparated.html)
+{{#cite TypeTopology}}
```agda
module _
- {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {C : A → UU l3} {D : B → UU l4}
- (e : A ≃ B) (f : (x : A) → C x ≃ D (map-equiv e x))
+ {l1 l2 : Level} {A : UU l1} {B : A → UU l2}
+ (H : has-double-negation-dense-equality A)
where
- is-decidable-Σ-equiv : is-decidable (Σ A C) → is-decidable (Σ B D)
- is-decidable-Σ-equiv = is-decidable-equiv' (equiv-Σ D e f)
-
- is-decidable-Σ-equiv' : is-decidable (Σ B D) → is-decidable (Σ A C)
- is-decidable-Σ-equiv' = is-decidable-equiv (equiv-Σ D e f)
+ is-inhabited-or-empty-Σ-has-double-negation-dense-equality-base :
+ is-inhabited-or-empty A →
+ ((x : A) → is-inhabited-or-empty (B x)) →
+ is-inhabited-or-empty (Σ A B)
+ is-inhabited-or-empty-Σ-has-double-negation-dense-equality-base dA dB =
+ elim-is-inhabited-or-empty-Prop
+ ( is-inhabited-or-empty-Prop (Σ A B))
+ ( λ a →
+ elim-is-inhabited-or-empty-Prop
+ ( is-inhabited-or-empty-Prop (Σ A B))
+ ( λ b → inl (unit-trunc-Prop (a , b)))
+ ( λ nb → inr (λ x → H (pr1 x) a (λ p → nb (tr B p (pr2 x)))))
+ ( dB a))
+ ( λ na → inr (map-neg pr1 na))
+ ( dA)
```
+
+See [`foundation.decidable-types`](foundation.decidable-types.md) for the
+untruncated version.
diff --git a/src/foundation/decidable-maps.lagda.md b/src/foundation/decidable-maps.lagda.md
index 926253c0dc..aae4c0c21e 100644
--- a/src/foundation/decidable-maps.lagda.md
+++ b/src/foundation/decidable-maps.lagda.md
@@ -13,8 +13,10 @@ open import foundation.coproduct-types
open import foundation.decidable-equality
open import foundation.decidable-types
open import foundation.dependent-pair-types
+open import foundation.embeddings
open import foundation.functoriality-cartesian-product-types
open import foundation.functoriality-coproduct-types
+open import foundation.hilbert-epsilon-operators-maps
open import foundation.identity-types
open import foundation.retracts-of-maps
open import foundation.universe-levels
@@ -81,7 +83,7 @@ module _
### Decidable maps are closed under homotopy
```agda
-abstract
+opaque
is-decidable-map-htpy :
{l1 l2 : Level} {A : UU l1} {B : UU l2} {f g : A → B} →
f ~ g → is-decidable-map g → is-decidable-map f
@@ -279,3 +281,56 @@ module _
( retract-fiber-retract-map f g R x)
( G (map-codomain-inclusion-retract-map f g R x))
```
+
+### Decidable maps have Hilbert ε-operators
+
+A decidable map `f` induces "eliminators" on the propositional truncations of
+its fibers
+
+```text
+ ε : (x : A) → ║ fiber f x ║₋₁ → fiber f x.
+```
+
+Such "eliminators" are called
+[Hilbert ε-operators](foundation.hilbert-epsilon-operators-maps.md), or _split
+supports_.
+
+```agda
+ε-operator-map-is-decidable-map :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} →
+ is-decidable-map f → ε-operator-map f
+ε-operator-map-is-decidable-map F = ε-operator-is-decidable ∘ F
+```
+
+### Decidable injective maps are embeddings
+
+**Proof.** Given a decidable map `f : A → B` then `f` decomposes
+`B ≃ (im f) + B∖(im f)`. Restricting to `im f` we have a section given by the
+Hilbert ε-operator on `f`. Now, by injectivity of `f` we know this restriction
+map is an equivalence. Hence, `f` is a composite of embeddings and so must be an
+embedding as well.
+
+```text
+ im f ╰────→ im f + B\(im f)
+ ↟ ⋮ │
+ │ ⋮ ~ │ ~
+ │ ↓ f ↓
+ A ────────────→ B
+```
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B}
+ where
+
+ is-emb-is-injective-is-decidable-map :
+ is-decidable-map f → is-injective f → is-emb f
+ is-emb-is-injective-is-decidable-map H K =
+ is-emb-is-injective-ε-operator-map (ε-operator-map-is-decidable-map H) K
+```
+
+There is also an analogous proof using the double negation image. This analogous
+proof avoids the use of propositional truncations, but cannot be included here
+due to introducing cyclic dependencies. See
+[`foundation.double-negation-images`](foundation.double-negation-images.md)
+instead.
diff --git a/src/foundation/decidable-propositions.lagda.md b/src/foundation/decidable-propositions.lagda.md
index a9c4e42e28..8215e2af78 100644
--- a/src/foundation/decidable-propositions.lagda.md
+++ b/src/foundation/decidable-propositions.lagda.md
@@ -11,8 +11,10 @@ open import foundation-core.decidable-propositions public
```agda
open import foundation.action-on-identifications-functions
open import foundation.booleans
+open import foundation.decidable-equality
open import foundation.decidable-types
open import foundation.dependent-pair-types
+open import foundation.discrete-types
open import foundation.embeddings
open import foundation.empty-types
open import foundation.equivalences
@@ -124,15 +126,18 @@ module _
( map-equiv-bool-Decidable-Prop ,
is-equiv-map-equiv-bool-Decidable-Prop)
+ bool-Decidable-Prop : Decidable-Prop l → bool
+ bool-Decidable-Prop = map-equiv equiv-bool-Decidable-Prop
+
abstract
compute-equiv-bool-Decidable-Prop :
(P : Decidable-Prop l) →
type-Decidable-Prop P ≃ (map-equiv equiv-bool-Decidable-Prop P = true)
- compute-equiv-bool-Decidable-Prop (pair P (pair H (inl p))) =
+ compute-equiv-bool-Decidable-Prop (P , H , inl p) =
equiv-is-contr
( is-proof-irrelevant-is-prop H p)
( is-proof-irrelevant-is-prop (is-set-bool true true) refl)
- compute-equiv-bool-Decidable-Prop (pair P (pair H (inr np))) =
+ compute-equiv-bool-Decidable-Prop (P , H , inr np) =
equiv-is-empty np neq-false-true-bool
```
@@ -168,6 +173,21 @@ pr2 (iff-universes-Decidable-Prop l l' P) p =
( p)))
```
+### The type of decidable propositions in any universe is discrete
+
+```agda
+has-decidable-equality-Decidable-Prop :
+ {l : Level} → has-decidable-equality (Decidable-Prop l)
+has-decidable-equality-Decidable-Prop =
+ has-decidable-equality-equiv
+ ( equiv-bool-Decidable-Prop)
+ ( has-decidable-equality-bool)
+
+Decidable-Prop-Discrete-Type : (l : Level) → Discrete-Type (lsuc l)
+Decidable-Prop-Discrete-Type l =
+ ( Decidable-Prop l , has-decidable-equality-Decidable-Prop)
+```
+
### The type of decidable propositions in any universe is a set
```agda
diff --git a/src/foundation/decidable-subtypes.lagda.md b/src/foundation/decidable-subtypes.lagda.md
index 826dc8bc01..f79d378a3c 100644
--- a/src/foundation/decidable-subtypes.lagda.md
+++ b/src/foundation/decidable-subtypes.lagda.md
@@ -161,14 +161,14 @@ module _
( is-decidable-emb-map-decidable-emb f)
( y)
- compute-type-decidable-type-decidable-emb :
+ compute-type-decidable-subtype-decidable-emb :
type-decidable-subtype decidable-subtype-decidable-emb ≃ X
- compute-type-decidable-type-decidable-emb =
+ compute-type-decidable-subtype-decidable-emb =
equiv-total-fiber (map-decidable-emb f)
- inv-compute-type-decidable-type-decidable-emb :
+ inv-compute-type-decidable-subtype-decidable-emb :
X ≃ type-decidable-subtype decidable-subtype-decidable-emb
- inv-compute-type-decidable-type-decidable-emb =
+ inv-compute-type-decidable-subtype-decidable-emb =
inv-equiv-total-fiber (map-decidable-emb f)
```
diff --git a/src/foundation/decidable-type-families.lagda.md b/src/foundation/decidable-type-families.lagda.md
new file mode 100644
index 0000000000..60b3093236
--- /dev/null
+++ b/src/foundation/decidable-type-families.lagda.md
@@ -0,0 +1,174 @@
+# Decidable type families
+
+```agda
+module foundation.decidable-type-families where
+```
+
+Imports
+
+```agda
+open import foundation.coproduct-types
+open import foundation.decidable-subtypes
+open import foundation.decidable-types
+open import foundation.dependent-pair-types
+open import foundation.double-negation
+open import foundation.double-negation-dense-equality
+open import foundation.irrefutable-equality
+open import foundation.negation
+open import foundation.propositions
+open import foundation.transport-along-identifications
+open import foundation.universe-levels
+
+open import foundation-core.function-types
+open import foundation-core.identity-types
+```
+
+
+
+## Idea
+
+A type family `B : A → 𝒰` is said to be
+{{#concept "decidable" Disambiguation="type family" Agda=is-decidable-family}}
+if we can for every `x : A` either construct an element of `B x` or we can prove
+that it is [empty](foundation-core.empty-types.md). In other words, we interpret
+decidability via the
+[Curry–Howard interpretation](https://en.wikipedia.org/wiki/Curry–Howard_correspondence)
+of logic into type theory. A related concept is that a type family is either
+[inhabited](foundation.inhabited-types.md) or empty, where inhabitedness of a
+type is expressed using the
+[propositional truncation](foundation.propositional-truncations.md).
+
+## Definitions
+
+### The Curry–Howard interpretation of decidability
+
+```agda
+is-decidable-family : {l1 l2 : Level} {A : UU l1} (P : A → UU l2) → UU (l1 ⊔ l2)
+is-decidable-family {A = A} P = (x : A) → is-decidable (P x)
+
+decidable-family : {l1 : Level} (l2 : Level) → UU l1 → UU (l1 ⊔ lsuc l2)
+decidable-family l2 A = Σ (A → UU l2) is-decidable-family
+
+module _
+ {l1 l2 : Level} {A : UU l1} (P : decidable-family l2 A)
+ where
+
+ family-decidable-family : A → UU l2
+ family-decidable-family = pr1 P
+
+ is-decidable-decidable-family : is-decidable-family family-decidable-family
+ is-decidable-decidable-family = pr2 P
+```
+
+### The underlying decidable type family of a decidable subtype
+
+```agda
+decidable-family-decidable-subtype :
+ {l1 l2 : Level} {A : UU l1} → decidable-subtype l2 A → decidable-family l2 A
+decidable-family-decidable-subtype P =
+ ( is-in-decidable-subtype P , is-decidable-decidable-subtype P)
+```
+
+## Properties
+
+### Base change of decidable type families
+
+```agda
+module _
+ {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} (P : decidable-family l3 B)
+ where
+
+ base-change-decidable-family : (f : A → B) → decidable-family l3 A
+ base-change-decidable-family f =
+ ( family-decidable-family P ∘ f , is-decidable-decidable-family P ∘ f)
+```
+
+### The negation of a decidable family is decidable
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} (P : decidable-family l2 A)
+ where
+
+ is-decidable-neg-decidable-family :
+ is-decidable-family (λ x → ¬ (family-decidable-family P x))
+ is-decidable-neg-decidable-family =
+ is-decidable-neg ∘ is-decidable-decidable-family P
+
+ neg-decidable-family : decidable-family l2 A
+ neg-decidable-family =
+ ( ( λ x → ¬ (family-decidable-family P x)) ,
+ is-decidable-neg-decidable-family)
+```
+
+### Composition of decidable families
+
+Given a decidable family of types with double negation dense equality
+`P : A → 𝒰` and a decidable type family `Q : (x : A) → P x → 𝒰` then, via
+[type duality](foundation.type-duality.md) we may _compose_ `Q` after `P` and
+obtain a decidable type family `Q ∘ P : A → 𝒰`, defined on elements as
+[dependent pair types](foundation.dependent-pair-types.md).
+
+```text
+ (Q ∘ P) x := Σ (y : P x), (Q x y).
+```
+
+```agda
+module _
+ {l1 l2 l3 : Level} {A : UU l1}
+ where
+
+ is-decidable-comp-decidable-family-has-double-negation-dense-equality :
+ (P : decidable-family l2 A)
+ (Q : (x : A) → decidable-family l3 (family-decidable-family P x)) →
+ ( (x : A) →
+ has-double-negation-dense-equality (family-decidable-family P x)) →
+ is-decidable-family
+ ( λ x → Σ (family-decidable-family P x) (family-decidable-family (Q x)))
+ is-decidable-comp-decidable-family-has-double-negation-dense-equality
+ P Q H x =
+ rec-coproduct
+ ( λ p →
+ rec-coproduct
+ ( λ q → inl (p , q))
+ (λ nq →
+ inr
+ ( λ q →
+ H ( x)
+ ( p)
+ ( pr1 q)
+ ( λ r →
+ nq (tr (family-decidable-family (Q x)) (inv r) (pr2 q)))))
+ ( is-decidable-decidable-family (Q x) p))
+ ( λ np → inr (map-neg pr1 np))
+ ( is-decidable-decidable-family P x)
+
+ comp-decidable-family-has-double-negation-dense-equality :
+ (P : decidable-family l2 A) →
+ ( (x : A) → decidable-family l3 (family-decidable-family P x)) →
+ ( (x : A) →
+ has-double-negation-dense-equality (family-decidable-family P x)) →
+ decidable-family (l2 ⊔ l3) A
+ comp-decidable-family-has-double-negation-dense-equality P Q H =
+ ( λ x → Σ (family-decidable-family P x) (family-decidable-family (Q x))) ,
+ ( is-decidable-comp-decidable-family-has-double-negation-dense-equality
+ ( P)
+ ( Q)
+ ( H))
+
+ comp-decidable-family-decidable-subtype :
+ (P : decidable-subtype l2 A) →
+ ((x : A) → decidable-family l3 (is-in-decidable-subtype P x)) →
+ decidable-family (l2 ⊔ l3) A
+ comp-decidable-family-decidable-subtype P Q =
+ comp-decidable-family-has-double-negation-dense-equality
+ ( decidable-family-decidable-subtype P)
+ ( Q)
+ ( λ x p q →
+ intro-double-negation
+ ( eq-is-prop (is-prop-is-in-decidable-subtype P x)))
+```
+
+## See also
+
+- [Uniformly decidable type families](foundation.uniformly-decidable-type-families.md)
diff --git a/src/foundation/decidable-types.lagda.md b/src/foundation/decidable-types.lagda.md
index 93bdd1707e..aa77d7383c 100644
--- a/src/foundation/decidable-types.lagda.md
+++ b/src/foundation/decidable-types.lagda.md
@@ -11,21 +11,25 @@ open import foundation.action-on-identifications-functions
open import foundation.coproduct-types
open import foundation.dependent-pair-types
open import foundation.double-negation
+open import foundation.double-negation-dense-equality
open import foundation.empty-types
open import foundation.equivalences
+open import foundation.evaluation-functions
+open import foundation.functoriality-coproduct-types
open import foundation.hilberts-epsilon-operators
+open import foundation.irrefutable-equality
open import foundation.logical-equivalences
open import foundation.negation
open import foundation.propositional-truncations
open import foundation.raising-universe-levels
open import foundation.retracts-of-types
+open import foundation.transport-along-identifications
open import foundation.type-arithmetic-empty-type
open import foundation.unit-type
open import foundation.universe-levels
open import foundation-core.cartesian-product-types
open import foundation-core.function-types
-open import foundation-core.propositions
open import foundation-core.retractions
open import foundation-core.sections
```
@@ -45,40 +49,13 @@ of logic into type theory. A related concept is that a type is either
type is expressed using the
[propositional truncation](foundation.propositional-truncations.md).
-## Definition
+## Definitions
### The Curry–Howard interpretation of decidability
```agda
is-decidable : {l : Level} (A : UU l) → UU l
is-decidable A = A + (¬ A)
-
-is-decidable-fam :
- {l1 l2 : Level} {A : UU l1} (P : A → UU l2) → UU (l1 ⊔ l2)
-is-decidable-fam {A = A} P = (x : A) → is-decidable (P x)
-```
-
-### The predicate that a type is inhabited or empty
-
-```agda
-is-inhabited-or-empty : {l1 : Level} → UU l1 → UU l1
-is-inhabited-or-empty A = type-trunc-Prop A + is-empty A
-```
-
-### Merely decidable types
-
-A type `A` is said to be
-{{#concept "merely decidable" Agda=is-merely-decidable}} if it comes equipped
-with an element of `║ is-decidable A ║₋₁`, or equivalently, the
-[disjunction](foundation.disjunction.md) `A ∨ ¬ A` holds.
-
-```agda
-is-merely-decidable-Prop :
- {l : Level} → UU l → Prop l
-is-merely-decidable-Prop A = trunc-Prop (is-decidable A)
-
-is-merely-decidable : {l : Level} → UU l → UU l
-is-merely-decidable A = type-trunc-Prop (is-decidable A)
```
## Examples
@@ -112,7 +89,7 @@ is-decidable-coproduct (inr na) (inr nb) = inr (rec-coproduct na nb)
is-decidable-product :
{l1 l2 : Level} {A : UU l1} {B : UU l2} →
is-decidable A → is-decidable B → is-decidable (A × B)
-is-decidable-product (inl a) (inl b) = inl (pair a b)
+is-decidable-product (inl a) (inl b) = inl (a , b)
is-decidable-product (inl a) (inr g) = inr (g ∘ pr2)
is-decidable-product (inr f) (inl b) = inr (f ∘ pr1)
is-decidable-product (inr f) (inr g) = inr (f ∘ pr1)
@@ -120,22 +97,21 @@ is-decidable-product (inr f) (inr g) = inr (f ∘ pr1)
is-decidable-product' :
{l1 l2 : Level} {A : UU l1} {B : UU l2} →
is-decidable A → (A → is-decidable B) → is-decidable (A × B)
-is-decidable-product' (inl a) d with d a
-... | inl b = inl (pair a b)
-... | inr nb = inr (nb ∘ pr2)
+is-decidable-product' (inl a) d =
+ rec-coproduct (λ b → inl (a , b)) (λ nb → inr (nb ∘ pr2)) (d a)
is-decidable-product' (inr na) d = inr (na ∘ pr1)
is-decidable-left-factor :
{l1 l2 : Level} {A : UU l1} {B : UU l2} →
is-decidable (A × B) → B → is-decidable A
-is-decidable-left-factor (inl (pair x y)) b = inl x
-is-decidable-left-factor (inr f) b = inr (λ a → f (pair a b))
+is-decidable-left-factor (inl (x , y)) b = inl x
+is-decidable-left-factor (inr f) b = inr (λ a → f (a , b))
is-decidable-right-factor :
{l1 l2 : Level} {A : UU l1} {B : UU l2} →
is-decidable (A × B) → A → is-decidable B
-is-decidable-right-factor (inl (pair x y)) a = inl y
-is-decidable-right-factor (inr f) a = inr (λ b → f (pair a b))
+is-decidable-right-factor (inl (x , y)) a = inl y
+is-decidable-right-factor (inr f) a = inr (λ b → f (a , b))
```
### Function types of decidable types are decidable
@@ -144,16 +120,15 @@ is-decidable-right-factor (inr f) a = inr (λ b → f (pair a b))
is-decidable-function-type :
{l1 l2 : Level} {A : UU l1} {B : UU l2} →
is-decidable A → is-decidable B → is-decidable (A → B)
-is-decidable-function-type (inl a) (inl b) = inl (λ x → b)
-is-decidable-function-type (inl a) (inr g) = inr (λ h → g (h a))
+is-decidable-function-type (inl a) (inl b) = inl (λ _ → b)
+is-decidable-function-type (inl a) (inr nb) = inr (map-neg (ev a) nb)
is-decidable-function-type (inr f) _ = inl (ex-falso ∘ f)
is-decidable-function-type' :
{l1 l2 : Level} {A : UU l1} {B : UU l2} →
is-decidable A → (A → is-decidable B) → is-decidable (A → B)
-is-decidable-function-type' (inl a) d with d a
-... | inl b = inl (λ x → b)
-... | inr nb = inr (λ f → nb (f a))
+is-decidable-function-type' (inl a) d =
+ rec-coproduct (λ b → inl (λ _ → b)) (λ nb → inr (map-neg (ev a) nb)) (d a)
is-decidable-function-type' (inr na) d = inl (ex-falso ∘ na)
```
@@ -165,6 +140,14 @@ is-decidable-neg :
is-decidable-neg d = is-decidable-function-type d is-decidable-empty
```
+### The double negation of a decidable type is decidable
+
+```agda
+is-decidable-double-negation :
+ {l : Level} {A : UU l} → is-decidable A → is-decidable (¬¬ A)
+is-decidable-double-negation d = is-decidable-neg (is-decidable-neg d)
+```
+
### Decidable types are closed under coinhabited types
```agda
@@ -279,38 +262,28 @@ See also
### Decidable types have ε-operators
```agda
-elim-trunc-Prop-is-decidable :
+ε-operator-is-decidable :
{l : Level} {A : UU l} → is-decidable A → ε-operator-Hilbert A
-elim-trunc-Prop-is-decidable (inl a) x = a
-elim-trunc-Prop-is-decidable (inr f) x =
+ε-operator-is-decidable (inl a) x = a
+ε-operator-is-decidable (inr f) x =
ex-falso (apply-universal-property-trunc-Prop x empty-Prop f)
```
### `is-decidable` is an idempotent operation
```agda
-idempotent-is-decidable :
- {l : Level} (P : UU l) → is-decidable (is-decidable P) → is-decidable P
-idempotent-is-decidable P (inl (inl p)) = inl p
-idempotent-is-decidable P (inl (inr np)) = inr np
-idempotent-is-decidable P (inr np) = inr (λ p → np (inl p))
-```
+module _
+ {l : Level} {P : UU l}
+ where
-### Being inhabited or empty is a proposition
+ map-idempotent-is-decidable : is-decidable P → is-decidable (is-decidable P)
+ map-idempotent-is-decidable = inl
-```agda
-abstract
- is-property-is-inhabited-or-empty :
- {l1 : Level} (A : UU l1) → is-prop (is-inhabited-or-empty A)
- is-property-is-inhabited-or-empty A =
- is-prop-coproduct
- ( λ t → apply-universal-property-trunc-Prop t empty-Prop)
- ( is-prop-type-trunc-Prop)
- ( is-prop-neg)
-
-is-inhabited-or-empty-Prop : {l1 : Level} → UU l1 → Prop l1
-pr1 (is-inhabited-or-empty-Prop A) = is-inhabited-or-empty A
-pr2 (is-inhabited-or-empty-Prop A) = is-property-is-inhabited-or-empty A
+ map-inv-idempotent-is-decidable :
+ is-decidable (is-decidable P) → is-decidable P
+ map-inv-idempotent-is-decidable (inl (inl p)) = inl p
+ map-inv-idempotent-is-decidable (inl (inr np)) = inr np
+ map-inv-idempotent-is-decidable (inr np) = inr (λ p → np (inl p))
```
### Any inhabited type is a fixed point for `is-decidable`
@@ -322,60 +295,36 @@ is-fixed-point-is-decidable-is-inhabited {l} {X} t =
right-unit-law-coproduct-is-empty X (¬ X) (is-nonempty-is-inhabited t)
```
-### Raising universe level conserves decidability
+### The dependent sum of a family of decidable propositions over a decidable base with double negation dense equality is decidable
-```agda
-module _
- (l : Level) {l1 : Level} (A : UU l1)
- where
-
- is-decidable-raise : is-decidable A → is-decidable (raise l A)
- is-decidable-raise = is-decidable-equiv' (compute-raise l A)
-```
-
-### Decidable types are inhabited or empty
-
-```agda
-is-inhabited-or-empty-is-decidable :
- {l : Level} {A : UU l} → is-decidable A → is-inhabited-or-empty A
-is-inhabited-or-empty-is-decidable (inl x) = inl (unit-trunc-Prop x)
-is-inhabited-or-empty-is-decidable (inr y) = inr y
-```
-
-### Decidable types are merely decidable
+This is a special case of the more general fact that a type has decidable sums
+if and only if its totally separated reflection does, and totally separated
+types have double negation stable equality. {{#cite TypeTopology}}
```agda
-is-merely-decidable-is-decidable :
- {l : Level} {A : UU l} → is-decidable A → is-merely-decidable A
-is-merely-decidable-is-decidable = unit-trunc-Prop
+is-decidable-Σ-has-double-negation-dense-equality-base :
+ {l1 l2 : Level} {P : UU l1} {Q : P → UU l2} →
+ has-double-negation-dense-equality P →
+ is-decidable P →
+ ((x : P) → is-decidable (Q x)) → is-decidable (Σ P Q)
+is-decidable-Σ-has-double-negation-dense-equality-base {Q = Q} hP (inl p) dQ =
+ map-coproduct
+ ( pair p)
+ ( λ nq pq → hP (pr1 pq) p (λ r → nq (tr Q r (pr2 pq))))
+ ( dQ p)
+is-decidable-Σ-has-double-negation-dense-equality-base hP (inr np) _ =
+ inr (map-neg pr1 np)
```
-### Types are inhabited or empty if and only if they are merely decidable
+### Raising universe level preserves decidability
```agda
module _
- {l : Level} {A : UU l}
+ (l : Level) {l1 : Level} (A : UU l1)
where
- is-inhabited-or-empty-is-merely-decidable :
- is-merely-decidable A → is-inhabited-or-empty A
- is-inhabited-or-empty-is-merely-decidable =
- rec-trunc-Prop
- ( is-inhabited-or-empty-Prop A)
- ( is-inhabited-or-empty-is-decidable)
-
- is-merely-decidable-is-inhabited-or-empty :
- is-inhabited-or-empty A → is-merely-decidable A
- is-merely-decidable-is-inhabited-or-empty (inl |x|) =
- rec-trunc-Prop (is-merely-decidable-Prop A) (unit-trunc-Prop ∘ inl) |x|
- is-merely-decidable-is-inhabited-or-empty (inr y) =
- unit-trunc-Prop (inr y)
-
- iff-is-inhabited-or-empty-is-merely-decidable :
- is-merely-decidable A ↔ is-inhabited-or-empty A
- iff-is-inhabited-or-empty-is-merely-decidable =
- ( is-inhabited-or-empty-is-merely-decidable ,
- is-merely-decidable-is-inhabited-or-empty)
+ is-decidable-raise : is-decidable A → is-decidable (raise l A)
+ is-decidable-raise = is-decidable-equiv' (compute-raise l A)
```
## See also
diff --git a/src/foundation/disjoint-subtypes.lagda.md b/src/foundation/disjoint-subtypes.lagda.md
index e21739bbd5..77b37edb06 100644
--- a/src/foundation/disjoint-subtypes.lagda.md
+++ b/src/foundation/disjoint-subtypes.lagda.md
@@ -53,3 +53,7 @@ module _
disjoint-subtype B B → is-empty (type-subtype B)
is-empty-disjoint-subtype-self H (b , b∈B) = H b (b∈B , b∈B)
```
+
+## See also
+
+- [Exclusive sums](foundation.exclusive-sum.md)
diff --git a/src/foundation/disjunction.lagda.md b/src/foundation/disjunction.lagda.md
index 21a764be49..a36b44f3f7 100644
--- a/src/foundation/disjunction.lagda.md
+++ b/src/foundation/disjunction.lagda.md
@@ -10,9 +10,11 @@ module foundation.disjunction where
open import foundation.decidable-types
open import foundation.dependent-pair-types
open import foundation.functoriality-coproduct-types
+open import foundation.functoriality-propositional-truncation
open import foundation.inhabited-types
open import foundation.logical-equivalences
open import foundation.propositional-truncations
+open import foundation.type-arithmetic-coproduct-types
open import foundation.universe-levels
open import foundation-core.cartesian-product-types
@@ -22,6 +24,8 @@ open import foundation-core.empty-types
open import foundation-core.equivalences
open import foundation-core.function-types
open import foundation-core.propositions
+
+open import logic.propositionally-decidable-types
```
@@ -308,7 +312,6 @@ module _
is-decidable A → is-decidable B → is-decidable (disjunction-type A B)
is-decidable-disjunction is-decidable-A is-decidable-B =
is-decidable-trunc-Prop-is-merely-decidable
- ( A + B)
( unit-trunc-Prop (is-decidable-coproduct is-decidable-A is-decidable-B))
module _
@@ -335,6 +338,17 @@ module _
( is-decidable-Decidable-Prop Q))
```
+### Symmetry of the disjuction
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ swap-disjunction : disjunction-type A B → disjunction-type B A
+ swap-disjunction = map-trunc-Prop (map-commutative-coproduct A B)
+```
+
## See also
- The indexed counterpart to disjunction is
diff --git a/src/foundation/double-negation-dense-equality-maps.lagda.md b/src/foundation/double-negation-dense-equality-maps.lagda.md
new file mode 100644
index 0000000000..0fa5ddaa97
--- /dev/null
+++ b/src/foundation/double-negation-dense-equality-maps.lagda.md
@@ -0,0 +1,36 @@
+# Maps with double negation dense equality
+
+```agda
+module foundation.double-negation-dense-equality-maps where
+```
+
+Imports
+
+```agda
+open import foundation.double-negation-dense-equality
+open import foundation.irrefutable-equality
+open import foundation.universe-levels
+
+open import foundation-core.fibers-of-maps
+```
+
+
+
+## Idea
+
+A map `f : A → B` is said to have
+{{#concept "double negation dense equality" Disambiguation="map of types" Agda=has-double-negation-dense-equality-map}}
+if its [fibers](foundation-core.fibers-of-maps.md) have
+[double negation dense equality](foundation.irrefutable-equality.md). I.e., if
+for every `y : B` and every pair `p q : fiber f y` it is
+[irrefutable](foundation.irrefutable-propositions.md) that `p` equals `q`. In
+other words, `¬¬ (p = q)` holds.
+
+## Definitions
+
+```agda
+has-double-negation-dense-equality-map :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} → (A → B) → UU (l1 ⊔ l2)
+has-double-negation-dense-equality-map {B = B} f =
+ (y : B) → has-double-negation-dense-equality (fiber f y)
+```
diff --git a/src/foundation/double-negation-dense-equality.lagda.md b/src/foundation/double-negation-dense-equality.lagda.md
new file mode 100644
index 0000000000..bba5c1d628
--- /dev/null
+++ b/src/foundation/double-negation-dense-equality.lagda.md
@@ -0,0 +1,99 @@
+# Double negation dense equality
+
+```agda
+module foundation.double-negation-dense-equality where
+```
+
+Imports
+
+```agda
+open import foundation.action-on-identifications-functions
+open import foundation.binary-relations
+open import foundation.dependent-pair-types
+open import foundation.double-negation
+open import foundation.equality-dependent-pair-types
+open import foundation.equivalences
+open import foundation.irrefutable-equality
+open import foundation.retracts-of-types
+open import foundation.transport-along-identifications
+open import foundation.universe-levels
+
+open import foundation-core.equivalence-relations
+open import foundation-core.identity-types
+open import foundation-core.propositions
+open import foundation-core.sets
+```
+
+
+
+## Idea
+
+A type `A` is said to have
+{{#concept "double negation dense equality" Agda=has-double-negation-dense-equality}}
+if for every two elements `x` and `y` in `A`, it is
+[irrefutable](logic.irrefutable-types.md) that `x` and `y` are
+[equal](foundation-core.identity-types.md). In other words, if all elements of
+`A` are [irrefutably equal](foundation.irrefutable-equality.md).
+
+**Terminology.** The term _dense_ used here is in the sense of dense with
+respect to a
+[reflective subuniverse](orthogonal-factorization-systems.reflective-global-subuniverses.md)/[modality](orthogonal-factorization-systems.higher-modalities.md),
+or connected. Here, it means that the double negation of the identity types of
+the relevant type are contractible. Since negations are propositions, it
+suffices that the double negation has an element.
+
+## Definitions
+
+### Types with double negation dense equality
+
+```agda
+has-double-negation-dense-equality : {l : Level} → UU l → UU l
+has-double-negation-dense-equality A = (x y : A) → irrefutable-eq x y
+```
+
+## Properties
+
+### Retracts of types with double negation dense equality
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ has-double-negation-dense-equality-retract-of :
+ B retract-of A →
+ has-double-negation-dense-equality A →
+ has-double-negation-dense-equality B
+ has-double-negation-dense-equality-retract-of (i , r , R) H x y =
+ map-double-negation (λ p → inv (R x) ∙ ap r p ∙ R y) (H (i x) (i y))
+
+ has-double-negation-dense-equality-equiv :
+ B ≃ A →
+ has-double-negation-dense-equality A → has-double-negation-dense-equality B
+ has-double-negation-dense-equality-equiv e =
+ has-double-negation-dense-equality-retract-of (retract-equiv e)
+
+ has-double-negation-dense-equality-equiv' :
+ A ≃ B →
+ has-double-negation-dense-equality A → has-double-negation-dense-equality B
+ has-double-negation-dense-equality-equiv' e =
+ has-double-negation-dense-equality-retract-of (retract-inv-equiv e)
+```
+
+### Dependent sums of types with double negation dense equality
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : A → UU l2}
+ (mA : has-double-negation-dense-equality A)
+ (mB : (x : A) → has-double-negation-dense-equality (B x))
+ where
+
+ has-double-negation-dense-equality-Σ :
+ has-double-negation-dense-equality (Σ A B)
+ has-double-negation-dense-equality-Σ x y =
+ extend-double-negation
+ ( λ p →
+ map-double-negation (eq-pair-Σ p) (mB (pr1 y) (tr B p (pr2 x)) (pr2 y)))
+ ( mA (pr1 x) (pr1 y))
+```
diff --git a/src/foundation/double-negation-images.lagda.md b/src/foundation/double-negation-images.lagda.md
new file mode 100644
index 0000000000..7fdda611c5
--- /dev/null
+++ b/src/foundation/double-negation-images.lagda.md
@@ -0,0 +1,362 @@
+# The double negation image of a map
+
+```agda
+module foundation.double-negation-images where
+```
+
+Imports
+
+```agda
+open import foundation.action-on-identifications-functions
+open import foundation.dependent-pair-types
+open import foundation.double-negation
+open import foundation.embeddings
+open import foundation.fundamental-theorem-of-identity-types
+open import foundation.hilbert-epsilon-operators-maps
+open import foundation.slice
+open import foundation.split-surjective-maps
+open import foundation.subtype-identity-principle
+open import foundation.universe-levels
+
+open import foundation-core.1-types
+open import foundation-core.commuting-triangles-of-maps
+open import foundation-core.equivalences
+open import foundation-core.fibers-of-maps
+open import foundation-core.identity-types
+open import foundation-core.injective-maps
+open import foundation-core.propositions
+open import foundation-core.sections
+open import foundation-core.sets
+open import foundation-core.subtypes
+open import foundation-core.torsorial-type-families
+open import foundation-core.truncated-types
+open import foundation-core.truncation-levels
+
+open import logic.double-negation-dense-maps
+open import logic.double-negation-eliminating-maps
+open import logic.double-negation-stable-embeddings
+```
+
+
+
+## Idea
+
+The
+{{#concept "double negation image" Disambiguation="of a map" Agda=double-negation-im}}
+of `f : A → B` is the essentially unique type that
+[factorizes](orthogonal-factorization-systems.factorizations-of-maps.md) `f` as
+a [double negation dense map](logic.double-negation-dense-maps.md) followed by a
+[double negation stable embedding](logic.double-negation-stable-embeddings.md).
+I.e., the double negation image `im'f` of `f` fits into a commuting triangle
+
+```text
+ im'f
+ ∧ \
+ l / \ r
+ / f ∨
+ A -------------> B
+```
+
+such that `l` is double negation dense, i.e., its
+[fibers](foundation-core.fibers-of-maps.md) are
+[nonempty](foundation.double-negation.md), and `r` is a double negation stable
+embedding, i.e., its fibers are [propositions](foundation-core.propositions.md)
+and satisfy the property that if they are nonempty then they are inhabited.
+
+This factorization is unique in the sense that any other commuting triangle
+
+```text
+ X
+ ∧ \
+ l'/ \ r'
+ / f ∨
+ A ------------> B
+```
+
+is uniquely equivalent to the double negation image factorization in a coherent
+manner. This is a direct consequence of the fact that double negation is a
+modality, which is shown in
+[`foundation.double-negation-modality`](foundation.double-negation-modality.md).
+
+The double negation image factorization is in one sense an approximation to the
+[image factorization](foundation.images.md) which satisfies a restricted
+universal property that only applies to
+[negative statements](foundation-core.negation.md) and does not rely on the
+existence of
+[propositional truncations](foundation.propositional-truncations.md). On the
+other hand, the double negation image inclusion `r` satisfies the additional
+property of being double negation stable, compared to the image inclusion.
+
+## Definitions
+
+```agda
+module _
+ {l1 l2 : Level} {X : UU l1} {A : UU l2} (f : A → X)
+ where
+
+ subtype-double-negation-im : subtype (l1 ⊔ l2) X
+ subtype-double-negation-im x = double-negation-type-Prop (fiber f x)
+
+ is-in-double-negation-im : X → UU (l1 ⊔ l2)
+ is-in-double-negation-im = is-in-subtype subtype-double-negation-im
+
+ double-negation-im : UU (l1 ⊔ l2)
+ double-negation-im = type-subtype subtype-double-negation-im
+
+ inclusion-double-negation-im : double-negation-im → X
+ inclusion-double-negation-im = inclusion-subtype subtype-double-negation-im
+
+ map-unit-double-negation-im : A → double-negation-im
+ map-unit-double-negation-im a = (f a , intro-double-negation (a , refl))
+
+ triangle-unit-double-negation-im :
+ coherence-triangle-maps
+ ( f)
+ ( inclusion-double-negation-im)
+ ( map-unit-double-negation-im)
+ triangle-unit-double-negation-im a = refl
+
+ unit-double-negation-im : hom-slice f inclusion-double-negation-im
+ pr1 unit-double-negation-im = map-unit-double-negation-im
+ pr2 unit-double-negation-im = triangle-unit-double-negation-im
+```
+
+## Properties
+
+### We characterize the identity type of `double-negation-im f`
+
+```agda
+module _
+ {l1 l2 : Level} {X : UU l1} {A : UU l2} (f : A → X)
+ where
+
+ Eq-double-negation-im : double-negation-im f → double-negation-im f → UU l1
+ Eq-double-negation-im x y = (pr1 x = pr1 y)
+
+ refl-Eq-double-negation-im :
+ (x : double-negation-im f) → Eq-double-negation-im x x
+ refl-Eq-double-negation-im x = refl
+
+ Eq-eq-double-negation-im :
+ (x y : double-negation-im f) → x = y → Eq-double-negation-im x y
+ Eq-eq-double-negation-im x .x refl = refl-Eq-double-negation-im x
+
+ abstract
+ is-torsorial-Eq-double-negation-im :
+ (x : double-negation-im f) → is-torsorial (Eq-double-negation-im x)
+ is-torsorial-Eq-double-negation-im x =
+ is-torsorial-Eq-subtype
+ ( is-torsorial-Id (pr1 x))
+ ( is-prop-is-in-subtype (subtype-double-negation-im f))
+ ( pr1 x)
+ ( refl)
+ ( pr2 x)
+
+ abstract
+ is-equiv-Eq-eq-double-negation-im :
+ (x y : double-negation-im f) → is-equiv (Eq-eq-double-negation-im x y)
+ is-equiv-Eq-eq-double-negation-im x =
+ fundamental-theorem-id
+ ( is-torsorial-Eq-double-negation-im x)
+ ( Eq-eq-double-negation-im x)
+
+ equiv-Eq-eq-double-negation-im :
+ (x y : double-negation-im f) → (x = y) ≃ Eq-double-negation-im x y
+ equiv-Eq-eq-double-negation-im x y =
+ ( Eq-eq-double-negation-im x y , is-equiv-Eq-eq-double-negation-im x y)
+
+ eq-Eq-double-negation-im :
+ (x y : double-negation-im f) → Eq-double-negation-im x y → x = y
+ eq-Eq-double-negation-im x y =
+ map-inv-equiv (equiv-Eq-eq-double-negation-im x y)
+```
+
+### The unit map of the double negation image is double negation dense
+
+```agda
+abstract
+ is-double-negation-dense-unit-double-negation-im :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A → B) →
+ is-double-negation-dense-map (map-unit-double-negation-im f)
+ is-double-negation-dense-unit-double-negation-im f (y , nnq) np =
+ nnq
+ ( λ p →
+ np
+ ( pr1 p ,
+ eq-Eq-double-negation-im f
+ ( map-unit-double-negation-im f (pr1 p)) (y , nnq) (pr2 p)))
+```
+
+### The double negation image inclusion is a double negation stable embedding
+
+```agda
+module _
+ {l1 l2 : Level} {X : UU l1} {A : UU l2} (f : A → X)
+ where
+
+ is-emb-inclusion-double-negation-im :
+ is-emb (inclusion-double-negation-im f)
+ is-emb-inclusion-double-negation-im =
+ is-emb-inclusion-subtype (subtype-double-negation-im f)
+
+ emb-double-negation-im : double-negation-im f ↪ X
+ emb-double-negation-im =
+ ( inclusion-double-negation-im f , is-emb-inclusion-double-negation-im)
+
+ is-injective-inclusion-double-negation-im :
+ is-injective (inclusion-double-negation-im f)
+ is-injective-inclusion-double-negation-im =
+ is-injective-is-emb is-emb-inclusion-double-negation-im
+
+ is-double-negation-eliminating-map-inclusion-double-negation-im :
+ is-double-negation-eliminating-map (inclusion-double-negation-im f)
+ is-double-negation-eliminating-map-inclusion-double-negation-im x nnip =
+ ( ( x ,
+ ( λ np →
+ nnip
+ ( λ ip →
+ is-double-negation-dense-unit-double-negation-im f
+ ( pr1 ip)
+ ( λ ηq →
+ np
+ ( pr1 ηq ,
+ ap (inclusion-double-negation-im f) (pr2 ηq) ∙ pr2 ip))))) ,
+ ( refl))
+
+ double-negation-eliminating-map-inclusion-double-negation-im :
+ double-negation-im f →¬¬ X
+ double-negation-eliminating-map-inclusion-double-negation-im =
+ ( inclusion-double-negation-im f ,
+ is-double-negation-eliminating-map-inclusion-double-negation-im)
+
+ is-double-negation-stable-emb-inclusion-double-negation-im :
+ is-double-negation-stable-emb (inclusion-double-negation-im f)
+ is-double-negation-stable-emb-inclusion-double-negation-im =
+ ( is-emb-inclusion-double-negation-im ,
+ is-double-negation-eliminating-map-inclusion-double-negation-im)
+
+ double-negation-stable-emb-double-negation-im : double-negation-im f ↪¬¬ X
+ double-negation-stable-emb-double-negation-im =
+ ( inclusion-double-negation-im f ,
+ is-double-negation-stable-emb-inclusion-double-negation-im)
+
+ ε-operator-map-inclusion-double-negation-im :
+ ε-operator-map (inclusion-double-negation-im f)
+ ε-operator-map-inclusion-double-negation-im =
+ ε-operator-double-negation-eliminating-map
+ ( double-negation-eliminating-map-inclusion-double-negation-im)
+```
+
+### The double negation image of a map into a truncated type is truncated
+
+```agda
+abstract
+ is-trunc-double-negation-im :
+ {l1 l2 : Level} (k : 𝕋) {X : UU l1} {A : UU l2} (f : A → X) →
+ is-trunc (succ-𝕋 k) X → is-trunc (succ-𝕋 k) (double-negation-im f)
+ is-trunc-double-negation-im k f = is-trunc-emb k (emb-double-negation-im f)
+
+double-negation-im-Truncated-Type :
+ {l1 l2 : Level} (k : 𝕋) (X : Truncated-Type l1 (succ-𝕋 k)) {A : UU l2}
+ (f : A → type-Truncated-Type X) → Truncated-Type (l1 ⊔ l2) (succ-𝕋 k)
+double-negation-im-Truncated-Type k X f =
+ ( double-negation-im f ,
+ is-trunc-double-negation-im k f (is-trunc-type-Truncated-Type X))
+```
+
+### The double negation image of a map into a proposition is a proposition
+
+```agda
+abstract
+ is-prop-double-negation-im :
+ {l1 l2 : Level} {X : UU l1} {A : UU l2} (f : A → X) →
+ is-prop X → is-prop (double-negation-im f)
+ is-prop-double-negation-im = is-trunc-double-negation-im neg-two-𝕋
+
+double-negation-im-Prop :
+ {l1 l2 : Level} (X : Prop l1) {A : UU l2} →
+ (A → type-Prop X) → Prop (l1 ⊔ l2)
+double-negation-im-Prop = double-negation-im-Truncated-Type neg-two-𝕋
+```
+
+### The double negation image of a map into a set is a set
+
+```agda
+abstract
+ is-set-double-negation-im :
+ {l1 l2 : Level} {X : UU l1} {A : UU l2} (f : A → X) →
+ is-set X → is-set (double-negation-im f)
+ is-set-double-negation-im = is-trunc-double-negation-im neg-one-𝕋
+
+double-negation-im-Set :
+ {l1 l2 : Level} (X : Set l1) {A : UU l2} →
+ (A → type-Set X) → Set (l1 ⊔ l2)
+double-negation-im-Set = double-negation-im-Truncated-Type neg-one-𝕋
+```
+
+### The double negation image of a map into a 1-type is a 1-type
+
+```agda
+abstract
+ is-1-type-double-negation-im :
+ {l1 l2 : Level} {X : UU l1} {A : UU l2} (f : A → X) →
+ is-1-type X → is-1-type (double-negation-im f)
+ is-1-type-double-negation-im = is-trunc-double-negation-im zero-𝕋
+
+double-negation-im-1-Type :
+ {l1 l2 : Level} (X : 1-Type l1) {A : UU l2}
+ (f : A → type-1-Type X) → 1-Type (l1 ⊔ l2)
+double-negation-im-1-Type = double-negation-im-Truncated-Type zero-𝕋
+```
+
+### Injective double negation eliminating maps are embeddings
+
+```agda
+module _
+ {l1 l2 : Level} {X : UU l1} {A : UU l2} {f : A → X}
+ where
+
+ map-section-map-unit-double-negation-im :
+ is-double-negation-eliminating-map f → double-negation-im f → A
+ map-section-map-unit-double-negation-im K (y , p) = pr1 (K y p)
+
+ is-section-map-section-map-unit-double-negation-im :
+ (K : is-double-negation-eliminating-map f) →
+ is-section
+ ( map-unit-double-negation-im f)
+ ( map-section-map-unit-double-negation-im K)
+ is-section-map-section-map-unit-double-negation-im K (y , p) =
+ is-injective-inclusion-double-negation-im f (pr2 (K y p))
+
+ section-map-unit-double-negation-im :
+ is-double-negation-eliminating-map f →
+ section (map-unit-double-negation-im f)
+ section-map-unit-double-negation-im K =
+ ( map-section-map-unit-double-negation-im K ,
+ is-section-map-section-map-unit-double-negation-im K)
+
+ is-equiv-map-unit-double-negation-im :
+ is-double-negation-eliminating-map f →
+ is-injective f →
+ is-equiv (map-unit-double-negation-im f)
+ is-equiv-map-unit-double-negation-im K H =
+ is-equiv-is-injective
+ ( section-map-unit-double-negation-im K)
+ ( is-injective-right-factor
+ ( inclusion-double-negation-im f)
+ ( map-unit-double-negation-im f)
+ ( H))
+
+ is-emb-is-injective-is-double-negation-eliminating-map :
+ is-double-negation-eliminating-map f → is-injective f → is-emb f
+ is-emb-is-injective-is-double-negation-eliminating-map K H =
+ is-emb-comp
+ ( inclusion-double-negation-im f)
+ ( map-unit-double-negation-im f)
+ ( is-emb-inclusion-double-negation-im f)
+ ( is-emb-is-equiv (is-equiv-map-unit-double-negation-im K H))
+```
+
+## See also
+
+- [The double negation modality](foundation.double-negation-modality.md)
diff --git a/src/foundation/double-negation-stable-propositions.lagda.md b/src/foundation/double-negation-stable-propositions.lagda.md
index 0ba325bf24..b3486593b7 100644
--- a/src/foundation/double-negation-stable-propositions.lagda.md
+++ b/src/foundation/double-negation-stable-propositions.lagda.md
@@ -8,27 +8,20 @@ module foundation.double-negation-stable-propositions where
```agda
open import foundation.cartesian-product-types
-open import foundation.conjunction
-open import foundation.coproduct-types
open import foundation.decidable-propositions
open import foundation.decidable-types
open import foundation.dependent-pair-types
-open import foundation.disjunction
open import foundation.double-negation
open import foundation.embeddings
open import foundation.empty-types
open import foundation.equivalences
-open import foundation.existential-quantification
open import foundation.logical-equivalences
open import foundation.negation
open import foundation.propositional-extensionality
open import foundation.propositions
open import foundation.sets
open import foundation.subtypes
-open import foundation.transport-along-identifications
-open import foundation.type-arithmetic-dependent-pair-types
open import foundation.unit-type
-open import foundation.universal-quantification
open import foundation.universe-levels
open import foundation-core.contractible-types
@@ -283,6 +276,20 @@ neg-Double-Negation-Stable-Prop P =
neg-type-Double-Negation-Stable-Prop (type-Double-Negation-Stable-Prop P)
```
+### Double negations of types are double negation stable propositions
+
+```agda
+double-negation-type-Double-Negation-Stable-Prop :
+ {l : Level} → UU l → Double-Negation-Stable-Prop l
+double-negation-type-Double-Negation-Stable-Prop A =
+ neg-Double-Negation-Stable-Prop (neg-type-Double-Negation-Stable-Prop A)
+
+double-negation-Double-Negation-Stable-Prop :
+ {l : Level} → Double-Negation-Stable-Prop l → Double-Negation-Stable-Prop l
+double-negation-Double-Negation-Stable-Prop P =
+ neg-Double-Negation-Stable-Prop (neg-Double-Negation-Stable-Prop P)
+```
+
### Universal quantification over double negation stable propositions is double negation stable
```agda
@@ -292,7 +299,7 @@ is-double-negation-stable-prop-Π :
is-double-negation-stable-prop ((a : A) → B a)
is-double-negation-stable-prop-Π b =
( is-prop-Π (is-prop-type-is-double-negation-stable-prop ∘ b)) ,
- ( double-negation-elim-for-all
+ ( double-negation-elim-Π
( has-double-negation-elim-is-double-negation-stable-prop ∘ b))
Π-Double-Negation-Stable-Prop :
diff --git a/src/foundation/double-negation.lagda.md b/src/foundation/double-negation.lagda.md
index ee813f6384..75e99d2729 100644
--- a/src/foundation/double-negation.lagda.md
+++ b/src/foundation/double-negation.lagda.md
@@ -18,9 +18,11 @@ open import foundation-core.propositions
-## Definition
+## Idea
-We define double negation and triple negation
+We define double negation and triple negation.
+
+## Definitions
```agda
infix 25 ¬¬_ ¬¬¬_
@@ -42,6 +44,9 @@ intro-double-negation p f = f p
map-double-negation :
{l1 l2 : Level} {P : UU l1} {Q : UU l2} → (P → Q) → ¬¬ P → ¬¬ Q
map-double-negation f = map-neg (map-neg f)
+
+elim-triple-negation : {l : Level} {P : UU l} → ¬¬¬ P → ¬ P
+elim-triple-negation = map-neg intro-double-negation
```
## Properties
@@ -94,23 +99,28 @@ double-negation-linearity-implication {P = P} {Q = Q} f =
### Maps into double negations extend along `intro-double-negation`
```agda
-double-negation-extend :
+extend-double-negation :
{l1 l2 : Level} {P : UU l1} {Q : UU l2} →
(P → ¬¬ Q) → (¬¬ P → ¬¬ Q)
-double-negation-extend {P = P} {Q = Q} f nnp nq = nnp (λ p → f p nq)
+extend-double-negation {P = P} {Q = Q} f nnp nq = nnp (λ p → f p nq)
```
### The double negation of a type is logically equivalent to the double negation of its propositional truncation
```agda
+abstract
+ intro-double-negation-type-trunc-Prop :
+ {l : Level} {A : UU l} → type-trunc-Prop A → ¬¬ A
+ intro-double-negation-type-trunc-Prop {A = A} =
+ map-universal-property-trunc-Prop
+ ( double-negation-type-Prop A)
+ ( intro-double-negation)
+
abstract
double-negation-double-negation-type-trunc-Prop :
- {l : Level} (A : UU l) → ¬¬ (type-trunc-Prop A) → ¬¬ A
- double-negation-double-negation-type-trunc-Prop A =
- double-negation-extend
- ( map-universal-property-trunc-Prop
- ( double-negation-type-Prop A)
- ( intro-double-negation))
+ {l : Level} {A : UU l} → ¬¬ (type-trunc-Prop A) → ¬¬ A
+ double-negation-double-negation-type-trunc-Prop =
+ extend-double-negation intro-double-negation-type-trunc-Prop
abstract
double-negation-type-trunc-Prop-double-negation :
diff --git a/src/foundation/full-subtypes.lagda.md b/src/foundation/full-subtypes.lagda.md
index 35e882b6f7..eb9c39abfe 100644
--- a/src/foundation/full-subtypes.lagda.md
+++ b/src/foundation/full-subtypes.lagda.md
@@ -35,7 +35,7 @@ module _
where
is-full-subtype-Prop : Prop (l1 ⊔ l2)
- is-full-subtype-Prop = Π-Prop A (λ x → P x)
+ is-full-subtype-Prop = Π-Prop A P
is-full-subtype : UU (l1 ⊔ l2)
is-full-subtype = type-Prop is-full-subtype-Prop
diff --git a/src/foundation/hilbert-epsilon-operators-maps.lagda.md b/src/foundation/hilbert-epsilon-operators-maps.lagda.md
new file mode 100644
index 0000000000..1378faf499
--- /dev/null
+++ b/src/foundation/hilbert-epsilon-operators-maps.lagda.md
@@ -0,0 +1,107 @@
+# Hilbert ε-operators on maps
+
+```agda
+module foundation.hilbert-epsilon-operators-maps where
+```
+
+Imports
+
+```agda
+open import foundation.dependent-pair-types
+open import foundation.embeddings
+open import foundation.hilberts-epsilon-operators
+open import foundation.images
+open import foundation.universe-levels
+
+open import foundation-core.equivalences
+open import foundation-core.fibers-of-maps
+open import foundation-core.injective-maps
+open import foundation-core.sections
+```
+
+
+
+## Idea
+
+A
+{{#concept "Hilbert ε-operator" Disambiguation="on a map" Agda=ε-operator-map}}
+on a map $f : A → B$ is a family of
+[Hilbert ε-operators](foundation.hilberts-epsilon-operators.md) on its
+[fibers](foundation-core.fibers-of-maps.md). I.e., for every `y : B` there is an
+operator
+
+```text
+ ε_y : ║ fiber f y ║₋₁ → fiber f y.
+```
+
+Some authors also refer to this as _split support_ {{#cite KECA17}}. Contrary to
+Hilbert, we do not assume that such an operator exists for every map.
+
+## Definitions
+
+### The structure of a Hilbert ε-operator on a map
+
+```agda
+ε-operator-map :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} → (A → B) → UU (l1 ⊔ l2)
+ε-operator-map {B = B} f = (y : B) → ε-operator-Hilbert (fiber f y)
+```
+
+## Properties
+
+### ε-operators on maps are sections of the image-unit
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B}
+ where
+
+ map-section-map-unit-im-ε-operator-map : ε-operator-map f → im f → A
+ map-section-map-unit-im-ε-operator-map ε (y , p) = pr1 (ε y p)
+
+ is-section-map-section-map-unit-im-ε-operator-map :
+ (ε : ε-operator-map f) →
+ is-section (map-unit-im f) (map-section-map-unit-im-ε-operator-map ε)
+ is-section-map-section-map-unit-im-ε-operator-map ε (y , p) =
+ eq-Eq-im f _ _ (pr2 (ε y p))
+
+ section-map-unit-im-ε-operator-map :
+ ε-operator-map f → section (map-unit-im f)
+ section-map-unit-im-ε-operator-map ε =
+ ( map-section-map-unit-im-ε-operator-map ε ,
+ is-section-map-section-map-unit-im-ε-operator-map ε)
+```
+
+### Injective maps with ε-operators are embeddings
+
+**Proof.** Given a map `f : A → B` equipped with an ε-operator, then we have a
+section of the image projection map `A ↠ im f` given by the Hilbert ε-operator.
+Now, by injectivity of `f` we the image projection map must be an equivalence.
+Hence, `f` is a composite of embeddings and so must be an embedding as well.
+
+```text
+ im f
+ ↟ ⋮ \
+ │ ⋮ ~ \
+ │ ↓ ∨
+ A ──────→ B
+ f
+```
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B}
+ where
+
+ is-emb-is-injective-ε-operator-map :
+ ε-operator-map f → is-injective f → is-emb f
+ is-emb-is-injective-ε-operator-map ε H =
+ is-emb-comp
+ ( inclusion-im f)
+ ( map-unit-im f)
+ ( is-emb-inclusion-im f)
+ ( is-emb-is-equiv
+ ( is-equiv-is-injective
+ ( section-map-unit-im-ε-operator-map ε)
+ ( is-injective-right-factor (inclusion-im f) (map-unit-im f) H)))
+```
diff --git a/src/foundation/hilberts-epsilon-operators.lagda.md b/src/foundation/hilberts-epsilon-operators.lagda.md
index 694040c8e2..6fbbbceb35 100644
--- a/src/foundation/hilberts-epsilon-operators.lagda.md
+++ b/src/foundation/hilberts-epsilon-operators.lagda.md
@@ -1,4 +1,4 @@
-# Hilbert's `ε`-operators
+# Hilbert's ε-operators
```agda
module foundation.hilberts-epsilon-operators where
@@ -19,7 +19,8 @@ open import foundation-core.function-types
## Idea
-{{#concept "Hilbert's ε-operator"}} at a type `A` is a map
+{{#concept "Hilbert's ε-operator" Disambiguation="on types" Agda=ε-operator-Hilbert}}
+on a type `A` is a map
```text
ε : ║A║₋₁ → A
@@ -57,6 +58,10 @@ Hilbert, we will not assume that such an operator exists for each type `A`.
{{#bibliography}}
+## See also
+
+- [Global choice](foundation.global-choice.md)
+
## External links
- [Epsilon calculus](https://en.wikipedia.org/wiki/Epsilon_calculus) at
diff --git a/src/foundation/images-subtypes.lagda.md b/src/foundation/images-subtypes.lagda.md
index 81a37b66c0..3310d88c6d 100644
--- a/src/foundation/images-subtypes.lagda.md
+++ b/src/foundation/images-subtypes.lagda.md
@@ -252,7 +252,7 @@ module _
has-same-elements-subtype (subtype-im (g ∘ f)) (im-subtype g (subtype-im f))
compute-subtype-im-comp x =
logical-equivalence-reasoning
- is-in-subtype-im (g ∘ f) x
+ is-in-im (g ∘ f) x
↔ is-in-im-subtype (g ∘ f) (full-subtype lzero A) x
by
inv-iff (compute-im-full-subtype (g ∘ f) x)
diff --git a/src/foundation/images.lagda.md b/src/foundation/images.lagda.md
index 4ffd596c45..7fdbb46a83 100644
--- a/src/foundation/images.lagda.md
+++ b/src/foundation/images.lagda.md
@@ -17,7 +17,6 @@ open import foundation.universe-levels
open import foundation-core.1-types
open import foundation-core.commuting-triangles-of-maps
-open import foundation-core.contractible-types
open import foundation-core.embeddings
open import foundation-core.equivalences
open import foundation-core.fibers-of-maps
@@ -52,8 +51,8 @@ module _
subtype-im : subtype (l1 ⊔ l2) X
subtype-im x = trunc-Prop (fiber f x)
- is-in-subtype-im : X → UU (l1 ⊔ l2)
- is-in-subtype-im = is-in-subtype subtype-im
+ is-in-im : X → UU (l1 ⊔ l2)
+ is-in-im = is-in-subtype subtype-im
im : UU (l1 ⊔ l2)
im = type-subtype subtype-im
diff --git a/src/foundation/inequality-booleans.lagda.md b/src/foundation/inequality-booleans.lagda.md
new file mode 100644
index 0000000000..e26d2cd07c
--- /dev/null
+++ b/src/foundation/inequality-booleans.lagda.md
@@ -0,0 +1,228 @@
+# The standard inequality relation on booleans
+
+```agda
+module foundation.inequality-booleans where
+```
+
+Imports
+
+```agda
+open import foundation.booleans
+open import foundation.decidable-propositions
+open import foundation.decidable-types
+open import foundation.dependent-pair-types
+open import foundation.disjunction
+open import foundation.logical-operations-booleans
+open import foundation.propositional-truncations
+open import foundation.unit-type
+open import foundation.universe-levels
+
+open import foundation-core.coproduct-types
+open import foundation-core.identity-types
+open import foundation-core.propositions
+
+open import order-theory.decidable-total-orders
+open import order-theory.posets
+open import order-theory.preorders
+open import order-theory.total-orders
+```
+
+
+
+## Idea
+
+The
+{{#concept "standard inequality relation" Disambiguation="on booleans" Agda=leq-bool}}
+on [booleans](foundation.booleans.md) is the
+[partial order](order-theory.posets.md) defined by the logical connective `⇒`,
+i.e. `(x ≤ y) := (x ⇒ y)`. This means it is the unique partial order on the
+booleans satisfying the four inequalities
+
+```text
+ false ≤ false
+ false ≤ true
+ true ≤ true
+ true ≰ false.
+```
+
+## Definitions
+
+### The standard inequality relation on booleans
+
+```agda
+leq-bool-Decidable-Prop : bool → bool → Decidable-Prop lzero
+leq-bool-Decidable-Prop x y = decidable-prop-bool (hom-bool x y)
+
+leq-bool-Prop : bool → bool → Prop lzero
+leq-bool-Prop x y = prop-Decidable-Prop (leq-bool-Decidable-Prop x y)
+
+leq-bool : bool → bool → UU lzero
+leq-bool x y = type-Decidable-Prop (leq-bool-Decidable-Prop x y)
+
+is-decidable-leq-bool : {x y : bool} → is-decidable (leq-bool x y)
+is-decidable-leq-bool {x} {y} =
+ is-decidable-Decidable-Prop (leq-bool-Decidable-Prop x y)
+
+is-prop-leq-bool : {x y : bool} → is-prop (leq-bool x y)
+is-prop-leq-bool {x} {y} = is-prop-type-Prop (leq-bool-Prop x y)
+```
+
+## Properties
+
+### Reflexivity
+
+```agda
+refl-leq-bool : {x : bool} → leq-bool x x
+refl-leq-bool {true} = star
+refl-leq-bool {false} = star
+
+refl-leq-bool' : (x : bool) → leq-bool x x
+refl-leq-bool' x = refl-leq-bool {x}
+
+leq-eq-bool : {x y : bool} → x = y → leq-bool x y
+leq-eq-bool {x} refl = refl-leq-bool' x
+```
+
+### Transitivity
+
+```agda
+transitive-leq-bool :
+ {x y z : bool} → leq-bool y z → leq-bool x y → leq-bool x z
+transitive-leq-bool {true} {true} {true} p q = star
+transitive-leq-bool {false} {y} {z} p q = star
+```
+
+### Antisymmetry
+
+```agda
+antisymmetric-leq-bool :
+ {x y : bool} → leq-bool x y → leq-bool y x → x = y
+antisymmetric-leq-bool {true} {true} p q = refl
+antisymmetric-leq-bool {false} {false} p q = refl
+```
+
+### Linearity
+
+```agda
+linear-leq-bool : {x y : bool} → leq-bool x y + leq-bool y x
+linear-leq-bool {true} {true} = inr star
+linear-leq-bool {true} {false} = inr star
+linear-leq-bool {false} {y} = inl star
+
+is-total-leq-bool :
+ (x y : bool) → disjunction-type (leq-bool x y) (leq-bool y x)
+is-total-leq-bool x y = unit-trunc-Prop (linear-leq-bool {x} {y})
+```
+
+### The maximal and minimal elements
+
+```agda
+leq-true-bool : {x : bool} → leq-bool x true
+leq-true-bool {true} = star
+leq-true-bool {false} = star
+
+leq-false-bool : {x : bool} → leq-bool false x
+leq-false-bool = star
+
+eq-leq-true-bool : {x : bool} → leq-bool true x → x = true
+eq-leq-true-bool {true} p = refl
+
+eq-leq-false-bool : {x : bool} → leq-bool x false → x = false
+eq-leq-false-bool {false} p = refl
+```
+
+### The decidable total order on booleans
+
+```agda
+bool-Preorder : Preorder lzero lzero
+bool-Preorder =
+ ( bool ,
+ leq-bool-Prop ,
+ refl-leq-bool' ,
+ ( λ x y z → transitive-leq-bool {x} {y} {z}))
+
+bool-Poset : Poset lzero lzero
+bool-Poset = (bool-Preorder , (λ x y → antisymmetric-leq-bool {x} {y}))
+
+bool-Total-Order : Total-Order lzero lzero
+bool-Total-Order = (bool-Poset , is-total-leq-bool)
+
+bool-Decidable-Total-Order : Decidable-Total-Order lzero lzero
+bool-Decidable-Total-Order =
+ ( bool-Poset ,
+ is-total-leq-bool ,
+ ( λ x y → is-decidable-Decidable-Prop (leq-bool-Decidable-Prop x y)))
+```
+
+### Interactions between the inequality relation and the disjunction operation
+
+```agda
+left-leq-or-bool : {x y : bool} → leq-bool x (or-bool x y)
+left-leq-or-bool {true} {y} = star
+left-leq-or-bool {false} {y} = star
+
+right-leq-or-bool : {x y : bool} → leq-bool y (or-bool x y)
+right-leq-or-bool {true} {true} = star
+right-leq-or-bool {true} {false} = star
+right-leq-or-bool {false} {true} = star
+right-leq-or-bool {false} {false} = star
+
+leq-left-or-bool : {x y : bool} → leq-bool x y → leq-bool (or-bool x y) y
+leq-left-or-bool {true} {true} p = star
+leq-left-or-bool {false} {true} p = star
+leq-left-or-bool {false} {false} p = star
+
+leq-right-or-bool : {x y : bool} → leq-bool x y → leq-bool (or-bool y x) y
+leq-right-or-bool {x} {true} p = star
+leq-right-or-bool {false} {false} p = star
+
+is-upper-bound-or-bool :
+ {x y z : bool} → leq-bool x z → leq-bool y z → leq-bool (or-bool x y) z
+is-upper-bound-or-bool {true} {y} {true} p q = star
+is-upper-bound-or-bool {false} {true} {true} p q = star
+is-upper-bound-or-bool {false} {false} {true} p q = star
+is-upper-bound-or-bool {false} {false} {false} p q = star
+```
+
+### Interactions between the inequality relation and the conjunction operation
+
+```agda
+left-leq-and-bool : {x y : bool} → leq-bool (and-bool x y) x
+left-leq-and-bool {true} {true} = star
+left-leq-and-bool {false} {true} = star
+left-leq-and-bool {true} {false} = star
+left-leq-and-bool {false} {false} = star
+
+right-leq-and-bool : {x y : bool} → leq-bool (and-bool x y) y
+right-leq-and-bool {true} {true} = star
+right-leq-and-bool {true} {false} = star
+right-leq-and-bool {false} {y} = star
+
+leq-left-and-bool : {x y : bool} → leq-bool x y → leq-bool x (and-bool x y)
+leq-left-and-bool {true} {true} p = star
+leq-left-and-bool {false} {y} p = star
+
+leq-right-and-bool : {x y : bool} → leq-bool x y → leq-bool x (and-bool y x)
+leq-right-and-bool {true} {true} p = star
+leq-right-and-bool {false} {y} p = star
+
+is-lower-bound-and-bool :
+ {x y z : bool} → leq-bool x y → leq-bool x z → leq-bool x (and-bool y z)
+is-lower-bound-and-bool {true} {true} {true} p q = star
+is-lower-bound-and-bool {false} {y} {z} p q = star
+```
+
+```agda
+is-false-is-false-leq-bool :
+ {x y : bool} → leq-bool x y → is-false y → is-false x
+is-false-is-false-leq-bool {false} {false} p refl = refl
+
+is-true-is-true-leq-bool :
+ {x y : bool} → leq-bool x y → is-true x → is-true y
+is-true-is-true-leq-bool {true} {true} p refl = refl
+```
+
+## See also
+
+- The underlying category of the poset of booleans is called
+ [the representing arrow category](category-theory.representing-arrow-category.md).
diff --git a/src/foundation/injective-maps.lagda.md b/src/foundation/injective-maps.lagda.md
index 8ab3913353..56aff7be4a 100644
--- a/src/foundation/injective-maps.lagda.md
+++ b/src/foundation/injective-maps.lagda.md
@@ -9,7 +9,6 @@ open import foundation-core.injective-maps public
Imports
```agda
-open import foundation.action-on-identifications-dependent-functions
open import foundation.action-on-identifications-functions
open import foundation.dependent-pair-types
open import foundation.function-extensionality
@@ -33,7 +32,8 @@ open import foundation-core.sets
## Idea
-A map `f : A → B` is **injective** if `f x = f y` implies `x = y`.
+A map `f : A → B` is **injective**, also called _left cancellable_, if
+`f x = f y` implies `x = y`.
## Warning
diff --git a/src/foundation/irrefutable-equality.lagda.md b/src/foundation/irrefutable-equality.lagda.md
new file mode 100644
index 0000000000..e2e4d7e02d
--- /dev/null
+++ b/src/foundation/irrefutable-equality.lagda.md
@@ -0,0 +1,113 @@
+# Irrefutable equality
+
+```agda
+module foundation.irrefutable-equality where
+```
+
+Imports
+
+```agda
+open import foundation.action-on-identifications-functions
+open import foundation.binary-relations
+open import foundation.dependent-pair-types
+open import foundation.double-negation
+open import foundation.equality-dependent-pair-types
+open import foundation.equivalences
+open import foundation.retracts-of-types
+open import foundation.transport-along-identifications
+open import foundation.universe-levels
+
+open import foundation-core.equivalence-relations
+open import foundation-core.identity-types
+open import foundation-core.propositions
+open import foundation-core.sets
+```
+
+
+
+## Idea
+
+Two elements `x` and `y` in a type are said to be
+{{#concept "irrefutably equal" Disambiguation="elements of a type" Agda=irrefutable-eq}}
+if there is an element of the [double negation](foundation.double-negation.md)
+of the [identity type](foundation-core.identity-types.md) between them,
+`¬¬ (x = y)`.
+
+## Definitions
+
+### Irrefutably equal elements
+
+```agda
+module _
+ {l : Level} {A : UU l}
+ where
+
+ irrefutable-eq : A → A → UU l
+ irrefutable-eq x y = ¬¬ (x = y)
+
+ is-prop-irrefutable-eq : (x y : A) → is-prop (irrefutable-eq x y)
+ is-prop-irrefutable-eq x y = is-prop-double-negation
+
+ irrefutable-eq-Prop : A → A → Prop l
+ irrefutable-eq-Prop x y = (irrefutable-eq x y , is-prop-irrefutable-eq x y)
+```
+
+## Properties
+
+### Reflexivity
+
+```agda
+abstract
+ refl-irrefutable-eq :
+ {l : Level} {A : UU l} → is-reflexive (irrefutable-eq {l} {A})
+ refl-irrefutable-eq _ = intro-double-negation refl
+
+irrefutable-eq-eq :
+ {l : Level} {A : UU l} {x y : A} → x = y → irrefutable-eq x y
+irrefutable-eq-eq = intro-double-negation
+```
+
+### Symmetry
+
+```agda
+abstract
+ symmetric-irrefutable-eq :
+ {l : Level} {A : UU l} → is-symmetric (irrefutable-eq {l} {A})
+ symmetric-irrefutable-eq _ _ = map-double-negation inv
+```
+
+### Transitivity
+
+```agda
+abstract
+ transitive-irrefutable-eq :
+ {l : Level} {A : UU l} → is-transitive (irrefutable-eq {l} {A})
+ transitive-irrefutable-eq x y z nnp nnq npq =
+ nnp (λ p → nnq (λ q → npq (q ∙ p)))
+```
+
+### Irrefutable equality is an equivalence relation
+
+```agda
+irrefutable-eq-equivalence-relation :
+ {l1 : Level} (A : UU l1) → equivalence-relation l1 A
+irrefutable-eq-equivalence-relation A =
+ ( irrefutable-eq-Prop ,
+ refl-irrefutable-eq ,
+ symmetric-irrefutable-eq ,
+ transitive-irrefutable-eq)
+```
+
+### If irrefutable equality maps into the identity type of `A`, then `A` is a set
+
+```agda
+is-set-irrefutable-eq-in-id :
+ {l : Level} {A : UU l} → ((x y : A) → irrefutable-eq x y → x = y) → is-set A
+is-set-irrefutable-eq-in-id =
+ is-set-prop-in-id irrefutable-eq is-prop-irrefutable-eq refl-irrefutable-eq
+```
+
+## See also
+
+- [_Double negation dense equality_](foundation.double-negation-dense-equality.md)
+ is the property that all elements of a type are irrefutably equal.
diff --git a/src/foundation/irrefutable-propositions.lagda.md b/src/foundation/irrefutable-propositions.lagda.md
index a6a0d7fcde..af0ce7c537 100644
--- a/src/foundation/irrefutable-propositions.lagda.md
+++ b/src/foundation/irrefutable-propositions.lagda.md
@@ -9,20 +9,15 @@ module foundation.irrefutable-propositions where
```agda
open import foundation.cartesian-product-types
open import foundation.contractible-types
-open import foundation.coproduct-types
open import foundation.decidable-propositions
-open import foundation.decidable-types
open import foundation.dependent-pair-types
open import foundation.double-negation
-open import foundation.empty-types
open import foundation.function-types
-open import foundation.negation
open import foundation.propositions
open import foundation.subuniverses
-open import foundation.unit-type
open import foundation.universe-levels
-open import logic.double-negation-elimination
+open import logic.irrefutable-types
```
@@ -30,10 +25,18 @@ open import logic.double-negation-elimination
## Idea
The [subuniverse](foundation.subuniverses.md) of
-{{#concept "irrefutable propositions" Agda=Irrefutable-Prop}} consists of
-[propositions](foundation-core.propositions.md) `P` for which the
+{{#concept "irrefutable propositions" Agda=Irrefutable-Prop}}, or
+{{#concept "double negation dense propositions" Agda=Irrefutable-Prop}},
+consists of [propositions](foundation-core.propositions.md) `P` for which the
[double negation](foundation.double-negation.md) `¬¬P` is true.
+**Terminology.** The term _dense_ used here is in the sense of dense with
+respect to a
+[reflective subuniverse](orthogonal-factorization-systems.reflective-global-subuniverses.md)/[modality](orthogonal-factorization-systems.higher-modalities.md),
+or connected. Here, it means that the double negation of `P` is contractible.
+Since negations are propositions, it thus suffices that the double negation is
+true.
+
## Definitions
### The predicate on a proposition of being irrefutable
@@ -43,14 +46,11 @@ module _
{l : Level} (P : Prop l)
where
- is-irrefutable : UU l
- is-irrefutable = ¬¬ (type-Prop P)
-
- is-prop-is-irrefutable : is-prop is-irrefutable
- is-prop-is-irrefutable = is-prop-double-negation
-
is-irrefutable-Prop : Prop l
- is-irrefutable-Prop = double-negation-Prop P
+ is-irrefutable-Prop = is-irrefutable-prop-Type (type-Prop P)
+
+ is-irrefutable-type-Prop : UU l
+ is-irrefutable-type-Prop = is-irrefutable (type-Prop P)
```
### The predicate on a type of being an irrefutable proposition
@@ -81,7 +81,7 @@ module _
prop-is-irrefutable-prop = P , is-prop-type-is-irrefutable-prop
is-irrefutable-is-irrefutable-prop :
- is-irrefutable (P , is-prop-type-is-irrefutable-prop)
+ is-irrefutable P
is-irrefutable-is-irrefutable-prop = pr2 H
```
@@ -92,7 +92,7 @@ Irrefutable-Prop : (l : Level) → UU (lsuc l)
Irrefutable-Prop l = type-subuniverse is-irrefutable-prop-Prop
make-Irrefutable-Prop :
- {l : Level} (P : Prop l) → is-irrefutable P → Irrefutable-Prop l
+ {l : Level} (P : Prop l) → is-irrefutable-type-Prop P → Irrefutable-Prop l
make-Irrefutable-Prop P is-irrefutable-P =
( type-Prop P , is-prop-type-Prop P , is-irrefutable-P)
@@ -114,60 +114,31 @@ module _
prop-Irrefutable-Prop : Prop l
prop-Irrefutable-Prop = type-Irrefutable-Prop , is-prop-type-Irrefutable-Prop
- is-irrefutable-Irrefutable-Prop : is-irrefutable prop-Irrefutable-Prop
+ is-irrefutable-Irrefutable-Prop : is-irrefutable type-Irrefutable-Prop
is-irrefutable-Irrefutable-Prop =
is-irrefutable-is-irrefutable-prop is-irrefutable-prop-type-Irrefutable-Prop
```
## Properties
-### Provable propositions are irrefutable
-
-```agda
-module _
- {l : Level} (P : Prop l)
- where
-
- is-irrefutable-has-element : type-Prop P → is-irrefutable P
- is-irrefutable-has-element = intro-double-negation
-
-is-irrefutable-unit : is-irrefutable unit-Prop
-is-irrefutable-unit = is-irrefutable-has-element unit-Prop star
-```
-
### Contractible types are irrefutable propositions
```agda
is-irrefutable-prop-is-contr :
{l : Level} {P : UU l} → is-contr P → is-irrefutable-prop P
is-irrefutable-prop-is-contr H =
- ( is-prop-is-contr H , intro-double-negation (center H))
-```
-
-### If it is irrefutable that a proposition is irrefutable, then the proposition is irrefutable
-
-```agda
-module _
- {l : Level} (P : Prop l)
- where
-
- is-idempotent-is-irrefutable :
- is-irrefutable (is-irrefutable-Prop P) → is-irrefutable P
- is-idempotent-is-irrefutable =
- double-negation-elim-neg (¬ (type-Prop P))
+ ( is-prop-is-contr H , is-irrefutable-is-contr H)
```
### Decidability is irrefutable
```agda
-is-irrefutable-is-decidable : {l : Level} {A : UU l} → ¬¬ (is-decidable A)
-is-irrefutable-is-decidable H = H (inr (H ∘ inl))
-
module _
{l : Level} (P : Prop l)
where
- is-irrefutable-is-decidable-Prop : is-irrefutable (is-decidable-Prop P)
+ is-irrefutable-is-decidable-Prop :
+ is-irrefutable-type-Prop (is-decidable-Prop P)
is-irrefutable-is-decidable-Prop = is-irrefutable-is-decidable
is-decidable-prop-Irrefutable-Prop : Irrefutable-Prop l
@@ -175,15 +146,6 @@ module _
make-Irrefutable-Prop (is-decidable-Prop P) is-irrefutable-is-decidable-Prop
```
-### Double negation elimination is irrefutable
-
-```agda
-is-irrefutable-double-negation-elim :
- {l : Level} {A : UU l} → ¬¬ (has-double-negation-elim A)
-is-irrefutable-double-negation-elim H =
- H (λ f → ex-falso (f (λ a → H (λ _ → a))))
-```
-
### Dependent sums of irrefutable propositions
```agda
@@ -191,10 +153,6 @@ module _
{l1 l2 : Level} {A : UU l1} {B : A → UU l2}
where
- is-irrefutable-Σ :
- ¬¬ A → ((x : A) → ¬¬ B x) → ¬¬ (Σ A B)
- is-irrefutable-Σ nna nnb nab = nna (λ a → nnb a (λ b → nab (a , b)))
-
is-irrefutable-prop-Σ :
is-irrefutable-prop A → ((x : A) → is-irrefutable-prop (B x)) →
is-irrefutable-prop (Σ A B)
@@ -214,28 +172,11 @@ module _
{l1 l2 : Level} {A : UU l1} {B : UU l2}
where
- is-irrefutable-product : ¬¬ A → ¬¬ B → ¬¬ (A × B)
- is-irrefutable-product nna nnb = is-irrefutable-Σ nna (λ _ → nnb)
-
is-irrefutable-prop-product :
is-irrefutable-prop A → is-irrefutable-prop B → is-irrefutable-prop (A × B)
is-irrefutable-prop-product a b = is-irrefutable-prop-Σ a (λ _ → b)
```
-### Coproducts of irrefutable propositions
-
-```agda
-module _
- {l1 l2 : Level} {A : UU l1} {B : UU l2}
- where
-
- is-irrefutable-coproduct-inl : ¬¬ A → ¬¬ (A + B)
- is-irrefutable-coproduct-inl nna x = nna (x ∘ inl)
-
- is-irrefutable-coproduct-inr : ¬¬ B → ¬¬ (A + B)
- is-irrefutable-coproduct-inr nnb x = nnb (x ∘ inr)
-```
-
## See also
- [De Morgan's law](logic.de-morgans-law.md) is irrefutable.
diff --git a/src/foundation/iterating-functions.lagda.md b/src/foundation/iterating-functions.lagda.md
index 60dafe2242..97c6d29d93 100644
--- a/src/foundation/iterating-functions.lagda.md
+++ b/src/foundation/iterating-functions.lagda.md
@@ -2,6 +2,8 @@
```agda
module foundation.iterating-functions where
+
+open import foundation-core.iterating-functions public
```
Imports
@@ -19,9 +21,7 @@ open import foundation.dependent-pair-types
open import foundation.function-extensionality
open import foundation.universe-levels
-open import foundation-core.commuting-squares-of-maps
open import foundation-core.endomorphisms
-open import foundation-core.homotopies
open import foundation-core.identity-types
open import foundation-core.sets
@@ -32,71 +32,12 @@ open import group-theory.monoid-actions
## Idea
-Any map `f : X → X` can be iterated by repeatedly applying `f`
-
-## Definition
-
-### Iterating functions
-
-```agda
-module _
- {l : Level} {X : UU l}
- where
-
- iterate : ℕ → (X → X) → (X → X)
- iterate zero-ℕ f x = x
- iterate (succ-ℕ k) f x = f (iterate k f x)
-
- iterate' : ℕ → (X → X) → (X → X)
- iterate' zero-ℕ f x = x
- iterate' (succ-ℕ k) f x = iterate' k f (f x)
-```
-
-### Homotopies of iterating functions
-
-```agda
-module _
- {l1 l2 : Level} {A : UU l1} {B : UU l2} (s : A → A) (t : B → B)
- where
-
- coherence-square-iterate :
- {f : A → B} (H : coherence-square-maps f s t f) →
- (n : ℕ) → coherence-square-maps f (iterate n s) (iterate n t) f
- coherence-square-iterate {f} H zero-ℕ x = refl
- coherence-square-iterate {f} H (succ-ℕ n) =
- pasting-vertical-coherence-square-maps
- ( f)
- ( iterate n s)
- ( iterate n t)
- ( f)
- ( s)
- ( t)
- ( f)
- ( coherence-square-iterate H n)
- ( H)
-```
+Any map `f : X → X` can be
+{{#concept "iterated" Disambiguation="endo map of types"}} by repeatedly
+applying `f`.
## Properties
-### The two definitions of iterating are homotopic
-
-```agda
-module _
- {l : Level} {X : UU l}
- where
-
- reassociate-iterate-succ-ℕ :
- (k : ℕ) (f : X → X) (x : X) → iterate (succ-ℕ k) f x = iterate k f (f x)
- reassociate-iterate-succ-ℕ zero-ℕ f x = refl
- reassociate-iterate-succ-ℕ (succ-ℕ k) f x =
- ap f (reassociate-iterate-succ-ℕ k f x)
-
- reassociate-iterate : (k : ℕ) (f : X → X) → iterate k f ~ iterate' k f
- reassociate-iterate zero-ℕ f x = refl
- reassociate-iterate (succ-ℕ k) f x =
- reassociate-iterate-succ-ℕ k f x ∙ reassociate-iterate k f (f x)
-```
-
### For any map `f : X → X`, iterating `f` defines a monoid action of ℕ on `X`
```agda
diff --git a/src/foundation/limited-principle-of-omniscience.lagda.md b/src/foundation/limited-principle-of-omniscience.lagda.md
index 7b50241fc1..b39a6595e4 100644
--- a/src/foundation/limited-principle-of-omniscience.lagda.md
+++ b/src/foundation/limited-principle-of-omniscience.lagda.md
@@ -24,6 +24,8 @@ open import foundation.raising-universe-levels
open import foundation.transport-along-identifications
open import foundation.universal-quantification
open import foundation.universe-levels
+
+open import logic.propositionally-decidable-types
```
@@ -66,7 +68,7 @@ has-true-or-all-false-Prop f =
is-prop-coproduct
( elim-exists
( ¬' ∀' ℕ (λ n → is-false-Prop (f n)))
- ( λ n t h → not-is-false-is-true (f n) t (h n)))
+ ( λ n t h → is-not-false-is-true (f n) t (h n)))
( is-prop-exists ℕ (λ n → is-true-Prop (f n)))
( is-prop-for-all-Prop ℕ (λ n → is-false-Prop (f n))))
@@ -94,7 +96,7 @@ abstract
( λ f~false →
inr-disjunction
( λ (a , a∈S) →
- not-is-false-is-true
+ is-not-false-is-true
( f a)
( is-true-map-bool-is-in-decidable-subtype S a a∈S)
( f~false a)))
diff --git a/src/foundation/logical-operations-booleans.lagda.md b/src/foundation/logical-operations-booleans.lagda.md
new file mode 100644
index 0000000000..b0818af5f1
--- /dev/null
+++ b/src/foundation/logical-operations-booleans.lagda.md
@@ -0,0 +1,297 @@
+# Logical operations on the booleans
+
+```agda
+module foundation.logical-operations-booleans where
+```
+
+Imports
+
+```agda
+open import foundation.apartness-relations
+open import foundation.booleans
+open import foundation.decidable-equality
+open import foundation.decidable-types
+open import foundation.dependent-pair-types
+open import foundation.discrete-types
+open import foundation.involutions
+open import foundation.negated-equality
+open import foundation.raising-universe-levels
+open import foundation.tight-apartness-relations
+open import foundation.unit-type
+open import foundation.universe-levels
+
+open import foundation-core.constant-maps
+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.homotopies
+open import foundation-core.identity-types
+open import foundation-core.injective-maps
+open import foundation-core.negation
+open import foundation-core.propositions
+open import foundation-core.sections
+open import foundation-core.sets
+
+open import univalent-combinatorics.finite-types
+open import univalent-combinatorics.standard-finite-types
+```
+
+
+
+## Idea
+
+We consider basic logical operations on the booleans and prove standard facts
+about them.
+
+## Definitions
+
+### Negation
+
+```agda
+neg-bool : bool → bool
+neg-bool true = false
+neg-bool false = true
+```
+
+### Conjunction
+
+```agda
+and-bool : bool → bool → bool
+and-bool true y = y
+and-bool false y = false
+```
+
+### Disjunction
+
+```agda
+or-bool : bool → bool → bool
+or-bool true y = true
+or-bool false y = y
+```
+
+### Implication
+
+```agda
+hom-bool : bool → bool → bool
+hom-bool x = or-bool (neg-bool x)
+```
+
+### Exclusive disjunction
+
+```agda
+xor-bool : bool → bool → bool
+xor-bool true y = neg-bool y
+xor-bool false y = y
+```
+
+### Negated exclusive disjunction
+
+```agda
+xnor-bool : bool → bool → bool
+xnor-bool true y = y
+xnor-bool false y = neg-bool y
+```
+
+## Properties
+
+### Boolean negation has no fixed points
+
+```agda
+neq-neg-bool : (b : bool) → b ≠ neg-bool b
+neq-neg-bool true ()
+neq-neg-bool false ()
+
+neq-neg-bool' : (b : bool) → neg-bool b ≠ b
+neq-neg-bool' b = neq-neg-bool b ∘ inv
+
+is-true-is-false-neg-bool : {b : bool} → is-false (neg-bool b) → is-true b
+is-true-is-false-neg-bool {true} p = refl
+
+is-false-is-true-neg-bool : {b : bool} → is-true (neg-bool b) → is-false b
+is-false-is-true-neg-bool {false} p = refl
+```
+
+### Boolean negation is an involution
+
+```agda
+is-involution-neg-bool : is-involution neg-bool
+is-involution-neg-bool true = refl
+is-involution-neg-bool false = refl
+```
+
+### Boolean negation is an equivalence
+
+```agda
+abstract
+ is-equiv-neg-bool : is-equiv neg-bool
+ is-equiv-neg-bool = is-equiv-is-involution is-involution-neg-bool
+
+equiv-neg-bool : bool ≃ bool
+pr1 equiv-neg-bool = neg-bool
+pr2 equiv-neg-bool = is-equiv-neg-bool
+```
+
+### Basic properties of the or operation
+
+```agda
+left-unit-law-or-bool : {x : bool} → or-bool false x = x
+left-unit-law-or-bool = refl
+
+right-unit-law-or-bool : {x : bool} → or-bool x false = x
+right-unit-law-or-bool {true} = refl
+right-unit-law-or-bool {false} = refl
+
+left-zero-law-or-bool : {x : bool} → or-bool true x = true
+left-zero-law-or-bool = refl
+
+right-zero-law-or-bool : {x : bool} → or-bool x true = true
+right-zero-law-or-bool {true} = refl
+right-zero-law-or-bool {false} = refl
+
+idempotent-or-bool : {x : bool} → or-bool x x = x
+idempotent-or-bool {true} = refl
+idempotent-or-bool {false} = refl
+
+commutative-or-bool : {x y : bool} → or-bool x y = or-bool y x
+commutative-or-bool {true} {true} = refl
+commutative-or-bool {true} {false} = refl
+commutative-or-bool {false} {true} = refl
+commutative-or-bool {false} {false} = refl
+
+associative-or-bool :
+ {x y z : bool} → or-bool (or-bool x y) z = or-bool x (or-bool y z)
+associative-or-bool {true} {y} {z} = refl
+associative-or-bool {false} {y} {z} = refl
+```
+
+### Basic properties of the and operation
+
+```agda
+left-unit-law-and-bool : {x : bool} → and-bool true x = x
+left-unit-law-and-bool = refl
+
+right-unit-law-and-bool : {x : bool} → and-bool x true = x
+right-unit-law-and-bool {true} = refl
+right-unit-law-and-bool {false} = refl
+
+left-zero-law-and-bool : {x : bool} → and-bool false x = false
+left-zero-law-and-bool = refl
+
+right-zero-law-and-bool : {x : bool} → and-bool x false = false
+right-zero-law-and-bool {true} = refl
+right-zero-law-and-bool {false} = refl
+
+commutative-and-bool : {x y : bool} → and-bool x y = and-bool y x
+commutative-and-bool {true} {true} = refl
+commutative-and-bool {true} {false} = refl
+commutative-and-bool {false} {true} = refl
+commutative-and-bool {false} {false} = refl
+
+idempotent-and-bool : {x : bool} → and-bool x x = x
+idempotent-and-bool {true} = refl
+idempotent-and-bool {false} = refl
+
+associative-and-bool :
+ {x y z : bool} → and-bool (and-bool x y) z = and-bool x (and-bool y z)
+associative-and-bool {true} {y} {z} = refl
+associative-and-bool {false} {y} {z} = refl
+```
+
+### Basic properties of the implication operation
+
+```agda
+left-unit-law-hom-bool : {x : bool} → hom-bool true x = x
+left-unit-law-hom-bool = refl
+
+right-neg-law-hom-bool : {x : bool} → hom-bool x false = neg-bool x
+right-neg-law-hom-bool {true} = refl
+right-neg-law-hom-bool {false} = refl
+
+left-zero-law-hom-bool : {x : bool} → hom-bool false x = true
+left-zero-law-hom-bool = refl
+
+right-zero-law-hom-bool : {x : bool} → hom-bool x true = true
+right-zero-law-hom-bool {true} = refl
+right-zero-law-hom-bool {false} = refl
+
+compute-hom-self-bool : {x : bool} → hom-bool x x = true
+compute-hom-self-bool {true} = refl
+compute-hom-self-bool {false} = refl
+```
+
+### Computing implication on connectives
+
+```agda
+compute-and-hom-bool :
+ {x y z : bool} → hom-bool (and-bool x y) z = hom-bool x (hom-bool y z)
+compute-and-hom-bool {true} {y} {z} = refl
+compute-and-hom-bool {false} {y} {z} = refl
+
+compute-or-hom-bool :
+ {x y z : bool} →
+ hom-bool (or-bool x y) z = and-bool (hom-bool x z) (hom-bool y z)
+compute-or-hom-bool {true} {true} {true} = refl
+compute-or-hom-bool {true} {false} {true} = refl
+compute-or-hom-bool {true} {true} {false} = refl
+compute-or-hom-bool {true} {false} {false} = refl
+compute-or-hom-bool {false} {y} {z} = refl
+
+distributive-hom-and-bool :
+ {x y z : bool} →
+ hom-bool x (and-bool y z) = and-bool (hom-bool x y) (hom-bool x z)
+distributive-hom-and-bool {true} {y} {z} = refl
+distributive-hom-and-bool {false} {y} {z} = refl
+```
+
+### Distributivity of conjunction over disjunction
+
+```agda
+distributive-and-or-bool :
+ {x y z : bool} →
+ and-bool x (or-bool y z) = or-bool (and-bool x y) (and-bool x z)
+distributive-and-or-bool {true} = refl
+distributive-and-or-bool {false} = refl
+```
+
+### Distributivity of disjunction over conjunction
+
+```agda
+distributive-or-and-bool :
+ {x y z : bool} →
+ or-bool x (and-bool y z) = and-bool (or-bool x y) (or-bool x z)
+distributive-or-and-bool {true} = refl
+distributive-or-and-bool {false} = refl
+```
+
+### The law of excluded middle
+
+```agda
+law-of-excluded-middle-bool :
+ {x : bool} → or-bool x (neg-bool x) = true
+law-of-excluded-middle-bool {true} = refl
+law-of-excluded-middle-bool {false} = refl
+```
+
+### Double negation elimination
+
+```agda
+double-negation-elim-bool : {x : bool} → neg-bool (neg-bool x) = x
+double-negation-elim-bool {true} = refl
+double-negation-elim-bool {false} = refl
+```
+
+### De Morgan's laws
+
+```agda
+de-morgans-law-bool :
+ {x y : bool} → neg-bool (and-bool x y) = or-bool (neg-bool x) (neg-bool y)
+de-morgans-law-bool {true} = refl
+de-morgans-law-bool {false} = refl
+
+de-morgans-law-bool' :
+ {x y : bool} → neg-bool (or-bool x y) = and-bool (neg-bool x) (neg-bool y)
+de-morgans-law-bool' {true} = refl
+de-morgans-law-bool' {false} = refl
+```
diff --git a/src/foundation/mere-equality.lagda.md b/src/foundation/mere-equality.lagda.md
index d5319cae0a..9e740772a4 100644
--- a/src/foundation/mere-equality.lagda.md
+++ b/src/foundation/mere-equality.lagda.md
@@ -10,9 +10,16 @@ module foundation.mere-equality where
open import foundation.action-on-identifications-functions
open import foundation.binary-relations
open import foundation.dependent-pair-types
+open import foundation.double-negation
+open import foundation.double-negation-dense-equality
+open import foundation.equality-dependent-pair-types
+open import foundation.equivalences
open import foundation.functoriality-propositional-truncation
+open import foundation.irrefutable-equality
open import foundation.propositional-truncations
open import foundation.reflecting-maps-equivalence-relations
+open import foundation.retracts-of-types
+open import foundation.transport-along-identifications
open import foundation.universe-levels
open import foundation-core.equivalence-relations
@@ -25,10 +32,16 @@ open import foundation-core.sets
## Idea
-Two elements in a type are said to be merely equal if there is an element of the
-propositionally truncated identity type between them.
+Two elements `x` and `y` in a type `A` are said to be
+{{#concept "merely equal" Agda=mere-eq}} if there is an element of the
+[propositionally truncated](foundation.propositional-truncations.md)
+[identity type](foundation-core.identity-types.md) between them.
-## Definition
+```text
+ ║ x = y ║₋₁
+```
+
+## Definitions
```agda
module _
@@ -45,6 +58,13 @@ module _
is-prop-mere-eq x y = is-prop-type-trunc-Prop
```
+### Types whose elements are all merely equal
+
+```agda
+all-elements-merely-equal : {l : Level} → UU l → UU l
+all-elements-merely-equal A = (x y : A) → mere-eq x y
+```
+
## Properties
### Reflexivity
@@ -83,10 +103,8 @@ abstract
```agda
mere-eq-equivalence-relation :
{l1 : Level} (A : UU l1) → equivalence-relation l1 A
-pr1 (mere-eq-equivalence-relation A) = mere-eq-Prop
-pr1 (pr2 (mere-eq-equivalence-relation A)) = refl-mere-eq
-pr1 (pr2 (pr2 (mere-eq-equivalence-relation A))) = symmetric-mere-eq
-pr2 (pr2 (pr2 (mere-eq-equivalence-relation A))) = transitive-mere-eq
+mere-eq-equivalence-relation A =
+ ( mere-eq-Prop , refl-mere-eq , symmetric-mere-eq , transitive-mere-eq)
```
### Any map into a set reflects mere equality
@@ -107,8 +125,7 @@ module _
reflecting-map-equivalence-relation
( mere-eq-equivalence-relation A)
( type-Set X)
- pr1 reflecting-map-mere-eq = f
- pr2 reflecting-map-mere-eq = reflects-mere-eq
+ reflecting-map-mere-eq = (f , reflects-mere-eq)
```
### If mere equality maps into the identity type of `A`, then `A` is a set
@@ -117,8 +134,64 @@ module _
is-set-mere-eq-in-id :
{l : Level} {A : UU l} → ((x y : A) → mere-eq x y → x = y) → is-set A
is-set-mere-eq-in-id =
- is-set-prop-in-id
- ( mere-eq)
- ( is-prop-mere-eq)
- ( refl-mere-eq)
+ is-set-prop-in-id mere-eq is-prop-mere-eq refl-mere-eq
+```
+
+In other words, if equality on `A` has an
+[ε-operator](foundation.hilberts-epsilon-operators.md), or "split support", then
+`A` is a set.
+
+### Retracts of types with merely equal elements
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ all-elements-merely-equal-retract-of :
+ B retract-of A → all-elements-merely-equal A → all-elements-merely-equal B
+ all-elements-merely-equal-retract-of (i , r , R) H x y =
+ rec-trunc-Prop
+ ( mere-eq-Prop x y)
+ ( λ p → unit-trunc-Prop (inv (R x) ∙ ap r p ∙ R y))
+ ( H (i x) (i y))
+
+ all-elements-merely-equal-equiv :
+ B ≃ A → all-elements-merely-equal A → all-elements-merely-equal B
+ all-elements-merely-equal-equiv e =
+ all-elements-merely-equal-retract-of (retract-equiv e)
+
+ all-elements-merely-equal-equiv' :
+ A ≃ B → all-elements-merely-equal A → all-elements-merely-equal B
+ all-elements-merely-equal-equiv' e =
+ all-elements-merely-equal-retract-of (retract-inv-equiv e)
+```
+
+### Dependent sums of types with merely equal elements
+
+```agda
+all-elements-merely-equal-Σ :
+ {l1 l2 : Level} {A : UU l1} {B : A → UU l2} →
+ all-elements-merely-equal A →
+ ((x : A) → all-elements-merely-equal (B x)) →
+ all-elements-merely-equal (Σ A B)
+all-elements-merely-equal-Σ {B = B} mA mB x y =
+ rec-trunc-Prop
+ ( mere-eq-Prop x y)
+ ( λ p → map-trunc-Prop (eq-pair-Σ p) (mB (pr1 y) (tr B p (pr2 x)) (pr2 y)))
+ ( mA (pr1 x) (pr1 y))
+```
+
+### Mere equality implies irrefutable equality
+
+```agda
+irrefutable-eq-mere-eq :
+ {l : Level} {A : UU l} {x y : A} → mere-eq x y → irrefutable-eq x y
+irrefutable-eq-mere-eq = intro-double-negation-type-trunc-Prop
+
+has-double-negation-dense-equality-all-elements-merely-equal :
+ {l : Level} {A : UU l} →
+ all-elements-merely-equal A → has-double-negation-dense-equality A
+has-double-negation-dense-equality-all-elements-merely-equal H x y =
+ irrefutable-eq-mere-eq (H x y)
```
diff --git a/src/foundation/null-homotopic-maps.lagda.md b/src/foundation/null-homotopic-maps.lagda.md
index 4a3da066c0..d3770cc648 100644
--- a/src/foundation/null-homotopic-maps.lagda.md
+++ b/src/foundation/null-homotopic-maps.lagda.md
@@ -12,7 +12,6 @@ open import foundation.commuting-triangles-of-identifications
open import foundation.constant-maps
open import foundation.dependent-pair-types
open import foundation.empty-types
-open import foundation.functoriality-dependent-pair-types
open import foundation.fundamental-theorem-of-identity-types
open import foundation.homotopy-induction
open import foundation.identity-types
@@ -29,6 +28,7 @@ open import foundation.weakly-constant-maps
open import foundation-core.contractible-types
open import foundation-core.equivalences
+open import foundation-core.functoriality-dependent-pair-types
open import foundation-core.homotopies
```
diff --git a/src/foundation/path-split-type-families.lagda.md b/src/foundation/path-split-type-families.lagda.md
index 690d6d1a74..54af7a8822 100644
--- a/src/foundation/path-split-type-families.lagda.md
+++ b/src/foundation/path-split-type-families.lagda.md
@@ -36,7 +36,7 @@ and `v` _over_ p. This condition is
[equivalent](foundation.logical-equivalences.md) to asking that `P` is a family
of [propositions](foundation-core.propositions.md).
-This condition is a direct rephrasing of stating that the
+This condition is a direct rephrasing of the statement that the
[action on identifications](foundation.action-on-identifications-functions.md)
of the first projection map `Σ A P → A` has a
[section](foundation-core.sections.md), and in this way is closely related to
diff --git a/src/foundation/projective-types.lagda.md b/src/foundation/projective-types.lagda.md
index f537366853..4ac853ef0d 100644
--- a/src/foundation/projective-types.lagda.md
+++ b/src/foundation/projective-types.lagda.md
@@ -15,7 +15,6 @@ open import foundation.surjective-maps
open import foundation.truncation-levels
open import foundation.universe-levels
-open import foundation-core.function-types
open import foundation-core.sets
open import foundation-core.truncated-types
```
@@ -76,5 +75,5 @@ is-projective l2 l3 k X =
## See also
-- The natural map `(X → A)/~ → (X → A/R)` was studied in
- [foundation.exponents-set-quotients](foundation.exponents-set-quotients.md)
+- The natural map `(X → A)/~ → (X → A/R)` is studied in
+ [`foundation.exponents-set-quotients`](foundation.exponents-set-quotients.md)
diff --git a/src/foundation/propositional-truncations.lagda.md b/src/foundation/propositional-truncations.lagda.md
index 2ae3713137..9888a5f5aa 100644
--- a/src/foundation/propositional-truncations.lagda.md
+++ b/src/foundation/propositional-truncations.lagda.md
@@ -8,6 +8,7 @@ module foundation.propositional-truncations where
```agda
open import foundation.action-on-identifications-functions
+open import foundation.constant-type-families
open import foundation.dependent-pair-types
open import foundation.functoriality-cartesian-product-types
open import foundation.logical-equivalences
@@ -19,6 +20,7 @@ open import foundation.universe-levels
open import foundation-core.cartesian-product-types
open import foundation-core.contractible-types
open import foundation-core.coproduct-types
+open import foundation-core.dependent-identifications
open import foundation-core.equivalences
open import foundation-core.function-types
open import foundation-core.identity-types
@@ -46,22 +48,22 @@ postulate of the existence of truncations at all levels, found in the file
type-trunc-Prop : {l : Level} → UU l → UU l
type-trunc-Prop = type-trunc neg-one-𝕋
-unit-trunc-Prop : {l : Level} {A : UU l} → A → type-trunc-Prop A
+║_║₋₁ : {l : Level} → UU l → UU l
+║_║₋₁ = type-trunc-Prop
+
+unit-trunc-Prop : {l : Level} {A : UU l} → A → ║ A ║₋₁
unit-trunc-Prop = unit-trunc
-is-prop-type-trunc-Prop : {l : Level} {A : UU l} → is-prop (type-trunc-Prop A)
+is-prop-type-trunc-Prop : {l : Level} {A : UU l} → is-prop (║ A ║₋₁)
is-prop-type-trunc-Prop = is-trunc-type-trunc
all-elements-equal-type-trunc-Prop :
- {l : Level} {A : UU l} → all-elements-equal (type-trunc-Prop A)
+ {l : Level} {A : UU l} → all-elements-equal (║ A ║₋₁)
all-elements-equal-type-trunc-Prop {l} {A} =
eq-is-prop' (is-prop-type-trunc-Prop {l} {A})
trunc-Prop : {l : Level} → UU l → Prop l
trunc-Prop = trunc neg-one-𝕋
-
-║_║₋₁ : {l : Level} → UU l → UU l
-║_║₋₁ = type-trunc-Prop
```
**Notation.** The [box drawings double vertical](https://codepoints.net/U+2551)
@@ -76,10 +78,10 @@ the list.
```agda
abstract
is-prop-condition-ind-trunc-Prop' :
- {l1 l2 : Level} {A : UU l1} {P : type-trunc-Prop A → UU l2} →
- ( (x y : type-trunc-Prop A) (u : P x) (v : P y) →
- tr P (all-elements-equal-type-trunc-Prop x y) u = v) →
- (x : type-trunc-Prop A) → is-prop (P x)
+ {l1 l2 : Level} {A : UU l1} {P : ║ A ║₋₁ → UU l2} →
+ ( (x y : ║ A ║₋₁) (u : P x) (v : P y) →
+ dependent-identification P (all-elements-equal-type-trunc-Prop x y) u v) →
+ (x : ║ A ║₋₁) → is-prop (P x)
is-prop-condition-ind-trunc-Prop' {P = P} H x =
is-prop-all-elements-equal
( λ u v →
@@ -93,29 +95,46 @@ abstract
```agda
ind-trunc-Prop' :
- {l l1 : Level} {A : UU l1} (P : type-trunc-Prop A → UU l)
+ {l l1 : Level} {A : UU l1} (P : ║ A ║₋₁ → UU l)
(f : (x : A) → P (unit-trunc-Prop x))
(H :
- (x y : type-trunc-Prop A) (u : P x) (v : P y) →
- tr P (all-elements-equal-type-trunc-Prop x y) u = v) →
- (x : type-trunc-Prop A) → P x
+ (x y : ║ A ║₋₁) (u : P x) (v : P y) →
+ dependent-identification P (all-elements-equal-type-trunc-Prop x y) u v) →
+ (x : ║ A ║₋₁) → P x
ind-trunc-Prop' P f H =
function-dependent-universal-property-trunc
- ( λ x → pair (P x) (is-prop-condition-ind-trunc-Prop' H x))
+ ( λ x → (P x , is-prop-condition-ind-trunc-Prop' H x))
( f)
```
+### The recursion principle for propositional truncations
+
+```agda
+rec-trunc-Prop' :
+ {l l1 : Level} {A : UU l1} {P : UU l}
+ (f : A → P) (H : ║ A ║₋₁ → (u v : P) → u = v) →
+ ║ A ║₋₁ → P
+rec-trunc-Prop' {P = P} f H =
+ ind-trunc-Prop'
+ ( λ _ → P)
+ ( f)
+ ( λ x y u v →
+ map-compute-dependent-identification-constant-type-family
+ ( all-elements-equal-type-trunc-Prop x y)
+ ( H x u v))
+```
+
### The propositional induction principle for propositional truncations
```agda
module _
- {l l1 : Level} {A : UU l1} (P : type-trunc-Prop A → Prop l)
+ {l l1 : Level} {A : UU l1} (P : ║ A ║₋₁ → Prop l)
where
abstract
ind-trunc-Prop :
((x : A) → type-Prop (P (unit-trunc-Prop x))) →
- (( y : type-trunc-Prop A) → type-Prop (P y))
+ (( y : ║ A ║₋₁) → type-Prop (P y))
ind-trunc-Prop f =
ind-trunc-Prop' (type-Prop ∘ P) f
( λ x y u v → eq-is-prop (is-prop-type-Prop (P y)))
@@ -135,7 +154,7 @@ module _
abstract
rec-trunc-Prop :
- (A → type-Prop P) → (type-trunc-Prop A → type-Prop P)
+ (A → type-Prop P) → (║ A ║₋₁ → type-Prop P)
rec-trunc-Prop = ind-trunc-Prop (λ _ → P)
compute-rec-trunc-Prop :
@@ -186,15 +205,15 @@ abstract
abstract
apply-universal-property-trunc-Prop :
- {l1 l2 : Level} {A : UU l1} (t : type-trunc-Prop A) (P : Prop l2) →
+ {l1 l2 : Level} {A : UU l1} (t : ║ A ║₋₁) (P : Prop l2) →
(A → type-Prop P) → type-Prop P
apply-universal-property-trunc-Prop t P f =
map-universal-property-trunc-Prop P f t
abstract
apply-twice-universal-property-trunc-Prop :
- {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} (u : type-trunc-Prop A)
- (v : type-trunc-Prop B) (P : Prop l3) →
+ {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} (u : ║ A ║₋₁)
+ (v : ║ B ║₋₁) (P : Prop l3) →
(A → B → type-Prop P) → type-Prop P
apply-twice-universal-property-trunc-Prop u v P f =
apply-universal-property-trunc-Prop u P
@@ -203,7 +222,7 @@ abstract
abstract
apply-three-times-universal-property-trunc-Prop :
{l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {C : UU l3}
- (u : type-trunc-Prop A) (v : type-trunc-Prop B) (w : type-trunc-Prop C) →
+ (u : ║ A ║₋₁) (v : ║ B ║₋₁) (w : ║ C ║₋₁) →
(P : Prop l4) → (A → B → C → type-Prop P) → type-Prop P
apply-three-times-universal-property-trunc-Prop u v w P f =
apply-universal-property-trunc-Prop u P
@@ -214,12 +233,12 @@ abstract
```agda
is-trunc-trunc-Prop :
- {l : Level} (k : 𝕋) {A : UU l} → is-trunc (succ-𝕋 k) (type-trunc-Prop A)
+ {l : Level} (k : 𝕋) {A : UU l} → is-trunc (succ-𝕋 k) (║ A ║₋₁)
is-trunc-trunc-Prop k = is-trunc-is-prop k is-prop-type-trunc-Prop
truncated-type-trunc-Prop :
{l : Level} (k : 𝕋) → UU l → Truncated-Type l (succ-𝕋 k)
-pr1 (truncated-type-trunc-Prop k A) = type-trunc-Prop A
+pr1 (truncated-type-trunc-Prop k A) = ║ A ║₋₁
pr2 (truncated-type-trunc-Prop k A) = is-trunc-trunc-Prop k
set-trunc-Prop : {l : Level} → UU l → Set l
@@ -233,7 +252,7 @@ module _
{l : Level} (A : Prop l)
where
- equiv-unit-trunc-Prop : type-Prop A ≃ type-trunc-Prop (type-Prop A)
+ equiv-unit-trunc-Prop : type-Prop A ≃ ║ type-Prop A ║₋₁
equiv-unit-trunc-Prop = equiv-unit-trunc A
```
@@ -246,7 +265,7 @@ module _
abstract
map-idempotent-trunc-Prop :
- type-trunc-Prop (type-trunc-Prop A) → type-trunc-Prop A
+ ║ (║ A ║₋₁) ║₋₁ → ║ A ║₋₁
map-idempotent-trunc-Prop =
map-universal-property-trunc-Prop (trunc-Prop A) id
@@ -259,13 +278,13 @@ module _
( unit-trunc-Prop)
idempotent-trunc-Prop :
- type-trunc-Prop (type-trunc-Prop A) ≃ type-trunc-Prop A
+ ║ (║ A ║₋₁) ║₋₁ ≃ ║ A ║₋₁
pr1 idempotent-trunc-Prop = map-idempotent-trunc-Prop
pr2 idempotent-trunc-Prop = is-equiv-map-idempotent-trunc-Prop
abstract
is-equiv-map-inv-idempotent-trunc-Prop :
- is-equiv (unit-trunc-Prop {A = type-trunc-Prop A})
+ is-equiv (unit-trunc-Prop {A = ║ A ║₋₁})
is-equiv-map-inv-idempotent-trunc-Prop =
is-equiv-has-converse-is-prop
( is-prop-type-trunc-Prop)
@@ -273,7 +292,7 @@ module _
( map-idempotent-trunc-Prop)
inv-idempotent-trunc-Prop :
- type-trunc-Prop A ≃ type-trunc-Prop (type-trunc-Prop A)
+ ║ A ║₋₁ ≃ ║ (║ A ║₋₁) ║₋₁
pr1 inv-idempotent-trunc-Prop = unit-trunc-Prop
pr2 inv-idempotent-trunc-Prop = is-equiv-map-inv-idempotent-trunc-Prop
```
@@ -294,11 +313,11 @@ abstract
( is-propositional-truncation-trunc-Prop A)
module _
- {l1 l2 : Level} {A : UU l1} (P : type-trunc-Prop A → Prop l2)
+ {l1 l2 : Level} {A : UU l1} (P : ║ A ║₋₁ → Prop l2)
where
equiv-dependent-universal-property-trunc-Prop :
- ((y : type-trunc-Prop A) → type-Prop (P y)) ≃
+ ((y : ║ A ║₋₁) → type-Prop (P y)) ≃
((x : A) → type-Prop (P (unit-trunc-Prop x)))
pr1 equiv-dependent-universal-property-trunc-Prop =
precomp-Π unit-trunc-Prop (type-Prop ∘ P)
@@ -306,7 +325,7 @@ module _
dependent-universal-property-trunc-Prop P
apply-dependent-universal-property-trunc-Prop :
- (y : type-trunc-Prop A) → ((x : A) → type-Prop (P (unit-trunc-Prop x))) →
+ (y : ║ A ║₋₁) → ((x : A) → type-Prop (P (unit-trunc-Prop x))) →
type-Prop (P y)
apply-dependent-universal-property-trunc-Prop y f =
map-inv-equiv equiv-dependent-universal-property-trunc-Prop f y
@@ -339,17 +358,17 @@ equiv-product-trunc-Prop A A' =
map-distributive-trunc-product-Prop :
{l1 l2 : Level} {A : UU l1} {B : UU l2} →
- type-trunc-Prop (A × B) → type-trunc-Prop A × type-trunc-Prop B
+ ║ A × B ║₋₁ → ║ A ║₋₁ × ║ B ║₋₁
map-distributive-trunc-product-Prop {l1} {l2} {A} {B} =
map-universal-property-trunc-Prop
( pair
- ( type-trunc-Prop A × type-trunc-Prop B)
+ ( ║ A ║₋₁ × ║ B ║₋₁)
( is-prop-product is-prop-type-trunc-Prop is-prop-type-trunc-Prop))
( map-product unit-trunc-Prop unit-trunc-Prop)
map-inv-distributive-trunc-product-Prop :
{l1 l2 : Level} {A : UU l1} {B : UU l2} →
- type-trunc-Prop A × type-trunc-Prop B → type-trunc-Prop (A × B)
+ ║ A ║₋₁ × ║ B ║₋₁ → ║ A × B ║₋₁
map-inv-distributive-trunc-product-Prop {l1} {l2} {A} {B} t =
map-universal-property-trunc-Prop
( trunc-Prop (A × B))
@@ -372,7 +391,7 @@ abstract
distributive-trunc-product-Prop :
{l1 l2 : Level} {A : UU l1} {B : UU l2} →
- type-trunc-Prop (A × B) ≃ (type-trunc-Prop A × type-trunc-Prop B)
+ ║ A × B ║₋₁ ≃ ║ A ║₋₁ × ║ B ║₋₁
pr1 distributive-trunc-product-Prop = map-distributive-trunc-product-Prop
pr2 distributive-trunc-product-Prop =
is-equiv-map-distributive-trunc-product-Prop
@@ -389,7 +408,7 @@ abstract
inv-distributive-trunc-product-Prop :
{l1 l2 : Level} {A : UU l1} {B : UU l2} →
- ( type-trunc-Prop A × type-trunc-Prop B) ≃ type-trunc-Prop (A × B)
+ ( ║ A ║₋₁ × ║ B ║₋₁) ≃ ║ A × B ║₋₁
pr1 inv-distributive-trunc-product-Prop =
map-inv-distributive-trunc-product-Prop
pr2 inv-distributive-trunc-product-Prop =
@@ -400,16 +419,18 @@ pr2 inv-distributive-trunc-product-Prop =
```agda
module _
- {l : Level} {A : UU l} where
+ {l : Level} {A : UU l}
+ where
+
map-trunc-Prop-diagonal-coproduct :
- type-trunc-Prop (A + A) → type-trunc-Prop A
+ ║ A + A ║₋₁ → ║ A ║₋₁
map-trunc-Prop-diagonal-coproduct =
map-universal-property-trunc-Prop
( trunc-Prop A)
( unit-trunc ∘ rec-coproduct id id)
map-inv-trunc-Prop-diagonal-coproduct :
- type-trunc-Prop A → type-trunc-Prop (A + A)
+ ║ A ║₋₁ → ║ A + A ║₋₁
map-inv-trunc-Prop-diagonal-coproduct =
map-universal-property-trunc-Prop
( trunc-Prop (A + A))
@@ -433,13 +454,13 @@ module _
map-trunc-Prop-diagonal-coproduct
equiv-trunc-Prop-diagonal-coproduct :
- type-trunc-Prop (A + A) ≃ type-trunc-Prop A
+ ║ A + A ║₋₁ ≃ ║ A ║₋₁
pr1 equiv-trunc-Prop-diagonal-coproduct = map-trunc-Prop-diagonal-coproduct
pr2 equiv-trunc-Prop-diagonal-coproduct =
is-equiv-map-trunc-Prop-diagonal-coproduct
inv-equiv-trunc-Prop-diagonal-coproduct :
- type-trunc-Prop A ≃ type-trunc-Prop (A + A)
+ ║ A ║₋₁ ≃ ║ A + A ║₋₁
pr1 inv-equiv-trunc-Prop-diagonal-coproduct =
map-inv-trunc-Prop-diagonal-coproduct
pr2 inv-equiv-trunc-Prop-diagonal-coproduct =
diff --git a/src/foundation/split-surjective-maps.lagda.md b/src/foundation/split-surjective-maps.lagda.md
index 10fb45cb17..be0a77d97c 100644
--- a/src/foundation/split-surjective-maps.lagda.md
+++ b/src/foundation/split-surjective-maps.lagda.md
@@ -95,25 +95,22 @@ module _
retraction-is-split-surjective-is-injective :
is-injective f → is-split-surjective f → retraction f
- pr1 (retraction-is-split-surjective-is-injective l s) = pr1 ∘ s
- pr2 (retraction-is-split-surjective-is-injective l s) = l ∘ pr2 ∘ s ∘ f
+ retraction-is-split-surjective-is-injective l s = (pr1 ∘ s , l ∘ pr2 ∘ s ∘ f)
is-equiv-is-split-surjective-is-injective :
is-injective f → is-split-surjective f → is-equiv f
- pr1 (is-equiv-is-split-surjective-is-injective l s) =
- section-is-split-surjective f s
- pr2 (is-equiv-is-split-surjective-is-injective l s) =
- retraction-is-split-surjective-is-injective l s
+ is-equiv-is-split-surjective-is-injective l s =
+ ( section-is-split-surjective f s ,
+ retraction-is-split-surjective-is-injective l s)
is-split-surjective-is-equiv : is-equiv f → is-split-surjective f
is-split-surjective-is-equiv = is-split-surjective-section f ∘ pr1
is-split-surjective-is-injective-is-equiv :
is-equiv f → is-injective f × is-split-surjective f
- pr1 (is-split-surjective-is-injective-is-equiv is-equiv-f) =
- is-injective-is-equiv is-equiv-f
- pr2 (is-split-surjective-is-injective-is-equiv is-equiv-f) =
- is-split-surjective-is-equiv is-equiv-f
+ is-split-surjective-is-injective-is-equiv is-equiv-f =
+ ( is-injective-is-equiv is-equiv-f ,
+ is-split-surjective-is-equiv is-equiv-f)
```
## See also
diff --git a/src/foundation/structure.lagda.md b/src/foundation/structure.lagda.md
index 819a679062..68d4e2d873 100644
--- a/src/foundation/structure.lagda.md
+++ b/src/foundation/structure.lagda.md
@@ -26,18 +26,31 @@ consists of a type `A` _equipped_ with an element of type `𝒫 A`.
## Definitions
+### Structure at a universe
+
```agda
structure : {l1 l2 : Level} (𝒫 : UU l1 → UU l2) → UU (lsuc l1 ⊔ l2)
structure {l1} 𝒫 = Σ (UU l1) 𝒫
-fam-structure :
- {l1 l2 l3 : Level} (𝒫 : UU l1 → UU l2) (A : UU l3) → UU (lsuc l1 ⊔ l2 ⊔ l3)
-fam-structure 𝒫 A = A → structure 𝒫
+structure-family :
+ {l1 l2 l3 : Level} (𝒫 : UU l1 → UU l2) {A : UU l3} →
+ (A → UU l1) → UU (l2 ⊔ l3)
+structure-family 𝒫 {A} B = (x : A) → 𝒫 (B x)
+
+structured-family :
+ {l1 l2 l3 : Level} (𝒫 : UU l1 → UU l2) → UU l3 → UU (lsuc l1 ⊔ l2 ⊔ l3)
+structured-family 𝒫 A = A → structure 𝒫
structure-map :
{l1 l2 l3 : Level} (𝒫 : UU (l1 ⊔ l2) → UU l3) {A : UU l1} {B : UU l2}
(f : A → B) → UU (l2 ⊔ l3)
-structure-map 𝒫 {A} {B} f = (b : B) → 𝒫 (fiber f b)
+structure-map 𝒫 {A} {B} f = structure-family 𝒫 (fiber f)
+
+structured-map :
+ {l1 l2 l3 : Level}
+ (𝒫 : UU (l1 ⊔ l2) → UU l3)
+ (A : UU l1) (B : UU l2) → UU (l1 ⊔ l2 ⊔ l3)
+structured-map 𝒫 A B = Σ (A → B) (structure-map 𝒫)
hom-structure :
{l1 l2 l3 : Level} (𝒫 : UU (l1 ⊔ l2) → UU l3) →
diff --git a/src/foundation/structured-type-duality.lagda.md b/src/foundation/structured-type-duality.lagda.md
index e7d04bcb07..cdbbcfc227 100644
--- a/src/foundation/structured-type-duality.lagda.md
+++ b/src/foundation/structured-type-duality.lagda.md
@@ -36,7 +36,7 @@ Slice-structure l P B = Σ (UU l) (λ A → hom-structure P A B)
equiv-Fiber-structure :
{l1 l2 : Level} (l : Level) (P : UU (l1 ⊔ l) → UU l2) (B : UU l1) →
- Slice-structure (l1 ⊔ l) P B ≃ fam-structure P B
+ Slice-structure (l1 ⊔ l) P B ≃ structured-family P B
equiv-Fiber-structure {l1} {l3} l P B =
( ( inv-distributive-Π-Σ) ∘e
( equiv-Σ
diff --git a/src/foundation/surjective-maps.lagda.md b/src/foundation/surjective-maps.lagda.md
index f6fc1ffb05..3a233849c0 100644
--- a/src/foundation/surjective-maps.lagda.md
+++ b/src/foundation/surjective-maps.lagda.md
@@ -41,6 +41,7 @@ open import foundation-core.homotopies
open import foundation-core.precomposition-dependent-functions
open import foundation-core.propositional-maps
open import foundation-core.propositions
+open import foundation-core.retracts-of-types
open import foundation-core.sections
open import foundation-core.sets
open import foundation-core.subtypes
@@ -225,6 +226,16 @@ abstract
is-surjective-has-section (g , G) b = unit-trunc-Prop (g b , G b)
```
+### The underlying surjection of a retract
+
+```agda
+surjection-retract :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} →
+ A retract-of B → B ↠ A
+surjection-retract R =
+ ( map-retraction-retract R , is-surjective-has-section (section-retract R))
+```
+
### Any split surjective map is surjective
```agda
diff --git a/src/foundation/uniformly-decidable-type-families.lagda.md b/src/foundation/uniformly-decidable-type-families.lagda.md
index 01904ea182..0832b90c8a 100644
--- a/src/foundation/uniformly-decidable-type-families.lagda.md
+++ b/src/foundation/uniformly-decidable-type-families.lagda.md
@@ -9,25 +9,29 @@ module foundation.uniformly-decidable-type-families where
```agda
open import foundation.contractible-types
open import foundation.coproduct-types
+open import foundation.decidable-type-families
open import foundation.decidable-types
open import foundation.dependent-pair-types
+open import foundation.double-negation-dense-equality
open import foundation.equality-coproduct-types
+open import foundation.functoriality-coproduct-types
open import foundation.inhabited-types
+open import foundation.irrefutable-equality
+open import foundation.mere-equality
open import foundation.negation
open import foundation.propositional-truncations
open import foundation.propositions
+open import foundation.subtypes
+open import foundation.transport-along-identifications
open import foundation.truncated-types
open import foundation.truncation-levels
open import foundation.type-arithmetic-empty-type
open import foundation.universe-levels
-open import foundation-core.cartesian-product-types
-open import foundation-core.contractible-maps
open import foundation-core.empty-types
-open import foundation-core.equivalences
open import foundation-core.function-types
-open import foundation-core.homotopies
-open import foundation-core.identity-types
+
+open import logic.propositionally-decidable-types
```
@@ -63,7 +67,7 @@ is-decidable-is-uniformly-decidable-family (inl f) x = inl (f x)
is-decidable-is-uniformly-decidable-family (inr g) x = inr (g x)
```
-### The uniform decidability predicate on a family of truncated types
+### The uniform decidability predicate on a family of contractible types
```agda
module _
@@ -132,6 +136,16 @@ module _
rec-trunc-Prop
( is-prop-Prop (is-uniformly-decidable-family B))
( is-prop-is-uniformly-decidable-family-is-inhabited-base' H)
+
+is-uniformly-decidable-family-Prop :
+ {l1 l2 : Level}
+ (A : Inhabited-Type l1) (B : subtype l2 (type-Inhabited-Type A)) →
+ Prop (l1 ⊔ l2)
+is-uniformly-decidable-family-Prop (A , |a|) B =
+ ( is-uniformly-decidable-family (is-in-subtype B)) ,
+ ( is-prop-is-uniformly-decidable-family-is-inhabited-base
+ ( is-prop-is-in-subtype B)
+ ( |a|))
```
### The uniform decidability predicate on a family of truncated types
@@ -173,3 +187,76 @@ module _
( succ-𝕋 (succ-𝕋 k)) H _ =
is-trunc-succ-succ-is-uniformly-decidable-family k H
```
+
+### Every family of decidable propositions over a decidable base with double negation dense equality is uniformly decidable
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : A → UU l2}
+ (H : has-double-negation-dense-equality A)
+ (dB : is-decidable-family B)
+ where
+
+ abstract
+ is-uniformly-decidable-family-has-double-negation-dense-equality-base :
+ is-decidable A →
+ is-uniformly-decidable-family B
+ is-uniformly-decidable-family-has-double-negation-dense-equality-base
+ (inl a) =
+ map-coproduct
+ ( λ b x →
+ double-negation-elim-is-decidable
+ ( dB x)
+ ( λ nb → H a x (λ p → nb (tr B p b))))
+ ( λ nb x b → H x a (λ p → nb (tr B p b)))
+ ( dB a)
+ is-uniformly-decidable-family-has-double-negation-dense-equality-base
+ (inr na) =
+ inr (λ x _ → na x)
+
+ abstract
+ is-uniformly-decidable-family-has-double-negation-dense-equality-base' :
+ is-inhabited-or-empty A →
+ ((x : A) → is-prop (B x)) →
+ is-uniformly-decidable-family B
+ is-uniformly-decidable-family-has-double-negation-dense-equality-base'
+ ( inl |a|) K =
+ rec-trunc-Prop
+ ( is-uniformly-decidable-family-Prop (A , |a|) (λ x → (B x , K x)))
+ ( is-uniformly-decidable-family-has-double-negation-dense-equality-base ∘
+ inl)
+ ( |a|)
+ is-uniformly-decidable-family-has-double-negation-dense-equality-base'
+ ( inr na) K =
+ is-uniformly-decidable-family-has-double-negation-dense-equality-base
+ ( inr na)
+```
+
+### A family of decidable propositions over a decidable base with mere equality is uniformly decidable
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : A → UU l2}
+ (H : all-elements-merely-equal A)
+ (dB : is-decidable-family B)
+ where
+
+ abstract
+ is-uniformly-decidable-family-all-elements-merely-equal-base :
+ is-decidable A →
+ is-uniformly-decidable-family B
+ is-uniformly-decidable-family-all-elements-merely-equal-base =
+ is-uniformly-decidable-family-has-double-negation-dense-equality-base
+ ( has-double-negation-dense-equality-all-elements-merely-equal H)
+ ( dB)
+
+ abstract
+ is-uniformly-decidable-family-all-elements-merely-equal-base' :
+ is-inhabited-or-empty A →
+ ((x : A) → is-prop (B x)) →
+ is-uniformly-decidable-family B
+ is-uniformly-decidable-family-all-elements-merely-equal-base' =
+ is-uniformly-decidable-family-has-double-negation-dense-equality-base'
+ ( has-double-negation-dense-equality-all-elements-merely-equal H)
+ ( dB)
+```
diff --git a/src/foundation/universal-property-identity-types.lagda.md b/src/foundation/universal-property-identity-types.lagda.md
index 4904b22306..bf40f8734e 100644
--- a/src/foundation/universal-property-identity-types.lagda.md
+++ b/src/foundation/universal-property-identity-types.lagda.md
@@ -26,7 +26,6 @@ open import foundation-core.contractible-maps
open import foundation-core.contractible-types
open import foundation-core.families-of-equivalences
open import foundation-core.fibers-of-maps
-open import foundation-core.function-types
open import foundation-core.functoriality-dependent-pair-types
open import foundation-core.homotopies
open import foundation-core.propositional-maps
diff --git a/src/literature/introduction-to-homotopy-type-theory.lagda.md b/src/literature/introduction-to-homotopy-type-theory.lagda.md
index 9bace413bb..b539482f7d 100644
--- a/src/literature/introduction-to-homotopy-type-theory.lagda.md
+++ b/src/literature/introduction-to-homotopy-type-theory.lagda.md
@@ -302,16 +302,16 @@ open import foundation.booleans using
; ind-bool)
-- (a)
-open import foundation.booleans using
+open import foundation.logical-operations-booleans using
( neg-bool)
-- (b)
-open import foundation.booleans using
- ( conjunction-bool)
+open import foundation.logical-operations-booleans using
+ ( and-bool)
-- (c)
-open import foundation.booleans using
- ( disjunction-bool)
+open import foundation.logical-operations-booleans using
+ ( or-bool)
```
**Exercise 4.3.** Double negation.
@@ -336,7 +336,7 @@ open import foundation.double-negation using
( ¬¬_
; intro-double-negation -- P → ¬¬P
; map-double-negation -- (P → Q) → (¬¬P → ¬¬Q)
- ; double-negation-extend -- (P → ¬¬Q) → (¬¬P → ¬¬Q)
+ ; extend-double-negation -- (P → ¬¬Q) → (¬¬P → ¬¬Q)
)
-- (c)
@@ -345,7 +345,7 @@ open import foundation.double-negation using
; double-negation-Peirces-law -- ¬¬(((P → Q) → P) → P)
; double-negation-linearity-implication -- ¬¬((P → Q) + (Q → P))
)
-open import foundation.irrefutable-propositions using
+open import logic.irrefutable-types using
( is-irrefutable-is-decidable -- ¬¬(P + ¬P)
)
@@ -382,7 +382,7 @@ _ =
( double-negation-elim-neg (¬ Q))
-- (f)
-open import foundation.irrefutable-propositions using
+open import logic.irrefutable-types using
( is-irrefutable-product -- ¬¬A → ¬¬B → ¬¬(A × B)
)
@@ -935,7 +935,7 @@ _ : (x y : bool) → (x = y) ↔ Eq-bool x y
_ = λ x y → (Eq-eq-bool , eq-Eq-bool)
-- (c)
-open import foundation.booleans using
+open import foundation.logical-operations-booleans using
( neq-neg-bool -- b ≠ neg-bool b
)
_ : ¬ (false = true)
@@ -1753,7 +1753,7 @@ open import elementary-number-theory.collatz-conjecture using
```agda
open import foundation.decidable-types using
- ( idempotent-is-decidable -- is-decidable (is-decidable P) → is-decidable P
+ ( map-idempotent-is-decidable -- is-decidable (is-decidable P) → is-decidable P
)
```
diff --git a/src/logic.lagda.md b/src/logic.lagda.md
index 840556f77d..601198477e 100644
--- a/src/logic.lagda.md
+++ b/src/logic.lagda.md
@@ -14,11 +14,19 @@ open import logic.de-morgan-propositions public
open import logic.de-morgan-subtypes public
open import logic.de-morgan-types public
open import logic.de-morgans-law public
+open import logic.dirk-gentlys-principle public
+open import logic.double-negation-dense-maps public
+open import logic.double-negation-dense-subtypes public
open import logic.double-negation-eliminating-maps public
open import logic.double-negation-elimination public
open import logic.double-negation-stable-embeddings public
open import logic.double-negation-stable-subtypes public
open import logic.functoriality-existential-quantification public
+open import logic.irrefutable-types public
open import logic.markovian-types public
open import logic.markovs-principle public
+open import logic.propositional-double-negation-elimination public
+open import logic.propositionally-decidable-maps public
+open import logic.propositionally-decidable-types public
+open import logic.propositionally-double-negation-eliminating-maps public
```
diff --git a/src/logic/complements-decidable-subtypes.lagda.md b/src/logic/complements-decidable-subtypes.lagda.md
index ae2a775f33..44304ffbcd 100644
--- a/src/logic/complements-decidable-subtypes.lagda.md
+++ b/src/logic/complements-decidable-subtypes.lagda.md
@@ -13,21 +13,19 @@ open import foundation.decidable-propositions
open import foundation.decidable-subtypes
open import foundation.decidable-types
open import foundation.dependent-pair-types
-open import foundation.double-negation-stable-propositions
open import foundation.evaluation-functions
open import foundation.full-subtypes
open import foundation.involutions
-open import foundation.negation
-open import foundation.postcomposition-functions
-open import foundation.powersets
open import foundation.propositional-truncations
+open import foundation.propositions
+open import foundation.type-arithmetic-coproduct-types
+open import foundation.type-arithmetic-dependent-pair-types
open import foundation.unions-subtypes
open import foundation.universe-levels
+open import foundation-core.equivalences
open import foundation-core.function-types
open import foundation-core.subtypes
-
-open import logic.double-negation-stable-subtypes
```
@@ -44,9 +42,20 @@ the elements that are not in `B`.
### Complements of decidable subtypes
```agda
-complement-decidable-subtype :
- {l1 l2 : Level} {A : UU l1} → decidable-subtype l2 A → decidable-subtype l2 A
-complement-decidable-subtype P x = neg-Decidable-Prop (P x)
+module _
+ {l1 l2 : Level} {A : UU l1} (P : decidable-subtype l2 A)
+ where
+
+ complement-decidable-subtype : decidable-subtype l2 A
+ complement-decidable-subtype x = neg-Decidable-Prop (P x)
+
+ type-complement-decidable-subtype : UU (l1 ⊔ l2)
+ type-complement-decidable-subtype =
+ type-decidable-subtype complement-decidable-subtype
+
+ is-in-complement-decidable-subtype : A → UU l2
+ is-in-complement-decidable-subtype =
+ is-in-decidable-subtype complement-decidable-subtype
```
## Properties
@@ -98,3 +107,31 @@ module _
( subtype-decidable-subtype P)
( is-decidable-decidable-subtype P)
```
+
+### The coproduct decomposition associated to a decidable subtype
+
+Every decidable subtype `P ⊆ A` decomposes `A` into a coproduct `A ≃ (P + A∖P)`.
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} (P : decidable-subtype l2 A)
+ where
+
+ equiv-coproduct-decomposition-decidable-subtype :
+ A ≃ type-decidable-subtype P + type-complement-decidable-subtype P
+ equiv-coproduct-decomposition-decidable-subtype =
+ equivalence-reasoning
+ A
+ ≃ Σ A (λ x → is-decidable (is-in-decidable-subtype P x))
+ by
+ inv-right-unit-law-Σ-is-contr
+ ( λ x →
+ is-proof-irrelevant-is-prop
+ ( is-prop-is-decidable (is-prop-is-in-decidable-subtype P x))
+ ( is-decidable-decidable-subtype P x))
+ ≃ type-decidable-subtype P + type-complement-decidable-subtype P
+ by
+ left-distributive-Σ-coproduct A
+ ( is-in-decidable-subtype P)
+ ( is-in-complement-decidable-subtype P)
+```
diff --git a/src/logic/de-morgan-types.lagda.md b/src/logic/de-morgan-types.lagda.md
index a87cd18593..37de751b7a 100644
--- a/src/logic/de-morgan-types.lagda.md
+++ b/src/logic/de-morgan-types.lagda.md
@@ -8,7 +8,6 @@ module logic.de-morgan-types where
```agda
open import foundation.cartesian-product-types
-open import foundation.conjunction
open import foundation.contractible-types
open import foundation.coproduct-types
open import foundation.decidable-types
@@ -16,13 +15,9 @@ open import foundation.dependent-pair-types
open import foundation.disjunction
open import foundation.double-negation
open import foundation.empty-types
-open import foundation.evaluation-functions
open import foundation.function-types
-open import foundation.identity-types
-open import foundation.irrefutable-propositions
open import foundation.logical-equivalences
open import foundation.negation
-open import foundation.precomposition-functions
open import foundation.propositional-truncations
open import foundation.retracts-of-types
open import foundation.truncation-levels
@@ -34,7 +29,8 @@ open import foundation-core.decidable-propositions
open import foundation-core.equivalences
open import foundation-core.propositions
-open import logic.de-morgans-law
+open import logic.irrefutable-types
+open import logic.propositionally-decidable-types
```
@@ -249,7 +245,8 @@ module _
### It is irrefutable that a type is De Morgan
```agda
-is-irrefutable-is-de-morgan : {l : Level} {A : UU l} → ¬¬ (is-de-morgan A)
+is-irrefutable-is-de-morgan :
+ {l : Level} {A : UU l} → is-irrefutable (is-de-morgan A)
is-irrefutable-is-de-morgan = is-irrefutable-is-decidable
```
diff --git a/src/logic/dirk-gentlys-principle.lagda.md b/src/logic/dirk-gentlys-principle.lagda.md
new file mode 100644
index 0000000000..a0a110c912
--- /dev/null
+++ b/src/logic/dirk-gentlys-principle.lagda.md
@@ -0,0 +1,95 @@
+# Dirk Gently's principle
+
+```agda
+module logic.dirk-gentlys-principle where
+```
+
+Imports
+
+```agda
+open import foundation.coproduct-types
+open import foundation.decidable-types
+open import foundation.disjunction
+open import foundation.empty-types
+open import foundation.function-types
+open import foundation.law-of-excluded-middle
+open import foundation.propositions
+open import foundation.universe-levels
+```
+
+
+
+## Idea
+
+{{#concept "Dirk Gently's principle" Agda=Dirk-Gently-Principle}} is the logical
+axiom that the type of [propositions](foundation-core.propositions.md) is
+[linearly ordered](order-theory.total-orders.md). In other words, for every pair
+of propositions `P` and `Q`, either `P` implies `Q` or `Q` implies `P`:
+
+$$
+ (P ⇒ Q) ∨ (Q ⇒ P).
+$$
+
+The proof strength of this principle lies strictly between the
+[law of excluded middle](foundation.law-of-excluded-middle.md) and
+[De Morgan's law](logic.de-morgans-law.md), Section 8.5 {{#cite Diener18}}.
+
+> The name is based on the guiding principle of the protagonist of Douglas
+> Adam’s novel Dirk Gently’s Holistic Detective Agency who believes in the
+> “fundamental interconnectedness of all things.” {{#cite Diener18}}
+
+## Statement
+
+```agda
+instance-prop-Dirk-Gently-Principle :
+ {l1 l2 : Level} → Prop l1 → Prop l2 → Prop (l1 ⊔ l2)
+instance-prop-Dirk-Gently-Principle P Q = (P ⇒ Q) ∨ (Q ⇒ P)
+
+instance-Dirk-Gently-Principle :
+ {l1 l2 : Level} → Prop l1 → Prop l2 → UU (l1 ⊔ l2)
+instance-Dirk-Gently-Principle P Q =
+ type-Prop (instance-prop-Dirk-Gently-Principle P Q)
+
+level-Dirk-Gently-Principle : (l1 l2 : Level) → UU (lsuc l1 ⊔ lsuc l2)
+level-Dirk-Gently-Principle l1 l2 =
+ (P : Prop l1) (Q : Prop l2) → instance-Dirk-Gently-Principle P Q
+
+Dirk-Gently-Principle : UUω
+Dirk-Gently-Principle =
+ {l1 l2 : Level} → level-Dirk-Gently-Principle l1 l2
+```
+
+## Properties
+
+### The law of excluded middle implies Dirk Gently's principle
+
+```agda
+instance-Dirk-Gently-Principle-LEM' :
+ {l1 l2 : Level} (P : Prop l1) (Q : Prop l2) →
+ is-decidable (type-Prop P) →
+ instance-Dirk-Gently-Principle P Q
+instance-Dirk-Gently-Principle-LEM' P Q (inl p) =
+ inr-disjunction (λ _ → p)
+instance-Dirk-Gently-Principle-LEM' P Q (inr np) =
+ inl-disjunction (ex-falso ∘ np)
+
+level-Dirk-Gently-Principle-LEM :
+ (l1 l2 : Level) → LEM l1 → level-Dirk-Gently-Principle l1 l2
+level-Dirk-Gently-Principle-LEM l1 l2 lem P Q =
+ instance-Dirk-Gently-Principle-LEM' P Q (lem P)
+
+level-Dirk-Gently-Principle-LEM' :
+ (l1 l2 : Level) → LEM l2 → level-Dirk-Gently-Principle l1 l2
+level-Dirk-Gently-Principle-LEM' l1 l2 lem P Q =
+ swap-disjunction (level-Dirk-Gently-Principle-LEM l2 l1 lem Q P)
+```
+
+## References
+
+{{#bibliography}}
+
+## External links
+
+- This principle is studied under the name _Dummett's linearity axiom_ in
+ [`Various.DummettDisjunction`](https://martinescardo.github.io/TypeTopology/Various.DummettDisjunction.html)
+ at TypeTopology
diff --git a/src/logic/double-negation-dense-maps.lagda.md b/src/logic/double-negation-dense-maps.lagda.md
new file mode 100644
index 0000000000..c592365c00
--- /dev/null
+++ b/src/logic/double-negation-dense-maps.lagda.md
@@ -0,0 +1,524 @@
+# Double negation dense maps
+
+```agda
+module logic.double-negation-dense-maps where
+```
+
+Imports
+
+```agda
+open import foundation.connected-maps
+open import foundation.dependent-pair-types
+open import foundation.double-negation
+open import foundation.functoriality-cartesian-product-types
+open import foundation.functoriality-dependent-pair-types
+open import foundation.fundamental-theorem-of-identity-types
+open import foundation.homotopy-induction
+open import foundation.identity-types
+open import foundation.split-surjective-maps
+open import foundation.structure-identity-principle
+open import foundation.subtype-identity-principle
+open import foundation.surjective-maps
+open import foundation.univalence
+open import foundation.universe-levels
+
+open import foundation-core.cartesian-product-types
+open import foundation-core.contractible-maps
+open import foundation-core.equivalences
+open import foundation-core.fibers-of-maps
+open import foundation-core.function-types
+open import foundation-core.homotopies
+open import foundation-core.propositions
+open import foundation-core.retracts-of-types
+open import foundation-core.sections
+open import foundation-core.torsorial-type-families
+open import foundation-core.truncation-levels
+
+open import logic.double-negation-stable-embeddings
+open import logic.irrefutable-types
+```
+
+
+
+## Idea
+
+A map `f : A → B` is
+{{#concept "double negation dense" Disambiguation="map of types" Agda=is-double-negation-dense-map}},
+if all of its [fibers](foundation-core.fibers-of-maps.md) are
+[irrefutable](logic.irrefutable-types.md). I.e., for every `y : B`, it is not
+not true that `y` has a preimage under `f`.
+
+Double negation dense maps are a close cousin of
+[surjective maps](foundation.surjective-maps.md), but don't require the
+existence of
+[propositional truncations](foundation.propositional-truncations.md). In
+particular, every map factors essentially uniquely as a double negation dense
+map followed by a
+[double negation stable embedding](logic.double-negation-stable-embeddings.md),
+through its [double negation image](foundation.double-negation-images.md).
+
+**Terminology.** The term _dense_ used here is in the sense of dense with
+respect to a
+[reflective subuniverse](orthogonal-factorization-systems.reflective-global-subuniverses.md)/[modality](orthogonal-factorization-systems.higher-modalities.md),
+or connected. Here, it means that the double negation of the fibers of the
+relevant map are contractible. Since negations are propositions, it suffices
+that the double negation has an element.
+
+## Definitions
+
+### The predicate on maps of being double negation dense
+
+```agda
+is-double-negation-dense-map-Prop :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} → (A → B) → Prop (l1 ⊔ l2)
+is-double-negation-dense-map-Prop {B = B} f =
+ Π-Prop B (is-irrefutable-prop-Type ∘ fiber f)
+
+is-double-negation-dense-map :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} → (A → B) → UU (l1 ⊔ l2)
+is-double-negation-dense-map f = type-Prop (is-double-negation-dense-map-Prop f)
+
+is-prop-is-double-negation-dense-map :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A → B) →
+ is-prop (is-double-negation-dense-map f)
+is-prop-is-double-negation-dense-map f =
+ is-prop-type-Prop (is-double-negation-dense-map-Prop f)
+```
+
+### The type of double negation dense maps
+
+```agda
+double-negation-dense-map : {l1 l2 : Level} → UU l1 → UU l2 → UU (l1 ⊔ l2)
+double-negation-dense-map A B = Σ (A → B) is-double-negation-dense-map
+
+infix 5 _↠¬¬_
+_↠¬¬_ : {l1 l2 : Level} → UU l1 → UU l2 → UU (l1 ⊔ l2)
+_↠¬¬_ = double-negation-dense-map
+
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A ↠¬¬ B)
+ where
+
+ map-double-negation-dense-map : A → B
+ map-double-negation-dense-map = pr1 f
+
+ is-double-negation-dense-map-double-negation-dense-map :
+ is-double-negation-dense-map map-double-negation-dense-map
+ is-double-negation-dense-map-double-negation-dense-map = pr2 f
+```
+
+### The type of all double negation dense maps out of a type
+
+```agda
+Double-Negation-Dense-Map :
+ {l1 : Level} (l2 : Level) → UU l1 → UU (l1 ⊔ lsuc l2)
+Double-Negation-Dense-Map l2 A = Σ (UU l2) (A ↠¬¬_)
+
+module _
+ {l1 l2 : Level} {A : UU l1} (f : Double-Negation-Dense-Map l2 A)
+ where
+
+ type-Double-Negation-Dense-Map : UU l2
+ type-Double-Negation-Dense-Map = pr1 f
+
+ double-negation-dense-map-Double-Negation-Dense-Map :
+ A ↠¬¬ type-Double-Negation-Dense-Map
+ double-negation-dense-map-Double-Negation-Dense-Map = pr2 f
+
+ map-Double-Negation-Dense-Map : A → type-Double-Negation-Dense-Map
+ map-Double-Negation-Dense-Map =
+ map-double-negation-dense-map
+ double-negation-dense-map-Double-Negation-Dense-Map
+
+ is-double-negation-dense-map-Double-Negation-Dense-Map :
+ is-double-negation-dense-map map-Double-Negation-Dense-Map
+ is-double-negation-dense-map-Double-Negation-Dense-Map =
+ is-double-negation-dense-map-double-negation-dense-map
+ double-negation-dense-map-Double-Negation-Dense-Map
+```
+
+## Properties
+
+### Any surjective map is double negation dense
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ is-double-negation-dense-map-is-surjective :
+ {f : A → B} → is-surjective f → is-double-negation-dense-map f
+ is-double-negation-dense-map-is-surjective H =
+ intro-double-negation-type-trunc-Prop ∘ H
+
+ double-negation-dense-map-surjection : (A ↠ B) → (A ↠¬¬ B)
+ double-negation-dense-map-surjection =
+ tot (λ _ → is-double-negation-dense-map-is-surjective)
+```
+
+### Any map that has a section is double negation dense
+
+```agda
+is-double-negation-dense-map-has-section :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} →
+ section f → is-double-negation-dense-map f
+is-double-negation-dense-map-has-section (g , G) b =
+ intro-double-negation (g b , G b)
+```
+
+### The underlying double negation dense map of a retract
+
+```agda
+double-negation-dense-map-retract :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} →
+ A retract-of B → B ↠¬¬ A
+double-negation-dense-map-retract R =
+ ( map-retraction-retract R ,
+ is-double-negation-dense-map-has-section (section-retract R))
+```
+
+### Any split surjective map is double negation dense
+
+```agda
+is-double-negation-dense-map-is-split-surjective :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} →
+ is-split-surjective f → is-double-negation-dense-map f
+is-double-negation-dense-map-is-split-surjective H =
+ intro-double-negation ∘ H
+```
+
+### Any equivalence is double negation dense
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ is-double-negation-dense-map-is-equiv :
+ {f : A → B} → is-equiv f → is-double-negation-dense-map f
+ is-double-negation-dense-map-is-equiv H =
+ is-double-negation-dense-map-has-section (section-is-equiv H)
+
+ is-double-negation-dense-map-equiv :
+ (e : A ≃ B) → is-double-negation-dense-map (map-equiv e)
+ is-double-negation-dense-map-equiv e =
+ is-double-negation-dense-map-is-equiv (is-equiv-map-equiv e)
+
+ double-negation-dense-map-equiv : A ≃ B → A ↠¬¬ B
+ double-negation-dense-map-equiv e =
+ (map-equiv e , is-double-negation-dense-map-equiv e)
+
+ double-negation-dense-map-inv-equiv : B ≃ A → A ↠¬¬ B
+ double-negation-dense-map-inv-equiv e =
+ double-negation-dense-map-equiv (inv-equiv e)
+```
+
+### The identity function is double negation dense
+
+```agda
+module _
+ {l : Level} {A : UU l}
+ where
+
+ is-double-negation-dense-map-id : is-double-negation-dense-map (id {A = A})
+ is-double-negation-dense-map-id a = intro-double-negation (a , refl)
+```
+
+### A (k+1)-connected map is double negation dense
+
+```agda
+is-double-negation-dense-map-is-connected-map :
+ {l1 l2 : Level} (k : 𝕋) {A : UU l1} {B : UU l2}
+ {f : A → B} → is-connected-map (succ-𝕋 k) f →
+ is-double-negation-dense-map f
+is-double-negation-dense-map-is-connected-map k H =
+ is-double-negation-dense-map-is-surjective
+ ( is-surjective-is-connected-map k H)
+```
+
+### Maps which are homotopic to double negation dense maps are double negation dense
+
+```agda
+module _
+ { l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ abstract
+ is-double-negation-dense-map-htpy :
+ {f g : A → B} → f ~ g →
+ is-double-negation-dense-map g → is-double-negation-dense-map f
+ is-double-negation-dense-map-htpy {f} {g} H K b =
+ map-double-negation (map-equiv-fiber-htpy H b) (K b)
+
+ abstract
+ is-double-negation-dense-map-htpy' :
+ {f g : A → B} → f ~ g →
+ is-double-negation-dense-map f → is-double-negation-dense-map g
+ is-double-negation-dense-map-htpy' H =
+ is-double-negation-dense-map-htpy (inv-htpy H)
+```
+
+### A map that is both double negation dense and a double negation stable embedding is an equivalence
+
+```agda
+abstract
+ is-equiv-is-double-negation-stable-emb-is-double-negation-dense-map :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} →
+ is-double-negation-dense-map f →
+ is-double-negation-stable-emb f →
+ is-equiv f
+ is-equiv-is-double-negation-stable-emb-is-double-negation-dense-map H K =
+ is-equiv-is-contr-map
+ ( λ y →
+ is-proof-irrelevant-is-prop
+ ( is-prop-map-is-double-negation-stable-emb K y)
+ ( is-double-negation-eliminating-map-is-double-negation-stable-emb K y
+ ( H y)))
+```
+
+### Composite of double negation dense maps
+
+```agda
+module _
+ {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {X : UU l3}
+ where
+
+ is-double-negation-dense-map-comp :
+ {g : B → X} {h : A → B} →
+ is-double-negation-dense-map g →
+ is-double-negation-dense-map h →
+ is-double-negation-dense-map (g ∘ h)
+ is-double-negation-dense-map-comp {g} {h} G H x =
+ map-double-negation
+ ( map-inv-compute-fiber-comp g h x)
+ ( is-irrefutable-Σ (G x) (H ∘ pr1))
+
+ is-double-negation-dense-map-left-map-triangle :
+ (f : A → X) (g : B → X) (h : A → B) → f ~ g ∘ h →
+ is-double-negation-dense-map g →
+ is-double-negation-dense-map h →
+ is-double-negation-dense-map f
+ is-double-negation-dense-map-left-map-triangle f g h K G H =
+ is-double-negation-dense-map-htpy K (is-double-negation-dense-map-comp G H)
+
+ comp-double-negation-dense-map : B ↠¬¬ X → A ↠¬¬ B → A ↠¬¬ X
+ comp-double-negation-dense-map (g , G) (h , H) =
+ ( g ∘ h , is-double-negation-dense-map-comp G H)
+```
+
+### Products of double negation dense maps
+
+```agda
+module _
+ {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {D : UU l4}
+ where
+
+ is-double-negation-dense-map-product :
+ {f : A → C} {g : B → D} →
+ is-double-negation-dense-map f →
+ is-double-negation-dense-map g →
+ is-double-negation-dense-map (map-product f g)
+ is-double-negation-dense-map-product {f} {g} F G (c , d) =
+ map-double-negation
+ ( map-inv-compute-fiber-map-product f g (c , d))
+ ( is-irrefutable-product (F c) (G d))
+
+ double-negation-dense-map-product :
+ (A ↠¬¬ C) → (B ↠¬¬ D) → ((A × B) ↠¬¬ (C × D))
+ pr1 (double-negation-dense-map-product f g) =
+ map-product
+ ( map-double-negation-dense-map f)
+ ( map-double-negation-dense-map g)
+ pr2 (double-negation-dense-map-product f g) =
+ is-double-negation-dense-map-product
+ ( is-double-negation-dense-map-double-negation-dense-map f)
+ ( is-double-negation-dense-map-double-negation-dense-map g)
+```
+
+### The composite of a double negation dense map before an equivalence is double negation dense
+
+```agda
+is-double-negation-dense-map-left-comp-equiv :
+ {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3}
+ (e : B ≃ C) {f : A → B} →
+ is-double-negation-dense-map f →
+ is-double-negation-dense-map (map-equiv e ∘ f)
+is-double-negation-dense-map-left-comp-equiv e =
+ is-double-negation-dense-map-comp (is-double-negation-dense-map-equiv e)
+```
+
+### The composite of a double negation dense map after an equivalence is double negation dense
+
+```agda
+is-double-negation-dense-map-right-comp-equiv :
+ {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {f : B → C} →
+ is-double-negation-dense-map f →
+ (e : A ≃ B) →
+ is-double-negation-dense-map (f ∘ map-equiv e)
+is-double-negation-dense-map-right-comp-equiv H e =
+ is-double-negation-dense-map-comp H (is-double-negation-dense-map-equiv e)
+```
+
+### If a composite is double negation dense, then so is its left factor
+
+```agda
+module _
+ {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {X : UU l3}
+ where
+
+ is-double-negation-dense-map-left-factor :
+ {g : B → X} (h : A → B) →
+ is-double-negation-dense-map (g ∘ h) → is-double-negation-dense-map g
+ is-double-negation-dense-map-left-factor {g} h GH x =
+ map-double-negation (pr1 ∘ map-compute-fiber-comp g h x) (GH x)
+
+ is-double-negation-dense-map-right-map-triangle' :
+ (f : A → X) (g : B → X) (h : A → B) → g ∘ h ~ f →
+ is-double-negation-dense-map f → is-double-negation-dense-map g
+ is-double-negation-dense-map-right-map-triangle' f g h K F =
+ is-double-negation-dense-map-left-factor h
+ ( is-double-negation-dense-map-htpy K F)
+
+ is-double-negation-dense-map-right-map-triangle :
+ (f : A → X) (g : B → X) (h : A → B) → f ~ g ∘ h →
+ is-double-negation-dense-map f → is-double-negation-dense-map g
+ is-double-negation-dense-map-right-map-triangle f g h K =
+ is-double-negation-dense-map-right-map-triangle' f g h (inv-htpy K)
+```
+
+### Characterization of the identity type of `A ↠¬¬ B`
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A ↠¬¬ B)
+ where
+
+ htpy-double-negation-dense-map : (A ↠¬¬ B) → UU (l1 ⊔ l2)
+ htpy-double-negation-dense-map g =
+ map-double-negation-dense-map f ~ map-double-negation-dense-map g
+
+ refl-htpy-double-negation-dense-map : htpy-double-negation-dense-map f
+ refl-htpy-double-negation-dense-map = refl-htpy
+
+ is-torsorial-htpy-double-negation-dense-map :
+ is-torsorial htpy-double-negation-dense-map
+ is-torsorial-htpy-double-negation-dense-map =
+ is-torsorial-Eq-subtype
+ ( is-torsorial-htpy (map-double-negation-dense-map f))
+ ( is-prop-is-double-negation-dense-map)
+ ( map-double-negation-dense-map f)
+ ( refl-htpy)
+ ( is-double-negation-dense-map-double-negation-dense-map f)
+
+ htpy-eq-double-negation-dense-map :
+ (g : A ↠¬¬ B) → (f = g) → htpy-double-negation-dense-map g
+ htpy-eq-double-negation-dense-map .f refl =
+ refl-htpy-double-negation-dense-map
+
+ is-equiv-htpy-eq-double-negation-dense-map :
+ (g : A ↠¬¬ B) → is-equiv (htpy-eq-double-negation-dense-map g)
+ is-equiv-htpy-eq-double-negation-dense-map =
+ fundamental-theorem-id
+ is-torsorial-htpy-double-negation-dense-map
+ htpy-eq-double-negation-dense-map
+
+ extensionality-double-negation-dense-map :
+ (g : A ↠¬¬ B) → (f = g) ≃ htpy-double-negation-dense-map g
+ extensionality-double-negation-dense-map g =
+ ( htpy-eq-double-negation-dense-map g ,
+ is-equiv-htpy-eq-double-negation-dense-map g)
+
+ eq-htpy-double-negation-dense-map :
+ (g : A ↠¬¬ B) → htpy-double-negation-dense-map g → f = g
+ eq-htpy-double-negation-dense-map g =
+ map-inv-equiv (extensionality-double-negation-dense-map g)
+```
+
+### Characterization of the identity type of `Double-Negation-Dense-Map l2 A`
+
+```agda
+equiv-Double-Negation-Dense-Map :
+ {l1 l2 l3 : Level} {A : UU l1} →
+ Double-Negation-Dense-Map l2 A →
+ Double-Negation-Dense-Map l3 A →
+ UU (l1 ⊔ l2 ⊔ l3)
+equiv-Double-Negation-Dense-Map f g =
+ Σ ( type-Double-Negation-Dense-Map f ≃
+ type-Double-Negation-Dense-Map g)
+ ( λ e →
+ map-equiv e ∘ map-Double-Negation-Dense-Map f ~
+ map-Double-Negation-Dense-Map g)
+
+module _
+ {l1 l2 : Level} {A : UU l1} (f : Double-Negation-Dense-Map l2 A)
+ where
+
+ id-equiv-Double-Negation-Dense-Map : equiv-Double-Negation-Dense-Map f f
+ pr1 id-equiv-Double-Negation-Dense-Map = id-equiv
+ pr2 id-equiv-Double-Negation-Dense-Map = refl-htpy
+
+ is-torsorial-equiv-Double-Negation-Dense-Map :
+ is-torsorial (equiv-Double-Negation-Dense-Map f)
+ is-torsorial-equiv-Double-Negation-Dense-Map =
+ is-torsorial-Eq-structure
+ ( is-torsorial-equiv (type-Double-Negation-Dense-Map f))
+ ( type-Double-Negation-Dense-Map f , id-equiv)
+ ( is-torsorial-htpy-double-negation-dense-map
+ ( double-negation-dense-map-Double-Negation-Dense-Map f))
+
+ equiv-eq-Double-Negation-Dense-Map :
+ (g : Double-Negation-Dense-Map l2 A) →
+ f = g → equiv-Double-Negation-Dense-Map f g
+ equiv-eq-Double-Negation-Dense-Map .f refl =
+ id-equiv-Double-Negation-Dense-Map
+
+ is-equiv-equiv-eq-Double-Negation-Dense-Map :
+ (g : Double-Negation-Dense-Map l2 A) →
+ is-equiv (equiv-eq-Double-Negation-Dense-Map g)
+ is-equiv-equiv-eq-Double-Negation-Dense-Map =
+ fundamental-theorem-id
+ is-torsorial-equiv-Double-Negation-Dense-Map
+ equiv-eq-Double-Negation-Dense-Map
+
+ extensionality-Double-Negation-Dense-Map :
+ (g : Double-Negation-Dense-Map l2 A) →
+ (f = g) ≃ equiv-Double-Negation-Dense-Map f g
+ pr1 (extensionality-Double-Negation-Dense-Map g) =
+ equiv-eq-Double-Negation-Dense-Map g
+ pr2 (extensionality-Double-Negation-Dense-Map g) =
+ is-equiv-equiv-eq-Double-Negation-Dense-Map g
+
+ eq-equiv-Double-Negation-Dense-Map :
+ (g : Double-Negation-Dense-Map l2 A) →
+ equiv-Double-Negation-Dense-Map f g → f = g
+ eq-equiv-Double-Negation-Dense-Map g =
+ map-inv-equiv (extensionality-Double-Negation-Dense-Map g)
+```
+
+### Every type that maps double negation densely onto an irrefutable type is irrefutable
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ is-irrefutable-is-double-negation-dense-map :
+ {f : A → B} → is-double-negation-dense-map f → ¬¬ B → ¬¬ A
+ is-irrefutable-is-double-negation-dense-map F nnb na =
+ nnb (λ b → F b (λ p → na (pr1 p)))
+
+ is-irrefutable-double-negation-dense-map :
+ A ↠¬¬ B → ¬¬ B → ¬¬ A
+ is-irrefutable-double-negation-dense-map f =
+ is-irrefutable-is-double-negation-dense-map
+ ( is-double-negation-dense-map-double-negation-dense-map f)
+```
+
+## See also
+
+- [Double negation modality](foundation.double-negation-modality.md)
+
+## External links
+
+- [TypeTopology.Density](https://martinescardo.github.io/TypeTopology/TypeTopology.Density.html)
+ at TypeTopology
diff --git a/src/logic/double-negation-dense-subtypes.lagda.md b/src/logic/double-negation-dense-subtypes.lagda.md
new file mode 100644
index 0000000000..459e89503d
--- /dev/null
+++ b/src/logic/double-negation-dense-subtypes.lagda.md
@@ -0,0 +1,144 @@
+# Double negation dense subtypes of types
+
+```agda
+module logic.double-negation-dense-subtypes where
+```
+
+Imports
+
+```agda
+open import foundation.complements-subtypes
+open import foundation.dependent-pair-types
+open import foundation.double-negation
+open import foundation.full-subtypes
+open import foundation.function-types
+open import foundation.type-arithmetic-dependent-pair-types
+open import foundation.unit-type
+open import foundation.universe-levels
+
+open import foundation-core.equivalences
+open import foundation-core.identity-types
+open import foundation-core.propositions
+open import foundation-core.subtypes
+open import foundation-core.transport-along-identifications
+
+open import logic.double-negation-dense-maps
+```
+
+
+
+## Idea
+
+A
+{{#concept "double negation dense" Disambiguation="subtype" Agda=is-double-negation-dense-subtype Agda=double-negation-dense-subtype}}
+[subtype](foundation.subtypes.md) of a type `X` is a subtype `P ⊆ X` such that
+its double [complement](foundation.complements-subtypes.md) is
+[full](foundation.full-subtypes.md).
+
+## Definitions
+
+### The predicate on a subtype of being double negation dense
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} (P : subtype l2 A)
+ where
+
+ is-double-negation-dense-subtype-Prop : Prop (l1 ⊔ l2)
+ is-double-negation-dense-subtype-Prop =
+ is-full-subtype-Prop (complement-subtype (complement-subtype P))
+
+ is-double-negation-dense-subtype : UU (l1 ⊔ l2)
+ is-double-negation-dense-subtype =
+ type-Prop is-double-negation-dense-subtype-Prop
+
+ is-prop-is-double-negation-dense-subtype :
+ is-prop is-double-negation-dense-subtype
+ is-prop-is-double-negation-dense-subtype =
+ is-prop-type-Prop is-double-negation-dense-subtype-Prop
+```
+
+### The type of double negation dense subtypes
+
+```agda
+double-negation-dense-subtype :
+ {l1 : Level} (l2 : Level) → UU l1 → UU (l1 ⊔ lsuc l2)
+double-negation-dense-subtype l2 A =
+ Σ (subtype l2 A) is-double-negation-dense-subtype
+
+module _
+ {l1 l2 : Level} {A : UU l1} (P : double-negation-dense-subtype l2 A)
+ where
+
+ subtype-double-negation-dense-subtype : subtype l2 A
+ subtype-double-negation-dense-subtype = pr1 P
+
+ is-double-negation-dense-double-negation-dense-subtype :
+ is-double-negation-dense-subtype subtype-double-negation-dense-subtype
+ is-double-negation-dense-double-negation-dense-subtype = pr2 P
+
+ type-double-negation-dense-subtype : UU (l1 ⊔ l2)
+ type-double-negation-dense-subtype =
+ type-subtype subtype-double-negation-dense-subtype
+
+ is-in-double-negation-dense-subtype : A → UU l2
+ is-in-double-negation-dense-subtype =
+ is-in-subtype subtype-double-negation-dense-subtype
+
+ is-prop-is-in-double-negation-dense-subtype :
+ (x : A) → is-prop (is-in-double-negation-dense-subtype x)
+ is-prop-is-in-double-negation-dense-subtype =
+ is-prop-is-in-subtype subtype-double-negation-dense-subtype
+
+ inclusion-double-negation-dense-subtype :
+ type-double-negation-dense-subtype → A
+ inclusion-double-negation-dense-subtype =
+ inclusion-subtype subtype-double-negation-dense-subtype
+```
+
+## Properties
+
+### A subtype is double negation dense if and only if the inclusion is double negation dense
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} (P : subtype l2 A)
+ where
+
+ is-double-negation-dense-inclusion-is-double-negation-dense-subtype :
+ is-double-negation-dense-subtype P →
+ is-double-negation-dense-map (inclusion-subtype P)
+ is-double-negation-dense-inclusion-is-double-negation-dense-subtype H x =
+ map-double-negation (λ y → ((x , y) , refl)) (H x)
+
+ double-negation-dense-inclusion-is-double-negation-dense-subtype :
+ is-double-negation-dense-subtype P → type-subtype P ↠¬¬ A
+ double-negation-dense-inclusion-is-double-negation-dense-subtype H =
+ ( inclusion-subtype P ,
+ is-double-negation-dense-inclusion-is-double-negation-dense-subtype H)
+
+ is-double-negation-dense-subtype-is-double-negation-dense-inclusion-subtype :
+ is-double-negation-dense-map (inclusion-subtype P) →
+ is-double-negation-dense-subtype P
+ is-double-negation-dense-subtype-is-double-negation-dense-inclusion-subtype
+ H x =
+ map-double-negation (λ p → tr (is-in-subtype P) (pr2 p) (pr2 (pr1 p))) (H x)
+
+module _
+ {l1 l2 : Level} {A : UU l1} (P : double-negation-dense-subtype l2 A)
+ where
+
+ is-double-negation-dense-inclusion-double-negation-dense-subtype :
+ is-double-negation-dense-map (inclusion-double-negation-dense-subtype P)
+ is-double-negation-dense-inclusion-double-negation-dense-subtype =
+ is-double-negation-dense-inclusion-is-double-negation-dense-subtype
+ ( subtype-double-negation-dense-subtype P)
+ ( is-double-negation-dense-double-negation-dense-subtype P)
+
+ double-negation-dense-inclusion-double-negation-dense-subtype :
+ type-double-negation-dense-subtype P ↠¬¬ A
+ double-negation-dense-inclusion-double-negation-dense-subtype =
+ double-negation-dense-inclusion-is-double-negation-dense-subtype
+ ( subtype-double-negation-dense-subtype P)
+ ( is-double-negation-dense-double-negation-dense-subtype P)
+```
diff --git a/src/logic/double-negation-eliminating-maps.lagda.md b/src/logic/double-negation-eliminating-maps.lagda.md
index 0cce173210..1909dd860c 100644
--- a/src/logic/double-negation-eliminating-maps.lagda.md
+++ b/src/logic/double-negation-eliminating-maps.lagda.md
@@ -10,7 +10,6 @@ module logic.double-negation-eliminating-maps where
open import foundation.action-on-identifications-functions
open import foundation.cartesian-morphisms-arrows
open import foundation.coproduct-types
-open import foundation.decidable-equality
open import foundation.decidable-maps
open import foundation.decidable-types
open import foundation.dependent-pair-types
@@ -18,11 +17,10 @@ open import foundation.double-negation
open import foundation.empty-types
open import foundation.functoriality-cartesian-product-types
open import foundation.functoriality-coproduct-types
+open import foundation.hilbert-epsilon-operators-maps
open import foundation.identity-types
open import foundation.injective-maps
-open import foundation.retractions
open import foundation.retracts-of-maps
-open import foundation.retracts-of-types
open import foundation.transport-along-identifications
open import foundation.universe-levels
@@ -180,7 +178,7 @@ module _
(y : B) → ¬¬ (fiber f y) → Σ (fiber g (g y)) (λ t → fiber f (pr1 t))
fiber-comp-is-double-negation-eliminating-map-right-factor' y nnfy =
map-compute-fiber-comp g f (g y)
- ( GF (g y) (λ ngfgy → nnfy λ x → ngfgy ((pr1 x) , ap g (pr2 x))))
+ ( GF (g y) (map-double-negation (λ x → (pr1 x , ap g (pr2 x))) nnfy))
is-double-negation-eliminating-map-right-factor' :
is-injective g → is-double-negation-eliminating-map f
@@ -333,3 +331,27 @@ module _
( retract-fiber-retract-map f g R x)
( G (map-codomain-inclusion-retract-map f g R x))
```
+
+### Double negation eliminating maps have Hilbert ε-operators
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ ε-operator-map-is-double-negation-eliminating-map :
+ {f : A → B} → is-double-negation-eliminating-map f → ε-operator-map f
+ ε-operator-map-is-double-negation-eliminating-map H x =
+ ε-operator-Hilbert-has-double-negation-elim (H x)
+
+ ε-operator-double-negation-eliminating-map :
+ (f : A →¬¬ B) → ε-operator-map (map-double-negation-eliminating-map f)
+ ε-operator-double-negation-eliminating-map f =
+ ε-operator-map-is-double-negation-eliminating-map
+ ( is-double-negation-eliminating-double-negation-eliminating-map f)
+```
+
+## See also
+
+- In [double negation images](foundation.double-negation-images.md) we show that
+ injective maps with double negation elimination are embeddings.
diff --git a/src/logic/double-negation-elimination.lagda.md b/src/logic/double-negation-elimination.lagda.md
index 1acfd21ebb..265cf366ed 100644
--- a/src/logic/double-negation-elimination.lagda.md
+++ b/src/logic/double-negation-elimination.lagda.md
@@ -12,20 +12,22 @@ open import foundation.coproduct-types
open import foundation.decidable-types
open import foundation.dependent-pair-types
open import foundation.double-negation
+open import foundation.double-negation-dense-equality
+open import foundation.empty-types
open import foundation.evaluation-functions
open import foundation.hilberts-epsilon-operators
+open import foundation.irrefutable-equality
open import foundation.logical-equivalences
+open import foundation.mere-equality
+open import foundation.negation
open import foundation.retracts-of-types
open import foundation.transport-along-identifications
open import foundation.unit-type
open import foundation.universe-levels
open import foundation-core.contractible-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.negation
open import foundation-core.propositions
```
@@ -171,6 +173,81 @@ double-negation-elim-neg :
double-negation-elim-neg A f p = f (ev p)
```
+### Double negation elimination for dependent sums of types with double negation elimination over a double negation stable proposition
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : A → UU l2}
+ where
+
+ double-negation-elim-Σ-has-double-negation-dense-equality-base :
+ has-double-negation-dense-equality A →
+ has-double-negation-elim A →
+ ((x : A) → has-double-negation-elim (B x)) →
+ has-double-negation-elim (Σ A B)
+ double-negation-elim-Σ-has-double-negation-dense-equality-base H f g h =
+ ( f ( map-double-negation pr1 h)) ,
+ ( g ( f ( map-double-negation pr1 h))
+ ( λ nb →
+ h ( λ x →
+ H ( pr1 x)
+ ( f (map-double-negation pr1 h))
+ ( λ p → nb (tr B p (pr2 x))))))
+
+ double-negation-elim-Σ-all-elements-merely-equal-base :
+ all-elements-merely-equal A →
+ has-double-negation-elim A →
+ ((x : A) → has-double-negation-elim (B x)) →
+ has-double-negation-elim (Σ A B)
+ double-negation-elim-Σ-all-elements-merely-equal-base H =
+ double-negation-elim-Σ-has-double-negation-dense-equality-base
+ ( has-double-negation-dense-equality-all-elements-merely-equal H)
+
+ double-negation-elim-Σ-is-prop-base :
+ is-prop A → has-double-negation-elim A →
+ ((x : A) → has-double-negation-elim (B x)) →
+ has-double-negation-elim (Σ A B)
+ double-negation-elim-Σ-is-prop-base is-prop-A =
+ double-negation-elim-Σ-has-double-negation-dense-equality-base
+ ( λ x y → intro-double-negation (eq-is-prop is-prop-A))
+
+ double-negation-elim-base-Σ-section' :
+ has-double-negation-elim (Σ A B) →
+ (A → Σ A B) →
+ has-double-negation-elim A
+ double-negation-elim-base-Σ-section' H f nna =
+ pr1 (H (map-double-negation f nna))
+
+ double-negation-elim-base-Σ-section :
+ has-double-negation-elim (Σ A B) →
+ ((x : A) → B x) →
+ has-double-negation-elim A
+ double-negation-elim-base-Σ-section H f =
+ double-negation-elim-base-Σ-section' H (λ x → x , f x)
+
+ double-negation-elim-family-Σ-is-prop-base :
+ has-double-negation-elim (Σ A B) →
+ is-prop A →
+ (x : A) → has-double-negation-elim (B x)
+ double-negation-elim-family-Σ-is-prop-base K is-prop-A x nnb =
+ tr B (eq-is-prop is-prop-A) (pr2 (K (map-double-negation (pair x) nnb)))
+```
+
+### Double negation elimination for products of types with double negation elimination
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ double-negation-elim-product :
+ has-double-negation-elim A →
+ has-double-negation-elim B →
+ has-double-negation-elim (A × B)
+ double-negation-elim-product f g h =
+ ( f (map-double-negation pr1 h) , g (map-double-negation pr2 h))
+```
+
### Double negation elimination for universal quantification over double negations
```agda
@@ -178,17 +255,15 @@ module _
{l1 l2 : Level} {P : UU l1} {Q : P → UU l2}
where
- double-negation-elim-for-all-neg-neg :
+ double-negation-elim-Π-neg-neg :
has-double-negation-elim ((p : P) → ¬¬ (Q p))
- double-negation-elim-for-all-neg-neg f p =
- double-negation-elim-neg
- ( ¬ (Q p))
- ( map-double-negation (λ (g : (u : P) → ¬¬ (Q u)) → g p) f)
+ double-negation-elim-Π-neg-neg f p =
+ double-negation-elim-neg (¬ (Q p)) (map-double-negation (ev p) f)
- double-negation-elim-for-all :
+ double-negation-elim-Π :
((p : P) → has-double-negation-elim (Q p)) →
has-double-negation-elim ((p : P) → Q p)
- double-negation-elim-for-all H f p = H p (λ nq → f (λ g → nq (g p)))
+ double-negation-elim-Π H f p = H p (map-double-negation (ev p) f)
```
### Double negation elimination for function types into double negations
@@ -198,61 +273,21 @@ module _
{l1 l2 : Level} {P : UU l1} {Q : UU l2}
where
- double-negation-elim-exp-neg-neg :
- has-double-negation-elim (P → ¬¬ Q)
- double-negation-elim-exp-neg-neg =
- double-negation-elim-for-all-neg-neg
+ double-negation-elim-exp-neg-neg : has-double-negation-elim (P → ¬¬ Q)
+ double-negation-elim-exp-neg-neg = double-negation-elim-Π-neg-neg
double-negation-elim-exp :
- has-double-negation-elim Q →
- has-double-negation-elim (P → Q)
- double-negation-elim-exp q = double-negation-elim-for-all (λ _ → q)
-```
-
-### Double negation elimination for dependent sums of types with double negation elimination over a double negation stable proposition
-
-```agda
-double-negation-elim-Σ-is-prop-base :
- {l1 l2 : Level} {A : UU l1} {B : A → UU l2} →
- is-prop A →
- has-double-negation-elim A →
- ((a : A) → has-double-negation-elim (B a)) →
- has-double-negation-elim (Σ A B)
-double-negation-elim-Σ-is-prop-base {B = B} is-prop-A f g h =
- ( f (λ na → h (na ∘ pr1))) ,
- ( g ( f (λ na → h (na ∘ pr1)))
- ( λ nb → h (λ y → nb (tr B (eq-is-prop is-prop-A) (pr2 y)))))
-
-double-negation-elim-Σ-is-decidable-prop-base :
- {l1 l2 : Level} {P : UU l1} {B : P → UU l2} →
- is-decidable-prop P →
- ((x : P) → has-double-negation-elim (B x)) →
- has-double-negation-elim (Σ P B)
-double-negation-elim-Σ-is-decidable-prop-base (H , d) =
- double-negation-elim-Σ-is-prop-base H (double-negation-elim-is-decidable d)
-```
-
-### Double negation elimination for products of types with double negation elimination
-
-```agda
-double-negation-elim-product :
- {l1 l2 : Level} {A : UU l1} {B : UU l2} →
- has-double-negation-elim A →
- has-double-negation-elim B →
- has-double-negation-elim (A × B)
-double-negation-elim-product f g h =
- f (λ na → h (na ∘ pr1)) , g (λ nb → h (nb ∘ pr2))
+ has-double-negation-elim Q → has-double-negation-elim (P → Q)
+ double-negation-elim-exp q = double-negation-elim-Π (λ _ → q)
```
### If a type satisfies untruncated double negation elimination then it has a Hilbert ε-operator
```agda
ε-operator-Hilbert-has-double-negation-elim :
- {l1 : Level} {A : UU l1} →
- has-double-negation-elim A →
- ε-operator-Hilbert A
-ε-operator-Hilbert-has-double-negation-elim {A = A} H =
- H ∘ double-negation-double-negation-type-trunc-Prop A ∘ intro-double-negation
+ {l1 : Level} {A : UU l1} → has-double-negation-elim A → ε-operator-Hilbert A
+ε-operator-Hilbert-has-double-negation-elim H =
+ H ∘ double-negation-double-negation-type-trunc-Prop ∘ intro-double-negation
```
## See also
diff --git a/src/logic/double-negation-stable-embeddings.lagda.md b/src/logic/double-negation-stable-embeddings.lagda.md
index 4e6a207085..f6f753758a 100644
--- a/src/logic/double-negation-stable-embeddings.lagda.md
+++ b/src/logic/double-negation-stable-embeddings.lagda.md
@@ -10,9 +10,6 @@ module logic.double-negation-stable-embeddings where
open import foundation.action-on-identifications-functions
open import foundation.cartesian-morphisms-arrows
open import foundation.decidable-embeddings
-open import foundation.decidable-maps
-open import foundation.decidable-propositions
-open import foundation.decidable-types
open import foundation.dependent-pair-types
open import foundation.double-negation-stable-propositions
open import foundation.embeddings
@@ -23,18 +20,15 @@ open import foundation.fundamental-theorem-of-identity-types
open import foundation.homotopy-induction
open import foundation.identity-types
open import foundation.logical-equivalences
-open import foundation.negation
open import foundation.propositional-maps
open import foundation.propositions
open import foundation.retracts-of-maps
open import foundation.subtype-identity-principle
-open import foundation.type-arithmetic-dependent-pair-types
open import foundation.unit-type
open import foundation.universal-property-equivalences
open import foundation.universe-levels
open import foundation-core.cartesian-product-types
-open import foundation-core.coproduct-types
open import foundation-core.empty-types
open import foundation-core.equivalences
open import foundation-core.function-types
@@ -62,6 +56,12 @@ Equivalently, a double negation stable embedding is a map whose fibers are
We refer to this condition as being a
{{#concept "double negation stable propositional map" Disambiguation="of types" Agda=is-double-negation-stable-prop-map}}.
+Double negation stable embeddings form the right class of an orthogonal
+factorization system on types whose left class is
+[double negation dense maps](logic.double-negation-dense-maps.md). This
+orthogonal factorization system is determined by the
+[double negation modality](foundation.double-negation-modality.md).
+
## Definitions
### The condition on a map of being a double negation stable embedding
@@ -276,6 +276,11 @@ abstract
( is-property-is-emb f)
( is-prop-Π
( is-prop-has-double-negation-elim ∘ is-prop-map-is-emb (pr1 H))))
+
+is-double-negation-stable-emb-Prop :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} → (A → B) → Prop (l1 ⊔ l2)
+is-double-negation-stable-emb-Prop f =
+ ( is-double-negation-stable-emb f , is-prop-is-double-negation-stable-emb f)
```
### Double negation stable embeddings are closed under homotopies
@@ -729,3 +734,7 @@ module _
( is-emb-terminal-map-is-prop (is-prop-type-Prop P)))
( p))
```
+
+## See also
+
+- [Double negation images](foundation.double-negation-images.md)
diff --git a/src/logic/irrefutable-types.lagda.md b/src/logic/irrefutable-types.lagda.md
new file mode 100644
index 0000000000..5455f326d0
--- /dev/null
+++ b/src/logic/irrefutable-types.lagda.md
@@ -0,0 +1,175 @@
+# Irrefutable types
+
+```agda
+module logic.irrefutable-types where
+```
+
+Imports
+
+```agda
+open import foundation.cartesian-product-types
+open import foundation.contractible-types
+open import foundation.coproduct-types
+open import foundation.decidable-types
+open import foundation.dependent-pair-types
+open import foundation.double-negation
+open import foundation.empty-types
+open import foundation.function-types
+open import foundation.inhabited-types
+open import foundation.negation
+open import foundation.propositions
+open import foundation.subuniverses
+open import foundation.unit-type
+open import foundation.universe-levels
+
+open import logic.double-negation-elimination
+```
+
+
+
+## Idea
+
+The [subuniverse](foundation.subuniverses.md) of
+{{#concept "irrefutable types" Agda=Irrefutable-Type}}, or
+{{#concept "double negation dense types" Agda=Irrefutable-Type}}, consists of
+types `X` for which the [double negation](foundation.double-negation.md) `¬¬X`
+is true.
+
+**Terminology.** The term _dense_ used here is in the sense of dense with
+respect to a
+[reflective subuniverse](orthogonal-factorization-systems.reflective-global-subuniverses.md)/[modality](orthogonal-factorization-systems.higher-modalities.md),
+or connected. Here, it means that the double negation of `X` is contractible.
+Since negations are propositions, it thus suffices that the double negation is
+true.
+
+## Definitions
+
+### The predicate on a type of being irrefutable
+
+```agda
+is-irrefutable : {l : Level} → UU l → UU l
+is-irrefutable X = ¬¬ X
+
+is-prop-is-irrefutable : {l : Level} {X : UU l} → is-prop (is-irrefutable X)
+is-prop-is-irrefutable = is-prop-double-negation
+
+is-irrefutable-prop-Type : {l : Level} → UU l → Prop l
+is-irrefutable-prop-Type X = (is-irrefutable X , is-prop-is-irrefutable)
+```
+
+### The subuniverse of irrefutable types
+
+```agda
+Irrefutable-Type : (l : Level) → UU (lsuc l)
+Irrefutable-Type l = type-subuniverse is-irrefutable-prop-Type
+
+make-Irrefutable-Type :
+ {l : Level} {X : UU l} → is-irrefutable X → Irrefutable-Type l
+make-Irrefutable-Type {X = X} is-irrefutable-X = (X , is-irrefutable-X)
+
+module _
+ {l : Level} (X : Irrefutable-Type l)
+ where
+
+ type-Irrefutable-Type : UU l
+ type-Irrefutable-Type = pr1 X
+
+ is-irrefutable-Irrefutable-Type : is-irrefutable type-Irrefutable-Type
+ is-irrefutable-Irrefutable-Type = pr2 X
+```
+
+## Properties
+
+### Provable types are irrefutable
+
+```agda
+is-irrefutable-has-element : {l : Level} {X : UU l} → X → is-irrefutable X
+is-irrefutable-has-element = intro-double-negation
+
+is-irrefutable-unit : is-irrefutable unit
+is-irrefutable-unit = is-irrefutable-has-element star
+```
+
+### Inhabited types are irrefutable
+
+```agda
+is-irrefutable-is-inhabited :
+ {l : Level} {X : UU l} → is-inhabited X → is-irrefutable X
+is-irrefutable-is-inhabited = intro-double-negation-type-trunc-Prop
+```
+
+### Contractible types are irrefutable
+
+```agda
+is-irrefutable-is-contr :
+ {l : Level} {X : UU l} → is-contr X → is-irrefutable X
+is-irrefutable-is-contr H = intro-double-negation (center H)
+```
+
+### If it is irrefutable that a type is irrefutable, then the type is irrefutable
+
+```agda
+is-idempotent-is-irrefutable :
+ {l : Level} {X : UU l} → is-irrefutable (is-irrefutable X) → is-irrefutable X
+is-idempotent-is-irrefutable {X = X} = double-negation-elim-neg (¬ X)
+```
+
+### Decidability is irrefutable
+
+```agda
+is-irrefutable-is-decidable :
+ {l : Level} {A : UU l} → is-irrefutable (is-decidable A)
+is-irrefutable-is-decidable H = H (inr (H ∘ inl))
+```
+
+### Double negation elimination is irrefutable
+
+```agda
+is-irrefutable-double-negation-elim :
+ {l : Level} {A : UU l} → is-irrefutable (has-double-negation-elim A)
+is-irrefutable-double-negation-elim H =
+ H (λ f → ex-falso (f (λ a → H (λ _ → a))))
+```
+
+### Dependent sums of irrefutable types
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : A → UU l2}
+ where
+
+ is-irrefutable-Σ :
+ is-irrefutable A → ((x : A) → is-irrefutable (B x)) → is-irrefutable (Σ A B)
+ is-irrefutable-Σ nna nnb nab = nna (λ a → nnb a (λ b → nab (a , b)))
+```
+
+### Products of irrefutable types
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ is-irrefutable-product :
+ is-irrefutable A → is-irrefutable B → is-irrefutable (A × B)
+ is-irrefutable-product nna nnb = is-irrefutable-Σ nna (λ _ → nnb)
+```
+
+### Coproducts of irrefutable types
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ is-irrefutable-coproduct-inl : is-irrefutable A → is-irrefutable (A + B)
+ is-irrefutable-coproduct-inl nna x = nna (x ∘ inl)
+
+ is-irrefutable-coproduct-inr : is-irrefutable B → is-irrefutable (A + B)
+ is-irrefutable-coproduct-inr nnb x = nnb (x ∘ inr)
+```
+
+## See also
+
+- [Irrefutable propositions](foundation.irrefutable-propositions.md)
+- [De Morgan's law](logic.de-morgans-law.md) is irrefutable
diff --git a/src/logic/markovian-types.lagda.md b/src/logic/markovian-types.lagda.md
index 54b779cddd..4ecf717e65 100644
--- a/src/logic/markovian-types.lagda.md
+++ b/src/logic/markovian-types.lagda.md
@@ -7,24 +7,15 @@ module logic.markovian-types where
Imports
```agda
-open import elementary-number-theory.natural-numbers
-
open import foundation.booleans
open import foundation.decidable-subtypes
-open import foundation.dependent-pair-types
-open import foundation.disjunction
open import foundation.existential-quantification
open import foundation.function-types
-open import foundation.inhabited-types
open import foundation.negation
open import foundation.universal-quantification
open import foundation.universe-levels
-open import foundation-core.identity-types
open import foundation-core.propositions
-open import foundation-core.sets
-
-open import univalent-combinatorics.standard-finite-types
```
@@ -91,6 +82,10 @@ module _
> This remains to be formalized.
+### Types with decidability search are Markovian
+
+> This remains to be formalized.
+
## See also
- [Markov's principle](logic.markovs-principle.md)
diff --git a/src/logic/propositional-double-negation-elimination.lagda.md b/src/logic/propositional-double-negation-elimination.lagda.md
new file mode 100644
index 0000000000..27eb74c953
--- /dev/null
+++ b/src/logic/propositional-double-negation-elimination.lagda.md
@@ -0,0 +1,274 @@
+# Propositional double negation elimination
+
+```agda
+module logic.propositional-double-negation-elimination where
+```
+
+Imports
+
+```agda
+open import foundation.cartesian-product-types
+open import foundation.coproduct-types
+open import foundation.decidable-types
+open import foundation.dependent-pair-types
+open import foundation.double-negation
+open import foundation.double-negation-dense-equality
+open import foundation.empty-types
+open import foundation.functoriality-propositional-truncation
+open import foundation.irrefutable-equality
+open import foundation.logical-equivalences
+open import foundation.mere-equality
+open import foundation.negation
+open import foundation.propositional-truncations
+open import foundation.retracts-of-types
+open import foundation.transport-along-identifications
+open import foundation.universe-levels
+
+open import foundation-core.equivalences
+open import foundation-core.function-types
+open import foundation-core.propositions
+
+open import logic.double-negation-elimination
+open import logic.propositionally-decidable-types
+```
+
+
+
+## Idea
+
+We say a type `A` satisfies
+{{#concept "propositional double negation elimination" Disambiguation="on a type" Agda=has-prop-double-negation-elim}}
+if the implication
+
+```text
+ ¬¬A ⇒ ║A║₋₁
+```
+
+holds.
+
+## Definitions
+
+### Propositional double negation elimination
+
+```agda
+module _
+ {l : Level} (A : UU l)
+ where
+
+ has-prop-double-negation-elim : UU l
+ has-prop-double-negation-elim = ¬¬ A → ║ A ║₋₁
+
+ is-prop-has-prop-double-negation-elim : is-prop has-prop-double-negation-elim
+ is-prop-has-prop-double-negation-elim =
+ is-prop-function-type is-prop-type-trunc-Prop
+
+ has-prop-double-negation-elim-Prop : Prop l
+ has-prop-double-negation-elim-Prop =
+ ( has-prop-double-negation-elim , is-prop-has-prop-double-negation-elim)
+```
+
+## Properties
+
+### Propositional double negation elimination is preserved by logical equivalences
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ has-prop-double-negation-elim-iff :
+ A ↔ B → has-prop-double-negation-elim B → has-prop-double-negation-elim A
+ has-prop-double-negation-elim-iff e H =
+ map-trunc-Prop (backward-implication e) ∘
+ H ∘
+ map-double-negation (forward-implication e)
+
+ has-prop-double-negation-elim-iff' :
+ B ↔ A → has-prop-double-negation-elim B → has-prop-double-negation-elim A
+ has-prop-double-negation-elim-iff' e =
+ has-prop-double-negation-elim-iff (inv-iff e)
+```
+
+### Propositional double negation elimination is preserved by equivalences
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ has-prop-double-negation-elim-equiv :
+ A ≃ B → has-prop-double-negation-elim B → has-prop-double-negation-elim A
+ has-prop-double-negation-elim-equiv e =
+ has-prop-double-negation-elim-iff (iff-equiv e)
+
+ has-prop-double-negation-elim-equiv' :
+ B ≃ A → has-prop-double-negation-elim B → has-prop-double-negation-elim A
+ has-prop-double-negation-elim-equiv' e =
+ has-prop-double-negation-elim-iff' (iff-equiv e)
+```
+
+### Propositional double negation elimination is preserved by retracts
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ has-prop-double-negation-elim-retract :
+ A retract-of B →
+ has-prop-double-negation-elim B → has-prop-double-negation-elim A
+ has-prop-double-negation-elim-retract e =
+ has-prop-double-negation-elim-iff (iff-retract e)
+
+ has-prop-double-negation-elim-retract' :
+ B retract-of A →
+ has-prop-double-negation-elim B → has-prop-double-negation-elim A
+ has-prop-double-negation-elim-retract' e =
+ has-prop-double-negation-elim-iff' (iff-retract e)
+```
+
+### If the negation of a type with double negation elimination is decidable, then the type is inhabited or empty
+
+```agda
+module _
+ {l1 : Level} {A : UU l1}
+ where
+
+ is-inhabited-or-empty-is-decidable-neg-has-prop-double-negation-elim :
+ has-prop-double-negation-elim A →
+ is-decidable (¬ A) →
+ is-inhabited-or-empty A
+ is-inhabited-or-empty-is-decidable-neg-has-prop-double-negation-elim f
+ ( inl nx) =
+ inr nx
+ is-inhabited-or-empty-is-decidable-neg-has-prop-double-negation-elim f
+ ( inr nnx) =
+ inl (f nnx)
+```
+
+**Remark.** It is an established fact that both the property of satisfying
+double negation elimination and the property of having decidable negation are
+strictly weaker conditions than being decidable {{#cite Johnstone02}}.
+Therefore, this result demonstrates that they are independent too.
+
+### Types with double negation elimination satisfy propositional double negation elimination
+
+```agda
+has-prop-double-negation-elim-has-double-negation-elim :
+ {l : Level} {A : UU l} →
+ has-double-negation-elim A →
+ has-prop-double-negation-elim A
+has-prop-double-negation-elim-has-double-negation-elim H = unit-trunc-Prop ∘ H
+```
+
+### Propositional double negation elimination for inhabited or empty types
+
+```agda
+prop-double-negation-elim-is-inhabited-or-empty :
+ {l : Level} {A : UU l} →
+ is-inhabited-or-empty A → has-prop-double-negation-elim A
+prop-double-negation-elim-is-inhabited-or-empty (inl |a|) _ = |a|
+prop-double-negation-elim-is-inhabited-or-empty (inr na) nna = ex-falso (nna na)
+```
+
+### Propositional double negation elimination for dependent sums
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : A → UU l2}
+ where
+
+ has-prop-double-negation-elim-Σ-has-double-negation-dense-equality-base :
+ has-double-negation-dense-equality A →
+ has-prop-double-negation-elim A →
+ ((x : A) → has-prop-double-negation-elim (B x)) →
+ has-prop-double-negation-elim (Σ A B)
+ has-prop-double-negation-elim-Σ-has-double-negation-dense-equality-base
+ H f g nnab =
+ rec-trunc-Prop
+ ( trunc-Prop (Σ A B))
+ ( λ a →
+ rec-trunc-Prop
+ ( trunc-Prop (Σ A B))
+ ( λ b → unit-trunc-Prop (a , b))
+ ( g a (λ nb → nnab (λ x → H (pr1 x) a (λ p → nb (tr B p (pr2 x)))))))
+ ( f (map-double-negation pr1 nnab))
+
+ has-prop-double-negation-elim-Σ-all-elements-merely-equal-base :
+ all-elements-merely-equal A →
+ has-prop-double-negation-elim A →
+ ((x : A) → has-prop-double-negation-elim (B x)) →
+ has-prop-double-negation-elim (Σ A B)
+ has-prop-double-negation-elim-Σ-all-elements-merely-equal-base H =
+ has-prop-double-negation-elim-Σ-has-double-negation-dense-equality-base
+ ( λ x y →
+ double-negation-double-negation-type-trunc-Prop
+ ( intro-double-negation (H x y)))
+
+ has-prop-double-negation-elim-Σ-is-prop-base :
+ is-prop A →
+ has-prop-double-negation-elim A →
+ ((x : A) → has-prop-double-negation-elim (B x)) →
+ has-prop-double-negation-elim (Σ A B)
+ has-prop-double-negation-elim-Σ-is-prop-base is-prop-A =
+ has-prop-double-negation-elim-Σ-all-elements-merely-equal-base
+ ( λ x y → unit-trunc-Prop (eq-is-prop is-prop-A))
+
+ has-prop-double-negation-elim-base-Σ-section' :
+ has-prop-double-negation-elim (Σ A B) →
+ (A → Σ A B) →
+ has-prop-double-negation-elim A
+ has-prop-double-negation-elim-base-Σ-section' H f nna =
+ map-trunc-Prop pr1 (H (λ nab → nna (λ x → nab (f x))))
+
+ has-prop-double-negation-elim-base-Σ-section :
+ has-prop-double-negation-elim (Σ A B) →
+ ((x : A) → B x) →
+ has-prop-double-negation-elim A
+ has-prop-double-negation-elim-base-Σ-section H f =
+ has-prop-double-negation-elim-base-Σ-section' H (λ x → x , f x)
+
+ has-prop-double-negation-elim-family-Σ-all-elements-merely-equal-base :
+ has-prop-double-negation-elim (Σ A B) →
+ all-elements-merely-equal A →
+ (x : A) → has-prop-double-negation-elim (B x)
+ has-prop-double-negation-elim-family-Σ-all-elements-merely-equal-base
+ K q x nnb =
+ rec-trunc-Prop
+ ( trunc-Prop (B x))
+ ( λ xy →
+ rec-trunc-Prop
+ ( trunc-Prop (B x))
+ ( λ p → unit-trunc-Prop (tr B p (pr2 xy)))
+ ( q (pr1 xy) x))
+ ( K (λ nab → nnb (λ y → nab (x , y))))
+```
+
+### Double negation elimination for products of types with double negation elimination
+
+```agda
+has-prop-double-negation-elim-product :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} →
+ has-prop-double-negation-elim A →
+ has-prop-double-negation-elim B →
+ has-prop-double-negation-elim (A × B)
+has-prop-double-negation-elim-product {A = A} {B} f g nnab =
+ rec-trunc-Prop
+ ( trunc-Prop (A × B))
+ ( λ a →
+ rec-trunc-Prop
+ ( trunc-Prop (A × B))
+ ( λ b → unit-trunc-Prop (a , b))
+ ( g (map-double-negation pr2 nnab)))
+ ( f (map-double-negation pr1 nnab))
+```
+
+## References
+
+{{#bibliography}}
+
+## See also
+
+- [The double negation modality](foundation.double-negation-modality.md)
+- [Irrefutable propositions](foundation.irrefutable-propositions.md) are double
+ negation connected types.
diff --git a/src/logic/propositionally-decidable-maps.lagda.md b/src/logic/propositionally-decidable-maps.lagda.md
new file mode 100644
index 0000000000..5d0eb7a334
--- /dev/null
+++ b/src/logic/propositionally-decidable-maps.lagda.md
@@ -0,0 +1,187 @@
+# Propositionally decidable maps
+
+```agda
+module logic.propositionally-decidable-maps where
+```
+
+Imports
+
+```agda
+open import elementary-number-theory.natural-numbers
+
+open import foundation.coproduct-types
+open import foundation.decidable-dependent-pair-types
+open import foundation.decidable-maps
+open import foundation.dependent-pair-types
+open import foundation.double-negation-dense-equality-maps
+open import foundation.identity-types
+open import foundation.propositional-truncations
+open import foundation.universe-levels
+
+open import foundation-core.fibers-of-maps
+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.iterating-functions
+
+open import logic.propositionally-decidable-types
+```
+
+
+
+## Idea
+
+A [map](foundation-core.function-types.md) is said to be
+{{#concept "propositionally decidable" Disambiguation="map of types" Agda=is-inhabited-or-empty-map}}
+if its [fibers](foundation-core.fibers-of-maps.md) are
+[propositionally decidable types](logic.propositionally-decidable-types.md),
+i.e., if they are merely [inhabited](foundation.inhabited-types.md) or
+[empty](foundation.empty-types.md).
+
+## Definitions
+
+### The propositional decidability predicate on a map
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ is-inhabited-or-empty-map : (A → B) → UU (l1 ⊔ l2)
+ is-inhabited-or-empty-map f = (y : B) → is-inhabited-or-empty (fiber f y)
+```
+
+### The type of propositionally decidable maps
+
+```agda
+inhabited-or-empty-map : {l1 l2 : Level} (A : UU l1) (B : UU l2) → UU (l1 ⊔ l2)
+inhabited-or-empty-map A B = Σ (A → B) (is-inhabited-or-empty-map)
+
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : inhabited-or-empty-map A B)
+ where
+
+ map-inhabited-or-empty-map : A → B
+ map-inhabited-or-empty-map = pr1 f
+
+ is-inhabited-or-empty-inhabited-or-empty-map :
+ is-inhabited-or-empty-map map-inhabited-or-empty-map
+ is-inhabited-or-empty-inhabited-or-empty-map = pr2 f
+```
+
+## Properties
+
+### Propositionally decidable maps are closed under homotopy
+
+```agda
+abstract
+ is-inhabited-or-empty-map-htpy :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} {f g : A → B} →
+ f ~ g → is-inhabited-or-empty-map g → is-inhabited-or-empty-map f
+ is-inhabited-or-empty-map-htpy H K b =
+ is-inhabited-or-empty-equiv
+ ( equiv-tot (λ a → equiv-concat (inv (H a)) b))
+ ( K b)
+```
+
+### Decidable maps are propositionally decidable
+
+```agda
+is-inhabited-or-empty-map-is-decidable-map :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} →
+ is-decidable-map f → is-inhabited-or-empty-map f
+is-inhabited-or-empty-map-is-decidable-map H x =
+ is-inhabited-or-empty-is-decidable (H x)
+```
+
+### The identity map is propositionally decidable
+
+```agda
+abstract
+ is-inhabited-or-empty-map-id :
+ {l : Level} {X : UU l} → is-inhabited-or-empty-map (id {l} {X})
+ is-inhabited-or-empty-map-id y = inl (unit-trunc-Prop (y , refl))
+```
+
+### Composition of propositionally decidable maps
+
+The composite `g ∘ f` of two propositionally decidable maps is propositionally
+decidable if `g` is injective.
+
+```agda
+module _
+ {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3}
+ {g : B → C} {f : A → B}
+ where
+
+ abstract
+ is-inhabited-or-empty-map-comp :
+ is-injective g →
+ is-inhabited-or-empty-map g →
+ is-inhabited-or-empty-map f →
+ is-inhabited-or-empty-map (g ∘ f)
+ is-inhabited-or-empty-map-comp H G F x =
+ is-inhabited-or-empty-equiv
+ ( compute-fiber-comp g f x)
+ ( elim-is-inhabited-or-empty-Prop
+ ( is-inhabited-or-empty-Prop
+ ( Σ (fiber g x) (fiber f ∘ pr1)))
+ ( λ t →
+ elim-is-inhabited-or-empty-Prop
+ ( is-inhabited-or-empty-Prop (Σ (fiber g x) (fiber f ∘ pr1)))
+ ( λ s → inl (unit-trunc-Prop (t , s)))
+ ( λ ns →
+ inr
+ ( λ ts →
+ ns
+ ( pr1 (pr2 ts) ,
+ pr2 (pr2 ts) ∙ H ((pr2 (pr1 ts)) ∙ inv (pr2 t)))))
+ ( F (pr1 t)))
+ ( λ nt → inr (λ ts → nt (pr1 ts)))
+ ( G x))
+```
+
+The composite `g ∘ f` of two propositionally decidable maps is propositionally
+decidable if `g` has double negation dense equality.
+
+```agda
+module _
+ {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3}
+ {g : B → C} {f : A → B}
+ where
+
+ abstract
+ is-inhabited-or-empty-map-comp-has-double-negation-dense-equality-map :
+ has-double-negation-dense-equality-map g →
+ is-inhabited-or-empty-map g →
+ is-inhabited-or-empty-map f →
+ is-inhabited-or-empty-map (g ∘ f)
+ is-inhabited-or-empty-map-comp-has-double-negation-dense-equality-map
+ H G F x =
+ is-inhabited-or-empty-equiv
+ ( compute-fiber-comp g f x)
+ ( is-inhabited-or-empty-Σ-has-double-negation-dense-equality-base
+ ( H x)
+ ( G x)
+ ( F ∘ pr1))
+
+module _
+ {l1 : Level} {A : UU l1} {f : A → A}
+ (is-inhabited-or-empty-f : is-inhabited-or-empty-map f)
+ (F : has-double-negation-dense-equality-map f)
+ where
+
+ is-inhabited-or-empty-map-iterate-has-double-negation-dense-equality-map :
+ (n : ℕ) → is-inhabited-or-empty-map (iterate n f)
+ is-inhabited-or-empty-map-iterate-has-double-negation-dense-equality-map
+ zero-ℕ =
+ is-inhabited-or-empty-map-id
+ is-inhabited-or-empty-map-iterate-has-double-negation-dense-equality-map
+ ( succ-ℕ n) =
+ is-inhabited-or-empty-map-comp-has-double-negation-dense-equality-map
+ ( F)
+ ( is-inhabited-or-empty-f)
+ ( is-inhabited-or-empty-map-iterate-has-double-negation-dense-equality-map
+ ( n))
+```
diff --git a/src/logic/propositionally-decidable-types.lagda.md b/src/logic/propositionally-decidable-types.lagda.md
new file mode 100644
index 0000000000..400e949a3b
--- /dev/null
+++ b/src/logic/propositionally-decidable-types.lagda.md
@@ -0,0 +1,362 @@
+# Propositionally decidable types
+
+```agda
+module logic.propositionally-decidable-types where
+```
+
+Imports
+
+```agda
+open import foundation.coinhabited-pairs-of-types
+open import foundation.coproduct-types
+open import foundation.decidable-types
+open import foundation.dependent-pair-types
+open import foundation.empty-types
+open import foundation.equivalences
+open import foundation.functoriality-coproduct-types
+open import foundation.logical-equivalences
+open import foundation.negation
+open import foundation.propositional-truncations
+open import foundation.retracts-of-types
+open import foundation.universe-levels
+
+open import foundation-core.cartesian-product-types
+open import foundation-core.decidable-propositions
+open import foundation-core.function-types
+open import foundation-core.propositions
+```
+
+
+
+## Idea
+
+A type is said to be
+{{#concept "propositionally decidable" Disambiguation="type" Agda=is-inhabited-or-empty}}
+if we can either deduce that it is [inhabited](foundation.inhabited-types.md),
+or we can deduce that it is [empty](foundation-core.empty-types.md), where
+inhabitedness of a type is expressed using the
+[propositional truncation](foundation.propositional-truncations.md).
+
+## Definitions
+
+### The predicate that a type is inhabited or empty
+
+```agda
+is-inhabited-or-empty : {l1 : Level} → UU l1 → UU l1
+is-inhabited-or-empty A = type-trunc-Prop A + is-empty A
+```
+
+### Merely decidable types
+
+A type `A` is said to be
+{{#concept "merely decidable" Agda=is-merely-decidable}} if it comes equipped
+with an element of `║ is-decidable A ║₋₁`, or equivalently, the
+[disjunction](foundation.disjunction.md) `A ∨ ¬ A` holds.
+
+```agda
+is-merely-decidable-Prop :
+ {l : Level} → UU l → Prop l
+is-merely-decidable-Prop A = trunc-Prop (is-decidable A)
+
+is-merely-decidable : {l : Level} → UU l → UU l
+is-merely-decidable A = type-trunc-Prop (is-decidable A)
+```
+
+## Properties
+
+### Decidable types are inhabited or empty
+
+```agda
+is-inhabited-or-empty-is-decidable :
+ {l : Level} {A : UU l} → is-decidable A → is-inhabited-or-empty A
+is-inhabited-or-empty-is-decidable (inl x) = inl (unit-trunc-Prop x)
+is-inhabited-or-empty-is-decidable (inr y) = inr y
+```
+
+### Decidable types are merely decidable
+
+```agda
+is-merely-decidable-is-decidable :
+ {l : Level} {A : UU l} → is-decidable A → is-merely-decidable A
+is-merely-decidable-is-decidable = unit-trunc-Prop
+```
+
+### Being inhabited or empty is a proposition
+
+```agda
+abstract
+ is-property-is-inhabited-or-empty :
+ {l1 : Level} (A : UU l1) → is-prop (is-inhabited-or-empty A)
+ is-property-is-inhabited-or-empty A =
+ is-prop-coproduct
+ ( λ t → apply-universal-property-trunc-Prop t empty-Prop)
+ ( is-prop-type-trunc-Prop)
+ ( is-prop-neg)
+
+is-inhabited-or-empty-Prop : {l1 : Level} → UU l1 → Prop l1
+pr1 (is-inhabited-or-empty-Prop A) = is-inhabited-or-empty A
+pr2 (is-inhabited-or-empty-Prop A) = is-property-is-inhabited-or-empty A
+```
+
+### Types are inhabited or empty if and only if they are merely decidable
+
+```agda
+module _
+ {l : Level} {A : UU l}
+ where
+
+ is-inhabited-or-empty-is-merely-decidable :
+ is-merely-decidable A → is-inhabited-or-empty A
+ is-inhabited-or-empty-is-merely-decidable =
+ rec-trunc-Prop
+ ( is-inhabited-or-empty-Prop A)
+ ( is-inhabited-or-empty-is-decidable)
+
+ is-merely-decidable-is-inhabited-or-empty :
+ is-inhabited-or-empty A → is-merely-decidable A
+ is-merely-decidable-is-inhabited-or-empty (inl |x|) =
+ rec-trunc-Prop (is-merely-decidable-Prop A) (unit-trunc-Prop ∘ inl) |x|
+ is-merely-decidable-is-inhabited-or-empty (inr y) =
+ unit-trunc-Prop (inr y)
+
+ iff-is-inhabited-or-empty-is-merely-decidable :
+ is-merely-decidable A ↔ is-inhabited-or-empty A
+ iff-is-inhabited-or-empty-is-merely-decidable =
+ ( is-inhabited-or-empty-is-merely-decidable ,
+ is-merely-decidable-is-inhabited-or-empty)
+```
+
+### Propositionally decidable types are closed under coinhabited types
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ is-inhabited-or-empty-is-coinhabited :
+ is-coinhabited A B → is-inhabited-or-empty A → is-inhabited-or-empty B
+ is-inhabited-or-empty-is-coinhabited (f , b) =
+ map-coproduct
+ ( f)
+ ( is-empty-type-trunc-Prop' ∘ map-neg b ∘ is-empty-type-trunc-Prop)
+```
+
+### Propositionally decidable types are closed under logical equivalences
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ is-inhabited-or-empty-iff :
+ (A → B) → (B → A) → is-inhabited-or-empty A → is-inhabited-or-empty B
+ is-inhabited-or-empty-iff f g (inl |a|) =
+ inl (rec-trunc-Prop (trunc-Prop B) (unit-trunc-Prop ∘ f) |a|)
+ is-inhabited-or-empty-iff f g (inr na) = inr (na ∘ g)
+
+ is-inhabited-or-empty-iff' :
+ A ↔ B → is-inhabited-or-empty A → is-inhabited-or-empty B
+ is-inhabited-or-empty-iff' (f , g) = is-inhabited-or-empty-iff f g
+
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ iff-is-inhabited-or-empty :
+ A ↔ B → is-inhabited-or-empty A ↔ is-inhabited-or-empty B
+ iff-is-inhabited-or-empty e =
+ is-inhabited-or-empty-iff' e , is-inhabited-or-empty-iff' (inv-iff e)
+```
+
+### Propositionally decidable types are closed under retracts
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ is-inhabited-or-empty-retract-of :
+ A retract-of B → is-inhabited-or-empty B → is-inhabited-or-empty A
+ is-inhabited-or-empty-retract-of R =
+ is-inhabited-or-empty-iff' (iff-retract' R)
+
+ is-inhabited-or-empty-retract-of' :
+ A retract-of B → is-inhabited-or-empty A → is-inhabited-or-empty B
+ is-inhabited-or-empty-retract-of' R =
+ is-inhabited-or-empty-iff' (inv-iff (iff-retract' R))
+```
+
+### Propositionally decidable types are closed under equivalences
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ is-inhabited-or-empty-is-equiv :
+ {f : A → B} → is-equiv f → is-inhabited-or-empty B → is-inhabited-or-empty A
+ is-inhabited-or-empty-is-equiv {f} H =
+ is-inhabited-or-empty-retract-of (retract-equiv (f , H))
+
+ is-inhabited-or-empty-equiv :
+ A ≃ B → is-inhabited-or-empty B → is-inhabited-or-empty A
+ is-inhabited-or-empty-equiv e =
+ is-inhabited-or-empty-iff (map-inv-equiv e) (map-equiv e)
+
+ is-inhabited-or-empty-equiv' :
+ A ≃ B → is-inhabited-or-empty A → is-inhabited-or-empty B
+ is-inhabited-or-empty-equiv' e =
+ is-inhabited-or-empty-iff (map-equiv e) (map-inv-equiv e)
+```
+
+### Elimination for propositional decidability
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} (B : Prop l2)
+ where
+
+ elim-is-inhabited-or-empty-Prop :
+ (A → type-Prop B) → (¬ A → type-Prop B) →
+ is-inhabited-or-empty A → type-Prop B
+ elim-is-inhabited-or-empty-Prop b nb (inl |a|) = rec-trunc-Prop B b |a|
+ elim-is-inhabited-or-empty-Prop b nb (inr na) = nb na
+
+ elim-is-inhabited-or-empty-Prop' :
+ (is-decidable A → type-Prop B) → is-inhabited-or-empty A → type-Prop B
+ elim-is-inhabited-or-empty-Prop' f =
+ elim-is-inhabited-or-empty-Prop (f ∘ inl) (f ∘ inr)
+```
+
+### Coproducts of propositionally decidable types are propositionally decidable
+
+```agda
+is-inhabited-or-empty-coproduct :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} →
+ is-inhabited-or-empty A →
+ is-inhabited-or-empty B →
+ is-inhabited-or-empty (A + B)
+is-inhabited-or-empty-coproduct (inl a) dB =
+ rec-trunc-Prop (is-inhabited-or-empty-Prop _) (inl ∘ unit-trunc-Prop ∘ inl) a
+is-inhabited-or-empty-coproduct (inr na) (inl b) =
+ rec-trunc-Prop (is-inhabited-or-empty-Prop _) (inl ∘ unit-trunc-Prop ∘ inr) b
+is-inhabited-or-empty-coproduct (inr na) (inr nb) = inr (rec-coproduct na nb)
+```
+
+### Cartesian products of propositionally decidable types are propositionally decidable
+
+```agda
+is-inhabited-or-empty-product :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} →
+ is-inhabited-or-empty A →
+ is-inhabited-or-empty B →
+ is-inhabited-or-empty (A × B)
+is-inhabited-or-empty-product (inl a) (inl b) =
+ inl (map-inv-distributive-trunc-product-Prop (a , b))
+is-inhabited-or-empty-product (inl a) (inr nb) = inr (nb ∘ pr2)
+is-inhabited-or-empty-product (inr na) dB = inr (na ∘ pr1)
+
+is-inhabited-or-empty-product' :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} →
+ is-inhabited-or-empty A → (A → is-inhabited-or-empty B) →
+ is-inhabited-or-empty (A × B)
+is-inhabited-or-empty-product' (inl a) dB =
+ rec-trunc-Prop
+ ( is-inhabited-or-empty-Prop _)
+ ( rec-coproduct
+ ( λ b → inl (map-inv-distributive-trunc-product-Prop (a , b)))
+ ( λ nb → inr (nb ∘ pr2)) ∘
+ dB)
+ ( a)
+is-inhabited-or-empty-product' (inr na) dB = inr (na ∘ pr1)
+
+is-inhabited-or-empty-left-factor :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} →
+ is-inhabited-or-empty (A × B) → B → is-inhabited-or-empty A
+is-inhabited-or-empty-left-factor (inl x) b =
+ inl (pr1 (map-distributive-trunc-product-Prop x))
+is-inhabited-or-empty-left-factor (inr nx) b = inr (λ a → nx (a , b))
+
+is-inhabited-or-empty-right-factor :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} →
+ is-inhabited-or-empty (A × B) → A → is-inhabited-or-empty B
+is-inhabited-or-empty-right-factor (inl x) a =
+ inl (pr2 (map-distributive-trunc-product-Prop x))
+is-inhabited-or-empty-right-factor (inr nx) a = inr (λ b → nx (a , b))
+```
+
+### Function types of propositionally decidable types are propositionally decidable
+
+```agda
+is-inhabited-or-empty-function-type :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} →
+ is-inhabited-or-empty A →
+ is-inhabited-or-empty B →
+ is-inhabited-or-empty (A → B)
+is-inhabited-or-empty-function-type (inl a) (inl b) =
+ inl (rec-trunc-Prop (trunc-Prop _) (λ y → unit-trunc-Prop (λ _ → y)) b)
+is-inhabited-or-empty-function-type (inl a) (inr nb) =
+ inr (λ f → rec-trunc-Prop empty-Prop (λ x → nb (f x)) a)
+is-inhabited-or-empty-function-type (inr na) dB =
+ inl (unit-trunc-Prop (ex-falso ∘ na))
+
+is-inhabited-or-empty-function-type' :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} →
+ is-inhabited-or-empty A → (A → is-inhabited-or-empty B) →
+ is-inhabited-or-empty (A → B)
+is-inhabited-or-empty-function-type' (inl a) dB =
+ rec-trunc-Prop (is-inhabited-or-empty-Prop _)
+ ( λ x →
+ rec-coproduct
+ ( inl ∘ rec-trunc-Prop (trunc-Prop _) (λ y → unit-trunc-Prop (λ _ → y)))
+ ( λ nb → inr (λ f → nb (f x)))
+ ( dB x))
+ ( a)
+is-inhabited-or-empty-function-type' (inr na) dB =
+ inl (unit-trunc-Prop (ex-falso ∘ na))
+```
+
+### Decidability of a propositional truncation
+
+```agda
+abstract
+ is-prop-is-decidable-trunc-Prop :
+ {l : Level} (A : UU l) → is-prop (is-decidable (type-trunc-Prop A))
+ is-prop-is-decidable-trunc-Prop A =
+ is-prop-is-decidable is-prop-type-trunc-Prop
+
+is-decidable-trunc-Prop : {l : Level} → UU l → Prop l
+pr1 (is-decidable-trunc-Prop A) = is-decidable (type-trunc-Prop A)
+pr2 (is-decidable-trunc-Prop A) = is-prop-is-decidable-trunc-Prop A
+
+is-decidable-trunc-Prop-is-decidable :
+ {l : Level} {A : UU l} →
+ is-decidable A → type-Prop (is-decidable-trunc-Prop A)
+is-decidable-trunc-Prop-is-decidable (inl a) =
+ inl (unit-trunc-Prop a)
+is-decidable-trunc-Prop-is-decidable (inr f) =
+ inr (map-universal-property-trunc-Prop empty-Prop f)
+
+is-decidable-trunc-Prop-is-merely-decidable :
+ {l : Level} {A : UU l} →
+ is-merely-decidable A → is-decidable (type-trunc-Prop A)
+is-decidable-trunc-Prop-is-merely-decidable {A = A} =
+ map-universal-property-trunc-Prop
+ ( is-decidable-trunc-Prop A)
+ ( is-decidable-trunc-Prop-is-decidable)
+
+is-merely-decidable-is-decidable-trunc-Prop :
+ {l : Level} (A : UU l) →
+ is-decidable (type-trunc-Prop A) → is-merely-decidable A
+is-merely-decidable-is-decidable-trunc-Prop A (inl x) =
+ apply-universal-property-trunc-Prop x
+ ( is-merely-decidable-Prop A)
+ ( unit-trunc-Prop ∘ inl)
+is-merely-decidable-is-decidable-trunc-Prop A (inr f) =
+ unit-trunc-Prop (inr (f ∘ unit-trunc-Prop))
+```
+
+## See also
+
+- That decidablity is irrefutable is shown in
+ [`foundation.irrefutable-propositions`](foundation.irrefutable-propositions.md).
diff --git a/src/logic/propositionally-double-negation-eliminating-maps.lagda.md b/src/logic/propositionally-double-negation-eliminating-maps.lagda.md
new file mode 100644
index 0000000000..7738cf2653
--- /dev/null
+++ b/src/logic/propositionally-double-negation-eliminating-maps.lagda.md
@@ -0,0 +1,124 @@
+# Propositionally double negation eliminating maps
+
+```agda
+module logic.propositionally-double-negation-eliminating-maps where
+```
+
+Imports
+
+```agda
+open import foundation.dependent-pair-types
+open import foundation.identity-types
+open import foundation.propositions
+open import foundation.universe-levels
+
+open import foundation-core.fibers-of-maps
+open import foundation-core.functoriality-dependent-pair-types
+open import foundation-core.homotopies
+
+open import logic.double-negation-eliminating-maps
+open import logic.propositional-double-negation-elimination
+open import logic.propositionally-decidable-maps
+```
+
+
+
+## Idea
+
+A [map](foundation-core.function-types.md) is said to be
+{{#concept "propositionally double negation eliminating" Disambiguation="map of types" Agda=is-prop-double-negation-eliminating-map}}
+if its [fibers](foundation-core.fibers-of-maps.md) satisfy
+[propositional double negation elimination](logic.propositional-double-negation-elimination.md).
+I.e., for every `y : B`, if `fiber f y` is
+[irrefutable](foundation.irrefutable-propositions.md), then we have that the
+fiber is in fact inhabited. In other words, double negation eliminating maps
+come [equipped](foundation.structure.md) with a map
+
+```text
+ (y : B) → ¬¬ (fiber f y) → ║ fiber f y ║₋₁.
+```
+
+## Definitions
+
+### Propositional double negation elimination on a map
+
+```agda
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ where
+
+ is-prop-double-negation-eliminating-map : (A → B) → UU (l1 ⊔ l2)
+ is-prop-double-negation-eliminating-map f =
+ (y : B) → has-prop-double-negation-elim (fiber f y)
+
+ is-property-is-prop-double-negation-eliminating-map :
+ {f : A → B} → is-prop (is-prop-double-negation-eliminating-map f)
+ is-property-is-prop-double-negation-eliminating-map {f} =
+ is-prop-Π (λ y → is-prop-has-prop-double-negation-elim (fiber f y))
+
+ is-prop-double-negation-eliminating-map-Prop : (A → B) → Prop (l1 ⊔ l2)
+ is-prop-double-negation-eliminating-map-Prop f =
+ is-prop-double-negation-eliminating-map f ,
+ is-property-is-prop-double-negation-eliminating-map
+```
+
+### The type of propositionally double negation eliminating maps
+
+```agda
+prop-double-negation-eliminating-map :
+ {l1 l2 : Level} (A : UU l1) (B : UU l2) → UU (l1 ⊔ l2)
+prop-double-negation-eliminating-map A B =
+ Σ (A → B) (is-prop-double-negation-eliminating-map)
+
+module _
+ {l1 l2 : Level} {A : UU l1} {B : UU l2}
+ (f : prop-double-negation-eliminating-map A B)
+ where
+
+ map-prop-double-negation-eliminating-map : A → B
+ map-prop-double-negation-eliminating-map = pr1 f
+
+ is-prop-double-negation-eliminating-prop-double-negation-eliminating-map :
+ is-prop-double-negation-eliminating-map
+ map-prop-double-negation-eliminating-map
+ is-prop-double-negation-eliminating-prop-double-negation-eliminating-map =
+ pr2 f
+```
+
+## Properties
+
+### Propositionally double negation eliminating maps are closed under homotopy
+
+```agda
+abstract
+ is-prop-double-negation-eliminating-map-htpy :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} {f g : A → B} →
+ f ~ g →
+ is-prop-double-negation-eliminating-map g →
+ is-prop-double-negation-eliminating-map f
+ is-prop-double-negation-eliminating-map-htpy H K b =
+ has-prop-double-negation-elim-equiv
+ ( equiv-tot (λ a → equiv-concat (inv (H a)) b))
+ ( K b)
+```
+
+### Double negation eliminating maps are propositionally double negation eliminating
+
+```agda
+is-prop-double-negation-eliminating-map-is-double-negation-eliminating-map :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} →
+ is-double-negation-eliminating-map f →
+ is-prop-double-negation-eliminating-map f
+is-prop-double-negation-eliminating-map-is-double-negation-eliminating-map H y =
+ has-prop-double-negation-elim-has-double-negation-elim (H y)
+```
+
+### Propositionally decidable maps are propositionally double negation eliminating
+
+```agda
+is-prop-double-negation-eliminating-map-is-inhabited-or-empty-map :
+ {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} →
+ is-inhabited-or-empty-map f → is-prop-double-negation-eliminating-map f
+is-prop-double-negation-eliminating-map-is-inhabited-or-empty-map H y =
+ prop-double-negation-elim-is-inhabited-or-empty (H y)
+```
diff --git a/src/set-theory/cantors-diagonal-argument.lagda.md b/src/set-theory/cantors-diagonal-argument.lagda.md
index b573aa9ab7..083b3aff85 100644
--- a/src/set-theory/cantors-diagonal-argument.lagda.md
+++ b/src/set-theory/cantors-diagonal-argument.lagda.md
@@ -33,6 +33,8 @@ open import foundation-core.empty-types
open import foundation-core.fibers-of-maps
open import foundation-core.propositions
+open import logic.propositionally-decidable-types
+
open import set-theory.countable-sets
open import set-theory.infinite-sets
open import set-theory.uncountable-sets
diff --git a/src/trees.lagda.md b/src/trees.lagda.md
index ccadfa4206..c2cfc02fbc 100644
--- a/src/trees.lagda.md
+++ b/src/trees.lagda.md
@@ -4,7 +4,7 @@
{-# OPTIONS --guardedness #-}
```
-## Files in the `trees` module
+## Modules in the trees namespace
```agda
module trees where
diff --git a/src/univalent-combinatorics/counting.lagda.md b/src/univalent-combinatorics/counting.lagda.md
index b9c4fa6d19..79b55c6a18 100644
--- a/src/univalent-combinatorics/counting.lagda.md
+++ b/src/univalent-combinatorics/counting.lagda.md
@@ -26,6 +26,8 @@ open import foundation.sets
open import foundation.unit-type
open import foundation.universe-levels
+open import logic.propositionally-decidable-types
+
open import univalent-combinatorics.equality-standard-finite-types
open import univalent-combinatorics.standard-finite-types
```
diff --git a/src/univalent-combinatorics/decidable-dependent-function-types.lagda.md b/src/univalent-combinatorics/decidable-dependent-function-types.lagda.md
index 5f6cfff00c..c9e717f084 100644
--- a/src/univalent-combinatorics/decidable-dependent-function-types.lagda.md
+++ b/src/univalent-combinatorics/decidable-dependent-function-types.lagda.md
@@ -62,7 +62,7 @@ is-decidable-Π-is-finite :
((x : A) → is-decidable (B x)) → is-decidable ((x : A) → B x)
is-decidable-Π-is-finite {l1} {l2} {A} {B} H d =
is-decidable-iff
- ( map-Π (λ x → elim-trunc-Prop-is-decidable (d x)))
+ ( map-Π (λ x → ε-operator-is-decidable (d x)))
( map-Π (λ x → unit-trunc-Prop))
( is-decidable-iff
( α)
@@ -77,7 +77,7 @@ is-decidable-Π-is-finite {l1} {l2} {A} {B} H d =
( λ x →
is-decidable-iff
( unit-trunc-Prop)
- ( elim-trunc-Prop-is-decidable (d x))
+ ( ε-operator-is-decidable (d x))
( d x))))))
where
α : type-trunc-Prop ((x : A) → B x) → (x : A) → type-trunc-Prop (B x)
diff --git a/src/univalent-combinatorics/dependent-pair-types.lagda.md b/src/univalent-combinatorics/dependent-pair-types.lagda.md
index 911d347b75..bb19fd3a96 100644
--- a/src/univalent-combinatorics/dependent-pair-types.lagda.md
+++ b/src/univalent-combinatorics/dependent-pair-types.lagda.md
@@ -31,6 +31,8 @@ open import foundation.type-arithmetic-coproduct-types
open import foundation.type-arithmetic-dependent-pair-types
open import foundation.universe-levels
+open import logic.propositionally-decidable-types
+
open import univalent-combinatorics.coproduct-types
open import univalent-combinatorics.counting
open import univalent-combinatorics.counting-dependent-pair-types
diff --git a/src/univalent-combinatorics/finite-types.lagda.md b/src/univalent-combinatorics/finite-types.lagda.md
index 0ddff4cb5a..ab9b151fe7 100644
--- a/src/univalent-combinatorics/finite-types.lagda.md
+++ b/src/univalent-combinatorics/finite-types.lagda.md
@@ -42,6 +42,8 @@ open import foundation.universe-levels
open import foundation-core.torsorial-type-families
+open import logic.propositionally-decidable-types
+
open import univalent-combinatorics.counting
open import univalent-combinatorics.double-counting
open import univalent-combinatorics.standard-finite-types