src/HOL/Integ/IntArith.thy
author paulson
Fri, 27 Sep 2002 10:35:10 +0200
changeset 13592 dfe0c7191125
parent 13575 ecb6ecd9af13
child 13685 0b8fbcf65d73
permissions -rw-r--r--
new Ring example
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12023
wenzelm
parents: 11868
diff changeset
     1
wenzelm
parents: 11868
diff changeset
     2
header {* Integer arithmetic *}
wenzelm
parents: 11868
diff changeset
     3
9436
62bb04ab4b01 rearranged setup of arithmetic procedures, avoiding global reference values;
wenzelm
parents: 9214
diff changeset
     4
theory IntArith = Bin
62bb04ab4b01 rearranged setup of arithmetic procedures, avoiding global reference values;
wenzelm
parents: 9214
diff changeset
     5
files ("int_arith1.ML") ("int_arith2.ML"):
62bb04ab4b01 rearranged setup of arithmetic procedures, avoiding global reference values;
wenzelm
parents: 9214
diff changeset
     6
12023
wenzelm
parents: 11868
diff changeset
     7
use "int_arith1.ML"
wenzelm
parents: 11868
diff changeset
     8
setup int_arith_setup
wenzelm
parents: 11868
diff changeset
     9
use "int_arith2.ML"
wenzelm
parents: 11868
diff changeset
    10
declare zabs_split [arith_split]
wenzelm
parents: 11868
diff changeset
    11
13575
ecb6ecd9af13 added nat_split
nipkow
parents: 12023
diff changeset
    12
lemma split_nat[arith_split]:
ecb6ecd9af13 added nat_split
nipkow
parents: 12023
diff changeset
    13
  "P(nat(i::int)) = ((ALL n. i = int n \<longrightarrow> P n) & (i < 0 \<longrightarrow> P 0))"
ecb6ecd9af13 added nat_split
nipkow
parents: 12023
diff changeset
    14
  (is "?P = (?L & ?R)")
ecb6ecd9af13 added nat_split
nipkow
parents: 12023
diff changeset
    15
proof (cases "i < 0")
ecb6ecd9af13 added nat_split
nipkow
parents: 12023
diff changeset
    16
  case True thus ?thesis by simp
ecb6ecd9af13 added nat_split
nipkow
parents: 12023
diff changeset
    17
next
ecb6ecd9af13 added nat_split
nipkow
parents: 12023
diff changeset
    18
  case False
ecb6ecd9af13 added nat_split
nipkow
parents: 12023
diff changeset
    19
  have "?P = ?L"
ecb6ecd9af13 added nat_split
nipkow
parents: 12023
diff changeset
    20
  proof
ecb6ecd9af13 added nat_split
nipkow
parents: 12023
diff changeset
    21
    assume ?P thus ?L using False by clarsimp
ecb6ecd9af13 added nat_split
nipkow
parents: 12023
diff changeset
    22
  next
ecb6ecd9af13 added nat_split
nipkow
parents: 12023
diff changeset
    23
    assume ?L thus ?P using False by simp
ecb6ecd9af13 added nat_split
nipkow
parents: 12023
diff changeset
    24
  qed
ecb6ecd9af13 added nat_split
nipkow
parents: 12023
diff changeset
    25
  with False show ?thesis by simp
ecb6ecd9af13 added nat_split
nipkow
parents: 12023
diff changeset
    26
qed
ecb6ecd9af13 added nat_split
nipkow
parents: 12023
diff changeset
    27
7707
1f4b67fdfdae simprocs now in IntArith;
wenzelm
parents:
diff changeset
    28
end