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