src/HOL/Real/PReal.ML
author wenzelm
Fri, 08 Mar 2002 16:24:06 +0100
changeset 13049 ce180e5b7fa0
parent 12886 75ca1bf5ae12
child 13438 527811f00c56
permissions -rw-r--r--
tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9427
a9c60e655107 avoid referencing thy value;
wenzelm
parents: 9266
diff changeset
     1
(*  Title       : HOL/Real/PReal.ML
7219
4e3f386c2e37 inserted Id: lines
paulson
parents: 7077
diff changeset
     2
    ID          : $Id$
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
     3
    Author      : Jacques D. Fleuriot
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
     4
    Copyright   : 1998  University of Cambridge
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
     5
    Description : The positive reals as Dedekind sections of positive
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
     6
                  rationals. Fundamentals of Abstract Analysis 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
     7
                  [Gleason- p. 121] provides some of the definitions.
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
     8
*)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
     9
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    10
Goal "inj_on Abs_preal preal";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    11
by (rtac inj_on_inverseI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    12
by (etac Abs_preal_inverse 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    13
qed "inj_on_Abs_preal";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    14
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    15
Addsimps [inj_on_Abs_preal RS inj_on_iff];
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    16
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    17
Goal "inj(Rep_preal)";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    18
by (rtac inj_inverseI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    19
by (rtac Rep_preal_inverse 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    20
qed "inj_Rep_preal";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    21
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    22
Goalw [preal_def] "{} ~: preal";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    23
by (Fast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    24
qed "empty_not_mem_preal";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    25
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    26
(* {} : preal ==> P *)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    27
bind_thm ("empty_not_mem_prealE", empty_not_mem_preal RS notE);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    28
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    29
Addsimps [empty_not_mem_preal];
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    30
11701
3d51fbf81c17 sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
wenzelm
parents: 11655
diff changeset
    31
Goalw [preal_def] "{x::prat. x < prat_of_pnat (Abs_pnat (Suc 0))} : preal";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    32
by (rtac preal_1 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    33
qed "one_set_mem_preal";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    34
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    35
Addsimps [one_set_mem_preal];
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    36
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
    37
Goalw [preal_def] "x : preal ==> {} < x";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    38
by (Fast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    39
qed "preal_psubset_empty";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    40
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    41
Goal "{} < Rep_preal x";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    42
by (rtac (Rep_preal RS preal_psubset_empty) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    43
qed "Rep_preal_psubset_empty";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    44
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
    45
Goal "EX x. x: Rep_preal X";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    46
by (cut_inst_tac [("x","X")]  Rep_preal_psubset_empty 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    47
by (auto_tac (claset() addIs [(equals0I RS sym)],
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    48
              simpset() addsimps [psubset_def]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    49
qed "mem_Rep_preal_Ex";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    50
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    51
Goalw [preal_def] 
7825
1be9b63e7d93 replaced {x. True} by UNIV to work with the new simprule, Collect_const
paulson
parents: 7499
diff changeset
    52
      "[| {} < A; A < UNIV; \
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
    53
\              (ALL y: A. ((ALL z. z < y --> z: A) & \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
    54
\                        (EX u: A. y < u))) |] ==> A : preal";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    55
by (Fast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    56
qed "prealI1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    57
    
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    58
Goalw [preal_def] 
7825
1be9b63e7d93 replaced {x. True} by UNIV to work with the new simprule, Collect_const
paulson
parents: 7499
diff changeset
    59
      "[| {} < A; A < UNIV; \
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
    60
\              ALL y: A. (ALL z. z < y --> z: A); \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
    61
\              ALL y: A. (EX u: A. y < u) |] ==> A : preal";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    62
by (Best_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    63
qed "prealI2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    64
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    65
Goalw [preal_def] 
7825
1be9b63e7d93 replaced {x. True} by UNIV to work with the new simprule, Collect_const
paulson
parents: 7499
diff changeset
    66
      "A : preal ==> {} < A & A < UNIV & \
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
    67
\                         (ALL y: A. ((ALL z. z < y --> z: A) & \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
    68
\                                  (EX u: A. y < u)))";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    69
by (Fast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    70
qed "prealE_lemma";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    71
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    72
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    73
AddSIs [prealI1,prealI2];
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    74
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    75
Addsimps [Abs_preal_inverse];
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    76
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    77
5148
74919e8f221c More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5143
diff changeset
    78
Goalw [preal_def] "A : preal ==> {} < A";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    79
by (Fast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    80
qed "prealE_lemma1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    81
7825
1be9b63e7d93 replaced {x. True} by UNIV to work with the new simprule, Collect_const
paulson
parents: 7499
diff changeset
    82
Goalw [preal_def] "A : preal ==> A < UNIV";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    83
by (Fast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    84
qed "prealE_lemma2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    85
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
    86
Goalw [preal_def] "A : preal ==> ALL y: A. (ALL z. z < y --> z: A)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    87
by (Fast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    88
qed "prealE_lemma3";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    89
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
    90
Goal "[| A : preal; y: A |] ==> (ALL z. z < y --> z: A)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    91
by (fast_tac (claset() addSDs [prealE_lemma3]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    92
qed "prealE_lemma3a";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    93
5148
74919e8f221c More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5143
diff changeset
    94
Goal "[| A : preal; y: A; z < y |] ==> z: A";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    95
by (fast_tac (claset() addSDs [prealE_lemma3a]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    96
qed "prealE_lemma3b";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    97
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
    98
Goalw [preal_def] "A : preal ==> ALL y: A. (EX u: A. y < u)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
    99
by (Fast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   100
qed "prealE_lemma4";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   101
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   102
Goal "[| A : preal; y: A |] ==> EX u: A. y < u";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   103
by (fast_tac (claset() addSDs [prealE_lemma4]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   104
qed "prealE_lemma4a";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   105
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   106
Goal "EX x. x~: Rep_preal X";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   107
by (cut_inst_tac [("x","X")] Rep_preal 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   108
by (dtac prealE_lemma2 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   109
by (auto_tac (claset(),simpset() addsimps [psubset_def]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   110
qed "not_mem_Rep_preal_Ex";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   111
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
   112
(** preal_of_prat: the injection from prat to preal **)
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   113
(** A few lemmas **)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   114
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   115
Goal "{xa::prat. xa < y} : preal";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   116
by (cut_facts_tac [qless_Ex] 1);
8919
d00b01ed8539 tidied and made to work with AddSIs [psubsetI]
paulson
parents: 7825
diff changeset
   117
by (auto_tac (claset() addIs[prat_less_trans]
12886
75ca1bf5ae12 deleted some redundant 'addS*Es [equalityC*E]'s
paulson
parents: 12018
diff changeset
   118
                       addSEs [prat_less_irrefl], 
8919
d00b01ed8539 tidied and made to work with AddSIs [psubsetI]
paulson
parents: 7825
diff changeset
   119
	      simpset()));
d00b01ed8539 tidied and made to work with AddSIs [psubsetI]
paulson
parents: 7825
diff changeset
   120
by (blast_tac (claset() addDs [prat_dense]) 1);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   121
qed "lemma_prat_less_set_mem_preal";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   122
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   123
Goal "!!(x::prat). {xa. xa < x} = {x. x < y} ==> x = y";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   124
by (cut_inst_tac [("q1.0","x"),("q2.0","y")] prat_linear 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   125
by Auto_tac;
8919
d00b01ed8539 tidied and made to work with AddSIs [psubsetI]
paulson
parents: 7825
diff changeset
   126
by (dtac prat_dense 2 THEN etac exE 2);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   127
by (dtac prat_dense 1 THEN etac exE 1);
12886
75ca1bf5ae12 deleted some redundant 'addS*Es [equalityC*E]'s
paulson
parents: 12018
diff changeset
   128
by (auto_tac (claset() addDs [prat_less_not_sym], simpset()));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   129
qed "lemma_prat_set_eq";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   130
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
   131
Goal "inj(preal_of_prat)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   132
by (rtac injI 1);
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
   133
by (rewtac preal_of_prat_def);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   134
by (dtac (inj_on_Abs_preal RS inj_onD) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   135
by (rtac lemma_prat_less_set_mem_preal 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   136
by (rtac lemma_prat_less_set_mem_preal 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   137
by (etac lemma_prat_set_eq 1);
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
   138
qed "inj_preal_of_prat";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   139
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   140
      (*** theorems for ordering ***)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   141
(* prove introduction and elimination rules for preal_less *)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   142
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   143
(* A positive fraction not in a positive real is an upper bound *)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   144
(* Gleason p. 122 - Remark (1)                                  *)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   145
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   146
Goal "x ~: Rep_preal(R) ==> ALL y: Rep_preal(R). y < x";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   147
by (cut_inst_tac [("x1","R")] (Rep_preal RS prealE_lemma) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   148
by (auto_tac (claset() addIs [not_less_not_eq_prat_less],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   149
qed "not_in_preal_ub";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   150
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   151
(* preal_less is a strong order i.e nonreflexive and transitive *)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   152
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   153
Goalw [preal_less_def] "~ (x::preal) < x";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   154
by (simp_tac (simpset() addsimps [psubset_def]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   155
qed "preal_less_not_refl";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   156
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   157
(*** y < y ==> P ***)
10752
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   158
bind_thm("preal_less_irrefl", preal_less_not_refl RS notE);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   159
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   160
Goal "!!(x::preal). x < y ==> x ~= y";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   161
by (auto_tac (claset(),simpset() addsimps [preal_less_not_refl]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   162
qed "preal_not_refl2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   163
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   164
Goalw  [preal_less_def] "!!(x::preal). [| x < y; y < z |] ==> x < z";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   165
by (auto_tac (claset() addDs [subsetD,equalityI],
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   166
              simpset() addsimps [psubset_def]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   167
qed "preal_less_trans";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   168
5459
1dbaf888f4e7 well-formed asym rules; misc. tidying
paulson
parents: 5148
diff changeset
   169
Goal "!! (q1::preal). q1 < q2 ==> ~ q2 < q1";
1dbaf888f4e7 well-formed asym rules; misc. tidying
paulson
parents: 5148
diff changeset
   170
by (rtac notI 1);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   171
by (dtac preal_less_trans 1 THEN assume_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   172
by (asm_full_simp_tac (simpset() addsimps [preal_less_not_refl]) 1);
5459
1dbaf888f4e7 well-formed asym rules; misc. tidying
paulson
parents: 5148
diff changeset
   173
qed "preal_less_not_sym";
1dbaf888f4e7 well-formed asym rules; misc. tidying
paulson
parents: 5148
diff changeset
   174
1dbaf888f4e7 well-formed asym rules; misc. tidying
paulson
parents: 5148
diff changeset
   175
(* [| x < y;  ~P ==> y < x |] ==> P *)
10232
529c65b5dcde restoration of "equalityI"; renaming of contrapos rules
paulson
parents: 9969
diff changeset
   176
bind_thm ("preal_less_asym", preal_less_not_sym RS contrapos_np);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   177
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   178
Goalw [preal_less_def] 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   179
      "(r1::preal) < r2 | r1 = r2 | r2 < r1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   180
by (auto_tac (claset() addSDs [inj_Rep_preal RS injD],
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   181
              simpset() addsimps [psubset_def]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   182
by (rtac prealE_lemma3b 1 THEN rtac Rep_preal 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   183
by (assume_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   184
by (fast_tac (claset() addDs [not_in_preal_ub]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   185
qed "preal_linear";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   186
5459
1dbaf888f4e7 well-formed asym rules; misc. tidying
paulson
parents: 5148
diff changeset
   187
Goal "!!(r1::preal). [| r1 < r2 ==> P;  r1 = r2 ==> P; \
1dbaf888f4e7 well-formed asym rules; misc. tidying
paulson
parents: 5148
diff changeset
   188
\                       r2 < r1 ==> P |] ==> P";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   189
by (cut_inst_tac [("r1.0","r1"),("r2.0","r2")] preal_linear 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   190
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   191
qed "preal_linear_less2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   192
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   193
  (*** Properties of addition ***)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   194
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   195
Goalw [preal_add_def] "(x::preal) + y = y + x";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   196
by (res_inst_tac [("f","Abs_preal")] arg_cong 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   197
by (blast_tac (claset() addIs [prat_add_commute RS subst]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   198
qed "preal_add_commute";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   199
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   200
(** addition of two positive reals gives a positive real **)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   201
(** lemmas for proving positive reals addition set in preal **)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   202
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   203
(** Part 1 of Dedekind sections def **)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   204
Goal "{} < {w. EX x: Rep_preal R. EX y:Rep_preal S. w = x + y}";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   205
by (cut_facts_tac [mem_Rep_preal_Ex,mem_Rep_preal_Ex] 1);
12886
75ca1bf5ae12 deleted some redundant 'addS*Es [equalityC*E]'s
paulson
parents: 12018
diff changeset
   206
by (auto_tac (claset() addSIs [psubsetI], simpset()));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   207
qed "preal_add_set_not_empty";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   208
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   209
(** Part 2 of Dedekind sections def **)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   210
Goal "EX q. q  ~: {w. EX x: Rep_preal R. EX y:Rep_preal S. w = x + y}";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   211
by (cut_inst_tac [("X","R")] not_mem_Rep_preal_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   212
by (cut_inst_tac [("X","S")] not_mem_Rep_preal_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   213
by (REPEAT(etac exE 1));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   214
by (REPEAT(dtac not_in_preal_ub 1));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   215
by (res_inst_tac [("x","x+xa")] exI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   216
by (Auto_tac THEN (REPEAT(etac ballE 1)) THEN Auto_tac);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   217
by (dtac prat_add_less_mono 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   218
by (auto_tac (claset(),simpset() addsimps [prat_less_not_refl]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   219
qed "preal_not_mem_add_set_Ex";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   220
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   221
Goal "{w. EX x: Rep_preal R. EX y:Rep_preal S. w = x + y} < UNIV";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   222
by (auto_tac (claset() addSIs [psubsetI],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   223
by (cut_inst_tac [("R","R"),("S","S")] preal_not_mem_add_set_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   224
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   225
qed "preal_add_set_not_prat_set";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   226
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   227
(** Part 3 of Dedekind sections def **)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   228
Goal "ALL y: {w. EX x: Rep_preal R. EX y: Rep_preal S. w = x + y}. \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   229
\         ALL z. z < y --> z : {w. EX x:Rep_preal R. EX y:Rep_preal S. w = x + y}";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   230
by Auto_tac;
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7219
diff changeset
   231
by (ftac prat_mult_qinv_less_1 1);
11701
3d51fbf81c17 sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
wenzelm
parents: 11655
diff changeset
   232
by (forw_inst_tac [("x","x"),("q2.0","prat_of_pnat (Abs_pnat (Suc 0))")] 
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   233
    prat_mult_less2_mono1 1);
11701
3d51fbf81c17 sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
wenzelm
parents: 11655
diff changeset
   234
by (forw_inst_tac [("x","ya"),("q2.0","prat_of_pnat (Abs_pnat (Suc 0))")] 
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   235
    prat_mult_less2_mono1 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   236
by (Asm_full_simp_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   237
by (REPEAT(dtac (Rep_preal RS prealE_lemma3a) 1));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   238
by (REPEAT(etac allE 1));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   239
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   240
by (REPEAT(rtac bexI 1));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   241
by (auto_tac (claset(),simpset() addsimps [prat_add_mult_distrib2 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   242
     RS sym,prat_add_assoc RS sym,prat_mult_assoc]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   243
qed "preal_add_set_lemma3";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   244
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   245
Goal "ALL y: {w. EX x: Rep_preal R. EX y: Rep_preal S. w = x + y}. \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   246
\         EX u: {w. EX x: Rep_preal R. EX y: Rep_preal S. w = x + y}. y < u";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   247
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   248
by (dtac (Rep_preal RS prealE_lemma4a) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   249
by (auto_tac (claset() addIs [prat_add_less2_mono1],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   250
qed "preal_add_set_lemma4";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   251
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   252
Goal "{w. EX x: Rep_preal R. EX y: Rep_preal S. w = x + y} : preal";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   253
by (rtac prealI2 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   254
by (rtac preal_add_set_not_empty 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   255
by (rtac preal_add_set_not_prat_set 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   256
by (rtac preal_add_set_lemma3 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   257
by (rtac preal_add_set_lemma4 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   258
qed "preal_mem_add_set";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   259
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   260
Goalw [preal_add_def] "((x::preal) + y) + z = x + (y + z)";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   261
by (res_inst_tac [("f","Abs_preal")] arg_cong 1);
10292
paulson
parents: 10232
diff changeset
   262
by (simp_tac (simpset() addsimps [preal_mem_add_set RS Abs_preal_inverse]) 1); 
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   263
by (auto_tac (claset(),simpset() addsimps prat_add_ac));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   264
by (rtac bexI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   265
by (auto_tac (claset() addSIs [exI],simpset() addsimps prat_add_ac));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   266
qed "preal_add_assoc";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   267
9266
1b917b8b1b38 removal of batch style, and tidying
paulson
parents: 9189
diff changeset
   268
Goal "(z1::preal) + (z2 + z3) = z2 + (z1 + z3)";
1b917b8b1b38 removal of batch style, and tidying
paulson
parents: 9189
diff changeset
   269
by (rtac (preal_add_commute RS trans) 1);
1b917b8b1b38 removal of batch style, and tidying
paulson
parents: 9189
diff changeset
   270
by (rtac (preal_add_assoc RS trans) 1);
1b917b8b1b38 removal of batch style, and tidying
paulson
parents: 9189
diff changeset
   271
by (rtac (preal_add_commute RS arg_cong) 1);
1b917b8b1b38 removal of batch style, and tidying
paulson
parents: 9189
diff changeset
   272
qed "preal_add_left_commute";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   273
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   274
(* Positive Reals addition is an AC operator *)
9108
9fff97d29837 bind_thm(s);
wenzelm
parents: 9043
diff changeset
   275
bind_thms ("preal_add_ac", [preal_add_assoc, preal_add_commute, preal_add_left_commute]);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   276
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   277
  (*** Properties of multiplication ***)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   278
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   279
(** Proofs essentially same as for addition **)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   280
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   281
Goalw [preal_mult_def] "(x::preal) * y = y * x";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   282
by (res_inst_tac [("f","Abs_preal")] arg_cong 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   283
by (blast_tac (claset() addIs [prat_mult_commute RS subst]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   284
qed "preal_mult_commute";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   285
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   286
(** multiplication of two positive reals gives a positive real **)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   287
(** lemmas for proving positive reals multiplication set in preal **)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   288
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   289
(** Part 1 of Dedekind sections def **)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   290
Goal "{} < {w. EX x: Rep_preal R. EX y:Rep_preal S. w = x * y}";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   291
by (cut_facts_tac [mem_Rep_preal_Ex,mem_Rep_preal_Ex] 1);
12886
75ca1bf5ae12 deleted some redundant 'addS*Es [equalityC*E]'s
paulson
parents: 12018
diff changeset
   292
by (auto_tac (claset() addSIs [psubsetI], simpset()));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   293
qed "preal_mult_set_not_empty";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   294
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   295
(** Part 2 of Dedekind sections def **)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   296
Goal "EX q. q  ~: {w. EX x: Rep_preal R. EX y:Rep_preal S. w = x * y}";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   297
by (cut_inst_tac [("X","R")] not_mem_Rep_preal_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   298
by (cut_inst_tac [("X","S")] not_mem_Rep_preal_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   299
by (REPEAT(etac exE 1));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   300
by (REPEAT(dtac not_in_preal_ub 1));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   301
by (res_inst_tac [("x","x*xa")] exI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   302
by (Auto_tac  THEN (REPEAT(etac ballE 1)) THEN Auto_tac );
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   303
by (dtac prat_mult_less_mono 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   304
by (auto_tac (claset(),simpset() addsimps [prat_less_not_refl]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   305
qed "preal_not_mem_mult_set_Ex";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   306
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   307
Goal "{w. EX x: Rep_preal R. EX y:Rep_preal S. w = x * y} < UNIV";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   308
by (auto_tac (claset() addSIs [psubsetI],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   309
by (cut_inst_tac [("R","R"),("S","S")] preal_not_mem_mult_set_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   310
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   311
qed "preal_mult_set_not_prat_set";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   312
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   313
(** Part 3 of Dedekind sections def **)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   314
Goal "ALL y: {w. EX x: Rep_preal R. EX y: Rep_preal S. w = x * y}. \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   315
\         ALL z. z < y --> z : {w. EX x:Rep_preal R. EX y:Rep_preal S. w = x * y}";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   316
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   317
by (forw_inst_tac [("x","qinv(ya)"),("q1.0","z")] 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   318
    prat_mult_left_less2_mono1 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   319
by (asm_full_simp_tac (simpset() addsimps prat_mult_ac) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   320
by (dtac (Rep_preal RS prealE_lemma3a) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   321
by (etac allE 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   322
by (REPEAT(rtac bexI 1));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   323
by (auto_tac (claset(),simpset() addsimps [prat_mult_assoc]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   324
qed "preal_mult_set_lemma3";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   325
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   326
Goal "ALL y: {w. EX x: Rep_preal R. EX y: Rep_preal S. w = x * y}. \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   327
\         EX u: {w. EX x: Rep_preal R. EX y: Rep_preal S. w = x * y}. y < u";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   328
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   329
by (dtac (Rep_preal RS prealE_lemma4a) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   330
by (auto_tac (claset() addIs [prat_mult_less2_mono1],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   331
qed "preal_mult_set_lemma4";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   332
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   333
Goal "{w. EX x: Rep_preal R. EX y: Rep_preal S. w = x * y} : preal";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   334
by (rtac prealI2 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   335
by (rtac preal_mult_set_not_empty 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   336
by (rtac preal_mult_set_not_prat_set 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   337
by (rtac preal_mult_set_lemma3 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   338
by (rtac preal_mult_set_lemma4 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   339
qed "preal_mem_mult_set";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   340
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   341
Goalw [preal_mult_def] "((x::preal) * y) * z = x * (y * z)";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   342
by (res_inst_tac [("f","Abs_preal")] arg_cong 1);
10292
paulson
parents: 10232
diff changeset
   343
by (simp_tac (simpset() addsimps [preal_mem_mult_set RS Abs_preal_inverse]) 1);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   344
by (auto_tac (claset(),simpset() addsimps prat_mult_ac));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   345
by (rtac bexI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   346
by (auto_tac (claset() addSIs [exI],simpset() addsimps prat_mult_ac));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   347
qed "preal_mult_assoc";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   348
9266
1b917b8b1b38 removal of batch style, and tidying
paulson
parents: 9189
diff changeset
   349
Goal "(z1::preal) * (z2 * z3) = z2 * (z1 * z3)";
1b917b8b1b38 removal of batch style, and tidying
paulson
parents: 9189
diff changeset
   350
by (rtac (preal_mult_commute RS trans) 1);
1b917b8b1b38 removal of batch style, and tidying
paulson
parents: 9189
diff changeset
   351
by (rtac (preal_mult_assoc RS trans) 1);
1b917b8b1b38 removal of batch style, and tidying
paulson
parents: 9189
diff changeset
   352
by (rtac (preal_mult_commute RS arg_cong) 1);
1b917b8b1b38 removal of batch style, and tidying
paulson
parents: 9189
diff changeset
   353
qed "preal_mult_left_commute";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   354
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   355
(* Positive Reals multiplication is an AC operator *)
9108
9fff97d29837 bind_thm(s);
wenzelm
parents: 9043
diff changeset
   356
bind_thms ("preal_mult_ac", [preal_mult_assoc, 
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   357
                     preal_mult_commute, 
9108
9fff97d29837 bind_thm(s);
wenzelm
parents: 9043
diff changeset
   358
                     preal_mult_left_commute]);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   359
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   360
(* Positive Real 1 is the multiplicative identity element *) 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   361
(* long *)
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
   362
Goalw [preal_of_prat_def,preal_mult_def] 
11701
3d51fbf81c17 sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
wenzelm
parents: 11655
diff changeset
   363
      "(preal_of_prat (prat_of_pnat (Abs_pnat (Suc 0)))) * z = z";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   364
by (rtac (Rep_preal_inverse RS subst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   365
by (res_inst_tac [("f","Abs_preal")] arg_cong 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   366
by (rtac (one_set_mem_preal RS Abs_preal_inverse RS ssubst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   367
by (auto_tac(claset(),simpset() addsimps [Rep_preal_inverse]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   368
by (EVERY1[dtac (Rep_preal RS prealE_lemma4a),etac bexE]);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   369
by (dtac prat_mult_less_mono 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   370
by (auto_tac (claset() addDs [Rep_preal RS prealE_lemma3a],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   371
by (EVERY1[forward_tac [Rep_preal RS prealE_lemma4a],etac bexE]);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   372
by (forw_inst_tac [("x","qinv(u)"),("q1.0","x")] 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   373
    prat_mult_less2_mono1 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   374
by (rtac exI 1 THEN Auto_tac THEN res_inst_tac [("x","u")] bexI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   375
by (auto_tac (claset(),simpset() addsimps [prat_mult_assoc]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   376
qed "preal_mult_1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   377
11701
3d51fbf81c17 sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
wenzelm
parents: 11655
diff changeset
   378
Goal "z * (preal_of_prat (prat_of_pnat (Abs_pnat (Suc 0)))) = z";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   379
by (rtac (preal_mult_commute RS subst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   380
by (rtac preal_mult_1 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   381
qed "preal_mult_1_right";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   382
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   383
(** Lemmas **)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   384
9266
1b917b8b1b38 removal of batch style, and tidying
paulson
parents: 9189
diff changeset
   385
Goal "(z::preal) + v = z' + v' ==> z + (v + w) = z' + (v' + w)";
1b917b8b1b38 removal of batch style, and tidying
paulson
parents: 9189
diff changeset
   386
by (asm_simp_tac (simpset() addsimps [preal_add_assoc RS sym]) 1);
1b917b8b1b38 removal of batch style, and tidying
paulson
parents: 9189
diff changeset
   387
qed "preal_add_assoc_cong";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   388
9266
1b917b8b1b38 removal of batch style, and tidying
paulson
parents: 9189
diff changeset
   389
Goal "(z::preal) + (v + w) = v + (z + w)";
1b917b8b1b38 removal of batch style, and tidying
paulson
parents: 9189
diff changeset
   390
by (REPEAT (ares_tac [preal_add_commute RS preal_add_assoc_cong] 1));
1b917b8b1b38 removal of batch style, and tidying
paulson
parents: 9189
diff changeset
   391
qed "preal_add_assoc_swap";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   392
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   393
(** Distribution of multiplication across addition **)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   394
(** lemmas for the proof **)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   395
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   396
 (** lemmas **)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   397
Goalw [preal_add_def] 
5148
74919e8f221c More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5143
diff changeset
   398
      "z: Rep_preal(R+S) ==> \
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   399
\           EX x: Rep_preal(R). EX y: Rep_preal(S). z = x + y";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   400
by (dtac (preal_mem_add_set RS Abs_preal_inverse RS subst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   401
by (Fast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   402
qed "mem_Rep_preal_addD";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   403
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   404
Goalw [preal_add_def] 
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   405
      "EX x: Rep_preal(R). EX y: Rep_preal(S). z = x + y \
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   406
\      ==> z: Rep_preal(R+S)";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   407
by (rtac (preal_mem_add_set RS Abs_preal_inverse RS ssubst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   408
by (Fast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   409
qed "mem_Rep_preal_addI";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   410
11655
923e4d0d36d5 tuned parentheses in relational expressions;
wenzelm
parents: 11464
diff changeset
   411
Goal "(z: Rep_preal(R+S)) = (EX x: Rep_preal(R). \
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   412
\                                 EX y: Rep_preal(S). z = x + y)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   413
by (fast_tac (claset() addSIs [mem_Rep_preal_addD,mem_Rep_preal_addI]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   414
qed "mem_Rep_preal_add_iff";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   415
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   416
Goalw [preal_mult_def] 
5148
74919e8f221c More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5143
diff changeset
   417
      "z: Rep_preal(R*S) ==> \
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   418
\           EX x: Rep_preal(R). EX y: Rep_preal(S). z = x * y";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   419
by (dtac (preal_mem_mult_set RS Abs_preal_inverse RS subst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   420
by (Fast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   421
qed "mem_Rep_preal_multD";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   422
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   423
Goalw [preal_mult_def] 
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   424
      "EX x: Rep_preal(R). EX y: Rep_preal(S). z = x * y \
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   425
\      ==> z: Rep_preal(R*S)";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   426
by (rtac (preal_mem_mult_set RS Abs_preal_inverse RS ssubst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   427
by (Fast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   428
qed "mem_Rep_preal_multI";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   429
11655
923e4d0d36d5 tuned parentheses in relational expressions;
wenzelm
parents: 11464
diff changeset
   430
Goal "(z: Rep_preal(R*S)) = (EX x: Rep_preal(R). \
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   431
\                                 EX y: Rep_preal(S). z = x * y)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   432
by (fast_tac (claset() addSIs [mem_Rep_preal_multD,mem_Rep_preal_multI]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   433
qed "mem_Rep_preal_mult_iff";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   434
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   435
(** More lemmas for preal_add_mult_distrib2 **)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   436
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
   437
Goal "[| xb: Rep_preal z1; xc: Rep_preal z2; ya: \
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   438
\                  Rep_preal w; yb: Rep_preal w |] ==> \
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   439
\                  xb * ya + xc * yb: Rep_preal (z1 * w + z2 * w)";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   440
by (fast_tac (claset() addIs [mem_Rep_preal_addI,mem_Rep_preal_multI]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   441
qed "lemma_add_mult_mem_Rep_preal";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   442
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
   443
Goal "[| xb: Rep_preal z1; xc: Rep_preal z2; ya: \
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   444
\                  Rep_preal w; yb: Rep_preal w |] ==> \
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   445
\                  yb*(xb + xc): Rep_preal (w*(z1 + z2))";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   446
by (fast_tac (claset() addIs [mem_Rep_preal_addI,mem_Rep_preal_multI]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   447
qed "lemma_add_mult_mem_Rep_preal1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   448
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
   449
Goal "x: Rep_preal (w * z1 + w * z2) ==> \
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   450
\              x: Rep_preal (w * (z1 + z2))";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   451
by (auto_tac (claset() addSDs [mem_Rep_preal_addD,mem_Rep_preal_multD],
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   452
              simpset()));
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
   453
by (forw_inst_tac [("ya","xa"),("yb","xb"),("xb","ya"),("xc","yb")] 
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   454
                                   lemma_add_mult_mem_Rep_preal1 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   455
by Auto_tac;
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
   456
by (res_inst_tac [("q1.0","xa"),("q2.0","xb")] prat_linear_less2 1);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   457
by (dres_inst_tac [("b","ya"),("c","yb")] lemma_prat_add_mult_mono 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   458
by (rtac (Rep_preal RS prealE_lemma3b) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   459
by (auto_tac (claset(),simpset() addsimps [prat_add_mult_distrib2]));
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
   460
by (dres_inst_tac [("ya","xb"),("yb","xa"),("xc","ya"),("xb","yb")] 
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   461
                                   lemma_add_mult_mem_Rep_preal1 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   462
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   463
by (dres_inst_tac [("b","yb"),("c","ya")] lemma_prat_add_mult_mono 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   464
by (rtac (Rep_preal RS prealE_lemma3b) 1);
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
   465
by (thin_tac "xb * ya + xb * yb  : Rep_preal (w * (z1 + z2))" 1);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   466
by (auto_tac (claset(),simpset() addsimps [prat_add_mult_distrib,
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   467
              prat_add_commute] @ preal_add_ac ));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   468
qed "lemma_preal_add_mult_distrib";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   469
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
   470
Goal "x: Rep_preal (w * (z1 + z2)) ==> \
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   471
\              x: Rep_preal (w * z1 + w * z2)";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   472
by (auto_tac (claset() addSDs [mem_Rep_preal_addD,mem_Rep_preal_multD]
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   473
              addSIs [bexI,mem_Rep_preal_addI,mem_Rep_preal_multI],
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   474
              simpset() addsimps [prat_add_mult_distrib2]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   475
qed "lemma_preal_add_mult_distrib2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   476
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   477
Goal "(w * ((z1::preal) + z2)) = (w * z1) + (w * z2)";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   478
by (rtac (inj_Rep_preal RS injD) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   479
by (fast_tac (claset() addIs [lemma_preal_add_mult_distrib,
10292
paulson
parents: 10232
diff changeset
   480
                              lemma_preal_add_mult_distrib2]) 1);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   481
qed "preal_add_mult_distrib2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   482
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   483
Goal "(((z1::preal) + z2) * w) = (z1 * w) + (z2 * w)";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   484
by (simp_tac (simpset() addsimps [preal_mult_commute,
10292
paulson
parents: 10232
diff changeset
   485
                                  preal_add_mult_distrib2]) 1);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   486
qed "preal_add_mult_distrib";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   487
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   488
(*** Prove existence of inverse ***)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   489
(*** Inverse is a positive real ***)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   490
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   491
Goal "EX y. qinv(y) ~:  Rep_preal X";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   492
by (cut_inst_tac [("X","X")] not_mem_Rep_preal_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   493
by (etac exE 1 THEN cut_inst_tac [("x","x")] prat_as_inverse_ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   494
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   495
qed "qinv_not_mem_Rep_preal_Ex";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   496
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   497
Goal "EX q. q: {x. EX y. x < y & qinv y ~:  Rep_preal A}";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   498
by (cut_inst_tac [("X","A")] qinv_not_mem_Rep_preal_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   499
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   500
by (cut_inst_tac [("y","y")] qless_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   501
by (Fast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   502
qed "lemma_preal_mem_inv_set_ex";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   503
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   504
(** Part 1 of Dedekind sections def **)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   505
Goal "{} < {x. EX y. x < y & qinv y ~:  Rep_preal A}";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   506
by (cut_facts_tac [lemma_preal_mem_inv_set_ex] 1);
12886
75ca1bf5ae12 deleted some redundant 'addS*Es [equalityC*E]'s
paulson
parents: 12018
diff changeset
   507
by (auto_tac (claset() addSIs [psubsetI], simpset()));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   508
qed "preal_inv_set_not_empty";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   509
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   510
(** Part 2 of Dedekind sections def **)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   511
Goal "EX y. qinv(y) :  Rep_preal X";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   512
by (cut_inst_tac [("X","X")] mem_Rep_preal_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   513
by (etac exE 1 THEN cut_inst_tac [("x","x")] prat_as_inverse_ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   514
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   515
qed "qinv_mem_Rep_preal_Ex";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   516
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   517
Goal "EX x. x ~: {x. EX y. x < y & qinv y ~:  Rep_preal A}";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   518
by (rtac ccontr 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   519
by (cut_inst_tac [("X","A")] qinv_mem_Rep_preal_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   520
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   521
by (EVERY1[etac allE, etac exE, etac conjE]);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   522
by (dtac qinv_prat_less 1 THEN dtac not_in_preal_ub 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   523
by (eres_inst_tac [("x","qinv y")] ballE 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   524
by (dtac prat_less_trans 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   525
by (auto_tac (claset(),simpset() addsimps [prat_less_not_refl]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   526
qed "preal_not_mem_inv_set_Ex";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   527
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   528
Goal "{x. EX y. x < y & qinv y ~:  Rep_preal A} < UNIV";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   529
by (auto_tac (claset() addSIs [psubsetI],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   530
by (cut_inst_tac [("A","A")]  preal_not_mem_inv_set_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   531
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   532
qed "preal_inv_set_not_prat_set";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   533
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   534
(** Part 3 of Dedekind sections def **)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   535
Goal "ALL y: {x. EX y. x < y & qinv y ~: Rep_preal A}. \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   536
 \      ALL z. z < y --> z : {x. EX y. x < y & qinv y ~: Rep_preal A}";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   537
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   538
by (res_inst_tac [("x","ya")] exI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   539
by (auto_tac (claset() addIs [prat_less_trans],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   540
qed "preal_inv_set_lemma3";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   541
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   542
Goal "ALL y: {x. EX y. x < y & qinv y ~: Rep_preal A}. \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   543
\       Bex {x. EX y. x < y & qinv y ~: Rep_preal A} (op < y)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   544
by (blast_tac (claset() addDs [prat_dense]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   545
qed "preal_inv_set_lemma4";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   546
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   547
Goal "{x. EX y. x < y & qinv(y) ~: Rep_preal(A)} : preal";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   548
by (rtac prealI2 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   549
by (rtac preal_inv_set_not_empty 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   550
by (rtac preal_inv_set_not_prat_set 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   551
by (rtac preal_inv_set_lemma3 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   552
by (rtac preal_inv_set_lemma4 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   553
qed "preal_mem_inv_set";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   554
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   555
(*more lemmas for inverse *)
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
   556
Goal "x: Rep_preal(pinv(A)*A) ==> \
11701
3d51fbf81c17 sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
wenzelm
parents: 11655
diff changeset
   557
\     x: Rep_preal(preal_of_prat (prat_of_pnat (Abs_pnat (Suc 0))))";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   558
by (auto_tac (claset() addSDs [mem_Rep_preal_multD],
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
   559
              simpset() addsimps [pinv_def,preal_of_prat_def] ));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   560
by (dtac (preal_mem_inv_set RS Abs_preal_inverse RS subst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   561
by (auto_tac (claset() addSDs [not_in_preal_ub],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   562
by (dtac prat_mult_less_mono 1 THEN Blast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   563
by (auto_tac (claset(),simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   564
qed "preal_mem_mult_invD";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   565
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   566
(*** Gleason's Lemma 9-3.4 p 122 ***)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   567
Goal "ALL xa : Rep_preal(A). xa + x : Rep_preal(A) ==> \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   568
\            EX xb : Rep_preal(A). xb + (prat_of_pnat p)*x : Rep_preal(A)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   569
by (cut_facts_tac [mem_Rep_preal_Ex] 1);
9747
043098ba5098 introduced induct_thm_tac
nipkow
parents: 9427
diff changeset
   570
by (induct_thm_tac pnat_induct "p" 1);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   571
by (auto_tac (claset(),simpset() addsimps [pnat_one_def,
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
   572
    pSuc_is_plus_one,prat_add_mult_distrib,
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
   573
   prat_of_pnat_add,prat_add_assoc RS sym]));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   574
qed "lemma1_gleason9_34";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   575
10834
a7897aebbffc *** empty log message ***
nipkow
parents: 10797
diff changeset
   576
Goal "Abs_prat (ratrel `` {(y, z)}) < xb + \
11701
3d51fbf81c17 sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
wenzelm
parents: 11655
diff changeset
   577
\         Abs_prat (ratrel `` {(x*y, Abs_pnat (Suc 0))})*Abs_prat (ratrel `` {(w, x)})";
3d51fbf81c17 sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
wenzelm
parents: 11655
diff changeset
   578
by (res_inst_tac [("j","Abs_prat (ratrel `` {(x * y, Abs_pnat (Suc 0))}) *\
10834
a7897aebbffc *** empty log message ***
nipkow
parents: 10797
diff changeset
   579
\                   Abs_prat (ratrel `` {(w, x)})")] prat_le_less_trans 1);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   580
by (rtac prat_self_less_add_right 2);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   581
by (auto_tac (claset() addIs [lemma_Abs_prat_le3],
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   582
    simpset() addsimps [prat_mult,pre_lemma_gleason9_34b,pnat_mult_assoc]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   583
qed "lemma1b_gleason9_34";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   584
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   585
Goal "ALL xa : Rep_preal(A). xa + x : Rep_preal(A) ==> False";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   586
by (cut_inst_tac [("X","A")] not_mem_Rep_preal_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   587
by (etac exE 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   588
by (dtac not_in_preal_ub 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   589
by (res_inst_tac [("z","x")] eq_Abs_prat 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   590
by (res_inst_tac [("z","xa")] eq_Abs_prat 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   591
by (dres_inst_tac [("p","y*xb")] lemma1_gleason9_34 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   592
by (etac bexE 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   593
by (cut_inst_tac [("x","y"),("y","xb"),("w","xaa"),
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   594
    ("z","ya"),("xb","xba")] lemma1b_gleason9_34 1);
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
   595
by (dres_inst_tac [("x","xba + prat_of_pnat (y * xb) * x")]  bspec 1);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   596
by (auto_tac (claset() addIs [prat_less_asym],
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
   597
    simpset() addsimps [prat_of_pnat_def]));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   598
qed "lemma_gleason9_34a";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   599
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   600
Goal "EX r: Rep_preal(R). r + x ~: Rep_preal(R)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   601
by (rtac ccontr 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   602
by (blast_tac (claset() addIs [lemma_gleason9_34a]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   603
qed "lemma_gleason9_34";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   604
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   605
(*** Gleason's Lemma 9-3.6  ***)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   606
(*  lemmas for Gleason 9-3.6  *)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   607
(*                            *) 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   608
(******************************)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   609
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   610
Goal "r + r*qinv(xa)*Q3 = r*qinv(xa)*(xa + Q3)";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   611
by (full_simp_tac (simpset() addsimps [prat_add_mult_distrib2,
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   612
    prat_mult_assoc]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   613
qed "lemma1_gleason9_36";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   614
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   615
Goal "r*qinv(xa)*(xa*x) = r*x";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   616
by (full_simp_tac (simpset() addsimps prat_mult_ac) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   617
qed "lemma2_gleason9_36";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   618
(******)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   619
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   620
(*** FIXME: long! ***)
12018
ec054019c910 Numerals and simprocs for types real and hypreal. The abstract
paulson
parents: 11701
diff changeset
   621
Goal "prat_of_pnat 1 < x ==> EX r: Rep_preal(A). r*x ~: Rep_preal(A)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   622
by (res_inst_tac [("X1","A")] (mem_Rep_preal_Ex RS exE) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   623
by (res_inst_tac [("Q","xa*x : Rep_preal(A)")] (excluded_middle RS disjE) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   624
by (Fast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   625
by (dres_inst_tac [("x","xa")] prat_self_less_mult_right 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   626
by (etac prat_lessE 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   627
by (cut_inst_tac [("R","A"),("x","Q3")] lemma_gleason9_34 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   628
by (dtac sym 1 THEN Auto_tac );
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7219
diff changeset
   629
by (ftac not_in_preal_ub 1);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   630
by (dres_inst_tac [("x","xa + Q3")] bspec 1 THEN assume_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   631
by (dtac prat_add_right_less_cancel 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   632
by (dres_inst_tac [("x","qinv(xa)*Q3")] prat_mult_less2_mono1 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   633
by (dres_inst_tac [("x","r")] prat_add_less2_mono2 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   634
by (asm_full_simp_tac (simpset() addsimps
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   635
    [prat_mult_assoc RS sym,lemma1_gleason9_36]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   636
by (dtac sym 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   637
by (auto_tac (claset(),simpset() addsimps [lemma2_gleason9_36]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   638
by (res_inst_tac [("x","r")] bexI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   639
by (rtac notI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   640
by (dres_inst_tac [("y","r*x")] (Rep_preal RS prealE_lemma3b) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   641
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   642
qed "lemma_gleason9_36";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   643
11701
3d51fbf81c17 sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
wenzelm
parents: 11655
diff changeset
   644
Goal "prat_of_pnat (Abs_pnat (Suc 0)) < x ==> \
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   645
\     EX r: Rep_preal(A). r*x ~: Rep_preal(A)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   646
by (rtac lemma_gleason9_36 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   647
by (asm_simp_tac (simpset() addsimps [pnat_one_def]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   648
qed "lemma_gleason9_36a";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   649
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   650
(*** Part 2 of existence of inverse ***)
11701
3d51fbf81c17 sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
wenzelm
parents: 11655
diff changeset
   651
Goal "x: Rep_preal(preal_of_prat (prat_of_pnat (Abs_pnat (Suc 0)))) \
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
   652
\     ==> x: Rep_preal(pinv(A)*A)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   653
by (auto_tac (claset() addSIs [mem_Rep_preal_multI],
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
   654
              simpset() addsimps [pinv_def,preal_of_prat_def] ));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   655
by (rtac (preal_mem_inv_set RS Abs_preal_inverse RS ssubst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   656
by (dtac prat_qinv_gt_1 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   657
by (dres_inst_tac [("A","A")] lemma_gleason9_36a 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   658
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   659
by (dtac (Rep_preal RS prealE_lemma4a) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   660
by (Auto_tac  THEN dtac qinv_prat_less 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   661
by (res_inst_tac [("x","qinv(u)*x")] exI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   662
by (rtac conjI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   663
by (res_inst_tac [("x","qinv(r)*x")] exI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   664
by (auto_tac (claset() addIs [prat_mult_less2_mono1],
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   665
    simpset() addsimps [qinv_mult_eq,qinv_qinv]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   666
by (res_inst_tac [("x","u")] bexI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   667
by (auto_tac (claset(),simpset() addsimps [prat_mult_assoc,
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   668
    prat_mult_left_commute]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   669
qed "preal_mem_mult_invI";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   670
11701
3d51fbf81c17 sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
wenzelm
parents: 11655
diff changeset
   671
Goal "pinv(A)*A = (preal_of_prat (prat_of_pnat (Abs_pnat (Suc 0))))";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   672
by (rtac (inj_Rep_preal RS injD) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   673
by (fast_tac (claset() addDs [preal_mem_mult_invD,preal_mem_mult_invI]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   674
qed "preal_mult_inv";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   675
11701
3d51fbf81c17 sane numerals (stage 1): added generic 1, removed 1' and 2 on nat,
wenzelm
parents: 11655
diff changeset
   676
Goal "A*pinv(A) = (preal_of_prat (prat_of_pnat (Abs_pnat (Suc 0))))";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   677
by (rtac (preal_mult_commute RS subst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   678
by (rtac preal_mult_inv 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   679
qed "preal_mult_inv_right";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   680
9969
4753185f1dd2 renamed (most of...) the select rules
paulson
parents: 9747
diff changeset
   681
val [prem] = Goal
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   682
    "(!!u. z = Abs_preal(u) ==> P) ==> P";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   683
by (cut_inst_tac [("x1","z")] 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   684
    (rewrite_rule [preal_def] (Rep_preal RS Abs_preal_inverse)) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   685
by (res_inst_tac [("u","Rep_preal z")] prem 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   686
by (dtac (inj_Rep_preal RS injD) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   687
by (Asm_simp_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   688
qed "eq_Abs_preal";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   689
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   690
(*** Lemmas/Theorem(s) need lemma_gleason9_34 ***)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   691
Goal "Rep_preal (R1) <= Rep_preal(R1 + R2)";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   692
by (cut_inst_tac [("X","R2")] mem_Rep_preal_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   693
by (auto_tac (claset() addSIs [bexI] addIs [(Rep_preal RS prealE_lemma3b),
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   694
   prat_self_less_add_left,mem_Rep_preal_addI],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   695
qed "Rep_preal_self_subset";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   696
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   697
Goal "~ Rep_preal (R1 + R2) <= Rep_preal(R1)";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   698
by (cut_inst_tac [("X","R2")] mem_Rep_preal_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   699
by (etac exE 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   700
by (cut_inst_tac [("R","R1")] lemma_gleason9_34 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   701
by (auto_tac (claset() addIs [mem_Rep_preal_addI],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   702
qed "Rep_preal_sum_not_subset";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   703
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   704
Goal "Rep_preal (R1 + R2) ~= Rep_preal(R1)";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   705
by (rtac notI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   706
by (etac equalityE 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   707
by (asm_full_simp_tac (simpset() addsimps [Rep_preal_sum_not_subset]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   708
qed "Rep_preal_sum_not_eq";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   709
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   710
(*** at last --- Gleason prop. 9-3.5(iii) p. 123 ***)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   711
Goalw [preal_less_def,psubset_def] "(R1::preal) < R1 + R2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   712
by (simp_tac (simpset() addsimps [Rep_preal_self_subset,
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   713
    Rep_preal_sum_not_eq RS not_sym]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   714
qed "preal_self_less_add_left";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   715
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   716
Goal "(R1::preal) < R2 + R1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   717
by (simp_tac (simpset() addsimps [preal_add_commute,preal_self_less_add_left]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   718
qed "preal_self_less_add_right";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   719
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   720
(*** Properties of <= ***)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   721
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   722
Goalw [preal_le_def,psubset_def,preal_less_def] 
5148
74919e8f221c More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5143
diff changeset
   723
                     "z<=w ==> ~(w<(z::preal))";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   724
by (auto_tac  (claset() addDs [equalityI],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   725
qed "preal_leD";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   726
9108
9fff97d29837 bind_thm(s);
wenzelm
parents: 9043
diff changeset
   727
bind_thm ("preal_leE", make_elim preal_leD);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   728
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   729
Goalw [preal_le_def,psubset_def,preal_less_def]
5148
74919e8f221c More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5143
diff changeset
   730
                   "~ z <= w ==> w<(z::preal)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   731
by (cut_inst_tac [("r1.0","w"),("r2.0","z")] preal_linear 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   732
by (auto_tac  (claset(),simpset() addsimps [preal_less_def,psubset_def]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   733
qed "not_preal_leE";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   734
		       
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
   735
Goal "~(w < z) ==> z <= (w::preal)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   736
by (fast_tac (claset() addIs [not_preal_leE]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   737
qed "preal_leI";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   738
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
   739
Goal "(~(w < z)) = (z <= (w::preal))";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   740
by (fast_tac (claset() addSIs [preal_leI,preal_leD]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   741
qed "preal_less_le_iff";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   742
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   743
Goalw [preal_le_def,preal_less_def,psubset_def] 
10752
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   744
     "z < w ==> z <= (w::preal)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   745
by (Fast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   746
qed "preal_less_imp_le";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   747
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   748
Goalw [preal_le_def,preal_less_def,psubset_def] 
10752
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   749
     "!!(x::preal). x <= y ==> x < y | x = y";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   750
by (auto_tac (claset() addIs [inj_Rep_preal RS injD],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   751
qed "preal_le_imp_less_or_eq";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   752
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   753
Goalw [preal_le_def,preal_less_def,psubset_def] 
10752
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   754
     "!!(x::preal). x < y | x = y ==> x <=y";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   755
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   756
qed "preal_less_or_eq_imp_le";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   757
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   758
Goalw [preal_le_def] "w <= (w::preal)";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   759
by (Simp_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   760
qed "preal_le_refl";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   761
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
   762
Goal "[| i <= j; j <= k |] ==> i <= (k::preal)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   763
by (EVERY1 [dtac preal_le_imp_less_or_eq, dtac preal_le_imp_less_or_eq,
10752
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   764
          rtac preal_less_or_eq_imp_le, 
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   765
                 fast_tac (claset() addIs [preal_less_trans])]);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   766
qed "preal_le_trans";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   767
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
   768
Goal "[| z <= w; w <= z |] ==> z = (w::preal)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   769
by (EVERY1 [dtac preal_le_imp_less_or_eq, dtac preal_le_imp_less_or_eq,
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   770
            fast_tac (claset() addEs [preal_less_irrefl,preal_less_asym])]);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   771
qed "preal_le_anti_sym";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   772
10752
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   773
Goal "!!w::preal. (w ~= z) = (w<z | z<w)";
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   774
by (cut_inst_tac [("r1.0","w"),("r2.0","z")] preal_linear 1);
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   775
by (auto_tac (claset() addEs [preal_less_irrefl], simpset()));
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   776
qed "preal_neq_iff";
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   777
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   778
(* Axiom 'order_less_le' of class 'order': *)
11655
923e4d0d36d5 tuned parentheses in relational expressions;
wenzelm
parents: 11464
diff changeset
   779
Goal "((w::preal) < z) = (w <= z & w ~= z)";
10752
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   780
by (simp_tac (simpset() addsimps [preal_less_le_iff RS sym, preal_neq_iff]) 1);
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   781
by (blast_tac (claset() addSEs [preal_less_asym]) 1);
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   782
qed "preal_less_le";
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   783
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   784
9969
4753185f1dd2 renamed (most of...) the select rules
paulson
parents: 9747
diff changeset
   785
(****)(****)(****)(****)(****)(****)(****)(****)(****)(****)(****)(****)
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   786
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   787
(**** Set up all lemmas for proving A < B ==> ?D. A + D = B ****)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   788
(**** Gleason prop. 9-3.5(iv) p. 123 ****)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   789
(**** Define the D required and show that it is a positive real ****)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   790
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   791
(* useful lemmas - proved elsewhere? *)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   792
Goalw [psubset_def] "A < B ==> EX x. x ~: A & x : B";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   793
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   794
qed "lemma_psubset_mem";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   795
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   796
Goalw [psubset_def] "~ (A::'a set) < A";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   797
by (Fast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   798
qed "lemma_psubset_not_refl";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   799
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   800
Goalw [psubset_def] "!!(A::'a set). [| A < B; B < C |] ==> A < C";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   801
by (auto_tac (claset() addDs [subset_antisym],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   802
qed "psubset_trans";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   803
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   804
Goalw [psubset_def] "!!(A::'a set). [| A <= B; B < C |] ==> A < C";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   805
by (auto_tac (claset() addDs [subset_antisym],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   806
qed "subset_psubset_trans";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   807
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   808
Goalw [psubset_def] "!!(A::'a set). [| A < B; B <= C |] ==> A < C";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   809
by (auto_tac (claset() addDs [subset_antisym],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   810
qed "subset_psubset_trans2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   811
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   812
Goalw [psubset_def] "!!(A::'a set). [| A < B; c : A |] ==> c : B";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   813
by (auto_tac (claset() addDs [subsetD],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   814
qed "psubsetD";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   815
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   816
(** Part 1 of Dedekind sections def **)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   817
Goalw [preal_less_def]
5148
74919e8f221c More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5143
diff changeset
   818
     "A < B ==> \
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   819
\     EX q. q : {d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)}";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   820
by (EVERY1[dtac lemma_psubset_mem, etac exE, etac conjE]);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   821
by (dres_inst_tac [("x1","B")] (Rep_preal RS prealE_lemma4a) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   822
by (auto_tac (claset(),simpset() addsimps [prat_less_def]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   823
qed "lemma_ex_mem_less_left_add1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   824
10752
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   825
Goal "A < B ==> {} < {d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)}";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   826
by (dtac lemma_ex_mem_less_left_add1 1);
12886
75ca1bf5ae12 deleted some redundant 'addS*Es [equalityC*E]'s
paulson
parents: 12018
diff changeset
   827
by (auto_tac (claset() addSIs [psubsetI], simpset()));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   828
qed "preal_less_set_not_empty";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   829
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   830
(** Part 2 of Dedekind sections def **)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   831
Goal "EX q. q ~: {d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)}";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   832
by (cut_inst_tac [("X","B")] not_mem_Rep_preal_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   833
by (etac exE 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   834
by (res_inst_tac [("x","x")] exI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   835
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   836
by (cut_inst_tac [("x","x"),("y","n")] prat_self_less_add_right 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   837
by (auto_tac (claset() addDs [Rep_preal RS prealE_lemma3b],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   838
qed "lemma_ex_not_mem_less_left_add1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   839
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   840
Goal "{d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)} < UNIV";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   841
by (auto_tac (claset() addSIs [psubsetI],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   842
by (cut_inst_tac [("A","A"),("B","B")] lemma_ex_not_mem_less_left_add1 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   843
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   844
qed "preal_less_set_not_prat_set";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   845
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   846
(** Part 3 of Dedekind sections def **)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   847
Goal "A < B ==> ALL y: {d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)}. \
10752
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   848
 \   ALL z. z < y --> z : {d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)}";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   849
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   850
by (dres_inst_tac [("x","n")] prat_add_less2_mono2 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   851
by (dtac (Rep_preal RS prealE_lemma3b) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   852
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   853
qed "preal_less_set_lemma3";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   854
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   855
Goal "A < B ==> ALL y: {d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)}. \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   856
\       Bex {d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)} (op < y)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   857
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   858
by (dtac (Rep_preal RS prealE_lemma4a) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   859
by (auto_tac (claset(),simpset() addsimps [prat_less_def,prat_add_assoc]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   860
qed "preal_less_set_lemma4";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   861
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   862
Goal 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   863
     "!! (A::preal). A < B ==> \
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   864
\     {d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)}: preal";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   865
by (rtac prealI2 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   866
by (rtac preal_less_set_not_empty 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   867
by (rtac preal_less_set_not_prat_set 2);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   868
by (rtac preal_less_set_lemma3 2);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   869
by (rtac preal_less_set_lemma4 3);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   870
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   871
qed "preal_mem_less_set";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   872
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   873
(** proving that A + D <= B **)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   874
Goalw [preal_le_def] 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   875
       "!! (A::preal). A < B ==> \
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   876
\         A + Abs_preal({d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)}) <= B";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   877
by (rtac subsetI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   878
by (dtac mem_Rep_preal_addD 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   879
by (auto_tac (claset(),simpset() addsimps [
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   880
    preal_mem_less_set RS Abs_preal_inverse]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   881
by (dtac not_in_preal_ub 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   882
by (dtac bspec 1 THEN assume_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   883
by (dres_inst_tac [("x","y")] prat_add_less2_mono1 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   884
by (dres_inst_tac [("x1","B")] (Rep_preal RS prealE_lemma3b) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   885
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   886
qed "preal_less_add_left_subsetI";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   887
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   888
(** proving that B <= A + D  --- trickier **)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   889
(** lemma **)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   890
Goal "x : Rep_preal(B) ==> EX e. x + e : Rep_preal(B)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   891
by (dtac (Rep_preal RS prealE_lemma4a) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   892
by (auto_tac (claset(),simpset() addsimps [prat_less_def]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   893
qed "lemma_sum_mem_Rep_preal_ex";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   894
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   895
Goalw [preal_le_def] 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   896
       "!! (A::preal). A < B ==> \
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   897
\         B <= A + Abs_preal({d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)})";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   898
by (rtac subsetI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   899
by (res_inst_tac [("Q","x: Rep_preal(A)")] (excluded_middle RS disjE) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   900
by (rtac mem_Rep_preal_addI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   901
by (dtac lemma_sum_mem_Rep_preal_ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   902
by (etac exE 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   903
by (cut_inst_tac [("R","A"),("x","e")] lemma_gleason9_34 1 THEN etac bexE 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   904
by (dtac not_in_preal_ub 1 THEN dtac bspec 1 THEN assume_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   905
by (etac prat_lessE 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   906
by (res_inst_tac [("x","r")] bexI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   907
by (res_inst_tac [("x","Q3")] bexI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   908
by (cut_facts_tac [Rep_preal_self_subset] 4);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   909
by (auto_tac (claset(),simpset() addsimps [
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   910
    preal_mem_less_set RS Abs_preal_inverse]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   911
by (res_inst_tac [("x","r+e")] exI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   912
by (asm_full_simp_tac (simpset() addsimps prat_add_ac) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   913
qed "preal_less_add_left_subsetI2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   914
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   915
(*** required proof ***)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   916
Goal "!! (A::preal). A < B ==> \
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   917
\         A + Abs_preal({d. EX n. n ~: Rep_preal(A) & n + d : Rep_preal(B)}) = B";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   918
by (blast_tac (claset() addIs [preal_le_anti_sym,
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   919
                preal_less_add_left_subsetI,preal_less_add_left_subsetI2]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   920
qed "preal_less_add_left";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   921
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
   922
Goal "!! (A::preal). A < B ==> EX D. A + D = B";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   923
by (fast_tac (claset() addDs [preal_less_add_left]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   924
qed "preal_less_add_left_Ex";        
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   925
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   926
Goal "!!(A::preal). A < B ==> A + C < B + C";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   927
by (auto_tac (claset() addSDs [preal_less_add_left_Ex],
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   928
    simpset() addsimps [preal_add_assoc]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   929
by (res_inst_tac [("y1","D")] (preal_add_commute RS subst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   930
by (auto_tac (claset() addIs [preal_self_less_add_left],
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   931
          simpset() addsimps [preal_add_assoc RS sym]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   932
qed "preal_add_less2_mono1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   933
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   934
Goal "!!(A::preal). A < B ==> C + A < C + B";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   935
by (auto_tac (claset() addIs [preal_add_less2_mono1],
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   936
    simpset() addsimps [preal_add_commute]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   937
qed "preal_add_less2_mono2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   938
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   939
Goal 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   940
      "!!(q1::preal). q1 < q2 ==> q1 * x < q2 * x";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   941
by (dtac preal_less_add_left_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   942
by (auto_tac (claset(),simpset() addsimps [preal_add_mult_distrib,
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   943
    preal_self_less_add_left]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   944
qed "preal_mult_less_mono1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   945
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   946
Goal "!!(q1::preal). q1 < q2  ==> x * q1 < x * q2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   947
by (auto_tac (claset() addDs [preal_mult_less_mono1],
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   948
    simpset() addsimps [preal_mult_commute]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   949
qed "preal_mult_left_less_mono1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   950
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   951
Goal "!!(q1::preal). q1 <= q2  ==> x * q1 <= x * q2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   952
by (dtac preal_le_imp_less_or_eq 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   953
by (Step_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   954
by (auto_tac (claset() addSIs [preal_le_refl,
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   955
    preal_less_imp_le,preal_mult_left_less_mono1],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   956
qed "preal_mult_left_le_mono1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   957
 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   958
Goal "!!(q1::preal). q1 <= q2  ==> q1 * x <= q2 * x";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   959
by (auto_tac (claset() addDs [preal_mult_left_le_mono1],
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   960
    simpset() addsimps [preal_mult_commute]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   961
qed "preal_mult_le_mono1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   962
 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   963
Goal "!!(q1::preal). q1 <= q2  ==> x + q1 <= x + q2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   964
by (dtac preal_le_imp_less_or_eq 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   965
by (Step_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   966
by (auto_tac (claset() addSIs [preal_le_refl,
10752
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   967
                               preal_less_imp_le,preal_add_less2_mono1],
c4f1bf2acf4c tidying, and separation of HOL-Hyperreal from HOL-Real
paulson
parents: 10292
diff changeset
   968
              simpset() addsimps [preal_add_commute]));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   969
qed "preal_add_left_le_mono1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   970
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   971
Goal "!!(q1::preal). q1 <= q2  ==> q1 + x <= q2 + x";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   972
by (auto_tac (claset() addDs [preal_add_left_le_mono1],
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   973
    simpset() addsimps [preal_add_commute]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   974
qed "preal_add_le_mono1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   975
 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   976
Goal "!!(A::preal). A + C < B + C ==> A < B";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   977
by (cut_facts_tac [preal_linear] 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   978
by (auto_tac (claset() addEs [preal_less_irrefl],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   979
by (dres_inst_tac [("A","B"),("C","C")] preal_add_less2_mono1 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   980
by (fast_tac (claset() addDs [preal_less_trans] 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   981
                addEs [preal_less_irrefl]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   982
qed "preal_add_right_less_cancel";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   983
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   984
Goal "!!(A::preal). C + A < C + B ==> A < B";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   985
by (auto_tac (claset() addEs [preal_add_right_less_cancel],
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   986
              simpset() addsimps [preal_add_commute]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   987
qed "preal_add_left_less_cancel";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   988
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   989
Goal "((A::preal) + C < B + C) = (A < B)";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   990
by (REPEAT(ares_tac [iffI,preal_add_less2_mono1,
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   991
    preal_add_right_less_cancel] 1));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   992
qed "preal_add_less_iff1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   993
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   994
Addsimps [preal_add_less_iff1];
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   995
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   996
Goal "(C + (A::preal) < C + B) = (A < B)";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   997
by (REPEAT(ares_tac [iffI,preal_add_less2_mono2,
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   998
    preal_add_left_less_cancel] 1));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
   999
qed "preal_add_less_iff2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1000
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1001
Addsimps [preal_add_less_iff2];
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1002
5148
74919e8f221c More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5143
diff changeset
  1003
Goal "[| x1 < y1; x2 < y2 |] ==> x1 + x2 < y1 + (y2::preal)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1004
by (auto_tac (claset() addSDs [preal_less_add_left_Ex],
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1005
    simpset() addsimps  preal_add_ac));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1006
by (rtac (preal_add_assoc RS subst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1007
by (rtac preal_self_less_add_right 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1008
qed "preal_add_less_mono";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1009
5148
74919e8f221c More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5143
diff changeset
  1010
Goal "[| x1 < y1; x2 < y2 |] ==> x1 * x2 < y1 * (y2::preal)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1011
by (auto_tac (claset() addSDs [preal_less_add_left_Ex],
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1012
              simpset() addsimps [preal_add_mult_distrib,
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1013
              preal_add_mult_distrib2,preal_self_less_add_left,
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1014
              preal_add_assoc] @ preal_mult_ac));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1015
qed "preal_mult_less_mono";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1016
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1017
Goal "!!(A::preal). A + C = B + C ==> A = B";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1018
by (cut_facts_tac [preal_linear] 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1019
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1020
by (ALLGOALS(dres_inst_tac [("C","C")] preal_add_less2_mono1));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1021
by (auto_tac (claset() addEs [preal_less_irrefl],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1022
qed "preal_add_right_cancel";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1023
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1024
Goal "!!(A::preal). C + A = C + B ==> A = B";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1025
by (auto_tac (claset() addIs [preal_add_right_cancel],
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1026
              simpset() addsimps [preal_add_commute]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1027
qed "preal_add_left_cancel";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1028
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1029
Goal "(C + A = C + B) = ((A::preal) = B)";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1030
by (fast_tac (claset() addIs [preal_add_left_cancel]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1031
qed "preal_add_left_cancel_iff";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1032
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1033
Goal "(A + C = B + C) = ((A::preal) = B)";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1034
by (fast_tac (claset() addIs [preal_add_right_cancel]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1035
qed "preal_add_right_cancel_iff";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1036
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1037
Addsimps [preal_add_left_cancel_iff,preal_add_right_cancel_iff];
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1038
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1039
(*** Completeness of preal ***)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1040
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1041
(*** prove that supremum is a cut ***)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1042
Goal "EX (X::preal). X: P ==> \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1043
\         EX q.  q: {w. EX X. X : P & w : Rep_preal X}";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1044
by Safe_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1045
by (cut_inst_tac [("X","X")] mem_Rep_preal_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1046
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1047
qed "preal_sup_mem_Ex";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1048
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1049
(** Part 1 of Dedekind def **)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1050
Goal "EX (X::preal). X: P ==> \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1051
\         {} < {w. EX X : P. w : Rep_preal X}";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1052
by (dtac preal_sup_mem_Ex 1);
12886
75ca1bf5ae12 deleted some redundant 'addS*Es [equalityC*E]'s
paulson
parents: 12018
diff changeset
  1053
by (auto_tac (claset() addSIs [psubsetI], simpset()));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1054
qed "preal_sup_set_not_empty";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1055
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1056
(** Part 2 of Dedekind sections def **) 
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1057
Goalw [preal_less_def] "EX Y. (ALL X: P. X < Y)  \             
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1058
\         ==> EX q. q ~: {w. EX X. X: P & w: Rep_preal(X)}"; (**)
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1059
by (auto_tac (claset(),simpset() addsimps [psubset_def]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1060
by (cut_inst_tac [("X","Y")] not_mem_Rep_preal_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1061
by (etac exE 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1062
by (res_inst_tac [("x","x")] exI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1063
by (auto_tac (claset() addSDs [bspec],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1064
qed "preal_sup_not_mem_Ex";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1065
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1066
Goalw [preal_le_def] "EX Y. (ALL X: P. X <= Y)  \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1067
\         ==> EX q. q ~: {w. EX X. X: P & w: Rep_preal(X)}";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1068
by (Step_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1069
by (cut_inst_tac [("X","Y")] not_mem_Rep_preal_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1070
by (etac exE 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1071
by (res_inst_tac [("x","x")] exI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1072
by (auto_tac (claset() addSDs [bspec],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1073
qed "preal_sup_not_mem_Ex1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1074
9189
69b71b554e91 the default equalityCE simplifies proofs
paulson
parents: 9108
diff changeset
  1075
Goal "EX Y. (ALL X: P. X < Y) ==> {w. EX X: P. w: Rep_preal(X)} < UNIV"; (**)
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1076
by (dtac preal_sup_not_mem_Ex 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1077
by (auto_tac (claset() addSIs [psubsetI],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1078
qed "preal_sup_set_not_prat_set";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1079
9189
69b71b554e91 the default equalityCE simplifies proofs
paulson
parents: 9108
diff changeset
  1080
Goal "EX Y. (ALL X: P. X <= Y) ==> {w. EX X: P. w: Rep_preal(X)} < UNIV";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1081
by (dtac preal_sup_not_mem_Ex1 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1082
by (auto_tac (claset() addSIs [psubsetI],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1083
qed "preal_sup_set_not_prat_set1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1084
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1085
(** Part 3 of Dedekind sections def **)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1086
Goal "[|EX (X::preal). X: P; EX Y. (ALL X:P. X < Y) |] \              
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1087
\         ==> ALL y: {w. EX X: P. w: Rep_preal X}. \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1088
\             ALL z. z < y --> z: {w. EX X: P. w: Rep_preal X}";         (**)
9189
69b71b554e91 the default equalityCE simplifies proofs
paulson
parents: 9108
diff changeset
  1089
by (auto_tac(claset() addEs [Rep_preal RS prealE_lemma3b], simpset()));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1090
qed "preal_sup_set_lemma3";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1091
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1092
Goal "[|EX (X::preal). X: P; EX Y. (ALL X:P. X <= Y) |] \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1093
\         ==> ALL y: {w. EX X: P. w: Rep_preal X}. \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1094
\             ALL z. z < y --> z: {w. EX X: P. w: Rep_preal X}";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1095
by (auto_tac(claset() addEs [Rep_preal RS prealE_lemma3b],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1096
qed "preal_sup_set_lemma3_1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1097
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1098
Goal "[|EX (X::preal). X: P; EX Y. (ALL X:P. X < Y) |] \              
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1099
\         ==>  ALL y: {w. EX X: P. w: Rep_preal X}. \                        
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1100
\             Bex {w. EX X: P. w: Rep_preal X} (op < y)";                (**)
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1101
by (blast_tac (claset() addDs [(Rep_preal RS prealE_lemma4a)]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1102
qed "preal_sup_set_lemma4";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1103
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1104
Goal "[|EX (X::preal). X: P; EX Y. (ALL X:P. X <= Y) |] \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1105
\         ==>  ALL y: {w. EX X: P. w: Rep_preal X}. \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1106
\             Bex {w. EX X: P. w: Rep_preal X} (op < y)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1107
by (blast_tac (claset() addDs [(Rep_preal RS prealE_lemma4a)]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1108
qed "preal_sup_set_lemma4_1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1109
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1110
Goal "[|EX (X::preal). X: P; EX Y. (ALL X:P. X < Y) |] \            
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1111
\         ==> {w. EX X: P. w: Rep_preal(X)}: preal";                      (**)
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1112
by (rtac prealI2 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1113
by (rtac preal_sup_set_not_empty 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1114
by (rtac preal_sup_set_not_prat_set 2);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1115
by (rtac preal_sup_set_lemma3 3);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1116
by (rtac preal_sup_set_lemma4 5);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1117
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1118
qed "preal_sup";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1119
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1120
Goal "[|EX (X::preal). X: P; EX Y. (ALL X:P. X <= Y) |] \
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1121
\         ==> {w. EX X: P. w: Rep_preal(X)}: preal";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1122
by (rtac prealI2 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1123
by (rtac preal_sup_set_not_empty 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1124
by (rtac preal_sup_set_not_prat_set1 2);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1125
by (rtac preal_sup_set_lemma3_1 3);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1126
by (rtac preal_sup_set_lemma4_1 5);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1127
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1128
qed "preal_sup1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1129
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1130
Goalw [psup_def] "EX Y. (ALL X:P. X < Y) ==> ALL x: P. x <= psup P";      (**) 
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1131
by (auto_tac (claset(),simpset() addsimps [preal_le_def]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1132
by (rtac (preal_sup RS Abs_preal_inverse RS ssubst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1133
by Auto_tac;
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1134
qed "preal_psup_leI";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1135
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1136
Goalw [psup_def] "EX Y. (ALL X:P. X <= Y) ==> ALL x: P. x <= psup P";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1137
by (auto_tac (claset(),simpset() addsimps [preal_le_def]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1138
by (rtac (preal_sup1 RS Abs_preal_inverse RS ssubst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1139
by (auto_tac (claset(),simpset() addsimps [preal_le_def]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1140
qed "preal_psup_leI2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1141
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1142
Goal "[| EX Y. (ALL X:P. X < Y); x : P |] ==> x <= psup P";              (**)
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1143
by (blast_tac (claset() addSDs [preal_psup_leI]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1144
qed "preal_psup_leI2b";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1145
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1146
Goal "[| EX Y. (ALL X:P. X <= Y); x : P |] ==> x <= psup P";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1147
by (blast_tac (claset() addSDs [preal_psup_leI2]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1148
qed "preal_psup_leI2a";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1149
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1150
Goalw [psup_def] "[| EX X. X : P; ALL X:P. X < Y |] ==> psup P <= Y";   (**)
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1151
by (auto_tac (claset(),simpset() addsimps [preal_le_def]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1152
by (dtac (([exI,exI] MRS preal_sup) RS Abs_preal_inverse RS subst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1153
by (rotate_tac 1 2);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1154
by (assume_tac 2);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1155
by (auto_tac (claset() addSDs [bspec],simpset() addsimps [preal_less_def,psubset_def]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1156
qed "psup_le_ub";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1157
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1158
Goalw [psup_def] "[| EX X. X : P; ALL X:P. X <= Y |] ==> psup P <= Y";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1159
by (auto_tac (claset(),simpset() addsimps [preal_le_def]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1160
by (dtac (([exI,exI] MRS preal_sup1) RS Abs_preal_inverse RS subst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1161
by (rotate_tac 1 2);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1162
by (assume_tac 2);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1163
by (auto_tac (claset() addSDs [bspec],
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1164
    simpset() addsimps [preal_less_def,psubset_def,preal_le_def]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1165
qed "psup_le_ub1";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1166
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1167
(** supremum property **)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1168
Goal "[|EX (X::preal). X: P; EX Y. (ALL X:P. X < Y) |] \                  
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 8919
diff changeset
  1169
\         ==> (ALL Y. (EX X: P. Y < X) = (Y < psup P))";              
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1170
by (forward_tac [preal_sup RS Abs_preal_inverse] 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1171
by (Fast_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1172
by (auto_tac (claset() addSIs [psubsetI],simpset() addsimps [psup_def,preal_less_def]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1173
by (blast_tac (claset() addDs [psubset_def RS meta_eq_to_obj_eq RS iffD1]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1174
by (rotate_tac 4 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1175
by (asm_full_simp_tac (simpset() addsimps [psubset_def]) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1176
by (dtac bspec 1 THEN assume_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1177
by (REPEAT(etac conjE 1));
10292
paulson
parents: 10232
diff changeset
  1178
by (EVERY1[rtac contrapos_np, assume_tac]);
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1179
by (auto_tac (claset() addSDs [lemma_psubset_mem],simpset()));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1180
by (cut_inst_tac [("r1.0","Xa"),("r2.0","Ya")] preal_linear 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1181
by (auto_tac (claset() addDs [psubsetD],simpset() addsimps [preal_less_def]));
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1182
qed "preal_complete";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1183
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1184
(****)(****)(****)(****)(****)(****)(****)(****)(****)(****)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1185
    (****** Embedding ******)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1186
(*** mapping from prat into preal ***)
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1187
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
  1188
Goal "x < z1 + z2 ==> x * z1 * qinv (z1 + z2) < z1";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1189
by (dres_inst_tac [("x","z1 * qinv (z1 + z2)")] prat_mult_less2_mono1 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1190
by (asm_full_simp_tac (simpset() addsimps prat_mult_ac) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1191
qed "lemma_preal_rat_less";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1192
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
  1193
Goal "x < z1 + z2 ==> x * z2 * qinv (z1 + z2) < z2";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1194
by (stac prat_add_commute 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1195
by (dtac (prat_add_commute RS subst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1196
by (etac lemma_preal_rat_less 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1197
qed "lemma_preal_rat_less2";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1198
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
  1199
Goalw [preal_of_prat_def,preal_add_def] 
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
  1200
      "preal_of_prat ((z1::prat) + z2) = \
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
  1201
\      preal_of_prat z1 + preal_of_prat z2";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1202
by (res_inst_tac [("f","Abs_preal")] arg_cong 1);
10292
paulson
parents: 10232
diff changeset
  1203
by (auto_tac (claset() addIs [prat_add_less_mono],
paulson
parents: 10232
diff changeset
  1204
     simpset() addsimps [lemma_prat_less_set_mem_preal RS Abs_preal_inverse]));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1205
by (res_inst_tac [("x","x*z1*qinv(z1+z2)")] exI 1 THEN rtac conjI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1206
by (etac lemma_preal_rat_less 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1207
by (res_inst_tac [("x","x*z2*qinv(z1+z2)")] exI 1 THEN rtac conjI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1208
by (etac lemma_preal_rat_less2 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1209
by (asm_full_simp_tac (simpset() addsimps [prat_add_mult_distrib RS sym,
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1210
     prat_add_mult_distrib2 RS sym] @ prat_mult_ac) 1);
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
  1211
qed "preal_of_prat_add";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1212
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
  1213
Goal "x < xa ==> x*z1*qinv(xa) < z1";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1214
by (dres_inst_tac [("x","z1 * qinv xa")] prat_mult_less2_mono1 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1215
by (dtac (prat_mult_left_commute RS subst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1216
by (asm_full_simp_tac (simpset() addsimps prat_mult_ac) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1217
qed "lemma_preal_rat_less3";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1218
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5078
diff changeset
  1219
Goal "xa < z1 * z2 ==> xa*z2*qinv(z1*z2) < z2";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1220
by (dres_inst_tac [("x","z2 * qinv(z1*z2)")] prat_mult_less2_mono1 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1221
by (dtac (prat_mult_left_commute RS subst) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1222
by (asm_full_simp_tac (simpset() addsimps prat_mult_ac) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1223
qed "lemma_preal_rat_less4";
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1224
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
  1225
Goalw [preal_of_prat_def,preal_mult_def] 
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
  1226
      "preal_of_prat ((z1::prat) * z2) = \
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
  1227
\      preal_of_prat z1 * preal_of_prat z2";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1228
by (res_inst_tac [("f","Abs_preal")] arg_cong 1);
10292
paulson
parents: 10232
diff changeset
  1229
by (auto_tac (claset() addIs [prat_mult_less_mono],
paulson
parents: 10232
diff changeset
  1230
     simpset() addsimps [lemma_prat_less_set_mem_preal RS Abs_preal_inverse]));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1231
by (dtac prat_dense 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1232
by (Step_tac 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1233
by (res_inst_tac [("x","x*z1*qinv(xa)")] exI 1 THEN rtac conjI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1234
by (etac lemma_preal_rat_less3 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1235
by (res_inst_tac [("x"," xa*z2*qinv(z1*z2)")] exI 1 THEN rtac conjI 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1236
by (etac lemma_preal_rat_less4 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1237
by (asm_full_simp_tac (simpset() 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1238
    addsimps [qinv_mult_eq RS sym] @ prat_mult_ac) 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1239
by (asm_full_simp_tac (simpset() 
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1240
    addsimps [prat_mult_assoc RS sym]) 1);
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
  1241
qed "preal_of_prat_mult";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1242
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
  1243
Goalw [preal_of_prat_def,preal_less_def] 
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
  1244
      "(preal_of_prat p < preal_of_prat q) = (p < q)";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1245
by (auto_tac (claset() addSDs [lemma_prat_set_eq] addEs [prat_less_trans],
10292
paulson
parents: 10232
diff changeset
  1246
              simpset() addsimps [lemma_prat_less_set_mem_preal,
paulson
parents: 10232
diff changeset
  1247
                                  psubset_def,prat_less_not_refl]));
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1248
by (res_inst_tac [("q1.0","p"),("q2.0","q")] prat_linear_less2 1);
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1249
by (auto_tac (claset() addIs [prat_less_irrefl],simpset()));
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
  1250
qed "preal_of_prat_less_iff";
5078
7b5ea59c0275 Installation of target HOL-Real
paulson
parents:
diff changeset
  1251
7077
60b098bb8b8a heavily revised by Jacques: coercions have alphabetic names;
paulson
parents: 5588
diff changeset
  1252
Addsimps [preal_of_prat_less_iff];