src/HOL/Real.thy
changeset 57512 cc97b347b301
parent 57447 87429bdecad5
child 57514 bdc2c6b40bf2
equal deleted inserted replaced
57511:de51a86fc903 57512:cc97b347b301
   410   unfolding realrel_def minus_diff_minus
   410   unfolding realrel_def minus_diff_minus
   411   by (simp only: cauchy_minus vanishes_minus simp_thms)
   411   by (simp only: cauchy_minus vanishes_minus simp_thms)
   412 
   412 
   413 lift_definition times_real :: "real \<Rightarrow> real \<Rightarrow> real" is "\<lambda>X Y n. X n * Y n"
   413 lift_definition times_real :: "real \<Rightarrow> real \<Rightarrow> real" is "\<lambda>X Y n. X n * Y n"
   414   unfolding realrel_def mult_diff_mult
   414   unfolding realrel_def mult_diff_mult
   415   by (subst (4) mult_commute, simp only: cauchy_mult vanishes_add
   415   by (subst (4) mult.commute, simp only: cauchy_mult vanishes_add
   416     vanishes_mult_bounded cauchy_imp_bounded simp_thms)
   416     vanishes_mult_bounded cauchy_imp_bounded simp_thms)
   417 
   417 
   418 lift_definition inverse_real :: "real \<Rightarrow> real"
   418 lift_definition inverse_real :: "real \<Rightarrow> real"
   419   is "\<lambda>X. if vanishes X then (\<lambda>n. 0) else (\<lambda>n. inverse (X n))"
   419   is "\<lambda>X. if vanishes X then (\<lambda>n. 0) else (\<lambda>n. inverse (X n))"
   420 proof -
   420 proof -
   810     apply (simp add: C_def avg_def algebra_simps)
   810     apply (simp add: C_def avg_def algebra_simps)
   811     done
   811     done
   812 
   812 
   813   have twos: "\<And>y r :: rat. 0 < r \<Longrightarrow> \<exists>n. y / 2 ^ n < r"
   813   have twos: "\<And>y r :: rat. 0 < r \<Longrightarrow> \<exists>n. y / 2 ^ n < r"
   814     apply (simp add: divide_less_eq)
   814     apply (simp add: divide_less_eq)
   815     apply (subst mult_commute)
   815     apply (subst mult.commute)
   816     apply (frule_tac y=y in ex_less_of_nat_mult)
   816     apply (frule_tac y=y in ex_less_of_nat_mult)
   817     apply clarify
   817     apply clarify
   818     apply (rule_tac x=n in exI)
   818     apply (rule_tac x=n in exI)
   819     apply (erule less_trans)
   819     apply (erule less_trans)
   820     apply (rule mult_strict_right_mono)
   820     apply (rule mult_strict_right_mono)