Ian Ray, 23rd July 2024 Modifications made by Ian Ray on 26th September 2024 We define connected types and maps. We then explore relationships, closure properties and characterizations of interest pertaining to the concept of connectedness. \begin{code} {-# OPTIONS --safe --without-K #-} open import UF.FunExt module UF.ConnectedTypes (fe : Fun-Ext) where open import MLTT.Spartan hiding (_+_) open import Notation.Order open import UF.Equiv open import UF.EquivalenceExamples open import UF.PropTrunc open import UF.Subsingletons open import UF.Subsingletons-FunExt open import UF.Truncations fe open import UF.TruncationLevels open import UF.TruncatedTypes fe open import UF.Univalence \end{code} We now define the notion of connectedness for types and functions with respect to truncation levels. \begin{code} module _ (te : general-truncations-exist) where private pt : propositional-truncations-exist pt = general-truncations-give-propositional-truncations te open general-truncations-exist te open propositional-truncations-exist pt open import UF.ImageAndSurjection pt _is_connected : ๐ค ฬ โ โโโ โ ๐ค ฬ X is k connected = is-contr (โฅ X โฅ[ k ]) _is_connected-map : {X : ๐ค ฬ} {Y : ๐ฅ ฬ} โ (f : X โ Y) โ โโโ โ ๐ค โ ๐ฅ ฬ f is k connected-map = each-fiber-of f (ฮป - โ - is k connected) \end{code} TODO: show that connectedness as defined elsewhere in the library is a special case of k-connectedness. Connectedness typically means set connectedness, by our convention it will mean 0-connectedness. We characterize โ1-connected types as inhabited types and โ1-connected maps as surjections. \begin{code} inhabited-if-โ1-connected : {X : ๐ค ฬ} โ X is โ1 connected โ โฅ X โฅ inhabited-if-โ1-connected X-1-conn = โ1-trunc-to-prop-trunc pt (center X-1-conn) โ1-connected-if-inhabited : {X : ๐ค ฬ} โ โฅ X โฅ โ X is โ1 connected โ1-connected-if-inhabited x-anon = pointed-props-are-singletons (prop-trunc-to-โ1-trunc pt x-anon) โ1-trunc-is-prop โ1-connected-iff-inhabited : {X : ๐ค ฬ} โ X is โ1 connected โ โฅ X โฅ โ1-connected-iff-inhabited = (inhabited-if-โ1-connected , โ1-connected-if-inhabited) map-is-surj-if-โ1-connected : {X : ๐ค ฬ} {Y : ๐ฅ ฬ} {f : X โ Y} โ f is โ1 connected-map โ is-surjection f map-is-surj-if-โ1-connected m y = inhabited-if-โ1-connected (m y) map-is-โ1-connected-if-surj : {X : ๐ค ฬ} {Y : ๐ฅ ฬ} {f : X โ Y} โ is-surjection f โ f is โ1 connected-map map-is-โ1-connected-if-surj f-is-surj y = โ1-connected-if-inhabited (f-is-surj y) map-is-โ1-connected-iff-surj : {X : ๐ค ฬ} {Y : ๐ฅ ฬ} {f : X โ Y} โ f is โ1 connected-map โ is-surjection f map-is-โ1-connected-iff-surj = (map-is-surj-if-โ1-connected , map-is-โ1-connected-if-surj) \end{code} We develop some closure conditions pertaining to connectedness. Connectedness is closed under equivalence as expected, but more importantly connectedness extends below: more precisely if a type is k connected then it is l connected for all l โค k. We provide a few incarnations of this fact below which may prove useful. \begin{code} connectedness-closed-under-equiv : {X : ๐ค ฬ} {Y : ๐ฅ ฬ} {k : โโโ} โ X โ Y โ Y is k connected โ X is k connected connectedness-closed-under-equiv e Y-con = equiv-to-singleton (truncation-closed-under-equiv e) Y-con contractible-types-are-connected : {X : ๐ค ฬ} {k : โโโ} โ is-contr X โ X is k connected contractible-types-are-connected {๐ค} {X} {k} (c , C) = ((โฃ c โฃ[ k ]) , C') where C' : (s : โฅ X โฅ[ k ]) โ (โฃ c โฃ[ k ]) ๏ผ s C' = โฅโฅโ-ind (truncation-levels-closed-under-Id โฅโฅโ-is-truncated (โฃ c โฃ[ k ])) (ฮป x โ ap โฃ_โฃ[ k ] (C x)) connectedness-is-lower-closed : {X : ๐ค ฬ} {k : โโโ} โ X is (k + 1) connected โ X is k connected connectedness-is-lower-closed {๐ค} {X} {k} X-succ-con = equiv-to-singleton successive-truncations-equiv (contractible-types-are-connected X-succ-con) connectedness-is-lower-closed-+ : {X : ๐ค ฬ} {l : โโโ} {k : โ} โ X is (l + k) connected โ X is l connected connectedness-is-lower-closed-+ {๐ค} {X} {l} {0} X-con = X-con connectedness-is-lower-closed-+ {๐ค} {X} {l} {succ k} X-con = connectedness-is-lower-closed-+ (connectedness-is-lower-closed X-con) connectedness-is-lower-closed' : {X : ๐ค ฬ} {k l : โโโ} โ (l โค k) โ X is k connected โ X is l connected connectedness-is-lower-closed' {๐ค} {X} {k} {l} o X-con = connectedness-is-lower-closed-+ (transport (ฮป z โ X is z connected) p X-con) where m : โ m = subtraction-โโโ-term l k o p = k ๏ผโจ subtraction-โโโ-identification l k o โปยน โฉ l + m โ \end{code} We characterize connected types in terms of inhabitedness and connectedness of the identity type at one level below. We will assume univalence only when necessary. \begin{code} inhabited-if-connected : {X : ๐ค ฬ} {k : โโโ} โ X is (k + 1) connected โ โฅ X โฅ inhabited-if-connected {_} {_} {k} X-conn = inhabited-if-โ1-connected (connectedness-is-lower-closed' โ X-conn) _is-locally_connected : (X : ๐ค ฬ) (k : โโโ) โ ๐ค ฬ X is-locally k connected = (x y : X) โ (x ๏ผ y) is k connected connected-types-are-locally-connected : {X : ๐ค ฬ} {k : โโโ} โ is-univalent ๐ค โ X is (k + 1) connected โ X is-locally k connected connected-types-are-locally-connected {_} {_} {k} ua X-conn x y = equiv-to-singleton (eliminated-trunc-identity-char ua) (is-prop-implies-is-prop' (singletons-are-props X-conn) โฃ x โฃ[ succ k ] โฃ y โฃ[ succ k ]) connected-types-are-inhabited-and-locally-connected : {X : ๐ค ฬ} {k : โโโ} โ is-univalent ๐ค โ X is (k + 1) connected โ โฅ X โฅ ร X is-locally k connected connected-types-are-inhabited-and-locally-connected ua X-conn = (inhabited-if-connected X-conn , connected-types-are-locally-connected ua X-conn) inhabited-and-locally-connected-types-are-connected : {X : ๐ค ฬ} {k : โโโ} โ is-univalent ๐ค โ โฅ X โฅ โ X is-locally k connected โ X is (k + 1) connected inhabited-and-locally-connected-types-are-connected {_} {_} {โ2} ua anon-x id-conn = pointed-props-are-singletons (prop-trunc-to-โ1-trunc pt anon-x) โ1-trunc-is-prop inhabited-and-locally-connected-types-are-connected {_} {_} {succ k} ua anon-x id-conn = โฅโฅ-rec (being-singleton-is-prop fe) (ฮป x โ (โฃ x โฃ[ (k + 1) + 1 ] , โฅโฅโ-ind (ฮป v โ truncation-levels-are-upper-closed (ฮป p q โ โฅโฅโ-is-truncated โฃ x โฃ[ (k + 1) + 1 ] v p q)) (ฮป y โ forth-trunc-id-char ua (center (id-conn x y))))) anon-x connected-characterization : {X : ๐ค ฬ} {k : โโโ} โ is-univalent ๐ค โ X is (k + 1) connected โ โฅ X โฅ ร X is-locally k connected connected-characterization ua = (connected-types-are-inhabited-and-locally-connected ua , uncurry (inhabited-and-locally-connected-types-are-connected ua)) ap-is-less-connected : {X : ๐ค ฬ} {Y : ๐ฅ ฬ} {k : โโโ} โ (ua : is-univalent (๐ค โ ๐ฅ)) โ (f : X โ Y) โ f is (k + 1) connected-map โ {x x' : X} โ (ap f {x} {x'}) is k connected-map ap-is-less-connected ua f f-conn {x} {x'} p = equiv-to-singleton (truncation-closed-under-equiv (fiber-of-ap-โ f p)) (connected-types-are-locally-connected ua (f-conn (f x')) (x , p) (x' , refl)) \end{code}