author | wenzelm |
Mon, 12 Mar 2007 19:23:49 +0100 | |
changeset 22439 | b709739c69e6 |
parent 22430 | 6a56bf1b3a64 |
child 22452 | 8a86fd2a1bf0 |
permissions | -rw-r--r-- |
17006 | 1 |
(* Title: HOL/FixedPoint.thy |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
4 |
Author: Stefan Berghofer, TU Muenchen |
17006 | 5 |
Copyright 1992 University of Cambridge |
6 |
*) |
|
7 |
||
8 |
header{* Fixed Points and the Knaster-Tarski Theorem*} |
|
9 |
||
10 |
theory FixedPoint |
|
21326 | 11 |
imports Product_Type LOrder |
17006 | 12 |
begin |
13 |
||
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
14 |
subsection {* Complete lattices *} |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
15 |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
16 |
consts |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
17 |
Inf :: "'a::order set \<Rightarrow> 'a" |
21312 | 18 |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
19 |
definition |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
20 |
Sup :: "'a::order set \<Rightarrow> 'a" where |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
21 |
"Sup A = Inf {b. \<forall>a \<in> A. a \<le> b}" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
22 |
|
22390 | 23 |
class comp_lat = order + |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
24 |
assumes Inf_lower: "x \<in> A \<Longrightarrow> Inf A \<sqsubseteq> x" |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
25 |
assumes Inf_greatest: "(\<And>x. x \<in> A \<Longrightarrow> z \<sqsubseteq> x) \<Longrightarrow> z \<sqsubseteq> Inf A" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
26 |
|
21312 | 27 |
theorem Sup_upper: "(x::'a::comp_lat) \<in> A \<Longrightarrow> x <= Sup A" |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
28 |
by (auto simp: Sup_def intro: Inf_greatest) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
29 |
|
21312 | 30 |
theorem Sup_least: "(\<And>x::'a::comp_lat. x \<in> A \<Longrightarrow> x <= z) \<Longrightarrow> Sup A <= z" |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
31 |
by (auto simp: Sup_def intro: Inf_lower) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
32 |
|
22430
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
33 |
definition |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
34 |
SUPR :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b::comp_lat) \<Rightarrow> 'b" where |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
35 |
"SUPR A f == Sup (f ` A)" |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
36 |
|
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
37 |
definition |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
38 |
INFI :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b::comp_lat) \<Rightarrow> 'b" where |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
39 |
"INFI A f == Inf (f ` A)" |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
40 |
|
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
41 |
syntax |
22439 | 42 |
"_SUP1" :: "pttrns => 'b => 'b" ("(3SUP _./ _)" [0, 10] 10) |
43 |
"_SUP" :: "pttrn => 'a set => 'b => 'b" ("(3SUP _:_./ _)" [0, 10] 10) |
|
44 |
"_INF1" :: "pttrns => 'b => 'b" ("(3INF _./ _)" [0, 10] 10) |
|
45 |
"_INF" :: "pttrn => 'a set => 'b => 'b" ("(3INF _:_./ _)" [0, 10] 10) |
|
22430
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
46 |
|
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
47 |
translations |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
48 |
"SUP x y. B" == "SUP x. SUP y. B" |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
49 |
"SUP x. B" == "CONST SUPR UNIV (%x. B)" |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
50 |
"SUP x. B" == "SUP x:UNIV. B" |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
51 |
"SUP x:A. B" == "CONST SUPR A (%x. B)" |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
52 |
"INF x y. B" == "INF x. INF y. B" |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
53 |
"INF x. B" == "CONST INFI UNIV (%x. B)" |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
54 |
"INF x. B" == "INF x:UNIV. B" |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
55 |
"INF x:A. B" == "CONST INFI A (%x. B)" |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
56 |
|
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
57 |
(* To avoid eta-contraction of body: *) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
58 |
print_translation {* |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
59 |
let |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
60 |
fun btr' syn (A :: Abs abs :: ts) = |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
61 |
let val (x,t) = atomic_abs_tr' abs |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
62 |
in list_comb (Syntax.const syn $ x $ A $ t, ts) end |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
63 |
val const_syntax_name = Sign.const_syntax_name @{theory} o fst o dest_Const |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
64 |
in |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
65 |
[(const_syntax_name @{term SUPR}, btr' "_SUP"),(const_syntax_name @{term "INFI"}, btr' "_INF")] |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
66 |
end |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
67 |
*} |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
68 |
|
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
69 |
lemma le_SUPI: "i : A \<Longrightarrow> M i \<le> (SUP i:A. M i)" |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
70 |
by (auto simp add: SUPR_def intro: Sup_upper) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
71 |
|
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
72 |
lemma SUP_leI: "(\<And>i. i : A \<Longrightarrow> M i \<le> u) \<Longrightarrow> (SUP i:A. M i) \<le> u" |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
73 |
by (auto simp add: SUPR_def intro: Sup_least) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
74 |
|
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
75 |
lemma INF_leI: "i : A \<Longrightarrow> (INF i:A. M i) \<le> M i" |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
76 |
by (auto simp add: INFI_def intro: Inf_lower) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
77 |
|
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
78 |
lemma le_INFI: "(\<And>i. i : A \<Longrightarrow> u \<le> M i) \<Longrightarrow> u \<le> (INF i:A. M i)" |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
79 |
by (auto simp add: INFI_def intro: Inf_greatest) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
80 |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
81 |
text {* A complete lattice is a lattice *} |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
82 |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
83 |
lemma is_meet_Inf: "is_meet (\<lambda>(x::'a::comp_lat) y. Inf {x, y})" |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
84 |
by (auto simp: is_meet_def intro: Inf_lower Inf_greatest) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
85 |
|
21312 | 86 |
lemma is_join_Sup: "is_join (\<lambda>(x::'a::comp_lat) y. Sup {x, y})" |
87 |
by (auto simp: is_join_def intro: Sup_upper Sup_least) |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
88 |
|
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
89 |
instance comp_lat < lorder |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
90 |
proof |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
91 |
from is_meet_Inf show "\<exists>m::'a\<Rightarrow>'a\<Rightarrow>'a. is_meet m" by iprover |
21312 | 92 |
from is_join_Sup show "\<exists>j::'a\<Rightarrow>'a\<Rightarrow>'a. is_join j" by iprover |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
93 |
qed |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
94 |
|
21312 | 95 |
subsubsection {* Properties *} |
96 |
||
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
97 |
lemma mono_inf: "mono f \<Longrightarrow> f (inf A B) <= inf (f A) (f B)" |
21312 | 98 |
by (auto simp add: mono_def) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
99 |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
100 |
lemma mono_sup: "mono f \<Longrightarrow> sup (f A) (f B) <= f (sup A B)" |
21312 | 101 |
by (auto simp add: mono_def) |
102 |
||
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
103 |
lemma Sup_insert[simp]: "Sup (insert (a::'a::comp_lat) A) = sup a (Sup A)" |
22430
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
104 |
apply (rule order_antisym) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
105 |
apply (rule Sup_least) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
106 |
apply (erule insertE) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
107 |
apply (rule le_supI1) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
108 |
apply simp |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
109 |
apply (rule le_supI2) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
110 |
apply (erule Sup_upper) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
111 |
apply (rule le_supI) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
112 |
apply (rule Sup_upper) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
113 |
apply simp |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
114 |
apply (rule Sup_least) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
115 |
apply (rule Sup_upper) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
116 |
apply simp |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
117 |
done |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
118 |
|
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
119 |
lemma Inf_insert[simp]: "Inf (insert (a::'a::comp_lat) A) = inf a (Inf A)" |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
120 |
apply (rule order_antisym) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
121 |
apply (rule le_infI) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
122 |
apply (rule Inf_lower) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
123 |
apply simp |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
124 |
apply (rule Inf_greatest) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
125 |
apply (rule Inf_lower) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
126 |
apply simp |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
127 |
apply (rule Inf_greatest) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
128 |
apply (erule insertE) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
129 |
apply (rule le_infI1) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
130 |
apply simp |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
131 |
apply (rule le_infI2) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
132 |
apply (erule Inf_lower) |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
133 |
done |
21312 | 134 |
|
135 |
lemma bot_least[simp]: "Sup{} \<le> (x::'a::comp_lat)" |
|
22430
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
136 |
by (rule Sup_least) simp |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
137 |
|
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
138 |
lemma top_greatest[simp]: "(x::'a::comp_lat) \<le> Inf{}" |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
139 |
by (rule Inf_greatest) simp |
21312 | 140 |
|
22430
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
141 |
lemma SUP_const[simp]: "A \<noteq> {} \<Longrightarrow> (SUP i:A. M) = M" |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
142 |
by (auto intro: order_antisym SUP_leI le_SUPI) |
21312 | 143 |
|
22430
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
144 |
lemma INF_const[simp]: "A \<noteq> {} \<Longrightarrow> (INF i:A. M) = M" |
6a56bf1b3a64
Generalized version of SUP and INF (with index set).
berghofe
parents:
22422
diff
changeset
|
145 |
by (auto intro: order_antisym INF_leI le_INFI) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
146 |
|
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
147 |
|
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
148 |
subsection {* Some instances of the type class of complete lattices *} |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
149 |
|
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
150 |
subsubsection {* Booleans *} |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
151 |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
152 |
defs |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
153 |
Inf_bool_def: "Inf A == ALL x:A. x" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
154 |
|
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
155 |
instance bool :: comp_lat |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
156 |
apply intro_classes |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
157 |
apply (unfold Inf_bool_def) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
158 |
apply (iprover intro!: le_boolI elim: ballE) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
159 |
apply (iprover intro!: ballI le_boolI elim: ballE le_boolE) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
160 |
done |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
161 |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
162 |
theorem inf_bool_eq: "inf P Q \<longleftrightarrow> P \<and> Q" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
163 |
apply (rule order_antisym) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
164 |
apply (rule le_boolI) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
165 |
apply (rule conjI) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
166 |
apply (rule le_boolE) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
167 |
apply (rule inf_le1) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
168 |
apply assumption+ |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
169 |
apply (rule le_boolE) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
170 |
apply (rule inf_le2) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
171 |
apply assumption+ |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
172 |
apply (rule le_infI) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
173 |
apply (rule le_boolI) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
174 |
apply (erule conjunct1) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
175 |
apply (rule le_boolI) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
176 |
apply (erule conjunct2) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
177 |
done |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
178 |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
179 |
theorem sup_bool_eq: "sup P Q \<longleftrightarrow> P \<or> Q" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
180 |
apply (rule order_antisym) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
181 |
apply (rule le_supI) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
182 |
apply (rule le_boolI) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
183 |
apply (erule disjI1) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
184 |
apply (rule le_boolI) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
185 |
apply (erule disjI2) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
186 |
apply (rule le_boolI) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
187 |
apply (erule disjE) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
188 |
apply (rule le_boolE) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
189 |
apply (rule sup_ge1) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
190 |
apply assumption+ |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
191 |
apply (rule le_boolE) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
192 |
apply (rule sup_ge2) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
193 |
apply assumption+ |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
194 |
done |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
195 |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
196 |
theorem Sup_bool_eq: "Sup A \<longleftrightarrow> (\<exists>x \<in> A. x)" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
197 |
apply (rule order_antisym) |
21312 | 198 |
apply (rule Sup_least) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
199 |
apply (rule le_boolI) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
200 |
apply (erule bexI, assumption) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
201 |
apply (rule le_boolI) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
202 |
apply (erule bexE) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
203 |
apply (rule le_boolE) |
21312 | 204 |
apply (rule Sup_upper) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
205 |
apply assumption+ |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
206 |
done |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
207 |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
208 |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
209 |
subsubsection {* Functions *} |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
210 |
|
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
211 |
text {* |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
212 |
Handy introduction and elimination rules for @{text "\<le>"} |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
213 |
on unary and binary predicates |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
214 |
*} |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
215 |
|
22276
96a4db55a0b3
Introduction and elimination rules for <= on predicates
berghofe
parents:
21547
diff
changeset
|
216 |
lemma predicate1I [Pure.intro!, intro!]: |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
217 |
assumes PQ: "\<And>x. P x \<Longrightarrow> Q x" |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
218 |
shows "P \<le> Q" |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
219 |
apply (rule le_funI) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
220 |
apply (rule le_boolI) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
221 |
apply (rule PQ) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
222 |
apply assumption |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
223 |
done |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
224 |
|
22276
96a4db55a0b3
Introduction and elimination rules for <= on predicates
berghofe
parents:
21547
diff
changeset
|
225 |
lemma predicate1D [Pure.dest, dest]: "P \<le> Q \<Longrightarrow> P x \<Longrightarrow> Q x" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
226 |
apply (erule le_funE) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
227 |
apply (erule le_boolE) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
228 |
apply assumption+ |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
229 |
done |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
230 |
|
22276
96a4db55a0b3
Introduction and elimination rules for <= on predicates
berghofe
parents:
21547
diff
changeset
|
231 |
lemma predicate2I [Pure.intro!, intro!]: |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
232 |
assumes PQ: "\<And>x y. P x y \<Longrightarrow> Q x y" |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
233 |
shows "P \<le> Q" |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
234 |
apply (rule le_funI)+ |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
235 |
apply (rule le_boolI) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
236 |
apply (rule PQ) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
237 |
apply assumption |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
238 |
done |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
239 |
|
22276
96a4db55a0b3
Introduction and elimination rules for <= on predicates
berghofe
parents:
21547
diff
changeset
|
240 |
lemma predicate2D [Pure.dest, dest]: "P \<le> Q \<Longrightarrow> P x y \<Longrightarrow> Q x y" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
241 |
apply (erule le_funE)+ |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
242 |
apply (erule le_boolE) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
243 |
apply assumption+ |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
244 |
done |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
245 |
|
22276
96a4db55a0b3
Introduction and elimination rules for <= on predicates
berghofe
parents:
21547
diff
changeset
|
246 |
lemma rev_predicate1D: "P x ==> P <= Q ==> Q x" |
96a4db55a0b3
Introduction and elimination rules for <= on predicates
berghofe
parents:
21547
diff
changeset
|
247 |
by (rule predicate1D) |
96a4db55a0b3
Introduction and elimination rules for <= on predicates
berghofe
parents:
21547
diff
changeset
|
248 |
|
96a4db55a0b3
Introduction and elimination rules for <= on predicates
berghofe
parents:
21547
diff
changeset
|
249 |
lemma rev_predicate2D: "P x y ==> P <= Q ==> Q x y" |
96a4db55a0b3
Introduction and elimination rules for <= on predicates
berghofe
parents:
21547
diff
changeset
|
250 |
by (rule predicate2D) |
96a4db55a0b3
Introduction and elimination rules for <= on predicates
berghofe
parents:
21547
diff
changeset
|
251 |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
252 |
defs |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
253 |
Inf_fun_def: "Inf A == (\<lambda>x. Inf {y. EX f:A. y = f x})" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
254 |
|
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
255 |
instance "fun" :: (type, comp_lat) comp_lat |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
256 |
apply intro_classes |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
257 |
apply (unfold Inf_fun_def) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
258 |
apply (rule le_funI) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
259 |
apply (rule Inf_lower) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
260 |
apply (rule CollectI) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
261 |
apply (rule bexI) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
262 |
apply (rule refl) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
263 |
apply assumption |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
264 |
apply (rule le_funI) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
265 |
apply (rule Inf_greatest) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
266 |
apply (erule CollectE) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
267 |
apply (erule bexE) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
268 |
apply (iprover elim: le_funE) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
269 |
done |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
270 |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
271 |
theorem inf_fun_eq: "inf f g = (\<lambda>x. inf (f x) (g x))" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
272 |
apply (rule order_antisym) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
273 |
apply (rule le_funI) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
274 |
apply (rule le_infI) |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
275 |
apply (rule le_funD [OF inf_le1]) |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
276 |
apply (rule le_funD [OF inf_le2]) |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
277 |
apply (rule le_infI) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
278 |
apply (rule le_funI) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
279 |
apply (rule inf_le1) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
280 |
apply (rule le_funI) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
281 |
apply (rule inf_le2) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
282 |
done |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
283 |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
284 |
theorem sup_fun_eq: "sup f g = (\<lambda>x. sup (f x) (g x))" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
285 |
apply (rule order_antisym) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
286 |
apply (rule le_supI) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
287 |
apply (rule le_funI) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
288 |
apply (rule sup_ge1) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
289 |
apply (rule le_funI) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
290 |
apply (rule sup_ge2) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
291 |
apply (rule le_funI) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
292 |
apply (rule le_supI) |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
293 |
apply (rule le_funD [OF sup_ge1]) |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
294 |
apply (rule le_funD [OF sup_ge2]) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
295 |
done |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
296 |
|
21312 | 297 |
theorem Sup_fun_eq: "Sup A = (\<lambda>x. Sup {y::'a::comp_lat. EX f:A. y = f x})" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
298 |
apply (rule order_antisym) |
21312 | 299 |
apply (rule Sup_least) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
300 |
apply (rule le_funI) |
21312 | 301 |
apply (rule Sup_upper) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
302 |
apply fast |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
303 |
apply (rule le_funI) |
21312 | 304 |
apply (rule Sup_least) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
305 |
apply (erule CollectE) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
306 |
apply (erule bexE) |
21312 | 307 |
apply (drule le_funD [OF Sup_upper]) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
308 |
apply simp |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
309 |
done |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
310 |
|
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
311 |
subsubsection {* Sets *} |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
312 |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
313 |
defs |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
314 |
Inf_set_def: "Inf S == \<Inter>S" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
315 |
|
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
316 |
instance set :: (type) comp_lat |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
317 |
by intro_classes (auto simp add: Inf_set_def) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
318 |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
319 |
theorem inf_set_eq: "inf A B = A \<inter> B" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
320 |
apply (rule subset_antisym) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
321 |
apply (rule Int_greatest) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
322 |
apply (rule inf_le1) |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
323 |
apply (rule inf_le2) |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
324 |
apply (rule le_infI) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
325 |
apply (rule Int_lower1) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
326 |
apply (rule Int_lower2) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
327 |
done |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
328 |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
329 |
theorem sup_set_eq: "sup A B = A \<union> B" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
330 |
apply (rule subset_antisym) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
331 |
apply (rule le_supI) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
332 |
apply (rule Un_upper1) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
333 |
apply (rule Un_upper2) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
334 |
apply (rule Un_least) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
335 |
apply (rule sup_ge1) |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
336 |
apply (rule sup_ge2) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
337 |
done |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
338 |
|
21312 | 339 |
theorem Sup_set_eq: "Sup S = \<Union>S" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
340 |
apply (rule subset_antisym) |
21312 | 341 |
apply (rule Sup_least) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
342 |
apply (erule Union_upper) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
343 |
apply (rule Union_least) |
21312 | 344 |
apply (erule Sup_upper) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
345 |
done |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
346 |
|
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
347 |
|
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
348 |
subsection {* Least and greatest fixed points *} |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
349 |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
350 |
definition |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
351 |
lfp :: "('a\<Colon>comp_lat \<Rightarrow> 'a) \<Rightarrow> 'a" where |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
352 |
"lfp f = Inf {u. f u \<le> u}" --{*least fixed point*} |
17006 | 353 |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
354 |
definition |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
355 |
gfp :: "('a\<Colon>comp_lat \<Rightarrow> 'a) \<Rightarrow> 'a" where |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
356 |
"gfp f = Sup {u. u \<le> f u}" --{*greatest fixed point*} |
17006 | 357 |
|
358 |
||
359 |
subsection{*Proof of Knaster-Tarski Theorem using @{term lfp}*} |
|
360 |
||
361 |
text{*@{term "lfp f"} is the least upper bound of |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
362 |
the set @{term "{u. f(u) \<le> u}"} *} |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
363 |
|
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
364 |
lemma lfp_lowerbound: "f A \<le> A ==> lfp f \<le> A" |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
365 |
by (auto simp add: lfp_def intro: Inf_lower) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
366 |
|
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
367 |
lemma lfp_greatest: "(!!u. f u \<le> u ==> A \<le> u) ==> A \<le> lfp f" |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
368 |
by (auto simp add: lfp_def intro: Inf_greatest) |
17006 | 369 |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
370 |
lemma lfp_lemma2: "mono f ==> f (lfp f) \<le> lfp f" |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
371 |
by (iprover intro: lfp_greatest order_trans monoD lfp_lowerbound) |
17006 | 372 |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
373 |
lemma lfp_lemma3: "mono f ==> lfp f \<le> f (lfp f)" |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
374 |
by (iprover intro: lfp_lemma2 monoD lfp_lowerbound) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
375 |
|
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
376 |
lemma lfp_unfold: "mono f ==> lfp f = f (lfp f)" |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
377 |
by (iprover intro: order_antisym lfp_lemma2 lfp_lemma3) |
17006 | 378 |
|
22356 | 379 |
lemma lfp_const: "lfp (\<lambda>x. t) = t" |
380 |
by (rule lfp_unfold) (simp add:mono_def) |
|
381 |
||
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
382 |
subsection{*General induction rules for least fixed points*} |
17006 | 383 |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
384 |
theorem lfp_induct: |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
385 |
assumes mono: "mono f" and ind: "f (inf (lfp f) P) <= P" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
386 |
shows "lfp f <= P" |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
387 |
proof - |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
388 |
have "inf (lfp f) P <= lfp f" by (rule inf_le1) |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
389 |
with mono have "f (inf (lfp f) P) <= f (lfp f)" .. |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
390 |
also from mono have "f (lfp f) = lfp f" by (rule lfp_unfold [symmetric]) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
391 |
finally have "f (inf (lfp f) P) <= lfp f" . |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
392 |
from this and ind have "f (inf (lfp f) P) <= inf (lfp f) P" by (rule le_infI) |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
393 |
hence "lfp f <= inf (lfp f) P" by (rule lfp_lowerbound) |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
394 |
also have "inf (lfp f) P <= P" by (rule inf_le2) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
395 |
finally show ?thesis . |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
396 |
qed |
17006 | 397 |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
398 |
lemma lfp_induct_set: |
17006 | 399 |
assumes lfp: "a: lfp(f)" |
400 |
and mono: "mono(f)" |
|
401 |
and indhyp: "!!x. [| x: f(lfp(f) Int {x. P(x)}) |] ==> P(x)" |
|
402 |
shows "P(a)" |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
403 |
by (rule lfp_induct [THEN subsetD, THEN CollectD, OF mono _ lfp]) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
404 |
(auto simp: inf_set_eq intro: indhyp) |
17006 | 405 |
|
406 |
||
407 |
text{*Version of induction for binary relations*} |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
408 |
lemmas lfp_induct2 = lfp_induct_set [of "(a,b)", split_format (complete)] |
17006 | 409 |
|
410 |
||
411 |
lemma lfp_ordinal_induct: |
|
412 |
assumes mono: "mono f" |
|
413 |
shows "[| !!S. P S ==> P(f S); !!M. !S:M. P S ==> P(Union M) |] |
|
414 |
==> P(lfp f)" |
|
415 |
apply(subgoal_tac "lfp f = Union{S. S \<subseteq> lfp f & P S}") |
|
416 |
apply (erule ssubst, simp) |
|
417 |
apply(subgoal_tac "Union{S. S \<subseteq> lfp f & P S} \<subseteq> lfp f") |
|
418 |
prefer 2 apply blast |
|
419 |
apply(rule equalityI) |
|
420 |
prefer 2 apply assumption |
|
421 |
apply(drule mono [THEN monoD]) |
|
422 |
apply (cut_tac mono [THEN lfp_unfold], simp) |
|
423 |
apply (rule lfp_lowerbound, auto) |
|
424 |
done |
|
425 |
||
426 |
||
427 |
text{*Definition forms of @{text lfp_unfold} and @{text lfp_induct}, |
|
428 |
to control unfolding*} |
|
429 |
||
430 |
lemma def_lfp_unfold: "[| h==lfp(f); mono(f) |] ==> h = f(h)" |
|
431 |
by (auto intro!: lfp_unfold) |
|
432 |
||
433 |
lemma def_lfp_induct: |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
434 |
"[| A == lfp(f); mono(f); |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
435 |
f (inf A P) \<le> P |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
436 |
|] ==> A \<le> P" |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
437 |
by (blast intro: lfp_induct) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
438 |
|
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
439 |
lemma def_lfp_induct_set: |
17006 | 440 |
"[| A == lfp(f); mono(f); a:A; |
441 |
!!x. [| x: f(A Int {x. P(x)}) |] ==> P(x) |
|
442 |
|] ==> P(a)" |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
443 |
by (blast intro: lfp_induct_set) |
17006 | 444 |
|
445 |
(*Monotonicity of lfp!*) |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
446 |
lemma lfp_mono: "(!!Z. f Z \<le> g Z) ==> lfp f \<le> lfp g" |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
447 |
by (rule lfp_lowerbound [THEN lfp_greatest], blast intro: order_trans) |
17006 | 448 |
|
449 |
||
450 |
subsection{*Proof of Knaster-Tarski Theorem using @{term gfp}*} |
|
451 |
||
452 |
||
453 |
text{*@{term "gfp f"} is the greatest lower bound of |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
454 |
the set @{term "{u. u \<le> f(u)}"} *} |
17006 | 455 |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
456 |
lemma gfp_upperbound: "X \<le> f X ==> X \<le> gfp f" |
21312 | 457 |
by (auto simp add: gfp_def intro: Sup_upper) |
17006 | 458 |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
459 |
lemma gfp_least: "(!!u. u \<le> f u ==> u \<le> X) ==> gfp f \<le> X" |
21312 | 460 |
by (auto simp add: gfp_def intro: Sup_least) |
17006 | 461 |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
462 |
lemma gfp_lemma2: "mono f ==> gfp f \<le> f (gfp f)" |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
463 |
by (iprover intro: gfp_least order_trans monoD gfp_upperbound) |
17006 | 464 |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
465 |
lemma gfp_lemma3: "mono f ==> f (gfp f) \<le> gfp f" |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
466 |
by (iprover intro: gfp_lemma2 monoD gfp_upperbound) |
17006 | 467 |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
468 |
lemma gfp_unfold: "mono f ==> gfp f = f (gfp f)" |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
469 |
by (iprover intro: order_antisym gfp_lemma2 gfp_lemma3) |
17006 | 470 |
|
471 |
subsection{*Coinduction rules for greatest fixed points*} |
|
472 |
||
473 |
text{*weak version*} |
|
474 |
lemma weak_coinduct: "[| a: X; X \<subseteq> f(X) |] ==> a : gfp(f)" |
|
475 |
by (rule gfp_upperbound [THEN subsetD], auto) |
|
476 |
||
477 |
lemma weak_coinduct_image: "!!X. [| a : X; g`X \<subseteq> f (g`X) |] ==> g a : gfp f" |
|
478 |
apply (erule gfp_upperbound [THEN subsetD]) |
|
479 |
apply (erule imageI) |
|
480 |
done |
|
481 |
||
482 |
lemma coinduct_lemma: |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
483 |
"[| X \<le> f (sup X (gfp f)); mono f |] ==> sup X (gfp f) \<le> f (sup X (gfp f))" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
484 |
apply (frule gfp_lemma2) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
485 |
apply (drule mono_sup) |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
486 |
apply (rule le_supI) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
487 |
apply assumption |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
488 |
apply (rule order_trans) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
489 |
apply (rule order_trans) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
490 |
apply assumption |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
491 |
apply (rule sup_ge2) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
492 |
apply assumption |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
493 |
done |
17006 | 494 |
|
495 |
text{*strong version, thanks to Coen and Frost*} |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
496 |
lemma coinduct_set: "[| mono(f); a: X; X \<subseteq> f(X Un gfp(f)) |] ==> a : gfp(f)" |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
497 |
by (blast intro: weak_coinduct [OF _ coinduct_lemma, simplified sup_set_eq]) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
498 |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
499 |
lemma coinduct: "[| mono(f); X \<le> f (sup X (gfp f)) |] ==> X \<le> gfp(f)" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
500 |
apply (rule order_trans) |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
501 |
apply (rule sup_ge1) |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
502 |
apply (erule gfp_upperbound [OF coinduct_lemma]) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
503 |
apply assumption |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
504 |
done |
17006 | 505 |
|
506 |
lemma gfp_fun_UnI2: "[| mono(f); a: gfp(f) |] ==> a: f(X Un gfp(f))" |
|
507 |
by (blast dest: gfp_lemma2 mono_Un) |
|
508 |
||
509 |
subsection{*Even Stronger Coinduction Rule, by Martin Coen*} |
|
510 |
||
511 |
text{* Weakens the condition @{term "X \<subseteq> f(X)"} to one expressed using both |
|
512 |
@{term lfp} and @{term gfp}*} |
|
513 |
||
514 |
lemma coinduct3_mono_lemma: "mono(f) ==> mono(%x. f(x) Un X Un B)" |
|
17589 | 515 |
by (iprover intro: subset_refl monoI Un_mono monoD) |
17006 | 516 |
|
517 |
lemma coinduct3_lemma: |
|
518 |
"[| X \<subseteq> f(lfp(%x. f(x) Un X Un gfp(f))); mono(f) |] |
|
519 |
==> lfp(%x. f(x) Un X Un gfp(f)) \<subseteq> f(lfp(%x. f(x) Un X Un gfp(f)))" |
|
520 |
apply (rule subset_trans) |
|
521 |
apply (erule coinduct3_mono_lemma [THEN lfp_lemma3]) |
|
522 |
apply (rule Un_least [THEN Un_least]) |
|
523 |
apply (rule subset_refl, assumption) |
|
524 |
apply (rule gfp_unfold [THEN equalityD1, THEN subset_trans], assumption) |
|
525 |
apply (rule monoD, assumption) |
|
526 |
apply (subst coinduct3_mono_lemma [THEN lfp_unfold], auto) |
|
527 |
done |
|
528 |
||
529 |
lemma coinduct3: |
|
530 |
"[| mono(f); a:X; X \<subseteq> f(lfp(%x. f(x) Un X Un gfp(f))) |] ==> a : gfp(f)" |
|
531 |
apply (rule coinduct3_lemma [THEN [2] weak_coinduct]) |
|
532 |
apply (rule coinduct3_mono_lemma [THEN lfp_unfold, THEN ssubst], auto) |
|
533 |
done |
|
534 |
||
535 |
||
536 |
text{*Definition forms of @{text gfp_unfold} and @{text coinduct}, |
|
537 |
to control unfolding*} |
|
538 |
||
539 |
lemma def_gfp_unfold: "[| A==gfp(f); mono(f) |] ==> A = f(A)" |
|
540 |
by (auto intro!: gfp_unfold) |
|
541 |
||
542 |
lemma def_coinduct: |
|
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
543 |
"[| A==gfp(f); mono(f); X \<le> f(sup X A) |] ==> X \<le> A" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
544 |
by (iprover intro!: coinduct) |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
545 |
|
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
546 |
lemma def_coinduct_set: |
17006 | 547 |
"[| A==gfp(f); mono(f); a:X; X \<subseteq> f(X Un A) |] ==> a: A" |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
548 |
by (auto intro!: coinduct_set) |
17006 | 549 |
|
550 |
(*The version used in the induction/coinduction package*) |
|
551 |
lemma def_Collect_coinduct: |
|
552 |
"[| A == gfp(%w. Collect(P(w))); mono(%w. Collect(P(w))); |
|
553 |
a: X; !!z. z: X ==> P (X Un A) z |] ==> |
|
554 |
a : A" |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
555 |
apply (erule def_coinduct_set, auto) |
17006 | 556 |
done |
557 |
||
558 |
lemma def_coinduct3: |
|
559 |
"[| A==gfp(f); mono(f); a:X; X \<subseteq> f(lfp(%x. f(x) Un X Un A)) |] ==> a: A" |
|
560 |
by (auto intro!: coinduct3) |
|
561 |
||
562 |
text{*Monotonicity of @{term gfp}!*} |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
563 |
lemma gfp_mono: "(!!Z. f Z \<le> g Z) ==> gfp f \<le> gfp g" |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
564 |
by (rule gfp_upperbound [THEN gfp_least], blast intro: order_trans) |
17006 | 565 |
|
566 |
||
21312 | 567 |
|
17006 | 568 |
ML |
569 |
{* |
|
570 |
val lfp_def = thm "lfp_def"; |
|
571 |
val lfp_lowerbound = thm "lfp_lowerbound"; |
|
572 |
val lfp_greatest = thm "lfp_greatest"; |
|
573 |
val lfp_unfold = thm "lfp_unfold"; |
|
574 |
val lfp_induct = thm "lfp_induct"; |
|
575 |
val lfp_induct2 = thm "lfp_induct2"; |
|
576 |
val lfp_ordinal_induct = thm "lfp_ordinal_induct"; |
|
577 |
val def_lfp_unfold = thm "def_lfp_unfold"; |
|
578 |
val def_lfp_induct = thm "def_lfp_induct"; |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
579 |
val def_lfp_induct_set = thm "def_lfp_induct_set"; |
17006 | 580 |
val lfp_mono = thm "lfp_mono"; |
581 |
val gfp_def = thm "gfp_def"; |
|
582 |
val gfp_upperbound = thm "gfp_upperbound"; |
|
583 |
val gfp_least = thm "gfp_least"; |
|
584 |
val gfp_unfold = thm "gfp_unfold"; |
|
585 |
val weak_coinduct = thm "weak_coinduct"; |
|
586 |
val weak_coinduct_image = thm "weak_coinduct_image"; |
|
587 |
val coinduct = thm "coinduct"; |
|
588 |
val gfp_fun_UnI2 = thm "gfp_fun_UnI2"; |
|
589 |
val coinduct3 = thm "coinduct3"; |
|
590 |
val def_gfp_unfold = thm "def_gfp_unfold"; |
|
591 |
val def_coinduct = thm "def_coinduct"; |
|
592 |
val def_Collect_coinduct = thm "def_Collect_coinduct"; |
|
593 |
val def_coinduct3 = thm "def_coinduct3"; |
|
594 |
val gfp_mono = thm "gfp_mono"; |
|
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
595 |
val le_funI = thm "le_funI"; |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
596 |
val le_boolI = thm "le_boolI"; |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
597 |
val le_boolI' = thm "le_boolI'"; |
22422
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
598 |
val inf_fun_eq = thm "inf_fun_eq"; |
ee19cdb07528
stepping towards uniform lattice theory development in HOL
haftmann
parents:
22390
diff
changeset
|
599 |
val inf_bool_eq = thm "inf_bool_eq"; |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
600 |
val le_funE = thm "le_funE"; |
22276
96a4db55a0b3
Introduction and elimination rules for <= on predicates
berghofe
parents:
21547
diff
changeset
|
601 |
val le_funD = thm "le_funD"; |
21017
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
602 |
val le_boolE = thm "le_boolE"; |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
603 |
val le_boolD = thm "le_boolD"; |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
604 |
val le_bool_def = thm "le_bool_def"; |
5693e4471c2b
Generalized gfp and lfp to arbitrary complete lattices.
berghofe
parents:
17589
diff
changeset
|
605 |
val le_fun_def = thm "le_fun_def"; |
17006 | 606 |
*} |
607 |
||
608 |
end |