Built with Alectryon, running Coq+SerAPI v8.19.0+0.19.3. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use ⌘ instead of Ctrl.
(** * Properties of compact and searchable types *)
[Loading ML file number_string_notation_plugin.cmxs (using legacy method) ... done]
Require Import Truncations.Core Truncations.Connectedness.Require Import Spaces.Nat.Core.Require Import Misc.UStructures.Require Import Spaces.NatSeq.Core Spaces.NatSeq.UStructure.Require Import Homotopy.Suspension.Require Import Pointed.Core.Require Import Universes.TruncType.Require Import Idempotents.LocalOpen Scope nat_scope.LocalOpen Scope pointed_scope.(** ** Basic definitions of compact types *)(** A type [A] is compact if for every decidable predicate [P] on [A] we can either find an element of [A] making [P] false or we can show that [P a] always holds. *)DefinitionIsCompact (A : Type)
:= forallP : A -> Type, (foralla : A, Decidable (P a)) ->
{a : A & ~ P a} + (foralla : A, P a).(** Any compact type is decidable. *)
A: Type c: IsCompact A
Decidable A
A: Type c: IsCompact A
Decidable A
A: Type c: IsCompact A c1: {_ : A & ~ Empty}
Decidable A
A: Type c: IsCompact A c2: A -> Empty
Decidable A
A: Type c: IsCompact A c1: {_ : A & ~ Empty}
Decidable A
exact (inl c1.1).
A: Type c: IsCompact A c2: A -> Empty
Decidable A
exact (inr c2).Defined.(** Compactness is equivalent to assuming the same for [HProp]-valued decidable predicates. *)DefinitionIsCompactProps (A : Type)
:= forallP : A -> HProp, (foralla : A, Decidable (P a)) ->
{a : A & ~ P a} + (foralla : A, P a).
A: Type c: IsCompactProps A
IsCompact A
A: Type c: IsCompactProps A
IsCompact A
A: Type c: IsCompactProps A P: A -> Type dP: foralla : A, Decidable (P a)
({a : A & ~ P a} + (foralla : A, P a))%type
A: Type c: IsCompactProps A P: A -> Type dP: foralla : A, Decidable (P a) l: {a : A & ~ merely (P a)}
({a : A & ~ P a} + (foralla : A, P a))%type
A: Type c: IsCompactProps A P: A -> Type dP: foralla : A, Decidable (P a) r: foralla : A, merely (P a)
({a : A & ~ P a} + (foralla : A, P a))%type
A: Type c: IsCompactProps A P: A -> Type dP: foralla : A, Decidable (P a) l: {a : A & ~ merely (P a)}
({a : A & ~ P a} + (foralla : A, P a))%type
exact (inl (l.1; funp => l.2 (tr p))).
A: Type c: IsCompactProps A P: A -> Type dP: foralla : A, Decidable (P a) r: foralla : A, merely (P a)
({a : A & ~ P a} + (foralla : A, P a))%type
A: Type c: IsCompactProps A P: A -> Type dP: foralla : A, Decidable (P a) r: foralla : A, merely (P a)
foralla : A, P a
A: Type c: IsCompactProps A P: A -> Type dP: foralla : A, Decidable (P a) r: foralla : A, merely (P a) a: A
P a
apply merely_inhabited_iff_inhabited_stable, r.Defined.(** Since decidable types are stable, it's also equivalent to negate [P] in the definition. *)DefinitionIsCompact' (A : Type)
:= forallP : A -> Type, (foralla : A, Decidable (P a)) ->
{a : A & P a} + (foralla : A, ~ P a).
A: Type
IsCompact A <-> IsCompact' A
A: Type
IsCompact A <-> IsCompact' A
A: Type P: A -> Type dP: foralla : A, Decidable (P a)
{a : A & ~~ P a} -> {a : A & P a}
A: Type P: A -> Type dP: foralla : A, Decidable (P a)
(foralla : A, ~ P a) -> foralla : A, ~ P a
A: Type P: A -> Type dP: foralla : A, Decidable (P a)
{a : A & ~ P a} -> {a : A & ~ P a}
A: Type P: A -> Type dP: foralla : A, Decidable (P a)
(foralla : A, ~~ P a) -> foralla : A, P a
A: Type P: A -> Type dP: foralla : A, Decidable (P a)
{a : A & ~~ P a} -> {a : A & P a}
A: Type P: A -> Type dP: foralla : A, Decidable (P a)
(foralla : A, ~~ P a) -> foralla : A, P a
A: Type P: A -> Type dP: foralla : A, Decidable (P a)
foralla : A, ~~ P a -> P a
A: Type P: A -> Type dP: foralla : A, Decidable (P a)
(foralla : A, ~~ P a) -> foralla : A, P a
A: Type P: A -> Type dP: foralla : A, Decidable (P a)
foralla : A, ~~ P a -> P a
A: Type P: A -> Type dP: foralla : A, Decidable (P a)
forallb : A, ~~ P b -> P b
all: intro a; byapply stable_decidable.Defined.(** Another equivalent definition of compactness: If a family over the type is decidable, then the Σ-type is decidable. *)DefinitionIsSigmaCompact (A : Type)
:= forallP : A -> Type, (foralla : A, Decidable (P a)) -> Decidable (sig P).
A: Type
IsCompact' A <-> IsSigmaCompact A
A: Type
IsCompact' A <-> IsSigmaCompact A
A: Type P: A -> Type
((foralla : A, Decidable (P a)) ->
{a : A & P a} + (foralla : A, ~ P a)) <->
((foralla : A, Decidable (P a)) ->
Decidable {x : _ & P x})
A: Type P: A -> Type dP: foralla : A, Decidable (P a)
{a : A & P a} + (foralla : A, ~ P a) <->
Decidable {x : _ & P x}
A: Type P: A -> Type dP: foralla : A, Decidable (P a)
{a : A & P a} + (foralla : A, ~ P a) <~>
Decidable {x : _ & P x}
A: Type P: A -> Type dP: foralla : A, Decidable (P a)
(foralla : A, ~ P a) <~> ~ {x : _ & P x}
napply equiv_sig_ind.Defined.(** Again, it is enough to consider [HProp]-valued families. *)DefinitionIsSigmaCompactProps (A : Type)
:= forallP : A -> HProp,
(foralla : A, Decidable (P a)) -> Decidable (sig P).Definitionissigmacompactprops_issigmacompact {A : Type}
(h : IsSigmaCompact A)
: IsSigmaCompactProps A
:= funPhP => h P hP.
A: Type h: IsSigmaCompactProps A
IsSigmaCompact A
A: Type h: IsSigmaCompactProps A
IsSigmaCompact A
A: Type h: IsSigmaCompactProps A P: A -> Type hP: foralla : A, Decidable (P a)
Decidable {x : _ & P x}
A: Type h: IsSigmaCompactProps A P: A -> Type hP: foralla : A, Decidable (P a)
{x : A & merely (P x)} <-> {x : _ & P x}
A: Type h: IsSigmaCompactProps A P: A -> Type hP: foralla : A, Decidable (P a) a: A
merely (P a) <-> P a
exact merely_inhabited_iff_inhabited_stable.Defined.(** A weaker definition: for any decidable family, the dependent function type is decidable. *)DefinitionIsPiCompact (A : Type)
:= forall (P : A -> Type) (dP : foralla : A, Decidable (P a)),
Decidable (foralla : A, P a).
A: Type c: IsSigmaCompact A
IsPiCompact A
A: Type c: IsSigmaCompact A
IsPiCompact A
A: Type c: IsSigmaCompact A P: A -> Type dP: foralla : A, Decidable (P a)
Decidable (foralla : A, P a)
A: Type c: IsSigmaCompact A P: A -> Type dP: foralla : A, Decidable (P a) l: {x : A & ~ P x}
Decidable (foralla : A, P a)
A: Type c: IsSigmaCompact A P: A -> Type dP: foralla : A, Decidable (P a) r: ~ {x : A & ~ P x}
Decidable (foralla : A, P a)
A: Type c: IsSigmaCompact A P: A -> Type dP: foralla : A, Decidable (P a) l: {x : A & ~ P x}
Decidable (foralla : A, P a)
right; exact (funf => l.2 (f l.1)).
A: Type c: IsSigmaCompact A P: A -> Type dP: foralla : A, Decidable (P a) r: ~ {x : A & ~ P x}
Decidable (foralla : A, P a)
A: Type c: IsSigmaCompact A P: A -> Type dP: foralla : A, Decidable (P a) r: ~ {x : A & ~ P x}
foralla : A, P a
A: Type c: IsSigmaCompact A P: A -> Type dP: foralla : A, Decidable (P a) r: ~ {x : A & ~ P x} a: A
P a
A: Type c: IsSigmaCompact A P: A -> Type dP: foralla : A, Decidable (P a) r: ~ {x : A & ~ P x} a: A
~~ P a
exact (funu => r (a; u)).Defined.(** Compact types are closed under retracts. *)
A: Type R: RetractOf A c: IsCompact A
IsCompact (retract_type R)
A: Type R: RetractOf A c: IsCompact A
IsCompact (retract_type R)
A: Type R: RetractOf A c: IsCompact A P: retract_type R -> Type dP: foralla : retract_type R, Decidable (P a) l: {a : A & ~ P (retract_retr R a)}
({a : retract_type R & ~ P a} +
(foralla : retract_type R, P a))%type
A: Type R: RetractOf A c: IsCompact A P: retract_type R -> Type dP: foralla : retract_type R, Decidable (P a) r: foralla : A, P (retract_retr R a)
({a : retract_type R & ~ P a} +
(foralla : retract_type R, P a))%type
A: Type R: RetractOf A c: IsCompact A P: retract_type R -> Type dP: foralla : retract_type R, Decidable (P a) l: {a : A & ~ P (retract_retr R a)}
({a : retract_type R & ~ P a} +
(foralla : retract_type R, P a))%type
exact (inl ((retract_retr R) l.1; l.2)).
A: Type R: RetractOf A c: IsCompact A P: retract_type R -> Type dP: foralla : retract_type R, Decidable (P a) r: foralla : A, P (retract_retr R a)
({a : retract_type R & ~ P a} +
(foralla : retract_type R, P a))%type
exact (inr (funa => ((retract_issect R) a) # r ((retract_sect R) a))).Defined.Definitioniscompact_retract' {AR : Type} {f : A -> R} {g : R -> A}
(s : f o g == idmap) (c : IsCompact A)
: IsCompact R
:= iscompact_retract (Build_RetractOf A R f g s) c.(** Assuming the set truncation map has a section, a type is compact if and only if its set truncation is compact. *)
H: Univalence A: Type f: Tr 0 A -> A s: tr o f == idmap
IsCompact A <-> IsCompact (Tr 0 A)
H: Univalence A: Type f: Tr 0 A -> A s: tr o f == idmap
IsCompact A <-> IsCompact (Tr 0 A)
H: Univalence A: Type f: Tr 0 A -> A s: tr o f == idmap
IsCompact A -> IsCompact (Tr 0 A)
H: Univalence A: Type f: Tr 0 A -> A s: tr o f == idmap
IsCompact (Tr 0 A) -> IsCompact A
H: Univalence A: Type f: Tr 0 A -> A s: tr o f == idmap
IsCompact (Tr 0 A) -> IsCompact A
H: Univalence A: Type f: Tr 0 A -> A s: tr o f == idmap cpt: IsCompact (Tr 0 A)
IsCompactProps A
H: Univalence A: Type f: Tr 0 A -> A s: tr o f == idmap cpt: IsCompact (Tr 0 A) P: A -> HProp dP: foralla : A, Decidable (P a)
({a : A & ~ P a} + (foralla : A, P a))%type
H: Univalence A: Type f: Tr 0 A -> A s: tr o f == idmap cpt: IsCompact (Tr 0 A) P: A -> HProp dP: foralla : A, Decidable (P a)
foralla : Tr 0 A, Decidable (Trunc_rec P a)
H: Univalence A: Type f: Tr 0 A -> A s: tr o f == idmap cpt: IsCompact (Tr 0 A) P: A -> HProp dP: foralla : A, Decidable (P a) l: {a : Tr 0 A & ~ Trunc_rec P a}
({a : A & ~ P a} + (foralla : A, P a))%type
H: Univalence A: Type f: Tr 0 A -> A s: tr o f == idmap cpt: IsCompact (Tr 0 A) P: A -> HProp dP: foralla : A, Decidable (P a) r: foralla : Tr 0 A, Trunc_rec P a
({a : A & ~ P a} + (foralla : A, P a))%type
H: Univalence A: Type f: Tr 0 A -> A s: tr o f == idmap cpt: IsCompact (Tr 0 A) P: A -> HProp dP: foralla : A, Decidable (P a)
foralla : Tr 0 A, Decidable (Trunc_rec P a)
H: Univalence A: Type f: Tr 0 A -> A s: tr o f == idmap cpt: IsCompact (Tr 0 A) P: A -> HProp dP: foralla : A, Decidable (P a) a: A
Decidable (Trunc_rec P (tr a))
exact (dP a).
H: Univalence A: Type f: Tr 0 A -> A s: tr o f == idmap cpt: IsCompact (Tr 0 A) P: A -> HProp dP: foralla : A, Decidable (P a) l: {a : Tr 0 A & ~ Trunc_rec P a}
({a : A & ~ P a} + (foralla : A, P a))%type
exact (inl (f l.1; funx => l.2 (ap (Trunc_rec P) (s l.1) # x))).
H: Univalence A: Type f: Tr 0 A -> A s: tr o f == idmap cpt: IsCompact (Tr 0 A) P: A -> HProp dP: foralla : A, Decidable (P a) r: foralla : Tr 0 A, Trunc_rec P a
({a : A & ~ P a} + (foralla : A, P a))%type
exact (inr (funa => r (tr a))).Defined.(** ** Basic definitions of searchable types *)(** A type is searchable if for every decidable predicate we can find a "universal witness" for whether the predicate is always true or not. *)DefinitionIsSearchable (A : Type)
:= forall (P : A -> Type) (dP : foralla : A, Decidable (P a)),
{x : A & P x -> foralla : A, P a}.DefinitionIsSearchableProps (A : Type)
:= forall (P : A -> HProp) (dP : foralla : A, Decidable (P a)),
{x : A & P x -> foralla : A, P a}.
A: Type s: IsSearchableProps A
IsSearchable A
A: Type s: IsSearchableProps A
IsSearchable A
A: Type s: IsSearchableProps A P: A -> Type dP: foralla : A, Decidable (P a)
{x : A & P x -> foralla : A, P a}
A: Type P: A -> Type s: {x : A &
(merely o P) x -> foralla : A, (merely o P) a} dP: foralla : A, Decidable (P a)
{x : A & P x -> foralla : A, P a}
A: Type P: A -> Type s: {x : A &
(merely o P) x -> foralla : A, (merely o P) a} dP: foralla : A, Decidable (P a)
P s.1 -> foralla : A, P a
A: Type P: A -> Type s: {x : A &
(merely o P) x -> foralla : A, (merely o P) a} dP: foralla : A, Decidable (P a) h: P s.1 a: A
P a
apply merely_inhabited_iff_inhabited_stable, s.2, tr, h.Defined.(** A type is searchable if and only if it is compact and inhabited. *)
A: Type
IsCompact A -> A -> IsSearchable A
A: Type
IsCompact A -> A -> IsSearchable A
A: Type c: IsCompact A a: A P: A -> Type dP: foralla : A, Decidable (P a)
{x : A & P x -> foralla : A, P a}
A: Type c: IsCompact A a: A P: A -> Type dP: foralla : A, Decidable (P a) l: {a : A & ~ P a}
{x : A & P x -> foralla : A, P a}
A: Type c: IsCompact A a: A P: A -> Type dP: foralla : A, Decidable (P a) r: foralla : A, P a
{x : A & P x -> foralla : A, P a}
A: Type c: IsCompact A a: A P: A -> Type dP: foralla : A, Decidable (P a) l: {a : A & ~ P a}
{x : A & P x -> foralla : A, P a}
A: Type c: IsCompact A a: A P: A -> Type dP: foralla : A, Decidable (P a) l: {a : A & ~ P a}
P l.1 -> foralla : A, P a
intro h; contradiction (l.2 h).
A: Type c: IsCompact A a: A P: A -> Type dP: foralla : A, Decidable (P a) r: foralla : A, P a
{x : A & P x -> foralla : A, P a}
exact (a; fun_ => r).Defined.
A: Type
IsSearchable A -> IsCompact A
A: Type
IsSearchable A -> IsCompact A
A: Type h: IsSearchable A P: A -> Type dP: foralla : A, Decidable (P a)
({a : A & ~ P a} + (foralla : A, P a))%type
A: Type h: IsSearchable A P: A -> Type dP: foralla : A, Decidable (P a) w:= (h P dP).1: A
({a : A & ~ P a} + (foralla : A, P a))%type
A: Type h: IsSearchable A P: A -> Type dP: foralla : A, Decidable (P a) w:= (h P dP).1: A x: P w
({a : A & ~ P a} + (foralla : A, P a))%type
A: Type h: IsSearchable A P: A -> Type dP: foralla : A, Decidable (P a) w:= (h P dP).1: A y: ~ P w
({a : A & ~ P a} + (foralla : A, P a))%type
A: Type h: IsSearchable A P: A -> Type dP: foralla : A, Decidable (P a) w:= (h P dP).1: A x: P w
({a : A & ~ P a} + (foralla : A, P a))%type
exact (inr ((h P dP).2 x)).
A: Type h: IsSearchable A P: A -> Type dP: foralla : A, Decidable (P a) w:= (h P dP).1: A y: ~ P w
({a : A & ~ P a} + (foralla : A, P a))%type
exact (inl (w; y)).Defined.Definitioninhabited_issearchable {A : Type} : IsSearchable A -> A
:= funs => (s (funa => Unit) _).1.Definitionsearchable_iff {A : Type} : IsSearchable A <-> A * (IsCompact A)
:= (funs => (inhabited_issearchable s, iscompact_issearchable s),
func => issearchable_iscompact_inhabited (snd c) (fst c)).(** ** Examples of searchable and compact types *)
A: Type c: Contr A
IsSearchable A
A: Type c: Contr A
IsSearchable A
A: Type c: Contr A P: A -> Type dP: foralla : A, Decidable (P a)
{x : A & P x -> foralla : A, P a}
A: Type c: Contr A P: A -> Type dP: foralla : A, Decidable (P a)
P (center A) -> foralla : A, P a
A: Type c: Contr A P: A -> Type dP: foralla : A, Decidable (P a) p: P (center A) a: A
P a
byinduction (contr a).Defined.
IsSearchable Bool
IsSearchable Bool
P: Bool -> Type dP: foralla : Bool, Decidable (P a)
{x : Bool & P x -> foralla : Bool, P a}
P: Bool -> Type dP: foralla : Bool, Decidable (P a) p: P false
P true -> foralla : Bool, P a
P: Bool -> Type dP: foralla : Bool, Decidable (P a) np: ~ P false
P false -> foralla : Bool, P a
all: byintros p' [].Defined.(** The empty type is trivially compact. *)Definitioniscompact_empty : IsCompact Empty
:= funPdP => inr (funa => Empty_rec a).Definitioniscompact_empty' {A : Type} (na : ~A) : IsCompact A
:= funpdP => inr (funa => Empty_rec (na a)).
A: Type
IsCompact A <-> ~ A + IsSearchable A
A: Type
IsCompact A <-> ~ A + IsSearchable A
A: Type
IsCompact A -> ~ A + IsSearchable A
A: Type
~ A + IsSearchable A -> IsCompact A
A: Type
IsCompact A -> ~ A + IsSearchable A
A: Type c: IsCompact A
(~ A + IsSearchable A)%type
A: Type c: IsCompact A l: A
(~ A + IsSearchable A)%type
A: Type c: IsCompact A r: ~ A
(~ A + IsSearchable A)%type
A: Type c: IsCompact A l: A
(~ A + IsSearchable A)%type
exact (inr (issearchable_iscompact_inhabited c l)).
A: Type c: IsCompact A r: ~ A
(~ A + IsSearchable A)%type
exact (inl r).
A: Type
~ A + IsSearchable A -> IsCompact A
A: Type l: ~ A
IsCompact A
A: Type r: IsSearchable A
IsCompact A
A: Type l: ~ A
IsCompact A
exact (iscompact_empty' l).
A: Type r: IsSearchable A
IsCompact A
exact (iscompact_issearchable r).Defined.(** Assuming univalence, the type of propositions is searchable. *)
H: Univalence P: HProp -> HProp dP: foralla : HProp, Decidable (P a) t: P Unit_hp
{x : HProp & P x -> foralla : HProp, P a}
H: Univalence P: HProp -> HProp dP: foralla : HProp, Decidable (P a) f: ~ P Unit_hp
{x : HProp & P x -> foralla : HProp, P a}
H: Univalence P: HProp -> HProp dP: foralla : HProp, Decidable (P a) t: P Unit_hp
{x : HProp & P x -> foralla : HProp, P a}
H: Univalence P: HProp -> HProp dP: foralla : HProp, Decidable (P a) t: P Unit_hp p: P False_hp a: HProp
P a
H: Univalence P: HProp -> HProp dP: foralla : HProp, Decidable (P a) t: P Unit_hp p: P False_hp a: HProp
~~ P a
byapply (not_not_constant_family_hprop P).
H: Univalence P: HProp -> HProp dP: foralla : HProp, Decidable (P a) f: ~ P Unit_hp
{x : HProp & P x -> foralla : HProp, P a}
exact (Unit_hp; funh => Empty_rec (f h)).Defined.(** Assuming univalence, if the domain of a surjective map is searchable, then so is its codomain. *)
H: Univalence A, B: Type s: IsSearchableProps A f: A -> B surj: IsConnMap (Tr (-1)) f
IsSearchableProps B
H: Univalence A, B: Type s: IsSearchableProps A f: A -> B surj: IsConnMap (Tr (-1)) f
IsSearchableProps B
H: Univalence A, B: Type s: IsSearchableProps A f: A -> B surj: IsConnMap (Tr (-1)) f P: B -> HProp dP: foralla : B, Decidable (P a)
{x : B & P x -> foralla : B, P a}
H: Univalence A, B: Type f: A -> B P: B -> HProp s: {x : A & (P o f) x -> foralla : A, (P o f) a} surj: IsConnMap (Tr (-1)) f dP: foralla : B, Decidable (P a)
{x : B & P x -> foralla : B, P a}
exact (f s.1; funt => conn_map_elim _ f _ (s.2 t)).Defined.Definitionissearchable_image `{Univalence} (A B : Type)
(s : IsSearchable A)
(f : A -> B) (surj : IsSurjection f)
: IsSearchable B
:= issearchable_issearchableprops (issearchableprops_image A B s f surj).(** Assuming univalence, every connected pointed type is searchable. *)Definitionissearchable_isconnected_ptype `{Univalence} (A : pType)
(c : IsConnected 0 A)
: IsSearchable A
:= issearchable_image Unit A (issearchable_contr _) (fun_ => pt) _.(** Assuming univalence, the suspension of any type is searchable. *)
H: Univalence A: Type
IsSearchable (Susp A)
H: Univalence A: Type
IsSearchable (Susp A)
H: Univalence A: Type
Bool -> Susp A
H: Univalence A: Type
IsConnMap (Tr (-1)) ?f
H: Univalence A: Type
Bool -> Susp A
exact (Bool_rec _ North South).
H: Univalence A: Type
IsConnMap (Tr (-1)) (Bool_rec (Susp A) North South)
H: Univalence A: Type
IsConnected (Tr (-1))
(hfiber (Bool_rec (Susp A) North South) North)
H: Univalence A: Type
IsConnected (Tr (-1))
(hfiber (Bool_rec (Susp A) North South) South)
H: Univalence A: Type
forallx : A,
transport
(funy : Susp A =>
IsConnected (Tr (-1))
(hfiber (Bool_rec (Susp A) North South) y))
(merid x) ?Goal = ?Goal0
H: Univalence A: Type
hfiber (Bool_rec (Susp A) North South) North
H: Univalence A: Type
hfiber (Bool_rec (Susp A) North South) South
H: Univalence A: Type
forallx : A,
transport
(funy : Susp A =>
IsConnected (Tr (-1))
(hfiber (Bool_rec (Susp A) North South) y))
(merid x)
(contr_inhabited_hprop
(Tr (-1)
(hfiber (Bool_rec (Susp A) North South) North))
(tr ?Goal0)) =
contr_inhabited_hprop
(Tr (-1)
(hfiber (Bool_rec (Susp A) North South) South))
(tr ?Goal1)
H: Univalence A: Type
hfiber (Bool_rec (Susp A) North South) South
H: Univalence A: Type
forallx : A,
transport
(funy : Susp A =>
IsConnected (Tr (-1))
(hfiber (Bool_rec (Susp A) North South) y))
(merid x)
(contr_inhabited_hprop
(Tr (-1)
(hfiber (Bool_rec (Susp A) North South) North))
(tr (true; 1))) =
contr_inhabited_hprop
(Tr (-1)
(hfiber (Bool_rec (Susp A) North South) South))
(tr ?Goal0)
H: Univalence A: Type
forallx : A,
transport
(funy : Susp A =>
IsConnected (Tr (-1))
(hfiber (Bool_rec (Susp A) North South) y))
(merid x)
(contr_inhabited_hprop
(Tr (-1)
(hfiber (Bool_rec (Susp A) North South) North))
(tr (true; 1))) =
contr_inhabited_hprop
(Tr (-1)
(hfiber (Bool_rec (Susp A) North South) South))
(tr (false; 1))
intro x; byapply path_ishprop.Defined.
H: Univalence A, B: Type c: IsCompact A f: A -> B surj: IsConnMap (Tr (-1)) f
IsCompact B
H: Univalence A, B: Type c: IsCompact A f: A -> B surj: IsConnMap (Tr (-1)) f
IsCompact B
H: Univalence A, B: Type c: IsCompact A f: A -> B surj: IsConnMap (Tr (-1)) f
(~ B + IsSearchable B)%type
H: Univalence A, B: Type c: IsCompact A f: A -> B surj: IsConnMap (Tr (-1)) f n: ~ A
(~ B + IsSearchable B)%type
H: Univalence A, B: Type c: IsCompact A f: A -> B surj: IsConnMap (Tr (-1)) f s: IsSearchable A
(~ B + IsSearchable B)%type
H: Univalence A, B: Type c: IsCompact A f: A -> B surj: IsConnMap (Tr (-1)) f n: ~ A
(~ B + IsSearchable B)%type
left; by rapply conn_map_elim.
H: Univalence A, B: Type c: IsCompact A f: A -> B surj: IsConnMap (Tr (-1)) f s: IsSearchable A
(~ B + IsSearchable B)%type
right; by rapply issearchable_image.Defined.SectionUniform_Search.(** ** Searchability of [nat -> A] *)(** Following https://www.cs.bham.ac.uk/~mhe/TypeTopology/TypeTopology.UniformSearch.html, we prove that if [A] is searchable then [nat -> A] is uniformly searchable. *)(** A type with a uniform structure is uniformly searchable if it is searchable over uniformly continuous predicates. Here the uniform structure on [Type] is the trivial one [trivial_us] involving the identity types at each level. *)Definitionuniformly_searchable (A : Type) {usA : UStructure A}
:= forall (P : A -> Type) (dP : foralla : A, Decidable (P a)),
uniformly_continuous P -> existsw0 : A, (P w0 -> forallu : A, P u).Context {A : Type} (issearchable_A : IsSearchable A).(** The witness function for uniformly continuous predicates on [nat -> A]. The first argument [n : nat] will be the modulus of uniform continuity, but we do not use the property in this definition. *)
A: Type issearchable_A: IsSearchable A n: nat P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f)
nat -> A
A: Type issearchable_A: IsSearchable A n: nat P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f)
nat -> A
A: Type issearchable_A: IsSearchable A P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f)
nat -> A
A: Type issearchable_A: IsSearchable A n: nat P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) IHn: forallP : (nat -> A) -> Type,
(forallf : nat -> A, Decidable (P f)) ->
nat -> A
nat -> A
A: Type issearchable_A: IsSearchable A P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f)
A: Type issearchable_A: IsSearchable A n: nat P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) IHn: forallP : (nat -> A) -> Type,
(forallf : nat -> A, Decidable (P f)) ->
nat -> A
nat -> A
A: Type issearchable_A: IsSearchable A n: nat P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) IHn: forallP : (nat -> A) -> Type,
(forallf : nat -> A, Decidable (P f)) ->
nat -> A g:= fun (Q : (nat -> A) -> Type)
(dQ : forallf : nat -> A, Decidable (Q f)) =>
Q (IHn Q dQ): forallQ : (nat -> A) -> Type,
(forallf : nat -> A, Decidable (Q f)) -> Type
nat -> A
A: Type issearchable_A: IsSearchable A n: nat P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) IHn: forallP : (nat -> A) -> Type,
(forallf : nat -> A, Decidable (P f)) ->
nat -> A g:= fun (Q : (nat -> A) -> Type)
(dQ : forallf : nat -> A, Decidable (Q f)) =>
Q (IHn Q dQ): forallQ : (nat -> A) -> Type,
(forallf : nat -> A, Decidable (Q f)) -> Type wA:= (issearchable_A
(funx : A =>
g (P o seq_cons x)
(funf : nat -> A => dP (seq_cons x f)))
(funa : A =>
dP
(seq_cons a
(IHn
(funx0 : nat -> A =>
P (seq_cons a x0))
(funf : nat -> A => dP (seq_cons a f)))))).1: A
nat -> A
exact (seq_cons wA (IHn (P o (seq_cons wA)) _)).Defined.(** We often need to apply [P] to [uniformsearch_witness n P dP], and this saves repeating [P]. *)Local Definitionpred_uniformsearch_witness (n : nat) (P : (nat -> A) -> Type)
(dP : forall (f : nat -> A), Decidable (P f))
:= P (uniformsearch_witness n P dP).(** The desired property of the witness function. *)
A: Type issearchable_A: IsSearchable A n: nat P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) is_mod: is_modulus_of_uniform_continuity n P h: pred_uniformsearch_witness n P dP
forallu : nat -> A, P u
A: Type issearchable_A: IsSearchable A n: nat P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) is_mod: is_modulus_of_uniform_continuity n P h: pred_uniformsearch_witness n P dP
forallu : nat -> A, P u
A: Type issearchable_A: IsSearchable A P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) is_mod: is_modulus_of_uniform_continuity 0 P h: pred_uniformsearch_witness 0 P dP
forallu : nat -> A, P u
A: Type issearchable_A: IsSearchable A n: nat P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) is_mod: is_modulus_of_uniform_continuity n.+1 P h: pred_uniformsearch_witness n.+1 P dP IHn: forall (P : (nat -> A) -> Type)
(dP : forallf : nat -> A, Decidable (P f)),
is_modulus_of_uniform_continuity n P ->
pred_uniformsearch_witness n P dP ->
forallu : nat -> A, P u
forallu : nat -> A, P u
A: Type issearchable_A: IsSearchable A P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) is_mod: is_modulus_of_uniform_continuity 0 P h: pred_uniformsearch_witness 0 P dP
forallu : nat -> A, P u
A: Type issearchable_A: IsSearchable A P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) is_mod: is_modulus_of_uniform_continuity 0 P h: pred_uniformsearch_witness 0 P dP u: nat -> A
P u
A: Type issearchable_A: IsSearchable A P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) is_mod: is_modulus_of_uniform_continuity 0 P h: pred_uniformsearch_witness 0 P dP u: nat -> A
pred_uniformsearch_witness 0 P dP = P u
(* For [n = 0], [is_mod u1 u2] says that [P u1 = P u2]. *)apply is_mod, sequence_type_us_zero.
A: Type issearchable_A: IsSearchable A n: nat P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) is_mod: is_modulus_of_uniform_continuity n.+1 P h: pred_uniformsearch_witness n.+1 P dP IHn: forall (P : (nat -> A) -> Type)
(dP : forallf : nat -> A, Decidable (P f)),
is_modulus_of_uniform_continuity n P ->
pred_uniformsearch_witness n P dP ->
forallu : nat -> A, P u
forallu : nat -> A, P u
A: Type issearchable_A: IsSearchable A n: nat P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) is_mod: is_modulus_of_uniform_continuity n.+1 P h: pred_uniformsearch_witness n.+1 P dP IHn: forall (P : (nat -> A) -> Type)
(dP : forallf : nat -> A, Decidable (P f)),
is_modulus_of_uniform_continuity n P ->
pred_uniformsearch_witness n P dP ->
forallu : nat -> A, P u u: nat -> A
P u
A: Type issearchable_A: IsSearchable A n: nat P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) is_mod: is_modulus_of_uniform_continuity n.+1 P h: pred_uniformsearch_witness n.+1 P dP IHn: forall (P : (nat -> A) -> Type)
(dP : forallf : nat -> A, Decidable (P f)),
is_modulus_of_uniform_continuity n P ->
pred_uniformsearch_witness n P dP ->
forallu : nat -> A, P u u: nat -> A
?Goal = P u
A: Type issearchable_A: IsSearchable A n: nat P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) is_mod: is_modulus_of_uniform_continuity n.+1 P h: pred_uniformsearch_witness n.+1 P dP IHn: forall (P : (nat -> A) -> Type)
(dP : forallf : nat -> A, Decidable (P f)),
is_modulus_of_uniform_continuity n P ->
pred_uniformsearch_witness n P dP ->
forallu : nat -> A, P u u: nat -> A
?Goal
A: Type issearchable_A: IsSearchable A n: nat P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) is_mod: is_modulus_of_uniform_continuity n.+1 P h: pred_uniformsearch_witness n.+1 P dP IHn: forall (P : (nat -> A) -> Type)
(dP : forallf : nat -> A, Decidable (P f)),
is_modulus_of_uniform_continuity n P ->
pred_uniformsearch_witness n P dP ->
forallu : nat -> A, P u u: nat -> A
P (seq_cons (u 0) (seq_tail u))
A: Type issearchable_A: IsSearchable A n: nat P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) is_mod: is_modulus_of_uniform_continuity n.+1 P h: pred_uniformsearch_witness n.+1 P dP IHn: forall (P : (nat -> A) -> Type)
(dP : forallf : nat -> A, Decidable (P f)),
is_modulus_of_uniform_continuity n P ->
pred_uniformsearch_witness n P dP ->
forallu : nat -> A, P u u: nat -> A
is_modulus_of_uniform_continuity n
(funx : nat -> A => P (seq_cons (u 0) x))
A: Type issearchable_A: IsSearchable A n: nat P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) is_mod: is_modulus_of_uniform_continuity n.+1 P h: pred_uniformsearch_witness n.+1 P dP IHn: forall (P : (nat -> A) -> Type)
(dP : forallf : nat -> A, Decidable (P f)),
is_modulus_of_uniform_continuity n P ->
pred_uniformsearch_witness n P dP ->
forallu : nat -> A, P u u: nat -> A
pred_uniformsearch_witness n
(funx : nat -> A => P (seq_cons (u 0) x))
(funf : nat -> A => dP (seq_cons (u 0) f))
A: Type issearchable_A: IsSearchable A n: nat P: (nat -> A) -> Type dP: forallf : nat -> A, Decidable (P f) is_mod: is_modulus_of_uniform_continuity n.+1 P h: pred_uniformsearch_witness n.+1 P dP IHn: forall (P : (nat -> A) -> Type)
(dP : forallf : nat -> A, Decidable (P f)),
is_modulus_of_uniform_continuity n P ->
pred_uniformsearch_witness n P dP ->
forallu : nat -> A, P u u: nat -> A
pred_uniformsearch_witness n
(funx : nat -> A => P (seq_cons (u 0) x))
(funf : nat -> A => dP (seq_cons (u 0) f))
(* The universality of [uniformsearch_witness] says that it is enough to check this statement with [u 0] replaced with [wA] above, and that is exactly what [h] proves, by the inductive step. *)exact ((issearchable_A
(funy => pred_uniformsearch_witness n (P o (seq_cons y)) _) _).2
h (u 0)).Defined.
A: Type issearchable_A: IsSearchable A
uniformly_searchable (nat -> A)
A: Type issearchable_A: IsSearchable A
uniformly_searchable (nat -> A)
A: Type issearchable_A: IsSearchable A P: (nat -> A) -> Type dP: foralla : nat -> A, Decidable (P a) contP: uniformly_continuous P
{w0 : nat -> A & P w0 -> forallu : nat -> A, P u}
A: Type issearchable_A: IsSearchable A P: (nat -> A) -> Type dP: foralla : nat -> A, Decidable (P a) contP: uniformly_continuous P
P (uniformsearch_witness (contP 0).1 P dP) ->
forallu : nat -> A, P u