src/HOL/Nitpick_Examples/Core_Nits.thy
changeset 45970 b6d0cff57d96
parent 45035 60d2c03d5c70
child 46085 447cda88adfe
equal deleted inserted replaced
45969:562e99c3d316 45970:b6d0cff57d96
    73 
    73 
    74 lemma "(a\<Colon>'a\<times>'a, a) \<in> Id\<^sup>* \<union> {(a, b)}\<^sup>*"
    74 lemma "(a\<Colon>'a\<times>'a, a) \<in> Id\<^sup>* \<union> {(a, b)}\<^sup>*"
    75 nitpick [card = 1\<emdash>4, expect = none]
    75 nitpick [card = 1\<emdash>4, expect = none]
    76 by auto
    76 by auto
    77 
    77 
    78 lemma "Id (a, a)"
    78 lemma "(a, a) \<in> Id"
    79 nitpick [card = 1\<emdash>50, expect = none]
    79 nitpick [card = 1\<emdash>50, expect = none]
    80 by (auto simp: Id_def Collect_def)
    80 by (auto simp: Id_def)
    81 
    81 
    82 lemma "Id ((a\<Colon>'a, b\<Colon>'a), (a, b))"
    82 lemma "((a\<Colon>'a, b\<Colon>'a), (a, b)) \<in> Id"
    83 nitpick [card = 1\<emdash>10, expect = none]
    83 nitpick [card = 1\<emdash>10, expect = none]
    84 by (auto simp: Id_def Collect_def)
    84 by (auto simp: Id_def)
    85 
    85 
    86 lemma "UNIV (x\<Colon>'a\<times>'a)"
    86 lemma "(x\<Colon>'a\<times>'a) \<in> UNIV"
    87 nitpick [card = 1\<emdash>50, expect = none]
    87 nitpick [card = 1\<emdash>50, expect = none]
    88 sorry
    88 sorry
    89 
    89 
    90 lemma "{} = A - A"
    90 lemma "{} = A - A"
    91 nitpick [card = 1\<emdash>100, expect = none]
    91 nitpick [card = 1\<emdash>100, expect = none]
   537 
   537 
   538 lemma "(x, y) \<in> Id \<Longrightarrow> x = y"
   538 lemma "(x, y) \<in> Id \<Longrightarrow> x = y"
   539 nitpick [expect = none]
   539 nitpick [expect = none]
   540 by auto
   540 by auto
   541 
   541 
   542 lemma "I = (\<lambda>x. x) \<Longrightarrow> Id = (\<lambda>x. Id (I x))"
   542 lemma "I = (\<lambda>x. x) \<Longrightarrow> Id = {x. I x \<in> Id}"
   543 nitpick [expect = none]
   543 nitpick [expect = none]
   544 by auto
   544 by auto
   545 
   545 
   546 lemma "{} = (\<lambda>x. False)"
   546 lemma "{} = {x. False}"
   547 nitpick [expect = none]
   547 nitpick [expect = none]
   548 by (metis Collect_def empty_def)
   548 by (metis empty_def)
   549 
   549 
   550 lemma "x \<in> {}"
   550 lemma "x \<in> {}"
   551 nitpick [expect = genuine]
   551 nitpick [expect = genuine]
   552 oops
   552 oops
   553 
   553 
   569 
   569 
   570 lemma "{a, b, c} = {c, b, a}"
   570 lemma "{a, b, c} = {c, b, a}"
   571 nitpick [expect = none]
   571 nitpick [expect = none]
   572 by auto
   572 by auto
   573 
   573 
   574 lemma "UNIV = (\<lambda>x. True)"
   574 lemma "UNIV = {x. True}"
   575 nitpick [expect = none]
   575 nitpick [expect = none]
   576 by (simp only: UNIV_def Collect_def)
   576 by (simp only: UNIV_def)
   577 
   577 
   578 lemma "UNIV x = True"
   578 lemma "x \<in> UNIV \<longleftrightarrow> True"
   579 nitpick [expect = none]
   579 nitpick [expect = none]
   580 by (simp only: UNIV_def Collect_def)
   580 by (simp only: UNIV_def mem_Collect_eq)
   581 
   581 
   582 lemma "x \<notin> UNIV"
   582 lemma "x \<notin> UNIV"
   583 nitpick [expect = genuine]
   583 nitpick [expect = genuine]
   584 oops
   584 oops
   585 
   585 
   586 lemma "op \<in> = (\<lambda>x P. P x)"
   586 lemma "I = (\<lambda>x. x) \<Longrightarrow> op \<in> = (\<lambda>x. (op \<in> (I x)))"
   587 nitpick [expect = none]
   587 nitpick [expect = none]
   588 apply (rule ext)
   588 apply (rule ext)
   589 apply (rule ext)
   589 apply (rule ext)
   590 by (simp add: mem_def)
   590 by simp
   591 
       
   592 lemma "I = (\<lambda>x. x) \<Longrightarrow> op \<in> = (\<lambda>x. (op \<in> (I x)))"
       
   593 nitpick [expect = none]
       
   594 apply (rule ext)
       
   595 apply (rule ext)
       
   596 by (simp add: mem_def)
       
   597 
       
   598 lemma "P x = (x \<in> P)"
       
   599 nitpick [expect = none]
       
   600 by (simp add: mem_def)
       
   601 
   591 
   602 lemma "insert = (\<lambda>x y. insert x (y \<union> y))"
   592 lemma "insert = (\<lambda>x y. insert x (y \<union> y))"
   603 nitpick [expect = none]
   593 nitpick [expect = none]
   604 by simp
   594 by simp
   605 
   595 
   751 
   741 
   752 lemma "P (Eps P)"
   742 lemma "P (Eps P)"
   753 nitpick [expect = genuine]
   743 nitpick [expect = genuine]
   754 oops
   744 oops
   755 
   745 
   756 lemma "(P\<Colon>nat set) (Eps P)"
   746 lemma "Eps (\<lambda>x. x \<in> P) \<in> (P\<Colon>nat set)"
   757 nitpick [expect = genuine]
   747 nitpick [expect = genuine]
   758 oops
   748 oops
   759 
   749 
   760 lemma "\<not> P (Eps P)"
   750 lemma "\<not> P (Eps P)"
   761 nitpick [expect = genuine]
   751 nitpick [expect = genuine]
   762 oops
   752 oops
   763 
   753 
   764 lemma "\<not> (P\<Colon>nat set) (Eps P)"
   754 lemma "\<not> (P \<Colon> nat \<Rightarrow> bool) (Eps P)"
   765 nitpick [expect = genuine]
   755 nitpick [expect = genuine]
   766 oops
   756 oops
   767 
   757 
   768 lemma "P \<noteq> {} \<Longrightarrow> P (Eps P)"
   758 lemma "P \<noteq> bot \<Longrightarrow> P (Eps P)"
   769 nitpick [expect = none]
   759 nitpick [expect = none]
   770 sorry
   760 sorry
   771 
   761 
   772 lemma "(P\<Colon>nat set) \<noteq> {} \<Longrightarrow> P (Eps P)"
   762 lemma "(P \<Colon> nat \<Rightarrow> bool) \<noteq> bot \<Longrightarrow> P (Eps P)"
   773 nitpick [expect = none]
   763 nitpick [expect = none]
   774 sorry
   764 sorry
   775 
   765 
   776 lemma "P (The P)"
   766 lemma "P (The P)"
   777 nitpick [expect = genuine]
   767 nitpick [expect = genuine]
   778 oops
   768 oops
   779 
   769 
   780 lemma "(P\<Colon>nat set) (The P)"
   770 lemma "(P \<Colon> nat \<Rightarrow> bool) (The P)"
   781 nitpick [expect = genuine]
   771 nitpick [expect = genuine]
   782 oops
   772 oops
   783 
   773 
   784 lemma "\<not> P (The P)"
   774 lemma "\<not> P (The P)"
   785 nitpick [expect = genuine]
   775 nitpick [expect = genuine]
   786 oops
   776 oops
   787 
   777 
   788 lemma "\<not> (P\<Colon>nat set) (The P)"
   778 lemma "\<not> (P \<Colon> nat \<Rightarrow> bool) (The P)"
   789 nitpick [expect = genuine]
   779 nitpick [expect = genuine]
   790 oops
   780 oops
   791 
   781 
   792 lemma "The P \<noteq> x"
   782 lemma "The P \<noteq> x"
   793 nitpick [expect = genuine]
   783 nitpick [expect = genuine]
   803 
   793 
   804 lemma "P (x\<Colon>nat) \<Longrightarrow> P (The P)"
   794 lemma "P (x\<Colon>nat) \<Longrightarrow> P (The P)"
   805 nitpick [expect = genuine]
   795 nitpick [expect = genuine]
   806 oops
   796 oops
   807 
   797 
   808 lemma "P = {x} \<Longrightarrow> P (The P)"
   798 lemma "P = {x} \<Longrightarrow> (THE x. x \<in> P) \<in> P"
   809 nitpick [expect = none]
   799 nitpick [expect = none]
   810 oops
   800 oops
   811 
   801 
   812 lemma "P = {x\<Colon>nat} \<Longrightarrow> P (The P)"
   802 lemma "P = {x\<Colon>nat} \<Longrightarrow> (THE x. x \<in> P) \<in> P"
   813 nitpick [expect = none]
   803 nitpick [expect = none]
   814 oops
   804 oops
   815 
   805 
   816 consts Q :: 'a
   806 consts Q :: 'a
   817 
   807 
   818 lemma "Q (Eps Q)"
   808 lemma "Q (Eps Q)"
   819 nitpick [expect = genuine]
   809 nitpick [expect = genuine]
   820 oops
   810 oops
   821 
   811 
   822 lemma "(Q\<Colon>nat set) (Eps Q)"
   812 lemma "(Q \<Colon> nat \<Rightarrow> bool) (Eps Q)"
   823 nitpick [expect = none] (* unfortunate *)
   813 nitpick [expect = none] (* unfortunate *)
   824 oops
   814 oops
   825 
   815 
   826 lemma "\<not> Q (Eps Q)"
   816 lemma "\<not> (Q \<Colon> nat \<Rightarrow> bool) (Eps Q)"
   827 nitpick [expect = genuine]
   817 nitpick [expect = genuine]
   828 oops
   818 oops
   829 
   819 
   830 lemma "\<not> (Q\<Colon>nat set) (Eps Q)"
   820 lemma "\<not> (Q \<Colon> nat \<Rightarrow> bool) (Eps Q)"
   831 nitpick [expect = genuine]
   821 nitpick [expect = genuine]
   832 oops
   822 oops
   833 
   823 
   834 lemma "(Q\<Colon>'a set) \<noteq> {} \<Longrightarrow> (Q\<Colon>'a set) (Eps Q)"
   824 lemma "(Q \<Colon> 'a \<Rightarrow> bool) \<noteq> bot \<Longrightarrow> Q (Eps Q)"
   835 nitpick [expect = none]
   825 nitpick [expect = none]
   836 sorry
   826 sorry
   837 
   827 
   838 lemma "(Q\<Colon>nat set) \<noteq> {} \<Longrightarrow> (Q\<Colon>nat set) (Eps Q)"
   828 lemma "(Q \<Colon> nat \<Rightarrow> bool) \<noteq> top \<Longrightarrow> Q (Eps Q)"
   839 nitpick [expect = none]
   829 nitpick [expect = none]
   840 sorry
   830 sorry
   841 
   831 
   842 lemma "Q (The Q)"
   832 lemma "Q (The Q)"
   843 nitpick [expect = genuine]
   833 nitpick [expect = genuine]
   844 oops
   834 oops
   845 
   835 
   846 lemma "(Q\<Colon>nat set) (The Q)"
   836 lemma "(Q \<Colon> nat \<Rightarrow> bool) (The Q)"
   847 nitpick [expect = genuine]
   837 nitpick [expect = genuine]
   848 oops
   838 oops
   849 
   839 
   850 lemma "\<not> Q (The Q)"
   840 lemma "\<not> Q (The Q)"
   851 nitpick [expect = genuine]
   841 nitpick [expect = genuine]
   852 oops
   842 oops
   853 
   843 
   854 lemma "\<not> (Q\<Colon>nat set) (The Q)"
   844 lemma "\<not> (Q \<Colon> nat \<Rightarrow> bool) (The Q)"
   855 nitpick [expect = genuine]
   845 nitpick [expect = genuine]
   856 oops
   846 oops
   857 
   847 
   858 lemma "The Q \<noteq> x"
   848 lemma "The Q \<noteq> x"
   859 nitpick [expect = genuine]
   849 nitpick [expect = genuine]
   869 
   859 
   870 lemma "Q (x\<Colon>nat) \<Longrightarrow> Q (The Q)"
   860 lemma "Q (x\<Colon>nat) \<Longrightarrow> Q (The Q)"
   871 nitpick [expect = genuine]
   861 nitpick [expect = genuine]
   872 oops
   862 oops
   873 
   863 
   874 lemma "Q = {x\<Colon>'a} \<Longrightarrow> (Q\<Colon>'a set) (The Q)"
   864 lemma "Q = {x\<Colon>'a} \<Longrightarrow> (The Q) \<in> (Q\<Colon>'a set)"
   875 nitpick [expect = none]
   865 nitpick [expect = none]
   876 sorry
   866 sorry
   877 
   867 
   878 lemma "Q = {x\<Colon>nat} \<Longrightarrow> (Q\<Colon>nat set) (The Q)"
   868 lemma "Q = {x\<Colon>nat} \<Longrightarrow> (The Q) \<in> (Q\<Colon>nat set)"
   879 nitpick [expect = none]
   869 nitpick [expect = none]
   880 sorry
   870 sorry
   881 
   871 
   882 nitpick_params [max_potential = 1]
   872 nitpick_params [max_potential = 1]
   883 
   873