src/ZF/Coind/Map.ML
author wenzelm
Thu, 14 Oct 1999 15:04:36 +0200
changeset 7866 3ccaa11b6df9
parent 7499 23e090051cb8
child 9683 f87c8c449018
permissions -rw-r--r--
pdf: generate thumbnails if ISABELLE_THUMBPDF set;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1075
diff changeset
     1
(*  Title:      ZF/Coind/Map.ML
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
     2
    ID:         $Id$
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1075
diff changeset
     3
    Author:     Jacob Frost, Cambridge University Computer Laboratory
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
     4
    Copyright   1995  University of Cambridge
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
     5
*)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
     6
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
     7
open Map;
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
     8
4841
d275fd349f3d new thms, really demos of the final coalgebra theorem
paulson
parents: 4152
diff changeset
     9
(** Some sample proofs of inclusions for the final coalgebra "U" (by lcp) **)
d275fd349f3d new thms, really demos of the final coalgebra theorem
paulson
parents: 4152
diff changeset
    10
5265
9d1d4c43c76d Disjointness reasoning by AddEs [equals0E, sym RS equals0E]
paulson
parents: 5147
diff changeset
    11
Goalw [TMap_def] "{0,1} <= {1} Un TMap(I, {0,1})";
4841
d275fd349f3d new thms, really demos of the final coalgebra theorem
paulson
parents: 4152
diff changeset
    12
by (Blast_tac 1);
d275fd349f3d new thms, really demos of the final coalgebra theorem
paulson
parents: 4152
diff changeset
    13
result();
d275fd349f3d new thms, really demos of the final coalgebra theorem
paulson
parents: 4152
diff changeset
    14
5265
9d1d4c43c76d Disjointness reasoning by AddEs [equals0E, sym RS equals0E]
paulson
parents: 5147
diff changeset
    15
Goalw [TMap_def] "{0} Un TMap(I,1) <= {1} Un TMap(I, {0} Un TMap(I,1))";
4841
d275fd349f3d new thms, really demos of the final coalgebra theorem
paulson
parents: 4152
diff changeset
    16
by (Blast_tac 1);
d275fd349f3d new thms, really demos of the final coalgebra theorem
paulson
parents: 4152
diff changeset
    17
result();
d275fd349f3d new thms, really demos of the final coalgebra theorem
paulson
parents: 4152
diff changeset
    18
5265
9d1d4c43c76d Disjointness reasoning by AddEs [equals0E, sym RS equals0E]
paulson
parents: 5147
diff changeset
    19
Goalw [TMap_def] "{0,1} Un TMap(I,2) <= {1} Un TMap(I, {0,1} Un TMap(I,2))";
4841
d275fd349f3d new thms, really demos of the final coalgebra theorem
paulson
parents: 4152
diff changeset
    20
by (Blast_tac 1);
d275fd349f3d new thms, really demos of the final coalgebra theorem
paulson
parents: 4152
diff changeset
    21
result();
d275fd349f3d new thms, really demos of the final coalgebra theorem
paulson
parents: 4152
diff changeset
    22
5265
9d1d4c43c76d Disjointness reasoning by AddEs [equals0E, sym RS equals0E]
paulson
parents: 5147
diff changeset
    23
(*TOO SLOW
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4841
diff changeset
    24
Goalw [TMap_def]
4841
d275fd349f3d new thms, really demos of the final coalgebra theorem
paulson
parents: 4152
diff changeset
    25
     "{0,1} Un TMap(I,TMap(I,2)) Un TMap(I,2) <= \
d275fd349f3d new thms, really demos of the final coalgebra theorem
paulson
parents: 4152
diff changeset
    26
\     {1} Un TMap(I, {0,1} Un TMap(I,TMap(I,2)) Un TMap(I,2))";
5265
9d1d4c43c76d Disjointness reasoning by AddEs [equals0E, sym RS equals0E]
paulson
parents: 5147
diff changeset
    27
by (Blast_tac 1);
4841
d275fd349f3d new thms, really demos of the final coalgebra theorem
paulson
parents: 4152
diff changeset
    28
result();
5265
9d1d4c43c76d Disjointness reasoning by AddEs [equals0E, sym RS equals0E]
paulson
parents: 5147
diff changeset
    29
*)
4841
d275fd349f3d new thms, really demos of the final coalgebra theorem
paulson
parents: 4152
diff changeset
    30
