2017-08-16 17:37:12 +02:00
|
|
|
|
Require Import HoTT HitTactics.
|
2017-09-07 15:19:48 +02:00
|
|
|
|
Require Import subobjects.k_finite subobjects.b_finite FSets.
|
|
|
|
|
Require Import misc.T.
|
2017-08-16 17:37:12 +02:00
|
|
|
|
|
|
|
|
|
Class IsProjective (X : Type) :=
|
|
|
|
|
projective : forall {P Q : Type} (p : P -> Q) (f : X -> Q),
|
|
|
|
|
IsSurjection p -> hexists (fun (g : X -> P) => p o g = f).
|
|
|
|
|
|
|
|
|
|
Instance IsProjective_IsHProp `{Univalence} X : IsHProp (IsProjective X).
|
|
|
|
|
Proof. unfold IsProjective. apply _. Defined.
|
|
|
|
|
|
|
|
|
|
Instance Unit_Projective `{Univalence} : IsProjective Unit.
|
|
|
|
|
Proof.
|
|
|
|
|
intros P Q p f Hsurj.
|
|
|
|
|
pose (x' := center (merely (hfiber p (f tt)))).
|
|
|
|
|
simple refine (@Trunc_rec (-1) (hfiber p (f tt)) _ _ _ x'). clear x'; intro x.
|
|
|
|
|
simple refine (tr (fun _ => x.1;_)). simpl.
|
|
|
|
|
apply path_forall; intros [].
|
|
|
|
|
apply x.2.
|
|
|
|
|
Defined.
|
|
|
|
|
|
|
|
|
|
Instance Empty_Projective `{Univalence} : IsProjective Empty.
|
|
|
|
|
Proof.
|
|
|
|
|
intros P Q p f Hsurj.
|
|
|
|
|
apply tr. exists Empty_rec.
|
|
|
|
|
apply path_forall. intros [].
|
|
|
|
|
Defined.
|
|
|
|
|
|
|
|
|
|
Instance Sum_Projective `{Univalence} {A B: Type} `{IsProjective A} `{IsProjective B} :
|
|
|
|
|
IsProjective (A + B).
|
|
|
|
|
Proof.
|
|
|
|
|
intros P Q p f Hsurj.
|
|
|
|
|
pose (f1 := fun a => f (inl a)).
|
|
|
|
|
pose (f2 := fun b => f (inr b)).
|
|
|
|
|
pose (g1' := projective p f1 Hsurj).
|
|
|
|
|
pose (g2' := projective p f2 Hsurj).
|
|
|
|
|
simple refine (Trunc_rec _ g1') ; intros [g1 pg1].
|
|
|
|
|
simple refine (Trunc_rec _ g2') ; intros [g2 pg2].
|
|
|
|
|
simple refine (tr (_;_)).
|
|
|
|
|
- intros [a | b].
|
|
|
|
|
+ apply (g1 a).
|
|
|
|
|
+ apply (g2 b).
|
|
|
|
|
- apply path_forall; intros [a | b]; simpl.
|
|
|
|
|
+ apply (ap (fun h => h a) pg1).
|
|
|
|
|
+ apply (ap (fun h => h b) pg2).
|
|
|
|
|
Defined.
|
|
|
|
|
|
|
|
|
|
(* All Bishop-finite sets are projective *)
|
|
|
|
|
Section b_fin_projective.
|
|
|
|
|
Context `{Univalence}.
|
|
|
|
|
|
|
|
|
|
Global Instance bishop_projective (X : Type) (Hfin : Finite X) : IsProjective X.
|
|
|
|
|
Proof.
|
|
|
|
|
simple refine (finite_ind_hprop (fun X _ => IsProjective X) _ _ X);
|
|
|
|
|
simpl; apply _.
|
|
|
|
|
Defined.
|
|
|
|
|
End b_fin_projective.
|
|
|
|
|
|
|
|
|
|
Section k_fin_lemoo_projective.
|
|
|
|
|
Context `{Univalence}.
|
|
|
|
|
Context {LEMoo : forall (P : Type), Decidable P}.
|
|
|
|
|
Global Instance kuratowski_projective_oo (X : Type) (Hfin : Kf X) : IsProjective X.
|
|
|
|
|
Proof.
|
|
|
|
|
assert (Finite X).
|
2017-08-24 16:36:59 +02:00
|
|
|
|
{ eapply Kf_to_Bf; auto.
|
2017-08-16 17:37:12 +02:00
|
|
|
|
intros pp qq. apply LEMoo. }
|
|
|
|
|
apply _.
|
|
|
|
|
Defined.
|
|
|
|
|
End k_fin_lemoo_projective.
|
|
|
|
|
|
|
|
|
|
Section k_fin_lem_projective.
|
|
|
|
|
Context `{Univalence}.
|
|
|
|
|
Context {LEM : forall (P : Type) {Hprop : IsHProp P}, Decidable P}.
|
|
|
|
|
Variable (X : Type).
|
|
|
|
|
Context `{IsHSet X}.
|
|
|
|
|
|
|
|
|
|
Global Instance kuratowski_projective (Hfin : Kf X) : IsProjective X.
|
|
|
|
|
Proof.
|
|
|
|
|
assert (Finite X).
|
2017-08-24 16:36:59 +02:00
|
|
|
|
{ eapply Kf_to_Bf; auto.
|
2017-08-16 17:37:12 +02:00
|
|
|
|
intros pp qq. apply LEM. apply _. }
|
|
|
|
|
apply _.
|
|
|
|
|
Defined.
|
|
|
|
|
End k_fin_lem_projective.
|
|
|
|
|
|
|
|
|
|
Section k_fin_projective_lem.
|
|
|
|
|
Context `{Univalence}.
|
|
|
|
|
Variable (P : Type).
|
2017-09-01 16:29:48 +02:00
|
|
|
|
Context `{IsHProp P}.
|
2017-08-16 17:37:12 +02:00
|
|
|
|
|
2017-09-01 16:29:48 +02:00
|
|
|
|
Definition X : Type := TR (BuildhProp P).
|
2017-08-16 17:37:12 +02:00
|
|
|
|
Instance X_set : IsHSet X.
|
2017-09-01 16:29:48 +02:00
|
|
|
|
Proof.
|
|
|
|
|
apply _.
|
|
|
|
|
Defined.
|
2017-08-16 17:37:12 +02:00
|
|
|
|
|
|
|
|
|
Definition X_fin : Kf X.
|
|
|
|
|
Proof.
|
|
|
|
|
apply Kf_unfold.
|
2017-09-01 16:29:48 +02:00
|
|
|
|
exists ({|TR_zero _|} ∪ {|TR_one _|}).
|
2017-08-16 17:37:12 +02:00
|
|
|
|
hinduction.
|
2017-09-01 16:29:48 +02:00
|
|
|
|
- destruct x as [ [ ] | [ ] ].
|
|
|
|
|
* apply (tr (inl (tr idpath))).
|
|
|
|
|
* apply (tr (inr (tr idpath))).
|
|
|
|
|
- intros.
|
|
|
|
|
apply path_ishprop.
|
2017-08-16 17:37:12 +02:00
|
|
|
|
Defined.
|
|
|
|
|
|
|
|
|
|
Definition p (a : Unit + Unit) : X :=
|
|
|
|
|
match a with
|
2017-09-01 16:29:48 +02:00
|
|
|
|
| inl _ => TR_zero _
|
|
|
|
|
| inr _ => TR_one _
|
2017-08-16 17:37:12 +02:00
|
|
|
|
end.
|
|
|
|
|
|
|
|
|
|
Instance p_surj : IsSurjection p.
|
|
|
|
|
Proof.
|
|
|
|
|
apply BuildIsSurjection.
|
|
|
|
|
hinduction.
|
2017-09-01 16:29:48 +02:00
|
|
|
|
- destruct x as [[ ] | [ ]].
|
|
|
|
|
* apply tr. exists (inl tt). reflexivity.
|
|
|
|
|
* apply tr. exists (inr tt). reflexivity.
|
|
|
|
|
- intros.
|
|
|
|
|
apply path_ishprop.
|
2017-08-16 17:37:12 +02:00
|
|
|
|
Defined.
|
|
|
|
|
|
|
|
|
|
Lemma LEM `{IsProjective X} : P + ~P.
|
|
|
|
|
Proof.
|
|
|
|
|
pose (k := projective p idmap _).
|
|
|
|
|
unfold hexists in k.
|
|
|
|
|
simple refine (Trunc_rec _ k); clear k; intros [g Hg].
|
2017-09-01 16:29:48 +02:00
|
|
|
|
destruct (dec (g (TR_zero _) = g (TR_one _))) as [Hℵ | Hℵ].
|
2017-08-16 17:37:12 +02:00
|
|
|
|
- left.
|
2017-09-01 16:29:48 +02:00
|
|
|
|
assert (TR_zero (BuildhProp P) = TR_one _) as Hbc.
|
2017-08-16 17:37:12 +02:00
|
|
|
|
{ pose (ap p Hℵ) as Hα.
|
2017-09-01 16:29:48 +02:00
|
|
|
|
rewrite (ap (fun h => h (TR_zero _)) Hg) in Hα.
|
|
|
|
|
rewrite (ap (fun h => h (TR_one _)) Hg) in Hα.
|
2017-08-16 17:37:12 +02:00
|
|
|
|
assumption. }
|
2017-09-01 16:29:48 +02:00
|
|
|
|
refine (classes_eq_related _ _ _ Hbc).
|
2017-08-16 17:37:12 +02:00
|
|
|
|
- right. intros HP.
|
|
|
|
|
apply Hℵ.
|
2017-09-01 16:29:48 +02:00
|
|
|
|
refine (ap g (related_classes_eq _ _)).
|
|
|
|
|
apply HP.
|
2017-08-16 17:37:12 +02:00
|
|
|
|
Defined.
|
|
|
|
|
End k_fin_projective_lem.
|