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

Solve exercise 3.15 and 3.17 #1678

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Next Next commit
Solve exercise 3.15 and 3.17
  • Loading branch information
HyunggyuJang committed Nov 4, 2022
commit da9b3099387a692ba7bd1c44620b869e01b5be2a
34 changes: 32 additions & 2 deletions contrib/HoTTBookExercises.v
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,23 @@ End Book_3_14.
(* ================================================== ex:impred-brck *)
(** Exercise 3.15 *)


Section Book_3_15.
Definition Book_3_15_rec {A B} `{IsHProp B}
: (A -> B) -> (forall P : HProp, (A -> P) -> P) -> B.
Proof.
intros f trA.
set (B' := Build_HProp B).
specialize (trA B').
apply trA.
assumption.
Defined.
Lemma Book_3_15_eq {A B} `{IsHProp B} (f : A -> B)
: forall a, f a = Book_3_15_rec f (fun _ f' => f' a).
Proof.
intro a. reflexivity.
Qed.
(* proportional resizing is needed? *)
End Book_3_15.

(* ================================================== ex:lem-impl-dn-commutes *)
(** Exercise 3.16 *)
Expand All @@ -949,7 +965,21 @@ End Book_3_14.
(* ================================================== ex:prop-trunc-ind *)
(** Exercise 3.17 *)


Section Book_3_17.
Theorem prop_trunc_ind
: forall A (B : merely A -> Type),
(forall a, B (tr a))
-> (forall x, IsHProp (B x))
-> forall x, B x.
Proof.
intros A B base p x.
specialize (p x).
refine (Trunc_rec _ x).
intro a.
assert (H: tr a = x) by (apply path_ishprop).
destruct H. exact (base a).
Defined.
End Book_3_17.

(* ================================================== ex:lem-ldn *)
(** Exercise 3.18 *)
Expand Down