src/ZF/ex/Mutil.thy
author paulson
Mon, 03 May 1999 11:19:08 +0200
changeset 6566 7ed743d18af7
parent 6117 f9aad8ccd590
child 11316 b4e71bd751e4
permissions -rw-r--r--
improved error handling
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1606
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
     1
(*  Title:      ZF/ex/Mutil
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
     2
    ID:         $Id$
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
     4
    Copyright   1996  University of Cambridge
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
     5
1702
4aa538e82f76 Cosmetic re-ordering of declarations
paulson
parents: 1624
diff changeset
     6
The Mutilated Chess Board Problem, formalized inductively
4aa538e82f76 Cosmetic re-ordering of declarations
paulson
parents: 1624
diff changeset
     7
  Originator is Max Black, according to J A Robinson.
4aa538e82f76 Cosmetic re-ordering of declarations
paulson
parents: 1624
diff changeset
     8
  Popularized as the Mutilated Checkerboard Problem by J McCarthy
1606
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
     9
*)
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    10
1624
e2a6102b9369 Alternative proof removes dependence upon AC
paulson
parents: 1606
diff changeset
    11
Mutil = CardinalArith +
1606
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    12
consts
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    13
  domino  :: i
1702
4aa538e82f76 Cosmetic re-ordering of declarations
paulson
parents: 1624
diff changeset
    14
  tiling  :: i=>i
1606
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    15
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    16
inductive
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    17
  domains "domino" <= "Pow(nat*nat)"
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    18
  intrs
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    19
    horiz  "[| i: nat;  j: nat |] ==> {<i,j>, <i,succ(j)>} : domino"
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    20
    vertl  "[| i: nat;  j: nat |] ==> {<i,j>, <succ(i),j>} : domino"
6117
f9aad8ccd590 tidying of datatype and inductive definitions
paulson
parents: 1806
diff changeset
    21
  type_intrs  empty_subsetI, cons_subsetI, PowI, SigmaI, nat_succI
1606
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    22
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    23
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    24
inductive
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    25
    domains "tiling(A)" <= "Pow(Union(A))"
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    26
  intrs
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    27
    empty  "0 : tiling(A)"
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    28
    Un     "[| a: A;  t: tiling(A);  a Int t = 0 |] ==> a Un t : tiling(A)"
6117
f9aad8ccd590 tidying of datatype and inductive definitions
paulson
parents: 1806
diff changeset
    29
  type_intrs  empty_subsetI, Union_upper, Un_least, PowI
1606
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    30
  type_elims "[make_elim PowD]"
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    31
1806
12708740f58d Converted to use constdefs instead of defs
paulson
parents: 1702
diff changeset
    32
constdefs
12708740f58d Converted to use constdefs instead of defs
paulson
parents: 1702
diff changeset
    33
  evnodd  :: [i,i]=>i
12708740f58d Converted to use constdefs instead of defs
paulson
parents: 1702
diff changeset
    34
  "evnodd(A,b) == {z:A. EX i j. z=<i,j> & (i#+j) mod 2 = b}"
1702
4aa538e82f76 Cosmetic re-ordering of declarations
paulson
parents: 1624
diff changeset
    35
1606
dd66bed09592 New example: mutilated checkerboard
paulson
parents:
diff changeset
    36
end