diff --git a/references.bib b/references.bib index c2241820e2..c89a9ec3a0 100644 --- a/references.bib +++ b/references.bib @@ -264,6 +264,25 @@ @article{EKMS93 keywords = {axiality,closure operation,Galois connection,interior operation,polarity} } +@article{Esc08, + author = {Escardó, Martín}, + title = {Exhaustible sets in higher-type computation}, + journal = {Logical Methods in Computer Science}, + volume = {4}, + year = {2008}, + month = {8}, + number = {3}, + issue = {3}, + publisher = {Centre pour la Communication Scientifique Directe (CCSD)}, + pages = {3:3, 37}, + issn = {1860-5974}, + doi = {10.2168/LMCS-4(3:3)2008}, + eprint = {0808.0441}, + eprinttype = {arxiv}, + eprintclass = {cs}, + primaryclass = {cs.LO} +} + @online{Esc19DefinitionsEquivalence, title = {Definitions of Equivalence Satisfying Judgmental/Strict Groupoid Laws?}, author = {Escardó, Martín Hötzel}, @@ -480,6 +499,22 @@ @online{MR23 keywords = {20B30 03B15,Mathematics - Group Theory,Mathematics - Logic} } +@article{Esc21b, + author = {Escardó, Martín Hötzel}, + title = {Injective types in univalent mathematics}, + journal = {Mathematical Structures in Computer Science}, + volume = {31}, + year = {2021}, + number = {1}, + pages = {89--111}, + issn = {0960-1295,1469-8072}, + doi = {10.1017/S0960129520000225}, + eprint = {1903.01211}, + archiveprefix = {arXiv}, + primaryclass = {math.CT}, + url = {https://martinescardo.github.io/TypeTopology/InjectiveTypes.Article.html} +} + @book{MRR88, title = {A {{Course}} in {{Constructive Algebra}}}, author = {Mines, Ray and Richman, Fred and Ruitenburg, Wim}, diff --git a/src/category-theory/opposite-large-precategories.lagda.md b/src/category-theory/opposite-large-precategories.lagda.md index 3365e3523b..99647dd2de 100644 --- a/src/category-theory/opposite-large-precategories.lagda.md +++ b/src/category-theory/opposite-large-precategories.lagda.md @@ -14,6 +14,7 @@ open import foundation.dependent-pair-types open import foundation.equivalences open import foundation.homotopies open import foundation.identity-types +open import foundation.large-identity-types open import foundation.sets open import foundation.strictly-involutive-identity-types open import foundation.universe-levels @@ -141,6 +142,18 @@ module _ ## Properties +### The opposite large precategory construction is a strict involution + +```agda +module _ + {α : Level → Level} {β : Level → Level → Level} (C : Large-Precategory α β) + where + + is-involution-opposite-Large-Precategory : + opposite-Large-Precategory (opposite-Large-Precategory C) =ω C + is-involution-opposite-Large-Precategory = reflω +``` + ### Computing the isomorphism sets of the opposite large precategory ```agda diff --git a/src/domain-theory.lagda.md b/src/domain-theory.lagda.md new file mode 100644 index 0000000000..0b0c1426a5 --- /dev/null +++ b/src/domain-theory.lagda.md @@ -0,0 +1,14 @@ +# Domain theory + +```agda +module domain-theory where + +open import domain-theory.directed-complete-posets public +open import domain-theory.directed-families-posets public +open import domain-theory.kleenes-fixed-point-theorem-omega-complete-posets public +open import domain-theory.kleenes-fixed-point-theorem-posets public +open import domain-theory.omega-complete-posets public +open import domain-theory.omega-continuous-maps-omega-complete-posets public +open import domain-theory.omega-continuous-maps-posets public +open import domain-theory.scott-continuous-maps-posets public +``` diff --git a/src/domain-theory/directed-complete-posets.lagda.md b/src/domain-theory/directed-complete-posets.lagda.md new file mode 100644 index 0000000000..88c512f414 --- /dev/null +++ b/src/domain-theory/directed-complete-posets.lagda.md @@ -0,0 +1,174 @@ +# Directed complete posets + +```agda +module domain-theory.directed-complete-posets where +``` + +
Imports + +```agda +open import domain-theory.directed-families-posets + +open import foundation.binary-relations +open import foundation.dependent-pair-types +open import foundation.equivalences +open import foundation.function-types +open import foundation.logical-equivalences +open import foundation.propositions +open import foundation.sets +open import foundation.universe-levels + +open import order-theory.least-upper-bounds-posets +open import order-theory.posets +``` + +
+ +## Idea + +A +{{#concept "directed complete poset" WD="complete partial order" WDID=Q3082805 Agda=Directed-Complete-Poset}} +is a [poset](order-theory.posets.md) such that all +[directed families](domain-theory.directed-families-posets.md) have +[least upper bounds](order-theory.least-upper-bounds-posets.md). + +## Definitions + +### The predicate on posets of being a directed complete poset + +```agda +module _ + {l1 l2 : Level} (l3 : Level) (P : Poset l1 l2) + where + + is-directed-complete-Poset-Prop : Prop (l1 ⊔ l2 ⊔ lsuc l3) + is-directed-complete-Poset-Prop = + Π-Prop + ( directed-family-Poset l3 P) + ( λ F → + has-least-upper-bound-family-of-elements-prop-Poset P + ( family-directed-family-Poset P F)) + + is-directed-complete-Poset : UU (l1 ⊔ l2 ⊔ lsuc l3) + is-directed-complete-Poset = + type-Prop is-directed-complete-Poset-Prop + + is-prop-is-directed-complete-Poset : is-prop is-directed-complete-Poset + is-prop-is-directed-complete-Poset = + is-prop-type-Prop is-directed-complete-Poset-Prop + +module _ + {l1 l2 l3 : Level} (P : Poset l1 l2) (H : is-directed-complete-Poset l3 P) + where + + sup-is-directed-complete-Poset : directed-family-Poset l3 P → type-Poset P + sup-is-directed-complete-Poset F = pr1 (H F) + + is-least-upper-bound-sup-is-directed-complete-Poset : + (x : directed-family-Poset l3 P) → + is-least-upper-bound-family-of-elements-Poset P + ( family-directed-family-Poset P x) + ( sup-is-directed-complete-Poset x) + is-least-upper-bound-sup-is-directed-complete-Poset F = pr2 (H F) +``` + +### Directed complete posets + +```agda +Directed-Complete-Poset : + (l1 l2 l3 : Level) → UU (lsuc l1 ⊔ lsuc l2 ⊔ lsuc l3) +Directed-Complete-Poset l1 l2 l3 = + Σ (Poset l1 l2) (is-directed-complete-Poset l3) + +module _ + {l1 l2 l3 : Level} (A : Directed-Complete-Poset l1 l2 l3) + where + + poset-Directed-Complete-Poset : Poset l1 l2 + poset-Directed-Complete-Poset = pr1 A + + type-Directed-Complete-Poset : UU l1 + type-Directed-Complete-Poset = + type-Poset poset-Directed-Complete-Poset + + leq-prop-Directed-Complete-Poset : + (x y : type-Directed-Complete-Poset) → Prop l2 + leq-prop-Directed-Complete-Poset = + leq-prop-Poset poset-Directed-Complete-Poset + + leq-Directed-Complete-Poset : + (x y : type-Directed-Complete-Poset) → UU l2 + leq-Directed-Complete-Poset = + leq-Poset poset-Directed-Complete-Poset + + is-prop-leq-Directed-Complete-Poset : + (x y : type-Directed-Complete-Poset) → + is-prop (leq-Directed-Complete-Poset x y) + is-prop-leq-Directed-Complete-Poset = + is-prop-leq-Poset poset-Directed-Complete-Poset + + refl-leq-Directed-Complete-Poset : + (x : type-Directed-Complete-Poset) → + leq-Directed-Complete-Poset x x + refl-leq-Directed-Complete-Poset = + refl-leq-Poset poset-Directed-Complete-Poset + + antisymmetric-leq-Directed-Complete-Poset : + is-antisymmetric leq-Directed-Complete-Poset + antisymmetric-leq-Directed-Complete-Poset = + antisymmetric-leq-Poset poset-Directed-Complete-Poset + + transitive-leq-Directed-Complete-Poset : + is-transitive leq-Directed-Complete-Poset + transitive-leq-Directed-Complete-Poset = + transitive-leq-Poset poset-Directed-Complete-Poset + + is-set-type-Directed-Complete-Poset : + is-set type-Directed-Complete-Poset + is-set-type-Directed-Complete-Poset = + is-set-type-Poset poset-Directed-Complete-Poset + + set-Directed-Complete-Poset : Set l1 + set-Directed-Complete-Poset = + set-Poset poset-Directed-Complete-Poset + + is-directed-complete-Directed-Complete-Poset : + is-directed-complete-Poset l3 poset-Directed-Complete-Poset + is-directed-complete-Directed-Complete-Poset = pr2 A + + sup-Directed-Complete-Poset : + directed-family-Poset l3 poset-Directed-Complete-Poset → + type-Directed-Complete-Poset + sup-Directed-Complete-Poset = + sup-is-directed-complete-Poset + ( poset-Directed-Complete-Poset) + ( is-directed-complete-Directed-Complete-Poset) + + is-least-upper-bound-sup-Directed-Complete-Poset : + (x : directed-family-Poset l3 poset-Directed-Complete-Poset) → + is-least-upper-bound-family-of-elements-Poset + ( poset-Directed-Complete-Poset) + ( family-directed-family-Poset poset-Directed-Complete-Poset x) + ( sup-Directed-Complete-Poset x) + is-least-upper-bound-sup-Directed-Complete-Poset = + is-least-upper-bound-sup-is-directed-complete-Poset + ( poset-Directed-Complete-Poset) + ( is-directed-complete-Directed-Complete-Poset) + + leq-sup-Directed-Complete-Poset : + (x : directed-family-Poset l3 poset-Directed-Complete-Poset) + (i : type-directed-family-Poset poset-Directed-Complete-Poset x) → + leq-Directed-Complete-Poset + ( family-directed-family-Poset poset-Directed-Complete-Poset x i) + ( sup-Directed-Complete-Poset x) + leq-sup-Directed-Complete-Poset x = + backward-implication + ( is-least-upper-bound-sup-Directed-Complete-Poset + ( x) + ( sup-Directed-Complete-Poset x)) + ( refl-leq-Directed-Complete-Poset (sup-Directed-Complete-Poset x)) +``` + +## External links + +- [dcpo](https://ncatlab.org/nlab/show/dcpo) at $n$Lab diff --git a/src/domain-theory/directed-families-posets.lagda.md b/src/domain-theory/directed-families-posets.lagda.md new file mode 100644 index 0000000000..02618528ac --- /dev/null +++ b/src/domain-theory/directed-families-posets.lagda.md @@ -0,0 +1,233 @@ +# Directed families in posets + +```agda +module domain-theory.directed-families-posets where +``` + +
Imports + +```agda +open import foundation.action-on-identifications-functions +open import foundation.cartesian-product-types +open import foundation.conjunction +open import foundation.dependent-pair-types +open import foundation.equivalences +open import foundation.existential-quantification +open import foundation.function-types +open import foundation.identity-types +open import foundation.inhabited-types +open import foundation.propositional-truncations +open import foundation.propositions +open import foundation.surjective-maps +open import foundation.universal-quantification +open import foundation.universe-levels + +open import order-theory.order-preserving-maps-posets +open import order-theory.posets +``` + +
+ +## Idea + +A +{{#concept "directed family of elements" WD="upward directed set" WDID=Q1513048 Agda=directed-family-Poset}} +in a [poset](order-theory.posets.md) `P` consists of an +[inhabited type](foundation.inhabited-types.md) `I` and a map `x : I → P` such +that for any two elements `i j : I` there +[exists](foundaiton.existential-quantification.md) an element `k : I` such that +both `x i ≤ x k` and `x j ≤ x k` hold. + +## Definitions + +### The predicate on a family of being directed + +```agda +is-directed-family-Poset-Prop : + {l1 l2 l3 : Level} (P : Poset l1 l2) (I : Inhabited-Type l3) + (x : type-Inhabited-Type I → type-Poset P) → Prop (l2 ⊔ l3) +is-directed-family-Poset-Prop P I x = + ∀' + ( type-Inhabited-Type I) + ( λ i → + ∀' + ( type-Inhabited-Type I) + ( λ j → + ∃ ( type-Inhabited-Type I) + ( λ k → + leq-prop-Poset P (x i) (x k) ∧ leq-prop-Poset P (x j) (x k)))) + +is-directed-family-Poset : + {l1 l2 l3 : Level} (P : Poset l1 l2) (I : Inhabited-Type l3) + (α : type-Inhabited-Type I → type-Poset P) → UU (l2 ⊔ l3) +is-directed-family-Poset P I x = type-Prop (is-directed-family-Poset-Prop P I x) +``` + +### The type of directed families in a poset + +```agda +directed-family-Poset : + {l1 l2 : Level} (l3 : Level) → Poset l1 l2 → UU (l1 ⊔ l2 ⊔ lsuc l3) +directed-family-Poset l3 P = + Σ ( Inhabited-Type l3) + ( λ I → + Σ ( type-Inhabited-Type I → type-Poset P) + ( is-directed-family-Poset P I)) + +module _ + {l1 l2 l3 : Level} (P : Poset l1 l2) (x : directed-family-Poset l3 P) + where + + inhabited-type-directed-family-Poset : Inhabited-Type l3 + inhabited-type-directed-family-Poset = pr1 x + + type-directed-family-Poset : UU l3 + type-directed-family-Poset = + type-Inhabited-Type inhabited-type-directed-family-Poset + + is-inhabited-type-directed-family-Poset : + is-inhabited type-directed-family-Poset + is-inhabited-type-directed-family-Poset = + is-inhabited-type-Inhabited-Type inhabited-type-directed-family-Poset + + family-directed-family-Poset : type-directed-family-Poset → type-Poset P + family-directed-family-Poset = pr1 (pr2 x) + + is-directed-family-directed-family-Poset : + is-directed-family-Poset P + ( inhabited-type-directed-family-Poset) + ( family-directed-family-Poset) + is-directed-family-directed-family-Poset = pr2 (pr2 x) +``` + +### Reindexing directed families in a poset + +```agda +module _ + {l1 l2 l3 l4 : Level} (P : Poset l1 l2) (x : directed-family-Poset l3 P) + {I : UU l4} (f : I ↠ type-directed-family-Poset P x) + where + + type-reindex-directed-family-Poset : UU l4 + type-reindex-directed-family-Poset = I + + is-inhabited-type-reindex-directed-family-Poset : + is-inhabited type-reindex-directed-family-Poset + is-inhabited-type-reindex-directed-family-Poset = + is-inhabited-surjects-onto f (is-inhabited-type-directed-family-Poset P x) + + inhabited-type-reindex-directed-family-Poset : Inhabited-Type l4 + inhabited-type-reindex-directed-family-Poset = + type-reindex-directed-family-Poset , + is-inhabited-type-reindex-directed-family-Poset + + family-reindex-directed-family-Poset : + type-reindex-directed-family-Poset → type-Poset P + family-reindex-directed-family-Poset = + family-directed-family-Poset P x ∘ map-surjection f + + abstract + is-directed-family-reindex-directed-family-Poset : + is-directed-family-Poset P + inhabited-type-reindex-directed-family-Poset + family-reindex-directed-family-Poset + is-directed-family-reindex-directed-family-Poset u v = + elim-exists + ( exists-structure-Prop type-reindex-directed-family-Poset _) + (λ z y → + rec-trunc-Prop + ( exists-structure-Prop type-reindex-directed-family-Poset _) + ( λ p → + intro-exists + ( pr1 p) + ( concatenate-leq-eq-Poset P + ( pr1 y) + ( ap (family-directed-family-Poset P x) (inv (pr2 p))) , + concatenate-leq-eq-Poset P + ( pr2 y) + ( ap (family-directed-family-Poset P x) (inv (pr2 p))))) + ( is-surjective-map-surjection f z)) + ( is-directed-family-directed-family-Poset P x + ( map-surjection f u) + ( map-surjection f v)) + + reindex-directed-family-Poset : directed-family-Poset l4 P + reindex-directed-family-Poset = + inhabited-type-reindex-directed-family-Poset , + family-reindex-directed-family-Poset , + is-directed-family-reindex-directed-family-Poset +``` + +### Reindexing directed families in a poset by an equivalence + +```agda +module _ + {l1 l2 l3 l4 : Level} (P : Poset l1 l2) (x : directed-family-Poset l3 P) + {I : UU l4} + where + + reindex-equiv-directed-family-Poset : + I ≃ type-directed-family-Poset P x → directed-family-Poset l4 P + reindex-equiv-directed-family-Poset f = + reindex-directed-family-Poset P x (surjection-equiv f) + + reindex-inv-equiv-directed-family-Poset : + type-directed-family-Poset P x ≃ I → directed-family-Poset l4 P + reindex-inv-equiv-directed-family-Poset f = + reindex-directed-family-Poset P x (surjection-inv-equiv f) +``` + +### Mapping directed families in a poset under an order preserving map + +```agda +module _ + {l1 l2 l3 l4 l5 : Level} + (P : Poset l1 l2) (Q : Poset l3 l4) + (f : hom-Poset P Q) + (x : directed-family-Poset l5 P) + where + + type-directed-family-hom-Poset : UU l5 + type-directed-family-hom-Poset = type-directed-family-Poset P x + + is-inhabited-type-directed-family-hom-Poset : + is-inhabited type-directed-family-hom-Poset + is-inhabited-type-directed-family-hom-Poset = + is-inhabited-type-directed-family-Poset P x + + inhabited-type-directed-family-hom-Poset : Inhabited-Type l5 + inhabited-type-directed-family-hom-Poset = + type-directed-family-hom-Poset , + is-inhabited-type-directed-family-hom-Poset + + family-directed-family-hom-Poset : + type-directed-family-hom-Poset → type-Poset Q + family-directed-family-hom-Poset = + map-hom-Poset P Q f ∘ family-directed-family-Poset P x + + abstract + is-directed-family-directed-family-hom-Poset : + is-directed-family-Poset Q + inhabited-type-directed-family-hom-Poset + family-directed-family-hom-Poset + is-directed-family-directed-family-hom-Poset u v = + elim-exists + ( exists-structure-Prop type-directed-family-hom-Poset _) + ( λ z y → + intro-exists z + ( preserves-order-map-hom-Poset P Q f + ( family-directed-family-Poset P x u) + ( family-directed-family-Poset P x z) + ( pr1 y) , + preserves-order-map-hom-Poset P Q f + ( family-directed-family-Poset P x v) + ( family-directed-family-Poset P x z) + ( pr2 y))) + ( is-directed-family-directed-family-Poset P x u v) + + directed-family-hom-Poset : directed-family-Poset l5 Q + directed-family-hom-Poset = + inhabited-type-directed-family-hom-Poset , + family-directed-family-hom-Poset , + is-directed-family-directed-family-hom-Poset +``` diff --git a/src/domain-theory/kleenes-fixed-point-theorem-omega-complete-posets.lagda.md b/src/domain-theory/kleenes-fixed-point-theorem-omega-complete-posets.lagda.md new file mode 100644 index 0000000000..b077cb384c --- /dev/null +++ b/src/domain-theory/kleenes-fixed-point-theorem-omega-complete-posets.lagda.md @@ -0,0 +1,304 @@ +# Kleene's fixed point theorem for ω-complete posets + +```agda +module domain-theory.kleenes-fixed-point-theorem-omega-complete-posets where +``` + +
Imports + +```agda +open import domain-theory.directed-families-posets +open import domain-theory.kleenes-fixed-point-theorem-posets +open import domain-theory.omega-complete-posets +open import domain-theory.omega-continuous-maps-omega-complete-posets +open import domain-theory.omega-continuous-maps-posets + +open import elementary-number-theory.decidable-total-order-natural-numbers +open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.natural-numbers + +open import foundation.dependent-pair-types +open import foundation.fixed-points-endofunctions +open import foundation.function-types +open import foundation.identity-types +open import foundation.inhabited-types +open import foundation.iterating-functions +open import foundation.logical-equivalences +open import foundation.propositional-truncations +open import foundation.universe-levels + +open import order-theory.bottom-elements-posets +open import order-theory.chains-posets +open import order-theory.inflattices +open import order-theory.inhabited-chains-posets +open import order-theory.least-upper-bounds-posets +open import order-theory.order-preserving-maps-posets +open import order-theory.posets +open import order-theory.suplattices +open import order-theory.upper-bounds-posets +``` + +
+ +## Idea + +{{#concept "Kleene's fixed point theorem" Disambiguation="ω-complete posets" WD="Kleene fixed-point theorem" WDID=Q3527263}} +states that given an +[ω-continuous](domain-theory.omega-continuous-maps-omega-complete-posets.md) +endomap `f : 𝒜 → 𝒜` on an +[ω-complete poset](domain-theoryomega-complete-posets.md) `𝒜`, then for every +`x ∈ 𝒜` such that `x ≤ f x`, the ω-transfinite application of `f` to `x`, +`f^ω(x)`, given that it exists, is a +[fixed point](foundation.fixed-points-endofunctions.md) of `f`: + +```text + x ≤ f(x) ≤ f²(x) ≤ … ≤ fⁿ(x) ≤ … ≤ f^ω(x) = f(f^ω(x)) = …. +``` + +If `𝒜` has a [bottom element](order-theory.bottom-elements-posets.md) `⊥`, then +this construction applied to `⊥` gives a least fixed point of `f`. + +## Construction + +### Kleene's fixed point construction for order preserving endomaps on ω-complete posets + +```agda +module _ + {l1 l2 : Level} + (𝒜 : ω-Complete-Poset l1 l2) + {f : type-ω-Complete-Poset 𝒜 → type-ω-Complete-Poset 𝒜} + (H : + preserves-order-Poset + ( poset-ω-Complete-Poset 𝒜) + ( poset-ω-Complete-Poset 𝒜) + ( f)) + (x : type-ω-Complete-Poset 𝒜) + (p : leq-ω-Complete-Poset 𝒜 x (f x)) + where + + family-of-elements-construction-kleene-hom-ω-Complete-Poset : + ℕ → type-ω-Complete-Poset 𝒜 + family-of-elements-construction-kleene-hom-ω-Complete-Poset = + family-of-elements-construction-kleene-hom-Poset + ( poset-ω-Complete-Poset 𝒜) H x p + + leq-succ-family-of-elements-construction-kleene-hom-ω-Complete-Poset : + (n : ℕ) → + leq-ω-Complete-Poset 𝒜 + ( family-of-elements-construction-kleene-hom-ω-Complete-Poset n) + ( family-of-elements-construction-kleene-hom-ω-Complete-Poset (succ-ℕ n)) + leq-succ-family-of-elements-construction-kleene-hom-ω-Complete-Poset = + leq-succ-family-of-elements-construction-kleene-hom-Poset + ( poset-ω-Complete-Poset 𝒜) H x p + + hom-construction-kleene-hom-ω-Complete-Poset : + hom-Poset ℕ-Poset (poset-ω-Complete-Poset 𝒜) + hom-construction-kleene-hom-ω-Complete-Poset = + hom-construction-kleene-hom-Poset (poset-ω-Complete-Poset 𝒜) H x p + +module _ + {l1 l2 : Level} + (𝒜 : ω-Complete-Poset l1 l2) + {f : type-ω-Complete-Poset 𝒜 → type-ω-Complete-Poset 𝒜} + (H : + preserves-order-Poset + ( poset-ω-Complete-Poset 𝒜) + ( poset-ω-Complete-Poset 𝒜) + ( f)) + (x : type-ω-Complete-Poset 𝒜) + (p : leq-ω-Complete-Poset 𝒜 x (f x)) + where + + point-construction-kleene-hom-ω-Complete-Poset : type-ω-Complete-Poset 𝒜 + point-construction-kleene-hom-ω-Complete-Poset = + point-construction-kleene-hom-Poset + ( poset-ω-Complete-Poset 𝒜) + ( H) + ( x) + ( p) + ( is-ω-complete-ω-Complete-Poset 𝒜 + ( hom-construction-kleene-hom-ω-Complete-Poset 𝒜 H x p)) + + is-fixed-point-construction-kleene-hom-ω-Complete-Poset : + (F : + preserves-ω-supremum-ω-Complete-Poset 𝒜 𝒜 f + ( hom-construction-kleene-hom-ω-Complete-Poset 𝒜 H x p)) → + f (point-construction-kleene-hom-ω-Complete-Poset) = + point-construction-kleene-hom-ω-Complete-Poset + is-fixed-point-construction-kleene-hom-ω-Complete-Poset = + is-fixed-point-construction-kleene-hom-Poset + ( poset-ω-Complete-Poset 𝒜) + ( H) + ( x) + ( p) + ( is-ω-complete-ω-Complete-Poset 𝒜 + ( hom-construction-kleene-hom-ω-Complete-Poset 𝒜 H x p)) + + fixed-point-construction-kleene-hom-ω-Complete-Poset : + (F : + preserves-ω-supremum-ω-Complete-Poset 𝒜 𝒜 f + ( hom-construction-kleene-hom-ω-Complete-Poset 𝒜 H x p)) → + fixed-point f + fixed-point-construction-kleene-hom-ω-Complete-Poset F = + point-construction-kleene-hom-ω-Complete-Poset , + is-fixed-point-construction-kleene-hom-ω-Complete-Poset F +``` + +### Kleene's fixed point construction for ω-continuous endomaps on ω-complete posets + +```agda +module _ + {l1 l2 : Level} + (𝒜 : ω-Complete-Poset l1 l2) + {f : type-ω-Complete-Poset 𝒜 → type-ω-Complete-Poset 𝒜} + (F : is-ω-continuous-ω-Complete-Poset 𝒜 𝒜 f) + (x : type-ω-Complete-Poset 𝒜) + (p : leq-ω-Complete-Poset 𝒜 x (f x)) + where + + family-of-elements-construction-kleene-ω-Complete-Poset : + ℕ → type-ω-Complete-Poset 𝒜 + family-of-elements-construction-kleene-ω-Complete-Poset = + family-of-elements-construction-kleene-hom-ω-Complete-Poset 𝒜 + ( preserves-order-is-ω-continuous-ω-Complete-Poset 𝒜 𝒜 F) + ( x) + ( p) + + hom-construction-kleene-ω-Complete-Poset : + hom-Poset ℕ-Poset (poset-ω-Complete-Poset 𝒜) + hom-construction-kleene-ω-Complete-Poset = + hom-construction-kleene-hom-ω-Complete-Poset 𝒜 + ( preserves-order-is-ω-continuous-ω-Complete-Poset 𝒜 𝒜 F) + ( x) + ( p) + +module _ + {l1 l2 : Level} + (𝒜 : ω-Complete-Poset l1 l2) + {f : type-ω-Complete-Poset 𝒜 → type-ω-Complete-Poset 𝒜} + (F : is-ω-continuous-ω-Complete-Poset 𝒜 𝒜 f) + (x : type-ω-Complete-Poset 𝒜) + (p : leq-ω-Complete-Poset 𝒜 x (f x)) + where + + point-construction-kleene-ω-Complete-Poset : type-ω-Complete-Poset 𝒜 + point-construction-kleene-ω-Complete-Poset = + point-construction-kleene-hom-ω-Complete-Poset 𝒜 + ( preserves-order-is-ω-continuous-ω-Complete-Poset 𝒜 𝒜 F) + ( x) + ( p) + + is-fixed-point-construction-kleene-ω-Complete-Poset : + f ( point-construction-kleene-ω-Complete-Poset) = + point-construction-kleene-ω-Complete-Poset + is-fixed-point-construction-kleene-ω-Complete-Poset = + is-fixed-point-construction-kleene-hom-ω-Complete-Poset 𝒜 + ( preserves-order-is-ω-continuous-ω-Complete-Poset 𝒜 𝒜 F) + ( x) + ( p) + ( F (hom-construction-kleene-ω-Complete-Poset 𝒜 F x p)) + + fixed-point-construction-kleene-ω-Complete-Poset : fixed-point f + fixed-point-construction-kleene-ω-Complete-Poset = + point-construction-kleene-ω-Complete-Poset , + is-fixed-point-construction-kleene-ω-Complete-Poset +``` + +## Theorem + +### Kleene's least fixed point theorem for order preserving endomaps on ω-complete posets with a bottom element + +If `𝒜` has a bottom element, then Kleene's fixed point construction gives a +least fixed point of `f`. + +```agda +module _ + {l1 l2 : Level} + (𝒜 : ω-Complete-Poset l1 l2) + {f : type-ω-Complete-Poset 𝒜 → type-ω-Complete-Poset 𝒜} + (H : + preserves-order-Poset + ( poset-ω-Complete-Poset 𝒜) + ( poset-ω-Complete-Poset 𝒜) + ( f)) + (b@(⊥ , b') : has-bottom-element-Poset (poset-ω-Complete-Poset 𝒜)) + (F : + preserves-ω-supremum-ω-Complete-Poset 𝒜 𝒜 f + ( hom-construction-kleene-hom-ω-Complete-Poset 𝒜 H ⊥ (b' (f ⊥)))) + where + + point-theorem-kleene-hom-ω-Complete-Poset : type-ω-Complete-Poset 𝒜 + point-theorem-kleene-hom-ω-Complete-Poset = + point-construction-kleene-hom-ω-Complete-Poset 𝒜 H ⊥ (b' (f ⊥)) + + fixed-point-theorem-kleene-hom-ω-Complete-Poset : fixed-point f + fixed-point-theorem-kleene-hom-ω-Complete-Poset = + fixed-point-construction-kleene-hom-ω-Complete-Poset 𝒜 H ⊥ (b' (f ⊥)) F + + is-upper-bound-family-of-elements-is-fixed-point-theorem-kleene-hom-ω-Complete-Poset : + {z : type-ω-Complete-Poset 𝒜} → f z = z → + is-upper-bound-family-of-elements-Poset (poset-ω-Complete-Poset 𝒜) + ( family-of-elements-construction-kleene-hom-ω-Complete-Poset 𝒜 H + ( ⊥) + ( b' (f ⊥))) + ( z) + is-upper-bound-family-of-elements-is-fixed-point-theorem-kleene-hom-ω-Complete-Poset = + is-upper-bound-family-of-elements-is-fixed-point-theorem-kleene-hom-Poset + ( poset-ω-Complete-Poset 𝒜) + ( H) + ( b) + ( is-ω-complete-ω-Complete-Poset 𝒜 + ( hom-construction-kleene-hom-ω-Complete-Poset 𝒜 H ⊥ (b' (f ⊥)))) + ( F) + + is-least-fixed-point-theorem-kleene-hom-ω-Complete-Poset : + (q : fixed-point f) → + leq-ω-Complete-Poset 𝒜 point-theorem-kleene-hom-ω-Complete-Poset (pr1 q) + is-least-fixed-point-theorem-kleene-hom-ω-Complete-Poset = + is-least-fixed-point-theorem-kleene-hom-Poset + ( poset-ω-Complete-Poset 𝒜) + ( H) + ( b) + ( is-ω-complete-ω-Complete-Poset 𝒜 + ( hom-construction-kleene-hom-ω-Complete-Poset 𝒜 H ⊥ (b' (f ⊥)))) + ( F) +``` + +### Kleene's least fixed point theorem for order preserving endomaps on posets with a bottom element + +If `𝒜` has a bottom element, then Kleene's fixed point construction gives a +least fixed point of `f`. + +```agda +module _ + {l1 l2 : Level} + (𝒜 : ω-Complete-Poset l1 l2) + {f : type-ω-Complete-Poset 𝒜 → type-ω-Complete-Poset 𝒜} + (F : is-ω-continuous-ω-Complete-Poset 𝒜 𝒜 f) + (b@(⊥ , b') : has-bottom-element-Poset (poset-ω-Complete-Poset 𝒜)) + where + + point-theorem-kleene-ω-Complete-Poset : type-ω-Complete-Poset 𝒜 + point-theorem-kleene-ω-Complete-Poset = + point-construction-kleene-ω-Complete-Poset 𝒜 F ⊥ (b' (f ⊥)) + + fixed-point-theorem-kleene-ω-Complete-Poset : fixed-point f + fixed-point-theorem-kleene-ω-Complete-Poset = + fixed-point-construction-kleene-ω-Complete-Poset 𝒜 F ⊥ (b' (f ⊥)) + + is-least-fixed-point-theorem-kleene-ω-Complete-Poset : + (q : fixed-point f) → + leq-ω-Complete-Poset 𝒜 point-theorem-kleene-ω-Complete-Poset (pr1 q) + is-least-fixed-point-theorem-kleene-ω-Complete-Poset = + is-least-fixed-point-theorem-kleene-hom-ω-Complete-Poset 𝒜 + ( preserves-order-is-ω-continuous-ω-Complete-Poset 𝒜 𝒜 F) + ( b) + ( F (hom-construction-kleene-ω-Complete-Poset 𝒜 F ⊥ (b' (f ⊥)))) +``` + +## External links + +- [Kleene fixed-point theorem](https://en.wikipedia.org/wiki/Kleene_fixed-point_theorem) + at Wikipedia +- [Kleene's fixed point theorem](https://ncatlab.org/nlab/show/Kleene%27s+fixed+point+theorem) + at $n$Lab diff --git a/src/domain-theory/kleenes-fixed-point-theorem-posets.lagda.md b/src/domain-theory/kleenes-fixed-point-theorem-posets.lagda.md new file mode 100644 index 0000000000..033bc8f7e9 --- /dev/null +++ b/src/domain-theory/kleenes-fixed-point-theorem-posets.lagda.md @@ -0,0 +1,370 @@ +# Kleene's fixed point theorem for posets + +```agda +module domain-theory.kleenes-fixed-point-theorem-posets where +``` + +
Imports + +```agda +open import domain-theory.directed-families-posets +open import domain-theory.omega-continuous-maps-posets + +open import elementary-number-theory.decidable-total-order-natural-numbers +open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.natural-numbers + +open import foundation.dependent-pair-types +open import foundation.fixed-points-endofunctions +open import foundation.function-types +open import foundation.identity-types +open import foundation.inhabited-types +open import foundation.iterating-functions +open import foundation.logical-equivalences +open import foundation.propositional-truncations +open import foundation.universe-levels + +open import order-theory.bottom-elements-posets +open import order-theory.chains-posets +open import order-theory.inflattices +open import order-theory.inhabited-chains-posets +open import order-theory.least-upper-bounds-posets +open import order-theory.order-preserving-maps-posets +open import order-theory.posets +open import order-theory.suplattices +open import order-theory.upper-bounds-posets +``` + +
+ +## Idea + +{{#concept "Kleene's fixed point theorem" Disambiguation="posets" WD="Kleene fixed-point theorem" WDID=Q3527263}} +states that given an +[ω-continuous](domain-theory.omega-continuous-maps-posets.md) endomap +`f : 𝒜 → 𝒜` on a [poset](domain-theory.posets.md) `𝒜`, then for every `x ∈ 𝒜` +such that `x ≤ f x`, the ω-transfinite application of `f` to `x`,`f^ω(x)`, given +that it exists, is a [fixed point](foundation.fixed-points-endofunctions.md) of +`f`: + +```text + x ≤ f(x) ≤ f²(x) ≤ … ≤ fⁿ(x) ≤ … ≤ f^ω(x) = f(^fω(x)) = …. +``` + +If `𝒜` has a [bottom element](order-theory.bottom-elements-posets.md) `⊥`, then +this construction applied to `⊥` gives a least fixed point of `f`. + +**Duality.** Of course, since the structure of posets is self-dual, there is a +dual Kleene's fixed point theorem that, for every ω-cocontinuous endomap `f` and +point `y ∈ 𝒜`, if `f(y) ≤ y`, then the ω-transfinite application of `f` to `y`, +`f^ω(y)`, given that it exists, gives a fixed point of `f`: + +```text + … = f(f^ω(y)) = f^ω(y) ≤ … ≤ fⁿ(y) ≤ … ≤ f²(y) ≤ f(y) ≤ y. +``` + +If `𝒜` has a [top element](order-theory.top-elements-posets.md) `⊤`, then this +construction applied to `⊤` gives a greatest fixed point of `f`. + +## Construction + +### Kleene's fixed point construction for order preserving endomaps on posets + +```agda +module _ + {l1 l2 : Level} + (𝒜 : Poset l1 l2) + {f : type-Poset 𝒜 → type-Poset 𝒜} + (H : preserves-order-Poset 𝒜 𝒜 f) + (x : type-Poset 𝒜) + (p : leq-Poset 𝒜 x (f x)) + where + + family-of-elements-construction-kleene-hom-Poset : ℕ → type-Poset 𝒜 + family-of-elements-construction-kleene-hom-Poset n = iterate n f x + + leq-succ-family-of-elements-construction-kleene-hom-Poset : + (n : ℕ) → + leq-Poset 𝒜 + ( family-of-elements-construction-kleene-hom-Poset n) + ( family-of-elements-construction-kleene-hom-Poset (succ-ℕ n)) + leq-succ-family-of-elements-construction-kleene-hom-Poset zero-ℕ = p + leq-succ-family-of-elements-construction-kleene-hom-Poset (succ-ℕ n) = + H ( family-of-elements-construction-kleene-hom-Poset n) + ( family-of-elements-construction-kleene-hom-Poset (succ-ℕ n)) + ( leq-succ-family-of-elements-construction-kleene-hom-Poset n) + + hom-construction-kleene-hom-Poset : hom-Poset ℕ-Poset 𝒜 + hom-construction-kleene-hom-Poset = + hom-ind-ℕ-Poset 𝒜 + ( family-of-elements-construction-kleene-hom-Poset) + ( leq-succ-family-of-elements-construction-kleene-hom-Poset) + +module _ + {l1 l2 : Level} + (𝒜 : Poset l1 l2) + {f : type-Poset 𝒜 → type-Poset 𝒜} + (H : preserves-order-Poset 𝒜 𝒜 f) + (x : type-Poset 𝒜) + (p : leq-Poset 𝒜 x (f x)) + (s : + has-least-upper-bound-family-of-elements-Poset 𝒜 + ( family-of-elements-construction-kleene-hom-Poset 𝒜 H x p)) + where + + point-construction-kleene-hom-Poset : type-Poset 𝒜 + point-construction-kleene-hom-Poset = pr1 s + + is-upper-bound-map-point-construction-kleene-hom-Poset : + is-upper-bound-family-of-elements-Poset 𝒜 + ( family-of-elements-construction-kleene-hom-Poset 𝒜 H x p) + ( f point-construction-kleene-hom-Poset) + is-upper-bound-map-point-construction-kleene-hom-Poset zero-ℕ = + transitive-leq-Poset 𝒜 x (f x) + ( f point-construction-kleene-hom-Poset) + ( H x + ( point-construction-kleene-hom-Poset) + ( is-upper-bound-is-least-upper-bound-family-of-elements-Poset 𝒜 + ( pr2 s) + ( 0))) + ( p) + is-upper-bound-map-point-construction-kleene-hom-Poset (succ-ℕ n) = + H ( family-of-elements-construction-kleene-hom-Poset 𝒜 H x p n) + ( point-construction-kleene-hom-Poset) + ( is-upper-bound-is-least-upper-bound-family-of-elements-Poset 𝒜 + ( pr2 s) + ( n)) + + leq-point-construction-kleene-hom-Poset : + leq-Poset 𝒜 + ( point-construction-kleene-hom-Poset) + ( f point-construction-kleene-hom-Poset) + leq-point-construction-kleene-hom-Poset = + pr1 + ( pr2 s (f point-construction-kleene-hom-Poset)) + ( is-upper-bound-map-point-construction-kleene-hom-Poset) + + geq-point-construction-kleene-hom-Poset : + (F : + preserves-ω-supremum-Poset 𝒜 𝒜 f + ( hom-construction-kleene-hom-Poset 𝒜 H x p)) → + leq-Poset 𝒜 + ( f point-construction-kleene-hom-Poset) + ( point-construction-kleene-hom-Poset) + geq-point-construction-kleene-hom-Poset F = + pr1 + ( F s point-construction-kleene-hom-Poset) + ( is-upper-bound-is-least-upper-bound-family-of-elements-Poset 𝒜 (pr2 s) ∘ + succ-ℕ) + + is-fixed-point-construction-kleene-hom-Poset : + (F : + preserves-ω-supremum-Poset 𝒜 𝒜 f + ( hom-construction-kleene-hom-Poset 𝒜 H x p)) → + f (point-construction-kleene-hom-Poset) = + point-construction-kleene-hom-Poset + is-fixed-point-construction-kleene-hom-Poset F = + antisymmetric-leq-Poset 𝒜 + ( f point-construction-kleene-hom-Poset) + ( point-construction-kleene-hom-Poset) + ( geq-point-construction-kleene-hom-Poset F) + ( leq-point-construction-kleene-hom-Poset) + + fixed-point-construction-kleene-hom-Poset : + (F : + preserves-ω-supremum-Poset 𝒜 𝒜 f + ( hom-construction-kleene-hom-Poset 𝒜 H x p)) → + fixed-point f + fixed-point-construction-kleene-hom-Poset F = + point-construction-kleene-hom-Poset , + is-fixed-point-construction-kleene-hom-Poset F +``` + +### Kleene's fixed point construction for ω-continuous endomaps on posets + +```agda +module _ + {l1 l2 : Level} + (𝒜 : Poset l1 l2) + {f : type-Poset 𝒜 → type-Poset 𝒜} + (F : is-ω-continuous-Poset 𝒜 𝒜 f) + (x : type-Poset 𝒜) + (p : leq-Poset 𝒜 x (f x)) + where + + family-of-elements-construction-kleene-Poset : ℕ → type-Poset 𝒜 + family-of-elements-construction-kleene-Poset = + family-of-elements-construction-kleene-hom-Poset 𝒜 + ( preserves-order-is-ω-continuous-Poset 𝒜 𝒜 F) + ( x) + ( p) + + hom-construction-kleene-Poset : hom-Poset ℕ-Poset 𝒜 + hom-construction-kleene-Poset = + hom-construction-kleene-hom-Poset 𝒜 + ( preserves-order-is-ω-continuous-Poset 𝒜 𝒜 F) + ( x) + ( p) + +module _ + {l1 l2 : Level} + (𝒜 : Poset l1 l2) + {f : type-Poset 𝒜 → type-Poset 𝒜} + (F : is-ω-continuous-Poset 𝒜 𝒜 f) + (x : type-Poset 𝒜) + (p : leq-Poset 𝒜 x (f x)) + (s : + has-least-upper-bound-family-of-elements-Poset 𝒜 + ( family-of-elements-construction-kleene-Poset 𝒜 F x p)) + where + + point-construction-kleene-Poset : type-Poset 𝒜 + point-construction-kleene-Poset = pr1 s + + is-upper-bound-map-point-construction-kleene-Poset : + is-upper-bound-family-of-elements-Poset 𝒜 + ( family-of-elements-construction-kleene-Poset 𝒜 F x p) + ( f point-construction-kleene-Poset) + is-upper-bound-map-point-construction-kleene-Poset = + is-upper-bound-map-point-construction-kleene-hom-Poset 𝒜 + ( preserves-order-is-ω-continuous-Poset 𝒜 𝒜 F) + ( x) + ( p) + ( s) + + leq-point-construction-kleene-Poset : + leq-Poset 𝒜 + ( point-construction-kleene-Poset) + ( f point-construction-kleene-Poset) + leq-point-construction-kleene-Poset = + leq-point-construction-kleene-hom-Poset 𝒜 + ( preserves-order-is-ω-continuous-Poset 𝒜 𝒜 F) + ( x) + ( p) + ( s) + + geq-point-construction-kleene-Poset : + leq-Poset 𝒜 + ( f point-construction-kleene-Poset) + ( point-construction-kleene-Poset) + geq-point-construction-kleene-Poset = + geq-point-construction-kleene-hom-Poset 𝒜 + ( preserves-order-is-ω-continuous-Poset 𝒜 𝒜 F) + ( x) + ( p) + ( s) + ( F (hom-construction-kleene-Poset 𝒜 F x p)) + + is-fixed-point-construction-kleene-Poset : + f (point-construction-kleene-Poset) = point-construction-kleene-Poset + is-fixed-point-construction-kleene-Poset = + is-fixed-point-construction-kleene-hom-Poset 𝒜 + ( preserves-order-is-ω-continuous-Poset 𝒜 𝒜 F) + ( x) + ( p) + ( s) + ( F (hom-construction-kleene-Poset 𝒜 F x p)) + + fixed-point-construction-kleene-Poset : fixed-point f + fixed-point-construction-kleene-Poset = + point-construction-kleene-Poset , is-fixed-point-construction-kleene-Poset +``` + +## Theorem + +### Kleene's least fixed point theorem for order preserving endomaps on posets with a bottom element + +If `𝒜` has a bottom element, then Kleene's fixed point construction gives a +least fixed point of `f`. + +```agda +module _ + {l1 l2 : Level} + (𝒜 : Poset l1 l2) + {f : type-Poset 𝒜 → type-Poset 𝒜} + (H : preserves-order-Poset 𝒜 𝒜 f) + (b@(⊥ , b') : has-bottom-element-Poset 𝒜) + (s : + has-least-upper-bound-family-of-elements-Poset 𝒜 + ( family-of-elements-construction-kleene-hom-Poset 𝒜 H ⊥ (b' (f ⊥)))) + (F : + preserves-ω-supremum-Poset 𝒜 𝒜 f + ( hom-construction-kleene-hom-Poset 𝒜 H ⊥ (b' (f ⊥)))) + where + + point-theorem-kleene-hom-Poset : type-Poset 𝒜 + point-theorem-kleene-hom-Poset = + point-construction-kleene-hom-Poset 𝒜 H ⊥ (b' (f ⊥)) s + + fixed-point-theorem-kleene-hom-Poset : fixed-point f + fixed-point-theorem-kleene-hom-Poset = + fixed-point-construction-kleene-hom-Poset 𝒜 H ⊥ (b' (f ⊥)) s F + + is-upper-bound-family-of-elements-is-fixed-point-theorem-kleene-hom-Poset : + {z : type-Poset 𝒜} → f z = z → + is-upper-bound-family-of-elements-Poset 𝒜 + ( family-of-elements-construction-kleene-hom-Poset 𝒜 H ⊥ (b' (f ⊥))) + ( z) + is-upper-bound-family-of-elements-is-fixed-point-theorem-kleene-hom-Poset + { z} q zero-ℕ = + b' z + is-upper-bound-family-of-elements-is-fixed-point-theorem-kleene-hom-Poset + {z} q (succ-ℕ n) = + concatenate-leq-eq-Poset 𝒜 + ( H ( iterate n f ⊥) + ( z) + ( is-upper-bound-family-of-elements-is-fixed-point-theorem-kleene-hom-Poset + ( q) + ( n))) + ( q) + + is-least-fixed-point-theorem-kleene-hom-Poset : + (q : fixed-point f) → leq-Poset 𝒜 point-theorem-kleene-hom-Poset (pr1 q) + is-least-fixed-point-theorem-kleene-hom-Poset (z , q) = + pr1 + ( pr2 s z) + ( is-upper-bound-family-of-elements-is-fixed-point-theorem-kleene-hom-Poset + ( q)) +``` + +### Kleene's least fixed point theorem for order preserving endomaps on posets with a bottom element + +If `𝒜` has a bottom element, then Kleene's fixed point construction gives a +least fixed point of `f`. + +```agda +module _ + {l1 l2 : Level} + (𝒜 : Poset l1 l2) + {f : type-Poset 𝒜 → type-Poset 𝒜} + (F : is-ω-continuous-Poset 𝒜 𝒜 f) + (b@(⊥ , b') : has-bottom-element-Poset 𝒜) + (s : + has-least-upper-bound-family-of-elements-Poset 𝒜 + ( family-of-elements-construction-kleene-Poset 𝒜 F ⊥ (b' (f ⊥)))) + where + + point-theorem-kleene-Poset : type-Poset 𝒜 + point-theorem-kleene-Poset = + point-construction-kleene-Poset 𝒜 F ⊥ (b' (f ⊥)) s + + fixed-point-theorem-kleene-Poset : fixed-point f + fixed-point-theorem-kleene-Poset = + fixed-point-construction-kleene-Poset 𝒜 F ⊥ (b' (f ⊥)) s + + is-least-fixed-point-theorem-kleene-Poset : + (q : fixed-point f) → leq-Poset 𝒜 point-theorem-kleene-Poset (pr1 q) + is-least-fixed-point-theorem-kleene-Poset = + is-least-fixed-point-theorem-kleene-hom-Poset 𝒜 + ( preserves-order-is-ω-continuous-Poset 𝒜 𝒜 F) + ( b) + ( s) + ( F (hom-construction-kleene-Poset 𝒜 F ⊥ (b' (f ⊥)))) +``` + +## External links + +- [Kleene fixed-point theorem](https://en.wikipedia.org/wiki/Kleene_fixed-point_theorem) + at Wikipedia +- [Kleene's fixed point theorem](https://ncatlab.org/nlab/show/Kleene%27s+fixed+point+theorem) + at $n$Lab diff --git a/src/domain-theory/omega-complete-posets.lagda.md b/src/domain-theory/omega-complete-posets.lagda.md new file mode 100644 index 0000000000..f75c69c510 --- /dev/null +++ b/src/domain-theory/omega-complete-posets.lagda.md @@ -0,0 +1,194 @@ +# ω-complete posets + +```agda +module domain-theory.omega-complete-posets where +``` + +
Imports + +```agda +open import elementary-number-theory.decidable-total-order-natural-numbers +open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.natural-numbers + +open import foundation.binary-relations +open import foundation.dependent-pair-types +open import foundation.equivalences +open import foundation.function-types +open import foundation.logical-equivalences +open import foundation.propositions +open import foundation.sets +open import foundation.universe-levels + +open import order-theory.least-upper-bounds-posets +open import order-theory.order-preserving-maps-posets +open import order-theory.posets +open import order-theory.upper-bounds-posets +``` + +
+ +## Idea + +An +{{#concept "ω-complete poset" WD="complete partial order" WDID=Q3082805 Agda=ω-Complete-Poset}} +is a [poset](order-theory.posets.md) `P` such that every ascending +[chain](order-theory.chains-posets.md) + +```text + ℕ → P +``` + +has a [supremum](order-theory.least-upper-bounds--posets.md) in `P`. + +## Definitions + +### The predicate on posets of being an ω-complete poset + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) + where + + is-ω-complete-Poset-Prop : Prop (l1 ⊔ l2) + is-ω-complete-Poset-Prop = + Π-Prop + ( hom-Poset ℕ-Poset P) + ( λ F → + has-least-upper-bound-family-of-elements-prop-Poset P + ( map-hom-Poset ℕ-Poset P F)) + + is-ω-complete-Poset : UU (l1 ⊔ l2) + is-ω-complete-Poset = + type-Prop is-ω-complete-Poset-Prop + + is-prop-is-ω-complete-Poset : is-prop is-ω-complete-Poset + is-prop-is-ω-complete-Poset = + is-prop-type-Prop is-ω-complete-Poset-Prop + +module _ + {l1 l2 : Level} (P : Poset l1 l2) (H : is-ω-complete-Poset P) + where + + sup-is-ω-complete-Poset : hom-Poset ℕ-Poset P → type-Poset P + sup-is-ω-complete-Poset F = pr1 (H F) + + is-least-upper-bound-sup-is-ω-complete-Poset : + (x : hom-Poset ℕ-Poset P) → + is-least-upper-bound-family-of-elements-Poset P + ( map-hom-Poset ℕ-Poset P x) + ( sup-is-ω-complete-Poset x) + is-least-upper-bound-sup-is-ω-complete-Poset F = pr2 (H F) +``` + +### ω-Complete posets + +```agda +ω-Complete-Poset : + (l1 l2 : Level) → UU (lsuc l1 ⊔ lsuc l2) +ω-Complete-Poset l1 l2 = + Σ (Poset l1 l2) (is-ω-complete-Poset) + +module _ + {l1 l2 : Level} (A : ω-Complete-Poset l1 l2) + where + + poset-ω-Complete-Poset : Poset l1 l2 + poset-ω-Complete-Poset = pr1 A + + type-ω-Complete-Poset : UU l1 + type-ω-Complete-Poset = + type-Poset poset-ω-Complete-Poset + + leq-prop-ω-Complete-Poset : + (x y : type-ω-Complete-Poset) → Prop l2 + leq-prop-ω-Complete-Poset = + leq-prop-Poset poset-ω-Complete-Poset + + leq-ω-Complete-Poset : + (x y : type-ω-Complete-Poset) → UU l2 + leq-ω-Complete-Poset = + leq-Poset poset-ω-Complete-Poset + + is-prop-leq-ω-Complete-Poset : + (x y : type-ω-Complete-Poset) → + is-prop (leq-ω-Complete-Poset x y) + is-prop-leq-ω-Complete-Poset = + is-prop-leq-Poset poset-ω-Complete-Poset + + refl-leq-ω-Complete-Poset : + (x : type-ω-Complete-Poset) → + leq-ω-Complete-Poset x x + refl-leq-ω-Complete-Poset = + refl-leq-Poset poset-ω-Complete-Poset + + antisymmetric-leq-ω-Complete-Poset : + is-antisymmetric leq-ω-Complete-Poset + antisymmetric-leq-ω-Complete-Poset = + antisymmetric-leq-Poset poset-ω-Complete-Poset + + transitive-leq-ω-Complete-Poset : + is-transitive leq-ω-Complete-Poset + transitive-leq-ω-Complete-Poset = + transitive-leq-Poset poset-ω-Complete-Poset + + is-set-type-ω-Complete-Poset : + is-set type-ω-Complete-Poset + is-set-type-ω-Complete-Poset = + is-set-type-Poset poset-ω-Complete-Poset + + set-ω-Complete-Poset : Set l1 + set-ω-Complete-Poset = + set-Poset poset-ω-Complete-Poset + + is-ω-complete-ω-Complete-Poset : + is-ω-complete-Poset poset-ω-Complete-Poset + is-ω-complete-ω-Complete-Poset = pr2 A + + sup-ω-Complete-Poset : + hom-Poset ℕ-Poset poset-ω-Complete-Poset → + type-ω-Complete-Poset + sup-ω-Complete-Poset = + sup-is-ω-complete-Poset + ( poset-ω-Complete-Poset) + ( is-ω-complete-ω-Complete-Poset) + + is-least-upper-bound-sup-ω-Complete-Poset : + (x : hom-Poset ℕ-Poset poset-ω-Complete-Poset) → + is-least-upper-bound-family-of-elements-Poset + ( poset-ω-Complete-Poset) + ( map-hom-Poset ℕ-Poset poset-ω-Complete-Poset x) + ( sup-ω-Complete-Poset x) + is-least-upper-bound-sup-ω-Complete-Poset = + is-least-upper-bound-sup-is-ω-complete-Poset + ( poset-ω-Complete-Poset) + ( is-ω-complete-ω-Complete-Poset) + + is-upper-bound-sup-ω-Complete-Poset : + (x : hom-Poset ℕ-Poset poset-ω-Complete-Poset) → + is-upper-bound-family-of-elements-Poset + ( poset-ω-Complete-Poset) + ( map-hom-Poset ℕ-Poset poset-ω-Complete-Poset x) + ( sup-ω-Complete-Poset x) + is-upper-bound-sup-ω-Complete-Poset x = + is-upper-bound-is-least-upper-bound-family-of-elements-Poset + ( poset-ω-Complete-Poset) + ( is-least-upper-bound-sup-ω-Complete-Poset x) + + leq-sup-ω-Complete-Poset : + (x : hom-Poset ℕ-Poset poset-ω-Complete-Poset) + (i : ℕ) → + leq-ω-Complete-Poset + ( map-hom-Poset ℕ-Poset poset-ω-Complete-Poset x i) + ( sup-ω-Complete-Poset x) + leq-sup-ω-Complete-Poset x = + backward-implication + ( is-least-upper-bound-sup-ω-Complete-Poset + ( x) + ( sup-ω-Complete-Poset x)) + ( refl-leq-ω-Complete-Poset (sup-ω-Complete-Poset x)) +``` + +## External links + +- [dcpo](https://ncatlab.org/nlab/show/dcpo) at $n$Lab diff --git a/src/domain-theory/omega-continuous-maps-omega-complete-posets.lagda.md b/src/domain-theory/omega-continuous-maps-omega-complete-posets.lagda.md new file mode 100644 index 0000000000..d452677473 --- /dev/null +++ b/src/domain-theory/omega-continuous-maps-omega-complete-posets.lagda.md @@ -0,0 +1,397 @@ +# ω-Continuous maps between ω-complete posets + +```agda +module domain-theory.omega-continuous-maps-omega-complete-posets where +``` + +
Imports + +```agda +open import domain-theory.directed-families-posets +open import domain-theory.omega-complete-posets +open import domain-theory.omega-continuous-maps-posets + +open import elementary-number-theory.decidable-total-order-natural-numbers +open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.natural-numbers + +open import foundation.booleans +open import foundation.dependent-pair-types +open import foundation.equivalences +open import foundation.evaluation-functions +open import foundation.existential-quantification +open import foundation.function-types +open import foundation.fundamental-theorem-of-identity-types +open import foundation.homotopies +open import foundation.homotopy-induction +open import foundation.identity-types +open import foundation.propositional-truncations +open import foundation.propositions +open import foundation.raising-universe-levels +open import foundation.strictly-involutive-identity-types +open import foundation.subtype-identity-principle +open import foundation.surjective-maps +open import foundation.torsorial-type-families +open import foundation.universe-levels + +open import order-theory.join-preserving-maps-posets +open import order-theory.least-upper-bounds-posets +open import order-theory.order-preserving-maps-posets +open import order-theory.posets +``` + +
+ +## Idea + +A map `f : P → Q` between the underlying types of two +[ω-complete posets](order-theory.omega-complete-posets.md) is said to be +{{#concept "ω-continuous" Disambiguation="map of ω-complete posets" Agda=ω-continuous-map-ω-Complete-Poset}} +if it maps the supremum of every ascending +[chain](order-theory.chains-posets.md) + +```text + x₀ ≤ x₁ ≤ x₂ ≤ ­… ≤ xₙ ≤ xₙ₊₁ ≤ … ≤ xω +``` + +to the supremum of the image of the ascending chain + +```text + f x₀ ≤ f x₁ ≤ f x₂ ≤ ­… ≤ f xₙ ≤ f xₙ₊₁ ≤ … ≤ f xω. +``` + +In other words, `f(⋃ᵢxᵢ) = ⋃ᵢf(xᵢ)` for all ascending chains `x₍₋₎ : ℕ → P`. + +The ω-continuity condition is a proper generalization of +[Scott-continuity](domain-theory.scott-continuous-functions-posets.md) for which +[Kleene's fixed point theorem](domain-theory.kleenes-fixed-point-theorem-omega-complete-posets.md) +still applies. + +## Definitions + +### The predicate of preserving the supremum of an ω-chain + +```agda +module _ + {l1 l2 l3 l4 : Level} + (P : ω-Complete-Poset l1 l2) (Q : ω-Complete-Poset l3 l4) + (f : type-ω-Complete-Poset P → type-ω-Complete-Poset Q) + (x : hom-Poset ℕ-Poset (poset-ω-Complete-Poset P)) + where + + preserves-ω-supremum-ω-Complete-Poset : UU (l1 ⊔ l2 ⊔ l3 ⊔ l4) + preserves-ω-supremum-ω-Complete-Poset = + (y : + has-least-upper-bound-family-of-elements-Poset (poset-ω-Complete-Poset P) + ( map-hom-Poset ℕ-Poset (poset-ω-Complete-Poset P) x)) → + is-least-upper-bound-family-of-elements-Poset (poset-ω-Complete-Poset Q) + ( f ∘ map-hom-Poset ℕ-Poset (poset-ω-Complete-Poset P) x) + ( f (pr1 y)) + + is-prop-preserves-ω-supremum-ω-Complete-Poset : + is-prop preserves-ω-supremum-ω-Complete-Poset + is-prop-preserves-ω-supremum-ω-Complete-Poset = + is-prop-Π + ( λ y → + is-prop-is-least-upper-bound-family-of-elements-Poset + ( poset-ω-Complete-Poset Q) + ( f ∘ map-hom-Poset ℕ-Poset (poset-ω-Complete-Poset P) x) + ( f (pr1 y))) + + preserves-ω-supremum-prop-ω-Complete-Poset : + Prop (l1 ⊔ l2 ⊔ l3 ⊔ l4) + preserves-ω-supremum-prop-ω-Complete-Poset = + preserves-ω-supremum-ω-Complete-Poset , + is-prop-preserves-ω-supremum-ω-Complete-Poset +``` + +### The predicate on a map of ω-complete posets of being ω-continuous + +```agda +module _ + {l1 l2 l3 l4 : Level} + (P : ω-Complete-Poset l1 l2) (Q : ω-Complete-Poset l3 l4) + where + + is-ω-continuous-ω-Complete-Poset : + (type-ω-Complete-Poset P → type-ω-Complete-Poset Q) → + UU (l1 ⊔ l2 ⊔ l3 ⊔ l4) + is-ω-continuous-ω-Complete-Poset f = + (x : hom-Poset ℕ-Poset (poset-ω-Complete-Poset P)) + (y : + has-least-upper-bound-family-of-elements-Poset (poset-ω-Complete-Poset P) + ( map-hom-Poset ℕ-Poset (poset-ω-Complete-Poset P) x)) → + is-least-upper-bound-family-of-elements-Poset (poset-ω-Complete-Poset Q) + ( f ∘ map-hom-Poset ℕ-Poset (poset-ω-Complete-Poset P) x) + ( f (pr1 y)) + + is-prop-is-ω-continuous-ω-Complete-Poset : + (f : type-ω-Complete-Poset P → type-ω-Complete-Poset Q) → + is-prop (is-ω-continuous-ω-Complete-Poset f) + is-prop-is-ω-continuous-ω-Complete-Poset f = + is-prop-Π (is-prop-preserves-ω-supremum-ω-Complete-Poset P Q f) + + is-ω-continuous-prop-ω-Complete-Poset : + (type-ω-Complete-Poset P → type-ω-Complete-Poset Q) → + Prop (l1 ⊔ l2 ⊔ l3 ⊔ l4) + is-ω-continuous-prop-ω-Complete-Poset f = + ( is-ω-continuous-ω-Complete-Poset f) , + ( is-prop-is-ω-continuous-ω-Complete-Poset f) + + ω-continuous-hom-ω-Complete-Poset : UU (l1 ⊔ l2 ⊔ l3 ⊔ l4) + ω-continuous-hom-ω-Complete-Poset = + ω-continuous-hom-Poset (poset-ω-Complete-Poset P) (poset-ω-Complete-Poset Q) + + map-ω-continuous-hom-ω-Complete-Poset : + ω-continuous-hom-ω-Complete-Poset → + type-ω-Complete-Poset P → + type-ω-Complete-Poset Q + map-ω-continuous-hom-ω-Complete-Poset = pr1 + + is-ω-continuous-ω-continuous-hom-ω-Complete-Poset : + (f : ω-continuous-hom-ω-Complete-Poset) → + is-ω-continuous-ω-Complete-Poset (map-ω-continuous-hom-ω-Complete-Poset f) + is-ω-continuous-ω-continuous-hom-ω-Complete-Poset = pr2 + + sup-map-ω-continuous-hom-ω-Complete-Poset : + (f : ω-continuous-hom-ω-Complete-Poset) → + (x : hom-Poset ℕ-Poset (poset-ω-Complete-Poset P)) → + has-least-upper-bound-family-of-elements-Poset (poset-ω-Complete-Poset P) + ( map-hom-Poset ℕ-Poset (poset-ω-Complete-Poset P) x) → + has-least-upper-bound-family-of-elements-Poset (poset-ω-Complete-Poset Q) + ( map-ω-continuous-hom-ω-Complete-Poset f ∘ + map-hom-Poset ℕ-Poset (poset-ω-Complete-Poset P) x) + sup-map-ω-continuous-hom-ω-Complete-Poset f x y = + ( map-ω-continuous-hom-ω-Complete-Poset f (pr1 y) , + is-ω-continuous-ω-continuous-hom-ω-Complete-Poset f x y) +``` + +## Properties + +### ω-Continuous maps preserve order + +```agda +module _ + {l1 l2 l3 l4 : Level} + (P : ω-Complete-Poset l1 l2) (Q : ω-Complete-Poset l3 l4) + where + + abstract + preserves-order-is-ω-continuous-ω-Complete-Poset : + {f : type-ω-Complete-Poset P → type-ω-Complete-Poset Q} → + is-ω-continuous-ω-Complete-Poset P Q f → + preserves-order-Poset + ( poset-ω-Complete-Poset P) + ( poset-ω-Complete-Poset Q) f + preserves-order-is-ω-continuous-ω-Complete-Poset {f} H x y p = + pr2 + ( H ( hom-ind-ℕ-Poset (poset-ω-Complete-Poset P) + ( rec-ℕ x (λ _ _ → y)) + ( ind-ℕ p (λ _ _ → refl-leq-ω-Complete-Poset P y))) + ( y , + ( λ z → + ( λ g → g 1) , + ( λ q → + ind-ℕ + ( transitive-leq-ω-Complete-Poset P x y z q p) + ( λ _ _ → q)))) + ( f y)) + ( refl-leq-ω-Complete-Poset Q (f y)) + ( 0) + + hom-ω-continuous-hom-ω-Complete-Poset : + ω-continuous-hom-ω-Complete-Poset P Q → + hom-Poset (poset-ω-Complete-Poset P) (poset-ω-Complete-Poset Q) + hom-ω-continuous-hom-ω-Complete-Poset f = + map-ω-continuous-hom-ω-Complete-Poset P Q f , + preserves-order-is-ω-continuous-ω-Complete-Poset + ( is-ω-continuous-ω-continuous-hom-ω-Complete-Poset P Q f) +``` + +### Homotopies of ω-continuous maps + +```agda +module _ + {l1 l2 l3 l4 : Level} + (P : ω-Complete-Poset l1 l2) (Q : ω-Complete-Poset l3 l4) + where + + htpy-ω-continuous-hom-ω-Complete-Poset : + (f g : ω-continuous-hom-ω-Complete-Poset P Q) → UU (l1 ⊔ l3) + htpy-ω-continuous-hom-ω-Complete-Poset f g = + map-ω-continuous-hom-ω-Complete-Poset P Q f ~ + map-ω-continuous-hom-ω-Complete-Poset P Q g + + refl-htpy-ω-continuous-hom-ω-Complete-Poset : + (f : ω-continuous-hom-ω-Complete-Poset P Q) → + htpy-ω-continuous-hom-ω-Complete-Poset f f + refl-htpy-ω-continuous-hom-ω-Complete-Poset f = refl-htpy + + htpy-eq-ω-continuous-hom-ω-Complete-Poset : + (f g : ω-continuous-hom-ω-Complete-Poset P Q) → + f = g → + htpy-ω-continuous-hom-ω-Complete-Poset f g + htpy-eq-ω-continuous-hom-ω-Complete-Poset f .f refl = + refl-htpy-ω-continuous-hom-ω-Complete-Poset f + + is-torsorial-htpy-ω-continuous-hom-ω-Complete-Poset : + (f : ω-continuous-hom-ω-Complete-Poset P Q) → + is-torsorial (htpy-ω-continuous-hom-ω-Complete-Poset f) + is-torsorial-htpy-ω-continuous-hom-ω-Complete-Poset f = + is-torsorial-Eq-subtype + ( is-torsorial-htpy (map-ω-continuous-hom-ω-Complete-Poset P Q f)) + ( is-prop-is-ω-continuous-ω-Complete-Poset P Q) + ( map-ω-continuous-hom-ω-Complete-Poset P Q f) + ( refl-htpy) + ( is-ω-continuous-ω-continuous-hom-ω-Complete-Poset P Q f) + + is-equiv-htpy-eq-ω-continuous-hom-ω-Complete-Poset : + (f g : ω-continuous-hom-ω-Complete-Poset P Q) → + is-equiv (htpy-eq-ω-continuous-hom-ω-Complete-Poset f g) + is-equiv-htpy-eq-ω-continuous-hom-ω-Complete-Poset f = + fundamental-theorem-id + ( is-torsorial-htpy-ω-continuous-hom-ω-Complete-Poset f) + ( htpy-eq-ω-continuous-hom-ω-Complete-Poset f) + + extensionality-ω-continuous-hom-ω-Complete-Poset : + (f g : ω-continuous-hom-ω-Complete-Poset P Q) → + (f = g) ≃ htpy-ω-continuous-hom-ω-Complete-Poset f g + pr1 (extensionality-ω-continuous-hom-ω-Complete-Poset f g) = + htpy-eq-ω-continuous-hom-ω-Complete-Poset f g + pr2 (extensionality-ω-continuous-hom-ω-Complete-Poset f g) = + is-equiv-htpy-eq-ω-continuous-hom-ω-Complete-Poset f g + + eq-htpy-ω-continuous-hom-ω-Complete-Poset : + (f g : ω-continuous-hom-ω-Complete-Poset P Q) → + htpy-ω-continuous-hom-ω-Complete-Poset f g → f = g + eq-htpy-ω-continuous-hom-ω-Complete-Poset f g = + map-inv-is-equiv (is-equiv-htpy-eq-ω-continuous-hom-ω-Complete-Poset f g) +``` + +### The identity ω-continuous map + +```agda +module _ + {l1 l2 : Level} (P : ω-Complete-Poset l1 l2) + where + + is-ω-continuous-id-ω-Complete-Poset : + is-ω-continuous-ω-Complete-Poset P P (id {A = type-ω-Complete-Poset P}) + is-ω-continuous-id-ω-Complete-Poset x y = pr2 y + + id-ω-continuous-hom-ω-Complete-Poset : ω-continuous-hom-ω-Complete-Poset P P + id-ω-continuous-hom-ω-Complete-Poset = + id , is-ω-continuous-id-ω-Complete-Poset +``` + +### Composing ω-continuous maps + +```agda +module _ + {l1 l2 l3 l4 l5 l6 : Level} + (P : ω-Complete-Poset l1 l2) + (Q : ω-Complete-Poset l3 l4) + (R : ω-Complete-Poset l5 l6) + where + + is-ω-continuous-comp-ω-Complete-Poset : + (g : ω-continuous-hom-ω-Complete-Poset Q R) + (f : ω-continuous-hom-ω-Complete-Poset P Q) → + is-ω-continuous-ω-Complete-Poset P R + ( map-ω-continuous-hom-ω-Complete-Poset Q R g ∘ + map-ω-continuous-hom-ω-Complete-Poset P Q f) + is-ω-continuous-comp-ω-Complete-Poset g f c y = + is-ω-continuous-ω-continuous-hom-ω-Complete-Poset Q R g + ( comp-hom-Poset ℕ-Poset + ( poset-ω-Complete-Poset P) + ( poset-ω-Complete-Poset Q) + ( hom-ω-continuous-hom-ω-Complete-Poset P Q f) c) + ( map-ω-continuous-hom-ω-Complete-Poset P Q f (pr1 y) , + is-ω-continuous-ω-continuous-hom-ω-Complete-Poset P Q f c y) + + comp-ω-continuous-hom-ω-Complete-Poset : + (g : ω-continuous-hom-ω-Complete-Poset Q R) + (f : ω-continuous-hom-ω-Complete-Poset P Q) → + ω-continuous-hom-ω-Complete-Poset P R + comp-ω-continuous-hom-ω-Complete-Poset g f = + map-ω-continuous-hom-ω-Complete-Poset Q R g ∘ + map-ω-continuous-hom-ω-Complete-Poset P Q f , + is-ω-continuous-comp-ω-Complete-Poset g f +``` + +### Unit laws for composition of ω-continuous maps + +```agda +module _ + {l1 l2 l3 l4 : Level} + (P : ω-Complete-Poset l1 l2) (Q : ω-Complete-Poset l3 l4) + where + + left-unit-law-comp-ω-continuous-hom-ω-Complete-Poset : + (f : ω-continuous-hom-ω-Complete-Poset P Q) → + ( comp-ω-continuous-hom-ω-Complete-Poset P Q Q + ( id-ω-continuous-hom-ω-Complete-Poset Q) + ( f)) = + ( f) + left-unit-law-comp-ω-continuous-hom-ω-Complete-Poset f = + eq-htpy-ω-continuous-hom-ω-Complete-Poset P Q + ( comp-ω-continuous-hom-ω-Complete-Poset P Q Q + ( id-ω-continuous-hom-ω-Complete-Poset Q) + ( f)) + ( f) + ( refl-htpy) + + right-unit-law-comp-ω-continuous-hom-ω-Complete-Poset : + (f : ω-continuous-hom-ω-Complete-Poset P Q) → + ( comp-ω-continuous-hom-ω-Complete-Poset P P Q + ( f) + ( id-ω-continuous-hom-ω-Complete-Poset P)) = + ( f) + right-unit-law-comp-ω-continuous-hom-ω-Complete-Poset f = + eq-htpy-ω-continuous-hom-ω-Complete-Poset P Q + ( comp-ω-continuous-hom-ω-Complete-Poset P P Q + ( f) + ( id-ω-continuous-hom-ω-Complete-Poset P)) + ( f) + ( refl-htpy) +``` + +### Associativity of composition of ω-continuous maps + +```agda +module _ + {l1 l2 l3 l4 l5 l6 l7 l8 : Level} + (P : ω-Complete-Poset l1 l2) (Q : ω-Complete-Poset l3 l4) + (R : ω-Complete-Poset l5 l6) (S : ω-Complete-Poset l7 l8) + (h : ω-continuous-hom-ω-Complete-Poset R S) + (g : ω-continuous-hom-ω-Complete-Poset Q R) + (f : ω-continuous-hom-ω-Complete-Poset P Q) + where + + associative-comp-ω-continuous-hom-ω-Complete-Poset : + comp-ω-continuous-hom-ω-Complete-Poset P Q S + ( comp-ω-continuous-hom-ω-Complete-Poset Q R S h g) + ( f) = + comp-ω-continuous-hom-ω-Complete-Poset P R S + ( h) + ( comp-ω-continuous-hom-ω-Complete-Poset P Q R g f) + associative-comp-ω-continuous-hom-ω-Complete-Poset = + eq-htpy-ω-continuous-hom-ω-Complete-Poset P S + ( comp-ω-continuous-hom-ω-Complete-Poset P Q S + ( comp-ω-continuous-hom-ω-Complete-Poset Q R S h g) + ( f)) + ( comp-ω-continuous-hom-ω-Complete-Poset P R S + ( h) + ( comp-ω-continuous-hom-ω-Complete-Poset P Q R g f)) + ( refl-htpy) + + involutive-eq-associative-comp-ω-continuous-hom-ω-Complete-Poset : + comp-ω-continuous-hom-ω-Complete-Poset P Q S + ( comp-ω-continuous-hom-ω-Complete-Poset Q R S h g) + ( f) =ⁱ + comp-ω-continuous-hom-ω-Complete-Poset P R S + ( h) + ( comp-ω-continuous-hom-ω-Complete-Poset P Q R g f) + involutive-eq-associative-comp-ω-continuous-hom-ω-Complete-Poset = + involutive-eq-eq associative-comp-ω-continuous-hom-ω-Complete-Poset +``` diff --git a/src/domain-theory/omega-continuous-maps-posets.lagda.md b/src/domain-theory/omega-continuous-maps-posets.lagda.md new file mode 100644 index 0000000000..ef7ad141c8 --- /dev/null +++ b/src/domain-theory/omega-continuous-maps-posets.lagda.md @@ -0,0 +1,372 @@ +# ω-Continuous maps between posets + +```agda +module domain-theory.omega-continuous-maps-posets where +``` + +
Imports + +```agda +open import domain-theory.directed-families-posets + +open import elementary-number-theory.decidable-total-order-natural-numbers +open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.natural-numbers + +open import foundation.booleans +open import foundation.dependent-pair-types +open import foundation.equivalences +open import foundation.evaluation-functions +open import foundation.existential-quantification +open import foundation.function-types +open import foundation.fundamental-theorem-of-identity-types +open import foundation.homotopies +open import foundation.homotopy-induction +open import foundation.identity-types +open import foundation.propositional-truncations +open import foundation.propositions +open import foundation.raising-universe-levels +open import foundation.strictly-involutive-identity-types +open import foundation.subtype-identity-principle +open import foundation.surjective-maps +open import foundation.torsorial-type-families +open import foundation.universe-levels + +open import order-theory.join-preserving-maps-posets +open import order-theory.least-upper-bounds-posets +open import order-theory.order-preserving-maps-posets +open import order-theory.posets +``` + +
+ +## Idea + +A map `f : P → Q` between the underlying types of two +[posets](order-theory.posets.md) is said to be +{{#concept "ω-continuous" Disambiguation="map of posets" Agda=ω-continuous-map-Poset}} +if it maps the supremum of every ascending +[chain](order-theory.chains-posets.md) + +```text + x₀ ≤ x₁ ≤ x₂ ≤ ­… ≤ xₙ ≤ xₙ₊₁ ≤ … ≤ xω +``` + +to the supremum of the image of the ascending chain + +```text + f x₀ ≤ f x₁ ≤ f x₂ ≤ ­… ≤ f xₙ ≤ f xₙ₊₁ ≤ … ≤ f xω. +``` + +In other words, `f(⋃ᵢxᵢ) = ⋃ᵢf(xᵢ)` for all ascending chains `x₍₋₎ : ℕ → P`. + +The ω-continuity condition is a proper generalization of +[Scott-continuity](domain-theory.scott-continuous-functions-posets.md) for which +[Kleene's fixed point theorem](domain-theory.kleenes-fixed-point-theorem-omega-complete-posets.md) +still applies. + +## Definitions + +### The predicate of preserving the supremum of an ω-chain + +```agda +module _ + {l1 l2 l3 l4 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + (f : type-Poset P → type-Poset Q) + (x : hom-Poset ℕ-Poset P) + where + + preserves-ω-supremum-Poset : UU (l1 ⊔ l2 ⊔ l3 ⊔ l4) + preserves-ω-supremum-Poset = + (y : + has-least-upper-bound-family-of-elements-Poset P + ( map-hom-Poset ℕ-Poset P x)) → + is-least-upper-bound-family-of-elements-Poset Q + ( f ∘ map-hom-Poset ℕ-Poset P x) + ( f (pr1 y)) + + is-prop-preserves-ω-supremum-Poset : + is-prop preserves-ω-supremum-Poset + is-prop-preserves-ω-supremum-Poset = + is-prop-Π + ( λ y → + is-prop-is-least-upper-bound-family-of-elements-Poset Q + ( f ∘ map-hom-Poset ℕ-Poset P x) + ( f (pr1 y))) + + preserves-ω-supremum-prop-Poset : + Prop (l1 ⊔ l2 ⊔ l3 ⊔ l4) + preserves-ω-supremum-prop-Poset = + preserves-ω-supremum-Poset , + is-prop-preserves-ω-supremum-Poset +``` + +### The predicate on a map of posets of being ω-continuous + +```agda +module _ + {l1 l2 l3 l4 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + is-ω-continuous-Poset : + (type-Poset P → type-Poset Q) → + UU (l1 ⊔ l2 ⊔ l3 ⊔ l4) + is-ω-continuous-Poset f = + (x : hom-Poset ℕ-Poset P) + (y : + has-least-upper-bound-family-of-elements-Poset P + ( map-hom-Poset ℕ-Poset P x)) → + is-least-upper-bound-family-of-elements-Poset Q + ( f ∘ map-hom-Poset ℕ-Poset P x) + ( f (pr1 y)) + + is-prop-is-ω-continuous-Poset : + (f : type-Poset P → type-Poset Q) → + is-prop (is-ω-continuous-Poset f) + is-prop-is-ω-continuous-Poset f = + is-prop-Π (is-prop-preserves-ω-supremum-Poset P Q f) + + is-ω-continuous-prop-Poset : + (type-Poset P → type-Poset Q) → Prop (l1 ⊔ l2 ⊔ l3 ⊔ l4) + is-ω-continuous-prop-Poset f = + ( is-ω-continuous-Poset f) , + ( is-prop-is-ω-continuous-Poset f) + + ω-continuous-hom-Poset : UU (l1 ⊔ l2 ⊔ l3 ⊔ l4) + ω-continuous-hom-Poset = + Σ (type-Poset P → type-Poset Q) (is-ω-continuous-Poset) + + map-ω-continuous-hom-Poset : + ω-continuous-hom-Poset → type-Poset P → type-Poset Q + map-ω-continuous-hom-Poset = pr1 + + is-ω-continuous-ω-continuous-hom-Poset : + (f : ω-continuous-hom-Poset) → + is-ω-continuous-Poset (map-ω-continuous-hom-Poset f) + is-ω-continuous-ω-continuous-hom-Poset = pr2 + + sup-map-ω-continuous-hom-Poset : + (f : ω-continuous-hom-Poset) → + (x : hom-Poset ℕ-Poset P) → + has-least-upper-bound-family-of-elements-Poset P + ( map-hom-Poset ℕ-Poset P x) → + has-least-upper-bound-family-of-elements-Poset Q + ( map-ω-continuous-hom-Poset f ∘ map-hom-Poset ℕ-Poset P x) + sup-map-ω-continuous-hom-Poset f x y = + ( map-ω-continuous-hom-Poset f (pr1 y) , + is-ω-continuous-ω-continuous-hom-Poset f x y) +``` + +## Properties + +### ω-Continuous maps preserve order + +```agda +module _ + {l1 l2 l3 l4 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + abstract + preserves-order-is-ω-continuous-Poset : + {f : type-Poset P → type-Poset Q} → + is-ω-continuous-Poset P Q f → + preserves-order-Poset P Q f + preserves-order-is-ω-continuous-Poset {f} H x y p = + pr2 + ( H ( hom-ind-ℕ-Poset P + ( rec-ℕ x (λ _ _ → y)) + ( ind-ℕ p (λ _ _ → refl-leq-Poset P y))) + ( y , + ( λ z → + ( λ g → g 1) , + ( λ q → ind-ℕ (transitive-leq-Poset P x y z q p) (λ _ _ → q)))) + ( f y)) + ( refl-leq-Poset Q (f y)) + ( 0) + + hom-ω-continuous-hom-Poset : + ω-continuous-hom-Poset P Q → hom-Poset P Q + hom-ω-continuous-hom-Poset f = + map-ω-continuous-hom-Poset P Q f , + preserves-order-is-ω-continuous-Poset + ( is-ω-continuous-ω-continuous-hom-Poset P Q f) +``` + +### Homotopies of ω-continuous maps + +```agda +module _ + {l1 l2 l3 l4 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + htpy-ω-continuous-hom-Poset : + (f g : ω-continuous-hom-Poset P Q) → UU (l1 ⊔ l3) + htpy-ω-continuous-hom-Poset f g = + map-ω-continuous-hom-Poset P Q f ~ map-ω-continuous-hom-Poset P Q g + + refl-htpy-ω-continuous-hom-Poset : + (f : ω-continuous-hom-Poset P Q) → + htpy-ω-continuous-hom-Poset f f + refl-htpy-ω-continuous-hom-Poset f = refl-htpy + + htpy-eq-ω-continuous-hom-Poset : + (f g : ω-continuous-hom-Poset P Q) → + f = g → + htpy-ω-continuous-hom-Poset f g + htpy-eq-ω-continuous-hom-Poset f .f refl = + refl-htpy-ω-continuous-hom-Poset f + + is-torsorial-htpy-ω-continuous-hom-Poset : + (f : ω-continuous-hom-Poset P Q) → + is-torsorial (htpy-ω-continuous-hom-Poset f) + is-torsorial-htpy-ω-continuous-hom-Poset f = + is-torsorial-Eq-subtype + ( is-torsorial-htpy (map-ω-continuous-hom-Poset P Q f)) + ( is-prop-is-ω-continuous-Poset P Q) + ( map-ω-continuous-hom-Poset P Q f) + ( refl-htpy) + ( is-ω-continuous-ω-continuous-hom-Poset P Q f) + + is-equiv-htpy-eq-ω-continuous-hom-Poset : + (f g : ω-continuous-hom-Poset P Q) → + is-equiv (htpy-eq-ω-continuous-hom-Poset f g) + is-equiv-htpy-eq-ω-continuous-hom-Poset f = + fundamental-theorem-id + ( is-torsorial-htpy-ω-continuous-hom-Poset f) + ( htpy-eq-ω-continuous-hom-Poset f) + + extensionality-ω-continuous-hom-Poset : + (f g : ω-continuous-hom-Poset P Q) → + (f = g) ≃ htpy-ω-continuous-hom-Poset f g + pr1 (extensionality-ω-continuous-hom-Poset f g) = + htpy-eq-ω-continuous-hom-Poset f g + pr2 (extensionality-ω-continuous-hom-Poset f g) = + is-equiv-htpy-eq-ω-continuous-hom-Poset f g + + eq-htpy-ω-continuous-hom-Poset : + (f g : ω-continuous-hom-Poset P Q) → + htpy-ω-continuous-hom-Poset f g → f = g + eq-htpy-ω-continuous-hom-Poset f g = + map-inv-is-equiv (is-equiv-htpy-eq-ω-continuous-hom-Poset f g) +``` + +### The identity ω-continuous map + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) + where + + is-ω-continuous-id-Poset : + is-ω-continuous-Poset P P (id {A = type-Poset P}) + is-ω-continuous-id-Poset x y = pr2 y + + id-ω-continuous-hom-Poset : ω-continuous-hom-Poset P P + id-ω-continuous-hom-Poset = id , is-ω-continuous-id-Poset +``` + +### Composing ω-continuous maps + +```agda +module _ + {l1 l2 l3 l4 l5 l6 : Level} + (P : Poset l1 l2) (Q : Poset l3 l4) (R : Poset l5 l6) + where + + is-ω-continuous-comp-Poset : + (g : ω-continuous-hom-Poset Q R) + (f : ω-continuous-hom-Poset P Q) → + is-ω-continuous-Poset P R + ( map-ω-continuous-hom-Poset Q R g ∘ + map-ω-continuous-hom-Poset P Q f) + is-ω-continuous-comp-Poset g f c y = + is-ω-continuous-ω-continuous-hom-Poset Q R g + ( comp-hom-Poset ℕ-Poset P Q (hom-ω-continuous-hom-Poset P Q f) c) + ( map-ω-continuous-hom-Poset P Q f (pr1 y) , + is-ω-continuous-ω-continuous-hom-Poset P Q f c y) + + comp-ω-continuous-hom-Poset : + (g : ω-continuous-hom-Poset Q R) + (f : ω-continuous-hom-Poset P Q) → + ω-continuous-hom-Poset P R + comp-ω-continuous-hom-Poset g f = + map-ω-continuous-hom-Poset Q R g ∘ + map-ω-continuous-hom-Poset P Q f , + is-ω-continuous-comp-Poset g f +``` + +### Unit laws for composition of ω-continuous maps + +```agda +module _ + {l1 l2 l3 l4 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + left-unit-law-comp-ω-continuous-hom-Poset : + (f : ω-continuous-hom-Poset P Q) → + ( comp-ω-continuous-hom-Poset P Q Q + ( id-ω-continuous-hom-Poset Q) + ( f)) = + ( f) + left-unit-law-comp-ω-continuous-hom-Poset f = + eq-htpy-ω-continuous-hom-Poset P Q + ( comp-ω-continuous-hom-Poset P Q Q + ( id-ω-continuous-hom-Poset Q) + ( f)) + ( f) + ( refl-htpy) + + right-unit-law-comp-ω-continuous-hom-Poset : + (f : ω-continuous-hom-Poset P Q) → + ( comp-ω-continuous-hom-Poset P P Q + ( f) + ( id-ω-continuous-hom-Poset P)) = + ( f) + right-unit-law-comp-ω-continuous-hom-Poset f = + eq-htpy-ω-continuous-hom-Poset P Q + ( comp-ω-continuous-hom-Poset P P Q + ( f) + ( id-ω-continuous-hom-Poset P)) + ( f) + ( refl-htpy) +``` + +### Associativity of composition of ω-continuous maps + +```agda +module _ + {l1 l2 l3 l4 l5 l6 l7 l8 : Level} + (P : Poset l1 l2) (Q : Poset l3 l4) + (R : Poset l5 l6) (S : Poset l7 l8) + (h : ω-continuous-hom-Poset R S) + (g : ω-continuous-hom-Poset Q R) + (f : ω-continuous-hom-Poset P Q) + where + + associative-comp-ω-continuous-hom-Poset : + comp-ω-continuous-hom-Poset P Q S + ( comp-ω-continuous-hom-Poset Q R S h g) + ( f) = + comp-ω-continuous-hom-Poset P R S + ( h) + ( comp-ω-continuous-hom-Poset P Q R g f) + associative-comp-ω-continuous-hom-Poset = + eq-htpy-ω-continuous-hom-Poset P S + ( comp-ω-continuous-hom-Poset P Q S + ( comp-ω-continuous-hom-Poset Q R S h g) + ( f)) + ( comp-ω-continuous-hom-Poset P R S + ( h) + ( comp-ω-continuous-hom-Poset P Q R g f)) + ( refl-htpy) + + involutive-eq-associative-comp-ω-continuous-hom-Poset : + comp-ω-continuous-hom-Poset P Q S + ( comp-ω-continuous-hom-Poset Q R S h g) + ( f) =ⁱ + comp-ω-continuous-hom-Poset P R S + ( h) + ( comp-ω-continuous-hom-Poset P Q R g f) + involutive-eq-associative-comp-ω-continuous-hom-Poset = + involutive-eq-eq associative-comp-ω-continuous-hom-Poset +``` diff --git a/src/domain-theory/scott-continuous-maps-posets.lagda.md b/src/domain-theory/scott-continuous-maps-posets.lagda.md new file mode 100644 index 0000000000..73eee12f7a --- /dev/null +++ b/src/domain-theory/scott-continuous-maps-posets.lagda.md @@ -0,0 +1,391 @@ +# Scott-continuous maps between posets + +```agda +module domain-theory.scott-continuous-maps-posets where +``` + +
Imports + +```agda +open import domain-theory.directed-families-posets + +open import foundation.booleans +open import foundation.dependent-pair-types +open import foundation.equivalences +open import foundation.evaluation-functions +open import foundation.existential-quantification +open import foundation.function-types +open import foundation.fundamental-theorem-of-identity-types +open import foundation.homotopies +open import foundation.homotopy-induction +open import foundation.identity-types +open import foundation.propositional-truncations +open import foundation.propositions +open import foundation.raising-universe-levels +open import foundation.small-types +open import foundation.strictly-involutive-identity-types +open import foundation.subtype-identity-principle +open import foundation.surjective-maps +open import foundation.torsorial-type-families +open import foundation.universe-levels + +open import order-theory.least-upper-bounds-posets +open import order-theory.order-preserving-maps-posets +open import order-theory.posets +``` + +
+ +## Idea + +A map `f : P → Q` between the underlying types of two +[posets](order-theory.posets.md) is said to be +{{#concept "Scott-continuous" Disambiguation="map of posets" WD="Scott continuity" WDID=Q895815 Agda=scott-continuous-map-Poset}} + +```text + f(⋃ᵢxᵢ) = ⋃ᵢf(xᵢ) +``` + +for every [directed family](domain-theory.directed-families-posets.md) +`x₍₋₎ : I → P` with a [supremum](order-theory.least-upper-bounds-posets.md) in +`P`. + +## Definitions + +### The predicate of preserving the supremum of a directed family + +```agda +module _ + {l1 l2 l3 l4 l5 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + (f : type-Poset P → type-Poset Q) + (x : directed-family-Poset l5 P) + where + + preserves-supremum-directed-family-map-Poset : UU (l1 ⊔ l2 ⊔ l3 ⊔ l4 ⊔ l5) + preserves-supremum-directed-family-map-Poset = + (y : + has-least-upper-bound-family-of-elements-Poset P + ( family-directed-family-Poset P x)) → + is-least-upper-bound-family-of-elements-Poset Q + ( f ∘ family-directed-family-Poset P x) + ( f (pr1 y)) + + is-prop-preserves-supremum-directed-family-map-Poset : + is-prop preserves-supremum-directed-family-map-Poset + is-prop-preserves-supremum-directed-family-map-Poset = + is-prop-Π + ( λ y → + is-prop-is-least-upper-bound-family-of-elements-Poset Q + ( f ∘ family-directed-family-Poset P x) + ( f (pr1 y))) + + preserves-supremum-directed-family-prop-map-Poset : + Prop (l1 ⊔ l2 ⊔ l3 ⊔ l4 ⊔ l5) + preserves-supremum-directed-family-prop-map-Poset = + preserves-supremum-directed-family-map-Poset , + is-prop-preserves-supremum-directed-family-map-Poset +``` + +### The predicate on a map of posets of being Scott-continuous + +```agda +module _ + {l1 l2 l3 l4 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + is-scott-continuous-Poset : + (l5 : Level) → (type-Poset P → type-Poset Q) → + UU (l1 ⊔ l2 ⊔ l3 ⊔ l4 ⊔ lsuc l5) + is-scott-continuous-Poset l5 f = + (x : directed-family-Poset l5 P) + (y : + has-least-upper-bound-family-of-elements-Poset P + ( family-directed-family-Poset P x)) → + is-least-upper-bound-family-of-elements-Poset Q + ( f ∘ family-directed-family-Poset P x) + ( f (pr1 y)) + + is-prop-is-scott-continuous-Poset : + {l5 : Level} (f : type-Poset P → type-Poset Q) → + is-prop (is-scott-continuous-Poset l5 f) + is-prop-is-scott-continuous-Poset f = + is-prop-Π (is-prop-preserves-supremum-directed-family-map-Poset P Q f) + + is-scott-continuous-prop-Poset : + (l5 : Level) → + (type-Poset P → type-Poset Q) → Prop (l1 ⊔ l2 ⊔ l3 ⊔ l4 ⊔ lsuc l5) + is-scott-continuous-prop-Poset l5 f = + ( is-scott-continuous-Poset l5 f) , + ( is-prop-is-scott-continuous-Poset f) + + scott-continuous-hom-Poset : (l5 : Level) → UU (l1 ⊔ l2 ⊔ l3 ⊔ l4 ⊔ lsuc l5) + scott-continuous-hom-Poset l5 = + Σ (type-Poset P → type-Poset Q) (is-scott-continuous-Poset l5) + + map-scott-continuous-hom-Poset : + {l5 : Level} → scott-continuous-hom-Poset l5 → type-Poset P → type-Poset Q + map-scott-continuous-hom-Poset = pr1 + + is-scott-continuous-map-scott-continuous-hom-Poset : + {l5 : Level} (f : scott-continuous-hom-Poset l5) → + is-scott-continuous-Poset l5 (map-scott-continuous-hom-Poset f) + is-scott-continuous-map-scott-continuous-hom-Poset = pr2 + + sup-map-scott-continuous-hom-Poset : + {l5 : Level} (f : scott-continuous-hom-Poset l5) → + (x : directed-family-Poset l5 P) → + has-least-upper-bound-family-of-elements-Poset P + ( family-directed-family-Poset P x) → + has-least-upper-bound-family-of-elements-Poset Q + ( map-scott-continuous-hom-Poset f ∘ family-directed-family-Poset P x) + sup-map-scott-continuous-hom-Poset f x y = + ( map-scott-continuous-hom-Poset f (pr1 y) , + is-scott-continuous-map-scott-continuous-hom-Poset f x y) +``` + +## Properties + +### Scott-continuous maps preserve suprema of directed families over small indexing types + +```agda +module _ + {l1 l2 l3 l4 l5 l6 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + preserves-small-supremum-directed-family-is-scott-continuous-Poset : + {f : type-Poset P → type-Poset Q} → + is-scott-continuous-Poset P Q l5 f → + (x : directed-family-Poset l6 P) + (u : is-small l5 (type-directed-family-Poset P x)) → + preserves-supremum-directed-family-map-Poset P Q f + ( reindex-inv-equiv-directed-family-Poset P x (equiv-is-small u)) + preserves-small-supremum-directed-family-is-scott-continuous-Poset H x u = + H (reindex-inv-equiv-directed-family-Poset P x (equiv-is-small u)) +``` + +### Scott-continuous maps preserve order + +```agda +module _ + {l1 l2 l3 l4 l5 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + abstract + preserves-order-is-scott-continuous-Poset : + {f : type-Poset P → type-Poset Q} → + is-scott-continuous-Poset P Q l5 f → + preserves-order-Poset P Q f + preserves-order-is-scott-continuous-Poset {f} H x y p = + pr2 + ( preserves-small-supremum-directed-family-is-scott-continuous-Poset + ( P) + ( Q) + ( H) + ( ( bool , unit-trunc-Prop true) , + rec-bool x y , + λ where + true true → + intro-exists true (refl-leq-Poset P x , refl-leq-Poset P x) + true false → + intro-exists false (p , refl-leq-Poset P y) + false true → + intro-exists false (refl-leq-Poset P y , p) + false false → + intro-exists false (refl-leq-Poset P y , refl-leq-Poset P y)) + ( Raise l5 bool) + ( y , + λ z → + ( ( ev (map-raise false)) , + ( λ where + u (map-raise true) → transitive-leq-Poset P x y z u p + u (map-raise false) → u))) + ( f y)) + ( refl-leq-Poset Q (f y)) + ( map-raise true) + + hom-scott-continuous-hom-Poset : + scott-continuous-hom-Poset P Q l5 → hom-Poset P Q + hom-scott-continuous-hom-Poset f = + map-scott-continuous-hom-Poset P Q f , + preserves-order-is-scott-continuous-Poset + ( is-scott-continuous-map-scott-continuous-hom-Poset P Q f) +``` + +### Homotopies of Scott-continuous maps + +```agda +module _ + {l1 l2 l3 l4 l5 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + htpy-scott-continuous-hom-Poset : + (f g : scott-continuous-hom-Poset P Q l5) → UU (l1 ⊔ l3) + htpy-scott-continuous-hom-Poset f g = + map-scott-continuous-hom-Poset P Q f ~ map-scott-continuous-hom-Poset P Q g + + refl-htpy-scott-continuous-hom-Poset : + (f : scott-continuous-hom-Poset P Q l5) → + htpy-scott-continuous-hom-Poset f f + refl-htpy-scott-continuous-hom-Poset f = refl-htpy + + htpy-eq-scott-continuous-hom-Poset : + (f g : scott-continuous-hom-Poset P Q l5) → + f = g → + htpy-scott-continuous-hom-Poset f g + htpy-eq-scott-continuous-hom-Poset f .f refl = + refl-htpy-scott-continuous-hom-Poset f + + is-torsorial-htpy-scott-continuous-hom-Poset : + (f : scott-continuous-hom-Poset P Q l5) → + is-torsorial (htpy-scott-continuous-hom-Poset f) + is-torsorial-htpy-scott-continuous-hom-Poset f = + is-torsorial-Eq-subtype + ( is-torsorial-htpy (map-scott-continuous-hom-Poset P Q f)) + ( is-prop-is-scott-continuous-Poset P Q) + ( map-scott-continuous-hom-Poset P Q f) + ( refl-htpy) + ( is-scott-continuous-map-scott-continuous-hom-Poset P Q f) + + is-equiv-htpy-eq-scott-continuous-hom-Poset : + (f g : scott-continuous-hom-Poset P Q l5) → + is-equiv (htpy-eq-scott-continuous-hom-Poset f g) + is-equiv-htpy-eq-scott-continuous-hom-Poset f = + fundamental-theorem-id + ( is-torsorial-htpy-scott-continuous-hom-Poset f) + ( htpy-eq-scott-continuous-hom-Poset f) + + extensionality-scott-continuous-hom-Poset : + (f g : scott-continuous-hom-Poset P Q l5) → + (f = g) ≃ htpy-scott-continuous-hom-Poset f g + pr1 (extensionality-scott-continuous-hom-Poset f g) = + htpy-eq-scott-continuous-hom-Poset f g + pr2 (extensionality-scott-continuous-hom-Poset f g) = + is-equiv-htpy-eq-scott-continuous-hom-Poset f g + + eq-htpy-scott-continuous-hom-Poset : + (f g : scott-continuous-hom-Poset P Q l5) → + htpy-scott-continuous-hom-Poset f g → f = g + eq-htpy-scott-continuous-hom-Poset f g = + map-inv-is-equiv (is-equiv-htpy-eq-scott-continuous-hom-Poset f g) +``` + +### The identity Scott-continuous map + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) + where + + is-scott-continuous-id-Poset : + {l3 : Level} → is-scott-continuous-Poset P P l3 (id {A = type-Poset P}) + is-scott-continuous-id-Poset x y = pr2 y + + id-scott-continuous-hom-Poset : + (l3 : Level) → scott-continuous-hom-Poset P P l3 + id-scott-continuous-hom-Poset l3 = id , is-scott-continuous-id-Poset +``` + +### Composing Scott-continuous maps + +```agda +module _ + {l1 l2 l3 l4 l5 l6 l7 : Level} + (P : Poset l1 l2) (Q : Poset l3 l4) (R : Poset l5 l6) + where + + is-scott-continuous-comp-Poset : + (g : scott-continuous-hom-Poset Q R l7) + (f : scott-continuous-hom-Poset P Q l7) → + is-scott-continuous-Poset P R l7 + ( map-scott-continuous-hom-Poset Q R g ∘ + map-scott-continuous-hom-Poset P Q f) + is-scott-continuous-comp-Poset g f x y = + is-scott-continuous-map-scott-continuous-hom-Poset Q R g + ( directed-family-hom-Poset P Q (hom-scott-continuous-hom-Poset P Q f) x) + ( sup-map-scott-continuous-hom-Poset P Q f x y) + + comp-scott-continuous-hom-Poset : + (g : scott-continuous-hom-Poset Q R l7) + (f : scott-continuous-hom-Poset P Q l7) → + scott-continuous-hom-Poset P R l7 + comp-scott-continuous-hom-Poset g f = + map-scott-continuous-hom-Poset Q R g ∘ + map-scott-continuous-hom-Poset P Q f , + is-scott-continuous-comp-Poset g f +``` + +### Unit laws for composition of Scott-continuous maps + +```agda +module _ + {l1 l2 l3 l4 l5 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + left-unit-law-comp-scott-continuous-hom-Poset : + (f : scott-continuous-hom-Poset P Q l5) → + ( comp-scott-continuous-hom-Poset P Q Q + ( id-scott-continuous-hom-Poset Q l5) + ( f)) = + ( f) + left-unit-law-comp-scott-continuous-hom-Poset f = + eq-htpy-scott-continuous-hom-Poset P Q + ( comp-scott-continuous-hom-Poset P Q Q + ( id-scott-continuous-hom-Poset Q l5) + ( f)) + ( f) + ( refl-htpy) + + right-unit-law-comp-scott-continuous-hom-Poset : + (f : scott-continuous-hom-Poset P Q l5) → + ( comp-scott-continuous-hom-Poset P P Q + ( f) + ( id-scott-continuous-hom-Poset P l5)) = + ( f) + right-unit-law-comp-scott-continuous-hom-Poset f = + eq-htpy-scott-continuous-hom-Poset P Q + ( comp-scott-continuous-hom-Poset P P Q + ( f) + ( id-scott-continuous-hom-Poset P l5)) + ( f) + ( refl-htpy) +``` + +### Associativity of composition of Scott-continuous maps + +```agda +module _ + {l1 l2 l3 l4 l5 l6 l7 l8 l9 : Level} + (P : Poset l1 l2) (Q : Poset l3 l4) + (R : Poset l5 l6) (S : Poset l7 l8) + (h : scott-continuous-hom-Poset R S l9) + (g : scott-continuous-hom-Poset Q R l9) + (f : scott-continuous-hom-Poset P Q l9) + where + + associative-comp-scott-continuous-hom-Poset : + comp-scott-continuous-hom-Poset P Q S + ( comp-scott-continuous-hom-Poset Q R S h g) + ( f) = + comp-scott-continuous-hom-Poset P R S + ( h) + ( comp-scott-continuous-hom-Poset P Q R g f) + associative-comp-scott-continuous-hom-Poset = + eq-htpy-scott-continuous-hom-Poset P S + ( comp-scott-continuous-hom-Poset P Q S + ( comp-scott-continuous-hom-Poset Q R S h g) + ( f)) + ( comp-scott-continuous-hom-Poset P R S + ( h) + ( comp-scott-continuous-hom-Poset P Q R g f)) + ( refl-htpy) + + involutive-eq-associative-comp-scott-continuous-hom-Poset : + comp-scott-continuous-hom-Poset P Q S + ( comp-scott-continuous-hom-Poset Q R S h g) + ( f) =ⁱ + comp-scott-continuous-hom-Poset P R S + ( h) + ( comp-scott-continuous-hom-Poset P Q R g f) + involutive-eq-associative-comp-scott-continuous-hom-Poset = + involutive-eq-eq associative-comp-scott-continuous-hom-Poset +``` diff --git a/src/elementary-number-theory/decidable-total-order-natural-numbers.lagda.md b/src/elementary-number-theory/decidable-total-order-natural-numbers.lagda.md index 218c186e1f..e1f374b7db 100644 --- a/src/elementary-number-theory/decidable-total-order-natural-numbers.lagda.md +++ b/src/elementary-number-theory/decidable-total-order-natural-numbers.lagda.md @@ -8,12 +8,19 @@ module elementary-number-theory.decidable-total-order-natural-numbers where ```agda open import elementary-number-theory.inequality-natural-numbers +open import elementary-number-theory.natural-numbers open import foundation.dependent-pair-types +open import foundation.function-types open import foundation.propositional-truncations +open import foundation.unit-type open import foundation.universe-levels open import order-theory.decidable-total-orders +open import order-theory.order-preserving-maps-posets +open import order-theory.order-preserving-maps-preorders +open import order-theory.posets +open import order-theory.preorders open import order-theory.total-orders ``` @@ -41,3 +48,50 @@ pr1 ℕ-Decidable-Total-Order = ℕ-Poset pr1 (pr2 ℕ-Decidable-Total-Order) = is-total-leq-ℕ pr2 (pr2 ℕ-Decidable-Total-Order) = is-decidable-leq-ℕ ``` + +## Properties + +### Defining order preserving maps out of the natural numbers by induction + +```agda +module _ + {l1 l2 : Level} (P : Preorder l1 l2) + where + + preserves-order-ind-ℕ-Preorder : + (f : ℕ → type-Preorder P) → + ((n : ℕ) → leq-Preorder P (f n) (f (succ-ℕ n))) → + preserves-order-Preorder ℕ-Preorder P f + preserves-order-ind-ℕ-Preorder f H zero-ℕ zero-ℕ p = + refl-leq-Preorder P (f zero-ℕ) + preserves-order-ind-ℕ-Preorder f H zero-ℕ (succ-ℕ m) p = + transitive-leq-Preorder P (f 0) (f m) (f (succ-ℕ m)) + ( H m) + ( preserves-order-ind-ℕ-Preorder f H zero-ℕ m star) + preserves-order-ind-ℕ-Preorder f H (succ-ℕ n) zero-ℕ () + preserves-order-ind-ℕ-Preorder f H (succ-ℕ n) (succ-ℕ m) = + preserves-order-ind-ℕ-Preorder (f ∘ succ-ℕ) (H ∘ succ-ℕ) n m + + hom-ind-ℕ-Preorder : + (f : ℕ → type-Preorder P) → + ((n : ℕ) → leq-Preorder P (f n) (f (succ-ℕ n))) → + hom-Preorder (ℕ-Preorder) P + hom-ind-ℕ-Preorder f H = f , preserves-order-ind-ℕ-Preorder f H + +module _ + {l1 l2 : Level} (P : Poset l1 l2) + where + + preserves-order-ind-ℕ-Poset : + (f : ℕ → type-Poset P) → + ((n : ℕ) → leq-Poset P (f n) (f (succ-ℕ n))) → + preserves-order-Poset ℕ-Poset P f + preserves-order-ind-ℕ-Poset = + preserves-order-ind-ℕ-Preorder (preorder-Poset P) + + hom-ind-ℕ-Poset : + (f : ℕ → type-Poset P) → + ((n : ℕ) → leq-Poset P (f n) (f (succ-ℕ n))) → + hom-Poset (ℕ-Poset) P + hom-ind-ℕ-Poset = hom-ind-ℕ-Preorder (preorder-Poset P) +``` 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 9c437a8708..a72905645f 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 @@ -1,4 +1,4 @@ -# The Well-Ordering Principle of the natural numbers +# The well-ordering principle of the natural numbers ```agda module elementary-number-theory.well-ordering-principle-natural-numbers where diff --git a/src/foundation-core/decidable-propositions.lagda.md b/src/foundation-core/decidable-propositions.lagda.md index 3f6eb2e2ce..eb48a26b7d 100644 --- a/src/foundation-core/decidable-propositions.lagda.md +++ b/src/foundation-core/decidable-propositions.lagda.md @@ -13,10 +13,12 @@ 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.universe-levels open import foundation-core.cartesian-product-types +open import foundation-core.contractible-types open import foundation-core.empty-types open import foundation-core.function-types open import foundation-core.functoriality-dependent-pair-types @@ -32,14 +34,11 @@ A {{#concept "decidable proposition" Agda=is-decidable-Prop}} is a [proposition](foundation-core.propositions.md) that has a [decidable](foundation.decidable-types.md) underlying type. -## Definition +## Definitions -### The subtype of decidable propositions +### The property of a proposition of being decidable ```agda -is-decidable-prop : {l : Level} → UU l → UU l -is-decidable-prop A = is-prop A × is-decidable A - is-prop-is-decidable : {l : Level} {A : UU l} → is-prop A → is-prop (is-decidable A) is-prop-is-decidable is-prop-A = @@ -50,6 +49,16 @@ is-decidable-Prop : pr1 (is-decidable-Prop P) = is-decidable (type-Prop P) pr2 (is-decidable-Prop P) = is-prop-is-decidable (is-prop-type-Prop P) +is-decidable-type-Prop : {l : Level} → Prop l → UU l +is-decidable-type-Prop P = is-decidable (type-Prop P) +``` + +### The subuniverse of decidable propositions + +```agda +is-decidable-prop : {l : Level} → UU l → UU l +is-decidable-prop A = is-prop A × is-decidable A + is-prop-is-decidable-prop : {l : Level} (X : UU l) → is-prop (is-decidable-prop X) is-prop-is-decidable-prop X = @@ -63,6 +72,16 @@ is-decidable-prop-Prop : {l : Level} (A : UU l) → Prop l pr1 (is-decidable-prop-Prop A) = is-decidable-prop A pr2 (is-decidable-prop-Prop A) = is-prop-is-decidable-prop A + +module _ + {l : Level} {A : UU l} (H : is-decidable-prop A) + where + + is-prop-type-is-decidable-prop : is-prop A + is-prop-type-is-decidable-prop = pr1 H + + is-decidable-type-is-decidable-prop : is-decidable A + is-decidable-type-is-decidable-prop = pr2 H ``` ### Decidable propositions @@ -93,7 +112,8 @@ module _ is-decidable-prop-type-Decidable-Prop = pr2 P is-decidable-prop-Decidable-Prop : Prop l - pr1 is-decidable-prop-Decidable-Prop = is-decidable type-Decidable-Prop + pr1 is-decidable-prop-Decidable-Prop = + is-decidable type-Decidable-Prop pr2 is-decidable-prop-Decidable-Prop = is-prop-is-decidable is-prop-type-Decidable-Prop ``` @@ -110,6 +130,14 @@ pr1 empty-Decidable-Prop = empty pr2 empty-Decidable-Prop = is-decidable-prop-empty ``` +### Empty types are decidable propositions + +```agda +is-decidable-prop-is-empty : + {l : Level} {A : UU l} → is-empty A → is-decidable-prop A +is-decidable-prop-is-empty H = is-prop-is-empty H , inr H +``` + ### The unit type is a decidable proposition ```agda @@ -122,6 +150,14 @@ pr1 unit-Decidable-Prop = unit pr2 unit-Decidable-Prop = is-decidable-prop-unit ``` +### Contractible types are decidable propositions + +```agda +is-decidable-prop-is-contr : + {l : Level} {A : UU l} → is-contr A → is-decidable-prop A +is-decidable-prop-is-contr H = is-prop-is-contr H , inl (center H) +``` + ### The product of two decidable propositions is a decidable proposition ```agda @@ -154,6 +190,42 @@ module _ pr2 product-Decidable-Prop = is-decidable-prop-product-Decidable-Prop ``` +### The dependent sum of a family of decidable propositions over a decidable proposition + +```agda +module _ + {l1 l2 : Level} {P : UU l1} {Q : P → UU l2} + (H : is-decidable-prop P) (K : (x : P) → is-decidable-prop (Q x)) + where + + is-prop-is-decidable-prop-Σ : is-prop (Σ P Q) + is-prop-is-decidable-prop-Σ = + is-prop-Σ + ( is-prop-type-is-decidable-prop H) + ( is-prop-type-is-decidable-prop ∘ K) + + 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-type-is-decidable-prop H) + + is-decidable-prop-Σ : is-decidable-prop (Σ P Q) + is-decidable-prop-Σ = + ( is-prop-is-decidable-prop-Σ , is-decidable-is-decidable-prop-Σ) +``` + ### The negation operation on decidable propositions ```agda diff --git a/src/foundation-core/fibers-of-maps.lagda.md b/src/foundation-core/fibers-of-maps.lagda.md index 066a033e3c..69367d3013 100644 --- a/src/foundation-core/fibers-of-maps.lagda.md +++ b/src/foundation-core/fibers-of-maps.lagda.md @@ -10,6 +10,7 @@ module foundation-core.fibers-of-maps where open import foundation.action-on-identifications-functions open import foundation.dependent-pair-types open import foundation.universe-levels +open import foundation.strictly-right-unital-concatenation-identifications open import foundation-core.equivalences open import foundation-core.function-types @@ -373,6 +374,76 @@ module _ pr2 inv-compute-fiber-comp = is-equiv-map-inv-compute-fiber-comp ``` +### Fibers of homotopic maps are equivalent + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + {f g : A → B} (H : g ~ f) (y : B) + where + + map-equiv-fiber-htpy : fiber f y → fiber g y + map-equiv-fiber-htpy (x , p) = x , H x ∙ᵣ p + + map-inv-equiv-fiber-htpy : fiber g y → fiber f y + map-inv-equiv-fiber-htpy (x , p) = x , inv (H x) ∙ᵣ p + + is-section-map-inv-equiv-fiber-htpy : + is-section map-equiv-fiber-htpy map-inv-equiv-fiber-htpy + is-section-map-inv-equiv-fiber-htpy (x , refl) = + eq-Eq-fiber g (g x) refl (inv (right-inv-right-strict-concat (H x))) + + is-retraction-map-inv-equiv-fiber-htpy : + is-retraction map-equiv-fiber-htpy map-inv-equiv-fiber-htpy + is-retraction-map-inv-equiv-fiber-htpy (x , refl) = + eq-Eq-fiber f (f x) refl (inv (left-inv-right-strict-concat (H x))) + + is-equiv-map-equiv-fiber-htpy : is-equiv map-equiv-fiber-htpy + is-equiv-map-equiv-fiber-htpy = + is-equiv-is-invertible + map-inv-equiv-fiber-htpy + is-section-map-inv-equiv-fiber-htpy + is-retraction-map-inv-equiv-fiber-htpy + + equiv-fiber-htpy : fiber f y ≃ fiber g y + equiv-fiber-htpy = map-equiv-fiber-htpy , is-equiv-map-equiv-fiber-htpy +``` + +We repeat the construction for `fiber'`. + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + {f g : A → B} (H : g ~ f) (y : B) + where + + map-equiv-fiber-htpy' : fiber' f y → fiber' g y + map-equiv-fiber-htpy' (x , p) = (x , p ∙ inv (H x)) + + map-inv-equiv-fiber-htpy' : fiber' g y → fiber' f y + map-inv-equiv-fiber-htpy' (x , p) = (x , p ∙ H x) + + is-section-map-inv-equiv-fiber-htpy' : + is-section map-equiv-fiber-htpy' map-inv-equiv-fiber-htpy' + is-section-map-inv-equiv-fiber-htpy' (x , p) = + ap (pair x) (is-retraction-inv-concat' (H x) p) + + is-retraction-map-inv-equiv-fiber-htpy' : + is-retraction map-equiv-fiber-htpy' map-inv-equiv-fiber-htpy' + is-retraction-map-inv-equiv-fiber-htpy' (x , p) = + ap (pair x) (is-section-inv-concat' (H x) p) + + is-equiv-map-equiv-fiber-htpy' : is-equiv map-equiv-fiber-htpy' + is-equiv-map-equiv-fiber-htpy' = + is-equiv-is-invertible + map-inv-equiv-fiber-htpy' + is-section-map-inv-equiv-fiber-htpy' + is-retraction-map-inv-equiv-fiber-htpy' + + equiv-fiber-htpy' : fiber' f y ≃ fiber' g y + equiv-fiber-htpy' = map-equiv-fiber-htpy' , is-equiv-map-equiv-fiber-htpy' +``` + ## Table of files about fibers of maps The following table lists files that are about fibers of maps as a general diff --git a/src/foundation-core/propositions.lagda.md b/src/foundation-core/propositions.lagda.md index 041ce6881d..0b5e5878b3 100644 --- a/src/foundation-core/propositions.lagda.md +++ b/src/foundation-core/propositions.lagda.md @@ -126,6 +126,10 @@ module _ abstract eq-is-proof-irrelevant : is-proof-irrelevant A → all-elements-equal A eq-is-proof-irrelevant = eq-is-prop' ∘ is-prop-is-proof-irrelevant + +abstract + eq-type-Prop : {l : Level} (P : Prop l) → {x y : type-Prop P} → x = y + eq-type-Prop P = eq-is-prop (is-prop-type-Prop P) ``` ### Propositions are closed under equivalences diff --git a/src/foundation.lagda.md b/src/foundation.lagda.md index 17148ba8de..71cf40a215 100644 --- a/src/foundation.lagda.md +++ b/src/foundation.lagda.md @@ -85,6 +85,7 @@ open import foundation.connected-types public open import foundation.constant-maps public open import foundation.constant-span-diagrams public open import foundation.constant-type-families public +open import foundation.constructive-cantor-schroder-bernstein public open import foundation.continuations public open import foundation.contractible-maps public open import foundation.contractible-types public @@ -220,6 +221,7 @@ open import foundation.identity-systems public open import foundation.identity-truncated-types public open import foundation.identity-types public open import foundation.images public +open import foundation.images-embeddings public open import foundation.images-subtypes public open import foundation.implicit-function-types public open import foundation.impredicative-encodings public @@ -255,6 +257,7 @@ open import foundation.lawveres-fixed-point-theorem public open import foundation.lesser-limited-principle-of-omniscience public open import foundation.lifts-types public 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.maps-in-global-subuniverses public diff --git a/src/foundation/booleans.lagda.md b/src/foundation/booleans.lagda.md index 4e317afa3a..82e07d5dfc 100644 --- a/src/foundation/booleans.lagda.md +++ b/src/foundation/booleans.lagda.md @@ -65,6 +65,17 @@ module _ ind-bool pt pf false = pf ``` +### The recursion principle of the booleans + +```agda +module _ + {l : Level} {P : UU l} + where + + rec-bool : P → P → bool → P + rec-bool = ind-bool (λ _ → P) +``` + ### The `if_then_else` function ```agda @@ -73,8 +84,7 @@ module _ where if_then_else_ : bool → A → A → A - if true then x else y = x - if false then x else y = y + if b then x else y = rec-bool x y b ``` ### Raising universe levels of the booleans @@ -187,6 +197,32 @@ pr1 bool-Set = bool pr2 bool-Set = is-set-bool ``` +### The "is true" predicate on booleans + +```agda +is-true : bool → UU lzero +is-true = Eq-bool true + +is-prop-is-true : (b : bool) → is-prop (is-true b) +is-prop-is-true = is-prop-Eq-bool true + +is-true-Prop : bool → Prop lzero +is-true-Prop b = is-true b , is-prop-is-true b +``` + +### The "is false" predicate on booleans + +```agda +is-false : bool → UU lzero +is-false = Eq-bool false + +is-prop-is-false : (b : bool) → is-prop (is-false b) +is-prop-is-false = is-prop-Eq-bool false + +is-false-Prop : bool → Prop lzero +is-false-Prop b = is-false b , is-prop-is-false b +``` + ### The type of booleans is equivalent to `Fin 2` ```agda diff --git a/src/foundation/cantor-schroder-bernstein-escardo.lagda.md b/src/foundation/cantor-schroder-bernstein-escardo.lagda.md index 7f0d889d21..a13b105093 100644 --- a/src/foundation/cantor-schroder-bernstein-escardo.lagda.md +++ b/src/foundation/cantor-schroder-bernstein-escardo.lagda.md @@ -45,8 +45,9 @@ The Cantor–Schröder–Bernstein theorem is the 25th theorem on ## Statement ```agda -type-Cantor-Schröder-Bernstein-Escardó : (l1 l2 : Level) → UU (lsuc (l1 ⊔ l2)) -type-Cantor-Schröder-Bernstein-Escardó l1 l2 = +statement-Cantor-Schröder-Bernstein-Escardó : + (l1 l2 : Level) → UU (lsuc (l1 ⊔ l2)) +statement-Cantor-Schröder-Bernstein-Escardó l1 l2 = {X : UU l1} {Y : UU l2} → (X ↪ Y) → (Y ↪ X) → X ≃ Y ``` @@ -57,124 +58,119 @@ type-Cantor-Schröder-Bernstein-Escardó l1 l2 = ```agda module _ {l1 l2 : Level} (lem : LEM (l1 ⊔ l2)) + {X : UU l1} {Y : UU l2} (f : X ↪ Y) (g : Y ↪ X) where - module _ - {X : UU l1} {Y : UU l2} (f : X ↪ Y) (g : Y ↪ X) + map-Cantor-Schröder-Bernstein-Escardó' : + (x : X) → is-decidable (is-perfect-image (map-emb f) (map-emb g) x) → Y + map-Cantor-Schröder-Bernstein-Escardó' x (inl y) = + inverse-of-perfect-image x y + map-Cantor-Schröder-Bernstein-Escardó' x (inr y) = + map-emb f x + + map-Cantor-Schröder-Bernstein-Escardó : X → Y + map-Cantor-Schröder-Bernstein-Escardó x = + map-Cantor-Schröder-Bernstein-Escardó' x + ( is-decidable-is-perfect-image-is-emb-LEM lem (is-emb-map-emb g) x) + + is-injective-map-Cantor-Schröder-Bernstein-Escardó : + is-injective map-Cantor-Schröder-Bernstein-Escardó + is-injective-map-Cantor-Schröder-Bernstein-Escardó {x} {x'} = + l (is-decidable-is-perfect-image-is-emb-LEM lem (is-emb-map-emb g) x) + (is-decidable-is-perfect-image-is-emb-LEM lem (is-emb-map-emb g) x') where - - map-Cantor-Schröder-Bernstein-Escardó' : - (x : X) → is-decidable (is-perfect-image (map-emb f) (map-emb g) x) → Y - map-Cantor-Schröder-Bernstein-Escardó' x (inl y) = - inverse-of-perfect-image x y - map-Cantor-Schröder-Bernstein-Escardó' x (inr y) = - map-emb f x - - map-Cantor-Schröder-Bernstein-Escardó : - X → Y - map-Cantor-Schröder-Bernstein-Escardó x = - map-Cantor-Schröder-Bernstein-Escardó' x - ( is-decidable-is-perfect-image-is-emb (is-emb-map-emb g) lem x) - - is-injective-map-Cantor-Schröder-Bernstein-Escardó : - is-injective map-Cantor-Schröder-Bernstein-Escardó - is-injective-map-Cantor-Schröder-Bernstein-Escardó {x} {x'} = - l (is-decidable-is-perfect-image-is-emb (is-emb-map-emb g) lem x) - (is-decidable-is-perfect-image-is-emb (is-emb-map-emb g) lem x') + l : + (d : is-decidable (is-perfect-image (map-emb f) (map-emb g) x)) + (d' : is-decidable (is-perfect-image (map-emb f) (map-emb g) x')) → + ( map-Cantor-Schröder-Bernstein-Escardó' x d) = + ( map-Cantor-Schröder-Bernstein-Escardó' x' d') → + x = x' + l (inl ρ) (inl ρ') p = + ( inv (is-section-inverse-of-perfect-image x ρ)) ∙ + ( ap (map-emb g) p ∙ is-section-inverse-of-perfect-image x' ρ') + l (inl ρ) (inr nρ') p = + ex-falso (perfect-image-has-distinct-image x' x nρ' ρ (inv p)) + l (inr nρ) (inl ρ') p = + ex-falso (perfect-image-has-distinct-image x x' nρ ρ' p) + l (inr nρ) (inr nρ') p = + is-injective-is-emb (is-emb-map-emb f) p + + is-split-surjective-map-Cantor-Schröder-Bernstein-Escardó : + is-split-surjective map-Cantor-Schröder-Bernstein-Escardó + is-split-surjective-map-Cantor-Schröder-Bernstein-Escardó y = + pair x p + where + a : + is-decidable + ( is-perfect-image (map-emb f) (map-emb g) (map-emb g y)) → + Σ ( X) + ( λ x → + ( (d : is-decidable (is-perfect-image (map-emb f) (map-emb g) x)) → + map-Cantor-Schröder-Bernstein-Escardó' x d = y)) + a (inl γ) = + pair (map-emb g y) ψ where - l : - (d : is-decidable (is-perfect-image (map-emb f) (map-emb g) x)) - (d' : is-decidable (is-perfect-image (map-emb f) (map-emb g) x')) → - ( map-Cantor-Schröder-Bernstein-Escardó' x d) = - ( map-Cantor-Schröder-Bernstein-Escardó' x' d') → - x = x' - l (inl ρ) (inl ρ') p = - inv (is-section-inverse-of-perfect-image x ρ) ∙ - (ap (map-emb g) p ∙ is-section-inverse-of-perfect-image x' ρ') - l (inl ρ) (inr nρ') p = - ex-falso (perfect-image-has-distinct-image x' x nρ' ρ (inv p)) - l (inr nρ) (inl ρ') p = - ex-falso (perfect-image-has-distinct-image x x' nρ ρ' p) - l (inr nρ) (inr nρ') p = - is-injective-is-emb (is-emb-map-emb f) p - - is-split-surjective-map-Cantor-Schröder-Bernstein-Escardó : - is-split-surjective map-Cantor-Schröder-Bernstein-Escardó - is-split-surjective-map-Cantor-Schröder-Bernstein-Escardó y = - pair x p + ψ : + ( d : + is-decidable + ( is-perfect-image (map-emb f) (map-emb g) (map-emb g y))) → + map-Cantor-Schröder-Bernstein-Escardó' (map-emb g y) d = y + ψ (inl v') = + is-retraction-inverse-of-perfect-image + { is-emb-g = is-emb-map-emb g} + ( y) + ( v') + ψ (inr v) = ex-falso (v γ) + a (inr γ) = + pair x ψ where - a : - is-decidable - ( is-perfect-image (map-emb f) (map-emb g) (map-emb g y)) → - Σ ( X) - ( λ x → - ( (d : is-decidable (is-perfect-image (map-emb f) (map-emb g) x)) → - map-Cantor-Schröder-Bernstein-Escardó' x d = y)) - a (inl γ) = - pair (map-emb g y) ψ - where - ψ : - ( d : - is-decidable - ( is-perfect-image (map-emb f) (map-emb g) (map-emb g y))) → - map-Cantor-Schröder-Bernstein-Escardó' (map-emb g y) d = y - ψ (inl v') = - is-retraction-inverse-of-perfect-image - { is-emb-g = is-emb-map-emb g} - ( y) - ( v') - ψ (inr v) = ex-falso (v γ) - a (inr γ) = - pair x ψ - where - w : - Σ ( fiber (map-emb f) y) - ( λ s → ¬ (is-perfect-image (map-emb f) (map-emb g) (pr1 s))) - w = - not-perfect-image-has-not-perfect-fiber - ( is-emb-map-emb f) - ( is-emb-map-emb g) - ( lem) - ( y) - ( γ) - x : X - x = pr1 (pr1 w) - p : map-emb f x = y - p = pr2 (pr1 w) - ψ : - ( d : is-decidable (is-perfect-image (map-emb f) (map-emb g) x)) → - map-Cantor-Schröder-Bernstein-Escardó' x d = y - ψ (inl v) = ex-falso ((pr2 w) v) - ψ (inr v) = p - b : - Σ ( X) - ( λ x → - ( (d : is-decidable (is-perfect-image (map-emb f) (map-emb g) x)) → - map-Cantor-Schröder-Bernstein-Escardó' x d = y)) - b = - a ( is-decidable-is-perfect-image-is-emb - ( is-emb-map-emb g) - ( lem) - ( map-emb g y)) + w : + Σ ( fiber (map-emb f) y) + ( λ s → ¬ (is-perfect-image (map-emb f) (map-emb g) (pr1 s))) + w = + has-not-perfect-fiber-is-not-perfect-image-LEM lem + ( is-emb-map-emb f) + ( is-emb-map-emb g) + ( y) + ( γ) x : X - x = pr1 b - p : map-Cantor-Schröder-Bernstein-Escardó x = y - p = pr2 b (is-decidable-is-perfect-image-is-emb (is-emb-map-emb g) lem x) - - is-equiv-map-Cantor-Schröder-Bernstein-Escardó : - is-equiv map-Cantor-Schröder-Bernstein-Escardó - is-equiv-map-Cantor-Schröder-Bernstein-Escardó = - is-equiv-is-split-surjective-is-injective - map-Cantor-Schröder-Bernstein-Escardó - is-injective-map-Cantor-Schröder-Bernstein-Escardó - is-split-surjective-map-Cantor-Schröder-Bernstein-Escardó - - Cantor-Schröder-Bernstein-Escardó : - type-Cantor-Schröder-Bernstein-Escardó l1 l2 - pr1 (Cantor-Schröder-Bernstein-Escardó f g) = - map-Cantor-Schröder-Bernstein-Escardó f g - pr2 (Cantor-Schröder-Bernstein-Escardó f g) = - is-equiv-map-Cantor-Schröder-Bernstein-Escardó f g + x = pr1 (pr1 w) + p : map-emb f x = y + p = pr2 (pr1 w) + ψ : + ( d : is-decidable (is-perfect-image (map-emb f) (map-emb g) x)) → + map-Cantor-Schröder-Bernstein-Escardó' x d = y + ψ (inl v) = ex-falso ((pr2 w) v) + ψ (inr v) = p + b : + Σ ( X) + ( λ x → + ( (d : is-decidable (is-perfect-image (map-emb f) (map-emb g) x)) → + map-Cantor-Schröder-Bernstein-Escardó' x d = y)) + b = + a ( is-decidable-is-perfect-image-is-emb-LEM lem + ( is-emb-map-emb g) + ( map-emb g y)) + x : X + x = pr1 b + p : map-Cantor-Schröder-Bernstein-Escardó x = y + p = + pr2 b (is-decidable-is-perfect-image-is-emb-LEM lem (is-emb-map-emb g) x) + + is-equiv-map-Cantor-Schröder-Bernstein-Escardó : + is-equiv map-Cantor-Schröder-Bernstein-Escardó + is-equiv-map-Cantor-Schröder-Bernstein-Escardó = + is-equiv-is-split-surjective-is-injective + map-Cantor-Schröder-Bernstein-Escardó + is-injective-map-Cantor-Schröder-Bernstein-Escardó + is-split-surjective-map-Cantor-Schröder-Bernstein-Escardó + +Cantor-Schröder-Bernstein-Escardó : + {l1 l2 : Level} (lem : LEM (l1 ⊔ l2)) → + statement-Cantor-Schröder-Bernstein-Escardó l1 l2 +Cantor-Schröder-Bernstein-Escardó lem f g = + ( map-Cantor-Schröder-Bernstein-Escardó lem f g , + is-equiv-map-Cantor-Schröder-Bernstein-Escardó lem f g) ``` ## Corollaries diff --git a/src/foundation/cantors-theorem.lagda.md b/src/foundation/cantors-theorem.lagda.md index a00b09caeb..05959a1db9 100644 --- a/src/foundation/cantors-theorem.lagda.md +++ b/src/foundation/cantors-theorem.lagda.md @@ -11,6 +11,7 @@ open import foundation.action-on-identifications-functions open import foundation.decidable-propositions open import foundation.decidable-subtypes open import foundation.dependent-pair-types +open import foundation.double-negation-stable-propositions open import foundation.function-extensionality open import foundation.logical-equivalences open import foundation.negation @@ -22,6 +23,10 @@ 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-stable-subtypes ``` @@ -110,6 +115,62 @@ module _ ( not-in-image-map-theorem-decidable-Cantor) ``` +### Cantor's theorem for the set of double negation stable subtypes + +```agda +module _ + {l1 l2 : Level} {X : UU l1} (f : X → double-negation-stable-subtype l2 X) + where + + map-theorem-double-negation-stable-Cantor : + double-negation-stable-subtype l2 X + map-theorem-double-negation-stable-Cantor x = + neg-Double-Negation-Stable-Prop (f x x) + + abstract + not-in-image-map-theorem-double-negation-stable-Cantor : + ¬ (fiber f map-theorem-double-negation-stable-Cantor) + not-in-image-map-theorem-double-negation-stable-Cantor (x , α) = + no-fixed-points-neg-Double-Negation-Stable-Prop + ( 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) +``` + +### Cantor's theorem for the set of de morgan subtypes + +```agda +module _ + {l1 l2 : Level} {X : UU l1} (f : X → de-morgan-subtype l2 X) + where + + map-theorem-de-morgan-Cantor : de-morgan-subtype l2 X + map-theorem-de-morgan-Cantor x = neg-De-Morgan-Prop (f x x) + + abstract + not-in-image-map-theorem-de-morgan-Cantor : + ¬ (fiber f map-theorem-de-morgan-Cantor) + not-in-image-map-theorem-de-morgan-Cantor (x , α) = + no-fixed-points-neg-De-Morgan-Prop + ( 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) +``` + ## References A proof of Cantor's theorem first appeared in {{#cite Cantor1890/91}} where it diff --git a/src/foundation/complements-subtypes.lagda.md b/src/foundation/complements-subtypes.lagda.md index f105addb16..7c538522ec 100644 --- a/src/foundation/complements-subtypes.lagda.md +++ b/src/foundation/complements-subtypes.lagda.md @@ -9,22 +9,37 @@ module foundation.complements-subtypes where ```agda open import foundation.decidable-propositions open import foundation.decidable-subtypes +open import foundation.double-negation-stable-propositions open import foundation.full-subtypes open import foundation.negation +open import foundation.postcomposition-functions +open import foundation.powersets open import foundation.propositional-truncations open import foundation.unions-subtypes open import foundation.universe-levels open import foundation-core.function-types open import foundation-core.subtypes + +open import logic.double-negation-stable-subtypes + +open import order-theory.large-posets +open import order-theory.opposite-large-posets +open import order-theory.order-preserving-maps-large-posets +open import order-theory.order-preserving-maps-large-preorders +open import order-theory.order-preserving-maps-posets +open import order-theory.order-preserving-maps-preorders +open import order-theory.posets ``` ## Idea -The **complement** of a [subtype](foundation-core.subtypes.md) `P` of `A` -consists of the elements that are not in `P`. +The +{{#concept "complement" Disambiguation="of a subtype" Agda=complement-subtype}} +of a [subtype](foundation-core.subtypes.md) `P ⊆ A` consists of the elements +that are not in `P`. ## Definition @@ -36,45 +51,29 @@ complement-subtype : complement-subtype P x = neg-Prop (P x) ``` -### Complements of decidable subtypes +## Properties + +### Complements of subtypes are double negation stable ```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) +complement-double-negation-stable-subtype' : + {l1 l2 : Level} {A : UU l1} → + subtype l2 A → double-negation-stable-subtype l2 A +complement-double-negation-stable-subtype' P x = + neg-type-Double-Negation-Stable-Prop (is-in-subtype P x) ``` -## Properties - -### The union of a subtype `P` with its complement is the full subtype if and only if `P` is a decidable subtype +### Taking complements gives a contravariant endooperator on the powerset posets ```agda -module _ - {l1 l2 : Level} {A : UU l1} - where - - is-full-union-subtype-complement-subtype : - (P : subtype l2 A) → is-decidable-subtype P → - is-full-subtype (union-subtype P (complement-subtype P)) - is-full-union-subtype-complement-subtype P d x = - unit-trunc-Prop (d x) - - is-decidable-subtype-is-full-union-subtype-complement-subtype : - (P : subtype l2 A) → - is-full-subtype (union-subtype P (complement-subtype P)) → - is-decidable-subtype P - is-decidable-subtype-is-full-union-subtype-complement-subtype P H x = - apply-universal-property-trunc-Prop - ( H x) - ( is-decidable-Prop (P x)) - ( id) - - is-full-union-subtype-complement-decidable-subtype : - (P : decidable-subtype l2 A) → - is-full-decidable-subtype - ( union-decidable-subtype P (complement-decidable-subtype P)) - is-full-union-subtype-complement-decidable-subtype P = - is-full-union-subtype-complement-subtype - ( subtype-decidable-subtype P) - ( is-decidable-decidable-subtype P) +neg-hom-powerset : + {l1 : Level} {A : UU l1} → + hom-Large-Poset + ( λ l → l) + ( powerset-Large-Poset A) + ( opposite-Large-Poset (powerset-Large-Poset A)) +neg-hom-powerset = + make-hom-Large-Preorder + ( λ P x → neg-Prop (P x)) + ( λ P Q f x → map-neg (f x)) ``` diff --git a/src/foundation/constructive-cantor-schroder-bernstein.lagda.md b/src/foundation/constructive-cantor-schroder-bernstein.lagda.md new file mode 100644 index 0000000000..77841b756b --- /dev/null +++ b/src/foundation/constructive-cantor-schroder-bernstein.lagda.md @@ -0,0 +1,367 @@ +# The constructive Cantor–Schröder–Bernstein theorem + +```agda +module foundation.constructive-cantor-schroder-bernstein where +``` + +
Imports + +```agda +open import foundation.action-on-identifications-functions +open import foundation.complements-subtypes +open import foundation.decidable-embeddings +open import foundation.decidable-maps +open import foundation.decidable-propositions +open import foundation.decidable-subtypes +open import foundation.decidable-types +open import foundation.dependent-pair-types +open import foundation.fixed-points-endofunctions +open import foundation.function-extensionality +open import foundation.function-types +open import foundation.images-embeddings +open import foundation.injective-maps +open import foundation.negation +open import foundation.perfect-images +open import foundation.powersets +open import foundation.propositional-maps +open import foundation.propositional-resizing +open import foundation.split-surjective-maps +open import foundation.transport-along-identifications +open import foundation.universe-levels + +open import foundation-core.coproduct-types +open import foundation-core.embeddings +open import foundation-core.empty-types +open import foundation-core.equivalences +open import foundation-core.fibers-of-maps +open import foundation-core.identity-types +open import foundation-core.sets + +open import logic.de-morgan-maps +open import logic.double-negation-stable-embeddings + +open import order-theory.inflattices +open import order-theory.knaster-tarski-fixed-point-theorem +open import order-theory.opposite-large-posets +open import order-theory.order-preserving-maps-large-posets +open import order-theory.order-preserving-maps-posets +open import order-theory.resizing-suplattices +open import order-theory.suplattices +``` + +
+ +## Idea + +We consider a constructive refinement of the Cantor–Schröder–Bernstein theorem. + +The Cantor–Schröder–Bernstein theorem asserts that, assuming +[the law of excluded middle](foundation.law-of-excluded-middle.md), every pair +of mutually [embedding](foundation-core.embeddings.md) types `f : X ↪ Y` and +`g : Y ↪ X` are equivalent. Here, we generalize this statement by dropping the +assumption of the law of excluded middle, and rather considering embeddings that +satisfy certain computability assumptions. + +## Statement + +```agda +statement-constructive-Cantor-Schröder-Bernstein : + (l1 l2 : Level) → UU (lsuc (l1 ⊔ l2)) +statement-constructive-Cantor-Schröder-Bernstein l1 l2 = + {X : UU l1} {Y : UU l2} → (X ↪ᵈ Y) → (Y ↪ᵈ X) → X ≃ Y +``` + +## Proof + +**Proof.** Let us begin by assuming we have two arbitrary embeddings `f : X ↪ Y` +and `g : Y ↪ X`. In general, these need not be equivalences, so we need to find +a "correction" so that we are left with a pair of mutual inverses. + +We will proceed by finding a pair of subtypes that are left fixed by a roundtrip +around taking direct images of `f` and `g` and their complements. + +If we begin by considering the entirety of `X` and taking its direct image under +`f`, we are left with a subtype of `Y` that need not be full. By translating to +the complement, we have a measure of "everything that `f` does not hit". +`Y\f(X)`. + +```text + X Y + _______ _______ + / \ / \ + / \ / \ + | | f | | + | | --------> | f(X) | + |~~~~~~~~~~~| | | + | | g |~~~~~~~~~~~| <-?- Y\(f(X) ∪ Y\f(X)) + | g(Y\f(X)) | <-------- | | + | | | Y\f(X) | + \ / \ / + \_______/ \_______/ +``` + +Using an appropriate fixed point theorem, such as the Knaster–Tarski fixed point +theorem, or Kleene's fixed point theorem, we may deduce that at some point this +operation stabilizes, giving us a subtype `S ⊆ X` such that + +```text + X\g(Y\f(S)) = S. +``` + +```text + X Y + _______ _______ + / \ / f(S) \ + / \ /~~~~~~~~~\ <--- "Y\(f(S) ∪ Y\f(S))" + | | f | | + | | --------> | | + | | | | + | | g | | + | | <-------- | | + | | | | + \~~~~~~~~~/ \ / + \___S___/ \_______/ +``` + +Dually, we also have a least fixed point `T` of the endooperator + +```text + B ↦ Y\(f(X\g(B))) +``` + +But this gives us two further fixed points + +```text + Y\f(X\g(Y\f(S))) = Y\f(S) and X\g(Y\f(X\g(T))) = X\g(T) +``` + +So if `S` and `T` are greatest fixed points, we have + +```text + X\g(T) ⊆ S and Y\f(S) ⊆ T +``` + +If `g` is double negation stable we also have the equality + +```text + g(Y\f(S)) = X\S. +``` + +Since `f` and `g` are embeddings, this gives us inverse maps `g⁻¹ : X\S → Y` and +`f⁻¹ : Y\T → X`. Now, if `S` and `f(S)` were decidable subtypes, we could define +a new total map `h : X → Y` by + +```text + h(x) = f (x) if x ∈ S + h(x) = g⁻¹(x) if x ∉ S +``` + +and a converse map + +```text + h⁻¹(x) = f⁻¹(x) if x ∈ f(S) + h⁻¹(x) = g (x) if x ∉ f(S). +``` + +Here we're not using the existence of `T` at all, nor that `S` is a greatest +fixed point or that `g` satisfies decidability, only double negation stability. +However, to show that `h⁻¹` is a right inverse of `h` on `Y\f(S)`, we need +decidability of `g` as well. + +```agda +module _ + {l1 l2 : Level} {X : UU l1} {Y : UU l2} (f : X ↪ Y) + where + + hom-half-way-powerset-Cantor-Schröder-Bernstein : + hom-Large-Poset (λ l3 → l1 ⊔ l2 ⊔ l3) + ( powerset-Large-Poset X) + ( opposite-Large-Poset (powerset-Large-Poset Y)) + hom-half-way-powerset-Cantor-Schröder-Bernstein = + comp-hom-Large-Poset + ( powerset-Large-Poset X) + ( powerset-Large-Poset Y) + ( opposite-Large-Poset (powerset-Large-Poset Y)) + ( neg-hom-powerset) + ( direct-image-hom-emb-powerset f) + +module _ + {l1 l2 : Level} {X : UU l1} {Y : UU l2} (f : X ↪ Y) (g : Y ↪ X) + where + + hom-large-powerset-Cantor-Schröder-Bernstein : + hom-Large-Poset + ( λ l3 → l1 ⊔ l2 ⊔ l3) + ( powerset-Large-Poset X) + ( powerset-Large-Poset X) + hom-large-powerset-Cantor-Schröder-Bernstein = + comp-hom-Large-Poset + ( powerset-Large-Poset X) + ( opposite-Large-Poset (powerset-Large-Poset Y)) + ( powerset-Large-Poset X) + ( opposite-hom-Large-Poset + { P = powerset-Large-Poset Y} + { opposite-Large-Poset (powerset-Large-Poset X)} + ( hom-half-way-powerset-Cantor-Schröder-Bernstein g)) + ( hom-half-way-powerset-Cantor-Schröder-Bernstein f) + + hom-powerset-Cantor-Schröder-Bernstein : + hom-Poset + ( powerset-Poset (l1 ⊔ l2) X) + ( powerset-Poset (l1 ⊔ l2) X) + hom-powerset-Cantor-Schröder-Bernstein = + hom-poset-hom-Large-Poset + ( powerset-Large-Poset X) + ( powerset-Large-Poset X) + ( hom-large-powerset-Cantor-Schröder-Bernstein) + ( l1 ⊔ l2) +``` + +### Impredicative proof using the Knaster–Tarski fixed point theorem + +```agda +module _ + {l1 l2 : Level} + (resize-prop : propositional-resizing-Level (l1 ⊔ l2) (l1 ⊔ l2)) + {X : UU l1} {Y : UU l2} (f : X ↪ Y) (g : Y ↪ X) + where + + fixed-point-domain-Cantor-Schröder-Bernstein : + fixed-point + ( map-hom-Poset + ( powerset-Poset (l1 ⊔ l2) X) + ( powerset-Poset (l1 ⊔ l2) X) + ( hom-powerset-Cantor-Schröder-Bernstein f g)) + fixed-point-domain-Cantor-Schröder-Bernstein = + fixed-point-knaster-tarski-Suplattice {! !} {! !} {! !} + -- ( resize-type-Suplattice + -- ( powerset-Suplattice X {! l1 ⊔ l2 !} lzero) + -- {! !}) + -- {! hom-powerset-Cantor-Schröder-Bernstein f g !} + -- {! !} + + -- ( resize-type-Suplattice (powerset-Suplattice X {! !} {! !}) {! !}) {! !} {! !} +``` + +Since the fixed point is an image of `g` by double negation stability, it must +be decidable. + +```agda +module _ + {l1 l2 : Level} {X : UU l1} {Y : UU l2} (f : X ↪ Y) (g : Y ↪ X) + (S : + fixed-point + ( map-hom-Poset + ( powerset-Poset (l1 ⊔ l2) X) + ( powerset-Poset (l1 ⊔ l2) X) + ( hom-powerset-Cantor-Schröder-Bernstein f g))) + where + + is-decidable-subtype-fixed-point-Cantor-Schröder-Bernstein : + is-decidable-map (map-emb f) → + is-de-morgan-map (map-emb g) → + is-decidable-subtype (pr1 S) + is-decidable-subtype-fixed-point-Cantor-Schröder-Bernstein F G x = + tr is-decidable (ap pr1 (htpy-eq (pr2 S) x)) + ( rec-coproduct + ( λ ngx → inl (ngx ∘ pr1)) + ( λ nngx → rec-coproduct {! !} {! !} (F {! !})) + ( G x)) + + is-decidable-subtype-fixed-point-Cantor-Schröder-Bernstein' : + is-decidable-map (map-emb f) → + is-decidable-map (map-emb g) → + is-decidable-subtype (pr1 S) + is-decidable-subtype-fixed-point-Cantor-Schröder-Bernstein' F G x = + tr is-decidable (ap pr1 (htpy-eq (pr2 S) x)) + ( rec-coproduct + ( λ gx → + rec-coproduct + (λ fx → inr λ h → h (gx , {! !})) + (λ nfgx → {! !}) + ( F (pr1 gx))) + ( λ ngx → inl (ngx ∘ pr1)) + ( G x)) + + -- is-decidable-subtype-fixed-point-Cantor-Schröder-Bernstein' : + -- is-decidable-map (map-emb g) → + -- is-decidable-subtype (pr1 S) + -- is-decidable-subtype-fixed-point-Cantor-Schröder-Bernstein' G x with (G x) + -- ... | inl y = tr is-decidable (ap pr1 (htpy-eq (pr2 S) x)) (inr λ np → np (y , λ h → {! !})) + -- ... | inr y = tr is-decidable (ap pr1 (htpy-eq (pr2 S) x)) (inl (y ∘ pr1)) + -- tr is-decidable (ap pr1 (htpy-eq (pr2 S) x)) ({! !}) +``` + +We can define mutual inverse maps from the given fixed point. For the inverse +map we need decidability of `f` and `g`. + +```text +module _ + {l1 l2 : Level} {X : UU l1} {Y : UU l2} (f : X ↪ᵈ Y) (g : Y ↪ᵈ X) + (S : + fixed-point + ( map-hom-Poset + ( powerset-Poset (l1 ⊔ l2) X) + ( powerset-Poset (l1 ⊔ l2) X) + ( hom-small-powerset-Cantor-Schröder-Bernstein f g (l1 ⊔ l2)))) + where + + map-inv-impredicative-Cantor-Schröder-Bernstein : Y → X + map-inv-impredicative-Cantor-Schröder-Bernstein = ? + + is-section-map-inv-impredicative-Cantor-Schröder-Bernstein : + is-section + map-impredicative-Cantor-Schröder-Bernstein + map-inv-impredicative-Cantor-Schröder-Bernstein + + is-retraction-map-inv-impredicative-Cantor-Schröder-Bernstein : + is-retraction + map-impredicative-Cantor-Schröder-Bernstein + map-inv-impredicative-Cantor-Schröder-Bernstein + + is-equiv-map-impredicative-Cantor-Schröder-Bernstein : + is-equiv map-impredicative-Cantor-Schröder-Bernstein + is-equiv-map-impredicative-Cantor-Schröder-Bernstein = + is-equiv-is-invertible + map-inv-impredicative-Cantor-Schröder-Bernstein + is-section-map-inv-impredicative-Cantor-Schröder-Bernstein + is-retraction-map-inv-impredicative-Cantor-Schröder-Bernstein +``` + +### Proof using Kleene's fixed point theorem + +Assuming that `g` is a De Morgan embedding, the operator +`¬X\g(Y\f(-)) : 𝒫(X) → 𝒫(X)` is ω-continuous: + +```text + X\g(Y\f(⋃ᵢUᵢ)) = X\g(Y\(⋃ᵢfᵢ(Uᵢ))) unions commute with images + = X\g(⋂ᵢY\f(Uᵢ)) constructively valid De Morgan law + = X\(⋂ᵢg(Y\f(Uᵢ))) meets commute with images + = ⋃ᵢ(X\g(Y\f(Uᵢ))) g is De Morgan -- ? +``` + +The final step is not automatic. In fact, if we were not to consider that +`U ⊆ X\g(Y\f(U))`, this would be equivalent to +[Markov's principle](logic.markovs-principle.md). + +Let us consider it in more detail. Let `Pᵢ` be a countable family of +propositions such that `Pᵢ ⇒ Pᵢ₊₁`. Then `∃ i (¬ Pᵢ) ⇒ ¬ (∀ i, Pᵢ)`. If `Pᵢ` are +De Morgan + +Kleene's fixed point theorem then states that, given a starting point +`U : 𝒫(X)`, the sequence + +```text + ⋃(n : ℕ), (X\gY\f)ⁿ(U) +``` + +converges to a fixed point `S` of the operator. + +Now, again since `g` is De Morgan, every subtype of `Y` gives a decomposition of +`X`, in particular, applying it to `S`: + +```text + X ≅ X\g(Y\f(S)) ∪ X\X\g(Y\f(S)) = S ∪ X\S. +``` + +In other words, `S` is a decidable subtype of `X`. diff --git a/src/foundation/coproduct-decompositions-subuniverse.lagda.md b/src/foundation/coproduct-decompositions-subuniverse.lagda.md index 1662dfbdc9..3d8495b9a1 100644 --- a/src/foundation/coproduct-decompositions-subuniverse.lagda.md +++ b/src/foundation/coproduct-decompositions-subuniverse.lagda.md @@ -503,7 +503,7 @@ module _ eq-pair-Σ ( eq-pair-Σ ( eq-equiv (equiv-is-empty is-empty-raise-empty (pr2 x))) - ( eq-is-prop (is-prop-type-Prop (P _)))) + ( eq-type-Prop (P _))) ( eq-is-prop is-property-is-empty))) ( ( raise-empty l1 , C1) , is-empty-raise-empty)) ∘e ( ( inv-associative-Σ _ _ _) ∘e diff --git a/src/foundation/decidable-dependent-function-types.lagda.md b/src/foundation/decidable-dependent-function-types.lagda.md index f0045ab035..3cd5d80d2b 100644 --- a/src/foundation/decidable-dependent-function-types.lagda.md +++ b/src/foundation/decidable-dependent-function-types.lagda.md @@ -15,14 +15,37 @@ open import foundation.universal-property-maybe open import foundation.universe-levels 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 ``` ## Idea -We describe conditions under which dependent products are decidable. +We describe conditions under which +[dependent function types](foundation.dependent-function-types.md) are +[decidable](foundation.decidable-types.md). + +## Properties + +### Decidability of dependent products of uniformly decidable families + +```agda +is-decidable-Π-uniformly-decidable-family : + {l1 l2 : Level} {A : UU l1} {B : A → UU l2} → + is-decidable A → + (((a : A) → B a) + ((a : A) → ¬ (B a))) → + is-decidable ((a : A) → (B a)) +is-decidable-Π-uniformly-decidable-family (inl a) (inl b) = + inl b +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) +``` ### Decidablitilty of dependent products over coproducts @@ -42,7 +65,8 @@ is-decidable-Π-coproduct {C = C} dA dB = ```agda is-decidable-Π-Maybe : {l1 l2 : Level} {A : UU l1} {B : Maybe A → UU l2} → - is-decidable ((x : A) → B (unit-Maybe x)) → is-decidable (B exception-Maybe) → + is-decidable ((x : A) → B (unit-Maybe x)) → + is-decidable (B exception-Maybe) → is-decidable ((x : Maybe A) → B x) is-decidable-Π-Maybe {B = B} du de = is-decidable-equiv diff --git a/src/foundation/decidable-dependent-pair-types.lagda.md b/src/foundation/decidable-dependent-pair-types.lagda.md index 1632117634..fdd0736644 100644 --- a/src/foundation/decidable-dependent-pair-types.lagda.md +++ b/src/foundation/decidable-dependent-pair-types.lagda.md @@ -18,24 +18,49 @@ open import foundation-core.coproduct-types open import foundation-core.equivalences open import foundation-core.function-types open import foundation-core.functoriality-dependent-pair-types +open import foundation-core.negation ``` ## Idea -We describe conditions under which dependent sums are decidable. +We describe conditions under which +[dependent sums](foundation.dependent-pair-types.md) are +[decidable](foundation.decidable-types.md) + +## Properites + +### Dependent sums of a uniformly decidable family of types + +```agda +is-decidable-Σ-uniformly-decidable-family : + {l1 l2 : Level} {A : UU l1} {B : A → UU l2} → + is-decidable A → (((a : A) → B a) + ((a : A) → ¬ B a)) → is-decidable (Σ A B) +is-decidable-Σ-uniformly-decidable-family (inl a) (inl b) = + inl (a , b a) +is-decidable-Σ-uniformly-decidable-family (inl a) (inr b) = + inr (λ x → b (pr1 x) (pr2 x)) +is-decidable-Σ-uniformly-decidable-family (inr a) _ = + inr (λ x → a (pr1 x)) +``` + +### Decidability of dependent sums over coproducts ```agda is-decidable-Σ-coproduct : {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} (C : A + B → UU l3) → is-decidable (Σ A (C ∘ inl)) → is-decidable (Σ B (C ∘ inr)) → is-decidable (Σ (A + B) C) -is-decidable-Σ-coproduct {l1} {l2} {l3} {A} {B} C dA dB = +is-decidable-Σ-coproduct {A = A} {B} C dA dB = is-decidable-equiv ( right-distributive-Σ-coproduct A B C) ( is-decidable-coproduct dA dB) +``` + +### Decidability of dependent sums over `Maybe` +```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) → @@ -45,7 +70,11 @@ is-decidable-Σ-Maybe {l1} {l2} {A} {B} dA de = ( is-decidable-equiv ( left-unit-law-Σ (B ∘ inr)) ( de)) +``` + +### Decidability of dependent sums over equivalences +```agda is-decidable-Σ-equiv : {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)) → diff --git a/src/foundation/decidable-embeddings.lagda.md b/src/foundation/decidable-embeddings.lagda.md index fc452b45c0..f968a58978 100644 --- a/src/foundation/decidable-embeddings.lagda.md +++ b/src/foundation/decidable-embeddings.lagda.md @@ -14,6 +14,7 @@ open import foundation.decidable-propositions open import foundation.decidable-types open import foundation.dependent-pair-types open import foundation.embeddings +open import foundation.fibers-of-maps open import foundation.functoriality-cartesian-product-types open import foundation.functoriality-coproduct-types open import foundation.fundamental-theorem-of-identity-types @@ -21,9 +22,11 @@ open import foundation.homotopy-induction open import foundation.identity-types open import foundation.logical-equivalences 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 @@ -31,12 +34,10 @@ 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.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.propositions open import foundation-core.torsorial-type-families ``` @@ -64,35 +65,49 @@ is-decidable-emb : {l1 l2 : Level} {X : UU l1} {Y : UU l2} → (X → Y) → UU (l1 ⊔ l2) is-decidable-emb f = is-emb f × is-decidable-map f -abstract - is-emb-is-decidable-emb : - {l1 l2 : Level} {X : UU l1} {Y : UU l2} {f : X → Y} → - is-decidable-emb f → is-emb f - is-emb-is-decidable-emb = pr1 +is-emb-is-decidable-emb : + {l1 l2 : Level} {X : UU l1} {Y : UU l2} {f : X → Y} → + is-decidable-emb f → is-emb f +is-emb-is-decidable-emb = pr1 is-decidable-map-is-decidable-emb : {l1 l2 : Level} {X : UU l1} {Y : UU l2} {f : X → Y} → is-decidable-emb f → is-decidable-map f is-decidable-map-is-decidable-emb = pr2 + +is-injective-is-decidable-emb : + {l1 l2 : Level} {X : UU l1} {Y : UU l2} {f : X → Y} → + is-decidable-emb f → is-injective f +is-injective-is-decidable-emb = is-injective-is-emb ∘ is-emb-is-decidable-emb ``` ### Decidably propositional maps ```agda -is-decidable-prop-map : - {l1 l2 : Level} {X : UU l1} {Y : UU l2} → (X → Y) → UU (l1 ⊔ l2) -is-decidable-prop-map {Y = Y} f = (y : Y) → is-decidable-prop (fiber f y) +module _ + {l1 l2 : Level} {X : UU l1} {Y : UU l2} + where -abstract - is-prop-map-is-decidable-prop-map : - {l1 l2 : Level} {X : UU l1} {Y : UU l2} {f : X → Y} → - is-decidable-prop-map f → is-prop-map f - is-prop-map-is-decidable-prop-map H y = pr1 (H y) + is-decidable-prop-map : (X → Y) → UU (l1 ⊔ l2) + is-decidable-prop-map f = (y : Y) → is-decidable-prop (fiber f y) -is-decidable-map-is-decidable-prop-map : - {l1 l2 : Level} {X : UU l1} {Y : UU l2} {f : X → Y} → - is-decidable-prop-map f → is-decidable-map f -is-decidable-map-is-decidable-prop-map H y = pr2 (H y) + is-prop-is-decidable-prop-map : + (f : X → Y) → is-prop (is-decidable-prop-map f) + is-prop-is-decidable-prop-map f = + is-prop-Π (λ y → is-prop-is-decidable-prop (fiber f y)) + + is-decidable-prop-map-Prop : (X → Y) → Prop (l1 ⊔ l2) + is-decidable-prop-map-Prop f = + ( is-decidable-prop-map f , is-prop-is-decidable-prop-map f) + + abstract + is-prop-map-is-decidable-prop-map : + {f : X → Y} → is-decidable-prop-map f → is-prop-map f + is-prop-map-is-decidable-prop-map H y = pr1 (H y) + + is-decidable-map-is-decidable-prop-map : + {f : X → Y} → is-decidable-prop-map f → is-decidable-map f + is-decidable-map-is-decidable-prop-map H y = pr2 (H y) ``` ### The type of decidable embeddings @@ -135,17 +150,6 @@ pr2 (emb-decidable-emb e) = is-emb-map-decidable-emb e ## Properties -### Being a decidably propositional map is a proposition - -```agda -abstract - is-prop-is-decidable-prop-map : - {l1 l2 : Level} {X : UU l1} {Y : UU l2} (f : X → Y) → - is-prop (is-decidable-prop-map f) - is-prop-is-decidable-prop-map f = - is-prop-Π (λ y → is-prop-is-decidable-prop (fiber f y)) -``` - ### Any map of which the fibers are decidable propositions is a decidable embedding ```agda @@ -175,6 +179,26 @@ module _ is-decidable-map-is-decidable-emb H y ``` +### The first projection map of a dependent sum of decidable propositions is a decidable embedding + +```agda +module _ + {l1 l2 : Level} {A : UU l1} (Q : A → Decidable-Prop l2) + where + + is-decidable-prop-map-pr1 : + is-decidable-prop-map (pr1 {B = type-Decidable-Prop ∘ Q}) + is-decidable-prop-map-pr1 y = + is-decidable-prop-equiv + ( equiv-fiber-pr1 (type-Decidable-Prop ∘ Q) y) + ( is-decidable-prop-type-Decidable-Prop (Q y)) + + is-decidable-emb-pr1 : + is-decidable-emb (pr1 {B = type-Decidable-Prop ∘ Q}) + is-decidable-emb-pr1 = + is-decidable-emb-is-decidable-prop-map is-decidable-prop-map-pr1 +``` + ### Equivalences are decidable embeddings ```agda @@ -189,13 +213,16 @@ abstract ### Identity maps are decidable embeddings ```agda -abstract - is-decidable-emb-id : - {l1 : Level} {A : UU l1} → is-decidable-emb (id {A = A}) - is-decidable-emb-id = (is-emb-id , is-decidable-map-id) +is-decidable-emb-id : + {l : Level} {A : UU l} → is-decidable-emb (id {A = A}) +is-decidable-emb-id = (is-emb-id , is-decidable-map-id) -decidable-emb-id : {l1 : Level} {A : UU l1} → A ↪ᵈ A +decidable-emb-id : {l : Level} {A : UU l} → A ↪ᵈ A decidable-emb-id = (id , is-decidable-emb-id) + +is-decidable-prop-map-id : + {l : Level} {A : UU l} → is-decidable-prop-map (id {A = A}) +is-decidable-prop-map-id y = is-decidable-prop-is-contr (is-torsorial-Id' y) ``` ### Being a decidable embedding is a property @@ -214,6 +241,18 @@ abstract ( λ y → is-prop-is-decidable (is-prop-map-is-emb (pr1 H) y)))) ``` +### Decidable embeddings are closed under homotopies + +```agda +abstract + is-decidable-emb-htpy : + {l1 l2 : Level} {A : UU l1} {B : UU l2} {f g : A → B} → + f ~ g → is-decidable-emb g → is-decidable-emb f + is-decidable-emb-htpy {f = f} {g} H K = + ( is-emb-htpy H (is-emb-is-decidable-emb K) , + is-decidable-map-htpy H (is-decidable-map-is-decidable-emb K)) +``` + ### Decidable embeddings are closed under composition ```agda @@ -225,18 +264,10 @@ module _ abstract is-decidable-map-comp-is-decidable-emb' : is-decidable-emb g → is-decidable-map f → is-decidable-map (g ∘ f) - is-decidable-map-comp-is-decidable-emb' K H x = - rec-coproduct - ( λ u → - is-decidable-equiv - ( ( left-unit-law-Σ-is-contr - ( is-proof-irrelevant-is-prop - ( is-prop-map-is-emb (is-emb-is-decidable-emb K) x) u) - ( u)) ∘e - ( compute-fiber-comp g f x)) - ( H (pr1 u))) - ( λ α → inr (λ t → α (f (pr1 t) , pr2 t))) - ( is-decidable-map-is-decidable-emb K x) + is-decidable-map-comp-is-decidable-emb' K = + is-decidable-map-comp + ( is-injective-is-decidable-emb K) + ( is-decidable-map-is-decidable-emb K) is-decidable-map-comp-is-decidable-emb : is-decidable-emb g → is-decidable-emb f → is-decidable-map (g ∘ f) @@ -250,6 +281,29 @@ module _ is-decidable-emb-comp K H = ( is-emb-comp _ _ (pr1 K) (pr1 H) , is-decidable-map-comp-is-decidable-emb K H) + + abstract + is-decidable-prop-map-comp : + is-decidable-prop-map g → + is-decidable-prop-map f → + is-decidable-prop-map (g ∘ f) + is-decidable-prop-map-comp K H = + is-decidable-prop-map-is-decidable-emb + ( is-decidable-emb-comp + ( is-decidable-emb-is-decidable-prop-map K) + ( is-decidable-emb-is-decidable-prop-map H)) + +comp-decidable-emb : + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} → + B ↪ᵈ C → A ↪ᵈ B → A ↪ᵈ C +comp-decidable-emb (g , G) (f , F) = + ( g ∘ f , is-decidable-emb-comp G F) + +infixr 15 _∘ᵈ_ +_∘ᵈ_ : + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} → + B ↪ᵈ C → A ↪ᵈ B → A ↪ᵈ C +_∘ᵈ_ = comp-decidable-emb ``` ### Left cancellation for decidable embeddings @@ -273,18 +327,6 @@ module _ is-decidable-emb-right-factor' GH (is-emb-is-decidable-emb G) ``` -### Decidable embeddings are closed under homotopies - -```agda -abstract - is-decidable-emb-htpy : - {l1 l2 : Level} {A : UU l1} {B : UU l2} {f g : A → B} → - f ~ g → is-decidable-emb g → is-decidable-emb f - is-decidable-emb-htpy {f = f} {g} H K = - ( is-emb-htpy H (is-emb-is-decidable-emb K) , - is-decidable-map-htpy H (is-decidable-map-is-decidable-emb K)) -``` - ### In a commuting triangle of maps, if the top and right maps are decidable embeddings so is the left map ```agda @@ -360,9 +402,9 @@ abstract ( htpy-eq-decidable-emb f) eq-htpy-decidable-emb : - {l1 l2 : Level} {A : UU l1} {B : UU l2} {f g : A ↪ᵈ B} → + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f g : A ↪ᵈ B) → htpy-decidable-emb f g → f = g -eq-htpy-decidable-emb {f = f} {g} = +eq-htpy-decidable-emb f g = map-inv-is-equiv (is-equiv-htpy-eq-decidable-emb f g) ``` @@ -561,3 +603,45 @@ module _ ( is-decidable-prop-map-retract-map R ( is-decidable-prop-map-is-decidable-emb G)) ``` + +### A type is a decidable proposition if and only if its terminal map is a decidable embedding + +```agda +module _ + {l : Level} {A : UU l} + where + + is-decidable-prop-is-decidable-emb-terminal-map : + is-decidable-emb (terminal-map A) → is-decidable-prop A + is-decidable-prop-is-decidable-emb-terminal-map H = + is-decidable-prop-equiv' + ( equiv-fiber-terminal-map star) + ( is-decidable-prop-map-is-decidable-emb H star) + + is-decidable-emb-terminal-map-is-decidable-prop : + is-decidable-prop A → is-decidable-emb (terminal-map A) + is-decidable-emb-terminal-map-is-decidable-prop H = + is-decidable-emb-is-decidable-prop-map + ( λ y → is-decidable-prop-equiv (equiv-fiber-terminal-map y) H) +``` + +### If a dependent sum of propositions over a proposition is decidable, then the family is a family of decidable propositions + +```agda +module _ + {l1 l2 : Level} (P : Prop l1) (Q : type-Prop P → Prop l2) + where + + is-decidable-prop-family-is-decidable-Σ : + is-decidable (Σ (type-Prop P) (type-Prop ∘ Q)) → + (p : type-Prop P) → is-decidable (type-Prop (Q p)) + is-decidable-prop-family-is-decidable-Σ H p = + is-decidable-equiv' + ( equiv-fiber-pr1 (type-Prop ∘ Q) p) + ( is-decidable-map-is-decidable-emb + ( is-decidable-emb-right-factor' + ( is-decidable-emb-terminal-map-is-decidable-prop + ( is-prop-Σ (is-prop-type-Prop P) (is-prop-type-Prop ∘ Q) , H)) + ( is-emb-terminal-map-is-prop (is-prop-type-Prop P))) + ( p)) +``` diff --git a/src/foundation/decidable-maps.lagda.md b/src/foundation/decidable-maps.lagda.md index 893f11da73..e0b5a70178 100644 --- a/src/foundation/decidable-maps.lagda.md +++ b/src/foundation/decidable-maps.lagda.md @@ -29,17 +29,22 @@ open import foundation-core.functoriality-dependent-pair-types open import foundation-core.homotopies open import foundation-core.injective-maps open import foundation-core.retractions +open import foundation-core.sections ``` -## Definition +## Idea A [map](foundation-core.function-types.md) is said to be {{#concept "decidable" Disambiguation="map of types" Agda=is-decidable-map}} if its [fibers](foundation-core.fibers-of-maps.md) are [decidable types](foundation.decidable-types.md). +## Definition + +### The structure on a map of decidability + ```agda module _ {l1 l2 : Level} {A : UU l1} {B : UU l2} @@ -49,6 +54,17 @@ module _ is-decidable-map f = (y : B) → is-decidable (fiber f y) ``` +### The type of decidabile maps + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + decidable-map : UU (l1 ⊔ l2) + decidable-map = Σ (A → B) (is-decidable-map) +``` + ## Properties ### Decidable maps are closed under homotopy @@ -64,6 +80,31 @@ abstract ( K b) ``` +### Composition of decidable maps + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} + {g : B → C} {f : A → B} + where + + abstract + is-decidable-map-comp : + is-injective g → + is-decidable-map g → + is-decidable-map f → + is-decidable-map (g ∘ f) + is-decidable-map-comp H G F x = + rec-coproduct + ( λ u → + is-decidable-iff + ( λ v → (pr1 v) , ap g (pr2 v) ∙ pr2 u) + ( λ w → pr1 w , H (pr2 w ∙ inv (pr2 u))) + ( F (pr1 u))) + ( λ α → inr (λ t → α (f (pr1 t) , pr2 t))) + ( G x) +``` + ### Left cancellation for decidable maps If a composite `g ∘ f` is decidable and the left factor `g` is injective, then @@ -77,9 +118,11 @@ module _ abstract is-decidable-map-right-factor' : is-decidable-map (g ∘ f) → is-injective g → is-decidable-map f - is-decidable-map-right-factor' GF G y with (GF (g y)) - ... | inl q = inl (pr1 q , G (pr2 q)) - ... | inr q = inr (λ x → q ((pr1 x) , ap g (pr2 x))) + is-decidable-map-right-factor' GF G y = + rec-coproduct + ( λ q → inl (pr1 q , G (pr2 q))) + ( λ q → inr (λ x → q ((pr1 x) , ap g (pr2 x)))) + ( GF (g y)) ``` ### Retracts into types with decidable equality are decidable @@ -91,10 +134,19 @@ is-decidable-map-retraction : is-decidable-map-retraction d i (r , R) b = is-decidable-iff ( λ (p : i (r b) = b) → r b , p) - ( λ t → ap (i ∘ r) (inv (pr2 t)) ∙ (ap i (R (pr1 t)) ∙ pr2 t)) + ( λ t → ap (i ∘ r) (inv (pr2 t)) ∙ ap i (R (pr1 t)) ∙ pr2 t) ( d (i (r b)) b) ``` +### Maps with sections are decidable + +```agda +is-decidable-map-section : + {l1 l2 : Level} {A : UU l1} {B : UU l2} → + (i : A → B) → section i → is-decidable-map i +is-decidable-map-section i (s , S) b = inl (s b , S b) +``` + ### Any map out of the empty type is decidable ```agda diff --git a/src/foundation/decidable-propositions.lagda.md b/src/foundation/decidable-propositions.lagda.md index 4315eab9c8..c6c5bfb814 100644 --- a/src/foundation/decidable-propositions.lagda.md +++ b/src/foundation/decidable-propositions.lagda.md @@ -115,8 +115,7 @@ module _ is-retraction-map-inv-equiv-bool-Decidable-Prop' equiv-bool-Decidable-Prop' : - ((Σ (Prop l) type-Prop) + (Σ (Prop l) (λ Q → ¬ (type-Prop Q)))) ≃ - bool + ((Σ (Prop l) type-Prop) + (Σ (Prop l) (λ Q → ¬ (type-Prop Q)))) ≃ bool pr1 equiv-bool-Decidable-Prop' = map-equiv-bool-Decidable-Prop' pr2 equiv-bool-Decidable-Prop' = is-equiv-map-equiv-bool-Decidable-Prop' diff --git a/src/foundation/decidable-subtypes.lagda.md b/src/foundation/decidable-subtypes.lagda.md index 9a162ba9f7..1a274d55a1 100644 --- a/src/foundation/decidable-subtypes.lagda.md +++ b/src/foundation/decidable-subtypes.lagda.md @@ -36,6 +36,8 @@ open import foundation-core.propositions open import foundation-core.transport-along-identifications open import foundation-core.truncated-types open import foundation-core.truncation-levels + +open import logic.double-negation-stable-subtypes ``` @@ -227,6 +229,26 @@ module _ ( iff-universes-Decidable-Prop l l' (S x)) ``` +### Decidable subtypes are double negation stable + +```agda +is-double-negation-stable-decicable-subtype : + {l1 l2 : Level} {A : UU l1} (P : decidable-subtype l2 A) → + is-double-negation-stable-subtype (subtype-decidable-subtype P) +is-double-negation-stable-decicable-subtype P x = + double-negation-elim-is-decidable (is-decidable-decidable-subtype P x) +``` + +### Decidable subtypes are De Morgan + +```text +is-de-morgan-decicable-subtype : + {l1 l2 : Level} {A : UU l1} (P : decidable-subtype l2 A) → + is-de-morgan-subtype (subtype-decidable-subtype P) +is-de-morgan-decicable-subtype P x = + is-de-morgan-is-decidable (is-decidable-decidable-subtype P x) +``` + ### A decidable subtype of a `k+1`-truncated type is `k+1`-truncated ```agda diff --git a/src/foundation/decidable-types.lagda.md b/src/foundation/decidable-types.lagda.md index 2f34bdc31f..872b7120fa 100644 --- a/src/foundation/decidable-types.lagda.md +++ b/src/foundation/decidable-types.lagda.md @@ -14,6 +14,9 @@ open import foundation.empty-types open import foundation.hilberts-epsilon-operators open import foundation.logical-equivalences open import foundation.negation +open import foundation.retracts-of-types +open import foundation.equivalences +open import foundation.action-on-identifications-functions open import foundation.propositional-truncations open import foundation.raising-universe-levels open import foundation.type-arithmetic-empty-type @@ -22,6 +25,8 @@ open import foundation.universe-levels open import foundation-core.cartesian-product-types open import foundation-core.equivalences +open import foundation-core.sections +open import foundation-core.retractions open import foundation-core.function-types open import foundation-core.propositions open import foundation-core.retracts-of-types @@ -154,36 +159,6 @@ is-decidable-function-type' (inl a) d with d a is-decidable-function-type' (inr na) d = inl (ex-falso ∘ na) ``` -### Dependent sums of a uniformly decidable family of types over a decidable base is decidable - -```agda -is-decidable-Σ-uniformly-decidable-family : - {l1 l2 : Level} {A : UU l1} {B : A → UU l2} → - is-decidable A → (((a : A) → B a) + ((a : A) → ¬ B a)) → is-decidable (Σ A B) -is-decidable-Σ-uniformly-decidable-family (inl a) (inl b) = - inl (a , b a) -is-decidable-Σ-uniformly-decidable-family (inl a) (inr b) = - inr (λ x → b (pr1 x) (pr2 x)) -is-decidable-Σ-uniformly-decidable-family (inr a) _ = - inr (λ x → a (pr1 x)) -``` - -### Dependent products of uniformly decidable families over decidable bases are decidable - -```agda -is-decidable-Π-uniformly-decidable-family : - {l1 l2 : Level} {A : UU l1} {B : A → UU l2} → - is-decidable A → - (((a : A) → B a) + ((a : A) → ¬ (B a))) → - is-decidable ((a : A) → (B a)) -is-decidable-Π-uniformly-decidable-family (inl a) (inl b) = - inl b -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) -``` - ### The negation of a decidable type is decidable ```agda @@ -202,7 +177,18 @@ module _ is-decidable-iff : (A → B) → (B → A) → is-decidable A → is-decidable B is-decidable-iff f g (inl a) = inl (f a) - is-decidable-iff f g (inr na) = inr (λ b → na (g b)) + is-decidable-iff f g (inr na) = inr (na ∘ g) + + is-decidable-iff' : + A ↔ B → is-decidable A → is-decidable B + is-decidable-iff' (f , g) = is-decidable-iff f g + +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + iff-is-decidable : A ↔ B → is-decidable A ↔ is-decidable B + iff-is-decidable e = is-decidable-iff' e , is-decidable-iff' (inv-iff e) ``` ### Decidable types are closed under retracts @@ -214,26 +200,66 @@ module _ is-decidable-retract-of : A retract-of B → is-decidable B → is-decidable A - is-decidable-retract-of (pair i (pair r H)) (inl b) = inl (r b) - is-decidable-retract-of (pair i (pair r H)) (inr f) = inr (f ∘ i) + is-decidable-retract-of R = is-decidable-iff' (iff-retract' R) ``` ### Decidable types are closed under equivalences ```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + is-decidable-is-equiv : {f : A → B} → is-equiv f → is-decidable B → is-decidable A - is-decidable-is-equiv {f} (pair (pair g G) (pair h H)) = - is-decidable-retract-of (pair f (pair h H)) + is-decidable-is-equiv {f} H = + is-decidable-retract-of (retract-equiv (f , H)) is-decidable-equiv : - (e : A ≃ B) → is-decidable B → is-decidable A + A ≃ B → is-decidable B → is-decidable A is-decidable-equiv e = is-decidable-iff (map-inv-equiv e) (map-equiv e) -is-decidable-equiv' : - {l1 l2 : Level} {A : UU l1} {B : UU l2} (e : A ≃ B) → - is-decidable A → is-decidable B -is-decidable-equiv' e = is-decidable-equiv (inv-equiv e) + is-decidable-equiv' : + A ≃ B → is-decidable A → is-decidable B + is-decidable-equiv' e = is-decidable-iff (map-equiv e) (map-inv-equiv e) +``` + +### Equivalent types have equivalent decidability predicates + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} (e : A ≃ B) + where + + map-equiv-is-decidable : is-decidable A → is-decidable B + map-equiv-is-decidable = is-decidable-equiv' e + + map-inv-equiv-is-decidable : is-decidable B → is-decidable A + map-inv-equiv-is-decidable = is-decidable-equiv e + + is-section-map-inv-equiv-is-decidable : + is-section map-equiv-is-decidable map-inv-equiv-is-decidable + is-section-map-inv-equiv-is-decidable (inl x) = + ap inl (is-section-map-inv-equiv e x) + is-section-map-inv-equiv-is-decidable (inr x) = + ap inr eq-neg + + is-retraction-map-inv-equiv-is-decidable : + is-retraction map-equiv-is-decidable map-inv-equiv-is-decidable + is-retraction-map-inv-equiv-is-decidable (inl x) = + ap inl (is-retraction-map-inv-equiv e x) + is-retraction-map-inv-equiv-is-decidable (inr x) = + ap inr eq-neg + + is-equiv-map-equiv-is-decidable : is-equiv map-equiv-is-decidable + is-equiv-map-equiv-is-decidable = + is-equiv-is-invertible + map-inv-equiv-is-decidable + is-section-map-inv-equiv-is-decidable + is-retraction-map-inv-equiv-is-decidable + + equiv-is-decidable : is-decidable A ≃ is-decidable B + equiv-is-decidable = map-equiv-is-decidable , is-equiv-map-equiv-is-decidable ``` ### Decidability implies double negation elimination diff --git a/src/foundation/double-negation-stable-propositions.lagda.md b/src/foundation/double-negation-stable-propositions.lagda.md index 760c158524..b6d94ae237 100644 --- a/src/foundation/double-negation-stable-propositions.lagda.md +++ b/src/foundation/double-negation-stable-propositions.lagda.md @@ -7,14 +7,36 @@ module foundation.double-negation-stable-propositions where
Imports ```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 open import foundation-core.function-types -open import foundation-core.propositions +open import foundation-core.identity-types +open import foundation-core.retracts-of-types + +open import logic.double-negation-elimination ```
@@ -52,32 +74,327 @@ module _ is-prop-type-Prop is-double-negation-stable-Prop ``` +### The predicate on a type of being a double negation stable proposition + +```agda +is-double-negation-stable-prop : {l : Level} → UU l → UU l +is-double-negation-stable-prop X = (is-prop X) × (¬¬ X → X) + +is-prop-is-double-negation-stable-prop : + {l : Level} (X : UU l) → is-prop (is-double-negation-stable-prop X) +is-prop-is-double-negation-stable-prop X = + is-prop-Σ + ( is-prop-is-prop X) + ( λ is-prop-X → is-prop-is-double-negation-stable (X , is-prop-X)) + +is-double-negation-stable-prop-Prop : {l : Level} → UU l → Prop l +is-double-negation-stable-prop-Prop X = + ( is-double-negation-stable-prop X , is-prop-is-double-negation-stable-prop X) + +module _ + {l : Level} {A : UU l} (H : is-double-negation-stable-prop A) + where + + is-prop-type-is-double-negation-stable-prop : is-prop A + is-prop-type-is-double-negation-stable-prop = pr1 H + + has-double-negation-elim-is-double-negation-stable-prop : + has-double-negation-elim A + has-double-negation-elim-is-double-negation-stable-prop = pr2 H +``` + +### The subuniverse of double negation stable propositions + +```agda +Double-Negation-Stable-Prop : (l : Level) → UU (lsuc l) +Double-Negation-Stable-Prop l = Σ (UU l) (is-double-negation-stable-prop) + +module _ + {l : Level} (P : Double-Negation-Stable-Prop l) + where + + type-Double-Negation-Stable-Prop : UU l + type-Double-Negation-Stable-Prop = pr1 P + + is-double-negation-stable-prop-type-Double-Negation-Stable-Prop : + is-double-negation-stable-prop type-Double-Negation-Stable-Prop + is-double-negation-stable-prop-type-Double-Negation-Stable-Prop = pr2 P + + is-prop-type-Double-Negation-Stable-Prop : + is-prop type-Double-Negation-Stable-Prop + is-prop-type-Double-Negation-Stable-Prop = + is-prop-type-is-double-negation-stable-prop + ( is-double-negation-stable-prop-type-Double-Negation-Stable-Prop) + + prop-Double-Negation-Stable-Prop : Prop l + prop-Double-Negation-Stable-Prop = + ( type-Double-Negation-Stable-Prop , + is-prop-type-Double-Negation-Stable-Prop) + + has-double-negation-elim-type-Double-Negation-Stable-Prop : + has-double-negation-elim type-Double-Negation-Stable-Prop + has-double-negation-elim-type-Double-Negation-Stable-Prop = + has-double-negation-elim-is-double-negation-stable-prop + ( is-double-negation-stable-prop-type-Double-Negation-Stable-Prop) +``` + ## Properties +### The forgetful map from double negation stable propositions to propositions is an embedding + +```agda +is-emb-prop-Double-Negation-Stable-Prop : + {l : Level} → is-emb (prop-Double-Negation-Stable-Prop {l}) +is-emb-prop-Double-Negation-Stable-Prop = + is-emb-tot + ( λ X → + is-emb-inclusion-subtype + ( λ H → + has-double-negation-elim X , is-prop-has-double-negation-elim H)) + +emb-prop-Double-Negation-Stable-Prop : + {l : Level} → Double-Negation-Stable-Prop l ↪ Prop l +emb-prop-Double-Negation-Stable-Prop = + ( prop-Double-Negation-Stable-Prop , is-emb-prop-Double-Negation-Stable-Prop) +``` + +### The subuniverse of double negation stable propositions is a set + +```agda +is-set-Double-Negation-Stable-Prop : + {l : Level} → is-set (Double-Negation-Stable-Prop l) +is-set-Double-Negation-Stable-Prop {l} = + is-set-emb emb-prop-Double-Negation-Stable-Prop is-set-type-Prop + +set-Double-Negation-Stable-Prop : (l : Level) → Set (lsuc l) +set-Double-Negation-Stable-Prop l = + ( Double-Negation-Stable-Prop l , is-set-Double-Negation-Stable-Prop) +``` + +### Extensionality of double negation stable propositions + +```agda +module _ + {l : Level} (P Q : Double-Negation-Stable-Prop l) + where + + extensionality-Double-Negation-Stable-Prop : + ( P = Q) ≃ + ( type-Double-Negation-Stable-Prop P ↔ type-Double-Negation-Stable-Prop Q) + extensionality-Double-Negation-Stable-Prop = + ( propositional-extensionality + ( prop-Double-Negation-Stable-Prop P) + ( prop-Double-Negation-Stable-Prop Q)) ∘e + ( equiv-ap-emb emb-prop-Double-Negation-Stable-Prop) + + iff-eq-Double-Negation-Stable-Prop : + P = Q → + type-Double-Negation-Stable-Prop P ↔ type-Double-Negation-Stable-Prop Q + iff-eq-Double-Negation-Stable-Prop = + map-equiv extensionality-Double-Negation-Stable-Prop + + eq-iff-Double-Negation-Stable-Prop : + (type-Double-Negation-Stable-Prop P → type-Double-Negation-Stable-Prop Q) → + (type-Double-Negation-Stable-Prop Q → type-Double-Negation-Stable-Prop P) → + P = Q + eq-iff-Double-Negation-Stable-Prop f g = + map-inv-equiv extensionality-Double-Negation-Stable-Prop (pair f g) +``` + +### Double negation stable propositions are preserved by retracts + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + is-double-negation-stable-prop-retract : + A retract-of B → + is-double-negation-stable-prop B → + is-double-negation-stable-prop A + is-double-negation-stable-prop-retract e H = + ( is-prop-retract-of e + ( is-prop-type-is-double-negation-stable-prop H)) , + ( has-double-negation-elim-retract e + ( has-double-negation-elim-is-double-negation-stable-prop H)) +``` + +### Double negation stable propositions are preserved by equivalences + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + is-double-negation-stable-prop-equiv : + A ≃ B → is-double-negation-stable-prop B → is-double-negation-stable-prop A + is-double-negation-stable-prop-equiv e = + is-double-negation-stable-prop-retract (retract-equiv e) + + is-double-negation-stable-prop-equiv' : + B ≃ A → is-double-negation-stable-prop B → is-double-negation-stable-prop A + is-double-negation-stable-prop-equiv' e = + is-double-negation-stable-prop-retract (retract-inv-equiv e) +``` + ### The empty proposition is double negation stable ```agda -is-double-negation-stable-empty : is-double-negation-stable empty-Prop -is-double-negation-stable-empty e = e id +empty-Double-Negation-Stable-Prop : Double-Negation-Stable-Prop lzero +empty-Double-Negation-Stable-Prop = + ( empty , is-prop-empty , double-negation-elim-empty) ``` ### The unit proposition is double negation stable ```agda -is-double-negation-stable-unit : is-double-negation-stable unit-Prop -is-double-negation-stable-unit _ = star +unit-Double-Negation-Stable-Prop : Double-Negation-Stable-Prop lzero +unit-Double-Negation-Stable-Prop = + ( unit , is-prop-unit , double-negation-elim-unit) +``` + +```agda +is-double-negation-stable-prop-is-contr : + {l : Level} {A : UU l} → is-contr A → is-double-negation-stable-prop A +is-double-negation-stable-prop-is-contr H = + (is-prop-is-contr H , double-negation-elim-is-contr H) +``` + +### Decidable propositions are double negation stable + +```agda +double-negation-stable-prop-Decidable-Prop : + {l : Level} → Decidable-Prop l → Double-Negation-Stable-Prop l +double-negation-stable-prop-Decidable-Prop (A , H , d) = + ( A , H , double-negation-elim-is-decidable d) +``` + +### Negations of types are double negation stable propositions + +```agda +neg-type-Double-Negation-Stable-Prop : + {l : Level} → UU l → Double-Negation-Stable-Prop l +neg-type-Double-Negation-Stable-Prop A = + ( ¬ A , is-prop-neg , double-negation-elim-neg A) + +neg-Double-Negation-Stable-Prop : + {l : Level} → Double-Negation-Stable-Prop l → Double-Negation-Stable-Prop l +neg-Double-Negation-Stable-Prop P = + neg-type-Double-Negation-Stable-Prop (type-Double-Negation-Stable-Prop P) +``` + +### Universal quantification over double negation stable propositions is double negation stable + +```agda +is-double-negation-stable-prop-Π : + {l1 l2 : Level} {A : UU l1} {B : A → UU l2} → + ((a : A) → is-double-negation-stable-prop (B a)) → + 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 + ( has-double-negation-elim-is-double-negation-stable-prop ∘ b)) + +Π-Double-Negation-Stable-Prop : + {l1 l2 : Level} + (A : UU l1) (B : A → Double-Negation-Stable-Prop l2) → + Double-Negation-Stable-Prop (l1 ⊔ l2) +Π-Double-Negation-Stable-Prop A B = + ( (a : A) → type-Double-Negation-Stable-Prop (B a)) , + ( is-double-negation-stable-prop-Π + ( is-double-negation-stable-prop-type-Double-Negation-Stable-Prop ∘ B)) +``` + +### Implication into double negation stable propositions is double negation stable + +```agda +is-double-negation-stable-prop-exp : + {l1 l2 : Level} {A : UU l1} {B : UU l2} → + is-double-negation-stable-prop B → + is-double-negation-stable-prop (A → B) +is-double-negation-stable-prop-exp b = + is-double-negation-stable-prop-Π (λ _ → b) + +exp-Double-Negation-Stable-Prop : + {l1 l2 : Level} + (A : UU l1) (B : Double-Negation-Stable-Prop l2) → + Double-Negation-Stable-Prop (l1 ⊔ l2) +exp-Double-Negation-Stable-Prop A B = Π-Double-Negation-Stable-Prop A (λ _ → B) +``` + +### Dependent sums of double negation stable types over a decidable proposition are double negation stable + +```agda +is-double-negation-stable-prop-Σ : + {l1 l2 : Level} {A : UU l1} {B : A → UU l2} → + is-double-negation-stable-prop A → + ((a : A) → is-double-negation-stable-prop (B a)) → + is-double-negation-stable-prop (Σ A B) +is-double-negation-stable-prop-Σ a b = + ( is-prop-Σ + ( is-prop-type-is-double-negation-stable-prop a) + ( is-prop-type-is-double-negation-stable-prop ∘ b)) , + ( double-negation-elim-Σ-is-prop-base + ( is-prop-type-is-double-negation-stable-prop a) + ( has-double-negation-elim-is-double-negation-stable-prop a) + ( has-double-negation-elim-is-double-negation-stable-prop ∘ b)) + +Σ-Double-Negation-Stable-Prop : + {l1 l2 : Level} + (A : Double-Negation-Stable-Prop l1) + (B : type-Double-Negation-Stable-Prop A → Double-Negation-Stable-Prop l2) → + Double-Negation-Stable-Prop (l1 ⊔ l2) +Σ-Double-Negation-Stable-Prop A B = + ( Σ ( type-Double-Negation-Stable-Prop A) + ( type-Double-Negation-Stable-Prop ∘ B)) , + ( is-double-negation-stable-prop-Σ + ( is-double-negation-stable-prop-type-Double-Negation-Stable-Prop A) + ( is-double-negation-stable-prop-type-Double-Negation-Stable-Prop ∘ B)) +``` + +### The conjunction of two double negation stable propositions is double negation stable + +```agda +is-double-negation-stable-prop-product : + {l1 l2 : Level} {A : UU l1} {B : UU l2} → + is-double-negation-stable-prop A → + is-double-negation-stable-prop B → + is-double-negation-stable-prop (A × B) +is-double-negation-stable-prop-product a b = + ( is-prop-product + ( is-prop-type-is-double-negation-stable-prop a) + ( is-prop-type-is-double-negation-stable-prop b)) , + ( double-negation-elim-product + ( has-double-negation-elim-is-double-negation-stable-prop a) + ( has-double-negation-elim-is-double-negation-stable-prop b)) + +product-Double-Negation-Stable-Prop : + {l1 l2 : Level} → + Double-Negation-Stable-Prop l1 → + Double-Negation-Stable-Prop l2 → + Double-Negation-Stable-Prop (l1 ⊔ l2) +product-Double-Negation-Stable-Prop A B = + ( ( type-Double-Negation-Stable-Prop A) × + ( type-Double-Negation-Stable-Prop B)) , + ( is-double-negation-stable-prop-product + ( is-double-negation-stable-prop-type-Double-Negation-Stable-Prop A) + ( is-double-negation-stable-prop-type-Double-Negation-Stable-Prop B)) ``` -### The negation of a type is double negation stable +### Negation has no fixed points on double negation stable propositions ```agda -is-double-negation-stable-neg : - {l : Level} (A : UU l) → is-double-negation-stable (neg-type-Prop A) -is-double-negation-stable-neg = double-negation-elim-neg +abstract + no-fixed-points-neg-Double-Negation-Stable-Prop : + {l : Level} (P : Double-Negation-Stable-Prop l) → + ¬ (type-Double-Negation-Stable-Prop P ↔ + ¬ (type-Double-Negation-Stable-Prop P)) + no-fixed-points-neg-Double-Negation-Stable-Prop P = + no-fixed-points-neg (type-Double-Negation-Stable-Prop P) ``` ## See also - [The double negation modality](foundation.double-negation-modality.md) - [Irrefutable propositions](foundation.irrefutable-propositions.md) are double - negation stable. + negation connected types. diff --git a/src/foundation/double-negation.lagda.md b/src/foundation/double-negation.lagda.md index 4529283ca7..7a8c9f02e0 100644 --- a/src/foundation/double-negation.lagda.md +++ b/src/foundation/double-negation.lagda.md @@ -7,15 +7,12 @@ module foundation.double-negation where
Imports ```agda -open import foundation.dependent-pair-types open import foundation.negation open import foundation.propositional-truncations 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.function-types open import foundation-core.propositions ``` @@ -94,45 +91,13 @@ double-negation-linearity-implication {P = P} {Q = Q} f = ( λ (p : P) → map-neg (inr {A = P → Q} {B = Q → P}) f (λ _ → p)) ``` -### Cases of double negation elimination - -```agda -double-negation-elim-neg : {l : Level} (P : UU l) → ¬¬¬ P → ¬ P -double-negation-elim-neg P f p = f (λ g → g p) - -double-negation-elim-product : - {l1 l2 : Level} {P : UU l1} {Q : UU l2} → - ¬¬ ((¬¬ P) × (¬¬ Q)) → (¬¬ P) × (¬¬ Q) -pr1 (double-negation-elim-product {P = P} {Q = Q} f) = - double-negation-elim-neg (¬ P) (map-double-negation pr1 f) -pr2 (double-negation-elim-product {P = P} {Q = Q} f) = - double-negation-elim-neg (¬ Q) (map-double-negation pr2 f) - -double-negation-elim-exp : - {l1 l2 : Level} {P : UU l1} {Q : UU l2} → - ¬¬ (P → ¬¬ Q) → (P → ¬¬ Q) -double-negation-elim-exp {P = P} {Q = Q} f p = - double-negation-elim-neg - ( ¬ Q) - ( map-double-negation (λ (g : P → ¬¬ Q) → g p) f) - -double-negation-elim-for-all : - {l1 l2 : Level} {P : UU l1} {Q : P → UU l2} → - ¬¬ ((p : P) → ¬¬ (Q p)) → (p : P) → ¬¬ (Q p) -double-negation-elim-for-all {P = P} {Q = Q} f p = - double-negation-elim-neg - ( ¬ (Q p)) - ( map-double-negation (λ (g : (u : P) → ¬¬ (Q u)) → g p) f) -``` - ### Maps into double negations extend along `intro-double-negation` ```agda double-negation-extend : {l1 l2 : Level} {P : UU l1} {Q : UU l2} → (P → ¬¬ Q) → (¬¬ P → ¬¬ Q) -double-negation-extend {P = P} {Q = Q} f = - double-negation-elim-neg (¬ Q) ∘ (map-double-negation f) +double-negation-extend {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 diff --git a/src/foundation/equivalence-injective-type-families.lagda.md b/src/foundation/equivalence-injective-type-families.lagda.md index d565eb4308..5b1ea1cb5f 100644 --- a/src/foundation/equivalence-injective-type-families.lagda.md +++ b/src/foundation/equivalence-injective-type-families.lagda.md @@ -37,9 +37,7 @@ as a map. **Note.** The concept of equivalence injective type family as considered here is unrelated to the concept of "injective type" as studied by Martín Escardó in -_Injective types in univalent mathematics_ -([arXiv:1903.01211](https://arxiv.org/abs/1903.01211), -[TypeTopology](https://www.cs.bham.ac.uk/~mhe/TypeTopology/InjectiveTypes.index.html)). +_Injective types in univalent mathematics_ {{#cite Esc21b}}. ## Definition @@ -108,3 +106,7 @@ module _ pr1 is-equivalence-injective-Prop = is-equivalence-injective P pr2 is-equivalence-injective-Prop = is-prop-is-equivalence-injective ``` + +## References + +{{#bibliography}} diff --git a/src/foundation/hilberts-epsilon-operators.lagda.md b/src/foundation/hilberts-epsilon-operators.lagda.md index 6ad95cd052..cb8b91e0f5 100644 --- a/src/foundation/hilberts-epsilon-operators.lagda.md +++ b/src/foundation/hilberts-epsilon-operators.lagda.md @@ -19,8 +19,10 @@ open import foundation-core.function-types ## Idea -Hilbert's $ε$-operator at a type `A` is a map `type-trunc-Prop A → A`. Contrary -to Hilbert, we will not assume that such an operator exists for each type `A`. +{{#concept "Hilbert's $ε$-operator"}} at a type `A` is a map +`type-trunc-Prop A → A`. Contrary to Hilbert, we will not assume that such an +operator exists for each type `A`. Some authors also refer to this as _split +support_. {{#cite KECA17}} ## Definition @@ -46,3 +48,12 @@ to Hilbert, we will not assume that such an operator exists for each type `A`. ε-operator-equiv' e f = (map-inv-equiv e ∘ f) ∘ (map-trunc-Prop (map-equiv e)) ``` + +## References + +{{#bibliography}} + +## External links + +- [Epsilon calculus](https://en.wikipedia.org/wiki/Epsilon_calculus) at + Wikipedia diff --git a/src/foundation/images-embeddings.lagda.md b/src/foundation/images-embeddings.lagda.md new file mode 100644 index 0000000000..b2fdef9844 --- /dev/null +++ b/src/foundation/images-embeddings.lagda.md @@ -0,0 +1,449 @@ +# The image of an embedding + +```agda +module foundation.images-embeddings where +``` + +
Imports + +```agda +open import foundation.dependent-pair-types +open import foundation.fundamental-theorem-of-identity-types +open import foundation.powersets +open import foundation.propositional-maps +open import foundation.propositional-truncations +open import foundation.slice +open import foundation.subtype-identity-principle +open import foundation.surjective-maps +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 +open import foundation-core.function-types +open import foundation-core.identity-types +open import foundation-core.injective-maps +open import foundation-core.propositions +open import foundation-core.sets +open import foundation-core.subtypes +open import foundation-core.torsorial-type-families +open import foundation-core.truncated-types +open import foundation-core.truncation-levels + +open import order-theory.order-preserving-maps-large-posets +open import order-theory.order-preserving-maps-large-preorders +open import order-theory.order-preserving-maps-posets +``` + +
+ +## Idea + +The {{#concept "image" Disambiguation="of an embedding" Agda=im-emb}} of an +[embedding](foundation-core.embeddings.md) is a type that satisfies the +[universal property of the image](foundation.universal-property-image.md) of a +map. + +## Definitions + +```agda +module _ + {l1 l2 : Level} {X : UU l1} {A : UU l2} (f : A ↪ X) + where + + subtype-im-emb : subtype (l1 ⊔ l2) X + subtype-im-emb x = (fiber (map-emb f) x , is-prop-map-emb f x) + + is-in-subtype-im-emb : X → UU (l1 ⊔ l2) + is-in-subtype-im-emb = is-in-subtype subtype-im-emb + + im-emb : UU (l1 ⊔ l2) + im-emb = type-subtype subtype-im-emb + + inclusion-im-emb : im-emb → X + inclusion-im-emb = inclusion-subtype subtype-im-emb + + map-unit-im-emb : A → im-emb + pr1 (map-unit-im-emb a) = map-emb f a + pr2 (map-unit-im-emb a) = a , refl + + triangle-unit-im-emb : + coherence-triangle-maps (map-emb f) inclusion-im-emb map-unit-im-emb + triangle-unit-im-emb a = refl + + unit-im-emb : hom-slice (map-emb f) inclusion-im-emb + pr1 unit-im-emb = map-unit-im-emb + pr2 unit-im-emb = triangle-unit-im-emb +``` + +### The direct image operator on powersets + +```agda +module _ + {l1 l2 : Level} {X : UU l1} {A : UU l2} (f : A ↪ X) + where + + direct-image-hom-emb-powerset : + hom-Large-Poset + ( λ l → l1 ⊔ l2 ⊔ l) + ( powerset-Large-Poset A) + ( powerset-Large-Poset X) + direct-image-hom-emb-powerset = + make-hom-Large-Preorder + ( λ P i → Σ-Prop (subtype-im-emb f i) (λ x → P (pr1 x))) + ( λ P Q x y w → pr1 w , x (pr1 (pr1 w)) (pr2 w)) + + direct-image-hom-emb-powerset' : + {l : Level} → + hom-Poset (powerset-Poset l A) (powerset-Poset (l1 ⊔ l2 ⊔ l) X) + direct-image-hom-emb-powerset' {l} = + ( hom-poset-hom-Large-Poset + ( powerset-Large-Poset A) + ( powerset-Large-Poset X) + ( direct-image-hom-emb-powerset) + ( l)) +``` + +## Properties + +### We characterize the identity type of `im-emb f` + +```agda +module _ + {l1 l2 : Level} {X : UU l1} {A : UU l2} (f : A ↪ X) + where + + Eq-im-emb : im-emb f → im-emb f → UU l1 + Eq-im-emb x y = (pr1 x = pr1 y) + + refl-Eq-im-emb : (x : im-emb f) → Eq-im-emb x x + refl-Eq-im-emb x = refl + + Eq-eq-im-emb : (x y : im-emb f) → x = y → Eq-im-emb x y + Eq-eq-im-emb x .x refl = refl-Eq-im-emb x + + abstract + is-torsorial-Eq-im-emb : + (x : im-emb f) → is-torsorial (Eq-im-emb x) + is-torsorial-Eq-im-emb x = + is-torsorial-Eq-subtype + ( is-torsorial-Id (pr1 x)) + ( is-prop-map-emb f) + ( pr1 x) + ( refl) + ( pr2 x) + + abstract + is-equiv-Eq-eq-im-emb : (x y : im-emb f) → is-equiv (Eq-eq-im-emb x y) + is-equiv-Eq-eq-im-emb x = + fundamental-theorem-id + ( is-torsorial-Eq-im-emb x) + ( Eq-eq-im-emb x) + + equiv-Eq-eq-im-emb : (x y : im-emb f) → (x = y) ≃ Eq-im-emb x y + pr1 (equiv-Eq-eq-im-emb x y) = Eq-eq-im-emb x y + pr2 (equiv-Eq-eq-im-emb x y) = is-equiv-Eq-eq-im-emb x y + + eq-Eq-im-emb : (x y : im-emb f) → Eq-im-emb x y → x = y + eq-Eq-im-emb x y = map-inv-is-equiv (is-equiv-Eq-eq-im-emb x y) +``` + +### The image inclusion is an embedding + +```agda +abstract + is-emb-inclusion-im-emb : + {l1 l2 : Level} {X : UU l1} {A : UU l2} (f : A ↪ X) → + is-emb (inclusion-im-emb f) + is-emb-inclusion-im-emb f = + is-emb-inclusion-subtype (λ x → fiber (map-emb f) x , is-prop-map-emb f x) + +emb-im-emb : + {l1 l2 : Level} {X : UU l1} {A : UU l2} (f : A ↪ X) → im-emb f ↪ X +pr1 (emb-im-emb f) = inclusion-im-emb f +pr2 (emb-im-emb f) = is-emb-inclusion-im-emb f +``` + +### The image inclusion is injective + +```agda +abstract + is-injective-inclusion-im-emb : + {l1 l2 : Level} {X : UU l1} {A : UU l2} (f : A ↪ X) → + is-injective (inclusion-im-emb f) + is-injective-inclusion-im-emb f = + is-injective-is-emb (is-emb-inclusion-im-emb f) +``` + +### The unit map of the image is surjective + +```text +abstract + is-surjective-map-unit-im-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A ↪ B) → + is-surjective (map-unit-im-emb f) + is-surjective-map-unit-im-emb f (y , z) = + apply-universal-property-trunc-Prop z + ( trunc-Prop (fiber (map-unit-im-emb f) (y , z))) + ( α) + where + α : fiber (map-emb f) y → type-Prop (trunc-Prop (fiber (map-unit-im-emb f) (y , z))) + α (x , p) = unit-trunc-Prop (x , eq-type-subtype (λ w → fiber (map-emb f) w , is-prop-map-emb f w) p) +``` + +### The image of a map into a truncated type is truncated + +```agda +abstract + is-trunc-im-emb : + {l1 l2 : Level} (k : 𝕋) {X : UU l1} {A : UU l2} (f : A ↪ X) → + is-trunc (succ-𝕋 k) X → is-trunc (succ-𝕋 k) (im-emb f) + is-trunc-im-emb k f = is-trunc-emb k (emb-im-emb f) + +im-emb-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) +pr1 (im-emb-Truncated-Type k X f) = im-emb f +pr2 (im-emb-Truncated-Type k X f) = + is-trunc-im-emb k f (is-trunc-type-Truncated-Type X) +``` + +## Idea + + + +Consider a map `f : A → B` and a [subtype](foundation-core.subtypes.md) `S ⊆ A`, +then the **image** of `S` under `f` is the subtype of `B` consisting of the +values of the composite `S ⊆ A → B`. In other words, the image `im f S` of a +subtype `S` under `f` satisfies the universal property that + +```text + (im f S ⊆ U) ↔ (S ⊆ U ∘ f). +``` + +The image operation on subtypes is an +[order preserving map](order-theory.order-preserving-maps-large-posets.md) from +the [powerset](foundation.powersets.md) of `A` to the powerset of `B`. Thus we +obtain a [Galois connection](order-theory.galois-connections-large-posets.md) +between the powersets of `A` and `B`: the **image-pullback Galois connection** + +```text + image-subtype f ⊣ pullback-subtype f. +``` + +## Definitions + +### The predicate of being the image of a subtype under a map + +```text +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} (f : A → B) (S : subtype l3 A) + where + + is-image-map-subtype : {l4 : Level} (T : subtype l4 B) → UUω + is-image-map-subtype T = + {l : Level} (U : subtype l B) → (T ⊆ U) ↔ (S ⊆ U ∘ f) +``` + +### The image of a subtype under a map + +```text +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} (f : A → B) (S : subtype l3 A) + where + + im-subtype : subtype (l1 ⊔ l2 ⊔ l3) B + im-subtype y = subtype-im (f ∘ inclusion-subtype S) y + + is-in-im-subtype : B → UU (l1 ⊔ l2 ⊔ l3) + is-in-im-subtype = is-in-subtype im-subtype +``` + +### The order preserving operation taking the image of a subtype under a map + +```text +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A → B) + where + + preserves-order-im-subtype : + {l3 l4 : Level} (S : subtype l3 A) (T : subtype l4 A) → + S ⊆ T → im-subtype f S ⊆ im-subtype f T + preserves-order-im-subtype S T H y p = + apply-universal-property-trunc-Prop p + ( im-subtype f T y) + ( λ ((x , s) , q) → unit-trunc-Prop ((x , H x s) , q)) + + im-subtype-hom-Large-Poset : + hom-Large-Poset + ( λ l → l1 ⊔ l2 ⊔ l) + ( powerset-Large-Poset A) + ( powerset-Large-Poset B) + map-hom-Large-Preorder im-subtype-hom-Large-Poset = + im-subtype f + preserves-order-hom-Large-Preorder im-subtype-hom-Large-Poset = + preserves-order-im-subtype +``` + +### The image-pullback Galois connection on powersets + +```text +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A → B) + where + + forward-implication-adjoint-relation-image-pullback-subtype : + {l3 l4 : Level} (S : subtype l3 A) (T : subtype l4 B) → + (im-subtype f S ⊆ T) → (S ⊆ pullback-subtype f T) + forward-implication-adjoint-relation-image-pullback-subtype S T H x p = + H (f x) (unit-trunc-Prop ((x , p) , refl)) + + backward-implication-adjoint-relation-image-pullback-subtype : + {l3 l4 : Level} (S : subtype l3 A) (T : subtype l4 B) → + (S ⊆ pullback-subtype f T) → (im-subtype f S ⊆ T) + backward-implication-adjoint-relation-image-pullback-subtype S T H y p = + apply-universal-property-trunc-Prop p + ( T y) + ( λ where ((x , s) , refl) → H x s) + + adjoint-relation-image-pullback-subtype : + {l3 l4 : Level} (S : subtype l3 A) (T : subtype l4 B) → + (im-subtype f S ⊆ T) ↔ (S ⊆ pullback-subtype f T) + pr1 (adjoint-relation-image-pullback-subtype S T) = + forward-implication-adjoint-relation-image-pullback-subtype S T + pr2 (adjoint-relation-image-pullback-subtype S T) = + backward-implication-adjoint-relation-image-pullback-subtype S T + + image-pullback-subtype-galois-connection-Large-Poset : + galois-connection-Large-Poset + ( λ l → l1 ⊔ l2 ⊔ l) + ( λ l → l) + ( powerset-Large-Poset A) + ( powerset-Large-Poset B) + lower-adjoint-galois-connection-Large-Poset + image-pullback-subtype-galois-connection-Large-Poset = + im-subtype-hom-Large-Poset f + upper-adjoint-galois-connection-Large-Poset + image-pullback-subtype-galois-connection-Large-Poset = + pullback-subtype-hom-Large-Poset f + adjoint-relation-galois-connection-Large-Poset + image-pullback-subtype-galois-connection-Large-Poset = + adjoint-relation-image-pullback-subtype +``` + +## Properties + +### If `S` and `T` have the same elements, then `im-subtype f S` and `im-subtype f T` have the same elements + +```text +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} (f : A → B) + (S : subtype l3 A) (T : subtype l4 A) + where + + has-same-elements-im-has-same-elements-subtype : + has-same-elements-subtype S T → + has-same-elements-subtype (im-subtype f S) (im-subtype f T) + has-same-elements-im-has-same-elements-subtype s = + has-same-elements-sim-subtype + ( im-subtype f S) + ( im-subtype f T) + ( preserves-sim-hom-Large-Poset + ( powerset-Large-Poset A) + ( powerset-Large-Poset B) + ( im-subtype-hom-Large-Poset f) + ( S) + ( T) + ( sim-has-same-elements-subtype S T s)) +``` + +### The image subtype `im f (full-subtype A)` has the same elements as the subtype `im f` + +```text +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A → B) + where + + compute-im-full-subtype : + has-same-elements-subtype + ( im-subtype f (full-subtype lzero A)) + ( subtype-im f) + compute-im-full-subtype y = + iff-equiv + ( equiv-trunc-Prop + ( ( right-unit-law-Σ-is-contr + ( λ a → + is-contr-map-is-equiv is-equiv-inclusion-full-subtype (pr1 a))) ∘e + ( compute-fiber-comp f inclusion-full-subtype y))) +``` + +### The image subtype `im (g ∘ f) S` has the same elements as the image subtype `im g (im f S)` + +**Proof:** The asserted similarity follows at once from the similarity + +```text + pullback-subtype (g ∘ f) ≈ pullback-subtype g ∘ pullback-subtype f +``` + +via the image-pullback Galois connection. + +```text +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {C : UU l3} + (g : B → C) (f : A → B) (S : subtype l4 A) + where + + compute-im-subtype-comp : + has-same-elements-subtype + ( im-subtype (g ∘ f) S) + ( im-subtype g (im-subtype f S)) + compute-im-subtype-comp = + has-same-elements-sim-subtype + ( im-subtype (g ∘ f) S) + ( im-subtype g (im-subtype f S)) + ( lower-sim-upper-sim-galois-connection-Large-Poset + ( powerset-Large-Poset A) + ( powerset-Large-Poset C) + ( image-pullback-subtype-galois-connection-Large-Poset (g ∘ f)) + ( comp-galois-connection-Large-Poset + ( powerset-Large-Poset A) + ( powerset-Large-Poset B) + ( powerset-Large-Poset C) + ( image-pullback-subtype-galois-connection-Large-Poset g) + ( image-pullback-subtype-galois-connection-Large-Poset f)) + ( refl-sim-hom-Large-Poset + ( powerset-Large-Poset C) + ( powerset-Large-Poset A) + ( pullback-subtype-hom-Large-Poset (g ∘ f))) + ( S)) +``` + +### The image `im (g ∘ f)` has the same elements as the image subtype `im g (im f)` + +```text +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} (g : B → C) (f : A → B) + where + + compute-subtype-im-comp : + 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-subtype (g ∘ f) (full-subtype lzero A) x + by + inv-iff (compute-im-full-subtype (g ∘ f) x) + ↔ is-in-im-subtype g (im-subtype f (full-subtype lzero A)) x + by + compute-im-subtype-comp g f (full-subtype lzero A) x + ↔ is-in-im-subtype g (subtype-im f) x + by + has-same-elements-im-has-same-elements-subtype g + ( im-subtype f (full-subtype lzero A)) + ( subtype-im f) + ( compute-im-full-subtype f) + ( x) +``` diff --git a/src/foundation/images.lagda.md b/src/foundation/images.lagda.md index f678e73231..22502c5e02 100644 --- a/src/foundation/images.lagda.md +++ b/src/foundation/images.lagda.md @@ -36,7 +36,9 @@ open import foundation-core.truncation-levels ## Idea -The **image** of a map is a type that satisfies the +The +{{#concept "image" Disambiguation="of a map" WD="image" WDID=Q860623 Agda=im}} +of a map is a type that satisfies the [universal property of the image](foundation.universal-property-image.md) of a map. @@ -73,7 +75,7 @@ module _ ## Properties -### We characterize the identity type of im f +### We characterize the identity type of `im f` ```agda module _ @@ -216,3 +218,8 @@ im-1-Type : (f : A → type-1-Type X) → 1-Type (l1 ⊔ l2) im-1-Type X f = im-Truncated-Type zero-𝕋 X f ``` + +## External links + +- [Image (mathematics)]() at + Wikipedia diff --git a/src/foundation/irrefutable-propositions.lagda.md b/src/foundation/irrefutable-propositions.lagda.md index 7e0dd013dc..e3101cf862 100644 --- a/src/foundation/irrefutable-propositions.lagda.md +++ b/src/foundation/irrefutable-propositions.lagda.md @@ -7,18 +7,22 @@ module foundation.irrefutable-propositions where
Imports ```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 foundation-core.propositions +open import logic.double-negation-elimination ```
@@ -35,26 +39,57 @@ The [subuniverse](foundation.subuniverses.md) of ### The predicate on a proposition of being irrefutable ```agda -is-irrefutable : {l : Level} → Prop l → UU l -is-irrefutable P = ¬¬ (type-Prop P) +module _ + {l : Level} (P : Prop l) + where + + is-irrefutable : UU l + is-irrefutable = ¬¬ (type-Prop P) -is-prop-is-irrefutable : {l : Level} (P : Prop l) → is-prop (is-irrefutable P) -is-prop-is-irrefutable P = is-prop-double-negation + is-prop-is-irrefutable : is-prop is-irrefutable + is-prop-is-irrefutable = is-prop-double-negation -is-irrefutable-Prop : {l : Level} → Prop l → Prop l -is-irrefutable-Prop = double-negation-Prop + is-irrefutable-Prop : Prop l + is-irrefutable-Prop = double-negation-Prop P ``` -### The subuniverse of irrefutable propositions +### The predicate on a type of being an irrefutable proposition ```agda -subuniverse-Irrefutable-Prop : (l : Level) → subuniverse l l -subuniverse-Irrefutable-Prop l A = - product-Prop (is-prop-Prop A) (double-negation-type-Prop A) +module _ + {l : Level} (P : UU l) + where + + is-irrefutable-prop : UU l + is-irrefutable-prop = is-prop P × (¬¬ P) + + is-prop-is-irrefutable-prop : is-prop is-irrefutable-prop + is-prop-is-irrefutable-prop = + is-prop-product (is-prop-is-prop P) is-prop-double-negation + + is-irrefutable-prop-Prop : Prop l + is-irrefutable-prop-Prop = is-irrefutable-prop , is-prop-is-irrefutable-prop + +module _ + {l : Level} {P : UU l} (H : is-irrefutable-prop P) + where + + is-prop-type-is-irrefutable-prop : is-prop P + is-prop-type-is-irrefutable-prop = pr1 H + + prop-is-irrefutable-prop : Prop l + 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-is-irrefutable-prop = pr2 H +``` + +### The subuniverse of irrefutable propositions + +```agda Irrefutable-Prop : (l : Level) → UU (lsuc l) -Irrefutable-Prop l = - type-subuniverse (subuniverse-Irrefutable-Prop l) +Irrefutable-Prop l = type-subuniverse is-irrefutable-prop-Prop make-Irrefutable-Prop : {l : Level} (P : Prop l) → is-irrefutable P → Irrefutable-Prop l @@ -68,18 +103,47 @@ module _ type-Irrefutable-Prop : UU l type-Irrefutable-Prop = pr1 P + is-irrefutable-prop-type-Irrefutable-Prop : + is-irrefutable-prop type-Irrefutable-Prop + is-irrefutable-prop-type-Irrefutable-Prop = pr2 P + is-prop-type-Irrefutable-Prop : is-prop type-Irrefutable-Prop - is-prop-type-Irrefutable-Prop = pr1 (pr2 P) + is-prop-type-Irrefutable-Prop = + is-prop-type-is-irrefutable-prop is-irrefutable-prop-type-Irrefutable-Prop 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 = pr2 (pr2 P) + 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 @@ -87,13 +151,13 @@ module _ {l : Level} (P : Prop l) where - is-irrefutable-is-irrefutable-is-irrefutable : + is-idempotent-is-irrefutable : is-irrefutable (is-irrefutable-Prop P) → is-irrefutable P - is-irrefutable-is-irrefutable-is-irrefutable = + is-idempotent-is-irrefutable = double-negation-elim-neg (¬ (type-Prop P)) ``` -### The decidability of a proposition is irrefutable +### Decidability is irrefutable ```agda is-irrefutable-is-decidable : {l : Level} {A : UU l} → ¬¬ (is-decidable A) @@ -111,16 +175,67 @@ module _ make-Irrefutable-Prop (is-decidable-Prop P) is-irrefutable-is-decidable-Prop ``` -### Provable propositions are irrefutable +### 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 of irrefutable propositions ```agda module _ - {l : Level} (P : Prop l) + {l1 l2 : Level} {A : UU l1} {B : A → UU l2} where - is-irrefutable-is-inhabited : type-Prop P → is-irrefutable P - is-irrefutable-is-inhabited = intro-double-negation + 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) + is-irrefutable-prop-Σ a b = + ( is-prop-Σ + ( is-prop-type-is-irrefutable-prop a) + ( is-prop-type-is-irrefutable-prop ∘ b) , + is-irrefutable-Σ + ( is-irrefutable-is-irrefutable-prop a) + ( is-irrefutable-is-irrefutable-prop ∘ b)) +``` -is-irrefutable-unit : is-irrefutable unit-Prop -is-irrefutable-unit = is-irrefutable-is-inhabited unit-Prop star +### Products of irrefutable propositions + +```agda +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 edf0a3ddd1..18ea8c42a7 100644 --- a/src/foundation/iterating-functions.lagda.md +++ b/src/foundation/iterating-functions.lagda.md @@ -17,10 +17,12 @@ open import foundation.action-on-higher-identifications-functions open import foundation.action-on-identifications-functions open import foundation.dependent-pair-types open import foundation.function-extensionality +open import foundation.subtypes open import foundation.universe-levels open import foundation-core.commuting-squares-of-maps open import foundation-core.endomorphisms +open import foundation-core.function-types open import foundation-core.homotopies open import foundation-core.identity-types open import foundation-core.sets @@ -162,3 +164,35 @@ module _ eq-htpy (λ f → eq-htpy (λ x → iterate-mul-ℕ k l f x)) pr2 (pr2 iterative-action-Monoid) = refl ``` + +### 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/large-locale-of-propositions.lagda.md b/src/foundation/large-locale-of-propositions.lagda.md index 816cd18c3d..d5ef3ea50a 100644 --- a/src/foundation/large-locale-of-propositions.lagda.md +++ b/src/foundation/large-locale-of-propositions.lagda.md @@ -8,6 +8,7 @@ module foundation.large-locale-of-propositions where ```agda open import foundation.conjunction +open import foundation.empty-types open import foundation.existential-quantification open import foundation.logical-equivalences open import foundation.propositional-extensionality @@ -18,6 +19,7 @@ open import foundation.universe-levels open import foundation-core.function-types open import foundation-core.propositions +open import order-theory.bottom-elements-large-posets open import order-theory.large-frames open import order-theory.large-locales open import order-theory.large-meet-semilattices @@ -87,6 +89,17 @@ is-top-element-top-has-top-element-Large-Poset star ``` +### The smallest element in the large poset of propositions + +```agda +has-bottom-element-Prop-Large-Locale : + has-bottom-element-Large-Poset Prop-Large-Poset +bottom-has-bottom-element-Large-Poset + has-bottom-element-Prop-Large-Locale = empty-Prop +is-bottom-element-bottom-has-bottom-element-Large-Poset + has-bottom-element-Prop-Large-Locale P = ex-falso +``` + ### The large poset of propositions is a large meet-semilattice ```agda @@ -98,6 +111,12 @@ has-meets-is-large-meet-semilattice-Large-Poset has-top-element-is-large-meet-semilattice-Large-Poset is-large-meet-semilattice-Prop-Large-Locale = has-top-element-Prop-Large-Locale + +Prop-Large-Meet-Semilattice : Large-Meet-Semilattice lsuc (_⊔_) +Prop-Large-Meet-Semilattice = + make-Large-Meet-Semilattice + ( Prop-Large-Poset) + ( is-large-meet-semilattice-Prop-Large-Locale) ``` ### Suprema in the large poset of propositions @@ -111,6 +130,10 @@ sup-has-least-upper-bound-family-of-elements-Large-Poset is-least-upper-bound-sup-has-least-upper-bound-family-of-elements-Large-Poset ( is-large-suplattice-Prop-Large-Locale {I = I} P) R = inv-iff (up-exists R) + +Prop-Large-Suplattice : Large-Suplattice lsuc (_⊔_) lzero +Prop-Large-Suplattice = + make-Large-Suplattice Prop-Large-Poset is-large-suplattice-Prop-Large-Locale ``` ### The large frame of propositions diff --git a/src/foundation/large-locale-of-subtypes.lagda.md b/src/foundation/large-locale-of-subtypes.lagda.md index 4bec76c43e..2661d3c83d 100644 --- a/src/foundation/large-locale-of-subtypes.lagda.md +++ b/src/foundation/large-locale-of-subtypes.lagda.md @@ -14,21 +14,25 @@ open import foundation.universe-levels open import foundation-core.identity-types open import foundation-core.sets +open import order-theory.bottom-elements-large-posets open import order-theory.greatest-lower-bounds-large-posets open import order-theory.large-locales open import order-theory.large-meet-semilattices open import order-theory.large-posets +open import order-theory.large-preorders open import order-theory.large-suplattices open import order-theory.least-upper-bounds-large-posets open import order-theory.powers-of-large-locales +open import order-theory.top-elements-large-posets ```
## Idea -The **large locale of subtypes** of a type `A` is the -[power locale](order-theory.powers-of-large-locales.md) `A → Prop-Large-Locale`. +The {{#concept "large locale of subtypes" Agda=powerset-Large-Locale}} of a type +`A` is the [power locale](order-theory.powers-of-large-locales.md) +`A → Prop-Large-Locale`. ## Definition @@ -41,6 +45,11 @@ module _ Large-Locale (λ l2 → l1 ⊔ lsuc l2) (λ l2 l3 → l1 ⊔ l2 ⊔ l3) lzero powerset-Large-Locale = power-Large-Locale A Prop-Large-Locale + large-preorder-powerset-Large-Locale : + Large-Preorder (λ l2 → l1 ⊔ lsuc l2) (λ l2 l3 → l1 ⊔ l2 ⊔ l3) + large-preorder-powerset-Large-Locale = + large-preorder-Large-Locale powerset-Large-Locale + large-poset-powerset-Large-Locale : Large-Poset (λ l2 → l1 ⊔ lsuc l2) (λ l2 l3 → l1 ⊔ l2 ⊔ l3) large-poset-powerset-Large-Locale = @@ -168,4 +177,16 @@ module _ sup-powerset-Large-Locale (λ j → meet-powerset-Large-Locale x (y j)) distributive-meet-sup-powerset-Large-Locale = distributive-meet-sup-Large-Locale (powerset-Large-Locale A) + + has-top-element-powerset-Large-Locale : + has-top-element-Large-Poset (large-poset-powerset-Large-Locale A) + has-top-element-powerset-Large-Locale = + has-top-element-Large-Locale (powerset-Large-Locale A) + + has-bottom-element-powerset-Large-Locale : + has-bottom-element-Large-Poset (large-poset-powerset-Large-Locale A) + has-bottom-element-powerset-Large-Locale = + has-bottom-element-Π-Large-Poset + ( λ _ → Prop-Large-Poset) + ( λ _ → has-bottom-element-Prop-Large-Locale) ``` diff --git a/src/foundation/lesser-limited-principle-of-omniscience.lagda.md b/src/foundation/lesser-limited-principle-of-omniscience.lagda.md index a44fa6433b..9a2ffc9aca 100644 --- a/src/foundation/lesser-limited-principle-of-omniscience.lagda.md +++ b/src/foundation/lesser-limited-principle-of-omniscience.lagda.md @@ -24,9 +24,9 @@ open import univalent-combinatorics.standard-finite-types ## Statement -The **lesser limited principle of omniscience** asserts that for any sequence -`f : ℕ → Fin 2` containing at most one `1`, either `f n = 0` for all even `n` -or `f n = 0` for all odd `n`. +The {{#concept "lesser limited principle of omniscience" Agda=LLPO}} (LLPO) +asserts that for any sequence `f : ℕ → Fin 2` containing at most one `1`, either +`f n = 0` for all even `n` or `f n = 0` for all odd `n`. ```agda LLPO : UU lzero @@ -46,3 +46,9 @@ LLPO = - [The principle of omniscience](foundation.principle-of-omniscience.md) - [The limited principle of omniscience](foundation.limited-principle-of-omniscience.md) - [The weak limited principle of omniscience](foundation.weak-limited-principle-of-omniscience.md) +- [Markov's principle](logic.markovs-principle.md) + +## External links + +- [lesser limited principle of omniscience](https://ncatlab.org/nlab/show/lesser+limited+principle+of+omniscience) + at $n$Lab diff --git a/src/foundation/limited-principle-of-omniscience.lagda.md b/src/foundation/limited-principle-of-omniscience.lagda.md index 5b6d52ed2e..d204ef55bf 100644 --- a/src/foundation/limited-principle-of-omniscience.lagda.md +++ b/src/foundation/limited-principle-of-omniscience.lagda.md @@ -45,3 +45,9 @@ LPO = - [The principle of omniscience](foundation.principle-of-omniscience.md) - [The lesser limited principle of omniscience](foundation.lesser-limited-principle-of-omniscience.md) - [The weak limited principle of omniscience](foundation.weak-limited-principle-of-omniscience.md) +- [Markov's principle](logic.markovs-principle.md) + +## External links + +- [limited principle of omniscience](https://ncatlab.org/nlab/show/limited+principle+of+omniscience) + at $n$Lab diff --git a/src/foundation/locale-of-propositions.lagda.md b/src/foundation/locale-of-propositions.lagda.md new file mode 100644 index 0000000000..1d610d7759 --- /dev/null +++ b/src/foundation/locale-of-propositions.lagda.md @@ -0,0 +1,119 @@ +# The locale of propositions + +```agda +module foundation.locale-of-propositions where +``` + +
Imports + +```agda +open import foundation.dependent-pair-types +open import foundation.existential-quantification +open import foundation.large-locale-of-propositions +open import foundation.logical-equivalences +open import foundation.unit-type +open import foundation.universe-levels + +open import foundation-core.function-types + +open import order-theory.large-posets +open import order-theory.large-preorders +open import order-theory.posets +open import order-theory.preorders +open import order-theory.suplattices +open import order-theory.top-elements-posets +``` + +
+ +## Idea + +The [locale](order-theory.locales.md) of +[propositions](foundation-core.propositions.md) consists of all the propositions +of any [universe level](foundation.universe-levels.md) and is ordered by the +implications between them. [Conjunction](foundation.conjunction.md) gives this +[poset](order-theory.posets.md) the structure of a +[meet-semilattice](order-theory.meet-semilattices.md), and +[existential quantification](foundation.existential-quantification.md) gives it +the structure of a [suplattice](order-theory.suplattices.md). + +## Definitions + +### The preorder of propositions + +```agda +Prop-Preorder : (l : Level) → Preorder (lsuc l) l +Prop-Preorder = preorder-Large-Preorder Prop-Large-Preorder +``` + +### The poset of propositions + +```agda +Prop-Poset : (l : Level) → Poset (lsuc l) l +Prop-Poset = poset-Large-Poset Prop-Large-Poset +``` + +### Meets in the poset of propositions + +```text +has-meets-Prop-Locale : + has-meets-Poset Prop-Poset +meet-has-meets-Poset has-meets-Prop-Locale = conjunction-Prop +is-greatest-binary-lower-bound-meet-has-meets-Poset + has-meets-Prop-Locale P Q R = + is-greatest-binary-lower-bound-conjunction-Prop P Q R +``` + +### The largest element in the poset of propositions + +```agda +has-top-element-Prop-Locale : + {l : Level} → has-top-element-Poset (Prop-Poset l) +has-top-element-Prop-Locale {l} = (raise-unit-Prop l , λ _ _ → raise-star) +``` + +### The poset of propositions is a meet-semilattice + +```text +is-meet-semilattice-Prop-Locale : + is-meet-semilattice-Poset Prop-Poset +has-meets-is-meet-semilattice-Poset + is-meet-semilattice-Prop-Locale = + has-meets-Prop-Locale +has-top-element-is-meet-semilattice-Poset + is-meet-semilattice-Prop-Locale = + has-top-element-Prop-Locale +``` + +### Suprema in the poset of propositions + +```agda +is-suplattice-Prop-Locale : + (l : Level) → is-suplattice-Poset l (Prop-Poset l) +is-suplattice-Prop-Locale l I P = (∃ I P , inv-iff ∘ up-exists) +``` + +### The frame of propositions + +```text +Prop-Frame : Frame lsuc (_⊔_) lzero +poset-Frame Prop-Frame = + Prop-Poset +is-meet-semilattice-Frame Prop-Frame = + is-meet-semilattice-Prop-Locale +is-suplattice-Frame Prop-Frame = + is-suplattice-Prop-Locale +distributive-meet-sup-Frame Prop-Frame = + eq-distributive-conjunction-exists +``` + +### The locale of propositions + +```text +Prop-Locale : Locale lsuc (_⊔_) lzero +Prop-Locale = Prop-Frame +``` + +## See also + +- [Propositional resizing](foundation.propositional-resizing.md) diff --git a/src/foundation/logical-equivalences.lagda.md b/src/foundation/logical-equivalences.lagda.md index e6208ce084..d806e1ca3d 100644 --- a/src/foundation/logical-equivalences.lagda.md +++ b/src/foundation/logical-equivalences.lagda.md @@ -220,6 +220,10 @@ iff-equiv : {l1 l2 : Level} {A : UU l1} {B : UU l2} → (A ≃ B) → (A ↔ B) pr1 (iff-equiv e) = map-equiv e pr2 (iff-equiv e) = map-inv-equiv e +iff-equiv' : {l1 l2 : Level} {A : UU l1} {B : UU l2} → (A ≃ B) → (B ↔ A) +pr1 (iff-equiv' e) = map-inv-equiv e +pr2 (iff-equiv' e) = map-equiv e + is-injective-iff-equiv : {l1 l2 : Level} {A : UU l1} {B : UU l2} → is-injective (iff-equiv {A = A} {B}) is-injective-iff-equiv p = eq-htpy-equiv (pr1 (htpy-eq-iff p)) diff --git a/src/foundation/negation.lagda.md b/src/foundation/negation.lagda.md index 3a7b5044e1..273c37d133 100644 --- a/src/foundation/negation.lagda.md +++ b/src/foundation/negation.lagda.md @@ -15,6 +15,7 @@ open import foundation.universe-levels open import foundation-core.empty-types open import foundation-core.equivalences +open import foundation-core.identity-types open import foundation-core.propositions ``` @@ -34,7 +35,7 @@ using propositions as types. Thus, the negation of a type `A` is the type ```agda is-prop-neg : {l : Level} {A : UU l} → is-prop (¬ A) -is-prop-neg {A = A} = is-prop-function-type is-prop-empty +is-prop-neg = is-prop-function-type is-prop-empty neg-type-Prop : {l1 : Level} → UU l1 → Prop l1 neg-type-Prop A = ¬ A , is-prop-neg @@ -49,6 +50,9 @@ infix 25 ¬'_ ¬'_ : {l1 : Level} → Prop l1 → Prop l1 ¬'_ = neg-Prop + +eq-neg : {l : Level} {A : UU l} {p q : ¬ A} → p = q +eq-neg = eq-is-prop is-prop-neg ``` ### Reductio ad absurdum @@ -58,17 +62,30 @@ reductio-ad-absurdum : {l1 l2 : Level} {P : UU l1} {Q : UU l2} → P → ¬ P reductio-ad-absurdum p np = ex-falso (np p) ``` +### Logically equivalent types have logically equivalent negations + +```agda +module _ + {l1 l2 : Level} {X : UU l1} {Y : UU l2} + where + + iff-neg : X ↔ Y → ¬ X ↔ ¬ Y + iff-neg e = map-neg (backward-implication e) , map-neg (forward-implication e) + + equiv-iff-neg : X ↔ Y → ¬ X ≃ ¬ Y + equiv-iff-neg e = + equiv-iff' (neg-type-Prop X) (neg-type-Prop Y) (iff-neg e) +``` + ### Equivalent types have equivalent negations ```agda -equiv-neg : - {l1 l2 : Level} {X : UU l1} {Y : UU l2} → - (X ≃ Y) → (¬ X ≃ ¬ Y) -equiv-neg {l1} {l2} {X} {Y} e = - equiv-iff' - ( neg-type-Prop X) - ( neg-type-Prop Y) - ( pair (map-neg (map-inv-equiv e)) (map-neg (map-equiv e))) +module _ + {l1 l2 : Level} {X : UU l1} {Y : UU l2} + where + + equiv-neg : X ≃ Y → ¬ X ≃ ¬ Y + equiv-neg e = equiv-iff-neg (iff-equiv e) ``` ### Negation has no fixed points diff --git a/src/foundation/perfect-images.lagda.md b/src/foundation/perfect-images.lagda.md index 73b8c53e54..bd8ed02235 100644 --- a/src/foundation/perfect-images.lagda.md +++ b/src/foundation/perfect-images.lagda.md @@ -10,20 +10,26 @@ module foundation.perfect-images where open import elementary-number-theory.natural-numbers open import foundation.action-on-identifications-functions +open import foundation.decidable-maps open import foundation.decidable-types open import foundation.dependent-pair-types open import foundation.double-negation +open import foundation.double-negation-stable-propositions +open import foundation.functoriality-dependent-function-types open import foundation.iterated-dependent-product-types open import foundation.iterating-functions open import foundation.law-of-excluded-middle open import foundation.negated-equality open import foundation.negation +open import foundation.type-arithmetic-dependent-function-types +open import foundation.universal-property-dependent-pair-types open import foundation.universe-levels open import foundation-core.cartesian-product-types open import foundation-core.coproduct-types open import foundation-core.embeddings open import foundation-core.empty-types +open import foundation-core.equivalences open import foundation-core.fibers-of-maps open import foundation-core.function-types open import foundation-core.identity-types @@ -31,6 +37,9 @@ open import foundation-core.injective-maps open import foundation-core.propositional-maps open import foundation-core.propositions open import foundation-core.transport-along-identifications + +open import logic.double-negation-eliminating-maps +open import logic.double-negation-elimination ``` @@ -49,7 +58,9 @@ We say `a₀` is an {{#concept "origin"}} for `a`, and `a` is a {{#concept "perfect image" Agda=is-perfect-image}} for `g` if any origin of `a` is in the [image](foundation.images.md) of `g`. -## Definition +## Definitions + +### Perfect images ```agda module _ @@ -58,17 +69,82 @@ module _ is-perfect-image : (a : A) → UU (l1 ⊔ l2) is-perfect-image a = - (a₀ : A) (n : ℕ) → (iterate n (g ∘ f)) a₀ = a → fiber g a₀ + (a₀ : A) (n : ℕ) → iterate n (g ∘ f) a₀ = a → fiber g a₀ +``` + +An alternative but equivalent definition. + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A → B) (g : B → A) + where + + is-perfect-image' : (a : A) → UU (l1 ⊔ l2) + is-perfect-image' a = + (n : ℕ) → (p : fiber (iterate n (g ∘ f)) a) → fiber g (pr1 p) + + equiv-is-perfect-image-is-perfect-image' : + (a : A) → + is-perfect-image' a ≃ + is-perfect-image f g a + equiv-is-perfect-image-is-perfect-image' a = + equivalence-reasoning + ((n : ℕ) (p : fiber (iterate n (g ∘ f)) a) → fiber g (pr1 p)) + ≃ ((n : ℕ) (a₀ : A) → iterate n (g ∘ f) a₀ = a → fiber g a₀) + by equiv-Π-equiv-family (λ n → equiv-ev-pair) + ≃ ((a₀ : A) (n : ℕ) → iterate n (g ∘ f) a₀ = a → fiber g a₀) + by equiv-swap-Π +``` + +### Nonperfect images + +We can talk about origins of `a` which are not images of `g`. + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} {g : B → A} + where + + is-nonperfect-image : (a : A) → UU (l1 ⊔ l2) + is-nonperfect-image a = + Σ A (λ a₀ → Σ ℕ (λ n → (iterate n (g ∘ f) a₀ = a) × ¬ (fiber g a₀))) +``` + +### Not perfect fibers over an element + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + (f : A → B) (g : B → A) + where + + has-not-perfect-fiber : (b : B) → UU (l1 ⊔ l2) + has-not-perfect-fiber b = + Σ (fiber f b) (λ s → ¬ (is-perfect-image f g (pr1 s))) + + is-prop-has-not-perfect-fiber' : + is-prop-map f → (b : B) → is-prop (has-not-perfect-fiber b) + is-prop-has-not-perfect-fiber' F b = is-prop-Σ (F b) (λ _ → is-prop-neg) + + is-prop-has-not-perfect-fiber : + is-emb f → (b : B) → is-prop (has-not-perfect-fiber b) + is-prop-has-not-perfect-fiber F = + is-prop-has-not-perfect-fiber' (is-prop-map-is-emb F) + + has-not-perfect-fiber-Prop' : + is-prop-map f → (b : B) → Prop (l1 ⊔ l2) + has-not-perfect-fiber-Prop' F b = + ( has-not-perfect-fiber b , is-prop-has-not-perfect-fiber' F b) + + has-not-perfect-fiber-Prop : + is-emb f → (b : B) → Prop (l1 ⊔ l2) + has-not-perfect-fiber-Prop F b = + ( has-not-perfect-fiber b , is-prop-has-not-perfect-fiber F b) ``` ## Properties -If `g` is an [embedding](foundation-core.embeddings.md), then -`is-perfect-image a` is a [proposition](foundation-core.propositions.md). In -this case, if we assume the -[law of exluded middle](foundation.law-of-excluded-middle.md), we can show -`is-perfect-image a` is a [decidable type](foundation.decidable-types.md) for -any `a : A`. +TODO: prose here ```agda module _ @@ -84,11 +160,6 @@ module _ is-perfect-image-Prop : A → Prop (l1 ⊔ l2) pr1 (is-perfect-image-Prop a) = is-perfect-image f g a pr2 (is-perfect-image-Prop a) = is-prop-is-perfect-image-is-emb a - - is-decidable-is-perfect-image-is-emb : - LEM (l1 ⊔ l2) → (a : A) → is-decidable (is-perfect-image f g a) - is-decidable-is-perfect-image-is-emb lem a = - lem (is-perfect-image-Prop a) ``` If `a` is a perfect image for `g`, then `a` has a preimage under `g`. Just take @@ -116,7 +187,7 @@ module _ where inverse-of-perfect-image : - (a : A) → (is-perfect-image f g a) → B + (a : A) → is-perfect-image f g a → B inverse-of-perfect-image a ρ = pr1 (is-perfect-image-is-fiber a ρ) @@ -165,7 +236,9 @@ module _ where perfect-image-has-distinct-image : - (a a₀ : A) → ¬ (is-perfect-image f g a) → (ρ : is-perfect-image f g a₀) → + (a a₀ : A) → + ¬ (is-perfect-image f g a) → + (ρ : is-perfect-image f g a₀) → f a ≠ inverse-of-perfect-image a₀ ρ perfect-image-has-distinct-image a a₀ nρ ρ p = v ρ @@ -177,39 +250,152 @@ module _ s = λ η → nρ (previous-perfect-image a η) v : ¬ (is-perfect-image f g a₀) - v = tr (λ _ → ¬ (is-perfect-image f g _)) q s + v = tr (λ a' → ¬ (is-perfect-image f g a')) q s ``` -Using the property above, we can talk about origins of `a` which are not images -of `g`. +### The constructive story + +If we assume that `g` is a double negation eliminating map, we can prove that if +`is-nonperfect-image a` does not hold, we have `is-perfect-image a`. ```agda module _ - {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} {g : B → A} + {l1 l2 : Level} {A : UU l1} {B : UU l2} + {f : A → B} {g : B → A} (G : is-double-negation-eliminating-map g) where - is-not-perfect-image : (a : A) → UU (l1 ⊔ l2) - is-not-perfect-image a = - Σ A (λ a₀ → (Σ ℕ (λ n → ((iterate n (g ∘ f)) a₀ = a) × ¬ (fiber g a₀)))) + double-negation-elim-is-perfect-image : + (a : A) → ¬ (is-nonperfect-image a) → is-perfect-image f g a + double-negation-elim-is-perfect-image a nρ a₀ n p = + G a₀ (λ a₁ → nρ (a₀ , n , p , a₁)) ``` -If we assume the law of excluded middle and `g` is an embedding, we can prove -that if `is-not-perfect-image a` does not hold, we have `is-perfect-image a`. +The following property states that if `g (b)` is not a perfect image, then `b` +has an `f` fiber `a` that is not a perfect image for `g`. Again, we need to +assume law of excluded middle and that both `g` and `f` are embedding. ```agda module _ {l1 l2 : Level} {A : UU l1} {B : UU l2} + {f : A → B} {g : B → A} + (G : is-double-negation-eliminating-map g) + (b : B) + (nρ : ¬ (is-perfect-image f g (g b))) + where + + not-not-is-nonperfect-image : ¬¬ (is-nonperfect-image {f = f} (g b)) + not-not-is-nonperfect-image nμ = + nρ (double-negation-elim-is-perfect-image G (g b) nμ) + +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} {g : B → A} + (is-injective-g : is-injective g) (b : B) + where + + has-not-perfect-fiber-is-nonperfect-image : + is-nonperfect-image {f = f} (g b) → has-not-perfect-fiber f g b + has-not-perfect-fiber-is-nonperfect-image (x₀ , zero-ℕ , u) = + ex-falso (pr2 u (b , inv (pr1 u))) + has-not-perfect-fiber-is-nonperfect-image (x₀ , succ-ℕ n , u) = + ( iterate n (g ∘ f) x₀ , is-injective-g (pr1 u)) , + ( λ s → pr2 u (s x₀ n refl)) + +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + {f : A → B} {g : B → A} + (is-double-negation-eliminating-g : is-double-negation-eliminating-map g) + (is-injective-g : is-injective g) + (b : B) + (nρ : ¬ (is-perfect-image f g (g b))) + where + + not-not-has-has-not-perfect-fiber-is-not-perfect-image' : + ¬¬ (has-not-perfect-fiber f g b) + not-not-has-has-not-perfect-fiber-is-not-perfect-image' t = + not-not-is-nonperfect-image + ( is-double-negation-eliminating-g) + ( b) + ( nρ) + ( λ s → t (has-not-perfect-fiber-is-nonperfect-image is-injective-g b s)) + +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + {f : A → B} {g : B → A} + (is-double-negation-eliminating-f : is-double-negation-eliminating-map f) + (is-prop-map-f : is-prop-map f) + (b : B) + where + + is-double-negation-stable-has-not-perfect-fiber : + is-double-negation-stable (has-not-perfect-fiber-Prop' f g is-prop-map-f b) + is-double-negation-stable-has-not-perfect-fiber = + double-negation-elim-Σ-is-prop-base + ( is-prop-map-f b) + ( is-double-negation-eliminating-f b) + ( λ p → double-negation-elim-neg (is-perfect-image f g (pr1 p))) + +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + {f : A → B} {g : B → A} + (is-double-negation-eliminating-g : is-double-negation-eliminating-map g) + (is-injective-g : is-injective g) + (is-double-negation-eliminating-f : is-double-negation-eliminating-map f) + (is-prop-map-f : is-prop-map f) + (b : B) + (nρ : ¬ (is-perfect-image f g (g b))) + where + + has-not-perfect-fiber-is-not-perfect-image' : + has-not-perfect-fiber f g b + has-not-perfect-fiber-is-not-perfect-image' = + is-double-negation-stable-has-not-perfect-fiber + ( is-double-negation-eliminating-f) + ( is-prop-map-f) + ( b) + ( not-not-has-has-not-perfect-fiber-is-not-perfect-image' + ( is-double-negation-eliminating-g) + ( is-injective-g) + ( b) + ( nρ)) +``` + +### The classical story + +If `g` is an [embedding](foundation-core.embeddings.md), then +`is-perfect-image a` is a [proposition](foundation-core.propositions.md). In +this case, if we assume the +[law of exluded middle](foundation.law-of-excluded-middle.md), we can show +`is-perfect-image a` is a [decidable type](foundation.decidable-types.md) for +any `a : A`. + +```agda +module _ + {l1 l2 : Level} (lem : LEM (l1 ⊔ l2)) {A : UU l1} {B : UU l2} {f : A → B} {g : B → A} (is-emb-g : is-emb g) - (lem : LEM (l1 ⊔ l2)) where - is-perfect-not-not-is-perfect-image : - (a : A) → ¬ (is-not-perfect-image a) → is-perfect-image f g a - is-perfect-not-not-is-perfect-image a nρ a₀ n p = - rec-coproduct - ( id) - ( λ a₁ → ex-falso (nρ (a₀ , n , p , a₁))) - ( lem (fiber g a₀ , is-prop-map-is-emb is-emb-g a₀)) + is-decidable-is-perfect-image-is-emb-LEM : + (a : A) → is-decidable (is-perfect-image f g a) + is-decidable-is-perfect-image-is-emb-LEM a = + lem (is-perfect-image-Prop is-emb-g a) +``` + +If we assume the law of excluded middle and `g` is an embedding, we can prove +that if `is-nonperfect-image a` does not hold, we have `is-perfect-image a`. + +```agda +module _ + {l1 l2 : Level} (lem : LEM (l1 ⊔ l2)) + {A : UU l1} {B : UU l2} {f : A → B} {g : B → A} + (is-emb-g : is-emb g) + where + + double-negation-elim-is-perfect-image-LEM : + (a : A) → ¬ (is-nonperfect-image a) → is-perfect-image f g a + double-negation-elim-is-perfect-image-LEM = + double-negation-elim-is-perfect-image + ( is-double-negation-eliminating-map-is-decidable-map + ( λ y → lem (fiber g y , is-prop-map-is-emb is-emb-g y))) ``` The following property states that if `g (b)` is not a perfect image, then `b` @@ -218,47 +404,21 @@ assume law of excluded middle and that both `g` and `f` are embedding. ```agda module _ - {l1 l2 : Level} {A : UU l1} {B : UU l2} - {f : A → B} {g : B → A} + {l1 l2 : Level} (lem : LEM (l1 ⊔ l2)) + {A : UU l1} {B : UU l2} {f : A → B} {g : B → A} (is-emb-f : is-emb f) (is-emb-g : is-emb g) - (lem : LEM (l1 ⊔ l2)) where - not-perfect-image-has-not-perfect-fiber : + has-not-perfect-fiber-is-not-perfect-image-LEM : (b : B) → ¬ (is-perfect-image f g (g b)) → - Σ (fiber f b) (λ s → ¬ (is-perfect-image f g (pr1 s))) - not-perfect-image-has-not-perfect-fiber b nρ = v - where - i : ¬¬ (is-not-perfect-image {f = f} (g b)) - i = λ nμ → nρ (is-perfect-not-not-is-perfect-image is-emb-g lem (g b) nμ) - - ii : - is-not-perfect-image (g b) → - Σ (fiber f b) (λ s → ¬ (is-perfect-image f g (pr1 s))) - ii (x₀ , 0 , u) = - ex-falso (pr2 u (b , inv (pr1 u))) - ii (x₀ , succ-ℕ n , u) = - a , w - where - q : f (iterate n (g ∘ f) x₀) = b - q = is-injective-is-emb is-emb-g (pr1 u) - - a : fiber f b - a = iterate n (g ∘ f) x₀ , q - - w : ¬ (is-perfect-image f g ((iterate n (g ∘ f)) x₀)) - w = λ s → pr2 u (s x₀ n refl) - - iii : ¬¬ (Σ (fiber f b) (λ s → ¬ (is-perfect-image f g (pr1 s)))) - iii = λ t → i (λ s → t (ii s)) - - iv : is-prop (Σ (fiber f b) (λ s → ¬ (is-perfect-image f g (pr1 s)))) - iv = - is-prop-Σ - (is-prop-map-is-emb is-emb-f b) - (λ s → is-prop-neg {A = is-perfect-image f g (pr1 s)}) - - v : Σ (fiber f b) (λ s → ¬ (is-perfect-image f g (pr1 s))) - v = double-negation-elim-is-decidable (lem (_ , iv)) iii + has-not-perfect-fiber f g b + has-not-perfect-fiber-is-not-perfect-image-LEM = + has-not-perfect-fiber-is-not-perfect-image' + ( is-double-negation-eliminating-map-is-decidable-map + ( λ y → lem (fiber g y , is-prop-map-is-emb is-emb-g y))) + ( is-injective-is-emb is-emb-g) + ( is-double-negation-eliminating-map-is-decidable-map + ( λ y → lem (fiber f y , is-prop-map-is-emb is-emb-f y))) + ( is-prop-map-is-emb is-emb-f) ``` diff --git a/src/foundation/powersets.lagda.md b/src/foundation/powersets.lagda.md index 33631db4f1..bcbc992421 100644 --- a/src/foundation/powersets.lagda.md +++ b/src/foundation/powersets.lagda.md @@ -7,15 +7,34 @@ module foundation.powersets where
Imports ```agda +open import foundation.dependent-pair-types +open import foundation.embeddings +open import foundation.empty-types +open import foundation.large-locale-of-propositions open import foundation.subtypes +open import foundation.unit-type open import foundation.universe-levels open import foundation-core.sets +open import order-theory.bottom-elements-large-posets +open import order-theory.bottom-elements-posets +open import order-theory.dependent-products-large-meet-semilattices +open import order-theory.dependent-products-large-posets +open import order-theory.dependent-products-large-preorders +open import order-theory.dependent-products-large-suplattices +open import order-theory.large-meet-semilattices open import order-theory.large-posets open import order-theory.large-preorders +open import order-theory.large-suplattices +open import order-theory.meet-semilattices +open import order-theory.order-preserving-maps-large-posets +open import order-theory.order-preserving-maps-large-preorders open import order-theory.posets open import order-theory.preorders +open import order-theory.suplattices +open import order-theory.top-elements-large-posets +open import order-theory.top-elements-posets ```
@@ -25,8 +44,7 @@ open import order-theory.preorders The {{#concept "powerset" Disambiguation="of a type" Agda=powerset WD="power set" WDID=Q205170}} of a type is the [set](foundation-core.sets.md) of all -[subtypes](foundation-core.subtypes.md) with respect to a given -[universe level](foundation.universe-levels.md). +[subtypes](foundation-core.subtypes.md). ## Definition @@ -61,10 +79,14 @@ module _ powerset-Large-Preorder : Large-Preorder (λ l → l1 ⊔ lsuc l) (λ l2 l3 → l1 ⊔ l2 ⊔ l3) - type-Large-Preorder powerset-Large-Preorder l = subtype l A - leq-prop-Large-Preorder powerset-Large-Preorder = leq-prop-subtype - refl-leq-Large-Preorder powerset-Large-Preorder = refl-leq-subtype - transitive-leq-Large-Preorder powerset-Large-Preorder = transitive-leq-subtype + powerset-Large-Preorder = Π-Large-Preorder {I = A} (λ _ → Prop-Large-Preorder) + +module _ + {l1 : Level} (l2 : Level) (A : UU l1) + where + + powerset-Preorder : Preorder (l1 ⊔ lsuc l2) (l1 ⊔ l2) + powerset-Preorder = preorder-Large-Preorder (powerset-Large-Preorder A) l2 ``` ### The powerset large poset @@ -76,33 +98,92 @@ module _ powerset-Large-Poset : Large-Poset (λ l → l1 ⊔ lsuc l) (λ l2 l3 → l1 ⊔ l2 ⊔ l3) - large-preorder-Large-Poset powerset-Large-Poset = powerset-Large-Preorder A - antisymmetric-leq-Large-Poset powerset-Large-Poset P Q = - antisymmetric-leq-subtype P Q + powerset-Large-Poset = Π-Large-Poset {I = A} (λ _ → Prop-Large-Poset) + +module _ + {l1 : Level} (l2 : Level) (A : UU l1) + where + + powerset-Poset : Poset (l1 ⊔ lsuc l2) (l1 ⊔ l2) + powerset-Poset = poset-Large-Poset (powerset-Large-Poset A) l2 ``` -### The powerset preorder at a universe level +### The powerset poset has a top element ```agda module _ {l1 : Level} (A : UU l1) where - powerset-Preorder : (l2 : Level) → Preorder (l1 ⊔ lsuc l2) (l1 ⊔ l2) - powerset-Preorder = preorder-Large-Preorder (powerset-Large-Preorder A) + has-top-element-powerset-Large-Poset : + has-top-element-Large-Poset (powerset-Large-Poset A) + has-top-element-powerset-Large-Poset = + has-top-element-Π-Large-Poset + ( λ _ → Prop-Large-Poset) + ( λ _ → has-top-element-Prop-Large-Locale) + + has-top-element-powerset-Poset : + {l2 : Level} → has-top-element-Poset (powerset-Poset l2 A) + has-top-element-powerset-Poset {l2} = + (λ _ → raise-unit-Prop l2) , (λ _ _ _ → raise-star) ``` -### The powerset poset at a universe level +### The powerset poset has a bottom element ```agda module _ {l1 : Level} (A : UU l1) where - powerset-Poset : (l2 : Level) → Poset (l1 ⊔ lsuc l2) (l1 ⊔ l2) - powerset-Poset = poset-Large-Poset (powerset-Large-Poset A) + has-bottom-element-powerset-Large-Poset : + has-bottom-element-Large-Poset (powerset-Large-Poset A) + has-bottom-element-powerset-Large-Poset = + has-bottom-element-Π-Large-Poset + ( λ _ → Prop-Large-Poset) + ( λ _ → has-bottom-element-Prop-Large-Locale) + + has-bottom-element-powerset-Poset : + {l2 : Level} → has-bottom-element-Poset (powerset-Poset l2 A) + has-bottom-element-powerset-Poset {l2} = + (λ _ → raise-empty-Prop l2) , (λ _ _ → raise-ex-falso l2) ``` +### The powerset meet semilattice + +```agda +module _ + {l1 : Level} (A : UU l1) + where + + powerset-Large-Meet-Semilattice : + Large-Meet-Semilattice (λ l2 → l1 ⊔ lsuc l2) (λ l2 l3 → l1 ⊔ l2 ⊔ l3) + powerset-Large-Meet-Semilattice = + Π-Large-Meet-Semilattice {I = A} (λ _ → Prop-Large-Meet-Semilattice) +``` + +### The powerset suplattice + +```agda +module _ + {l1 : Level} (A : UU l1) + where + + powerset-Large-Suplattice : + Large-Suplattice (λ l2 → lsuc l2 ⊔ l1) (λ l2 l3 → l2 ⊔ l3 ⊔ l1) lzero + powerset-Large-Suplattice = + Π-Large-Suplattice {I = A} (λ _ → Prop-Large-Suplattice) + + powerset-Suplattice : + (l2 l3 : Level) → Suplattice (l1 ⊔ lsuc l2 ⊔ lsuc l3) (l1 ⊔ l2 ⊔ l3) l2 + powerset-Suplattice = suplattice-Large-Suplattice powerset-Large-Suplattice +``` + +## See also + +- [the large locale of subtypes](foundation.large-locale-of-subtypes.md) +- [preimages of subtypes](foundation.preimages-of-subtypes.md) +- [images of subtypes](foundation.images-subtypes.md) + ## External links - [power object](https://ncatlab.org/nlab/show/power+object) at $n$Lab diff --git a/src/foundation/preimages-of-subtypes.lagda.md b/src/foundation/preimages-of-subtypes.lagda.md index ac1a192b66..2c6c46fd56 100644 --- a/src/foundation/preimages-of-subtypes.lagda.md +++ b/src/foundation/preimages-of-subtypes.lagda.md @@ -7,17 +7,22 @@ module foundation.preimages-of-subtypes where
Imports ```agda +open import foundation.powersets open import foundation.universe-levels open import foundation-core.subtypes + +open import order-theory.order-preserving-maps-large-posets +open import order-theory.order-preserving-maps-large-preorders ```
## Idea -The preimage of a subtype `S ⊆ B` under a map `f : A → B` is the subtype of `A` -consisting of elements `a` such that `f a ∈ S`. +The {{#concept "preimage" Disambiguation="of a subtype" Agda=preimage-subtype}} +of a [subtype](foundation-core.subtypes.md) `S ⊆ B` under a map `f : A → B` is +the subtype of `A` consisting of elements `a` such that `f a ∈ S`. ## Definition @@ -27,3 +32,18 @@ preimage-subtype : subtype l3 B → subtype l3 A preimage-subtype f S a = S (f a) ``` + +### Maps of types give order preserving maps on their powersets + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A → B) + where + + preimage-hom-powerset : + hom-Large-Poset (λ l → l) (powerset-Large-Poset B) (powerset-Large-Poset A) + preimage-hom-powerset = + make-hom-Large-Preorder + ( preimage-subtype f) + ( λ B' B'' B'⊆B'' x B'fx → B'⊆B'' (f x) B'fx) +``` diff --git a/src/foundation/principle-of-omniscience.lagda.md b/src/foundation/principle-of-omniscience.lagda.md index e3a35258cb..eaf0f7ee1e 100644 --- a/src/foundation/principle-of-omniscience.lagda.md +++ b/src/foundation/principle-of-omniscience.lagda.md @@ -19,7 +19,8 @@ open import foundation-core.propositions ## Idea -A type `X` is said to satisfy the **principle of omniscience** if every +A type `X` is said to satisfy the +{{#concept "principle of omniscience" Agda=is-omniscient}} if every [decidable subtype](foundation.decidable-subtypes.md) of `X` is either [inhabited](foundation.inhabited-types.md) or [empty](foundation-core.empty-types.md). @@ -42,3 +43,4 @@ is-omniscient X = type-Prop (is-omniscient-Prop X) - [The limited principle of omniscience](foundation.limited-principle-of-omniscience.md) - [The lesser limited principle of omniscience](foundation.lesser-limited-principle-of-omniscience.md) - [The weak limited principle of omniscience](foundation.weak-limited-principle-of-omniscience.md) +- [Markov's principle](logic.markovs-principle.md) diff --git a/src/foundation/propositional-resizing.lagda.md b/src/foundation/propositional-resizing.lagda.md index 46d48494aa..4abe732a36 100644 --- a/src/foundation/propositional-resizing.lagda.md +++ b/src/foundation/propositional-resizing.lagda.md @@ -10,7 +10,9 @@ module foundation.propositional-resizing where open import foundation.dependent-pair-types open import foundation.universe-levels +open import foundation-core.equivalences open import foundation-core.propositions +open import foundation-core.small-types open import foundation-core.subtypes ``` @@ -19,20 +21,172 @@ open import foundation-core.subtypes ## Idea We say that a universe `𝒱` satisfies `𝒰`-small -{{#concept "propositional resizing"}} if there is a type `Ω` in `𝒰` -[equipped](foundation.structure.md) with a +{{#concept "propositional resizing" Agda=propositional-resizing-Level}} if there +is a type `Ω` in `𝒰` [equipped](foundation.structure.md) with a [subtype](foundation-core.subtypes.md) `Q` such that for each proposition `P` in `𝒱` there is an element `u : Ω` such that `Q u ≃ P`. Such a type `Ω` is called an `𝒰`-small {{#concept "classifier" Disambiguation="of small subobjects"}} of `𝒱`-small subobjects. -## Definition +## Definitions + +### The predicate on a type of being a subtype classifier of a given universe level + +```agda +is-subtype-classifier : + {l1 l2 : Level} (l3 : Level) → Σ (UU l1) (subtype l2) → UU (l1 ⊔ l2 ⊔ lsuc l3) +is-subtype-classifier l3 Ω = + (P : Prop l3) → Σ (pr1 Ω) (λ u → type-equiv-Prop P (pr2 Ω u)) + +module _ + {l1 l2 l3 : Level} + (Ω : Σ (UU l1) (subtype l2)) (H : is-subtype-classifier l3 Ω) + (P : Prop l3) + where + + object-prop-is-subtype-classifier : pr1 Ω + object-prop-is-subtype-classifier = pr1 (H P) + + prop-is-small-prop-is-subtype-classifier : Prop l2 + prop-is-small-prop-is-subtype-classifier = + pr2 Ω object-prop-is-subtype-classifier + + type-is-small-prop-is-subtype-classifier : UU l2 + type-is-small-prop-is-subtype-classifier = + type-Prop prop-is-small-prop-is-subtype-classifier + + equiv-is-small-prop-is-subtype-classifier : + type-Prop P ≃ type-is-small-prop-is-subtype-classifier + equiv-is-small-prop-is-subtype-classifier = pr2 (H P) + + is-small-prop-is-subtype-classifier : is-small l2 (type-Prop P) + is-small-prop-is-subtype-classifier = + ( type-is-small-prop-is-subtype-classifier , + equiv-is-small-prop-is-subtype-classifier) +``` + +### Propositional resizing between specified universes + +```agda +propositional-resizing-Level' : + (l1 l2 l3 : Level) → UU (lsuc l1 ⊔ lsuc l2 ⊔ lsuc l3) +propositional-resizing-Level' l1 l2 l3 = + Σ (Σ (UU l1) (subtype l2)) (is-subtype-classifier l3) + +propositional-resizing-Level : + (l1 l2 : Level) → UU (lsuc l1 ⊔ lsuc l2) +propositional-resizing-Level l1 l2 = + propositional-resizing-Level' l1 l1 l2 +``` + +```agda +module _ + {l1 l2 l3 : Level} (ρ : propositional-resizing-Level' l1 l2 l3) + where + + subtype-classifier-propositional-resizing-Level : Σ (UU l1) (subtype l2) + subtype-classifier-propositional-resizing-Level = pr1 ρ + + type-subtype-classifier-propositional-resizing-Level : UU l1 + type-subtype-classifier-propositional-resizing-Level = + pr1 subtype-classifier-propositional-resizing-Level + + is-subtype-classifier-subtype-classifier-propositional-resizing-Level : + is-subtype-classifier l3 subtype-classifier-propositional-resizing-Level + is-subtype-classifier-subtype-classifier-propositional-resizing-Level = pr2 ρ + +module _ + {l1 l2 l3 : Level} (ρ : propositional-resizing-Level' l1 l2 l3) (P : Prop l3) + where + + object-prop-propositional-resizing-Level : + type-subtype-classifier-propositional-resizing-Level ρ + object-prop-propositional-resizing-Level = + object-prop-is-subtype-classifier + ( subtype-classifier-propositional-resizing-Level ρ) + ( is-subtype-classifier-subtype-classifier-propositional-resizing-Level ρ) + ( P) + + prop-is-small-prop-propositional-resizing-Level : Prop l2 + prop-is-small-prop-propositional-resizing-Level = + prop-is-small-prop-is-subtype-classifier + ( subtype-classifier-propositional-resizing-Level ρ) + ( is-subtype-classifier-subtype-classifier-propositional-resizing-Level ρ) + ( P) + + type-is-small-prop-propositional-resizing-Level : UU l2 + type-is-small-prop-propositional-resizing-Level = + type-is-small-prop-is-subtype-classifier + ( subtype-classifier-propositional-resizing-Level ρ) + ( is-subtype-classifier-subtype-classifier-propositional-resizing-Level ρ) + ( P) + + equiv-is-small-prop-propositional-resizing-Level : + type-Prop P ≃ type-is-small-prop-propositional-resizing-Level + equiv-is-small-prop-propositional-resizing-Level = + equiv-is-small-prop-is-subtype-classifier + ( subtype-classifier-propositional-resizing-Level ρ) + ( is-subtype-classifier-subtype-classifier-propositional-resizing-Level ρ) + ( P) + + is-small-prop-propositional-resizing-Level : is-small l2 (type-Prop P) + is-small-prop-propositional-resizing-Level = + is-small-prop-is-subtype-classifier + ( subtype-classifier-propositional-resizing-Level ρ) + ( is-subtype-classifier-subtype-classifier-propositional-resizing-Level ρ) + ( P) +``` + +### The propositional resizing axiom + +```agda +propositional-resizing : UUω +propositional-resizing = (l1 l2 : Level) → propositional-resizing-Level l1 l2 +``` ```agda -propositional-resizing : (l1 l2 : Level) → UU (lsuc l1 ⊔ lsuc l2) -propositional-resizing l1 l2 = - Σ ( Σ (UU l1) (subtype l1)) - ( λ Ω → (P : Prop l2) → Σ (pr1 Ω) (λ u → type-equiv-Prop (pr2 Ω u) P)) +module _ + (ρ : propositional-resizing) (l1 l2 : Level) + where + + subtype-classifier-propositional-resizing : Σ (UU l1) (subtype l1) + subtype-classifier-propositional-resizing = pr1 (ρ l1 l2) + + type-subtype-classifier-propositional-resizing : UU l1 + type-subtype-classifier-propositional-resizing = + type-subtype-classifier-propositional-resizing-Level (ρ l1 l2) + + is-subtype-classifier-subtype-classifier-propositional-resizing : + is-subtype-classifier l2 subtype-classifier-propositional-resizing + is-subtype-classifier-subtype-classifier-propositional-resizing = + is-subtype-classifier-subtype-classifier-propositional-resizing-Level + ( ρ l1 l2) + +module _ + (ρ : propositional-resizing) (l1 : Level) {l2 : Level} (P : Prop l2) + where + + object-prop-propositional-resizing : + type-subtype-classifier-propositional-resizing ρ l1 l2 + object-prop-propositional-resizing = + object-prop-propositional-resizing-Level (ρ l1 l2) P + + prop-is-small-prop-propositional-resizing : Prop l1 + prop-is-small-prop-propositional-resizing = + prop-is-small-prop-propositional-resizing-Level (ρ l1 l2) P + + type-is-small-prop-propositional-resizing : UU l1 + type-is-small-prop-propositional-resizing = + type-is-small-prop-propositional-resizing-Level (ρ l1 l2) P + + equiv-is-small-prop-propositional-resizing : + type-Prop P ≃ type-is-small-prop-propositional-resizing + equiv-is-small-prop-propositional-resizing = + equiv-is-small-prop-propositional-resizing-Level (ρ l1 l2) P + + is-small-prop-propositional-resizing : is-small l1 (type-Prop P) + is-small-prop-propositional-resizing = + is-small-prop-propositional-resizing-Level (ρ l1 l2) P ``` ## See also diff --git a/src/foundation/propositions.lagda.md b/src/foundation/propositions.lagda.md index cc36431139..e4bf1eb773 100644 --- a/src/foundation/propositions.lagda.md +++ b/src/foundation/propositions.lagda.md @@ -11,12 +11,15 @@ open import foundation-core.propositions public ```agda open import foundation.contractible-types open import foundation.dependent-pair-types +open import foundation.fibers-of-maps open import foundation.logical-equivalences open import foundation.retracts-of-types +open import foundation.unit-type open import foundation.universe-levels open import foundation-core.embeddings open import foundation-core.equivalences +open import foundation-core.propositional-maps open import foundation-core.truncated-types open import foundation-core.truncation-levels ``` @@ -64,6 +67,24 @@ abstract is-prop-emb = is-trunc-emb neg-two-𝕋 ``` +### A type is a proposition if and only if it embeds into the unit type + +```agda +module _ + {l : Level} {A : UU l} + where + + abstract + is-prop-is-emb-terminal-map : is-emb (terminal-map A) → is-prop A + is-prop-is-emb-terminal-map H = + is-prop-is-emb (terminal-map A) H is-prop-unit + + abstract + is-emb-terminal-map-is-prop : is-prop A → is-emb (terminal-map A) + is-emb-terminal-map-is-prop H = + is-emb-is-prop-map (λ y → is-prop-equiv (equiv-fiber-terminal-map y) H) +``` + ### Two equivalent types are equivalently propositions ```agda diff --git a/src/foundation/retracts-of-types.lagda.md b/src/foundation/retracts-of-types.lagda.md index ce0fa62ff3..56c7476a61 100644 --- a/src/foundation/retracts-of-types.lagda.md +++ b/src/foundation/retracts-of-types.lagda.md @@ -15,12 +15,14 @@ open import foundation.fundamental-theorem-of-identity-types open import foundation.homotopies open import foundation.homotopy-algebra open import foundation.homotopy-induction +open import foundation.logical-equivalences open import foundation.structure-identity-principle open import foundation.univalence open import foundation.universe-levels open import foundation.whiskering-homotopies-composition open import foundation-core.contractible-types +open import foundation-core.function-types open import foundation-core.functoriality-dependent-pair-types open import foundation-core.identity-types open import foundation-core.torsorial-type-families @@ -166,6 +168,18 @@ module _ eq-equiv-retracts R S = map-inv-is-equiv (is-equiv-equiv-eq-retracts R S) ``` +### The underlying logical equivalence associated to a retract + +```agda +iff-retract : + {l1 l2 : Level} {A : UU l1} {B : UU l2} → A retract-of B → A ↔ B +iff-retract R = inclusion-retract R , map-retraction-retract R + +iff-retract' : + {l1 l2 : Level} {A : UU l1} {B : UU l2} → A retract-of B → B ↔ A +iff-retract' = inv-iff ∘ iff-retract +``` + ## See also - [Retracts of maps](foundation.retracts-of-maps.md) diff --git a/src/foundation/surjective-maps.lagda.md b/src/foundation/surjective-maps.lagda.md index 4d04c3d5db..a76467c310 100644 --- a/src/foundation/surjective-maps.lagda.md +++ b/src/foundation/surjective-maps.lagda.md @@ -18,6 +18,7 @@ open import foundation.functoriality-cartesian-product-types open import foundation.fundamental-theorem-of-identity-types open import foundation.homotopy-induction open import foundation.identity-types +open import foundation.inhabited-types open import foundation.postcomposition-dependent-functions open import foundation.propositional-truncations open import foundation.split-surjective-maps @@ -238,15 +239,21 @@ abstract ### Any equivalence is surjective ```agda -is-surjective-is-equiv : - {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} → - is-equiv f → is-surjective f -is-surjective-is-equiv H = is-surjective-has-section (pr1 H) +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + is-surjective-is-equiv : {f : A → B} → is-equiv f → is-surjective f + is-surjective-is-equiv H = is-surjective-has-section (pr1 H) -is-surjective-map-equiv : - {l1 l2 : Level} {A : UU l1} {B : UU l2} (e : A ≃ B) → - is-surjective (map-equiv e) -is-surjective-map-equiv e = is-surjective-is-equiv (is-equiv-map-equiv e) + is-surjective-map-equiv : (e : A ≃ B) → is-surjective (map-equiv e) + is-surjective-map-equiv e = is-surjective-is-equiv (is-equiv-map-equiv e) + + surjection-equiv : A ≃ B → A ↠ B + surjection-equiv e = map-equiv e , is-surjective-map-equiv e + + surjection-inv-equiv : B ≃ A → A ↠ B + surjection-inv-equiv e = surjection-equiv (inv-equiv e) ``` ### The identity function is surjective @@ -445,7 +452,7 @@ module _ abstract is-surjective-left-map-triangle : - (f : A → X) (g : B → X) (h : A → B) (H : f ~ (g ∘ h)) → + (f : A → X) (g : B → X) (h : A → B) (H : f ~ g ∘ h) → is-surjective g → is-surjective h → is-surjective f is-surjective-left-map-triangle f g h H is-surj-g is-surj-h x = apply-universal-property-trunc-Prop @@ -830,6 +837,26 @@ module _ ( is-emb-map-emb g) ``` +### Every type that surjects onto an inhabited type is inhabited + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + is-inhabited-is-surjective : + {f : A → B} → is-surjective f → is-inhabited B → is-inhabited A + is-inhabited-is-surjective F = + rec-trunc-Prop + ( is-inhabited-Prop A) + ( rec-trunc-Prop (is-inhabited-Prop A) (unit-trunc-Prop ∘ pr1) ∘ F) + + is-inhabited-surjects-onto : + A ↠ B → is-inhabited B → is-inhabited A + is-inhabited-surjects-onto f = + is-inhabited-is-surjective (is-surjective-map-surjection f) +``` + ### The type of surjections `A ↠ B` is equivalent to the type of families `P` of inhabited types over `B` equipped with an equivalence `A ≃ Σ B P` This remains to be shown. diff --git a/src/foundation/truncation-equivalences.lagda.md b/src/foundation/truncation-equivalences.lagda.md index 8d8ecf5786..5462a0bf32 100644 --- a/src/foundation/truncation-equivalences.lagda.md +++ b/src/foundation/truncation-equivalences.lagda.md @@ -40,8 +40,10 @@ open import foundation-core.truncation-levels ## Idea -A map `f : A → B` is said to be a `k`-equivalence if the map -`map-trunc k f : trunc k A → trunc k B` is an equivalence. +A map `f : A → B` is said to be a +{{#concept "`k`-equivalence" Disambiguation="truncations of types" Agda=truncation-equivalence}} +if the map `map-trunc k f : trunc k A → trunc k B` is an +[equivalence](foundation-core.equivalences.md). ## Definition @@ -300,11 +302,11 @@ We consider the following composition of maps ```text fiber f b = Σ A (λ a → f a = b) - → Σ A (λ a → ║ f a = b ║) - ≃ Σ A (λ a → | f a | = | b | - ≃ Σ A (λ a → ║ f ║ | a | = | b |) - → Σ ║ A ║ (λ t → ║ f ║ t = | b |) - = fiber ║ f ║ | b | + → Σ A (λ a → ║f a = b║) + ≃ Σ A (λ a → |f a| = |b|) + ≃ Σ A (λ a → ║f║ |a| = |b|) + → Σ ║A║ (λ t → ║f║ t = |b|) + = fiber ║f║ |b| ``` where the first and last maps are `k`-equivalences. diff --git a/src/foundation/truncations.lagda.md b/src/foundation/truncations.lagda.md index 8b01d5b970..9523e78045 100644 --- a/src/foundation/truncations.lagda.md +++ b/src/foundation/truncations.lagda.md @@ -144,11 +144,8 @@ module _ unique-dependent-function-trunc B f = is-contr-equiv' ( fiber (precomp-Π-Truncated-Type unit-trunc B) f) - ( equiv-tot - ( λ h → equiv-funext)) - ( is-contr-map-is-equiv - ( dependent-universal-property-trunc B) - ( f)) + ( equiv-tot (λ h → equiv-funext)) + ( is-contr-map-is-equiv (dependent-universal-property-trunc B) f) apply-dependent-universal-property-trunc : {l2 : Level} (B : type-trunc k A → Truncated-Type l2 k) → diff --git a/src/foundation/weak-limited-principle-of-omniscience.lagda.md b/src/foundation/weak-limited-principle-of-omniscience.lagda.md index b4a805bc24..3fbef50663 100644 --- a/src/foundation/weak-limited-principle-of-omniscience.lagda.md +++ b/src/foundation/weak-limited-principle-of-omniscience.lagda.md @@ -24,9 +24,9 @@ open import univalent-combinatorics.standard-finite-types ## Statement -The {{#concept "Weak Limited Principle of Omniscience"}} asserts that for any -[sequence](foundation.sequences.md) `f : ℕ → Fin 2` either `f n = 0` for all -`n : ℕ` or not. In particular, it is a restricted form of the +The {{#concept "weak limited principle of omniscience"}} (WLPO) asserts that for +any [sequence](foundation.sequences.md) `f : ℕ → Fin 2` either `f n = 0` for +all `n : ℕ` or not. In particular, it is a restricted form of the [law of excluded middle](foundation.law-of-excluded-middle.md). ```agda @@ -48,3 +48,9 @@ WLPO = type-Prop WLPO-Prop - [The principle of omniscience](foundation.principle-of-omniscience.md) - [The limited principle of omniscience](foundation.limited-principle-of-omniscience.md) - [The lesser limited principle of omniscience](foundation.lesser-limited-principle-of-omniscience.md) +- [Markov's principle](logic.markovs-principle.md) + +## External links + +- [weak limited principle of omniscience](https://ncatlab.org/nlab/show/weak+limited+principle+of+omniscience) + at $n$Lab diff --git a/src/logic.lagda.md b/src/logic.lagda.md new file mode 100644 index 0000000000..4187ab1fc9 --- /dev/null +++ b/src/logic.lagda.md @@ -0,0 +1,22 @@ +# Logic + +```agda +module logic where + +open import logic.complements-de-morgan-subtypes public +open import logic.complements-decidable-subtypes public +open import logic.complements-double-negation-stable-subtypes public +open import logic.de-morgan-embeddings public +open import logic.de-morgan-maps public +open import logic.de-morgan-propositions public +open import logic.de-morgan-sheaves 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.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.markovs-principle public +open import logic.mutually-de-morgan-families public +``` diff --git a/src/logic/complements-de-morgan-subtypes.lagda.md b/src/logic/complements-de-morgan-subtypes.lagda.md new file mode 100644 index 0000000000..fd1da58e72 --- /dev/null +++ b/src/logic/complements-de-morgan-subtypes.lagda.md @@ -0,0 +1,106 @@ +# Complements of De Morgan subtypes + +```agda +module logic.complements-de-morgan-subtypes where +``` + +
Imports + +```agda +open import foundation.complements-subtypes +open import foundation.decidable-subtypes +open import foundation.dependent-pair-types +open import foundation.double-negation +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.subtypes +open import foundation.unions-subtypes +open import foundation.universe-levels + +open import foundation-core.function-types + +open import logic.complements-decidable-subtypes +open import logic.de-morgan-propositions +open import logic.de-morgan-subtypes + +open import order-theory.large-posets +open import order-theory.opposite-large-posets +open import order-theory.order-preserving-maps-large-posets +open import order-theory.order-preserving-maps-large-preorders +open import order-theory.order-preserving-maps-posets +open import order-theory.order-preserving-maps-preorders +open import order-theory.posets +``` + +
+ +## Idea + +The +{{#concept "complement" Disambiguation="of a De Morgan subtype" Agda=complement-de-morgan-subtype}} +of a [De Morgan subtype](foundation.de-morgan-subtypes.md) `B ⊆ A` consists of +the elements that are not in `B`. + +## Definition + +### Complements of De Morgan subtypes + +```agda +complement-de-morgan-subtype : + {l1 l2 : Level} {A : UU l1} → de-morgan-subtype l2 A → de-morgan-subtype l2 A +complement-de-morgan-subtype P x = neg-De-Morgan-Prop (P x) +``` + +## Properties + +### Complement of De Morgan subtypes are decidable + +```agda +is-decidable-complement-de-morgan-subtype : + {l1 l2 : Level} {A : UU l1} (P : de-morgan-subtype l2 A) → + is-decidable-subtype + ( subtype-de-morgan-subtype (complement-de-morgan-subtype P)) +is-decidable-complement-de-morgan-subtype P = is-de-morgan-de-morgan-subtype P +``` + +### The union of the complement of a subtype `P` with its double complement is the full subtype if and only if `P` is De Morgan + +```agda +module _ + {l1 l2 : Level} {A : UU l1} + where + + is-full-union-complement-subtype-double-complement-subtype : + (P : subtype l2 A) → is-de-morgan-subtype P → + is-full-subtype + ( union-subtype + ( complement-subtype P) + ( complement-subtype (complement-subtype P))) + is-full-union-complement-subtype-double-complement-subtype P = + is-full-union-subtype-complement-subtype (complement-subtype P) + + is-de-morgan-subtype-is-full-union-complement-subtype-double-complement-subtype : + (P : subtype l2 A) → + is-full-subtype + ( union-subtype + ( complement-subtype P) + ( complement-subtype (complement-subtype P))) → + is-de-morgan-subtype P + is-de-morgan-subtype-is-full-union-complement-subtype-double-complement-subtype + P = + is-decidable-subtype-is-full-union-subtype-complement-subtype + ( complement-subtype P) + + is-full-union-subtype-complement-de-morgan-subtype : + (P : de-morgan-subtype l2 A) → + is-full-subtype + ( union-de-morgan-subtype P (complement-de-morgan-subtype P)) + is-full-union-subtype-complement-de-morgan-subtype P = + is-full-union-complement-subtype-double-complement-subtype + ( subtype-de-morgan-subtype P) + ( is-de-morgan-de-morgan-subtype P) +``` diff --git a/src/logic/complements-decidable-subtypes.lagda.md b/src/logic/complements-decidable-subtypes.lagda.md new file mode 100644 index 0000000000..c410ff90ff --- /dev/null +++ b/src/logic/complements-decidable-subtypes.lagda.md @@ -0,0 +1,108 @@ +# Complements of decidable subtypes + +```agda +module logic.complements-decidable-subtypes where +``` + +
Imports + +```agda +open import foundation.complements-subtypes +open import foundation.coproduct-types +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.unions-subtypes +open import foundation.universe-levels + +open import foundation-core.function-types +open import foundation-core.subtypes + +open import logic.double-negation-stable-subtypes + +open import order-theory.large-posets +open import order-theory.opposite-large-posets +open import order-theory.order-preserving-maps-large-posets +open import order-theory.order-preserving-maps-large-preorders +open import order-theory.order-preserving-maps-posets +open import order-theory.order-preserving-maps-preorders +open import order-theory.posets +``` + +
+ +## Idea + +The +{{#concept "complement" Disambiguation="of a decidable subtype" Agda=complement-decidable-subtype}} +of a [decidable subtype](foundation.decidable-subtypes.md) `B ⊆ A` consists of +the elements that are not in `B`. + +## Definition + +### 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) +``` + +## Properties + +### Taking complements is an involution on decidable subtypes + +```agda +is-involution-complement-decidable-subtype : + {l1 l2 : Level} {A : UU l1} → + is-involution (complement-decidable-subtype {l1} {l2} {A}) +is-involution-complement-decidable-subtype P = + eq-has-same-elements-decidable-subtype + ( complement-decidable-subtype (complement-decidable-subtype P)) + ( P) + ( λ x → + double-negation-elim-is-decidable (is-decidable-decidable-subtype P x) , + ev) +``` + +### The union of a subtype `P` with its complement is the full subtype if and only if `P` is a decidable subtype + +```agda +module _ + {l1 l2 : Level} {A : UU l1} + where + + is-full-union-subtype-complement-subtype : + (P : subtype l2 A) → is-decidable-subtype P → + is-full-subtype (union-subtype P (complement-subtype P)) + is-full-union-subtype-complement-subtype P d x = + unit-trunc-Prop (d x) + + is-decidable-subtype-is-full-union-subtype-complement-subtype : + (P : subtype l2 A) → + is-full-subtype (union-subtype P (complement-subtype P)) → + is-decidable-subtype P + is-decidable-subtype-is-full-union-subtype-complement-subtype P H x = + apply-universal-property-trunc-Prop + ( H x) + ( is-decidable-Prop (P x)) + ( id) + + is-full-union-subtype-complement-decidable-subtype : + (P : decidable-subtype l2 A) → + is-full-decidable-subtype + ( union-decidable-subtype P (complement-decidable-subtype P)) + is-full-union-subtype-complement-decidable-subtype P = + is-full-union-subtype-complement-subtype + ( subtype-decidable-subtype P) + ( is-decidable-decidable-subtype P) +``` diff --git a/src/logic/complements-double-negation-stable-subtypes.lagda.md b/src/logic/complements-double-negation-stable-subtypes.lagda.md new file mode 100644 index 0000000000..be18e959f2 --- /dev/null +++ b/src/logic/complements-double-negation-stable-subtypes.lagda.md @@ -0,0 +1,75 @@ +# Complements of double negation stable subtypes + +```agda +module logic.complements-double-negation-stable-subtypes where +``` + +
Imports + +```agda +open import foundation.dependent-pair-types +open import foundation.double-negation +open import foundation.double-negation-stable-propositions +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.subtypes +open import foundation.unions-subtypes +open import foundation.universe-levels + +open import foundation-core.function-types + +open import logic.double-negation-stable-subtypes + +open import order-theory.large-posets +open import order-theory.opposite-large-posets +open import order-theory.order-preserving-maps-large-posets +open import order-theory.order-preserving-maps-large-preorders +open import order-theory.order-preserving-maps-posets +open import order-theory.order-preserving-maps-preorders +open import order-theory.posets +``` + +
+ +## Idea + +The +{{#concept "complement" Disambiguation="of a double negation stable subtype" Agda=complement-double-negation-stable-subtype}} +of a +[double negation stable subtype](foundation.double-negation-stable-subtypes.md) +`B ⊆ A` consists of the elements that are not in `B`. + +## Definition + +### Complements of double negation stable subtypes + +```agda +complement-double-negation-stable-subtype : + {l1 l2 : Level} {A : UU l1} → + double-negation-stable-subtype l2 A → + double-negation-stable-subtype l2 A +complement-double-negation-stable-subtype P x = + neg-Double-Negation-Stable-Prop (P x) +``` + +## Properties + +### Taking complements is an involution on double negation stable subtypes + +```agda +is-involution-complement-double-negation-stable-subtype : + {l1 l2 : Level} {A : UU l1} → + is-involution (complement-double-negation-stable-subtype {l1} {l2} {A}) +is-involution-complement-double-negation-stable-subtype P = + eq-has-same-elements-double-negation-stable-subtype + ( complement-double-negation-stable-subtype + ( complement-double-negation-stable-subtype P)) + ( P) + ( λ x → + ( is-double-negation-stable-double-negation-stable-subtype P x , + intro-double-negation)) +``` diff --git a/src/logic/de-morgan-embeddings.lagda.md b/src/logic/de-morgan-embeddings.lagda.md new file mode 100644 index 0000000000..102b62237e --- /dev/null +++ b/src/logic/de-morgan-embeddings.lagda.md @@ -0,0 +1,685 @@ +# De Morgan embeddings + +```agda +module logic.de-morgan-embeddings where +``` + +
Imports + +```agda +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.embeddings +open import foundation.fibers-of-maps +open import foundation.functoriality-cartesian-product-types +open import foundation.functoriality-coproduct-types +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 +open import foundation-core.functoriality-dependent-pair-types +open import foundation-core.homotopies +open import foundation-core.injective-maps +open import foundation-core.torsorial-type-families + +open import logic.de-morgan-maps +open import logic.de-morgan-propositions +open import logic.de-morgan-types +open import logic.double-negation-eliminating-maps +open import logic.double-negation-elimination +``` + +
+ +## Idea + +A [map](foundation-core.function-types.md) is said to be a +{{#concept "De Morgan embedding" Disambiguation="of types" Agda=is-de-morgan-emb}} +if it is an [embedding](foundation-core.embeddings.md) and the +[negations](foundation-core.negation.md) of its +[fibers](foundation-core.fibers-of-maps.md) are +[decidable](foundation-core.decidable-maps.md). + +Equivalently, a De Morgan embedding is a map whose fibers are +[De Morgan propositions](foundation.de-morgan-propositions.md). We refer to this +condition as being a +{{#concept "De Morgan propositional map" Disambiguation="of types" Agda=is-de-morgan-prop-map}}. + +## Definitions + +### The condition on a map of being a De Morgan embedding + +```agda +is-de-morgan-emb : + {l1 l2 : Level} {X : UU l1} {Y : UU l2} → (X → Y) → UU (l1 ⊔ l2) +is-de-morgan-emb f = is-emb f × is-de-morgan-map f + +module _ + {l1 l2 : Level} {X : UU l1} {Y : UU l2} {f : X → Y} + (F : is-de-morgan-emb f) + where + + is-emb-is-de-morgan-emb : is-emb f + is-emb-is-de-morgan-emb = pr1 F + + is-de-morgan-map-is-de-morgan-emb : + is-de-morgan-map f + is-de-morgan-map-is-de-morgan-emb = pr2 F + + is-prop-map-is-de-morgan-emb : is-prop-map f + is-prop-map-is-de-morgan-emb = + is-prop-map-is-emb is-emb-is-de-morgan-emb + + is-injective-is-de-morgan-emb : is-injective f + is-injective-is-de-morgan-emb = + is-injective-is-emb is-emb-is-de-morgan-emb +``` + +### De Morgan propositional maps + +```agda +module _ + {l1 l2 : Level} {X : UU l1} {Y : UU l2} + where + + is-de-morgan-prop-map : (X → Y) → UU (l1 ⊔ l2) + is-de-morgan-prop-map f = + (y : Y) → is-de-morgan-prop (fiber f y) + + is-prop-is-de-morgan-prop-map : + (f : X → Y) → is-prop (is-de-morgan-prop-map f) + is-prop-is-de-morgan-prop-map f = + is-prop-Π (λ y → is-prop-is-de-morgan-prop (fiber f y)) + + is-de-morgan-prop-map-Prop : (X → Y) → Prop (l1 ⊔ l2) + is-de-morgan-prop-map-Prop f = + ( is-de-morgan-prop-map f , is-prop-is-de-morgan-prop-map f) + + is-prop-map-is-de-morgan-prop-map : + {f : X → Y} → is-de-morgan-prop-map f → is-prop-map f + is-prop-map-is-de-morgan-prop-map H y = + is-prop-type-is-de-morgan-prop (H y) + + is-de-morgan-map-is-de-morgan-prop-map : + {f : X → Y} → is-de-morgan-prop-map f → is-de-morgan-map f + is-de-morgan-map-is-de-morgan-prop-map H y = + is-de-morgan-type-is-de-morgan-prop (H y) +``` + +### The type of De Morgan embeddings + +```agda +infix 5 _↪ᵈᵐ_ +_↪ᵈᵐ_ : + {l1 l2 : Level} (X : UU l1) (Y : UU l2) → UU (l1 ⊔ l2) +X ↪ᵈᵐ Y = Σ (X → Y) is-de-morgan-emb + +map-de-morgan-emb : + {l1 l2 : Level} {X : UU l1} {Y : UU l2} → X ↪ᵈᵐ Y → X → Y +map-de-morgan-emb e = pr1 e + +abstract + is-de-morgan-emb-map-de-morgan-emb : + {l1 l2 : Level} {X : UU l1} {Y : UU l2} (e : X ↪ᵈᵐ Y) → + is-de-morgan-emb (map-de-morgan-emb e) + is-de-morgan-emb-map-de-morgan-emb e = pr2 e + +abstract + is-emb-map-de-morgan-emb : + {l1 l2 : Level} {X : UU l1} {Y : UU l2} (e : X ↪ᵈᵐ Y) → + is-emb (map-de-morgan-emb e) + is-emb-map-de-morgan-emb e = + is-emb-is-de-morgan-emb + ( is-de-morgan-emb-map-de-morgan-emb e) + +abstract + is-de-morgan-map-map-de-morgan-emb : + {l1 l2 : Level} {X : UU l1} {Y : UU l2} (e : X ↪ᵈᵐ Y) → + is-de-morgan-map (map-de-morgan-emb e) + is-de-morgan-map-map-de-morgan-emb e = + is-de-morgan-map-is-de-morgan-emb + ( is-de-morgan-emb-map-de-morgan-emb e) + +emb-de-morgan-emb : + {l1 l2 : Level} {X : UU l1} {Y : UU l2} → X ↪ᵈᵐ Y → X ↪ Y +pr1 (emb-de-morgan-emb e) = map-de-morgan-emb e +pr2 (emb-de-morgan-emb e) = is-emb-map-de-morgan-emb e +``` + +## Properties + +### Any map of which the fibers are De Morgan propositions is a De Morgan embedding + +```agda +module _ + {l1 l2 : Level} {X : UU l1} {Y : UU l2} {f : X → Y} + where + + abstract + is-de-morgan-emb-is-de-morgan-prop-map : + is-de-morgan-prop-map f → is-de-morgan-emb f + pr1 (is-de-morgan-emb-is-de-morgan-prop-map H) = + is-emb-is-prop-map (is-prop-map-is-de-morgan-prop-map H) + pr2 (is-de-morgan-emb-is-de-morgan-prop-map H) = + is-de-morgan-map-is-de-morgan-prop-map H + + abstract + is-de-morgan-prop-map-is-de-morgan-emb : + is-de-morgan-emb f → is-de-morgan-prop-map f + pr1 (is-de-morgan-prop-map-is-de-morgan-emb H y) = + is-prop-map-is-de-morgan-emb H y + pr2 (is-de-morgan-prop-map-is-de-morgan-emb H y) = + is-de-morgan-map-is-de-morgan-emb H y +``` + +### The first projection map of a dependent sum of De Morgan propositions is a De Morgan embedding + +```agda +module _ + {l1 l2 : Level} {A : UU l1} (Q : A → De-Morgan-Prop l2) + where + + is-de-morgan-prop-map-pr1 : + is-de-morgan-prop-map + ( pr1 {B = type-De-Morgan-Prop ∘ Q}) + is-de-morgan-prop-map-pr1 y = + is-de-morgan-prop-equiv + ( equiv-fiber-pr1 (type-De-Morgan-Prop ∘ Q) y) + ( is-de-morgan-prop-type-De-Morgan-Prop (Q y)) + + is-de-morgan-emb-pr1 : + is-de-morgan-emb + ( pr1 {B = type-De-Morgan-Prop ∘ Q}) + is-de-morgan-emb-pr1 = + is-de-morgan-emb-is-de-morgan-prop-map + ( is-de-morgan-prop-map-pr1) +``` + +### Decidable embeddings are De Morgan + +```agda +is-de-morgan-map-is-decidable-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} → + is-decidable-emb f → is-de-morgan-map f +is-de-morgan-map-is-decidable-emb H = + is-de-morgan-map-is-decidable-map + ( is-decidable-map-is-decidable-emb H) + +abstract + is-de-morgan-emb-is-decidable-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} → + is-decidable-emb f → is-de-morgan-emb f + is-de-morgan-emb-is-decidable-emb H = + ( is-emb-is-decidable-emb H , + is-de-morgan-map-is-decidable-emb H) +``` + +### Equivalences are De Morgan embeddings + +```agda +abstract + is-de-morgan-emb-is-equiv : + {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} → + is-equiv f → is-de-morgan-emb f + is-de-morgan-emb-is-equiv H = + ( is-emb-is-equiv H , is-de-morgan-map-is-equiv H) +``` + +### Identity maps are De Morgan embeddings + +```agda +is-de-morgan-emb-id : + {l : Level} {A : UU l} → is-de-morgan-emb (id {A = A}) +is-de-morgan-emb-id = + ( is-emb-id , is-de-morgan-map-id) + +de-morgan-emb-id : {l : Level} {A : UU l} → A ↪ᵈᵐ A +de-morgan-emb-id = (id , is-de-morgan-emb-id) + +is-de-morgan-prop-map-id : + {l : Level} {A : UU l} → is-de-morgan-prop-map (id {A = A}) +is-de-morgan-prop-map-id y = + is-de-morgan-prop-is-contr (is-torsorial-Id' y) +``` + +### Being a De Morgan embedding is a property + +```agda +abstract + is-prop-is-de-morgan-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A → B) → + is-prop (is-de-morgan-emb f) + is-prop-is-de-morgan-emb f = + is-prop-product (is-property-is-emb f) is-prop-is-de-morgan-map +``` + +### De Morgan embeddings are closed under homotopies + +```agda +abstract + is-de-morgan-emb-htpy : + {l1 l2 : Level} {A : UU l1} {B : UU l2} {f g : A → B} → + f ~ g → is-de-morgan-emb g → is-de-morgan-emb f + is-de-morgan-emb-htpy {f = f} {g} H K = + ( is-emb-htpy H (is-emb-is-de-morgan-emb K) , + is-de-morgan-map-htpy H + ( is-de-morgan-map-is-de-morgan-emb K)) +``` + +### De Morgan embeddings are closed under composition + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} + {g : B → C} {f : A → B} + where + + is-de-morgan-map-comp-is-decidable-emb : + is-decidable-emb g → + is-de-morgan-map f → + is-de-morgan-map (g ∘ f) + is-de-morgan-map-comp-is-decidable-emb G F = + is-de-morgan-map-comp-is-decidable-map + ( is-injective-is-decidable-emb G) + ( is-decidable-map-is-decidable-emb G) + ( F) + + is-de-morgan-prop-map-comp-is-decidable-prop-map : + is-decidable-prop-map g → + is-de-morgan-prop-map f → + is-de-morgan-prop-map (g ∘ f) + is-de-morgan-prop-map-comp-is-decidable-prop-map K H z = + is-de-morgan-prop-equiv + ( compute-fiber-comp g f z) + ( is-de-morgan-prop-Σ (K z) (H ∘ pr1)) + + is-de-morgan-emb-comp-is-decidable-emb : + is-decidable-emb g → + is-de-morgan-emb f → + is-de-morgan-emb (g ∘ f) + is-de-morgan-emb-comp-is-decidable-emb K H = + is-de-morgan-emb-is-de-morgan-prop-map + ( is-de-morgan-prop-map-comp-is-decidable-prop-map + ( is-decidable-prop-map-is-decidable-emb K) + ( is-de-morgan-prop-map-is-de-morgan-emb H)) + +comp-de-morgan-emb : + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} → + B ↪ᵈ C → A ↪ᵈᵐ B → A ↪ᵈᵐ C +comp-de-morgan-emb (g , G) (f , F) = + ( g ∘ f , is-de-morgan-emb-comp-is-decidable-emb G F) +``` + +### Left cancellation for De Morgan embeddings + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {f : A → B} {g : B → C} + where + + is-de-morgan-emb-right-factor' : + is-de-morgan-emb (g ∘ f) → + is-emb g → + is-de-morgan-emb f + is-de-morgan-emb-right-factor' GH G = + ( is-emb-right-factor g f G (is-emb-is-de-morgan-emb GH) , + is-de-morgan-map-right-factor' + ( is-injective-is-emb G) + ( is-de-morgan-map-is-de-morgan-emb GH)) + + is-de-morgan-emb-right-factor : + is-de-morgan-emb (g ∘ f) → + is-de-morgan-emb g → + is-de-morgan-emb f + is-de-morgan-emb-right-factor GH G = + is-de-morgan-emb-right-factor' + ( GH) + ( is-emb-is-de-morgan-emb G) +``` + +### In a commuting triangle of maps, if the top and right maps are De Morgan embeddings so is the left map + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} + {top : A → B} {left : A → C} {right : B → C} + (H : left ~ right ∘ top) + where + + is-de-morgan-emb-left-map-triangle-is-decidable-emb-top : + is-de-morgan-emb top → + is-decidable-emb right → + is-de-morgan-emb left + is-de-morgan-emb-left-map-triangle-is-decidable-emb-top T R = + is-de-morgan-emb-htpy H + ( is-de-morgan-emb-comp-is-decidable-emb R T) +``` + +### In a commuting triangle of maps, if the left and right maps are De Morgan embeddings so is the top map + +In fact, the right map need only be an embedding. + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} + {top : A → B} {left : A → C} {right : B → C} + (H : left ~ right ∘ top) + where + + is-de-morgan-emb-top-map-triangle' : + is-emb right → + is-de-morgan-emb left → + is-de-morgan-emb top + is-de-morgan-emb-top-map-triangle' R' L = + is-de-morgan-emb-right-factor' + ( is-de-morgan-emb-htpy (inv-htpy H) L) + ( R') + + is-de-morgan-emb-top-map-triangle : + is-de-morgan-emb right → + is-de-morgan-emb left → + is-de-morgan-emb top + is-de-morgan-emb-top-map-triangle R L = + is-de-morgan-emb-right-factor + ( is-de-morgan-emb-htpy (inv-htpy H) L) + ( R) +``` + +### Characterizing equality in the type of De Morgan embeddings + +```agda +htpy-de-morgan-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f g : A ↪ᵈᵐ B) → UU (l1 ⊔ l2) +htpy-de-morgan-emb f g = + map-de-morgan-emb f ~ map-de-morgan-emb g + +refl-htpy-de-morgan-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A ↪ᵈᵐ B) → + htpy-de-morgan-emb f f +refl-htpy-de-morgan-emb f = refl-htpy + +htpy-eq-de-morgan-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f g : A ↪ᵈᵐ B) → + f = g → htpy-de-morgan-emb f g +htpy-eq-de-morgan-emb f .f refl = + refl-htpy-de-morgan-emb f + +abstract + is-torsorial-htpy-de-morgan-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A ↪ᵈᵐ B) → + is-torsorial (htpy-de-morgan-emb f) + is-torsorial-htpy-de-morgan-emb f = + is-torsorial-Eq-subtype + ( is-torsorial-htpy (map-de-morgan-emb f)) + ( is-prop-is-de-morgan-emb) + ( map-de-morgan-emb f) + ( refl-htpy) + ( is-de-morgan-emb-map-de-morgan-emb f) + +abstract + is-equiv-htpy-eq-de-morgan-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f g : A ↪ᵈᵐ B) → + is-equiv (htpy-eq-de-morgan-emb f g) + is-equiv-htpy-eq-de-morgan-emb f = + fundamental-theorem-id + ( is-torsorial-htpy-de-morgan-emb f) + ( htpy-eq-de-morgan-emb f) + +eq-htpy-de-morgan-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f g : A ↪ᵈᵐ B) → + htpy-de-morgan-emb f g → f = g +eq-htpy-de-morgan-emb f g = + map-inv-is-equiv (is-equiv-htpy-eq-de-morgan-emb f g) +``` + +### Any map out of the empty type is a De Morgan embedding + +```agda +abstract + is-de-morgan-emb-ex-falso : + {l : Level} {X : UU l} → is-de-morgan-emb (ex-falso {l} {X}) + is-de-morgan-emb-ex-falso = + ( is-emb-ex-falso , is-de-morgan-map-ex-falso) + +de-morgan-emb-ex-falso : + {l : Level} {X : UU l} → empty ↪ᵈᵐ X +de-morgan-emb-ex-falso = + ( ex-falso , is-de-morgan-emb-ex-falso) +``` + +### The map on total spaces induced by a family of De Morgan embeddings is a De Morgan embedding + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : A → UU l2} {C : A → UU l3} + where + + is-de-morgan-emb-tot : + {f : (x : A) → B x → C x} → + ((x : A) → is-de-morgan-emb (f x)) → + is-de-morgan-emb (tot f) + is-de-morgan-emb-tot H = + ( is-emb-tot (is-emb-is-de-morgan-emb ∘ H) , + is-de-morgan-map-tot + ( is-de-morgan-map-is-de-morgan-emb ∘ H)) + + de-morgan-emb-tot : ((x : A) → B x ↪ᵈᵐ C x) → Σ A B ↪ᵈᵐ Σ A C + de-morgan-emb-tot f = + ( tot (map-de-morgan-emb ∘ f) , + is-de-morgan-emb-tot + ( is-de-morgan-emb-map-de-morgan-emb ∘ f)) +``` + +### The map on total spaces induced by a De Morgan embedding on the base is a De Morgan embedding + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} (C : B → UU l3) + where + + is-de-morgan-emb-map-Σ-map-base : + {f : A → B} → + is-de-morgan-emb f → + is-de-morgan-emb (map-Σ-map-base f C) + is-de-morgan-emb-map-Σ-map-base H = + ( is-emb-map-Σ-map-base C (is-emb-is-de-morgan-emb H) , + is-de-morgan-map-Σ-map-base C + ( is-de-morgan-map-is-de-morgan-emb H)) + + de-morgan-emb-map-Σ-map-base : + (f : A ↪ᵈᵐ B) → Σ A (C ∘ map-de-morgan-emb f) ↪ᵈᵐ Σ B C + de-morgan-emb-map-Σ-map-base f = + ( map-Σ-map-base (map-de-morgan-emb f) C , + is-de-morgan-emb-map-Σ-map-base + ( is-de-morgan-emb-map-de-morgan-emb f)) +``` + +### The functoriality of dependent pair types on De Morgan embeddings + +```agda +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {C : A → UU l3} (D : B → UU l4) + where + + is-de-morgan-emb-map-Σ : + {f : A → B} {g : (x : A) → C x → D (f x)} → + is-decidable-emb f → + ((x : A) → is-de-morgan-emb (g x)) → + is-de-morgan-emb (map-Σ D f g) + is-de-morgan-emb-map-Σ {f} {g} F G = + is-de-morgan-emb-left-map-triangle-is-decidable-emb-top + ( triangle-map-Σ D f g) + ( is-de-morgan-emb-tot G) + ( is-decidable-emb-map-Σ-map-base D F) + + de-morgan-emb-Σ : + (f : A ↪ᵈ B) → + ((x : A) → C x ↪ᵈᵐ D (map-decidable-emb f x)) → + Σ A C ↪ᵈᵐ Σ B D + de-morgan-emb-Σ f g = + ( ( map-Σ D (map-decidable-emb f) (map-de-morgan-emb ∘ g)) , + ( is-de-morgan-emb-map-Σ + ( is-decidable-emb-map-decidable-emb f) + ( is-de-morgan-emb-map-de-morgan-emb ∘ g))) +``` + +### Products of De Morgan embeddings are De Morgan embeddings + +```agda +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {D : UU l4} + where + + is-de-morgan-emb-map-product : + {f : A → B} {g : C → D} → + is-de-morgan-emb f → + is-de-morgan-emb g → + is-de-morgan-emb (map-product f g) + is-de-morgan-emb-map-product (eF , dF) (eG , dG) = + ( is-emb-map-product eF eG , + is-de-morgan-map-product dF dG) + + de-morgan-emb-product : + A ↪ᵈᵐ B → C ↪ᵈᵐ D → A × C ↪ᵈᵐ B × D + de-morgan-emb-product (f , F) (g , G) = + ( map-product f g , is-de-morgan-emb-map-product F G) +``` + +### Coproducts of De Morgan embeddings are De Morgan embeddings + +```agda +module _ + {l1 l2 l1' l2' : Level} {A : UU l1} {B : UU l2} {A' : UU l1'} {B' : UU l2'} + where + +abstract + is-de-morgan-emb-map-coproduct : + {l1 l2 l3 l4 : Level} + {A : UU l1} {B : UU l2} {X : UU l3} {Y : UU l4} + {f : A → B} {g : X → Y} → + is-de-morgan-emb f → + is-de-morgan-emb g → + is-de-morgan-emb (map-coproduct f g) + is-de-morgan-emb-map-coproduct (eF , dF) (eG , dG) = + ( is-emb-map-coproduct eF eG , + is-de-morgan-map-coproduct dF dG) +``` + +### De Morgan embeddings are closed under base change + +```agda +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {D : UU l4} + {f : A → B} {g : C → D} + where + + is-de-morgan-prop-map-base-change : + cartesian-hom-arrow g f → + is-de-morgan-prop-map f → + is-de-morgan-prop-map g + is-de-morgan-prop-map-base-change α F d = + is-de-morgan-prop-equiv + ( equiv-fibers-cartesian-hom-arrow g f α d) + ( F (map-codomain-cartesian-hom-arrow g f α d)) + + is-de-morgan-emb-base-change : + cartesian-hom-arrow g f → + is-de-morgan-emb f → + is-de-morgan-emb g + is-de-morgan-emb-base-change α F = + is-de-morgan-emb-is-de-morgan-prop-map + ( is-de-morgan-prop-map-base-change α + ( is-de-morgan-prop-map-is-de-morgan-emb F)) +``` + +### De Morgan embeddings are closed under retracts of maps + +```agda +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {X : UU l3} {Y : UU l4} + {f : A → B} {g : X → Y} + where + + is-de-morgan-prop-map-retract-map : + f retract-of-map g → + is-de-morgan-prop-map g → + is-de-morgan-prop-map f + is-de-morgan-prop-map-retract-map R G x = + is-de-morgan-prop-retract-of + ( retract-fiber-retract-map f g R x) + ( G (map-codomain-inclusion-retract-map f g R x)) + + is-de-morgan-emb-retract-map : + f retract-of-map g → + is-de-morgan-emb g → + is-de-morgan-emb f + is-de-morgan-emb-retract-map R G = + is-de-morgan-emb-is-de-morgan-prop-map + ( is-de-morgan-prop-map-retract-map R + ( is-de-morgan-prop-map-is-de-morgan-emb G)) +``` + +### A type is a De Morgan proposition if and only if its terminal map is a De Morgan embedding + +```agda +module _ + {l : Level} {A : UU l} + where + + is-de-morgan-prop-is-de-morgan-emb-terminal-map : + is-de-morgan-emb (terminal-map A) → + is-de-morgan-prop A + is-de-morgan-prop-is-de-morgan-emb-terminal-map H = + is-de-morgan-prop-equiv' + ( equiv-fiber-terminal-map star) + ( is-de-morgan-prop-map-is-de-morgan-emb H star) + + is-de-morgan-emb-terminal-map-is-de-morgan-prop : + is-de-morgan-prop A → + is-de-morgan-emb (terminal-map A) + is-de-morgan-emb-terminal-map-is-de-morgan-prop H = + is-de-morgan-emb-is-de-morgan-prop-map + ( λ y → + is-de-morgan-prop-equiv (equiv-fiber-terminal-map y) H) +``` + +### If a dependent sum of propositions over a proposition is De Morgan, then the family is a family of De Morgan propositions + +```agda +module _ + {l1 l2 : Level} (P : Prop l1) (Q : type-Prop P → Prop l2) + where + + is-de-morgan-prop-family-is-de-morgan-Σ : + is-de-morgan (Σ (type-Prop P) (type-Prop ∘ Q)) → + (p : type-Prop P) → is-de-morgan (type-Prop (Q p)) + is-de-morgan-prop-family-is-de-morgan-Σ H p = + is-de-morgan-equiv' + ( equiv-fiber-pr1 (type-Prop ∘ Q) p) + ( is-de-morgan-map-is-de-morgan-emb + ( is-de-morgan-emb-right-factor' + ( is-de-morgan-emb-terminal-map-is-de-morgan-prop + ( is-prop-Σ (is-prop-type-Prop P) (is-prop-type-Prop ∘ Q) , H)) + ( is-emb-terminal-map-is-prop (is-prop-type-Prop P))) + ( p)) +``` diff --git a/src/logic/de-morgan-maps.lagda.md b/src/logic/de-morgan-maps.lagda.md new file mode 100644 index 0000000000..1fdb864d4c --- /dev/null +++ b/src/logic/de-morgan-maps.lagda.md @@ -0,0 +1,329 @@ +# De Morgan maps + +```agda +module logic.de-morgan-maps where +``` + +
Imports + +```agda +open import elementary-number-theory.natural-numbers + +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 +open import foundation.double-negation +open import foundation.embeddings +open import foundation.empty-types +open import foundation.existential-quantification +open import foundation.functoriality-cartesian-product-types +open import foundation.functoriality-coproduct-types +open import foundation.identity-types +open import foundation.injective-maps +open import foundation.negation +open import foundation.propositions +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.unit-type +open import foundation.universal-property-equivalences +open import foundation.universe-levels + +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.functoriality-dependent-pair-types +open import foundation-core.homotopies + +open import logic.de-morgan-types +open import logic.de-morgans-law +open import logic.double-negation-eliminating-maps +open import logic.double-negation-elimination +``` + +
+ +## Idea + +A [map](foundation-core.function-types.md) is said to be +{{#concept "De Morgan" Disambiguation="map of types" Agda=is-de-morgan-map}} if +the [negation](foundation-core.negation.md) of its +[fibers](foundation-core.fibers-of-maps.md) are +[decidable](foundation.decidable-types.md). I.e., the map `f : A → B` is De +Morgan if for every `y : B`, the fiber `fiber f y` is either +[empty](foundation.empty-types.md) or +[irrefutable](foundation.irrefutable-propositions.md). This is equivalent to +asking that the fibers satisfy [De Morgan's law](logic.de-morgans-law.md), but +is a [small](foundation.small-types.md) condition. + +## Definintion + +### De Morgan maps + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + is-de-morgan-map : (A → B) → UU (l1 ⊔ l2) + is-de-morgan-map f = (y : B) → is-de-morgan (fiber f y) + + is-prop-is-de-morgan-map : {f : A → B} → is-prop (is-de-morgan-map f) + is-prop-is-de-morgan-map {f} = + is-prop-Π (λ y → is-prop-is-de-morgan (fiber f y)) + + is-de-morgan-map-Prop : (A → B) → Prop (l1 ⊔ l2) + is-de-morgan-map-Prop f = is-de-morgan-map f , is-prop-is-de-morgan-map +``` + +### The type of De Morgan maps + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + de-morgan-map : UU (l1 ⊔ l2) + de-morgan-map = Σ (A → B) (is-de-morgan-map) +``` + +### Self-De-Morgan maps + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + is-self-de-morgan-map : (A → B) → UU (l1 ⊔ l2) + is-self-de-morgan-map f = + (y z : B) → de-morgans-law' (fiber f y) (fiber f z) +``` + +## Properties + +### De Morgan maps are closed under homotopy + +```agda +abstract + is-de-morgan-map-htpy : + {l1 l2 : Level} {A : UU l1} {B : UU l2} {f g : A → B} → + f ~ g → + is-de-morgan-map g → + is-de-morgan-map f + is-de-morgan-map-htpy H K b = + is-decidable-equiv' + ( equiv-precomp (equiv-tot (λ a → equiv-concat (inv (H a)) b)) empty) + ( K b) +``` + +### Decidable maps are De Morgan + +```agda +is-de-morgan-map-is-decidable-map : + {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} → + is-decidable-map f → is-de-morgan-map f +is-de-morgan-map-is-decidable-map H y = is-de-morgan-is-decidable (H y) +``` + +### Double negation eliminating De Morgan maps are decidable + +```agda +is-decidable-map-is-double-negation-eliminating-de-morgan-map : + {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} → + is-de-morgan-map f → is-double-negation-eliminating-map f → is-decidable-map f +is-decidable-map-is-double-negation-eliminating-de-morgan-map H K y = + is-decidable-is-decidable-neg-has-double-negation-elim (K y) (H y) +``` + +### Left cancellation for De Morgan maps + +If a composite `g ∘ f` is De Morgan and the left factor `g` is injective, then +the right factor `f` is De Morgan. + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {f : A → B} {g : B → C} + where + + is-de-morgan-map-right-factor' : + is-injective g → + is-de-morgan-map (g ∘ f) → + is-de-morgan-map f + is-de-morgan-map-right-factor' H GF y = + rec-coproduct + ( λ ngfy → inl (λ p → ngfy (pr1 p , ap g (pr2 p)))) + ( λ nngfy → inr (λ nq → nngfy (λ p → nq (pr1 p , H (pr2 p))))) + ( GF (g y)) +``` + +### Composition of De Morgan maps with decidable maps + +If `g` is a decidable injection and `f` is a De Morgan map, then `g ∘ f` is De +Morgan. + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {f : A → B} {g : B → C} + where + + is-de-morgan-map-comp-is-decidable-map : + is-injective g → + is-decidable-map g → + is-de-morgan-map f → + is-de-morgan-map (g ∘ f) + is-de-morgan-map-comp-is-decidable-map H G F y = + rec-coproduct + ( λ u → + is-de-morgan-iff + ( λ v → (pr1 v) , ap g (pr2 v) ∙ pr2 u) + ( λ w → pr1 w , H (pr2 w ∙ inv (pr2 u))) + ( F (pr1 u))) + ( λ ng → inl (λ u → ng (f (pr1 u) , pr2 u))) + ( G y) +``` + +### Any map out of the empty type is De Morgan + +```agda +abstract + is-de-morgan-map-ex-falso : + {l : Level} {X : UU l} → is-de-morgan-map (ex-falso {l} {X}) + is-de-morgan-map-ex-falso = + is-de-morgan-map-is-decidable-map is-decidable-map-ex-falso +``` + +### The identity map is De Morgan + +```agda +abstract + is-de-morgan-map-id : + {l : Level} {X : UU l} → is-de-morgan-map (id {l} {X}) + is-de-morgan-map-id = + is-de-morgan-map-is-decidable-map is-decidable-map-id +``` + +### Equivalences are De Morgan maps + +```agda +abstract + is-de-morgan-map-is-equiv : + {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} → + is-equiv f → is-de-morgan-map f + is-de-morgan-map-is-equiv H = + is-de-morgan-map-is-decidable-map (is-decidable-map-is-equiv H) +``` + +### The map on total spaces induced by a family of De Morgan maps is De Morgan + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : A → UU l2} {C : A → UU l3} + where + + is-de-morgan-map-tot : + {f : (x : A) → B x → C x} → + ((x : A) → is-de-morgan-map (f x)) → + is-de-morgan-map (tot f) + is-de-morgan-map-tot {f} H x = + is-decidable-equiv (equiv-neg (compute-fiber-tot f x)) (H (pr1 x) (pr2 x)) +``` + +### The map on total spaces induced by a De Morgan map on the base is De Morgan + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} (C : B → UU l3) + where + + is-de-morgan-map-Σ-map-base : + {f : A → B} → + is-de-morgan-map f → + is-de-morgan-map (map-Σ-map-base f C) + is-de-morgan-map-Σ-map-base {f} H x = + is-decidable-equiv' + ( equiv-neg (compute-fiber-map-Σ-map-base f C x)) + ( H (pr1 x)) +``` + +### Products of De Morgan maps are De Morgan + +```agda +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {D : UU l4} + where + + is-de-morgan-map-product : + {f : A → B} {g : C → D} → + is-de-morgan-map f → + is-de-morgan-map g → + is-de-morgan-map (map-product f g) + is-de-morgan-map-product {f} {g} F G y = + is-de-morgan-equiv + ( compute-fiber-map-product f g y) + ( is-de-morgan-product (F (pr1 y)) (G (pr2 y))) +``` + +### Coproducts of De Morgan maps are De Morgan + +```agda +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {D : UU l4} + where + + is-de-morgan-map-coproduct : + {f : A → B} {g : C → D} → + is-de-morgan-map f → + is-de-morgan-map g → + is-de-morgan-map (map-coproduct f g) + is-de-morgan-map-coproduct {f} {g} F G (inl x) = + is-decidable-equiv' + ( equiv-neg (compute-fiber-inl-map-coproduct f g x)) + ( F x) + is-de-morgan-map-coproduct {f} {g} F G (inr x) = + is-decidable-equiv' + ( equiv-neg (compute-fiber-inr-map-coproduct f g x)) + ( G x) +``` + +### De Morgan maps are closed under base change + +```agda +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {D : UU l4} + {f : A → B} {g : C → D} + where + + is-de-morgan-map-base-change : + cartesian-hom-arrow g f → + is-de-morgan-map f → + is-de-morgan-map g + is-de-morgan-map-base-change α F d = + is-decidable-equiv + ( equiv-neg (equiv-fibers-cartesian-hom-arrow g f α d)) + ( F (map-codomain-cartesian-hom-arrow g f α d)) +``` + +### De Morgan maps are closed under retracts of maps + +```agda +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {X : UU l3} {Y : UU l4} + {f : A → B} {g : X → Y} + where + + is-de-morgan-retract-map : + f retract-of-map g → + is-de-morgan-map g → + is-de-morgan-map f + is-de-morgan-retract-map R G x = + is-decidable-iff + ( map-neg (inclusion-retract (retract-fiber-retract-map f g R x))) + ( map-neg (map-retraction-retract (retract-fiber-retract-map f g R x))) + ( G (map-codomain-inclusion-retract-map f g R x)) +``` diff --git a/src/logic/de-morgan-propositions.lagda.md b/src/logic/de-morgan-propositions.lagda.md new file mode 100644 index 0000000000..2c4e7ea966 --- /dev/null +++ b/src/logic/de-morgan-propositions.lagda.md @@ -0,0 +1,340 @@ +# De Morgan propositions + +```agda +module logic.de-morgan-propositions where +``` + +
Imports + +```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 +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.evaluation-functions +open import foundation.function-types +open import foundation.functoriality-dependent-pair-types +open import foundation.identity-types +open import foundation.irrefutable-propositions +open import foundation.logical-equivalences +open import foundation.negation +open import foundation.propositional-extensionality +open import foundation.propositional-truncations +open import foundation.propositions +open import foundation.retracts-of-types +open import foundation.sets +open import foundation.subtypes +open import foundation.transport-along-identifications +open import foundation.universe-levels + +open import foundation-core.decidable-propositions + +open import logic.de-morgan-types +open import logic.de-morgans-law +``` + +
+ +## Idea + +In classical logic, i.e., logic where we assume +[the law of excluded middle](foundation.law-of-excluded-middle.md), the _De +Morgan laws_ refers to the pair of logical equivalences + +```text + ¬ (P ∨ Q) ⇔ (¬ P) ∧ (¬ Q) + ¬ (P ∧ Q) ⇔ (¬ P) ∨ (¬ Q). +``` + +Out of these in total four logical implications, all but one are validated in +constructive mathematics. The odd one out is + +```text + ¬ (P ∧ Q) ⇒ (¬ P) ∨ (¬ Q). +``` + +Indeed, this would state that we could constructively deduce from a proof that +neither `P` nor `Q` is true, whether of `P` is false or `Q` is false. This +logical law is what we refer to as [De Morgan's Law](logic.de-morgans-law.md). +If a proposition `P` is such that for every other proposition `Q`, the De Morgan +implication + +```text + ¬ (P ∧ Q) ⇒ (¬ P) ∨ (¬ Q) +``` + +holds, we say `P` is {{#concept "De Morgan" Disambiguation="proposition"}}. + +Equivalently, a proposition is De Morgan if its negation is decidable. Since +this is a [small](foundation.small-types.md) condition, it is frequently more +convenient to use. + +## Definition + +### The predicate on propositions of being De Morgan + +```agda +module _ + {l : Level} (P : UU l) + where + + is-de-morgan-prop : UU l + is-de-morgan-prop = is-prop P × is-de-morgan P + + is-prop-is-de-morgan-prop : is-prop is-de-morgan-prop + is-prop-is-de-morgan-prop = + is-prop-product (is-prop-is-prop P) (is-prop-is-de-morgan P) + + is-de-morgan-prop-Prop : Prop l + is-de-morgan-prop-Prop = is-de-morgan-prop , is-prop-is-de-morgan-prop + +module _ + {l : Level} {P : UU l} (H : is-de-morgan-prop P) + where + + is-prop-type-is-de-morgan-prop : is-prop P + is-prop-type-is-de-morgan-prop = pr1 H + + is-de-morgan-type-is-de-morgan-prop : is-de-morgan P + is-de-morgan-type-is-de-morgan-prop = pr2 H +``` + +### The subuniverse of De Morgan propositions + +```agda +De-Morgan-Prop : (l : Level) → UU (lsuc l) +De-Morgan-Prop l = Σ (UU l) (is-de-morgan-prop) + +module _ + {l : Level} (A : De-Morgan-Prop l) + where + + type-De-Morgan-Prop : UU l + type-De-Morgan-Prop = pr1 A + + is-de-morgan-prop-type-De-Morgan-Prop : is-de-morgan-prop type-De-Morgan-Prop + is-de-morgan-prop-type-De-Morgan-Prop = pr2 A + + is-prop-type-De-Morgan-Prop : is-prop type-De-Morgan-Prop + is-prop-type-De-Morgan-Prop = + is-prop-type-is-de-morgan-prop is-de-morgan-prop-type-De-Morgan-Prop + + is-de-morgan-type-De-Morgan-Prop : is-de-morgan type-De-Morgan-Prop + is-de-morgan-type-De-Morgan-Prop = + is-de-morgan-type-is-de-morgan-prop is-de-morgan-prop-type-De-Morgan-Prop + + prop-De-Morgan-Prop : Prop l + prop-De-Morgan-Prop = type-De-Morgan-Prop , is-prop-type-De-Morgan-Prop + + de-morgan-type-De-Morgan-Prop : De-Morgan-Type l + de-morgan-type-De-Morgan-Prop = + type-De-Morgan-Prop , is-de-morgan-type-De-Morgan-Prop +``` + +## Properties + +### The forgetful map from De Morgan propositions to propositions is an embedding + +```agda +is-emb-prop-De-Morgan-Prop : + {l : Level} → is-emb (prop-De-Morgan-Prop {l}) +is-emb-prop-De-Morgan-Prop = + is-emb-tot + ( λ X → + is-emb-inclusion-subtype (λ _ → is-de-morgan X , is-prop-is-de-morgan X)) + +emb-prop-De-Morgan-Prop : + {l : Level} → De-Morgan-Prop l ↪ Prop l +emb-prop-De-Morgan-Prop = + ( prop-De-Morgan-Prop , is-emb-prop-De-Morgan-Prop) +``` + +### The subuniverse of De Morgan propositions is a set + +```agda +is-set-De-Morgan-Prop : {l : Level} → is-set (De-Morgan-Prop l) +is-set-De-Morgan-Prop {l} = + is-set-emb emb-prop-De-Morgan-Prop is-set-type-Prop + +set-De-Morgan-Prop : (l : Level) → Set (lsuc l) +set-De-Morgan-Prop l = (De-Morgan-Prop l , is-set-De-Morgan-Prop) +``` + +### Extensionality of De Morgan propositions + +```agda +module _ + {l : Level} (P Q : De-Morgan-Prop l) + where + + extensionality-De-Morgan-Prop : + (P = Q) ≃ (type-De-Morgan-Prop P ↔ type-De-Morgan-Prop Q) + extensionality-De-Morgan-Prop = + ( propositional-extensionality + ( prop-De-Morgan-Prop P) + ( prop-De-Morgan-Prop Q)) ∘e + ( equiv-ap-emb emb-prop-De-Morgan-Prop) + + iff-eq-De-Morgan-Prop : P = Q → type-De-Morgan-Prop P ↔ type-De-Morgan-Prop Q + iff-eq-De-Morgan-Prop = map-equiv extensionality-De-Morgan-Prop + + eq-iff-De-Morgan-Prop' : type-De-Morgan-Prop P ↔ type-De-Morgan-Prop Q → P = Q + eq-iff-De-Morgan-Prop' = map-inv-equiv extensionality-De-Morgan-Prop + + eq-iff-De-Morgan-Prop : + (type-De-Morgan-Prop P → type-De-Morgan-Prop Q) → + (type-De-Morgan-Prop Q → type-De-Morgan-Prop P) → + P = Q + eq-iff-De-Morgan-Prop f g = eq-iff-De-Morgan-Prop' (f , g) +``` + +### De Morgan propositions are closed under retracts + +```agda +is-de-morgan-prop-retract-of : + {l1 l2 : Level} {P : UU l1} {Q : UU l2} → + P retract-of Q → is-de-morgan-prop Q → is-de-morgan-prop P +is-de-morgan-prop-retract-of R H = + is-prop-retract-of R (is-prop-type-is-de-morgan-prop H) , + is-de-morgan-iff' (iff-retract' R) (is-de-morgan-type-is-de-morgan-prop H) +``` + +### De Morgan propositions are closed under equivalences + +```agda +is-de-morgan-prop-equiv : + {l1 l2 : Level} {P : UU l1} {Q : UU l2} → + P ≃ Q → is-de-morgan-prop Q → is-de-morgan-prop P +is-de-morgan-prop-equiv e = is-de-morgan-prop-retract-of (retract-equiv e) + +is-de-morgan-prop-equiv' : + {l1 l2 : Level} {P : UU l1} {Q : UU l2} → + Q ≃ P → is-de-morgan-prop Q → is-de-morgan-prop P +is-de-morgan-prop-equiv' e = is-de-morgan-prop-retract-of (retract-inv-equiv e) +``` + +### Irrefutable propositions are De Morgan + +```agda +is-de-morgan-prop-is-irrefutable-prop : + {l : Level} {P : UU l} → is-irrefutable-prop P → is-de-morgan-prop P +is-de-morgan-prop-is-irrefutable-prop = tot (λ _ → is-de-morgan-is-irrefutable) +``` + +### Contractible types are De Morgan propositions + +```agda +is-de-morgan-prop-is-contr : + {l : Level} {P : UU l} → is-contr P → is-de-morgan-prop P +is-de-morgan-prop-is-contr H = + is-de-morgan-prop-is-irrefutable-prop (is-irrefutable-prop-is-contr H) +``` + +### Empty types are De Morgan propositions + +```agda +is-de-morgan-prop-is-empty : + {l : Level} {P : UU l} → is-empty P → is-de-morgan-prop P +is-de-morgan-prop-is-empty H = is-prop-is-empty H , is-de-morgan-is-empty H +``` + +### Dependent sums of De Morgan propositions over decidable propositions + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : A → UU l2} + where + + is-de-morgan-prop-Σ' : + is-decidable-prop A → ((x : A) → is-de-morgan (B x)) → is-de-morgan (Σ A B) + is-de-morgan-prop-Σ' (is-prop-A , inl a) b = + rec-coproduct + ( λ nb → inl λ ab → nb (tr B (eq-is-prop is-prop-A) (pr2 ab))) + ( λ x → inr (λ z → x (λ b → z (a , b)))) + ( b a) + is-de-morgan-prop-Σ' (is-prop-A , inr na) b = inl (λ ab → na (pr1 ab)) + + is-de-morgan-prop-Σ : + is-decidable-prop A → + ((x : A) → is-de-morgan-prop (B x)) → + is-de-morgan-prop (Σ A B) + is-de-morgan-prop-Σ a b = + ( is-prop-Σ + ( is-prop-type-is-decidable-prop a) + ( is-prop-type-is-de-morgan-prop ∘ b)) , + ( is-de-morgan-prop-Σ' a (is-de-morgan-type-is-de-morgan-prop ∘ b)) +``` + +### The negation operation on decidable propositions + +```agda +is-de-morgan-prop-neg : + {l1 : Level} {A : UU l1} → is-de-morgan A → is-de-morgan-prop (¬ A) +is-de-morgan-prop-neg is-de-morgan-A = + ( is-prop-neg , is-de-morgan-neg is-de-morgan-A) + +neg-type-De-Morgan-Prop : + {l1 : Level} (A : UU l1) → is-de-morgan A → De-Morgan-Prop l1 +neg-type-De-Morgan-Prop A is-de-morgan-A = + ( ¬ A , is-de-morgan-prop-neg is-de-morgan-A) + +neg-De-Morgan-Prop : + {l1 : Level} → De-Morgan-Prop l1 → De-Morgan-Prop l1 +neg-De-Morgan-Prop P = + neg-type-De-Morgan-Prop + ( type-De-Morgan-Prop P) + ( is-de-morgan-type-De-Morgan-Prop P) + +type-neg-De-Morgan-Prop : + {l1 : Level} → De-Morgan-Prop l1 → UU l1 +type-neg-De-Morgan-Prop P = type-De-Morgan-Prop (neg-De-Morgan-Prop P) +``` + +### Propositional truncations of De Morgan types are De Morgan propositions + +```agda +module _ + {l1 : Level} {A : UU l1} + where + + is-de-morgan-prop-trunc-Prop : + is-de-morgan A → is-de-morgan-prop (type-trunc-Prop A) + is-de-morgan-prop-trunc-Prop a = + ( is-prop-type-trunc-Prop , is-de-morgan-trunc a) +``` + +### Disjunctions of De Morgan types are De Morgan propositions + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + is-de-morgan-prop-disjunction : + is-de-morgan A → is-de-morgan B → is-de-morgan-prop (disjunction-type A B) + is-de-morgan-prop-disjunction a b = + is-de-morgan-prop-trunc-Prop (is-de-morgan-coproduct a b) +``` + +### Negation has no fixed points on decidable propositions + +```agda +abstract + no-fixed-points-neg-De-Morgan-Prop : + {l : Level} (P : De-Morgan-Prop l) → + ¬ (type-De-Morgan-Prop P ↔ ¬ (type-De-Morgan-Prop P)) + no-fixed-points-neg-De-Morgan-Prop P = + no-fixed-points-neg (type-De-Morgan-Prop P) +``` + +## External links + +- [De Morgan laws, in constructive mathematics](https://ncatlab.org/nlab/show/De+Morgan+laws#in_constructive_mathematics) + at $n$Lab diff --git a/src/logic/de-morgan-sheaves.lagda.md b/src/logic/de-morgan-sheaves.lagda.md new file mode 100644 index 0000000000..d400b87aa1 --- /dev/null +++ b/src/logic/de-morgan-sheaves.lagda.md @@ -0,0 +1,162 @@ +# De Morgan sheaves + +```agda +module logic.de-morgan-sheaves where +``` + +
Imports + +```agda +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.fibers-of-maps +open import foundation.diagonal-maps-of-types +open import foundation.unit-type +open import foundation.subtypes +open import foundation.precomposition-functions +open import foundation.empty-types +open import foundation.propositional-truncations +open import foundation.universal-property-propositional-truncation +open import foundation.irrefutable-propositions +open import foundation.logical-equivalences +open import foundation.negation +open import foundation.identity-types +open import foundation.embeddings +open import foundation.type-arithmetic-cartesian-product-types +open import foundation.universal-property-coproduct-types +open import foundation.universe-levels + +open import foundation-core.equivalences +open import foundation-core.function-types +open import foundation-core.propositions + +open import logic.de-morgans-law +open import logic.de-morgan-types +open import logic.double-negation-stable-subtypes +open import foundation.decidable-subtypes +open import logic.de-morgan-maps + +open import orthogonal-factorization-systems.double-negation-sheaves +open import orthogonal-factorization-systems.null-types +``` + +
+ +## Idea + +{{#concept "De morgan sheaves" Agda=is-de-morgan-sheaf}} are types that are +[null](orthogonal-factorization-systems.null-types.md) at +[propositions](foundation-core.propositions.md) of the form `¬P ∨ ¬¬P`. + +De Morgan sheaves are closely related to, but a strictly weaker notion than +[double negation sheaves](orthogonal-factorization-systems.double-negation-sheaves.md). + +## Definitions + +### The property of being a De Morgan sheaf + +**Note.** We present De Morgan sheaves as types that are null at `¬ P + ¬¬ P` +for all _types_ `P`, this is equivalent to being null at `¬ P ∨ ¬¬ P` for all +propositions `P`. The latter presentation demonstrates that De Morgan +sheafification is a lex accessible modality. + +```agda +is-de-morgan-sheaf : + (l1 : Level) {l2 : Level} (A : UU l2) → UU (lsuc l1 ⊔ l2) +is-de-morgan-sheaf l1 A = + (P : UU l1) → is-null (is-decidable (¬ P)) A + +is-prop-is-de-morgan-sheaf : + {l1 l2 : Level} {A : UU l2} → is-prop (is-de-morgan-sheaf l1 A) +is-prop-is-de-morgan-sheaf {A = A} = + is-prop-Π (λ P → is-prop-is-null (is-decidable (¬ P)) A) +``` + +### The subuniverse of De Morgan sheaves + +```agda +De-Morgan-Sheaf : (l1 l2 : Level) → UU (lsuc l1 ⊔ lsuc l2) +De-Morgan-Sheaf l1 l2 = Σ (UU l1) (is-de-morgan-sheaf l2) + +module _ + {l1 l2 : Level} (A : De-Morgan-Sheaf l1 l2) + where + + type-De-Morgan-Sheaf : UU l1 + type-De-Morgan-Sheaf = pr1 A + + is-de-morgan-type-De-Morgan-Sheaf : is-de-morgan-sheaf l2 type-De-Morgan-Sheaf + is-de-morgan-type-De-Morgan-Sheaf = pr2 A +``` + +## Properties + +### If the De Morgan predicate is idempotent at a type, then the type is De Morgan + +```agda +module _ + {l1 : Level} {A : UU l1} + where + + is-de-morgan-is-idempotent-is-de-morgan' : + (is-de-morgan (is-de-morgan A) → is-de-morgan A) → is-de-morgan A + is-de-morgan-is-idempotent-is-de-morgan' f = f (inr is-irrefutable-is-de-morgan) +``` + +### The empty type is a De Morgan sheaf + +```agda +is-de-morgan-sheaf-empty : + {l : Level} → is-de-morgan-sheaf l empty +is-de-morgan-sheaf-empty P = + is-equiv-has-converse empty-Prop + ( neg-type-Prop (is-decidable (¬ P))) + ( is-irrefutable-is-decidable) +``` + +### Contractible types are De Morgan sheaves + +```agda +is-de-morgan-sheaf-is-contr : + {l1 l2 : Level} {A : UU l1} → is-contr A → is-de-morgan-sheaf l2 A +is-de-morgan-sheaf-is-contr is-contr-A P = + is-null-is-contr (is-decidable (¬ P)) is-contr-A +``` + +### Double negation sheaves are De Morgan sheaves + +```agda +is-de-morgan-sheaf-is-double-negation-sheaf : + {l1 l2 : Level} {A : UU l1} → + is-double-negation-sheaf l2 A → + is-de-morgan-sheaf l2 A +is-de-morgan-sheaf-is-double-negation-sheaf H P = + H (is-decidable-prop-Irrefutable-Prop (neg-type-Prop P)) +``` + +### If a type is a De Morgan sheaf at propositions then it is a De Morgan sheaf at all types + +```agda +module _ + {l1 l2 : Level} {A : UU l1} + where + + is-de-morgan-sheaf-is-de-morgan-sheaf-Prop : + ((P : Prop l2) → is-null (is-decidable (¬ (type-Prop P))) A) → + is-de-morgan-sheaf l2 A + is-de-morgan-sheaf-is-de-morgan-sheaf-Prop H B = + is-null-equiv-exponent + ( inv-equiv equiv-is-de-morgan-trunc) + ( H (trunc-Prop B)) +``` + +## References + +{{#bibliography}} + +## External links + +- [De Morganization](https://ncatlab.org/nlab/show/De+Morganization) at $n$Lab diff --git a/src/logic/de-morgan-subtypes.lagda.md b/src/logic/de-morgan-subtypes.lagda.md new file mode 100644 index 0000000000..ade1645ebe --- /dev/null +++ b/src/logic/de-morgan-subtypes.lagda.md @@ -0,0 +1,334 @@ +# De Morgan subtypes + +```agda +module logic.de-morgan-subtypes where +``` + +
Imports + +```agda +open import foundation.1-types +open import foundation.coproduct-types +open import foundation.dependent-pair-types +open import foundation.equality-dependent-function-types +open import foundation.functoriality-cartesian-product-types +open import foundation.functoriality-dependent-pair-types +open import foundation.logical-equivalences +open import foundation.propositional-maps +open import foundation.sets +open import foundation.structured-type-duality +open import foundation.subtypes +open import foundation.type-theoretic-principle-of-choice +open import foundation.universe-levels + +open import foundation-core.embeddings +open import foundation-core.equivalences +open import foundation-core.fibers-of-maps +open import foundation-core.function-types +open import foundation-core.identity-types +open import foundation-core.injective-maps +open import foundation-core.propositions +open import foundation-core.truncated-types +open import foundation-core.truncation-levels + +open import logic.de-morgan-embeddings +open import logic.de-morgan-maps +open import logic.de-morgan-propositions +open import logic.de-morgan-types +``` + +
+ +## Idea + +A +{{#concept "De Morgan subtype" Disambiguation="of a type" Agda=is-de-morgan-subtype Agda=de-morgan-subtype}} +of a type consists of a family of +[De Morgan propositions](foundation.de-morgan-propositions.md) over it. + +## Definitions + +### Decidable subtypes + +```agda +is-de-morgan-subtype-Prop : + {l1 l2 : Level} {A : UU l1} → subtype l2 A → Prop (l1 ⊔ l2) +is-de-morgan-subtype-Prop {A = A} P = + Π-Prop A (λ a → is-de-morgan-Prop (type-Prop (P a))) + +is-de-morgan-subtype : + {l1 l2 : Level} {A : UU l1} → subtype l2 A → UU (l1 ⊔ l2) +is-de-morgan-subtype P = + type-Prop (is-de-morgan-subtype-Prop P) + +is-prop-is-de-morgan-subtype : + {l1 l2 : Level} {A : UU l1} (P : subtype l2 A) → + is-prop (is-de-morgan-subtype P) +is-prop-is-de-morgan-subtype P = + is-prop-type-Prop (is-de-morgan-subtype-Prop P) + +de-morgan-subtype : + {l1 : Level} (l : Level) (X : UU l1) → UU (l1 ⊔ lsuc l) +de-morgan-subtype l X = X → De-Morgan-Prop l +``` + +### The underlying subtype of a De Morgan subtype + +```agda +module _ + {l1 l2 : Level} {A : UU l1} (P : de-morgan-subtype l2 A) + where + + subtype-de-morgan-subtype : subtype l2 A + subtype-de-morgan-subtype a = + prop-De-Morgan-Prop (P a) + + is-de-morgan-de-morgan-subtype : + is-de-morgan-subtype subtype-de-morgan-subtype + is-de-morgan-de-morgan-subtype a = + is-de-morgan-type-De-Morgan-Prop (P a) + + is-in-de-morgan-subtype : A → UU l2 + is-in-de-morgan-subtype = + is-in-subtype subtype-de-morgan-subtype + + is-prop-is-in-de-morgan-subtype : + (a : A) → is-prop (is-in-de-morgan-subtype a) + is-prop-is-in-de-morgan-subtype = + is-prop-is-in-subtype subtype-de-morgan-subtype +``` + +### The underlying type of a De Morgan subtype + +```agda +module _ + {l1 l2 : Level} {A : UU l1} (P : de-morgan-subtype l2 A) + where + + type-de-morgan-subtype : UU (l1 ⊔ l2) + type-de-morgan-subtype = + type-subtype (subtype-de-morgan-subtype P) + + inclusion-de-morgan-subtype : + type-de-morgan-subtype → A + inclusion-de-morgan-subtype = + inclusion-subtype (subtype-de-morgan-subtype P) + + is-emb-inclusion-de-morgan-subtype : + is-emb inclusion-de-morgan-subtype + is-emb-inclusion-de-morgan-subtype = + is-emb-inclusion-subtype (subtype-de-morgan-subtype P) + + is-de-morgan-map-inclusion-de-morgan-subtype : + is-de-morgan-map inclusion-de-morgan-subtype + is-de-morgan-map-inclusion-de-morgan-subtype x = + is-de-morgan-equiv + ( equiv-fiber-pr1 (type-De-Morgan-Prop ∘ P) x) + ( is-de-morgan-type-De-Morgan-Prop (P x)) + + is-injective-inclusion-de-morgan-subtype : + is-injective inclusion-de-morgan-subtype + is-injective-inclusion-de-morgan-subtype = + is-injective-inclusion-subtype (subtype-de-morgan-subtype P) + + emb-de-morgan-subtype : type-de-morgan-subtype ↪ A + emb-de-morgan-subtype = + emb-subtype (subtype-de-morgan-subtype P) + + is-de-morgan-emb-inclusion-de-morgan-subtype : + is-de-morgan-emb inclusion-de-morgan-subtype + is-de-morgan-emb-inclusion-de-morgan-subtype = + ( is-emb-inclusion-de-morgan-subtype , + is-de-morgan-map-inclusion-de-morgan-subtype) + + de-morgan-emb-de-morgan-subtype : + type-de-morgan-subtype ↪ᵈᵐ A + de-morgan-emb-de-morgan-subtype = + ( inclusion-de-morgan-subtype , + is-de-morgan-emb-inclusion-de-morgan-subtype) +``` + +### The De Morgan subtype associated to a De Morgan embedding + +```agda +module _ + {l1 l2 : Level} {X : UU l1} {Y : UU l2} (f : X ↪ᵈᵐ Y) + where + + de-morgan-subtype-de-morgan-emb : + de-morgan-subtype (l1 ⊔ l2) Y + pr1 (de-morgan-subtype-de-morgan-emb y) = + fiber (map-de-morgan-emb f) y + pr2 (de-morgan-subtype-de-morgan-emb y) = + is-de-morgan-prop-map-is-de-morgan-emb + ( is-de-morgan-emb-map-de-morgan-emb f) + ( y) + + compute-type-de-morgan-type-de-morgan-emb : + type-de-morgan-subtype + de-morgan-subtype-de-morgan-emb ≃ + X + compute-type-de-morgan-type-de-morgan-emb = + equiv-total-fiber (map-de-morgan-emb f) + + inv-compute-type-de-morgan-type-de-morgan-emb : + X ≃ + type-de-morgan-subtype + de-morgan-subtype-de-morgan-emb + inv-compute-type-de-morgan-type-de-morgan-emb = + inv-equiv-total-fiber (map-de-morgan-emb f) +``` + +## Examples + +### The De Morgan subtypes of left and right elements in a coproduct type + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + is-de-morgan-is-left : + (x : A + B) → is-de-morgan (is-left x) + is-de-morgan-is-left (inl x) = is-de-morgan-unit + is-de-morgan-is-left (inr x) = is-de-morgan-empty + + is-left-De-Morgan-Prop : + A + B → De-Morgan-Prop lzero + pr1 (is-left-De-Morgan-Prop x) = is-left x + pr1 (pr2 (is-left-De-Morgan-Prop x)) = is-prop-is-left x + pr2 (pr2 (is-left-De-Morgan-Prop x)) = + is-de-morgan-is-left x + + is-de-morgan-is-right : + (x : A + B) → is-de-morgan (is-right x) + is-de-morgan-is-right (inl x) = is-de-morgan-empty + is-de-morgan-is-right (inr x) = is-de-morgan-unit + + is-right-De-Morgan-Prop : + A + B → De-Morgan-Prop lzero + pr1 (is-right-De-Morgan-Prop x) = is-right x + pr1 (pr2 (is-right-De-Morgan-Prop x)) = is-prop-is-right x + pr2 (pr2 (is-right-De-Morgan-Prop x)) = + is-de-morgan-is-right x +``` + +## Properties + +### A De Morgan subtype of a `k+1`-truncated type is `k+1`-truncated + +```agda +module _ + {l1 l2 : Level} (k : 𝕋) {A : UU l1} (P : de-morgan-subtype l2 A) + where + + abstract + is-trunc-type-de-morgan-subtype : + is-trunc (succ-𝕋 k) A → is-trunc (succ-𝕋 k) + (type-de-morgan-subtype P) + is-trunc-type-de-morgan-subtype = + is-trunc-type-subtype k (subtype-de-morgan-subtype P) + +module _ + {l1 l2 : Level} {A : UU l1} (P : de-morgan-subtype l2 A) + where + + abstract + is-prop-type-de-morgan-subtype : + is-prop A → is-prop (type-de-morgan-subtype P) + is-prop-type-de-morgan-subtype = + is-prop-type-subtype (subtype-de-morgan-subtype P) + + abstract + is-set-type-de-morgan-subtype : + is-set A → is-set (type-de-morgan-subtype P) + is-set-type-de-morgan-subtype = + is-set-type-subtype (subtype-de-morgan-subtype P) + + abstract + is-1-type-type-de-morgan-subtype : + is-1-type A → is-1-type (type-de-morgan-subtype P) + is-1-type-type-de-morgan-subtype = + is-1-type-type-subtype (subtype-de-morgan-subtype P) + +prop-de-morgan-subprop : + {l1 l2 : Level} (A : Prop l1) + (P : de-morgan-subtype l2 (type-Prop A)) → + Prop (l1 ⊔ l2) +prop-de-morgan-subprop A P = + prop-subprop A (subtype-de-morgan-subtype P) + +set-de-morgan-subset : + {l1 l2 : Level} (A : Set l1) + (P : de-morgan-subtype l2 (type-Set A)) → + Set (l1 ⊔ l2) +set-de-morgan-subset A P = + set-subset A (subtype-de-morgan-subtype P) +``` + +### The type of De Morgan subtypes of a type is a set + +```agda +is-set-de-morgan-subtype : + {l1 l2 : Level} {X : UU l1} → is-set (de-morgan-subtype l2 X) +is-set-de-morgan-subtype = + is-set-function-type is-set-De-Morgan-Prop +``` + +### Extensionality of the type of De Morgan subtypes + +```agda +module _ + {l1 l2 : Level} {A : UU l1} (P : de-morgan-subtype l2 A) + where + + has-same-elements-de-morgan-subtype : + {l3 : Level} → de-morgan-subtype l3 A → UU (l1 ⊔ l2 ⊔ l3) + has-same-elements-de-morgan-subtype Q = + has-same-elements-subtype + ( subtype-de-morgan-subtype P) + ( subtype-de-morgan-subtype Q) + + extensionality-de-morgan-subtype : + (Q : de-morgan-subtype l2 A) → + (P = Q) ≃ has-same-elements-de-morgan-subtype Q + extensionality-de-morgan-subtype = + extensionality-Π P + ( λ x Q → + ( type-De-Morgan-Prop (P x)) ↔ + ( type-De-Morgan-Prop Q)) + ( λ x Q → extensionality-De-Morgan-Prop (P x) Q) + + has-same-elements-eq-de-morgan-subtype : + (Q : de-morgan-subtype l2 A) → + (P = Q) → has-same-elements-de-morgan-subtype Q + has-same-elements-eq-de-morgan-subtype Q = + map-equiv (extensionality-de-morgan-subtype Q) + + eq-has-same-elements-de-morgan-subtype : + (Q : de-morgan-subtype l2 A) → + has-same-elements-de-morgan-subtype Q → P = Q + eq-has-same-elements-de-morgan-subtype Q = + map-inv-equiv (extensionality-de-morgan-subtype Q) + + refl-extensionality-de-morgan-subtype : + map-equiv (extensionality-de-morgan-subtype P) refl = + (λ x → id , id) + refl-extensionality-de-morgan-subtype = refl +``` + +### The type of De Morgan subtypes of `A` is equivalent to the type of all De Morgan embeddings into a type `A` + +```agda +equiv-Fiber-De-Morgan-Prop : + (l : Level) {l1 : Level} (A : UU l1) → + Σ (UU (l1 ⊔ l)) (λ X → X ↪ᵈᵐ A) ≃ (de-morgan-subtype (l1 ⊔ l) A) +equiv-Fiber-De-Morgan-Prop l A = + ( equiv-Fiber-structure l is-de-morgan-prop A) ∘e + ( equiv-tot + ( λ X → + equiv-tot + ( λ f → + ( inv-distributive-Π-Σ) ∘e + ( equiv-product-left (equiv-is-prop-map-is-emb f))))) +``` diff --git a/src/logic/de-morgan-types.lagda.md b/src/logic/de-morgan-types.lagda.md new file mode 100644 index 0000000000..53f7136eb4 --- /dev/null +++ b/src/logic/de-morgan-types.lagda.md @@ -0,0 +1,463 @@ +# De Morgan types + +```agda +module logic.de-morgan-types where +``` + +
Imports + +```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 +open import foundation.dependent-pair-types +open import foundation.disjunction +open import foundation.identity-types +open import foundation.double-negation +open import foundation.empty-types +open import foundation.truncations +open import foundation.precomposition-functions +open import foundation.evaluation-functions +open import foundation.function-types +open import foundation.irrefutable-propositions +open import foundation.logical-equivalences +open import foundation.negation +open import foundation.propositional-truncations +open import foundation.retracts-of-types +open import foundation.truncation-levels +open import foundation.truncations +open import foundation.unit-type +open import foundation.universe-levels + +open import foundation-core.decidable-propositions +open import foundation-core.equivalences +open import foundation-core.propositions + +open import logic.de-morgans-law +``` + +
+ +## Idea + +In classical logic, i.e., logic where we assume +[the law of excluded middle](foundation.law-of-excluded-middle.md), the _De +Morgan laws_ refers to the pair of logical equivalences + +```text + ¬ (P ∨ Q) ⇔ (¬ P) ∧ (¬ Q) + ¬ (P ∧ Q) ⇔ (¬ P) ∨ (¬ Q). +``` + +Out of these in total four logical implications, all but one are validated in +constructive mathematics. The odd one out is + +```text + ¬ (P ∧ Q) ⇒ (¬ P) ∨ (¬ Q). +``` + +Indeed, this law would imply that we could constructively decide from a proof +that neither `P` nor `Q` is true, one of `P` and `Q` that is false. This logical +law is what we refer to as [De Morgan's Law](logic.de-morgans-law.md). If a type +`P` is such that for every other type `Q`, the De Morgan implication + +```text + ¬ (P ∧ Q) ⇒ (¬ P) ∨ (¬ Q) +``` + +holds, we say `P` is {{#concept "De Morgan" Disambiguation="type"}}. + +Equivalently, a type is De Morgan iff its negation is decidable. Since this is a +[small](foundation.small-types.md) condition, it is frequently more convenient +to use and is what we take as the main definition. + +## Definition + +### The small condition of being a De Morgan type + +I.e., types whose negation is decidable. + +```agda +module _ + {l : Level} (A : UU l) + where + + is-de-morgan : UU l + is-de-morgan = is-decidable (¬ A) + + is-prop-is-de-morgan : is-prop is-de-morgan + is-prop-is-de-morgan = is-prop-is-decidable is-prop-neg + + is-de-morgan-Prop : Prop l + is-de-morgan-Prop = is-decidable-Prop (neg-type-Prop A) +``` + +### The subuniverse of De Morgan types + +We use the decidability of the negation condition to define the subuniverse of +De Morgan types. + +```agda +De-Morgan-Type : (l : Level) → UU (lsuc l) +De-Morgan-Type l = Σ (UU l) (is-de-morgan) + +module _ + {l : Level} (A : De-Morgan-Type l) + where + + type-De-Morgan-Type : UU l + type-De-Morgan-Type = pr1 A + + is-de-morgan-type-De-Morgan-Type : is-de-morgan type-De-Morgan-Type + is-de-morgan-type-De-Morgan-Type = pr2 A +``` + +### Types that satisfy De Morgan's law + +```agda +satisfies-de-morgans-law-type-Level : + {l1 : Level} (l2 : Level) (A : UU l1) → UU (l1 ⊔ lsuc l2) +satisfies-de-morgans-law-type-Level l2 A = + (B : UU l2) → ¬ (A × B) → disjunction-type (¬ A) (¬ B) + +satisfies-de-morgans-law-type : {l1 : Level} (A : UU l1) → UUω +satisfies-de-morgans-law-type A = + {l2 : Level} (B : UU l2) → ¬ (A × B) → disjunction-type (¬ A) (¬ B) + +is-prop-satisfies-de-morgans-law-type-Level : + {l1 l2 : Level} {A : UU l1} → + is-prop (satisfies-de-morgans-law-type-Level l2 A) +is-prop-satisfies-de-morgans-law-type-Level {A = A} = + is-prop-Π (λ B → is-prop-Π (λ p → is-prop-disjunction-type (¬ A) (¬ B))) + +satisfies-de-morgans-law-type-Prop : + {l1 : Level} (l2 : Level) (A : UU l1) → Prop (l1 ⊔ lsuc l2) +satisfies-de-morgans-law-type-Prop l2 A = + ( satisfies-de-morgans-law-type-Level l2 A , + is-prop-satisfies-de-morgans-law-type-Level) +``` + +```agda +satisfies-de-morgans-law-type-Level' : + {l1 : Level} (l2 : Level) (A : UU l1) → UU (l1 ⊔ lsuc l2) +satisfies-de-morgans-law-type-Level' l2 A = + (B : UU l2) → ¬ (B × A) → disjunction-type (¬ B) (¬ A) + +satisfies-de-morgans-law-type' : {l1 : Level} (A : UU l1) → UUω +satisfies-de-morgans-law-type' A = + {l2 : Level} (B : UU l2) → ¬ (B × A) → disjunction-type (¬ B) (¬ A) + +is-prop-satisfies-de-morgans-law-type-Level' : + {l1 l2 : Level} {A : UU l1} → + is-prop (satisfies-de-morgans-law-type-Level' l2 A) +is-prop-satisfies-de-morgans-law-type-Level' {A = A} = + is-prop-Π (λ B → is-prop-Π (λ p → is-prop-disjunction-type (¬ B) (¬ A))) + +satisfies-de-morgans-law-type-Prop' : + {l1 : Level} (l2 : Level) (A : UU l1) → Prop (l1 ⊔ lsuc l2) +satisfies-de-morgans-law-type-Prop' l2 A = + ( satisfies-de-morgans-law-type-Level' l2 A , + is-prop-satisfies-de-morgans-law-type-Level') +``` + +## Properties + +### If a type satisfies De Morgan's law then its negation is decidable + +Indeed, one need only check that `A` and `¬ A` satisfy De Morgan's law, as then +the hypothesis of the implication + +```text + ¬ (A ∧ ¬ A) ⇒ ¬ A ∨ ¬¬ A +``` + +is true. + +```agda +module _ + {l : Level} (A : UU l) + where + + is-de-morgan-satisfies-de-morgans-law' : + ({l' : Level} (B : UU l') → ¬ (A × B) → ¬ A + ¬ B) → is-de-morgan A + is-de-morgan-satisfies-de-morgans-law' H = H (¬ A) (λ f → pr2 f (pr1 f)) + + is-merely-decidable-neg-satisfies-de-morgan : + satisfies-de-morgans-law-type A → is-merely-decidable (¬ A) + is-merely-decidable-neg-satisfies-de-morgan H = H (¬ A) (λ f → pr2 f (pr1 f)) + + is-de-morgan-satisfies-de-morgans-law : + satisfies-de-morgans-law-type A → is-de-morgan A + is-de-morgan-satisfies-de-morgans-law H = + rec-trunc-Prop + ( is-decidable-Prop (neg-type-Prop A)) + ( id) + ( H (¬ A) (λ f → pr2 f (pr1 f))) +``` + +### If the negation of a type is decidable then it satisfies De Morgan's law + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + satisfies-de-morgans-law-is-de-morgan-left : + is-de-morgan A → ¬ (A × B) → ¬ A + ¬ B + satisfies-de-morgans-law-is-de-morgan-left (inl na) f = + inl na + satisfies-de-morgans-law-is-de-morgan-left (inr nna) f = + inr (λ y → nna (λ x → f (x , y))) + + satisfies-de-morgans-law-is-de-morgan-right : + is-de-morgan B → ¬ (A × B) → ¬ A + ¬ B + satisfies-de-morgans-law-is-de-morgan-right (inl nb) f = + inr nb + satisfies-de-morgans-law-is-de-morgan-right (inr nnb) f = + inl (λ x → nnb (λ y → f (x , y))) + +satisfies-de-morgans-law-is-de-morgan : + {l : Level} {A : UU l} → is-de-morgan A → satisfies-de-morgans-law-type A +satisfies-de-morgans-law-is-de-morgan x B q = + unit-trunc-Prop (satisfies-de-morgans-law-is-de-morgan-left x q) + +satisfies-de-morgans-law-is-de-morgan' : + {l : Level} {A : UU l} → is-de-morgan A → satisfies-de-morgans-law-type' A +satisfies-de-morgans-law-is-de-morgan' x B q = + unit-trunc-Prop (satisfies-de-morgans-law-is-de-morgan-right x q) + +module _ + {l : Level} (A : De-Morgan-Type l) + where + + satisfies-de-morgans-law-type-De-Morgan-Type : + satisfies-de-morgans-law-type (type-De-Morgan-Type A) + satisfies-de-morgans-law-type-De-Morgan-Type = + satisfies-de-morgans-law-is-de-morgan (is-de-morgan-type-De-Morgan-Type A) + + satisfies-de-morgans-law-type-De-Morgan-Type' : + satisfies-de-morgans-law-type' (type-De-Morgan-Type A) + satisfies-de-morgans-law-type-De-Morgan-Type' = + satisfies-de-morgans-law-is-de-morgan' (is-de-morgan-type-De-Morgan-Type A) +``` + +### 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 = is-irrefutable-is-decidable +``` + +### Decidable types are De Morgan + +```agda +is-de-morgan-is-decidable : + {l : Level} {A : UU l} → is-decidable A → is-de-morgan A +is-de-morgan-is-decidable (inl x) = inr (intro-double-negation x) +is-de-morgan-is-decidable (inr x) = inl x + +satisfies-de-morgans-law-is-decidable : + {l : Level} {A : UU l} → is-decidable A → satisfies-de-morgans-law-type A +satisfies-de-morgans-law-is-decidable H = + satisfies-de-morgans-law-is-de-morgan (is-de-morgan-is-decidable H) + +satisfies-de-morgans-law-is-decidable' : + {l : Level} {A : UU l} → is-decidable A → satisfies-de-morgans-law-type' A +satisfies-de-morgans-law-is-decidable' H = + satisfies-de-morgans-law-is-de-morgan' (is-de-morgan-is-decidable H) +``` + +### Irrefutable types are De Morgan + +```agda +is-de-morgan-is-irrefutable : + {l : Level} {A : UU l} → ¬¬ A → is-de-morgan A +is-de-morgan-is-irrefutable = inr +``` + +### Contractible types are De Morgan + +```agda +is-de-morgan-is-contr : + {l : Level} {A : UU l} → is-contr A → is-de-morgan A +is-de-morgan-is-contr H = + is-de-morgan-is-irrefutable (intro-double-negation (center H)) + +is-de-morgan-unit : is-de-morgan unit +is-de-morgan-unit = is-de-morgan-is-contr is-contr-unit +``` + +### Empty types are De Morgan + +```agda +is-de-morgan-is-empty : {l : Level} {A : UU l} → is-empty A → is-de-morgan A +is-de-morgan-is-empty = inl + +is-de-morgan-empty : is-de-morgan empty +is-de-morgan-empty = is-de-morgan-is-empty id +``` + +### De Morgan types are closed under logical equivalences + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + is-de-morgan-iff : + (A → B) → (B → A) → is-de-morgan A → is-de-morgan B + is-de-morgan-iff f g = is-decidable-iff (map-neg g) (map-neg f) + + is-de-morgan-iff' : + (A ↔ B) → is-de-morgan A → is-de-morgan B + is-de-morgan-iff' (f , g) = is-de-morgan-iff f g + + satisfies-de-morgans-law-iff : + (A → B) → (B → A) → + satisfies-de-morgans-law-type A → satisfies-de-morgans-law-type B + satisfies-de-morgans-law-iff f g a = + satisfies-de-morgans-law-is-de-morgan + ( is-de-morgan-iff f g (is-de-morgan-satisfies-de-morgans-law A a)) + + satisfies-de-morgans-law-iff' : + (A ↔ B) → satisfies-de-morgans-law-type A → satisfies-de-morgans-law-type B + satisfies-de-morgans-law-iff' (f , g) = satisfies-de-morgans-law-iff f g +``` + +### De Morgan types are closed under retracts + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} (R : B retract-of A) + where + + is-de-morgan-retract-of : is-de-morgan A → is-de-morgan B + is-de-morgan-retract-of = is-de-morgan-iff' (iff-retract' R) + + is-de-morgan-retract-of' : is-de-morgan B → is-de-morgan A + is-de-morgan-retract-of' = is-de-morgan-iff' (iff-retract R) +``` + +### De Morgan types are closed under equivalences + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} (e : A ≃ B) + where + + is-de-morgan-equiv' : is-de-morgan A → is-de-morgan B + is-de-morgan-equiv' = is-de-morgan-iff' (iff-equiv e) + + is-de-morgan-equiv : is-de-morgan B → is-de-morgan A + is-de-morgan-equiv = is-de-morgan-iff' (iff-equiv' e) +``` + +### Equivalent types have equivalent De Morgan predicates + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + iff-is-de-morgan : A ↔ B → is-de-morgan A ↔ is-de-morgan B + iff-is-de-morgan e = iff-is-decidable (iff-neg e) + + equiv-iff-is-de-morgan : A ↔ B → is-de-morgan A ≃ is-de-morgan B + equiv-iff-is-de-morgan e = equiv-is-decidable (equiv-iff-neg e) + + equiv-is-de-morgan : A ≃ B → is-de-morgan A ≃ is-de-morgan B + equiv-is-de-morgan e = equiv-iff-is-de-morgan (iff-equiv e) +``` + +### The truncation of a De Morgan type is De Morgan + +```agda +module _ + {l1 : Level} {A : UU l1} + where + + is-de-morgan-trunc : {k : 𝕋} → is-de-morgan A → is-de-morgan (type-trunc k A) + is-de-morgan-trunc {neg-two-𝕋} a = + is-de-morgan-is-contr is-trunc-type-trunc + is-de-morgan-trunc {succ-𝕋 k} (inl na) = + inl (map-universal-property-trunc (empty-Truncated-Type k) na) + is-de-morgan-trunc {succ-𝕋 k} (inr nna) = + inr (λ nn|a| → nna (λ a → nn|a| (unit-trunc a))) +``` + +### If the truncation of a type is De Morgan then the type is De Morgan + +```agda +module _ + {l1 : Level} {A : UU l1} + where + + equiv-is-de-morgan-trunc : + {k : 𝕋} → is-de-morgan (type-trunc (succ-𝕋 k) A) ≃ is-de-morgan A + equiv-is-de-morgan-trunc {k} = + equiv-is-decidable + ( map-neg unit-trunc , is-truncation-trunc (empty-Truncated-Type k)) + + is-de-morgan-is-de-morgan-trunc : + {k : 𝕋} → is-de-morgan (type-trunc (succ-𝕋 k) A) → is-de-morgan A + is-de-morgan-is-de-morgan-trunc = map-equiv equiv-is-de-morgan-trunc +``` + +### Products of De Morgan types are De Morgan + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + is-de-morgan-product : is-de-morgan A → is-de-morgan B → is-de-morgan (A × B) + is-de-morgan-product (inl na) b = + inl (λ ab → na (pr1 ab)) + is-de-morgan-product (inr nna) (inl nb) = + inl (λ ab → nb (pr2 ab)) + is-de-morgan-product (inr nna) (inr nnb) = + inr (is-irrefutable-product nna nnb) +``` + +### Coproducts of De Morgan types are De Morgan + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + is-de-morgan-coproduct : + is-de-morgan A → is-de-morgan B → is-de-morgan (A + B) + is-de-morgan-coproduct (inl na) (inl nb) = + inl (rec-coproduct na nb) + is-de-morgan-coproduct (inl na) (inr nnb) = + inr (λ nab → nnb (λ nb → nab (inr nb))) + is-de-morgan-coproduct (inr nna) _ = + inr (λ nab → nna (λ na → nab (inl na))) + + is-de-morgan-disjunction : + is-de-morgan A → is-de-morgan B → is-de-morgan (disjunction-type A B) + is-de-morgan-disjunction a b = is-de-morgan-trunc (is-de-morgan-coproduct a b) +``` + +### The negation of a De Morgan type is De Morgan + +```agda +is-de-morgan-neg : {l : Level} {A : UU l} → is-de-morgan A → is-de-morgan (¬ A) +is-de-morgan-neg = is-decidable-neg +``` + +### The identity types of De Morgan types are not generally De Morgan + +Consider any type `A`, then its suspension `ΣA` is De Morgan since it is +inhabited. However, its identity type `N = S` is equivalent to `A`, so cannot +be De Morgan unless `A` is. + +> This remains to be formalized. + +## External links + +- [De Morgan laws, in constructive mathematics](https://ncatlab.org/nlab/show/De+Morgan+laws#in_constructive_mathematics) + at $n$Lab diff --git a/src/logic/de-morgans-law.lagda.md b/src/logic/de-morgans-law.lagda.md new file mode 100644 index 0000000000..81cb2892e2 --- /dev/null +++ b/src/logic/de-morgans-law.lagda.md @@ -0,0 +1,144 @@ +# De Morgan's law + +```agda +module logic.de-morgans-law where +``` + +
Imports + +```agda +open import foundation.cartesian-product-types +open import foundation.conjunction +open import foundation.coproduct-types +open import foundation.decidable-types +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.logical-equivalences +open import foundation.negation +open import foundation.universe-levels + +open import foundation-core.decidable-propositions +open import foundation-core.propositions + +open import univalent-combinatorics.2-element-types +``` + +
+ +## Idea + +In classical logic, i.e., logic where we assume +[the law of excluded middle](foundation.law-of-excluded-middle.md), the _De +Morgan laws_ refers to the pair of logical equivalences + +```text + ¬ (P ∨ Q) ⇔ (¬ P) ∧ (¬ Q) + ¬ (P ∧ Q) ⇔ (¬ P) ∨ (¬ Q). +``` + +Out of these in total four logical implications, all but one are validated in +constructive mathematics. The odd one out is + +```text + ¬ (P ∧ Q) ⇒ (¬ P) ∨ (¬ Q). +``` + +Indeed, this would state that we could constructively deduce from a proof that +neither `P` nor `Q` is true, which of `P` is false or `Q` is false. This logical +law is what we refer to as {{#concept "De Morgan's Law" Agda=De-Morgans-Law}}. + +## Definition + +```agda +module _ + {l1 l2 : Level} (A : UU l1) (B : UU l2) + where + + de-morgans-law-Prop' : Prop (l1 ⊔ l2) + de-morgans-law-Prop' = + neg-type-Prop (A × B) ⇒ (neg-type-Prop A) ∨ (neg-type-Prop B) + + de-morgans-law' : UU (l1 ⊔ l2) + de-morgans-law' = ¬ (A × B) → disjunction-type (¬ A) (¬ B) + +module _ + {l1 l2 : Level} (P : Prop l1) (Q : Prop l2) + where + + de-morgans-law-Prop : Prop (l1 ⊔ l2) + de-morgans-law-Prop = ¬' (P ∧ Q) ⇒ (¬' P) ∨ (¬' Q) + + de-morgans-law : UU (l1 ⊔ l2) + de-morgans-law = type-Prop de-morgans-law-Prop + +De-Morgans-Law-Level : (l1 l2 : Level) → UU (lsuc l1 ⊔ lsuc l2) +De-Morgans-Law-Level l1 l2 = + (P : Prop l1) (Q : Prop l2) → de-morgans-law P Q + +prop-De-Morgans-Law-Level : (l1 l2 : Level) → Prop (lsuc l1 ⊔ lsuc l2) +prop-De-Morgans-Law-Level l1 l2 = + Π-Prop + ( Prop l1) + ( λ P → Π-Prop (Prop l2) (λ Q → de-morgans-law-Prop P Q)) + +De-Morgans-Law : UUω +De-Morgans-Law = {l1 l2 : Level} → De-Morgans-Law-Level l1 l2 +``` + +## Properties + +### The constructively valid De Morgan's laws + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + forward-implication-constructive-de-morgan : ¬ (A + B) → (¬ A) × (¬ B) + forward-implication-constructive-de-morgan z = (z ∘ inl) , (z ∘ inr) + + backward-implication-constructive-de-morgan : (¬ A) × (¬ B) → ¬ (A + B) + backward-implication-constructive-de-morgan (na , nb) (inl x) = na x + backward-implication-constructive-de-morgan (na , nb) (inr y) = nb y + + constructive-de-morgan : ¬ (A + B) ↔ (¬ A) × (¬ B) + constructive-de-morgan = + ( forward-implication-constructive-de-morgan , + backward-implication-constructive-de-morgan) + + backward-implication-de-morgan : ¬ A + ¬ B → ¬ (A × B) + backward-implication-de-morgan (inl na) (x , y) = na x + backward-implication-de-morgan (inr nb) (x , y) = nb y +``` + +### Given the hypothesis of De Morgan's law, the conclusion is irrefutable + +```agda +double-negation-de-morgan : + {l1 l2 : Level} {A : UU l1} {B : UU l2} → ¬ (A × B) → ¬¬ (¬ A + ¬ B) +double-negation-de-morgan f v = + v (inl (λ x → v (inr (λ y → f (x , y))))) +``` + +### De Morgan's law is irrefutable + +```agda +is-irrefutable-de-morgans-law : + {l1 l2 : Level} {A : UU l1} {B : UU l2} → ¬¬ (¬ (A × B) → ¬ A + ¬ B) +is-irrefutable-de-morgans-law u = + u (λ _ → inl (λ x → u (λ f → inr (λ y → f (x , y))))) +``` + +## See also + +- [De Morgan types](logic.de-morgan-types.md) +- [De Morgan sheaves](logic.de-morgan-sheaves.md) + +## External links + +- [De Morgan laws, in constructive mathematics](https://ncatlab.org/nlab/show/De+Morgan+laws#in_constructive_mathematics) + at $n$Lab diff --git a/src/logic/double-negation-eliminating-maps.lagda.md b/src/logic/double-negation-eliminating-maps.lagda.md new file mode 100644 index 0000000000..a0924afec0 --- /dev/null +++ b/src/logic/double-negation-eliminating-maps.lagda.md @@ -0,0 +1,309 @@ +# Double negation eliminating maps + +```agda +module logic.double-negation-eliminating-maps where +``` + +
Imports + +```agda +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 +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.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 + +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.functoriality-dependent-pair-types +open import foundation-core.homotopies + +open import logic.double-negation-elimination +``` + +
+ +## Idea + +A [map](foundation-core.function-types.md) is said to be +{{#concept "double negation eliminating" Disambiguation="map of types" Agda=is-double-negation-eliminating-map}} +if its [fibers](foundation-core.fibers-of-maps.md) satisfy +[untruncated double negation elimination](logic.double-negation-elimination.md). +I.e., for every `y : B`, if `fiber f y` is +[irrefutable](foundation.irrefutable-propositions.md), then we do in fact have +an element of the fiber `p : fiber f y`. In other words, double negation +eliminating maps come [equipped](foundation.structure.md) with a map + +```text + (y : B) → ¬¬ (fiber f y) → fiber f y. +``` + +## Definintion + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + is-double-negation-eliminating-map : (A → B) → UU (l1 ⊔ l2) + is-double-negation-eliminating-map f = + (y : B) → has-double-negation-elim (fiber f y) +``` + +## Properties + +### Double negation eliminating maps are closed under homotopy + +```agda +abstract + is-double-negation-eliminating-map-htpy : + {l1 l2 : Level} {A : UU l1} {B : UU l2} {f g : A → B} → + f ~ g → + is-double-negation-eliminating-map g → + is-double-negation-eliminating-map f + is-double-negation-eliminating-map-htpy H K b = + has-double-negation-elim-equiv + ( equiv-tot (λ a → equiv-concat (inv (H a)) b)) + ( K b) +``` + +### Decidable maps are double negation eliminating + +```agda +is-double-negation-eliminating-map-is-decidable-map : + {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} → + is-decidable-map f → is-double-negation-eliminating-map f +is-double-negation-eliminating-map-is-decidable-map H y = + double-negation-elim-is-decidable (H y) +``` + +### Composition of double negation eliminating maps + +Given a composition `g ∘ f` of double negation eliminating maps where the left +factor `g` is injective, then the composition is double negation eliminating. + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} + {g : B → C} {f : A → B} + where + + fiber-left-is-double-negation-eliminating-map-left : + is-double-negation-eliminating-map g → + (z : C) → ¬¬ (fiber (g ∘ f) z) → fiber g z + fiber-left-is-double-negation-eliminating-map-left G z nngfz = + G z (λ x → nngfz (λ w → x (f (pr1 w) , pr2 w))) + + fiber-right-is-double-negation-eliminating-map-comp : + is-injective g → + (G : is-double-negation-eliminating-map g) → + is-double-negation-eliminating-map f → + (z : C) (nngfz : ¬¬ (fiber (g ∘ f) z)) → + fiber f (pr1 (fiber-left-is-double-negation-eliminating-map-left G z nngfz)) + fiber-right-is-double-negation-eliminating-map-comp H G F z nngfz = + F ( pr1 + ( fiber-left-is-double-negation-eliminating-map-left G z nngfz)) + ( λ x → + nngfz + ( λ w → + x ( pr1 w , + H ( pr2 w ∙ + inv + ( pr2 + ( fiber-left-is-double-negation-eliminating-map-left + G z nngfz)))))) + + is-double-negation-eliminating-map-comp : + is-injective g → + is-double-negation-eliminating-map g → + is-double-negation-eliminating-map f → + is-double-negation-eliminating-map (g ∘ f) + is-double-negation-eliminating-map-comp H G F z nngfz = + map-inv-compute-fiber-comp g f z + ( ( fiber-left-is-double-negation-eliminating-map-left G z nngfz) , + ( fiber-right-is-double-negation-eliminating-map-comp H G F z nngfz)) +``` + +### Left cancellation for double negation eliminating maps + +If a composite `g ∘ f` is double negation eliminating and the left factor `g` is +injective, then the right factor `f` is double negation eliminating. + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {f : A → B} {g : B → C} + (GF : is-double-negation-eliminating-map (g ∘ f)) + where + + fiber-comp-is-double-negation-eliminating-map-right-factor' : + (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)))) + + is-double-negation-eliminating-map-right-factor' : + is-injective g → is-double-negation-eliminating-map f + is-double-negation-eliminating-map-right-factor' G y nnfy = + tr + ( fiber f) + ( G ( pr2 + ( pr1 + ( fiber-comp-is-double-negation-eliminating-map-right-factor' + ( y) + ( nnfy))))) + ( pr2 + ( fiber-comp-is-double-negation-eliminating-map-right-factor' y nnfy)) +``` + +### Any map out of the empty type is double negation eliminating + +```agda +abstract + is-double-negation-eliminating-map-ex-falso : + {l : Level} {X : UU l} → + is-double-negation-eliminating-map (ex-falso {l} {X}) + is-double-negation-eliminating-map-ex-falso x f = ex-falso (f λ ()) +``` + +### The identity map is double negation eliminating + +```agda +abstract + is-double-negation-eliminating-map-id : + {l : Level} {X : UU l} → is-double-negation-eliminating-map (id {l} {X}) + is-double-negation-eliminating-map-id x y = (x , refl) +``` + +### Equivalences are double negation eliminating maps + +```agda +abstract + is-double-negation-eliminating-map-is-equiv : + {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} → + is-equiv f → is-double-negation-eliminating-map f + is-double-negation-eliminating-map-is-equiv H x = + double-negation-elim-is-contr (is-contr-map-is-equiv H x) +``` + +### The map on total spaces induced by a family of double negation eliminating maps is double negation eliminating + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : A → UU l2} {C : A → UU l3} + where + + is-double-negation-eliminating-map-tot : + {f : (x : A) → B x → C x} → + ((x : A) → is-double-negation-eliminating-map (f x)) → + is-double-negation-eliminating-map (tot f) + is-double-negation-eliminating-map-tot {f} H x = + has-double-negation-elim-equiv (compute-fiber-tot f x) (H (pr1 x) (pr2 x)) +``` + +### The map on total spaces induced by a double negation eliminating map on the base is double negation eliminating + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} (C : B → UU l3) + where + + is-double-negation-eliminating-map-Σ-map-base : + {f : A → B} → + is-double-negation-eliminating-map f → + is-double-negation-eliminating-map (map-Σ-map-base f C) + is-double-negation-eliminating-map-Σ-map-base {f} H x = + has-double-negation-elim-equiv' + ( compute-fiber-map-Σ-map-base f C x) + ( H (pr1 x)) +``` + +### Products of double negation eliminating maps are double negation eliminating + +```agda +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {D : UU l4} + where + + is-double-negation-eliminating-map-product : + {f : A → B} {g : C → D} → + is-double-negation-eliminating-map f → + is-double-negation-eliminating-map g → + is-double-negation-eliminating-map (map-product f g) + is-double-negation-eliminating-map-product {f} {g} F G x = + has-double-negation-elim-equiv + ( compute-fiber-map-product f g x) + ( double-negation-elim-product (F (pr1 x)) (G (pr2 x))) +``` + +### Coproducts of double negation eliminating maps are double negation eliminating + +```agda +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {D : UU l4} + where + + is-double-negation-eliminating-map-coproduct : + {f : A → B} {g : C → D} → + is-double-negation-eliminating-map f → + is-double-negation-eliminating-map g → + is-double-negation-eliminating-map (map-coproduct f g) + is-double-negation-eliminating-map-coproduct {f} {g} F G (inl x) = + has-double-negation-elim-equiv' + ( compute-fiber-inl-map-coproduct f g x) + ( F x) + is-double-negation-eliminating-map-coproduct {f} {g} F G (inr y) = + has-double-negation-elim-equiv' + ( compute-fiber-inr-map-coproduct f g y) + ( G y) +``` + +### Double negation eliminating maps are closed under base change + +```agda +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {D : UU l4} + {f : A → B} {g : C → D} + where + + is-double-negation-eliminating-map-base-change : + cartesian-hom-arrow g f → + is-double-negation-eliminating-map f → + is-double-negation-eliminating-map g + is-double-negation-eliminating-map-base-change α F d = + has-double-negation-elim-equiv + ( equiv-fibers-cartesian-hom-arrow g f α d) + ( F (map-codomain-cartesian-hom-arrow g f α d)) +``` + +### Double negation eliminating maps are closed under retracts of maps + +```agda +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {X : UU l3} {Y : UU l4} + {f : A → B} {g : X → Y} + where + + is-double-negation-eliminating-retract-map : + f retract-of-map g → + is-double-negation-eliminating-map g → + is-double-negation-eliminating-map f + is-double-negation-eliminating-retract-map R G x = + has-double-negation-elim-retract + ( retract-fiber-retract-map f g R x) + ( G (map-codomain-inclusion-retract-map f g R x)) +``` diff --git a/src/logic/double-negation-elimination.lagda.md b/src/logic/double-negation-elimination.lagda.md new file mode 100644 index 0000000000..efcd51b62c --- /dev/null +++ b/src/logic/double-negation-elimination.lagda.md @@ -0,0 +1,266 @@ +# Double negation elimination + +```agda +module logic.double-negation-elimination where +``` + +
Imports + +```agda +open import foundation.cartesian-product-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.evaluation-functions +open import foundation.logical-equivalences +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.equivalences +open import foundation-core.function-types +open import foundation-core.propositions +``` + +
+ +## Idea + +We say a type `A` satisfies +{{#concept "untruncated double negation elimination" Disambiguation="on a type" Agda=has-double-negation-elim}} +if there is a map + +```text + ¬¬A → A. +``` + +We say a type `A` satisfies +{{#concept "double negation elimination" Disambiguation="on a type"}} if there +is an implication + +```text + ¬¬A ⇒ ║A║₋₁. +``` + +## Definitions + +### Untruncated double negation elimination + +```agda +module _ + {l : Level} (A : UU l) + where + + has-double-negation-elim : UU l + has-double-negation-elim = ¬¬ A → A +``` + +## Properties + +### Having double negation elimination is a property for propositions + +```agda +is-prop-has-double-negation-elim : + {l : Level} {A : UU l} → is-prop A → is-prop (has-double-negation-elim A) +is-prop-has-double-negation-elim = is-prop-function-type +``` + +### Double negation elimination is preserved by logical equivalences + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + has-double-negation-elim-iff : + A ↔ B → has-double-negation-elim B → has-double-negation-elim A + has-double-negation-elim-iff e H = + backward-implication e ∘ H ∘ map-double-negation (forward-implication e) + + has-double-negation-elim-iff' : + B ↔ A → has-double-negation-elim B → has-double-negation-elim A + has-double-negation-elim-iff' e = has-double-negation-elim-iff (inv-iff e) +``` + +### Double negation elimination is preserved by equivalences + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + has-double-negation-elim-equiv : + A ≃ B → has-double-negation-elim B → has-double-negation-elim A + has-double-negation-elim-equiv e = + has-double-negation-elim-iff (iff-equiv e) + + has-double-negation-elim-equiv' : + B ≃ A → has-double-negation-elim B → has-double-negation-elim A + has-double-negation-elim-equiv' e = + has-double-negation-elim-iff' (iff-equiv e) +``` + +### Double negation elimination is preserved by retracts + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + has-double-negation-elim-retract : + A retract-of B → has-double-negation-elim B → has-double-negation-elim A + has-double-negation-elim-retract e = + has-double-negation-elim-iff (iff-retract e) + + has-double-negation-elim-retract' : + B retract-of A → has-double-negation-elim B → has-double-negation-elim A + has-double-negation-elim-retract' e = + has-double-negation-elim-iff' (iff-retract e) +``` + +### If the negation of a type with double negation elimination is decidable, then the type is decidable + +**Note.** 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. Therefore, this result +demonstrates that they are independent too. + +```agda +module _ + {l1 : Level} {A : UU l1} + where + + is-decidable-is-decidable-neg-has-double-negation-elim : + has-double-negation-elim A → is-decidable (¬ A) → is-decidable A + is-decidable-is-decidable-neg-has-double-negation-elim f (inl nx) = + inr nx + is-decidable-is-decidable-neg-has-double-negation-elim f (inr nnx) = + inl (f nnx) +``` + +### Double negation elimination for empty types + +```agda +double-negation-elim-empty : has-double-negation-elim empty +double-negation-elim-empty e = e id + +double-negation-elim-is-empty : + {l : Level} {A : UU l} → is-empty A → has-double-negation-elim A +double-negation-elim-is-empty H q = ex-falso (q H) +``` + +### Double negation elimination for the unit type + +```agda +double-negation-elim-unit : has-double-negation-elim unit +double-negation-elim-unit _ = star +``` + +### Double negation elimination for the contractible types + +```agda +double-negation-elim-is-contr : + {l : Level} {A : UU l} → is-contr A → has-double-negation-elim A +double-negation-elim-is-contr H _ = center H +``` + +### Double negation elimination for negations of types + +```agda +double-negation-elim-neg : + {l : Level} (A : UU l) → has-double-negation-elim (¬ A) +double-negation-elim-neg A f p = f (ev p) +``` + +### Double negation elimination for uiversal quantification over double negations + +```agda +module _ + {l1 l2 : Level} {P : UU l1} {Q : P → UU l2} + where + + double-negation-elim-for-all-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-for-all : + ((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 elimination for function types into double negations + +```agda +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 : + 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 ecidable propositions + +```text +double-negation-elim-is-decidable : + {l : Level} {A : UU l} → is-decidable A → has-double-negation-elim A +double-negation-elim-is-decidable = double-negation-elim-is-decidable +``` + +### 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)) +``` + +## 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/double-negation-stable-embeddings.lagda.md b/src/logic/double-negation-stable-embeddings.lagda.md new file mode 100644 index 0000000000..8fe259345b --- /dev/null +++ b/src/logic/double-negation-stable-embeddings.lagda.md @@ -0,0 +1,731 @@ +# Double negation stable embeddings + +```agda +module logic.double-negation-stable-embeddings where +``` + +
Imports + +```agda +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 +open import foundation.fibers-of-maps +open import foundation.functoriality-cartesian-product-types +open import foundation.functoriality-coproduct-types +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 +open import foundation-core.functoriality-dependent-pair-types +open import foundation-core.homotopies +open import foundation-core.injective-maps +open import foundation-core.torsorial-type-families + +open import logic.double-negation-eliminating-maps +open import logic.double-negation-elimination +``` + +
+ +## Idea + +A [map](foundation-core.function-types.md) is said to be a +{{#concept "double negation stable embedding" Disambiguation="of types" Agda=is-double-negation-stable-emb}} +if it is an [embedding](foundation-core.embeddings.md) and its +[fibers](foundation-core.fibers-of-maps.md) satisfy +[double negation elimination](logic.double-negation-elimination.md). + +Equivalently, a double negation stable embedding is a map whose fibers are +[double negation stable propositions](foundation.double-negation-stable-propositions.md). +We refer to this condition as being a +{{#concept "double negation stable propositional map" Disambiguation="of types" Agda=is-double-negation-stable-prop-map}}. + +## Definitions + +### The condition on a map of being a double negation stable embedding + +```agda +is-double-negation-stable-emb : + {l1 l2 : Level} {X : UU l1} {Y : UU l2} → (X → Y) → UU (l1 ⊔ l2) +is-double-negation-stable-emb f = + is-emb f × is-double-negation-eliminating-map f + +module _ + {l1 l2 : Level} {X : UU l1} {Y : UU l2} {f : X → Y} + (F : is-double-negation-stable-emb f) + where + + is-emb-is-double-negation-stable-emb : is-emb f + is-emb-is-double-negation-stable-emb = pr1 F + + is-double-negation-eliminating-map-is-double-negation-stable-emb : + is-double-negation-eliminating-map f + is-double-negation-eliminating-map-is-double-negation-stable-emb = pr2 F + + is-prop-map-is-double-negation-stable-emb : is-prop-map f + is-prop-map-is-double-negation-stable-emb = + is-prop-map-is-emb is-emb-is-double-negation-stable-emb + + is-injective-is-double-negation-stable-emb : is-injective f + is-injective-is-double-negation-stable-emb = + is-injective-is-emb is-emb-is-double-negation-stable-emb +``` + +### Double negation stable propositional maps + +```agda +module _ + {l1 l2 : Level} {X : UU l1} {Y : UU l2} + where + + is-double-negation-stable-prop-map : (X → Y) → UU (l1 ⊔ l2) + is-double-negation-stable-prop-map f = + (y : Y) → is-double-negation-stable-prop (fiber f y) + + is-prop-is-double-negation-stable-prop-map : + (f : X → Y) → is-prop (is-double-negation-stable-prop-map f) + is-prop-is-double-negation-stable-prop-map f = + is-prop-Π (λ y → is-prop-is-double-negation-stable-prop (fiber f y)) + + is-double-negation-stable-prop-map-Prop : (X → Y) → Prop (l1 ⊔ l2) + is-double-negation-stable-prop-map-Prop f = + ( is-double-negation-stable-prop-map f , + is-prop-is-double-negation-stable-prop-map f) + + is-prop-map-is-double-negation-stable-prop-map : + {f : X → Y} → is-double-negation-stable-prop-map f → is-prop-map f + is-prop-map-is-double-negation-stable-prop-map H y = pr1 (H y) + + is-double-negation-eliminating-map-is-double-negation-stable-prop-map : + {f : X → Y} → + is-double-negation-stable-prop-map f → + is-double-negation-eliminating-map f + is-double-negation-eliminating-map-is-double-negation-stable-prop-map H y = + pr2 (H y) +``` + +### The type of double negation stable embeddings + +```agda +infix 5 _↪¬¬_ +_↪¬¬_ : + {l1 l2 : Level} (X : UU l1) (Y : UU l2) → UU (l1 ⊔ l2) +X ↪¬¬ Y = Σ (X → Y) is-double-negation-stable-emb + +map-double-negation-stable-emb : + {l1 l2 : Level} {X : UU l1} {Y : UU l2} → X ↪¬¬ Y → X → Y +map-double-negation-stable-emb e = pr1 e + +abstract + is-double-negation-stable-emb-map-double-negation-stable-emb : + {l1 l2 : Level} {X : UU l1} {Y : UU l2} (e : X ↪¬¬ Y) → + is-double-negation-stable-emb (map-double-negation-stable-emb e) + is-double-negation-stable-emb-map-double-negation-stable-emb e = pr2 e + +abstract + is-emb-map-double-negation-stable-emb : + {l1 l2 : Level} {X : UU l1} {Y : UU l2} (e : X ↪¬¬ Y) → + is-emb (map-double-negation-stable-emb e) + is-emb-map-double-negation-stable-emb e = + is-emb-is-double-negation-stable-emb + ( is-double-negation-stable-emb-map-double-negation-stable-emb e) + +abstract + is-double-negation-eliminating-map-map-double-negation-stable-emb : + {l1 l2 : Level} {X : UU l1} {Y : UU l2} (e : X ↪¬¬ Y) → + is-double-negation-eliminating-map (map-double-negation-stable-emb e) + is-double-negation-eliminating-map-map-double-negation-stable-emb e = + is-double-negation-eliminating-map-is-double-negation-stable-emb + ( is-double-negation-stable-emb-map-double-negation-stable-emb e) + +emb-double-negation-stable-emb : + {l1 l2 : Level} {X : UU l1} {Y : UU l2} → X ↪¬¬ Y → X ↪ Y +pr1 (emb-double-negation-stable-emb e) = map-double-negation-stable-emb e +pr2 (emb-double-negation-stable-emb e) = is-emb-map-double-negation-stable-emb e +``` + +## Properties + +### Any map of which the fibers are double negation stable propositions is a double negation stable embedding + +```agda +module _ + {l1 l2 : Level} {X : UU l1} {Y : UU l2} {f : X → Y} + where + + abstract + is-double-negation-stable-emb-is-double-negation-stable-prop-map : + is-double-negation-stable-prop-map f → is-double-negation-stable-emb f + pr1 (is-double-negation-stable-emb-is-double-negation-stable-prop-map H) = + is-emb-is-prop-map (is-prop-map-is-double-negation-stable-prop-map H) + pr2 (is-double-negation-stable-emb-is-double-negation-stable-prop-map H) = + is-double-negation-eliminating-map-is-double-negation-stable-prop-map H + + abstract + is-double-negation-stable-prop-map-is-double-negation-stable-emb : + is-double-negation-stable-emb f → is-double-negation-stable-prop-map f + pr1 (is-double-negation-stable-prop-map-is-double-negation-stable-emb H y) = + is-prop-map-is-double-negation-stable-emb H y + pr2 (is-double-negation-stable-prop-map-is-double-negation-stable-emb H y) = + is-double-negation-eliminating-map-is-double-negation-stable-emb H y +``` + +### The first projection map of a dependent sum of double negation stable propositions is a double negation stable embedding + +```agda +module _ + {l1 l2 : Level} {A : UU l1} (Q : A → Double-Negation-Stable-Prop l2) + where + + is-double-negation-stable-prop-map-pr1 : + is-double-negation-stable-prop-map + ( pr1 {B = type-Double-Negation-Stable-Prop ∘ Q}) + is-double-negation-stable-prop-map-pr1 y = + is-double-negation-stable-prop-equiv + ( equiv-fiber-pr1 (type-Double-Negation-Stable-Prop ∘ Q) y) + ( is-double-negation-stable-prop-type-Double-Negation-Stable-Prop (Q y)) + + is-double-negation-stable-emb-pr1 : + is-double-negation-stable-emb + ( pr1 {B = type-Double-Negation-Stable-Prop ∘ Q}) + is-double-negation-stable-emb-pr1 = + is-double-negation-stable-emb-is-double-negation-stable-prop-map + ( is-double-negation-stable-prop-map-pr1) +``` + +### Decidable embeddings are double negation stable + +```agda +is-double-negation-eliminating-map-is-decidable-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} → + is-decidable-emb f → is-double-negation-eliminating-map f +is-double-negation-eliminating-map-is-decidable-emb H = + is-double-negation-eliminating-map-is-decidable-map + ( is-decidable-map-is-decidable-emb H) + +abstract + is-double-negation-stable-emb-is-decidable-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} → + is-decidable-emb f → is-double-negation-stable-emb f + is-double-negation-stable-emb-is-decidable-emb H = + ( is-emb-is-decidable-emb H , + is-double-negation-eliminating-map-is-decidable-emb H) +``` + +### Equivalences are double negation stable embeddings + +```agda +abstract + is-double-negation-stable-emb-is-equiv : + {l1 l2 : Level} {A : UU l1} {B : UU l2} {f : A → B} → + is-equiv f → is-double-negation-stable-emb f + is-double-negation-stable-emb-is-equiv H = + ( is-emb-is-equiv H , is-double-negation-eliminating-map-is-equiv H) +``` + +### Identity maps are double negation stable embeddings + +```agda +is-double-negation-stable-emb-id : + {l : Level} {A : UU l} → is-double-negation-stable-emb (id {A = A}) +is-double-negation-stable-emb-id = + ( is-emb-id , is-double-negation-eliminating-map-id) + +double-negation-stable-emb-id : {l : Level} {A : UU l} → A ↪¬¬ A +double-negation-stable-emb-id = (id , is-double-negation-stable-emb-id) + +is-double-negation-stable-prop-map-id : + {l : Level} {A : UU l} → is-double-negation-stable-prop-map (id {A = A}) +is-double-negation-stable-prop-map-id y = + is-double-negation-stable-prop-is-contr (is-torsorial-Id' y) +``` + +### Being a double negation stable embedding is a property + +```agda +abstract + is-prop-is-double-negation-stable-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A → B) → + is-prop (is-double-negation-stable-emb f) + is-prop-is-double-negation-stable-emb f = + is-prop-has-element + ( λ H → + is-prop-product + ( is-property-is-emb f) + ( is-prop-Π + ( is-prop-has-double-negation-elim ∘ is-prop-map-is-emb (pr1 H)))) +``` + +### Double negation stable embeddings are closed under homotopies + +```agda +abstract + is-double-negation-stable-emb-htpy : + {l1 l2 : Level} {A : UU l1} {B : UU l2} {f g : A → B} → + f ~ g → is-double-negation-stable-emb g → is-double-negation-stable-emb f + is-double-negation-stable-emb-htpy {f = f} {g} H K = + ( is-emb-htpy H (is-emb-is-double-negation-stable-emb K) , + is-double-negation-eliminating-map-htpy H + ( is-double-negation-eliminating-map-is-double-negation-stable-emb K)) +``` + +### Double negation stable embeddings are closed under composition + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} + {g : B → C} {f : A → B} + where + + is-double-negation-eliminating-map-comp-is-double-negation-stable-emb : + is-double-negation-stable-emb g → + is-double-negation-eliminating-map f → + is-double-negation-eliminating-map (g ∘ f) + is-double-negation-eliminating-map-comp-is-double-negation-stable-emb G F = + is-double-negation-eliminating-map-comp + ( is-injective-is-double-negation-stable-emb G) + ( is-double-negation-eliminating-map-is-double-negation-stable-emb G) + ( F) + + is-double-negation-stable-prop-map-comp : + is-double-negation-stable-prop-map g → + is-double-negation-stable-prop-map f → + is-double-negation-stable-prop-map (g ∘ f) + is-double-negation-stable-prop-map-comp K H z = + is-double-negation-stable-prop-equiv + ( compute-fiber-comp g f z) + ( is-double-negation-stable-prop-Σ (K z) (H ∘ pr1)) + + is-double-negation-stable-emb-comp : + is-double-negation-stable-emb g → + is-double-negation-stable-emb f → + is-double-negation-stable-emb (g ∘ f) + is-double-negation-stable-emb-comp K H = + is-double-negation-stable-emb-is-double-negation-stable-prop-map + ( is-double-negation-stable-prop-map-comp + ( is-double-negation-stable-prop-map-is-double-negation-stable-emb K) + ( is-double-negation-stable-prop-map-is-double-negation-stable-emb H)) + +comp-double-negation-stable-emb : + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} → + B ↪¬¬ C → A ↪¬¬ B → A ↪¬¬ C +comp-double-negation-stable-emb (g , G) (f , F) = + ( g ∘ f , is-double-negation-stable-emb-comp G F) + +infixr 15 _∘¬¬_ +_∘¬¬_ : + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} → + B ↪¬¬ C → A ↪¬¬ B → A ↪¬¬ C +_∘¬¬_ = comp-double-negation-stable-emb +``` + +### Left cancellation for double negation stable embeddings + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {f : A → B} {g : B → C} + where + + is-double-negation-stable-emb-right-factor' : + is-double-negation-stable-emb (g ∘ f) → + is-emb g → + is-double-negation-stable-emb f + is-double-negation-stable-emb-right-factor' GH G = + ( is-emb-right-factor g f G (is-emb-is-double-negation-stable-emb GH) , + is-double-negation-eliminating-map-right-factor' + ( is-double-negation-eliminating-map-is-double-negation-stable-emb GH) + ( is-injective-is-emb G)) + + is-double-negation-stable-emb-right-factor : + is-double-negation-stable-emb (g ∘ f) → + is-double-negation-stable-emb g → + is-double-negation-stable-emb f + is-double-negation-stable-emb-right-factor GH G = + is-double-negation-stable-emb-right-factor' + ( GH) + ( is-emb-is-double-negation-stable-emb G) +``` + +### In a commuting triangle of maps, if the top and right maps are double negation stable embeddings so is the left map + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} + {top : A → B} {left : A → C} {right : B → C} + (H : left ~ right ∘ top) + where + + is-double-negation-stable-emb-left-map-triangle : + is-double-negation-stable-emb top → + is-double-negation-stable-emb right → + is-double-negation-stable-emb left + is-double-negation-stable-emb-left-map-triangle T R = + is-double-negation-stable-emb-htpy H + ( is-double-negation-stable-emb-comp R T) +``` + +### In a commuting triangle of maps, if the left and right maps are double negation stable embeddings so is the top map + +In fact, the right map need only be an embedding. + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} + {top : A → B} {left : A → C} {right : B → C} + (H : left ~ right ∘ top) + where + + is-double-negation-stable-emb-top-map-triangle' : + is-emb right → + is-double-negation-stable-emb left → + is-double-negation-stable-emb top + is-double-negation-stable-emb-top-map-triangle' R' L = + is-double-negation-stable-emb-right-factor' + ( is-double-negation-stable-emb-htpy (inv-htpy H) L) + ( R') + + is-double-negation-stable-emb-top-map-triangle : + is-double-negation-stable-emb right → + is-double-negation-stable-emb left → + is-double-negation-stable-emb top + is-double-negation-stable-emb-top-map-triangle R L = + is-double-negation-stable-emb-right-factor + ( is-double-negation-stable-emb-htpy (inv-htpy H) L) + ( R) +``` + +### Characterizing equality in the type of double negation stable embeddings + +```agda +htpy-double-negation-stable-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f g : A ↪¬¬ B) → UU (l1 ⊔ l2) +htpy-double-negation-stable-emb f g = + map-double-negation-stable-emb f ~ map-double-negation-stable-emb g + +refl-htpy-double-negation-stable-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A ↪¬¬ B) → + htpy-double-negation-stable-emb f f +refl-htpy-double-negation-stable-emb f = refl-htpy + +htpy-eq-double-negation-stable-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f g : A ↪¬¬ B) → + f = g → htpy-double-negation-stable-emb f g +htpy-eq-double-negation-stable-emb f .f refl = + refl-htpy-double-negation-stable-emb f + +abstract + is-torsorial-htpy-double-negation-stable-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A ↪¬¬ B) → + is-torsorial (htpy-double-negation-stable-emb f) + is-torsorial-htpy-double-negation-stable-emb f = + is-torsorial-Eq-subtype + ( is-torsorial-htpy (map-double-negation-stable-emb f)) + ( is-prop-is-double-negation-stable-emb) + ( map-double-negation-stable-emb f) + ( refl-htpy) + ( is-double-negation-stable-emb-map-double-negation-stable-emb f) + +abstract + is-equiv-htpy-eq-double-negation-stable-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f g : A ↪¬¬ B) → + is-equiv (htpy-eq-double-negation-stable-emb f g) + is-equiv-htpy-eq-double-negation-stable-emb f = + fundamental-theorem-id + ( is-torsorial-htpy-double-negation-stable-emb f) + ( htpy-eq-double-negation-stable-emb f) + +eq-htpy-double-negation-stable-emb : + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f g : A ↪¬¬ B) → + htpy-double-negation-stable-emb f g → f = g +eq-htpy-double-negation-stable-emb f g = + map-inv-is-equiv (is-equiv-htpy-eq-double-negation-stable-emb f g) +``` + +### Precomposing double negation stable embeddings with equivalences + +```agda +equiv-precomp-double-negation-stable-emb-equiv : + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} (e : A ≃ B) → + (C : UU l3) → (B ↪¬¬ C) ≃ (A ↪¬¬ C) +equiv-precomp-double-negation-stable-emb-equiv e C = + equiv-Σ + ( is-double-negation-stable-emb) + ( equiv-precomp e C) + ( λ g → + equiv-iff-is-prop + ( is-prop-is-double-negation-stable-emb g) + ( is-prop-is-double-negation-stable-emb (g ∘ map-equiv e)) + ( λ H → + is-double-negation-stable-emb-comp H + ( is-double-negation-stable-emb-is-equiv (pr2 e))) + ( λ d → + is-double-negation-stable-emb-htpy + ( λ b → ap g (inv (is-section-map-inv-equiv e b))) + ( is-double-negation-stable-emb-comp + ( d) + ( is-double-negation-stable-emb-is-equiv + ( is-equiv-map-inv-equiv e))))) +``` + +### Any map out of the empty type is a double negation stable embedding + +```agda +abstract + is-double-negation-stable-emb-ex-falso : + {l : Level} {X : UU l} → is-double-negation-stable-emb (ex-falso {l} {X}) + is-double-negation-stable-emb-ex-falso = + ( is-emb-ex-falso , is-double-negation-eliminating-map-ex-falso) + +double-negation-stable-emb-ex-falso : + {l : Level} {X : UU l} → empty ↪¬¬ X +double-negation-stable-emb-ex-falso = + ( ex-falso , is-double-negation-stable-emb-ex-falso) + +double-negation-stable-emb-is-empty : + {l1 l2 : Level} {A : UU l1} {B : UU l2} → is-empty A → A ↪¬¬ B +double-negation-stable-emb-is-empty {A = A} f = + map-equiv + ( equiv-precomp-double-negation-stable-emb-equiv (equiv-is-empty f id) _) + ( double-negation-stable-emb-ex-falso) +``` + +### The map on total spaces induced by a family of double negation stable embeddings is a double negation stable embedding + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : A → UU l2} {C : A → UU l3} + where + + is-double-negation-stable-emb-tot : + {f : (x : A) → B x → C x} → + ((x : A) → is-double-negation-stable-emb (f x)) → + is-double-negation-stable-emb (tot f) + is-double-negation-stable-emb-tot H = + ( is-emb-tot (is-emb-is-double-negation-stable-emb ∘ H) , + is-double-negation-eliminating-map-tot + ( is-double-negation-eliminating-map-is-double-negation-stable-emb ∘ H)) + + double-negation-stable-emb-tot : ((x : A) → B x ↪¬¬ C x) → Σ A B ↪¬¬ Σ A C + double-negation-stable-emb-tot f = + ( tot (map-double-negation-stable-emb ∘ f) , + is-double-negation-stable-emb-tot + ( is-double-negation-stable-emb-map-double-negation-stable-emb ∘ f)) +``` + +### The map on total spaces induced by a double negation stable embedding on the base is a double negation stable embedding + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} (C : B → UU l3) + where + + is-double-negation-stable-emb-map-Σ-map-base : + {f : A → B} → + is-double-negation-stable-emb f → + is-double-negation-stable-emb (map-Σ-map-base f C) + is-double-negation-stable-emb-map-Σ-map-base H = + ( is-emb-map-Σ-map-base C (is-emb-is-double-negation-stable-emb H) , + is-double-negation-eliminating-map-Σ-map-base C + ( is-double-negation-eliminating-map-is-double-negation-stable-emb H)) + + double-negation-stable-emb-map-Σ-map-base : + (f : A ↪¬¬ B) → Σ A (C ∘ map-double-negation-stable-emb f) ↪¬¬ Σ B C + double-negation-stable-emb-map-Σ-map-base f = + ( map-Σ-map-base (map-double-negation-stable-emb f) C , + is-double-negation-stable-emb-map-Σ-map-base + ( is-double-negation-stable-emb-map-double-negation-stable-emb f)) +``` + +### The functoriality of dependent pair types preserves double negation stable embeddings + +```agda +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {C : A → UU l3} (D : B → UU l4) + where + + is-double-negation-stable-emb-map-Σ : + {f : A → B} {g : (x : A) → C x → D (f x)} → + is-double-negation-stable-emb f → + ((x : A) → is-double-negation-stable-emb (g x)) → + is-double-negation-stable-emb (map-Σ D f g) + is-double-negation-stable-emb-map-Σ {f} {g} F G = + is-double-negation-stable-emb-left-map-triangle + ( triangle-map-Σ D f g) + ( is-double-negation-stable-emb-tot G) + ( is-double-negation-stable-emb-map-Σ-map-base D F) + + double-negation-stable-emb-Σ : + (f : A ↪¬¬ B) → + ((x : A) → C x ↪¬¬ D (map-double-negation-stable-emb f x)) → + Σ A C ↪¬¬ Σ B D + double-negation-stable-emb-Σ f g = + ( ( map-Σ D + ( map-double-negation-stable-emb f) + ( map-double-negation-stable-emb ∘ g)) , + ( is-double-negation-stable-emb-map-Σ + ( is-double-negation-stable-emb-map-double-negation-stable-emb f) + ( is-double-negation-stable-emb-map-double-negation-stable-emb ∘ g))) +``` + +### Products of double negation stable embeddings are double negation stable embeddings + +```agda +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {D : UU l4} + where + + is-double-negation-stable-emb-map-product : + {f : A → B} {g : C → D} → + is-double-negation-stable-emb f → + is-double-negation-stable-emb g → + is-double-negation-stable-emb (map-product f g) + is-double-negation-stable-emb-map-product (eF , dF) (eG , dG) = + ( is-emb-map-product eF eG , + is-double-negation-eliminating-map-product dF dG) + + double-negation-stable-emb-product : + A ↪¬¬ B → C ↪¬¬ D → A × C ↪¬¬ B × D + double-negation-stable-emb-product (f , F) (g , G) = + ( map-product f g , is-double-negation-stable-emb-map-product F G) +``` + +### Coproducts of double negation stable embeddings are double negation stable embeddings + +```agda +module _ + {l1 l2 l1' l2' : Level} {A : UU l1} {B : UU l2} {A' : UU l1'} {B' : UU l2'} + where + +abstract + is-double-negation-stable-emb-map-coproduct : + {l1 l2 l3 l4 : Level} + {A : UU l1} {B : UU l2} {X : UU l3} {Y : UU l4} + {f : A → B} {g : X → Y} → + is-double-negation-stable-emb f → + is-double-negation-stable-emb g → + is-double-negation-stable-emb (map-coproduct f g) + is-double-negation-stable-emb-map-coproduct (eF , dF) (eG , dG) = + ( is-emb-map-coproduct eF eG , + is-double-negation-eliminating-map-coproduct dF dG) +``` + +### Double negation stable embeddings are closed under base change + +```agda +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {D : UU l4} + {f : A → B} {g : C → D} + where + + is-double-negation-stable-prop-map-base-change : + cartesian-hom-arrow g f → + is-double-negation-stable-prop-map f → + is-double-negation-stable-prop-map g + is-double-negation-stable-prop-map-base-change α F d = + is-double-negation-stable-prop-equiv + ( equiv-fibers-cartesian-hom-arrow g f α d) + ( F (map-codomain-cartesian-hom-arrow g f α d)) + + is-double-negation-stable-emb-base-change : + cartesian-hom-arrow g f → + is-double-negation-stable-emb f → + is-double-negation-stable-emb g + is-double-negation-stable-emb-base-change α F = + is-double-negation-stable-emb-is-double-negation-stable-prop-map + ( is-double-negation-stable-prop-map-base-change α + ( is-double-negation-stable-prop-map-is-double-negation-stable-emb F)) +``` + +### Double negation stable embeddings are closed under retracts of maps + +```agda +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} {B : UU l2} {X : UU l3} {Y : UU l4} + {f : A → B} {g : X → Y} + where + + is-double-negation-stable-prop-map-retract-map : + f retract-of-map g → + is-double-negation-stable-prop-map g → + is-double-negation-stable-prop-map f + is-double-negation-stable-prop-map-retract-map R G x = + is-double-negation-stable-prop-retract + ( retract-fiber-retract-map f g R x) + ( G (map-codomain-inclusion-retract-map f g R x)) + + is-double-negation-stable-emb-retract-map : + f retract-of-map g → + is-double-negation-stable-emb g → + is-double-negation-stable-emb f + is-double-negation-stable-emb-retract-map R G = + is-double-negation-stable-emb-is-double-negation-stable-prop-map + ( is-double-negation-stable-prop-map-retract-map R + ( is-double-negation-stable-prop-map-is-double-negation-stable-emb G)) +``` + +### A type is a double negation stable proposition if and only if its terminal map is a double negation stable embedding + +```agda +module _ + {l : Level} {A : UU l} + where + + is-double-negation-stable-prop-is-double-negation-stable-emb-terminal-map : + is-double-negation-stable-emb (terminal-map A) → + is-double-negation-stable-prop A + is-double-negation-stable-prop-is-double-negation-stable-emb-terminal-map H = + is-double-negation-stable-prop-equiv' + ( equiv-fiber-terminal-map star) + ( is-double-negation-stable-prop-map-is-double-negation-stable-emb H star) + + is-double-negation-stable-emb-terminal-map-is-double-negation-stable-prop : + is-double-negation-stable-prop A → + is-double-negation-stable-emb (terminal-map A) + is-double-negation-stable-emb-terminal-map-is-double-negation-stable-prop H = + is-double-negation-stable-emb-is-double-negation-stable-prop-map + ( λ y → + is-double-negation-stable-prop-equiv (equiv-fiber-terminal-map y) H) +``` + +### If a dependent sum of propositions over a proposition is double negation stable, then the family is a family of double negation stable propositions + +```agda +module _ + {l1 l2 : Level} (P : Prop l1) (Q : type-Prop P → Prop l2) + where + + is-double-negation-stable-prop-family-has-double-negation-elim-Σ : + has-double-negation-elim (Σ (type-Prop P) (type-Prop ∘ Q)) → + (p : type-Prop P) → has-double-negation-elim (type-Prop (Q p)) + is-double-negation-stable-prop-family-has-double-negation-elim-Σ H p = + has-double-negation-elim-equiv' + ( equiv-fiber-pr1 (type-Prop ∘ Q) p) + ( is-double-negation-eliminating-map-is-double-negation-stable-emb + ( is-double-negation-stable-emb-right-factor' + ( is-double-negation-stable-emb-terminal-map-is-double-negation-stable-prop + ( is-prop-Σ (is-prop-type-Prop P) (is-prop-type-Prop ∘ Q) , H)) + ( is-emb-terminal-map-is-prop (is-prop-type-Prop P))) + ( p)) +``` diff --git a/src/logic/double-negation-stable-subtypes.lagda.md b/src/logic/double-negation-stable-subtypes.lagda.md new file mode 100644 index 0000000000..6614510a1b --- /dev/null +++ b/src/logic/double-negation-stable-subtypes.lagda.md @@ -0,0 +1,338 @@ +# Double negation stable subtypes + +```agda +module logic.double-negation-stable-subtypes where +``` + +
Imports + +```agda +open import foundation.1-types +open import foundation.coproduct-types +open import foundation.dependent-pair-types +open import foundation.double-negation-stable-propositions +open import foundation.equality-dependent-function-types +open import foundation.functoriality-cartesian-product-types +open import foundation.functoriality-dependent-function-types +open import foundation.functoriality-dependent-pair-types +open import foundation.logical-equivalences +open import foundation.propositional-maps +open import foundation.sets +open import foundation.structured-type-duality +open import foundation.subtypes +open import foundation.type-theoretic-principle-of-choice +open import foundation.universe-levels + +open import foundation-core.embeddings +open import foundation-core.equivalences +open import foundation-core.fibers-of-maps +open import foundation-core.function-types +open import foundation-core.identity-types +open import foundation-core.injective-maps +open import foundation-core.propositions +open import foundation-core.transport-along-identifications +open import foundation-core.truncated-types +open import foundation-core.truncation-levels + +open import logic.double-negation-eliminating-maps +open import logic.double-negation-elimination +open import logic.double-negation-stable-embeddings +``` + +
+ +## Idea + +A +{{#concept "double negation stable subtype" Disambiguation="of a type" Agda=is-double-negation-stable-subtype Agda=double-negation-stable-subtype}} +of a type consists of a family of +[double negation stable propositions](foundation.double-negation-stable-propositions.md) +over it. + +## Definitions + +### Decidable subtypes + +```agda +is-double-negation-stable-subtype-Prop : + {l1 l2 : Level} {A : UU l1} → subtype l2 A → Prop (l1 ⊔ l2) +is-double-negation-stable-subtype-Prop {A = A} P = + Π-Prop A (λ a → is-double-negation-stable-Prop (P a)) + +is-double-negation-stable-subtype : + {l1 l2 : Level} {A : UU l1} → subtype l2 A → UU (l1 ⊔ l2) +is-double-negation-stable-subtype P = + type-Prop (is-double-negation-stable-subtype-Prop P) + +is-prop-is-double-negation-stable-subtype : + {l1 l2 : Level} {A : UU l1} (P : subtype l2 A) → + is-prop (is-double-negation-stable-subtype P) +is-prop-is-double-negation-stable-subtype P = + is-prop-type-Prop (is-double-negation-stable-subtype-Prop P) + +double-negation-stable-subtype : + {l1 : Level} (l : Level) (X : UU l1) → UU (l1 ⊔ lsuc l) +double-negation-stable-subtype l X = X → Double-Negation-Stable-Prop l +``` + +### The underlying subtype of a double negation stable subtype + +```agda +module _ + {l1 l2 : Level} {A : UU l1} (P : double-negation-stable-subtype l2 A) + where + + subtype-double-negation-stable-subtype : subtype l2 A + subtype-double-negation-stable-subtype a = + prop-Double-Negation-Stable-Prop (P a) + + is-double-negation-stable-double-negation-stable-subtype : + is-double-negation-stable-subtype subtype-double-negation-stable-subtype + is-double-negation-stable-double-negation-stable-subtype a = + has-double-negation-elim-type-Double-Negation-Stable-Prop (P a) + + is-in-double-negation-stable-subtype : A → UU l2 + is-in-double-negation-stable-subtype = + is-in-subtype subtype-double-negation-stable-subtype + + is-prop-is-in-double-negation-stable-subtype : + (a : A) → is-prop (is-in-double-negation-stable-subtype a) + is-prop-is-in-double-negation-stable-subtype = + is-prop-is-in-subtype subtype-double-negation-stable-subtype +``` + +### The underlying type of a double negation stable subtype + +```agda +module _ + {l1 l2 : Level} {A : UU l1} (P : double-negation-stable-subtype l2 A) + where + + type-double-negation-stable-subtype : UU (l1 ⊔ l2) + type-double-negation-stable-subtype = + type-subtype (subtype-double-negation-stable-subtype P) + + inclusion-double-negation-stable-subtype : + type-double-negation-stable-subtype → A + inclusion-double-negation-stable-subtype = + inclusion-subtype (subtype-double-negation-stable-subtype P) + + is-emb-inclusion-double-negation-stable-subtype : + is-emb inclusion-double-negation-stable-subtype + is-emb-inclusion-double-negation-stable-subtype = + is-emb-inclusion-subtype (subtype-double-negation-stable-subtype P) + + is-double-negation-eliminating-map-inclusion-double-negation-stable-subtype : + is-double-negation-eliminating-map inclusion-double-negation-stable-subtype + is-double-negation-eliminating-map-inclusion-double-negation-stable-subtype + x = + has-double-negation-elim-equiv + ( equiv-fiber-pr1 (type-Double-Negation-Stable-Prop ∘ P) x) + ( has-double-negation-elim-type-Double-Negation-Stable-Prop (P x)) + + is-injective-inclusion-double-negation-stable-subtype : + is-injective inclusion-double-negation-stable-subtype + is-injective-inclusion-double-negation-stable-subtype = + is-injective-inclusion-subtype (subtype-double-negation-stable-subtype P) + + emb-double-negation-stable-subtype : type-double-negation-stable-subtype ↪ A + emb-double-negation-stable-subtype = + emb-subtype (subtype-double-negation-stable-subtype P) + + is-double-negation-stable-emb-inclusion-double-negation-stable-subtype : + is-double-negation-stable-emb inclusion-double-negation-stable-subtype + is-double-negation-stable-emb-inclusion-double-negation-stable-subtype = + ( is-emb-inclusion-double-negation-stable-subtype , + is-double-negation-eliminating-map-inclusion-double-negation-stable-subtype) + + double-negation-stable-emb-double-negation-stable-subtype : + type-double-negation-stable-subtype ↪¬¬ A + double-negation-stable-emb-double-negation-stable-subtype = + ( inclusion-double-negation-stable-subtype , + is-double-negation-stable-emb-inclusion-double-negation-stable-subtype) +``` + +### The double negation stable subtype associated to a double negation stable embedding + +```agda +module _ + {l1 l2 : Level} {X : UU l1} {Y : UU l2} (f : X ↪¬¬ Y) + where + + double-negation-stable-subtype-double-negation-stable-emb : + double-negation-stable-subtype (l1 ⊔ l2) Y + pr1 (double-negation-stable-subtype-double-negation-stable-emb y) = + fiber (map-double-negation-stable-emb f) y + pr2 (double-negation-stable-subtype-double-negation-stable-emb y) = + is-double-negation-stable-prop-map-is-double-negation-stable-emb + ( is-double-negation-stable-emb-map-double-negation-stable-emb f) + ( y) + + compute-type-double-negation-stable-type-double-negation-stable-emb : + type-double-negation-stable-subtype + double-negation-stable-subtype-double-negation-stable-emb ≃ + X + compute-type-double-negation-stable-type-double-negation-stable-emb = + equiv-total-fiber (map-double-negation-stable-emb f) + + inv-compute-type-double-negation-stable-type-double-negation-stable-emb : + X ≃ + type-double-negation-stable-subtype + double-negation-stable-subtype-double-negation-stable-emb + inv-compute-type-double-negation-stable-type-double-negation-stable-emb = + inv-equiv-total-fiber (map-double-negation-stable-emb f) +``` + +## Examples + +### The double negation stable subtypes of left and right elements in a coproduct type + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} + where + + is-double-negation-stable-is-left : + (x : A + B) → has-double-negation-elim (is-left x) + is-double-negation-stable-is-left (inl x) = double-negation-elim-unit + is-double-negation-stable-is-left (inr x) = double-negation-elim-empty + + is-left-Double-Negation-Stable-Prop : + A + B → Double-Negation-Stable-Prop lzero + pr1 (is-left-Double-Negation-Stable-Prop x) = is-left x + pr1 (pr2 (is-left-Double-Negation-Stable-Prop x)) = is-prop-is-left x + pr2 (pr2 (is-left-Double-Negation-Stable-Prop x)) = + is-double-negation-stable-is-left x + + is-double-negation-stable-is-right : + (x : A + B) → has-double-negation-elim (is-right x) + is-double-negation-stable-is-right (inl x) = double-negation-elim-empty + is-double-negation-stable-is-right (inr x) = double-negation-elim-unit + + is-right-Double-Negation-Stable-Prop : + A + B → Double-Negation-Stable-Prop lzero + pr1 (is-right-Double-Negation-Stable-Prop x) = is-right x + pr1 (pr2 (is-right-Double-Negation-Stable-Prop x)) = is-prop-is-right x + pr2 (pr2 (is-right-Double-Negation-Stable-Prop x)) = + is-double-negation-stable-is-right x +``` + +## Properties + +### A double negation stable subtype of a `k+1`-truncated type is `k+1`-truncated + +```agda +module _ + {l1 l2 : Level} (k : 𝕋) {A : UU l1} (P : double-negation-stable-subtype l2 A) + where + + abstract + is-trunc-type-double-negation-stable-subtype : + is-trunc (succ-𝕋 k) A → is-trunc (succ-𝕋 k) + (type-double-negation-stable-subtype P) + is-trunc-type-double-negation-stable-subtype = + is-trunc-type-subtype k (subtype-double-negation-stable-subtype P) + +module _ + {l1 l2 : Level} {A : UU l1} (P : double-negation-stable-subtype l2 A) + where + + abstract + is-prop-type-double-negation-stable-subtype : + is-prop A → is-prop (type-double-negation-stable-subtype P) + is-prop-type-double-negation-stable-subtype = + is-prop-type-subtype (subtype-double-negation-stable-subtype P) + + abstract + is-set-type-double-negation-stable-subtype : + is-set A → is-set (type-double-negation-stable-subtype P) + is-set-type-double-negation-stable-subtype = + is-set-type-subtype (subtype-double-negation-stable-subtype P) + + abstract + is-1-type-type-double-negation-stable-subtype : + is-1-type A → is-1-type (type-double-negation-stable-subtype P) + is-1-type-type-double-negation-stable-subtype = + is-1-type-type-subtype (subtype-double-negation-stable-subtype P) + +prop-double-negation-stable-subprop : + {l1 l2 : Level} (A : Prop l1) + (P : double-negation-stable-subtype l2 (type-Prop A)) → + Prop (l1 ⊔ l2) +prop-double-negation-stable-subprop A P = + prop-subprop A (subtype-double-negation-stable-subtype P) + +set-double-negation-stable-subset : + {l1 l2 : Level} (A : Set l1) + (P : double-negation-stable-subtype l2 (type-Set A)) → + Set (l1 ⊔ l2) +set-double-negation-stable-subset A P = + set-subset A (subtype-double-negation-stable-subtype P) +``` + +### The type of double negation stable subtypes of a type is a set + +```agda +is-set-double-negation-stable-subtype : + {l1 l2 : Level} {X : UU l1} → is-set (double-negation-stable-subtype l2 X) +is-set-double-negation-stable-subtype = + is-set-function-type is-set-Double-Negation-Stable-Prop +``` + +### Extensionality of the type of double negation stable subtypes + +```agda +module _ + {l1 l2 : Level} {A : UU l1} (P : double-negation-stable-subtype l2 A) + where + + has-same-elements-double-negation-stable-subtype : + {l3 : Level} → double-negation-stable-subtype l3 A → UU (l1 ⊔ l2 ⊔ l3) + has-same-elements-double-negation-stable-subtype Q = + has-same-elements-subtype + ( subtype-double-negation-stable-subtype P) + ( subtype-double-negation-stable-subtype Q) + + extensionality-double-negation-stable-subtype : + (Q : double-negation-stable-subtype l2 A) → + (P = Q) ≃ has-same-elements-double-negation-stable-subtype Q + extensionality-double-negation-stable-subtype = + extensionality-Π P + ( λ x Q → + ( type-Double-Negation-Stable-Prop (P x)) ↔ + ( type-Double-Negation-Stable-Prop Q)) + ( λ x Q → extensionality-Double-Negation-Stable-Prop (P x) Q) + + has-same-elements-eq-double-negation-stable-subtype : + (Q : double-negation-stable-subtype l2 A) → + (P = Q) → has-same-elements-double-negation-stable-subtype Q + has-same-elements-eq-double-negation-stable-subtype Q = + map-equiv (extensionality-double-negation-stable-subtype Q) + + eq-has-same-elements-double-negation-stable-subtype : + (Q : double-negation-stable-subtype l2 A) → + has-same-elements-double-negation-stable-subtype Q → P = Q + eq-has-same-elements-double-negation-stable-subtype Q = + map-inv-equiv (extensionality-double-negation-stable-subtype Q) + + refl-extensionality-double-negation-stable-subtype : + map-equiv (extensionality-double-negation-stable-subtype P) refl = + (λ x → id , id) + refl-extensionality-double-negation-stable-subtype = refl +``` + +### The type of double negation stable subtypes of `A` is equivalent to the type of all double negation stable embeddings into a type `A` + +```agda +equiv-Fiber-Double-Negation-Stable-Prop : + (l : Level) {l1 : Level} (A : UU l1) → + Σ (UU (l1 ⊔ l)) (λ X → X ↪¬¬ A) ≃ (double-negation-stable-subtype (l1 ⊔ l) A) +equiv-Fiber-Double-Negation-Stable-Prop l A = + ( equiv-Fiber-structure l is-double-negation-stable-prop A) ∘e + ( equiv-tot + ( λ X → + equiv-tot + ( λ f → + ( inv-distributive-Π-Σ) ∘e + ( equiv-product-left (equiv-is-prop-map-is-emb f))))) +``` diff --git a/src/logic/markovs-principle.lagda.md b/src/logic/markovs-principle.lagda.md new file mode 100644 index 0000000000..aefbbff69d --- /dev/null +++ b/src/logic/markovs-principle.lagda.md @@ -0,0 +1,138 @@ +# Markov's principle + +```agda +module logic.markovs-principle 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 +``` + +
+ +## Idea + +{{#concept "Markov's principle" WDID=Q3922074 WD="Markov's principle" Agda=Markov's-Principle}} +asserts that if a [decidable subtype](foundation.decidable-subtypes.md) `𝒫` of +the [natural numbers](elementary-number-theory.natural-numbers.md) `ℕ` is not +[full](foundation.full-subtypes.md), then +[there is](foundation.existential-quantification.md) a natural number `n` that +is not in `𝒫`. + +More generally we say a type `A` is {{#concept "Markovian" Agda=is-markovian}} +if, for every decidable subtype `𝒫` of `A`, if `𝒫` is not full then there is an +element of `A` that is not in `𝒫`. + +Markov's principle is an example of a constructive taboo. That is, it is an +example of a principle that need not be true in constructive mathematics, +although, it does not imply the +[law of excluded middle](foundation.law-of-excluded-middle.md). + +## Definitions + +### The predicate on a type of being Markovian + +We phrase the condition using booleans to obtain a small predicate. + +```agda +is-markovian : {l : Level} → UU l → UU l +is-markovian A = + (𝒫 : (x : A) → bool) → + ¬ ((x : A) → is-true (𝒫 x)) → + is-inhabited (Σ A (is-false ∘ 𝒫)) + +is-prop-is-markovian : {l : Level} (A : UU l) → is-prop (is-markovian A) +is-prop-is-markovian A = + is-prop-Π + ( λ 𝒫 → + is-prop-function-type + ( is-property-is-inhabited (Σ A (is-false ∘ 𝒫)))) +``` + +### The predicate on a type of being Markovian at a universe level + +```agda +module _ + {l1 : Level} (l2 : Level) (A : UU l1) + where + + is-markovian-prop-Level : Prop (l1 ⊔ lsuc l2) + is-markovian-prop-Level = + Π-Prop + ( decidable-subtype l2 A) + ( λ P → + ¬' (∀' A (subtype-decidable-subtype P)) ⇒ + ∃ A (¬'_ ∘ subtype-decidable-subtype P)) + + is-markovian-Level : UU (l1 ⊔ lsuc l2) + is-markovian-Level = + (P : decidable-subtype l2 A) → + ¬ ((x : A) → is-in-decidable-subtype P x) → + exists A (¬'_ ∘ subtype-decidable-subtype P) + + is-prop-is-markovian-Level : is-prop is-markovian-Level + is-prop-is-markovian-Level = is-prop-type-Prop is-markovian-prop-Level +``` + +### Markov's principle + +```agda +Markov's-Principle : UU lzero +Markov's-Principle = is-markovian ℕ +``` + +## Properties + +### A type is Markovian if and only if it is Markovian at any universe level + +> This remains to be formalized. + +### A type is Markovian if and only if it is Markovian at all universe levels + +> This remains to be formalized. + +### Markov's principle is constructively valid for ascending chains of decidable propositions + +**Proof.** Assume given a descending chain of propositions `Pᵢ ⇒ Pᵢ₊₁` indexed +by the natural numbers `ℕ`. This gives a subtype `𝒫` of `ℕ` given by `i ∈ 𝒫` iff +`Pᵢ` is true. Observe that if `i ∈ 𝒫` then every `j ≥ i` is also in `𝒫`, and +there must exist a least `k ∈ 𝒫`. Therefore, `𝒫 = Σ (m ∈ ℕ) (m ≥ k)` for some +`k`. So, if `¬∀Pᵢ` it is necessarily the case that `¬P₀`. + +```agda +markov-descending-chain-ℕ : + {l : Level} (P : ℕ → UU l) + (H : (n : ℕ) → P n → P (succ-ℕ n)) → ¬ ((n : ℕ) → P n) → Σ ℕ (¬_ ∘ P) +markov-descending-chain-ℕ P H q = (0 , λ x → q (ind-ℕ x H)) +``` + +## See also + +- [The principle of omniscience](foundation.principle-of-omniscience.md) +- [The limited principle of omniscience](foundation.limited-principle-of-omniscience.md) +- [The lesser limited principle of omniscience](foundation.lesser-limited-principle-of-omniscience.md) +- [The weak limited principle of omniscience](foundation.weak-limited-principle-of-omniscience.md) + +## External links + +- [limited principle of omniscience](https://ncatlab.org/nlab/show/limited+principle+of+omniscience) + at $n$Lab diff --git a/src/logic/mutually-de-morgan-families.lagda.md b/src/logic/mutually-de-morgan-families.lagda.md new file mode 100644 index 0000000000..b4547059a8 --- /dev/null +++ b/src/logic/mutually-de-morgan-families.lagda.md @@ -0,0 +1,75 @@ +# Mutually De Morgan families + +```agda +module logic.mutually-de-morgan-families where +``` + +
Imports + +```agda +open import foundation.cartesian-product-types +open import foundation.conjunction +open import foundation.coproduct-types +open import foundation.decidable-types +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.existential-quantification +open import foundation.function-types +open import foundation.logical-equivalences +open import foundation.negation +open import foundation.propositional-truncations +open import foundation.universal-quantification +open import foundation.universe-levels + +open import foundation-core.decidable-propositions +open import foundation-core.propositions + +open import logic.de-morgans-law + +open import univalent-combinatorics.2-element-types +``` + +
+ +## Idea + +A family of types `P : A → 𝒰` is +{{#concept "mutually de morgan" Disambiguation="family of types" Agda=is-mutually-de-morgan-family}} + +if the logical implication + +```text + ∃x, ¬(P x) ⇒ ¬ (∀x, P x) +``` + +has a converse. + +## Definition + +### Mutually De Morgan families + +```agda +module _ + {l1 l2 : Level} {A : UU l1} (P : A → UU l2) + where + + is-mutually-de-morgan-family : UU (l1 ⊔ l2) + is-mutually-de-morgan-family = + ¬ ((x : A) → P x) → exists-structure A (λ x → ¬ P x) + + is-prop-is-mutually-de-morgan-family : is-prop is-mutually-de-morgan-family + is-prop-is-mutually-de-morgan-family = + is-prop-function-type (is-prop-exists-structure A (λ x → ¬ P x)) + + is-mutually-de-morgan-family-Prop : Prop (l1 ⊔ l2) + is-mutually-de-morgan-family-Prop = + ( is-mutually-de-morgan-family , is-prop-is-mutually-de-morgan-family) +``` + +## External links + +- [De Morgan laws, in constructive mathematics](https://ncatlab.org/nlab/show/De+Morgan+laws#in_constructive_mathematics) + at $n$Lab diff --git a/src/order-theory.lagda.md b/src/order-theory.lagda.md index 55ffbd3d3f..3df4da92b1 100644 --- a/src/order-theory.lagda.md +++ b/src/order-theory.lagda.md @@ -6,6 +6,7 @@ module order-theory where open import order-theory.accessible-elements-relations public +open import order-theory.bottom-elements-large-posets public open import order-theory.bottom-elements-posets public open import order-theory.bottom-elements-preorders public open import order-theory.chains-posets public @@ -27,8 +28,6 @@ open import order-theory.dependent-products-large-meet-semilattices public open import order-theory.dependent-products-large-posets public open import order-theory.dependent-products-large-preorders public open import order-theory.dependent-products-large-suplattices public -open import order-theory.directed-complete-posets public -open import order-theory.directed-families public open import order-theory.distributive-lattices public open import order-theory.finite-coverings-locales public open import order-theory.finite-posets public @@ -50,9 +49,14 @@ open import order-theory.homomorphisms-meet-sup-lattices public open import order-theory.homomorphisms-sup-lattices public open import order-theory.ideals-preorders public open import order-theory.incidence-algebras public +open import order-theory.inflattices public +open import order-theory.inhabited-chains-posets public +open import order-theory.inhabited-chains-preorders public open import order-theory.inhabited-finite-total-orders public open import order-theory.interval-subposets public +open import order-theory.join-preserving-maps-posets public open import order-theory.join-semilattices public +open import order-theory.knaster-tarski-fixed-point-theorem public open import order-theory.large-frames public open import order-theory.large-locales public open import order-theory.large-meet-semilattices public @@ -79,6 +83,10 @@ open import order-theory.maximal-chains-preorders public open import order-theory.meet-semilattices public open import order-theory.meet-suplattices public open import order-theory.nuclei-large-locales public +open import order-theory.opposite-large-posets public +open import order-theory.opposite-large-preorders public +open import order-theory.opposite-posets public +open import order-theory.opposite-preorders public open import order-theory.order-preserving-maps-large-posets public open import order-theory.order-preserving-maps-large-preorders public open import order-theory.order-preserving-maps-posets public @@ -96,6 +104,9 @@ open import order-theory.preorders public open import order-theory.principal-lower-sets-large-posets public open import order-theory.principal-upper-sets-large-posets public open import order-theory.reflective-galois-connections-large-posets public +open import order-theory.resizing-posets public +open import order-theory.resizing-preorders public +open import order-theory.resizing-suplattices public open import order-theory.similarity-of-elements-large-posets public open import order-theory.similarity-of-elements-large-preorders public open import order-theory.similarity-of-order-preserving-maps-large-posets public @@ -103,6 +114,7 @@ open import order-theory.similarity-of-order-preserving-maps-large-preorders pub open import order-theory.subposets public open import order-theory.subpreorders public open import order-theory.suplattices public +open import order-theory.supremum-preserving-maps-posets public open import order-theory.top-elements-large-posets public open import order-theory.top-elements-posets public open import order-theory.top-elements-preorders public diff --git a/src/order-theory/bottom-elements-large-posets.lagda.md b/src/order-theory/bottom-elements-large-posets.lagda.md new file mode 100644 index 0000000000..76262a6702 --- /dev/null +++ b/src/order-theory/bottom-elements-large-posets.lagda.md @@ -0,0 +1,79 @@ +# Bottom elements in large posets + +```agda +module order-theory.bottom-elements-large-posets where +``` + +
Imports + +```agda +open import foundation.universe-levels + +open import order-theory.dependent-products-large-posets +open import order-theory.large-posets +``` + +
+ +## Idea + +We say that a [large poset](order-theory.large-posets.md) `P` has a +{{#concept "least element" Disambiguation="in a large poset" Agda=is-bottom-element-Large-Poset}} +if it comes equipped with an element `t : type-Large-Poset P lzero` such that +`t ≤ x` holds for every `x : P`. + +## Definition + +### The predicate on elements of posets of being a bottom element + +```agda +module _ + {α : Level → Level} {β : Level → Level → Level} (P : Large-Poset α β) + where + + is-bottom-element-Large-Poset : + {l1 : Level} → type-Large-Poset P l1 → UUω + is-bottom-element-Large-Poset x = + {l : Level} (y : type-Large-Poset P l) → leq-Large-Poset P x y +``` + +### The predicate on posets of having a bottom element + +```agda +module _ + {α : Level → Level} {β : Level → Level → Level} + (P : Large-Poset α β) + where + + record + has-bottom-element-Large-Poset : UUω + where + field + bottom-has-bottom-element-Large-Poset : + type-Large-Poset P lzero + is-bottom-element-bottom-has-bottom-element-Large-Poset : + is-bottom-element-Large-Poset P bottom-has-bottom-element-Large-Poset + + open has-bottom-element-Large-Poset public +``` + +## Properties + +### If `P` is a family of large posets, then `Π-Large-Poset P` has a bottom element + +```agda +module _ + {α : Level → Level} {β : Level → Level → Level} + {l1 : Level} {I : UU l1} (P : I → Large-Poset α β) + where + + has-bottom-element-Π-Large-Poset : + ((i : I) → has-bottom-element-Large-Poset (P i)) → + has-bottom-element-Large-Poset (Π-Large-Poset P) + bottom-has-bottom-element-Large-Poset + ( has-bottom-element-Π-Large-Poset H) i = + bottom-has-bottom-element-Large-Poset (H i) + is-bottom-element-bottom-has-bottom-element-Large-Poset + ( has-bottom-element-Π-Large-Poset H) x i = + is-bottom-element-bottom-has-bottom-element-Large-Poset (H i) (x i) +``` diff --git a/src/order-theory/bottom-elements-posets.lagda.md b/src/order-theory/bottom-elements-posets.lagda.md index 3a49794ba8..19f835b65c 100644 --- a/src/order-theory/bottom-elements-posets.lagda.md +++ b/src/order-theory/bottom-elements-posets.lagda.md @@ -20,8 +20,10 @@ open import order-theory.posets ## Idea -A **bottom element** in a poset `P` is an element `b` such that `b ≤ x` holds -for every element `x : P`. +A +{{#concept "bottom element" Disambiguation="in a poset" Agda=is-bottom-element-Poset}} +in a [poset](order-theory.posets.md) `P` is an element `b` such that `b ≤ x` +holds for every element `x : P`. ## Definition diff --git a/src/order-theory/bottom-elements-preorders.lagda.md b/src/order-theory/bottom-elements-preorders.lagda.md index 538fba883d..5d5c0f1b8b 100644 --- a/src/order-theory/bottom-elements-preorders.lagda.md +++ b/src/order-theory/bottom-elements-preorders.lagda.md @@ -30,7 +30,7 @@ module _ is-bottom-element-Preorder-Prop : type-Preorder X → Prop (l1 ⊔ l2) is-bottom-element-Preorder-Prop x = - Π-Prop (type-Preorder X) (leq-Preorder-Prop X x) + Π-Prop (type-Preorder X) (leq-prop-Preorder X x) is-bottom-element-Preorder : type-Preorder X → UU (l1 ⊔ l2) is-bottom-element-Preorder x = type-Prop (is-bottom-element-Preorder-Prop x) diff --git a/src/order-theory/chains-posets.lagda.md b/src/order-theory/chains-posets.lagda.md index 99d9811a4b..d882287302 100644 --- a/src/order-theory/chains-posets.lagda.md +++ b/src/order-theory/chains-posets.lagda.md @@ -7,16 +7,23 @@ module order-theory.chains-posets where
Imports ```agda +open import foundation.coproduct-types open import foundation.dependent-pair-types +open import foundation.disjunction open import foundation.existential-quantification open import foundation.function-types +open import foundation.identity-types +open import foundation.images +open import foundation.propositional-truncations open import foundation.propositions open import foundation.subtypes open import foundation.universe-levels open import order-theory.chains-preorders +open import order-theory.order-preserving-maps-posets open import order-theory.posets open import order-theory.subposets +open import order-theory.total-orders ```
@@ -79,8 +86,8 @@ module _ (C : chain-Poset l3 X) (D : chain-Poset l4 X) where - inclusion-chain-prop-Poset : Prop (l1 ⊔ l3 ⊔ l4) - inclusion-chain-prop-Poset = + inclusion-prop-chain-Poset : Prop (l1 ⊔ l3 ⊔ l4) + inclusion-prop-chain-Poset = inclusion-prop-chain-Preorder (preorder-Poset X) C D inclusion-chain-Poset : UU (l1 ⊔ l3 ⊔ l4) @@ -91,7 +98,65 @@ module _ is-prop-inclusion-chain-Preorder (preorder-Poset X) C D ``` +## Properties + +### Chains in a poset from order preserving maps from a total order + +```agda +module _ + {l1 l2 l3 l4 : Level} + (X : Poset l1 l2) + (T : Total-Order l3 l4) + (f : hom-Poset (poset-Total-Order T) X) + where + + subposet-chain-hom-total-order-Poset : Subposet (l1 ⊔ l3) X + subposet-chain-hom-total-order-Poset = + subtype-im (map-hom-Poset (poset-Total-Order T) X f) + + is-chain-chain-hom-total-order-Poset : + is-chain-Subposet X subposet-chain-hom-total-order-Poset + is-chain-chain-hom-total-order-Poset (x , u) (y , v) = + rec-trunc-Prop + ( leq-prop-Poset X x y ∨ leq-prop-Poset X y x) + ( λ p → + rec-trunc-Prop + ( leq-prop-Poset X x y ∨ leq-prop-Poset X y x) + ( λ q → + rec-trunc-Prop + ( leq-prop-Poset X x y ∨ leq-prop-Poset X y x) + ( rec-coproduct + ( λ H → + inl-disjunction + ( concatenate-eq-leq-eq-Poset' X + ( pr2 p) + ( preserves-order-map-hom-Poset (poset-Total-Order T) X f + ( pr1 p) + ( pr1 q) + ( H)) + ( pr2 q))) + ( λ H → + inr-disjunction + ( concatenate-eq-leq-eq-Poset' X + ( pr2 q) + ( preserves-order-map-hom-Poset (poset-Total-Order T) X f + ( pr1 q) + ( pr1 p) + ( H)) + ( pr2 p)))) + ( is-total-Total-Order T (pr1 p) (pr1 q))) + ( v)) + ( u) + + chain-hom-total-order-Poset : chain-Poset (l1 ⊔ l3) X + chain-hom-total-order-Poset = + subposet-chain-hom-total-order-Poset , + is-chain-chain-hom-total-order-Poset +``` + ## External links +- [Total order, chains](https://en.wikipedia.org/wiki/Total_order#Chains) at + Wikipedia - [chain, in order theory](https://ncatlab.org/nlab/show/chain#in_order_theory) at $n$Lab diff --git a/src/order-theory/chains-preorders.lagda.md b/src/order-theory/chains-preorders.lagda.md index f620d50ff1..65c1ad4c19 100644 --- a/src/order-theory/chains-preorders.lagda.md +++ b/src/order-theory/chains-preorders.lagda.md @@ -94,5 +94,7 @@ module _ ## External links +- [Total order, chains](https://en.wikipedia.org/wiki/Total_order#Chains) at + Wikipedia - [chain, in order theory](https://ncatlab.org/nlab/show/chain#in_order_theory) at $n$Lab diff --git a/src/order-theory/decidable-posets.lagda.md b/src/order-theory/decidable-posets.lagda.md index ed925a3c91..b02c21afbf 100644 --- a/src/order-theory/decidable-posets.lagda.md +++ b/src/order-theory/decidable-posets.lagda.md @@ -34,15 +34,15 @@ module _ {l1 l2 : Level} (X : Poset l1 l2) where - is-decidable-leq-Poset-Prop : Prop (l1 ⊔ l2) - is-decidable-leq-Poset-Prop = - is-decidable-leq-Preorder-Prop (preorder-Poset X) + is-decidable-leq-prop-Poset : Prop (l1 ⊔ l2) + is-decidable-leq-prop-Poset = + is-decidable-leq-prop-Preorder (preorder-Poset X) is-decidable-leq-Poset : UU (l1 ⊔ l2) - is-decidable-leq-Poset = type-Prop is-decidable-leq-Poset-Prop + is-decidable-leq-Poset = type-Prop is-decidable-leq-prop-Poset is-prop-is-decidable-leq-Poset : is-prop is-decidable-leq-Poset - is-prop-is-decidable-leq-Poset = is-prop-type-Prop is-decidable-leq-Poset-Prop + is-prop-is-decidable-leq-Poset = is-prop-type-Prop is-decidable-leq-prop-Poset Decidable-Poset : (l1 l2 : Level) → UU (lsuc l1 ⊔ lsuc l2) Decidable-Poset l1 l2 = Σ (Poset l1 l2) is-decidable-leq-Poset @@ -65,7 +65,7 @@ module _ type-Decidable-Poset = type-Poset poset-Decidable-Poset leq-Decidable-Poset-Prop : (x y : type-Decidable-Poset) → Prop l2 - leq-Decidable-Poset-Prop = leq-Poset-Prop poset-Decidable-Poset + leq-Decidable-Poset-Prop = leq-prop-Poset poset-Decidable-Poset leq-Decidable-Poset : (x y : type-Decidable-Poset) → UU l2 leq-Decidable-Poset = leq-Poset poset-Decidable-Poset diff --git a/src/order-theory/decidable-preorders.lagda.md b/src/order-theory/decidable-preorders.lagda.md index 94d9b8472c..b752e33a13 100644 --- a/src/order-theory/decidable-preorders.lagda.md +++ b/src/order-theory/decidable-preorders.lagda.md @@ -30,21 +30,21 @@ module _ {l1 l2 : Level} (X : Preorder l1 l2) where - is-decidable-leq-Preorder-Prop : Prop (l1 ⊔ l2) - is-decidable-leq-Preorder-Prop = + is-decidable-leq-prop-Preorder : Prop (l1 ⊔ l2) + is-decidable-leq-prop-Preorder = Π-Prop ( type-Preorder X) ( λ x → Π-Prop ( type-Preorder X) - ( λ y → is-decidable-Prop (leq-Preorder-Prop X x y))) + ( λ y → is-decidable-Prop (leq-prop-Preorder X x y))) is-decidable-leq-Preorder : UU (l1 ⊔ l2) - is-decidable-leq-Preorder = type-Prop is-decidable-leq-Preorder-Prop + is-decidable-leq-Preorder = type-Prop is-decidable-leq-prop-Preorder is-prop-is-decidable-leq-Preorder : is-prop is-decidable-leq-Preorder is-prop-is-decidable-leq-Preorder = - is-prop-type-Prop is-decidable-leq-Preorder-Prop + is-prop-type-Prop is-decidable-leq-prop-Preorder Decidable-Preorder : (l1 l2 : Level) → UU (lsuc l1 ⊔ lsuc l2) Decidable-Preorder l1 l2 = Σ (Preorder l1 l2) is-decidable-leq-Preorder @@ -66,7 +66,7 @@ module _ leq-Decidable-Preorder-Prop : (x y : type-Decidable-Preorder) → Prop l2 leq-Decidable-Preorder-Prop = - leq-Preorder-Prop preorder-Decidable-Preorder + leq-prop-Preorder preorder-Decidable-Preorder leq-Decidable-Preorder : (x y : type-Decidable-Preorder) → UU l2 diff --git a/src/order-theory/decidable-total-orders.lagda.md b/src/order-theory/decidable-total-orders.lagda.md index 6e25cceabf..2aeb739708 100644 --- a/src/order-theory/decidable-total-orders.lagda.md +++ b/src/order-theory/decidable-total-orders.lagda.md @@ -38,7 +38,7 @@ which the inequality [relation](foundation.binary-relations.md) is ```agda is-decidable-total-prop-Poset : {l1 l2 : Level} → Poset l1 l2 → Prop (l1 ⊔ l2) is-decidable-total-prop-Poset P = - product-Prop (is-total-Poset-Prop P) (is-decidable-leq-Poset-Prop P) + product-Prop (is-total-Poset-Prop P) (is-decidable-leq-prop-Poset P) is-decidable-total-Poset : {l1 l2 : Level} → Poset l1 l2 → UU (l1 ⊔ l2) is-decidable-total-Poset P = type-Prop (is-decidable-total-prop-Poset P) @@ -75,7 +75,7 @@ module _ leq-Decidable-Total-Order-Prop : (x y : type-Decidable-Total-Order) → Prop l2 - leq-Decidable-Total-Order-Prop = leq-Poset-Prop poset-Decidable-Total-Order + leq-Decidable-Total-Order-Prop = leq-prop-Poset poset-Decidable-Total-Order leq-Decidable-Total-Order : (x y : type-Decidable-Total-Order) → UU l2 @@ -90,7 +90,7 @@ module _ le-Decidable-Total-Order-Prop : (x y : type-Decidable-Total-Order) → Prop (l1 ⊔ l2) le-Decidable-Total-Order-Prop = - le-Poset-Prop poset-Decidable-Total-Order + le-prop-Poset poset-Decidable-Total-Order le-Decidable-Total-Order : (x y : type-Decidable-Total-Order) → UU (l1 ⊔ l2) diff --git a/src/order-theory/decidable-total-preorders.lagda.md b/src/order-theory/decidable-total-preorders.lagda.md index 351b2a1d2a..c3385ce7ae 100644 --- a/src/order-theory/decidable-total-preorders.lagda.md +++ b/src/order-theory/decidable-total-preorders.lagda.md @@ -67,7 +67,7 @@ module _ leq-Decidable-Total-Preorder-Prop : (x y : type-Decidable-Total-Preorder) → Prop l2 leq-Decidable-Total-Preorder-Prop = - leq-Preorder-Prop preorder-Decidable-Total-Preorder + leq-prop-Preorder preorder-Decidable-Total-Preorder leq-Decidable-Total-Preorder : (x y : type-Decidable-Total-Preorder) → UU l2 @@ -83,7 +83,7 @@ module _ le-Decidable-Total-Preorder-Prop : (x y : type-Decidable-Total-Preorder) → Prop (l1 ⊔ l2) le-Decidable-Total-Preorder-Prop = - le-Preorder-Prop preorder-Decidable-Total-Preorder + le-prop-Preorder preorder-Decidable-Total-Preorder le-Decidable-Total-Preorder : (x y : type-Decidable-Total-Preorder) → UU (l1 ⊔ l2) diff --git a/src/order-theory/directed-complete-posets.lagda.md b/src/order-theory/directed-complete-posets.lagda.md deleted file mode 100644 index 8f4cf11c56..0000000000 --- a/src/order-theory/directed-complete-posets.lagda.md +++ /dev/null @@ -1,40 +0,0 @@ -# Directed complete posets - -```agda -module order-theory.directed-complete-posets where -``` - -
Imports - -```agda -open import foundation.propositions -open import foundation.subtypes -open import foundation.universe-levels - -open import order-theory.directed-families -open import order-theory.least-upper-bounds-posets -open import order-theory.posets -``` - -
- -## Idea - -A **DCPO**, i.e., a **directed complete partially ordered set**, is a poset in -which each directed family of elements has a least upper bound. - -## Definition - -```agda -is-directed-complete-Poset-Prop : - {l1 l2 : Level} (l3 : Level) (P : Poset l1 l2) → Prop (l1 ⊔ l2 ⊔ lsuc l3) -is-directed-complete-Poset-Prop l3 P = - Π-Prop - ( directed-family-Poset l3 P) - ( λ x → - has-least-upper-bound-family-of-elements-Poset-Prop P - ( family-directed-family-Poset P x)) - -DCPO : (l1 l2 l3 : Level) → UU (lsuc l1 ⊔ lsuc l2 ⊔ lsuc l3) -DCPO l1 l2 l3 = type-subtype (is-directed-complete-Poset-Prop {l1} {l2} l3) -``` diff --git a/src/order-theory/directed-families.lagda.md b/src/order-theory/directed-families.lagda.md deleted file mode 100644 index e82194883e..0000000000 --- a/src/order-theory/directed-families.lagda.md +++ /dev/null @@ -1,84 +0,0 @@ -# Directed families in posets - -```agda -module order-theory.directed-families where -``` - -
Imports - -```agda -open import foundation.cartesian-product-types -open import foundation.conjunction -open import foundation.dependent-pair-types -open import foundation.existential-quantification -open import foundation.inhabited-types -open import foundation.propositions -open import foundation.universal-quantification -open import foundation.universe-levels - -open import order-theory.posets -``` - -
- -## Idea - -A **directed family of elements** in a poset `P` consists of an inhabited type -`I` and a map `x : I → P` such that for any two elements `i j : I` there exists -an element `k : I` such that both `x i ≤ x k` and `x j ≤ x k` hold. - -## Definition - -```agda -is-directed-family-Poset-Prop : - {l1 l2 l3 : Level} (P : Poset l1 l2) (I : Inhabited-Type l3) - (x : type-Inhabited-Type I → type-Poset P) → Prop (l2 ⊔ l3) -is-directed-family-Poset-Prop P I x = - ∀' - ( type-Inhabited-Type I) - ( λ i → - ∀' - ( type-Inhabited-Type I) - ( λ j → - ∃ ( type-Inhabited-Type I) - ( λ k → - leq-Poset-Prop P (x i) (x k) ∧ leq-Poset-Prop P (x j) (x k)))) - -is-directed-family-Poset : - {l1 l2 l3 : Level} (P : Poset l1 l2) (I : Inhabited-Type l3) - (α : type-Inhabited-Type I → type-Poset P) → UU (l2 ⊔ l3) -is-directed-family-Poset P I x = type-Prop (is-directed-family-Poset-Prop P I x) - -directed-family-Poset : - {l1 l2 : Level} (l3 : Level) → Poset l1 l2 → UU (l1 ⊔ l2 ⊔ lsuc l3) -directed-family-Poset l3 P = - Σ ( Inhabited-Type l3) - ( λ I → - Σ ( type-Inhabited-Type I → type-Poset P) - ( is-directed-family-Poset P I)) - -module _ - {l1 l2 l3 : Level} (P : Poset l1 l2) (x : directed-family-Poset l3 P) - where - - inhabited-type-directed-family-Poset : Inhabited-Type l3 - inhabited-type-directed-family-Poset = pr1 x - - type-directed-family-Poset : UU l3 - type-directed-family-Poset = - type-Inhabited-Type inhabited-type-directed-family-Poset - - is-inhabited-type-directed-family-Poset : - is-inhabited type-directed-family-Poset - is-inhabited-type-directed-family-Poset = - is-inhabited-type-Inhabited-Type inhabited-type-directed-family-Poset - - family-directed-family-Poset : type-directed-family-Poset → type-Poset P - family-directed-family-Poset = pr1 (pr2 x) - - is-directed-family-directed-family-Poset : - is-directed-family-Poset P - ( inhabited-type-directed-family-Poset) - ( family-directed-family-Poset) - is-directed-family-directed-family-Poset = pr2 (pr2 x) -``` diff --git a/src/order-theory/finite-preorders.lagda.md b/src/order-theory/finite-preorders.lagda.md index 23c83dcdd3..3fd77f600d 100644 --- a/src/order-theory/finite-preorders.lagda.md +++ b/src/order-theory/finite-preorders.lagda.md @@ -48,7 +48,7 @@ module _ is-finite-Preorder-Prop = product-Prop ( is-finite-Prop (type-Preorder P)) - ( is-decidable-leq-Preorder-Prop P) + ( is-decidable-leq-prop-Preorder P) is-finite-Preorder : UU (l1 ⊔ l2) is-finite-Preorder = type-Prop is-finite-Preorder-Prop diff --git a/src/order-theory/frames.lagda.md b/src/order-theory/frames.lagda.md index 46e4450009..96d2f47cec 100644 --- a/src/order-theory/frames.lagda.md +++ b/src/order-theory/frames.lagda.md @@ -213,7 +213,7 @@ module _ is-set-type-Frame = is-set-type-Poset poset-Frame leq-Frame-Prop : (x y : type-Frame) → Prop l1 - leq-Frame-Prop = leq-Poset-Prop poset-Frame + leq-Frame-Prop = leq-prop-Poset poset-Frame leq-Frame : (x y : type-Frame) → UU l1 leq-Frame = leq-Poset poset-Frame diff --git a/src/order-theory/galois-connections.lagda.md b/src/order-theory/galois-connections.lagda.md index 166d4d22a0..5ae6e96259 100644 --- a/src/order-theory/galois-connections.lagda.md +++ b/src/order-theory/galois-connections.lagda.md @@ -52,8 +52,8 @@ module _ ( type-Poset Q) ( λ y → iff-Prop - ( leq-Poset-Prop Q (map-hom-Poset P Q f x) y) - ( leq-Poset-Prop P x (map-hom-Poset Q P g y)))) + ( leq-prop-Poset Q (map-hom-Poset P Q f x) y) + ( leq-prop-Poset P x (map-hom-Poset Q P g y)))) is-lower-adjoint-Galois-Connection : hom-Poset P Q → UU (l1 ⊔ l2 ⊔ l3 ⊔ l4) diff --git a/src/order-theory/greatest-lower-bounds-posets.lagda.md b/src/order-theory/greatest-lower-bounds-posets.lagda.md index c6afa32f62..84f0675768 100644 --- a/src/order-theory/greatest-lower-bounds-posets.lagda.md +++ b/src/order-theory/greatest-lower-bounds-posets.lagda.md @@ -56,7 +56,7 @@ module _ ( λ y → iff-Prop ( is-binary-lower-bound-Poset-Prop P a b y) - ( leq-Poset-Prop P y x)) + ( leq-prop-Poset P y x)) is-greatest-binary-lower-bound-Poset : type-Poset P → UU (l1 ⊔ l2) is-greatest-binary-lower-bound-Poset x = @@ -180,26 +180,26 @@ module _ {l1 l2 l3 : Level} (P : Poset l1 l2) {I : UU l3} (a : I → type-Poset P) where - is-greatest-lower-bound-family-of-elements-Poset-Prop : + is-greatest-lower-bound-family-of-elements-prop-Poset : type-Poset P → Prop (l1 ⊔ l2 ⊔ l3) - is-greatest-lower-bound-family-of-elements-Poset-Prop x = + is-greatest-lower-bound-family-of-elements-prop-Poset x = Π-Prop ( type-Poset P) ( λ y → iff-Prop - ( Π-Prop I (λ i → leq-Poset-Prop P y (a i))) - ( leq-Poset-Prop P y x)) + ( Π-Prop I (λ i → leq-prop-Poset P y (a i))) + ( leq-prop-Poset P y x)) is-greatest-lower-bound-family-of-elements-Poset : type-Poset P → UU (l1 ⊔ l2 ⊔ l3) is-greatest-lower-bound-family-of-elements-Poset z = - type-Prop (is-greatest-lower-bound-family-of-elements-Poset-Prop z) + type-Prop (is-greatest-lower-bound-family-of-elements-prop-Poset z) is-prop-is-greatest-lower-bound-family-of-elements-Poset : (z : type-Poset P) → is-prop (is-greatest-lower-bound-family-of-elements-Poset z) is-prop-is-greatest-lower-bound-family-of-elements-Poset z = - is-prop-type-Prop (is-greatest-lower-bound-family-of-elements-Poset-Prop z) + is-prop-type-Prop (is-greatest-lower-bound-family-of-elements-prop-Poset z) module _ {l1 l2 l3 : Level} (P : Poset l1 l2) {I : UU l3} {a : I → type-Poset P} @@ -246,7 +246,7 @@ module _ all-elements-equal-has-greatest-lower-bound-family-of-elements-Poset ( x , H) (y , K) = eq-type-subtype - ( is-greatest-lower-bound-family-of-elements-Poset-Prop P a) + ( is-greatest-lower-bound-family-of-elements-prop-Poset P a) ( antisymmetric-leq-Poset P x y ( forward-implication-is-greatest-lower-bound-family-of-elements-Poset ( P) @@ -267,10 +267,10 @@ module _ is-prop-all-elements-equal all-elements-equal-has-greatest-lower-bound-family-of-elements-Poset - has-greatest-lower-bound-family-of-elements-Poset-Prop : Prop (l1 ⊔ l2 ⊔ l3) - pr1 has-greatest-lower-bound-family-of-elements-Poset-Prop = + has-greatest-lower-bound-family-of-elements-prop-Poset : Prop (l1 ⊔ l2 ⊔ l3) + pr1 has-greatest-lower-bound-family-of-elements-prop-Poset = has-greatest-lower-bound-family-of-elements-Poset - pr2 has-greatest-lower-bound-family-of-elements-Poset-Prop = + pr2 has-greatest-lower-bound-family-of-elements-prop-Poset = is-prop-has-greatest-lower-bound-family-of-elements-Poset module _ diff --git a/src/order-theory/inflattices.lagda.md b/src/order-theory/inflattices.lagda.md new file mode 100644 index 0000000000..7ded028eca --- /dev/null +++ b/src/order-theory/inflattices.lagda.md @@ -0,0 +1,146 @@ +# Inflattices + +```agda +module order-theory.inflattices where +``` + +
Imports + +```agda +open import foundation.binary-relations +open import foundation.dependent-pair-types +open import foundation.logical-equivalences +open import foundation.propositions +open import foundation.sets +open import foundation.universe-levels + +open import order-theory.greatest-lower-bounds-posets +open import order-theory.posets +``` + +
+ +## Idea + +An `l`-{{#concept "inflattice" Agda=Inflattice}} is a +[poset](order-theory.posets.md) which has all +[greatest lower bounds](order-theory.greatest-lower-bounds-posets.md) of +families of elements indexed by a type of +[universe level](foundation.universe-levels.md) `l`. + +## Definitions + +### The predicate on posets of being an `l`-inflattice + +```agda +module _ + {l1 l2 : Level} (l3 : Level) (P : Poset l1 l2) + where + + is-inflattice-Poset-Prop : Prop (l1 ⊔ l2 ⊔ lsuc l3) + is-inflattice-Poset-Prop = + Π-Prop + (UU l3) + ( λ I → + Π-Prop + ( I → type-Poset P) + ( λ f → has-greatest-lower-bound-family-of-elements-prop-Poset P f)) + + is-inflattice-Poset : UU (l1 ⊔ l2 ⊔ lsuc l3) + is-inflattice-Poset = type-Prop is-inflattice-Poset-Prop + + is-prop-inflattice-Poset : is-prop is-inflattice-Poset + is-prop-inflattice-Poset = is-prop-type-Prop is-inflattice-Poset-Prop + +module _ + {l1 l2 l3 : Level} (P : Poset l1 l2) (H : is-inflattice-Poset l3 P) + where + + inf-is-inflattice-Poset : + {I : UU l3} → (I → type-Poset P) → type-Poset P + inf-is-inflattice-Poset {I} x = pr1 (H I x) + + is-greatest-lower-bound-inf-is-inflattice-Poset : + {I : UU l3} (x : I → type-Poset P) → + is-greatest-lower-bound-family-of-elements-Poset P x + ( inf-is-inflattice-Poset x) + is-greatest-lower-bound-inf-is-inflattice-Poset {I} x = pr2 (H I x) +``` + +### `l`-Inflattices + +```agda +Inflattice : (l1 l2 l3 : Level) → UU (lsuc l1 ⊔ lsuc l2 ⊔ lsuc l3) +Inflattice l1 l2 l3 = Σ (Poset l1 l2) (λ P → is-inflattice-Poset l3 P) + +module _ + {l1 l2 l3 : Level} (A : Inflattice l1 l2 l3) + where + + poset-Inflattice : Poset l1 l2 + poset-Inflattice = pr1 A + + type-Inflattice : UU l1 + type-Inflattice = type-Poset poset-Inflattice + + leq-prop-Inflattice : (x y : type-Inflattice) → Prop l2 + leq-prop-Inflattice = leq-prop-Poset poset-Inflattice + + leq-Inflattice : (x y : type-Inflattice) → UU l2 + leq-Inflattice = leq-Poset poset-Inflattice + + is-prop-leq-Inflattice : + (x y : type-Inflattice) → is-prop (leq-Inflattice x y) + is-prop-leq-Inflattice = is-prop-leq-Poset poset-Inflattice + + refl-leq-Inflattice : + (x : type-Inflattice) → leq-Inflattice x x + refl-leq-Inflattice = refl-leq-Poset poset-Inflattice + + antisymmetric-leq-Inflattice : is-antisymmetric leq-Inflattice + antisymmetric-leq-Inflattice = + antisymmetric-leq-Poset poset-Inflattice + + transitive-leq-Inflattice : is-transitive leq-Inflattice + transitive-leq-Inflattice = transitive-leq-Poset poset-Inflattice + + is-set-type-Inflattice : is-set type-Inflattice + is-set-type-Inflattice = is-set-type-Poset poset-Inflattice + + set-Inflattice : Set l1 + set-Inflattice = set-Poset poset-Inflattice + + is-inflattice-Inflattice : + is-inflattice-Poset l3 poset-Inflattice + is-inflattice-Inflattice = pr2 A + + inf-Inflattice : + {I : UU l3} → (I → type-Inflattice) → type-Inflattice + inf-Inflattice = + inf-is-inflattice-Poset + ( poset-Inflattice) + ( is-inflattice-Inflattice) + + is-greatest-lower-bound-inf-Inflattice : + {I : UU l3} (x : I → type-Inflattice) → + is-greatest-lower-bound-family-of-elements-Poset + ( poset-Inflattice) + ( x) + ( inf-Inflattice x) + is-greatest-lower-bound-inf-Inflattice = + is-greatest-lower-bound-inf-is-inflattice-Poset + ( poset-Inflattice) + ( is-inflattice-Inflattice) + + leq-inf-Inflattice : + {I : UU l3} (x : I → type-Inflattice) (i : I) → + leq-Inflattice (inf-Inflattice x) (x i) + leq-inf-Inflattice x = + backward-implication + ( is-greatest-lower-bound-inf-Inflattice x (inf-Inflattice x)) + ( refl-leq-Inflattice (inf-Inflattice x)) +``` + +## External links + +- [inflattice](https://ncatlab.org/nlab/show/inflattice) at $n$Lab diff --git a/src/order-theory/inhabited-chains-posets.lagda.md b/src/order-theory/inhabited-chains-posets.lagda.md new file mode 100644 index 0000000000..055bb668ac --- /dev/null +++ b/src/order-theory/inhabited-chains-posets.lagda.md @@ -0,0 +1,171 @@ +# Inhabited chains in posets + +```agda +module order-theory.inhabited-chains-posets where +``` + +
Imports + +```agda +open import domain-theory.directed-families-posets + +open import foundation.conjunction +open import foundation.dependent-pair-types +open import foundation.disjunction +open import foundation.existential-quantification +open import foundation.inhabited-subtypes +open import foundation.inhabited-types +open import foundation.propositions +open import foundation.subtypes +open import foundation.universe-levels + +open import order-theory.chains-posets +open import order-theory.posets +open import order-theory.subposets +open import order-theory.total-preorders +``` + +
+ +## Idea + +An +{{#concept "inhabited chain" Disambiguation="in a poset" Agda=inhabited-chain-Poset}} +in a [poset](order-theory.posets.md) `P` is a +[subtype](foundation-core.subtypes.md) `S` of `P` such that the ordering of `P` +restricted to `S` is [linear](order-theory.total-posets.md). + +## Definitions + +### The predicate on chains in posets of being inhabited + +```agda +module _ + {l1 l2 l3 : Level} (X : Poset l1 l2) (S : chain-Poset l3 X) + where + + is-inhabited-prop-chain-Poset : Prop (l1 ⊔ l3) + is-inhabited-prop-chain-Poset = + is-inhabited-subtype-Prop (subposet-chain-Poset X S) + + is-inhabited-chain-Poset : UU (l1 ⊔ l3) + is-inhabited-chain-Poset = + type-Prop is-inhabited-prop-chain-Poset + + is-prop-is-inhabited-chain-Poset : + is-prop is-inhabited-chain-Poset + is-prop-is-inhabited-chain-Poset = + is-prop-type-Prop is-inhabited-prop-chain-Poset +``` + +### Inhabited chains in posets + +```agda +inhabited-chain-Poset : + {l1 l2 : Level} (l : Level) (X : Poset l1 l2) → UU (l1 ⊔ l2 ⊔ lsuc l) +inhabited-chain-Poset l X = + Σ (chain-Poset l X) (is-inhabited-chain-Poset X) + +module _ + {l1 l2 l3 : Level} (X : Poset l1 l2) (C : inhabited-chain-Poset l3 X) + where + + chain-inhabited-chain-Poset : chain-Poset l3 X + chain-inhabited-chain-Poset = pr1 C + + subposet-inhabited-chain-Poset : Subposet l3 X + subposet-inhabited-chain-Poset = + subposet-chain-Poset X chain-inhabited-chain-Poset + + is-chain-inhabited-chain-Poset : + is-chain-Subposet X subposet-inhabited-chain-Poset + is-chain-inhabited-chain-Poset = + is-chain-subposet-chain-Poset X chain-inhabited-chain-Poset + + is-inhabited-inhabited-chain-Poset : + is-inhabited-chain-Poset X chain-inhabited-chain-Poset + is-inhabited-inhabited-chain-Poset = pr2 C + + type-inhabited-chain-Poset : UU (l1 ⊔ l3) + type-inhabited-chain-Poset = + type-subtype subposet-inhabited-chain-Poset + + inclusion-subposet-inhabited-chain-Poset : + type-inhabited-chain-Poset → type-Poset X + inclusion-subposet-inhabited-chain-Poset = + inclusion-subtype subposet-inhabited-chain-Poset + +module _ + {l1 l2 l3 l4 : Level} (X : Poset l1 l2) + (C : inhabited-chain-Poset l3 X) (D : inhabited-chain-Poset l4 X) + where + + inclusion-prop-inhabited-chain-Poset : Prop (l1 ⊔ l3 ⊔ l4) + inclusion-prop-inhabited-chain-Poset = + inclusion-prop-chain-Poset X + ( chain-inhabited-chain-Poset X C) + ( chain-inhabited-chain-Poset X D) + + inclusion-inhabited-chain-Poset : UU (l1 ⊔ l3 ⊔ l4) + inclusion-inhabited-chain-Poset = + type-Prop inclusion-prop-inhabited-chain-Poset + + is-prop-inclusion-inhabited-chain-Poset : + is-prop inclusion-inhabited-chain-Poset + is-prop-inclusion-inhabited-chain-Poset = + is-prop-type-Prop inclusion-prop-inhabited-chain-Poset +``` + +## Properties + +### Inhabited chains are directed families + +```agda +module _ + {l1 l2 l3 : Level} (P : Poset l1 l2) (x : inhabited-chain-Poset l3 P) + where + + type-directed-family-inhabited-chain-Poset : UU (l1 ⊔ l3) + type-directed-family-inhabited-chain-Poset = type-inhabited-chain-Poset P x + + is-inhabited-type-directed-family-inhabited-chain-Poset : + is-inhabited type-directed-family-inhabited-chain-Poset + is-inhabited-type-directed-family-inhabited-chain-Poset = + is-inhabited-inhabited-chain-Poset P x + + inhabited-type-directed-family-inhabited-chain-Poset : + Inhabited-Type (l1 ⊔ l3) + inhabited-type-directed-family-inhabited-chain-Poset = + type-directed-family-inhabited-chain-Poset , + is-inhabited-type-directed-family-inhabited-chain-Poset + + family-directed-family-inhabited-chain-Poset : + type-directed-family-inhabited-chain-Poset → type-Poset P + family-directed-family-inhabited-chain-Poset = + inclusion-subposet-inhabited-chain-Poset P x + + is-directed-family-directed-family-inhabited-chain-Poset : + is-directed-family-Poset P + inhabited-type-directed-family-inhabited-chain-Poset + family-directed-family-inhabited-chain-Poset + is-directed-family-directed-family-inhabited-chain-Poset u v = + elim-disjunction + ( ∃ ( type-directed-family-inhabited-chain-Poset) + ( λ k → + leq-prop-Poset P + ( family-directed-family-inhabited-chain-Poset u) + ( family-directed-family-inhabited-chain-Poset k) ∧ + leq-prop-Poset P + ( family-directed-family-inhabited-chain-Poset v) + ( family-directed-family-inhabited-chain-Poset k))) + ( λ p → intro-exists v (p , refl-leq-Poset P (pr1 v))) + ( λ p → intro-exists u (refl-leq-Poset P (pr1 u) , p)) + ( is-chain-inhabited-chain-Poset P x u v) + + directed-family-inhabited-chain-Poset : + directed-family-Poset (l1 ⊔ l3) P + directed-family-inhabited-chain-Poset = + inhabited-type-directed-family-inhabited-chain-Poset , + family-directed-family-inhabited-chain-Poset , + is-directed-family-directed-family-inhabited-chain-Poset +``` diff --git a/src/order-theory/inhabited-chains-preorders.lagda.md b/src/order-theory/inhabited-chains-preorders.lagda.md new file mode 100644 index 0000000000..ac1e4dfdd3 --- /dev/null +++ b/src/order-theory/inhabited-chains-preorders.lagda.md @@ -0,0 +1,111 @@ +# Inhabited chains in preorders + +```agda +module order-theory.inhabited-chains-preorders where +``` + +
Imports + +```agda +open import foundation.dependent-pair-types +open import foundation.inhabited-subtypes +open import foundation.propositions +open import foundation.subtypes +open import foundation.universe-levels + +open import order-theory.chains-preorders +open import order-theory.preorders +open import order-theory.subpreorders +open import order-theory.total-preorders +``` + +
+ +## Idea + +An +{{#concept "inhabited chain" Disambiguation="in a preorder" Agda=inhabited-chain-Preorder}} +in a [preorder](order-theory.preorders.md) `P` is a +[subtype](foundation-core.subtypes.md) `S` of `P` such that the ordering of `P` +restricted to `S` is [linear](order-theory.total-preorders.md). + +## Definitions + +### The predicate on chains in preorders of being inhabited + +```agda +module _ + {l1 l2 l3 : Level} (X : Preorder l1 l2) (S : chain-Preorder l3 X) + where + + is-inhabited-prop-chain-Preorder : Prop (l1 ⊔ l3) + is-inhabited-prop-chain-Preorder = + is-inhabited-subtype-Prop (subpreorder-chain-Preorder X S) + + is-inhabited-chain-Preorder : UU (l1 ⊔ l3) + is-inhabited-chain-Preorder = + type-Prop is-inhabited-prop-chain-Preorder + + is-prop-is-inhabited-chain-Preorder : + is-prop is-inhabited-chain-Preorder + is-prop-is-inhabited-chain-Preorder = + is-prop-type-Prop is-inhabited-prop-chain-Preorder +``` + +### Inhabited chains in preorders + +```agda +inhabited-chain-Preorder : + {l1 l2 : Level} (l : Level) (X : Preorder l1 l2) → UU (l1 ⊔ l2 ⊔ lsuc l) +inhabited-chain-Preorder l X = + Σ (chain-Preorder l X) (is-inhabited-chain-Preorder X) + +module _ + {l1 l2 l3 : Level} (X : Preorder l1 l2) (C : inhabited-chain-Preorder l3 X) + where + + chain-inhabited-chain-Preorder : chain-Preorder l3 X + chain-inhabited-chain-Preorder = pr1 C + + subpreorder-inhabited-chain-Preorder : Subpreorder l3 X + subpreorder-inhabited-chain-Preorder = + subpreorder-chain-Preorder X chain-inhabited-chain-Preorder + + is-chain-inhabited-chain-Preorder : + is-chain-Subpreorder X subpreorder-inhabited-chain-Preorder + is-chain-inhabited-chain-Preorder = + is-chain-subpreorder-chain-Preorder X chain-inhabited-chain-Preorder + + is-inhabited-inhabited-chain-Preorder : + is-inhabited-chain-Preorder X chain-inhabited-chain-Preorder + is-inhabited-inhabited-chain-Preorder = pr2 C + + type-inhabited-chain-Preorder : UU (l1 ⊔ l3) + type-inhabited-chain-Preorder = + type-subtype subpreorder-inhabited-chain-Preorder + + inclusion-subpreorder-inhabited-chain-Preorder : + type-inhabited-chain-Preorder → type-Preorder X + inclusion-subpreorder-inhabited-chain-Preorder = + inclusion-subtype subpreorder-inhabited-chain-Preorder + +module _ + {l1 l2 l3 l4 : Level} (X : Preorder l1 l2) + (C : inhabited-chain-Preorder l3 X) (D : inhabited-chain-Preorder l4 X) + where + + inclusion-prop-inhabited-chain-Preorder : Prop (l1 ⊔ l3 ⊔ l4) + inclusion-prop-inhabited-chain-Preorder = + inclusion-prop-chain-Preorder X + ( chain-inhabited-chain-Preorder X C) + ( chain-inhabited-chain-Preorder X D) + + inclusion-inhabited-chain-Preorder : UU (l1 ⊔ l3 ⊔ l4) + inclusion-inhabited-chain-Preorder = + type-Prop inclusion-prop-inhabited-chain-Preorder + + is-prop-inclusion-inhabited-chain-Preorder : + is-prop inclusion-inhabited-chain-Preorder + is-prop-inclusion-inhabited-chain-Preorder = + is-prop-type-Prop inclusion-prop-inhabited-chain-Preorder +``` diff --git a/src/order-theory/interval-subposets.lagda.md b/src/order-theory/interval-subposets.lagda.md index 4cd0f385a6..5f53725119 100644 --- a/src/order-theory/interval-subposets.lagda.md +++ b/src/order-theory/interval-subposets.lagda.md @@ -35,7 +35,7 @@ module _ is-in-interval-Poset : (z : type-Poset X) → Prop l2 is-in-interval-Poset z = - product-Prop (leq-Poset-Prop X x z) (leq-Poset-Prop X z y) + product-Prop (leq-prop-Poset X x z) (leq-prop-Poset X z y) poset-interval-Subposet : Poset (l1 ⊔ l2) l2 poset-interval-Subposet = poset-Subposet X is-in-interval-Poset diff --git a/src/order-theory/join-preserving-maps-posets.lagda.md b/src/order-theory/join-preserving-maps-posets.lagda.md new file mode 100644 index 0000000000..5602aaac13 --- /dev/null +++ b/src/order-theory/join-preserving-maps-posets.lagda.md @@ -0,0 +1,282 @@ +# Join preserving maps on posets + +```agda +module order-theory.join-preserving-maps-posets where +``` + +
Imports + +```agda +open import foundation.booleans +open import foundation.dependent-pair-types +open import foundation.equivalences +open import foundation.evaluation-functions +open import foundation.function-types +open import foundation.fundamental-theorem-of-identity-types +open import foundation.homotopies +open import foundation.homotopy-induction +open import foundation.identity-types +open import foundation.propositions +open import foundation.raising-universe-levels +open import foundation.small-types +open import foundation.strictly-involutive-identity-types +open import foundation.subtype-identity-principle +open import foundation.torsorial-type-families +open import foundation.universe-levels + +open import order-theory.least-upper-bounds-posets +open import order-theory.order-preserving-maps-posets +open import order-theory.posets +``` + +
+ +## Idea + +A map `f : P → Q` between the underlying types of two +[posets](order-theory.posets.md) is said to be +{{#concept "join preserving" Disambiguation="map of posets" Agda=preserves-joins-Poset}} +if for every pair of elements `x, y : P` with a +[least upper bound](order-theory.least-upper-bounds-posets.md) `z`, we have +`f z` is the least upper bound of `f x` and `f y`. + +## Definitions + +### The predicate of preserving a join + +```agda +module _ + {l1 l2 l3 l4 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + (f : type-Poset P → type-Poset Q) + (x y : type-Poset P) + where + + preserves-join-Poset : UU (l1 ⊔ l2 ⊔ l3 ⊔ l4) + preserves-join-Poset = + (s : has-least-binary-upper-bound-Poset P x y) → + is-least-binary-upper-bound-Poset Q (f x) (f y) (f (pr1 s)) + + is-prop-preserves-join-Poset : + is-prop preserves-join-Poset + is-prop-preserves-join-Poset = + is-prop-Π + ( λ s → + is-prop-is-least-binary-upper-bound-Poset Q + ( f x) + ( f y) + ( f (pr1 s))) + + preserves-join-prop-Poset : Prop (l1 ⊔ l2 ⊔ l3 ⊔ l4) + preserves-join-prop-Poset = + preserves-join-Poset , is-prop-preserves-join-Poset +``` + +### Join preserving maps + +```agda +module _ + {l1 l2 l3 l4 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + preserves-joins-Poset : + (type-Poset P → type-Poset Q) → + UU (l1 ⊔ l2 ⊔ l3 ⊔ l4) + preserves-joins-Poset f = + (x y : type-Poset P) + (s : has-least-binary-upper-bound-Poset P x y) → + is-least-binary-upper-bound-Poset Q (f x) (f y) (f (pr1 s)) + + is-prop-preserves-joins-Poset : + (f : type-Poset P → type-Poset Q) → + is-prop (preserves-joins-Poset f) + is-prop-preserves-joins-Poset f = + is-prop-Π + ( λ x → is-prop-Π (is-prop-preserves-join-Poset P Q f x)) + + preserves-joins-prop-Poset : + (type-Poset P → type-Poset Q) → Prop (l1 ⊔ l2 ⊔ l3 ⊔ l4) + preserves-joins-prop-Poset f = + ( preserves-joins-Poset f , is-prop-preserves-joins-Poset f) + + hom-join-Poset : UU (l1 ⊔ l2 ⊔ l3 ⊔ l4) + hom-join-Poset = + Σ (type-Poset P → type-Poset Q) (preserves-joins-Poset) + + map-hom-join-Poset : hom-join-Poset → type-Poset P → type-Poset Q + map-hom-join-Poset = pr1 + + preserves-joins-hom-join-Poset : + (f : hom-join-Poset) → + preserves-joins-Poset (map-hom-join-Poset f) + preserves-joins-hom-join-Poset = pr2 + + sup-map-hom-join-Poset : + (f : hom-join-Poset) {x y : type-Poset P} → + has-least-binary-upper-bound-Poset P x y → + has-least-binary-upper-bound-Poset Q + ( map-hom-join-Poset f x) + ( map-hom-join-Poset f y) + sup-map-hom-join-Poset f {x} {y} s = + ( map-hom-join-Poset f (pr1 s) , preserves-joins-hom-join-Poset f x y s) +``` + +## Properties + +### Join preserving maps preserve order + +```agda +module _ + {l1 l2 l3 l4 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + abstract + preserves-order-preserves-joins-Poset : + {f : type-Poset P → type-Poset Q} → + preserves-joins-Poset P Q f → + preserves-order-Poset P Q f + preserves-order-preserves-joins-Poset {f} H x y p = + pr1 + ( pr2 + ( H x y (y , is-least-binary-upper-bound-leq-Poset P x y p) (f y)) + ( refl-leq-Poset Q (f y))) +``` + +### Homotopies of join preserving maps + +```agda +module _ + {l1 l2 l3 l4 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + htpy-hom-join-Poset : (f g : hom-join-Poset P Q) → UU (l1 ⊔ l3) + htpy-hom-join-Poset f g = map-hom-join-Poset P Q f ~ map-hom-join-Poset P Q g + + refl-htpy-hom-join-Poset : (f : hom-join-Poset P Q) → htpy-hom-join-Poset f f + refl-htpy-hom-join-Poset f = refl-htpy + + htpy-eq-hom-join-Poset : + (f g : hom-join-Poset P Q) → f = g → htpy-hom-join-Poset f g + htpy-eq-hom-join-Poset f .f refl = refl-htpy-hom-join-Poset f + + is-torsorial-htpy-hom-join-Poset : + (f : hom-join-Poset P Q) → is-torsorial (htpy-hom-join-Poset f) + is-torsorial-htpy-hom-join-Poset f = + is-torsorial-Eq-subtype + ( is-torsorial-htpy (map-hom-join-Poset P Q f)) + ( is-prop-preserves-joins-Poset P Q) + ( map-hom-join-Poset P Q f) + ( refl-htpy) + ( preserves-joins-hom-join-Poset P Q f) + + is-equiv-htpy-eq-hom-join-Poset : + (f g : hom-join-Poset P Q) → is-equiv (htpy-eq-hom-join-Poset f g) + is-equiv-htpy-eq-hom-join-Poset f = + fundamental-theorem-id + ( is-torsorial-htpy-hom-join-Poset f) + ( htpy-eq-hom-join-Poset f) + + extensionality-hom-join-Poset : + (f g : hom-join-Poset P Q) → (f = g) ≃ htpy-hom-join-Poset f g + pr1 (extensionality-hom-join-Poset f g) = htpy-eq-hom-join-Poset f g + pr2 (extensionality-hom-join-Poset f g) = is-equiv-htpy-eq-hom-join-Poset f g + + eq-htpy-hom-join-Poset : + (f g : hom-join-Poset P Q) → htpy-hom-join-Poset f g → f = g + eq-htpy-hom-join-Poset f g = + map-inv-is-equiv (is-equiv-htpy-eq-hom-join-Poset f g) +``` + +### The identity join preserving map + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) + where + + preserves-joins-id-Poset : + preserves-joins-Poset P P (id {A = type-Poset P}) + preserves-joins-id-Poset x y s = pr2 s + + id-hom-join-Poset : hom-join-Poset P P + id-hom-join-Poset = id , preserves-joins-id-Poset +``` + +### Composing join preserving maps + +```agda +module _ + {l1 l2 l3 l4 l5 l6 : Level} + (P : Poset l1 l2) (Q : Poset l3 l4) (R : Poset l5 l6) + where + + preserves-joins-comp-Poset : + (g : hom-join-Poset Q R) (f : hom-join-Poset P Q) → + preserves-joins-Poset P R + ( map-hom-join-Poset Q R g ∘ map-hom-join-Poset P Q f) + preserves-joins-comp-Poset g f x y s = + preserves-joins-hom-join-Poset Q R g + ( map-hom-join-Poset P Q f x) + ( map-hom-join-Poset P Q f y) + ( sup-map-hom-join-Poset P Q f s) + + comp-hom-join-Poset : + (g : hom-join-Poset Q R) (f : hom-join-Poset P Q) → + hom-join-Poset P R + comp-hom-join-Poset g f = + map-hom-join-Poset Q R g ∘ map-hom-join-Poset P Q f , + preserves-joins-comp-Poset g f +``` + +### Unit laws for composition of join preserving maps + +```agda +module _ + {l1 l2 l3 l4 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + left-unit-law-comp-hom-join-Poset : + (f : hom-join-Poset P Q) → + ( comp-hom-join-Poset P Q Q (id-hom-join-Poset Q) f) = f + left-unit-law-comp-hom-join-Poset f = + eq-htpy-hom-join-Poset P Q + ( comp-hom-join-Poset P Q Q (id-hom-join-Poset Q) f) + ( f) + ( refl-htpy) + + right-unit-law-comp-hom-join-Poset : + (f : hom-join-Poset P Q) → + (comp-hom-join-Poset P P Q f (id-hom-join-Poset P)) = f + right-unit-law-comp-hom-join-Poset f = + eq-htpy-hom-join-Poset P Q + ( comp-hom-join-Poset P P Q f (id-hom-join-Poset P)) + ( f) + ( refl-htpy) +``` + +### Associativity of composition of join preserving maps + +```agda +module _ + {l1 l2 l3 l4 l5 l6 l7 l8 : Level} + (P : Poset l1 l2) (Q : Poset l3 l4) + (R : Poset l5 l6) (S : Poset l7 l8) + (h : hom-join-Poset R S) + (g : hom-join-Poset Q R) + (f : hom-join-Poset P Q) + where + + associative-comp-hom-join-Poset : + comp-hom-join-Poset P Q S (comp-hom-join-Poset Q R S h g) f = + comp-hom-join-Poset P R S h (comp-hom-join-Poset P Q R g f) + associative-comp-hom-join-Poset = + eq-htpy-hom-join-Poset P S + ( comp-hom-join-Poset P Q S (comp-hom-join-Poset Q R S h g) f) + ( comp-hom-join-Poset P R S h (comp-hom-join-Poset P Q R g f)) + ( refl-htpy) + + involutive-eq-associative-comp-hom-join-Poset : + comp-hom-join-Poset P Q S (comp-hom-join-Poset Q R S h g) f =ⁱ + comp-hom-join-Poset P R S h (comp-hom-join-Poset P Q R g f) + involutive-eq-associative-comp-hom-join-Poset = + involutive-eq-eq associative-comp-hom-join-Poset +``` diff --git a/src/order-theory/join-semilattices.lagda.md b/src/order-theory/join-semilattices.lagda.md index 38ae8a9889..fe7f25a8cc 100644 --- a/src/order-theory/join-semilattices.lagda.md +++ b/src/order-theory/join-semilattices.lagda.md @@ -252,7 +252,7 @@ module _ ( λ x → Π-Prop ( type-Poset P) - ( has-least-binary-upper-bound-Poset-Prop P x)) + ( has-least-binary-upper-bound-prop-Poset P x)) is-join-semilattice-Poset : UU (l1 ⊔ l2) is-join-semilattice-Poset = type-Prop is-join-semilattice-Poset-Prop @@ -308,7 +308,7 @@ module _ leq-Order-Theoretic-Join-Semilattice-Prop : (x y : type-Order-Theoretic-Join-Semilattice) → Prop l2 leq-Order-Theoretic-Join-Semilattice-Prop = - leq-Poset-Prop poset-Order-Theoretic-Join-Semilattice + leq-prop-Poset poset-Order-Theoretic-Join-Semilattice leq-Order-Theoretic-Join-Semilattice : (x y : type-Order-Theoretic-Join-Semilattice) → UU l2 diff --git a/src/order-theory/knaster-tarski-fixed-point-theorem.lagda.md b/src/order-theory/knaster-tarski-fixed-point-theorem.lagda.md new file mode 100644 index 0000000000..3ec53b1556 --- /dev/null +++ b/src/order-theory/knaster-tarski-fixed-point-theorem.lagda.md @@ -0,0 +1,199 @@ +# The Knaster–Tarski fixed point theorem + +```agda +module order-theory.knaster-tarski-fixed-point-theorem where +``` + +
Imports + +```agda +open import foundation.dependent-pair-types +open import foundation.fixed-points-endofunctions +open import foundation.identity-types +open import foundation.logical-equivalences +open import foundation.universe-levels + +open import order-theory.inflattices +open import order-theory.order-preserving-maps-posets +open import order-theory.posets +open import order-theory.suplattices +``` + +
+ +## Idea + +The +{{#concept "Knaster–Tarski fixed point theorem" WD="Knaster–Tarski theorem" WDID=Q609612}} +states that every order preserving endomap `f : 𝒜 → 𝒜` on a complete lattice has +a least and a greatest [fixed point](foundation.fixed-points-endofunctions.md). +Indeed, any order preserving endomap on a +[suplattice](order-theory.suplattices.md) has a greatest fixed point and any +order preserving endomap on an [inflattice](order-theory.inflattices.md) has a +least fixed point. + +## Theorem + +### The Knaster–Tarski fixed point theorem for suplattices + +```agda +module _ + {l1 l2 : Level} + (𝒜 : Suplattice l1 l2 (l1 ⊔ l2)) + (f : type-Suplattice 𝒜 → type-Suplattice 𝒜) + (F : preserves-order-Poset (poset-Suplattice 𝒜) (poset-Suplattice 𝒜) f) + where + + indexing-type-family-of-elements-knaster-tarski-Suplattice : UU (l1 ⊔ l2) + indexing-type-family-of-elements-knaster-tarski-Suplattice = + Σ ( type-Suplattice 𝒜) (λ x → leq-Suplattice 𝒜 x (f x)) + + family-of-elements-knaster-tarski-Suplattice : + indexing-type-family-of-elements-knaster-tarski-Suplattice → + type-Suplattice 𝒜 + family-of-elements-knaster-tarski-Suplattice = pr1 + + point-knaster-tarski-Suplattice : type-Suplattice 𝒜 + point-knaster-tarski-Suplattice = + sup-Suplattice 𝒜 family-of-elements-knaster-tarski-Suplattice + + leq-point-knaster-tarski-Suplattice : + leq-Suplattice 𝒜 + ( point-knaster-tarski-Suplattice) + ( f point-knaster-tarski-Suplattice) + leq-point-knaster-tarski-Suplattice = + forward-implication + ( is-least-upper-bound-sup-Suplattice 𝒜 + ( family-of-elements-knaster-tarski-Suplattice) + ( f point-knaster-tarski-Suplattice)) + ( λ w → + transitive-leq-Suplattice 𝒜 _ _ _ + ( F ( pr1 w) + ( point-knaster-tarski-Suplattice) + ( leq-sup-Suplattice 𝒜 _ w)) + ( pr2 w)) + + geq-point-knaster-tarski-Suplattice : + leq-Suplattice 𝒜 + ( f point-knaster-tarski-Suplattice) + ( point-knaster-tarski-Suplattice) + geq-point-knaster-tarski-Suplattice = + leq-sup-Suplattice 𝒜 family-of-elements-knaster-tarski-Suplattice + ( f point-knaster-tarski-Suplattice , + F point-knaster-tarski-Suplattice + ( f point-knaster-tarski-Suplattice) + ( leq-point-knaster-tarski-Suplattice)) + + is-fixed-point-knaster-tarski-Suplattice : + f ( point-knaster-tarski-Suplattice) = + point-knaster-tarski-Suplattice + is-fixed-point-knaster-tarski-Suplattice = + antisymmetric-leq-Suplattice 𝒜 + ( f (point-knaster-tarski-Suplattice)) + ( point-knaster-tarski-Suplattice) + ( geq-point-knaster-tarski-Suplattice) + ( leq-point-knaster-tarski-Suplattice) + + fixed-point-knaster-tarski-Suplattice : fixed-point f + fixed-point-knaster-tarski-Suplattice = + point-knaster-tarski-Suplattice , + is-fixed-point-knaster-tarski-Suplattice + + greatest-fixed-point-knaster-tarski-Suplattice : + (x : fixed-point f) → + leq-Suplattice 𝒜 (pr1 x) point-knaster-tarski-Suplattice + greatest-fixed-point-knaster-tarski-Suplattice (x , p) = + leq-sup-Suplattice 𝒜 _ + ( x , + concatenate-leq-eq-Poset + ( poset-Suplattice 𝒜) + ( refl-leq-Suplattice 𝒜 x) + ( inv p)) +``` + +### The Knaster–Tarski fixed point theorem for inflattices + +```agda +module _ + {l1 l2 : Level} + (𝒜 : Inflattice l1 l2 (l1 ⊔ l2)) + (f : type-Inflattice 𝒜 → type-Inflattice 𝒜) + (F : preserves-order-Poset (poset-Inflattice 𝒜) (poset-Inflattice 𝒜) f) + where + + indexing-type-family-of-elements-knaster-tarski-Inflattice : UU (l1 ⊔ l2) + indexing-type-family-of-elements-knaster-tarski-Inflattice = + Σ ( type-Inflattice 𝒜) (λ x → leq-Inflattice 𝒜 (f x) x) + + family-of-elements-knaster-tarski-Inflattice : + indexing-type-family-of-elements-knaster-tarski-Inflattice → + type-Inflattice 𝒜 + family-of-elements-knaster-tarski-Inflattice = pr1 + + point-knaster-tarski-Inflattice : type-Inflattice 𝒜 + point-knaster-tarski-Inflattice = + inf-Inflattice 𝒜 family-of-elements-knaster-tarski-Inflattice + + geq-point-knaster-tarski-Inflattice : + leq-Inflattice 𝒜 + ( f point-knaster-tarski-Inflattice) + ( point-knaster-tarski-Inflattice) + geq-point-knaster-tarski-Inflattice = + forward-implication + ( is-greatest-lower-bound-inf-Inflattice 𝒜 + ( family-of-elements-knaster-tarski-Inflattice) + ( f point-knaster-tarski-Inflattice)) + ( λ w → + transitive-leq-Inflattice 𝒜 _ _ _ + ( pr2 w) + ( F _ _ (leq-inf-Inflattice 𝒜 _ w))) + + leq-point-knaster-tarski-Inflattice : + leq-Inflattice 𝒜 + ( point-knaster-tarski-Inflattice) + ( f point-knaster-tarski-Inflattice) + leq-point-knaster-tarski-Inflattice = + leq-inf-Inflattice 𝒜 family-of-elements-knaster-tarski-Inflattice + ( f point-knaster-tarski-Inflattice , + F (f point-knaster-tarski-Inflattice) + ( point-knaster-tarski-Inflattice) + ( geq-point-knaster-tarski-Inflattice)) + + is-fixed-point-knaster-tarski-Inflattice : + f ( point-knaster-tarski-Inflattice) = + point-knaster-tarski-Inflattice + is-fixed-point-knaster-tarski-Inflattice = + antisymmetric-leq-Inflattice 𝒜 + ( f (point-knaster-tarski-Inflattice)) + ( point-knaster-tarski-Inflattice) + ( geq-point-knaster-tarski-Inflattice) + ( leq-point-knaster-tarski-Inflattice) + + fixed-point-knaster-tarski-Inflattice : fixed-point f + fixed-point-knaster-tarski-Inflattice = + point-knaster-tarski-Inflattice , + is-fixed-point-knaster-tarski-Inflattice + + least-fixed-point-knaster-tarski-Inflattice : + (x : fixed-point f) → + leq-Inflattice 𝒜 point-knaster-tarski-Inflattice (pr1 x) + least-fixed-point-knaster-tarski-Inflattice (x , p) = + leq-inf-Inflattice 𝒜 _ + ( x , + concatenate-eq-leq-Poset + ( poset-Inflattice 𝒜) + ( p) + ( refl-leq-Inflattice 𝒜 x)) +``` + +## References + +- by Reed + Mullanix + +## External links + +- [Knaster–Tarski theorem](https://en.wikipedia.org/wiki/Knaster%E2%80%93Tarski_theorem) + at Wikipedia +- [Tarski's Fixed Point Theorem](https://mathworld.wolfram.com/TarskisFixedPointTheorem.html) + at Wolfram MathWorld diff --git a/src/order-theory/large-suplattices.lagda.md b/src/order-theory/large-suplattices.lagda.md index 6f8bb90417..489330b18b 100644 --- a/src/order-theory/large-suplattices.lagda.md +++ b/src/order-theory/large-suplattices.lagda.md @@ -228,7 +228,7 @@ module _ suplattice-Large-Suplattice : (l1 l2 : Level) → - Suplattice (α (γ ⊔ l1 ⊔ l2)) (β (γ ⊔ l1 ⊔ l2) (γ ⊔ l1 ⊔ l2)) (l1) + Suplattice (α (γ ⊔ l1 ⊔ l2)) (β (γ ⊔ l1 ⊔ l2) (γ ⊔ l1 ⊔ l2)) l1 pr1 (suplattice-Large-Suplattice l1 l2) = poset-Large-Suplattice (γ ⊔ l1 ⊔ l2) pr2 (suplattice-Large-Suplattice l1 l2) = diff --git a/src/order-theory/lattices.lagda.md b/src/order-theory/lattices.lagda.md index 6334ebe73a..bc9d9bc466 100644 --- a/src/order-theory/lattices.lagda.md +++ b/src/order-theory/lattices.lagda.md @@ -61,7 +61,7 @@ module _ type-Lattice = type-Poset poset-Lattice leq-lattice-Prop : (x y : type-Lattice) → Prop l2 - leq-lattice-Prop = leq-Poset-Prop poset-Lattice + leq-lattice-Prop = leq-prop-Poset poset-Lattice leq-Lattice : (x y : type-Lattice) → UU l2 leq-Lattice = leq-Poset poset-Lattice diff --git a/src/order-theory/least-upper-bounds-posets.lagda.md b/src/order-theory/least-upper-bounds-posets.lagda.md index 7bddf850d8..45eaaed587 100644 --- a/src/order-theory/least-upper-bounds-posets.lagda.md +++ b/src/order-theory/least-upper-bounds-posets.lagda.md @@ -8,10 +8,13 @@ module order-theory.least-upper-bounds-posets where ```agda open import foundation.action-on-identifications-functions +open import foundation.booleans open import foundation.dependent-pair-types +open import foundation.function-types open import foundation.identity-types open import foundation.logical-equivalences open import foundation.propositions +open import foundation.raising-universe-levels open import foundation.subtypes open import foundation.universe-levels @@ -56,7 +59,7 @@ module _ ( λ y → iff-Prop ( is-binary-upper-bound-Poset-Prop P a b y) - ( leq-Poset-Prop P x y)) + ( leq-prop-Poset P x y)) is-least-binary-upper-bound-Poset : type-Poset P → UU (l1 ⊔ l2) is-least-binary-upper-bound-Poset x = @@ -134,8 +137,7 @@ module _ all-elements-equal-has-least-binary-upper-bound-Poset : all-elements-equal has-least-binary-upper-bound-Poset - all-elements-equal-has-least-binary-upper-bound-Poset - (pair u H) (pair v K) = + all-elements-equal-has-least-binary-upper-bound-Poset (u , H) (v , K) = eq-type-subtype ( is-least-binary-upper-bound-Poset-Prop P a b) ( antisymmetric-leq-Poset P u v @@ -150,10 +152,10 @@ module _ is-prop-all-elements-equal all-elements-equal-has-least-binary-upper-bound-Poset - has-least-binary-upper-bound-Poset-Prop : Prop (l1 ⊔ l2) - pr1 has-least-binary-upper-bound-Poset-Prop = + has-least-binary-upper-bound-prop-Poset : Prop (l1 ⊔ l2) + pr1 has-least-binary-upper-bound-prop-Poset = has-least-binary-upper-bound-Poset - pr2 has-least-binary-upper-bound-Poset-Prop = + pr2 has-least-binary-upper-bound-prop-Poset = is-prop-has-least-binary-upper-bound-Poset module _ @@ -180,26 +182,26 @@ module _ {l1 l2 l3 : Level} (P : Poset l1 l2) {I : UU l3} (a : I → type-Poset P) where - is-least-upper-bound-family-of-elements-Poset-Prop : + is-least-upper-bound-family-of-elements-prop-Poset : type-Poset P → Prop (l1 ⊔ l2 ⊔ l3) - is-least-upper-bound-family-of-elements-Poset-Prop x = + is-least-upper-bound-family-of-elements-prop-Poset x = Π-Prop ( type-Poset P) ( λ y → iff-Prop - ( Π-Prop I (λ i → leq-Poset-Prop P (a i) y)) - ( leq-Poset-Prop P x y)) + ( Π-Prop I (λ i → leq-prop-Poset P (a i) y)) + ( leq-prop-Poset P x y)) is-least-upper-bound-family-of-elements-Poset : type-Poset P → UU (l1 ⊔ l2 ⊔ l3) is-least-upper-bound-family-of-elements-Poset z = - type-Prop (is-least-upper-bound-family-of-elements-Poset-Prop z) + type-Prop (is-least-upper-bound-family-of-elements-prop-Poset z) is-prop-is-least-upper-bound-family-of-elements-Poset : (z : type-Poset P) → is-prop (is-least-upper-bound-family-of-elements-Poset z) is-prop-is-least-upper-bound-family-of-elements-Poset z = - is-prop-type-Prop (is-least-upper-bound-family-of-elements-Poset-Prop z) + is-prop-type-Prop (is-least-upper-bound-family-of-elements-prop-Poset z) module _ {l1 l2 l3 : Level} (P : Poset l1 l2) {I : UU l3} {a : I → type-Poset P} @@ -244,7 +246,7 @@ module _ all-elements-equal-has-least-upper-bound-family-of-elements-Poset ( x , H) (y , K) = eq-type-subtype - ( is-least-upper-bound-family-of-elements-Poset-Prop P a) + ( is-least-upper-bound-family-of-elements-prop-Poset P a) ( antisymmetric-leq-Poset P x y ( forward-implication-is-least-upper-bound-family-of-elements-Poset ( P) @@ -265,10 +267,10 @@ module _ is-prop-all-elements-equal all-elements-equal-has-least-upper-bound-family-of-elements-Poset - has-least-upper-bound-family-of-elements-Poset-Prop : Prop (l1 ⊔ l2 ⊔ l3) - pr1 has-least-upper-bound-family-of-elements-Poset-Prop = + has-least-upper-bound-family-of-elements-prop-Poset : Prop (l1 ⊔ l2 ⊔ l3) + pr1 has-least-upper-bound-family-of-elements-prop-Poset = has-least-upper-bound-family-of-elements-Poset - pr2 has-least-upper-bound-family-of-elements-Poset-Prop = + pr2 has-least-upper-bound-family-of-elements-prop-Poset = is-prop-has-least-upper-bound-family-of-elements-Poset module _ @@ -289,3 +291,94 @@ module _ ( x , H) ( y , K)) ``` + +## Properties + +### Binary least upper bounds as least upper bounds of families + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (a b : type-Poset P) + (H : has-least-binary-upper-bound-Poset P a b) + where + + family-of-elements-has-least-binary-upper-bound-Poset : + bool → type-Poset P + family-of-elements-has-least-binary-upper-bound-Poset = rec-bool a b + + least-upper-bound-family-of-elements-has-least-binary-upper-bound-Poset : + type-Poset P + least-upper-bound-family-of-elements-has-least-binary-upper-bound-Poset = + pr1 H + + is-least-upper-bound-family-of-elements-has-least-binary-upper-bound-Poset : + is-least-upper-bound-family-of-elements-Poset P + ( family-of-elements-has-least-binary-upper-bound-Poset) + ( least-upper-bound-family-of-elements-has-least-binary-upper-bound-Poset) + is-least-upper-bound-family-of-elements-has-least-binary-upper-bound-Poset x = + ( λ f → pr1 (pr2 H x) (f true , f false)) , + ( λ u → + ind-bool + ( λ z → + leq-Poset P + ( family-of-elements-has-least-binary-upper-bound-Poset z) + ( x)) + ( pr1 (pr2 (pr2 H x) u)) + ( pr2 (pr2 (pr2 H x) u))) + + has-least-upper-bound-family-of-elements-has-least-binary-upper-bound-Poset : + has-least-upper-bound-family-of-elements-Poset P + ( family-of-elements-has-least-binary-upper-bound-Poset) + has-least-upper-bound-family-of-elements-has-least-binary-upper-bound-Poset = + least-upper-bound-family-of-elements-has-least-binary-upper-bound-Poset , + is-least-upper-bound-family-of-elements-has-least-binary-upper-bound-Poset +``` + +### Least upper bounds of families over the booleans as binary least upper bounds + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (x : bool → type-Poset P) + (H : has-least-upper-bound-family-of-elements-Poset P x) + where + + least-binary-upper-bound-has-least-upper-bound-family-of-elements-Poset : + type-Poset P + least-binary-upper-bound-has-least-upper-bound-family-of-elements-Poset = + pr1 H + + is-least-binary-upper-bound-has-least-upper-bound-family-of-elements-Poset : + is-least-binary-upper-bound-Poset P + ( x true) + ( x false) + ( least-binary-upper-bound-has-least-upper-bound-family-of-elements-Poset) + is-least-binary-upper-bound-has-least-upper-bound-family-of-elements-Poset z = + ( λ f → + pr1 (pr2 H z) (ind-bool (λ i → leq-Poset P (x i) z) (pr1 f) (pr2 f))) , + ( λ u → pr2 (pr2 H z) u true , pr2 (pr2 H z) u false) + + has-least-binary-upper-bound-has-least-upper-bound-family-of-elements-Poset : + has-least-binary-upper-bound-Poset P (x true) (x false) + has-least-binary-upper-bound-has-least-upper-bound-family-of-elements-Poset = + least-binary-upper-bound-has-least-upper-bound-family-of-elements-Poset , + is-least-binary-upper-bound-has-least-upper-bound-family-of-elements-Poset +``` + +### if $a ≤ b$ then $b$ is the least binary upper bound of $a$ and $b$ + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) (a b : type-Poset P) (p : leq-Poset P a b) + where + + is-least-binary-upper-bound-leq-Poset : + is-least-binary-upper-bound-Poset P a b b + is-least-binary-upper-bound-leq-Poset x = + ( λ f → pr2 f) , + ( λ f → transitive-leq-Poset P a b x f p , f) + + has-least-binary-upper-bound-leq-Poset : + has-least-binary-upper-bound-Poset P a b + has-least-binary-upper-bound-leq-Poset = + ( b , is-least-binary-upper-bound-leq-Poset) +``` diff --git a/src/order-theory/lower-bounds-posets.lagda.md b/src/order-theory/lower-bounds-posets.lagda.md index 32e062d37a..5ae8f55417 100644 --- a/src/order-theory/lower-bounds-posets.lagda.md +++ b/src/order-theory/lower-bounds-posets.lagda.md @@ -34,7 +34,7 @@ module _ is-binary-lower-bound-Poset-Prop : Prop l2 is-binary-lower-bound-Poset-Prop = - product-Prop (leq-Poset-Prop P x a) (leq-Poset-Prop P x b) + product-Prop (leq-prop-Poset P x a) (leq-prop-Poset P x b) is-binary-lower-bound-Poset : UU l2 is-binary-lower-bound-Poset = @@ -63,18 +63,18 @@ module _ {l1 l2 l3 : Level} (P : Poset l1 l2) {I : UU l3} (x : I → type-Poset P) where - is-lower-bound-family-of-elements-Poset-Prop : type-Poset P → Prop (l2 ⊔ l3) - is-lower-bound-family-of-elements-Poset-Prop z = - Π-Prop I (λ i → leq-Poset-Prop P z (x i)) + is-lower-bound-family-of-elements-prop-Poset : type-Poset P → Prop (l2 ⊔ l3) + is-lower-bound-family-of-elements-prop-Poset z = + Π-Prop I (λ i → leq-prop-Poset P z (x i)) is-lower-bound-family-of-elements-Poset : type-Poset P → UU (l2 ⊔ l3) is-lower-bound-family-of-elements-Poset z = - type-Prop (is-lower-bound-family-of-elements-Poset-Prop z) + type-Prop (is-lower-bound-family-of-elements-prop-Poset z) is-prop-is-lower-bound-family-of-elements-Poset : (z : type-Poset P) → is-prop (is-lower-bound-family-of-elements-Poset z) is-prop-is-lower-bound-family-of-elements-Poset z = - is-prop-type-Prop (is-lower-bound-family-of-elements-Poset-Prop z) + is-prop-type-Prop (is-lower-bound-family-of-elements-prop-Poset z) ``` ## Properties diff --git a/src/order-theory/maximal-chains-posets.lagda.md b/src/order-theory/maximal-chains-posets.lagda.md index ce5852dbf7..e62dabcc6e 100644 --- a/src/order-theory/maximal-chains-posets.lagda.md +++ b/src/order-theory/maximal-chains-posets.lagda.md @@ -19,8 +19,11 @@ open import order-theory.posets ## Idea -A **maximal chain** in a poset `P` is a chain `C` in `P` such that for any chain -`D` we have `C ⊆ D ⇒ C = D`. +A +{{#concept "maximal chain" Disambiguation="in a poset" Agda=maximal-chain-Poset}} +in a [poset](order-theory.posets.md) `P` is a +[chain](order-theory.chains-posets.md) `C` in `P` such that for any chain `D` we +have `C ⊆ D ⇒ C = D`. ## Definition diff --git a/src/order-theory/maximal-chains-preorders.lagda.md b/src/order-theory/maximal-chains-preorders.lagda.md index f79f5015d3..0cf6169f4f 100644 --- a/src/order-theory/maximal-chains-preorders.lagda.md +++ b/src/order-theory/maximal-chains-preorders.lagda.md @@ -19,8 +19,11 @@ open import order-theory.preorders ## Idea -A **maximal chain** in a preorder `P` is a chain `C` in `P` such that for every -chain `D` in `P` we have `C ⊆ D ⇒ D ⊆ C`. +A +{{#concept "maximal chain" Disambiguation="in a preorder" Agda=maximal-chain-Preorder}} +in a [preorder](order-theory.preorders.md) `P` is a +[chain](order-theory.chains-preorders.md) `C` in `P` such that for any chain `D` +we have `C ⊆ D ⇒ C = D`. ## Definition diff --git a/src/order-theory/meet-semilattices.lagda.md b/src/order-theory/meet-semilattices.lagda.md index 09fd773dc2..ab9a4a7687 100644 --- a/src/order-theory/meet-semilattices.lagda.md +++ b/src/order-theory/meet-semilattices.lagda.md @@ -317,7 +317,7 @@ module _ leq-Order-Theoretic-Meet-Semilattice-Prop : (x y : type-Order-Theoretic-Meet-Semilattice) → Prop l2 leq-Order-Theoretic-Meet-Semilattice-Prop = - leq-Poset-Prop poset-Order-Theoretic-Meet-Semilattice + leq-prop-Poset poset-Order-Theoretic-Meet-Semilattice leq-Order-Theoretic-Meet-Semilattice : (x y : type-Order-Theoretic-Meet-Semilattice) → UU l2 diff --git a/src/order-theory/meet-suplattices.lagda.md b/src/order-theory/meet-suplattices.lagda.md index c9ee77f4e0..898eeb5f7a 100644 --- a/src/order-theory/meet-suplattices.lagda.md +++ b/src/order-theory/meet-suplattices.lagda.md @@ -74,7 +74,7 @@ module _ type-Poset poset-Meet-Suplattice leq-meet-suplattice-Prop : (x y : type-Meet-Suplattice) → Prop l1 - leq-meet-suplattice-Prop = leq-Poset-Prop poset-Meet-Suplattice + leq-meet-suplattice-Prop = leq-prop-Poset poset-Meet-Suplattice leq-Meet-Suplattice : (x y : type-Meet-Suplattice) → UU l1 leq-Meet-Suplattice = leq-Poset poset-Meet-Suplattice diff --git a/src/order-theory/opposite-large-posets.lagda.md b/src/order-theory/opposite-large-posets.lagda.md new file mode 100644 index 0000000000..cbb94d58f5 --- /dev/null +++ b/src/order-theory/opposite-large-posets.lagda.md @@ -0,0 +1,137 @@ +# Opposite large posets + +```agda +module order-theory.opposite-large-posets where +``` + +
Imports + +```agda +open import foundation.dependent-pair-types +open import foundation.equivalences +open import foundation.homotopies +open import foundation.identity-types +open import foundation.large-identity-types +open import foundation.propositions +open import foundation.sets +open import foundation.universe-levels + +open import order-theory.large-posets +open import order-theory.large-preorders +open import order-theory.opposite-large-preorders +open import order-theory.order-preserving-maps-large-posets +``` + +
+ +## Idea + +Let `X` be a [large poset](order-theory.large-posets.md), its +{{#concept "opposite" Disambiguation="large poset" Agda=opposite-Large-Poset}} +`Xᵒᵖ` is given by reversing the relation. + +## Definition + +### The opposite large poset + +```agda +module _ + {α : Level → Level} {β : Level → Level → Level} (P : Large-Poset α β) + where + + large-preorder-opposite-Large-Poset : + Large-Preorder α (λ l1 l2 → β l2 l1) + large-preorder-opposite-Large-Poset = + opposite-Large-Preorder (large-preorder-Large-Poset P) + + type-opposite-Large-Poset : (l : Level) → UU (α l) + type-opposite-Large-Poset = + type-Large-Preorder large-preorder-opposite-Large-Poset + + leq-prop-opposite-Large-Poset : + {l1 l2 : Level} + (X : type-opposite-Large-Poset l1) + (Y : type-opposite-Large-Poset l2) → Prop (β l2 l1) + leq-prop-opposite-Large-Poset = + leq-prop-Large-Preorder large-preorder-opposite-Large-Poset + + leq-opposite-Large-Poset : + {l1 l2 : Level} + (X : type-opposite-Large-Poset l1) + (Y : type-opposite-Large-Poset l2) → UU (β l2 l1) + leq-opposite-Large-Poset = + leq-Large-Preorder large-preorder-opposite-Large-Poset + + transitive-leq-opposite-Large-Poset : + {l1 l2 l3 : Level} + (X : type-opposite-Large-Poset l1) + (Y : type-opposite-Large-Poset l2) + (Z : type-opposite-Large-Poset l3) → + leq-opposite-Large-Poset Y Z → + leq-opposite-Large-Poset X Y → + leq-opposite-Large-Poset X Z + transitive-leq-opposite-Large-Poset = + transitive-leq-Large-Preorder large-preorder-opposite-Large-Poset + + refl-leq-opposite-Large-Poset : + {l1 : Level} (X : type-opposite-Large-Poset l1) → + leq-opposite-Large-Poset X X + refl-leq-opposite-Large-Poset = + refl-leq-Large-Preorder large-preorder-opposite-Large-Poset + + antisymmetric-leq-opposite-Large-Poset : + {l1 : Level} (X Y : type-opposite-Large-Poset l1) → + leq-opposite-Large-Poset X Y → + leq-opposite-Large-Poset Y X → + X = Y + antisymmetric-leq-opposite-Large-Poset X Y p q = + antisymmetric-leq-Large-Poset P X Y q p + + opposite-Large-Poset : Large-Poset α (λ l1 l2 → β l2 l1) + opposite-Large-Poset = + make-Large-Poset + large-preorder-opposite-Large-Poset + antisymmetric-leq-opposite-Large-Poset +``` + +### The opposite functorial action on order preserving maps of large posets + +```agda +module _ + {αP αQ : Level → Level} {βP βQ : Level → Level → Level} {γ : Level → Level} + {P : Large-Poset αP βP} {Q : Large-Poset αQ βQ} + where + + opposite-hom-Large-Poset : + hom-Large-Poset γ P Q → + hom-Large-Poset γ (opposite-Large-Poset P) (opposite-Large-Poset Q) + opposite-hom-Large-Poset = opposite-hom-Large-Preorder +``` + +## Properties + +### The opposite large poset construction is a strict involution + +```agda +module _ + {α : Level → Level} {β : Level → Level → Level} (P : Large-Poset α β) + where + + is-involution-opposite-Large-Poset : + opposite-Large-Poset (opposite-Large-Poset P) =ω P + is-involution-opposite-Large-Poset = reflω + +module _ + {αP αQ : Level → Level} {βP βQ : Level → Level → Level} {γ : Level → Level} + (P : Large-Poset αP βP) (Q : Large-Poset αQ βQ) + (f : hom-Large-Poset γ P Q) + where + + is-involution-opposite-hom-Large-Poset : + opposite-hom-Large-Poset + { P = opposite-Large-Poset P} + { opposite-Large-Poset Q} + ( opposite-hom-Large-Poset {P = P} {Q} f) =ω + f + is-involution-opposite-hom-Large-Poset = reflω +``` diff --git a/src/order-theory/opposite-large-preorders.lagda.md b/src/order-theory/opposite-large-preorders.lagda.md new file mode 100644 index 0000000000..5ecbfef3d7 --- /dev/null +++ b/src/order-theory/opposite-large-preorders.lagda.md @@ -0,0 +1,120 @@ +# Opposite large preorders + +```agda +module order-theory.opposite-large-preorders where +``` + +
Imports + +```agda +open import foundation.dependent-pair-types +open import foundation.equivalences +open import foundation.homotopies +open import foundation.identity-types +open import foundation.large-identity-types +open import foundation.propositions +open import foundation.sets +open import foundation.universe-levels + +open import order-theory.large-preorders +open import order-theory.order-preserving-maps-large-preorders +``` + +
+ +## Idea + +Let `X` be a [large preorder](order-theory.large-preorders.md), its +{{#concept "opposite" Disambiguation="large preorder" Agda=opposite-Large-Preorder}} +`Xᵒᵖ` is given by reversing the relation. + +## Definition + +### The opposite large preorder + +```agda +module _ + {α : Level → Level} {β : Level → Level → Level} (P : Large-Preorder α β) + where + + type-opposite-Large-Preorder : (l : Level) → UU (α l) + type-opposite-Large-Preorder = type-Large-Preorder P + + leq-prop-opposite-Large-Preorder : + {l1 l2 : Level} + (X : type-opposite-Large-Preorder l1) + (Y : type-opposite-Large-Preorder l2) → Prop (β l2 l1) + leq-prop-opposite-Large-Preorder X Y = leq-prop-Large-Preorder P Y X + + leq-opposite-Large-Preorder : + {l1 l2 : Level} + (X : type-opposite-Large-Preorder l1) + (Y : type-opposite-Large-Preorder l2) → UU (β l2 l1) + leq-opposite-Large-Preorder X Y = + type-Prop (leq-prop-opposite-Large-Preorder X Y) + + transitive-leq-opposite-Large-Preorder : + {l1 l2 l3 : Level} + (X : type-opposite-Large-Preorder l1) + (Y : type-opposite-Large-Preorder l2) + (Z : type-opposite-Large-Preorder l3) → + leq-opposite-Large-Preorder Y Z → + leq-opposite-Large-Preorder X Y → + leq-opposite-Large-Preorder X Z + transitive-leq-opposite-Large-Preorder X Y Z g f = + transitive-leq-Large-Preorder P Z Y X f g + + refl-leq-opposite-Large-Preorder : + {l1 : Level} (X : type-opposite-Large-Preorder l1) → + leq-opposite-Large-Preorder X X + refl-leq-opposite-Large-Preorder = refl-leq-Large-Preorder P + + opposite-Large-Preorder : Large-Preorder α (λ l1 l2 → β l2 l1) + opposite-Large-Preorder = + make-Large-Preorder + type-opposite-Large-Preorder + leq-prop-opposite-Large-Preorder + refl-leq-opposite-Large-Preorder + transitive-leq-opposite-Large-Preorder +``` + +### The opposite functorial action on order preserving maps of large posets + +```agda +module _ + {αP αQ : Level → Level} {βP βQ : Level → Level → Level} {γ : Level → Level} + {P : Large-Preorder αP βP} {Q : Large-Preorder αQ βQ} + where + + opposite-hom-Large-Preorder : + hom-Large-Preorder γ P Q → + hom-Large-Preorder γ (opposite-Large-Preorder P) (opposite-Large-Preorder Q) + opposite-hom-Large-Preorder f = + make-hom-Large-Preorder + ( map-hom-Large-Preorder f) + ( λ x y p → preserves-order-hom-Large-Preorder f y x p) +``` + +## Properties + +### The opposite large preorder construction is a strict involution + +```agda +module _ + {α : Level → Level} {β : Level → Level → Level} (P : Large-Preorder α β) + where + + is-involution-opposite-Large-Preorder : + opposite-Large-Preorder (opposite-Large-Preorder P) =ω P + is-involution-opposite-Large-Preorder = reflω + +module _ + {αP αQ : Level → Level} {βP βQ : Level → Level → Level} {γ : Level → Level} + (P : Large-Preorder αP βP) (Q : Large-Preorder αQ βQ) + (f : hom-Large-Preorder γ P Q) + where + + is-involution-opposite-hom-Large-Preorder : + opposite-hom-Large-Preorder (opposite-hom-Large-Preorder f) =ω f + is-involution-opposite-hom-Large-Preorder = reflω +``` diff --git a/src/order-theory/opposite-posets.lagda.md b/src/order-theory/opposite-posets.lagda.md new file mode 100644 index 0000000000..45b842294c --- /dev/null +++ b/src/order-theory/opposite-posets.lagda.md @@ -0,0 +1,120 @@ +# Opposite posets + +```agda +module order-theory.opposite-posets where +``` + +
Imports + +```agda +open import foundation.dependent-pair-types +open import foundation.equivalences +open import foundation.homotopies +open import foundation.identity-types +open import foundation.propositions +open import foundation.sets +open import foundation.universe-levels + +open import order-theory.opposite-preorders +open import order-theory.order-preserving-maps-posets +open import order-theory.posets +open import order-theory.preorders +``` + +
+ +## Idea + +Let `X` be a [poset](order-theory.posets.md), its +{{#concept "opposite" Disambiguation="poset" Agda=opposite-Poset}} `Xᵒᵖ` is +given by reversing the relation. + +## Definition + +### The opposite poset + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) + where + + preorder-opposite-Poset : Preorder l1 l2 + preorder-opposite-Poset = + opposite-Preorder (preorder-Poset P) + + type-opposite-Poset : UU l1 + type-opposite-Poset = type-Preorder preorder-opposite-Poset + + leq-prop-opposite-Poset : (X Y : type-opposite-Poset) → Prop l2 + leq-prop-opposite-Poset = + leq-prop-Preorder preorder-opposite-Poset + + leq-opposite-Poset : (X Y : type-opposite-Poset) → UU l2 + leq-opposite-Poset = + leq-Preorder preorder-opposite-Poset + + transitive-leq-opposite-Poset : + (X Y Z : type-opposite-Poset) → + leq-opposite-Poset Y Z → + leq-opposite-Poset X Y → + leq-opposite-Poset X Z + transitive-leq-opposite-Poset = + transitive-leq-Preorder preorder-opposite-Poset + + refl-leq-opposite-Poset : + (X : type-opposite-Poset) → leq-opposite-Poset X X + refl-leq-opposite-Poset = + refl-leq-Preorder preorder-opposite-Poset + + antisymmetric-leq-opposite-Poset : + (X Y : type-opposite-Poset) → + leq-opposite-Poset X Y → + leq-opposite-Poset Y X → + X = Y + antisymmetric-leq-opposite-Poset X Y p q = + antisymmetric-leq-Poset P X Y q p + + opposite-Poset : Poset l1 l2 + opposite-Poset = + ( preorder-opposite-Poset , antisymmetric-leq-opposite-Poset) +``` + +### The opposite functorial action on order preserving maps of posets + +```agda +module _ + {l1 l2 l3 l4 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + opposite-hom-Poset : + hom-Poset P Q → hom-Poset (opposite-Poset P) (opposite-Poset Q) + opposite-hom-Poset = + opposite-hom-Preorder (preorder-Poset P) (preorder-Poset Q) +``` + +## Properties + +### The opposite poset construction is a strict involution + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) + where + + is-involution-opposite-Poset : opposite-Poset (opposite-Poset P) = P + is-involution-opposite-Poset = refl + +module _ + {l1 l2 l3 l4 : Level} + (P : Poset l1 l2) (Q : Poset l3 l4) + (f : hom-Poset P Q) + where + + is-involution-opposite-hom-Poset : + opposite-hom-Poset + ( opposite-Poset P) + ( opposite-Poset Q) + ( opposite-hom-Poset P Q f) = + f + is-involution-opposite-hom-Poset = refl +``` diff --git a/src/order-theory/opposite-preorders.lagda.md b/src/order-theory/opposite-preorders.lagda.md new file mode 100644 index 0000000000..39c2c42ec0 --- /dev/null +++ b/src/order-theory/opposite-preorders.lagda.md @@ -0,0 +1,111 @@ +# Opposite preorders + +```agda +module order-theory.opposite-preorders where +``` + +
Imports + +```agda +open import foundation.dependent-pair-types +open import foundation.equivalences +open import foundation.homotopies +open import foundation.identity-types +open import foundation.propositions +open import foundation.sets +open import foundation.universe-levels + +open import order-theory.order-preserving-maps-preorders +open import order-theory.preorders +``` + +
+ +## Idea + +Let `X` be a [preorder](order-theory.preorders.md), its +{{#concept "opposite" Disambiguation="preorder" Agda=opposite-Preorder}} `Xᵒᵖ` +is given by reversing the relation. + +## Definition + +### The opposite preorder + +```agda +module _ + {l1 l2 : Level} (P : Preorder l1 l2) + where + + type-opposite-Preorder : UU l1 + type-opposite-Preorder = type-Preorder P + + leq-prop-opposite-Preorder : + (X Y : type-opposite-Preorder) → Prop l2 + leq-prop-opposite-Preorder X Y = leq-prop-Preorder P Y X + + leq-opposite-Preorder : + (X Y : type-opposite-Preorder) → UU l2 + leq-opposite-Preorder X Y = + type-Prop (leq-prop-opposite-Preorder X Y) + + transitive-leq-opposite-Preorder : + (X Y Z : type-opposite-Preorder) → + leq-opposite-Preorder Y Z → + leq-opposite-Preorder X Y → + leq-opposite-Preorder X Z + transitive-leq-opposite-Preorder X Y Z g f = + transitive-leq-Preorder P Z Y X f g + + refl-leq-opposite-Preorder : + (X : type-opposite-Preorder) → leq-opposite-Preorder X X + refl-leq-opposite-Preorder = refl-leq-Preorder P + + opposite-Preorder : Preorder l1 l2 + opposite-Preorder = + ( type-opposite-Preorder , + leq-prop-opposite-Preorder , + refl-leq-opposite-Preorder , + transitive-leq-opposite-Preorder) +``` + +### The opposite functorial action on order preserving maps of preorders + +```agda +module _ + {l1 l2 l3 l4 : Level} (P : Preorder l1 l2) (Q : Preorder l3 l4) + where + + opposite-hom-Preorder : + hom-Preorder P Q → + hom-Preorder (opposite-Preorder P) (opposite-Preorder Q) + opposite-hom-Preorder f = + ( map-hom-Preorder P Q f) , + ( λ x y p → preserves-order-map-hom-Preorder P Q f y x p) +``` + +## Properties + +### The opposite preorder construction is a strict involution + +```agda +module _ + {l1 l2 : Level} (P : Preorder l1 l2) + where + + is-involution-opposite-Preorder : opposite-Preorder (opposite-Preorder P) = P + is-involution-opposite-Preorder = refl + +module _ + {l1 l2 l3 l4 : Level} + (P : Preorder l1 l2) (Q : Preorder l3 l4) + (f : hom-Preorder P Q) + where + + is-involution-opposite-hom-Preorder : + opposite-hom-Preorder + ( opposite-Preorder P) + ( opposite-Preorder Q) + ( opposite-hom-Preorder P Q f) = + f + is-involution-opposite-hom-Preorder = refl +``` diff --git a/src/order-theory/order-preserving-maps-large-posets.lagda.md b/src/order-theory/order-preserving-maps-large-posets.lagda.md index f4cd9eb033..08254b6629 100644 --- a/src/order-theory/order-preserving-maps-large-posets.lagda.md +++ b/src/order-theory/order-preserving-maps-large-posets.lagda.md @@ -11,6 +11,7 @@ open import foundation.universe-levels open import order-theory.large-posets open import order-theory.order-preserving-maps-large-preorders +open import order-theory.order-preserving-maps-posets open import order-theory.similarity-of-elements-large-posets ``` @@ -81,6 +82,28 @@ module _ preserves-order-hom-Large-Preorder f ``` +### The induced order preserving maps on small posets + +```agda +module _ + {αP αQ : Level → Level} {βP βQ : Level → Level → Level} {γ : Level → Level} + (P : Large-Poset αP βP) + (Q : Large-Poset αQ βQ) + (f : hom-Large-Poset γ P Q) + where + + hom-poset-hom-Large-Poset : + (l : Level) → + hom-Poset + ( poset-Large-Poset P l) + ( poset-Large-Poset Q (γ l)) + hom-poset-hom-Large-Poset = + hom-preorder-hom-Large-Preorder + ( large-preorder-Large-Poset P) + ( large-preorder-Large-Poset Q) + ( f) +``` + ### The identity order preserving map on a large poset ```agda diff --git a/src/order-theory/order-preserving-maps-large-preorders.lagda.md b/src/order-theory/order-preserving-maps-large-preorders.lagda.md index bca9ee11b2..9197455f5e 100644 --- a/src/order-theory/order-preserving-maps-large-preorders.lagda.md +++ b/src/order-theory/order-preserving-maps-large-preorders.lagda.md @@ -14,6 +14,7 @@ open import foundation-core.function-types open import foundation-core.homotopies open import order-theory.large-preorders +open import order-theory.order-preserving-maps-preorders open import order-theory.similarity-of-elements-large-preorders ``` @@ -75,6 +76,25 @@ module _ open hom-Large-Preorder public ``` +### The induced order preserving maps on small preorders + +```agda +module _ + {αP αQ : Level → Level} {βP βQ : Level → Level → Level} {γ : Level → Level} + (P : Large-Preorder αP βP) + (Q : Large-Preorder αQ βQ) + (f : hom-Large-Preorder γ P Q) + where + + hom-preorder-hom-Large-Preorder : + (l : Level) → + hom-Preorder + ( preorder-Large-Preorder P l) + ( preorder-Large-Preorder Q (γ l)) + hom-preorder-hom-Large-Preorder l = + ( map-hom-Large-Preorder f , preserves-order-hom-Large-Preorder f) +``` + ### The identity order preserving map on a large preorder ```agda diff --git a/src/order-theory/order-preserving-maps-preorders.lagda.md b/src/order-theory/order-preserving-maps-preorders.lagda.md index b3bbc7d62b..c25b417ad1 100644 --- a/src/order-theory/order-preserving-maps-preorders.lagda.md +++ b/src/order-theory/order-preserving-maps-preorders.lagda.md @@ -17,9 +17,10 @@ open import foundation.identity-types open import foundation.propositions open import foundation.strictly-involutive-identity-types open import foundation.subtype-identity-principle -open import foundation.torsorial-type-families open import foundation.universe-levels +open import foundation-core.torsorial-type-families + open import order-theory.preorders ``` @@ -49,8 +50,8 @@ module _ ( type-Preorder P) ( λ y → hom-Prop - ( leq-Preorder-Prop P x y) - ( leq-Preorder-Prop Q (f x) (f y)))) + ( leq-prop-Preorder P x y) + ( leq-prop-Preorder Q (f x) (f y)))) preserves-order-Preorder : (type-Preorder P → type-Preorder Q) → UU (l1 ⊔ l2 ⊔ l4) diff --git a/src/order-theory/posets.lagda.md b/src/order-theory/posets.lagda.md index e3e5d5e91b..f1875f86f2 100644 --- a/src/order-theory/posets.lagda.md +++ b/src/order-theory/posets.lagda.md @@ -16,6 +16,7 @@ open import foundation.cartesian-product-types open import foundation.dependent-pair-types open import foundation.equivalences open import foundation.identity-types +open import foundation.injective-maps open import foundation.logical-equivalences open import foundation.propositions open import foundation.sets @@ -54,8 +55,8 @@ module _ type-Poset : UU l1 type-Poset = type-Preorder preorder-Poset - leq-Poset-Prop : (x y : type-Poset) → Prop l2 - leq-Poset-Prop = leq-Preorder-Prop preorder-Poset + leq-prop-Poset : (x y : type-Poset) → Prop l2 + leq-prop-Poset = leq-prop-Preorder preorder-Poset leq-Poset : (x y : type-Poset) → UU l2 leq-Poset = leq-Preorder preorder-Poset @@ -63,6 +64,10 @@ module _ is-prop-leq-Poset : (x y : type-Poset) → is-prop (leq-Poset x y) is-prop-leq-Poset = is-prop-leq-Preorder preorder-Poset + concatenate-eq-leq-Poset' : + {x y z : type-Poset} → x = y → leq-Poset x z → leq-Poset y z + concatenate-eq-leq-Poset' = concatenate-eq-leq-Preorder' preorder-Poset + concatenate-eq-leq-Poset : {x y z : type-Poset} → x = y → leq-Poset y z → leq-Poset x z concatenate-eq-leq-Poset = concatenate-eq-leq-Preorder preorder-Poset @@ -71,14 +76,22 @@ module _ {x y z : type-Poset} → leq-Poset x y → y = z → leq-Poset x z concatenate-leq-eq-Poset = concatenate-leq-eq-Preorder preorder-Poset + concatenate-eq-leq-eq-Poset : + {x y z w : type-Poset} → x = y → leq-Poset y z → z = w → leq-Poset x w + concatenate-eq-leq-eq-Poset = concatenate-eq-leq-eq-Preorder preorder-Poset + + concatenate-eq-leq-eq-Poset' : + {x y z w : type-Poset} → x = y → leq-Poset x z → z = w → leq-Poset y w + concatenate-eq-leq-eq-Poset' = concatenate-eq-leq-eq-Preorder' preorder-Poset + refl-leq-Poset : is-reflexive leq-Poset refl-leq-Poset = refl-leq-Preorder preorder-Poset transitive-leq-Poset : is-transitive leq-Poset transitive-leq-Poset = transitive-leq-Preorder preorder-Poset - le-Poset-Prop : (x y : type-Poset) → Prop (l1 ⊔ l2) - le-Poset-Prop = le-Preorder-Prop preorder-Poset + le-prop-Poset : (x y : type-Poset) → Prop (l1 ⊔ l2) + le-prop-Poset = le-prop-Preorder preorder-Poset le-Poset : (x y : type-Poset) → UU (l1 ⊔ l2) le-Poset = le-Preorder preorder-Poset diff --git a/src/order-theory/preorders.lagda.md b/src/order-theory/preorders.lagda.md index 2bc2aa9ba2..f7ac6b21ab 100644 --- a/src/order-theory/preorders.lagda.md +++ b/src/order-theory/preorders.lagda.md @@ -12,12 +12,14 @@ open import category-theory.precategories open import foundation.binary-relations open import foundation.cartesian-product-types open import foundation.dependent-pair-types +open import foundation.equivalences open import foundation.function-types open import foundation.identity-types open import foundation.negated-equality open import foundation.negation open import foundation.propositions open import foundation.sets +open import foundation.transport-along-identifications open import foundation.universe-levels ``` @@ -47,32 +49,48 @@ module _ type-Preorder : UU l1 type-Preorder = pr1 X - leq-Preorder-Prop : Relation-Prop l2 type-Preorder - leq-Preorder-Prop = pr1 (pr2 X) + leq-prop-Preorder : Relation-Prop l2 type-Preorder + leq-prop-Preorder = pr1 (pr2 X) leq-Preorder : (x y : type-Preorder) → UU l2 - leq-Preorder x y = type-Prop (leq-Preorder-Prop x y) + leq-Preorder x y = type-Prop (leq-prop-Preorder x y) is-prop-leq-Preorder : (x y : type-Preorder) → is-prop (leq-Preorder x y) - is-prop-leq-Preorder = is-prop-type-Relation-Prop leq-Preorder-Prop + is-prop-leq-Preorder = is-prop-type-Relation-Prop leq-prop-Preorder + + concatenate-eq-leq-Preorder' : + {x y z : type-Preorder} → x = y → leq-Preorder x z → leq-Preorder y z + concatenate-eq-leq-Preorder' {z = z} = tr (λ p → leq-Preorder p z) concatenate-eq-leq-Preorder : {x y z : type-Preorder} → x = y → leq-Preorder y z → leq-Preorder x z - concatenate-eq-leq-Preorder refl = id + concatenate-eq-leq-Preorder p = concatenate-eq-leq-Preorder' (inv p) concatenate-leq-eq-Preorder : {x y z : type-Preorder} → leq-Preorder x y → y = z → leq-Preorder x z - concatenate-leq-eq-Preorder H refl = H + concatenate-leq-eq-Preorder {x} H p = tr (leq-Preorder x) p H + + concatenate-eq-leq-eq-Preorder' : + {x y z w : type-Preorder} → + x = y → leq-Preorder x z → z = w → leq-Preorder y w + concatenate-eq-leq-eq-Preorder' p H q = + concatenate-eq-leq-Preorder' p (concatenate-leq-eq-Preorder H q) + + concatenate-eq-leq-eq-Preorder : + {x y z w : type-Preorder} → + x = y → leq-Preorder y z → z = w → leq-Preorder x w + concatenate-eq-leq-eq-Preorder p H q = + concatenate-eq-leq-Preorder p (concatenate-leq-eq-Preorder H q) - le-Preorder-Prop : Relation-Prop (l1 ⊔ l2) type-Preorder - le-Preorder-Prop x y = - product-Prop (x ≠ y , is-prop-neg) (leq-Preorder-Prop x y) + le-prop-Preorder : Relation-Prop (l1 ⊔ l2) type-Preorder + le-prop-Preorder x y = + product-Prop (x ≠ y , is-prop-neg) (leq-prop-Preorder x y) le-Preorder : Relation (l1 ⊔ l2) type-Preorder - le-Preorder x y = type-Prop (le-Preorder-Prop x y) + le-Preorder x y = type-Prop (le-prop-Preorder x y) is-prop-le-Preorder : (x y : type-Preorder) → is-prop (le-Preorder x y) - is-prop-le-Preorder = is-prop-type-Relation-Prop le-Preorder-Prop + is-prop-le-Preorder = is-prop-type-Relation-Prop le-prop-Preorder is-reflexive-leq-Preorder : is-reflexive (leq-Preorder) is-reflexive-leq-Preorder = pr1 (pr2 (pr2 X)) @@ -140,13 +158,13 @@ module _ precategory-Preorder = make-Precategory ( type-Preorder X) - ( λ x y → set-Prop (leq-Preorder-Prop X x y)) + ( λ x y → set-Prop (leq-prop-Preorder X x y)) ( λ {x} {y} {z} → is-transitive-leq-Preorder X x y z) ( refl-leq-Preorder X) ( λ {x} {y} {z} {w} h g f → - eq-is-prop (is-prop-type-Prop (leq-Preorder-Prop X x w))) - ( λ {x} {y} f → eq-is-prop (is-prop-type-Prop (leq-Preorder-Prop X x y))) - ( λ {x} {y} f → eq-is-prop (is-prop-type-Prop (leq-Preorder-Prop X x y))) + eq-is-prop (is-prop-type-Prop (leq-prop-Preorder X x w))) + ( λ {x} {y} f → eq-is-prop (is-prop-type-Prop (leq-prop-Preorder X x y))) + ( λ {x} {y} f → eq-is-prop (is-prop-type-Prop (leq-prop-Preorder X x y))) module _ {l1 l2 : Level} (C : Precategory l1 l2) diff --git a/src/order-theory/resizing-posets.lagda.md b/src/order-theory/resizing-posets.lagda.md new file mode 100644 index 0000000000..b707026f4c --- /dev/null +++ b/src/order-theory/resizing-posets.lagda.md @@ -0,0 +1,88 @@ +# Resizing posets + +```agda +module order-theory.resizing-posets where +``` + +
Imports + +```agda +open import foundation.binary-relations +open import foundation.cartesian-product-types +open import foundation.dependent-pair-types +open import foundation.equivalences +open import foundation.function-types +open import foundation.identity-types +open import foundation.injective-maps +open import foundation.negated-equality +open import foundation.negation +open import foundation.propositions +open import foundation.sets +open import foundation.universe-levels + +open import order-theory.order-preserving-maps-posets +open import order-theory.posets +open import order-theory.preorders +open import order-theory.resizing-preorders +``` + +
+ +## Idea + +Given a [poset](order-theory.posets.md) `P` on a +[small](foundation.small-types.md) carrier type `X`, then there is an equivalent +{{#concept "resized poset" Agda=resize-type-Poset}} on the small equivalent. + +## Definition + +### Resizing the underlying type of a poset + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} + where + + resize-type-Poset : + (P : Poset l2 l3) → A ≃ type-Poset P → Poset l1 l3 + resize-type-Poset P e = + ( resize-type-Preorder (preorder-Poset P) e , + ( λ x y p q → + is-injective-equiv e + ( antisymmetric-leq-Poset P (map-equiv e x) (map-equiv e y) p q))) +``` + +### The resizing structure equivalence + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} (P : Poset l2 l3) (e : A ≃ type-Poset P) + where + + hom-resize-type-Poset : hom-Poset (resize-type-Poset P e) P + hom-resize-type-Poset = hom-resize-type-Preorder (preorder-Poset P) e + + hom-inv-resize-type-Poset : hom-Poset P (resize-type-Poset P e) + hom-inv-resize-type-Poset = hom-inv-resize-type-Preorder (preorder-Poset P) e + + is-right-inverse-hom-inv-resize-type-Poset : + htpy-hom-Poset P P + ( comp-hom-Poset P (resize-type-Poset P e) P + ( hom-resize-type-Poset) + ( hom-inv-resize-type-Poset)) + ( id-hom-Poset P) + is-right-inverse-hom-inv-resize-type-Poset = + is-right-inverse-hom-inv-resize-type-Preorder (preorder-Poset P) e + + is-left-inverse-hom-inv-resize-type-Poset : + htpy-hom-Poset (resize-type-Poset P e) (resize-type-Poset P e) + ( comp-hom-Poset + ( resize-type-Poset P e) + ( P) + ( resize-type-Poset P e) + ( hom-inv-resize-type-Poset) + ( hom-resize-type-Poset)) + ( id-hom-Poset (resize-type-Poset P e)) + is-left-inverse-hom-inv-resize-type-Poset = + is-left-inverse-hom-inv-resize-type-Preorder (preorder-Poset P) e +``` diff --git a/src/order-theory/resizing-preorders.lagda.md b/src/order-theory/resizing-preorders.lagda.md new file mode 100644 index 0000000000..1fb0ab0218 --- /dev/null +++ b/src/order-theory/resizing-preorders.lagda.md @@ -0,0 +1,93 @@ +# Resizing preorders + +```agda +module order-theory.resizing-preorders where +``` + +
Imports + +```agda +open import foundation.binary-relations +open import foundation.cartesian-product-types +open import foundation.dependent-pair-types +open import foundation.equivalences +open import foundation.function-types +open import foundation.identity-types +open import foundation.negated-equality +open import foundation.negation +open import foundation.propositions +open import foundation.sets +open import foundation.universe-levels + +open import order-theory.order-preserving-maps-preorders +open import order-theory.preorders +``` + +
+ +## Idea + +Given a [preorder](order-theory.preorders.md) `P` on a +[small](foundation.small-types.md) carrier type `X`, then there is an equivalent +{{#concept "resized preorder" Agda=resize-type-Preorder}} on the small +equivalent. + +## Definition + +### Resizing the underlying type of a preorder + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} + where + + resize-type-Preorder : + (P : Preorder l2 l3) → A ≃ type-Preorder P → Preorder l1 l3 + resize-type-Preorder P e = + ( ( A) , + ( λ x y → leq-prop-Preorder P (map-equiv e x) (map-equiv e y)) , + ( λ x → refl-leq-Preorder P (map-equiv e x)) , + ( λ x y z → + transitive-leq-Preorder P + ( map-equiv e x) + ( map-equiv e y) + ( map-equiv e z))) +``` + +### The resizing structure equivalence + +```agda +module _ + {l1 l2 l3 : Level} {A : UU l1} (P : Preorder l2 l3) (e : A ≃ type-Preorder P) + where + + hom-resize-type-Preorder : hom-Preorder (resize-type-Preorder P e) P + pr1 hom-resize-type-Preorder = map-equiv e + pr2 hom-resize-type-Preorder _ _ = id + + hom-inv-resize-type-Preorder : hom-Preorder P (resize-type-Preorder P e) + pr1 hom-inv-resize-type-Preorder = map-inv-equiv e + pr2 hom-inv-resize-type-Preorder x y v = + concatenate-leq-eq-Preorder P + ( concatenate-eq-leq-Preorder P (is-section-map-inv-equiv e x) v) + ( inv (is-section-map-inv-equiv e y)) + + is-right-inverse-hom-inv-resize-type-Preorder : + htpy-hom-Preorder P P + ( comp-hom-Preorder P (resize-type-Preorder P e) P + ( hom-resize-type-Preorder) + ( hom-inv-resize-type-Preorder)) + ( id-hom-Preorder P) + is-right-inverse-hom-inv-resize-type-Preorder = is-section-map-inv-equiv e + + is-left-inverse-hom-inv-resize-type-Preorder : + htpy-hom-Preorder (resize-type-Preorder P e) (resize-type-Preorder P e) + ( comp-hom-Preorder + ( resize-type-Preorder P e) + ( P) + ( resize-type-Preorder P e) + ( hom-inv-resize-type-Preorder) + ( hom-resize-type-Preorder)) + ( id-hom-Preorder (resize-type-Preorder P e)) + is-left-inverse-hom-inv-resize-type-Preorder = is-retraction-map-inv-equiv e +``` diff --git a/src/order-theory/resizing-suplattices.lagda.md b/src/order-theory/resizing-suplattices.lagda.md new file mode 100644 index 0000000000..01af236a32 --- /dev/null +++ b/src/order-theory/resizing-suplattices.lagda.md @@ -0,0 +1,90 @@ +# Resizing suplattices + +```agda +module order-theory.resizing-suplattices where +``` + +
Imports + +```agda +open import foundation.binary-relations +open import foundation.cartesian-product-types +open import foundation.dependent-pair-types +open import foundation.equivalences +open import foundation.function-types +open import foundation.identity-types +open import foundation.injective-maps +open import foundation.negated-equality +open import foundation.negation +open import foundation.propositions +open import foundation.sets +open import foundation.universe-levels + +open import order-theory.least-upper-bounds-posets +open import order-theory.order-preserving-maps-posets +open import order-theory.posets +open import order-theory.resizing-posets +open import order-theory.suplattices +``` + +
+ +## Idea + +Given a [suplattice](order-theory.suplattices.md) `P` on a +[small](foundation.small-types.md) carrier type `X`, then there is an equivalent +{{#concept "resized suplattice" Agda=resize-type-Suplattice}} on the small +equivalent. + +## Definitions + +### Resizing the underlying type of a suplattice + +```agda +module _ + {l1 l2 l3 l4 : Level} {A : UU l1} + (P : Suplattice l2 l3 l4) (e : A ≃ type-Suplattice P) + where + + poset-resize-type-Suplattice : Poset l1 l3 + poset-resize-type-Suplattice = + resize-type-Poset (poset-Suplattice P) e + + sup-resize-type-Suplattice : + {I : UU l4} → (I → A) → A + sup-resize-type-Suplattice x = + map-inv-equiv e (sup-Suplattice P (map-equiv e ∘ x)) + + is-least-upper-bound-sup-resize-type-Suplattice : + {I : UU l4} (x : I → A) → + is-least-upper-bound-family-of-elements-Poset poset-resize-type-Suplattice x + ( sup-resize-type-Suplattice x) + is-least-upper-bound-sup-resize-type-Suplattice x u = + ( concatenate-eq-leq-Poset + ( poset-Suplattice P) + ( is-section-map-inv-equiv e (sup-Suplattice P (map-equiv e ∘ x))) ∘ + pr1 + ( is-least-upper-bound-sup-Suplattice P + ( map-equiv e ∘ x) + ( map-equiv e u))) , + ( pr2 + ( is-least-upper-bound-sup-Suplattice P + ( map-equiv e ∘ x) + ( map-equiv e u)) ∘ + ( concatenate-eq-leq-Poset + ( poset-Suplattice P) + ( inv + ( is-section-map-inv-equiv e + ( sup-Suplattice P (map-equiv e ∘ x)))))) + + is-suplattice-resize-type-Suplattice : + is-suplattice-Poset l4 poset-resize-type-Suplattice + is-suplattice-resize-type-Suplattice I x = + ( sup-resize-type-Suplattice x , + is-least-upper-bound-sup-resize-type-Suplattice x) + + resize-type-Suplattice : Suplattice l1 l3 l4 + resize-type-Suplattice = + ( poset-resize-type-Suplattice , + is-suplattice-resize-type-Suplattice) +``` diff --git a/src/order-theory/subpreorders.lagda.md b/src/order-theory/subpreorders.lagda.md index 1ca4e51888..8ac0925ccd 100644 --- a/src/order-theory/subpreorders.lagda.md +++ b/src/order-theory/subpreorders.lagda.md @@ -46,7 +46,7 @@ module _ eq-type-Subpreorder x y = eq-type-subtype S leq-Subpreorder-Prop : (x y : type-Subpreorder) → Prop l2 - leq-Subpreorder-Prop x y = leq-Preorder-Prop P (pr1 x) (pr1 y) + leq-Subpreorder-Prop x y = leq-prop-Preorder P (pr1 x) (pr1 y) leq-Subpreorder : (x y : type-Subpreorder) → UU l2 leq-Subpreorder x y = type-Prop (leq-Subpreorder-Prop x y) diff --git a/src/order-theory/suplattices.lagda.md b/src/order-theory/suplattices.lagda.md index 23b0a56327..81b7916803 100644 --- a/src/order-theory/suplattices.lagda.md +++ b/src/order-theory/suplattices.lagda.md @@ -9,20 +9,28 @@ module order-theory.suplattices where ```agda open import foundation.binary-relations open import foundation.dependent-pair-types +open import foundation.equivalences +open import foundation.function-types +open import foundation.identity-types +open import foundation.logical-equivalences open import foundation.propositions open import foundation.sets open import foundation.universe-levels open import order-theory.least-upper-bounds-posets open import order-theory.posets +open import order-theory.resizing-posets ``` ## Idea -An **`l`-suplattice** is a poset which has all least upper bounds of families of -elements indexed by a type of universe level `l`. +An `l`-{{#concept "suplattice" Agda=Suplattice}} is a +[poset](order-theory.posets.md) which has all +[least upper bounds](order-theory.least-upper-bounds-posets.md) of families of +elements indexed by a type of [universe level](foundation.universe-levels.md) +`l`. ## Definitions @@ -37,16 +45,16 @@ module _ is-suplattice-Poset-Prop = Π-Prop (UU l3) - (λ I → + ( λ I → Π-Prop ( I → type-Poset P) - ( λ f → has-least-upper-bound-family-of-elements-Poset-Prop P f)) + ( has-least-upper-bound-family-of-elements-prop-Poset P)) is-suplattice-Poset : UU (l1 ⊔ l2 ⊔ lsuc l3) is-suplattice-Poset = type-Prop is-suplattice-Poset-Prop - is-prop-suplattice-Poset : is-prop is-suplattice-Poset - is-prop-suplattice-Poset = is-prop-type-Prop is-suplattice-Poset-Prop + is-prop-is-suplattice-Poset : is-prop is-suplattice-Poset + is-prop-is-suplattice-Poset = is-prop-type-Prop is-suplattice-Poset-Prop module _ {l1 l2 l3 : Level} (P : Poset l1 l2) (H : is-suplattice-Poset l3 P) @@ -79,8 +87,8 @@ module _ type-Suplattice : UU l1 type-Suplattice = type-Poset poset-Suplattice - leq-Suplattice-Prop : (x y : type-Suplattice) → Prop l2 - leq-Suplattice-Prop = leq-Poset-Prop poset-Suplattice + leq-prop-Suplattice : (x y : type-Suplattice) → Prop l2 + leq-prop-Suplattice = leq-prop-Poset poset-Suplattice leq-Suplattice : (x y : type-Suplattice) → UU l2 leq-Suplattice = leq-Poset poset-Suplattice @@ -119,10 +127,24 @@ module _ is-least-upper-bound-sup-Suplattice : {I : UU l3} (x : I → type-Suplattice) → - is-least-upper-bound-family-of-elements-Poset poset-Suplattice x + is-least-upper-bound-family-of-elements-Poset + ( poset-Suplattice) + ( x) ( sup-Suplattice x) is-least-upper-bound-sup-Suplattice = is-least-upper-bound-sup-is-suplattice-Poset ( poset-Suplattice) ( is-suplattice-Suplattice) + + leq-sup-Suplattice : + {I : UU l3} (x : I → type-Suplattice) (i : I) → + leq-Suplattice (x i) (sup-Suplattice x) + leq-sup-Suplattice x = + backward-implication + ( is-least-upper-bound-sup-Suplattice x (sup-Suplattice x)) + ( refl-leq-Suplattice (sup-Suplattice x)) ``` + +## External links + +- [suplattice](https://ncatlab.org/nlab/show/suplattice) at $n$Lab diff --git a/src/order-theory/supremum-preserving-maps-posets.lagda.md b/src/order-theory/supremum-preserving-maps-posets.lagda.md new file mode 100644 index 0000000000..19e7480cce --- /dev/null +++ b/src/order-theory/supremum-preserving-maps-posets.lagda.md @@ -0,0 +1,333 @@ +# Supremum preserving maps on posets + +```agda +module order-theory.supremum-preserving-maps-posets where +``` + +
Imports + +```agda +open import foundation.booleans +open import foundation.dependent-pair-types +open import foundation.equivalences +open import foundation.evaluation-functions +open import foundation.function-types +open import foundation.fundamental-theorem-of-identity-types +open import foundation.homotopies +open import foundation.homotopy-induction +open import foundation.identity-types +open import foundation.propositions +open import foundation.raising-universe-levels +open import foundation.small-types +open import foundation.strictly-involutive-identity-types +open import foundation.subtype-identity-principle +open import foundation.torsorial-type-families +open import foundation.universe-levels + +open import order-theory.join-preserving-maps-posets +open import order-theory.least-upper-bounds-posets +open import order-theory.order-preserving-maps-posets +open import order-theory.posets +``` + +
+ +## Idea + +A map `f : P → Q` between the underlying types of two +[posets](order-theory.posets.md) is said to be +{{#concept "supremum preserving" Disambiguation="map of posets" Agda=preserves-suprema-Poset}} +if + +```text + f(⋃ᵢxᵢ) = ⋃ᵢf(xᵢ) +``` + +for every family `x₍₋₎ : I → P` with a +[supremum](order-theory.least-upper-bounds-posets.md) in `P`. + +## Definitions + +### The predicate of preserving a supremum + +```agda +module _ + {l1 l2 l3 l4 l5 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + (f : type-Poset P → type-Poset Q) + {I : UU l5} (x : I → type-Poset P) + where + + preserves-supremum-Poset : UU (l1 ⊔ l2 ⊔ l3 ⊔ l4 ⊔ l5) + preserves-supremum-Poset = + (y : has-least-upper-bound-family-of-elements-Poset P x) → + is-least-upper-bound-family-of-elements-Poset Q (f ∘ x) (f (pr1 y)) + + is-prop-preserves-supremum-Poset : + is-prop preserves-supremum-Poset + is-prop-preserves-supremum-Poset = + is-prop-Π + ( λ y → + is-prop-is-least-upper-bound-family-of-elements-Poset Q + ( f ∘ x) + ( f (pr1 y))) + + preserves-supremum-prop-Poset : Prop (l1 ⊔ l2 ⊔ l3 ⊔ l4 ⊔ l5) + preserves-supremum-prop-Poset = + preserves-supremum-Poset , is-prop-preserves-supremum-Poset +``` + +### Supremum preserving maps + +```agda +module _ + {l1 l2 l3 l4 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + preserves-suprema-Poset : + (l5 : Level) → (type-Poset P → type-Poset Q) → + UU (l1 ⊔ l2 ⊔ l3 ⊔ l4 ⊔ lsuc l5) + preserves-suprema-Poset l5 f = + {I : UU l5} (x : I → type-Poset P) + (y : has-least-upper-bound-family-of-elements-Poset P x) → + is-least-upper-bound-family-of-elements-Poset Q (f ∘ x) (f (pr1 y)) + + is-prop-preserves-suprema-Poset : + {l5 : Level} (f : type-Poset P → type-Poset Q) → + is-prop (preserves-suprema-Poset l5 f) + is-prop-preserves-suprema-Poset f = + is-prop-implicit-Π + ( λ I → is-prop-Π (is-prop-preserves-supremum-Poset P Q f)) + + preserves-suprema-prop-Poset : + (l5 : Level) → + (type-Poset P → type-Poset Q) → Prop (l1 ⊔ l2 ⊔ l3 ⊔ l4 ⊔ lsuc l5) + preserves-suprema-prop-Poset l5 f = + preserves-suprema-Poset l5 f , (is-prop-preserves-suprema-Poset f) + + hom-sup-Poset : (l5 : Level) → UU (l1 ⊔ l2 ⊔ l3 ⊔ l4 ⊔ lsuc l5) + hom-sup-Poset l5 = + Σ (type-Poset P → type-Poset Q) (preserves-suprema-Poset l5) + + map-hom-sup-Poset : + {l5 : Level} → hom-sup-Poset l5 → type-Poset P → type-Poset Q + map-hom-sup-Poset = pr1 + + preserves-suprema-hom-sup-Poset : + {l5 : Level} (f : hom-sup-Poset l5) → + preserves-suprema-Poset l5 (map-hom-sup-Poset f) + preserves-suprema-hom-sup-Poset = pr2 + + sup-map-hom-sup-Poset : + {l5 : Level} (f : hom-sup-Poset l5) → + {I : UU l5} {x : I → type-Poset P} → + has-least-upper-bound-family-of-elements-Poset P x → + has-least-upper-bound-family-of-elements-Poset Q (map-hom-sup-Poset f ∘ x) + sup-map-hom-sup-Poset f {x = x} y = + ( map-hom-sup-Poset f (pr1 y) , preserves-suprema-hom-sup-Poset f x y) +``` + +## Properties + +### Supremum preserving maps preserve suprema over small types + +```agda +module _ + {l1 l2 l3 l4 l5 l6 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + preserves-small-supremum-preserves-suprema-Poset : + {f : type-Poset P → type-Poset Q} → preserves-suprema-Poset P Q l5 f → + {I : UU l6} (u : is-small l5 I) (x : I → type-Poset P) → + preserves-supremum-Poset P Q f (x ∘ map-inv-equiv-is-small u) + preserves-small-supremum-preserves-suprema-Poset H u x = + H (x ∘ map-inv-equiv-is-small u) +``` + +### Supremum preserving maps preserve joins + +```text +module _ + {l1 l2 l3 l4 l5 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + abstract + preserves-joins-preserves-suprema-Poset : + {f : type-Poset P → type-Poset Q} → + preserves-suprema-Poset P Q l5 f → + preserves-joins-Poset P Q f + preserves-joins-preserves-suprema-Poset {f} H x y s = + is-least-binary-upper-bound-has-least-upper-bound-family-of-elements-Poset + ( Q) + ( rec-bool (f x) (f y)) + ( f (pr1 s) , ?) -- TODO +``` + +> From this property the next would be a simple corollary. + +### Supremum preserving maps preserve order + +```agda +module _ + {l1 l2 l3 l4 l5 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + abstract + preserves-order-preserves-suprema-Poset : + {f : type-Poset P → type-Poset Q} → + preserves-suprema-Poset P Q l5 f → + preserves-order-Poset P Q f + preserves-order-preserves-suprema-Poset {f} H x y p = + pr2 + ( preserves-small-supremum-preserves-suprema-Poset P Q H + ( Raise l5 bool) + ( family-of-elements-has-least-binary-upper-bound-Poset P x y + ( has-least-binary-upper-bound-leq-Poset P x y p)) + ( y , + λ z → + ( ( ev (map-raise false)) , + ( λ where + u (map-raise true) → transitive-leq-Poset P x y z u p + u (map-raise false) → u))) + ( f y)) + ( refl-leq-Poset Q (f y)) + ( map-raise true) +``` + +### Homotopies of supremum preserving maps + +```agda +module _ + {l1 l2 l3 l4 l5 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + htpy-hom-sup-Poset : (f g : hom-sup-Poset P Q l5) → UU (l1 ⊔ l3) + htpy-hom-sup-Poset f g = map-hom-sup-Poset P Q f ~ map-hom-sup-Poset P Q g + + refl-htpy-hom-sup-Poset : (f : hom-sup-Poset P Q l5) → htpy-hom-sup-Poset f f + refl-htpy-hom-sup-Poset f = refl-htpy + + htpy-eq-hom-sup-Poset : + (f g : hom-sup-Poset P Q l5) → f = g → htpy-hom-sup-Poset f g + htpy-eq-hom-sup-Poset f .f refl = refl-htpy-hom-sup-Poset f + + is-torsorial-htpy-hom-sup-Poset : + (f : hom-sup-Poset P Q l5) → is-torsorial (htpy-hom-sup-Poset f) + is-torsorial-htpy-hom-sup-Poset f = + is-torsorial-Eq-subtype + ( is-torsorial-htpy (map-hom-sup-Poset P Q f)) + ( is-prop-preserves-suprema-Poset P Q) + ( map-hom-sup-Poset P Q f) + ( refl-htpy) + ( preserves-suprema-hom-sup-Poset P Q f) + + is-equiv-htpy-eq-hom-sup-Poset : + (f g : hom-sup-Poset P Q l5) → is-equiv (htpy-eq-hom-sup-Poset f g) + is-equiv-htpy-eq-hom-sup-Poset f = + fundamental-theorem-id + ( is-torsorial-htpy-hom-sup-Poset f) + ( htpy-eq-hom-sup-Poset f) + + extensionality-hom-sup-Poset : + (f g : hom-sup-Poset P Q l5) → (f = g) ≃ htpy-hom-sup-Poset f g + pr1 (extensionality-hom-sup-Poset f g) = htpy-eq-hom-sup-Poset f g + pr2 (extensionality-hom-sup-Poset f g) = is-equiv-htpy-eq-hom-sup-Poset f g + + eq-htpy-hom-sup-Poset : + (f g : hom-sup-Poset P Q l5) → htpy-hom-sup-Poset f g → f = g + eq-htpy-hom-sup-Poset f g = + map-inv-is-equiv (is-equiv-htpy-eq-hom-sup-Poset f g) +``` + +### The identity supremum preserving map + +```agda +module _ + {l1 l2 : Level} (P : Poset l1 l2) + where + + preserves-suprema-id-Poset : + {l3 : Level} → preserves-suprema-Poset P P l3 (id {A = type-Poset P}) + preserves-suprema-id-Poset x y = pr2 y + + id-hom-sup-Poset : (l3 : Level) → hom-sup-Poset P P l3 + id-hom-sup-Poset l3 = id , preserves-suprema-id-Poset +``` + +### Composing supremum preserving maps + +```agda +module _ + {l1 l2 l3 l4 l5 l6 l7 : Level} + (P : Poset l1 l2) (Q : Poset l3 l4) (R : Poset l5 l6) + where + + preserves-suprema-comp-Poset : + (g : hom-sup-Poset Q R l7) (f : hom-sup-Poset P Q l7) → + preserves-suprema-Poset P R l7 + ( map-hom-sup-Poset Q R g ∘ map-hom-sup-Poset P Q f) + preserves-suprema-comp-Poset g f x y = + preserves-suprema-hom-sup-Poset Q R g + ( map-hom-sup-Poset P Q f ∘ x) + ( sup-map-hom-sup-Poset P Q f y) + + comp-hom-sup-Poset : + (g : hom-sup-Poset Q R l7) (f : hom-sup-Poset P Q l7) → + hom-sup-Poset P R l7 + comp-hom-sup-Poset g f = + map-hom-sup-Poset Q R g ∘ map-hom-sup-Poset P Q f , + preserves-suprema-comp-Poset g f +``` + +### Unit laws for composition of supremum preserving maps + +```agda +module _ + {l1 l2 l3 l4 l5 : Level} (P : Poset l1 l2) (Q : Poset l3 l4) + where + + left-unit-law-comp-hom-sup-Poset : + (f : hom-sup-Poset P Q l5) → + ( comp-hom-sup-Poset P Q Q (id-hom-sup-Poset Q l5) f) = f + left-unit-law-comp-hom-sup-Poset f = + eq-htpy-hom-sup-Poset P Q + ( comp-hom-sup-Poset P Q Q (id-hom-sup-Poset Q l5) f) + ( f) + ( refl-htpy) + + right-unit-law-comp-hom-sup-Poset : + (f : hom-sup-Poset P Q l5) → + (comp-hom-sup-Poset P P Q f (id-hom-sup-Poset P l5)) = f + right-unit-law-comp-hom-sup-Poset f = + eq-htpy-hom-sup-Poset P Q + ( comp-hom-sup-Poset P P Q f (id-hom-sup-Poset P l5)) + ( f) + ( refl-htpy) +``` + +### Associativity of composition of supremum preserving maps + +```agda +module _ + {l1 l2 l3 l4 l5 l6 l7 l8 l9 : Level} + (P : Poset l1 l2) (Q : Poset l3 l4) + (R : Poset l5 l6) (S : Poset l7 l8) + (h : hom-sup-Poset R S l9) + (g : hom-sup-Poset Q R l9) + (f : hom-sup-Poset P Q l9) + where + + associative-comp-hom-sup-Poset : + comp-hom-sup-Poset P Q S (comp-hom-sup-Poset Q R S h g) f = + comp-hom-sup-Poset P R S h (comp-hom-sup-Poset P Q R g f) + associative-comp-hom-sup-Poset = + eq-htpy-hom-sup-Poset P S + ( comp-hom-sup-Poset P Q S (comp-hom-sup-Poset Q R S h g) f) + ( comp-hom-sup-Poset P R S h (comp-hom-sup-Poset P Q R g f)) + ( refl-htpy) + + involutive-eq-associative-comp-hom-sup-Poset : + comp-hom-sup-Poset P Q S (comp-hom-sup-Poset Q R S h g) f =ⁱ + comp-hom-sup-Poset P R S h (comp-hom-sup-Poset P Q R g f) + involutive-eq-associative-comp-hom-sup-Poset = + involutive-eq-eq associative-comp-hom-sup-Poset +``` diff --git a/src/order-theory/top-elements-posets.lagda.md b/src/order-theory/top-elements-posets.lagda.md index 658fc977cc..9a6bf6e233 100644 --- a/src/order-theory/top-elements-posets.lagda.md +++ b/src/order-theory/top-elements-posets.lagda.md @@ -21,7 +21,7 @@ open import order-theory.top-elements-preorders ## Idea A -{{#concept "largest element" Disambiguation="in a poset" WD="maximal and minimal elements" WDID=Q1475294 Agda=is-top-element-Poset}} +{{#concept "largest element" Disambiguation="in a poset" Agda=is-top-element-Poset}} in a [poset](order-theory.posets.md) is an element `t` such that `x ≤ t` holds for every `x : P`. diff --git a/src/order-theory/top-elements-preorders.lagda.md b/src/order-theory/top-elements-preorders.lagda.md index 3e024bad5d..1c9655f1de 100644 --- a/src/order-theory/top-elements-preorders.lagda.md +++ b/src/order-theory/top-elements-preorders.lagda.md @@ -32,7 +32,7 @@ module _ is-top-element-prop-Preorder : type-Preorder X → Prop (l1 ⊔ l2) is-top-element-prop-Preorder x = - Π-Prop (type-Preorder X) (λ y → leq-Preorder-Prop X y x) + Π-Prop (type-Preorder X) (λ y → leq-prop-Preorder X y x) is-top-element-Preorder : type-Preorder X → UU (l1 ⊔ l2) is-top-element-Preorder x = type-Prop (is-top-element-prop-Preorder x) diff --git a/src/order-theory/total-orders.lagda.md b/src/order-theory/total-orders.lagda.md index 5c6541a1c9..1f84d69e67 100644 --- a/src/order-theory/total-orders.lagda.md +++ b/src/order-theory/total-orders.lagda.md @@ -23,10 +23,12 @@ open import order-theory.total-preorders ## Idea -A **total order**, or a **linear order**, is a [poset](order-theory.posets.md) -`P` such that for every two elements `x` and `y` in `P` the +A +{{#concept "total order" Disambiguation="on a type" WD="total order" WDID=Q369377 Agda=Total-Order}}, +or a **linear order**, is a [poset](order-theory.posets.md) `P` such that for +every two elements `x` and `y` in `P` the [disjunction](foundation.disjunction.md) `(x ≤ y) ∨ (y ≤ x)` holds. In other -words, total orders are totally ordered in the sense that any two elements are +words, total orders are _totally ordered_ in the sense that any two elements are comparable. ## Definitions @@ -81,7 +83,7 @@ module _ type-Total-Order = type-Poset poset-Total-Order leq-Total-Order-Prop : (x y : type-Total-Order) → Prop l2 - leq-Total-Order-Prop = leq-Poset-Prop poset-Total-Order + leq-Total-Order-Prop = leq-prop-Poset poset-Total-Order leq-Total-Order : (x y : type-Total-Order) → UU l2 leq-Total-Order = leq-Poset poset-Total-Order @@ -115,3 +117,9 @@ module _ set-Total-Order : Set l1 set-Total-Order = set-Poset poset-Total-Order ``` + +## External links + +- [Total order](https://en.wikipedia.org/wiki/Total_order) at Wikipedia +- [total order](https://ncatlab.org/nlab/show/total+order) at $n$Lab +- [Total orders](https://1lab.dev/Order.Total.html) at 1lab diff --git a/src/order-theory/total-preorders.lagda.md b/src/order-theory/total-preorders.lagda.md index fdc75e0459..facdaddbd8 100644 --- a/src/order-theory/total-preorders.lagda.md +++ b/src/order-theory/total-preorders.lagda.md @@ -36,7 +36,7 @@ module _ incident-Preorder-Prop : (x y : type-Preorder X) → Prop l2 incident-Preorder-Prop x y = - (leq-Preorder-Prop X x y) ∨ (leq-Preorder-Prop X y x) + (leq-prop-Preorder X x y) ∨ (leq-prop-Preorder X y x) incident-Preorder : (x y : type-Preorder X) → UU l2 incident-Preorder x y = type-Prop (incident-Preorder-Prop x y) @@ -78,7 +78,7 @@ module _ type-Total-Preorder = type-Preorder preorder-Total-Preorder leq-Total-Preorder-Prop : (x y : type-Total-Preorder) → Prop l2 - leq-Total-Preorder-Prop = leq-Preorder-Prop preorder-Total-Preorder + leq-Total-Preorder-Prop = leq-prop-Preorder preorder-Total-Preorder leq-Total-Preorder : (x y : type-Total-Preorder) → UU l2 leq-Total-Preorder = leq-Preorder preorder-Total-Preorder diff --git a/src/order-theory/upper-bounds-chains-posets.lagda.md b/src/order-theory/upper-bounds-chains-posets.lagda.md index 4326fd679f..3da859e4e1 100644 --- a/src/order-theory/upper-bounds-chains-posets.lagda.md +++ b/src/order-theory/upper-bounds-chains-posets.lagda.md @@ -37,7 +37,7 @@ module _ is-upper-bound-chain-prop-Poset : type-Poset X → Prop (l1 ⊔ l2 ⊔ l3) is-upper-bound-chain-prop-Poset = - is-upper-bound-family-of-elements-Poset-Prop X + is-upper-bound-family-of-elements-prop-Poset X ( inclusion-type-chain-Poset X C) is-upper-bound-chain-Poset : type-Poset X → UU (l1 ⊔ l2 ⊔ l3) diff --git a/src/order-theory/upper-bounds-posets.lagda.md b/src/order-theory/upper-bounds-posets.lagda.md index d3909c4678..0193ab6052 100644 --- a/src/order-theory/upper-bounds-posets.lagda.md +++ b/src/order-theory/upper-bounds-posets.lagda.md @@ -35,7 +35,7 @@ module _ is-binary-upper-bound-Poset-Prop : (x y z : type-Poset P) → Prop l2 is-binary-upper-bound-Poset-Prop x y z = - product-Prop (leq-Poset-Prop P x z) (leq-Poset-Prop P y z) + product-Prop (leq-prop-Poset P x z) (leq-prop-Poset P y z) is-binary-upper-bound-Poset : (x y z : type-Poset P) → UU l2 @@ -66,23 +66,23 @@ module _ {l1 l2 : Level} (P : Poset l1 l2) where - is-upper-bound-family-of-elements-Poset-Prop : + is-upper-bound-family-of-elements-prop-Poset : {l : Level} {I : UU l} → (I → type-Poset P) → type-Poset P → Prop (l2 ⊔ l) - is-upper-bound-family-of-elements-Poset-Prop {l} {I} f z = - Π-Prop I (λ i → leq-Poset-Prop P (f i) z) + is-upper-bound-family-of-elements-prop-Poset {l} {I} f z = + Π-Prop I (λ i → leq-prop-Poset P (f i) z) is-upper-bound-family-of-elements-Poset : {l : Level} {I : UU l} → (I → type-Poset P) → type-Poset P → UU (l2 ⊔ l) is-upper-bound-family-of-elements-Poset f z = - type-Prop (is-upper-bound-family-of-elements-Poset-Prop f z) + type-Prop (is-upper-bound-family-of-elements-prop-Poset f z) is-prop-is-upper-bound-family-of-elements-Poset : {l : Level} {I : UU l} (f : I → type-Poset P) (z : type-Poset P) → is-prop (is-upper-bound-family-of-elements-Poset f z) is-prop-is-upper-bound-family-of-elements-Poset f z = - is-prop-type-Prop (is-upper-bound-family-of-elements-Poset-Prop f z) + is-prop-type-Prop (is-upper-bound-family-of-elements-prop-Poset f z) ``` ## Properties diff --git a/src/orthogonal-factorization-systems/double-negation-sheaves.lagda.md b/src/orthogonal-factorization-systems/double-negation-sheaves.lagda.md index eb2cbcdba9..f173a260c6 100644 --- a/src/orthogonal-factorization-systems/double-negation-sheaves.lagda.md +++ b/src/orthogonal-factorization-systems/double-negation-sheaves.lagda.md @@ -83,7 +83,7 @@ is-double-negation-sheaf-is-contr is-contr-A P = module _ {l : Level} {A : UU l} (is-prop-A : is-prop A) - (is-¬¬sheaf-A : is-double-negation-sheaf l A) + (is-¬¬-sheaf-A : is-double-negation-sheaf l A) where compute-is-double-negation-sheaf-is-prop : A ≃ (¬ A → A) @@ -91,12 +91,12 @@ module _ ( left-unit-law-product-is-contr ( is-proof-irrelevant-is-prop (is-prop-function-type is-prop-A) id)) ∘e ( equiv-universal-property-coproduct A) ∘e - ( _ , is-¬¬sheaf-A (is-decidable-prop-Irrefutable-Prop (A , is-prop-A))) + ( _ , is-¬¬-sheaf-A (is-decidable-prop-Irrefutable-Prop (A , is-prop-A))) is-double-negation-stable-is-double-negation-sheaf-is-prop : is-double-negation-stable (A , is-prop-A) is-double-negation-stable-is-double-negation-sheaf-is-prop ¬¬a = - map-inv-is-equiv (is-¬¬sheaf-A (A , is-prop-A , ¬¬a)) id + map-inv-is-equiv (is-¬¬-sheaf-A (A , is-prop-A , ¬¬a)) id ``` ### Double negation stable propositions are double negation sheaves diff --git a/src/univalent-combinatorics.lagda.md b/src/univalent-combinatorics.lagda.md index d7d2896487..f62d4b12c8 100644 --- a/src/univalent-combinatorics.lagda.md +++ b/src/univalent-combinatorics.lagda.md @@ -38,6 +38,7 @@ open import univalent-combinatorics.cubes public open import univalent-combinatorics.cycle-partitions public open import univalent-combinatorics.cycle-prime-decomposition-natural-numbers public open import univalent-combinatorics.cyclic-finite-types public +open import univalent-combinatorics.de-morgans-law public open import univalent-combinatorics.decidable-dependent-function-types public open import univalent-combinatorics.decidable-dependent-pair-types public open import univalent-combinatorics.decidable-equivalence-relations public diff --git a/src/univalent-combinatorics/de-morgans-law.lagda.md b/src/univalent-combinatorics/de-morgans-law.lagda.md new file mode 100644 index 0000000000..4de478614e --- /dev/null +++ b/src/univalent-combinatorics/de-morgans-law.lagda.md @@ -0,0 +1,96 @@ +# De Morgan's law for finite families of propositions + +```agda +module univalent-combinatorics.de-morgans-law 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-types +open import foundation.dependent-pair-types +open import foundation.empty-types +open import foundation.equivalences +open import foundation.function-types +open import foundation.functoriality-dependent-pair-types +open import foundation.negation +open import foundation.unit-type +open import foundation.universe-levels + +open import logic.de-morgan-propositions +open import logic.de-morgan-types + +open import univalent-combinatorics.counting +open import univalent-combinatorics.standard-finite-types +``` + +
+ +## Idea + +Given a finite family of [De Morgan types](logic.de-morgan-types.md) +`P : Fin k → De-Morgan-Type`, then the "finitary De Morgan's law" + +```text + ¬ (∀ i, P i) ⇒ ∃ i, ¬ (P i) +``` + +holds. + +## Result + +```agda +lemma-satisfies-de-morgan-Fin-is-de-morgan-family : + {l : Level} (k : ℕ) {P : Fin (succ-ℕ k) → UU l} → + ((x : Fin (succ-ℕ k)) → is-de-morgan (P x)) → + ¬ ((x : Fin (succ-ℕ k)) → P x) → + ¬ P (inr star) + ¬ ((x : Fin k) → P (inl x)) +lemma-satisfies-de-morgan-Fin-is-de-morgan-family k {P} H q = + rec-coproduct + ( inl) + ( λ z → inr (λ y → z (λ y' → q (ind-coproduct P y (λ _ → y'))))) + ( H (inr star)) + +satisfies-de-morgan-Fin-is-de-morgan-family : + {l : Level} (k : ℕ) {P : Fin k → UU l} → + ((x : Fin k) → is-de-morgan (P x)) → + ¬ ((x : Fin k) → P x) → + Σ (Fin k) (¬_ ∘ P) +satisfies-de-morgan-Fin-is-de-morgan-family zero-ℕ {P} H q = + q (λ ()) , (λ x → q (λ ())) +satisfies-de-morgan-Fin-is-de-morgan-family (succ-ℕ k) {P} H q = + rec-coproduct + ( inr star ,_) + ( λ q' → + map-Σ-map-base inl + ( ¬_ ∘ P) + ( satisfies-de-morgan-Fin-is-de-morgan-family k (H ∘ inl) q')) + ( lemma-satisfies-de-morgan-Fin-is-de-morgan-family k H q) +``` + +```agda +module _ + {l : Level} {k : ℕ} (P : Fin k → De-Morgan-Type l) + where + + satisfies-de-morgan-family-Fin : + ¬ ((x : Fin k) → type-De-Morgan-Type (P x)) → + Σ (Fin k) (¬_ ∘ type-De-Morgan-Type ∘ P) + satisfies-de-morgan-family-Fin = + satisfies-de-morgan-Fin-is-de-morgan-family k + ( is-de-morgan-type-De-Morgan-Type ∘ P) +``` + +## Comment + +It is likely that this "finitary De Morgan's law" can be generalized to families +of De Morgan types indexed by _searchable types_ in the sense of Escardó +{{#cite Esc08}}. + +## References + +{{#bibliography}} diff --git a/src/univalent-combinatorics/kuratowski-finite-sets.lagda.md b/src/univalent-combinatorics/kuratowski-finite-sets.lagda.md index 8255b3ad10..26bf4b13d7 100644 --- a/src/univalent-combinatorics/kuratowski-finite-sets.lagda.md +++ b/src/univalent-combinatorics/kuratowski-finite-sets.lagda.md @@ -89,6 +89,11 @@ has-decidable-equality-is-finite-type-𝔽-Kuratowski X = has-decidable-equality-is-finite ``` +### Kuratowski finite sets are Markovian + +> This remains to be formalized. +> ([Markov's principle](logic.markovs-principle.md)) + ## See also - [Finite types](univalent-combinatorics.finite-types.md)