src/HOL/Algebra/Ideal.thy
changeset 27717 21bbd410ba04
parent 27714 27b4d7c01f8b
child 29237 e90d9d51106b
equal deleted inserted replaced
27716:96699d8eb49e 27717:21bbd410ba04
     8 imports Ring AbelCoset
     8 imports Ring AbelCoset
     9 begin
     9 begin
    10 
    10 
    11 section {* Ideals *}
    11 section {* Ideals *}
    12 
    12 
    13 subsection {* General definition *}
    13 subsection {* Definitions *}
       
    14 
       
    15 subsubsection {* General definition *}
    14 
    16 
    15 locale ideal = additive_subgroup I R + ring R +
    17 locale ideal = additive_subgroup I R + ring R +
    16   assumes I_l_closed: "\<lbrakk>a \<in> I; x \<in> carrier R\<rbrakk> \<Longrightarrow> x \<otimes> a \<in> I"
    18   assumes I_l_closed: "\<lbrakk>a \<in> I; x \<in> carrier R\<rbrakk> \<Longrightarrow> x \<otimes> a \<in> I"
    17       and I_r_closed: "\<lbrakk>a \<in> I; x \<in> carrier R\<rbrakk> \<Longrightarrow> a \<otimes> x \<in> I"
    19       and I_r_closed: "\<lbrakk>a \<in> I; x \<in> carrier R\<rbrakk> \<Longrightarrow> a \<otimes> x \<in> I"
    18 
    20 
    42    apply (erule (1) I_l_closed)
    44    apply (erule (1) I_l_closed)
    43   apply (erule (1) I_r_closed)
    45   apply (erule (1) I_r_closed)
    44   done
    46   done
    45 qed
    47 qed
    46 
    48 
    47 subsection {* Ideals Generated by a Subset of @{term [locale=ring] "carrier R"} *}
    49 subsubsection {* Ideals Generated by a Subset of @{term [locale=ring] "carrier R"} *}
    48 
    50 
    49 constdefs (structure R)
    51 constdefs (structure R)
    50   genideal :: "('a, 'b) ring_scheme \<Rightarrow> 'a set \<Rightarrow> 'a set"  ("Idl\<index> _" [80] 79)
    52   genideal :: "('a, 'b) ring_scheme \<Rightarrow> 'a set \<Rightarrow> 'a set"  ("Idl\<index> _" [80] 79)
    51   "genideal R S \<equiv> Inter {I. ideal I R \<and> S \<subseteq> I}"
    53   "genideal R S \<equiv> Inter {I. ideal I R \<and> S \<subseteq> I}"
    52 
    54 
    53 
    55 
    54 subsection {* Principal Ideals *}
    56 subsubsection {* Principal Ideals *}
    55 
    57 
    56 locale principalideal = ideal +
    58 locale principalideal = ideal +
    57   assumes generate: "\<exists>i \<in> carrier R. I = Idl {i}"
    59   assumes generate: "\<exists>i \<in> carrier R. I = Idl {i}"
    58 
    60 
    59 lemma (in principalideal) is_principalideal:
    61 lemma (in principalideal) is_principalideal:
    68 proof -
    70 proof -
    69   interpret ideal [I R] by fact
    71   interpret ideal [I R] by fact
    70   show ?thesis  by (intro principalideal.intro principalideal_axioms.intro) (rule is_ideal, rule generate)
    72   show ?thesis  by (intro principalideal.intro principalideal_axioms.intro) (rule is_ideal, rule generate)
    71 qed
    73 qed
    72 
    74 
    73 subsection {* Maximal Ideals *}
    75 subsubsection {* Maximal Ideals *}
    74 
    76 
    75 locale maximalideal = ideal +
    77 locale maximalideal = ideal +
    76   assumes I_notcarr: "carrier R \<noteq> I"
    78   assumes I_notcarr: "carrier R \<noteq> I"
    77       and I_maximal: "\<lbrakk>ideal J R; I \<subseteq> J; J \<subseteq> carrier R\<rbrakk> \<Longrightarrow> J = I \<or> J = carrier R"
    79       and I_maximal: "\<lbrakk>ideal J R; I \<subseteq> J; J \<subseteq> carrier R\<rbrakk> \<Longrightarrow> J = I \<or> J = carrier R"
    78 
    80 
    90   interpret ideal [I R] by fact
    92   interpret ideal [I R] by fact
    91   show ?thesis by (intro maximalideal.intro maximalideal_axioms.intro)
    93   show ?thesis by (intro maximalideal.intro maximalideal_axioms.intro)
    92     (rule is_ideal, rule I_notcarr, rule I_maximal)
    94     (rule is_ideal, rule I_notcarr, rule I_maximal)
    93 qed
    95 qed
    94 
    96 
    95 subsection {* Prime Ideals *}
    97 subsubsection {* Prime Ideals *}
    96 
    98 
    97 locale primeideal = ideal + cring +
    99 locale primeideal = ideal + cring +
    98   assumes I_notcarr: "carrier R \<noteq> I"
   100   assumes I_notcarr: "carrier R \<noteq> I"
    99       and I_prime: "\<lbrakk>a \<in> carrier R; b \<in> carrier R; a \<otimes> b \<in> I\<rbrakk> \<Longrightarrow> a \<in> I \<or> b \<in> I"
   101       and I_prime: "\<lbrakk>a \<in> carrier R; b \<in> carrier R; a \<otimes> b \<in> I\<rbrakk> \<Longrightarrow> a \<in> I \<or> b \<in> I"
   100 
   102 
   135     apply (intro primeideal_axioms.intro)
   137     apply (intro primeideal_axioms.intro)
   136     apply (rule I_notcarr)
   138     apply (rule I_notcarr)
   137     apply (erule (2) I_prime)
   139     apply (erule (2) I_prime)
   138     done
   140     done
   139 qed
   141 qed
   140 
       
   141 section {* Properties of Ideals *}
       
   142 
   142 
   143 subsection {* Special Ideals *}
   143 subsection {* Special Ideals *}
   144 
   144 
   145 lemma (in ring) zeroideal:
   145 lemma (in ring) zeroideal:
   146   shows "ideal {\<zero>} R"
   146   shows "ideal {\<zero>} R"
   220   apply (fast intro: ideal.I_l_closed ideal.intro assms)+
   220   apply (fast intro: ideal.I_l_closed ideal.intro assms)+
   221 apply (clarsimp, rule)
   221 apply (clarsimp, rule)
   222  apply (fast intro: ideal.I_r_closed ideal.intro assms)+
   222  apply (fast intro: ideal.I_r_closed ideal.intro assms)+
   223 done
   223 done
   224 qed
   224 qed
   225 
       
   226 subsubsection {* Intersection of a Set of Ideals *}
       
   227 
   225 
   228 text {* The intersection of any Number of Ideals is again
   226 text {* The intersection of any Number of Ideals is again
   229         an Ideal in @{term R} *}
   227         an Ideal in @{term R} *}
   230 lemma (in ring) i_Intersect:
   228 lemma (in ring) i_Intersect:
   231   assumes Sideals: "\<And>I. I \<in> S \<Longrightarrow> ideal I R"
   229   assumes Sideals: "\<And>I. I \<in> S \<Longrightarrow> ideal I R"
   350 
   348 
   351 
   349 
   352 subsection {* Ideals generated by a subset of @{term [locale=ring]
   350 subsection {* Ideals generated by a subset of @{term [locale=ring]
   353   "carrier R"} *}
   351   "carrier R"} *}
   354 
   352 
   355 subsubsection {* Generation of Ideals in General Rings *}
       
   356 
       
   357 text {* @{term genideal} generates an ideal *}
   353 text {* @{term genideal} generates an ideal *}
   358 lemma (in ring) genideal_ideal:
   354 lemma (in ring) genideal_ideal:
   359   assumes Scarr: "S \<subseteq> carrier R"
   355   assumes Scarr: "S \<subseteq> carrier R"
   360   shows "ideal (Idl S) R"
   356   shows "ideal (Idl S) R"
   361 unfolding genideal_def
   357 unfolding genideal_def
   453   apply (simp add: one_imp_carrier genideal_self')
   449   apply (simp add: one_imp_carrier genideal_self')
   454   done
   450   done
   455 qed
   451 qed
   456 
   452 
   457 
   453 
   458 subsubsection {* Generation of Principal Ideals in Commutative Rings *}
   454 text {* Generation of Principal Ideals in Commutative Rings *}
   459 
   455 
   460 constdefs (structure R)
   456 constdefs (structure R)
   461   cgenideal :: "('a, 'b) monoid_scheme \<Rightarrow> 'a \<Rightarrow> 'a set"  ("PIdl\<index> _" [80] 79)
   457   cgenideal :: "('a, 'b) monoid_scheme \<Rightarrow> 'a \<Rightarrow> 'a set"  ("PIdl\<index> _" [80] 79)
   462   "cgenideal R a \<equiv> { x \<otimes> a | x. x \<in> carrier R }"
   458   "cgenideal R a \<equiv> { x \<otimes> a | x. x \<in> carrier R }"
   463 
   459 
   871     from this and JnI and Jncarr
   867     from this and JnI and Jncarr
   872     show "False" by simp
   868     show "False" by simp
   873   qed
   869   qed
   874 qed
   870 qed
   875 
   871 
   876 subsection {* Derived Theorems Involving Ideals *}
   872 subsection {* Derived Theorems *}
   877 
   873 
   878 --"A non-zero cring that has only the two trivial ideals is a field"
   874 --"A non-zero cring that has only the two trivial ideals is a field"
   879 lemma (in cring) trivialideals_fieldI:
   875 lemma (in cring) trivialideals_fieldI:
   880   assumes carrnzero: "carrier R \<noteq> {\<zero>}"
   876   assumes carrnzero: "carrier R \<noteq> {\<zero>}"
   881       and haveideals: "{I. ideal I R} = {{\<zero>}, carrier R}"
   877       and haveideals: "{I. ideal I R} = {{\<zero>}, carrier R}"