Martin Escardo, 30 May - 3rd June 2020. Further additions 6th July. We look at * Quasidecidable propositions (generalizing semidecidable propositions). * The initial Ο-frame. * The free Ο-sup-lattice on one generator. Their definitions are given below verbally and in Agda. We work in a spartan univalent type theory with Ξ , Ξ£, +, Id, π, π, β, perhaps W-types, propositional-truncation, univalence, universes. Most of the time full univalence is not needed - propositional and functional extenstionality suffice. Sometimes we also consider propositional resizing, as an explicit assumption each time it is used. The above notions don't seem to be definable in our spartan univalent type theory. Their specifications are as follows: * Quasidecidable propositions. They are the smallest set of propositions closed under π,π, and countable existential quantification, or countable joins in the frame of propositions. They form a dominance. * The initial Ο-frame. A Ο-frame has finite meets β€ and β§ and countable joins β, such that β§ distributes over β, with homomorphisms that preserve them. * The free Ο-sup-lattice on one generator. A Ο-sup-lattice has an empty join β₯ and countable joins β with homomorphisms that preserve them. It automatically has binary joins, which are automatically preserved by homomorphisms. We have: * Quasidecidable propositions exist (the precise definition of their existence is given below) if and only if the free Ο-sup-lattice on one generator exists. The quasidecidable propositions form a dominance. * The free Ο-sup-lattice on one generator, if it exists, is also the initial Ο-frame. We have that Ο-sup-lattice homomorphisms from the free Ο-sup-lattice on one generator into a Ο-frame qua Ο-sup-lattice automatically preserve finite meets and hence are Ο-frame homomorphisms. * Assuming that the free Ο-sup-lattice on one generator exists, we have that Ο-sup-lattices (and hence Ο-frames) have joins of families indexed by quasidecidable propositions. \begin{code} {-# OPTIONS --safe --without-K #-} open import MLTT.Spartan open import UF.PropTrunc open import UF.FunExt open import UF.Subsingletons open import UF.SubtypeClassifier renaming (β₯ to β₯Ξ© ; β€ to β€Ξ©) open import UF.SubtypeClassifier-Properties open import UF.Sets \end{code} We assume function extensionality, propositional extensionality and the existence of propositional truncations, as explicit hypotheses for this file. \begin{code} module NotionsOfDecidability.QuasiDecidable (fe : Fun-Ext) (pe : Prop-Ext) (pt : propositional-truncations-exist) where open import UF.Size import OrderedTypes.Frame import OrderedTypes.sigma-frame import OrderedTypes.sigma-sup-lattice \end{code} The following three definitions are parametrized by a universe π£, which we may wish to be the first universe π€β in practice. We adopt the following notational conventions: * π£ is the universe where the quasidecidable truth values live. Typically π£ will be π€β or π€β. * π is the universe where the knowledge they are quasidecidable lives. Typically π will be π£ or π£ βΊ Recall that π€, π₯, π¦, π£ range over universes. We add π to this list. \begin{code} variable π : Universe \end{code} The notion of existence of quasidecidable propositions, formulated as a record: \begin{code} record quasidecidable-propositions-exist (π£ π : Universe) : π€Ο where constructor quasidecidable-propositions open PropositionalTruncation pt field is-quasidecidable : π£ Μ β π Μ being-quasidecidable-is-prop : β P β is-prop (is-quasidecidable P) π-is-quasidecidable : is-quasidecidable π π-is-quasidecidable : is-quasidecidable π quasidecidable-closed-under-Ο-joins : (P : β β π£ Μ ) β ((n : β) β is-quasidecidable (P n)) β is-quasidecidable (β n κ β , P n) quasidecidable-induction : β {π€} (F : π£ Μ β π€ Μ ) β ((P : π£ Μ ) β is-prop (F P)) β F π β F π β ((P : β β π£ Μ ) β ((n : β) β F (P n)) β F (β n κ β , P n)) β (P : π£ Μ ) β is-quasidecidable P β F P \end{code} (It follows automatically that quasidecidable types are propositions - see below.) We also formulate the existence of the initial Ο-frame as a record. \begin{code} record initial-Ο-frame-exists (π£ : Universe) : π€Ο where constructor initial-Ο-frame open OrderedTypes.sigma-frame fe field π : Ο-Frame π£ π-is-initial : {π€ : Universe} (π : Ο-Frame π€) β β! f κ (β¨ π β© β β¨ π β©), is-Ο-frame-hom π π f \end{code} And finally the existence of the free Ο-sup-lattice on one generator: \begin{code} record free-Ο-SupLat-on-one-generator-exists (π£ π : Universe) : π€Ο where constructor free-Ο-SupLat-on-one-generator open OrderedTypes.sigma-sup-lattice fe field π : Ο-SupLat π£ π β€ : β¨ π β© π-free : {π₯ π¦ : Universe} (π : Ο-SupLat π₯ π¦) (t : β¨ π β©) β β! f κ (β¨ π β© β β¨ π β©) , is-Ο-suplat-hom π π f Γ (f β€ οΌ t) \end{code} The main theorems are as follows, where the proofs are given after we have developed enough material: \begin{code} theoremβ : quasidecidable-propositions-exist π£ π β free-Ο-SupLat-on-one-generator-exists (π£ βΊ β π) π£ theoremβ : free-Ο-SupLat-on-one-generator-exists π£ π€ β quasidecidable-propositions-exist π£ π£ theoremβ : free-Ο-SupLat-on-one-generator-exists π£ π β initial-Ο-frame-exists π£ theoremβ : Propositional-Resizing β quasidecidable-propositions-exist π£ π \end{code} * We first work with a hypothetical collection of quasidecidable propositions and show that they form the initial Ο-frame. This is in the submodule hypothetical-quasidecidability. * Then we construct it assuming propositional resizing. This is in the submodule quasidecidability-construction-from-resizing. * Assuming a hypothetical free Ο-sup-lattice on one generator, it is automatically the initial Ο-frame, and from it we can define the notion of quasidecidable proposition. Can we construct them without resizing and without higher-inductive types other than propositional truncation? \begin{code} open PropositionalTruncation pt open import UF.Base open import UF.Subsingletons-FunExt open import UF.Equiv open import UF.Equiv-FunExt open import UF.Univalence open import UF.UA-FunExt open import UF.EquivalenceExamples open import UF.Yoneda open import UF.Embeddings open import UF.Powerset open import Dominance.Definition \end{code} Before considering quasidecidable propositions, we review semidecidable ones. A proposition is semidecidable if it is a countable join of decidable propositions. See the paper https://www.cs.bham.ac.uk/~mhe/papers/partial-elements-and-recursion.pdf by Martin Escardo and Cory Knapp. NB. Semidecidable propositions are called Rosolini propositions in the above reference. \begin{code} is-semidecidable : π€ Μ β π€ Μ is-semidecidable X = β Ξ± κ (β β π), X β (β n κ β , Ξ± n οΌ β) \end{code} Exercise. X is semidecidable iff it is a countable join of decidable propositions: \begin{code} is-semidecidable' : π€ Μ β π€ βΊ Μ is-semidecidable' {π€} X = β A κ (β β π€ Μ ) , ((n : β) β is-decidable (A n)) Γ (X β (β n κ β , A n)) \end{code} The following shows that we need to truncate, because the Cantor type (β β π) is certainly not the type of semidecidable propositions: \begin{code} semidecidability-data : π€ Μ β π€ Μ semidecidability-data X = Ξ£ Ξ± κ (β β π), X β (β n κ β , Ξ± n οΌ β) totality-of-semidecidability-data : is-univalent π€β β (Ξ£ X κ π€β Μ , semidecidability-data X) β (β β π) totality-of-semidecidability-data ua = (Ξ£ X κ π€β Μ , Ξ£ Ξ± κ (β β π), X β (β n κ β , Ξ± n οΌ β)) ββ¨ i β© (Ξ£ Ξ± κ (β β π), Ξ£ X κ π€β Μ , X β (β n κ β , Ξ± n οΌ β)) ββ¨ ii β© (Ξ£ Ξ± κ (β β π), Ξ£ X κ π€β Μ , (β n κ β , Ξ± n οΌ β) β X) ββ¨ iii β© (β β π) Γ π {π€β} ββ¨ iv β© (β β π) β where i = Ξ£-flip ii = Ξ£-cong (Ξ» Ξ± β Ξ£-cong (Ξ» X β β-Sym'' (univalence-gives-funext ua))) iii = Ξ£-cong (Ξ» Ξ± β singleton-β-π (univalence-via-singletonsβ ua (β n κ β , Ξ± n οΌ β))) iv = π-rneutral π’ : π€β Μ π’ = Ξ£ X κ π€β Μ , is-semidecidable X \end{code} The type π’ of semidecidable propositions is not a Ο-frame unless we have enough countable choice - see the Escardo-Knapp reference above. The set of quasidecidable propositions, if it exists, is the smallest collection of propositions containing π and π and closed under countable joins. Exercise. It exists under propositional resizing assumptions (just take the intersection of all subsets with π and π as members and closed under countable joins). This exercise is solved below in the submodule quasidecidability-construction-from-resizing. We now assume that there is a such a smallest collection of types, called quasidecidable, satisfying the above closure property. The types in this collection are automatically propositions. The minimality condition of the collection amounts to an induction principle. We recall the above convention: * π£ is the universe where the quasidecidable truth values live. Typically π£ will be π€β or π€β. * π is the universe where the knowledge they are quasidecidable lives. Typically π will be π£ or π£βΊ. \begin{code} module hypothetical-quasidecidability {π£ π : Universe} (qde : quasidecidable-propositions-exist π£ π) where \end{code} As promised, the quasidecidable types are automatically propositions, with a proof by induction: \begin{code} open quasidecidable-propositions-exist qde quasidecidable-types-are-props : β P β is-quasidecidable P β is-prop P quasidecidable-types-are-props = quasidecidable-induction is-prop (Ξ» _ β being-prop-is-prop fe) π-is-prop π-is-prop (Ξ» P Ο β β-is-prop) \end{code} We collect the quasidecidable propositions in the type π : \begin{code} π : π£ βΊ β π Μ π = Ξ£ P κ π£ Μ , is-quasidecidable P _is-true : π β π£ Μ _is-true (P , i) = P being-true-is-quasidecidable : (π‘ : π ) β is-quasidecidable (π‘ is-true) being-true-is-quasidecidable (P , i) = i being-true-is-prop : (π‘ : π ) β is-prop (π‘ is-true) being-true-is-prop (P , i) = quasidecidable-types-are-props P i π βΞ© : π β Ξ© π£ π βΞ© (P , i) = P , quasidecidable-types-are-props P i π βΞ©-is-embedding : is-embedding π βΞ© π βΞ©-is-embedding = NatΞ£-is-embedding is-quasidecidable is-prop ΞΆ ΞΆ-is-embedding where ΞΆ : (P : π£ Μ ) β is-quasidecidable P β is-prop P ΞΆ = quasidecidable-types-are-props ΞΆ-is-embedding : (P : π£ Μ ) β is-embedding (ΞΆ P) ΞΆ-is-embedding P = maps-of-props-are-embeddings (ΞΆ P) (being-quasidecidable-is-prop P) (being-prop-is-prop fe) π -is-set : is-set π π -is-set = subtypes-of-sets-are-sets π βΞ© π βΞ©-is-embedding (Ξ©-is-set fe pe) β₯ : π β₯ = π , π-is-quasidecidable β€ : π β€ = π , π-is-quasidecidable β : (β β π ) β π β π‘ = (β n κ β , π‘ n is-true) , quasidecidable-closed-under-Ο-joins (Ξ» n β π‘ n is-true) (Ξ» n β being-true-is-quasidecidable (π‘ n)) \end{code} We formulate and prove induction on π in two different, equivalent ways. \begin{code} π -induction : (G : π β π€ Μ ) β ((π‘ : π ) β is-prop (G π‘)) β G β₯ β G β€ β ((π‘ : β β π ) β ((n : β) β G (π‘ n)) β G (β π‘)) β (π‘ : π ) β G π‘ π -induction {π€} G G-is-prop-valued gβ gβ gΟ (P , i) = Ξ³ where F : π£ Μ β π β π€ Μ F P = Ξ£ j κ is-quasidecidable P , G (P , j) F-is-prop-valued : β P β is-prop (F P) F-is-prop-valued P = Ξ£-is-prop (being-quasidecidable-is-prop P) (Ξ» j β G-is-prop-valued (P , j)) Fβ : F π Fβ = π-is-quasidecidable , gβ Fβ : F π Fβ = π-is-quasidecidable , gβ FΟ : (Q : β β π£ Μ ) β ((n : β) β F (Q n)) β F (β n κ β , Q n) FΟ Q Ο = quasidecidable-closed-under-Ο-joins Q (Ξ» n β prβ (Ο n)) , gΟ (Ξ» n β (Q n , prβ (Ο n))) (Ξ» n β prβ (Ο n)) Ξ΄ : Ξ£ j κ is-quasidecidable P , G (P , j) Ξ΄ = quasidecidable-induction F F-is-prop-valued Fβ Fβ FΟ P i j : is-quasidecidable P j = prβ Ξ΄ g : G (P , j) g = prβ Ξ΄ r : j οΌ i r = being-quasidecidable-is-prop P j i Ξ³ : G (P , i) Ξ³ = transport (Ξ» - β G (P , -)) r g π -induction' : (π : π β Ξ© π€) β β₯ β π β β€ β π β ((π‘ : β β π ) β ((n : β) β π‘ n β π) β β π‘ β π) β (π‘ : π ) β π‘ β π π -induction' {π€} π = π -induction (Ξ» π‘ β prβ (π π‘)) (Ξ» π‘ β prβ (π π‘)) \end{code} The quasidecidable propositions form a dominance, with a proof by quasidecidable-induction. The main dominance condition generalizes closure under binary products (that is, conjunctions, or meets): \begin{code} quasidecidable-closed-under-Γ : (P : π£ Μ ) β is-quasidecidable P β (Q : π£ Μ ) β (P β is-quasidecidable Q) β is-quasidecidable (P Γ Q) quasidecidable-closed-under-Γ = quasidecidable-induction F F-is-prop-valued Fβ Fβ FΟ where F : π£ Μ β π£ βΊ β π Μ F P = (Q : π£ Μ ) β (P β is-quasidecidable Q) β is-quasidecidable (P Γ Q) F-is-prop-valued : (P : π£ Μ ) β is-prop (F P) F-is-prop-valued P = Ξ β-is-prop fe (Ξ» Q _ β being-quasidecidable-is-prop (P Γ Q)) Fβ : F π Fβ Q Ο = transport is-quasidecidable r π-is-quasidecidable where r : π οΌ π Γ Q r = pe π-is-prop (Ξ» (z , q) β π-elim z) unique-from-π prβ Fβ : F π Fβ Q Ο = transport is-quasidecidable r (Ο β) where i : is-prop Q i = quasidecidable-types-are-props Q (Ο β) r : Q οΌ π Γ Q r = pe i (Γ-is-prop π-is-prop i) (Ξ» q β (β , q)) prβ FΟ : (P : β β π£ Μ ) β ((n : β) β F (P n)) β F (β n κ β , P n) FΟ P f Q Ο = Ξ³ where Ο' : (n : β) β P n β is-quasidecidable Q Ο' n p = Ο β£ n , p β£ a : (n : β) β is-quasidecidable (P n Γ Q) a n = f n Q (Ο' n) b : is-quasidecidable (β n κ β , P n Γ Q) b = quasidecidable-closed-under-Ο-joins (Ξ» n β P n Γ Q) a c : (β n κ β , P n Γ Q) β ((β n κ β , P n) Γ Q) c s = (t , q) where t : β n κ β , P n t = β₯β₯-rec β-is-prop (Ξ» (n , (p , q)) β β£ n , p β£) s i : is-prop Q i = quasidecidable-types-are-props Q (Ο t) q : Q q = β₯β₯-rec i (Ξ» (n , (p , q)) β q) s d : ((β n κ β , P n) Γ Q) β (β n κ β , P n Γ Q) d (t , q) = β₯β₯-functor (Ξ» (n , p) β n , (p , q)) t r : (β n κ β , P n Γ Q) οΌ ((β n κ β , P n) Γ Q) r = pe β-is-prop (Γ-prop-criterion ((Ξ» _ β β-is-prop) , (Ξ» e β quasidecidable-types-are-props Q (Ο e)))) c d Ξ³ : is-quasidecidable ((β n κ β , P n) Γ Q) Ξ³ = transport is-quasidecidable r b \end{code} This condition automatically implies closure under Ξ£, or joins indexed by quasidecidable propositions: \begin{code} quasidecidable-closed-under-Ξ£ : (P : π£ Μ ) β (Q : P β π£ Μ ) β is-quasidecidable P β ((p : P) β is-quasidecidable (Q p)) β is-quasidecidable (Ξ£ Q) quasidecidable-closed-under-Ξ£ = D3-and-D5'-give-D5 pe is-quasidecidable (quasidecidable-types-are-props) (Ξ» P Q' i β quasidecidable-closed-under-Γ P i Q') \end{code} Notice that Ξ£ Q is equivalent to β Q as quasidecidable types are propositions, and propositions are closed under Ξ£: \begin{code} NB : (P : π£ Μ ) β (Q : P β π£ Μ ) β is-quasidecidable P β ((p : P) β is-quasidecidable (Q p)) β Ξ£ Q β β Q NB P Q i j = logically-equivalent-props-are-equivalent k β-is-prop (Ξ» (p , q) β β£ p , q β£) (β₯β₯-rec k id) where k : is-prop (Ξ£ Q) k = quasidecidable-types-are-props (Ξ£ Q) (quasidecidable-closed-under-Ξ£ P Q i j) \end{code} The following summarizes the dominance conditions: \begin{code} quasidecidability-is-dominance : is-dominance is-quasidecidable quasidecidability-is-dominance = being-quasidecidable-is-prop , quasidecidable-types-are-props , π-is-quasidecidable , quasidecidable-closed-under-Ξ£ \end{code} We now give the quasidecidable propositions the structure of a Ο-sup-lattice. We have already defined β₯, β€ and β. \begin{code} _β€_ : π β π β π£ Μ π‘ β€ π’ = π‘ is-true β π’ is-true β€-is-prop-valued : (π‘ π’ : π ) β is-prop (π‘ β€ π’) β€-is-prop-valued π‘ π’ = Ξ -is-prop fe (Ξ» _ β being-true-is-prop π’) β€-refl : (π‘ : π ) β π‘ β€ π‘ β€-refl π‘ = id β€-trans : (π‘ π’ π£ : π ) β π‘ β€ π’ β π’ β€ π£ β π‘ β€ π£ β€-trans π‘ π’ π£ l m = m β l β€-antisym : (π‘ π’ : π ) β π‘ β€ π’ β π’ β€ π‘ β π‘ οΌ π’ β€-antisym π‘ π’ l m = to-subtype-οΌ being-quasidecidable-is-prop (pe (being-true-is-prop π‘) (being-true-is-prop π’) l m) β₯-is-minimum : (π‘ : π ) β β₯ β€ π‘ β₯-is-minimum π‘ = unique-from-π β€-is-maximum : (π‘ : π ) β π‘ β€ β€ β€-is-maximum π‘ = unique-to-π β-is-ub : (π‘ : β β π ) β (n : β) β π‘ n β€ β π‘ β-is-ub π‘ n = (Ξ» p β β£ n , p β£) β-is-lb-of-ubs : (π‘ : β β π ) β (π¦ : π ) β ((n : β) β π‘ n β€ π¦) β β π‘ β€ π¦ β-is-lb-of-ubs π‘ (U , i) Ο = Ξ³ where Ξ΄ : (Ξ£ n κ β , π‘ n is-true) β U Ξ΄ (n , p) = Ο n p Ξ³ : (β n κ β , π‘ n is-true) β U Ξ³ = β₯β₯-rec (quasidecidable-types-are-props U i) Ξ΄ \end{code} Putting these axioms together we get the Ο-sup-lattice of quasidecidable propositions: \begin{code} open import OrderedTypes.sigma-sup-lattice fe QD : Ο-SupLat (π£ βΊ β π) π£ QD = π , (β₯ , β) , _β€_ , β€-is-prop-valued , β€-refl , β€-trans , β€-antisym , β₯-is-minimum , β-is-ub , β-is-lb-of-ubs \end{code} We now show that QD is the free Ο-sup-lattice on one generator. For this purpose, we assume that we are give a Ο-sup-lattice π with a distinguished element t. \begin{code} module _ {π€ π₯ : Universe} (π : Ο-SupLat π€ π₯) (t : β¨ π β©) where \end{code} We introduce some abbreviations, private to this anonymous module, for notational convenience: \begin{code} private A = β¨ π β© β₯' = β₯β¨ π β© β' = ββ¨ π β© _β€'_ : A β A β π₯ Μ a β€' b = a β€β¨ π β© b \end{code} And then again by π -induction, there is at most one homomorphism from π to π: \begin{code} at-most-one-hom : (g h : π β A) β is-Ο-suplat-hom QD π g β is-Ο-suplat-hom QD π h β g β€ οΌ t β h β€ οΌ t β g οΌ h at-most-one-hom g h (gβ₯ , gβ) (hβ₯ , hβ) gβ€ hβ€ = dfunext fe r where iβ = g β₯ οΌβ¨ gβ₯ β© β₯' οΌβ¨ hβ₯ β»ΒΉ β© h β₯ β iβ = g β€ οΌβ¨ gβ€ β© t οΌβ¨ hβ€ β»ΒΉ β© h β€ β iΟ : (π‘ : β β π ) β ((n : β) β g (π‘ n) οΌ h (π‘ n)) β g (β π‘) οΌ h (β π‘) iΟ π‘ Ο = g (β π‘) οΌβ¨ gβ π‘ β© β' (n β¦ g (π‘ n)) οΌβ¨ ap β' (dfunext fe Ο) β© β' (n β¦ h (π‘ n)) οΌβ¨ (hβ π‘)β»ΒΉ β© h (β π‘) β r : g βΌ h r = π -induction (Ξ» π‘ β g π‘ οΌ h π‘) (Ξ» π‘ β β¨ π β©-is-set {g π‘} {h π‘}) iβ iβ iΟ \end{code} The condition in the conclusion of the following lemma says that the element a : A is the least upper bound of the (weakly) constant family Ξ» (p : P) β β€'. Because least upper bounds are unique when they exist, the type in the conclusion of the lemma is a proposition. This is crucial because the induction principle can be applied to prop-valued predicates only. \begin{code} freeness-lemma : (P : π£ Μ ) β is-quasidecidable P β Ξ£ a κ A , (P β t β€' a) Γ ((u : A) β (P β t β€' u) β a β€' u) freeness-lemma = quasidecidable-induction F F-is-prop-valued Fβ Fβ FΟ where F : π£ Μ β π£ β π€ β π₯ Μ F P = Ξ£ a κ A , (P β t β€' a) Γ ((u : A) β (P β t β€' u) β a β€' u) F-is-prop-valued : (P : π£ Μ ) β is-prop (F P) F-is-prop-valued P (a , Ξ± , Ξ²) (a' , Ξ±' , Ξ²') = Ξ³ where j : (a : A) β is-prop ((P β t β€' a) Γ ((u : A) β (P β t β€' u) β a β€' u)) j a = Γ-is-prop (Ξ -is-prop fe (Ξ» _ β β¨ π β©-order-is-prop-valued t a)) (Ξ β-is-prop fe (Ξ» u _ β β¨ π β©-order-is-prop-valued a u)) r : a οΌ a' r = β¨ π β©-antisym a a' (Ξ² a' Ξ±') (Ξ²' a Ξ±) Ξ³ : (a , Ξ± , Ξ²) οΌ (a' , Ξ±' , Ξ²') Ξ³ = to-subtype-οΌ j r Fβ : F π Fβ = β₯' , unique-from-π , (Ξ» u Ο β β¨ π β©-β₯-is-minimum u) Fβ : F π Fβ = t , (Ξ» _ β β¨ π β©-refl t) , (Ξ» u Ο β Ο β) FΟ : (P : β β π£ Μ ) β ((n : β) β F (P n)) β F (β n κ β , P n) FΟ P Ο = aβ , Ξ±β , Ξ²β where a : β β A a n = prβ (Ο n) Ξ± : (n : β) β P n β t β€' a n Ξ± n = prβ (prβ (Ο n)) Ξ² : (n : β) (u : A) β (P n β t β€' u) β a n β€' u Ξ² n = prβ (prβ (Ο n)) aβ : A aβ = β' a Ξ±β : (β n κ β , P n) β t β€' aβ Ξ±β = β₯β₯-rec (β¨ π β©-order-is-prop-valued t aβ) Ξ±β' where Ξ±β' : (Ξ£ n κ β , P n) β t β€' aβ Ξ±β' (n , p) = β¨ π β©-trans t (a n) aβ (Ξ± n p) (β¨ π β©-β-is-ub a n) Ξ²β : (u : A) β ((β n κ β , P n) β t β€' u) β aβ β€' u Ξ²β u Ο = β¨ π β©-β-is-lb-of-ubs a u l where l : (n : β) β a n β€' u l n = Ξ² n u (Ξ» p β Ο β£ n , p β£) \end{code} We now have enough constructions and lemmas to show that the type of quasidecidable propositions is the free Ο-sup-lattice on one generator. It remains to show that the function π β A induced by the initiality lemma is a Ο-sup-lattice homomorphism. \begin{code} QD-is-free-Ο-SupLat : β! f κ (β¨ QD β© β β¨ π β©) , is-Ο-suplat-hom QD π f Γ (f β€ οΌ t) QD-is-free-Ο-SupLat = Ξ³ where f : π β A f (P , i) = prβ (freeness-lemma P i) Ξ± : (π‘ : π ) β π‘ is-true β t β€' f π‘ Ξ± (P , i) = prβ (prβ (freeness-lemma P i)) Ξ² : (π‘ : π ) β ((u : A) β (π‘ is-true β t β€' u) β f π‘ β€' u) Ξ² (P , i) = prβ (prβ (freeness-lemma P i)) \end{code} The conditions Ξ± and Ξ² on f are crucial to prove that f is indeed a homomorphism, and are all we need for that purpose. \begin{code} fβ€ : f β€ οΌ t fβ€ = β¨ π β©-antisym (f β€) t (Ξ² β€ t (Ξ» _ β β¨ π β©-refl t)) (Ξ± β€ β) fβ₯ : f β₯ οΌ β₯' fβ₯ = β¨ π β©-antisym (f β₯) β₯' (Ξ² β₯ β₯' unique-from-π) (β¨ π β©-β₯-is-minimum (f β₯)) f-is-monotone : (π‘ π’ : π ) β π‘ β€ π’ β f π‘ β€' f π’ f-is-monotone π‘ π’ l = Ξ² π‘ (f π’) (Ξ» p β Ξ± π’ (l p)) fβ : (π‘ : β β π ) β f (β π‘) οΌ β' (n β¦ f (π‘ n)) fβ π‘ = β¨ π β©-antisym (f (β π‘)) (β' (n β¦ f (π‘ n))) v w where Ο' : (Ξ£ n κ β , π‘ n is-true) β t β€' β' (n β¦ f (π‘ n)) Ο' (n , p) = β¨ π β©-trans t (f (π‘ n)) (β' (n β¦ f (π‘ n))) r s where r : t β€' f (π‘ n) r = Ξ± (π‘ n) p s : f (π‘ n) β€' β' (n β¦ f (π‘ n)) s = β¨ π β©-β-is-ub (n β¦ f (π‘ n)) n Ο : (β n κ β , π‘ n is-true) β t β€' β' (n β¦ f (π‘ n)) Ο = β₯β₯-rec (β¨ π β©-order-is-prop-valued _ _) Ο' v : f (β π‘) β€' β' (n β¦ f (π‘ n)) v = Ξ² (β π‘) (β' (n β¦ f (π‘ n))) Ο l : (n : β) β π‘ n β€ β π‘ l = β-is-ub π‘ m : (n : β) β f (π‘ n) β€' f (β π‘) m n = f-is-monotone (π‘ n) (β π‘) (l n) w : β' (n β¦ f (π‘ n)) β€' f (β π‘) w = β¨ π β©-β-is-lb-of-ubs (n β¦ f (π‘ n)) (f (β π‘)) m \end{code} And then we are done: \begin{code} f-is-hom : is-Ο-suplat-hom QD π f f-is-hom = fβ₯ , fβ Ξ³ : β! f κ (β¨ QD β© β A) , is-Ο-suplat-hom QD π f Γ (f β€ οΌ t) Ξ³ = (f , f-is-hom , fβ€) , (Ξ» (g , g-is-hom , gβ€) β to-subtype-οΌ (Ξ» f β Γ-is-prop (being-Ο-suplat-hom-is-prop QD π f) β¨ π β©-is-set) (at-most-one-hom f g f-is-hom g-is-hom fβ€ gβ€)) \end{code} This concludes the module hypothetical-quasidecidability. We discussed above the specification of the notion of quasidecidable proposition. But can we define or construct it? Yes if, for example, propositional resizing is available: \begin{code} module quasidecidability-construction-from-resizing (π£ π : Universe) (Ο : Propositional-Resizing) where open import UF.Powerset-Resizing fe Ο \end{code} This assumption says that any proposition in the universe π€ is equivalent to some proposition in the universe π₯, for any two universes π€ and π₯. The crucial fact exploited here is that intersections of collections of subcollections π : π (π X) exist under propositional resizing. To define the type of quasi-decidable propositions, we take the intersection of the collections of types satisfying the following closure condition: \begin{code} QD-closed-types : (π€ Μ β Ξ© π₯) β Ξ© (π€ βΊ β π₯) QD-closed-types {π€} {π₯} A = closure-condition , i where closure-condition : π€ βΊ β π₯ Μ closure-condition = (π β A) Γ (π β A) Γ ((P : β β π€ Μ ) β ((n : β) β P n β A) β (β n κ β , P n) β A) i : is-prop closure-condition i = Γβ-is-prop (β-is-prop A π) (β-is-prop A π) (Ξ β-is-prop fe (Ξ» P _ β β-is-prop A (β n κ β , P n))) is-quasidecidable : π£ Μ β π Μ is-quasidecidable P = P β β QD-closed-types being-quasidecidable-is-prop : β P β is-prop (is-quasidecidable P) being-quasidecidable-is-prop = β-is-prop (β QD-closed-types) π-is-quasidecidable : is-quasidecidable π π-is-quasidecidable = to-β QD-closed-types π (Ξ» A (cβ , cβ , cΟ) β cβ) π-is-quasidecidable : is-quasidecidable π π-is-quasidecidable = to-β QD-closed-types π (Ξ» A (cβ , cβ , cΟ) β cβ) quasidecidable-closed-under-Ο-joins : (P : β β π£ Μ ) β ((n : β) β is-quasidecidable (P n)) β is-quasidecidable (β n κ β , P n) quasidecidable-closed-under-Ο-joins P Ο = to-β QD-closed-types (β P) vi where i : (n : β) β P n β β QD-closed-types i = Ο ii : (n : β) (A : π£ Μ β Ξ© π) β A β QD-closed-types β P n β A ii n = from-β QD-closed-types (P n) (i n) iii : (A : π£ Μ β Ξ© π) β A β QD-closed-types β β P β A iii A (cβ , cβ , cΟ) = cΟ P (Ξ» n β ii n A (cβ , cβ , cΟ)) iv : β P β β QD-closed-types iv = to-β QD-closed-types (β P) iii vi : (A : π£ Μ β Ξ© π) β A β QD-closed-types β β P β A vi = from-β QD-closed-types (β P) iv \end{code} The full induction principle requires a further application of resizing. We first prove a particular case and then reduce the general case to this particular case. \begin{code} quasidecidable-inductionβ : (F : π£ Μ β π Μ ) β ((P : π£ Μ ) β is-prop (F P)) β F π β F π β ((P : β β π£ Μ ) β ((n : β) β F (P n)) β F (β n κ β , P n)) β (P : π£ Μ ) β is-quasidecidable P β F P quasidecidable-inductionβ F F-is-prop-valued Fβ Fβ FΟ P P-is-quasidecidable = Ξ³ where A : (P : π£ Μ ) β Ξ© π A P = F P , F-is-prop-valued P A-is-QD-closed : A β QD-closed-types A-is-QD-closed = Fβ , Fβ , FΟ pqd : P β β QD-closed-types pqd = P-is-quasidecidable Ξ΄ : P β A Ξ΄ = from-β QD-closed-types P pqd A A-is-QD-closed Ξ³ : F P Ξ³ = Ξ΄ \end{code} To get the full induction principle we apply the above particular case with back and forth resizing coercions. The point is that now F has values in any universe π€ rather than the universe π as above. \begin{code} quasidecidable-induction : (F : π£ Μ β π€ Μ ) β ((P : π£ Μ ) β is-prop (F P)) β F π β F π β ((P : β β π£ Μ ) β ((n : β) β F (P n)) β F (β n κ β , P n)) β (P : π£ Μ ) β is-quasidecidable P β F P quasidecidable-induction {π€} F F-is-prop-valued Fβ Fβ FΟ P P-is-quasidecidable = Ξ³ where i = F-is-prop-valued F' : π£ Μ β π Μ F' P = resize Ο (F P) (i P) i' : (P : π£ Μ ) β is-prop (F' P) i' P = resize-is-prop Ο (F P) (i P) Ξ΄ : F' P Ξ΄ = quasidecidable-inductionβ F' i' (to-resize Ο (F π) (i π) Fβ) (to-resize Ο (F π) (i π) Fβ) (Ξ» P Q β to-resize Ο (F (β P)) (i (β P)) (FΟ P (Ξ» n β from-resize Ο (F (P n)) (i (P n)) (Q n)))) P P-is-quasidecidable Ξ³ : F P Ξ³ = from-resize Ο (F P) (i P) Ξ΄ \end{code} Hence the free Ο-sup-lattice on one generator exists under propositional resizing: we simply plug the construction of the quasidecidable propositions to the above hypothetical development. \begin{code} open OrderedTypes.sigma-sup-lattice fe free-Ο-suplat-on-one-generator-exists : Ξ£ π κ Ο-SupLat (π£ βΊ β π) π£ , Ξ£ t κ β¨ π β© , ((π : Ο-SupLat π€ π₯) (u : β¨ π β©) β β! f κ (β¨ π β© β β¨ π β©) , is-Ο-suplat-hom π π f Γ (f t οΌ u)) free-Ο-suplat-on-one-generator-exists {π€} {π₯} = QD , β€ , QD-is-free-Ο-SupLat where open hypothetical-quasidecidability (quasidecidable-propositions is-quasidecidable being-quasidecidable-is-prop π-is-quasidecidable π-is-quasidecidable quasidecidable-closed-under-Ο-joins quasidecidable-induction) \end{code} This concludes the module quasidecidability-construction-from-resizing. The initial Ο-frame can also be constructed as a higher-inductive type, as is well known. The initial Ο-sup-lattice is automatically the initial Ο-frame. This is shown below. TODO. Write in Agda some of the proofs of the above reference with Cory Knapp, particularly regarding choice. E.g. the semidecidable properties form a dominance if and only if a certain particular case of countable choice holds. TODO. This certain particular case of countable choice holds if and only if the quasidecidable propositions are semidecidable. This is not in the paper, but the methods of proof of the paper should apply more or less directly. To think about. Can we construct the collection of quasidecidable propositions without resizing and without higher-inductive types other than propositional truncation? We now explore the consequences of the hypothetical existence of an free Ο-sup-lattice on one generator β€. \begin{code} module hypothetical-free-Ο-SupLat-on-one-generator where open import OrderedTypes.sigma-sup-lattice fe module assumption {π£ π : Universe} (π : Ο-SupLat π£ π) (β€ : β¨ π β©) (π-free : {π₯ π¦ : Universe} (π : Ο-SupLat π₯ π¦) (t : β¨ π β©) β β! f κ (β¨ π β© β β¨ π β©) , is-Ο-suplat-hom π π f Γ (f β€ οΌ t)) where \end{code} We first introduce some abbreviations: \begin{code} private A = β¨ π β© β₯ = β₯β¨ π β© β = ββ¨ π β© _β€_ : A β A β π Μ a β€ b = a β€β¨ π β© b Ο-rec : (π : Ο-SupLat π₯ π¦) (t : β¨ π β©) β β¨ π β© β β¨ π β© Ο-rec π t = prβ (center (π-free π t)) Ο-rec-is-hom : (π : Ο-SupLat π₯ π¦) (t : β¨ π β©) β is-Ο-suplat-hom π π (Ο-rec π t) Ο-rec-is-hom π t = prβ (prβ (center (π-free π t))) Ο-rec-β₯ : (π : Ο-SupLat π₯ π¦) (t : β¨ π β©) β Ο-rec π t β₯ οΌ β₯β¨ π β© Ο-rec-β₯ π t = Ο-suplat-hom-β₯ π π (Ο-rec π t) (Ο-rec-is-hom π t) Ο-rec-β : (π : Ο-SupLat π₯ π¦) (t : β¨ π β©) (a : β β A) β Ο-rec π t (β a) οΌ ββ¨ π β© (n β¦ Ο-rec π t (a n)) Ο-rec-β π t = Ο-suplat-hom-β π π (Ο-rec π t) (Ο-rec-is-hom π t) Ο-rec-β€ : (π : Ο-SupLat π₯ π¦) (t : β¨ π β©) β Ο-rec π t β€ οΌ t Ο-rec-β€ π t = prβ (prβ (center (π-free π t))) Ο-rec-is-unique : (π : Ο-SupLat π₯ π¦) (t : β¨ π β©) (f : A β β¨ π β©) β is-Ο-suplat-hom π π f β f β€ οΌ t β Ο-rec π t οΌ f Ο-rec-is-unique π t f i p = ap prβ (centrality (π-free π t) (f , i , p)) at-most-one-hom : (π : Ο-SupLat π₯ π¦) (t : β¨ π β©) (f g : A β β¨ π β©) β is-Ο-suplat-hom π π f β is-Ο-suplat-hom π π g β f β€ οΌ t β g β€ οΌ t β f οΌ g at-most-one-hom π t f g i j p q = ap prβ (singletons-are-props (π-free π t) (f , i , p) (g , j , q)) \end{code} We now establish the induction principle for the free Ο-sup-lattice on one generator by constructing a Ο-sup-lattice from the property we want to prove. \begin{code} Ο-induction : (P : A β π₯ Μ ) β ((a : A) β is-prop (P a)) β P β€ β P β₯ β ((a : (β β A)) β ((n : β) β P (a n)) β P (β a)) β (a : A) β P a Ο-induction {π₯} P P-is-prop-valued β€-closure β₯-closure β-closure = Ξ³ where X = Ξ£ a κ A , P a β€' β₯' : X β€' = (β€ , β€-closure) β₯' = (β₯ , β₯-closure) β' : (β β X) β X β' x = (β (prβ β x) , β-closure (prβ β x) (prβ β x)) _β€'_ : X β X β π Μ (a , _) β€' (b , _) = a β€ b π : Ο-SupLat (π£ β π₯) π π = X , (β₯' , β') , _β€'_ , (Ξ» (a , _) (b , _) β β¨ π β©-order-is-prop-valued a b) , (Ξ» (a , _) β β¨ π β©-refl a) , (Ξ» (a , _) (b , _) (c , _) β β¨ π β©-trans a b c) , (Ξ» (a , _) (b , _) l m β to-subtype-οΌ P-is-prop-valued (β¨ π β©-antisym a b l m)) , (Ξ» (a , _) β β¨ π β©-β₯-is-minimum a) , (Ξ» x n β β¨ π β©-β-is-ub (prβ β x) n) , (Ξ» x (u , _) Ο β β¨ π β©-β-is-lb-of-ubs (prβ β x) u Ο) g : X β A g = prβ g-is-hom : is-Ο-suplat-hom π π g g-is-hom = refl , (Ξ» π β refl) h : A β A h = g β Ο-rec π β€' hβ€ : h β€ οΌ β€ hβ€ = ap g (Ο-rec-β€ π β€') h-is-hom : is-Ο-suplat-hom π π h h-is-hom = β-Ο-suplat-hom π π π (Ο-rec π β€') g (Ο-rec-is-hom π β€') g-is-hom H : h οΌ id H = at-most-one-hom π β€ h id h-is-hom (id-is-Ο-suplat-hom π) hβ€ refl Ξ΄ : (a : A) β P (h a) Ξ΄ a = prβ (Ο-rec π β€' a) Ξ³ : (a : A) β P a Ξ³ a = transport P (happly H a) (Ξ΄ a) \end{code} For example, we see that the generator β€ is the maximum element by Ο-induction: \begin{code} β€-is-maximum : (a : A) β a β€ β€ β€-is-maximum = Ο-induction (_β€ β€) (Ξ» a β β¨ π β©-order-is-prop-valued a β€) (β¨ π β©-refl β€) (β¨ π β©-β₯-is-minimum β€) (Ξ» a β β¨ π β©-β-is-lb-of-ubs a β€) \end{code} We use the following little lemma a couple of times: \begin{code} β-β€ : (a : β β A) (n : β) β a n οΌ β€ β β a οΌ β€ β-β€ a n p = β¨ π β©-antisym (β a) β€ (β€-is-maximum (β a)) (β¨ π β©-trans β€ (a n) (β a) (β¨ π β©-οΌ-gives-β€ (p β»ΒΉ)) (β¨ π β©-β-is-ub a n)) \end{code} We now characterize Ο-rec as a least upper bound, or join. We first define joins and their basic properties: \begin{code} join-of : (π : Ο-SupLat π₯ π¦) {I : π¦' Μ } β (I β β¨ π β©) β β¨ π β© β π₯ β π¦ β π¦' Μ join-of π f x = (β i β f i β€β¨ π β© x) Γ ((u : β¨ π β©) β (β i β f i β€β¨ π β© u) β x β€β¨ π β© u) syntax join-of π f x = x is-the-join-of f on π being-join-is-prop : (π : Ο-SupLat π₯ π¦) {I : π¦' Μ } (x : β¨ π β©) (f : I β β¨ π β©) β is-prop (x is-the-join-of f on π) being-join-is-prop π x f = Γ-is-prop (Ξ -is-prop fe (Ξ» i β β¨ π β©-order-is-prop-valued (f i) x)) (Ξ β-is-prop fe (Ξ» u _ β β¨ π β©-order-is-prop-valued x u)) at-most-one-join : (π : Ο-SupLat π₯ π¦) {I : π¦' Μ } (x x' : β¨ π β©) (f : I β β¨ π β©) β x is-the-join-of f on π β x' is-the-join-of f on π β x οΌ x' at-most-one-join π x x' f (Ξ± , Ξ²) (Ξ±' , Ξ²') = β¨ π β©-antisym x x' (Ξ² x' Ξ±') (Ξ²' x Ξ±) \end{code} We have that the following characterization of (Ο-rec π t a) as the least upper bound of the weakly constant family Ξ» (_ : a οΌ β€) β t: \begin{code} Ο-rec-is-join : (π : Ο-SupLat π₯ π¦) (t : β¨ π β©) (a : A) β (Ο-rec π t a) is-the-join-of (Ξ» (_ : a οΌ β€) β t) on π Ο-rec-is-join π t a = Ξ± , Ξ² where h : A β β¨ π β© h = Ο-rec π t Ξ± : a οΌ β€ β t β€β¨ π β© h a Ξ± p = β¨ π β©-οΌ-gives-β€ (t οΌβ¨ (Ο-rec-β€ π t)β»ΒΉ β© h β€ οΌβ¨ ap (h) (p β»ΒΉ) β© h a β) Ξ² : (u : β¨ π β©) β (a οΌ β€ β t β€β¨ π β© u) β h a β€β¨ π β© u Ξ² = Ο-induction (Ξ» a β (u : β¨ π β©) β (a οΌ β€ β t β€β¨ π β© u) β h a β€β¨ π β© u) (Ξ» a β Ξ β-is-prop fe (Ξ» u p β β¨ π β©-order-is-prop-valued (h a) u)) Ξ²β€ Ξ²β₯ Ξ²β a where Ξ²β€ : (u : β¨ π β©) β (β€ οΌ β€ β t β€β¨ π β© u) β h β€ β€β¨ π β© u Ξ²β€ u Ο = transport (Ξ» - β - β€β¨ π β© u) ((Ο-rec-β€ π t )β»ΒΉ) (Ο refl) Ξ²β₯ : (u : β¨ π β©) β (β₯ οΌ β€ β t β€β¨ π β© u) β h β₯ β€β¨ π β© u Ξ²β₯ u Ο = transport (Ξ» - β - β€β¨ π β© u) ((Ο-rec-β₯ π t)β»ΒΉ) (β¨ π β©-β₯-is-minimum u) Ξ²β : (c : β β A) β ((n : β) (u : β¨ π β©) β (c n οΌ β€ β t β€β¨ π β© u) β h (c n) β€β¨ π β© u) β (u : β¨ π β©) β (β c οΌ β€ β t β€β¨ π β© u) β h (β c) β€β¨ π β© u Ξ²β c Ο u Ο = transport (Ξ» - β - β€β¨ π β© u) ((Ο-rec-β π t c)β»ΒΉ) Ξ³ where Ξ³ : ββ¨ π β© (h β c) β€β¨ π β© u Ξ³ = β¨ π β©-β-is-lb-of-ubs (h β c) u (Ξ» n β Ο n u (Ξ» (p : c n οΌ β€) β Ο (β-β€ c n p))) Ο-rec-is-ub : (π : Ο-SupLat π₯ π¦) (t : β¨ π β©) (a : A) β a οΌ β€ β t β€β¨ π β© Ο-rec π t a Ο-rec-is-ub π t a = prβ (Ο-rec-is-join π t a) Ο-rec-is-lb-of-ubs : (π : Ο-SupLat π₯ π¦) (t : β¨ π β©) (a : A) β (u : β¨ π β©) β (a οΌ β€ β t β€β¨ π β© u) β Ο-rec π t a β€β¨ π β© u Ο-rec-is-lb-of-ubs π t a = prβ (Ο-rec-is-join π t a) \end{code} Such joins are absolute, in the sense that they are preserved by all homomorphisms: \begin{code} Ο-suplat-homs-preserve-Ο-rec : (π : Ο-SupLat π₯ π¦) (π : Ο-SupLat π£' π₯') (f : β¨ π β© β β¨ π β©) β is-Ο-suplat-hom π π f β (t : β¨ π β©) (a : A) β f (Ο-rec π t a) οΌ Ο-rec π (f t) a Ο-suplat-homs-preserve-Ο-rec π π f i t = happly Ξ³ where composite-is-hom : is-Ο-suplat-hom π π (f β Ο-rec π t) composite-is-hom = β-Ο-suplat-hom π π π (Ο-rec π t) f (Ο-rec-is-hom π t) i Ξ³ : f β Ο-rec π t οΌ Ο-rec π (f t) Ξ³ = at-most-one-hom π (f t) (f β Ο-rec π t) (Ο-rec π (f t)) composite-is-hom (Ο-rec-is-hom π (f t)) (ap f (Ο-rec-β€ π t)) (Ο-rec-β€ π (f t)) \end{code} In particular, Ο-rec preserves Ο-rec: \begin{code} Ο-rec-preserves-Ο-rec : (π : Ο-SupLat π₯ π¦) (t : β¨ π β©) (a b : A) β Ο-rec π t (Ο-rec π a b) οΌ Ο-rec π (Ο-rec π t a) b Ο-rec-preserves-Ο-rec π t a b = Ο-suplat-homs-preserve-Ο-rec π π (Ο-rec π t) (Ο-rec-is-hom π t) a b \end{code} We now derive the existence of binary meets in the initial Ο-sup-lattice π from the above kind of joins. \begin{code} _β§_ : A β A β A a β§ b = Ο-rec π a b meetβ€ : (a : A) β a β§ β€ οΌ a meetβ€ = Ο-rec-β€ π meetβ₯ : (a : A) β a β§ β₯ οΌ β₯ meetβ₯ = Ο-rec-β₯ π meetβ : (a : A) (b : β β A) β a β§ β b οΌ β (n β¦ a β§ b n) meetβ = Ο-rec-β π infix 100 _β§_ β§-associative : (a b c : A) β a β§ (b β§ c) οΌ (a β§ b) β§ c β§-associative = Ο-rec-preserves-Ο-rec π β§-is-lb-left : (a b : A) β a β§ b β€ a β§-is-lb-left a b = Ο-rec-is-lb-of-ubs π a b a (Ξ» (_ : b οΌ β€) β β¨ π β©-refl a) β§-is-lb-right : (a b : A) β a β§ b β€ b β§-is-lb-right a b = Ο-rec-is-lb-of-ubs π a b b (Ξ» (r : b οΌ β€) β transport (a β€_) (r β»ΒΉ) (β€-is-maximum a)) \end{code} Using this, we show that a β§ b is the greatest lower bound of a and b. One step needs Ο-induction: \begin{code} β§-is-ub-of-lbs : (a b c : A) β c β€ a β c β€ b β c β€ a β§ b β§-is-ub-of-lbs a b = Ο-induction (Ξ» c β c β€ a β c β€ b β c β€ a β§ b) (Ξ» c β Ξ β-is-prop fe (Ξ» _ _ β β¨ π β©-order-is-prop-valued c (a β§ b))) pβ€ pβ₯ pβ where pβ€ : β€ β€ a β β€ β€ b β β€ β€ a β§ b pβ€ l m = β¨ π β©-trans _ _ _ l ii where i : b οΌ β€ i = β¨ π β©-antisym _ _ (β€-is-maximum b) m ii : a β€ a β§ b ii = Ο-rec-is-ub π a b i pβ₯ : β₯ β€ a β β₯ β€ b β β₯ β€ a β§ b pβ₯ _ _ = β¨ π β©-β₯-is-minimum (a β§ b) pβ : (d : β β A) β ((n : β) β d n β€ a β d n β€ b β d n β€ a β§ b) β β d β€ a β β d β€ b β β d β€ (a β§ b) pβ d Ο l m = β¨ π β©-β-is-lb-of-ubs d (a β§ b) (Ξ» n β Ο n (β¨ π β©-trans (d n) _ a (β¨ π β©-β-is-ub d n) l) (β¨ π β©-trans (d n) _ b (β¨ π β©-β-is-ub d n) m)) β§-idempotent : (a : A) β a β§ a οΌ a β§-idempotent a = β¨ π β©-antisym _ _ l m where l : a β§ a β€ a l = β§-is-lb-left a a m : a β€ a β§ a m = β§-is-ub-of-lbs a a a (β¨ π β©-refl a) (β¨ π β©-refl a) β§-commutative : (a b : A) β a β§ b οΌ b β§ a β§-commutative a b = β¨ π β©-antisym _ _ (l a b) (l b a) where l : (a b : A) β a β§ b β€ b β§ a l a b = β§-is-ub-of-lbs b a (a β§ b) (β§-is-lb-right a b) (β§-is-lb-left a b) \end{code} The intrinsic order coincides with the β§-semilattice order: \begin{code} from-β€ : (a b : A) β a β€ b β a β§ b οΌ a from-β€ a b l = β¨ π β©-antisym _ _ (β§-is-lb-left a b) m where m : a β€ a β§ b m = β§-is-ub-of-lbs _ _ _ (β¨ π β©-refl a) l to-β€ : (a b : A) β a β§ b οΌ a β a β€ b to-β€ a b p = β¨ π β©-trans _ _ _ l (β§-is-lb-right a b) where l : a β€ a β§ b l = β¨ π β©-οΌ-gives-β€ (p β»ΒΉ) \end{code} We now show that the the Ο-suplat on one generator is also the initial Ο-frame. The following renaming is annoying. \begin{code} open OrderedTypes.sigma-frame fe hiding (order) renaming (β¨_β© to β¨_β©' ; β₯β¨_β© to β₯β¨_β©' ; β€β¨_β© to β€β¨_β©' ; meet to meet' ; ββ¨_β© to ββ¨_β©' ; β¨_β©-is-set to β¨_β©'-is-set ; β¨_β©-refl to β¨_β©'-refl ; β¨_β©-trans to β¨_β©'-trans ; β¨_β©-antisym to β¨_β©'-antisym ; β¨_β©-β€-maximum to β¨_β©'-β€-maximum ; β¨_β©-β₯-minimum to β¨_β©'-β₯-minimum ; β¨_β©-β-is-ub to β¨_β©'-β-is-ub ; β¨_β©-β-is-lb-of-ubs to β¨_β©'-β-is-lb-of-ubs) π-qua-Ο-frame : Ο-Frame π£ π-qua-Ο-frame = A , (β€ , _β§_ , β₯ , β) , β¨ π β©-is-set , β§-idempotent , β§-commutative , β§-associative , (Ξ» a β β§-commutative β₯ a β meetβ₯ a) , meetβ€ , meetβ , (Ξ» a n β from-β€ (a n) (β a) (β¨ π β©-β-is-ub a n)) , (Ξ» a u Ο β from-β€ (β a) u (β¨ π β©-β-is-lb-of-ubs a u (Ξ» n β to-β€ (a n) u (Ο n)))) π-qua-Ο-frame-is-initial : (π : Ο-Frame π₯) β β! f κ (A β β¨ π β©), is-Ο-frame-hom π-qua-Ο-frame π f π-qua-Ο-frame-is-initial {π₯} π = Ξ³ where B = β¨ π β© _β§'_ : B β B β B _β§'_ = meet' π π-qua-Ο-suplat : Ο-SupLat π₯ π₯ π-qua-Ο-suplat = Ο-frames-are-Ο-suplats π β€' : B β€' = β€β¨ π β©' f : A β B f = Ο-rec π-qua-Ο-suplat β€' f-is-hom : is-Ο-suplat-hom π π-qua-Ο-suplat f f-is-hom = Ο-rec-is-hom π-qua-Ο-suplat β€' f-preserves-β§ : (a b : A) β f (a β§ b) οΌ f a β§' f b f-preserves-β§ a = Ο-induction (Ξ» b β f (a β§ b) οΌ f a β§' f b) (Ξ» b β β¨ π β©'-is-set) fβ€ fβ₯ fβ where fβ€ = f (a β§ β€) οΌβ¨ I β© f a οΌβ¨ II β© f a β§' β€' οΌβ¨ III β© f a β§' f β€ β where I = ap f (meetβ€ a) II = (β¨ π β©'-β€-maximum (f a))β»ΒΉ III = ap (f a β§'_) ((Ο-rec-β€ π-qua-Ο-suplat β€')β»ΒΉ) fβ₯ = f (a β§ β₯) οΌβ¨ I β© f β₯ οΌβ¨ II β© β₯β¨ π β©' οΌβ¨ III β© β₯β¨ π β©' β§' f a οΌβ¨ IV β© f β₯ β§' f a οΌβ¨ V β© f a β§' f β₯ β where I = ap f (meetβ₯ a) II = Ο-suplat-hom-β₯ π π-qua-Ο-suplat f f-is-hom III = (β¨ π β©'-β₯-minimum (f a))β»ΒΉ IV = ap (Ξ» - β - β§' f a) ((Ο-suplat-hom-β₯ π π-qua-Ο-suplat f f-is-hom)β»ΒΉ) V = β¨ π β©-commutativity (f β₯) (f a) fβ = Ξ» c p β f (a β§ β c) οΌβ¨ I c β© f (β (n β¦ a β§ c n)) οΌβ¨ II c β© ββ¨ π β©' (n β¦ f (a β§ c n)) οΌβ¨ III c p β© ββ¨ π β©' (n β¦ f a β§' f (c n)) οΌβ¨ IV c β© f a β§' ββ¨ π β©' (Ξ» n β f (c n)) οΌβ¨ V c β© f a β§' f (β c) β where I = Ξ» c β ap f (meetβ a c) II = Ξ» c β Ο-suplat-hom-β π π-qua-Ο-suplat f f-is-hom (Ξ» n β a β§ c n) III = Ξ» c p β ap ββ¨ π β©' (dfunext fe p) IV = Ξ» c β (β¨ π β©-distributivity (f a) (Ξ» n β f (c n)))β»ΒΉ V = Ξ» c β ap (f a β§'_) ((Ο-suplat-hom-β π π-qua-Ο-suplat f f-is-hom c)β»ΒΉ) f-is-hom' : is-Ο-frame-hom π-qua-Ο-frame π f f-is-hom' = Ο-rec-β€ π-qua-Ο-suplat β€' , f-preserves-β§ , Ο-suplat-hom-β₯ π π-qua-Ο-suplat f f-is-hom , Ο-suplat-hom-β π π-qua-Ο-suplat f f-is-hom forget : (g : A β B) β is-Ο-frame-hom π-qua-Ο-frame π g β is-Ο-suplat-hom π π-qua-Ο-suplat g forget g (i , ii , iii , iv) = (iii , iv) f-uniqueness : (g : A β B) β is-Ο-frame-hom π-qua-Ο-frame π g β f οΌ g f-uniqueness g g-is-hom' = at-most-one-hom π-qua-Ο-suplat β€' f g f-is-hom (forget g g-is-hom') (Ο-rec-β€ π-qua-Ο-suplat β€') (Ο-frame-hom-β€ π-qua-Ο-frame π g g-is-hom') Ξ³ : β! f κ (A β B), is-Ο-frame-hom π-qua-Ο-frame π f Ξ³ = (f , f-is-hom') , (Ξ» (g , g-is-hom') β to-subtype-οΌ (being-Ο-frame-hom-is-prop π-qua-Ο-frame π) (f-uniqueness g g-is-hom')) \end{code} We now regard the type of propositions as a Ο-sup-lattice: \begin{code} Ξ©-qua-Ο-Frame : Ο-Frame (π£ βΊ) Ξ©-qua-Ο-Frame = OrderedTypes.sigma-frame.Ξ©-qua-Ο-frame fe pe pt Ξ©-qua-Ο-SupLat : Ο-SupLat (π£ βΊ) (π£ βΊ) Ξ©-qua-Ο-SupLat = OrderedTypes.sigma-frame.Ξ©-qua-Ο-suplat fe pe pt private β₯' = β₯β¨ Ξ©-qua-Ο-SupLat β© β€' = β€β¨ Ξ©-qua-Ο-Frame β©' β' = ββ¨ Ξ©-qua-Ο-SupLat β© _β€'_ : Ξ© π£ β Ξ© π£ β π£ βΊ Μ x β€' y = x β€β¨ Ξ©-qua-Ο-SupLat β© y οΌ-gives-β€' : (p q : Ξ© π£) β p οΌ q β p β€' q οΌ-gives-β€' p q r = β¨ Ξ©-qua-Ο-SupLat β©-οΌ-gives-β€ r \end{code} In a frame the bottom element is not taken explicitly as part of the structure and is defined to be the join of the family indexed by the empty set. In the particular case of the frame of propositions, this is equal to the empty type π, but not definitionally: \begin{code} β₯-holds-is-π : β₯' holds οΌ π β₯-holds-is-π = p where p : (β x κ π , unique-from-π x holds) οΌ π p = pe β-is-prop π-is-prop (β₯β₯-rec π-is-prop (unique-from-π β prβ)) unique-from-π Ξ©-non-trivial : β₯' β β€' Ξ©-non-trivial q = π-is-not-π r where r : π οΌ π r = (β₯-holds-is-π)β»ΒΉ β ap _holds q \end{code} The following map Ο will play an important role: \begin{code} Ο : A β Ξ© π£ Ο = Ο-rec Ξ©-qua-Ο-SupLat β€' Ο-is-hom : is-Ο-suplat-hom π Ξ©-qua-Ο-SupLat Ο Ο-is-hom = Ο-rec-is-hom Ξ©-qua-Ο-SupLat β€' \end{code} Using Ο we derive the non-triviality of π from that of Ξ©: \begin{code} π-non-trivial : β₯ β β€ π-non-trivial p = Ξ©-non-trivial q where q = β₯' οΌβ¨ (Ο-suplat-hom-β₯ π Ξ©-qua-Ο-SupLat Ο Ο-is-hom)β»ΒΉ β© Ο β₯ οΌβ¨ ap Ο p β© Ο β€ οΌβ¨ Ο-rec-β€ Ξ©-qua-Ο-SupLat β€' β© β€' β \end{code} A crucial property of the map Ο is that it reflects top elements (in point-free topological terms, this says that Ο is dense): \begin{code} Ο-reflects-β€ : (a : A) β Ο a οΌ β€' β a οΌ β€ Ο-reflects-β€ = Ο-induction (Ξ» a β Ο a οΌ β€' β a οΌ β€) (Ξ» a β Ξ -is-prop fe (Ξ» _ β β¨ π β©-is-set)) iβ€ iβ₯ iβ where iβ€ : Ο β€ οΌ β€' β β€ οΌ β€ iβ€ _ = refl iβ₯ : Ο β₯ οΌ β€' β β₯ οΌ β€ iβ₯ p = π-elim (Ξ©-non-trivial q) where q : β₯' οΌ β€' q = (Ο-suplat-hom-β₯ π Ξ©-qua-Ο-SupLat Ο Ο-is-hom)β»ΒΉ β p iβ : (a : β β A) β ((n : β) β Ο (a n) οΌ β€' β a n οΌ β€) β Ο (β a) οΌ β€' β β a οΌ β€ iβ a Ο p = β₯β₯-rec β¨ π β©-is-set iii ii where i : β' (Ο β a) οΌ β€' i = (Ο-suplat-hom-β π Ξ©-qua-Ο-SupLat Ο Ο-is-hom a)β»ΒΉ β p ii : β n κ β , Ο (a n) holds ii = equal-β€-gives-holds (β' (Ο β a)) i iii : (Ξ£ n κ β , Ο (a n) holds) β β a οΌ β€ iii (n , h) = vi where iv : Ο (a n) οΌ β€' iv = holds-gives-equal-β€ pe fe (Ο (a n)) h v : a n οΌ β€ v = Ο n iv vi : β a οΌ β€ vi = β-β€ a n v \end{code} A frame is called compact if every cover of its top element has a finite subcover. It is supercompact (I think the terminology is due to John Isbell) if every cover of the top element has a singleton subcover. This motivates the name of the following theorem, whose crucial ingredient is the homomorphism Ο and the fact that it reflects top elements. \begin{code} π-is-Ο-super-compact : (a : β β A) β β a οΌ β€ β β n κ β , a n οΌ β€ π-is-Ο-super-compact a p = vi where i = β' (Ο β a) οΌβ¨ (Ο-suplat-hom-β π Ξ©-qua-Ο-SupLat Ο Ο-is-hom a)β»ΒΉ β© Ο (β a) οΌβ¨ ap Ο p β© Ο β€ οΌβ¨ Ο-rec-β€ Ξ©-qua-Ο-SupLat β€' β© β€' β ii : (β n κ β , Ο (a n) holds) οΌ π ii = ap _holds i iii : (Ξ£ n κ β , Ο (a n) holds) β (Ξ£ n κ β , a n οΌ β€) iii (n , h) = n , v where iv : Ο (a n) οΌ β€' iv = holds-gives-equal-β€ pe fe (Ο (a n)) h v : a n οΌ β€ v = Ο-reflects-β€ (a n) iv vi : β n κ β , a n οΌ β€ vi = β₯β₯-functor iii (equal-π-gives-holds (β n κ β , Ο (a n) holds) ii) \end{code} We have that Ο a holds precisely when a οΌ β€ (hence the name Ο for the function): \begin{code} Ο-characβ : (a : A) β Ο a holds β a οΌ β€ Ο-characβ a h = Ο-reflects-β€ a (holds-gives-equal-β€ pe fe (Ο a) h) Ο-characβ : (a : A) β a οΌ β€ β Ο a holds Ο-characβ a p = equal-β€-gives-holds (Ο a) (Ο a οΌβ¨ ap Ο p β© Ο β€ οΌβ¨ Ο-rec-β€ Ξ©-qua-Ο-SupLat β€' β© β€' β) Ο-charac' : (a : A) β Ο a holds οΌ (a οΌ β€) Ο-charac' a = pe (holds-is-prop (Ο a)) β¨ π β©-is-set (Ο-characβ a) (Ο-characβ a) Ο-charac : (a : A) β Ο a οΌ ((a οΌ β€) , β¨ π β©-is-set) Ο-charac a = to-subtype-οΌ (Ξ» a β being-prop-is-prop fe) (Ο-charac' a) \end{code} The following criterion for a β€ b will be useful: \begin{code} β€-criterion : (a b : A) β (a οΌ β€ β b οΌ β€) β a β€ b β€-criterion = Ο-induction (Ξ» a β (b : A) β (a οΌ β€ β b οΌ β€) β a β€ b) (Ξ» a β Ξ β-is-prop fe (Ξ» b _ β β¨ π β©-order-is-prop-valued a b)) iβ€ iβ₯ iβ where iβ€ : (b : A) β (β€ οΌ β€ β b οΌ β€) β β€ β€ b iβ€ b f = β¨ π β©-οΌ-gives-β€ ((f refl)β»ΒΉ) iβ₯ : (b : A) β (β₯ οΌ β€ β b οΌ β€) β β₯ β€ b iβ₯ b _ = β¨ π β©-β₯-is-minimum b iβ : (a : β β A) β ((n : β) (b : A) β (a n οΌ β€ β b οΌ β€) β a n β€ b) β (b : A) β (β a οΌ β€ β b οΌ β€) β β a β€ b iβ a Ο b Ο = β¨ π β©-β-is-lb-of-ubs a b (Ξ» n β Ο n b (Ξ» (p : a n οΌ β€) β Ο (β-β€ a n p))) β€-criterion-converse : (a b : A) β a β€ b β (a οΌ β€ β b οΌ β€) β€-criterion-converse a b l p = β¨ π β©-antisym _ _ (β€-is-maximum b) (β¨ π β©-trans _ _ _ (β¨ π β©-οΌ-gives-β€ (p β»ΒΉ)) l) \end{code} The map Ο reflects order and hence is left-cancellable, and therefore is an embedding (its fibers are propositions) because it is a map into a set: \begin{code} Ο-order-lc : (a b : A) β Ο a β€' Ο b β a β€ b Ο-order-lc a b l = iv where i : Ο a holds β Ο b holds i = OrderedTypes.Frame.from-β€Ξ© fe pe pt {π£} {Ο a} {Ο b} l ii : Ο a οΌ β€' β Ο b οΌ β€' ii p = holds-gives-equal-β€ pe fe (Ο b) (i (equal-β€-gives-holds (Ο a) p)) iii : a οΌ β€ β b οΌ β€ iii q = Ο-reflects-β€ b (ii r) where r = Ο a οΌβ¨ ap Ο q β© Ο β€ οΌβ¨ Ο-rec-β€ Ξ©-qua-Ο-SupLat β€' β© β€' β iv : a β€ b iv = β€-criterion a b iii Ο-lc : left-cancellable Ο Ο-lc {a} {b} p = β¨ π β©-antisym a b l r where l : a β€ b l = Ο-order-lc a b (οΌ-gives-β€' (Ο a) (Ο b) p) r : b β€ a r = Ο-order-lc b a (οΌ-gives-β€' (Ο b) (Ο a) (p β»ΒΉ)) Ο-is-embedding : is-embedding Ο Ο-is-embedding = lc-maps-into-sets-are-embeddings Ο Ο-lc (Ξ©-is-set fe pe) holds-is-embedding : is-embedding (_holds {π£}) holds-is-embedding = prβ-is-embedding (Ξ» _ β being-prop-is-prop fe) \end{code} Hence the composite Ο-holds is an embedding of A into the universe π£: \begin{code} Ο-holds : A β π£ Μ Ο-holds a = Ο a holds Ο-holds-is-embedding : is-embedding Ο-holds Ο-holds-is-embedding = β-is-embedding Ο-is-embedding holds-is-embedding \end{code} Using this we define the notion of quasidecidability and its required properties. We define the quasidecidability of the type P to be the type fiber Ο-holds P, which amounts to the type Ξ£ a κ A , (Ο a holds οΌ P) by construction: \begin{code} is-quasidecidable : π£ Μ β π£ βΊ Μ is-quasidecidable P = Ξ£ a κ A , (Ο a holds οΌ P) being-quasidecidable-is-prop : β P β is-prop (is-quasidecidable P) being-quasidecidable-is-prop = Ο-holds-is-embedding quasidecidable-types-are-props : β P β is-quasidecidable P β is-prop P quasidecidable-types-are-props P (a , p) = transport is-prop p (holds-is-prop (Ο a)) π-is-quasidecidable : is-quasidecidable π π-is-quasidecidable = β₯ , (Ο β₯ holds οΌβ¨ I β© β₯' holds οΌβ¨ II β© π β) where I = ap _holds (Ο-suplat-hom-β₯ π Ξ©-qua-Ο-SupLat Ο Ο-is-hom) II = β₯-holds-is-π π-is-quasidecidable : is-quasidecidable π π-is-quasidecidable = β€ , ap _holds (Ο-rec-β€ Ξ©-qua-Ο-SupLat β€') quasidecidable-closed-under-Ο-joins : (P : β β π£ Μ ) β ((n : β) β is-quasidecidable (P n)) β is-quasidecidable (β n κ β , P n) quasidecidable-closed-under-Ο-joins P Ο = vii where i : (n : β) β Ο-holds (fiber-point (Ο n)) οΌ P n i n = fiber-identification (Ο n) ii : (n : β) β Ο (fiber-point (Ο n)) οΌ P n , quasidecidable-types-are-props (P n) (Ο n) ii n = to-subtype-οΌ (Ξ» _ β being-prop-is-prop fe) (i n) iii : Ο (β (n β¦ fiber-point (Ο n))) οΌ β' (Ξ» n β P n , quasidecidable-types-are-props (P n) (Ο n)) iii = Ο (β (n β¦ fiber-point (Ο n))) οΌβ¨ iv β© β' (n β¦ Ο (fiber-point (Ο n))) οΌβ¨ v β© β' (n β¦ (P n , quasidecidable-types-are-props (P n) (Ο n))) β where iv = Ο-suplat-hom-β π Ξ©-qua-Ο-SupLat Ο Ο-is-hom (Ξ» n β fiber-point (Ο n)) v = ap β' (dfunext fe ii) vi : Ο-holds (β (n β¦ fiber-point (Ο n))) οΌ (β n κ β , P n) vi = ap _holds iii vii : is-quasidecidable (β n κ β , P n) vii = β (n β¦ fiber-point (Ο n)) , vi \end{code} Then we get quasidecidable induction by Ο-induction: \begin{code} quasidecidable-induction : (F : π£ Μ β π₯ Μ ) β ((P : π£ Μ ) β is-prop (F P)) β F π β F π β ((P : β β π£ Μ ) β ((n : β) β F (P n)) β F (β n κ β , P n)) β (P : π£ Μ ) β is-quasidecidable P β F P quasidecidable-induction {π₯} F i Fβ Fβ FΟ P (a , r) = Ξ³ a P r where Ξ³ : (a : A) (P : π£ Μ ) β Ο a holds οΌ P β F P Ξ³ = Ο-induction (Ξ» a β (P : π£ Μ ) β Ο a holds οΌ P β F P) (Ξ» a β Ξ β-is-prop fe (Ξ» P _ β i P)) Ξ³β€ Ξ³β₯ Ξ³β where Ξ³β€ : (P : π£ Μ ) β Ο β€ holds οΌ P β F P Ξ³β€ P s = transport F (t β»ΒΉ β s) Fβ where t : Ο β€ holds οΌ π t = ap _holds (Ο-rec-β€ Ξ©-qua-Ο-SupLat β€') Ξ³β₯ : (P : π£ Μ ) β Ο β₯ holds οΌ P β F P Ξ³β₯ P s = transport F (t β»ΒΉ β s) Fβ where t : Ο β₯ holds οΌ π t = ap _holds (Ο-suplat-hom-β₯ π Ξ©-qua-Ο-SupLat Ο Ο-is-hom) β β₯-holds-is-π Ξ³β : (a : β β A) β ((n : β) (P : π£ Μ ) β (Ο (a n) holds) οΌ P β F P) β (P : π£ Μ ) β (Ο (β a) holds) οΌ P β F P Ξ³β a Ο P s = transport F (t β»ΒΉ β s) (FΟ (Ξ» n β Ο (a n) holds) Ο) where t : Ο (β a) holds οΌ (β n κ β , Ο (a n) holds) t = ap _holds (Ο-suplat-hom-β π Ξ©-qua-Ο-SupLat Ο Ο-is-hom a) Ο : (n : β) β F (Ο (a n) holds) Ο n = Ο n (Ο (a n) holds) refl \end{code} We then get the dominance axiom for quasidecidable propositions by an application of the submodule hypothetical-quasidecidability. \begin{code} quasidecidable-closed-under-Ξ£ : (P : π£ Μ ) β (Q : P β π£ Μ ) β is-quasidecidable P β ((p : P) β is-quasidecidable (Q p)) β is-quasidecidable (Ξ£ Q) quasidecidable-closed-under-Ξ£ = hypothetical-quasidecidability.quasidecidable-closed-under-Ξ£ (quasidecidable-propositions is-quasidecidable being-quasidecidable-is-prop π-is-quasidecidable π-is-quasidecidable quasidecidable-closed-under-Ο-joins quasidecidable-induction) \end{code} Here are some consequences for the sake of illustration of the meaning of this. \begin{code} dependent-binary-meet : (a : A) (b : Ο a holds β A) β Ξ£ c κ A , (Ο c holds) οΌ (Ξ£ h κ Ο a holds , Ο (b h) holds) dependent-binary-meet a b = quasidecidable-closed-under-Ξ£ (Ο a holds) (Ξ» h β Ο (b h) holds) (a , refl) (Ξ» h β b h , refl) \end{code} The following just applies back-and-forth the characterization of Ο a holds as a οΌ β€. \begin{code} dependent-binary-meet' : (a : A) (b : a οΌ β€ β A) β Ξ£ c κ A , (c οΌ β€ β (Ξ£ p κ a οΌ β€ , b p οΌ β€)) dependent-binary-meet' a b = f Ο where b' : Ο a holds β A b' h = b (Ο-characβ a h) Ο : Ξ£ c κ A , (Ο c holds) οΌ (Ξ£ h κ Ο a holds , Ο (b' h) holds) Ο = dependent-binary-meet a b' f : (Ξ£ c κ A , (Ο c holds) οΌ (Ξ£ h κ Ο a holds , Ο (b' h) holds)) β Ξ£ c κ A , ((c οΌ β€) β (Ξ£ p κ a οΌ β€ , b p οΌ β€)) f ( c , q) = c , g , h where g : c οΌ β€ β Ξ£ p κ a οΌ β€ , b p οΌ β€ g r = Ο-characβ a (prβ (Idtofun q (Ο-characβ c r))) , transport (Ξ» - β b - οΌ β€) (β¨ π β©-is-set _ _) (Ο-characβ (b _) (prβ (Idtofun q (Ο-characβ c r)))) h : (Ξ£ p κ a οΌ β€ , b p οΌ β€) β c οΌ β€ h (p , s) = Ο-characβ c (Idtofun (q β»ΒΉ) (Ο-characβ a p , Ο-characβ (b' (Ο-characβ a p)) (transport (Ξ» - β b - οΌ β€) (β¨ π β©-is-set _ _) s))) \end{code} We can replace the bi-implication by an equality: \begin{code} dependent-binary-meet'' : (a : A) (b : a οΌ β€ β A) β Ξ£ c κ A , ((c οΌ β€) οΌ (Ξ£ p κ a οΌ β€ , b p οΌ β€)) dependent-binary-meet'' a b = f (dependent-binary-meet' a b) where f : (Ξ£ c κ A , (c οΌ β€ β (Ξ£ p κ a οΌ β€ , b p οΌ β€))) β Ξ£ c κ A , ((c οΌ β€) οΌ (Ξ£ p κ a οΌ β€ , b p οΌ β€)) f (c , g , h) = c , β prop-univalent-β pe fe (c οΌ β€) (Ξ£ p κ a οΌ β€ , b p οΌ β€) (Ξ£-is-prop β¨ π β©-is-set (Ξ» p β β¨ π β©-is-set)) ββ»ΒΉ (logically-equivalent-props-are-equivalent β¨ π β©-is-set (Ξ£-is-prop β¨ π β©-is-set (Ξ» p β β¨ π β©-is-set)) g h) \end{code} The non-dependent special case: \begin{code} binary-meet : (a b : A) β Ξ£ c κ A , (c οΌ β€ β ((a οΌ β€) Γ (b οΌ β€))) binary-meet a b = dependent-binary-meet' a (Ξ» _ β b) \end{code} Using the criterion for β€ we get that this does indeed give binary meets: \begin{code} binary-meet'-is-β§ : (a b c : A) β (c οΌ β€ β ((a οΌ β€) Γ (b οΌ β€))) β c οΌ a β§ b binary-meet'-is-β§ a b c (f , g) = viii where i : c β€ a i = β€-criterion c a (Ξ» (p : c οΌ β€) β prβ (f p)) ii : c β€ b ii = β€-criterion c b (Ξ» (p : c οΌ β€) β prβ (f p)) iii : c β€ a β§ b iii = β§-is-ub-of-lbs a b c i ii iv : a β§ b οΌ β€ β a οΌ β€ iv p = β¨ π β©-antisym a β€ (β€-is-maximum a) (β¨ π β©-trans β€ (a β§ b) a (β¨ π β©-οΌ-gives-β€ (p β»ΒΉ)) (β§-is-lb-left a b)) v : a β§ b οΌ β€ β b οΌ β€ v p = β¨ π β©-antisym b β€ (β€-is-maximum b) (β¨ π β©-trans β€ (a β§ b) b (β¨ π β©-οΌ-gives-β€ (p β»ΒΉ)) (β§-is-lb-right a b)) vi : a β§ b οΌ β€ β c οΌ β€ vi p = g (iv p , v p) vii : a β§ b β€ c vii = β€-criterion (a β§ b) c vi viii : c οΌ a β§ b viii = β¨ π β©-antisym c (a β§ b) iii vii \end{code} Ο-sup-lattices have joins of quasidecidable-indexed families: \begin{code} Ο-suplats-have-quasidecidable-joins : (π : Ο-SupLat π₯ π¦) (P : π£ Μ ) β is-quasidecidable P β (f : P β β¨ π β©) β Ξ£ b κ β¨ π β© , (b is-the-join-of f on π) Ο-suplats-have-quasidecidable-joins {π₯} {π¦} π = quasidecidable-induction F F-is-prop-valued Fβ Fβ FΟ where F : π£ Μ β π£ β π₯ β π¦ Μ F P = (f : P β β¨ π β©) β Ξ£ b κ β¨ π β© , (b is-the-join-of f on π) F-is-prop-valued : β P β is-prop (F P) F-is-prop-valued P = Ξ -is-prop fe (Ξ» f (b , i) (b' , i') β to-subtype-οΌ (Ξ» b β being-join-is-prop π b f) (at-most-one-join π b b' f i i')) Fβ : F π Fβ f = β₯β¨ π β© , (Ξ» (i : π) β π-elim i) , Ξ» u Ο β β¨ π β©-β₯-is-minimum u Fβ : F π Fβ f = f β , (Ξ» β β β¨ π β©-refl (f β)) , Ξ» u Ο β Ο β FΟ : ((P : β β π£ Μ ) β ((n : β) β F (P n)) β F (β n κ β , P n)) FΟ P Ο f = bβ , Ξ±β , Ξ²β where g : (n : β) β P n β β¨ π β© g n p = f β£ n , p β£ h : (n : β) β Ξ£ b κ β¨ π β© , (b is-the-join-of g n on π) h n = Ο n (g n) b : β β β¨ π β© b n = prβ (h n) Ξ± : (n : β) (p : P n) β g n p β€β¨ π β© b n Ξ± n = prβ (prβ (h n)) Ξ² : (n : β) (u : β¨ π β©) β ((p : P n) β (g n p) β€β¨ π β© u) β b n β€β¨ π β© u Ξ² n = prβ (prβ (h n)) bβ : β¨ π β© bβ = ββ¨ π β© b Ξ±β : (q : β n κ β , P n) β f q β€β¨ π β© bβ Ξ±β = β₯β₯-induction (Ξ» s β β¨ π β©-order-is-prop-valued (f s) bβ) Ξ±β' where Ξ±β' : (Ο : Ξ£ n κ β , P n) β f β£ Ο β£ β€β¨ π β© bβ Ξ±β' (n , p) = β¨ π β©-trans (g n p) (b n) bβ (Ξ± n p) (β¨ π β©-β-is-ub b n) Ξ²β : (u : β¨ π β©) β ((q : β n κ β , P n) β f q β€β¨ π β© u) β bβ β€β¨ π β© u Ξ²β u Ο = β¨ π β©-β-is-lb-of-ubs b u l where l : (n : β) β b n β€β¨ π β© u l n = Ξ² n u (Ξ» p β Ο β£ n , p β£) \end{code} We repackage the above. \begin{code} module _ {π₯ π¦ : Universe} (π : Ο-SupLat π₯ π¦) (P : π£ Μ ) (i : is-quasidecidable P) (f : P β β¨ π β©) where sup : β¨ π β© sup = prβ (Ο-suplats-have-quasidecidable-joins π P i f) sup-is-ub : (p : P) β f p β€β¨ π β© sup sup-is-ub = prβ (prβ (Ο-suplats-have-quasidecidable-joins π P i f)) sup-is-lb-of-ubs : (u : β¨ π β©) β ((p : P) β f p β€β¨ π β© u) β sup β€β¨ π β© u sup-is-lb-of-ubs = prβ (prβ (Ο-suplats-have-quasidecidable-joins π P i f)) \end{code} We say that a map is a q-embedding if its fibers are all quasidecidable. We define three versions of the same definition to help Agda to solve constraints. \begin{code} is-q-embedding : {X : π£ Μ } {Y : π£ Μ } β (X β Y) β π£ βΊ Μ is-q-embedding f = β y β is-quasidecidable (fiber f y) is-q-embeddingl : {X : π£ Μ } {Y : π€β Μ } β (X β Y) β π£ βΊ Μ is-q-embeddingl f = β y β is-quasidecidable (fiber f y) is-q-embeddingr : {X : π€β Μ } {Y : π£ Μ } β (X β Y) β π£ βΊ Μ is-q-embeddingr f = β y β is-quasidecidable (fiber f y) \end{code} The following generalizes the existence of quasidecidable-indexed joins. \begin{code} Ο-suplats-have-quasidecidable-joins' : (π : Ο-SupLat π₯ π¦) {I : π£ Μ } β (f : I β β) β is-q-embeddingl f β (b : β β β¨ π β©) β Ξ£ c κ β¨ π β© , (c is-the-join-of (b β f) on π) Ο-suplats-have-quasidecidable-joins' {π₯} {π¦} π {I} f q b = c , Ξ± , Ξ² where g : I β β¨ π β© g = b β f a : β β A a n = prβ (q n) e : (n : β) β Ο (a n) holds οΌ (Ξ£ i κ I , f i οΌ n) e n = prβ (q n) Ξ³ : (n : β) β Ο (a n) holds β (Ξ£ i κ I , f i οΌ n) Ξ³ n = Idtofun (e n) Ξ΄ : (n : β) β (Ξ£ i κ I , f i οΌ n) β Ο (a n) holds Ξ΄ n = Idtofun ((e n)β»ΒΉ) g' : (n : β) β Ο (a n) holds β β¨ π β© g' n h = g (prβ (Ξ³ n h)) b' : β β β¨ π β© b' n = sup π (Ο (a n) holds) (a n , refl) (g' n) c : β¨ π β© c = ββ¨ π β© b' Ξ± : β i β b (f i) β€β¨ π β© c Ξ± i = β¨ π β©-trans (b (f i)) (b' (f i)) c lβ lβ where lβ : b' (f i) β€β¨ π β© c lβ = β¨ π β©-β-is-ub b' (f i) lβ : g' (f i) (Ξ΄ (f i) (i , refl)) β€β¨ π β© b' (f i) lβ = sup-is-ub π (Ο (a (f i)) holds) (a (f i) , refl) (g' (f i)) (Ξ΄ (f i) (i , refl)) r : g' (f i) (Ξ΄ (f i) (i , refl)) οΌ b (f (prβ (Ξ³ (f i) (Ξ΄ (f i) (i , refl))))) r = refl s : b (f (prβ (Ξ³ (f i) (Ξ΄ (f i) (i , refl))))) οΌ b (f i) s = ap (Ξ» - β b (f (prβ -))) (Idtofun-retraction (e (f i)) (i , refl)) t : g' (f i) (Ξ΄ (f i) (i , refl)) οΌ b (f i) t = s lβ : b (f i) β€β¨ π β© b' (f i) lβ = transport (Ξ» - β - β€β¨ π β© b' (f i)) s lβ Ξ² : (u : β¨ π β©) β (β i β b (f i) β€β¨ π β© u) β c β€β¨ π β© u Ξ² u Ο = β¨ π β©-β-is-lb-of-ubs b' u l where Ο' : (n : β) (h : Ο (a n) holds) β g' n h β€β¨ π β© u Ο' n h = Ο (prβ (Ξ³ n h)) l : (n : β) β b' n β€β¨ π β© u l n = sup-is-lb-of-ubs π (Ο (a n) holds) (a n , refl) (g' n) u (Ο' n) \end{code} We now generalize and resize part of the above (without resizing axioms) by replacing equality by equivalence in the definition of quasidecidability: \begin{code} is-quasidecidable' : π₯ Μ β π£ β π₯ Μ is-quasidecidable' P = Ξ£ a κ A , (Ο a holds β P) is-quasidecidableβ : π£ Μ β π£ Μ is-quasidecidableβ = is-quasidecidable' {π£} quasidecidability-resizing : (P : π£ Μ ) β is-quasidecidable P β is-quasidecidableβ P quasidecidability-resizing P = Ξ£-cong e where e : (a : A) β (Ο a holds οΌ P) β (Ο a holds β P) e a = prop-univalent-β' pe fe P (Ο a holds) (holds-is-prop (Ο a)) being-quasidecidableβ-is-prop : (P : π£ Μ ) β is-prop (is-quasidecidableβ P) being-quasidecidableβ-is-prop P = equiv-to-prop (β-sym (quasidecidability-resizing P)) (being-quasidecidable-is-prop P) π-is-quasidecidableβ : is-quasidecidableβ π π-is-quasidecidableβ = β quasidecidability-resizing π β π-is-quasidecidable π-is-quasidecidableβ : is-quasidecidableβ π π-is-quasidecidableβ = β quasidecidability-resizing π β π-is-quasidecidable quasidecidableβ-closed-under-Ο-joins : (P : β β π£ Μ ) β ((n : β) β is-quasidecidableβ (P n)) β is-quasidecidableβ (β n κ β , P n) quasidecidableβ-closed-under-Ο-joins P Ο = β quasidecidability-resizing (β n κ β , P n) β (quasidecidable-closed-under-Ο-joins P Ο') where Ο' : (n : β) β is-quasidecidable (P n) Ο' n = β quasidecidability-resizing (P n) ββ»ΒΉ (Ο n) quasidecidableβ-induction : (F : π£ Μ β π₯ Μ ) β ((P : π£ Μ ) β is-prop (F P)) β F π β F π β ((P : β β π£ Μ ) β ((n : β) β F (P n)) β F (β n κ β , P n)) β (P : π£ Μ ) β is-quasidecidableβ P β F P quasidecidableβ-induction F i Fβ Fβ FΟ P q = quasidecidable-induction F i Fβ Fβ FΟ P (β quasidecidability-resizing P ββ»ΒΉ q) \end{code} This concludes the module hypothetical-free-Ο-SupLat-on-one-generator. We now give the proofs of the main theorems by calling the above modules. \begin{code} theoremβ {π£} {π€} q = free-Ο-SupLat-on-one-generator QD β€ QD-is-free-Ο-SupLat where open quasidecidable-propositions-exist q open hypothetical-quasidecidability {π£} {π€} (quasidecidable-propositions is-quasidecidable being-quasidecidable-is-prop π-is-quasidecidable π-is-quasidecidable quasidecidable-closed-under-Ο-joins quasidecidable-induction) theoremβ {π£} {π€} f = quasidecidable-propositions is-quasidecidableβ being-quasidecidableβ-is-prop π-is-quasidecidableβ π-is-quasidecidableβ quasidecidableβ-closed-under-Ο-joins quasidecidableβ-induction where open free-Ο-SupLat-on-one-generator-exists f open hypothetical-free-Ο-SupLat-on-one-generator open assumption {π£} {π€} π β€ π-free theoremβ {π£} {π} f = initial-Ο-frame π-qua-Ο-frame π-qua-Ο-frame-is-initial where open free-Ο-SupLat-on-one-generator-exists f open hypothetical-free-Ο-SupLat-on-one-generator open assumption {π£} {π} π β€ π-free theoremβ {π£} {π} Ο = quasidecidable-propositions is-quasidecidable being-quasidecidable-is-prop π-is-quasidecidable π-is-quasidecidable quasidecidable-closed-under-Ο-joins quasidecidable-induction where open quasidecidability-construction-from-resizing π£ π Ο \end{code} TODO: β Very little here has to do with the nature of the type β. We never used zero, successor, or induction! (But they are used in another module to construct binary joins, which are not used here.) Any indexing type replacing β works in the above development, with the definition of Ο-sup-lattice generalized to have an arbitrary (but fixed) indexing type in place of β. (We could have multiple indexing types, but this would require a modification of the above development.) β Define, by induction (or as a W-type) a type similar to the Brouwer ordinals, with two constructors 0 and 1 and a formal β-indexed sup operation. We have a unique map to the initial Ο-sup-lattice that transforms formal sups into sups and maps 0 to β₯ and 1 to β€. Is this function a surjection (it is definitely not an injection), or what (known) axioms are needed for it to be a surjection? Countable choice suffices. But is it necessary? It seems likely that the choice principle studied in the above paper with Cory Knapp is necessary and sufficient. This principle implies that the quasidecidable propositions agree with the semidecidable ones.