src/HOL/Algebra/abstract/Ring2.ML
changeset 21416 f23e4e75dfd3
parent 20318 0e0ea63fe768
equal deleted inserted replaced
21415:39f98c88f88a 21416:f23e4e75dfd3
   162 Goal "!!a::'a::ring. (a = b) = (a -- b = 0)";
   162 Goal "!!a::'a::ring. (a = b) = (a -- b = 0)";
   163 *)
   163 *)
   164 
   164 
   165 *)
   165 *)
   166 
   166 
   167 (* Power *)
   167 val dvd_def = thm "dvd_def'";
   168 
       
   169 Goal "!!a::'a::ring. a ^ 0 = 1";
       
   170 by (simp_tac (simpset() addsimps [power_def]) 1);
       
   171 qed "power_0";
       
   172 
       
   173 Goal "!!a::'a::ring. a ^ Suc n = a ^ n * a";
       
   174 by (simp_tac (simpset() addsimps [power_def]) 1);
       
   175 qed "power_Suc";
       
   176 
       
   177 Addsimps [power_0, power_Suc];
       
   178 
       
   179 Goal "1 ^ n = (1::'a::ring)";
       
   180 by (induct_tac "n" 1);
       
   181 by Auto_tac;
       
   182 qed "power_one";
       
   183 
       
   184 Goal "!!n. n ~= 0 ==> 0 ^ n = (0::'a::ring)";
       
   185 by (etac rev_mp 1);
       
   186 by (induct_tac "n" 1);
       
   187 by Auto_tac;
       
   188 qed "power_zero";
       
   189 
       
   190 Addsimps [power_zero, power_one];
       
   191 
       
   192 Goal "!! a::'a::ring. a ^ m * a ^ n = a ^ (m + n)";
       
   193 by (induct_tac "m" 1);
       
   194 by (Simp_tac 1);
       
   195 by (Asm_simp_tac 1);
       
   196 qed "power_mult";
       
   197 
       
   198 (* Divisibility *)
       
   199 section "Divisibility";
       
   200 
       
   201 Goalw [dvd_def] "!! a::'a::ring. a dvd 0";
       
   202 by (res_inst_tac [("x", "0")] exI 1);
       
   203 by (Simp_tac 1);
       
   204 qed "dvd_zero_right";
       
   205 
       
   206 Goalw [dvd_def] "!! a::'a::ring. 0 dvd a ==> a = 0";
       
   207 by Auto_tac;
       
   208 qed "dvd_zero_left";
       
   209 
       
   210 Goalw [dvd_def] "!! a::'a::ring. a dvd a";
       
   211 by (res_inst_tac [("x", "1")] exI 1);
       
   212 by (Simp_tac 1);
       
   213 qed "dvd_refl_ring";
       
   214 
       
   215 Goalw [dvd_def] "!! a::'a::ring. [| a dvd b; b dvd c |] ==> a dvd c";
       
   216 by (Step_tac 1);
       
   217 by (res_inst_tac [("x", "k * ka")] exI 1);
       
   218 by (Asm_simp_tac 1);
       
   219 qed "dvd_trans_ring";
       
   220 
       
   221 Addsimps [dvd_zero_right, dvd_refl_ring];
       
   222 
   168 
   223 Goalw [dvd_def]
   169 Goalw [dvd_def]
   224   "!!a::'a::ring. [| a dvd 1; b dvd 1 |] ==> a * b dvd 1";
   170   "!!a::'a::ring. [| a dvd 1; b dvd 1 |] ==> a * b dvd 1";
   225 by (Clarify_tac 1);
   171 by (Clarify_tac 1);
   226 by (res_inst_tac [("x", "k * ka")] exI 1);
   172 by (res_inst_tac [("x", "k * ka")] exI 1);
   364 (* Fields *)
   310 (* Fields *)
   365 
   311 
   366 section "Fields";
   312 section "Fields";
   367 
   313 
   368 Goal "!! a::'a::field. (a dvd 1) = (a ~= 0)";
   314 Goal "!! a::'a::field. (a dvd 1) = (a ~= 0)";
   369 by (auto_tac (claset() addDs [thm "field_ax", dvd_zero_left],
   315 by (auto_tac (claset() addDs [thm "field_ax", thm "dvd_zero_left"],
   370   simpset() addsimps [thm "field_one_not_zero"]));
   316   simpset() addsimps [thm "field_one_not_zero"]));
   371 qed "field_unit";
   317 qed "field_unit";
   372 
   318 
   373 (* required for instantiation of field < domain in file Field.thy *)
   319 (* required for instantiation of field < domain in file Field.thy *)
   374 
   320