src/HOLCF/Fix.thy
author huffman
Sun, 14 Mar 2010 19:48:33 -0700
changeset 35794 8cd7134275cc
parent 35055 f0ecf952b864
child 35915 5ea16bc10a7a
permissions -rw-r--r--
use headers consistently
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2275
diff changeset
     1
(*  Title:      HOLCF/Fix.thy
1479
21eb5e156d91 expanded tabs
clasohm
parents: 1410
diff changeset
     2
    Author:     Franz Regensburger
35794
8cd7134275cc use headers consistently
huffman
parents: 35055
diff changeset
     3
    Author:     Brian Huffman
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
     4
*)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
     5
15577
e16da3068ad6 fix headers
huffman
parents: 15576
diff changeset
     6
header {* Fixed point operator and admissibility *}
e16da3068ad6 fix headers
huffman
parents: 15576
diff changeset
     7
e16da3068ad6 fix headers
huffman
parents: 15576
diff changeset
     8
theory Fix
27316
9e74019041d4 use new-style abbreviation/notation for fix syntax
huffman
parents: 27270
diff changeset
     9
imports Cfun Cprod
15577
e16da3068ad6 fix headers
huffman
parents: 15576
diff changeset
    10
begin
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    11
16082
ebb53ebfd4e2 added defaultsort declaration
huffman
parents: 16079
diff changeset
    12
defaultsort pcpo
ebb53ebfd4e2 added defaultsort declaration
huffman
parents: 16079
diff changeset
    13
18093
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
    14
subsection {* Iteration *}
16005
42f3f299ee68 cleaned up and shortened some proofs
huffman
parents: 15857
diff changeset
    15
34941
156925dd67af dropped some old primrecs and some constdefs
haftmann
parents: 33590
diff changeset
    16
primrec iterate :: "nat \<Rightarrow> ('a::cpo \<rightarrow> 'a) \<rightarrow> ('a \<rightarrow> 'a)" where
156925dd67af dropped some old primrecs and some constdefs
haftmann
parents: 33590
diff changeset
    17
    "iterate 0 = (\<Lambda> F x. x)"
156925dd67af dropped some old primrecs and some constdefs
haftmann
parents: 33590
diff changeset
    18
  | "iterate (Suc n) = (\<Lambda> F x. F\<cdot>(iterate n\<cdot>F\<cdot>x))"
5192
704dd3a6d47d Adapted to new datatype package.
berghofe
parents: 4721
diff changeset
    19
18093
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
    20
