src/HOL/Quotient_Examples/Quotient_Cset.thy
author huffman
Tue, 27 Mar 2012 19:21:05 +0200
changeset 47165 9344891b504b
parent 47092 fa3538d6004b
child 47232 e2f0176149d0
permissions -rw-r--r--
remove redundant lemmas
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
     1
(*  Title:      HOL/Quotient_Examples/Quotient_Cset.thy
43800
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
     2
    Author:     Florian Haftmann, Alexander Krauss, TU Muenchen
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
     3
*)
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
     4
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
     5
header {* A variant of theory Cset from Library, defined as a quotient *}
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
     6
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
     7
theory Quotient_Cset
45990
b7b905b23b2a incorporated More_Set and More_List into the Main body -- to be consolidated later
haftmann
parents: 45986
diff changeset
     8
imports Main "~~/src/HOL/Library/Quotient_Syntax"
43800
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
     9
begin
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    10
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    11
subsection {* Lifting *}
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    12
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    13
(*FIXME: quotient package requires a dedicated constant*)
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    14
definition set_eq :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool"
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    15
where [simp]: "set_eq \<equiv> op ="
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    16
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    17
quotient_type 'a set = "'a Set.set" / "set_eq"
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    18
by (simp add: identity_equivp)
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    19
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    20
hide_type (open) set
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    21
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    22
subsection {* Operations *}
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    23
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    24
quotient_definition "member :: 'a => 'a Quotient_Cset.set => bool"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    25
is "op \<in>" by simp
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    26
quotient_definition "Set :: ('a => bool) => 'a Quotient_Cset.set"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    27
is Collect done
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    28
quotient_definition is_empty where "is_empty :: 'a Quotient_Cset.set \<Rightarrow> bool"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    29
is Set.is_empty by simp 
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    30
quotient_definition insert where "insert :: 'a \<Rightarrow> 'a Quotient_Cset.set \<Rightarrow> 'a Quotient_Cset.set"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    31
is Set.insert by simp
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    32
quotient_definition remove where "remove :: 'a \<Rightarrow> 'a Quotient_Cset.set \<Rightarrow> 'a Quotient_Cset.set"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    33
is Set.remove by simp
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    34
quotient_definition map where "map :: ('a \<Rightarrow> 'b) \<Rightarrow> 'a Quotient_Cset.set \<Rightarrow> 'b Quotient_Cset.set"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    35
is image by simp
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    36
quotient_definition filter where "filter :: ('a \<Rightarrow> bool) \<Rightarrow> 'a Quotient_Cset.set \<Rightarrow> 'a Quotient_Cset.set"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    37
is Set.project by simp
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    38
quotient_definition "forall :: 'a Quotient_Cset.set \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    39
is Ball by simp
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    40
quotient_definition "exists :: 'a Quotient_Cset.set \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    41
is Bex by simp
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    42
quotient_definition card where "card :: 'a Quotient_Cset.set \<Rightarrow> nat"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    43
is Finite_Set.card by simp
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    44
quotient_definition set where "set :: 'a list => 'a Quotient_Cset.set"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    45
is List.set done
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    46
quotient_definition subset where "subset :: 'a Quotient_Cset.set \<Rightarrow> 'a Quotient_Cset.set \<Rightarrow> bool"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    47
is "op \<subseteq> :: 'a set \<Rightarrow> 'a set \<Rightarrow> bool" by simp
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    48
quotient_definition psubset where "psubset :: 'a Quotient_Cset.set \<Rightarrow> 'a Quotient_Cset.set \<Rightarrow> bool"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    49
is "op \<subset> :: 'a set \<Rightarrow> 'a set \<Rightarrow> bool" by simp
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    50
quotient_definition inter where "inter :: 'a Quotient_Cset.set \<Rightarrow> 'a Quotient_Cset.set \<Rightarrow> 'a Quotient_Cset.set"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    51
is "op \<inter> :: 'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" by simp
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    52
quotient_definition union where "union :: 'a Quotient_Cset.set \<Rightarrow> 'a Quotient_Cset.set \<Rightarrow> 'a Quotient_Cset.set"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    53
is "op \<union> :: 'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" by simp
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    54
quotient_definition empty where "empty :: 'a Quotient_Cset.set"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    55
is "{} :: 'a set" done
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    56
quotient_definition UNIV where "UNIV :: 'a Quotient_Cset.set"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    57
is "Set.UNIV :: 'a set" done
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    58
quotient_definition uminus where "uminus :: 'a Quotient_Cset.set \<Rightarrow> 'a Quotient_Cset.set"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    59
is "uminus_class.uminus :: 'a set \<Rightarrow> 'a set" by simp
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    60
quotient_definition minus where "minus :: 'a Quotient_Cset.set \<Rightarrow> 'a Quotient_Cset.set \<Rightarrow> 'a Quotient_Cset.set"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    61
is "(op -) :: 'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" by simp
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    62
quotient_definition Inf where "Inf :: ('a :: Inf) Quotient_Cset.set \<Rightarrow> 'a"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    63
is "Inf_class.Inf :: ('a :: Inf) set \<Rightarrow> 'a" by simp
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    64
quotient_definition Sup where "Sup :: ('a :: Sup) Quotient_Cset.set \<Rightarrow> 'a"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    65
is "Sup_class.Sup :: ('a :: Sup) set \<Rightarrow> 'a" by simp
45319
2b002c6b0f7d renaming Quotient_Set and List_Quotient_Set to Quotient_Cset and List_Quotient_Cset to avoid name clash with existing Quotient_Set (again, cf. 66823a0066db)
bulwahn
parents: 45267
diff changeset
    66
quotient_definition UNION where "UNION :: 'a Quotient_Cset.set \<Rightarrow> ('a \<Rightarrow> 'b Quotient_Cset.set) \<Rightarrow> 'b Quotient_Cset.set"
47092
fa3538d6004b fix Quotient_Examples
kuncar
parents: 45990
diff changeset
    67
is "Complete_Lattices.UNION :: 'a set \<Rightarrow> ('a \<Rightarrow> 'b set) \<Rightarrow> 'b set" by simp
43800
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    68
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    69
hide_const (open) is_empty insert remove map filter forall exists card
43926
3264fbfd87d6 added UNION
krauss
parents: 43800
diff changeset
    70
  set subset psubset inter union empty UNIV uminus minus Inf Sup UNION
43800
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    71
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    72
hide_fact (open) is_empty_def insert_def remove_def map_def filter_def
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    73
  forall_def exists_def card_def set_def subset_def psubset_def
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    74
  inter_def union_def empty_def UNIV_def uminus_def minus_def Inf_def Sup_def
44928
7ef6505bde7f renamed Complete_Lattices lemmas, removed legacy names
hoelzl
parents: 44860
diff changeset
    75
  UNION_eq
43800
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    76
9959c8732edf experimental variants of Library/Cset.thy and Library/Dlist_Cset.thy defined via quotient package
krauss
parents:
diff changeset
    77
end