src/HOL/UNITY/LessThan.ML
changeset 5490 85855f65d0c6
parent 5355 a9f71e87f53e
child 5596 b29d18d8c4d2
equal deleted inserted replaced
5489:15c97b95b3e3 5490:85855f65d0c6
    30 Goal "(UN m. lessThan m) = UNIV";
    30 Goal "(UN m. lessThan m) = UNIV";
    31 by (Blast_tac 1);
    31 by (Blast_tac 1);
    32 qed "UN_lessThan_UNIV";
    32 qed "UN_lessThan_UNIV";
    33 
    33 
    34 Goalw [lessThan_def, atLeast_def, le_def]
    34 Goalw [lessThan_def, atLeast_def, le_def]
    35     "Compl(lessThan k) = atLeast k";
    35     "-lessThan k = atLeast k";
    36 by (Blast_tac 1);
    36 by (Blast_tac 1);
    37 qed "Compl_lessThan";
    37 qed "Compl_lessThan";
    38 
    38 
    39 
    39 
    40 (*** greaterThan ***)
    40 (*** greaterThan ***)
    56 Goal "(INT m. greaterThan m) = {}";
    56 Goal "(INT m. greaterThan m) = {}";
    57 by (Blast_tac 1);
    57 by (Blast_tac 1);
    58 qed "INT_greaterThan_UNIV";
    58 qed "INT_greaterThan_UNIV";
    59 
    59 
    60 Goalw [greaterThan_def, atMost_def, le_def]
    60 Goalw [greaterThan_def, atMost_def, le_def]
    61     "Compl(greaterThan k) = atMost k";
    61     "-greaterThan k = atMost k";
    62 by (Blast_tac 1);
    62 by (Blast_tac 1);
    63 qed "Compl_greaterThan";
    63 qed "Compl_greaterThan";
    64 
    64 
    65 Goalw [greaterThan_def, atMost_def, le_def]
    65 Goalw [greaterThan_def, atMost_def, le_def]
    66     "Compl(atMost k) = greaterThan k";
    66     "-atMost k = greaterThan k";
    67 by (Blast_tac 1);
    67 by (Blast_tac 1);
    68 qed "Compl_atMost";
    68 qed "Compl_atMost";
    69 
    69 
    70 Goal "less_than ^^ {k} = greaterThan k";
    70 Goal "less_than ^^ {k} = greaterThan k";
    71 by (Blast_tac 1);
    71 by (Blast_tac 1);
    94 Goal "(UN m. atLeast m) = UNIV";
    94 Goal "(UN m. atLeast m) = UNIV";
    95 by (Blast_tac 1);
    95 by (Blast_tac 1);
    96 qed "UN_atLeast_UNIV";
    96 qed "UN_atLeast_UNIV";
    97 
    97 
    98 Goalw [lessThan_def, atLeast_def, le_def]
    98 Goalw [lessThan_def, atLeast_def, le_def]
    99     "Compl(atLeast k) = lessThan k";
    99     "-atLeast k = lessThan k";
   100 by (Blast_tac 1);
   100 by (Blast_tac 1);
   101 qed "Compl_atLeast";
   101 qed "Compl_atLeast";
   102 
   102 
   103 Goal "less_than^-1 ^^ {k} = lessThan k";
   103 Goal "less_than^-1 ^^ {k} = lessThan k";
   104 by (Blast_tac 1);
   104 by (Blast_tac 1);
   126 Goal "(UN m. atMost m) = UNIV";
   126 Goal "(UN m. atMost m) = UNIV";
   127 by (Blast_tac 1);
   127 by (Blast_tac 1);
   128 qed "UN_atMost_UNIV";
   128 qed "UN_atMost_UNIV";
   129 
   129 
   130 Goalw [atMost_def, le_def]
   130 Goalw [atMost_def, le_def]
   131     "Compl(atMost k) = greaterThan k";
   131     "-atMost k = greaterThan k";
   132 by (Blast_tac 1);
   132 by (Blast_tac 1);
   133 qed "Compl_atMost";
   133 qed "Compl_atMost";
   134 Addsimps [Compl_atMost];
   134 Addsimps [Compl_atMost];
   135 
   135 
   136 
   136 
   146 (*** Finally, a few set-theoretic laws...
   146 (*** Finally, a few set-theoretic laws...
   147      CAN BOOLEAN SIMPLIFICATION BE AUTOMATED? ***)
   147      CAN BOOLEAN SIMPLIFICATION BE AUTOMATED? ***)
   148 
   148 
   149 context Set.thy;
   149 context Set.thy;
   150 
   150 
   151 (** Rewrites rules to eliminate A.  Conditions can be satisfied by letting B
   151 (** Rewrite rules to eliminate A.  Conditions can be satisfied by letting B
   152     be any set including A Int C and contained in A Un C, such as B=A or B=C.
   152     be any set including A Int C and contained in A Un C, such as B=A or B=C.
   153 **)
   153 **)
   154 
   154 
   155 Goal "[| A Int C <= B; B <= A Un C |] \
   155 Goal "[| A Int C <= B; B <= A Un C |] \
   156 \     ==> (A Int B) Un (Compl A Int C) = B Un C";
   156 \     ==> (A Int B) Un (-A Int C) = B Un C";
   157 by (Blast_tac 1);
   157 by (Blast_tac 1);
       
   158 qed "set_cancel1";
   158 
   159 
   159 Goal "[| A Int C <= B; B <= A Un C |] \
   160 Goal "[| A Int C <= B; B <= A Un C |] \
   160 \     ==> (A Un B) Int (Compl A Un C) = B Int C";
   161 \     ==> (A Un B) Int (-A Un C) = B Int C";
   161 by (Blast_tac 1);
   162 by (Blast_tac 1);
       
   163 qed "set_cancel2";
   162 
   164 
   163 (*The base B=A*)
   165 (*The base B=A*)
   164 Goal "A Un (Compl A Int C) = A Un C";
   166 Goal "A Un (-A Int C) = A Un C";
   165 by (Blast_tac 1);
   167 by (Blast_tac 1);
   166 
   168 qed "set_cancel3";
   167 Goal "A Int (Compl A Un C) = A Int C";
   169 
   168 by (Blast_tac 1);
   170 Goal "A Int (-A Un C) = A Int C";
       
   171 by (Blast_tac 1);
       
   172 qed "set_cancel4";
   169 
   173 
   170 (*The base B=C*)
   174 (*The base B=C*)
   171 Goal "(A Int C) Un (Compl A Int C) = C";
   175 Goal "(A Int C) Un (-A Int C) = C";
   172 by (Blast_tac 1);
   176 by (Blast_tac 1);
   173 
   177 qed "set_cancel5";
   174 Goal "(A Un C) Int (Compl A Un C) = C";
   178 
   175 by (Blast_tac 1);
   179 Goal "(A Un C) Int (-A Un C) = C";
       
   180 by (Blast_tac 1);
       
   181 qed "set_cancel6";
       
   182 
       
   183 Addsimps [set_cancel1, set_cancel2, set_cancel3,
       
   184 	  set_cancel4, set_cancel5, set_cancel6];
   176 
   185 
   177 
   186 
   178 (** More ad-hoc rules **)
   187 (** More ad-hoc rules **)
   179 
   188 
   180 Goal "A Un B - (A - B) = B";
   189 Goal "A Un B - (A - B) = B";
   181 by (Blast_tac 1);
   190 by (Blast_tac 1);
   182 qed "Un_Diff_Diff";
   191 qed "Un_Diff_Diff";
       
   192 Addsimps [Un_Diff_Diff];
   183 
   193 
   184 Goal "A Int (B - C) Un C = A Int B Un C";
   194 Goal "A Int (B - C) Un C = A Int B Un C";
   185 by (Blast_tac 1);
   195 by (Blast_tac 1);
   186 qed "Int_Diff_Un";
   196 qed "Int_Diff_Un";
   187 
   197