d275fd349f3d new thms, really demos of the final coalgebra theorem
paulson
parents: 4152
diff changeset
    31
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    32
(* ############################################################ *)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    33
(* Lemmas                                                       *)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    34
(* ############################################################ *)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    35
6068
2d8f3e1f1151 if-then-else syntax for ZF
paulson
parents: 6046
diff changeset
    36
Goal "Sigma(A,B)``{a} = (if a:A then B(a) else 0)";
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5265
diff changeset
    37
by Auto_tac;
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5265
diff changeset
    38
qed "qbeta_if";
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5265
diff changeset
    39
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
    40
Goal "a:A ==> Sigma(A,B)``{a} = B(a)";
2493
bdeb5024353a Removal of sum_cs and eq_cs
paulson
parents: 2469
diff changeset
    41
by (Fast_tac 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    42
qed "qbeta";
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    43
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
    44
Goal "a~:A ==> Sigma(A,B)``{a} = 0";
2493
bdeb5024353a Removal of sum_cs and eq_cs
paulson
parents: 2469
diff changeset
    45
by (Fast_tac 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    46
qed "qbeta_emp";
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    47
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
    48
Goal "a ~: A ==> Sigma(A,B)``{a}=0";
2493
bdeb5024353a Removal of sum_cs and eq_cs
paulson
parents: 2469
diff changeset
    49
by (Fast_tac 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    50
qed "image_Sigma1";
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    51
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    52
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    53
(* ############################################################ *)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    54
(* Inclusion in Quine Universes                                 *)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    55
(* ############################################################ *)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    56
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    57
(* Lemmas *)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    58
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4841
diff changeset
    59
Goalw [quniv_def]
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5143
diff changeset
    60
    "A <= univ(X) ==> Pow(A * Union(quniv(X))) <= quniv(X)";
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    61
by (rtac Pow_mono 1);
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    62
by (rtac ([Sigma_mono, product_univ] MRS subset_trans) 1);
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    63
by (etac subset_trans 1);
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    64
by (rtac (arg_subset_eclose RS univ_mono) 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
    65
by (simp_tac (simpset() addsimps [Union_Pow_eq]) 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    66
qed "MapQU_lemma";
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    67
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    68
(* Theorems *)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    69
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    70
val prems = goalw Map.thy [PMap_def,TMap_def]
3840
e0baea4d485a fixed dots;
wenzelm
parents: 3735
diff changeset
    71
  "[| m:PMap(A,quniv(B)); !!x. x:A ==> x:univ(B) |] ==> m:quniv(B)";
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    72
by (cut_facts_tac prems 1);
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    73
by (rtac (MapQU_lemma RS subsetD) 1);
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    74
by (rtac subsetI 1);
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    75
by (eresolve_tac prems 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2034
diff changeset
    76
by (Fast_tac 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    77
qed "mapQU";
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    78
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    79
(* ############################################################ *)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    80
(* Monotonicity                                                 *)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    81
(* ############################################################ *)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    82
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5137
diff changeset
    83
Goalw [PMap_def,TMap_def] "B<=C ==> PMap(A,B)<=PMap(A,C)";
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2034
diff changeset
    84
by (Fast_tac 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    85
qed "map_mono";
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    86
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    87
(* Rename to pmap_mono *)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    88
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    89
(* ############################################################ *)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    90
(* Introduction Rules                                           *)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    91
(* ############################################################ *)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    92
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    93
(** map_emp **)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    94
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4841
diff changeset
    95
Goalw [map_emp_def,PMap_def,TMap_def] "map_emp:PMap(A,B)";
5265
9d1d4c43c76d Disjointness reasoning by AddEs [equals0E, sym RS equals0E]
paulson
parents: 5147
diff changeset
    96
by Auto_tac;
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    97
qed "pmap_empI";
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    98
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
    99
(** map_owr **)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   100
1020
76d72126a9e7 Modified proofs for new hyp_subst_tac, and simplified them.
lcp
parents: 915
diff changeset
   101
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4841
diff changeset
   102
Goalw [map_owr_def,PMap_def,TMap_def] 
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5143
diff changeset
   103
  "[| m:PMap(A,B); a:A; b:B |]  ==> map_owr(m,a,b):PMap(A,B)";
3735
bed0ba7bff2f Step_tac -> Safe_tac
paulson
parents: 2493
diff changeset
   104
by Safe_tac;
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   105
by (ALLGOALS (asm_full_simp_tac (simpset() addsimps [if_iff])));
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2034
diff changeset
   106
by (Fast_tac 1);
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2034
diff changeset
   107
by (Fast_tac 1);
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2034
diff changeset
   108
by (Deepen_tac 2 1);
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2034
diff changeset
   109
(*Remaining subgoal*)
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   110
by (rtac (excluded_middle RS disjE) 1);
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   111
by (etac image_Sigma1 1);
1075
848bf2e18dff Modified proofs for new claset primitives. The problem is that they enforce
lcp
parents: 1020
diff changeset
   112
by (dres_inst_tac [("psi", "?uu ~: B")] asm_rl 1);
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5116
diff changeset
   113
by (asm_full_simp_tac (simpset() addsimps [qbeta]) 1);
4152
451104c223e2 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   114
by Safe_tac;
1075
848bf2e18dff Modified proofs for new claset primitives. The problem is that they enforce
lcp
parents: 1020
diff changeset
   115
by (dres_inst_tac [("psi", "?uu ~: B")] asm_rl 3);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2034
diff changeset
   116
by (ALLGOALS Asm_full_simp_tac);
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2034
diff changeset
   117
by (Fast_tac 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   118
qed "pmap_owrI";
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   119
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   120
(** map_app **)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   121
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4841
diff changeset
   122
Goalw [TMap_def,map_app_def] 
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5143
diff changeset
   123
  "[| m:TMap(A,B); a:domain(m) |] ==> map_app(m,a) ~=0";
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   124
by (etac domainE 1);
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   125
by (dtac imageI 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2034
diff changeset
   126
by (Fast_tac 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   127
by (etac not_emptyI 1);
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   128
qed "tmap_app_notempty";
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   129
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4841
diff changeset
   130
Goalw [TMap_def,map_app_def,domain_def] 
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5143
diff changeset
   131
  "[| m:TMap(A,B); a:domain(m) |] ==> map_app(m,a):B";
2493
bdeb5024353a Removal of sum_cs and eq_cs
paulson
parents: 2469
diff changeset
   132
by (Fast_tac 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   133
qed "tmap_appI";
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   134
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4841
diff changeset
   135
Goalw [PMap_def]
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5143
diff changeset
   136
  "[| m:PMap(A,B); a:domain(m) |] ==> map_app(m,a):B";
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 6068
diff changeset
   137
by (ftac tmap_app_notempty 1); 
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   138
by (assume_tac 1);
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   139
by (dtac tmap_appI 1); 
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   140
by (assume_tac 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2034
diff changeset
   141
by (Fast_tac 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   142
qed "pmap_appI";
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   143
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   144
(** domain **)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   145
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4841
diff changeset
   146
Goalw [TMap_def]
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5143
diff changeset
   147
  "[| m:TMap(A,B); a:domain(m) |] ==> a:A";
2493
bdeb5024353a Removal of sum_cs and eq_cs
paulson
parents: 2469
diff changeset
   148
by (Fast_tac 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   149
qed "tmap_domainD";
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   150
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4841
diff changeset
   151
Goalw [PMap_def,TMap_def]
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5143
diff changeset
   152
  "[| m:PMap(A,B); a:domain(m) |] ==> a:A";
2493
bdeb5024353a Removal of sum_cs and eq_cs
paulson
parents: 2469
diff changeset
   153
by (Fast_tac 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   154
qed "pmap_domainD";
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   155
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   156
(* ############################################################ *)
4841
d275fd349f3d new thms, really demos of the final coalgebra theorem
paulson
parents: 4152
diff changeset
   157
(* Equalities                                                   *)
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   158
(* ############################################################ *)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   159
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   160
(** Domain **)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   161
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   162
(* Lemmas *)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   163
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4841
diff changeset
   164
Goal  "domain(UN x:A. B(x)) = (UN x:A. domain(B(x)))";
2493
bdeb5024353a Removal of sum_cs and eq_cs
paulson
parents: 2469
diff changeset
   165
by (Fast_tac 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   166
qed "domain_UN";
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   167
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4841
diff changeset
   168
Goal  "domain(Sigma(A,B)) = {x:A. EX y. y:B(x)}";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   169
by (simp_tac (simpset() addsimps [domain_UN,domain_0,domain_cons]) 1);
2493
bdeb5024353a Removal of sum_cs and eq_cs
paulson
parents: 2469
diff changeset
   170
by (Fast_tac 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   171
qed "domain_Sigma";
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   172
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   173
(* Theorems *)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   174
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4841
diff changeset
   175
Goalw [map_emp_def] "domain(map_emp) = 0";
2493
bdeb5024353a Removal of sum_cs and eq_cs
paulson
parents: 2469
diff changeset
   176
by (Fast_tac 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   177
qed "map_domain_emp";
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   178
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4841
diff changeset
   179
Goalw [map_owr_def] 
5147
825877190618 More tidying and removal of "\!\!... from Goal commands
paulson
parents: 5143
diff changeset
   180
  "b ~= 0 ==> domain(map_owr(f,a,b)) = {a} Un domain(f)";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   181
by (simp_tac (simpset() addsimps [domain_Sigma]) 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   182
by (rtac equalityI 1);
2493
bdeb5024353a Removal of sum_cs and eq_cs
paulson
parents: 2469
diff changeset
   183
by (Fast_tac 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   184
by (rtac subsetI 1);
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   185
by (rtac CollectI 1);
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   186
by (assume_tac 1);
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   187
by (etac UnE' 1);
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   188
by (etac singletonE 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2034
diff changeset
   189
by (Asm_simp_tac 1);
2493
bdeb5024353a Removal of sum_cs and eq_cs
paulson
parents: 2469
diff changeset
   190
by (Fast_tac 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
   191
by (fast_tac (claset() addss (simpset())) 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   192
qed "map_domain_owr";
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   193
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   194
(** Application **)
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   195
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4841
diff changeset
   196
Goalw [map_app_def,map_owr_def] 
6068
2d8f3e1f1151 if-then-else syntax for ZF
paulson
parents: 6046
diff changeset
   197
  "map_app(map_owr(f,a,b),c) = (if c=a then b else map_app(f,c))";
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5265
diff changeset
   198
by (asm_simp_tac (simpset() addsimps [qbeta_if]) 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 2034
diff changeset
   199
by (Fast_tac 1);
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5265
diff changeset
   200
qed "map_app_owr";
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5265
diff changeset
   201
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5265
diff changeset
   202
Goal "map_app(map_owr(f,a,b),a) = b";
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5265
diff changeset
   203
by (asm_simp_tac (simpset() addsimps [map_app_owr]) 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   204
qed "map_app_owr1";
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   205
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5265
diff changeset
   206
Goal "c ~= a ==> map_app(map_owr(f,a,b),c)= map_app(f,c)";
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5265
diff changeset
   207
by (asm_simp_tac (simpset() addsimps [map_app_owr]) 1);
915
6dae0daf57b7 New example by Jacob Frost, tidied by lcp
lcp
parents:
diff changeset
   208
qed "map_app_owr2";