src/HOL/Library/Landau_Symbols.thy
changeset 70817 dd675800469d
parent 70688 3d894e1cfc75
child 74324 308e74afab83
equal deleted inserted replaced
70816:5bc338cee4a0 70817:dd675800469d
  1831 proof -
  1831 proof -
  1832   from assms have "filterlim (\<lambda>x. if f x = 0 \<and> g x = 0 then 1 else f x / g x) (nhds 1) F"
  1832   from assms have "filterlim (\<lambda>x. if f x = 0 \<and> g x = 0 then 1 else f x / g x) (nhds 1) F"
  1833     by (rule asymp_equivD)
  1833     by (rule asymp_equivD)
  1834   from order_tendstoD(1)[OF this zero_less_one]
  1834   from order_tendstoD(1)[OF this zero_less_one]
  1835     show ?th1 ?th2 ?th3
  1835     show ?th1 ?th2 ?th3
  1836     by (eventually_elim; force simp: sgn_if divide_simps split: if_splits)+
  1836     by (eventually_elim; force simp: sgn_if field_split_simps split: if_splits)+
  1837 qed
  1837 qed
  1838 
  1838 
  1839 lemma asymp_equiv_tendsto_transfer:
  1839 lemma asymp_equiv_tendsto_transfer:
  1840   assumes "f \<sim>[F] g" and "(f \<longlongrightarrow> c) F"
  1840   assumes "f \<sim>[F] g" and "(f \<longlongrightarrow> c) F"
  1841   shows   "(g \<longlongrightarrow> c) F"
  1841   shows   "(g \<longlongrightarrow> c) F"
  1898   let ?T = "\<lambda>f g x. if f x = 0 \<and> g x = 0 then 1 else f x / g x"
  1898   let ?T = "\<lambda>f g x. if f x = 0 \<and> g x = 0 then 1 else f x / g x"
  1899   from landau_o.smallD[OF assms(2) zero_less_one]
  1899   from landau_o.smallD[OF assms(2) zero_less_one]
  1900     have ev: "eventually (\<lambda>x. g x = 0 \<longrightarrow> h x = 0) F" by eventually_elim auto
  1900     have ev: "eventually (\<lambda>x. g x = 0 \<longrightarrow> h x = 0) F" by eventually_elim auto
  1901   have "(\<lambda>x. f x + h x) \<sim>[F] g \<longleftrightarrow> ((\<lambda>x. ?T f g x + h x / g x) \<longlongrightarrow> 1) F"
  1901   have "(\<lambda>x. f x + h x) \<sim>[F] g \<longleftrightarrow> ((\<lambda>x. ?T f g x + h x / g x) \<longlongrightarrow> 1) F"
  1902     unfolding asymp_equiv_def using ev
  1902     unfolding asymp_equiv_def using ev
  1903     by (intro tendsto_cong) (auto elim!: eventually_mono simp: divide_simps)
  1903     by (intro tendsto_cong) (auto elim!: eventually_mono simp: field_split_simps)
  1904   also have "\<dots> \<longleftrightarrow> ((\<lambda>x. ?T f g x + h x / g x) \<longlongrightarrow> 1 + 0) F" by simp
  1904   also have "\<dots> \<longleftrightarrow> ((\<lambda>x. ?T f g x + h x / g x) \<longlongrightarrow> 1 + 0) F" by simp
  1905   also have \<dots> by (intro tendsto_intros asymp_equivD assms smalloD_tendsto)
  1905   also have \<dots> by (intro tendsto_intros asymp_equivD assms smalloD_tendsto)
  1906   finally show "(\<lambda>x. f x + h x) \<sim>[F] g" .
  1906   finally show "(\<lambda>x. f x + h x) \<sim>[F] g" .
  1907 qed
  1907 qed
  1908 
  1908 
  2152     by (intro tendsto_diff asymp_equivD tendsto_const)
  2152     by (intro tendsto_diff asymp_equivD tendsto_const)
  2153   from tendstoD[OF this c] show "eventually (\<lambda>x. norm (f x - g x) \<le> c * norm (g x)) F"
  2153   from tendstoD[OF this c] show "eventually (\<lambda>x. norm (f x - g x) \<le> c * norm (g x)) F"
  2154   proof eventually_elim
  2154   proof eventually_elim
  2155     case (elim x)
  2155     case (elim x)
  2156     from elim have "norm (f x - g x) \<le> norm (f x / g x - 1) * norm (g x)"
  2156     from elim have "norm (f x - g x) \<le> norm (f x / g x - 1) * norm (g x)"
  2157       by (subst norm_mult [symmetric]) (auto split: if_splits simp: divide_simps)
  2157       by (subst norm_mult [symmetric]) (auto split: if_splits simp add: algebra_simps)
  2158     also have "norm (f x / g x - 1) * norm (g x) \<le> c * norm (g x)" using elim
  2158     also have "norm (f x / g x - 1) * norm (g x) \<le> c * norm (g x)" using elim
  2159       by (auto split: if_splits simp: mult_right_mono)
  2159       by (auto split: if_splits simp: mult_right_mono)
  2160     finally show ?case .
  2160     finally show ?case .
  2161   qed
  2161   qed
  2162 qed
  2162 qed