src/HOL/Nonstandard_Analysis/NSA.thy
changeset 69597 ff784d5a5bfb
parent 68527 2f4e2aab190a
child 70221 bca14283e1a8
equal deleted inserted replaced
69596:c8a2755bf220 69597:ff784d5a5bfb
  1371 
  1371 
  1372 lemma mem_monad_self [simp]: "x \<in> monad x"
  1372 lemma mem_monad_self [simp]: "x \<in> monad x"
  1373   by (simp add: monad_def)
  1373   by (simp add: monad_def)
  1374 
  1374 
  1375 
  1375 
  1376 subsection \<open>Proof that @{term "x \<approx> y"} implies @{term"\<bar>x\<bar> \<approx> \<bar>y\<bar>"}\<close>
  1376 subsection \<open>Proof that \<^term>\<open>x \<approx> y\<close> implies \<^term>\<open>\<bar>x\<bar> \<approx> \<bar>y\<bar>\<close>\<close>
  1377 
  1377 
  1378 lemma approx_subset_monad: "x \<approx> y \<Longrightarrow> {x, y} \<le> monad x"
  1378 lemma approx_subset_monad: "x \<approx> y \<Longrightarrow> {x, y} \<le> monad x"
  1379   by (simp (no_asm)) (simp add: approx_monad_iff)
  1379   by (simp (no_asm)) (simp add: approx_monad_iff)
  1380 
  1380 
  1381 lemma approx_subset_monad2: "x \<approx> y \<Longrightarrow> {x, y} \<le> monad y"
  1381 lemma approx_subset_monad2: "x \<approx> y \<Longrightarrow> {x, y} \<le> monad y"
  1466   apply (drule_tac x = y in approx_hrabs_add_minus_Infinitesimal)
  1466   apply (drule_tac x = y in approx_hrabs_add_minus_Infinitesimal)
  1467   apply (auto intro: approx_trans2)
  1467   apply (auto intro: approx_trans2)
  1468   done
  1468   done
  1469 
  1469 
  1470 
  1470 
  1471 subsection \<open>More @{term HFinite} and @{term Infinitesimal} Theorems\<close>
  1471 subsection \<open>More \<^term>\<open>HFinite\<close> and \<^term>\<open>Infinitesimal\<close> Theorems\<close>
  1472 
  1472 
  1473 text \<open>
  1473 text \<open>
  1474   Interesting slightly counterintuitive theorem: necessary
  1474   Interesting slightly counterintuitive theorem: necessary
  1475   for proving that an open interval is an NS open set.
  1475   for proving that an open interval is an NS open set.
  1476 \<close>
  1476 \<close>
  1752   done
  1752   done
  1753 
  1753 
  1754 
  1754 
  1755 subsection \<open>Alternative Definitions using Free Ultrafilter\<close>
  1755 subsection \<open>Alternative Definitions using Free Ultrafilter\<close>
  1756 
  1756 
  1757 subsubsection \<open>@{term HFinite}\<close>
  1757 subsubsection \<open>\<^term>\<open>HFinite\<close>\<close>
  1758 
  1758 
  1759 lemma HFinite_FreeUltrafilterNat:
  1759 lemma HFinite_FreeUltrafilterNat:
  1760   "star_n X \<in> HFinite \<Longrightarrow> \<exists>u. eventually (\<lambda>n. norm (X n) < u) \<U>"
  1760   "star_n X \<in> HFinite \<Longrightarrow> \<exists>u. eventually (\<lambda>n. norm (X n) < u) \<U>"
  1761   apply (auto simp add: HFinite_def SReal_def)
  1761   apply (auto simp add: HFinite_def SReal_def)
  1762   apply (rule_tac x=r in exI)
  1762   apply (rule_tac x=r in exI)
  1776 lemma HFinite_FreeUltrafilterNat_iff:
  1776 lemma HFinite_FreeUltrafilterNat_iff:
  1777   "star_n X \<in> HFinite \<longleftrightarrow> (\<exists>u. eventually (\<lambda>n. norm (X n) < u) \<U>)"
  1777   "star_n X \<in> HFinite \<longleftrightarrow> (\<exists>u. eventually (\<lambda>n. norm (X n) < u) \<U>)"
  1778   by (blast intro!: HFinite_FreeUltrafilterNat FreeUltrafilterNat_HFinite)
  1778   by (blast intro!: HFinite_FreeUltrafilterNat FreeUltrafilterNat_HFinite)
  1779 
  1779 
  1780 
  1780 
  1781 subsubsection \<open>@{term HInfinite}\<close>
  1781 subsubsection \<open>\<^term>\<open>HInfinite\<close>\<close>
  1782 
  1782 
  1783 lemma lemma_Compl_eq: "- {n. u < norm (f n)} = {n. norm (f n) \<le> u}"
  1783 lemma lemma_Compl_eq: "- {n. u < norm (f n)} = {n. norm (f n) \<le> u}"
  1784   by auto
  1784   by auto
  1785 
  1785 
  1786 lemma lemma_Compl_eq2: "- {n. norm (f n) < u} = {n. u \<le> norm (f n)}"
  1786 lemma lemma_Compl_eq2: "- {n. norm (f n) < u} = {n. u \<le> norm (f n)}"
  1833 lemma HInfinite_FreeUltrafilterNat_iff:
  1833 lemma HInfinite_FreeUltrafilterNat_iff:
  1834   "star_n X \<in> HInfinite \<longleftrightarrow> (\<forall>u. eventually (\<lambda>n. u < norm (X n)) \<U>)"
  1834   "star_n X \<in> HInfinite \<longleftrightarrow> (\<forall>u. eventually (\<lambda>n. u < norm (X n)) \<U>)"
  1835   by (blast intro!: HInfinite_FreeUltrafilterNat FreeUltrafilterNat_HInfinite)
  1835   by (blast intro!: HInfinite_FreeUltrafilterNat FreeUltrafilterNat_HInfinite)
  1836 
  1836 
  1837 
  1837 
  1838 subsubsection \<open>@{term Infinitesimal}\<close>
  1838 subsubsection \<open>\<^term>\<open>Infinitesimal\<close>\<close>
  1839 
  1839 
  1840 lemma ball_SReal_eq: "(\<forall>x::hypreal \<in> Reals. P x) \<longleftrightarrow> (\<forall>x::real. P (star_of x))"
  1840 lemma ball_SReal_eq: "(\<forall>x::hypreal \<in> Reals. P x) \<longleftrightarrow> (\<forall>x::real. P (star_of x))"
  1841   by (auto simp: SReal_def)
  1841   by (auto simp: SReal_def)
  1842 
  1842 
  1843 lemma Infinitesimal_FreeUltrafilterNat:
  1843 lemma Infinitesimal_FreeUltrafilterNat:
  1928   \<open>\<U>\<close> by property of (free) ultrafilters.\<close>
  1928   \<open>\<U>\<close> by property of (free) ultrafilters.\<close>
  1929 
  1929 
  1930 lemma Compl_real_le_eq: "- {n::nat. real n \<le> u} = {n. u < real n}"
  1930 lemma Compl_real_le_eq: "- {n::nat. real n \<le> u} = {n. u < real n}"
  1931   by (auto dest!: order_le_less_trans simp add: linorder_not_le)
  1931   by (auto dest!: order_le_less_trans simp add: linorder_not_le)
  1932 
  1932 
  1933 text \<open>@{term \<omega>} is a member of @{term HInfinite}.\<close>
  1933 text \<open>\<^term>\<open>\<omega>\<close> is a member of \<^term>\<open>HInfinite\<close>.\<close>
  1934 theorem HInfinite_omega [simp]: "\<omega> \<in> HInfinite"
  1934 theorem HInfinite_omega [simp]: "\<omega> \<in> HInfinite"
  1935   apply (simp add: omega_def)
  1935   apply (simp add: omega_def)
  1936   apply (rule FreeUltrafilterNat_HInfinite)
  1936   apply (rule FreeUltrafilterNat_HInfinite)
  1937   apply clarify
  1937   apply clarify
  1938   apply (rule_tac u1 = "u-1" in eventually_mono [OF FreeUltrafilterNat_nat_gt_real])
  1938   apply (rule_tac u1 = "u-1" in eventually_mono [OF FreeUltrafilterNat_nat_gt_real])