text {* Derive inductive properties of iterate from primitive recursion *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
    21
18074
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    22
lemma iterate_0 [simp]: "iterate 0\<cdot>F\<cdot>x = x"
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    23
by simp
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    24
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    25
lemma iterate_Suc [simp]: "iterate (Suc n)\<cdot>F\<cdot>x = F\<cdot>(iterate n\<cdot>F\<cdot>x)"
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    26
by simp
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    27
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    28
declare iterate.simps [simp del]
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    29
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    30
lemma iterate_Suc2: "iterate (Suc n)\<cdot>F\<cdot>x = iterate n\<cdot>F\<cdot>(F\<cdot>x)"
27270
6a353260735e add lemma iterate_iterate
huffman
parents: 27185
diff changeset
    31
by (induct n) simp_all
6a353260735e add lemma iterate_iterate
huffman
parents: 27185
diff changeset
    32
6a353260735e add lemma iterate_iterate
huffman
parents: 27185
diff changeset
    33
lemma iterate_iterate:
6a353260735e add lemma iterate_iterate
huffman
parents: 27185
diff changeset
    34
  "iterate m\<cdot>F\<cdot>(iterate n\<cdot>F\<cdot>x) = iterate (m + n)\<cdot>F\<cdot>x"
6a353260735e add lemma iterate_iterate
huffman
parents: 27185
diff changeset
    35
by (induct m) simp_all
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
    36
15637
d2a06007ebfa changed comments to text blocks, cleaned up a few proofs
huffman
parents: 15577
diff changeset
    37
text {*
d2a06007ebfa changed comments to text blocks, cleaned up a few proofs
huffman
parents: 15577
diff changeset
    38
  The sequence of function iterations is a chain.
d2a06007ebfa changed comments to text blocks, cleaned up a few proofs
huffman
parents: 15577
diff changeset
    39
  This property is essential since monotonicity of iterate makes no sense.
d2a06007ebfa changed comments to text blocks, cleaned up a few proofs
huffman
parents: 15577
diff changeset
    40
*}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
    41
18074
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    42
lemma chain_iterate2: "x \<sqsubseteq> F\<cdot>x \<Longrightarrow> chain (\<lambda>i. iterate i\<cdot>F\<cdot>x)"
16214
e3816a7db016 cleaned up proof of cont_Ifix
huffman
parents: 16082
diff changeset
    43
by (rule chainI, induct_tac i, auto elim: monofun_cfun_arg)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
    44
18074
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    45
lemma chain_iterate [simp]: "chain (\<lambda>i. iterate i\<cdot>F\<cdot>\<bottom>)"
16005
42f3f299ee68 cleaned up and shortened some proofs
huffman
parents: 15857
diff changeset
    46
by (rule chain_iterate2 [OF minimal])
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
    47
18093
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
    48
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
    49
subsection {* Least fixed point operator *}
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
    50
25131
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18095
diff changeset
    51
definition
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18095
diff changeset
    52
  "fix" :: "('a \<rightarrow> 'a) \<rightarrow> 'a" where
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18095
diff changeset
    53
  "fix = (\<Lambda> F. \<Squnion>i. iterate i\<cdot>F\<cdot>\<bottom>)"
18093
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
    54
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
    55
text {* Binder syntax for @{term fix} *}
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
    56
27316
9e74019041d4 use new-style abbreviation/notation for fix syntax
huffman
parents: 27270
diff changeset
    57
abbreviation
9e74019041d4 use new-style abbreviation/notation for fix syntax
huffman
parents: 27270
diff changeset
    58
  fix_syn :: "('a \<Rightarrow> 'a) \<Rightarrow> 'a"  (binder "FIX " 10) where
9e74019041d4 use new-style abbreviation/notation for fix syntax
huffman
parents: 27270
diff changeset
    59
  "fix_syn (\<lambda>x. f x) \<equiv> fix\<cdot>(\<Lambda> x. f x)"
18093
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
    60
27316
9e74019041d4 use new-style abbreviation/notation for fix syntax
huffman
parents: 27270
diff changeset
    61
notation (xsymbols)
9e74019041d4 use new-style abbreviation/notation for fix syntax
huffman
parents: 27270
diff changeset
    62
  fix_syn  (binder "\<mu> " 10)
18093
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
    63
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
    64
text {* Properties of @{term fix} *}
18074
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    65
18090
9d5cfd71f510 moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents: 18078
diff changeset
    66
text {* direct connection between @{term fix} and iteration *}
18074
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    67
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    68
lemma fix_def2: "fix\<cdot>F = (\<Squnion>i. iterate i\<cdot>F\<cdot>\<bottom>)"
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    69
apply (unfold fix_def)
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    70
apply (rule beta_cfun)
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    71
apply (rule cont2cont_lub)
18092
2c5d5da79a1e renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
huffman
parents: 18090
diff changeset
    72
apply (rule ch2ch_lambda)
18074
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    73
apply (rule chain_iterate)
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    74
apply simp
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    75
done
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    76
35055
f0ecf952b864 add lemma iterate_below_fix
huffman
parents: 34941
diff changeset
    77
lemma iterate_below_fix: "iterate n\<cdot>f\<cdot>\<bottom> \<sqsubseteq> fix\<cdot>f"
f0ecf952b864 add lemma iterate_below_fix
huffman
parents: 34941
diff changeset
    78
  unfolding fix_def2
f0ecf952b864 add lemma iterate_below_fix
huffman
parents: 34941
diff changeset
    79
  using chain_iterate by (rule is_ub_thelub)
f0ecf952b864 add lemma iterate_below_fix
huffman
parents: 34941
diff changeset
    80
15637
d2a06007ebfa changed comments to text blocks, cleaned up a few proofs
huffman
parents: 15577
diff changeset
    81
text {*
d2a06007ebfa changed comments to text blocks, cleaned up a few proofs
huffman
parents: 15577
diff changeset
    82
  Kleene's fixed point theorems for continuous functions in pointed
d2a06007ebfa changed comments to text blocks, cleaned up a few proofs
huffman
parents: 15577
diff changeset
    83
  omega cpo's
d2a06007ebfa changed comments to text blocks, cleaned up a few proofs
huffman
parents: 15577
diff changeset
    84
*}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
    85
18074
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    86
lemma fix_eq: "fix\<cdot>F = F\<cdot>(fix\<cdot>F)"
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    87
apply (simp add: fix_def2)
16005
42f3f299ee68 cleaned up and shortened some proofs
huffman
parents: 15857
diff changeset
    88
apply (subst lub_range_shift [of _ 1, symmetric])
42f3f299ee68 cleaned up and shortened some proofs
huffman
parents: 15857
diff changeset
    89
apply (rule chain_iterate)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
    90
apply (subst contlub_cfun_arg)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
    91
apply (rule chain_iterate)
16005
42f3f299ee68 cleaned up and shortened some proofs
huffman
parents: 15857
diff changeset
    92
apply simp
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
    93
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
    94
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29138
diff changeset
    95
lemma fix_least_below: "F\<cdot>x \<sqsubseteq> x \<Longrightarrow> fix\<cdot>F \<sqsubseteq> x"
18074
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
    96
apply (simp add: fix_def2)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
    97
apply (rule is_lub_thelub)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
    98
apply (rule chain_iterate)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
    99
apply (rule ub_rangeI)
16005
42f3f299ee68 cleaned up and shortened some proofs
huffman
parents: 15857
diff changeset
   100
apply (induct_tac i)
42f3f299ee68 cleaned up and shortened some proofs
huffman
parents: 15857
diff changeset
   101
apply simp
42f3f299ee68 cleaned up and shortened some proofs
huffman
parents: 15857
diff changeset
   102
apply simp
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29138
diff changeset
   103
apply (erule rev_below_trans)
16214
e3816a7db016 cleaned up proof of cont_Ifix
huffman
parents: 16082
diff changeset
   104
apply (erule monofun_cfun_arg)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   105
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   106
16214
e3816a7db016 cleaned up proof of cont_Ifix
huffman
parents: 16082
diff changeset
   107
lemma fix_least: "F\<cdot>x = x \<Longrightarrow> fix\<cdot>F \<sqsubseteq> x"
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29138
diff changeset
   108
by (rule fix_least_below, simp)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   109
27185
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   110
lemma fix_eqI:
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   111
  assumes fixed: "F\<cdot>x = x" and least: "\<And>z. F\<cdot>z = z \<Longrightarrow> x \<sqsubseteq> z"
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   112
  shows "fix\<cdot>F = x"
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29138
diff changeset
   113
apply (rule below_antisym)
27185
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   114
apply (rule fix_least [OF fixed])
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   115
apply (rule least [OF fix_eq [symmetric]])
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   116
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   117
16214
e3816a7db016 cleaned up proof of cont_Ifix
huffman
parents: 16082
diff changeset
   118
lemma fix_eq2: "f \<equiv> fix\<cdot>F \<Longrightarrow> f = F\<cdot>f"
15637
d2a06007ebfa changed comments to text blocks, cleaned up a few proofs
huffman
parents: 15577
diff changeset
   119
by (simp add: fix_eq [symmetric])
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   120
16214
e3816a7db016 cleaned up proof of cont_Ifix
huffman
parents: 16082
diff changeset
   121
lemma fix_eq3: "f \<equiv> fix\<cdot>F \<Longrightarrow> f\<cdot>x = F\<cdot>f\<cdot>x"
15637
d2a06007ebfa changed comments to text blocks, cleaned up a few proofs
huffman
parents: 15577
diff changeset
   122
by (erule fix_eq2 [THEN cfun_fun_cong])
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   123
16214
e3816a7db016 cleaned up proof of cont_Ifix
huffman
parents: 16082
diff changeset
   124
lemma fix_eq4: "f = fix\<cdot>F \<Longrightarrow> f = F\<cdot>f"
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   125
apply (erule ssubst)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   126
apply (rule fix_eq)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   127
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   128
16214
e3816a7db016 cleaned up proof of cont_Ifix
huffman
parents: 16082
diff changeset
   129
lemma fix_eq5: "f = fix\<cdot>F \<Longrightarrow> f\<cdot>x = F\<cdot>f\<cdot>x"
e3816a7db016 cleaned up proof of cont_Ifix
huffman
parents: 16082
diff changeset
   130
by (erule fix_eq4 [THEN cfun_fun_cong])
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   131
16556
a0c8d0499b5f added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents: 16388
diff changeset
   132
text {* strictness of @{term fix} *}
a0c8d0499b5f added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents: 16388
diff changeset
   133
16917
1fe50b19daba add theorem fix_defined_iff; cleaned up
huffman
parents: 16556
diff changeset
   134
lemma fix_defined_iff: "(fix\<cdot>F = \<bottom>) = (F\<cdot>\<bottom> = \<bottom>)"
1fe50b19daba add theorem fix_defined_iff; cleaned up
huffman
parents: 16556
diff changeset
   135
apply (rule iffI)
1fe50b19daba add theorem fix_defined_iff; cleaned up
huffman
parents: 16556
diff changeset
   136
apply (erule subst)
1fe50b19daba add theorem fix_defined_iff; cleaned up
huffman
parents: 16556
diff changeset
   137
apply (rule fix_eq [symmetric])
1fe50b19daba add theorem fix_defined_iff; cleaned up
huffman
parents: 16556
diff changeset
   138
apply (erule fix_least [THEN UU_I])
1fe50b19daba add theorem fix_defined_iff; cleaned up
huffman
parents: 16556
diff changeset
   139
done
1fe50b19daba add theorem fix_defined_iff; cleaned up
huffman
parents: 16556
diff changeset
   140
16556
a0c8d0499b5f added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents: 16388
diff changeset
   141
lemma fix_strict: "F\<cdot>\<bottom> = \<bottom> \<Longrightarrow> fix\<cdot>F = \<bottom>"
16917
1fe50b19daba add theorem fix_defined_iff; cleaned up
huffman
parents: 16556
diff changeset
   142
by (simp add: fix_defined_iff)
16556
a0c8d0499b5f added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents: 16388
diff changeset
   143
a0c8d0499b5f added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents: 16388
diff changeset
   144
lemma fix_defined: "F\<cdot>\<bottom> \<noteq> \<bottom> \<Longrightarrow> fix\<cdot>F \<noteq> \<bottom>"
16917
1fe50b19daba add theorem fix_defined_iff; cleaned up
huffman
parents: 16556
diff changeset
   145
by (simp add: fix_defined_iff)
16556
a0c8d0499b5f added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents: 16388
diff changeset
   146
a0c8d0499b5f added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents: 16388
diff changeset
   147
text {* @{term fix} applied to identity and constant functions *}
a0c8d0499b5f added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents: 16388
diff changeset
   148
a0c8d0499b5f added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents: 16388
diff changeset
   149
lemma fix_id: "(\<mu> x. x) = \<bottom>"
a0c8d0499b5f added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents: 16388
diff changeset
   150
by (simp add: fix_strict)
a0c8d0499b5f added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents: 16388
diff changeset
   151
a0c8d0499b5f added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents: 16388
diff changeset
   152
lemma fix_const: "(\<mu> x. c) = c"
18074
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
   153
by (subst fix_eq, simp)
16556
a0c8d0499b5f added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents: 16388
diff changeset
   154
18090
9d5cfd71f510 moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents: 18078
diff changeset
   155
subsection {* Fixed point induction *}
9d5cfd71f510 moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents: 18078
diff changeset
   156
9d5cfd71f510 moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents: 18078
diff changeset
   157
lemma fix_ind: "\<lbrakk>adm P; P \<bottom>; \<And>x. P x \<Longrightarrow> P (F\<cdot>x)\<rbrakk> \<Longrightarrow> P (fix\<cdot>F)"
27185
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   158
unfolding fix_def2
25925
3dc4acca4388 change lemma admD to rule_format
huffman
parents: 25131
diff changeset
   159
apply (erule admD)
18090
9d5cfd71f510 moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents: 18078
diff changeset
   160
apply (rule chain_iterate)
27185
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   161
apply (rule nat_induct, simp_all)
18090
9d5cfd71f510 moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents: 18078
diff changeset
   162
done
9d5cfd71f510 moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents: 18078
diff changeset
   163
9d5cfd71f510 moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents: 18078
diff changeset
   164
lemma def_fix_ind:
9d5cfd71f510 moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents: 18078
diff changeset
   165
  "\<lbrakk>f \<equiv> fix\<cdot>F; adm P; P \<bottom>; \<And>x. P x \<Longrightarrow> P (F\<cdot>x)\<rbrakk> \<Longrightarrow> P f"
9d5cfd71f510 moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents: 18078
diff changeset
   166
by (simp add: fix_ind)
9d5cfd71f510 moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents: 18078
diff changeset
   167
27185
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   168
lemma fix_ind2:
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   169
  assumes adm: "adm P"
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   170
  assumes 0: "P \<bottom>" and 1: "P (F\<cdot>\<bottom>)"
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   171
  assumes step: "\<And>x. \<lbrakk>P x; P (F\<cdot>x)\<rbrakk> \<Longrightarrow> P (F\<cdot>(F\<cdot>x))"
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   172
  shows "P (fix\<cdot>F)"
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   173
unfolding fix_def2
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   174
apply (rule admD [OF adm chain_iterate])
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   175
apply (rule nat_less_induct)
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   176
apply (case_tac n)
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   177
apply (simp add: 0)
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   178
apply (case_tac nat)
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   179
apply (simp add: 1)
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   180
apply (frule_tac x=nat in spec)
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   181
apply (simp add: step)
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   182
done
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   183
33590
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   184
lemma parallel_fix_ind:
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   185
  assumes adm: "adm (\<lambda>x. P (fst x) (snd x))"
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   186
  assumes base: "P \<bottom> \<bottom>"
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   187
  assumes step: "\<And>x y. P x y \<Longrightarrow> P (F\<cdot>x) (G\<cdot>y)"
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   188
  shows "P (fix\<cdot>F) (fix\<cdot>G)"
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   189
proof -
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   190
  from adm have adm': "adm (split P)"
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   191
    unfolding split_def .
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   192
  have "\<And>i. P (iterate i\<cdot>F\<cdot>\<bottom>) (iterate i\<cdot>G\<cdot>\<bottom>)"
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   193
    by (induct_tac i, simp add: base, simp add: step)
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   194
  hence "\<And>i. split P (iterate i\<cdot>F\<cdot>\<bottom>, iterate i\<cdot>G\<cdot>\<bottom>)"
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   195
    by simp
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   196
  hence "split P (\<Squnion>i. (iterate i\<cdot>F\<cdot>\<bottom>, iterate i\<cdot>G\<cdot>\<bottom>))"
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   197
    by - (rule admD [OF adm'], simp, assumption)
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   198
  hence "split P (\<Squnion>i. iterate i\<cdot>F\<cdot>\<bottom>, \<Squnion>i. iterate i\<cdot>G\<cdot>\<bottom>)"
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   199
    by (simp add: thelub_Pair)
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   200
  hence "P (\<Squnion>i. iterate i\<cdot>F\<cdot>\<bottom>) (\<Squnion>i. iterate i\<cdot>G\<cdot>\<bottom>)"
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   201
    by simp
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   202
  thus "P (fix\<cdot>F) (fix\<cdot>G)"
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   203
    by (simp add: fix_def2)
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   204
qed
1806f58a3651 add lemma parallel_fix_ind
huffman
parents: 31076
diff changeset
   205
18093
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   206
subsection {* Recursive let bindings *}
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   207
25131
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18095
diff changeset
   208
definition
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18095
diff changeset
   209
  CLetrec :: "('a \<rightarrow> 'a \<times> 'b) \<rightarrow> 'b" where
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18095
diff changeset
   210
  "CLetrec = (\<Lambda> F. csnd\<cdot>(F\<cdot>(\<mu> x. cfst\<cdot>(F\<cdot>x))))"
18093
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   211
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   212
nonterminals
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   213
  recbinds recbindt recbind
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   214
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   215
syntax
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   216
  "_recbind"  :: "['a, 'a] \<Rightarrow> recbind"               ("(2_ =/ _)" 10)
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   217
  ""          :: "recbind \<Rightarrow> recbindt"               ("_")
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   218
  "_recbindt" :: "[recbind, recbindt] \<Rightarrow> recbindt"   ("_,/ _")
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   219
  ""          :: "recbindt \<Rightarrow> recbinds"              ("_")
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   220
  "_recbinds" :: "[recbindt, recbinds] \<Rightarrow> recbinds"  ("_;/ _")
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   221
  "_Letrec"   :: "[recbinds, 'a] \<Rightarrow> 'a"      ("(Letrec (_)/ in (_))" 10)
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   222
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   223
translations
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   224
  (recbindt) "x = a, \<langle>y,ys\<rangle> = \<langle>b,bs\<rangle>" == (recbindt) "\<langle>x,y,ys\<rangle> = \<langle>a,b,bs\<rangle>"
25131
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18095
diff changeset
   225
  (recbindt) "x = a, y = b"          == (recbindt) "\<langle>x,y\<rangle> = \<langle>a,b\<rangle>"
18093
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   226
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   227
translations
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   228
  "_Letrec (_recbinds b bs) e" == "_Letrec b (_Letrec bs e)"
25131
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18095
diff changeset
   229
  "Letrec xs = a in \<langle>e,es\<rangle>"    == "CONST CLetrec\<cdot>(\<Lambda> xs. \<langle>a,e,es\<rangle>)"
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18095
diff changeset
   230
  "Letrec xs = a in e"         == "CONST CLetrec\<cdot>(\<Lambda> xs. \<langle>a,e\<rangle>)"
18093
587692219f69 put iterate and fix in separate sections; added Letrec
huffman
parents: 18092
diff changeset
   231
18095
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   232
text {*
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   233
  Bekic's Theorem: Simultaneous fixed points over pairs
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   234
  can be written in terms of separate fixed points.
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   235
*}
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   236
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   237
lemma fix_cprod:
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   238
  "fix\<cdot>(F::'a \<times> 'b \<rightarrow> 'a \<times> 'b) =
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   239
   \<langle>\<mu> x. cfst\<cdot>(F\<cdot>\<langle>x, \<mu> y. csnd\<cdot>(F\<cdot>\<langle>x, y\<rangle>)\<rangle>),
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   240
    \<mu> y. csnd\<cdot>(F\<cdot>\<langle>\<mu> x. cfst\<cdot>(F\<cdot>\<langle>x, \<mu> y. csnd\<cdot>(F\<cdot>\<langle>x, y\<rangle>)\<rangle>), y\<rangle>)\<rangle>"
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   241
  (is "fix\<cdot>F = \<langle>?x, ?y\<rangle>")
27185
0407630909ef change orientation of fix_eqI and convert to rule_format;
huffman
parents: 25927
diff changeset
   242
proof (rule fix_eqI)
18095
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   243
  have 1: "cfst\<cdot>(F\<cdot>\<langle>?x, ?y\<rangle>) = ?x"
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   244
    by (rule trans [symmetric, OF fix_eq], simp)
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   245
  have 2: "csnd\<cdot>(F\<cdot>\<langle>?x, ?y\<rangle>) = ?y"
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   246
    by (rule trans [symmetric, OF fix_eq], simp)
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   247
  from 1 2 show "F\<cdot>\<langle>?x, ?y\<rangle> = \<langle>?x, ?y\<rangle>" by (simp add: eq_cprod)
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   248
next
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   249
  fix z assume F_z: "F\<cdot>z = z"
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   250
  then obtain x y where z: "z = \<langle>x,y\<rangle>" by (rule_tac p=z in cprodE)
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   251
  from F_z z have F_x: "cfst\<cdot>(F\<cdot>\<langle>x, y\<rangle>) = x" by simp
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   252
  from F_z z have F_y: "csnd\<cdot>(F\<cdot>\<langle>x, y\<rangle>) = y" by simp
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   253
  let ?y1 = "\<mu> y. csnd\<cdot>(F\<cdot>\<langle>x, y\<rangle>)"
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   254
  have "?y1 \<sqsubseteq> y" by (rule fix_least, simp add: F_y)
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   255
  hence "cfst\<cdot>(F\<cdot>\<langle>x, ?y1\<rangle>) \<sqsubseteq> cfst\<cdot>(F\<cdot>\<langle>x, y\<rangle>)" by (simp add: monofun_cfun)
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   256
  hence "cfst\<cdot>(F\<cdot>\<langle>x, ?y1\<rangle>) \<sqsubseteq> x" using F_x by simp
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29138
diff changeset
   257
  hence 1: "?x \<sqsubseteq> x" by (simp add: fix_least_below)
18095
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   258
  hence "csnd\<cdot>(F\<cdot>\<langle>?x, y\<rangle>) \<sqsubseteq> csnd\<cdot>(F\<cdot>\<langle>x, y\<rangle>)" by (simp add: monofun_cfun)
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   259
  hence "csnd\<cdot>(F\<cdot>\<langle>?x, y\<rangle>) \<sqsubseteq> y" using F_y by simp
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 29138
diff changeset
   260
  hence 2: "?y \<sqsubseteq> y" by (simp add: fix_least_below)
18095
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   261
  show "\<langle>?x, ?y\<rangle> \<sqsubseteq> z" using z 1 2 by simp
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   262
qed
4328356ab7e6 add proof of Bekic's theorem: fix_cprod
huffman
parents: 18093
diff changeset
   263
18090
9d5cfd71f510 moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents: 18078
diff changeset
   264
subsection {* Weak admissibility *}
9d5cfd71f510 moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents: 18078
diff changeset
   265
25131
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18095
diff changeset
   266
definition
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18095
diff changeset
   267
  admw :: "('a \<Rightarrow> bool) \<Rightarrow> bool" where
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 18095
diff changeset
   268
  "admw P = (\<forall>F. (\<forall>n. P (iterate n\<cdot>F\<cdot>\<bottom>)) \<longrightarrow> P (\<Squnion>i. iterate i\<cdot>F\<cdot>\<bottom>))"
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   269
15637
d2a06007ebfa changed comments to text blocks, cleaned up a few proofs
huffman
parents: 15577
diff changeset
   270
text {* an admissible formula is also weak admissible *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   271
16214
e3816a7db016 cleaned up proof of cont_Ifix
huffman
parents: 16082
diff changeset
   272
lemma adm_impl_admw: "adm P \<Longrightarrow> admw P"
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   273
apply (unfold admw_def)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   274
apply (intro strip)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   275
apply (erule admD)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   276
apply (rule chain_iterate)
25925
3dc4acca4388 change lemma admD to rule_format
huffman
parents: 25131
diff changeset
   277
apply (erule spec)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   278
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   279
15637
d2a06007ebfa changed comments to text blocks, cleaned up a few proofs
huffman
parents: 15577
diff changeset
   280
text {* computational induction for weak admissible formulae *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   281
18074
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
   282
lemma wfix_ind: "\<lbrakk>admw P; \<forall>n. P (iterate n\<cdot>F\<cdot>\<bottom>)\<rbrakk> \<Longrightarrow> P (fix\<cdot>F)"
16214
e3816a7db016 cleaned up proof of cont_Ifix
huffman
parents: 16082
diff changeset
   283
by (simp add: fix_def2 admw_def)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   284
16214
e3816a7db016 cleaned up proof of cont_Ifix
huffman
parents: 16082
diff changeset
   285
lemma def_wfix_ind:
18074
a92b7c5133de reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents: 17816
diff changeset
   286
  "\<lbrakk>f \<equiv> fix\<cdot>F; admw P; \<forall>n. P (iterate n\<cdot>F\<cdot>\<bottom>)\<rbrakk> \<Longrightarrow> P f"
16214
e3816a7db016 cleaned up proof of cont_Ifix
huffman
parents: 16082
diff changeset
   287
by (simp, rule wfix_ind)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 14981
diff changeset
   288
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   289
end