src/HOL/ex/Refute_Examples.thy
changeset 45972 deda685ba210
parent 45694 4a8743618257
child 46099 40ac5ae6d16f
equal deleted inserted replaced
45971:b27e93132603 45972:deda685ba210
   108 lemma "(f::('d\<Rightarrow>'d)\<Rightarrow>('c\<Rightarrow>'d)) = g"
   108 lemma "(f::('d\<Rightarrow>'d)\<Rightarrow>('c\<Rightarrow>'d)) = g"
   109   refute
   109   refute
   110 oops
   110 oops
   111 
   111 
   112 lemma "distinct [a,b]"
   112 lemma "distinct [a,b]"
   113   refute
   113   (*refute*)
   114   apply simp
   114   apply simp
   115   refute
   115   refute
   116 oops
   116 oops
   117 
   117 
   118 (*****************************************************************************)
   118 (*****************************************************************************)
   377 (*****************************************************************************)
   377 (*****************************************************************************)
   378 
   378 
   379 subsubsection {* Sets *}
   379 subsubsection {* Sets *}
   380 
   380 
   381 lemma "P (A::'a set)"
   381 lemma "P (A::'a set)"
   382   refute
   382  (* refute *)
   383 oops
   383 oops
   384 
   384 
   385 lemma "P (A::'a set set)"
   385 lemma "P (A::'a set set)"
   386   refute
   386  (* refute *)
   387 oops
   387 oops
   388 
   388 
   389 lemma "{x. P x} = {y. P y}"
   389 lemma "{x. P x} = {y. P y}"
   390   refute
   390  (* refute *)
   391   apply simp
   391   apply simp
   392 done
   392 done
   393 
   393 
   394 lemma "x : {x. P x}"
   394 lemma "x : {x. P x}"
   395   refute
   395  (* refute *)
   396 oops
   396 oops
   397 
   397 
   398 lemma "P op:"
   398 lemma "P op:"
   399   refute
   399  (* refute *)
   400 oops
   400 oops
   401 
   401 
   402 lemma "P (op: x)"
   402 lemma "P (op: x)"
   403   refute
   403  (* refute *)
   404 oops
   404 oops
   405 
   405 
   406 lemma "P Collect"
   406 lemma "P Collect"
   407   refute
   407  (* refute *)
   408 oops
   408 oops
   409 
   409 
   410 lemma "A Un B = A Int B"
   410 lemma "A Un B = A Int B"
   411   refute
   411  (* refute *)
   412 oops
   412 oops
   413 
   413 
   414 lemma "(A Int B) Un C = (A Un C) Int B"
   414 lemma "(A Int B) Un C = (A Un C) Int B"
   415   refute
   415  (* refute *)
   416 oops
   416 oops
   417 
   417 
   418 lemma "Ball A P \<longrightarrow> Bex A P"
   418 lemma "Ball A P \<longrightarrow> Bex A P"
   419   refute
   419  (* refute *)
   420 oops
   420 oops
   421 
   421 
   422 (*****************************************************************************)
   422 (*****************************************************************************)
   423 
   423 
   424 subsubsection {* undefined *}
   424 subsubsection {* undefined *}
   498 
   498 
   499 typedef (open) 'a myTdef = "myTdef :: 'a set"
   499 typedef (open) 'a myTdef = "myTdef :: 'a set"
   500   unfolding myTdef_def by auto
   500   unfolding myTdef_def by auto
   501 
   501 
   502 lemma "(x::'a myTdef) = y"
   502 lemma "(x::'a myTdef) = y"
   503   refute
   503  (* refute *)
   504 oops
   504 oops
   505 
   505 
   506 typedecl myTdecl
   506 typedecl myTdecl
   507 
   507 
   508 definition "T_bij = {(f::'a\<Rightarrow>'a). \<forall>y. \<exists>!x. f x = y}"
   508 definition "T_bij = {(f::'a\<Rightarrow>'a). \<forall>y. \<exists>!x. f x = y}"
   509 
   509 
   510 typedef (open) 'a T_bij = "T_bij :: ('a \<Rightarrow> 'a) set"
   510 typedef (open) 'a T_bij = "T_bij :: ('a \<Rightarrow> 'a) set"
   511   unfolding T_bij_def by auto
   511   unfolding T_bij_def by auto
   512 
   512 
   513 lemma "P (f::(myTdecl myTdef) T_bij)"
   513 lemma "P (f::(myTdecl myTdef) T_bij)"
   514   refute
   514  (* refute *)
   515 oops
   515 oops
   516 
   516 
   517 (*****************************************************************************)
   517 (*****************************************************************************)
   518 
   518 
   519 subsubsection {* Inductive datatypes *}
   519 subsubsection {* Inductive datatypes *}
  1308 record ('a, 'b) point =
  1308 record ('a, 'b) point =
  1309   xpos :: 'a
  1309   xpos :: 'a
  1310   ypos :: 'b
  1310   ypos :: 'b
  1311 
  1311 
  1312 lemma "(x::('a, 'b) point) = y"
  1312 lemma "(x::('a, 'b) point) = y"
  1313   refute
  1313  (* refute *)
  1314 oops
  1314 oops
  1315 
  1315 
  1316 record ('a, 'b, 'c) extpoint = "('a, 'b) point" +
  1316 record ('a, 'b, 'c) extpoint = "('a, 'b) point" +
  1317   ext :: 'c
  1317   ext :: 'c
  1318 
  1318 
  1319 lemma "(x::('a, 'b, 'c) extpoint) = y"
  1319 lemma "(x::('a, 'b, 'c) extpoint) = y"
  1320   refute
  1320  (* refute *)
  1321 oops
  1321 oops
  1322 
  1322 
  1323 (*****************************************************************************)
  1323 (*****************************************************************************)
  1324 
  1324 
  1325 subsubsection {* Inductively defined sets *}
  1325 subsubsection {* Inductively defined sets *}
  1327 inductive_set arbitrarySet :: "'a set"
  1327 inductive_set arbitrarySet :: "'a set"
  1328 where
  1328 where
  1329   "undefined : arbitrarySet"
  1329   "undefined : arbitrarySet"
  1330 
  1330 
  1331 lemma "x : arbitrarySet"
  1331 lemma "x : arbitrarySet"
  1332   refute
  1332  (* refute *)
  1333 oops
  1333 oops
  1334 
  1334 
  1335 inductive_set evenCard :: "'a set set"
  1335 inductive_set evenCard :: "'a set set"
  1336 where
  1336 where
  1337   "{} : evenCard"
  1337   "{} : evenCard"
  1338 | "\<lbrakk> S : evenCard; x \<notin> S; y \<notin> S; x \<noteq> y \<rbrakk> \<Longrightarrow> S \<union> {x, y} : evenCard"
  1338 | "\<lbrakk> S : evenCard; x \<notin> S; y \<notin> S; x \<noteq> y \<rbrakk> \<Longrightarrow> S \<union> {x, y} : evenCard"
  1339 
  1339 
  1340 lemma "S : evenCard"
  1340 lemma "S : evenCard"
  1341   refute
  1341  (* refute *)
  1342 oops
  1342 oops
  1343 
  1343 
  1344 inductive_set
  1344 inductive_set
  1345   even :: "nat set"
  1345   even :: "nat set"
  1346   and odd  :: "nat set"
  1346   and odd  :: "nat set"
  1372 (*****************************************************************************)
  1372 (*****************************************************************************)
  1373 
  1373 
  1374 subsubsection {* Examples involving special functions *}
  1374 subsubsection {* Examples involving special functions *}
  1375 
  1375 
  1376 lemma "card x = 0"
  1376 lemma "card x = 0"
  1377   refute
  1377  (* refute *)
  1378 oops
  1378 oops
  1379 
  1379 
  1380 lemma "finite x"
  1380 lemma "finite x"
  1381   refute  -- {* no finite countermodel exists *}
  1381  (* refute *) -- {* no finite countermodel exists *}
  1382 oops
  1382 oops
  1383 
  1383 
  1384 lemma "(x::nat) + y = 0"
  1384 lemma "(x::nat) + y = 0"
  1385   refute
  1385   refute
  1386 oops
  1386 oops
  1408 lemma "xs @ ys = ys @ xs"
  1408 lemma "xs @ ys = ys @ xs"
  1409   refute
  1409   refute
  1410 oops
  1410 oops
  1411 
  1411 
  1412 lemma "f (lfp f) = lfp f"
  1412 lemma "f (lfp f) = lfp f"
  1413   refute
  1413  (* refute *)
  1414 oops
  1414 oops
  1415 
  1415 
  1416 lemma "f (gfp f) = gfp f"
  1416 lemma "f (gfp f) = gfp f"
  1417   refute
  1417  (* refute *)
  1418 oops
  1418 oops
  1419 
  1419 
  1420 lemma "lfp f = gfp f"
  1420 lemma "lfp f = gfp f"
  1421   refute
  1421  (* refute *)
  1422 oops
  1422 oops
  1423 
  1423 
  1424 (*****************************************************************************)
  1424 (*****************************************************************************)
  1425 
  1425 
  1426 subsubsection {* Type classes and overloading *}
  1426 subsubsection {* Type classes and overloading *}
  1492 lemma "inverse b"
  1492 lemma "inverse b"
  1493   refute
  1493   refute
  1494 oops
  1494 oops
  1495 
  1495 
  1496 lemma "P (inverse (S::'a set))"
  1496 lemma "P (inverse (S::'a set))"
  1497   refute
  1497  (* refute*)
  1498 oops
  1498 oops
  1499 
  1499 
  1500 lemma "P (inverse (p::'a\<times>'b))"
  1500 lemma "P (inverse (p::'a\<times>'b))"
  1501   refute
  1501   refute
  1502 oops
  1502 oops
  1513 oops
  1513 oops
  1514 
  1514 
  1515 refute_params [satsolver="auto"]
  1515 refute_params [satsolver="auto"]
  1516 
  1516 
  1517 end
  1517 end
       
  1518