1
0
mirror of https://github.com/nmvdw/HITs-Examples synced 2025-11-04 07:33:51 +01:00

Update the code to match the latest HoTT

HoTT commit 3526c344c47d32f5d4d268658031777239ec952b
This commit is contained in:
2017-11-06 15:25:56 +01:00
parent 55136b24e7
commit 8ce4cb760a
10 changed files with 31 additions and 328 deletions

View File

@@ -189,7 +189,7 @@ Section split.
(f : {a : A | P a } <~> Fin n + Unit).
Definition split : exists P' : Sub A, exists b : A,
prod ({a : A | P' a} <~> Fin n) (forall x, P x = (P' x merely (x = b))).
prod ({a : A | P' a} <~> Fin n) (forall x, P x = (P' x merely (x = b))).
Proof.
pose (fun x : A => sig (fun y : Fin n => x = (f^-1 (inl y)).1)) as P'.
assert (forall x, IsHProp (P' x)).

View File

@@ -7,7 +7,7 @@ Require Import sub prelude FSets list_representation subobjects.k_finite
Fixpoint listExt {A} (ls : list A) : Sub A := fun x =>
match ls with
| nil => False_hp
| cons a ls' => BuildhProp (Trunc (-1) (x = a)) listExt ls' x
| cons a ls' => merely (x = a) listExt ls' x
end.
Fixpoint map {A B} (f : A -> B) (ls : list A) : list B :=
@@ -260,7 +260,7 @@ Section fset_dec_enumerated.
strip_truncations. apply tr.
destruct Hls as [ls Hls].
exists (cons a ls). intros b. cbn.
apply (ap (fun z => _ z) (Hls b)).
apply (ap (fun z => _ z) (Hls b)).
Defined.
Definition Kf_enumerated : Kf A -> enumerated A.

View File

@@ -10,7 +10,7 @@ Section subobjects.
Global Instance sub_union : hasUnion Sub := join.
Global Instance sub_intersection : hasIntersection Sub := meet.
Global Instance sub_singleton : hasSingleton Sub A
:= fun a b => BuildhProp (Trunc (-1) (b = a)).
:= fun a b => merely (b = a).
Global Instance sub_membership : hasMembership Sub A := fun a X => X a.
Global Instance sub_comprehension : hasComprehension Sub A
:= fun ϕ X a => BuildhProp (X a * (ϕ a = true)).