3 *) |
3 *) |
4 |
4 |
5 section \<open>More on rings etc.\<close> |
5 section \<open>More on rings etc.\<close> |
6 |
6 |
7 theory More_Ring |
7 theory More_Ring |
8 imports |
8 imports Ring |
9 Ring |
|
10 begin |
9 begin |
11 |
10 |
12 lemma (in cring) field_intro2: "\<zero>\<^bsub>R\<^esub> ~= \<one>\<^bsub>R\<^esub> \<Longrightarrow> \<forall>x \<in> carrier R - {\<zero>\<^bsub>R\<^esub>}. x \<in> Units R \<Longrightarrow> field R" |
11 lemma (in cring) field_intro2: "\<zero>\<^bsub>R\<^esub> \<noteq> \<one>\<^bsub>R\<^esub> \<Longrightarrow> \<forall>x \<in> carrier R - {\<zero>\<^bsub>R\<^esub>}. x \<in> Units R \<Longrightarrow> field R" |
13 apply (unfold_locales) |
12 apply (unfold_locales) |
14 apply (insert cring_axioms, auto) |
13 apply (use cring_axioms in auto) |
15 apply (rule trans) |
14 apply (rule trans) |
16 apply (subgoal_tac "a = (a \<otimes> b) \<otimes> inv b") |
15 apply (subgoal_tac "a = (a \<otimes> b) \<otimes> inv b") |
17 apply assumption |
16 apply assumption |
18 apply (subst m_assoc) |
17 apply (subst m_assoc) |
19 apply auto |
18 apply auto |
20 apply (unfold Units_def) |
19 apply (unfold Units_def) |
21 apply auto |
20 apply auto |
22 done |
21 done |
23 |
22 |
24 lemma (in monoid) inv_char: "x : carrier G \<Longrightarrow> y : carrier G \<Longrightarrow> |
23 lemma (in monoid) inv_char: |
25 x \<otimes> y = \<one> \<Longrightarrow> y \<otimes> x = \<one> \<Longrightarrow> inv x = y" |
24 "x \<in> carrier G \<Longrightarrow> y \<in> carrier G \<Longrightarrow> x \<otimes> y = \<one> \<Longrightarrow> y \<otimes> x = \<one> \<Longrightarrow> inv x = y" |
26 apply (subgoal_tac "x : Units G") |
25 apply (subgoal_tac "x \<in> Units G") |
27 apply (subgoal_tac "y = inv x \<otimes> \<one>") |
26 apply (subgoal_tac "y = inv x \<otimes> \<one>") |
28 apply simp |
27 apply simp |
29 apply (erule subst) |
28 apply (erule subst) |
30 apply (subst m_assoc [symmetric]) |
29 apply (subst m_assoc [symmetric]) |
31 apply auto |
30 apply auto |
32 apply (unfold Units_def) |
31 apply (unfold Units_def) |
33 apply auto |
32 apply auto |
34 done |
33 done |
35 |
34 |
36 lemma (in comm_monoid) comm_inv_char: "x : carrier G \<Longrightarrow> y : carrier G \<Longrightarrow> |
35 lemma (in comm_monoid) comm_inv_char: "x \<in> carrier G \<Longrightarrow> y \<in> carrier G \<Longrightarrow> x \<otimes> y = \<one> \<Longrightarrow> inv x = y" |
37 x \<otimes> y = \<one> \<Longrightarrow> inv x = y" |
|
38 apply (rule inv_char) |
36 apply (rule inv_char) |
39 apply auto |
37 apply auto |
40 apply (subst m_comm, auto) |
38 apply (subst m_comm, auto) |
41 done |
39 done |
42 |
40 |
43 lemma (in ring) inv_neg_one [simp]: "inv (\<ominus> \<one>) = \<ominus> \<one>" |
41 lemma (in ring) inv_neg_one [simp]: "inv (\<ominus> \<one>) = \<ominus> \<one>" |
44 apply (rule inv_char) |
42 apply (rule inv_char) |
45 apply (auto simp add: l_minus r_minus) |
43 apply (auto simp add: l_minus r_minus) |
46 done |
44 done |
47 |
45 |
48 lemma (in monoid) inv_eq_imp_eq: "x : Units G \<Longrightarrow> y : Units G \<Longrightarrow> |
46 lemma (in monoid) inv_eq_imp_eq: "x \<in> Units G \<Longrightarrow> y \<in> Units G \<Longrightarrow> inv x = inv y \<Longrightarrow> x = y" |
49 inv x = inv y \<Longrightarrow> x = y" |
47 apply (subgoal_tac "inv (inv x) = inv (inv y)") |
50 apply (subgoal_tac "inv(inv x) = inv(inv y)") |
48 apply (subst (asm) Units_inv_inv)+ |
51 apply (subst (asm) Units_inv_inv)+ |
49 apply auto |
52 apply auto |
|
53 done |
50 done |
54 |
51 |
55 lemma (in ring) Units_minus_one_closed [intro]: "\<ominus> \<one> : Units R" |
52 lemma (in ring) Units_minus_one_closed [intro]: "\<ominus> \<one> \<in> Units R" |
56 apply (unfold Units_def) |
53 apply (unfold Units_def) |
57 apply auto |
54 apply auto |
58 apply (rule_tac x = "\<ominus> \<one>" in bexI) |
55 apply (rule_tac x = "\<ominus> \<one>" in bexI) |
59 apply auto |
56 apply auto |
60 apply (simp add: l_minus r_minus) |
57 apply (simp add: l_minus r_minus) |
61 done |
58 done |
62 |
59 |
63 lemma (in monoid) inv_one [simp]: "inv \<one> = \<one>" |
60 lemma (in monoid) inv_one [simp]: "inv \<one> = \<one>" |
64 apply (rule inv_char) |
61 apply (rule inv_char) |
65 apply auto |
62 apply auto |
66 done |
63 done |
67 |
64 |
68 lemma (in ring) inv_eq_neg_one_eq: "x : Units R \<Longrightarrow> (inv x = \<ominus> \<one>) = (x = \<ominus> \<one>)" |
65 lemma (in ring) inv_eq_neg_one_eq: "x \<in> Units R \<Longrightarrow> inv x = \<ominus> \<one> \<longleftrightarrow> x = \<ominus> \<one>" |
69 apply auto |
66 apply auto |
70 apply (subst Units_inv_inv [symmetric]) |
67 apply (subst Units_inv_inv [symmetric]) |
71 apply auto |
68 apply auto |
72 done |
69 done |
73 |
70 |
74 lemma (in monoid) inv_eq_one_eq: "x : Units G \<Longrightarrow> (inv x = \<one>) = (x = \<one>)" |
71 lemma (in monoid) inv_eq_one_eq: "x \<in> Units G \<Longrightarrow> inv x = \<one> \<longleftrightarrow> x = \<one>" |
75 by (metis Units_inv_inv inv_one) |
72 by (metis Units_inv_inv inv_one) |
76 |
73 |
77 end |
74 end |