| 1 |
(* simpl performs eta expansion *) |
| 2 |
|
| 3 |
Set Implicit Arguments. |
| 4 |
Require Import TestSuite.list. |
| 5 |
|
| 6 |
Definition k0 := Set. |
| 7 |
Definition k1 := k0 -> k0. |
| 8 |
|
| 9 |
(** iterating X n times *) |
| 10 |
Fixpoint Pow (X:k1)(k:nat){struct k}:k1:= |
| 11 |
match k with 0 => fun X => X |
| 12 |
| S k' => fun A => X (Pow X k' A) |
| 13 |
end. |
| 14 |
|
| 15 |
Parameter Bush: k1. |
| 16 |
Parameter BushToList: forall (A:k0), Bush A -> list A. |
| 17 |
|
| 18 |
Definition BushnToList (n:nat)(A:k0)(t:Pow Bush n A): list A. |
| 19 |
Proof. |
| 20 |
intros. |
| 21 |
induction n. |
| 22 |
exact (cons t nil). |
| 23 |
simpl in t. |
| 24 |
exact (flat_map IHn (BushToList t)). |
| 25 |
Defined. |
| 26 |
|
| 27 |
Parameter bnil : forall (A:k0), Bush A. |
| 28 |
Axiom BushToList_bnil: forall (A:k0), BushToList (bnil A) = nil(A:=A). |
| 29 |
|
| 30 |
Lemma BushnToList_bnil (n:nat)(A:k0): |
| 31 |
BushnToList (S n) A (bnil (Pow Bush n A)) = nil. |
| 32 |
Proof. |
| 33 |
intros. |
| 34 |
simpl. |
| 35 |
rewrite BushToList_bnil. |
| 36 |
simpl. |
| 37 |
reflexivity. |
| 38 |
Qed. |