src/HOL/Real/RComplete.ML
author paulson
Thu, 01 Oct 1998 18:18:01 +0200
changeset 5588 a3ab526bb891
parent 5521 7970832271cc
child 7077 60b098bb8b8a
permissions -rw-r--r--
Revised version with Abelian group simprocs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
     1
(*  Title       : RComplete.thy
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
     2
    Author      : Jacques D. Fleuriot
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
     3
    Copyright   : 1998  University of Cambridge
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
     4
    Description : Completeness theorems for positive
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
     5
                  reals and reals 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
     6
*) 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
     7
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
     8
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
     9
open RComplete;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    10
5521
7970832271cc added wrapper for bspec
oheimb
parents: 5143
diff changeset
    11
claset_ref() := claset() delWrapper "bspec";
7970832271cc added wrapper for bspec
oheimb
parents: 5143
diff changeset
    12
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    13
Goal "!!(x::real). [| isLub R S x; isLub R S y |] ==> x = y";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    14
by (forward_tac [isLub_isUb] 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    15
by (forw_inst_tac [("x","y")] isLub_isUb 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    16
by (blast_tac (claset() addSIs [real_le_anti_sym]
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    17
                addSDs [isLub_le_isUb]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    18
qed "real_isLub_unique";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    19
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    20
Goalw [setle_def,setge_def] 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    21
         "!!x::real. [| x <=* S'; S <= S' |] ==> x <=* S";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    22
by (Blast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    23
qed "real_order_restrict";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    24
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    25
(*----------------------------------------------------------------
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    26
           Completeness theorem for the positive reals(again)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    27
 ----------------------------------------------------------------*)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    28
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
    29
Goal "[| ALL x: S. 0r < x; \
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    30
\                 EX x. x: S; \
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    31
\                 EX u. isUb (UNIV::real set) S u \
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    32
\              |] ==> EX t. isLub (UNIV::real set) S t";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    33
by (res_inst_tac [("x","%#psup({w. %#w : S})")] exI 1);
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
    34
by (auto_tac (claset(), simpset() addsimps [isLub_def,leastP_def,isUb_def]));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    35
by (auto_tac (claset() addSIs [setleI,setgeI] 
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
    36
	               addSDs [real_gt_zero_preal_Ex RS iffD1],simpset()));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    37
by (forw_inst_tac [("x","y")] bspec 1 THEN assume_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    38
by (dtac (real_gt_zero_preal_Ex RS iffD1) 1);
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
    39
by (auto_tac (claset(), simpset() addsimps [real_preal_le_iff]));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    40
by (rtac preal_psup_leI2a 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    41
by (forw_inst_tac [("y","%#ya")] setleD 1 THEN assume_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    42
by (forward_tac  [real_ge_preal_preal_Ex] 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    43
by (Step_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    44
by (res_inst_tac [("x","y")] exI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    45
by (blast_tac (claset() addSDs [setleD] addIs [real_preal_le_iff RS iffD1]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    46
by (forw_inst_tac [("x","x")] bspec 1 THEN assume_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    47
by (forward_tac [isUbD2] 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    48
by (dtac (real_gt_zero_preal_Ex RS iffD1) 1);
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
    49
by (auto_tac (claset() addSDs [isUbD, real_ge_preal_preal_Ex],
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
    50
	      simpset() addsimps [real_preal_le_iff]));
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
    51
by (blast_tac (claset() addSDs [setleD] addSIs [psup_le_ub1] 
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
    52
	                addIs [real_preal_le_iff RS iffD1]) 1);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    53
qed "posreals_complete";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    54
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    55
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    56
(*-------------------------------
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    57
    Lemmas
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    58
 -------------------------------*)
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
    59
Goal "! y : {z. ? x: P. z = x + -xa + 1r} Int {x. 0r < x}. 0r < y";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    60
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    61
qed "real_sup_lemma3";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    62
 
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
    63
Goal "(xa <= S + X + -Z) = (xa + -X + Z <= (S::real))";
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
    64
by (simp_tac (simpset() addsimps [real_diff_def, real_diff_le_eq RS sym] @
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
    65
	                         real_add_ac) 1);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    66
qed "lemma_le_swap2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    67
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
    68
Goal "[| 0r < x + -X + 1r; x < xa |] ==> 0r < xa + -X + 1r";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    69
by (dtac real_add_less_mono 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    70
by (assume_tac 1);
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
    71
by (dres_inst_tac [("C","-x"),("A","0r + x")] real_add_less_mono2 1);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    72
by (asm_full_simp_tac (simpset() addsimps [real_add_zero_right,
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    73
    real_add_assoc RS sym,real_add_minus_left,real_add_zero_left]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    74
by (asm_full_simp_tac (simpset() addsimps real_add_ac) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    75
qed "lemma_real_complete1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    76
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
    77
Goal "!!x. [| x + -X + 1r <= S; xa < x |] ==> xa + -X + 1r <= S";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    78
by (dtac real_less_imp_le 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    79
by (dtac real_add_le_mono 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    80
by (assume_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    81
by (asm_full_simp_tac (simpset() addsimps real_add_ac) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    82
qed "lemma_real_complete2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    83
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
    84
Goal "[| x + -X + 1r <= S; xa < x |] ==> xa <= S + X + -1r"; (**)
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    85
by (rtac (lemma_le_swap2 RS iffD2) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    86
by (etac lemma_real_complete2 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    87
by (assume_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    88
qed "lemma_real_complete2a";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    89
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
    90
Goal "[| x + -X + 1r <= S; xa <= x |] ==> xa <= S + X + -1r";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    91
by (rotate_tac 1 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    92
by (etac (real_le_imp_less_or_eq RS disjE) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    93
by (blast_tac (claset() addIs [lemma_real_complete2a]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    94
by (blast_tac (claset() addIs [(lemma_le_swap2 RS iffD2)]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    95
qed "lemma_real_complete2b";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    96
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    97
(*------------------------------------
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    98
      reals Completeness (again!)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    99
 ------------------------------------*)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   100
Goal "!!(S::real set). [| EX X. X: S; \
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   101
\                             EX Y. isUb (UNIV::real set) S Y \
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   102
\                          |] ==> EX t. isLub (UNIV :: real set) S t";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   103
by (Step_tac 1);
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   104
by (subgoal_tac "? u. u: {z. ? x: S. z = x + -X + 1r} \
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   105
\                Int {x. 0r < x}" 1);
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   106
by (subgoal_tac "isUb (UNIV::real set) ({z. ? x: S. z = x + -X + 1r} \
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   107
\                Int {x. 0r < x})  (Y + -X + 1r)" 1); 
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   108
by (cut_inst_tac [("P","S"),("xa","X")] real_sup_lemma3 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   109
by (EVERY1[forward_tac [exI RSN (3,posreals_complete)], Blast_tac, Blast_tac, Step_tac]);
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   110
by (res_inst_tac [("x","t + X + -1r")] exI 1);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   111
by (rtac isLubI2 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   112
by (rtac setgeI 2 THEN Step_tac 2);
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   113
by (subgoal_tac "isUb (UNIV:: real set) ({z. ? x: S. z = x + -X + 1r} \
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   114
\                Int {x. 0r < x})  (y + -X + 1r)" 2); 
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   115
by (dres_inst_tac [("y","(y + - X + 1r)")] isLub_le_isUb 2 
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   116
      THEN assume_tac 2);
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   117
by (full_simp_tac
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   118
    (simpset() addsimps [real_diff_def, real_diff_le_eq RS sym] @
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   119
                        real_add_ac) 2);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   120
by (rtac (setleI RS isUbI) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   121
by (Step_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   122
by (res_inst_tac [("R1.0","x"),("R2.0","y")] real_linear_less2 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   123
by (stac lemma_le_swap2 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   124
by (forward_tac [isLubD2] 1 THEN assume_tac 2);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   125
by (Step_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   126
by (Blast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   127
by (dtac lemma_real_complete1 1 THEN REPEAT(assume_tac 1));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   128
by (stac lemma_le_swap2 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   129
by (forward_tac [isLubD2] 1 THEN assume_tac 2);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   130
by (Blast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   131
by (rtac lemma_real_complete2b 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   132
by (etac real_less_imp_le 2);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   133
by (blast_tac (claset() addSIs [isLubD2]) 1 THEN Step_tac 1);
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   134
by (full_simp_tac (simpset() addsimps [real_add_assoc]) 1);
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   135
by (blast_tac (claset() addDs [isUbD] addSIs [setleI RS isUbI]
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   136
                        addIs [real_add_le_mono1]) 1);
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   137
by (blast_tac (claset() addDs [isUbD] addSIs [setleI RS isUbI]
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   138
                        addIs [real_add_le_mono1]) 1);
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   139
by (auto_tac (claset(),
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   140
	      simpset() addsimps [real_add_assoc RS sym,
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   141
				  real_zero_less_one]));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   142
qed "reals_complete";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   143
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   144
(*----------------------------------------------------------------
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   145
        Related property: Archimedean property of reals
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   146
 ----------------------------------------------------------------*)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   147
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
   148
Goal "0r < x ==> EX n. rinv(%%#n) < x";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   149
by (stac real_nat_rinv_Ex_iff 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   150
by (EVERY1[rtac ccontr, Asm_full_simp_tac]);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   151
by (fold_tac [real_le_def]);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   152
by (subgoal_tac "isUb (UNIV::real set) {z. EX n. z = x*%%#n} 1r" 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   153
by (subgoal_tac "EX X. X : {z. EX n. z = x*%%#n}" 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   154
by (dtac reals_complete 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   155
by (auto_tac (claset() addIs [isUbI,setleI],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   156
by (subgoal_tac "ALL m. x*(%%#Suc m) <= t" 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   157
by (asm_full_simp_tac (simpset() addsimps 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   158
   [real_nat_Suc,real_add_mult_distrib2]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   159
by (blast_tac (claset() addIs [isLubD2]) 2);
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   160
by (asm_full_simp_tac
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   161
    (simpset() addsimps [real_le_diff_eq RS sym, real_diff_def]) 1);
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   162
by (subgoal_tac "isUb (UNIV::real set) {z. EX n. z = x*%%#n} (t + -x)" 1);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   163
by (blast_tac (claset() addSIs [isUbI,setleI]) 2);
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   164
by (dres_inst_tac [("y","t+-x")] isLub_le_isUb 1);
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   165
by (dres_inst_tac [("x","-t")] real_add_left_le_mono1 2);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   166
by (auto_tac (claset() addDs [real_le_less_trans,
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   167
			      (real_minus_zero_less_iff2 RS iffD2)], 
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   168
	      simpset() addsimps [real_less_not_refl,real_add_assoc RS sym]));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   169
qed "reals_Archimedean";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   170
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   171
Goal "EX n. (x::real) < %%#n";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   172
by (res_inst_tac [("R1.0","x"),("R2.0","0r")] real_linear_less2 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   173
by (res_inst_tac [("x","0")] exI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   174
by (res_inst_tac [("x","0")] exI 2);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   175
by (auto_tac (claset() addEs [real_less_trans],
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   176
	      simpset() addsimps [real_nat_one,real_zero_less_one]));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   177
by (forward_tac [(real_rinv_gt_zero RS reals_Archimedean)] 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   178
by (Step_tac 1 THEN res_inst_tac [("x","n")] exI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   179
by (forw_inst_tac [("y","rinv x")] real_mult_less_mono1 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   180
by (auto_tac (claset(),simpset() addsimps [real_not_refl2 RS not_sym]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   181
by (dres_inst_tac [("n1","n"),("y","1r")] 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   182
     (real_nat_less_zero RS real_mult_less_mono2)  1);
5588
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   183
by (auto_tac (claset(),
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   184
	      simpset() addsimps [real_nat_less_zero,
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   185
				  real_not_refl2 RS not_sym,
a3ab526bb891 Revised version with Abelian group simprocs
paulson
parents: 5521
diff changeset
   186
				  real_mult_assoc RS sym]));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   187
qed "reals_Archimedean2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   188
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   189
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   190
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   191
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   192