| 1 |
Fail Fixpoint F (n : nat) : nat := |
| 2 |
match n with |
| 3 |
| O => O |
| 4 |
| S k => |
| 5 |
(fix f (p : nat) (m : nat) {struct m} := |
| 6 |
match m with O => p | S m' => g (S p) m' end |
| 7 |
with g (q : nat) (m : nat) {struct m} := |
| 8 |
match m with O => F q | S m' => f q m' end |
| 9 |
for f) k k |
| 10 |
end. |
| 11 |
|
| 12 |
(* |
| 13 |
Lemma F_S k: |
| 14 |
F (S k) = |
| 15 |
(fix f (p : nat) (m : nat) {struct m} := |
| 16 |
match m with O => p | S m' => g (S p) m' end |
| 17 |
with g (q : nat) (m : nat) {struct m} := |
| 18 |
match m with O => S (F q) | S m' => f q m' end |
| 19 |
for f) k k. |
| 20 |
Proof. |
| 21 |
reflexivity. |
| 22 |
Qed. |
| 23 |
|
| 24 |
Lemma F_S': |
| 25 |
F 2 = S (F 2). |
| 26 |
Proof. |
| 27 |
etransitivity. |
| 28 |
1: rewrite F_S. |
| 29 |
all: reflexivity. |
| 30 |
Qed. |
| 31 |
|
| 32 |
Goal False. |
| 33 |
Proof. |
| 34 |
pose proof F_S'. |
| 35 |
remember (F 2). |
| 36 |
clear Heqn. |
| 37 |
induction n. |
| 38 |
- congruence. |
| 39 |
- inversion H; subst; tauto. |
| 40 |
Qed. |
| 41 |
*) |