src/HOL/Library/Ring_and_Field_Example.thy
author oheimb
Wed Jan 31 10:15:55 2001 +0100 (2001-01-31)
changeset 11008 f7333f055ef6
parent 10945 58ddb5049335
child 11701 3d51fbf81c17
permissions -rw-r--r--
improved theory reference in comment
wenzelm@10945
     1
wenzelm@10945
     2
header {* \title{}\subsection{Example: The ordered ring of integers} *}
wenzelm@10945
     3
wenzelm@10945
     4
theory Ring_and_Field_Example = Ring_and_Field:
wenzelm@10945
     5
wenzelm@10945
     6
instance int :: ordered_ring
wenzelm@10945
     7
proof
wenzelm@10945
     8
  fix i j k :: int
wenzelm@10945
     9
  show "(i + j) + k = i + (j + k)" by simp
wenzelm@10945
    10
  show "i + j = j + i" by simp
wenzelm@10945
    11
  show "0 + i = i" by simp
wenzelm@10945
    12
  show "- i + i = 0" by simp
wenzelm@10945
    13
  show "i - j = i + (-j)" by simp
wenzelm@10945
    14
  show "(i * j) * k = i * (j * k)" by simp
wenzelm@10945
    15
  show "i * j = j * i" by simp
wenzelm@10945
    16
  show "#1 * i = i" by simp
wenzelm@10945
    17
  show "0 = (#0::int)" by simp
wenzelm@10945
    18
  show "(i + j) * k = i * k + j * k" by (simp add: int_distrib)
wenzelm@10945
    19
  show "i \<le> j ==> k + i \<le> k + j" by simp
wenzelm@10945
    20
  show "i < j ==> 0 < k ==> k * i < k * j" by (simp add: zmult_zless_mono2)
wenzelm@10945
    21
  show "\<bar>i\<bar> = (if i < 0 then -i else i)" by (simp only: zabs_def)
wenzelm@10945
    22
qed
wenzelm@10945
    23
wenzelm@10945
    24
end