24 assumes l_cancel: |
24 assumes l_cancel: |
25 "\<And>a b c. \<lbrakk>c \<otimes> a = c \<otimes> b; a \<in> carrier G; b \<in> carrier G; c \<in> carrier G\<rbrakk> \<Longrightarrow> a = b" |
25 "\<And>a b c. \<lbrakk>c \<otimes> a = c \<otimes> b; a \<in> carrier G; b \<in> carrier G; c \<in> carrier G\<rbrakk> \<Longrightarrow> a = b" |
26 and r_cancel: |
26 and r_cancel: |
27 "\<And>a b c. \<lbrakk>a \<otimes> c = b \<otimes> c; a \<in> carrier G; b \<in> carrier G; c \<in> carrier G\<rbrakk> \<Longrightarrow> a = b" |
27 "\<And>a b c. \<lbrakk>a \<otimes> c = b \<otimes> c; a \<in> carrier G; b \<in> carrier G; c \<in> carrier G\<rbrakk> \<Longrightarrow> a = b" |
28 shows "monoid_cancel G" |
28 shows "monoid_cancel G" |
29 by unfold_locales fact+ |
29 proof qed fact+ |
30 |
30 |
31 lemma (in monoid_cancel) is_monoid_cancel: |
31 lemma (in monoid_cancel) is_monoid_cancel: |
32 "monoid_cancel G" |
32 "monoid_cancel G" |
33 by intro_locales |
33 .. |
34 |
34 |
35 interpretation group \<subseteq> monoid_cancel |
35 interpretation group \<subseteq> monoid_cancel |
36 by unfold_locales simp+ |
36 proof qed simp+ |
37 |
37 |
38 |
38 |
39 locale comm_monoid_cancel = monoid_cancel + comm_monoid |
39 locale comm_monoid_cancel = monoid_cancel + comm_monoid |
40 |
40 |
41 lemma comm_monoid_cancelI: |
41 lemma comm_monoid_cancelI: |
55 done |
55 done |
56 qed |
56 qed |
57 |
57 |
58 lemma (in comm_monoid_cancel) is_comm_monoid_cancel: |
58 lemma (in comm_monoid_cancel) is_comm_monoid_cancel: |
59 "comm_monoid_cancel G" |
59 "comm_monoid_cancel G" |
60 by intro_locales |
60 by intro_locales |
61 |
61 |
62 interpretation comm_group \<subseteq> comm_monoid_cancel |
62 interpretation comm_group \<subseteq> comm_monoid_cancel |
63 by unfold_locales |
63 .. |
64 |
64 |
65 |
65 |
66 subsection {* Products of Units in Monoids *} |
66 subsection {* Products of Units in Monoids *} |
67 |
67 |
68 lemma (in monoid) Units_m_closed[simp, intro]: |
68 lemma (in monoid) Units_m_closed[simp, intro]: |
1837 "\<And>a. a \<in> carrier G \<Longrightarrow> \<exists>fs. set fs \<subseteq> carrier G \<and> wfactors G fs a" |
1837 "\<And>a. a \<in> carrier G \<Longrightarrow> \<exists>fs. set fs \<subseteq> carrier G \<and> wfactors G fs a" |
1838 and wfactors_unique: |
1838 and wfactors_unique: |
1839 "\<And>a fs fs'. \<lbrakk>a \<in> carrier G; set fs \<subseteq> carrier G; set fs' \<subseteq> carrier G; |
1839 "\<And>a fs fs'. \<lbrakk>a \<in> carrier G; set fs \<subseteq> carrier G; set fs' \<subseteq> carrier G; |
1840 wfactors G fs a; wfactors G fs' a\<rbrakk> \<Longrightarrow> essentially_equal G fs fs'" |
1840 wfactors G fs a; wfactors G fs' a\<rbrakk> \<Longrightarrow> essentially_equal G fs fs'" |
1841 shows "factorial_monoid G" |
1841 shows "factorial_monoid G" |
1842 proof (unfold_locales) |
1842 proof |
1843 fix a |
1843 fix a |
1844 assume acarr: "a \<in> carrier G" and anunit: "a \<notin> Units G" |
1844 assume acarr: "a \<in> carrier G" and anunit: "a \<notin> Units G" |
1845 |
1845 |
1846 from wfactors_exists[OF acarr] |
1846 from wfactors_exists[OF acarr] |
1847 obtain as |
1847 obtain as |
3853 apply (rule properfactor_fcount, simp+) |
3853 apply (rule properfactor_fcount, simp+) |
3854 done |
3854 done |
3855 qed |
3855 qed |
3856 |
3856 |
3857 interpretation factorial_monoid \<subseteq> primeness_condition_monoid |
3857 interpretation factorial_monoid \<subseteq> primeness_condition_monoid |
3858 by (unfold_locales, rule irreducible_is_prime) |
3858 proof qed (rule irreducible_is_prime) |
3859 |
3859 |
3860 |
3860 |
3861 lemma (in factorial_monoid) primeness_condition: |
3861 lemma (in factorial_monoid) primeness_condition: |
3862 shows "primeness_condition_monoid G" |
3862 shows "primeness_condition_monoid G" |
3863 by unfold_locales |
3863 .. |
3864 |
3864 |
3865 lemma (in factorial_monoid) gcd_condition [simp]: |
3865 lemma (in factorial_monoid) gcd_condition [simp]: |
3866 shows "gcd_condition_monoid G" |
3866 shows "gcd_condition_monoid G" |
3867 by (unfold_locales, rule gcdof_exists) |
3867 proof qed (rule gcdof_exists) |
3868 |
3868 |
3869 interpretation factorial_monoid \<subseteq> gcd_condition_monoid |
3869 interpretation factorial_monoid \<subseteq> gcd_condition_monoid |
3870 by (unfold_locales, rule gcdof_exists) |
3870 proof qed (rule gcdof_exists) |
3871 |
3871 |
3872 lemma (in factorial_monoid) division_weak_lattice [simp]: |
3872 lemma (in factorial_monoid) division_weak_lattice [simp]: |
3873 shows "weak_lattice (division_rel G)" |
3873 shows "weak_lattice (division_rel G)" |
3874 proof - |
3874 proof - |
3875 interpret weak_lower_semilattice ["division_rel G"] by simp |
3875 interpret weak_lower_semilattice ["division_rel G"] by simp |