| author | krauss |
| Fri, 07 May 2010 15:03:53 +0200 | |
| changeset 36728 | ae397b810c8b |
| parent 36696 | 1b69f78be286 |
| permissions | -rw-r--r-- |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
1 |
(* Title: HOL/PReal.thy |
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
2 |
Author: Jacques D. Fleuriot, University of Cambridge |
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
3 |
|
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
4 |
The positive reals as Dedekind sections of positive |
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
5 |
rationals. Fundamentals of Abstract Analysis [Gleason- p. 121] |
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
6 |
provides some of the definitions. |
| 5078 | 7 |
*) |
8 |
||
| 17428 | 9 |
header {* Positive real numbers *}
|
10 |
||
| 15131 | 11 |
theory PReal |
| 35372 | 12 |
imports Rat |
| 15131 | 13 |
begin |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
14 |
|
|
35050
9f841f20dca6
renamed OrderedGroup to Groups; split theory Ring_and_Field into Rings Fields
haftmann
parents:
35028
diff
changeset
|
15 |
text{*Could be generalized and moved to @{text Groups}*}
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
16 |
lemma add_eq_exists: "\<exists>x. a+x = (b::rat)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
17 |
by (rule_tac x="b-a" in exI, simp) |
| 5078 | 18 |
|
| 19765 | 19 |
definition |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20495
diff
changeset
|
20 |
cut :: "rat set => bool" where |
| 28562 | 21 |
[code del]: "cut A = ({} \<subset> A &
|
| 19765 | 22 |
A < {r. 0 < r} &
|
23 |
(\<forall>y \<in> A. ((\<forall>z. 0<z & z < y --> z \<in> A) & (\<exists>u \<in> A. y < u))))" |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
24 |
|
|
29811
026b0f9f579f
fixed Proofs and dependencies ; Theory Dense_Linear_Order moved to Library
chaieb@chaieb-laptop
parents:
29667
diff
changeset
|
25 |
lemma interval_empty_iff: |
|
35028
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents:
32960
diff
changeset
|
26 |
"{y. (x::'a::dense_linorder) < y \<and> y < z} = {} \<longleftrightarrow> \<not> x < z"
|
|
29811
026b0f9f579f
fixed Proofs and dependencies ; Theory Dense_Linear_Order moved to Library
chaieb@chaieb-laptop
parents:
29667
diff
changeset
|
27 |
by (auto dest: dense) |
|
026b0f9f579f
fixed Proofs and dependencies ; Theory Dense_Linear_Order moved to Library
chaieb@chaieb-laptop
parents:
29667
diff
changeset
|
28 |
|
|
026b0f9f579f
fixed Proofs and dependencies ; Theory Dense_Linear_Order moved to Library
chaieb@chaieb-laptop
parents:
29667
diff
changeset
|
29 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
30 |
lemma cut_of_rat: |
| 20495 | 31 |
assumes q: "0 < q" shows "cut {r::rat. 0 < r & r < q}" (is "cut ?A")
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
32 |
proof - |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
33 |
from q have pos: "?A < {r. 0 < r}" by force
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
34 |
have nonempty: "{} \<subset> ?A"
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
35 |
proof |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
36 |
show "{} \<subseteq> ?A" by simp
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
37 |
show "{} \<noteq> ?A"
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
38 |
by (force simp only: q eq_commute [of "{}"] interval_empty_iff)
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
39 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
40 |
show ?thesis |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
41 |
by (simp add: cut_def pos nonempty, |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
42 |
blast dest: dense intro: order_less_trans) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
43 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
44 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
45 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
46 |
typedef preal = "{A. cut A}"
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
47 |
by (blast intro: cut_of_rat [OF zero_less_one]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
48 |
|
| 19765 | 49 |
definition |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20495
diff
changeset
|
50 |
psup :: "preal set => preal" where |
|
32115
8f10fb3bb46e
swapped bootstrap order of UNION/Union and INTER/Inter in theory Set
haftmann
parents:
29811
diff
changeset
|
51 |
[code del]: "psup P = Abs_preal (\<Union>X \<in> P. Rep_preal X)" |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
52 |
|
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20495
diff
changeset
|
53 |
definition |
|
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20495
diff
changeset
|
54 |
add_set :: "[rat set,rat set] => rat set" where |
| 19765 | 55 |
"add_set A B = {w. \<exists>x \<in> A. \<exists>y \<in> B. w = x + y}"
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
56 |
|
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20495
diff
changeset
|
57 |
definition |
|
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20495
diff
changeset
|
58 |
diff_set :: "[rat set,rat set] => rat set" where |
| 28562 | 59 |
[code del]: "diff_set A B = {w. \<exists>x. 0 < w & 0 < x & x \<notin> B & x + w \<in> A}"
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
60 |
|
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20495
diff
changeset
|
61 |
definition |
|
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20495
diff
changeset
|
62 |
mult_set :: "[rat set,rat set] => rat set" where |
| 19765 | 63 |
"mult_set A B = {w. \<exists>x \<in> A. \<exists>y \<in> B. w = x * y}"
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
64 |
|
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20495
diff
changeset
|
65 |
definition |
|
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20495
diff
changeset
|
66 |
inverse_set :: "rat set => rat set" where |
| 28562 | 67 |
[code del]: "inverse_set A = {x. \<exists>y. 0 < x & x < y & inverse y \<notin> A}"
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
68 |
|
| 26511 | 69 |
instantiation preal :: "{ord, plus, minus, times, inverse, one}"
|
70 |
begin |
|
| 5078 | 71 |
|
| 26511 | 72 |
definition |
| 28562 | 73 |
preal_less_def [code del]: |
| 20495 | 74 |
"R < S == Rep_preal R < Rep_preal S" |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
75 |
|
| 26511 | 76 |
definition |
| 28562 | 77 |
preal_le_def [code del]: |
| 20495 | 78 |
"R \<le> S == Rep_preal R \<subseteq> Rep_preal S" |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
79 |
|
| 26511 | 80 |
definition |
| 14335 | 81 |
preal_add_def: |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
82 |
"R + S == Abs_preal (add_set (Rep_preal R) (Rep_preal S))" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
83 |
|
| 26511 | 84 |
definition |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
85 |
preal_diff_def: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
86 |
"R - S == Abs_preal (diff_set (Rep_preal R) (Rep_preal S))" |
| 5078 | 87 |
|
| 26511 | 88 |
definition |
| 14335 | 89 |
preal_mult_def: |
| 20495 | 90 |
"R * S == Abs_preal (mult_set (Rep_preal R) (Rep_preal S))" |
| 5078 | 91 |
|
| 26511 | 92 |
definition |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
93 |
preal_inverse_def: |
| 20495 | 94 |
"inverse R == Abs_preal (inverse_set (Rep_preal R))" |
| 14335 | 95 |
|
| 26564 | 96 |
definition "R / S = R * inverse (S\<Colon>preal)" |
97 |
||
| 26511 | 98 |
definition |
|
23287
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
99 |
preal_one_def: |
|
36696
1b69f78be286
remove unused constant preal_of_rat; remove several unused lemmas about preals
huffman
parents:
35372
diff
changeset
|
100 |
"1 == Abs_preal {x. 0 < x & x < 1}"
|
|
23287
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
101 |
|
| 26511 | 102 |
instance .. |
103 |
||
104 |
end |
|
105 |
||
| 14335 | 106 |
|
| 15413 | 107 |
text{*Reduces equality on abstractions to equality on representatives*}
|
108 |
declare Abs_preal_inject [simp] |
|
| 20495 | 109 |
declare Abs_preal_inverse [simp] |
110 |
||
111 |
lemma rat_mem_preal: "0 < q ==> {r::rat. 0 < r & r < q} \<in> preal"
|
|
112 |
by (simp add: preal_def cut_of_rat) |
|
| 14335 | 113 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
114 |
lemma preal_nonempty: "A \<in> preal ==> \<exists>x\<in>A. 0 < x" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
115 |
by (unfold preal_def cut_def, blast) |
| 14335 | 116 |
|
| 20495 | 117 |
lemma preal_Ex_mem: "A \<in> preal \<Longrightarrow> \<exists>x. x \<in> A" |
118 |
by (drule preal_nonempty, fast) |
|
119 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
120 |
lemma preal_imp_psubset_positives: "A \<in> preal ==> A < {r. 0 < r}"
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
121 |
by (force simp add: preal_def cut_def) |
| 14335 | 122 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
123 |
lemma preal_exists_bound: "A \<in> preal ==> \<exists>x. 0 < x & x \<notin> A" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
124 |
by (drule preal_imp_psubset_positives, auto) |
| 14335 | 125 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
126 |
lemma preal_exists_greater: "[| A \<in> preal; y \<in> A |] ==> \<exists>u \<in> A. y < u" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
127 |
by (unfold preal_def cut_def, blast) |
| 14335 | 128 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
129 |
lemma preal_downwards_closed: "[| A \<in> preal; y \<in> A; 0 < z; z < y |] ==> z \<in> A" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
130 |
by (unfold preal_def cut_def, blast) |
| 14335 | 131 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
132 |
text{*Relaxing the final premise*}
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
133 |
lemma preal_downwards_closed': |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
134 |
"[| A \<in> preal; y \<in> A; 0 < z; z \<le> y |] ==> z \<in> A" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
135 |
apply (simp add: order_le_less) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
136 |
apply (blast intro: preal_downwards_closed) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
137 |
done |
| 14335 | 138 |
|
139 |
text{*A positive fraction not in a positive real is an upper bound.
|
|
140 |
Gleason p. 122 - Remark (1)*} |
|
141 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
142 |
lemma not_in_preal_ub: |
| 19765 | 143 |
assumes A: "A \<in> preal" |
144 |
and notx: "x \<notin> A" |
|
145 |
and y: "y \<in> A" |
|
146 |
and pos: "0 < x" |
|
147 |
shows "y < x" |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
148 |
proof (cases rule: linorder_cases) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
149 |
assume "x<y" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
150 |
with notx show ?thesis |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
151 |
by (simp add: preal_downwards_closed [OF A y] pos) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
152 |
next |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
153 |
assume "x=y" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
154 |
with notx and y show ?thesis by simp |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
155 |
next |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
156 |
assume "y<x" |
| 20495 | 157 |
thus ?thesis . |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
158 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
159 |
|
| 20495 | 160 |
text {* preal lemmas instantiated to @{term "Rep_preal X"} *}
|
161 |
||
162 |
lemma mem_Rep_preal_Ex: "\<exists>x. x \<in> Rep_preal X" |
|
163 |
by (rule preal_Ex_mem [OF Rep_preal]) |
|
164 |
||
165 |
lemma Rep_preal_exists_bound: "\<exists>x>0. x \<notin> Rep_preal X" |
|
166 |
by (rule preal_exists_bound [OF Rep_preal]) |
|
167 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
168 |
lemmas not_in_Rep_preal_ub = not_in_preal_ub [OF Rep_preal] |
| 14335 | 169 |
|
170 |
||
| 20495 | 171 |
subsection{*Properties of Ordering*}
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
172 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
173 |
instance preal :: order |
| 27682 | 174 |
proof |
175 |
fix w :: preal |
|
176 |
show "w \<le> w" by (simp add: preal_le_def) |
|
177 |
next |
|
178 |
fix i j k :: preal |
|
179 |
assume "i \<le> j" and "j \<le> k" |
|
180 |
then show "i \<le> k" by (simp add: preal_le_def) |
|
181 |
next |
|
182 |
fix z w :: preal |
|
183 |
assume "z \<le> w" and "w \<le> z" |
|
184 |
then show "z = w" by (simp add: preal_le_def Rep_preal_inject) |
|
185 |
next |
|
186 |
fix z w :: preal |
|
187 |
show "z < w \<longleftrightarrow> z \<le> w \<and> \<not> w \<le> z" |
|
188 |
by (auto simp add: preal_le_def preal_less_def Rep_preal_inject) |
|
189 |
qed |
|
| 14335 | 190 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
191 |
lemma preal_imp_pos: "[|A \<in> preal; r \<in> A|] ==> 0 < r" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
192 |
by (insert preal_imp_psubset_positives, blast) |
| 14335 | 193 |
|
| 27682 | 194 |
instance preal :: linorder |
195 |
proof |
|
196 |
fix x y :: preal |
|
197 |
show "x <= y | y <= x" |
|
198 |
apply (auto simp add: preal_le_def) |
|
199 |
apply (rule ccontr) |
|
200 |
apply (blast dest: not_in_Rep_preal_ub intro: preal_imp_pos [OF Rep_preal] |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
201 |
elim: order_less_asym) |
| 27682 | 202 |
done |
203 |
qed |
|
| 14335 | 204 |
|
|
25571
c9e39eafc7a0
instantiation target rather than legacy instance
haftmann
parents:
25502
diff
changeset
|
205 |
instantiation preal :: distrib_lattice |
|
c9e39eafc7a0
instantiation target rather than legacy instance
haftmann
parents:
25502
diff
changeset
|
206 |
begin |
|
c9e39eafc7a0
instantiation target rather than legacy instance
haftmann
parents:
25502
diff
changeset
|
207 |
|
|
c9e39eafc7a0
instantiation target rather than legacy instance
haftmann
parents:
25502
diff
changeset
|
208 |
definition |
|
c9e39eafc7a0
instantiation target rather than legacy instance
haftmann
parents:
25502
diff
changeset
|
209 |
"(inf \<Colon> preal \<Rightarrow> preal \<Rightarrow> preal) = min" |
|
c9e39eafc7a0
instantiation target rather than legacy instance
haftmann
parents:
25502
diff
changeset
|
210 |
|
|
c9e39eafc7a0
instantiation target rather than legacy instance
haftmann
parents:
25502
diff
changeset
|
211 |
definition |
|
c9e39eafc7a0
instantiation target rather than legacy instance
haftmann
parents:
25502
diff
changeset
|
212 |
"(sup \<Colon> preal \<Rightarrow> preal \<Rightarrow> preal) = max" |
|
c9e39eafc7a0
instantiation target rather than legacy instance
haftmann
parents:
25502
diff
changeset
|
213 |
|
|
c9e39eafc7a0
instantiation target rather than legacy instance
haftmann
parents:
25502
diff
changeset
|
214 |
instance |
| 22483 | 215 |
by intro_classes |
216 |
(auto simp add: inf_preal_def sup_preal_def min_max.sup_inf_distrib1) |
|
| 14335 | 217 |
|
|
25571
c9e39eafc7a0
instantiation target rather than legacy instance
haftmann
parents:
25502
diff
changeset
|
218 |
end |
| 14335 | 219 |
|
220 |
subsection{*Properties of Addition*}
|
|
221 |
||
222 |
lemma preal_add_commute: "(x::preal) + y = y + x" |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
223 |
apply (unfold preal_add_def add_set_def) |
| 14335 | 224 |
apply (rule_tac f = Abs_preal in arg_cong) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
225 |
apply (force simp add: add_commute) |
| 14335 | 226 |
done |
227 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
228 |
text{*Lemmas for proving that addition of two positive reals gives
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
229 |
a positive real*} |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
230 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
231 |
lemma empty_psubset_nonempty: "a \<in> A ==> {} \<subset> A"
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
232 |
by blast |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
233 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
234 |
text{*Part 1 of Dedekind sections definition*}
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
235 |
lemma add_set_not_empty: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
236 |
"[|A \<in> preal; B \<in> preal|] ==> {} \<subset> add_set A B"
|
| 20495 | 237 |
apply (drule preal_nonempty)+ |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
238 |
apply (auto simp add: add_set_def) |
| 14335 | 239 |
done |
240 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
241 |
text{*Part 2 of Dedekind sections definition. A structured version of
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
242 |
this proof is @{text preal_not_mem_mult_set_Ex} below.*}
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
243 |
lemma preal_not_mem_add_set_Ex: |
| 20495 | 244 |
"[|A \<in> preal; B \<in> preal|] ==> \<exists>q>0. q \<notin> add_set A B" |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
245 |
apply (insert preal_exists_bound [of A] preal_exists_bound [of B], auto) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
246 |
apply (rule_tac x = "x+xa" in exI) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
247 |
apply (simp add: add_set_def, clarify) |
| 20495 | 248 |
apply (drule (3) not_in_preal_ub)+ |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
249 |
apply (force dest: add_strict_mono) |
| 14335 | 250 |
done |
251 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
252 |
lemma add_set_not_rat_set: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
253 |
assumes A: "A \<in> preal" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
254 |
and B: "B \<in> preal" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
255 |
shows "add_set A B < {r. 0 < r}"
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
256 |
proof |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
257 |
from preal_imp_pos [OF A] preal_imp_pos [OF B] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
258 |
show "add_set A B \<subseteq> {r. 0 < r}" by (force simp add: add_set_def)
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
259 |
next |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
260 |
show "add_set A B \<noteq> {r. 0 < r}"
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
261 |
by (insert preal_not_mem_add_set_Ex [OF A B], blast) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
262 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
263 |
|
| 14335 | 264 |
text{*Part 3 of Dedekind sections definition*}
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
265 |
lemma add_set_lemma3: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
266 |
"[|A \<in> preal; B \<in> preal; u \<in> add_set A B; 0 < z; z < u|] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
267 |
==> z \<in> add_set A B" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
268 |
proof (unfold add_set_def, clarify) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
269 |
fix x::rat and y::rat |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
270 |
assume A: "A \<in> preal" |
| 19765 | 271 |
and B: "B \<in> preal" |
272 |
and [simp]: "0 < z" |
|
273 |
and zless: "z < x + y" |
|
274 |
and x: "x \<in> A" |
|
275 |
and y: "y \<in> B" |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
276 |
have xpos [simp]: "0<x" by (rule preal_imp_pos [OF A x]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
277 |
have ypos [simp]: "0<y" by (rule preal_imp_pos [OF B y]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
278 |
have xypos [simp]: "0 < x+y" by (simp add: pos_add_strict) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
279 |
let ?f = "z/(x+y)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
280 |
have fless: "?f < 1" by (simp add: zless pos_divide_less_eq) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
281 |
show "\<exists>x' \<in> A. \<exists>y'\<in>B. z = x' + y'" |
| 20495 | 282 |
proof (intro bexI) |
283 |
show "z = x*?f + y*?f" |
|
284 |
by (simp add: left_distrib [symmetric] divide_inverse mult_ac |
|
285 |
order_less_imp_not_eq2) |
|
286 |
next |
|
287 |
show "y * ?f \<in> B" |
|
288 |
proof (rule preal_downwards_closed [OF B y]) |
|
289 |
show "0 < y * ?f" |
|
290 |
by (simp add: divide_inverse zero_less_mult_iff) |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
291 |
next |
| 20495 | 292 |
show "y * ?f < y" |
293 |
by (insert mult_strict_left_mono [OF fless ypos], simp) |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
294 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
295 |
next |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
296 |
show "x * ?f \<in> A" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
297 |
proof (rule preal_downwards_closed [OF A x]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
298 |
show "0 < x * ?f" |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
299 |
by (simp add: divide_inverse zero_less_mult_iff) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
300 |
next |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
301 |
show "x * ?f < x" |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
302 |
by (insert mult_strict_left_mono [OF fless xpos], simp) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
303 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
304 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
305 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
306 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
307 |
text{*Part 4 of Dedekind sections definition*}
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
308 |
lemma add_set_lemma4: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
309 |
"[|A \<in> preal; B \<in> preal; y \<in> add_set A B|] ==> \<exists>u \<in> add_set A B. y < u" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
310 |
apply (auto simp add: add_set_def) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
311 |
apply (frule preal_exists_greater [of A], auto) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
312 |
apply (rule_tac x="u + y" in exI) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
313 |
apply (auto intro: add_strict_left_mono) |
| 14335 | 314 |
done |
315 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
316 |
lemma mem_add_set: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
317 |
"[|A \<in> preal; B \<in> preal|] ==> add_set A B \<in> preal" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
318 |
apply (simp (no_asm_simp) add: preal_def cut_def) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
319 |
apply (blast intro!: add_set_not_empty add_set_not_rat_set |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
320 |
add_set_lemma3 add_set_lemma4) |
| 14335 | 321 |
done |
322 |
||
323 |
lemma preal_add_assoc: "((x::preal) + y) + z = x + (y + z)" |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
324 |
apply (simp add: preal_add_def mem_add_set Rep_preal) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
325 |
apply (force simp add: add_set_def add_ac) |
| 14335 | 326 |
done |
327 |
||
|
23287
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
328 |
instance preal :: ab_semigroup_add |
|
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
329 |
proof |
|
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
330 |
fix a b c :: preal |
|
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
331 |
show "(a + b) + c = a + (b + c)" by (rule preal_add_assoc) |
|
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
332 |
show "a + b = b + a" by (rule preal_add_commute) |
|
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
333 |
qed |
|
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
334 |
|
| 14335 | 335 |
|
336 |
subsection{*Properties of Multiplication*}
|
|
337 |
||
338 |
text{*Proofs essentially same as for addition*}
|
|
339 |
||
340 |
lemma preal_mult_commute: "(x::preal) * y = y * x" |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
341 |
apply (unfold preal_mult_def mult_set_def) |
| 14335 | 342 |
apply (rule_tac f = Abs_preal in arg_cong) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
343 |
apply (force simp add: mult_commute) |
| 14335 | 344 |
done |
345 |
||
| 15055 | 346 |
text{*Multiplication of two positive reals gives a positive real.*}
|
| 14335 | 347 |
|
348 |
text{*Lemmas for proving positive reals multiplication set in @{typ preal}*}
|
|
349 |
||
350 |
text{*Part 1 of Dedekind sections definition*}
|
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
351 |
lemma mult_set_not_empty: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
352 |
"[|A \<in> preal; B \<in> preal|] ==> {} \<subset> mult_set A B"
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
353 |
apply (insert preal_nonempty [of A] preal_nonempty [of B]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
354 |
apply (auto simp add: mult_set_def) |
| 14335 | 355 |
done |
356 |
||
357 |
text{*Part 2 of Dedekind sections definition*}
|
|
358 |
lemma preal_not_mem_mult_set_Ex: |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
359 |
assumes A: "A \<in> preal" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
360 |
and B: "B \<in> preal" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
361 |
shows "\<exists>q. 0 < q & q \<notin> mult_set A B" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
362 |
proof - |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
363 |
from preal_exists_bound [OF A] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
364 |
obtain x where [simp]: "0 < x" "x \<notin> A" by blast |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
365 |
from preal_exists_bound [OF B] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
366 |
obtain y where [simp]: "0 < y" "y \<notin> B" by blast |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
367 |
show ?thesis |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
368 |
proof (intro exI conjI) |
|
16775
c1b87ef4a1c3
added lemmas to OrderedGroup.thy (reasoning about signs, absolute value, triangle inequalities)
avigad
parents:
15413
diff
changeset
|
369 |
show "0 < x*y" by (simp add: mult_pos_pos) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
370 |
show "x * y \<notin> mult_set A B" |
| 14377 | 371 |
proof - |
372 |
{ fix u::rat and v::rat
|
|
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
373 |
assume "u \<in> A" and "v \<in> B" and "x*y = u*v" |
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
374 |
moreover |
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
375 |
with prems have "u<x" and "v<y" by (blast dest: not_in_preal_ub)+ |
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
376 |
moreover |
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
377 |
with prems have "0\<le>v" |
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
378 |
by (blast intro: preal_imp_pos [OF B] order_less_imp_le prems) |
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
379 |
moreover |
| 14550 | 380 |
from calculation |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
381 |
have "u*v < x*y" by (blast intro: mult_strict_mono prems) |
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
382 |
ultimately have False by force } |
| 14377 | 383 |
thus ?thesis by (auto simp add: mult_set_def) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
384 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
385 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
386 |
qed |
| 14335 | 387 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
388 |
lemma mult_set_not_rat_set: |
| 19765 | 389 |
assumes A: "A \<in> preal" |
390 |
and B: "B \<in> preal" |
|
391 |
shows "mult_set A B < {r. 0 < r}"
|
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
392 |
proof |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
393 |
show "mult_set A B \<subseteq> {r. 0 < r}"
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
394 |
by (force simp add: mult_set_def |
| 19765 | 395 |
intro: preal_imp_pos [OF A] preal_imp_pos [OF B] mult_pos_pos) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
396 |
show "mult_set A B \<noteq> {r. 0 < r}"
|
| 19765 | 397 |
using preal_not_mem_mult_set_Ex [OF A B] by blast |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
398 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
399 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
400 |
|
| 14335 | 401 |
|
402 |
text{*Part 3 of Dedekind sections definition*}
|
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
403 |
lemma mult_set_lemma3: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
404 |
"[|A \<in> preal; B \<in> preal; u \<in> mult_set A B; 0 < z; z < u|] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
405 |
==> z \<in> mult_set A B" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
406 |
proof (unfold mult_set_def, clarify) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
407 |
fix x::rat and y::rat |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
408 |
assume A: "A \<in> preal" |
| 19765 | 409 |
and B: "B \<in> preal" |
410 |
and [simp]: "0 < z" |
|
411 |
and zless: "z < x * y" |
|
412 |
and x: "x \<in> A" |
|
413 |
and y: "y \<in> B" |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
414 |
have [simp]: "0<y" by (rule preal_imp_pos [OF B y]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
415 |
show "\<exists>x' \<in> A. \<exists>y' \<in> B. z = x' * y'" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
416 |
proof |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
417 |
show "\<exists>y'\<in>B. z = (z/y) * y'" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
418 |
proof |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
419 |
show "z = (z/y)*y" |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
420 |
by (simp add: divide_inverse mult_commute [of y] mult_assoc |
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
421 |
order_less_imp_not_eq2) |
| 23389 | 422 |
show "y \<in> B" by fact |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
423 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
424 |
next |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
425 |
show "z/y \<in> A" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
426 |
proof (rule preal_downwards_closed [OF A x]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
427 |
show "0 < z/y" |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
428 |
by (simp add: zero_less_divide_iff) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
429 |
show "z/y < x" by (simp add: pos_divide_less_eq zless) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
430 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
431 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
432 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
433 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
434 |
text{*Part 4 of Dedekind sections definition*}
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
435 |
lemma mult_set_lemma4: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
436 |
"[|A \<in> preal; B \<in> preal; y \<in> mult_set A B|] ==> \<exists>u \<in> mult_set A B. y < u" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
437 |
apply (auto simp add: mult_set_def) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
438 |
apply (frule preal_exists_greater [of A], auto) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
439 |
apply (rule_tac x="u * y" in exI) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
440 |
apply (auto intro: preal_imp_pos [of A] preal_imp_pos [of B] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
441 |
mult_strict_right_mono) |
| 14335 | 442 |
done |
443 |
||
444 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
445 |
lemma mem_mult_set: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
446 |
"[|A \<in> preal; B \<in> preal|] ==> mult_set A B \<in> preal" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
447 |
apply (simp (no_asm_simp) add: preal_def cut_def) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
448 |
apply (blast intro!: mult_set_not_empty mult_set_not_rat_set |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
449 |
mult_set_lemma3 mult_set_lemma4) |
| 14335 | 450 |
done |
451 |
||
452 |
lemma preal_mult_assoc: "((x::preal) * y) * z = x * (y * z)" |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
453 |
apply (simp add: preal_mult_def mem_mult_set Rep_preal) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
454 |
apply (force simp add: mult_set_def mult_ac) |
| 14335 | 455 |
done |
456 |
||
|
23287
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
457 |
instance preal :: ab_semigroup_mult |
|
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
458 |
proof |
|
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
459 |
fix a b c :: preal |
|
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
460 |
show "(a * b) * c = a * (b * c)" by (rule preal_mult_assoc) |
|
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
461 |
show "a * b = b * a" by (rule preal_mult_commute) |
|
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
462 |
qed |
|
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
463 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
464 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
465 |
text{* Positive real 1 is the multiplicative identity element *}
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
466 |
|
|
23287
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
467 |
lemma preal_mult_1: "(1::preal) * z = z" |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
468 |
proof (induct z) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
469 |
fix A :: "rat set" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
470 |
assume A: "A \<in> preal" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
471 |
have "{w. \<exists>u. 0 < u \<and> u < 1 & (\<exists>v \<in> A. w = u * v)} = A" (is "?lhs = A")
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
472 |
proof |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
473 |
show "?lhs \<subseteq> A" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
474 |
proof clarify |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
475 |
fix x::rat and u::rat and v::rat |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
476 |
assume upos: "0<u" and "u<1" and v: "v \<in> A" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
477 |
have vpos: "0<v" by (rule preal_imp_pos [OF A v]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
478 |
hence "u*v < 1*v" by (simp only: mult_strict_right_mono prems) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
479 |
thus "u * v \<in> A" |
|
16775
c1b87ef4a1c3
added lemmas to OrderedGroup.thy (reasoning about signs, absolute value, triangle inequalities)
avigad
parents:
15413
diff
changeset
|
480 |
by (force intro: preal_downwards_closed [OF A v] mult_pos_pos |
|
c1b87ef4a1c3
added lemmas to OrderedGroup.thy (reasoning about signs, absolute value, triangle inequalities)
avigad
parents:
15413
diff
changeset
|
481 |
upos vpos) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
482 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
483 |
next |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
484 |
show "A \<subseteq> ?lhs" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
485 |
proof clarify |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
486 |
fix x::rat |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
487 |
assume x: "x \<in> A" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
488 |
have xpos: "0<x" by (rule preal_imp_pos [OF A x]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
489 |
from preal_exists_greater [OF A x] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
490 |
obtain v where v: "v \<in> A" and xlessv: "x < v" .. |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
491 |
have vpos: "0<v" by (rule preal_imp_pos [OF A v]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
492 |
show "\<exists>u. 0 < u \<and> u < 1 \<and> (\<exists>v\<in>A. x = u * v)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
493 |
proof (intro exI conjI) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
494 |
show "0 < x/v" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
495 |
by (simp add: zero_less_divide_iff xpos vpos) |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
496 |
show "x / v < 1" |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
497 |
by (simp add: pos_divide_less_eq vpos xlessv) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
498 |
show "\<exists>v'\<in>A. x = (x / v) * v'" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
499 |
proof |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
500 |
show "x = (x/v)*v" |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
501 |
by (simp add: divide_inverse mult_assoc vpos |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
502 |
order_less_imp_not_eq2) |
| 23389 | 503 |
show "v \<in> A" by fact |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
504 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
505 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
506 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
507 |
qed |
|
36696
1b69f78be286
remove unused constant preal_of_rat; remove several unused lemmas about preals
huffman
parents:
35372
diff
changeset
|
508 |
thus "1 * Abs_preal A = Abs_preal A" |
|
1b69f78be286
remove unused constant preal_of_rat; remove several unused lemmas about preals
huffman
parents:
35372
diff
changeset
|
509 |
by (simp add: preal_one_def preal_mult_def mult_set_def |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
510 |
rat_mem_preal A) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
511 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
512 |
|
|
23287
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
513 |
instance preal :: comm_monoid_mult |
|
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
514 |
by intro_classes (rule preal_mult_1) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
515 |
|
| 14335 | 516 |
|
517 |
subsection{*Distribution of Multiplication across Addition*}
|
|
518 |
||
519 |
lemma mem_Rep_preal_add_iff: |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
520 |
"(z \<in> Rep_preal(R+S)) = (\<exists>x \<in> Rep_preal R. \<exists>y \<in> Rep_preal S. z = x + y)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
521 |
apply (simp add: preal_add_def mem_add_set Rep_preal) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
522 |
apply (simp add: add_set_def) |
| 14335 | 523 |
done |
524 |
||
525 |
lemma mem_Rep_preal_mult_iff: |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
526 |
"(z \<in> Rep_preal(R*S)) = (\<exists>x \<in> Rep_preal R. \<exists>y \<in> Rep_preal S. z = x * y)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
527 |
apply (simp add: preal_mult_def mem_mult_set Rep_preal) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
528 |
apply (simp add: mult_set_def) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
529 |
done |
| 14335 | 530 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
531 |
lemma distrib_subset1: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
532 |
"Rep_preal (w * (x + y)) \<subseteq> Rep_preal (w * x + w * y)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
533 |
apply (auto simp add: Bex_def mem_Rep_preal_add_iff mem_Rep_preal_mult_iff) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
534 |
apply (force simp add: right_distrib) |
| 14335 | 535 |
done |
536 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
537 |
lemma preal_add_mult_distrib_mean: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
538 |
assumes a: "a \<in> Rep_preal w" |
| 19765 | 539 |
and b: "b \<in> Rep_preal w" |
540 |
and d: "d \<in> Rep_preal x" |
|
541 |
and e: "e \<in> Rep_preal y" |
|
542 |
shows "\<exists>c \<in> Rep_preal w. a * d + b * e = c * (d + e)" |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
543 |
proof |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
544 |
let ?c = "(a*d + b*e)/(d+e)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
545 |
have [simp]: "0<a" "0<b" "0<d" "0<e" "0<d+e" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
546 |
by (blast intro: preal_imp_pos [OF Rep_preal] a b d e pos_add_strict)+ |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
547 |
have cpos: "0 < ?c" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
548 |
by (simp add: zero_less_divide_iff zero_less_mult_iff pos_add_strict) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
549 |
show "a * d + b * e = ?c * (d + e)" |
|
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14387
diff
changeset
|
550 |
by (simp add: divide_inverse mult_assoc order_less_imp_not_eq2) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
551 |
show "?c \<in> Rep_preal w" |
| 20495 | 552 |
proof (cases rule: linorder_le_cases) |
553 |
assume "a \<le> b" |
|
554 |
hence "?c \<le> b" |
|
555 |
by (simp add: pos_divide_le_eq right_distrib mult_right_mono |
|
556 |
order_less_imp_le) |
|
557 |
thus ?thesis by (rule preal_downwards_closed' [OF Rep_preal b cpos]) |
|
558 |
next |
|
559 |
assume "b \<le> a" |
|
560 |
hence "?c \<le> a" |
|
561 |
by (simp add: pos_divide_le_eq right_distrib mult_right_mono |
|
562 |
order_less_imp_le) |
|
563 |
thus ?thesis by (rule preal_downwards_closed' [OF Rep_preal a cpos]) |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
564 |
qed |
| 20495 | 565 |
qed |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
566 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
567 |
lemma distrib_subset2: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
568 |
"Rep_preal (w * x + w * y) \<subseteq> Rep_preal (w * (x + y))" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
569 |
apply (auto simp add: Bex_def mem_Rep_preal_add_iff mem_Rep_preal_mult_iff) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
570 |
apply (drule_tac w=w and x=x and y=y in preal_add_mult_distrib_mean, auto) |
| 14335 | 571 |
done |
572 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
573 |
lemma preal_add_mult_distrib2: "(w * ((x::preal) + y)) = (w * x) + (w * y)" |
| 15413 | 574 |
apply (rule Rep_preal_inject [THEN iffD1]) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
575 |
apply (rule equalityI [OF distrib_subset1 distrib_subset2]) |
| 14335 | 576 |
done |
577 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
578 |
lemma preal_add_mult_distrib: "(((x::preal) + y) * w) = (x * w) + (y * w)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
579 |
by (simp add: preal_mult_commute preal_add_mult_distrib2) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
580 |
|
|
23287
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
581 |
instance preal :: comm_semiring |
|
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
582 |
by intro_classes (rule preal_add_mult_distrib) |
|
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
583 |
|
| 14335 | 584 |
|
585 |
subsection{*Existence of Inverse, a Positive Real*}
|
|
586 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
587 |
lemma mem_inv_set_ex: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
588 |
assumes A: "A \<in> preal" shows "\<exists>x y. 0 < x & x < y & inverse y \<notin> A" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
589 |
proof - |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
590 |
from preal_exists_bound [OF A] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
591 |
obtain x where [simp]: "0<x" "x \<notin> A" by blast |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
592 |
show ?thesis |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
593 |
proof (intro exI conjI) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
594 |
show "0 < inverse (x+1)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
595 |
by (simp add: order_less_trans [OF _ less_add_one]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
596 |
show "inverse(x+1) < inverse x" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
597 |
by (simp add: less_imp_inverse_less less_add_one) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
598 |
show "inverse (inverse x) \<notin> A" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
599 |
by (simp add: order_less_imp_not_eq2) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
600 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
601 |
qed |
| 14335 | 602 |
|
603 |
text{*Part 1 of Dedekind sections definition*}
|
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
604 |
lemma inverse_set_not_empty: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
605 |
"A \<in> preal ==> {} \<subset> inverse_set A"
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
606 |
apply (insert mem_inv_set_ex [of A]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
607 |
apply (auto simp add: inverse_set_def) |
| 14335 | 608 |
done |
609 |
||
610 |
text{*Part 2 of Dedekind sections definition*}
|
|
611 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
612 |
lemma preal_not_mem_inverse_set_Ex: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
613 |
assumes A: "A \<in> preal" shows "\<exists>q. 0 < q & q \<notin> inverse_set A" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
614 |
proof - |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
615 |
from preal_nonempty [OF A] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
616 |
obtain x where x: "x \<in> A" and xpos [simp]: "0<x" .. |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
617 |
show ?thesis |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
618 |
proof (intro exI conjI) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
619 |
show "0 < inverse x" by simp |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
620 |
show "inverse x \<notin> inverse_set A" |
| 14377 | 621 |
proof - |
622 |
{ fix y::rat
|
|
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
623 |
assume ygt: "inverse x < y" |
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
624 |
have [simp]: "0 < y" by (simp add: order_less_trans [OF _ ygt]) |
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
625 |
have iyless: "inverse y < x" |
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
626 |
by (simp add: inverse_less_imp_less [of x] ygt) |
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
627 |
have "inverse y \<in> A" |
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
628 |
by (simp add: preal_downwards_closed [OF A x] iyless)} |
| 14377 | 629 |
thus ?thesis by (auto simp add: inverse_set_def) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
630 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
631 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
632 |
qed |
| 14335 | 633 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
634 |
lemma inverse_set_not_rat_set: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
635 |
assumes A: "A \<in> preal" shows "inverse_set A < {r. 0 < r}"
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
636 |
proof |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
637 |
show "inverse_set A \<subseteq> {r. 0 < r}" by (force simp add: inverse_set_def)
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
638 |
next |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
639 |
show "inverse_set A \<noteq> {r. 0 < r}"
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
640 |
by (insert preal_not_mem_inverse_set_Ex [OF A], blast) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
641 |
qed |
| 14335 | 642 |
|
643 |
text{*Part 3 of Dedekind sections definition*}
|
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
644 |
lemma inverse_set_lemma3: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
645 |
"[|A \<in> preal; u \<in> inverse_set A; 0 < z; z < u|] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
646 |
==> z \<in> inverse_set A" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
647 |
apply (auto simp add: inverse_set_def) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
648 |
apply (auto intro: order_less_trans) |
| 14335 | 649 |
done |
650 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
651 |
text{*Part 4 of Dedekind sections definition*}
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
652 |
lemma inverse_set_lemma4: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
653 |
"[|A \<in> preal; y \<in> inverse_set A|] ==> \<exists>u \<in> inverse_set A. y < u" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
654 |
apply (auto simp add: inverse_set_def) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
655 |
apply (drule dense [of y]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
656 |
apply (blast intro: order_less_trans) |
| 14335 | 657 |
done |
658 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
659 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
660 |
lemma mem_inverse_set: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
661 |
"A \<in> preal ==> inverse_set A \<in> preal" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
662 |
apply (simp (no_asm_simp) add: preal_def cut_def) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
663 |
apply (blast intro!: inverse_set_not_empty inverse_set_not_rat_set |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
664 |
inverse_set_lemma3 inverse_set_lemma4) |
| 14335 | 665 |
done |
666 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
667 |
|
| 14335 | 668 |
subsection{*Gleason's Lemma 9-3.4, page 122*}
|
669 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
670 |
lemma Gleason9_34_exists: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
671 |
assumes A: "A \<in> preal" |
| 19765 | 672 |
and "\<forall>x\<in>A. x + u \<in> A" |
673 |
and "0 \<le> z" |
|
674 |
shows "\<exists>b\<in>A. b + (of_int z) * u \<in> A" |
|
| 14369 | 675 |
proof (cases z rule: int_cases) |
676 |
case (nonneg n) |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
677 |
show ?thesis |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
678 |
proof (simp add: prems, induct n) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
679 |
case 0 |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
680 |
from preal_nonempty [OF A] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
681 |
show ?case by force |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
682 |
case (Suc k) |
| 15013 | 683 |
from this obtain b where "b \<in> A" "b + of_nat k * u \<in> A" .. |
|
14378
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14377
diff
changeset
|
684 |
hence "b + of_int (int k)*u + u \<in> A" by (simp add: prems) |
| 29667 | 685 |
thus ?case by (force simp add: algebra_simps prems) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
686 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
687 |
next |
| 14369 | 688 |
case (neg n) |
689 |
with prems show ?thesis by simp |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
690 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
691 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
692 |
lemma Gleason9_34_contra: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
693 |
assumes A: "A \<in> preal" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
694 |
shows "[|\<forall>x\<in>A. x + u \<in> A; 0 < u; 0 < y; y \<notin> A|] ==> False" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
695 |
proof (induct u, induct y) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
696 |
fix a::int and b::int |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
697 |
fix c::int and d::int |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
698 |
assume bpos [simp]: "0 < b" |
| 19765 | 699 |
and dpos [simp]: "0 < d" |
700 |
and closed: "\<forall>x\<in>A. x + (Fract c d) \<in> A" |
|
701 |
and upos: "0 < Fract c d" |
|
702 |
and ypos: "0 < Fract a b" |
|
703 |
and notin: "Fract a b \<notin> A" |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
704 |
have cpos [simp]: "0 < c" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
705 |
by (simp add: zero_less_Fract_iff [OF dpos, symmetric] upos) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
706 |
have apos [simp]: "0 < a" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
707 |
by (simp add: zero_less_Fract_iff [OF bpos, symmetric] ypos) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
708 |
let ?k = "a*d" |
|
14378
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14377
diff
changeset
|
709 |
have frle: "Fract a b \<le> Fract ?k 1 * (Fract c d)" |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
710 |
proof - |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
711 |
have "?thesis = ((a * d * b * d) \<le> c * b * (a * d * b * d))" |
| 35216 | 712 |
by (simp add: order_less_imp_not_eq2 mult_ac) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
713 |
moreover |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
714 |
have "(1 * (a * d * b * d)) \<le> c * b * (a * d * b * d)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
715 |
by (rule mult_mono, |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
716 |
simp_all add: int_one_le_iff_zero_less zero_less_mult_iff |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
717 |
order_less_imp_le) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
718 |
ultimately |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
719 |
show ?thesis by simp |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
720 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
721 |
have k: "0 \<le> ?k" by (simp add: order_less_imp_le zero_less_mult_iff) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
722 |
from Gleason9_34_exists [OF A closed k] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
723 |
obtain z where z: "z \<in> A" |
|
14378
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14377
diff
changeset
|
724 |
and mem: "z + of_int ?k * Fract c d \<in> A" .. |
|
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14377
diff
changeset
|
725 |
have less: "z + of_int ?k * Fract c d < Fract a b" |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
726 |
by (rule not_in_preal_ub [OF A notin mem ypos]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
727 |
have "0<z" by (rule preal_imp_pos [OF A z]) |
|
14378
69c4d5997669
generic of_nat and of_int functions, and generalization of iszero
paulson
parents:
14377
diff
changeset
|
728 |
with frle and less show False by (simp add: Fract_of_int_eq) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
729 |
qed |
| 14335 | 730 |
|
731 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
732 |
lemma Gleason9_34: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
733 |
assumes A: "A \<in> preal" |
| 19765 | 734 |
and upos: "0 < u" |
735 |
shows "\<exists>r \<in> A. r + u \<notin> A" |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
736 |
proof (rule ccontr, simp) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
737 |
assume closed: "\<forall>r\<in>A. r + u \<in> A" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
738 |
from preal_exists_bound [OF A] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
739 |
obtain y where y: "y \<notin> A" and ypos: "0 < y" by blast |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
740 |
show False |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
741 |
by (rule Gleason9_34_contra [OF A closed upos ypos y]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
742 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
743 |
|
| 14335 | 744 |
|
745 |
||
746 |
subsection{*Gleason's Lemma 9-3.6*}
|
|
747 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
748 |
lemma lemma_gleason9_36: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
749 |
assumes A: "A \<in> preal" |
| 19765 | 750 |
and x: "1 < x" |
751 |
shows "\<exists>r \<in> A. r*x \<notin> A" |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
752 |
proof - |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
753 |
from preal_nonempty [OF A] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
754 |
obtain y where y: "y \<in> A" and ypos: "0<y" .. |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
755 |
show ?thesis |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
756 |
proof (rule classical) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
757 |
assume "~(\<exists>r\<in>A. r * x \<notin> A)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
758 |
with y have ymem: "y * x \<in> A" by blast |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
759 |
from ypos mult_strict_left_mono [OF x] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
760 |
have yless: "y < y*x" by simp |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
761 |
let ?d = "y*x - y" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
762 |
from yless have dpos: "0 < ?d" and eq: "y + ?d = y*x" by auto |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
763 |
from Gleason9_34 [OF A dpos] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
764 |
obtain r where r: "r\<in>A" and notin: "r + ?d \<notin> A" .. |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
765 |
have rpos: "0<r" by (rule preal_imp_pos [OF A r]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
766 |
with dpos have rdpos: "0 < r + ?d" by arith |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
767 |
have "~ (r + ?d \<le> y + ?d)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
768 |
proof |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
769 |
assume le: "r + ?d \<le> y + ?d" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
770 |
from ymem have yd: "y + ?d \<in> A" by (simp add: eq) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
771 |
have "r + ?d \<in> A" by (rule preal_downwards_closed' [OF A yd rdpos le]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
772 |
with notin show False by simp |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
773 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
774 |
hence "y < r" by simp |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
775 |
with ypos have dless: "?d < (r * ?d)/y" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
776 |
by (simp add: pos_less_divide_eq mult_commute [of ?d] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
777 |
mult_strict_right_mono dpos) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
778 |
have "r + ?d < r*x" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
779 |
proof - |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
780 |
have "r + ?d < r + (r * ?d)/y" by (simp add: dless) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
781 |
also with ypos have "... = (r/y) * (y + ?d)" |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32115
diff
changeset
|
782 |
by (simp only: algebra_simps divide_inverse, simp) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
783 |
also have "... = r*x" using ypos |
| 35216 | 784 |
by simp |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
785 |
finally show "r + ?d < r*x" . |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
786 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
787 |
with r notin rdpos |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
788 |
show "\<exists>r\<in>A. r * x \<notin> A" by (blast dest: preal_downwards_closed [OF A]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
789 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
790 |
qed |
| 14335 | 791 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
792 |
subsection{*Existence of Inverse: Part 2*}
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
793 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
794 |
lemma mem_Rep_preal_inverse_iff: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
795 |
"(z \<in> Rep_preal(inverse R)) = |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
796 |
(0 < z \<and> (\<exists>y. z < y \<and> inverse y \<notin> Rep_preal R))" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
797 |
apply (simp add: preal_inverse_def mem_inverse_set Rep_preal) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
798 |
apply (simp add: inverse_set_def) |
| 14335 | 799 |
done |
800 |
||
|
36696
1b69f78be286
remove unused constant preal_of_rat; remove several unused lemmas about preals
huffman
parents:
35372
diff
changeset
|
801 |
lemma Rep_preal_one: |
|
1b69f78be286
remove unused constant preal_of_rat; remove several unused lemmas about preals
huffman
parents:
35372
diff
changeset
|
802 |
"Rep_preal 1 = {x. 0 < x \<and> x < 1}"
|
|
1b69f78be286
remove unused constant preal_of_rat; remove several unused lemmas about preals
huffman
parents:
35372
diff
changeset
|
803 |
by (simp add: preal_one_def rat_mem_preal) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
804 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
805 |
lemma subset_inverse_mult_lemma: |
| 19765 | 806 |
assumes xpos: "0 < x" and xless: "x < 1" |
807 |
shows "\<exists>r u y. 0 < r & r < y & inverse y \<notin> Rep_preal R & |
|
808 |
u \<in> Rep_preal R & x = r * u" |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
809 |
proof - |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
810 |
from xpos and xless have "1 < inverse x" by (simp add: one_less_inverse_iff) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
811 |
from lemma_gleason9_36 [OF Rep_preal this] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
812 |
obtain r where r: "r \<in> Rep_preal R" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
813 |
and notin: "r * (inverse x) \<notin> Rep_preal R" .. |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
814 |
have rpos: "0<r" by (rule preal_imp_pos [OF Rep_preal r]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
815 |
from preal_exists_greater [OF Rep_preal r] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
816 |
obtain u where u: "u \<in> Rep_preal R" and rless: "r < u" .. |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
817 |
have upos: "0<u" by (rule preal_imp_pos [OF Rep_preal u]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
818 |
show ?thesis |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
819 |
proof (intro exI conjI) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
820 |
show "0 < x/u" using xpos upos |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
821 |
by (simp add: zero_less_divide_iff) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
822 |
show "x/u < x/r" using xpos upos rpos |
|
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14387
diff
changeset
|
823 |
by (simp add: divide_inverse mult_less_cancel_left rless) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
824 |
show "inverse (x / r) \<notin> Rep_preal R" using notin |
|
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14387
diff
changeset
|
825 |
by (simp add: divide_inverse mult_commute) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
826 |
show "u \<in> Rep_preal R" by (rule u) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
827 |
show "x = x / u * u" using upos |
|
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14387
diff
changeset
|
828 |
by (simp add: divide_inverse mult_commute) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
829 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
830 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
831 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
832 |
lemma subset_inverse_mult: |
|
36696
1b69f78be286
remove unused constant preal_of_rat; remove several unused lemmas about preals
huffman
parents:
35372
diff
changeset
|
833 |
"Rep_preal 1 \<subseteq> Rep_preal(inverse R * R)" |
|
1b69f78be286
remove unused constant preal_of_rat; remove several unused lemmas about preals
huffman
parents:
35372
diff
changeset
|
834 |
apply (auto simp add: Bex_def Rep_preal_one mem_Rep_preal_inverse_iff |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
835 |
mem_Rep_preal_mult_iff) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
836 |
apply (blast dest: subset_inverse_mult_lemma) |
| 14335 | 837 |
done |
838 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
839 |
lemma inverse_mult_subset_lemma: |
| 19765 | 840 |
assumes rpos: "0 < r" |
841 |
and rless: "r < y" |
|
842 |
and notin: "inverse y \<notin> Rep_preal R" |
|
843 |
and q: "q \<in> Rep_preal R" |
|
844 |
shows "r*q < 1" |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
845 |
proof - |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
846 |
have "q < inverse y" using rpos rless |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
847 |
by (simp add: not_in_preal_ub [OF Rep_preal notin] q) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
848 |
hence "r * q < r/y" using rpos |
|
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14387
diff
changeset
|
849 |
by (simp add: divide_inverse mult_less_cancel_left) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
850 |
also have "... \<le> 1" using rpos rless |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
851 |
by (simp add: pos_divide_le_eq) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
852 |
finally show ?thesis . |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
853 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
854 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
855 |
lemma inverse_mult_subset: |
|
36696
1b69f78be286
remove unused constant preal_of_rat; remove several unused lemmas about preals
huffman
parents:
35372
diff
changeset
|
856 |
"Rep_preal(inverse R * R) \<subseteq> Rep_preal 1" |
|
1b69f78be286
remove unused constant preal_of_rat; remove several unused lemmas about preals
huffman
parents:
35372
diff
changeset
|
857 |
apply (auto simp add: Bex_def Rep_preal_one mem_Rep_preal_inverse_iff |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
858 |
mem_Rep_preal_mult_iff) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
859 |
apply (simp add: zero_less_mult_iff preal_imp_pos [OF Rep_preal]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
860 |
apply (blast intro: inverse_mult_subset_lemma) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
861 |
done |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
862 |
|
|
23287
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
863 |
lemma preal_mult_inverse: "inverse R * R = (1::preal)" |
| 15413 | 864 |
apply (rule Rep_preal_inject [THEN iffD1]) |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
865 |
apply (rule equalityI [OF inverse_mult_subset subset_inverse_mult]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
866 |
done |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
867 |
|
|
23287
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
868 |
lemma preal_mult_inverse_right: "R * inverse R = (1::preal)" |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
869 |
apply (rule preal_mult_commute [THEN subst]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
870 |
apply (rule preal_mult_inverse) |
| 14335 | 871 |
done |
872 |
||
873 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
874 |
text{*Theorems needing @{text Gleason9_34}*}
|
| 14335 | 875 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
876 |
lemma Rep_preal_self_subset: "Rep_preal (R) \<subseteq> Rep_preal(R + S)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
877 |
proof |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
878 |
fix r |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
879 |
assume r: "r \<in> Rep_preal R" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
880 |
have rpos: "0<r" by (rule preal_imp_pos [OF Rep_preal r]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
881 |
from mem_Rep_preal_Ex |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
882 |
obtain y where y: "y \<in> Rep_preal S" .. |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
883 |
have ypos: "0<y" by (rule preal_imp_pos [OF Rep_preal y]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
884 |
have ry: "r+y \<in> Rep_preal(R + S)" using r y |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
885 |
by (auto simp add: mem_Rep_preal_add_iff) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
886 |
show "r \<in> Rep_preal(R + S)" using r ypos rpos |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
887 |
by (simp add: preal_downwards_closed [OF Rep_preal ry]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
888 |
qed |
| 14335 | 889 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
890 |
lemma Rep_preal_sum_not_subset: "~ Rep_preal (R + S) \<subseteq> Rep_preal(R)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
891 |
proof - |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
892 |
from mem_Rep_preal_Ex |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
893 |
obtain y where y: "y \<in> Rep_preal S" .. |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
894 |
have ypos: "0<y" by (rule preal_imp_pos [OF Rep_preal y]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
895 |
from Gleason9_34 [OF Rep_preal ypos] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
896 |
obtain r where r: "r \<in> Rep_preal R" and notin: "r + y \<notin> Rep_preal R" .. |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
897 |
have "r + y \<in> Rep_preal (R + S)" using r y |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
898 |
by (auto simp add: mem_Rep_preal_add_iff) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
899 |
thus ?thesis using notin by blast |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
900 |
qed |
| 14335 | 901 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
902 |
lemma Rep_preal_sum_not_eq: "Rep_preal (R + S) \<noteq> Rep_preal(R)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
903 |
by (insert Rep_preal_sum_not_subset, blast) |
| 14335 | 904 |
|
905 |
text{*at last, Gleason prop. 9-3.5(iii) page 123*}
|
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
906 |
lemma preal_self_less_add_left: "(R::preal) < R + S" |
| 26806 | 907 |
apply (unfold preal_less_def less_le) |
| 14335 | 908 |
apply (simp add: Rep_preal_self_subset Rep_preal_sum_not_eq [THEN not_sym]) |
909 |
done |
|
910 |
||
911 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
912 |
subsection{*Subtraction for Positive Reals*}
|
| 14335 | 913 |
|
| 22710 | 914 |
text{*Gleason prop. 9-3.5(iv), page 123: proving @{prop "A < B ==> \<exists>D. A + D =
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
915 |
B"}. We define the claimed @{term D} and show that it is a positive real*}
|
| 14335 | 916 |
|
917 |
text{*Part 1 of Dedekind sections definition*}
|
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
918 |
lemma diff_set_not_empty: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
919 |
"R < S ==> {} \<subset> diff_set (Rep_preal S) (Rep_preal R)"
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
920 |
apply (auto simp add: preal_less_def diff_set_def elim!: equalityE) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
921 |
apply (frule_tac x1 = S in Rep_preal [THEN preal_exists_greater]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
922 |
apply (drule preal_imp_pos [OF Rep_preal], clarify) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
923 |
apply (cut_tac a=x and b=u in add_eq_exists, force) |
| 14335 | 924 |
done |
925 |
||
926 |
text{*Part 2 of Dedekind sections definition*}
|
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
927 |
lemma diff_set_nonempty: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
928 |
"\<exists>q. 0 < q & q \<notin> diff_set (Rep_preal S) (Rep_preal R)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
929 |
apply (cut_tac X = S in Rep_preal_exists_bound) |
| 14335 | 930 |
apply (erule exE) |
931 |
apply (rule_tac x = x in exI, auto) |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
932 |
apply (simp add: diff_set_def) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
933 |
apply (auto dest: Rep_preal [THEN preal_downwards_closed]) |
| 14335 | 934 |
done |
935 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
936 |
lemma diff_set_not_rat_set: |
| 19765 | 937 |
"diff_set (Rep_preal S) (Rep_preal R) < {r. 0 < r}" (is "?lhs < ?rhs")
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
938 |
proof |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
939 |
show "?lhs \<subseteq> ?rhs" by (auto simp add: diff_set_def) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
940 |
show "?lhs \<noteq> ?rhs" using diff_set_nonempty by blast |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
941 |
qed |
| 14335 | 942 |
|
943 |
text{*Part 3 of Dedekind sections definition*}
|
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
944 |
lemma diff_set_lemma3: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
945 |
"[|R < S; u \<in> diff_set (Rep_preal S) (Rep_preal R); 0 < z; z < u|] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
946 |
==> z \<in> diff_set (Rep_preal S) (Rep_preal R)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
947 |
apply (auto simp add: diff_set_def) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
948 |
apply (rule_tac x=x in exI) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
949 |
apply (drule Rep_preal [THEN preal_downwards_closed], auto) |
| 14335 | 950 |
done |
951 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
952 |
text{*Part 4 of Dedekind sections definition*}
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
953 |
lemma diff_set_lemma4: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
954 |
"[|R < S; y \<in> diff_set (Rep_preal S) (Rep_preal R)|] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
955 |
==> \<exists>u \<in> diff_set (Rep_preal S) (Rep_preal R). y < u" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
956 |
apply (auto simp add: diff_set_def) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
957 |
apply (drule Rep_preal [THEN preal_exists_greater], clarify) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
958 |
apply (cut_tac a="x+y" and b=u in add_eq_exists, clarify) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
959 |
apply (rule_tac x="y+xa" in exI) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
960 |
apply (auto simp add: add_ac) |
| 14335 | 961 |
done |
962 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
963 |
lemma mem_diff_set: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
964 |
"R < S ==> diff_set (Rep_preal S) (Rep_preal R) \<in> preal" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
965 |
apply (unfold preal_def cut_def) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
966 |
apply (blast intro!: diff_set_not_empty diff_set_not_rat_set |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
967 |
diff_set_lemma3 diff_set_lemma4) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
968 |
done |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
969 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
970 |
lemma mem_Rep_preal_diff_iff: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
971 |
"R < S ==> |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
972 |
(z \<in> Rep_preal(S-R)) = |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
973 |
(\<exists>x. 0 < x & 0 < z & x \<notin> Rep_preal R & x + z \<in> Rep_preal S)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
974 |
apply (simp add: preal_diff_def mem_diff_set Rep_preal) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
975 |
apply (force simp add: diff_set_def) |
| 14335 | 976 |
done |
977 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
978 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
979 |
text{*proving that @{term "R + D \<le> S"}*}
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
980 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
981 |
lemma less_add_left_lemma: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
982 |
assumes Rless: "R < S" |
| 19765 | 983 |
and a: "a \<in> Rep_preal R" |
984 |
and cb: "c + b \<in> Rep_preal S" |
|
985 |
and "c \<notin> Rep_preal R" |
|
986 |
and "0 < b" |
|
987 |
and "0 < c" |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
988 |
shows "a + b \<in> Rep_preal S" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
989 |
proof - |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
990 |
have "0<a" by (rule preal_imp_pos [OF Rep_preal a]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
991 |
moreover |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
992 |
have "a < c" using prems |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
993 |
by (blast intro: not_in_Rep_preal_ub ) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
994 |
ultimately show ?thesis using prems |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
995 |
by (simp add: preal_downwards_closed [OF Rep_preal cb]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
996 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
997 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
998 |
lemma less_add_left_le1: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
999 |
"R < (S::preal) ==> R + (S-R) \<le> S" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1000 |
apply (auto simp add: Bex_def preal_le_def mem_Rep_preal_add_iff |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1001 |
mem_Rep_preal_diff_iff) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1002 |
apply (blast intro: less_add_left_lemma) |
| 14335 | 1003 |
done |
1004 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1005 |
subsection{*proving that @{term "S \<le> R + D"} --- trickier*}
|
| 14335 | 1006 |
|
1007 |
lemma lemma_sum_mem_Rep_preal_ex: |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1008 |
"x \<in> Rep_preal S ==> \<exists>e. 0 < e & x + e \<in> Rep_preal S" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1009 |
apply (drule Rep_preal [THEN preal_exists_greater], clarify) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1010 |
apply (cut_tac a=x and b=u in add_eq_exists, auto) |
| 14335 | 1011 |
done |
1012 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1013 |
lemma less_add_left_lemma2: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1014 |
assumes Rless: "R < S" |
| 19765 | 1015 |
and x: "x \<in> Rep_preal S" |
1016 |
and xnot: "x \<notin> Rep_preal R" |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1017 |
shows "\<exists>u v z. 0 < v & 0 < z & u \<in> Rep_preal R & z \<notin> Rep_preal R & |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1018 |
z + v \<in> Rep_preal S & x = u + v" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1019 |
proof - |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1020 |
have xpos: "0<x" by (rule preal_imp_pos [OF Rep_preal x]) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1021 |
from lemma_sum_mem_Rep_preal_ex [OF x] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1022 |
obtain e where epos: "0 < e" and xe: "x + e \<in> Rep_preal S" by blast |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1023 |
from Gleason9_34 [OF Rep_preal epos] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1024 |
obtain r where r: "r \<in> Rep_preal R" and notin: "r + e \<notin> Rep_preal R" .. |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1025 |
with x xnot xpos have rless: "r < x" by (blast intro: not_in_Rep_preal_ub) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1026 |
from add_eq_exists [of r x] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1027 |
obtain y where eq: "x = r+y" by auto |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1028 |
show ?thesis |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1029 |
proof (intro exI conjI) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1030 |
show "r \<in> Rep_preal R" by (rule r) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1031 |
show "r + e \<notin> Rep_preal R" by (rule notin) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1032 |
show "r + e + y \<in> Rep_preal S" using xe eq by (simp add: add_ac) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1033 |
show "x = r + y" by (simp add: eq) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1034 |
show "0 < r + e" using epos preal_imp_pos [OF Rep_preal r] |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1035 |
by simp |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1036 |
show "0 < y" using rless eq by arith |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1037 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1038 |
qed |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1039 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1040 |
lemma less_add_left_le2: "R < (S::preal) ==> S \<le> R + (S-R)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1041 |
apply (auto simp add: preal_le_def) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1042 |
apply (case_tac "x \<in> Rep_preal R") |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1043 |
apply (cut_tac Rep_preal_self_subset [of R], force) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1044 |
apply (auto simp add: Bex_def mem_Rep_preal_add_iff mem_Rep_preal_diff_iff) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1045 |
apply (blast dest: less_add_left_lemma2) |
| 14335 | 1046 |
done |
1047 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1048 |
lemma less_add_left: "R < (S::preal) ==> R + (S-R) = S" |
| 27682 | 1049 |
by (blast intro: antisym [OF less_add_left_le1 less_add_left_le2]) |
| 14335 | 1050 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1051 |
lemma less_add_left_Ex: "R < (S::preal) ==> \<exists>D. R + D = S" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1052 |
by (fast dest: less_add_left) |
| 14335 | 1053 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1054 |
lemma preal_add_less2_mono1: "R < (S::preal) ==> R + T < S + T" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1055 |
apply (auto dest!: less_add_left_Ex simp add: preal_add_assoc) |
| 14335 | 1056 |
apply (rule_tac y1 = D in preal_add_commute [THEN subst]) |
1057 |
apply (auto intro: preal_self_less_add_left simp add: preal_add_assoc [symmetric]) |
|
1058 |
done |
|
1059 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1060 |
lemma preal_add_less2_mono2: "R < (S::preal) ==> T + R < T + S" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1061 |
by (auto intro: preal_add_less2_mono1 simp add: preal_add_commute [of T]) |
| 14335 | 1062 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1063 |
lemma preal_add_right_less_cancel: "R + T < S + T ==> R < (S::preal)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1064 |
apply (insert linorder_less_linear [of R S], auto) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1065 |
apply (drule_tac R = S and T = T in preal_add_less2_mono1) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1066 |
apply (blast dest: order_less_trans) |
| 14335 | 1067 |
done |
1068 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1069 |
lemma preal_add_left_less_cancel: "T + R < T + S ==> R < (S::preal)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1070 |
by (auto elim: preal_add_right_less_cancel simp add: preal_add_commute [of T]) |
| 14335 | 1071 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1072 |
lemma preal_add_less_cancel_left: "(T + (R::preal) < T + S) = (R < S)" |
| 14335 | 1073 |
by (blast intro: preal_add_less2_mono2 preal_add_left_less_cancel) |
1074 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1075 |
lemma preal_add_le_cancel_left: "(T + (R::preal) \<le> T + S) = (R \<le> S)" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1076 |
by (simp add: linorder_not_less [symmetric] preal_add_less_cancel_left) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1077 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1078 |
lemma preal_add_right_cancel: "(R::preal) + T = S + T ==> R = S" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1079 |
apply (insert linorder_less_linear [of R S], safe) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1080 |
apply (drule_tac [!] T = T in preal_add_less2_mono1, auto) |
| 14335 | 1081 |
done |
1082 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1083 |
lemma preal_add_left_cancel: "C + A = C + B ==> A = (B::preal)" |
| 14335 | 1084 |
by (auto intro: preal_add_right_cancel simp add: preal_add_commute) |
1085 |
||
|
35028
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents:
32960
diff
changeset
|
1086 |
instance preal :: linordered_cancel_ab_semigroup_add |
|
23285
c95a4f6b3881
instance preal :: ordered_cancel_ab_semigroup_add
huffman
parents:
22710
diff
changeset
|
1087 |
proof |
|
c95a4f6b3881
instance preal :: ordered_cancel_ab_semigroup_add
huffman
parents:
22710
diff
changeset
|
1088 |
fix a b c :: preal |
|
c95a4f6b3881
instance preal :: ordered_cancel_ab_semigroup_add
huffman
parents:
22710
diff
changeset
|
1089 |
show "a + b = a + c \<Longrightarrow> b = c" by (rule preal_add_left_cancel) |
|
23287
063039db59dd
define (1::preal); clean up instance declarations
huffman
parents:
23285
diff
changeset
|
1090 |
show "a \<le> b \<Longrightarrow> c + a \<le> c + b" by (simp only: preal_add_le_cancel_left) |
|
23285
c95a4f6b3881
instance preal :: ordered_cancel_ab_semigroup_add
huffman
parents:
22710
diff
changeset
|
1091 |
qed |
|
c95a4f6b3881
instance preal :: ordered_cancel_ab_semigroup_add
huffman
parents:
22710
diff
changeset
|
1092 |
|
| 14335 | 1093 |
|
1094 |
subsection{*Completeness of type @{typ preal}*}
|
|
1095 |
||
1096 |
text{*Prove that supremum is a cut*}
|
|
1097 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1098 |
text{*Part 1 of Dedekind sections definition*}
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1099 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1100 |
lemma preal_sup_set_not_empty: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1101 |
"P \<noteq> {} ==> {} \<subset> (\<Union>X \<in> P. Rep_preal(X))"
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1102 |
apply auto |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1103 |
apply (cut_tac X = x in mem_Rep_preal_Ex, auto) |
| 14335 | 1104 |
done |
1105 |
||
1106 |
||
1107 |
text{*Part 2 of Dedekind sections definition*}
|
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1108 |
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1109 |
lemma preal_sup_not_exists: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1110 |
"\<forall>X \<in> P. X \<le> Y ==> \<exists>q. 0 < q & q \<notin> (\<Union>X \<in> P. Rep_preal(X))" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1111 |
apply (cut_tac X = Y in Rep_preal_exists_bound) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1112 |
apply (auto simp add: preal_le_def) |
| 14335 | 1113 |
done |
1114 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1115 |
lemma preal_sup_set_not_rat_set: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1116 |
"\<forall>X \<in> P. X \<le> Y ==> (\<Union>X \<in> P. Rep_preal(X)) < {r. 0 < r}"
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1117 |
apply (drule preal_sup_not_exists) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1118 |
apply (blast intro: preal_imp_pos [OF Rep_preal]) |
| 14335 | 1119 |
done |
1120 |
||
1121 |
text{*Part 3 of Dedekind sections definition*}
|
|
1122 |
lemma preal_sup_set_lemma3: |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1123 |
"[|P \<noteq> {}; \<forall>X \<in> P. X \<le> Y; u \<in> (\<Union>X \<in> P. Rep_preal(X)); 0 < z; z < u|]
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1124 |
==> z \<in> (\<Union>X \<in> P. Rep_preal(X))" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1125 |
by (auto elim: Rep_preal [THEN preal_downwards_closed]) |
| 14335 | 1126 |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1127 |
text{*Part 4 of Dedekind sections definition*}
|
| 14335 | 1128 |
lemma preal_sup_set_lemma4: |
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1129 |
"[|P \<noteq> {}; \<forall>X \<in> P. X \<le> Y; y \<in> (\<Union>X \<in> P. Rep_preal(X)) |]
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1130 |
==> \<exists>u \<in> (\<Union>X \<in> P. Rep_preal(X)). y < u" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1131 |
by (blast dest: Rep_preal [THEN preal_exists_greater]) |
| 14335 | 1132 |
|
1133 |
lemma preal_sup: |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1134 |
"[|P \<noteq> {}; \<forall>X \<in> P. X \<le> Y|] ==> (\<Union>X \<in> P. Rep_preal(X)) \<in> preal"
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1135 |
apply (unfold preal_def cut_def) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1136 |
apply (blast intro!: preal_sup_set_not_empty preal_sup_set_not_rat_set |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1137 |
preal_sup_set_lemma3 preal_sup_set_lemma4) |
| 14335 | 1138 |
done |
1139 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1140 |
lemma preal_psup_le: |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1141 |
"[| \<forall>X \<in> P. X \<le> Y; x \<in> P |] ==> x \<le> psup P" |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1142 |
apply (simp (no_asm_simp) add: preal_le_def) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1143 |
apply (subgoal_tac "P \<noteq> {}")
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1144 |
apply (auto simp add: psup_def preal_sup) |
| 14335 | 1145 |
done |
1146 |
||
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1147 |
lemma psup_le_ub: "[| P \<noteq> {}; \<forall>X \<in> P. X \<le> Y |] ==> psup P \<le> Y"
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1148 |
apply (simp (no_asm_simp) add: preal_le_def) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1149 |
apply (simp add: psup_def preal_sup) |
| 14335 | 1150 |
apply (auto simp add: preal_le_def) |
1151 |
done |
|
1152 |
||
1153 |
text{*Supremum property*}
|
|
1154 |
lemma preal_complete: |
|
|
14365
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1155 |
"[| P \<noteq> {}; \<forall>X \<in> P. X \<le> Y |] ==> (\<exists>X \<in> P. Z < X) = (Z < psup P)"
|
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1156 |
apply (simp add: preal_less_def psup_def preal_sup) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1157 |
apply (auto simp add: preal_le_def) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1158 |
apply (rename_tac U) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1159 |
apply (cut_tac x = U and y = Z in linorder_less_linear) |
|
3d4df8c166ae
replacing HOL/Real/PRat, PNat by the rational number development
paulson
parents:
14335
diff
changeset
|
1160 |
apply (auto simp add: preal_less_def) |
| 14335 | 1161 |
done |
1162 |
||
| 5078 | 1163 |
end |