src/HOL/Hyperreal/NthRoot.thy
author paulson
Thu, 01 Jan 2004 10:06:32 +0100
changeset 14334 6137d24eef79
parent 14325 94ac3895822f
child 14348 744c868ee0b7
permissions -rw-r--r--
tweaking of lemmas in RealDef, RealOrd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12196
a3be6b3a9c0b new theories from Jacques Fleuriot
paulson
parents:
diff changeset
     1
(*  Title       : NthRoot.thy
a3be6b3a9c0b new theories from Jacques Fleuriot
paulson
parents:
diff changeset
     2
    Author      : Jacques D. Fleuriot
a3be6b3a9c0b new theories from Jacques Fleuriot
paulson
parents:
diff changeset
     3
    Copyright   : 1998  University of Cambridge
a3be6b3a9c0b new theories from Jacques Fleuriot
paulson
parents:
diff changeset
     4
    Description : Existence of nth root. Adapted from
a3be6b3a9c0b new theories from Jacques Fleuriot
paulson
parents:
diff changeset
     5
                   http://www.math.unl.edu/~webnotes
a3be6b3a9c0b new theories from Jacques Fleuriot
paulson
parents:
diff changeset
     6
*)
a3be6b3a9c0b new theories from Jacques Fleuriot
paulson
parents:
diff changeset
     7
14324
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
     8
header{*Existence of Nth Root*}
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
     9
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    10
theory NthRoot = SEQ + HSeries:
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    11
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    12
text{*Various lemmas needed for this result. We follow the proof
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    13
   given by John Lindsay Orr (jorr@math.unl.edu) in his Analysis
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    14
   Webnotes available on the www at http://www.math.unl.edu/~webnotes
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    15
   Lemmas about sequences of reals are used to reach the result.*}
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    16
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    17
lemma lemma_nth_realpow_non_empty:
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    18
     "[| (0::real) < a; 0 < n |] ==> \<exists>s. s : {x. x ^ n <= a & 0 < x}"
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    19
apply (case_tac "1 <= a")
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    20
apply (rule_tac x = "1" in exI)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14325
diff changeset
    21
apply (drule_tac [2] linorder_not_le [THEN iffD1])
14324
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    22
apply (drule_tac [2] less_not_refl2 [THEN not0_implies_Suc])
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14325
diff changeset
    23
apply (auto intro!: realpow_Suc_le_self simp add: zero_less_one)
14324
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    24
done
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    25
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    26
lemma lemma_nth_realpow_isUb_ex:
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    27
     "[| (0::real) < a; 0 < n |]  
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    28
      ==> \<exists>u. isUb (UNIV::real set) {x. x ^ n <= a & 0 < x} u"
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    29
apply (case_tac "1 <= a")
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    30
apply (rule_tac x = "a" in exI)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14325
diff changeset
    31
apply (drule_tac [2] linorder_not_le [THEN iffD1])
14324
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    32
apply (rule_tac [2] x = "1" in exI)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    33
apply (rule_tac [!] setleI [THEN isUbI])
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    34
apply safe
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    35
apply (simp_all (no_asm))
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    36
apply (rule_tac [!] ccontr)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14325
diff changeset
    37
apply (drule_tac [!] linorder_not_le [THEN iffD1])
14324
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    38
apply (drule realpow_ge_self2 , assumption)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    39
apply (drule_tac n = "n" in realpow_less)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    40
apply (assumption+)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    41
apply (drule real_le_trans , assumption)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    42
apply (drule_tac y = "y ^ n" in order_less_le_trans)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    43
apply (assumption , erule real_less_irrefl)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14325
diff changeset
    44
