Last active
August 15, 2018 05:05
-
-
Save yoshihiro503/157c6482dde50a70f8e07e8855acc4e0 to your computer and use it in GitHub Desktop.
Vec 0の元は全部VNilであることの証明(see https://twitter.com/i/web/status/1027868640169717762)
This file contains hidden or 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
Require Import JMeq. | |
Section Vec. | |
Variable A:Set. | |
Inductive Vec : nat -> Set := | |
| VNil : Vec O | |
| VCons : forall n, A -> Vec n -> Vec (S n). | |
Lemma Vec0_is_JMeq_to_VNil : forall n (v : Vec n), | |
n = 0 -> JMeq v VNil. | |
Proof. | |
intros n v. destruct v. | |
- reflexivity. | |
- discriminate. | |
Qed. | |
Goal forall v : Vec 0, v = VNil. | |
Proof. | |
intros v. apply JMeq_eq. | |
now apply Vec0_is_JMeq_to_VNil. | |
Qed. | |
End Vec. |
This file contains hidden or 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
Section Vec. | |
Variable A:Set. | |
Inductive Vec : nat -> Set := | |
| VNil : Vec O | |
| VCons : forall n, A -> Vec n -> Vec (S n). | |
Goal forall v : Vec 0, v = VNil. | |
Proof. | |
intros v. | |
refine(match v with | |
| VNil => _ | |
| _ => _ | |
end). | |
- reflexivity. | |
- exact idProp. | |
Qed. | |
End Vec. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment