src/HOL/Recdef.thy
author paulson
Tue, 19 Apr 2005 18:08:44 +0200
changeset 15774 9df37a0e935d
parent 15481 fc075ae929e4
child 16417 9bc16273c2d4
permissions -rw-r--r--
more tidying of libraries in Reconstruction
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7701
2c8c3b7003e5 load / setup recdef package (TFL);
wenzelm
parents: 7357
diff changeset
     1
(*  Title:      HOL/Recdef.thy
2c8c3b7003e5 load / setup recdef package (TFL);
wenzelm
parents: 7357
diff changeset
     2
    ID:         $Id$
10773
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
     3
    Author:     Konrad Slind and Markus Wenzel, TU Muenchen
12023
wenzelm
parents: 11533
diff changeset
     4
*)
5123
97c1d5c7b701 stepping stones;
wenzelm
parents:
diff changeset
     5
12023
wenzelm
parents: 11533
diff changeset
     6
header {* TFL: recursive function definitions *}
7701
2c8c3b7003e5 load / setup recdef package (TFL);
wenzelm
parents: 7357
diff changeset
     7
15131
c69542757a4d New theory header syntax.
nipkow
parents: 12437
diff changeset
     8
theory Recdef
15140
322485b816ac import -> imports
nipkow
parents: 15131
diff changeset
     9
imports Wellfounded_Relations Datatype
7701
2c8c3b7003e5 load / setup recdef package (TFL);
wenzelm
parents: 7357
diff changeset
    10
files
15150
c7af682b9ee5 fix to eliminate excessive case-splits in the recursion equations, by Luca Dixon
paulson
parents: 15140
diff changeset
    11
  ("../TFL/casesplit.ML")
10773
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    12
  ("../TFL/utils.ML")
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    13
  ("../TFL/usyntax.ML")
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    14
  ("../TFL/dcterm.ML")
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    15
  ("../TFL/thms.ML")
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    16
  ("../TFL/rules.ML")
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    17
  ("../TFL/thry.ML")
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    18
  ("../TFL/tfl.ML")
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    19
  ("../TFL/post.ML")
15131
c69542757a4d New theory header syntax.
nipkow
parents: 12437
diff changeset
    20
  ("Tools/recdef_package.ML")
c69542757a4d New theory header syntax.
nipkow
parents: 12437
diff changeset
    21
begin
10773
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    22
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    23
lemma tfl_eq_True: "(x = True) --> x"
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    24
  by blast
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    25
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    26
lemma tfl_rev_eq_mp: "(x = y) --> y --> x";
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    27
  by blast
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    28
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    29
lemma tfl_simp_thm: "(x --> y) --> (x = x') --> (x' --> y)"
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    30
  by blast
6438
e55a1869ed38 'HOL/recdef' theory data;
wenzelm
parents: 5123
diff changeset
    31
10773
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    32
lemma tfl_P_imp_P_iff_True: "P ==> P = True"
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    33
  by blast
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    34
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    35
lemma tfl_imp_trans: "(A --> B) ==> (B --> C) ==> (A --> C)"
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    36
  by blast
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    37
12023
wenzelm
parents: 11533
diff changeset
    38
lemma tfl_disj_assoc: "(a \<or> b) \<or> c == a \<or> (b \<or> c)"
10773
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    39
  by simp
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    40
12023
wenzelm
parents: 11533
diff changeset
    41
lemma tfl_disjE: "P \<or> Q ==> P --> R ==> Q --> R ==> R"
10773
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    42
  by blast
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    43
12023
wenzelm
parents: 11533
diff changeset
    44
lemma tfl_exE: "\<exists>x. P x ==> \<forall>x. P x --> Q ==> Q"
10773
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    45
  by blast
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    46
15150
c7af682b9ee5 fix to eliminate excessive case-splits in the recursion equations, by Luca Dixon
paulson
parents: 15140
diff changeset
    47
use "../TFL/casesplit.ML"
10773
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    48
use "../TFL/utils.ML"
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    49
use "../TFL/usyntax.ML"
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    50
use "../TFL/dcterm.ML"
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    51
use "../TFL/thms.ML"
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    52
use "../TFL/rules.ML"
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    53
use "../TFL/thry.ML"
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    54
use "../TFL/tfl.ML"
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    55
use "../TFL/post.ML"
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    56
use "Tools/recdef_package.ML"
6438
e55a1869ed38 'HOL/recdef' theory data;
wenzelm
parents: 5123
diff changeset
    57
setup RecdefPackage.setup
e55a1869ed38 'HOL/recdef' theory data;
wenzelm
parents: 5123
diff changeset
    58
9855
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    59
lemmas [recdef_simp] =
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    60
  inv_image_def
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    61
  measure_def
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    62
  lex_prod_def
11284
981ea92a86dd made same_fst recdef_simp
nipkow
parents: 11165
diff changeset
    63
  same_fst_def
9855
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    64
  less_Suc_eq [THEN iffD2]
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    65
11165
3b69feb7d053 added image_cong to default congs of recdef
oheimb
parents: 10773
diff changeset
    66
lemmas [recdef_cong] = if_cong image_cong
9855
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    67
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    68
lemma let_cong [recdef_cong]:
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    69
    "M = N ==> (!!x. x = N ==> f x = g x) ==> Let M f = Let N g"
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    70
  by (unfold Let_def) blast
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    71
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    72
lemmas [recdef_wf] =
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    73
  wf_trancl
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    74
  wf_less_than
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    75
  wf_lex_prod
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    76
  wf_inv_image
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    77
  wf_measure
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    78
  wf_pred_nat
10653
55f33da63366 small mods.
nipkow
parents: 10212
diff changeset
    79
  wf_same_fst
9855
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    80
  wf_empty
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
    81
6438
e55a1869ed38 'HOL/recdef' theory data;
wenzelm
parents: 5123
diff changeset
    82
end