apply (drule_tac n = "n" in zero_less_one [THEN realpow_less])
14324
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    45
apply auto
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    46
done
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    47
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    48
lemma nth_realpow_isLub_ex:
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    49
     "[| (0::real) < a; 0 < n |]  
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    50
      ==> \<exists>u. isLub (UNIV::real set) {x. x ^ n <= a & 0 < x} u"
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    51
apply (blast intro: lemma_nth_realpow_isUb_ex lemma_nth_realpow_non_empty reals_complete)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    52
done
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    53
 
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    54
subsection{*First Half -- Lemmas First*}
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    55
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    56
lemma lemma_nth_realpow_seq:
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    57
     "isLub (UNIV::real set) {x. x ^ n <= a & (0::real) < x} u  
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    58
           ==> u + inverse(real (Suc k)) ~: {x. x ^ n <= a & 0 < x}"
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    59
apply (safe , drule isLubD2 , blast)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    60
apply (simp add: real_le_def)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    61
done
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    62
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    63
lemma lemma_nth_realpow_isLub_gt_zero:
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    64
     "[| isLub (UNIV::real set) {x. x ^ n <= a & (0::real) < x} u;  
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    65
         0 < a; 0 < n |] ==> 0 < u"
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    66
apply (drule lemma_nth_realpow_non_empty , auto)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    67
apply (drule_tac y = "s" in isLub_isUb [THEN isUbD])
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    68
apply (auto intro: order_less_le_trans)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    69
done
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    70
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    71
lemma lemma_nth_realpow_isLub_ge:
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    72
     "[| isLub (UNIV::real set) {x. x ^ n <= a & (0::real) < x} u;  
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    73
         0 < a; 0 < n |] ==> ALL k. a <= (u + inverse(real (Suc k))) ^ n"
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    74
apply (safe)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    75
apply (frule lemma_nth_realpow_seq , safe)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    76
apply (auto elim: real_less_asym simp add: real_le_def)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    77
apply (simp add: real_le_def [symmetric])
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    78
apply (rule order_less_trans [of _ 0])
14325
94ac3895822f removing real_of_posnat
paulson
parents: 14324
diff changeset
    79
apply (auto intro: lemma_nth_realpow_isLub_gt_zero)
14324
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    80
done
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    81
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    82
text{*First result we want*}
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    83
lemma realpow_nth_ge:
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    84
     "[| (0::real) < a; 0 < n;  
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    85
     isLub (UNIV::real set)  
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    86
     {x. x ^ n <= a & 0 < x} u |] ==> a <= u ^ n"
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    87
apply (frule lemma_nth_realpow_isLub_ge , safe)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    88
apply (rule LIMSEQ_inverse_real_of_nat_add [THEN LIMSEQ_pow, THEN LIMSEQ_le_const])
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14325
diff changeset
    89
apply (auto simp add: real_of_nat_def)
14324
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    90
done
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    91
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    92
subsection{*Second Half*}
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    93
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    94
lemma less_isLub_not_isUb:
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    95
     "[| isLub (UNIV::real set) S u; x < u |]  
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    96
           ==> ~ isUb (UNIV::real set) S x"
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    97
apply (safe)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    98
apply (drule isLub_le_isUb)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
    99
apply assumption
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   100
apply (drule order_less_le_trans)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   101
apply (auto simp add: real_less_not_refl)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   102
done
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   103
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   104
lemma not_isUb_less_ex:
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   105
     "~ isUb (UNIV::real set) S u ==> \<exists>x \<in> S. u < x"
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   106
apply (rule ccontr , erule swap)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   107
apply (rule setleI [THEN isUbI])
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   108
apply (auto simp add: real_le_def)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   109
done
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   110
14325
94ac3895822f removing real_of_posnat
paulson
parents: 14324
diff changeset
   111
lemma real_mult_less_self: "0 < r ==> r * (1 + -inverse(real (Suc n))) < r"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14325
diff changeset
   112
apply (simp (no_asm) add: right_distrib)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14325
diff changeset
   113
apply (rule add_less_cancel_left [of "-r", THEN iffD1])
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14325
diff changeset
   114
apply (auto intro: mult_pos
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14325
diff changeset
   115
            simp add: add_assoc [symmetric] neg_less_0_iff_less)
14325
94ac3895822f removing real_of_posnat
paulson
parents: 14324
diff changeset
   116
done
94ac3895822f removing real_of_posnat
paulson
parents: 14324
diff changeset
   117
94ac3895822f removing real_of_posnat
paulson
parents: 14324
diff changeset
   118
lemma real_mult_add_one_minus_ge_zero:
94ac3895822f removing real_of_posnat
paulson
parents: 14324
diff changeset
   119
     "0 < r ==>  0 <= r*(1 + -inverse(real (Suc n)))"
94ac3895822f removing real_of_posnat
paulson
parents: 14324
diff changeset
   120
apply (simp add: zero_le_mult_iff real_of_nat_inverse_le_iff) 
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14325
diff changeset
   121
apply (simp add: real_of_nat_Suc) 
14325
94ac3895822f removing real_of_posnat
paulson
parents: 14324
diff changeset
   122
