Created
March 28, 2016 16:44
-
-
Save bmsherman/23239db85008ee60b69c to your computer and use it in GitHub Desktop.
An isomorphism of types involving truncation.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Record T { A B : Type } : Type := | |
{ to : A -> B | |
; from : B -> A | |
; from_to : forall (a : A), from (to a) = a | |
; to_from : forall (b : B), to (from b) = b | |
}. | |
Arguments T : clear implicits. | |
Inductive inhabited {A : Type} : Prop := | |
| elem (a : A) : inhabited. | |
Arguments inhabited : clear implicits. | |
Require Import ProofIrrelevance. | |
Theorem inhabited_idempotent {A : Type} : | |
T A (inhabited A * A). | |
Proof. | |
refine ( | |
{| to := fun a => (elem a, a) | |
; from := fun p => snd p | |
|} | |
). | |
- intros. reflexivity. | |
- intros. destruct b. simpl. | |
replace (elem a) with i by apply proof_irrelevance. | |
reflexivity. | |
Defined. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment