154 qed |
154 qed |
155 |
155 |
156 text{* An alternative useful formulation of completeness of the reals *} |
156 text{* An alternative useful formulation of completeness of the reals *} |
157 lemma real_sup_exists: assumes ex: "\<exists>x. P x" and bz: "\<exists>z. \<forall>x. P x \<longrightarrow> x < z" |
157 lemma real_sup_exists: assumes ex: "\<exists>x. P x" and bz: "\<exists>z. \<forall>x. P x \<longrightarrow> x < z" |
158 shows "\<exists>(s::real). \<forall>y. (\<exists>x. P x \<and> y < x) \<longleftrightarrow> y < s" |
158 shows "\<exists>(s::real). \<forall>y. (\<exists>x. P x \<and> y < x) \<longleftrightarrow> y < s" |
159 proof- |
159 proof |
160 from ex bz obtain x Y where x: "P x" and Y: "\<And>x. P x \<Longrightarrow> x < Y" by blast |
160 from bz have "bdd_above (Collect P)" |
161 from ex have thx:"\<exists>x. x \<in> Collect P" by blast |
161 by (force intro: less_imp_le) |
162 from bz have thY: "\<exists>Y. isUb UNIV (Collect P) Y" |
162 then show "\<forall>y. (\<exists>x. P x \<and> y < x) \<longleftrightarrow> y < Sup (Collect P)" |
163 by(auto simp add: isUb_def isLub_def setge_def setle_def leastP_def Ball_def order_le_less) |
163 using ex bz by (subst less_cSup_iff) auto |
164 from reals_complete[OF thx thY] obtain L where L: "isLub UNIV (Collect P) L" |
|
165 by blast |
|
166 from Y[OF x] have xY: "x < Y" . |
|
167 from L have L': "\<forall>x. P x \<longrightarrow> x \<le> L" by (auto simp add: isUb_def isLub_def setge_def setle_def leastP_def Ball_def) |
|
168 from Y have Y': "\<forall>x. P x \<longrightarrow> x \<le> Y" |
|
169 apply (clarsimp, atomize (full)) by auto |
|
170 from L Y' have "L \<le> Y" by (auto simp add: isUb_def isLub_def setge_def setle_def leastP_def Ball_def) |
|
171 {fix y |
|
172 {fix z assume z: "P z" "y < z" |
|
173 from L' z have "y < L" by auto } |
|
174 moreover |
|
175 {assume yL: "y < L" "\<forall>z. P z \<longrightarrow> \<not> y < z" |
|
176 hence nox: "\<forall>z. P z \<longrightarrow> y \<ge> z" by auto |
|
177 from nox L have "y \<ge> L" by (auto simp add: isUb_def isLub_def setge_def setle_def leastP_def Ball_def) |
|
178 with yL(1) have False by arith} |
|
179 ultimately have "(\<exists>x. P x \<and> y < x) \<longleftrightarrow> y < L" by blast} |
|
180 thus ?thesis by blast |
|
181 qed |
164 qed |
182 |
165 |
183 subsection {* Fundamental theorem of algebra *} |
166 subsection {* Fundamental theorem of algebra *} |
184 lemma unimodular_reduce_norm: |
167 lemma unimodular_reduce_norm: |
185 assumes md: "cmod z = 1" |
168 assumes md: "cmod z = 1" |