8890
|
1 |
theory Semigroups = Main:;
|
|
2 |
|
|
3 |
text {*
|
|
4 |
\noindent Associativity of binary operations:
|
|
5 |
*};
|
|
6 |
constdefs
|
|
7 |
is_assoc :: "('a \\<Rightarrow> 'a \\<Rightarrow> 'a) \\<Rightarrow> bool"
|
|
8 |
"is_assoc f == \\<forall>x y z. f (f x y) z = f x (f y z)";
|
|
9 |
|
|
10 |
text {*
|
|
11 |
\medskip\noindent Semigroups over \isa{(op~{\isasymOplus})}:
|
|
12 |
%term (latex xsymbols symbols) "op \<Oplus>";
|
|
13 |
*};
|
|
14 |
|
|
15 |
consts
|
|
16 |
plus :: "'a \\<Rightarrow> 'a \\<Rightarrow> 'a" (infixl "\<Oplus>" 65);
|
|
17 |
axclass
|
|
18 |
plus_semigroup < "term"
|
|
19 |
assoc: "is_assoc (op \<Oplus>)";
|
|
20 |
|
|
21 |
text {*
|
|
22 |
\medskip\noindent Semigroups over \isa{(op~{\isasymOtimes})}:
|
|
23 |
%term (latex xsymbols symbols) "op \<Otimes>";
|
|
24 |
*};
|
|
25 |
|
|
26 |
consts
|
|
27 |
times :: "'a \\<Rightarrow> 'a \\<Rightarrow> 'a" (infixl "\<Otimes>" 65);
|
|
28 |
axclass
|
|
29 |
times_semigroup < "term"
|
|
30 |
assoc: "is_assoc (op \<Otimes>)";
|
|
31 |
|
|
32 |
end; |