HITs-Examples/FiniteSets/prelude.v

25 lines
768 B
Coq
Raw Normal View History

2017-09-07 15:19:48 +02:00
(** Some general prerequisities in homotopy type theory. *)
2017-08-24 16:50:11 +02:00
Require Import HoTT.
Lemma ap_inl_path_sum_inl {A B} (x y : A) (p : inl x = inl y) :
ap inl (path_sum_inl B p) = p.
Proof.
transitivity (@path_sum _ B (inl x) (inl y) (path_sum_inl B p));
[ | apply (eisretr_path_sum _) ].
destruct (path_sum_inl B p).
reflexivity.
Defined.
2017-09-07 15:19:48 +02:00
2017-08-24 16:50:11 +02:00
Lemma ap_equiv {A B} (f : A <~> B) {x y : A} (p : x = y) :
ap (f^-1 o f) p = eissect f x @ p @ (eissect f y)^.
2017-09-07 15:19:48 +02:00
Proof.
destruct p.
hott_simpl.
Defined.
2017-09-01 17:08:00 +02:00
Global Instance hprop_lem `{Univalence} (T : Type) (Ttrunc : IsHProp T) : IsHProp (T + ~T).
2017-09-07 15:19:48 +02:00
Proof.
apply (equiv_hprop_allpath _)^-1.
intros [x | nx] [y | ny] ; try f_ap ; try (apply Ttrunc) ; try contradiction.
- apply equiv_hprop_allpath. apply _.
Defined.