src/HOL/Real/Hyperreal/HyperDef.ML
author paulson
Mon, 16 Aug 1999 18:41:06 +0200
changeset 7218 bfa767b4dc51
child 7322 d16d7ddcc842
permissions -rw-r--r--
new theory Real/Hyperreal/HyperDef and file fuf.ML
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7218
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
     1
(*  Title       : HOL/Real/Hyperreal/Hyper.ML
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
     2
    ID          : $Id$
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
     3
    Author      : Jacques D. Fleuriot
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
     4
    Copyright   : 1998  University of Cambridge
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
     5
    Description : Ultrapower construction of hyperreals
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
     6
*) 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
     7
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
     8
(*------------------------------------------------------------------------
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
     9
             Proof that the set of naturals is not finite
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    10
 ------------------------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    11
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    12
(*** based on James' proof that the set of naturals is not finite ***)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    13
Goal "finite (A::nat set) --> (? n. !m. Suc (n + m) ~: A)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    14
by (rtac impI 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    15
by (eres_inst_tac [("F","A")] finite_induct 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    16
by (Blast_tac 1 THEN etac exE 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    17
by (res_inst_tac [("x","n + x")] exI 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    18
by (rtac allI 1 THEN eres_inst_tac [("x","x + m")] allE 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    19
by (auto_tac (claset(), simpset() addsimps add_ac));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    20
by (auto_tac (claset(),
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    21
	      simpset() addsimps [add_assoc RS sym,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    22
				  less_add_Suc2 RS less_not_refl2]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    23
qed_spec_mp "finite_exhausts";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    24
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    25
Goal "finite (A :: nat set) --> (? n. n ~:A)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    26
by (rtac impI 1 THEN dtac finite_exhausts 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    27
by (Blast_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    28
qed_spec_mp "finite_not_covers";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    29
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    30
Goal "~ finite(UNIV:: nat set)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    31
by (fast_tac (claset() addSDs [finite_exhausts]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    32
qed "not_finite_nat";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    33
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    34
(*------------------------------------------------------------------------
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    35
   Existence of free ultrafilter over the naturals and proof of various 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    36
   properties of the FreeUltrafilterNat- an arbitrary free ultrafilter
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    37
 ------------------------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    38
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    39
Goal "EX U. U: FreeUltrafilter (UNIV::nat set)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    40
by (rtac (not_finite_nat RS FreeUltrafilter_Ex) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    41
qed "FreeUltrafilterNat_Ex";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    42
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    43
Goalw [FreeUltrafilterNat_def] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    44
     "FreeUltrafilterNat: FreeUltrafilter(UNIV:: nat set)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    45
by (rtac (FreeUltrafilterNat_Ex RS exE) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    46
by (rtac selectI2 1 THEN ALLGOALS(assume_tac));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    47
qed "FreeUltrafilterNat_mem";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    48
Addsimps [FreeUltrafilterNat_mem];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    49
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    50
Goalw [FreeUltrafilterNat_def] "finite x ==> x ~: FreeUltrafilterNat";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    51
by (rtac (FreeUltrafilterNat_Ex RS exE) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    52
by (rtac selectI2 1 THEN assume_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    53
by (blast_tac (claset() addDs [mem_FreeUltrafiltersetD1]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    54
qed "FreeUltrafilterNat_finite";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    55
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    56
Goal "x: FreeUltrafilterNat ==> ~ finite x";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    57
by (blast_tac (claset() addDs [FreeUltrafilterNat_finite]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    58
qed "FreeUltrafilterNat_not_finite";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    59
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    60
Goalw [FreeUltrafilterNat_def] "{} ~: FreeUltrafilterNat";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    61
by (rtac (FreeUltrafilterNat_Ex RS exE) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    62
by (rtac selectI2 1 THEN assume_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    63
by (blast_tac (claset() addDs [FreeUltrafilter_Ultrafilter,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    64
			       Ultrafilter_Filter,Filter_empty_not_mem]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    65
qed "FreeUltrafilterNat_empty";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    66
Addsimps [FreeUltrafilterNat_empty];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    67
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    68
Goal "[| X: FreeUltrafilterNat;  Y: FreeUltrafilterNat |]  \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    69
\     ==> X Int Y : FreeUltrafilterNat";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    70
by (cut_facts_tac [FreeUltrafilterNat_mem] 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    71
by (blast_tac (claset() addDs [FreeUltrafilter_Ultrafilter,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    72
			       Ultrafilter_Filter,mem_FiltersetD1]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    73
qed "FreeUltrafilterNat_Int";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    74
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    75
Goal "[| X: FreeUltrafilterNat;  X <= Y |] \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    76
\     ==> Y : FreeUltrafilterNat";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    77
by (cut_facts_tac [FreeUltrafilterNat_mem] 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    78
by (blast_tac (claset() addDs [FreeUltrafilter_Ultrafilter,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    79
			       Ultrafilter_Filter,mem_FiltersetD2]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    80
qed "FreeUltrafilterNat_subset";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    81
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    82
Goal "X: FreeUltrafilterNat ==> -X ~: FreeUltrafilterNat";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    83
by (Step_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    84
by (dtac FreeUltrafilterNat_Int 1 THEN assume_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    85
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    86
qed "FreeUltrafilterNat_Compl";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    87
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    88
Goal "X~: FreeUltrafilterNat ==> -X : FreeUltrafilterNat";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    89
by (cut_facts_tac [FreeUltrafilterNat_mem RS (FreeUltrafilter_iff RS iffD1)] 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    90
by (Step_tac 1 THEN dres_inst_tac [("x","X")] bspec 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    91
by (auto_tac (claset(),simpset() addsimps [UNIV_diff_Compl]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    92
qed "FreeUltrafilterNat_Compl_mem";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    93
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    94
Goal "(X ~: FreeUltrafilterNat) = (-X: FreeUltrafilterNat)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    95
by (blast_tac (claset() addDs [FreeUltrafilterNat_Compl,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    96
			       FreeUltrafilterNat_Compl_mem]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    97
qed "FreeUltrafilterNat_Compl_iff1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    98
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
    99
Goal "(X: FreeUltrafilterNat) = (-X ~: FreeUltrafilterNat)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   100
by (auto_tac (claset(),
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   101
	      simpset() addsimps [FreeUltrafilterNat_Compl_iff1 RS sym]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   102
qed "FreeUltrafilterNat_Compl_iff2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   103
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   104
Goal "(UNIV::nat set) : FreeUltrafilterNat";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   105
by (rtac (FreeUltrafilterNat_mem RS FreeUltrafilter_Ultrafilter RS 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   106
          Ultrafilter_Filter RS mem_FiltersetD4) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   107
qed "FreeUltrafilterNat_UNIV";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   108
Addsimps [FreeUltrafilterNat_UNIV];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   109
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   110
Goal "{n::nat. True}: FreeUltrafilterNat";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   111
by (subgoal_tac "{n::nat. True} = (UNIV::nat set)" 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   112
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   113
qed "FreeUltrafilterNat_Nat_set";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   114
Addsimps [FreeUltrafilterNat_Nat_set];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   115
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   116
Goal "{n. P(n) = P(n)} : FreeUltrafilterNat";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   117
by (Simp_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   118
qed "FreeUltrafilterNat_Nat_set_refl";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   119
AddIs [FreeUltrafilterNat_Nat_set_refl];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   120
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   121
Goal "{n::nat. P} : FreeUltrafilterNat ==> P";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   122
by (rtac ccontr 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   123
by (rotate_tac 1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   124
by (Asm_full_simp_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   125
qed "FreeUltrafilterNat_P";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   126
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   127
Goal "{n. P(n)} : FreeUltrafilterNat ==> EX n. P(n)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   128
by (rtac ccontr 1 THEN rotate_tac 1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   129
by (Asm_full_simp_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   130
qed "FreeUltrafilterNat_Ex_P";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   131
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   132
Goal "ALL n. P(n) ==> {n. P(n)} : FreeUltrafilterNat";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   133
by (auto_tac (claset() addIs [FreeUltrafilterNat_Nat_set],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   134
qed "FreeUltrafilterNat_all";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   135
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   136
(*-----------------------------------------
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   137
     Define and use Ultrafilter tactics
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   138
 -----------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   139
use "fuf.ML";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   140
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   141
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   142
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   143
(*------------------------------------------------------
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   144
   Now prove one further property of our free ultrafilter
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   145
 -------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   146
Goal "X Un Y: FreeUltrafilterNat \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   147
\     ==> X: FreeUltrafilterNat | Y: FreeUltrafilterNat";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   148
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   149
by (Ultra_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   150
qed "FreeUltrafilterNat_Un";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   151
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   152
(*------------------------------------------------------------------------
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   153
                       Properties of hyprel
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   154
 ------------------------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   155
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   156
(** Proving that hyprel is an equivalence relation **)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   157
(** Natural deduction for hyprel **)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   158
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   159
Goalw [hyprel_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   160
   "((X,Y): hyprel) = ({n. X n = Y n}: FreeUltrafilterNat)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   161
by (Fast_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   162
qed "hyprel_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   163
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   164
Goalw [hyprel_def] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   165
     "{n. X n = Y n}: FreeUltrafilterNat  ==> (X,Y): hyprel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   166
by (Fast_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   167
qed "hyprelI";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   168
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   169
Goalw [hyprel_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   170
  "p: hyprel --> (EX X Y. \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   171
\                 p = (X,Y) & {n. X n = Y n} : FreeUltrafilterNat)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   172
by (Fast_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   173
qed "hyprelE_lemma";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   174
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   175
val [major,minor] = goal thy
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   176
  "[| p: hyprel;  \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   177
\     !!X Y. [| p = (X,Y); {n. X n = Y n}: FreeUltrafilterNat\
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   178
\                    |] ==> Q |] ==> Q";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   179
by (cut_facts_tac [major RS (hyprelE_lemma RS mp)] 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   180
by (REPEAT (eresolve_tac [asm_rl,exE,conjE,minor] 1));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   181
qed "hyprelE";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   182
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   183
AddSIs [hyprelI];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   184
AddSEs [hyprelE];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   185
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   186
Goalw [hyprel_def] "(x,x): hyprel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   187
by (auto_tac (claset(),simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   188
         [FreeUltrafilterNat_Nat_set]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   189
qed "hyprel_refl";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   190
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   191
Goal "{n. X n = Y n} = {n. Y n = X n}";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   192
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   193
qed "lemma_perm";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   194
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   195
Goalw [hyprel_def] "(x,y): hyprel --> (y,x):hyprel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   196
by (auto_tac (claset() addIs [lemma_perm RS subst],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   197
qed_spec_mp "hyprel_sym";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   198
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   199
Goalw [hyprel_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   200
      "(x,y): hyprel --> (y,z):hyprel --> (x,z):hyprel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   201
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   202
by (Ultra_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   203
qed_spec_mp "hyprel_trans";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   204
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   205
Goalw [equiv_def, refl_def, sym_def, trans_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   206
    "equiv {x::nat=>real. True} hyprel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   207
by (auto_tac (claset() addSIs [hyprel_refl] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   208
                       addSEs [hyprel_sym,hyprel_trans] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   209
                       delrules [hyprelI,hyprelE],
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   210
	      simpset() addsimps [FreeUltrafilterNat_Nat_set]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   211
qed "equiv_hyprel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   212
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   213
val equiv_hyprel_iff =
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   214
    [TrueI, TrueI] MRS 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   215
    ([CollectI, CollectI] MRS 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   216
    (equiv_hyprel RS eq_equiv_class_iff));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   217
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   218
Goalw  [hypreal_def,hyprel_def,quotient_def] "hyprel^^{x}:hypreal";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   219
by (Blast_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   220
qed "hyprel_in_hypreal";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   221
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   222
Goal "inj_on Abs_hypreal hypreal";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   223
by (rtac inj_on_inverseI 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   224
by (etac Abs_hypreal_inverse 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   225
qed "inj_on_Abs_hypreal";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   226
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   227
Addsimps [equiv_hyprel_iff,inj_on_Abs_hypreal RS inj_on_iff,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   228
          hyprel_iff, hyprel_in_hypreal, Abs_hypreal_inverse];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   229
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   230
Addsimps [equiv_hyprel RS eq_equiv_class_iff];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   231
val eq_hyprelD = equiv_hyprel RSN (2,eq_equiv_class);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   232
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   233
Goal "inj(Rep_hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   234
by (rtac inj_inverseI 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   235
by (rtac Rep_hypreal_inverse 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   236
qed "inj_Rep_hypreal";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   237
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   238
Goalw [hyprel_def] "x: hyprel ^^ {x}";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   239
by (Step_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   240
by (auto_tac (claset() addSIs [FreeUltrafilterNat_Nat_set],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   241
qed "lemma_hyprel_refl";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   242
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   243
Addsimps [lemma_hyprel_refl];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   244
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   245
Goalw [hypreal_def] "{} ~: hypreal";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   246
by (auto_tac (claset() addSEs [quotientE], simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   247
qed "hypreal_empty_not_mem";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   248
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   249
Addsimps [hypreal_empty_not_mem];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   250
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   251
Goal "Rep_hypreal x ~= {}";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   252
by (cut_inst_tac [("x","x")] Rep_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   253
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   254
qed "Rep_hypreal_nonempty";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   255
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   256
Addsimps [Rep_hypreal_nonempty];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   257
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   258
(*------------------------------------------------------------------------
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   259
   hypreal_of_real: the injection from real to hypreal
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   260
 ------------------------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   261
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   262
Goal "inj(hypreal_of_real)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   263
by (rtac injI 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   264
by (rewtac hypreal_of_real_def);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   265
by (dtac (inj_on_Abs_hypreal RS inj_onD) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   266
by (REPEAT (rtac hyprel_in_hypreal 1));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   267
by (dtac eq_equiv_class 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   268
by (rtac equiv_hyprel 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   269
by (Fast_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   270
by (rtac ccontr 1 THEN rotate_tac 1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   271
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   272
qed "inj_hypreal_of_real";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   273
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   274
val [prem] = goal thy
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   275
    "(!!x y. z = Abs_hypreal(hyprel^^{x}) ==> P) ==> P";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   276
by (res_inst_tac [("x1","z")] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   277
    (rewrite_rule [hypreal_def] Rep_hypreal RS quotientE) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   278
by (dres_inst_tac [("f","Abs_hypreal")] arg_cong 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   279
by (res_inst_tac [("x","x")] prem 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   280
by (asm_full_simp_tac (simpset() addsimps [Rep_hypreal_inverse]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   281
qed "eq_Abs_hypreal";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   282
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   283
(**** hypreal_minus: additive inverse on hypreal ****)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   284
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   285
Goalw [congruent_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   286
  "congruent hyprel (%X. hyprel^^{%n. - (X n)})";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   287
by Safe_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   288
by (ALLGOALS Ultra_tac);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   289
qed "hypreal_minus_congruent";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   290
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   291
(*Resolve th against the corresponding facts for hypreal_minus*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   292
val hypreal_minus_ize = RSLIST [equiv_hyprel, hypreal_minus_congruent];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   293
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   294
Goalw [hypreal_minus_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   295
      "- (Abs_hypreal(hyprel^^{%n. X n})) = Abs_hypreal(hyprel ^^ {%n. -(X n)})";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   296
by (res_inst_tac [("f","Abs_hypreal")] arg_cong 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   297
by (simp_tac (simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   298
   [hyprel_in_hypreal RS Abs_hypreal_inverse,hypreal_minus_ize UN_equiv_class]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   299
qed "hypreal_minus";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   300
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   301
Goal "- (- z) = (z::hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   302
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   303
by (asm_simp_tac (simpset() addsimps [hypreal_minus]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   304
qed "hypreal_minus_minus";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   305
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   306
Addsimps [hypreal_minus_minus];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   307
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   308
Goal "inj(%r::hypreal. -r)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   309
by (rtac injI 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   310
by (dres_inst_tac [("f","uminus")] arg_cong 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   311
by (asm_full_simp_tac (simpset() addsimps [hypreal_minus_minus]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   312
qed "inj_hypreal_minus";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   313
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   314
Goalw [hypreal_zero_def] "-0hr = 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   315
by (simp_tac (simpset() addsimps [hypreal_minus]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   316
qed "hypreal_minus_zero";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   317
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   318
Addsimps [hypreal_minus_zero];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   319
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   320
Goal "(-x = 0hr) = (x = 0hr)"; 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   321
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   322
by (auto_tac (claset(),simpset() addsimps [hypreal_zero_def,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   323
    hypreal_minus] @ real_add_ac));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   324
qed "hypreal_minus_zero_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   325
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   326
Addsimps [hypreal_minus_zero_iff];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   327
(**** hrinv: multiplicative inverse on hypreal ****)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   328
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   329
Goalw [congruent_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   330
  "congruent hyprel (%X. hyprel^^{%n. if X n = 0r then 0r else rinv(X n)})";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   331
by (Auto_tac THEN Ultra_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   332
qed "hypreal_hrinv_congruent";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   333
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   334
(* Resolve th against the corresponding facts for hrinv *)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   335
val hypreal_hrinv_ize = RSLIST [equiv_hyprel, hypreal_hrinv_congruent];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   336
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   337
Goalw [hrinv_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   338
      "hrinv (Abs_hypreal(hyprel^^{%n. X n})) = \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   339
\      Abs_hypreal(hyprel ^^ {%n. if X n = 0r then 0r else rinv(X n)})";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   340
by (res_inst_tac [("f","Abs_hypreal")] arg_cong 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   341
by (simp_tac (simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   342
   [hyprel_in_hypreal RS Abs_hypreal_inverse,hypreal_hrinv_ize UN_equiv_class]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   343
qed "hypreal_hrinv";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   344
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   345
Goal "z ~= 0hr ==> hrinv (hrinv z) = z";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   346
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   347
by (rotate_tac 1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   348
by (asm_full_simp_tac (simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   349
    [hypreal_hrinv,hypreal_zero_def] setloop (split_tac [expand_if])) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   350
by (ultra_tac (claset() addDs [rinv_not_zero,real_rinv_rinv],simpset()) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   351
qed "hypreal_hrinv_hrinv";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   352
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   353
Addsimps [hypreal_hrinv_hrinv];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   354
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   355
Goalw [hypreal_one_def] "hrinv(1hr) = 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   356
by (full_simp_tac (simpset() addsimps [hypreal_hrinv,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   357
       real_zero_not_eq_one RS not_sym] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   358
                   setloop (split_tac [expand_if])) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   359
qed "hypreal_hrinv_1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   360
Addsimps [hypreal_hrinv_1];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   361
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   362
(**** hyperreal addition: hypreal_add  ****)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   363
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   364
Goalw [congruent2_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   365
    "congruent2 hyprel (%X Y. hyprel^^{%n. X n + Y n})";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   366
by Safe_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   367
by (ALLGOALS(Ultra_tac));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   368
qed "hypreal_add_congruent2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   369
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   370
(*Resolve th against the corresponding facts for hyppreal_add*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   371
val hypreal_add_ize = RSLIST [equiv_hyprel, hypreal_add_congruent2];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   372
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   373
Goalw [hypreal_add_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   374
  "Abs_hypreal(hyprel^^{%n. X n}) + Abs_hypreal(hyprel^^{%n. Y n}) = \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   375
\  Abs_hypreal(hyprel^^{%n. X n + Y n})";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   376
by (asm_simp_tac
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   377
    (simpset() addsimps [hypreal_add_ize UN_equiv_class2]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   378
qed "hypreal_add";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   379
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   380
Goal "(z::hypreal) + w = w + z";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   381
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   382
by (res_inst_tac [("z","w")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   383
by (asm_simp_tac (simpset() addsimps (real_add_ac @ [hypreal_add])) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   384
qed "hypreal_add_commute";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   385
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   386
Goal "((z1::hypreal) + z2) + z3 = z1 + (z2 + z3)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   387
by (res_inst_tac [("z","z1")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   388
by (res_inst_tac [("z","z2")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   389
by (res_inst_tac [("z","z3")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   390
by (asm_simp_tac (simpset() addsimps [hypreal_add, real_add_assoc]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   391
qed "hypreal_add_assoc";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   392
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   393
(*For AC rewriting*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   394
Goal "(x::hypreal)+(y+z)=y+(x+z)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   395
by (rtac (hypreal_add_commute RS trans) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   396
by (rtac (hypreal_add_assoc RS trans) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   397
by (rtac (hypreal_add_commute RS arg_cong) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   398
qed "hypreal_add_left_commute";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   399
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   400
(* hypreal addition is an AC operator *)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   401
val hypreal_add_ac = [hypreal_add_assoc,hypreal_add_commute,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   402
                      hypreal_add_left_commute];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   403
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   404
Goalw [hypreal_zero_def] "0hr + z = z";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   405
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   406
by (asm_full_simp_tac (simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   407
    [hypreal_add]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   408
qed "hypreal_add_zero_left";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   409
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   410
Goal "z + 0hr = z";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   411
by (simp_tac (simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   412
    [hypreal_add_zero_left,hypreal_add_commute]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   413
qed "hypreal_add_zero_right";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   414
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   415
Goalw [hypreal_zero_def] "z + -z = 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   416
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   417
by (asm_full_simp_tac (simpset() addsimps [hypreal_minus,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   418
        hypreal_add]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   419
qed "hypreal_add_minus";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   420
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   421
Goal "-z + z = 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   422
by (simp_tac (simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   423
    [hypreal_add_commute,hypreal_add_minus]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   424
qed "hypreal_add_minus_left";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   425
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   426
Addsimps [hypreal_add_minus,hypreal_add_minus_left,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   427
          hypreal_add_zero_left,hypreal_add_zero_right];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   428
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   429
Goal "? y. (x::hypreal) + y = 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   430
by (fast_tac (claset() addIs [hypreal_add_minus]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   431
qed "hypreal_minus_ex";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   432
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   433
Goal "?! y. (x::hypreal) + y = 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   434
by (auto_tac (claset() addIs [hypreal_add_minus],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   435
by (dres_inst_tac [("f","%x. ya+x")] arg_cong 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   436
by (asm_full_simp_tac (simpset() addsimps [hypreal_add_assoc RS sym]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   437
by (asm_full_simp_tac (simpset() addsimps [hypreal_add_commute]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   438
qed "hypreal_minus_ex1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   439
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   440
Goal "?! y. y + (x::hypreal) = 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   441
by (auto_tac (claset() addIs [hypreal_add_minus_left],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   442
by (dres_inst_tac [("f","%x. x+ya")] arg_cong 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   443
by (asm_full_simp_tac (simpset() addsimps [hypreal_add_assoc]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   444
by (asm_full_simp_tac (simpset() addsimps [hypreal_add_commute]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   445
qed "hypreal_minus_left_ex1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   446
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   447
Goal "x + y = 0hr ==> x = -y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   448
by (cut_inst_tac [("z","y")] hypreal_add_minus_left 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   449
by (res_inst_tac [("x1","y")] (hypreal_minus_left_ex1 RS ex1E) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   450
by (Blast_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   451
qed "hypreal_add_minus_eq_minus";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   452
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   453
Goal "? y::hypreal. x = -y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   454
by (cut_inst_tac [("x","x")] hypreal_minus_ex 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   455
by (etac exE 1 THEN dtac hypreal_add_minus_eq_minus 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   456
by (Fast_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   457
qed "hypreal_as_add_inverse_ex";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   458
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   459
Goal "-(x + (y::hypreal)) = -x + -y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   460
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   461
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   462
by (auto_tac (claset(),simpset() addsimps [hypreal_minus,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   463
    hypreal_add,real_minus_add_distrib]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   464
qed "hypreal_minus_add_distrib";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   465
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   466
Goal "-(y + -(x::hypreal)) = x + -y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   467
by (simp_tac (simpset() addsimps [hypreal_minus_add_distrib,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   468
    hypreal_add_commute]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   469
qed "hypreal_minus_distrib1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   470
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   471
Goal "(x + - (y::hypreal)) + (y + - z) = x + -z";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   472
by (res_inst_tac [("w1","y")] (hypreal_add_commute RS subst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   473
by (simp_tac (simpset() addsimps [hypreal_add_left_commute,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   474
    hypreal_add_assoc]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   475
by (simp_tac (simpset() addsimps [hypreal_add_commute]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   476
qed "hypreal_add_minus_cancel1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   477
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   478
Goal "((x::hypreal) + y = x + z) = (y = z)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   479
by (Step_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   480
by (dres_inst_tac [("f","%t.-x + t")] arg_cong 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   481
by (asm_full_simp_tac (simpset() addsimps [hypreal_add_assoc RS sym]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   482
qed "hypreal_add_left_cancel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   483
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   484
Goal "z + (x + (y + -z)) = x + (y::hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   485
by (simp_tac (simpset() addsimps hypreal_add_ac) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   486
qed "hypreal_add_minus_cancel2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   487
Addsimps [hypreal_add_minus_cancel2];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   488
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   489
Goal "y + -(x + y) = -(x::hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   490
by (full_simp_tac (simpset() addsimps [hypreal_minus_add_distrib]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   491
by (rtac (hypreal_add_left_commute RS subst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   492
by (Full_simp_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   493
qed "hypreal_add_minus_cancel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   494
Addsimps [hypreal_add_minus_cancel];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   495
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   496
Goal "y + -(y + x) = -(x::hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   497
by (simp_tac (simpset() addsimps [hypreal_minus_add_distrib,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   498
              hypreal_add_assoc RS sym]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   499
qed "hypreal_add_minus_cancelc";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   500
Addsimps [hypreal_add_minus_cancelc];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   501
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   502
Goal "(z + -x) + (y + -z) = (y + -(x::hypreal))";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   503
by (full_simp_tac (simpset() addsimps [hypreal_minus_add_distrib
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   504
    RS sym, hypreal_add_left_cancel] @ hypreal_add_ac) 1); 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   505
qed "hypreal_add_minus_cancel3";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   506
Addsimps [hypreal_add_minus_cancel3];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   507
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   508
Goal "(y + (x::hypreal)= z + x) = (y = z)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   509
by (simp_tac (simpset() addsimps [hypreal_add_commute,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   510
    hypreal_add_left_cancel]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   511
qed "hypreal_add_right_cancel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   512
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   513
Goal "z + (y + -z) = (y::hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   514
by (simp_tac (simpset() addsimps hypreal_add_ac) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   515
qed "hypreal_add_minus_cancel4";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   516
Addsimps [hypreal_add_minus_cancel4];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   517
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   518
Goal "z + (w + (x + (-z + y))) = w + x + (y::hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   519
by (simp_tac (simpset() addsimps hypreal_add_ac) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   520
qed "hypreal_add_minus_cancel5";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   521
Addsimps [hypreal_add_minus_cancel5];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   522
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   523
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   524
(**** hyperreal multiplication: hypreal_mult  ****)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   525
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   526
Goalw [congruent2_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   527
    "congruent2 hyprel (%X Y. hyprel^^{%n. X n * Y n})";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   528
by Safe_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   529
by (ALLGOALS(Ultra_tac));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   530
qed "hypreal_mult_congruent2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   531
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   532
(*Resolve th against the corresponding facts for hypreal_mult*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   533
val hypreal_mult_ize = RSLIST [equiv_hyprel, hypreal_mult_congruent2];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   534
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   535
Goalw [hypreal_mult_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   536
  "Abs_hypreal(hyprel^^{%n. X n}) * Abs_hypreal(hyprel^^{%n. Y n}) = \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   537
\  Abs_hypreal(hyprel^^{%n. X n * Y n})";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   538
by (asm_simp_tac
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   539
    (simpset() addsimps [hypreal_mult_ize UN_equiv_class2]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   540
qed "hypreal_mult";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   541
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   542
Goal "(z::hypreal) * w = w * z";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   543
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   544
by (res_inst_tac [("z","w")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   545
by (asm_simp_tac (simpset() addsimps ([hypreal_mult] @ real_mult_ac)) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   546
qed "hypreal_mult_commute";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   547
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   548
Goal "((z1::hypreal) * z2) * z3 = z1 * (z2 * z3)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   549
by (res_inst_tac [("z","z1")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   550
by (res_inst_tac [("z","z2")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   551
by (res_inst_tac [("z","z3")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   552
by (asm_simp_tac (simpset() addsimps [hypreal_mult,real_mult_assoc]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   553
qed "hypreal_mult_assoc";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   554
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   555
qed_goal "hypreal_mult_left_commute" thy
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   556
    "(z1::hypreal) * (z2 * z3) = z2 * (z1 * z3)"
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   557
 (fn _ => [rtac (hypreal_mult_commute RS trans) 1, rtac (hypreal_mult_assoc RS trans) 1,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   558
           rtac (hypreal_mult_commute RS arg_cong) 1]);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   559
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   560
(* hypreal multiplication is an AC operator *)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   561
val hypreal_mult_ac = [hypreal_mult_assoc, hypreal_mult_commute, 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   562
                       hypreal_mult_left_commute];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   563
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   564
Goalw [hypreal_one_def] "1hr * z = z";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   565
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   566
by (asm_full_simp_tac (simpset() addsimps [hypreal_mult]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   567
qed "hypreal_mult_1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   568
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   569
Goal "z * 1hr = z";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   570
by (simp_tac (simpset() addsimps [hypreal_mult_commute,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   571
    hypreal_mult_1]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   572
qed "hypreal_mult_1_right";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   573
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   574
Goalw [hypreal_zero_def] "0hr * z = 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   575
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   576
by (asm_full_simp_tac (simpset() addsimps [hypreal_mult,real_mult_0]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   577
qed "hypreal_mult_0";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   578
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   579
Goal "z * 0hr = 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   580
by (simp_tac (simpset() addsimps [hypreal_mult_commute,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   581
    hypreal_mult_0]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   582
qed "hypreal_mult_0_right";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   583
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   584
Addsimps [hypreal_mult_0,hypreal_mult_0_right];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   585
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   586
Goal "-(x * y) = -x * (y::hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   587
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   588
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   589
by (auto_tac (claset(),simpset() addsimps [hypreal_minus,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   590
    hypreal_mult,real_minus_mult_eq1] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   591
      @ real_mult_ac @ real_add_ac));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   592
qed "hypreal_minus_mult_eq1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   593
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   594
Goal "-(x * y) = (x::hypreal) * -y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   595
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   596
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   597
by (auto_tac (claset(),simpset() addsimps [hypreal_minus,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   598
   hypreal_mult,real_minus_mult_eq2] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   599
    @ real_mult_ac @ real_add_ac));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   600
qed "hypreal_minus_mult_eq2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   601
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   602
Goal "-x*-y = x*(y::hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   603
by (full_simp_tac (simpset() addsimps [hypreal_minus_mult_eq2 RS sym,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   604
    hypreal_minus_mult_eq1 RS sym]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   605
qed "hypreal_minus_mult_cancel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   606
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   607
Addsimps [hypreal_minus_mult_cancel];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   608
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   609
Goal "-x*y = (x::hypreal)*-y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   610
by (full_simp_tac (simpset() addsimps [hypreal_minus_mult_eq2 RS sym,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   611
    hypreal_minus_mult_eq1 RS sym]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   612
qed "hypreal_minus_mult_commute";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   613
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   614
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   615
(*-----------------------------------------------------------------------------
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   616
    A few more theorems
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   617
 ----------------------------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   618
Goal "(z::hypreal) + v = z' + v' ==> z + (v + w) = z' + (v' + w)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   619
by (asm_simp_tac (simpset() addsimps [hypreal_add_assoc RS sym]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   620
qed "hypreal_add_assoc_cong";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   621
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   622
Goal "(z::hypreal) + (v + w) = v + (z + w)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   623
by (REPEAT (ares_tac [hypreal_add_commute RS hypreal_add_assoc_cong] 1));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   624
qed "hypreal_add_assoc_swap";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   625
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   626
Goal "((z1::hypreal) + z2) * w = (z1 * w) + (z2 * w)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   627
by (res_inst_tac [("z","z1")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   628
by (res_inst_tac [("z","z2")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   629
by (res_inst_tac [("z","w")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   630
by (asm_simp_tac (simpset() addsimps [hypreal_mult,hypreal_add,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   631
     real_add_mult_distrib]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   632
qed "hypreal_add_mult_distrib";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   633
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   634
val hypreal_mult_commute'= read_instantiate [("z","w")] hypreal_mult_commute;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   635
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   636
Goal "(w::hypreal) * (z1 + z2) = (w * z1) + (w * z2)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   637
by (simp_tac (simpset() addsimps [hypreal_mult_commute',hypreal_add_mult_distrib]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   638
qed "hypreal_add_mult_distrib2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   639
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   640
val hypreal_mult_simps = [hypreal_mult_1, hypreal_mult_1_right];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   641
Addsimps hypreal_mult_simps;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   642
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   643
(*** one and zero are distinct ***)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   644
Goalw [hypreal_zero_def,hypreal_one_def] "0hr ~= 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   645
by (auto_tac (claset(),simpset() addsimps [real_zero_not_eq_one]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   646
qed "hypreal_zero_not_eq_one";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   647
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   648
(*** existence of inverse ***)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   649
Goalw [hypreal_one_def,hypreal_zero_def] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   650
          "x ~= 0hr ==> x*hrinv(x) = 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   651
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   652
by (rotate_tac 1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   653
by (asm_full_simp_tac (simpset() addsimps [hypreal_hrinv,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   654
    hypreal_mult] setloop (split_tac [expand_if])) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   655
by (dtac FreeUltrafilterNat_Compl_mem 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   656
by (blast_tac (claset() addSIs [real_mult_inv_right,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   657
    FreeUltrafilterNat_subset]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   658
qed "hypreal_mult_hrinv";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   659
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   660
Goal "x ~= 0hr ==> hrinv(x)*x = 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   661
by (asm_simp_tac (simpset() addsimps [hypreal_mult_hrinv,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   662
    hypreal_mult_commute]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   663
qed "hypreal_mult_hrinv_left";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   664
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   665
Goal "x ~= 0hr ==> ? y. (x::hypreal) * y = 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   666
by (fast_tac (claset() addDs [hypreal_mult_hrinv]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   667
qed "hypreal_hrinv_ex";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   668
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   669
Goal "x ~= 0hr ==> ? y. y * (x::hypreal) = 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   670
by (fast_tac (claset() addDs [hypreal_mult_hrinv_left]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   671
qed "hypreal_hrinv_left_ex";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   672
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   673
Goal "x ~= 0hr ==> ?! y. (x::hypreal) * y = 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   674
by (auto_tac (claset() addIs [hypreal_mult_hrinv],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   675
by (dres_inst_tac [("f","%x. ya*x")] arg_cong 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   676
by (asm_full_simp_tac (simpset() addsimps [hypreal_mult_assoc RS sym]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   677
by (asm_full_simp_tac (simpset() addsimps [hypreal_mult_commute]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   678
qed "hypreal_hrinv_ex1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   679
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   680
Goal "x ~= 0hr ==> ?! y. y * (x::hypreal) = 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   681
by (auto_tac (claset() addIs [hypreal_mult_hrinv_left],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   682
by (dres_inst_tac [("f","%x. x*ya")] arg_cong 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   683
by (asm_full_simp_tac (simpset() addsimps [hypreal_mult_assoc]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   684
by (asm_full_simp_tac (simpset() addsimps [hypreal_mult_commute]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   685
qed "hypreal_hrinv_left_ex1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   686
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   687
Goal "[| y~= 0hr; x * y = 1hr |]  ==> x = hrinv y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   688
by (forw_inst_tac [("x","y")] hypreal_mult_hrinv_left 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   689
by (res_inst_tac [("x1","y")] (hypreal_hrinv_left_ex1 RS ex1E) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   690
by (assume_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   691
by (Blast_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   692
qed "hypreal_mult_inv_hrinv";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   693
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   694
Goal "x ~= 0hr ==> ? y. x = hrinv y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   695
by (forw_inst_tac [("x","x")] hypreal_hrinv_left_ex 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   696
by (etac exE 1 THEN 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   697
    forw_inst_tac [("x","y")] hypreal_mult_inv_hrinv 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   698
by (res_inst_tac [("x","y")] exI 2);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   699
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   700
qed "hypreal_as_inverse_ex";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   701
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   702
Goal "(c::hypreal) ~= 0hr ==> (c*a=c*b) = (a=b)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   703
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   704
by (dres_inst_tac [("f","%x. x*hrinv c")] arg_cong 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   705
by (asm_full_simp_tac (simpset() addsimps [hypreal_mult_hrinv] @ hypreal_mult_ac)  1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   706
qed "hypreal_mult_left_cancel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   707
    
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   708
Goal "(c::hypreal) ~= 0hr ==> (a*c=b*c) = (a=b)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   709
by (Step_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   710
by (dres_inst_tac [("f","%x. x*hrinv c")] arg_cong 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   711
by (asm_full_simp_tac (simpset() addsimps [hypreal_mult_hrinv] @ hypreal_mult_ac)  1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   712
qed "hypreal_mult_right_cancel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   713
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   714
Goalw [hypreal_zero_def] "x ~= 0hr ==> hrinv(x) ~= 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   715
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   716
by (rotate_tac 1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   717
by (asm_full_simp_tac (simpset() addsimps [hypreal_hrinv,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   718
    hypreal_mult] setloop (split_tac [expand_if])) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   719
by (dtac FreeUltrafilterNat_Compl_mem 1 THEN Clarify_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   720
by (ultra_tac (claset() addIs [ccontr] addDs 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   721
    [rinv_not_zero],simpset()) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   722
qed "hrinv_not_zero";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   723
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   724
Addsimps [hypreal_mult_hrinv,hypreal_mult_hrinv_left];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   725
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   726
Goal "[| x ~= 0hr; y ~= 0hr |] ==> x * y ~= 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   727
by (Step_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   728
by (dres_inst_tac [("f","%z. hrinv x*z")] arg_cong 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   729
by (asm_full_simp_tac (simpset() addsimps [hypreal_mult_assoc RS sym]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   730
qed "hypreal_mult_not_0";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   731
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   732
bind_thm ("hypreal_mult_not_0E",hypreal_mult_not_0 RS notE);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   733
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   734
Goal "x ~= 0hr ==> x * x ~= 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   735
by (blast_tac (claset() addDs [hypreal_mult_not_0]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   736
qed "hypreal_mult_self_not_zero";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   737
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   738
Goal "[| x ~= 0hr; y ~= 0hr |] ==> hrinv(x*y) = hrinv(x)*hrinv(y)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   739
by (res_inst_tac [("c1","x")] (hypreal_mult_left_cancel RS iffD1) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   740
by (auto_tac (claset(),simpset() addsimps [hypreal_mult_assoc RS sym,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   741
    hypreal_mult_not_0]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   742
by (res_inst_tac [("c1","y")] (hypreal_mult_right_cancel RS iffD1) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   743
by (auto_tac (claset(),simpset() addsimps [hypreal_mult_not_0] @ hypreal_mult_ac));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   744
by (auto_tac (claset(),simpset() addsimps [hypreal_mult_assoc RS sym,hypreal_mult_not_0]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   745
qed "hrinv_mult_eq";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   746
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   747
Goal "x ~= 0hr ==> hrinv(-x) = -hrinv(x)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   748
by (res_inst_tac [("c1","-x")] (hypreal_mult_right_cancel RS iffD1) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   749
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   750
qed "hypreal_minus_hrinv";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   751
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   752
Goal "[| x ~= 0hr; y ~= 0hr |] \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   753
\     ==> hrinv(x*y) = hrinv(x)*hrinv(y)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   754
by (forw_inst_tac [("y","y")] hypreal_mult_not_0 1 THEN assume_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   755
by (res_inst_tac [("c1","x")] (hypreal_mult_left_cancel RS iffD1) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   756
by (auto_tac (claset(),simpset() addsimps [hypreal_mult_assoc RS sym]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   757
by (res_inst_tac [("c1","y")] (hypreal_mult_left_cancel RS iffD1) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   758
by (auto_tac (claset(),simpset() addsimps [hypreal_mult_left_commute]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   759
by (asm_simp_tac (simpset() addsimps [hypreal_mult_assoc RS sym]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   760
qed "hypreal_hrinv_distrib";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   761
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   762
(*------------------------------------------------------------------
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   763
                   Theorems for ordering 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   764
 ------------------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   765
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   766
(* prove introduction and elimination rules for hypreal_less *)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   767
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   768
Goalw [hypreal_less_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   769
 "P < (Q::hypreal) = (EX X Y. X : Rep_hypreal(P) & \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   770
\                             Y : Rep_hypreal(Q) & \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   771
\                             {n. X n < Y n} : FreeUltrafilterNat)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   772
by (Fast_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   773
qed "hypreal_less_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   774
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   775
Goalw [hypreal_less_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   776
 "[| {n. X n < Y n} : FreeUltrafilterNat; \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   777
\         X : Rep_hypreal(P); \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   778
\         Y : Rep_hypreal(Q) |] ==> P < (Q::hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   779
by (Fast_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   780
qed "hypreal_lessI";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   781
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   782
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   783
Goalw [hypreal_less_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   784
     "!! R1. [| R1 < (R2::hypreal); \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   785
\         !!X Y. {n. X n < Y n} : FreeUltrafilterNat ==> P; \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   786
\         !!X. X : Rep_hypreal(R1) ==> P; \ 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   787
\         !!Y. Y : Rep_hypreal(R2) ==> P |] \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   788
\     ==> P";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   789
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   790
qed "hypreal_lessE";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   791
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   792
Goalw [hypreal_less_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   793
 "R1 < (R2::hypreal) ==> (EX X Y. {n. X n < Y n} : FreeUltrafilterNat & \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   794
\                                  X : Rep_hypreal(R1) & \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   795
\                                  Y : Rep_hypreal(R2))";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   796
by (Fast_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   797
qed "hypreal_lessD";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   798
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   799
Goal "~ (R::hypreal) < R";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   800
by (res_inst_tac [("z","R")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   801
by (auto_tac (claset(),simpset() addsimps [hypreal_less_def]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   802
by (Ultra_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   803
qed "hypreal_less_not_refl";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   804
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   805
(*** y < y ==> P ***)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   806
bind_thm("hypreal_less_irrefl",hypreal_less_not_refl RS notE);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   807
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   808
Goal "!!(x::hypreal). x < y ==> x ~= y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   809
by (auto_tac (claset(),simpset() addsimps [hypreal_less_not_refl]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   810
qed "hypreal_not_refl2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   811
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   812
Goal "!!(R1::hypreal). [| R1 < R2; R2 < R3 |] ==> R1 < R3";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   813
by (res_inst_tac [("z","R1")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   814
by (res_inst_tac [("z","R2")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   815
by (res_inst_tac [("z","R3")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   816
by (auto_tac (claset() addSIs [exI],simpset() 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   817
     addsimps [hypreal_less_def]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   818
by (ultra_tac (claset() addIs [real_less_trans],simpset()) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   819
qed "hypreal_less_trans";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   820
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   821
Goal "!! (R1::hypreal). [| R1 < R2; R2 < R1 |] ==> P";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   822
by (dtac hypreal_less_trans 1 THEN assume_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   823
by (asm_full_simp_tac (simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   824
    [hypreal_less_not_refl]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   825
qed "hypreal_less_asym";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   826
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   827
(*--------------------------------------------------------
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   828
  TODO: The following theorem should have been proved 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   829
  first and then used througout the proofs as it probably 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   830
  makes many of them more straightforward. 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   831
 -------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   832
Goalw [hypreal_less_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   833
      "(Abs_hypreal(hyprel^^{%n. X n}) < \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   834
\           Abs_hypreal(hyprel^^{%n. Y n})) = \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   835
\      ({n. X n < Y n} : FreeUltrafilterNat)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   836
by (auto_tac (claset() addSIs [lemma_hyprel_refl],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   837
by (Ultra_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   838
qed "hypreal_less";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   839
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   840
(*---------------------------------------------------------------------------------
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   841
             Hyperreals as a linearly ordered field
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   842
 ---------------------------------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   843
(*** sum order ***)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   844
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   845
Goalw [hypreal_zero_def] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   846
      "[| 0hr < x; 0hr < y |] ==> 0hr < x + y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   847
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   848
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   849
by (auto_tac (claset(),simpset() addsimps
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   850
    [hypreal_less_def,hypreal_add]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   851
by (auto_tac (claset() addSIs [exI],simpset() addsimps
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   852
    [hypreal_less_def,hypreal_add]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   853
by (ultra_tac (claset() addIs [real_add_order],simpset()) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   854
qed "hypreal_add_order";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   855
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   856
(*** mult order ***)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   857
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   858
Goalw [hypreal_zero_def] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   859
          "[| 0hr < x; 0hr < y |] ==> 0hr < x * y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   860
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   861
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   862
by (auto_tac (claset() addSIs [exI],simpset() addsimps
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   863
    [hypreal_less_def,hypreal_mult]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   864
by (ultra_tac (claset() addIs [real_mult_order],simpset()) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   865
qed "hypreal_mult_order";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   866
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   867
(*---------------------------------------------------------------------------------
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   868
                         Trichotomy of the hyperreals
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   869
  --------------------------------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   870
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   871
Goalw [hyprel_def] "? x. x: hyprel ^^ {%n. 0r}";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   872
by (res_inst_tac [("x","%n. 0r")] exI 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   873
by (Step_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   874
by (auto_tac (claset() addSIs [FreeUltrafilterNat_Nat_set],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   875
qed "lemma_hyprel_0r_mem";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   876
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   877
Goalw [hypreal_zero_def]"0hr <  x | x = 0hr | x < 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   878
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   879
by (auto_tac (claset(),simpset() addsimps [hypreal_less_def]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   880
by (cut_facts_tac [lemma_hyprel_0r_mem] 1 THEN etac exE 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   881
by (dres_inst_tac [("x","xa")] spec 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   882
by (dres_inst_tac [("x","x")] spec 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   883
by (cut_inst_tac [("x","x")] lemma_hyprel_refl 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   884
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   885
by (dres_inst_tac [("x","x")] spec 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   886
by (dres_inst_tac [("x","xa")] spec 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   887
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   888
by (Ultra_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   889
by (auto_tac (claset() addIs [real_linear_less2],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   890
qed "hypreal_trichotomy";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   891
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   892
val prems = Goal "[| 0hr < x ==> P; \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   893
\                 x = 0hr ==> P; \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   894
\                 x < 0hr ==> P |] ==> P";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   895
by (cut_inst_tac [("x","x")] hypreal_trichotomy 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   896
by (REPEAT (eresolve_tac (disjE::prems) 1));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   897
qed "hypreal_trichotomyE";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   898
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   899
(*----------------------------------------------------------------------------
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   900
            More properties of <
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   901
 ----------------------------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   902
Goal "!!(A::hypreal). A < B ==> A + C < B + C";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   903
by (res_inst_tac [("z","A")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   904
by (res_inst_tac [("z","B")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   905
by (res_inst_tac [("z","C")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   906
by (auto_tac (claset() addSIs [exI],simpset() addsimps
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   907
    [hypreal_less_def,hypreal_add]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   908
by (Ultra_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   909
qed "hypreal_add_less_mono1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   910
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   911
Goal "!!(A::hypreal). A < B ==> C + A < C + B";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   912
by (auto_tac (claset() addIs [hypreal_add_less_mono1],
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   913
    simpset() addsimps [hypreal_add_commute]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   914
qed "hypreal_add_less_mono2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   915
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   916
Goal "((x::hypreal) < y) = (0hr < y + -x)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   917
by (Step_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   918
by (dres_inst_tac [("C","-x")] hypreal_add_less_mono1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   919
by (dres_inst_tac [("C","x")] hypreal_add_less_mono1 2);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   920
by (auto_tac (claset(),simpset() addsimps [hypreal_add_assoc]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   921
qed "hypreal_less_minus_iff"; 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   922
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   923
Goal "((x::hypreal) < y) = (x + -y< 0hr)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   924
by (Step_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   925
by (dres_inst_tac [("C","-y")] hypreal_add_less_mono1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   926
by (dres_inst_tac [("C","y")] hypreal_add_less_mono1 2);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   927
by (auto_tac (claset(),simpset() addsimps [hypreal_add_assoc]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   928
qed "hypreal_less_minus_iff2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   929
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   930
Goal  "!!(y1 :: hypreal). [| z1 < y1; z2 < y2 |] ==> z1 + z2 < y1 + y2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   931
by (dtac (hypreal_less_minus_iff RS iffD1) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   932
by (dtac (hypreal_less_minus_iff RS iffD1) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   933
by (dtac hypreal_add_order 1 THEN assume_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   934
by (thin_tac "0hr < y2 + - z2" 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   935
by (dres_inst_tac [("C","z1 + z2")] hypreal_add_less_mono1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   936
by (auto_tac (claset(),simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   937
    [hypreal_minus_add_distrib RS sym] @ hypreal_add_ac));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   938
qed "hypreal_add_less_mono";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   939
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   940
Goal "((x::hypreal) = y) = (0hr = x + - y)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   941
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   942
by (res_inst_tac [("x1","-y")] (hypreal_add_right_cancel RS iffD1) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   943
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   944
qed "hypreal_eq_minus_iff"; 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   945
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   946
Goal "((x::hypreal) = y) = (0hr = y + - x)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   947
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   948
by (res_inst_tac [("x1","-x")] (hypreal_add_right_cancel RS iffD1) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   949
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   950
qed "hypreal_eq_minus_iff2"; 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   951
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   952
Goal "(x = y + z) = (x + -z = (y::hypreal))";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   953
by (auto_tac (claset(),simpset() addsimps [hypreal_add_assoc]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   954
qed "hypreal_eq_minus_iff3";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   955
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   956
Goal "(x = z + y) = (x + -z = (y::hypreal))";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   957
by (auto_tac (claset(),simpset() addsimps hypreal_add_ac));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   958
qed "hypreal_eq_minus_iff4";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   959
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   960
Goal "(x ~= a) = (x + -a ~= 0hr)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   961
by (auto_tac (claset() addDs [sym RS 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   962
    (hypreal_eq_minus_iff RS iffD2)],simpset())); 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   963
qed "hypreal_not_eq_minus_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   964
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   965
(*** linearity ***)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   966
Goal "(x::hypreal) < y | x = y | y < x";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   967
by (rtac (hypreal_eq_minus_iff2 RS ssubst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   968
by (res_inst_tac [("x1","x")] (hypreal_less_minus_iff RS ssubst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   969
by (res_inst_tac [("x1","y")] (hypreal_less_minus_iff2 RS ssubst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   970
by (rtac hypreal_trichotomyE 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   971
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   972
qed "hypreal_linear";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   973
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   974
Goal "!!(x::hypreal). [| x < y ==> P;  x = y ==> P; \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   975
\          y < x ==> P |] ==> P";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   976
by (cut_inst_tac [("x","x"),("y","y")] hypreal_linear 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   977
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   978
qed "hypreal_linear_less2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   979
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   980
(*------------------------------------------------------------------------------
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   981
                            Properties of <=
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   982
 ------------------------------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   983
(*------ hypreal le iff reals le a.e ------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   984
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   985
Goalw [hypreal_le_def,real_le_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   986
      "(Abs_hypreal(hyprel^^{%n. X n}) <= \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   987
\           Abs_hypreal(hyprel^^{%n. Y n})) = \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   988
\      ({n. X n <= Y n} : FreeUltrafilterNat)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   989
by (auto_tac (claset(),simpset() addsimps [hypreal_less]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   990
by (ALLGOALS(Ultra_tac));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   991
qed "hypreal_le";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   992
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   993
(*---------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   994
(*---------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   995
Goalw [hypreal_le_def] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   996
     "~(w < z) ==> z <= (w::hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   997
by (assume_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   998
qed "hypreal_leI";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
   999
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1000
Goalw [hypreal_le_def] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1001
      "z<=w ==> ~(w<(z::hypreal))";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1002
by (assume_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1003
qed "hypreal_leD";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1004
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1005
val hypreal_leE = make_elim hypreal_leD;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1006
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1007
Goal "(~(w < z)) = (z <= (w::hypreal))";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1008
by (fast_tac (claset() addSIs [hypreal_leI,hypreal_leD]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1009
qed "hypreal_less_le_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1010
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1011
Goalw [hypreal_le_def] "~ z <= w ==> w<(z::hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1012
by (Fast_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1013
qed "not_hypreal_leE";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1014
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1015
Goalw [hypreal_le_def] "z < w ==> z <= (w::hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1016
by (fast_tac (claset() addEs [hypreal_less_asym]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1017
qed "hypreal_less_imp_le";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1018
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1019
Goalw [hypreal_le_def] "!!(x::hypreal). x <= y ==> x < y | x = y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1020
by (cut_facts_tac [hypreal_linear] 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1021
by (fast_tac (claset() addEs [hypreal_less_irrefl,hypreal_less_asym]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1022
qed "hypreal_le_imp_less_or_eq";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1023
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1024
Goalw [hypreal_le_def] "z<w | z=w ==> z <=(w::hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1025
by (cut_facts_tac [hypreal_linear] 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1026
by (fast_tac (claset() addEs [hypreal_less_irrefl,hypreal_less_asym]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1027
qed "hypreal_less_or_eq_imp_le";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1028
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1029
Goal "(x <= (y::hypreal)) = (x < y | x=y)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1030
by (REPEAT(ares_tac [iffI, hypreal_less_or_eq_imp_le, hypreal_le_imp_less_or_eq] 1));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1031
qed "hypreal_le_eq_less_or_eq";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1032
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1033
Goal "w <= (w::hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1034
by (simp_tac (simpset() addsimps [hypreal_le_eq_less_or_eq]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1035
qed "hypreal_le_refl";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1036
Addsimps [hypreal_le_refl];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1037
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1038
Goal "[| i <= j; j < k |] ==> i < (k::hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1039
by (dtac hypreal_le_imp_less_or_eq 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1040
by (fast_tac (claset() addIs [hypreal_less_trans]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1041
qed "hypreal_le_less_trans";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1042
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1043
Goal "!! (i::hypreal). [| i < j; j <= k |] ==> i < k";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1044
by (dtac hypreal_le_imp_less_or_eq 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1045
by (fast_tac (claset() addIs [hypreal_less_trans]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1046
qed "hypreal_less_le_trans";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1047
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1048
Goal "[| i <= j; j <= k |] ==> i <= (k::hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1049
by (EVERY1 [dtac hypreal_le_imp_less_or_eq, dtac hypreal_le_imp_less_or_eq,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1050
            rtac hypreal_less_or_eq_imp_le, fast_tac (claset() addIs [hypreal_less_trans])]);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1051
qed "hypreal_le_trans";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1052
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1053
Goal "[| z <= w; w <= z |] ==> z = (w::hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1054
by (EVERY1 [dtac hypreal_le_imp_less_or_eq, dtac hypreal_le_imp_less_or_eq,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1055
            fast_tac (claset() addEs [hypreal_less_irrefl,hypreal_less_asym])]);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1056
qed "hypreal_le_anti_sym";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1057
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1058
Goal "[| 0hr < x; 0hr <= y |] ==> 0hr < x + y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1059
by (auto_tac (claset() addDs [sym,hypreal_le_imp_less_or_eq]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1060
              addIs [hypreal_add_order],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1061
qed "hypreal_add_order_le";            
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1062
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1063
(*------------------------------------------------------------------------
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1064
 ------------------------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1065
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1066
Goal "[| ~ y < x; y ~= x |] ==> x < (y::hypreal)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1067
by (rtac not_hypreal_leE 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1068
by (fast_tac (claset() addDs [hypreal_le_imp_less_or_eq]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1069
qed "not_less_not_eq_hypreal_less";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1070
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1071
Goal "(0hr < -R) = (R < 0hr)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1072
by (Step_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1073
by (dres_inst_tac [("C","R")] hypreal_add_less_mono1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1074
by (dres_inst_tac [("C","-R")] hypreal_add_less_mono1 2);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1075
by (auto_tac (claset(),simpset() addsimps [hypreal_add_assoc]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1076
qed "hypreal_minus_zero_less_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1077
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1078
Goal "(-R < 0hr) = (0hr < R)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1079
by (Step_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1080
by (dres_inst_tac [("C","R")] hypreal_add_less_mono1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1081
by (dres_inst_tac [("C","-R")] hypreal_add_less_mono1 2);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1082
by (auto_tac (claset(),simpset() addsimps [hypreal_add_assoc]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1083
qed "hypreal_minus_zero_less_iff2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1084
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1085
Goal "((x::hypreal) < y) = (-y < -x)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1086
by (rtac (hypreal_less_minus_iff RS ssubst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1087
by (res_inst_tac [("x1","x")] (hypreal_less_minus_iff RS ssubst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1088
by (simp_tac (simpset() addsimps [hypreal_add_commute]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1089
qed "hypreal_less_swap_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1090
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1091
Goal "(0hr < x) = (-x < x)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1092
by (Step_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1093
by (rtac ccontr 2 THEN forward_tac 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1094
    [hypreal_leI RS hypreal_le_imp_less_or_eq] 2);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1095
by (Step_tac 2);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1096
by (dtac (hypreal_minus_zero_less_iff RS iffD2) 2);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1097
by (dres_inst_tac [("R2.0","-x")] hypreal_less_trans 2);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1098
by (Auto_tac );
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1099
by (forward_tac [hypreal_add_order] 1 THEN assume_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1100
by (dres_inst_tac [("C","-x"),("B","x + x")] hypreal_add_less_mono1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1101
by (auto_tac (claset(),simpset() addsimps [hypreal_add_assoc]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1102
qed "hypreal_gt_zero_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1103
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1104
Goal "(x < 0hr) = (x < -x)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1105
by (rtac (hypreal_minus_zero_less_iff RS subst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1106
by (rtac (hypreal_gt_zero_iff RS ssubst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1107
by (Full_simp_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1108
qed "hypreal_lt_zero_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1109
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1110
Goalw [hypreal_le_def] "(0hr <= x) = (-x <= x)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1111
by (auto_tac (claset(),simpset() addsimps [hypreal_lt_zero_iff RS sym]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1112
qed "hypreal_ge_zero_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1113
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1114
Goalw [hypreal_le_def] "(x <= 0hr) = (x <= -x)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1115
by (auto_tac (claset(),simpset() addsimps [hypreal_gt_zero_iff RS sym]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1116
qed "hypreal_le_zero_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1117
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1118
Goal "[| x < 0hr; y < 0hr |] ==> 0hr < x * y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1119
by (REPEAT(dtac (hypreal_minus_zero_less_iff RS iffD2) 1));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1120
by (dtac hypreal_mult_order 1 THEN assume_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1121
by (Asm_full_simp_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1122
qed "hypreal_mult_less_zero1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1123
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1124
Goal "[| 0hr <= x; 0hr <= y |] ==> 0hr <= x * y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1125
by (REPEAT(dtac hypreal_le_imp_less_or_eq 1));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1126
by (auto_tac (claset() addIs [hypreal_mult_order,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1127
    hypreal_less_imp_le],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1128
qed "hypreal_le_mult_order";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1129
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1130
Goal "[| x <= 0hr; y <= 0hr |] ==> 0hr <= x * y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1131
by (rtac hypreal_less_or_eq_imp_le 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1132
by (dtac hypreal_le_imp_less_or_eq 1 THEN etac disjE 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1133
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1134
by (dtac hypreal_le_imp_less_or_eq 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1135
by (auto_tac (claset() addDs [hypreal_mult_less_zero1],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1136
qed "real_mult_le_zero1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1137
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1138
Goal "[| 0hr <= x; y < 0hr |] ==> x * y <= 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1139
by (rtac hypreal_less_or_eq_imp_le 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1140
by (dtac hypreal_le_imp_less_or_eq 1 THEN etac disjE 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1141
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1142
by (dtac (hypreal_minus_zero_less_iff RS iffD2) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1143
by (rtac (hypreal_minus_zero_less_iff RS subst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1144
by (blast_tac (claset() addDs [hypreal_mult_order] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1145
    addIs [hypreal_minus_mult_eq2 RS ssubst]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1146
qed "hypreal_mult_le_zero";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1147
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1148
Goal "[| 0hr < x; y < 0hr |] ==> x*y < 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1149
by (dtac (hypreal_minus_zero_less_iff RS iffD2) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1150
by (dtac hypreal_mult_order 1 THEN assume_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1151
by (rtac (hypreal_minus_zero_less_iff RS iffD1) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1152
by (asm_full_simp_tac (simpset() addsimps [hypreal_minus_mult_eq2]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1153
qed "hypreal_mult_less_zero";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1154
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1155
Goalw [hypreal_one_def,hypreal_zero_def,hypreal_less_def] "0hr < 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1156
by (res_inst_tac [("x","%n. 0r")] exI 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1157
by (res_inst_tac [("x","%n. 1r")] exI 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1158
by (auto_tac (claset(),simpset() addsimps [real_zero_less_one,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1159
    FreeUltrafilterNat_Nat_set]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1160
qed "hypreal_zero_less_one";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1161
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1162
Goal "[| 0hr <= x; 0hr <= y |] ==> 0hr <= x + y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1163
by (REPEAT(dtac hypreal_le_imp_less_or_eq 1));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1164
by (auto_tac (claset() addIs [hypreal_add_order,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1165
    hypreal_less_imp_le],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1166
qed "hypreal_le_add_order";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1167
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1168
Goal "!!(q1::hypreal). q1 <= q2  ==> x + q1 <= x + q2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1169
by (dtac hypreal_le_imp_less_or_eq 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1170
by (Step_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1171
by (auto_tac (claset() addSIs [hypreal_le_refl,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1172
    hypreal_less_imp_le,hypreal_add_less_mono1],
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1173
    simpset() addsimps [hypreal_add_commute]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1174
qed "hypreal_add_left_le_mono1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1175
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1176
Goal "!!(q1::hypreal). q1 <= q2  ==> q1 + x <= q2 + x";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1177
by (auto_tac (claset() addDs [hypreal_add_left_le_mono1],
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1178
    simpset() addsimps [hypreal_add_commute]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1179
qed "hypreal_add_le_mono1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1180
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1181
Goal "!!k l::hypreal. [|i<=j;  k<=l |] ==> i + k <= j + l";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1182
by (etac (hypreal_add_le_mono1 RS hypreal_le_trans) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1183
by (simp_tac (simpset() addsimps [hypreal_add_commute]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1184
(*j moves to the end because it is free while k, l are bound*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1185
by (etac hypreal_add_le_mono1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1186
qed "hypreal_add_le_mono";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1187
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1188
Goal "!!k l::hypreal. [|i<j;  k<=l |] ==> i + k < j + l";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1189
by (auto_tac (claset() addSDs [hypreal_le_imp_less_or_eq] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1190
    addIs [hypreal_add_less_mono1,hypreal_add_less_mono],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1191
qed "hypreal_add_less_le_mono";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1192
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1193
Goal "!!k l::hypreal. [|i<=j;  k<l |] ==> i + k < j + l";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1194
by (auto_tac (claset() addSDs [hypreal_le_imp_less_or_eq] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1195
    addIs [hypreal_add_less_mono2,hypreal_add_less_mono],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1196
qed "hypreal_add_le_less_mono";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1197
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1198
Goal "(0hr*x<r)=(0hr<r)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1199
by (Simp_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1200
qed "hypreal_mult_0_less";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1201
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1202
Goal "[| 0hr < z; x < y |] ==> x*z < y*z";       
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1203
by (rotate_tac 1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1204
by (dtac (hypreal_less_minus_iff RS iffD1) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1205
by (rtac (hypreal_less_minus_iff RS iffD2) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1206
by (dtac hypreal_mult_order 1 THEN assume_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1207
by (asm_full_simp_tac (simpset() addsimps [hypreal_add_mult_distrib2,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1208
    hypreal_minus_mult_eq2 RS sym, hypreal_mult_commute ]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1209
qed "hypreal_mult_less_mono1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1210
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1211
Goal "[| 0hr<z; x<y |] ==> z*x<z*y";       
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1212
by (asm_simp_tac (simpset() addsimps [hypreal_mult_commute,hypreal_mult_less_mono1]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1213
qed "hypreal_mult_less_mono2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1214
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1215
Goal "[| 0hr<=z; x<y |] ==> x*z<=y*z";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1216
by (EVERY1 [rtac hypreal_less_or_eq_imp_le, dtac hypreal_le_imp_less_or_eq]);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1217
by (auto_tac (claset() addIs [hypreal_mult_less_mono1],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1218
qed "hypreal_mult_le_less_mono1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1219
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1220
Goal "[| 0hr<=z; x<y |] ==> z*x<=z*y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1221
by (asm_simp_tac (simpset() addsimps [hypreal_mult_commute,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1222
				      hypreal_mult_le_less_mono1]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1223
qed "hypreal_mult_le_less_mono2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1224
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1225
Goal "[| 0hr<=z; x<=y |] ==> z*x<=z*y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1226
by (dres_inst_tac [("x","x")] hypreal_le_imp_less_or_eq 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1227
by (auto_tac (claset() addIs [hypreal_mult_le_less_mono2,hypreal_le_refl],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1228
qed "hypreal_mult_le_le_mono1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1229
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1230
val prem1::prem2::prem3::rest = goal thy
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1231
     "[| 0hr<y; x<r; y*r<t*s |] ==> y*x<t*s";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1232
by (rtac ([([prem1,prem2] MRS hypreal_mult_less_mono2),prem3] MRS hypreal_less_trans) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1233
qed "hypreal_mult_less_trans";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1234
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1235
Goal "[| 0hr<=y; x<r; y*r<t*s; 0hr<t*s|] ==> y*x<t*s";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1236
by (dtac hypreal_le_imp_less_or_eq 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1237
by (fast_tac (HOL_cs addEs [(hypreal_mult_0_less RS iffD2),hypreal_mult_less_trans]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1238
qed "hypreal_mult_le_less_trans";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1239
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1240
Goal "[| 0hr <= y; x <= r; y*r < t*s; 0hr < t*s|] ==> y*x < t*s";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1241
by (dres_inst_tac [("x","x")] hypreal_le_imp_less_or_eq 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1242
by (fast_tac (claset() addIs [hypreal_mult_le_less_trans]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1243
qed "hypreal_mult_le_le_trans";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1244
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1245
Goal "[| 0hr < r1; r1 <r2; 0hr < x; x < y|] \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1246
\                     ==> r1 * x < r2 * y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1247
by (dres_inst_tac [("x","x")] hypreal_mult_less_mono2 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1248
by (dres_inst_tac [("R1.0","0hr")] hypreal_less_trans 2);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1249
by (dres_inst_tac [("x","r1")] hypreal_mult_less_mono1 3);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1250
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1251
by (blast_tac (claset() addIs [hypreal_less_trans]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1252
qed "hypreal_mult_less_mono";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1253
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1254
Goal "[| 0hr < r1; r1 <r2; 0hr < y|] \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1255
\                           ==> 0hr < r2 * y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1256
by (dres_inst_tac [("R1.0","0hr")] hypreal_less_trans 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1257
by (assume_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1258
by (blast_tac (claset() addIs [hypreal_mult_order]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1259
qed "hypreal_mult_order_trans";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1260
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1261
Goal "[| 0hr < r1; r1 <= r2; 0hr <= x; x <= y |] \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1262
\                  ==> r1 * x <= r2 * y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1263
by (rtac hypreal_less_or_eq_imp_le 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1264
by (REPEAT(dtac hypreal_le_imp_less_or_eq 1));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1265
by (auto_tac (claset() addIs [hypreal_mult_less_mono,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1266
    hypreal_mult_less_mono1,hypreal_mult_less_mono2,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1267
    hypreal_mult_order_trans,hypreal_mult_order],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1268
qed "hypreal_mult_le_mono";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1269
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1270
(*----------------------------------------------------------
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1271
  hypreal_of_real preserves field and order properties
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1272
 -----------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1273
Goalw [hypreal_of_real_def] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1274
      "hypreal_of_real ((z1::real) + z2) = \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1275
\      hypreal_of_real z1 + hypreal_of_real z2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1276
by (asm_simp_tac (simpset() addsimps [hypreal_add,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1277
       hypreal_add_mult_distrib]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1278
qed "hypreal_of_real_add";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1279
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1280
Goalw [hypreal_of_real_def] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1281
            "hypreal_of_real ((z1::real) * z2) = hypreal_of_real z1 * hypreal_of_real z2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1282
by (full_simp_tac (simpset() addsimps [hypreal_mult,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1283
        hypreal_add_mult_distrib2]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1284
qed "hypreal_of_real_mult";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1285
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1286
Goalw [hypreal_less_def,hypreal_of_real_def] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1287
            "(z1 < z2) = (hypreal_of_real z1 <  hypreal_of_real z2)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1288
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1289
by (res_inst_tac [("x","%n. z1")] exI 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1290
by (Step_tac 1); 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1291
by (res_inst_tac [("x","%n. z2")] exI 2);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1292
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1293
by (rtac FreeUltrafilterNat_P 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1294
by (Ultra_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1295
qed "hypreal_of_real_less_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1296
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1297
Addsimps [hypreal_of_real_less_iff RS sym];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1298
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1299
Goalw [hypreal_le_def,real_le_def] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1300
            "(z1 <= z2) = (hypreal_of_real z1 <=  hypreal_of_real z2)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1301
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1302
qed "hypreal_of_real_le_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1303
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1304
Goalw [hypreal_of_real_def] "hypreal_of_real (-r) = - hypreal_of_real  r";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1305
by (auto_tac (claset(),simpset() addsimps [hypreal_minus]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1306
qed "hypreal_of_real_minus";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1307
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1308
Goal "0hr < x ==> 0hr < hrinv x";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1309
by (EVERY1[rtac ccontr, dtac hypreal_leI]);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1310
by (forward_tac [hypreal_minus_zero_less_iff2 RS iffD2] 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1311
by (forward_tac [hypreal_not_refl2 RS not_sym] 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1312
by (dtac (hypreal_not_refl2 RS not_sym RS hrinv_not_zero) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1313
by (EVERY1[dtac hypreal_le_imp_less_or_eq, Step_tac]); 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1314
by (dtac hypreal_mult_less_zero1 1 THEN assume_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1315
by (auto_tac (claset() addIs [hypreal_zero_less_one RS hypreal_less_asym],
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1316
    simpset() addsimps [hypreal_minus_mult_eq1 RS sym,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1317
     hypreal_minus_zero_less_iff]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1318
qed "hypreal_hrinv_gt_zero";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1319
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1320
Goal "x < 0hr ==> hrinv x < 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1321
by (forward_tac [hypreal_not_refl2] 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1322
by (dtac (hypreal_minus_zero_less_iff RS iffD2) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1323
by (rtac (hypreal_minus_zero_less_iff RS iffD1) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1324
by (dtac (hypreal_minus_hrinv RS sym) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1325
by (auto_tac (claset() addIs [hypreal_hrinv_gt_zero],
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1326
    simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1327
qed "hypreal_hrinv_less_zero";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1328
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1329
Goalw [hypreal_of_real_def,hypreal_one_def] "hypreal_of_real  1r = 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1330
by (Step_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1331
qed "hypreal_of_real_one";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1332
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1333
Goalw [hypreal_of_real_def,hypreal_zero_def] "hypreal_of_real  0r = 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1334
by (Step_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1335
qed "hypreal_of_real_zero";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1336
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1337
Goal "(hypreal_of_real  r = 0hr) = (r = 0r)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1338
by (auto_tac (claset() addIs [FreeUltrafilterNat_P],
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1339
    simpset() addsimps [hypreal_of_real_def,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1340
    hypreal_zero_def,FreeUltrafilterNat_Nat_set]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1341
qed "hypreal_of_real_zero_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1342
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1343
Goal "(hypreal_of_real  r ~= 0hr) = (r ~= 0r)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1344
by (full_simp_tac (simpset() addsimps [hypreal_of_real_zero_iff]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1345
qed "hypreal_of_real_not_zero_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1346
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1347
Goal "r ~= 0r ==> hrinv (hypreal_of_real r) = \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1348
\          hypreal_of_real (rinv r)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1349
by (res_inst_tac [("c1","hypreal_of_real r")] (hypreal_mult_left_cancel RS iffD1) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1350
by (etac (hypreal_of_real_not_zero_iff RS iffD2) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1351
by (forward_tac [hypreal_of_real_not_zero_iff RS iffD2] 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1352
by (auto_tac (claset(),simpset() addsimps [hypreal_of_real_mult RS sym,hypreal_of_real_one]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1353
qed "hypreal_of_real_hrinv";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1354
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1355
Goal "hypreal_of_real r ~= 0hr ==> hrinv (hypreal_of_real r) = \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1356
\          hypreal_of_real (rinv r)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1357
by (etac (hypreal_of_real_not_zero_iff RS iffD1 RS hypreal_of_real_hrinv) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1358
qed "hypreal_of_real_hrinv2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1359
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1360
Goal "x+x=x*(1hr+1hr)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1361
by (simp_tac (simpset() addsimps [hypreal_add_mult_distrib2]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1362
qed "hypreal_add_self";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1363
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1364
Goal "1hr < 1hr + 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1365
by (rtac (hypreal_less_minus_iff RS iffD2) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1366
by (full_simp_tac (simpset() addsimps [hypreal_zero_less_one,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1367
    hypreal_add_assoc]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1368
qed "hypreal_one_less_two";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1369
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1370
Goal "0hr < 1hr + 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1371
by (rtac ([hypreal_zero_less_one,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1372
          hypreal_one_less_two] MRS hypreal_less_trans) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1373
qed "hypreal_zero_less_two";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1374
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1375
Goal "1hr + 1hr ~= 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1376
by (rtac (hypreal_zero_less_two RS hypreal_not_refl2 RS not_sym) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1377
qed "hypreal_two_not_zero";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1378
Addsimps [hypreal_two_not_zero];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1379
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1380
Goal "x*hrinv(1hr + 1hr) + x*hrinv(1hr + 1hr) = x";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1381
by (rtac (hypreal_add_self RS ssubst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1382
by (full_simp_tac (simpset() addsimps [hypreal_mult_assoc]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1383
qed "hypreal_sum_of_halves";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1384
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1385
Goal "z ~= 0hr ==> x*y = (x*hrinv(z))*(z*y)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1386
by (asm_simp_tac (simpset() addsimps hypreal_mult_ac)  1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1387
qed "lemma_chain";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1388
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1389
Goal "0hr < r ==> 0hr < r*hrinv(1hr+1hr)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1390
by (dtac (hypreal_zero_less_two RS hypreal_hrinv_gt_zero 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1391
          RS hypreal_mult_less_mono1) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1392
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1393
qed "hypreal_half_gt_zero";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1394
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1395
(* TODO: remove redundant  0hr < x *)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1396
Goal "[| 0hr < r; 0hr < x; r < x |] ==> hrinv x < hrinv r";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1397
by (forward_tac [hypreal_hrinv_gt_zero] 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1398
by (forw_inst_tac [("x","x")] hypreal_hrinv_gt_zero 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1399
by (forw_inst_tac [("x","r"),("z","hrinv r")] hypreal_mult_less_mono1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1400
by (assume_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1401
by (asm_full_simp_tac (simpset() addsimps [hypreal_not_refl2 RS 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1402
         not_sym RS hypreal_mult_hrinv]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1403
by (forward_tac [hypreal_hrinv_gt_zero] 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1404
by (forw_inst_tac [("x","1hr"),("z","hrinv x")] hypreal_mult_less_mono2 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1405
by (assume_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1406
by (asm_full_simp_tac (simpset() addsimps [hypreal_not_refl2 RS 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1407
         not_sym RS hypreal_mult_hrinv_left,hypreal_mult_assoc RS sym]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1408
qed "hypreal_hrinv_less_swap";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1409
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1410
Goal "[| 0hr < r; 0hr < x|] ==> (r < x) = (hrinv x < hrinv r)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1411
by (auto_tac (claset() addIs [hypreal_hrinv_less_swap],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1412
by (res_inst_tac [("t","r")] (hypreal_hrinv_hrinv RS subst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1413
by (etac (hypreal_not_refl2 RS not_sym) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1414
by (res_inst_tac [("t","x")] (hypreal_hrinv_hrinv RS subst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1415
by (etac (hypreal_not_refl2 RS not_sym) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1416
by (auto_tac (claset() addIs [hypreal_hrinv_less_swap],
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1417
    simpset() addsimps [hypreal_hrinv_gt_zero]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1418
qed "hypreal_hrinv_less_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1419
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1420
Goal "[| 0hr < z; x < y |] ==> x*hrinv(z) < y*hrinv(z)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1421
by (blast_tac (claset() addSIs [hypreal_mult_less_mono1,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1422
    hypreal_hrinv_gt_zero]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1423
qed "hypreal_mult_hrinv_less_mono1";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1424
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1425
Goal "[| 0hr < z; x < y |] ==> hrinv(z)*x < hrinv(z)*y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1426
by (blast_tac (claset() addSIs [hypreal_mult_less_mono2,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1427
    hypreal_hrinv_gt_zero]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1428
qed "hypreal_mult_hrinv_less_mono2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1429
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1430
Goal "[| 0hr < z; x*z < y*z |] ==> x < y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1431
by (forw_inst_tac [("x","x*z")] hypreal_mult_hrinv_less_mono1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1432
by (dtac (hypreal_not_refl2 RS not_sym) 2);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1433
by (auto_tac (claset() addSDs [hypreal_mult_hrinv],
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1434
              simpset() addsimps hypreal_mult_ac));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1435
qed "hypreal_less_mult_right_cancel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1436
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1437
Goal "[| 0hr < z; z*x < z*y |] ==> x < y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1438
by (auto_tac (claset() addIs [hypreal_less_mult_right_cancel],
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1439
    simpset() addsimps [hypreal_mult_commute]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1440
qed "hypreal_less_mult_left_cancel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1441
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1442
Goal "[| 0hr < r; 0hr < ra; \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1443
\                 r < x; ra < y |] \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1444
\              ==> r*ra < x*y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1445
by (forw_inst_tac [("R2.0","r")] hypreal_less_trans 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1446
by (dres_inst_tac [("z","ra"),("x","r")] hypreal_mult_less_mono1 2);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1447
by (dres_inst_tac [("z","x"),("x","ra")] hypreal_mult_less_mono2 3);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1448
by (auto_tac (claset() addIs [hypreal_less_trans],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1449
qed "hypreal_mult_less_gt_zero"; 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1450
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1451
Goal "[| 0hr < r; 0hr < ra; \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1452
\                 r <= x; ra <= y |] \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1453
\              ==> r*ra <= x*y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1454
by (REPEAT(dtac hypreal_le_imp_less_or_eq 1));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1455
by (rtac hypreal_less_or_eq_imp_le 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1456
by (auto_tac (claset() addIs [hypreal_mult_less_mono1,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1457
    hypreal_mult_less_mono2,hypreal_mult_less_gt_zero],
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1458
    simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1459
qed "hypreal_mult_le_ge_zero"; 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1460
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1461
Goal "? (x::hypreal). x < y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1462
by (rtac (hypreal_add_zero_right RS subst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1463
by (res_inst_tac [("x","y + -1hr")] exI 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1464
by (auto_tac (claset() addSIs [hypreal_add_less_mono2],
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1465
    simpset() addsimps [hypreal_minus_zero_less_iff2,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1466
    hypreal_zero_less_one] delsimps [hypreal_add_zero_right]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1467
qed "hypreal_less_Ex";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1468
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1469
Goal "!!(A::hypreal). A + C < B + C ==> A < B";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1470
by (dres_inst_tac [("C","-C")] hypreal_add_less_mono1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1471
by (asm_full_simp_tac (simpset() addsimps [hypreal_add_assoc]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1472
qed "hypreal_less_add_right_cancel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1473
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1474
Goal "!!(A::hypreal). C + A < C + B ==> A < B";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1475
by (dres_inst_tac [("C","-C")] hypreal_add_less_mono2 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1476
by (asm_full_simp_tac (simpset() addsimps [hypreal_add_assoc RS sym]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1477
qed "hypreal_less_add_left_cancel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1478
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1479
Goal "0hr <= x*x";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1480
by (res_inst_tac [("x","0hr"),("y","x")] hypreal_linear_less2 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1481
by (auto_tac (claset() addIs [hypreal_mult_order,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1482
    hypreal_mult_less_zero1,hypreal_less_imp_le],
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1483
    simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1484
qed "hypreal_le_square";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1485
Addsimps [hypreal_le_square];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1486
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1487
Goalw [hypreal_le_def] "- (x*x) <= 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1488
by (auto_tac (claset() addSDs [(hypreal_le_square RS 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1489
    hypreal_le_less_trans)],simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1490
    [hypreal_minus_zero_less_iff,hypreal_less_not_refl]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1491
qed "hypreal_less_minus_square";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1492
Addsimps [hypreal_less_minus_square];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1493
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1494
Goal "[|x ~= 0hr; y ~= 0hr |] ==> \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1495
\                   hrinv(x) + hrinv(y) = (x + y)*hrinv(x*y)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1496
by (asm_full_simp_tac (simpset() addsimps [hypreal_hrinv_distrib,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1497
             hypreal_add_mult_distrib,hypreal_mult_assoc RS sym]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1498
by (rtac (hypreal_mult_assoc RS ssubst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1499
by (rtac (hypreal_mult_left_commute RS subst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1500
by (asm_full_simp_tac (simpset() addsimps [hypreal_add_commute]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1501
qed "hypreal_hrinv_add";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1502
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1503
Goal "x = -x ==> x = 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1504
by (dtac (hypreal_eq_minus_iff RS iffD1 RS sym) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1505
by (Asm_full_simp_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1506
by (dtac (hypreal_add_self RS subst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1507
by (rtac ccontr 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1508
by (blast_tac (claset() addDs [hypreal_two_not_zero RSN
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1509
               (2,hypreal_mult_not_0)]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1510
qed "hypreal_self_eq_minus_self_zero";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1511
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1512
Goal "(x + x = 0hr) = (x = 0hr)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1513
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1514
by (dtac (hypreal_add_self RS subst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1515
by (rtac ccontr 1 THEN rtac hypreal_mult_not_0E 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1516
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1517
qed "hypreal_add_self_zero_cancel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1518
Addsimps [hypreal_add_self_zero_cancel];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1519
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1520
Goal "(x + x + y = y) = (x = 0hr)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1521
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1522
by (dtac (hypreal_eq_minus_iff RS iffD1) 1 THEN dtac sym 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1523
by (auto_tac (claset(),simpset() addsimps [hypreal_add_assoc]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1524
qed "hypreal_add_self_zero_cancel2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1525
Addsimps [hypreal_add_self_zero_cancel2];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1526
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1527
Goal "(x + (x + y) = y) = (x = 0hr)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1528
by (simp_tac (simpset() addsimps [hypreal_add_assoc RS sym]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1529
qed "hypreal_add_self_zero_cancel2a";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1530
Addsimps [hypreal_add_self_zero_cancel2a];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1531
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1532
Goal "(b = -a) = (-b = (a::hypreal))";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1533
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1534
qed "hypreal_minus_eq_swap";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1535
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1536
Goal "(-b = -a) = (b = (a::hypreal))";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1537
by (asm_full_simp_tac (simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1538
    [hypreal_minus_eq_swap]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1539
qed "hypreal_minus_eq_cancel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1540
Addsimps [hypreal_minus_eq_cancel];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1541
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1542
Goal "x < x + 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1543
by (cut_inst_tac [("C","x")] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1544
    (hypreal_zero_less_one RS hypreal_add_less_mono2) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1545
by (Asm_full_simp_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1546
qed "hypreal_less_self_add_one";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1547
Addsimps [hypreal_less_self_add_one];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1548
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1549
Goal "((x::hypreal) + x = y + y) = (x = y)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1550
by (auto_tac (claset() addIs [hypreal_two_not_zero RS 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1551
     hypreal_mult_left_cancel RS iffD1],simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1552
     [hypreal_add_mult_distrib]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1553
qed "hypreal_add_self_cancel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1554
Addsimps [hypreal_add_self_cancel];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1555
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1556
Goal "(y = x + - y + x) = (y = (x::hypreal))";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1557
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1558
by (dres_inst_tac [("x1","y")] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1559
    (hypreal_add_right_cancel RS iffD2) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1560
by (auto_tac (claset(),simpset() addsimps hypreal_add_ac));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1561
qed "hypreal_add_self_minus_cancel";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1562
Addsimps [hypreal_add_self_minus_cancel];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1563
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1564
Goal "(y = x + (- y + x)) = (y = (x::hypreal))";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1565
by (asm_full_simp_tac (simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1566
         [hypreal_add_assoc RS sym])1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1567
qed "hypreal_add_self_minus_cancel2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1568
Addsimps [hypreal_add_self_minus_cancel2];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1569
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1570
Goal "z + -x = y + (y + (-x + -z)) = (y = (z::hypreal))";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1571
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1572
by (dres_inst_tac [("x1","z")] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1573
    (hypreal_add_right_cancel RS iffD2) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1574
by (asm_full_simp_tac (simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1575
    [hypreal_minus_add_distrib RS sym] @ hypreal_add_ac) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1576
by (asm_full_simp_tac (simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1577
     [hypreal_add_assoc RS sym,hypreal_add_right_cancel]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1578
qed "hypreal_add_self_minus_cancel3";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1579
Addsimps [hypreal_add_self_minus_cancel3];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1580
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1581
(* check why this does not work without 2nd substiution anymore! *)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1582
Goal "x < y ==> x < (x + y)*hrinv(1hr + 1hr)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1583
by (dres_inst_tac [("C","x")] hypreal_add_less_mono2 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1584
by (dtac (hypreal_add_self RS subst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1585
by (dtac (hypreal_zero_less_two RS hypreal_hrinv_gt_zero RS 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1586
          hypreal_mult_less_mono1) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1587
by (auto_tac (claset() addDs [hypreal_two_not_zero RS 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1588
          (hypreal_mult_hrinv RS subst)],simpset() 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1589
          addsimps [hypreal_mult_assoc]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1590
qed "hypreal_less_half_sum";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1591
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1592
(* check why this does not work without 2nd substiution anymore! *)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1593
Goal "x < y ==> (x + y)*hrinv(1hr + 1hr) < y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1594
by (dres_inst_tac [("C","y")] hypreal_add_less_mono1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1595
by (dtac (hypreal_add_self RS subst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1596
by (dtac (hypreal_zero_less_two RS hypreal_hrinv_gt_zero RS 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1597
          hypreal_mult_less_mono1) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1598
by (auto_tac (claset() addDs [hypreal_two_not_zero RS 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1599
          (hypreal_mult_hrinv RS subst)],simpset() 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1600
          addsimps [hypreal_mult_assoc]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1601
qed "hypreal_gt_half_sum";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1602
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1603
Goal "!!(x::hypreal). x < y ==> EX r. x < r & r < y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1604
by (blast_tac (claset() addSIs [hypreal_less_half_sum,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1605
    hypreal_gt_half_sum]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1606
qed "hypreal_dense";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1607
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1608
Goal "(x * x = 0hr) = (x = 0hr)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1609
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1610
by (blast_tac (claset() addIs [hypreal_mult_not_0E]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1611
qed "hypreal_mult_self_eq_zero_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1612
Addsimps [hypreal_mult_self_eq_zero_iff];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1613
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1614
Goal "(0hr = x * x) = (x = 0hr)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1615
by (auto_tac (claset() addDs [sym],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1616
qed "hypreal_mult_self_eq_zero_iff2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1617
Addsimps [hypreal_mult_self_eq_zero_iff2];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1618
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1619
Goal "(x*x + y*y = 0hr) = (x = 0hr & y = 0hr)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1620
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1621
by (dtac (sym RS (hypreal_eq_minus_iff3 RS iffD1))  1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1622
by (dtac (sym RS (hypreal_eq_minus_iff4 RS iffD1))  2);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1623
by (ALLGOALS(rtac ccontr));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1624
by (ALLGOALS(dtac hypreal_mult_self_not_zero));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1625
by (cut_inst_tac [("x1","x")] (hypreal_le_square 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1626
        RS hypreal_le_imp_less_or_eq) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1627
by (cut_inst_tac [("x1","y")] (hypreal_le_square 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1628
        RS hypreal_le_imp_less_or_eq) 2);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1629
by (auto_tac (claset() addDs [sym],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1630
by (dres_inst_tac [("x1","y")] (hypreal_less_minus_square 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1631
    RS hypreal_le_less_trans) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1632
by (dres_inst_tac [("x1","x")] (hypreal_less_minus_square 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1633
    RS hypreal_le_less_trans) 2);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1634
by (auto_tac (claset(),simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1635
       [hypreal_less_not_refl]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1636
qed "hypreal_squares_add_zero_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1637
Addsimps [hypreal_squares_add_zero_iff];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1638
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1639
Goal "x * x ~= 0hr ==> 0hr < x* x + y*y + z*z";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1640
by (cut_inst_tac [("x1","x")] (hypreal_le_square 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1641
        RS hypreal_le_imp_less_or_eq) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1642
by (auto_tac (claset() addSIs 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1643
              [hypreal_add_order_le],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1644
qed "hypreal_sum_squares3_gt_zero";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1645
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1646
Goal "x * x ~= 0hr ==> 0hr < y*y + x*x + z*z";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1647
by (dtac hypreal_sum_squares3_gt_zero 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1648
by (auto_tac (claset(),simpset() addsimps hypreal_add_ac));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1649
qed "hypreal_sum_squares3_gt_zero2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1650
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1651
Goal "x * x ~= 0hr ==> 0hr < y*y + z*z + x*x";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1652
by (dtac hypreal_sum_squares3_gt_zero 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1653
by (auto_tac (claset(),simpset() addsimps hypreal_add_ac));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1654
qed "hypreal_sum_squares3_gt_zero3";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1655
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1656
Goal "(x*x + y*y + z*z = 0hr) = \ 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1657
\               (x = 0hr & y = 0hr & z = 0hr)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1658
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1659
by (ALLGOALS(rtac ccontr));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1660
by (ALLGOALS(dtac hypreal_mult_self_not_zero));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1661
by (auto_tac (claset() addDs [hypreal_not_refl2 RS not_sym,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1662
   hypreal_sum_squares3_gt_zero3,hypreal_sum_squares3_gt_zero,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1663
   hypreal_sum_squares3_gt_zero2],simpset() delsimps
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1664
   [hypreal_mult_self_eq_zero_iff]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1665
qed "hypreal_three_squares_add_zero_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1666
Addsimps [hypreal_three_squares_add_zero_iff];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1667
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1668
Goal "(x::hypreal)*x <= x*x + y*y";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1669
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1670
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1671
by (auto_tac (claset(),simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1672
    [hypreal_mult,hypreal_add,hypreal_le]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1673
qed "hypreal_self_le_add_pos";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1674
Addsimps [hypreal_self_le_add_pos];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1675
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1676
Goal "(x::hypreal)*x <= x*x + y*y + z*z";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1677
by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1678
by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1679
by (res_inst_tac [("z","z")] eq_Abs_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1680
by (auto_tac (claset(),simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1681
    [hypreal_mult,hypreal_add,hypreal_le,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1682
    real_le_add_order]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1683
qed "hypreal_self_le_add_pos2";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1684
Addsimps [hypreal_self_le_add_pos2];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1685
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1686
(*---------------------------------------------------------------------------------
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1687
             Embedding of the naturals in the hyperreals
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1688
 ---------------------------------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1689
Goalw [hypreal_of_posnat_def] "hypreal_of_posnat 0 = 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1690
by (full_simp_tac (simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1691
    [pnat_one_iff RS sym,real_of_preal_def]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1692
by (fold_tac [real_one_def]);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1693
by (rtac hypreal_of_real_one 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1694
qed "hypreal_of_posnat_one";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1695
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1696
Goalw [hypreal_of_posnat_def] "hypreal_of_posnat 1 = 1hr + 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1697
by (full_simp_tac (simpset() addsimps [real_of_preal_def,real_one_def,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1698
    hypreal_one_def,hypreal_add,hypreal_of_real_def,pnat_two_eq,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1699
    real_add,prat_of_pnat_add RS sym,preal_of_prat_add RS sym] @ pnat_add_ac) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1700
qed "hypreal_of_posnat_two";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1701
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1702
Goalw [hypreal_of_posnat_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1703
          "hypreal_of_posnat n1 + hypreal_of_posnat n2 = \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1704
\          hypreal_of_posnat (n1 + n2) + 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1705
by (full_simp_tac (simpset() addsimps [hypreal_of_posnat_one RS sym,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1706
    hypreal_of_real_add RS sym,hypreal_of_posnat_def,real_of_preal_add RS sym,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1707
    preal_of_prat_add RS sym,prat_of_pnat_add RS sym,pnat_of_nat_add]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1708
qed "hypreal_of_posnat_add";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1709
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1710
Goal "hypreal_of_posnat (n + 1) = hypreal_of_posnat n + 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1711
by (res_inst_tac [("x1","1hr")] (hypreal_add_right_cancel RS iffD1) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1712
by (rtac (hypreal_of_posnat_add RS subst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1713
by (full_simp_tac (simpset() addsimps [hypreal_of_posnat_two,hypreal_add_assoc]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1714
qed "hypreal_of_posnat_add_one";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1715
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1716
Goalw [real_of_posnat_def,hypreal_of_posnat_def] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1717
      "hypreal_of_posnat n = hypreal_of_real (real_of_posnat n)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1718
by (rtac refl 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1719
qed "hypreal_of_real_of_posnat";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1720
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1721
Goalw [hypreal_of_posnat_def] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1722
      "(n < m) = (hypreal_of_posnat n < hypreal_of_posnat m)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1723
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1724
qed "hypreal_of_posnat_less_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1725
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1726
Addsimps [hypreal_of_posnat_less_iff RS sym];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1727
(*---------------------------------------------------------------------------------
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1728
               Existence of infinite hyperreal number
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1729
 ---------------------------------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1730
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1731
Goal "hyprel^^{%n::nat. real_of_posnat n} : hypreal";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1732
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1733
qed "hypreal_omega";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1734
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1735
Goalw [omega_def] "Rep_hypreal(whr) : hypreal";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1736
by (rtac Rep_hypreal 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1737
qed "Rep_hypreal_omega";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1738
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1739
(* existence of infinite number not corresponding to any real number *)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1740
(* use assumption that member FreeUltrafilterNat is not finite       *)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1741
(* a few lemmas first *)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1742
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1743
Goal "{n::nat. x = real_of_posnat n} = {} | \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1744
\     (? y. {n::nat. x = real_of_posnat n} = {y})";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1745
by (auto_tac (claset() addDs [inj_real_of_posnat RS injD],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1746
qed "lemma_omega_empty_singleton_disj";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1747
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1748
Goal "finite {n::nat. x = real_of_posnat n}";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1749
by (cut_inst_tac [("x","x")] lemma_omega_empty_singleton_disj 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1750
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1751
qed "lemma_finite_omega_set";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1752
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1753
Goalw [omega_def,hypreal_of_real_def] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1754
      "~ (? x. hypreal_of_real x = whr)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1755
by (auto_tac (claset(),simpset() addsimps [lemma_finite_omega_set 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1756
    RS FreeUltrafilterNat_finite]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1757
qed "not_ex_hypreal_of_real_eq_omega";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1758
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1759
Goal "hypreal_of_real x ~= whr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1760
by (cut_facts_tac [not_ex_hypreal_of_real_eq_omega] 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1761
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1762
qed "hypreal_of_real_not_eq_omega";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1763
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1764
(* existence of infinitesimal number also not *)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1765
(* corresponding to any real number *)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1766
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1767
Goal "{n::nat. x = rinv(real_of_posnat n)} = {} | \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1768
\     (? y. {n::nat. x = rinv(real_of_posnat n)} = {y})";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1769
by (Step_tac 1 THEN Step_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1770
by (auto_tac (claset() addIs [real_of_posnat_rinv_inj],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1771
qed "lemma_epsilon_empty_singleton_disj";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1772
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1773
Goal "finite {n::nat. x = rinv(real_of_posnat n)}";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1774
by (cut_inst_tac [("x","x")] lemma_epsilon_empty_singleton_disj 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1775
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1776
qed "lemma_finite_epsilon_set";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1777
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1778
Goalw [epsilon_def,hypreal_of_real_def] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1779
      "~ (? x. hypreal_of_real x = ehr)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1780
by (auto_tac (claset(),simpset() addsimps [lemma_finite_epsilon_set 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1781
    RS FreeUltrafilterNat_finite]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1782
qed "not_ex_hypreal_of_real_eq_epsilon";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1783
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1784
Goal "hypreal_of_real x ~= ehr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1785
by (cut_facts_tac [not_ex_hypreal_of_real_eq_epsilon] 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1786
by Auto_tac;
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1787
qed "hypreal_of_real_not_eq_epsilon";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1788
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1789
Goalw [epsilon_def,hypreal_zero_def] "ehr ~= 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1790
by (auto_tac (claset(),simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1791
    [real_of_posnat_rinv_not_zero]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1792
qed "hypreal_epsilon_not_zero";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1793
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1794
Goalw [omega_def,hypreal_zero_def] "whr ~= 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1795
by (Simp_tac 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1796
qed "hypreal_omega_not_zero";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1797
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1798
Goal "ehr = hrinv(whr)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1799
by (asm_full_simp_tac (simpset() addsimps 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1800
    [hypreal_hrinv,omega_def,epsilon_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1801
    setloop (split_tac [expand_if])) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1802
qed "hypreal_epsilon_hrinv_omega";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1803
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1804
(*----------------------------------------------------------------
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1805
     Another embedding of the naturals in the 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1806
    hyperreals (see hypreal_of_posnat)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1807
 ----------------------------------------------------------------*)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1808
Goalw [hypreal_of_nat_def] "hypreal_of_nat 0 = 0hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1809
by (full_simp_tac (simpset() addsimps [hypreal_of_posnat_one]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1810
qed "hypreal_of_nat_zero";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1811
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1812
Goalw [hypreal_of_nat_def] "hypreal_of_nat 1 = 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1813
by (full_simp_tac (simpset() addsimps [hypreal_of_posnat_two,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1814
    hypreal_add_assoc]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1815
qed "hypreal_of_nat_one";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1816
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1817
Goalw [hypreal_of_nat_def]
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1818
      "hypreal_of_nat n1 + hypreal_of_nat n2 = \
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1819
\      hypreal_of_nat (n1 + n2)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1820
by (full_simp_tac (simpset() addsimps hypreal_add_ac) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1821
by (simp_tac (simpset() addsimps [hypreal_of_posnat_add,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1822
    hypreal_add_assoc RS sym]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1823
by (rtac (hypreal_add_commute RS subst) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1824
by (simp_tac (simpset() addsimps [hypreal_add_left_cancel,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1825
    hypreal_add_assoc]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1826
qed "hypreal_of_nat_add";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1827
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1828
Goal "hypreal_of_nat 2 = 1hr + 1hr";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1829
by (simp_tac (simpset() addsimps [hypreal_of_nat_one 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1830
    RS sym,hypreal_of_nat_add]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1831
qed "hypreal_of_nat_two";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1832
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1833
Goalw [hypreal_of_nat_def] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1834
      "(n < m) = (hypreal_of_nat n < hypreal_of_nat m)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1835
by (auto_tac (claset() addIs [hypreal_add_less_mono1],simpset()));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1836
by (dres_inst_tac [("C","1hr")] hypreal_add_less_mono1 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1837
by (full_simp_tac (simpset() addsimps [hypreal_add_assoc]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1838
qed "hypreal_of_nat_less_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1839
Addsimps [hypreal_of_nat_less_iff RS sym];
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1840
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1841
(* naturals embedded in hyperreals is an hyperreal *)
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1842
Goalw [hypreal_of_nat_def,real_of_nat_def] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1843
      "hypreal_of_nat  m = Abs_hypreal(hyprel^^{%n. real_of_nat m})";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1844
by (auto_tac (claset(),simpset() addsimps [hypreal_of_real_def,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1845
    hypreal_of_real_of_posnat,hypreal_minus,hypreal_one_def,hypreal_add]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1846
qed "hypreal_of_nat_iff";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1847
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1848
Goal "inj hypreal_of_nat";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1849
by (rtac injI 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1850
by (auto_tac (claset() addSDs [FreeUltrafilterNat_P],
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1851
        simpset() addsimps [hypreal_of_nat_iff,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1852
        real_add_right_cancel,inj_real_of_nat RS injD]));
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1853
qed "inj_hypreal_of_nat";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1854
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1855
Goalw [hypreal_of_nat_def,hypreal_of_real_def,hypreal_of_posnat_def,
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1856
       real_of_posnat_def,hypreal_one_def,real_of_nat_def] 
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1857
       "hypreal_of_nat n = hypreal_of_real (real_of_nat n)";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1858
by (simp_tac (simpset() addsimps [hypreal_add,hypreal_minus]) 1);
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1859
qed "hypreal_of_nat_real_of_nat";
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1860
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1861
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1862
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1863
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1864
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1865
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1866
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1867
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1868
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1869
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1870
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1871
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1872
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1873
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1874
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1875
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1876
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1877
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1878
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1879
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1880
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1881
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1882
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1883
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1884
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1885
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1886
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1887
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1888
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1889
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1890
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1891
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1892
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1893
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1894
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1895
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1896
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1897
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1898
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1899
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1900
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1901
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1902
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1903
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1904
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1905
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1906
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1907
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1908
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1909
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1910
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1911
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1912
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1913
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1914
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1915
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1916
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1917
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1918
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1919
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1920
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1921
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1922
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1923
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1924
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1925
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1926
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1927
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1928
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1929
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1930
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1931
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1932
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1933
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1934
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1935
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1936
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1937
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1938
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1939
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1940
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1941
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1942
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1943
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1944
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1945
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1946
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1947
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1948
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1949
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1950
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1951
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1952
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1953
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1954
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1955
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1956
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1957
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1958
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1959
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1960
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1961
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1962
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1963
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1964
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1965
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1966
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1967
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1968
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1969
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1970
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1971
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1972
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1973
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1974
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1975
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1976
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1977
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1978
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1979
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1980
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1981
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1982
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1983
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1984
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1985
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1986
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1987
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1988
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1989
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1990
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1991
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1992
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1993
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1994
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1995
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1996
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1997
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1998
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  1999
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2000
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2001
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2002
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2003
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2004
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2005
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2006
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2007
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2008
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2009
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2010
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2011
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2012
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2013
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2014
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2015
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2016
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2017
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2018
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2019
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2020
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2021
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2022
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2023
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2024
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2025
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2026
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2027
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2028
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2029
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2030
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2031
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2032
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2033
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2034
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2035
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2036
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2037
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2038
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2039
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2040
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2041
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2042
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2043
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2044
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2045
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2046
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2047
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2048
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2049
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2050
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2051
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2052
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2053
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2054
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2055
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2056
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2057
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2058
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2059
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2060
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2061
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2062
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2063
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2064
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2065
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2066
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2067
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2068
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2069
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2070
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2071
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2072
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2073
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2074
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2075
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2076
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2077
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2078
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2079
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2080
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2081
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2082
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2083
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2084
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2085
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2086
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2087
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2088
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2089
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2090
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2091
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2092
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2093
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2094
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2095
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2096
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2097
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2098
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2099
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2100
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2101
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2102
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2103
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2104
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2105
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2106
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2107
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2108
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2109
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2110
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2111
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2112
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2113
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2114
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2115
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2116
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2117
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2118
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2119
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2120
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2121
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2122
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2123
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2124
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2125
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2126
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2127
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2128
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2129
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2130
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2131
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2132
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2133
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2134
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2135
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2136
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2137
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2138
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2139
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2140
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2141
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2142
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2143
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2144
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2145
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2146
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2147
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2148
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2149
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2150
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2151
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2152
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2153
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2154
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2155
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2156
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2157
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2158
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2159
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2160
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2161
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2162
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2163
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2164
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2165
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2166
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2167
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2168
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2169
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2170
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2171
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2172
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2173
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2174
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2175
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2176
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2177
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2178
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2179
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2180
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2181
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2182
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2183
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2184
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2185
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2186
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2187
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2188
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2189
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2190
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2191
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2192
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2193
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2194
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2195
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2196
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2197
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2198
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2199
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2200
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2201
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2202
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2203
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2204
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2205
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2206
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2207
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2208
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2209
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2210
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2211
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2212
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2213
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2214
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2215
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2216
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2217
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2218
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2219
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2220
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2221
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2222
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2223
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2224
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2225
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2226
bfa767b4dc51 new theory Real/Hyperreal/HyperDef and file fuf.ML
paulson
parents:
diff changeset
  2227