src/Doc/Tutorial/Types/Numbers.thy
changeset 68635 8094b853a92f
parent 67443 3abf6a722518
child 68636 f33ffa0a27a1
equal deleted inserted replaced
68634:db0980691ef4 68635:8094b853a92f
   115 \rulename{dvd_antisym}
   115 \rulename{dvd_antisym}
   116 
   116 
   117 @{thm[display] dvd_add[no_vars]}
   117 @{thm[display] dvd_add[no_vars]}
   118 \rulename{dvd_add}
   118 \rulename{dvd_add}
   119 
   119 
   120 For the integers, I'd list a few theorems that somehow involve negative 
   120 For the integers, I'd list a few theorems that somehow involve negative
   121 numbers.\<close>
   121 numbers.\<close>
   122 
   122 
   123 
   123 
   124 text\<open>
   124 text\<open>
   125 Division, remainder of negatives
   125 Division, remainder of negatives
   135 \rulename{neg_mod_sign}
   135 \rulename{neg_mod_sign}
   136 
   136 
   137 @{thm[display] neg_mod_bound[no_vars]}
   137 @{thm[display] neg_mod_bound[no_vars]}
   138 \rulename{neg_mod_bound}
   138 \rulename{neg_mod_bound}
   139 
   139 
   140 @{thm[display] zdiv_zadd1_eq[no_vars]}
   140 @{thm[display] div_add1_eq[no_vars]}
   141 \rulename{zdiv_zadd1_eq}
   141 \rulename{div_add1_eq}
   142 
   142 
   143 @{thm[display] mod_add_eq[no_vars]}
   143 @{thm[display] mod_add_eq[no_vars]}
   144 \rulename{mod_add_eq}
   144 \rulename{mod_add_eq}
   145 
   145 
   146 @{thm[display] zdiv_zmult1_eq[no_vars]}
   146 @{thm[display] zdiv_zmult1_eq[no_vars]}
   152 @{thm[display] zdiv_zmult2_eq[no_vars]}
   152 @{thm[display] zdiv_zmult2_eq[no_vars]}
   153 \rulename{zdiv_zmult2_eq}
   153 \rulename{zdiv_zmult2_eq}
   154 
   154 
   155 @{thm[display] zmod_zmult2_eq[no_vars]}
   155 @{thm[display] zmod_zmult2_eq[no_vars]}
   156 \rulename{zmod_zmult2_eq}
   156 \rulename{zmod_zmult2_eq}
   157 \<close>  
   157 \<close>
   158 
   158 
   159 lemma "abs (x+y) \<le> abs x + abs (y :: int)"
   159 lemma "abs (x+y) \<le> abs x + abs (y :: int)"
   160 by arith
   160 by arith
   161 
   161 
   162 lemma "abs (2*x) = 2 * abs (x :: int)"
   162 lemma "abs (2*x) = 2 * abs (x :: int)"
   163 by (simp add: abs_if) 
   163 by (simp add: abs_if)
   164 
   164 
   165 
   165 
   166 text \<open>Induction rules for the Integers
   166 text \<open>Induction rules for the Integers
   167 
   167 
   168 @{thm[display] int_ge_induct[no_vars]}
   168 @{thm[display] int_ge_induct[no_vars]}
   174 @{thm[display] int_le_induct[no_vars]}
   174 @{thm[display] int_le_induct[no_vars]}
   175 \rulename{int_le_induct}
   175 \rulename{int_le_induct}
   176 
   176 
   177 @{thm[display] int_less_induct[no_vars]}
   177 @{thm[display] int_less_induct[no_vars]}
   178 \rulename{int_less_induct}
   178 \rulename{int_less_induct}
   179 \<close>  
   179 \<close>
   180 
   180 
   181 text \<open>FIELDS
   181 text \<open>FIELDS
   182 
   182 
   183 @{thm[display] dense[no_vars]}
   183 @{thm[display] dense[no_vars]}
   184 \rulename{dense}
   184 \rulename{dense}
   206 @{thm[display] add_divide_distrib[no_vars]}
   206 @{thm[display] add_divide_distrib[no_vars]}
   207 \rulename{add_divide_distrib}
   207 \rulename{add_divide_distrib}
   208 \<close>
   208 \<close>
   209 
   209 
   210 lemma "3/4 < (7/8 :: real)"
   210 lemma "3/4 < (7/8 :: real)"
   211 by simp 
   211 by simp
   212 
   212 
   213 lemma "P ((3/4) * (8/15 :: real))"
   213 lemma "P ((3/4) * (8/15 :: real))"
   214 txt\<open>
   214 txt\<open>
   215 @{subgoals[display,indent=0,margin=65]}
   215 @{subgoals[display,indent=0,margin=65]}
   216 \<close>
   216 \<close>
   217 apply simp 
   217 apply simp
   218 txt\<open>
   218 txt\<open>
   219 @{subgoals[display,indent=0,margin=65]}
   219 @{subgoals[display,indent=0,margin=65]}
   220 \<close>
   220 \<close>
   221 oops
   221 oops
   222 
   222 
   223 lemma "(3/4) * (8/15) < (x :: real)"
   223 lemma "(3/4) * (8/15) < (x :: real)"
   224 txt\<open>
   224 txt\<open>
   225 @{subgoals[display,indent=0,margin=65]}
   225 @{subgoals[display,indent=0,margin=65]}
   226 \<close>
   226 \<close>
   227 apply simp 
   227 apply simp
   228 txt\<open>
   228 txt\<open>
   229 @{subgoals[display,indent=0,margin=65]}
   229 @{subgoals[display,indent=0,margin=65]}
   230 \<close>
   230 \<close>
   231 oops
   231 oops
   232 
   232