src/HOL/Induct/Tree.ML
author paulson
Thu, 11 Nov 1999 10:25:17 +0100
changeset 8005 b64d86018785
parent 7018 ae18bb3075c3
permissions -rw-r--r--
new-style infix declaration for "image"
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7018
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
     1
(*  Title:      HOL/Induct/Tree.ML
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
     2
    ID:         $Id$
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
     3
    Author:     Stefan Berghofer,  TU Muenchen
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
     4
    Copyright   1999  TU Muenchen
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
     5
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
     6
Infinitely branching trees
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
     7
*)
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
     8
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
     9
Goal "map_tree g (map_tree f t) = map_tree (g o f) t";
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
    10
by (induct_tac "t" 1);
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
    11
by (ALLGOALS Asm_simp_tac);
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
    12
qed "tree_map_compose";
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
    13
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
    14
val prems = Goal "(!!x. P x ==> Q (f x)) ==>  \
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
    15
   \    exists_tree P ts --> exists_tree Q (map_tree f ts)";
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
    16
by (induct_tac "ts" 1);
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
    17
by (ALLGOALS (asm_simp_tac (simpset() addsimps prems)));
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
    18
by (Fast_tac 1);
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
    19
qed "exists_map";
ae18bb3075c3 Infinitely branching trees.
berghofe
parents:
diff changeset
    20