Attic/Quot/Examples/FSet_BallBex.thy
author Cezary Kaliszyk <kaliszyk@in.tum.de>
Fri, 27 Aug 2010 02:25:40 +0000
changeset 2441 fc3e8f79e698
child 2456 5e76af0a51f9
permissions -rw-r--r--
Ball Bex can be lifted after unfolding.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2441
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     1
theory FSet_ballbex
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     2
imports "../../../Nominal/FSet"
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     3
begin
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     4
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     5
notation
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     6
  list_eq (infix "\<approx>" 50)
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     7
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     8
lemma test:
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     9
  "\<forall>xs \<in> (\<lambda>xs. memb x xs). memb x (y # xs)"
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    10
  apply (simp add: memb_def)
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    11
  apply (metis mem_def)
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    12
  done
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    13
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    14
(* Should not work and doesn't.
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    15
thm test[quot_lifted]
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    16
*)
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    17
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    18
lemma "\<forall>xs \<in> (\<lambda>xs. x |\<in>| xs). x |\<in>| finsert y xs"
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    19
  unfolding Ball_def mem_def
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    20
  by (lifting test[unfolded Ball_def mem_def])
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    21
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    22
ML {* Quotient_Tacs.lifted @{context} [@{typ "'a fset"}] @{thms Ball_def Bex_def mem_def} @{thm test}*}
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    23
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    24
lemma test2:
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    25
  "\<exists>xs \<in> (\<lambda>xs. xs \<approx> []). xs \<approx> []"
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    26
  apply (rule_tac x="[]" in bexI)
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    27
  apply (auto simp add: mem_def)
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    28
  done
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    29
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    30
(* Should not work and doesn't
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    31
thm test2[quot_lifted]
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    32
*)
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    33
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    34
lemma "\<exists>xs \<in> (\<lambda>xs. xs = {||}). xs = {||}"
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    35
  unfolding Bex_def mem_def
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    36
  by (lifting test2[unfolded Bex_def mem_def])
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    37
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    38
ML {* Quotient_Tacs.lifted @{context} [@{typ "'a fset"}] @{thms Bex_def mem_def} @{thm test2}*}
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    39
fc3e8f79e698 Ball Bex can be lifted after unfolding.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    40
end