Univ.ML
changeset 66 14b9286ed036
parent 48 21291189b51e
child 111 361521bc7c47
equal deleted inserted replaced
65:52771c21d9ca 66:14b9286ed036
   145 by (etac (singleton_inject RS Abs_Node_inject RS Pair_inject) 1);
   145 by (etac (singleton_inject RS Abs_Node_inject RS Pair_inject) 1);
   146 by (REPEAT (ares_tac [Node_K0_I] 1));
   146 by (REPEAT (ares_tac [Node_K0_I] 1));
   147 val inj_Atom = result();
   147 val inj_Atom = result();
   148 val Atom_inject = inj_Atom RS injD;
   148 val Atom_inject = inj_Atom RS injD;
   149 
   149 
   150 goalw Univ.thy [Leaf_def] "inj(Leaf)";
   150 goalw Univ.thy [Leaf_def,o_def] "inj(Leaf)";
   151 by (stac o_def 1);
       
   152 by (rtac injI 1);
   151 by (rtac injI 1);
   153 by (etac (Atom_inject RS Inl_inject) 1);
   152 by (etac (Atom_inject RS Inl_inject) 1);
   154 val inj_Leaf = result();
   153 val inj_Leaf = result();
   155 
   154 
   156 val Leaf_inject = inj_Leaf RS injD;
   155 val Leaf_inject = inj_Leaf RS injD;
   157 
   156 
   158 goalw Univ.thy [Numb_def] "inj(Numb)";
   157 goalw Univ.thy [Numb_def,o_def] "inj(Numb)";
   159 by (stac o_def 1);
       
   160 by (rtac injI 1);
   158 by (rtac injI 1);
   161 by (etac (Atom_inject RS Inr_inject) 1);
   159 by (etac (Atom_inject RS Inr_inject) 1);
   162 val inj_Numb = result();
   160 val inj_Numb = result();
   163 
   161 
   164 val Numb_inject = inj_Numb RS injD;
   162 val Numb_inject = inj_Numb RS injD;
   221 
   219 
   222 (*** Distinctness involving Leaf and Numb ***)
   220 (*** Distinctness involving Leaf and Numb ***)
   223 
   221 
   224 (** Scons vs Leaf **)
   222 (** Scons vs Leaf **)
   225 
   223 
   226 goalw Univ.thy [Leaf_def] "(M$N) ~= Leaf(a)";
   224 goalw Univ.thy [Leaf_def,o_def] "(M$N) ~= Leaf(a)";
   227 by (stac o_def 1);
       
   228 by (rtac Scons_not_Atom 1);
   225 by (rtac Scons_not_Atom 1);
   229 val Scons_not_Leaf = result();
   226 val Scons_not_Leaf = result();
   230 val Leaf_not_Scons = standard (Scons_not_Leaf RS not_sym);
   227 val Leaf_not_Scons = standard (Scons_not_Leaf RS not_sym);
   231 
   228 
   232 val Scons_neq_Leaf = standard (Scons_not_Leaf RS notE);
   229 val Scons_neq_Leaf = standard (Scons_not_Leaf RS notE);
   233 val Leaf_neq_Scons = sym RS Scons_neq_Leaf;
   230 val Leaf_neq_Scons = sym RS Scons_neq_Leaf;
   234 
   231 
   235 (** Scons vs Numb **)
   232 (** Scons vs Numb **)
   236 
   233 
   237 goalw Univ.thy [Numb_def] "(M$N) ~= Numb(k)";
   234 goalw Univ.thy [Numb_def,o_def] "(M$N) ~= Numb(k)";
   238 by (stac o_def 1);
       
   239 by (rtac Scons_not_Atom 1);
   235 by (rtac Scons_not_Atom 1);
   240 val Scons_not_Numb = result();
   236 val Scons_not_Numb = result();
   241 val Numb_not_Scons = standard (Scons_not_Numb RS not_sym);
   237 val Numb_not_Scons = standard (Scons_not_Numb RS not_sym);
   242 
   238 
   243 val Scons_neq_Numb = standard (Scons_not_Numb RS notE);
   239 val Scons_neq_Numb = standard (Scons_not_Numb RS notE);
   299 by (safe_tac (set_cs addSIs [equalityI]));
   295 by (safe_tac (set_cs addSIs [equalityI]));
   300 by (stac ndepth_K0 1);
   296 by (stac ndepth_K0 1);
   301 by (rtac zero_less_Suc 1);
   297 by (rtac zero_less_Suc 1);
   302 val ntrunc_Atom = result();
   298 val ntrunc_Atom = result();
   303 
   299 
   304 goalw Univ.thy [Leaf_def] "ntrunc(Suc(k), Leaf(a)) = Leaf(a)";
   300 goalw Univ.thy [Leaf_def,o_def] "ntrunc(Suc(k), Leaf(a)) = Leaf(a)";
   305 by (stac o_def 1);
       
   306 by (rtac ntrunc_Atom 1);
   301 by (rtac ntrunc_Atom 1);
   307 val ntrunc_Leaf = result();
   302 val ntrunc_Leaf = result();
   308 
   303 
   309 goalw Univ.thy [Numb_def] "ntrunc(Suc(k), Numb(i)) = Numb(i)";
   304 goalw Univ.thy [Numb_def,o_def] "ntrunc(Suc(k), Numb(i)) = Numb(i)";
   310 by (stac o_def 1);
       
   311 by (rtac ntrunc_Atom 1);
   305 by (rtac ntrunc_Atom 1);
   312 val ntrunc_Numb = result();
   306 val ntrunc_Numb = result();
   313 
   307 
   314 goalw Univ.thy [Scons_def,ntrunc_def]
   308 goalw Univ.thy [Scons_def,ntrunc_def]
   315     "ntrunc(Suc(k), M$N) = ntrunc(k,M) $ ntrunc(k,N)";
   309     "ntrunc(Suc(k), M$N) = ntrunc(k,M) $ ntrunc(k,N)";
   430 by (ALLGOALS (rtac (ntrunc_subsetI RSN (2, subset_trans))));
   424 by (ALLGOALS (rtac (ntrunc_subsetI RSN (2, subset_trans))));
   431 by (rtac (major RS equalityD1) 1);
   425 by (rtac (major RS equalityD1) 1);
   432 by (rtac (major RS equalityD2) 1);
   426 by (rtac (major RS equalityD2) 1);
   433 val ntrunc_equality = result();
   427 val ntrunc_equality = result();
   434 
   428 
   435 val [major] = goal Univ.thy
   429 val [major] = goalw Univ.thy [o_def]
   436     "[| !!k. (ntrunc(k) o h1) = (ntrunc(k) o h2) |] ==> h1=h2";
   430     "[| !!k. (ntrunc(k) o h1) = (ntrunc(k) o h2) |] ==> h1=h2";
   437 by (rtac (ntrunc_equality RS ext) 1);
   431 by (rtac (ntrunc_equality RS ext) 1);
   438 by (resolve_tac ([major RS fun_cong] RL [o_def RS subst]) 1);
   432 by (rtac (major RS fun_cong) 1);
   439 val ntrunc_o_equality = result();
   433 val ntrunc_o_equality = result();
   440 
   434 
   441 (*** Monotonicity ***)
   435 (*** Monotonicity ***)
   442 
   436 
   443 goalw Univ.thy [uprod_def] "!!A B. [| A<=A';  B<=B' |] ==> A<*>B <= A'<*>B'";
   437 goalw Univ.thy [uprod_def] "!!A B. [| A<=A';  B<=B' |] ==> A<*>B <= A'<*>B'";