done
94ac3895822f removing real_of_posnat
paulson
parents: 14324
diff changeset
   123
14324
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   124
lemma lemma_nth_realpow_isLub_le:
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   125
     "[| isLub (UNIV::real set) {x. x ^ n <= a & (0::real) < x} u;  
14325
94ac3895822f removing real_of_posnat
paulson
parents: 14324
diff changeset
   126
       0 < a; 0 < n |] ==> ALL k. (u*(1 + -inverse(real (Suc k)))) ^ n <= a"
14324
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   127
apply (safe)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   128
apply (frule less_isLub_not_isUb [THEN not_isUb_less_ex])
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   129
apply (rule_tac n = "k" in real_mult_less_self)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   130
apply (blast intro: lemma_nth_realpow_isLub_gt_zero)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   131
apply (safe)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   132
apply (drule_tac n = "k" in lemma_nth_realpow_isLub_gt_zero [THEN real_mult_add_one_minus_ge_zero])
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   133
apply (drule_tac [3] conjI [THEN realpow_le2])
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   134
apply (rule_tac [3] order_less_imp_le) 
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   135
apply (auto intro: order_trans)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   136
done
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   137
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   138
text{*Second result we want*}
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   139
lemma realpow_nth_le:
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   140
     "[| (0::real) < a; 0 < n;  
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   141
     isLub (UNIV::real set)  
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   142
     {x. x ^ n <= a & 0 < x} u |] ==> u ^ n <= a"
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   143
apply (frule lemma_nth_realpow_isLub_le , safe)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   144
apply (rule LIMSEQ_inverse_real_of_nat_add_minus_mult [THEN LIMSEQ_pow, THEN LIMSEQ_le_const2])
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14325
diff changeset
   145
apply (auto simp add: real_of_nat_def)
14324
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   146
done
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   147
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   148
(*----------- The theorem at last! -----------*)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   149
lemma realpow_nth: "[| (0::real) < a; 0 < n |] ==> \<exists>r. r ^ n = a"
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   150
apply (frule nth_realpow_isLub_ex , auto)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   151
apply (auto intro: realpow_nth_le realpow_nth_ge real_le_anti_sym)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   152
done
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   153
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   154
(* positive only *)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   155
lemma realpow_pos_nth: "[| (0::real) < a; 0 < n |] ==> \<exists>r. 0 < r & r ^ n = a"
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   156
apply (frule nth_realpow_isLub_ex , auto)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   157
apply (auto intro: realpow_nth_le realpow_nth_ge real_le_anti_sym lemma_nth_realpow_isLub_gt_zero)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   158
done
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   159
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   160
lemma realpow_pos_nth2: "(0::real) < a  ==> \<exists>r. 0 < r & r ^ Suc n = a"
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   161
apply (blast intro: realpow_pos_nth)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   162
done
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   163
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   164
(* uniqueness of nth positive root *)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   165
lemma realpow_pos_nth_unique:
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   166
     "[| (0::real) < a; 0 < n |] ==> EX! r. 0 < r & r ^ n = a"
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   167
apply (auto intro!: realpow_pos_nth)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   168
apply (cut_tac x = "r" and y = "y" in linorder_less_linear)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   169
apply auto
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   170
apply (drule_tac x = "r" in realpow_less)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   171
apply (drule_tac [4] x = "y" in realpow_less)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   172
apply (auto simp add: real_less_not_refl)
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   173
done
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   174
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   175
ML
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   176
{*
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   177
val nth_realpow_isLub_ex = thm"nth_realpow_isLub_ex";
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   178
val realpow_nth_ge = thm"realpow_nth_ge";
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   179
val less_isLub_not_isUb = thm"less_isLub_not_isUb";
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   180
val not_isUb_less_ex = thm"not_isUb_less_ex";
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   181
val realpow_nth_le = thm"realpow_nth_le";
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   182
val realpow_nth = thm"realpow_nth";
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   183
val realpow_pos_nth = thm"realpow_pos_nth";
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   184
val realpow_pos_nth2 = thm"realpow_pos_nth2";
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   185
val realpow_pos_nth_unique = thm"realpow_pos_nth_unique";
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   186
*}
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   187
c9c6832f9b22 converting Hyperreal/NthRoot to Isar
paulson
parents: 14268
diff changeset
   188
end