Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding compatibility with HoTT for 8.19 #600

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions theories/HoTT/EqDec.v
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Require Import Equations.Init.
Require Import Equations.HoTT.Logic.
Require Import Equations.HoTT.Classes.

From HoTT Require Import Basics.Trunc.

(** Decidable equality.

We redevelop the derivation of [K] from decidable equality on [A] making
Expand Down Expand Up @@ -201,8 +203,9 @@ Qed.
#[export]
Instance eqdec_hset (A : Type) `(UIP A) : IsHSet A.
Proof.
red. red. intros *. exists (uip x0 y0). intros e.
destruct x0. apply uip.
apply equiv_istrunc_unfold ; cbn ; intros ??.
apply hprop_allpath.
now apply H.
Defined.

Lemma sigma_eq@{i} (A : Type@{i}) (P : A -> Type@{i}) (x y : sigma P) :
Expand All @@ -215,7 +218,7 @@ Defined.

Lemma is_hset {A} `{H : IsHSet A} {x y : A} (p q : x = y) : p = q.
Proof.
apply H.
apply path_ishprop.
Defined.

Theorem inj_sigma_r@{i} {A : Type@{i}} `{H : IsHSet A} {P : A -> Type@{i}} {x} {y y':P x} :
Expand All @@ -230,8 +233,6 @@ Definition apd_eq {A} {x y : A} (p : x = y) {z} (q : z = x) :
transport (@paths A z) p q = q @ p.
Proof. now destruct p, q. Defined.

Require Import HoTT.Basics.Trunc.

Lemma hprop_hset {A} (h : IsHProp A) : IsHSet A.
Proof.
apply istrunc_hprop.
Expand All @@ -240,9 +241,8 @@ Defined.
(** Proof that equality proofs in 0-truncated types are connected *)
Lemma hset_pi {A} `{H : IsHSet A} (x y : A) (p q : x = y) (r : p = q) : is_hset p q = r.
Proof.
red in H.
pose (hprop_hset (H x y)).
apply i.
enough (Contr (p = q)) by now apply path_ishprop.
apply (H _ _ _).
Defined.

Lemma is_hset_refl {A} `{H : IsHSet A} (x : A) : is_hset (@idpath _ x) 1 = 1%path.
Expand Down