author | wenzelm |
Mon, 22 Jun 1998 17:13:09 +0200 | |
changeset 5068 | fb28eaa07e01 |
parent 4152 | 451104c223e2 |
child 5137 | 60205b0de9b9 |
permissions | -rw-r--r-- |
1461 | 1 |
(* Title: SubUnion.ML |
1048 | 2 |
ID: $Id$ |
1461 | 3 |
Author: Ole Rasmussen |
1048 | 4 |
Copyright 1995 University of Cambridge |
5 |
Logic Image: ZF |
|
6 |
*) |
|
7 |
||
8 |
open SubUnion; |
|
9 |
||
10 |
fun rotate n i = EVERY(replicate n (etac revcut_rl i)); |
|
11 |
(* ------------------------------------------------------------------------- *) |
|
12 |
(* Specialisation of comp-rules *) |
|
13 |
(* ------------------------------------------------------------------------- *) |
|
14 |
||
15 |
val compD1 =Scomp.dom_subset RS subsetD RS SigmaD1; |
|
16 |
val compD2 =Scomp.dom_subset RS subsetD RS SigmaD2; |
|
17 |
||
18 |
val regD =Sreg.dom_subset RS subsetD; |
|
19 |
||
20 |
(* ------------------------------------------------------------------------- *) |
|
21 |
(* Equality rules for union *) |
|
22 |
(* ------------------------------------------------------------------------- *) |
|
23 |
||
5068 | 24 |
Goalw [union_def] |
3840 | 25 |
"!!u. n:nat==>Var(n) un Var(n)=Var(n)"; |
2469 | 26 |
by (Asm_simp_tac 1); |
1048 | 27 |
by (simp_tac (rank_ss addsimps redexes.con_defs) 1); |
3734
33f355f56f82
Much tidying including "qed" instead of result(), and even qed_spec_mp,
paulson
parents:
2469
diff
changeset
|
28 |
qed "union_Var"; |
1048 | 29 |
|
5068 | 30 |
Goalw [union_def] |
1048 | 31 |
"!!u.[|u:redexes; v:redexes|]==>Fun(u) un Fun(v)=Fun(u un v)"; |
2469 | 32 |
by (Asm_simp_tac 1); |
1048 | 33 |
by (simp_tac (rank_ss addsimps redexes.con_defs) 1); |
3734
33f355f56f82
Much tidying including "qed" instead of result(), and even qed_spec_mp,
paulson
parents:
2469
diff
changeset
|
34 |
qed "union_Fun"; |
1048 | 35 |
|
5068 | 36 |
Goalw [union_def] |
1048 | 37 |
"!!u.[|b1:bool; b2:bool; u1:redexes; v1:redexes; u2:redexes; v2:redexes|]==> \ |
38 |
\ App(b1,u1,v1) un App(b2,u2,v2)=App(b1 or b2,u1 un u2,v1 un v2)"; |
|
2469 | 39 |
by (Asm_simp_tac 1); |
1048 | 40 |
by (simp_tac (rank_ss addsimps redexes.con_defs) 1); |
3734
33f355f56f82
Much tidying including "qed" instead of result(), and even qed_spec_mp,
paulson
parents:
2469
diff
changeset
|
41 |
qed "union_App"; |
1048 | 42 |
|
2469 | 43 |
Addsimps (Ssub.intrs@bool_typechecks@ |
44 |
Sreg.intrs@Scomp.intrs@ |
|
45 |
[or_1 RSN (3,or_commute RS trans), |
|
46 |
or_0 RSN (3,or_commute RS trans), |
|
47 |
union_App,union_Fun,union_Var,compD2,compD1,regD]); |
|
1048 | 48 |
|
2469 | 49 |
AddIs Scomp.intrs; |
50 |
AddSEs [Sreg.mk_cases redexes.con_defs "regular(App(b,f,a))", |
|
51 |
Sreg.mk_cases redexes.con_defs "regular(Fun(b))", |
|
52 |
Sreg.mk_cases redexes.con_defs "regular(Var(b))", |
|
53 |
Scomp.mk_cases redexes.con_defs "Fun(u) ~ Fun(t)", |
|
54 |
Scomp.mk_cases redexes.con_defs "u ~ Fun(t)", |
|
55 |
Scomp.mk_cases redexes.con_defs "u ~ Var(n)", |
|
56 |
Scomp.mk_cases redexes.con_defs "u ~ App(b,t,a)", |
|
57 |
Scomp.mk_cases redexes.con_defs "Fun(t) ~ v", |
|
58 |
Scomp.mk_cases redexes.con_defs "App(b,f,a) ~ v", |
|
59 |
Scomp.mk_cases redexes.con_defs "Var(n) ~ u" |
|
60 |
]; |
|
1048 | 61 |
|
62 |
||
63 |
||
64 |
(* ------------------------------------------------------------------------- *) |
|
65 |
(* comp proofs *) |
|
66 |
(* ------------------------------------------------------------------------- *) |
|
67 |
||
5068 | 68 |
Goal "!!u. u:redexes ==> u ~ u"; |
1048 | 69 |
by (eresolve_tac [redexes.induct] 1); |
2469 | 70 |
by (ALLGOALS Fast_tac); |
3734
33f355f56f82
Much tidying including "qed" instead of result(), and even qed_spec_mp,
paulson
parents:
2469
diff
changeset
|
71 |
qed "comp_refl"; |
1048 | 72 |
|
5068 | 73 |
Goal |
3840 | 74 |
"!!u. u ~ v ==> v ~ u"; |
1732 | 75 |
by (etac Scomp.induct 1); |
2469 | 76 |
by (ALLGOALS Fast_tac); |
3734
33f355f56f82
Much tidying including "qed" instead of result(), and even qed_spec_mp,
paulson
parents:
2469
diff
changeset
|
77 |
qed "comp_sym"; |
1048 | 78 |
|
5068 | 79 |
Goal |
1048 | 80 |
"u ~ v <-> v ~ u"; |
4091 | 81 |
by (fast_tac (claset() addIs [comp_sym]) 1); |
3734
33f355f56f82
Much tidying including "qed" instead of result(), and even qed_spec_mp,
paulson
parents:
2469
diff
changeset
|
82 |
qed "comp_sym_iff"; |
1048 | 83 |
|
84 |
||
5068 | 85 |
Goal |
3840 | 86 |
"!!u. u ~ v ==> ALL w. v ~ w-->u ~ w"; |
1732 | 87 |
by (etac Scomp.induct 1); |
2469 | 88 |
by (ALLGOALS Fast_tac); |
3734
33f355f56f82
Much tidying including "qed" instead of result(), and even qed_spec_mp,
paulson
parents:
2469
diff
changeset
|
89 |
qed_spec_mp "comp_trans"; |
1048 | 90 |
|
91 |
(* ------------------------------------------------------------------------- *) |
|
92 |
(* union proofs *) |
|
93 |
(* ------------------------------------------------------------------------- *) |
|
94 |
||
5068 | 95 |
Goal |
3840 | 96 |
"!!u. u ~ v ==> u <== (u un v)"; |
1732 | 97 |
by (etac Scomp.induct 1); |
1461 | 98 |
by (etac boolE 3); |
2469 | 99 |
by (ALLGOALS Asm_full_simp_tac); |
3734
33f355f56f82
Much tidying including "qed" instead of result(), and even qed_spec_mp,
paulson
parents:
2469
diff
changeset
|
100 |
qed "union_l"; |
1048 | 101 |
|
5068 | 102 |
Goal |
3840 | 103 |
"!!u. u ~ v ==> v <== (u un v)"; |
1732 | 104 |
by (etac Scomp.induct 1); |
1048 | 105 |
by (eres_inst_tac [("c","b2")] boolE 3); |
2469 | 106 |
by (ALLGOALS Asm_full_simp_tac); |
3734
33f355f56f82
Much tidying including "qed" instead of result(), and even qed_spec_mp,
paulson
parents:
2469
diff
changeset
|
107 |
qed "union_r"; |
1048 | 108 |
|
5068 | 109 |
Goal |
3840 | 110 |
"!!u. u ~ v ==> u un v = v un u"; |
1732 | 111 |
by (etac Scomp.induct 1); |
4091 | 112 |
by (ALLGOALS(asm_simp_tac (simpset() addsimps [or_commute]))); |
3734
33f355f56f82
Much tidying including "qed" instead of result(), and even qed_spec_mp,
paulson
parents:
2469
diff
changeset
|
113 |
qed "union_sym"; |
1048 | 114 |
|
115 |
(* ------------------------------------------------------------------------- *) |
|
116 |
(* regular proofs *) |
|
117 |
(* ------------------------------------------------------------------------- *) |
|
118 |
||
5068 | 119 |
Goal |
3840 | 120 |
"!!u. u ~ v ==> regular(u)-->regular(v)-->regular(u un v)"; |
1732 | 121 |
by (etac Scomp.induct 1); |
1048 | 122 |
by (ALLGOALS(asm_full_simp_tac |
4152 | 123 |
(simpset() setloop(SELECT_GOAL Safe_tac)))); |
1048 | 124 |
by (dres_inst_tac [("psi", "regular(Fun(?u) un ?v)")] asm_rl 1); |
2469 | 125 |
by (Asm_full_simp_tac 1); |
3734
33f355f56f82
Much tidying including "qed" instead of result(), and even qed_spec_mp,
paulson
parents:
2469
diff
changeset
|
126 |
qed_spec_mp "union_preserve_regular"; |