src/HOL/Real/RealOrd.ML
author fleuriot
Thu, 21 Sep 2000 12:11:38 +0200
changeset 10043 a0364652e115
parent 9825 a0fcf6f0436c
child 10606 e3229a37d53f
permissions -rw-r--r--
Updated Files with new theorems
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
     1
(*  Title:       HOL/Real/Real.ML
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
     2
    ID:          $Id$
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
     3
    Author:      Jacques D. Fleuriot and Lawrence C. Paulson
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
     4
    Copyright:   1998  University of Cambridge
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
     5
    Description: Type "real" is a linear order
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
     6
*)
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
     7
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
     8
(**** The simproc abel_cancel ****)
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
     9
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    10
(*** Two lemmas needed for the simprocs ***)
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    11
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    12
(*Deletion of other terms in the formula, seeking the -x at the front of z*)
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    13
Goal "((x::real) + (y + z) = y + u) = ((x + z) = u)";
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    14
by (stac real_add_left_commute 1);
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    15
by (rtac real_add_left_cancel 1);
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    16
qed "real_add_cancel_21";
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    17
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    18
(*A further rule to deal with the case that
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    19
  everything gets cancelled on the right.*)
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    20
Goal "((x::real) + (y + z) = y) = (x = -z)";
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    21
by (stac real_add_left_commute 1);
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    22
by (res_inst_tac [("t", "y")] (real_add_zero_right RS subst) 1
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    23
    THEN stac real_add_left_cancel 1);
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    24
by (simp_tac (simpset() addsimps [real_eq_diff_eq RS sym]) 1);
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    25
qed "real_add_cancel_end";
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    26
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    27
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    28
structure Real_Cancel_Data =
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    29
struct
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    30
  val ss		= HOL_ss
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    31
  val eq_reflection	= eq_reflection
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    32
9434
d2fa043ab24f do nat pass theory value, but sg_ref;
wenzelm
parents: 9081
diff changeset
    33
  val sg_ref		= Sign.self_ref (Theory.sign_of (the_context ()))
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    34
  val T			= HOLogic.realT
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    35
  val zero		= Const ("0", T)
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    36
  val restrict_to_left  = restrict_to_left
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    37
  val add_cancel_21	= real_add_cancel_21
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    38
  val add_cancel_end	= real_add_cancel_end
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    39
  val add_left_cancel	= real_add_left_cancel
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    40
  val add_assoc		= real_add_assoc
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    41
  val add_commute	= real_add_commute
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    42
  val add_left_commute	= real_add_left_commute
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    43
  val add_0		= real_add_zero_left
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    44
  val add_0_right	= real_add_zero_right
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    45
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    46
  val eq_diff_eq	= real_eq_diff_eq
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    47
  val eqI_rules		= [real_less_eqI, real_eq_eqI, real_le_eqI]
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    48
  fun dest_eqI th = 
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    49
      #1 (HOLogic.dest_bin "op =" HOLogic.boolT 
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    50
	      (HOLogic.dest_Trueprop (concl_of th)))
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    51
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    52
  val diff_def		= real_diff_def
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    53
  val minus_add_distrib	= real_minus_add_distrib
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    54
  val minus_minus	= real_minus_minus
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    55
  val minus_0		= real_minus_zero
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    56
  val add_inverses	= [real_add_minus, real_add_minus_left];
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    57
  val cancel_simps	= [real_add_minus_cancel, real_minus_add_cancel]
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    58
end;
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    59
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    60
structure Real_Cancel = Abel_Cancel (Real_Cancel_Data);
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    61
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    62
Addsimprocs [Real_Cancel.sum_conv, Real_Cancel.rel_conv];
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    63
9081
d54b2c41fe0e new lemma real_minus_diff_eq
paulson
parents: 9069
diff changeset
    64
Goal "- (z - y) = y - (z::real)";
d54b2c41fe0e new lemma real_minus_diff_eq
paulson
parents: 9069
diff changeset
    65
by (Simp_tac 1);
d54b2c41fe0e new lemma real_minus_diff_eq
paulson
parents: 9069
diff changeset
    66
qed "real_minus_diff_eq";
d54b2c41fe0e new lemma real_minus_diff_eq
paulson
parents: 9069
diff changeset
    67
