Timings for GCH.v
From HoTT Require Import TruncType abstract_algebra.
From HoTT Require Import Universes.Smallness.
From HoTT Require Import Spaces.Nat.Core Spaces.Card.
Local Open Scope hprop_scope.
(** * Formulation of GCH *)
(* GCH states that for any infinite set X with Y between X and P(X) either Y embeds into X or P(X) embeds into Y. *)
Definition GCH :=
forall X Y : HSet, infinite X -> InjectsInto X Y -> InjectsInto Y (X -> HProp) -> InjectsInto Y X + InjectsInto (X -> HProp) Y.
(** * GCH is a proposition *)
Lemma Cantor_inj {PR : PropResizing} {FE : Funext} X :
~ Injection (X -> HProp) X.
pose (p n := Build_HProp (smalltype (forall q, i q = n -> ~ q n))).
enough (Hp : p (i p) <-> ~ p (i p)).
apply Hp; apply Hp; intros H; by apply Hp.
apply equiv_smalltype in H.
(* The concluding disjunction of GCH is exclusive since otherwise we'd obtain an injection of P(X) into X. *)
Lemma hprop_GCH {PR : PropResizing} {FE : Funext} :
IsHProp GCH.
repeat (napply istrunc_forall; intros).
enough (H = H') as ->; trivial.
eapply merely_destruct; try eapply (Cantor_inj a); trivial.
by apply InjectsInto_trans with a0.
eapply merely_destruct; try eapply (Cantor_inj a); trivial.
by apply InjectsInto_trans with a0.
enough (H = H') as ->; trivial.
Context {PR : PropResizing}.
Definition hpaths (x y : X) :=
Build_HProp (paths x y).
Definition sing (p : X -> HProp) :=
exists x, p = hpaths x.
Let sings :=
{ p : X -> HProp | sing p \/ (P + ~ P) }.
(* The main idea is that for a given set X and proposition P, the set sings fits between X and P(X).
Then CH for X implies that either sings embeds into X (which can be refuted constructively),
or that P(X) embeds into sings, from which we can extract a proof of P + ~P. *)
Lemma Cantor_sing (i : (X -> HProp) -> (X -> HProp)) :
IsInjective i -> exists p, ~ sing (i p).
pose (p n := Build_HProp (smalltype (forall q, i q = hpaths n -> ~ q n))).
enough (Hp : p n <-> ~ p n).
apply Hp; apply Hp; intros H; by apply Hp.
apply equiv_smalltype in H.
Lemma injective_proj1 {Z} (r : Z -> HProp) :
IsInjective (@proj1 Z r).
intros [p Hp] [q Hq]; cbn.
unshelve eapply path_sigma; cbn.
Lemma inject_sings :
(P + ~ P) -> Injection (X -> HProp) sings.
change p with ((exist (fun r => sing r \/ (P + ~ P)) p (tr (inr HP))).1).
Theorem CH_LEM :
(Injection X sings -> Injection sings (X -> HProp) -> ~ (Injection sings X) -> InjectsInto (X -> HProp) sings)
-> P \/ ~ P.
eapply merely_destruct; try apply ch.
by apply injective_proj1.
assert (HP' : ~ ~ (P + ~ P)).
intros HP % inject_sings.
by eapply (Injection_trans _ _ _ HP).
destruct (Cantor_sing (fun p => @proj1 _ _ (i p))) as [p HP].
intros x y H % injective_proj1.
destruct (i p) as [q Hq]; cbn in *.
eapply merely_destruct; try exact Hq.
intros [H|H]; [destruct (HP H)|by apply tr].
(* We can instantiate the previous lemma with nat to obtain GCH -> LEM. *)
Theorem GCH_LEM {PR : PropResizing} {UA : Univalence} :
GCH -> (forall P : HProp, P \/ ~ P).
eapply (CH_LEM (Build_HSet nat)); try exact _.
pose (sings := { p : nat -> HProp | sing (Build_HSet nat) p \/ (P + ~ P) }).
destruct (gch (Build_HSet nat) (Build_HSet sings)) as [H|H].
eapply merely_destruct; try exact H.