Last active
November 3, 2018 02:22
-
-
Save ryuta-ito/eb94c113fa30265c6403ce27f81aa6d4 to your computer and use it in GitHub Desktop.
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
| Set Printing Coercions. | |
| Require Import Omega. | |
| Inductive hoge (n:nat) : Type := | |
| | fuga (m:nat) : m < n -> hoge n. | |
| Coercion nat_of_hoge {n:nat} (h : hoge n) := | |
| match h with | |
| | fuga _ n _ => n | |
| end. | |
| Lemma _0_2 : 0 < 2. Proof. omega. Qed. | |
| Lemma _1_2 : 1 < 2. Proof. omega. Qed. | |
| Lemma _0_3 : 0 < 3. Proof. omega. Qed. | |
| Lemma _1_3 : 1 < 3. Proof. omega. Qed. | |
| Lemma _2_3 : 2 < 3. Proof. omega. Qed. | |
| Check fuga 3 0 _0_3. | |
| (* fuga 3 0 _0_3 *) | |
| (* : hoge 3 *) | |
| Check fuga 3 1 _1_3. | |
| (* fuga 3 1 _1_3 *) | |
| (* : hoge 3 *) | |
| Check fuga 3 2 _2_3. | |
| (* fuga 3 2 _2_3 *) | |
| (* : hoge 3 *) | |
| Definition f2_1 := fuga 2 1 _1_2. | |
| Definition f3_2 := fuga 3 2 _2_3. | |
| Check f2_1 + f3_2. | |
| (* nat_of_hoge f2_1 + nat_of_hoge f3_2 *) | |
| (* : nat *) | |
| Eval compute in f2_1 + f3_2. | |
| (* = 3 *) | |
| (* : nat *) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment