author | huffman |
Sat, 05 Nov 2005 21:52:13 +0100 | |
changeset 18093 | 587692219f69 |
parent 18092 | 2c5d5da79a1e |
child 18095 | 4328356ab7e6 |
permissions | -rw-r--r-- |
2640 | 1 |
(* Title: HOLCF/Fix.thy |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
2 |
ID: $Id$ |
1479 | 3 |
Author: Franz Regensburger |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
4 |
|
16070
4a83dd540b88
removed LICENCE note -- everything is subject to Isabelle licence as
wenzelm
parents:
16056
diff
changeset
|
5 |
Definitions for fixed point operator and admissibility. |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
6 |
*) |
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
7 |
|
15577 | 8 |
header {* Fixed point operator and admissibility *} |
9 |
||
10 |
theory Fix |
|
16056
32c3b7188c28
Moved admissibility definitions and lemmas to a separate theory
huffman
parents:
16006
diff
changeset
|
11 |
imports Cfun Cprod Adm |
15577 | 12 |
begin |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
13 |
|
16082 | 14 |
defaultsort pcpo |
15 |
||
18093
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
16 |
subsection {* Iteration *} |
16005 | 17 |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
18 |
consts |
18093
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
19 |
iterate :: "nat \<Rightarrow> ('a::cpo \<rightarrow> 'a) \<rightarrow> ('a \<rightarrow> 'a)" |
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
20 |
|
5192 | 21 |
primrec |
18074
a92b7c5133de
reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents:
17816
diff
changeset
|
22 |
"iterate 0 = (\<Lambda> F 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 |
"iterate (Suc n) = (\<Lambda> F x. F\<cdot>(iterate n\<cdot>F\<cdot>x))" |
5192 | 24 |
|
18093
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
25 |
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
|
26 |
|
18074
a92b7c5133de
reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents:
17816
diff
changeset
|
27 |
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
|
28 |
by simp |
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_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
|
31 |
by simp |
a92b7c5133de
reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents:
17816
diff
changeset
|
32 |
|
a92b7c5133de
reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents:
17816
diff
changeset
|
33 |
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
|
34 |
|
a92b7c5133de
reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents:
17816
diff
changeset
|
35 |
lemma iterate_Suc2: "iterate (Suc n)\<cdot>F\<cdot>x = iterate n\<cdot>F\<cdot>(F\<cdot>x)" |
16214 | 36 |
by (induct_tac n, auto) |
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
37 |
|
15637
d2a06007ebfa
changed comments to text blocks, cleaned up a few proofs
huffman
parents:
15577
diff
changeset
|
38 |
text {* |
d2a06007ebfa
changed comments to text blocks, cleaned up a few proofs
huffman
parents:
15577
diff
changeset
|
39 |
The sequence of function iterations is a chain. |
d2a06007ebfa
changed comments to text blocks, cleaned up a few proofs
huffman
parents:
15577
diff
changeset
|
40 |
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
|
41 |
*} |
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
42 |
|
18074
a92b7c5133de
reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents:
17816
diff
changeset
|
43 |
lemma chain_iterate2: "x \<sqsubseteq> F\<cdot>x \<Longrightarrow> chain (\<lambda>i. iterate i\<cdot>F\<cdot>x)" |
16214 | 44 |
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
|
45 |
|
18074
a92b7c5133de
reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents:
17816
diff
changeset
|
46 |
lemma chain_iterate [simp]: "chain (\<lambda>i. iterate i\<cdot>F\<cdot>\<bottom>)" |
16005 | 47 |
by (rule chain_iterate2 [OF minimal]) |
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
48 |
|
18093
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
49 |
|
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
50 |
subsection {* Least fixed point operator *} |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
51 |
|
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
52 |
constdefs |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
53 |
"fix" :: "('a \<rightarrow> 'a) \<rightarrow> 'a" |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
54 |
"fix \<equiv> \<Lambda> F. \<Squnion>i. iterate i\<cdot>F\<cdot>\<bottom>" |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
55 |
|
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
56 |
text {* Binder syntax for @{term fix} *} |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
57 |
|
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
58 |
syntax |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
59 |
"_FIX" :: "['a, 'a] \<Rightarrow> 'a" ("(3FIX _./ _)" [1000, 10] 10) |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
60 |
|
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
61 |
syntax (xsymbols) |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
62 |
"_FIX" :: "['a, 'a] \<Rightarrow> 'a" ("(3\<mu>_./ _)" [1000, 10] 10) |
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 |
translations |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
65 |
"\<mu> x. t" == "fix\<cdot>(\<Lambda> x. t)" |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
66 |
|
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
67 |
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
|
68 |
|
18090
9d5cfd71f510
moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents:
18078
diff
changeset
|
69 |
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
|
70 |
|
a92b7c5133de
reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents:
17816
diff
changeset
|
71 |
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
|
72 |
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
|
73 |
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
|
74 |
apply (rule cont2cont_lub) |
18092
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
huffman
parents:
18090
diff
changeset
|
75 |
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
|
76 |
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
|
77 |
apply simp |
a92b7c5133de
reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents:
17816
diff
changeset
|
78 |
done |
a92b7c5133de
reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents:
17816
diff
changeset
|
79 |
|
15637
d2a06007ebfa
changed comments to text blocks, cleaned up a few proofs
huffman
parents:
15577
diff
changeset
|
80 |
text {* |
d2a06007ebfa
changed comments to text blocks, cleaned up a few proofs
huffman
parents:
15577
diff
changeset
|
81 |
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
|
82 |
omega cpo's |
d2a06007ebfa
changed comments to text blocks, cleaned up a few proofs
huffman
parents:
15577
diff
changeset
|
83 |
*} |
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
84 |
|
18074
a92b7c5133de
reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents:
17816
diff
changeset
|
85 |
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
|
86 |
apply (simp add: fix_def2) |
16005 | 87 |
apply (subst lub_range_shift [of _ 1, symmetric]) |
88 |
apply (rule chain_iterate) |
|
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
89 |
apply (subst contlub_cfun_arg) |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
90 |
apply (rule chain_iterate) |
16005 | 91 |
apply simp |
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
92 |
done |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
93 |
|
18074
a92b7c5133de
reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents:
17816
diff
changeset
|
94 |
lemma fix_least_less: "F\<cdot>x \<sqsubseteq> x \<Longrightarrow> fix\<cdot>F \<sqsubseteq> x" |
a92b7c5133de
reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents:
17816
diff
changeset
|
95 |
apply (simp add: fix_def2) |
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
96 |
apply (rule is_lub_thelub) |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
97 |
apply (rule chain_iterate) |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
98 |
apply (rule ub_rangeI) |
16005 | 99 |
apply (induct_tac i) |
100 |
apply simp |
|
101 |
apply simp |
|
18074
a92b7c5133de
reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents:
17816
diff
changeset
|
102 |
apply (erule rev_trans_less) |
16214 | 103 |
apply (erule monofun_cfun_arg) |
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
104 |
done |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
105 |
|
16214 | 106 |
lemma fix_least: "F\<cdot>x = 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
|
107 |
by (rule fix_least_less, simp) |
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
108 |
|
16214 | 109 |
lemma fix_eqI: "\<lbrakk>F\<cdot>x = x; \<forall>z. F\<cdot>z = z \<longrightarrow> x \<sqsubseteq> z\<rbrakk> \<Longrightarrow> x = fix\<cdot>F" |
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
110 |
apply (rule antisym_less) |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
111 |
apply (erule allE) |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
112 |
apply (erule mp) |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
113 |
apply (rule fix_eq [symmetric]) |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
114 |
apply (erule fix_least) |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
115 |
done |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
116 |
|
16214 | 117 |
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
|
118 |
by (simp add: fix_eq [symmetric]) |
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
119 |
|
16214 | 120 |
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
|
121 |
by (erule fix_eq2 [THEN cfun_fun_cong]) |
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
122 |
|
16214 | 123 |
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
|
124 |
apply (erule ssubst) |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
125 |
apply (rule fix_eq) |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
126 |
done |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
127 |
|
16214 | 128 |
lemma fix_eq5: "f = fix\<cdot>F \<Longrightarrow> f\<cdot>x = F\<cdot>f\<cdot>x" |
129 |
by (erule fix_eq4 [THEN cfun_fun_cong]) |
|
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
130 |
|
16556
a0c8d0499b5f
added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents:
16388
diff
changeset
|
131 |
text {* strictness of @{term fix} *} |
a0c8d0499b5f
added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents:
16388
diff
changeset
|
132 |
|
16917 | 133 |
lemma fix_defined_iff: "(fix\<cdot>F = \<bottom>) = (F\<cdot>\<bottom> = \<bottom>)" |
134 |
apply (rule iffI) |
|
135 |
apply (erule subst) |
|
136 |
apply (rule fix_eq [symmetric]) |
|
137 |
apply (erule fix_least [THEN UU_I]) |
|
138 |
done |
|
139 |
||
16556
a0c8d0499b5f
added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents:
16388
diff
changeset
|
140 |
lemma fix_strict: "F\<cdot>\<bottom> = \<bottom> \<Longrightarrow> fix\<cdot>F = \<bottom>" |
16917 | 141 |
by (simp add: fix_defined_iff) |
16556
a0c8d0499b5f
added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents:
16388
diff
changeset
|
142 |
|
a0c8d0499b5f
added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents:
16388
diff
changeset
|
143 |
lemma fix_defined: "F\<cdot>\<bottom> \<noteq> \<bottom> \<Longrightarrow> fix\<cdot>F \<noteq> \<bottom>" |
16917 | 144 |
by (simp add: fix_defined_iff) |
16556
a0c8d0499b5f
added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents:
16388
diff
changeset
|
145 |
|
a0c8d0499b5f
added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents:
16388
diff
changeset
|
146 |
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
|
147 |
|
a0c8d0499b5f
added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents:
16388
diff
changeset
|
148 |
lemma fix_id: "(\<mu> x. x) = \<bottom>" |
a0c8d0499b5f
added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents:
16388
diff
changeset
|
149 |
by (simp add: fix_strict) |
a0c8d0499b5f
added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents:
16388
diff
changeset
|
150 |
|
a0c8d0499b5f
added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents:
16388
diff
changeset
|
151 |
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
|
152 |
by (subst fix_eq, simp) |
16556
a0c8d0499b5f
added theorems fix_strict, fix_defined, fix_id, fix_const
huffman
parents:
16388
diff
changeset
|
153 |
|
18090
9d5cfd71f510
moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents:
18078
diff
changeset
|
154 |
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
|
155 |
|
9d5cfd71f510
moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents:
18078
diff
changeset
|
156 |
lemma fix_ind: "\<lbrakk>adm P; P \<bottom>; \<And>x. P x \<Longrightarrow> P (F\<cdot>x)\<rbrakk> \<Longrightarrow> P (fix\<cdot>F)" |
9d5cfd71f510
moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents:
18078
diff
changeset
|
157 |
apply (subst fix_def2) |
9d5cfd71f510
moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents:
18078
diff
changeset
|
158 |
apply (erule admD [rule_format]) |
9d5cfd71f510
moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents:
18078
diff
changeset
|
159 |
apply (rule chain_iterate) |
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 (induct_tac "i", simp_all) |
9d5cfd71f510
moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents:
18078
diff
changeset
|
161 |
done |
9d5cfd71f510
moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents:
18078
diff
changeset
|
162 |
|
9d5cfd71f510
moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents:
18078
diff
changeset
|
163 |
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
|
164 |
"\<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
|
165 |
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
|
166 |
|
18093
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
167 |
subsection {* Recursive let bindings *} |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
168 |
|
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
169 |
constdefs |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
170 |
CLetrec :: "('a \<rightarrow> 'a \<times> 'b) \<rightarrow> 'b" |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
171 |
"CLetrec \<equiv> \<Lambda> F. csnd\<cdot>(F\<cdot>(\<mu> x. cfst\<cdot>(F\<cdot>x)))" |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
172 |
|
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
173 |
nonterminals |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
174 |
recbinds recbindt recbind |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
175 |
|
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
176 |
syntax |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
177 |
"_recbind" :: "['a, 'a] \<Rightarrow> recbind" ("(2_ =/ _)" 10) |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
178 |
"" :: "recbind \<Rightarrow> recbindt" ("_") |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
179 |
"_recbindt" :: "[recbind, recbindt] \<Rightarrow> recbindt" ("_,/ _") |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
180 |
"" :: "recbindt \<Rightarrow> recbinds" ("_") |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
181 |
"_recbinds" :: "[recbindt, recbinds] \<Rightarrow> recbinds" ("_;/ _") |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
182 |
"_Letrec" :: "[recbinds, 'a] \<Rightarrow> 'a" ("(Letrec (_)/ in (_))" 10) |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
183 |
|
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
184 |
translations |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
185 |
(recbindt) "x = a, \<langle>y,ys\<rangle> = \<langle>b,bs\<rangle>" == (recbindt) "\<langle>x,y,ys\<rangle> = \<langle>a,b,bs\<rangle>" |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
186 |
(recbindt) "x = a, y = b" == (recbindt) "\<langle>x,y\<rangle> = \<langle>a,b\<rangle>" |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
187 |
|
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
188 |
translations |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
189 |
"_Letrec (_recbinds b bs) e" == "_Letrec b (_Letrec bs e)" |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
190 |
"Letrec xs = a in \<langle>e,es\<rangle>" == "CLetrec\<cdot>(\<Lambda> xs. \<langle>a,e,es\<rangle>)" |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
191 |
"Letrec xs = a in e" == "CLetrec\<cdot>(\<Lambda> xs. \<langle>a,e\<rangle>)" |
587692219f69
put iterate and fix in separate sections; added Letrec
huffman
parents:
18092
diff
changeset
|
192 |
|
18090
9d5cfd71f510
moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents:
18078
diff
changeset
|
193 |
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
|
194 |
|
9d5cfd71f510
moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents:
18078
diff
changeset
|
195 |
constdefs |
9d5cfd71f510
moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents:
18078
diff
changeset
|
196 |
admw :: "('a \<Rightarrow> bool) \<Rightarrow> bool" |
9d5cfd71f510
moved adm_chfindom from Fix.thy to Cfun.thy; moved admw-related stuff to its own section
huffman
parents:
18078
diff
changeset
|
197 |
"admw P \<equiv> \<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
|
198 |
|
15637
d2a06007ebfa
changed comments to text blocks, cleaned up a few proofs
huffman
parents:
15577
diff
changeset
|
199 |
text {* an admissible formula is also weak admissible *} |
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
200 |
|
16214 | 201 |
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
|
202 |
apply (unfold admw_def) |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
203 |
apply (intro strip) |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
204 |
apply (erule admD) |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
205 |
apply (rule chain_iterate) |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
206 |
apply assumption |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
207 |
done |
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
208 |
|
15637
d2a06007ebfa
changed comments to text blocks, cleaned up a few proofs
huffman
parents:
15577
diff
changeset
|
209 |
text {* computational induction for weak admissible formulae *} |
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
210 |
|
18074
a92b7c5133de
reorganized; removed intermediate constant Ifix; changed iterate to a continuous type; added theorem fix_least_less
huffman
parents:
17816
diff
changeset
|
211 |
lemma wfix_ind: "\<lbrakk>admw P; \<forall>n. P (iterate n\<cdot>F\<cdot>\<bottom>)\<rbrakk> \<Longrightarrow> P (fix\<cdot>F)" |
16214 | 212 |
by (simp add: fix_def2 admw_def) |
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
213 |
|
16214 | 214 |
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
|
215 |
"\<lbrakk>f \<equiv> fix\<cdot>F; admw P; \<forall>n. P (iterate n\<cdot>F\<cdot>\<bottom>)\<rbrakk> \<Longrightarrow> P f" |
16214 | 216 |
by (simp, rule wfix_ind) |
15576
efb95d0d01f7
converted to new-style theories, and combined numbered files
huffman
parents:
14981
diff
changeset
|
217 |
|
243
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff
changeset
|
218 |
end |