Martin Escardo 29 April 2014. A proposition-indexed product of pointed compact sets is itself compact. But the assumption that a proposition-indexed product of compact sets is compact gives weak excluded middle (negative propositions are decidable). The definition of compactness (or exhaustive searchability) is compactβ A = (p : A β π) β Ξ£ aβ κ A , p aβ οΌ β β (a : A) β p a οΌ β With excluded middle for propositions, the above claim is not surprising, because (π β Y) = Y^π β π (which is always compact), (π β Y) = Y^π β Y (which is compact if Y is), and excluded middle for a proposition X amounts to X=π or X=π, so that Y^X is compact if Y is compact and X is a proposition. The point is that (1) We can reach this conclusion without excluded middle. (2) This also holds for dependent products: Ξ x : X , Y x is compact if X is a proposition and Y x is compact for every x : X. (This product is also written (x : X) β Y x or Ξ Y in Agda.) Our Agda proof below can be written rather concisely by expanding the definitions. We deliberately don't do that, so that we have a rigorous informal proof side-by-side with the formal proof. We proceed in a series of trivial steps, hopefully in the most natural way (although we had a convoluted path to this supposedly natural way). \begin{code} {-# OPTIONS --without-K --exact-split --safe --auto-inline #-} open import MLTT.Spartan open import UF.FunExt module TypeTopology.PropTychonoff (fe : FunExt) where open import TypeTopology.CompactTypes open import MLTT.Two-Properties open import UF.Base open import UF.Subsingletons open import UF.PropIndexedPiSigma open import UF.Equiv open import UF.EquivalenceExamples \end{code} A crucial lemma is prop-indexed-product : is-prop X β (a : X) β Ξ Y β Y a This is proved in the module Prop-indexed-product. Although it has a subtle proof, it should be intuitively clear, as X has at most one element by hypothesis, and if the element is a:X then the product Ξ Y should be isomorphic to its only factor Y a. With this observation, the following proof should be self-contained, if we recall again the definition of compact set from the module CompacTypes: compactβ A = (p : A β π) β Ξ£ aβ κ A , p aβ οΌ β β (a : A) β p a οΌ β Recall also that such an aβ is called a universal witness for the predicate p. \begin{code} prop-tychonoff : {X : π€ Μ } {Y : X β π₯ Μ } β is-prop X β ((x : X) β compactβ (Y x)) β compactβ (Ξ Y) prop-tychonoff {π€} {π₯} {X} {Y} X-is-prop Ξ΅ p = Ξ³ where have : (type-of Ξ΅ οΌ ((x : X) β compactβ(Y x))) Γ (type-of p οΌ (Ξ Y β π)) have = refl , refl hip : (x : X) β Ξ Y β Y x hip = prop-indexed-product (fe π€ π₯) X-is-prop \end{code} The essence of the first part of the proof is this: \begin{code} crude : X β compactβ (Ξ Y) crude x = equiv-compactβ (β-sym(hip x)) (Ξ΅ x) \end{code} But this is very crude for our purposes (or so it seems). So we instead proceed as follows. The following is what we get from prop-indexed-product, abstractly: \begin{code} f : (x : X) β Ξ Y β Y x f x = prβ (hip x) hrf : (x : X) β Ξ£ r κ (Y x β Ξ Y), r β f x βΌ id hrf x = prβ (prβ (hip x)) h : (x : X) β Y x β Ξ Y h x = prβ (hrf x) hf : (x : X) (Ο : Ξ Y) β h x (f x Ο) οΌ Ο hf x = prβ (hrf x) \end{code} We define a predicate q x : Y x β π, for each x : X, from the predicate p : Ξ Y β π via (part of) the above isomorphism: \begin{code} q : (x : X) β Y x β π q x y = p (h x y) \end{code} We argue that the following is a universal witness for the searchability of the type Ξ Y wrt the predicate p: \begin{code} Οβ : Ξ Y Οβ x = prβ (Ξ΅ x (q x)) \end{code} By hypothesis, it satisfies: \begin{code} Οβ-spec : (x : X) β q x (Οβ x) οΌ β β (y : Y x) β q x y οΌ β Οβ-spec x = prβ (Ξ΅ x (q x)) \end{code} By expanding the definitions, this amounts to: \begin{code} Οβ-specβ : (x : X) β p (h x (Οβ x)) οΌ β β (y : Y x) β p (h x y) οΌ β Οβ-specβ = Οβ-spec \end{code} By the definition of f in prop-indexed-product (namely f x Ο = Ο x): \begin{code} Οβ-specβ : (x : X) β p (h x (f x Οβ)) οΌ β β (y : Y x) β p (h x y) οΌ β Οβ-specβ = Οβ-specβ \end{code} (So we can't abstract away the definition/proof of prop-indexed-product.) In particular, with y = f x Ο, we get: \begin{code} Οβ-specβ-particular-case : (x : X) β p (h x (f x Οβ)) οΌ β β (Ο : Ξ Y) β p (h x (f x Ο)) οΌ β Οβ-specβ-particular-case x r Ο = Οβ-specβ x r (f x Ο) \end{code} Using the fact that g x (f x Ο) = Ο for any x:X, we get: \begin{code} Οβ-is-universal-witness-assuming-X : X β p Οβ οΌ β β (Ο : Ξ Y) β p Ο οΌ β Οβ-is-universal-witness-assuming-X x r Ο = p Ο οΌβ¨ ap p ((hf x Ο)β»ΒΉ) β© p (h x (f x Ο)) οΌβ¨ Οβ-specβ-particular-case x s Ο β© β β where s = p (h x (f x Οβ)) οΌβ¨ ap p (hf x Οβ) β© p Οβ οΌβ¨ r β© β β \end{code} Notice that the point x : X vanishes from the conclusion, and so we are able to omit it from the hypothesis, which is crucial for what follows. We get the same conclusion if X is empty: \begin{code} Οβ-is-universal-witness-assuming-Xβπ : (X β π) β p Οβ οΌ β β (Ο : Ξ Y) β p Ο οΌ β Οβ-is-universal-witness-assuming-Xβπ u r Ο = p Ο οΌβ¨ ap p claim β© p Οβ οΌβ¨ r β© β β where claim : Ο οΌ Οβ claim = dfunext (fe π€ π₯) (Ξ» x β unique-from-π (u x)) \end{code} So we would get what we want if we had excluded middle, because X is a proposition and the above shows that both X and X β π give the desired conclusion that Οβ is a universal witness. But excluded middle is not needed. We shuffle the arguments of Οβ-is-universal-witness-assuming-X: \begin{code} claimβ : p Οβ οΌ β β (Ο : Ξ Y) β X β p Ο οΌ β claimβ r Ο x = Οβ-is-universal-witness-assuming-X x r Ο \end{code} We then take the contrapositive of the conclusion X β p Ο οΌ β, and use the fact that if a point of the two-point type π is β, then it is not β: \begin{code} Claimβ : p Οβ οΌ β β (Ο : Ξ Y) β p Ο οΌ β β (X β π) Claimβ r Ο = contrapositive(claimβ r Ο) β equal-β-different-from-β \end{code} This concludes the first part of the argument. We now shuffle the arguments of Οβ-is-universal-witness-assuming-Xβπ: \begin{code} Claimβ : p Οβ οΌ β β (Ο : Ξ Y) β (X β π) β p Ο οΌ β Claimβ r Ο u = Οβ-is-universal-witness-assuming-Xβπ u r Ο \end{code} Combining the two last claims, we get: \begin{code} Claimβ : p Οβ οΌ β β (Ο : Ξ Y) β p Ο οΌ β β p Ο οΌ β Claimβ r Ο = Claimβ r Ο β Claimβ r Ο \end{code} Finally, we do case analysis on the value of p Ο: \begin{code} Οβ-is-universal-witness : p Οβ οΌ β β (Ο : Ξ Y) β p Ο οΌ β Οβ-is-universal-witness r Ο = π-equality-cases (Claimβ r Ο) id Ξ³ : Ξ£ Οβ κ Ξ Y , (p Οβ οΌ β β (Ο : Ξ Y) β p Ο οΌ β) Ξ³ = Οβ , Οβ-is-universal-witness \end{code} And we are done. TODO. 9 Sep 2015. We can generalize from X being a subsingleton (or proposition) to X being subfinite (embedded into a finite type). A particular case is the following: \begin{code} prop-tychonoff-corollary : {X : π€ Μ } {Y : π₯ Μ } β is-prop X β compactβ Y β compactβ (X β Y) prop-tychonoff-corollary X-is-prop Ξ΅ = prop-tychonoff X-is-prop (Ξ» x β Ξ΅) \end{code} This holds even for undecided X (such as X = LPO), or when we have no idea whether X or (X β π), and hence whether (X β Y) is π or Y (or none, if this is undecided)! Better (9 Sep 2015): \begin{code} prop-tychonoff-corollary' : {X : π€ Μ } {Y : π₯ Μ } β is-prop X β (X β compactβ Y) β compactβ (X β Y) prop-tychonoff-corollary' = prop-tychonoff \end{code} So the function type (LPO β β) is compact! (See the module LPO for a proof.) The Tychonoff theorem for prop-indexed products of compact types doesn't hold. To see this, first notice that a proposition is compact iff it is decidable. Now, the empty type π is compact (but not compactββ), and if π^P, that is, Β¬P, where compact for a proposition P, this would imply that Β¬P is decidable for every proposition P, which is weak excluded middle, which is not provable. \begin{code} open import UF.ExcludedMiddle compact-prop-tychonoff-gives-WEM : ((X : π€ Μ ) (Y : X β π₯ Μ ) β is-prop X β ((x : X) β compact (Y x)) β compact (Ξ Y)) β WEM π€ compact-prop-tychonoff-gives-WEM {π€} {π₯} Ο X X-is-prop = Ξ΄ Ξ³ where Y : X β π₯ Μ Y x = π negation-compact : compact (X β π {π₯}) negation-compact = Ο X Y X-is-prop (Ξ» p β π-compact) Ξ³ : decidable (X β π {π₯}) Ξ³ = compact-decidable (X β π) negation-compact Ξ΄ : decidable (X β π {π₯}) β decidable (Β¬ X) Ξ΄ (inl f) = inl (π-elim β f) Ξ΄ (inr Ο) = inr (contrapositive (Ξ» f β π-elim β f) Ο) \end{code}