src/HOL/ex/cla.ML
changeset 3842 b55686a7b22c
parent 3347 4e7dfe8ae41b
child 4061 5a2cc5752cb6
equal deleted inserted replaced
3841:22bbc1676768 3842:b55686a7b22c
   127 
   127 
   128 goal HOL.thy "(! x. P(x) & Q(x)) = ((! x. P(x)) & (! x. Q(x)))";
   128 goal HOL.thy "(! x. P(x) & Q(x)) = ((! x. P(x)) & (! x. Q(x)))";
   129 by (Blast_tac 1);
   129 by (Blast_tac 1);
   130 result(); 
   130 result(); 
   131 
   131 
   132 goal HOL.thy "(? x. P-->Q(x))  =  (P --> (? x.Q(x)))";
   132 goal HOL.thy "(? x. P-->Q(x))  =  (P --> (? x. Q(x)))";
   133 by (Blast_tac 1);
   133 by (Blast_tac 1);
   134 result(); 
   134 result(); 
   135 
   135 
   136 goal HOL.thy "(? x.P(x)-->Q) = ((! x.P(x)) --> Q)";
   136 goal HOL.thy "(? x. P(x)-->Q) = ((! x. P(x)) --> Q)";
   137 by (Blast_tac 1);
   137 by (Blast_tac 1);
   138 result(); 
   138 result(); 
   139 
   139 
   140 goal HOL.thy "((! x.P(x)) | Q)  =  (! x. P(x) | Q)";
   140 goal HOL.thy "((! x. P(x)) | Q)  =  (! x. P(x) | Q)";
   141 by (Blast_tac 1);
   141 by (Blast_tac 1);
   142 result(); 
   142 result(); 
   143 
   143 
   144 (*From Wishnu Prasetya*)
   144 (*From Wishnu Prasetya*)
   145 goal HOL.thy
   145 goal HOL.thy
   202 by (Blast_tac 1);  
   202 by (Blast_tac 1);  
   203 result();
   203 result();
   204 
   204 
   205 writeln"Problem 24";
   205 writeln"Problem 24";
   206 goal HOL.thy "~(? x. S(x)&Q(x)) & (! x. P(x) --> Q(x)|R(x)) &  \
   206 goal HOL.thy "~(? x. S(x)&Q(x)) & (! x. P(x) --> Q(x)|R(x)) &  \
   207 \    (~(? x.P(x)) --> (? x.Q(x))) & (! x. Q(x)|R(x) --> S(x))  \
   207 \    (~(? x. P(x)) --> (? x. Q(x))) & (! x. Q(x)|R(x) --> S(x))  \
   208 \   --> (? x. P(x)&R(x))";
   208 \   --> (? x. P(x)&R(x))";
   209 by (Blast_tac 1); 
   209 by (Blast_tac 1); 
   210 result();
   210 result();
   211 
   211 
   212 writeln"Problem 25";
   212 writeln"Problem 25";
   235 result();
   235 result();
   236 
   236 
   237 writeln"Problem 28.  AMENDED";
   237 writeln"Problem 28.  AMENDED";
   238 goal HOL.thy "(! x. P(x) --> (! x. Q(x))) &   \
   238 goal HOL.thy "(! x. P(x) --> (! x. Q(x))) &   \
   239 \       ((! x. Q(x)|R(x)) --> (? x. Q(x)&S(x))) &  \
   239 \       ((! x. Q(x)|R(x)) --> (? x. Q(x)&S(x))) &  \
   240 \       ((? x.S(x)) --> (! x. L(x) --> M(x)))  \
   240 \       ((? x. S(x)) --> (! x. L(x) --> M(x)))  \
   241 \   --> (! x. P(x) & L(x) --> M(x))";
   241 \   --> (! x. P(x) & L(x) --> M(x))";
   242 by (Blast_tac 1);  
   242 by (Blast_tac 1);  
   243 result();
   243 result();
   244 
   244 
   245 writeln"Problem 29.  Essentially the same as Principia Mathematica *11.71";
   245 writeln"Problem 29.  Essentially the same as Principia Mathematica *11.71";
   255 \   --> (! x. S(x))";
   255 \   --> (! x. S(x))";
   256 by (Blast_tac 1);  
   256 by (Blast_tac 1);  
   257 result();
   257 result();
   258 
   258 
   259 writeln"Problem 31";
   259 writeln"Problem 31";
   260 goal HOL.thy "~(? x.P(x) & (Q(x) | R(x))) & \
   260 goal HOL.thy "~(? x. P(x) & (Q(x) | R(x))) & \
   261 \       (? x. L(x) & P(x)) & \
   261 \       (? x. L(x) & P(x)) & \
   262 \       (! x. ~ R(x) --> M(x))  \
   262 \       (! x. ~ R(x) --> M(x))  \
   263 \   --> (? x. L(x) & M(x))";
   263 \   --> (? x. L(x) & M(x))";
   264 by (Blast_tac 1);
   264 by (Blast_tac 1);
   265 result();
   265 result();
   301 by (Blast_tac 1);
   301 by (Blast_tac 1);
   302 result();
   302 result();
   303 
   303 
   304 writeln"Problem 37";
   304 writeln"Problem 37";
   305 goal HOL.thy "(! z. ? w. ! x. ? y. \
   305 goal HOL.thy "(! z. ? w. ! x. ? y. \
   306 \          (P x z -->P y w) & P y z & (P y w --> (? u.Q u w))) & \
   306 \          (P x z -->P y w) & P y z & (P y w --> (? u. Q u w))) & \
   307 \       (! x z. ~(P x z) --> (? y. Q y z)) & \
   307 \       (! x z. ~(P x z) --> (? y. Q y z)) & \
   308 \       ((? x y. Q x y) --> (! x. R x x))  \
   308 \       ((? x y. Q x y) --> (! x. R x x))  \
   309 \   --> (! x. ? y. R x y)";
   309 \   --> (! x. ? y. R x y)";
   310 by (Blast_tac 1);
   310 by (Blast_tac 1);
   311 result();
   311 result();
   378 
   378 
   379 writeln"Problem 49  NOT PROVED AUTOMATICALLY";
   379 writeln"Problem 49  NOT PROVED AUTOMATICALLY";
   380 (*Hard because it involves substitution for Vars;
   380 (*Hard because it involves substitution for Vars;
   381   the type constraint ensures that x,y,z have the same type as a,b,u. *)
   381   the type constraint ensures that x,y,z have the same type as a,b,u. *)
   382 goal HOL.thy "(? x y::'a. ! z. z=x | z=y) & P(a) & P(b) & (~a=b) \
   382 goal HOL.thy "(? x y::'a. ! z. z=x | z=y) & P(a) & P(b) & (~a=b) \
   383 \               --> (! u::'a.P(u))";
   383 \               --> (! u::'a. P(u))";
   384 by (Classical.safe_tac (!claset));
   384 by (Classical.safe_tac (!claset));
   385 by (res_inst_tac [("x","a")] allE 1);
   385 by (res_inst_tac [("x","a")] allE 1);
   386 by (assume_tac 1);
   386 by (assume_tac 1);
   387 by (res_inst_tac [("x","b")] allE 1);
   387 by (res_inst_tac [("x","b")] allE 1);
   388 by (assume_tac 1);
   388 by (assume_tac 1);
   389 by (Blast_tac 1);
   389 by (Blast_tac 1);
   390 result();
   390 result();
   391 
   391 
   392 writeln"Problem 50";  
   392 writeln"Problem 50";  
   393 (*What has this to do with equality?*)
   393 (*What has this to do with equality?*)
   394 goal HOL.thy "(! x. P a x | (! y.P x y)) --> (? x. ! y.P x y)";
   394 goal HOL.thy "(! x. P a x | (! y. P x y)) --> (? x. ! y. P x y)";
   395 by (Blast_tac 1);
   395 by (Blast_tac 1);
   396 result();
   396 result();
   397 
   397 
   398 writeln"Problem 51";
   398 writeln"Problem 51";
   399 goal HOL.thy
   399 goal HOL.thy