1148 simp: Sup_ereal_def Inf_ereal_def bot_ereal_def top_ereal_def) |
1148 simp: Sup_ereal_def Inf_ereal_def bot_ereal_def top_ereal_def) |
1149 |
1149 |
1150 end |
1150 end |
1151 |
1151 |
1152 instance ereal :: complete_linorder .. |
1152 instance ereal :: complete_linorder .. |
|
1153 |
|
1154 instance ereal :: linear_continuum |
|
1155 proof |
|
1156 show "\<exists>a b::ereal. a \<noteq> b" |
|
1157 using ereal_zero_one by blast |
|
1158 qed |
1153 |
1159 |
1154 lemma ereal_Sup_uminus_image_eq: "Sup (uminus ` S::ereal set) = - Inf S" |
1160 lemma ereal_Sup_uminus_image_eq: "Sup (uminus ` S::ereal set) = - Inf S" |
1155 by (auto intro!: Sup_eqI |
1161 by (auto intro!: Sup_eqI |
1156 simp: Ball_def[symmetric] ereal_uminus_le_reorder le_Inf_iff |
1162 simp: Ball_def[symmetric] ereal_uminus_le_reorder le_Inf_iff |
1157 intro!: complete_lattice_class.Inf_lower2) |
1163 intro!: complete_lattice_class.Inf_lower2) |
1570 |
1576 |
1571 subsection "Limits on @{typ ereal}" |
1577 subsection "Limits on @{typ ereal}" |
1572 |
1578 |
1573 subsubsection "Topological space" |
1579 subsubsection "Topological space" |
1574 |
1580 |
1575 instantiation ereal :: connected_linorder_topology |
1581 instantiation ereal :: linear_continuum_topology |
1576 begin |
1582 begin |
1577 |
1583 |
1578 definition "open_ereal" :: "ereal set \<Rightarrow> bool" where |
1584 definition "open_ereal" :: "ereal set \<Rightarrow> bool" where |
1579 open_ereal_generated: "open_ereal = generate_topology (range lessThan \<union> range greaterThan)" |
1585 open_ereal_generated: "open_ereal = generate_topology (range lessThan \<union> range greaterThan)" |
1580 |
1586 |
1693 obtains a b where "a < x" "x < b" "{a <..< b} \<subseteq> S" |
1699 obtains a b where "a < x" "x < b" "{a <..< b} \<subseteq> S" |
1694 proof- |
1700 proof- |
1695 guess e using ereal_open_cont_interval[OF assms] . |
1701 guess e using ereal_open_cont_interval[OF assms] . |
1696 with that[of "x-e" "x+e"] ereal_between[OF x, of e] |
1702 with that[of "x-e" "x+e"] ereal_between[OF x, of e] |
1697 show thesis by auto |
1703 show thesis by auto |
1698 qed |
|
1699 |
|
1700 instance ereal :: perfect_space |
|
1701 proof (default, rule) |
|
1702 fix a :: ereal assume a: "open {a}" |
|
1703 show False |
|
1704 proof (cases a) |
|
1705 case MInf |
|
1706 then obtain y where "{..<ereal y} \<le> {a}" using a open_MInfty2[of "{a}"] by auto |
|
1707 then have "ereal (y - 1) \<in> {a}" apply (subst subsetD[of "{..<ereal y}"]) by auto |
|
1708 then show False using `a = -\<infinity>` by auto |
|
1709 next |
|
1710 case PInf |
|
1711 then obtain y where "{ereal y<..} \<le> {a}" using a open_PInfty2[of "{a}"] by auto |
|
1712 then have "ereal (y + 1) \<in> {a}" apply (subst subsetD[of "{ereal y<..}"]) by auto |
|
1713 then show False using `a = \<infinity>` by auto |
|
1714 next |
|
1715 case (real r) |
|
1716 then have fin: "\<bar>a\<bar> \<noteq> \<infinity>" by simp |
|
1717 from ereal_open_cont_interval[OF a singletonI this] guess e . note e = this |
|
1718 then obtain b where b_def: "a<b \<and> b<a+e" |
|
1719 using fin ereal_between dense[of a "a+e"] by auto |
|
1720 then have "b: {a-e <..< a+e}" using fin ereal_between[of a e] e by auto |
|
1721 then show False using b_def e by auto |
|
1722 qed |
|
1723 qed |
1704 qed |
1724 |
1705 |
1725 subsubsection {* Convergent sequences *} |
1706 subsubsection {* Convergent sequences *} |
1726 |
1707 |
1727 lemma lim_ereal[simp]: |
1708 lemma lim_ereal[simp]: |