
paulson@12196: (*  Title       : NthRoot.thy
paulson@12196:     Author      : Jacques D. Fleuriot
paulson@12196:     Copyright   : 1998  University of Cambridge
paulson@14477:     Conversion to Isar and new proofs by Lawrence C Paulson, 2004
paulson@12196: *)
paulson@12196: 
paulson@14324: header{*Existence of Nth Root*}
paulson@14324: 
nipkow@15131: theory NthRoot
huffman@20515: imports SEQ
nipkow@15131: begin
paulson@14324: 
huffman@20687: definition
wenzelm@21404:   root :: "[nat, real] \<Rightarrow> real" where
huffman@20687:   "root n x = (THE u. (0 < x \<longrightarrow> 0 < u) \<and> (u ^ n = x))"
huffman@20687: 
wenzelm@21404: definition
wenzelm@21404:   sqrt :: "real \<Rightarrow> real" where
huffman@20687:   "sqrt x = root 2 x"
huffman@20687: 
huffman@20687: 
wenzelm@14767: text {*
wenzelm@14767:   Various lemmas needed for this result. We follow the proof given by
wenzelm@14767:   John Lindsay Orr (\texttt{jorr@math.unl.edu}) in his Analysis
wenzelm@14767:   Webnotes available at \url{http://www.math.unl.edu/~webnotes}.
wenzelm@14767: 
wenzelm@14767:   Lemmas about sequences of reals are used to reach the result.
wenzelm@14767: *}
paulson@14324: 
paulson@14324: lemma lemma_nth_realpow_non_empty:
paulson@14324:      "[| (0::real) < a; 0 < n |] ==> \<exists>s. s : {x. x ^ n <= a & 0 < x}"
paulson@14324: apply (case_tac "1 <= a")
paulson@14477: apply (rule_tac x = 1 in exI)
paulson@14334: apply (drule_tac [2] linorder_not_le [THEN iffD1])
paulson@14477: apply (drule_tac [2] less_not_refl2 [THEN not0_implies_Suc], simp) 
paulson@14348: apply (force intro!: realpow_Suc_le_self simp del: realpow_Suc)
paulson@14324: done
paulson@14324: 
paulson@14348: text{*Used only just below*}
paulson@14348: lemma realpow_ge_self2: "[| (1::real) \<le> r; 0 < n |] ==> r \<le> r ^ n"
paulson@14348: by (insert power_increasing [of 1 n r], simp)
paulson@14348: 
paulson@14324: lemma lemma_nth_realpow_isUb_ex:
paulson@14324:      "[| (0::real) < a; 0 < n |]  
paulson@14324:       ==> \<exists>u. isUb (UNIV::real set) {x. x ^ n <= a & 0 < x} u"
paulson@14324: apply (case_tac "1 <= a")
paulson@14477: apply (rule_tac x = a in exI)
paulson@14334: apply (drule_tac [2] linorder_not_le [THEN iffD1])
paulson@14477: apply (rule_tac [2] x = 1 in exI)
paulson@14477: apply (rule_tac [!] setleI [THEN isUbI], safe)
paulson@14324: apply (simp_all (no_asm))
paulson@14324: apply (rule_tac [!] ccontr)
paulson@14334: apply (drule_tac [!] linorder_not_le [THEN iffD1])
paulson@14477: apply (drule realpow_ge_self2, assumption)
paulson@14477: apply (drule_tac n = n in realpow_less)
paulson@14324: apply (assumption+)
paulson@14477: apply (drule real_le_trans, assumption)
paulson@14477: apply (drule_tac y = "y ^ n" in order_less_le_trans, assumption, simp) 
paulson@14477: apply (drule_tac n = n in zero_less_one [THEN realpow_less], auto)
paulson@14324: done
paulson@14324: 
paulson@14324: lemma nth_realpow_isLub_ex:
paulson@14324:      "[| (0::real) < a; 0 < n |]  
paulson@14324:       ==> \<exists>u. isLub (UNIV::real set) {x. x ^ n <= a & 0 < x} u"
paulson@14365: by (blast intro: lemma_nth_realpow_isUb_ex lemma_nth_realpow_non_empty reals_complete)
paulson@14365: 
paulson@14324:  
paulson@14324: subsection{*First Half -- Lemmas First*}
paulson@14324: 
paulson@14324: lemma lemma_nth_realpow_seq:
paulson@14324:      "isLub (UNIV::real set) {x. x ^ n <= a & (0::real) < x} u  
paulson@14324:            ==> u + inverse(real (Suc k)) ~: {x. x ^ n <= a & 0 < x}"
paulson@14477: apply (safe, drule isLubD2, blast)
paulson@14365: apply (simp add: linorder_not_less [symmetric])
paulson@14324: done
paulson@14324: 
paulson@14324: lemma lemma_nth_realpow_isLub_gt_zero:
paulson@14324:      "[| isLub (UNIV::real set) {x. x ^ n <= a & (0::real) < x} u;  
paulson@14324:          0 < a; 0 < n |] ==> 0 < u"
paulson@14477: apply (drule lemma_nth_realpow_non_empty, auto)
paulson@14477: apply (drule_tac y = s in isLub_isUb [THEN isUbD])
paulson@14324: apply (auto intro: order_less_le_trans)
paulson@14324: done
paulson@14324: 
paulson@14324: lemma lemma_nth_realpow_isLub_ge:
paulson@14324:      "[| isLub (UNIV::real set) {x. x ^ n <= a & (0::real) < x} u;  
paulson@14324:          0 < a; 0 < n |] ==> ALL k. a <= (u + inverse(real (Suc k))) ^ n"
paulson@14477: apply safe
paulson@14477: apply (frule lemma_nth_realpow_seq, safe)
paulson@15085: apply (auto elim: order_less_asym simp add: linorder_not_less [symmetric]
paulson@15085:             iff: real_0_less_add_iff) --{*legacy iff rule!*}
paulson@14365: apply (simp add: linorder_not_less)
paulson@14324: apply (rule order_less_trans [of _ 0])
paulson@14325: apply (auto intro: lemma_nth_realpow_isLub_gt_zero)
paulson@14324: done
paulson@14324: 
paulson@14324: text{*First result we want*}
paulson@14324: lemma realpow_nth_ge:
paulson@14324:      "[| (0::real) < a; 0 < n;  
paulson@14324:      isLub (UNIV::real set)  
paulson@14324:      {x. x ^ n <= a & 0 < x} u |] ==> a <= u ^ n"
paulson@14477: apply (frule lemma_nth_realpow_isLub_ge, safe)
paulson@14324: apply (rule LIMSEQ_inverse_real_of_nat_add [THEN LIMSEQ_pow, THEN LIMSEQ_le_const])
paulson@14334: apply (auto simp add: real_of_nat_def)
paulson@14324: done
paulson@14324: 
paulson@14324: subsection{*Second Half*}
paulson@14324: 
paulson@14324: lemma less_isLub_not_isUb:
paulson@14324:      "[| isLub (UNIV::real set) S u; x < u |]  
paulson@14324:            ==> ~ isUb (UNIV::real set) S x"
paulson@14477: apply safe
paulson@14477: apply (drule isLub_le_isUb, assumption)
paulson@14477: apply (drule order_less_le_trans, auto)
paulson@14324: done
paulson@14324: 
paulson@14324: lemma not_isUb_less_ex:
paulson@14324:      "~ isUb (UNIV::real set) S u ==> \<exists>x \<in> S. u < x"
wenzelm@18585: apply (rule ccontr, erule contrapos_np)
paulson@14324: apply (rule setleI [THEN isUbI])
paulson@14365: apply (auto simp add: linorder_not_less [symmetric])
paulson@14324: done
paulson@14324: 
paulson@14325: lemma real_mult_less_self: "0 < r ==> r * (1 + -inverse(real (Suc n))) < r"
paulson@14334: apply (simp (no_asm) add: right_distrib)
paulson@14334: apply (rule add_less_cancel_left [of "-r", THEN iffD1])
avigad@16775: apply (auto intro: mult_pos_pos
paulson@14334:             simp add: add_assoc [symmetric] neg_less_0_iff_less)
paulson@14325: done
paulson@14325: 
paulson@14325: lemma real_mult_add_one_minus_ge_zero:
paulson@14325:      "0 < r ==>  0 <= r*(1 + -inverse(real (Suc n)))"
paulson@15085: by (simp add: zero_le_mult_iff real_of_nat_inverse_le_iff real_0_le_add_iff)
paulson@14325: 
paulson@14324: lemma lemma_nth_realpow_isLub_le:
paulson@14324:      "[| isLub (UNIV::real set) {x. x ^ n <= a & (0::real) < x} u;  
paulson@14325:        0 < a; 0 < n |] ==> ALL k. (u*(1 + -inverse(real (Suc k)))) ^ n <= a"
paulson@14477: apply safe
paulson@14324: apply (frule less_isLub_not_isUb [THEN not_isUb_less_ex])
paulson@14477: apply (rule_tac n = k in real_mult_less_self)
paulson@14477: apply (blast intro: lemma_nth_realpow_isLub_gt_zero, safe)
paulson@14477: apply (drule_tac n = k in
paulson@14477:         lemma_nth_realpow_isLub_gt_zero [THEN real_mult_add_one_minus_ge_zero], assumption+)
paulson@14348: apply (blast intro: order_trans order_less_imp_le power_mono) 
paulson@14324: done
paulson@14324: 
paulson@14324: text{*Second result we want*}
paulson@14324: lemma realpow_nth_le:
paulson@14324:      "[| (0::real) < a; 0 < n;  
paulson@14324:      isLub (UNIV::real set)  
paulson@14324:      {x. x ^ n <= a & 0 < x} u |] ==> u ^ n <= a"
paulson@14477: apply (frule lemma_nth_realpow_isLub_le, safe)
paulson@14348: apply (rule LIMSEQ_inverse_real_of_nat_add_minus_mult
paulson@14348:                 [THEN LIMSEQ_pow, THEN LIMSEQ_le_const2])
paulson@14334: apply (auto simp add: real_of_nat_def)
paulson@14324: done
paulson@14324: 
paulson@14348: text{*The theorem at last!*}
paulson@14324: lemma realpow_nth: "[| (0::real) < a; 0 < n |] ==> \<exists>r. r ^ n = a"
paulson@14477: apply (frule nth_realpow_isLub_ex, auto)
paulson@14477: apply (auto intro: realpow_nth_le realpow_nth_ge order_antisym)
paulson@14324: done
paulson@14324: 
paulson@14324: (* positive only *)
paulson@14324: lemma realpow_pos_nth: "[| (0::real) < a; 0 < n |] ==> \<exists>r. 0 < r & r ^ n = a"
paulson@14477: apply (frule nth_realpow_isLub_ex, auto)
paulson@14477: apply (auto intro: realpow_nth_le realpow_nth_ge order_antisym lemma_nth_realpow_isLub_gt_zero)
paulson@14324: done
paulson@14324: 
paulson@14324: lemma realpow_pos_nth2: "(0::real) < a  ==> \<exists>r. 0 < r & r ^ Suc n = a"
paulson@14477: by (blast intro: realpow_pos_nth)
paulson@14324: 
paulson@14324: (* uniqueness of nth positive root *)
paulson@14324: lemma realpow_pos_nth_unique:
paulson@14324:      "[| (0::real) < a; 0 < n |] ==> EX! r. 0 < r & r ^ n = a"
paulson@14324: apply (auto intro!: realpow_pos_nth)
paulson@14477: apply (cut_tac x = r and y = y in linorder_less_linear, auto)
paulson@14477: apply (drule_tac x = r in realpow_less)
paulson@14477: apply (drule_tac [4] x = y in realpow_less, auto)
paulson@14324: done
paulson@14324: 
huffman@20687: subsection {* Nth Root *}
huffman@20687: 
huffman@20687: lemma real_root_zero [simp]: "root (Suc n) 0 = 0"
huffman@20687: apply (simp add: root_def)
huffman@20687: apply (safe intro!: the_equality power_0_Suc elim!: realpow_zero_zero)
huffman@20687: done
huffman@20687: 
huffman@20687: lemma real_root_pow_pos: 
huffman@20687:      "0 < x ==> (root (Suc n) x) ^ (Suc n) = x"
huffman@20687: apply (simp add: root_def del: realpow_Suc)
huffman@20687: apply (drule_tac n="Suc n" in realpow_pos_nth_unique, simp)
huffman@20687: apply (erule theI' [THEN conjunct2])
huffman@20687: done
huffman@20687: 
huffman@20687: lemma real_root_pow_pos2: "0 \<le> x ==> (root (Suc n) x) ^ (Suc n) = x"
huffman@20687: by (auto dest!: real_le_imp_less_or_eq dest: real_root_pow_pos)
huffman@20687: 
huffman@20687: lemma real_root_pos: 
huffman@20687:      "0 < x ==> root(Suc n) (x ^ (Suc n)) = x"
huffman@20687: apply (simp add: root_def)
huffman@20687: apply (rule the_equality)
huffman@20687: apply (frule_tac [2] n = n in zero_less_power)
huffman@20687: apply (auto simp add: zero_less_mult_iff)
huffman@20687: apply (rule_tac x = u and y = x in linorder_cases)
huffman@20687: apply (drule_tac n1 = n and x = u in zero_less_Suc [THEN [3] realpow_less])
huffman@20687: apply (drule_tac [4] n1 = n and x = x in zero_less_Suc [THEN [3] realpow_less])
huffman@20687: apply (auto)
huffman@20687: done
huffman@20687: 
huffman@20687: lemma real_root_pos2: "0 \<le> x ==> root(Suc n) (x ^ (Suc n)) = x"
huffman@20687: by (auto dest!: real_le_imp_less_or_eq real_root_pos)
huffman@20687: 
huffman@20687: lemma real_root_gt_zero:
huffman@20687:      "0 < x ==> 0 < root (Suc n) x"
huffman@20687: apply (simp add: root_def del: realpow_Suc)
huffman@20687: apply (drule_tac n="Suc n" in realpow_pos_nth_unique, simp)
huffman@20687: apply (erule theI' [THEN conjunct1])
huffman@20687: done
huffman@20687: 
huffman@20687: lemma real_root_pos_pos: 
huffman@20687:      "0 < x ==> 0 \<le> root(Suc n) x"
huffman@20687: by (rule real_root_gt_zero [THEN order_less_imp_le])
huffman@20687: 
huffman@20687: lemma real_root_pos_pos_le: "0 \<le> x ==> 0 \<le> root(Suc n) x"
huffman@20687: by (auto simp add: order_le_less real_root_gt_zero)
huffman@20687: 
huffman@20687: lemma real_root_one [simp]: "root (Suc n) 1 = 1"
huffman@20687: apply (simp add: root_def)
huffman@20687: apply (rule the_equality, auto)
huffman@20687: apply (rule ccontr)
huffman@20687: apply (rule_tac x = u and y = 1 in linorder_cases)
huffman@20687: apply (drule_tac n = n in realpow_Suc_less_one)
huffman@20687: apply (drule_tac [4] n = n in power_gt1_lemma)
huffman@20687: apply (auto)
huffman@20687: done
huffman@20687: 
huffman@20687: 
huffman@20687: subsection{*Square Root*}
huffman@20687: 
huffman@20687: text{*needed because 2 is a binary numeral!*}
huffman@20687: lemma root_2_eq [simp]: "root 2 = root (Suc (Suc 0))"
huffman@20687: by (simp del: nat_numeral_0_eq_0 nat_numeral_1_eq_1 
huffman@20687:          add: nat_numeral_0_eq_0 [symmetric])
huffman@20687: 
huffman@20687: lemma real_sqrt_zero [simp]: "sqrt 0 = 0"
huffman@20687: by (simp add: sqrt_def)
huffman@20687: 
huffman@20687: lemma real_sqrt_one [simp]: "sqrt 1 = 1"
huffman@20687: by (simp add: sqrt_def)
huffman@20687: 
huffman@20687: lemma real_sqrt_pow2_iff [iff]: "((sqrt x)\<twosuperior> = x) = (0 \<le> x)"
huffman@20687: apply (simp add: sqrt_def)
huffman@20687: apply (rule iffI) 
huffman@20687:  apply (cut_tac r = "root 2 x" in realpow_two_le)
huffman@20687:  apply (simp add: numeral_2_eq_2)
huffman@20687: apply (subst numeral_2_eq_2)
huffman@20687: apply (erule real_root_pow_pos2)
huffman@20687: done
huffman@20687: 
huffman@20687: lemma [simp]: "(sqrt(u2\<twosuperior> + v2\<twosuperior>))\<twosuperior> = u2\<twosuperior> + v2\<twosuperior>"
huffman@20687: by (rule realpow_two_le_add_order [THEN real_sqrt_pow2_iff [THEN iffD2]])
huffman@20687: 
huffman@20687: lemma real_sqrt_pow2 [simp]: "0 \<le> x ==> (sqrt x)\<twosuperior> = x"
huffman@20687: by (simp)
huffman@20687: 
huffman@20687: lemma real_sqrt_abs_abs [simp]: "sqrt\<bar>x\<bar> ^ 2 = \<bar>x\<bar>"
huffman@20687: by (rule real_sqrt_pow2_iff [THEN iffD2], arith)
huffman@20687: 
huffman@20687: lemma real_pow_sqrt_eq_sqrt_pow: 
huffman@20687:       "0 \<le> x ==> (sqrt x)\<twosuperior> = sqrt(x\<twosuperior>)"
huffman@20687: apply (simp add: sqrt_def)
huffman@20687: apply (simp only: numeral_2_eq_2 real_root_pow_pos2 real_root_pos2)
huffman@20687: done
huffman@20687: 
huffman@20687: lemma real_pow_sqrt_eq_sqrt_abs_pow2:
huffman@20687:      "0 \<le> x ==> (sqrt x)\<twosuperior> = sqrt(\<bar>x\<bar> ^ 2)" 
huffman@20687: by (simp add: real_pow_sqrt_eq_sqrt_pow [symmetric])
huffman@20687: 
huffman@20687: lemma real_sqrt_pow_abs: "0 \<le> x ==> (sqrt x)\<twosuperior> = \<bar>x\<bar>"
huffman@20687: apply (rule real_sqrt_abs_abs [THEN subst])
huffman@20687: apply (rule_tac x1 = x in real_pow_sqrt_eq_sqrt_abs_pow2 [THEN ssubst])
huffman@20687: apply (rule_tac [2] real_pow_sqrt_eq_sqrt_pow [symmetric])
huffman@20687: apply (assumption, arith)
huffman@20687: done
huffman@20687: 
huffman@20687: lemma not_real_square_gt_zero [simp]: "(~ (0::real) < x*x) = (x = 0)"
huffman@20687: apply auto
huffman@20687: apply (cut_tac x = x and y = 0 in linorder_less_linear)
huffman@20687: apply (simp add: zero_less_mult_iff)
huffman@20687: done
huffman@20687: 
huffman@20687: lemma real_sqrt_gt_zero: "0 < x ==> 0 < sqrt(x)"
huffman@20687: by (simp add: sqrt_def real_root_gt_zero)
huffman@20687: 
huffman@20687: lemma real_sqrt_ge_zero: "0 \<le> x ==> 0 \<le> sqrt(x)"
huffman@20687: by (auto intro: real_sqrt_gt_zero simp add: order_le_less)
huffman@20687: 
huffman@20687: lemma real_sqrt_mult_self_sum_ge_zero [simp]: "0 \<le> sqrt(x*x + y*y)"
huffman@20687: by (rule real_sqrt_ge_zero [OF real_mult_self_sum_ge_zero]) 
huffman@20687: 
huffman@20687: 
huffman@20687: (*we need to prove something like this:
huffman@20687: lemma "[|r ^ n = a; 0<n; 0 < a \<longrightarrow> 0 < r|] ==> root n a = r"
huffman@20687: apply (case_tac n, simp) 
huffman@20687: apply (simp add: root_def) 
huffman@20687: apply (rule someI2 [of _ r], safe)
huffman@20687: apply (auto simp del: realpow_Suc dest: power_inject_base)
huffman@20687: *)
huffman@20687: 
huffman@20687: lemma sqrt_eqI: "[|r\<twosuperior> = a; 0 \<le> r|] ==> sqrt a = r"
huffman@20687: apply (erule subst)
huffman@20687: apply (simp add: sqrt_def numeral_2_eq_2 del: realpow_Suc)
huffman@20687: apply (erule real_root_pos2)
huffman@20687: done
huffman@20687: 
huffman@20687: lemma real_sqrt_mult_distrib: 
huffman@20687:      "[| 0 \<le> x; 0 \<le> y |] ==> sqrt(x*y) = sqrt(x) * sqrt(y)"
huffman@20687: apply (rule sqrt_eqI)
huffman@20687: apply (simp add: power_mult_distrib)  
huffman@20687: apply (simp add: zero_le_mult_iff real_sqrt_ge_zero) 
huffman@20687: done
huffman@20687: 
huffman@20687: lemma real_sqrt_mult_distrib2:
huffman@20687:      "[|0\<le>x; 0\<le>y |] ==> sqrt(x*y) =  sqrt(x) * sqrt(y)"
huffman@20687: by (auto intro: real_sqrt_mult_distrib simp add: order_le_less)
huffman@20687: 
huffman@20687: lemma real_sqrt_sum_squares_ge_zero [simp]: "0 \<le> sqrt (x\<twosuperior> + y\<twosuperior>)"
huffman@20687: by (auto intro!: real_sqrt_ge_zero)
huffman@20687: 
huffman@20687: lemma real_sqrt_sum_squares_mult_ge_zero [simp]:
huffman@20687:      "0 \<le> sqrt ((x\<twosuperior> + y\<twosuperior>)*(xa\<twosuperior> + ya\<twosuperior>))"
huffman@20687: by (auto intro!: real_sqrt_ge_zero simp add: zero_le_mult_iff)
huffman@20687: 
huffman@20687: lemma real_sqrt_sum_squares_mult_squared_eq [simp]:
huffman@20687:      "sqrt ((x\<twosuperior> + y\<twosuperior>) * (xa\<twosuperior> + ya\<twosuperior>)) ^ 2 = (x\<twosuperior> + y\<twosuperior>) * (xa\<twosuperior> + ya\<twosuperior>)"
huffman@20687: by (auto simp add: zero_le_mult_iff simp del: realpow_Suc)
huffman@20687: 
huffman@20687: lemma real_sqrt_abs [simp]: "sqrt(x\<twosuperior>) = \<bar>x\<bar>"
huffman@20687: apply (rule abs_realpow_two [THEN subst])
huffman@20687: apply (rule real_sqrt_abs_abs [THEN subst])
huffman@20687: apply (subst real_pow_sqrt_eq_sqrt_pow)
huffman@20687: apply (auto simp add: numeral_2_eq_2)
huffman@20687: done
huffman@20687: 
huffman@20687: lemma real_sqrt_abs2 [simp]: "sqrt(x*x) = \<bar>x\<bar>"
huffman@20687: apply (rule realpow_two [THEN subst])
huffman@20687: apply (subst numeral_2_eq_2 [symmetric])
huffman@20687: apply (rule real_sqrt_abs)
huffman@20687: done
huffman@20687: 
huffman@20687: lemma real_sqrt_pow2_gt_zero: "0 < x ==> 0 < (sqrt x)\<twosuperior>"
huffman@20687: by simp
huffman@20687: 
huffman@20687: lemma real_sqrt_not_eq_zero: "0 < x ==> sqrt x \<noteq> 0"
huffman@20687: apply (frule real_sqrt_pow2_gt_zero)
huffman@20687: apply (auto simp add: numeral_2_eq_2)
huffman@20687: done
huffman@20687: 
huffman@20687: lemma real_inv_sqrt_pow2: "0 < x ==> inverse (sqrt(x)) ^ 2 = inverse x"
wenzelm@20898: by (cut_tac n = 2 and a = "sqrt x" in power_inverse [symmetric], auto)
huffman@20687: 
huffman@20687: lemma real_sqrt_eq_zero_cancel: "[| 0 \<le> x; sqrt(x) = 0|] ==> x = 0"
huffman@20687: apply (drule real_le_imp_less_or_eq)
huffman@20687: apply (auto dest: real_sqrt_not_eq_zero)
huffman@20687: done
huffman@20687: 
huffman@20687: lemma real_sqrt_eq_zero_cancel_iff [simp]: "0 \<le> x ==> ((sqrt x = 0) = (x=0))"
huffman@20687: by (auto simp add: real_sqrt_eq_zero_cancel)
huffman@20687: 
huffman@20687: lemma real_sqrt_sum_squares_ge1 [simp]: "x \<le> sqrt(x\<twosuperior> + y\<twosuperior>)"
huffman@20687: apply (subgoal_tac "x \<le> 0 | 0 \<le> x", safe)
huffman@20687: apply (rule real_le_trans)
huffman@20687: apply (auto simp del: realpow_Suc)
huffman@20687: apply (rule_tac n = 1 in realpow_increasing)
huffman@20687: apply (auto simp add: numeral_2_eq_2 [symmetric] simp del: realpow_Suc)
huffman@20687: done
huffman@20687: 
huffman@20687: lemma real_sqrt_sum_squares_ge2 [simp]: "y \<le> sqrt(z\<twosuperior> + y\<twosuperior>)"
huffman@20687: apply (simp (no_asm) add: real_add_commute del: realpow_Suc)
huffman@20687: done
huffman@20687: 
huffman@20687: lemma real_sqrt_ge_one: "1 \<le> x ==> 1 \<le> sqrt x"
huffman@20687: apply (rule_tac n = 1 in realpow_increasing)
huffman@20687: apply (auto simp add: numeral_2_eq_2 [symmetric] real_sqrt_ge_zero simp 
huffman@20687:             del: realpow_Suc)
huffman@20687: done
huffman@20687: 
paulson@14324: end