Addsimps [real_minus_diff_eq];
d54b2c41fe0e new lemma real_minus_diff_eq
paulson
parents: 9069
diff changeset
    68
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    69
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    70
(**** Theorems about the ordering ****)
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    71
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    72
Goal "(0 < x) = (EX y. x = real_of_preal y)";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    73
by (auto_tac (claset(), simpset() addsimps [real_of_preal_zero_less]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    74
by (cut_inst_tac [("x","x")] real_of_preal_trichotomy 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    75
by (blast_tac (claset() addSEs [real_less_irrefl,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    76
				real_of_preal_not_minus_gt_zero RS notE]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    77
qed "real_gt_zero_preal_Ex";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    78
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    79
Goal "real_of_preal z < x ==> EX y. x = real_of_preal y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    80
by (blast_tac (claset() addSDs [real_of_preal_zero_less RS real_less_trans]
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    81
               addIs [real_gt_zero_preal_Ex RS iffD1]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    82
qed "real_gt_preal_preal_Ex";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    83
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    84
Goal "real_of_preal z <= x ==> EX y. x = real_of_preal y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    85
by (blast_tac (claset() addDs [real_le_imp_less_or_eq,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    86
			       real_gt_preal_preal_Ex]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    87
qed "real_ge_preal_preal_Ex";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    88
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    89
Goal "y <= 0 ==> ALL x. y < real_of_preal x";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    90
by (auto_tac (claset() addEs [real_le_imp_less_or_eq RS disjE]
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    91
                       addIs [real_of_preal_zero_less RSN(2,real_less_trans)],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    92
              simpset() addsimps [real_of_preal_zero_less]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    93
qed "real_less_all_preal";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    94
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
    95
Goal "~ 0 < y ==> ALL x. y < real_of_preal x";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    96
by (blast_tac (claset() addSIs [real_less_all_preal,real_leI]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    97
qed "real_less_all_real2";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    98
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
    99
Goal "((x::real) < y) = (-y < -x)";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   100
by (rtac (real_less_sum_gt_0_iff RS subst) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   101
by (res_inst_tac [("W1","x")] (real_less_sum_gt_0_iff RS subst) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   102
by (simp_tac (simpset() addsimps [real_add_commute]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   103
qed "real_less_swap_iff";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   104
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   105
Goal "[| R + L = S;  (0::real) < L |] ==> R < S";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   106
by (rtac (real_less_sum_gt_0_iff RS iffD1) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   107
by (auto_tac (claset(), simpset() addsimps real_add_ac));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   108
qed "real_lemma_add_positive_imp_less";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   109
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   110
Goal "EX T::real. 0 < T & R + T = S ==> R < S";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   111
by (blast_tac (claset() addIs [real_lemma_add_positive_imp_less]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   112
qed "real_ex_add_positive_left_less";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   113
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   114
(*Alternative definition for real_less.  NOT for rewriting*)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   115
Goal "(R < S) = (EX T::real. 0 < T & R + T = S)";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   116
by (blast_tac (claset() addSIs [real_less_add_positive_left_Ex,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   117
				real_ex_add_positive_left_less]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   118
qed "real_less_iff_add";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   119
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   120
Goal "((0::real) < x) = (-x < x)";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   121
by Safe_tac;
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   122
by (rtac ccontr 2 THEN forward_tac 
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   123
    [real_leI RS real_le_imp_less_or_eq] 2);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   124
by (Step_tac 2);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   125
by (dtac (real_minus_zero_less_iff RS iffD2) 2);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   126
by (blast_tac (claset() addIs [real_less_trans]) 2);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   127
by (auto_tac (claset(),
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   128
	      simpset() addsimps 
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   129
 	        [real_gt_zero_preal_Ex,real_of_preal_minus_less_self]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   130
qed "real_gt_zero_iff";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   131
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   132
Goal "(x < (0::real)) = (x < -x)";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   133
by (rtac (real_minus_zero_less_iff RS subst) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   134
by (stac real_gt_zero_iff 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   135
by (Full_simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   136
qed "real_lt_zero_iff";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   137
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   138
Goalw [real_le_def] "((0::real) <= x) = (-x <= x)";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   139
by (auto_tac (claset(), simpset() addsimps [real_lt_zero_iff RS sym]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   140
qed "real_ge_zero_iff";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   141
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   142
Goalw [real_le_def] "(x <= (0::real)) = (x <= -x)";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   143
by (auto_tac (claset(), simpset() addsimps [real_gt_zero_iff RS sym]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   144
qed "real_le_zero_iff";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   145
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   146
Goal "(real_of_preal m1 <= real_of_preal m2) = (m1 <= m2)";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   147
by (auto_tac (claset() addSIs [preal_leI],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   148
    simpset() addsimps [real_less_le_iff RS sym]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   149
by (dtac preal_le_less_trans 1 THEN assume_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   150
by (etac preal_less_irrefl 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   151
qed "real_of_preal_le_iff";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   152
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   153
Goal "[| 0 < x; 0 < y |] ==> (0::real) < x * y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   154
by (auto_tac (claset(), simpset() addsimps [real_gt_zero_preal_Ex]));  
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   155
by (res_inst_tac [("x","y*ya")] exI 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   156
by (full_simp_tac (simpset() addsimps [real_of_preal_mult]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   157
qed "real_mult_order";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   158
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   159
Goal "[| x < 0; y < 0 |] ==> (0::real) < x * y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   160
by (REPEAT(dtac (real_minus_zero_less_iff RS iffD2) 1));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   161
by (dtac real_mult_order 1 THEN assume_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   162
by (Asm_full_simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   163
qed "real_mult_less_zero1";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   164
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   165
Goal "[| 0 <= x; 0 <= y |] ==> (0::real) <= x * y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   166
by (REPEAT(dtac real_le_imp_less_or_eq 1));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   167
by (auto_tac (claset() addIs [real_mult_order, real_less_imp_le],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   168
	      simpset()));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   169
qed "real_le_mult_order";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   170
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   171
Goal "[| 0 < x; 0 <= y |] ==> (0::real) <= x * y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   172
by (dtac real_le_imp_less_or_eq 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   173
by (auto_tac (claset() addIs [real_mult_order,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   174
			      real_less_imp_le],simpset()));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   175
qed "real_less_le_mult_order";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   176
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   177
Goal "[| x <= 0; y <= 0 |] ==> (0::real) <= x * y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   178
by (rtac real_less_or_eq_imp_le 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   179
by (dtac real_le_imp_less_or_eq 1 THEN etac disjE 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   180
by Auto_tac;
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   181
by (dtac real_le_imp_less_or_eq 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   182
by (auto_tac (claset() addDs [real_mult_less_zero1],simpset()));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   183
qed "real_mult_le_zero1";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   184
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   185
Goal "[| 0 <= x; y < 0 |] ==> x * y <= (0::real)";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   186
by (rtac real_less_or_eq_imp_le 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   187
by (dtac real_le_imp_less_or_eq 1 THEN etac disjE 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   188
by Auto_tac;
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   189
by (dtac (real_minus_zero_less_iff RS iffD2) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   190
by (rtac (real_minus_zero_less_iff RS subst) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   191
by (blast_tac (claset() addDs [real_mult_order] 
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   192
	                addIs [real_minus_mult_eq2 RS ssubst]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   193
qed "real_mult_le_zero";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   194
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   195
Goal "[| 0 < x; y < 0 |] ==> x*y < (0::real)";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   196
by (dtac (real_minus_zero_less_iff RS iffD2) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   197
by (dtac real_mult_order 1 THEN assume_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   198
by (rtac (real_minus_zero_less_iff RS iffD1) 1);
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   199
by (Asm_full_simp_tac 1);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   200
qed "real_mult_less_zero";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   201
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   202
Goalw [real_one_def] "0 < 1r";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   203
by (auto_tac (claset() addIs [real_gt_zero_preal_Ex RS iffD2],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   204
	      simpset() addsimps [real_of_preal_def]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   205
qed "real_zero_less_one";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   206
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   207
(*** Monotonicity results ***)
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   208
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   209
Goal "(v+z < w+z) = (v < (w::real))";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   210
by (Simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   211
qed "real_add_right_cancel_less";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   212
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   213
Goal "(z+v < z+w) = (v < (w::real))";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   214
by (Simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   215
qed "real_add_left_cancel_less";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   216
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   217
Addsimps [real_add_right_cancel_less, real_add_left_cancel_less];
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   218
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   219
Goal "(v+z <= w+z) = (v <= (w::real))";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   220
by (Simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   221
qed "real_add_right_cancel_le";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   222
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   223
Goal "(z+v <= z+w) = (v <= (w::real))";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   224
by (Simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   225
qed "real_add_left_cancel_le";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   226
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   227
Addsimps [real_add_right_cancel_le, real_add_left_cancel_le];
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   228
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   229
(*"v<=w ==> v+z <= w+z"*)
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   230
bind_thm ("real_add_less_mono1", real_add_right_cancel_less RS iffD2);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   231
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   232
(*"v<=w ==> v+z <= w+z"*)
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   233
bind_thm ("real_add_le_mono1", real_add_right_cancel_le RS iffD2);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   234
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   235
Goal "!!z z'::real. [| w'<w; z'<=z |] ==> w' + z' < w + z";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   236
by (etac (real_add_less_mono1 RS real_less_le_trans) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   237
by (Simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   238
qed "real_add_less_le_mono";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   239
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   240
Goal "!!z z'::real. [| w'<=w; z'<z |] ==> w' + z' < w + z";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   241
by (etac (real_add_le_mono1 RS real_le_less_trans) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   242
by (Simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   243
qed "real_add_le_less_mono";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   244
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   245
Goal "!!(A::real). A < B ==> C + A < C + B";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   246
by (Simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   247
qed "real_add_less_mono2";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   248
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   249
Goal "!!(A::real). A + C < B + C ==> A < B";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   250
by (Full_simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   251
qed "real_less_add_right_cancel";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   252
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   253
Goal "!!(A::real). C + A < C + B ==> A < B";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   254
by (Full_simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   255
qed "real_less_add_left_cancel";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   256
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   257
Goal "!!(A::real). A + C <= B + C ==> A <= B";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   258
by (Full_simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   259
qed "real_le_add_right_cancel";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   260
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   261
Goal "!!(A::real). C + A <= C + B ==> A <= B";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   262
by (Full_simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   263
qed "real_le_add_left_cancel";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   264
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   265
Goal "[| 0 < x; 0 < y |] ==> (0::real) < x + y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   266
by (etac real_less_trans 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   267
by (dtac real_add_less_mono2 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   268
by (Full_simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   269
qed "real_add_order";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   270
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   271
Goal "[| 0 <= x; 0 <= y |] ==> (0::real) <= x + y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   272
by (REPEAT(dtac real_le_imp_less_or_eq 1));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   273
by (auto_tac (claset() addIs [real_add_order, real_less_imp_le],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   274
	      simpset()));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   275
qed "real_le_add_order";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   276
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   277
Goal "[| R1 < S1; R2 < S2 |] ==> R1 + R2 < S1 + (S2::real)";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   278
by (dtac real_add_less_mono1 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   279
by (etac real_less_trans 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   280
by (etac real_add_less_mono2 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   281
qed "real_add_less_mono";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   282
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   283
Goal "!!(q1::real). q1 <= q2  ==> x + q1 <= x + q2";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   284
by (Simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   285
qed "real_add_left_le_mono1";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   286
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   287
Goal "[|i<=j;  k<=l |] ==> i + k <= j + (l::real)";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   288
by (dtac real_add_le_mono1 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   289
by (etac real_le_trans 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   290
by (Simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   291
qed "real_add_le_mono";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   292
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   293
Goal "EX (x::real). x < y";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   294
by (rtac (real_add_zero_right RS subst) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   295
by (res_inst_tac [("x","y + (-1r)")] exI 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   296
by (auto_tac (claset() addSIs [real_add_less_mono2],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   297
	  simpset() addsimps [real_minus_zero_less_iff2, real_zero_less_one]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   298
qed "real_less_Ex";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   299
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   300
Goal "(0::real) < r ==>  u + (-r) < u";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   301
by (res_inst_tac [("C","r")] real_less_add_right_cancel 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   302
by (simp_tac (simpset() addsimps [real_add_assoc]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   303
qed "real_add_minus_positive_less_self";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   304
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   305
Goal "((r::real) <= s) = (-s <= -r)";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   306
by (Step_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   307
by (dres_inst_tac [("x","-s")] real_add_left_le_mono1 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   308
by (dres_inst_tac [("x","r")] real_add_left_le_mono1 2);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   309
by Auto_tac;
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   310
by (dres_inst_tac [("z","-r")] real_add_le_mono1 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   311
by (dres_inst_tac [("z","s")] real_add_le_mono1 2);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   312
by (auto_tac (claset(), simpset() addsimps [real_add_assoc]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   313
qed "real_le_minus_iff";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   314
Addsimps [real_le_minus_iff RS sym];
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   315
          
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   316
Goal "0 <= 1r";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   317
by (rtac (real_zero_less_one RS real_less_imp_le) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   318
qed "real_zero_le_one";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   319
Addsimps [real_zero_le_one];
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   320
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   321
Goal "(0::real) <= x*x";
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   322
by (res_inst_tac [("R2.0","0"),("R1.0","x")] real_linear_less2 1);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   323
by (auto_tac (claset() addIs [real_mult_order,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   324
			      real_mult_less_zero1,real_less_imp_le],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   325
	      simpset()));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   326
qed "real_le_square";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   327
Addsimps [real_le_square];
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   328
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   329
(*----------------------------------------------------------------------------
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   330
             An embedding of the naturals in the reals
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   331
 ----------------------------------------------------------------------------*)
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   332
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   333
Goalw [real_of_posnat_def] "real_of_posnat 0 = 1r";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   334
by (full_simp_tac (simpset() addsimps [pnat_one_iff RS sym,real_of_preal_def]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   335
by (fold_tac [real_one_def]);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   336
by (rtac refl 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   337
qed "real_of_posnat_one";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   338
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   339
Goalw [real_of_posnat_def] "real_of_posnat 1 = 1r + 1r";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   340
by (full_simp_tac (simpset() addsimps [real_of_preal_def,real_one_def,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   341
    pnat_two_eq,real_add,prat_of_pnat_add RS sym,preal_of_prat_add RS sym
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   342
    ] @ pnat_add_ac) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   343
qed "real_of_posnat_two";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   344
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   345
Goalw [real_of_posnat_def]
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   346
    "real_of_posnat n1 + real_of_posnat n2 = real_of_posnat (n1 + n2) + 1r";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   347
by (full_simp_tac (simpset() addsimps [real_of_posnat_one RS sym,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   348
    real_of_posnat_def,real_of_preal_add RS sym,preal_of_prat_add RS sym,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   349
    prat_of_pnat_add RS sym,pnat_of_nat_add]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   350
qed "real_of_posnat_add";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   351
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   352
Goal "real_of_posnat (n + 1) = real_of_posnat n + 1r";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   353
by (res_inst_tac [("x1","1r")] (real_add_right_cancel RS iffD1) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   354
by (rtac (real_of_posnat_add RS subst) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   355
by (full_simp_tac (simpset() addsimps [real_of_posnat_two,real_add_assoc]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   356
qed "real_of_posnat_add_one";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   357
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   358
Goal "real_of_posnat (Suc n) = real_of_posnat n + 1r";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   359
by (stac (real_of_posnat_add_one RS sym) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   360
by (Simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   361
qed "real_of_posnat_Suc";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   362
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   363
Goal "inj(real_of_posnat)";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   364
by (rtac injI 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   365
by (rewtac real_of_posnat_def);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   366
by (dtac (inj_real_of_preal RS injD) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   367
by (dtac (inj_preal_of_prat RS injD) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   368
by (dtac (inj_prat_of_pnat RS injD) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   369
by (etac (inj_pnat_of_nat RS injD) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   370
qed "inj_real_of_posnat";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   371
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   372
Goalw [real_of_posnat_def] "0 < real_of_posnat n";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   373
by (rtac (real_gt_zero_preal_Ex RS iffD2) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   374
by (Blast_tac 1);
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   375
qed "real_of_posnat_gt_zero";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   376
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   377
Goal "real_of_posnat n ~= 0";
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   378
by (rtac (real_of_posnat_gt_zero RS real_not_refl2 RS not_sym) 1);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   379
qed "real_of_posnat_not_eq_zero";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   380
Addsimps[real_of_posnat_not_eq_zero];
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   381
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   382
Goal "1r <= real_of_posnat n";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   383
by (simp_tac (simpset() addsimps [real_of_posnat_one RS sym]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   384
by (induct_tac "n" 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   385
by (auto_tac (claset(),
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   386
	      simpset () addsimps [real_of_posnat_Suc,real_of_posnat_one,
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   387
			   real_of_posnat_gt_zero, real_less_imp_le]));
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   388
qed "real_of_posnat_less_one";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   389
Addsimps [real_of_posnat_less_one];
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   390
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   391
Goal "rinv(real_of_posnat n) ~= 0";
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   392
by (rtac ((real_of_posnat_gt_zero RS 
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   393
    real_not_refl2 RS not_sym) RS rinv_not_zero) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   394
qed "real_of_posnat_rinv_not_zero";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   395
Addsimps [real_of_posnat_rinv_not_zero];
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   396
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   397
Goal "rinv(real_of_posnat x) = rinv(real_of_posnat y) ==> x = y";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   398
by (rtac (inj_real_of_posnat RS injD) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   399
by (res_inst_tac [("n2","x")] 
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   400
    (real_of_posnat_rinv_not_zero RS real_mult_left_cancel RS iffD1) 1);
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   401
by (full_simp_tac (simpset() addsimps [(real_of_posnat_gt_zero RS 
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   402
    real_not_refl2 RS not_sym) RS real_mult_inv_left]) 1);
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   403
by (asm_full_simp_tac (simpset() addsimps [(real_of_posnat_gt_zero RS 
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   404
    real_not_refl2 RS not_sym)]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   405
qed "real_of_posnat_rinv_inj";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   406
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   407
Goal "0 < x ==> 0 < rinv x";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   408
by (EVERY1[rtac ccontr, dtac real_leI]);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   409
by (forward_tac [real_minus_zero_less_iff2 RS iffD2] 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   410
by (forward_tac [real_not_refl2 RS not_sym] 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   411
by (dtac (real_not_refl2 RS not_sym RS rinv_not_zero) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   412
by (EVERY1[dtac real_le_imp_less_or_eq, Step_tac]); 
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   413
by (dtac real_mult_less_zero1 1 THEN assume_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   414
by (auto_tac (claset() addIs [real_zero_less_one RS real_less_asym],
9053
paulson
parents: 9043
diff changeset
   415
	      simpset()));
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   416
qed "real_rinv_gt_zero";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   417
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   418
Goal "x < 0 ==> rinv x < 0";
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7334
diff changeset
   419
by (ftac real_not_refl2 1);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   420
by (dtac (real_minus_zero_less_iff RS iffD2) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   421
by (rtac (real_minus_zero_less_iff RS iffD1) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   422
by (dtac (real_minus_rinv RS sym) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   423
by (auto_tac (claset() addIs [real_rinv_gt_zero], simpset()));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   424
qed "real_rinv_less_zero";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   425
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   426
Goal "0 < rinv(real_of_posnat n)";
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   427
by (rtac (real_of_posnat_gt_zero RS real_rinv_gt_zero) 1);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   428
qed "real_of_posnat_rinv_gt_zero";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   429
Addsimps [real_of_posnat_rinv_gt_zero];
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   430
10043
a0364652e115 Updated Files with new theorems
fleuriot
parents: 9825
diff changeset
   431
Goal "real_of_preal (preal_of_prat (prat_of_pnat (pnat_of_nat N))) = \
a0364652e115 Updated Files with new theorems
fleuriot
parents: 9825
diff changeset
   432
\     real_of_nat (Suc N)";
a0364652e115 Updated Files with new theorems
fleuriot
parents: 9825
diff changeset
   433
by (simp_tac (simpset() addsimps [real_of_nat_def,real_of_posnat_Suc,
a0364652e115 Updated Files with new theorems
fleuriot
parents: 9825
diff changeset
   434
    real_add_assoc,(real_of_posnat_def RS meta_eq_to_obj_eq) RS sym]) 1);
a0364652e115 Updated Files with new theorems
fleuriot
parents: 9825
diff changeset
   435
qed "real_of_preal_real_of_nat_Suc";
a0364652e115 Updated Files with new theorems
fleuriot
parents: 9825
diff changeset
   436
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   437
Goal "x+x = x*(1r+1r)";
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   438
by (simp_tac (simpset() addsimps [real_add_mult_distrib2]) 1);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   439
qed "real_add_self";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   440
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   441
Goal "x < x + 1r";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   442
by (rtac (real_less_sum_gt_0_iff RS iffD1) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   443
by (full_simp_tac (simpset() addsimps [real_zero_less_one,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   444
				real_add_assoc, real_add_left_commute]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   445
qed "real_self_less_add_one";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   446
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   447
Goal "1r < 1r + 1r";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   448
by (rtac real_self_less_add_one 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   449
qed "real_one_less_two";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   450
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   451
Goal "0 < 1r + 1r";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   452
by (rtac ([real_zero_less_one,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   453
	   real_one_less_two] MRS real_less_trans) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   454
qed "real_zero_less_two";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   455
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   456
Goal "1r + 1r ~= 0";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   457
by (rtac (real_zero_less_two RS real_not_refl2 RS not_sym) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   458
qed "real_two_not_zero";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   459
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   460
Addsimps [real_two_not_zero];
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   461
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   462
Goal "x*rinv(1r + 1r) + x*rinv(1r + 1r) = x";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   463
by (stac real_add_self 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   464
by (full_simp_tac (simpset() addsimps [real_mult_assoc]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   465
qed "real_sum_of_halves";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   466
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   467
Goal "[| (0::real) < z; x < y |] ==> x*z < y*z";       
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   468
by (rotate_tac 1 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   469
by (dtac real_less_sum_gt_zero 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   470
by (rtac real_sum_gt_zero_less 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   471
by (dtac real_mult_order 1 THEN assume_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   472
by (asm_full_simp_tac (simpset() addsimps [real_add_mult_distrib2,
9053
paulson
parents: 9043
diff changeset
   473
					   real_mult_commute ]) 1);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   474
qed "real_mult_less_mono1";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   475
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   476
Goal "[| (0::real) < z; x < y |] ==> z*x < z*y";       
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   477
by (asm_simp_tac (simpset() addsimps [real_mult_commute,real_mult_less_mono1]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   478
qed "real_mult_less_mono2";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   479
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   480
Goal "[| (0::real) < z; x*z < y*z |] ==> x < y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   481
by (forw_inst_tac [("x","x*z")] (real_rinv_gt_zero 
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   482
                       RS real_mult_less_mono1) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   483
by (auto_tac (claset(),
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   484
	      simpset() addsimps 
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   485
     [real_mult_assoc,real_not_refl2 RS not_sym]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   486
qed "real_mult_less_cancel1";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   487
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   488
Goal "[| (0::real) < z; z*x < z*y |] ==> x < y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   489
by (etac real_mult_less_cancel1 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   490
by (asm_full_simp_tac (simpset() addsimps [real_mult_commute]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   491
qed "real_mult_less_cancel2";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   492
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   493
Goal "(0::real) < z ==> (x*z < y*z) = (x < y)";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   494
by (blast_tac (claset() addIs [real_mult_less_mono1,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   495
    real_mult_less_cancel1]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   496
qed "real_mult_less_iff1";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   497
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   498
Goal "(0::real) < z ==> (z*x < z*y) = (x < y)";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   499
by (blast_tac (claset() addIs [real_mult_less_mono2,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   500
    real_mult_less_cancel2]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   501
qed "real_mult_less_iff2";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   502
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   503
Addsimps [real_mult_less_iff1,real_mult_less_iff2];
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   504
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   505
(* 05/00 *)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   506
Goalw [real_le_def] "[| (0::real) < z; x*z<=y*z |] ==> x<=y";
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   507
by (Auto_tac);
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   508
qed "real_mult_le_cancel1";
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   509
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   510
Goalw [real_le_def] "[| (0::real) < z; z*x<=z*y |] ==> x<=y";
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   511
by (Auto_tac);
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   512
qed "real_mult_le_cancel2";
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   513
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   514
Goalw [real_le_def] "(0::real) < z ==> (x*z <= y*z) = (x <= y)";
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   515
by (Auto_tac);
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   516
qed "real_mult_le_cancel_iff1";
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   517
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   518
Goalw [real_le_def] "(0::real) < z ==> (z*x <= z*y) = (x <= y)";
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   519
by (Auto_tac);
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   520
qed "real_mult_le_cancel_iff2";
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   521
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   522
Addsimps [real_mult_le_cancel_iff1,real_mult_le_cancel_iff2];
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   523
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   524
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   525
Goal "[| (0::real) <= z; x < y |] ==> x*z <= y*z";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   526
by (EVERY1 [rtac real_less_or_eq_imp_le, dtac real_le_imp_less_or_eq]);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   527
by (auto_tac (claset() addIs [real_mult_less_mono1],simpset()));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   528
qed "real_mult_le_less_mono1";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   529
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   530
Goal "[| (0::real) <= z; x < y |] ==> z*x <= z*y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   531
by (asm_simp_tac (simpset() addsimps [real_mult_commute,real_mult_le_less_mono1]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   532
qed "real_mult_le_less_mono2";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   533
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   534
Goal "[| (0::real) <= z; x <= y |] ==> z*x <= z*y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   535
by (dres_inst_tac [("x","x")] real_le_imp_less_or_eq 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   536
by (auto_tac (claset() addIs [real_mult_le_less_mono2], simpset()));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   537
qed "real_mult_le_le_mono1";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   538
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   539
Goal "[| (0::real) < r1; r1 < r2; 0 < x; x < y|] ==> r1 * x < r2 * y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   540
by (dres_inst_tac [("x","x")] real_mult_less_mono2 1);
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   541
by (dres_inst_tac [("R1.0","0")] real_less_trans 2);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   542
by (dres_inst_tac [("x","r1")] real_mult_less_mono1 3);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   543
by Auto_tac;
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   544
by (blast_tac (claset() addIs [real_less_trans]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   545
qed "real_mult_less_mono";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   546
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   547
Goal "[| (0::real) < r1; r1  < r2;  0 < y|] ==> 0 < r2 * y";
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   548
by (rtac real_mult_order 1); 
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   549
by (assume_tac 2);
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   550
by (blast_tac (claset() addIs [real_less_trans]) 1);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   551
qed "real_mult_order_trans";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   552
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   553
Goal "[| (0::real) < r1; r1  < r2;  0 <= x; x < y|] ==> r1 * x < r2 * y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   554
by (auto_tac (claset() addSDs [real_le_imp_less_or_eq] 
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   555
	               addIs [real_mult_less_mono,real_mult_order_trans],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   556
              simpset()));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   557
qed "real_mult_less_mono3";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   558
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   559
Goal "[| (0::real) <= r1; r1  < r2;  0 <= x; x < y|] ==> r1 * x < r2 * y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   560
by (auto_tac (claset() addSDs [real_le_imp_less_or_eq] 
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   561
	               addIs [real_mult_less_mono,real_mult_order_trans,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   562
			      real_mult_order],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   563
	      simpset()));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   564
by (dres_inst_tac [("R2.0","x")] real_less_trans 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   565
by (assume_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   566
by (blast_tac (claset() addIs [real_mult_order]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   567
qed "real_mult_less_mono4";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   568
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   569
Goal "[| (0::real) < r1; r1 <= r2;  0 <= x; x <= y |] ==> r1 * x <= r2 * y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   570
by (rtac real_less_or_eq_imp_le 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   571
by (REPEAT(dtac real_le_imp_less_or_eq 1));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   572
by (auto_tac (claset() addIs [real_mult_less_mono,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   573
			      real_mult_order_trans,real_mult_order],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   574
	      simpset()));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   575
qed "real_mult_le_mono";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   576
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   577
Goal "[| (0::real) < r1; r1 < r2;  0 <= x; x <= y |] ==> r1 * x <= r2 * y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   578
by (rtac real_less_or_eq_imp_le 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   579
by (REPEAT(dtac real_le_imp_less_or_eq 1));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   580
by (auto_tac (claset() addIs [real_mult_less_mono, real_mult_order_trans,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   581
			      real_mult_order],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   582
	      simpset()));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   583
qed "real_mult_le_mono2";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   584
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   585
Goal "[| (0::real) <= r1; r1 < r2;  0 <= x; x <= y |] ==> r1 * x <= r2 * y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   586
by (dtac real_le_imp_less_or_eq 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   587
by (auto_tac (claset() addIs [real_mult_le_mono2],simpset()));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   588
by (dtac real_le_trans 1 THEN assume_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   589
by (auto_tac (claset() addIs [real_less_le_mult_order], simpset()));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   590
qed "real_mult_le_mono3";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   591
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   592
Goal "[| (0::real) <= r1; r1 <= r2;  0 <= x; x <= y |] ==> r1 * x <= r2 * y";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   593
by (dres_inst_tac [("x","r1")] real_le_imp_less_or_eq 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   594
by (auto_tac (claset() addIs [real_mult_le_mono3, real_mult_le_le_mono1],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   595
	      simpset()));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   596
qed "real_mult_le_mono4";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   597
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   598
Goal "1r <= x ==> 0 < x";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   599
by (rtac ccontr 1 THEN dtac real_leI 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   600
by (dtac real_le_trans 1 THEN assume_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   601
by (auto_tac (claset() addDs [real_zero_less_one RSN (2,real_le_less_trans)],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   602
	      simpset() addsimps [real_less_not_refl]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   603
qed "real_gt_zero";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   604
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   605
Goal "[| 1r < r; 1r <= x |]  ==> x <= r * x";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   606
by (dtac (real_gt_zero RS real_less_imp_le) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   607
by (auto_tac (claset() addSDs [real_mult_le_less_mono1],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   608
    simpset()));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   609
qed "real_mult_self_le";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   610
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   611
Goal "[| 1r <= r; 1r <= x |]  ==> x <= r * x";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   612
by (dtac real_le_imp_less_or_eq 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   613
by (auto_tac (claset() addIs [real_mult_self_le],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   614
	      simpset() addsimps [real_le_refl]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   615
qed "real_mult_self_le2";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   616
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   617
Goal "x < y ==> x < (x + y)*rinv(1r + 1r)";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   618
by (dres_inst_tac [("C","x")] real_add_less_mono2 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   619
by (dtac (real_add_self RS subst) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   620
by (dtac (real_zero_less_two RS real_rinv_gt_zero RS 
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   621
          real_mult_less_mono1) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   622
by (asm_full_simp_tac (simpset() addsimps [real_mult_assoc]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   623
qed "real_less_half_sum";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   624
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   625
Goal "x < y ==> (x + y)*rinv(1r + 1r) < y";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   626
by (dtac real_add_less_mono1 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   627
by (dtac (real_add_self RS subst) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   628
by (dtac (real_zero_less_two RS real_rinv_gt_zero RS 
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   629
          real_mult_less_mono1) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   630
by (asm_full_simp_tac (simpset() addsimps [real_mult_assoc]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   631
qed "real_gt_half_sum";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   632
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   633
Goal "x < y ==> EX r::real. x < r & r < y";
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   634
by (blast_tac (claset() addSIs [real_less_half_sum, real_gt_half_sum]) 1);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   635
qed "real_dense";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   636
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   637
Goal "(EX n. rinv(real_of_posnat n) < r) = (EX n. 1r < r * real_of_posnat n)";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   638
by (Step_tac 1);
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   639
by (dres_inst_tac [("n1","n")] (real_of_posnat_gt_zero 
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   640
				RS real_mult_less_mono1) 1);
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   641
by (dres_inst_tac [("n2","n")] (real_of_posnat_gt_zero RS 
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   642
				real_rinv_gt_zero RS real_mult_less_mono1) 2);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   643
by (auto_tac (claset(),
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   644
	      simpset() addsimps [(real_of_posnat_gt_zero RS 
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   645
				   real_not_refl2 RS not_sym),
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   646
				  real_mult_assoc]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   647
qed "real_of_posnat_rinv_Ex_iff";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   648
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   649
Goal "(rinv(real_of_posnat n) < r) = (1r < r * real_of_posnat n)";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   650
by (Step_tac 1);
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   651
by (dres_inst_tac [("n1","n")] (real_of_posnat_gt_zero 
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   652
                       RS real_mult_less_mono1) 1);
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   653
by (dres_inst_tac [("n2","n")] (real_of_posnat_gt_zero RS 
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   654
				real_rinv_gt_zero RS real_mult_less_mono1) 2);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   655
by (auto_tac (claset(), simpset() addsimps [real_mult_assoc]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   656
qed "real_of_posnat_rinv_iff";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   657
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   658
Goal "(rinv(real_of_posnat n) <= r) = (1r <= r * real_of_posnat n)";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   659
by (Step_tac 1);
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   660
by (dres_inst_tac [("n2","n")] (real_of_posnat_gt_zero RS 
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   661
    real_less_imp_le RS real_mult_le_le_mono1) 1);
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   662
by (dres_inst_tac [("n3","n")] (real_of_posnat_gt_zero RS 
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   663
        real_rinv_gt_zero RS real_less_imp_le RS 
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   664
        real_mult_le_le_mono1) 2);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   665
by (auto_tac (claset(), simpset() addsimps real_mult_ac));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   666
qed "real_of_posnat_rinv_le_iff";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   667
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   668
Goalw [real_of_posnat_def] "(real_of_posnat n < real_of_posnat m) = (n < m)";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   669
by Auto_tac;
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   670
qed "real_of_posnat_less_iff";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   671
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   672
Addsimps [real_of_posnat_less_iff];
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   673
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   674
Goal "0 < u  ==> (u < rinv (real_of_posnat n)) = (real_of_posnat n < rinv(u))";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   675
by (Step_tac 1);
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   676
by (res_inst_tac [("n2","n")] (real_of_posnat_gt_zero RS 
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   677
    real_rinv_gt_zero RS real_mult_less_cancel1) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   678
by (res_inst_tac [("x1","u")] ( real_rinv_gt_zero
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   679
   RS real_mult_less_cancel1) 2);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   680
by (auto_tac (claset(),
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   681
	      simpset() addsimps [real_of_posnat_gt_zero, 
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   682
    real_not_refl2 RS not_sym]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   683
by (res_inst_tac [("z","u")] real_mult_less_cancel2 1);
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   684
by (res_inst_tac [("n1","n")] (real_of_posnat_gt_zero RS 
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   685
    real_mult_less_cancel2) 3);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   686
by (auto_tac (claset(),
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   687
	      simpset() addsimps [real_of_posnat_gt_zero, 
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   688
    real_not_refl2 RS not_sym,real_mult_assoc RS sym]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   689
qed "real_of_posnat_less_rinv_iff";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   690
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   691
Goal "0 < u ==> (u = rinv(real_of_posnat n)) = (real_of_posnat n = rinv u)";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   692
by (auto_tac (claset(),
9825
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   693
	      simpset() addsimps [real_rinv_rinv, real_of_posnat_gt_zero, 
a0fcf6f0436c Renamed real_of_posnat_less_zero to real_of_posnat_gt_zero
paulson
parents: 9434
diff changeset
   694
				  real_not_refl2 RS not_sym]));
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   695
qed "real_of_posnat_rinv_eq_iff";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   696
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   697
Goal "[| 0 < r; r < x |] ==> rinv x < rinv r";
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7334
diff changeset
   698
by (ftac real_less_trans 1 THEN assume_tac 1);
23e090051cb8 isatool expandshort;
wenzelm
parents: 7334
diff changeset
   699
by (ftac real_rinv_gt_zero 1);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   700
by (forw_inst_tac [("x","x")] real_rinv_gt_zero 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   701
by (forw_inst_tac [("x","r"),("z","rinv r")] real_mult_less_mono1 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   702
by (assume_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   703
by (asm_full_simp_tac (simpset() addsimps [real_not_refl2 RS 
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   704
					   not_sym RS real_mult_inv_right]) 1);
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7334
diff changeset
   705
by (ftac real_rinv_gt_zero 1);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   706
by (forw_inst_tac [("x","1r"),("z","rinv x")] real_mult_less_mono2 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   707
by (assume_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   708
by (asm_full_simp_tac (simpset() addsimps [real_not_refl2 RS 
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   709
         not_sym RS real_mult_inv_left,real_mult_assoc RS sym]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   710
qed "real_rinv_less_swap";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   711
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   712
Goal "[| 0 < r; 0 < x|] ==> (r < x) = (rinv x < rinv r)";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   713
by (auto_tac (claset() addIs [real_rinv_less_swap],simpset()));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   714
by (res_inst_tac [("t","r")] (real_rinv_rinv RS subst) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   715
by (etac (real_not_refl2 RS not_sym) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   716
by (res_inst_tac [("t","x")] (real_rinv_rinv RS subst) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   717
by (etac (real_not_refl2 RS not_sym) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   718
by (auto_tac (claset() addIs [real_rinv_less_swap],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   719
	      simpset() addsimps [real_rinv_gt_zero]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   720
qed "real_rinv_less_iff";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   721
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   722
Goal "r < r + rinv(real_of_posnat n)";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   723
by (res_inst_tac [("C","-r")] real_less_add_left_cancel 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   724
by (full_simp_tac (simpset() addsimps [real_add_assoc RS sym]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   725
qed "real_add_rinv_real_of_posnat_less";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   726
Addsimps [real_add_rinv_real_of_posnat_less];
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   727
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   728
Goal "r <= r + rinv(real_of_posnat n)";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   729
by (rtac real_less_imp_le 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   730
by (Simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   731
qed "real_add_rinv_real_of_posnat_le";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   732
Addsimps [real_add_rinv_real_of_posnat_le];
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   733
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   734
Goal "r + (-rinv(real_of_posnat n)) < r";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   735
by (res_inst_tac [("C","-r")] real_less_add_left_cancel 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   736
by (full_simp_tac (simpset() addsimps [real_add_assoc RS sym,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   737
				       real_minus_zero_less_iff2]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   738
qed "real_add_minus_rinv_real_of_posnat_less";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   739
Addsimps [real_add_minus_rinv_real_of_posnat_less];
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   740
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   741
Goal "r + (-rinv(real_of_posnat n)) <= r";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   742
by (rtac real_less_imp_le 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   743
by (Simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   744
qed "real_add_minus_rinv_real_of_posnat_le";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   745
Addsimps [real_add_minus_rinv_real_of_posnat_le];
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   746
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   747
Goal "0 < r ==> r*(1r + (-rinv(real_of_posnat n))) < r";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   748
by (simp_tac (simpset() addsimps [real_add_mult_distrib2]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   749
by (res_inst_tac [("C","-r")] real_less_add_left_cancel 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   750
by (auto_tac (claset() addIs [real_mult_order],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   751
	      simpset() addsimps [real_add_assoc RS sym,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   752
				  real_minus_zero_less_iff2]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   753
qed "real_mult_less_self";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   754
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   755
Goal "0 <= 1r + (-rinv(real_of_posnat n))";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   756
by (res_inst_tac [("C","rinv(real_of_posnat n)")] real_le_add_right_cancel 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   757
by (simp_tac (simpset() addsimps [real_add_assoc,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   758
				  real_of_posnat_rinv_le_iff]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   759
qed "real_add_one_minus_rinv_ge_zero";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   760
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   761
Goal "0 < r ==> 0 <= r*(1r + (-rinv(real_of_posnat n)))";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   762
by (dtac (real_add_one_minus_rinv_ge_zero RS real_mult_le_less_mono1) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   763
by Auto_tac;
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   764
qed "real_mult_add_one_minus_ge_zero";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   765
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   766
Goal "(x*y = 0) = (x = 0 | y = (0::real))";
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   767
by Auto_tac;
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   768
by (blast_tac (claset() addIs [ccontr] addDs [real_mult_not_zero]) 1);
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   769
qed "real_mult_is_0";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   770
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   771
Goal "(0 = x*y) = (0 = x | (0::real) = y)";
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   772
by (stac eq_commute 1 THEN stac real_mult_is_0 1);
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   773
by Auto_tac;
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   774
qed "real_0_is_mult";
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   775
AddIffs [real_mult_is_0, real_0_is_mult];
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   776
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   777
Goal "[| x ~= 1r; y * x = y |] ==> y = 0";
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   778
by (subgoal_tac "y*(1r + -x) = 0" 1);
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   779
by (stac real_add_mult_distrib2 2);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   780
by (auto_tac (claset(),
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   781
	      simpset() addsimps [real_eq_minus_iff2 RS sym]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   782
qed "real_mult_eq_self_zero";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   783
Addsimps [real_mult_eq_self_zero];
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   784
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   785
Goal "[| x ~= 1r; y = y * x |] ==> y = 0";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   786
by (dtac sym 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   787
by (Asm_full_simp_tac 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   788
qed "real_mult_eq_self_zero2";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   789
Addsimps [real_mult_eq_self_zero2];
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   790
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   791
Goal "[| 0 <= x*y; 0 < x |] ==> (0::real) <= y";
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 7334
diff changeset
   792
by (ftac real_rinv_gt_zero 1);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   793
by (dres_inst_tac [("x","rinv x")] real_less_le_mult_order 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   794
by (dtac (real_not_refl2 RS not_sym RS real_mult_inv_left) 2);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   795
by (auto_tac (claset(),
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   796
	      simpset() addsimps [real_mult_assoc RS sym]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   797
qed "real_mult_ge_zero_cancel";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   798
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   799
Goal "[|x ~= 0; y ~= 0 |] ==> rinv(x) + rinv(y) = (x + y)*rinv(x*y)";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   800
by (asm_full_simp_tac (simpset() addsimps 
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   801
		       [real_rinv_distrib,real_add_mult_distrib,
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   802
			real_mult_assoc RS sym]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   803
by (stac real_mult_assoc 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   804
by (rtac (real_mult_left_commute RS subst) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   805
by (asm_full_simp_tac (simpset() addsimps [real_add_commute]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   806
qed "real_rinv_add";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   807
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   808
(* 05/00 *)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   809
Goal "(0 <= -R) = (R <= (0::real))";
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   810
by (auto_tac (claset() addDs [sym],
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   811
    simpset() addsimps [real_le_less]));
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   812
qed "real_minus_zero_le_iff";
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   813
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   814
Goal "(-R <= 0) = ((0::real) <= R)";
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   815
by (auto_tac (claset(),simpset() addsimps 
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   816
    [real_minus_zero_less_iff2,real_le_less]));
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   817
qed "real_minus_zero_le_iff2";
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   818
9053
paulson
parents: 9043
diff changeset
   819
Addsimps [real_minus_zero_le_iff, real_minus_zero_le_iff2];
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   820
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   821
Goal "x * x + y * y = 0 ==> x = (0::real)";
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   822
by (dtac real_add_minus_eq_minus 1);
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   823
by (cut_inst_tac [("x","x")] real_le_square 1);
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   824
by (Auto_tac THEN dtac real_le_anti_sym 1);
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   825
by Auto_tac;
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   826
qed "real_sum_squares_cancel";
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   827
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   828
Goal "x * x + y * y = 0 ==> y = (0::real)";
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   829
by (res_inst_tac [("y","x")] real_sum_squares_cancel 1);
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   830
by (asm_full_simp_tac (simpset() addsimps [real_add_commute]) 1);
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   831
qed "real_sum_squares_cancel2";
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   832
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   833
(*----------------------------------------------------------------------------
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   834
     Some convenient biconditionals for products of signs (lcp)
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   835
 ----------------------------------------------------------------------------*)
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   836
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   837
Goal "((0::real) < x*y) = (0 < x & 0 < y | x < 0 & y < 0)";
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   838
by (auto_tac (claset(), 
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   839
              simpset() addsimps [order_le_less, linorder_not_less, 
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   840
                                  real_mult_order, real_mult_less_zero1]));
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   841
by (ALLGOALS (rtac ccontr)); 
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   842
by (auto_tac (claset(), simpset() addsimps [order_le_less, linorder_not_less]));
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   843
by (ALLGOALS (etac rev_mp)); 
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   844
by (ALLGOALS (dtac real_mult_less_zero THEN' assume_tac));
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   845
by (auto_tac (claset() addDs [order_less_not_sym], 
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   846
              simpset() addsimps [real_mult_commute]));  
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   847
qed "real_zero_less_mult_iff";
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   848
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   849
Goal "((0::real) <= x*y) = (0 <= x & 0 <= y | x <= 0 & y <= 0)";
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   850
by (auto_tac (claset(), 
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   851
              simpset() addsimps [order_le_less, linorder_not_less,  
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   852
                                  real_zero_less_mult_iff]));
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   853
qed "real_zero_le_mult_iff";
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   854
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   855
Goal "(x*y < (0::real)) = (0 < x & y < 0 | x < 0 & 0 < y)";
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   856
by (auto_tac (claset(), 
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   857
              simpset() addsimps [real_zero_le_mult_iff, 
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   858
                                  linorder_not_le RS sym]));
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   859
by (auto_tac (claset() addDs [order_less_not_sym],  
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   860
              simpset() addsimps [linorder_not_le]));
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   861
qed "real_mult_less_zero_iff";
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   862
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   863
Goal "(x*y <= (0::real)) = (0 <= x & y <= 0 | x <= 0 & 0 <= y)";
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   864
by (auto_tac (claset() addDs [order_less_not_sym], 
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   865
              simpset() addsimps [real_zero_less_mult_iff, 
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   866
                                  linorder_not_less RS sym]));
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   867
qed "real_mult_le_zero_iff";
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   868
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   869
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   870
(*----------------------------------------------------------------------------
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   871
     Another embedding of the naturals in the reals (see real_of_posnat)
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   872
 ----------------------------------------------------------------------------*)
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   873
Goalw [real_of_nat_def] "real_of_nat 0 = 0";
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   874
by (simp_tac (simpset() addsimps [real_of_posnat_one]) 1);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   875
qed "real_of_nat_zero";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   876
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   877
Goalw [real_of_nat_def] "real_of_nat 1 = 1r";
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   878
by (simp_tac (simpset() addsimps [real_of_posnat_two, real_add_assoc]) 1);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   879
qed "real_of_nat_one";
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   880
Addsimps [real_of_nat_zero, real_of_nat_one];
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   881
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   882
Goalw [real_of_nat_def]
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   883
     "real_of_nat (m + n) = real_of_nat m + real_of_nat n";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   884
by (simp_tac (simpset() addsimps 
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   885
              [real_of_posnat_add,real_add_assoc RS sym]) 1);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   886
qed "real_of_nat_add";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   887
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   888
Goalw [real_of_nat_def] "real_of_nat (Suc n) = real_of_nat n + 1r";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   889
by (simp_tac (simpset() addsimps [real_of_posnat_Suc] @ real_add_ac) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   890
qed "real_of_nat_Suc";
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   891
Addsimps [real_of_nat_Suc];
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   892
    
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   893
Goalw [real_of_nat_def] "(real_of_nat n < real_of_nat m) = (n < m)";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   894
by Auto_tac;
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   895
qed "real_of_nat_less_iff";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   896
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   897
AddIffs [real_of_nat_less_iff];
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   898
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   899
Goal "inj real_of_nat";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   900
by (rtac injI 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   901
by (auto_tac (claset() addSIs [inj_real_of_posnat RS injD],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   902
	      simpset() addsimps [real_of_nat_def,real_add_right_cancel]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   903
qed "inj_real_of_nat";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   904
9043
ca761fe227d8 First round of changes, towards installation of simprocs
paulson
parents: 9013
diff changeset
   905
Goalw [real_of_nat_def] "0 <= real_of_nat n";
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   906
by (res_inst_tac [("C","1r")] real_le_add_right_cancel 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   907
by (asm_full_simp_tac (simpset() addsimps [real_add_assoc]) 1);
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   908
qed "real_of_nat_ge_zero";
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   909
AddIffs [real_of_nat_ge_zero];
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   910
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   911
Goal "real_of_nat (m * n) = real_of_nat m * real_of_nat n";
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   912
by (induct_tac "m" 1);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   913
by (auto_tac (claset(),
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   914
	      simpset() addsimps [real_of_nat_add,
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   915
				  real_add_mult_distrib, real_add_commute]));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   916
qed "real_of_nat_mult";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   917
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   918
Goal "(real_of_nat n = real_of_nat m) = (n = m)";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   919
by (auto_tac (claset() addDs [inj_real_of_nat RS injD],
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   920
              simpset()));
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   921
qed "real_of_nat_eq_cancel";
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   922
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   923
Goal "n <= m --> real_of_nat (m - n) = real_of_nat m + (-real_of_nat n)";
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   924
by (induct_tac "m" 1);
7334
a90fc1e5fb19 Real/Real.thy main entry point;
wenzelm
parents:
diff changeset
   925
by (auto_tac (claset(),
8867
06dcd62f65ad deleted a lot of obsolete arithmetic lemmas
paulson
parents: 8856
diff changeset
   926
	      simpset() addsimps [Suc_diff_le, le_Suc_eq, real_of_nat_Suc, 
06dcd62f65ad deleted a lot of obsolete arithmetic lemmas
paulson
parents: 8856
diff changeset
   927
				  real_of_nat_zero] @ real_add_ac));
06dcd62f65ad deleted a lot of obsolete arithmetic lemmas
paulson
parents: 8856
diff changeset
   928
qed_spec_mp "real_of_nat_minus";
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   929
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   930
(* 05/00 *)
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   931
Goal "n < m ==> real_of_nat (m - n) = \
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   932
\     real_of_nat m + -real_of_nat n";
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   933
by (auto_tac (claset() addIs [real_of_nat_minus],simpset()));
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   934
qed "real_of_nat_minus2";
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   935
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   936
Goalw [real_diff_def]
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   937
     "n < m ==> real_of_nat (m - n) = real_of_nat m - real_of_nat n";
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   938
by (etac real_of_nat_minus2 1);
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   939
qed "real_of_nat_diff";
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   940
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   941
Goalw [real_diff_def]
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   942
     "n <= m ==> real_of_nat (m - n) = real_of_nat m - real_of_nat n";
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   943
by (etac real_of_nat_minus 1);
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   944
qed "real_of_nat_diff2";
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   945
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   946
Goal "(real_of_nat n = 0) = (n = 0)";
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   947
by (auto_tac (claset() addIs [inj_real_of_nat RS injD], simpset()));
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   948
qed "real_of_nat_zero_iff";
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   949
AddIffs [real_of_nat_zero_iff];
9013
9dd0274f76af Updated files to remove 0r and 1r from theorems in descendant theories
fleuriot
parents: 8867
diff changeset
   950
9069
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   951
Goal "neg z ==> real_of_nat (nat z) = 0";
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   952
by (asm_simp_tac (simpset() addsimps [neg_nat, real_of_nat_zero]) 1);
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   953
qed "real_of_nat_neg_int";
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   954
Addsimps [real_of_nat_neg_int];
e8d530582061 a big tidy-up
paulson
parents: 9053
diff changeset
   955