| 1 |
Definition not_zero n := match n with 0 => False | S _ => True end. |
| 2 |
Definition not_one n := match n with 0 => False | S n => not_zero n end. |
| 3 |
|
| 4 |
(* Written as clear as I can make it. #[refine] is not needed. *) |
| 5 |
Fixpoint issue (n : nat) {struct n} : not_zero n -> False. |
| 6 |
refine |
| 7 |
match n with |
| 8 |
| 0 => fun h => h |
| 9 |
| S subn => fun h => |
| 10 |
let f (b : bool) (e : b = true) (x : nat) (Hx : not_one x) := |
| 11 |
let arg := (match (if b then x else subn) with 0 => subn | S subsubn => subsubn end) in |
| 12 |
issue arg _ |
| 13 |
in |
| 14 |
f true eq_refl 5 I |
| 15 |
end. |
| 16 |
subst b. |
| 17 |
destruct x; cbn in Hx. |
| 18 |
- now exfalso. |
| 19 |
- assumption. |
| 20 |
Fail Defined. |
| 21 |
Abort. |