108 qed "le_real_number_of_eq_not_less"; |
108 qed "le_real_number_of_eq_not_less"; |
109 |
109 |
110 Addsimps [le_real_number_of_eq_not_less]; |
110 Addsimps [le_real_number_of_eq_not_less]; |
111 |
111 |
112 |
112 |
113 (** rabs (absolute value) **) |
113 (** abs (absolute value) **) |
114 |
114 |
115 Goalw [rabs_def] |
115 Goalw [abs_real_def] |
116 "rabs (number_of v :: real) = \ |
116 "abs (number_of v :: real) = \ |
117 \ (if neg (number_of v) then number_of (bin_minus v) \ |
117 \ (if neg (number_of v) then number_of (bin_minus v) \ |
118 \ else number_of v)"; |
118 \ else number_of v)"; |
119 by (simp_tac |
119 by (simp_tac |
120 (simpset_of Int.thy addsimps |
120 (simpset_of Int.thy addsimps |
121 bin_arith_simps@ |
121 bin_arith_simps@ |
122 [minus_real_number_of, zero_eq_numeral_0, le_real_number_of_eq_not_less, |
122 [minus_real_number_of, zero_eq_numeral_0, le_real_number_of_eq_not_less, |
123 less_real_number_of, real_of_int_le_iff]) 1); |
123 less_real_number_of, real_of_int_le_iff]) 1); |
124 qed "rabs_nat_number_of"; |
124 qed "abs_nat_number_of"; |
125 |
125 |
126 Addsimps [rabs_nat_number_of]; |
126 Addsimps [abs_nat_number_of]; |
127 |
127 |
128 |
128 |
129 (*** New versions of existing theorems involving 0r, 1r ***) |
129 (*** New versions of existing theorems involving 0r, 1r ***) |
130 |
130 |
131 Goal "- #1 = (#-1::real)"; |
131 Goal "- #1 = (#-1::real)"; |
208 "fast_real_arith" real_arith_simproc_pats Fast_Arith.lin_arith_prover; |
208 "fast_real_arith" real_arith_simproc_pats Fast_Arith.lin_arith_prover; |
209 in |
209 in |
210 Addsimprocs [fast_real_arith_simproc] |
210 Addsimprocs [fast_real_arith_simproc] |
211 end; |
211 end; |
212 |
212 |
213 Goalw [rabs_def] |
213 Goalw [abs_real_def] |
214 "P(rabs x) = ((#0 <= x --> P x) & (x < #0 --> P(-x)))"; |
214 "P(abs (x::real)) = ((#0 <= x --> P x) & (x < #0 --> P(-x)))"; |
215 by(auto_tac (claset(), simpset() addsimps [zero_eq_numeral_0])); |
215 by(auto_tac (claset(), simpset() addsimps [zero_eq_numeral_0])); |
216 qed "rabs_split"; |
216 qed "abs_split"; |
217 |
217 |
218 arith_tac_split_thms := !arith_tac_split_thms @ [rabs_split]; |
218 arith_tac_split_thms := !arith_tac_split_thms @ [abs_split]; |
219 |
219 |