doc-src/AxClass/generated/Group.tex
author wenzelm
Fri, 19 Aug 2005 22:28:23 +0200
changeset 17132 153fe83804c9
parent 12344 7237c6497cb1
permissions -rw-r--r--
updated;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9767
dc2ee9b2e065 updated;
wenzelm
parents: 9672
diff changeset
     1
%
dc2ee9b2e065 updated;
wenzelm
parents: 9672
diff changeset
     2
\begin{isabellebody}%
9921
7acefd99e748 updated;
wenzelm
parents: 9767
diff changeset
     3
\def\isabellecontext{Group}%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
     4
\isamarkuptrue%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
     5
%
10395
7ef380745743 updated;
wenzelm
parents: 10310
diff changeset
     6
\isamarkupheader{Basic group theory%
7ef380745743 updated;
wenzelm
parents: 10310
diff changeset
     7
}
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
     8
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
     9
\isadelimtheory
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
    10
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
    11
\endisadelimtheory
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
    12
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
    13
\isatagtheory
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
    14
\isamarkupfalse%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
    15
\isacommand{theory}\ Group\ \isakeyword{imports}\ Main\ \isakeyword{begin}%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
    16
\endisatagtheory
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
    17
{\isafoldtheory}%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
    18
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
    19
\isadelimtheory
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
    20
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
    21
\endisadelimtheory
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
    22
\isamarkuptrue%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
    23
%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
    24
\begin{isamarkuptext}%
10140
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
    25
\medskip\noindent The meta-level type system of Isabelle supports
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    26
  \emph{intersections} and \emph{inclusions} of type classes. These
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    27
  directly correspond to intersections and inclusions of type
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    28
  predicates in a purely set theoretic sense. This is sufficient as a
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    29
  means to describe simple hierarchies of structures.  As an
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    30
  illustration, we use the well-known example of semigroups, monoids,
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    31
  general groups and Abelian groups.%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
    32
\end{isamarkuptext}%
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
    33
\isamarkuptrue%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
    34
%
10395
7ef380745743 updated;
wenzelm
parents: 10310
diff changeset
    35
\isamarkupsubsection{Monoids and Groups%
7ef380745743 updated;
wenzelm
parents: 10310
diff changeset
    36
}
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
    37
\isamarkuptrue%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
    38
%
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
    39
\begin{isamarkuptext}%
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
    40
First we declare some polymorphic constants required later for the
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    41
  signature parts of our structures.%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
    42
\end{isamarkuptext}%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
    43
\isamarkupfalse%
8890
9a44d8d98731 snapshot of new Isar'ized version;
wenzelm
parents:
diff changeset
    44
\isacommand{consts}\isanewline
10207
c7c64cd26fc9 updated;
wenzelm
parents: 10140
diff changeset
    45
\ \ times\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a{\isachardoublequote}\ \ \ \ {\isacharparenleft}\isakeyword{infixl}\ {\isachardoublequote}{\isasymodot}{\isachardoublequote}\ {\isadigit{7}}{\isadigit{0}}{\isacharparenright}\isanewline
11071
wenzelm
parents: 10395
diff changeset
    46
\ \ invers\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a{\isachardoublequote}\ \ \ \ {\isacharparenleft}{\isachardoublequote}{\isacharparenleft}{\isacharunderscore}{\isasyminv}{\isacharparenright}{\isachardoublequote}\ {\isacharbrackleft}{\isadigit{1}}{\isadigit{0}}{\isadigit{0}}{\isadigit{0}}{\isacharbrackright}\ {\isadigit{9}}{\isadigit{9}}{\isadigit{9}}{\isacharparenright}\isanewline
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
    47
\ \ one\ {\isacharcolon}{\isacharcolon}\ {\isacharprime}a\ \ \ \ {\isacharparenleft}{\isachardoublequote}{\isasymone}{\isachardoublequote}{\isacharparenright}\isamarkuptrue%
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
    48
%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
    49
\begin{isamarkuptext}%
10140
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
    50
\noindent Next we define class \isa{monoid} of monoids with
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
    51
  operations \isa{{\isasymodot}} and \isa{{\isasymone}}.  Note that multiple class
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    52
  axioms are allowed for user convenience --- they simply represent
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    53
  the conjunction of their respective universal closures.%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
    54
\end{isamarkuptext}%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
    55
\isamarkupfalse%
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    56
\isacommand{axclass}\ monoid\ {\isasymsubseteq}\ type\isanewline
10140
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
    57
\ \ assoc{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}x\ {\isasymodot}\ y{\isacharparenright}\ {\isasymodot}\ z\ {\isacharequal}\ x\ {\isasymodot}\ {\isacharparenleft}y\ {\isasymodot}\ z{\isacharparenright}{\isachardoublequote}\isanewline
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
    58
\ \ left{\isacharunderscore}unit{\isacharcolon}\ {\isachardoublequote}{\isasymone}\ {\isasymodot}\ x\ {\isacharequal}\ x{\isachardoublequote}\isanewline
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
    59
\ \ right{\isacharunderscore}unit{\isacharcolon}\ {\isachardoublequote}x\ {\isasymodot}\ {\isasymone}\ {\isacharequal}\ x{\isachardoublequote}\isamarkuptrue%
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
    60
%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
    61
\begin{isamarkuptext}%
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    62
\noindent So class \isa{monoid} contains exactly those types
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
    63
  \isa{{\isasymtau}} where \isa{{\isasymodot}\ {\isasymColon}\ {\isasymtau}\ {\isasymRightarrow}\ {\isasymtau}\ {\isasymRightarrow}\ {\isasymtau}} and \isa{{\isasymone}\ {\isasymColon}\ {\isasymtau}}
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    64
  are specified appropriately, such that \isa{{\isasymodot}} is associative and
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
    65
  \isa{{\isasymone}} is a left and right unit element for the \isa{{\isasymodot}}
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    66
  operation.%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
    67
\end{isamarkuptext}%
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
    68
\isamarkuptrue%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
    69
%
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
    70
\begin{isamarkuptext}%
10140
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
    71
\medskip Independently of \isa{monoid}, we now define a linear
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    72
  hierarchy of semigroups, general groups and Abelian groups.  Note
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    73
  that the names of class axioms are automatically qualified with each
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    74
  class name, so we may re-use common names such as \isa{assoc}.%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
    75
\end{isamarkuptext}%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
    76
\isamarkupfalse%
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    77
\isacommand{axclass}\ semigroup\ {\isasymsubseteq}\ type\isanewline
10140
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
    78
\ \ assoc{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}x\ {\isasymodot}\ y{\isacharparenright}\ {\isasymodot}\ z\ {\isacharequal}\ x\ {\isasymodot}\ {\isacharparenleft}y\ {\isasymodot}\ z{\isacharparenright}{\isachardoublequote}\isanewline
8890
9a44d8d98731 snapshot of new Isar'ized version;
wenzelm
parents:
diff changeset
    79
\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
    80
\isamarkupfalse%
11099
b301d1f72552 \<subseteq>;
wenzelm
parents: 11071
diff changeset
    81
\isacommand{axclass}\ group\ {\isasymsubseteq}\ semigroup\isanewline
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
    82
\ \ left{\isacharunderscore}unit{\isacharcolon}\ {\isachardoublequote}{\isasymone}\ {\isasymodot}\ x\ {\isacharequal}\ x{\isachardoublequote}\isanewline
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
    83
\ \ left{\isacharunderscore}inverse{\isacharcolon}\ {\isachardoublequote}x{\isasyminv}\ {\isasymodot}\ x\ {\isacharequal}\ {\isasymone}{\isachardoublequote}\isanewline
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
    84
\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
    85
\isamarkupfalse%
11099
b301d1f72552 \<subseteq>;
wenzelm
parents: 11071
diff changeset
    86
\isacommand{axclass}\ agroup\ {\isasymsubseteq}\ group\isanewline
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
    87
\ \ commute{\isacharcolon}\ {\isachardoublequote}x\ {\isasymodot}\ y\ {\isacharequal}\ y\ {\isasymodot}\ x{\isachardoublequote}\isamarkuptrue%
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
    88
%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
    89
\begin{isamarkuptext}%
10140
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
    90
\noindent Class \isa{group} inherits associativity of \isa{{\isasymodot}}
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    91
  from \isa{semigroup} and adds two further group axioms. Similarly,
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    92
  \isa{agroup} is defined as the subset of \isa{group} such that
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
    93
  for all of its elements \isa{{\isasymtau}}, the operation \isa{{\isasymodot}\ {\isasymColon}\ {\isasymtau}\ {\isasymRightarrow}\ {\isasymtau}\ {\isasymRightarrow}\ {\isasymtau}} is even commutative.%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
    94
\end{isamarkuptext}%
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
    95
\isamarkuptrue%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
    96
%
10395
7ef380745743 updated;
wenzelm
parents: 10310
diff changeset
    97
\isamarkupsubsection{Abstract reasoning%
7ef380745743 updated;
wenzelm
parents: 10310
diff changeset
    98
}
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
    99
\isamarkuptrue%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   100
%
8890
9a44d8d98731 snapshot of new Isar'ized version;
wenzelm
parents:
diff changeset
   101
\begin{isamarkuptext}%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   102
In a sense, axiomatic type classes may be viewed as \emph{abstract
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   103
  theories}.  Above class definitions gives rise to abstract axioms
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   104
  \isa{assoc}, \isa{left{\isacharunderscore}unit}, \isa{left{\isacharunderscore}inverse}, \isa{commute}, where any of these contain a type variable \isa{{\isacharprime}a\ {\isasymColon}\ c} that is restricted to types of the corresponding class \isa{c}.  \emph{Sort constraints} like this express a logical
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   105
  precondition for the whole formula.  For example, \isa{assoc}
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   106
  states that for all \isa{{\isasymtau}}, provided that \isa{{\isasymtau}\ {\isasymColon}\ semigroup}, the operation \isa{{\isasymodot}\ {\isasymColon}\ {\isasymtau}\ {\isasymRightarrow}\ {\isasymtau}\ {\isasymRightarrow}\ {\isasymtau}} is associative.
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   107
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   108
  \medskip From a technical point of view, abstract axioms are just
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   109
  ordinary Isabelle theorems, which may be used in proofs without
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   110
  special treatment.  Such ``abstract proofs'' usually yield new
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   111
  ``abstract theorems''.  For example, we may now derive the following
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   112
  well-known laws of general groups.%
8890
9a44d8d98731 snapshot of new Isar'ized version;
wenzelm
parents:
diff changeset
   113
\end{isamarkuptext}%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   114
\isamarkupfalse%
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
   115
\isacommand{theorem}\ group{\isacharunderscore}right{\isacharunderscore}inverse{\isacharcolon}\ {\isachardoublequote}x\ {\isasymodot}\ x{\isasyminv}\ {\isacharequal}\ {\isacharparenleft}{\isasymone}{\isasymColon}{\isacharprime}a{\isasymColon}group{\isacharparenright}{\isachardoublequote}\isanewline
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   116
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   117
\isadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   118
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   119
\endisadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   120
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   121
\isatagproof
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   122
\isamarkupfalse%
9665
2a6d7f1409f9 updated;
wenzelm
parents: 9519
diff changeset
   123
\isacommand{proof}\ {\isacharminus}\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   124
\ \ \isamarkupfalse%
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
   125
\isacommand{have}\ {\isachardoublequote}x\ {\isasymodot}\ x{\isasyminv}\ {\isacharequal}\ {\isasymone}\ {\isasymodot}\ {\isacharparenleft}x\ {\isasymodot}\ x{\isasyminv}{\isacharparenright}{\isachardoublequote}\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   126
\ \ \ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   127
\isacommand{by}\ {\isacharparenleft}simp\ only{\isacharcolon}\ group{\isachardot}left{\isacharunderscore}unit{\isacharparenright}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   128
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   129
\isacommand{also}\ \isamarkupfalse%
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
   130
\isacommand{have}\ {\isachardoublequote}{\isachardot}{\isachardot}{\isachardot}\ {\isacharequal}\ {\isasymone}\ {\isasymodot}\ x\ {\isasymodot}\ x{\isasyminv}{\isachardoublequote}\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   131
\ \ \ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   132
\isacommand{by}\ {\isacharparenleft}simp\ only{\isacharcolon}\ semigroup{\isachardot}assoc{\isacharparenright}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   133
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   134
\isacommand{also}\ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   135
\isacommand{have}\ {\isachardoublequote}{\isachardot}{\isachardot}{\isachardot}\ {\isacharequal}\ {\isacharparenleft}x{\isasyminv}{\isacharparenright}{\isasyminv}\ {\isasymodot}\ x{\isasyminv}\ {\isasymodot}\ x\ {\isasymodot}\ x{\isasyminv}{\isachardoublequote}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   136
\ \ \ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   137
\isacommand{by}\ {\isacharparenleft}simp\ only{\isacharcolon}\ group{\isachardot}left{\isacharunderscore}inverse{\isacharparenright}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   138
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   139
\isacommand{also}\ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   140
\isacommand{have}\ {\isachardoublequote}{\isachardot}{\isachardot}{\isachardot}\ {\isacharequal}\ {\isacharparenleft}x{\isasyminv}{\isacharparenright}{\isasyminv}\ {\isasymodot}\ {\isacharparenleft}x{\isasyminv}\ {\isasymodot}\ x{\isacharparenright}\ {\isasymodot}\ x{\isasyminv}{\isachardoublequote}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   141
\ \ \ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   142
\isacommand{by}\ {\isacharparenleft}simp\ only{\isacharcolon}\ semigroup{\isachardot}assoc{\isacharparenright}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   143
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   144
\isacommand{also}\ \isamarkupfalse%
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
   145
\isacommand{have}\ {\isachardoublequote}{\isachardot}{\isachardot}{\isachardot}\ {\isacharequal}\ {\isacharparenleft}x{\isasyminv}{\isacharparenright}{\isasyminv}\ {\isasymodot}\ {\isasymone}\ {\isasymodot}\ x{\isasyminv}{\isachardoublequote}\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   146
\ \ \ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   147
\isacommand{by}\ {\isacharparenleft}simp\ only{\isacharcolon}\ group{\isachardot}left{\isacharunderscore}inverse{\isacharparenright}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   148
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   149
\isacommand{also}\ \isamarkupfalse%
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
   150
\isacommand{have}\ {\isachardoublequote}{\isachardot}{\isachardot}{\isachardot}\ {\isacharequal}\ {\isacharparenleft}x{\isasyminv}{\isacharparenright}{\isasyminv}\ {\isasymodot}\ {\isacharparenleft}{\isasymone}\ {\isasymodot}\ x{\isasyminv}{\isacharparenright}{\isachardoublequote}\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   151
\ \ \ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   152
\isacommand{by}\ {\isacharparenleft}simp\ only{\isacharcolon}\ semigroup{\isachardot}assoc{\isacharparenright}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   153
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   154
\isacommand{also}\ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   155
\isacommand{have}\ {\isachardoublequote}{\isachardot}{\isachardot}{\isachardot}\ {\isacharequal}\ {\isacharparenleft}x{\isasyminv}{\isacharparenright}{\isasyminv}\ {\isasymodot}\ x{\isasyminv}{\isachardoublequote}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   156
\ \ \ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   157
\isacommand{by}\ {\isacharparenleft}simp\ only{\isacharcolon}\ group{\isachardot}left{\isacharunderscore}unit{\isacharparenright}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   158
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   159
\isacommand{also}\ \isamarkupfalse%
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
   160
\isacommand{have}\ {\isachardoublequote}{\isachardot}{\isachardot}{\isachardot}\ {\isacharequal}\ {\isasymone}{\isachardoublequote}\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   161
\ \ \ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   162
\isacommand{by}\ {\isacharparenleft}simp\ only{\isacharcolon}\ group{\isachardot}left{\isacharunderscore}inverse{\isacharparenright}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   163
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   164
\isacommand{finally}\ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   165
\isacommand{show}\ {\isacharquery}thesis\ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   166
\isacommand{{\isachardot}}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   167
\isamarkupfalse%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   168
\isacommand{qed}%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   169
\endisatagproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   170
{\isafoldproof}%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   171
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   172
\isadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   173
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   174
\endisadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   175
\isamarkuptrue%
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   176
%
8890
9a44d8d98731 snapshot of new Isar'ized version;
wenzelm
parents:
diff changeset
   177
\begin{isamarkuptext}%
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   178
\noindent With \isa{group{\isacharunderscore}right{\isacharunderscore}inverse} already available, \isa{group{\isacharunderscore}right{\isacharunderscore}unit}\label{thm:group-right-unit} is now established
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   179
  much easier.%
8890
9a44d8d98731 snapshot of new Isar'ized version;
wenzelm
parents:
diff changeset
   180
\end{isamarkuptext}%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   181
\isamarkupfalse%
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
   182
\isacommand{theorem}\ group{\isacharunderscore}right{\isacharunderscore}unit{\isacharcolon}\ {\isachardoublequote}x\ {\isasymodot}\ {\isasymone}\ {\isacharequal}\ {\isacharparenleft}x{\isasymColon}{\isacharprime}a{\isasymColon}group{\isacharparenright}{\isachardoublequote}\isanewline
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   183
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   184
\isadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   185
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   186
\endisadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   187
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   188
\isatagproof
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   189
\isamarkupfalse%
9665
2a6d7f1409f9 updated;
wenzelm
parents: 9519
diff changeset
   190
\isacommand{proof}\ {\isacharminus}\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   191
\ \ \isamarkupfalse%
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
   192
\isacommand{have}\ {\isachardoublequote}x\ {\isasymodot}\ {\isasymone}\ {\isacharequal}\ x\ {\isasymodot}\ {\isacharparenleft}x{\isasyminv}\ {\isasymodot}\ x{\isacharparenright}{\isachardoublequote}\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   193
\ \ \ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   194
\isacommand{by}\ {\isacharparenleft}simp\ only{\isacharcolon}\ group{\isachardot}left{\isacharunderscore}inverse{\isacharparenright}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   195
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   196
\isacommand{also}\ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   197
\isacommand{have}\ {\isachardoublequote}{\isachardot}{\isachardot}{\isachardot}\ {\isacharequal}\ x\ {\isasymodot}\ x{\isasyminv}\ {\isasymodot}\ x{\isachardoublequote}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   198
\ \ \ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   199
\isacommand{by}\ {\isacharparenleft}simp\ only{\isacharcolon}\ semigroup{\isachardot}assoc{\isacharparenright}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   200
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   201
\isacommand{also}\ \isamarkupfalse%
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
   202
\isacommand{have}\ {\isachardoublequote}{\isachardot}{\isachardot}{\isachardot}\ {\isacharequal}\ {\isasymone}\ {\isasymodot}\ x{\isachardoublequote}\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   203
\ \ \ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   204
\isacommand{by}\ {\isacharparenleft}simp\ only{\isacharcolon}\ group{\isacharunderscore}right{\isacharunderscore}inverse{\isacharparenright}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   205
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   206
\isacommand{also}\ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   207
\isacommand{have}\ {\isachardoublequote}{\isachardot}{\isachardot}{\isachardot}\ {\isacharequal}\ x{\isachardoublequote}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   208
\ \ \ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   209
\isacommand{by}\ {\isacharparenleft}simp\ only{\isacharcolon}\ group{\isachardot}left{\isacharunderscore}unit{\isacharparenright}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   210
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   211
\isacommand{finally}\ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   212
\isacommand{show}\ {\isacharquery}thesis\ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   213
\isacommand{{\isachardot}}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   214
\isamarkupfalse%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   215
\isacommand{qed}%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   216
\endisatagproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   217
{\isafoldproof}%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   218
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   219
\isadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   220
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   221
\endisadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   222
\isamarkuptrue%
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   223
%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   224
\begin{isamarkuptext}%
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   225
\medskip Abstract theorems may be instantiated to only those types
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   226
  \isa{{\isasymtau}} where the appropriate class membership \isa{{\isasymtau}\ {\isasymColon}\ c} is
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   227
  known at Isabelle's type signature level.  Since we have \isa{agroup\ {\isasymsubseteq}\ group\ {\isasymsubseteq}\ semigroup} by definition, all theorems of \isa{semigroup} and \isa{group} are automatically inherited by \isa{group} and \isa{agroup}.%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   228
\end{isamarkuptext}%
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   229
\isamarkuptrue%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   230
%
10395
7ef380745743 updated;
wenzelm
parents: 10310
diff changeset
   231
\isamarkupsubsection{Abstract instantiation%
7ef380745743 updated;
wenzelm
parents: 10310
diff changeset
   232
}
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   233
\isamarkuptrue%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   234
%
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   235
\begin{isamarkuptext}%
10140
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
   236
From the definition, the \isa{monoid} and \isa{group} classes
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   237
  have been independent.  Note that for monoids, \isa{right{\isacharunderscore}unit}
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   238
  had to be included as an axiom, but for groups both \isa{right{\isacharunderscore}unit} and \isa{right{\isacharunderscore}inverse} are derivable from the other
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   239
  axioms.  With \isa{group{\isacharunderscore}right{\isacharunderscore}unit} derived as a theorem of group
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   240
  theory (see page~\pageref{thm:group-right-unit}), we may now
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   241
  instantiate \isa{monoid\ {\isasymsubseteq}\ semigroup} and \isa{group\ {\isasymsubseteq}\ monoid} properly as follows (cf.\ \figref{fig:monoid-group}).
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   242
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   243
 \begin{figure}[htbp]
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   244
   \begin{center}
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   245
     \small
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   246
     \unitlength 0.6mm
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   247
     \begin{picture}(65,90)(0,-10)
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   248
       \put(15,10){\line(0,1){10}} \put(15,30){\line(0,1){10}}
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   249
       \put(15,50){\line(1,1){10}} \put(35,60){\line(1,-1){10}}
10140
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
   250
       \put(15,5){\makebox(0,0){\isa{agroup}}}
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
   251
       \put(15,25){\makebox(0,0){\isa{group}}}
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
   252
       \put(15,45){\makebox(0,0){\isa{semigroup}}}
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   253
       \put(30,65){\makebox(0,0){\isa{type}}} \put(50,45){\makebox(0,0){\isa{monoid}}}
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   254
     \end{picture}
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   255
     \hspace{4em}
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   256
     \begin{picture}(30,90)(0,0)
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   257
       \put(15,10){\line(0,1){10}} \put(15,30){\line(0,1){10}}
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   258
       \put(15,50){\line(0,1){10}} \put(15,70){\line(0,1){10}}
10140
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
   259
       \put(15,5){\makebox(0,0){\isa{agroup}}}
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
   260
       \put(15,25){\makebox(0,0){\isa{group}}}
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
   261
       \put(15,45){\makebox(0,0){\isa{monoid}}}
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
   262
       \put(15,65){\makebox(0,0){\isa{semigroup}}}
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   263
       \put(15,85){\makebox(0,0){\isa{type}}}
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   264
     \end{picture}
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   265
     \caption{Monoids and groups: according to definition, and by proof}
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   266
     \label{fig:monoid-group}
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   267
   \end{center}
8907
wenzelm
parents: 8903
diff changeset
   268
 \end{figure}%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   269
\end{isamarkuptext}%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   270
\isamarkupfalse%
11099
b301d1f72552 \<subseteq>;
wenzelm
parents: 11071
diff changeset
   271
\isacommand{instance}\ monoid\ {\isasymsubseteq}\ semigroup\isanewline
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   272
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   273
\isadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   274
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   275
\endisadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   276
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   277
\isatagproof
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   278
\isamarkupfalse%
10310
d78de58fe368 updated;
wenzelm
parents: 10223
diff changeset
   279
\isacommand{proof}\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   280
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   281
\isacommand{fix}\ x\ y\ z\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharprime}a{\isasymColon}monoid{\isachardoublequote}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   282
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   283
\isacommand{show}\ {\isachardoublequote}x\ {\isasymodot}\ y\ {\isasymodot}\ z\ {\isacharequal}\ x\ {\isasymodot}\ {\isacharparenleft}y\ {\isasymodot}\ z{\isacharparenright}{\isachardoublequote}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   284
\ \ \ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   285
\isacommand{by}\ {\isacharparenleft}rule\ monoid{\isachardot}assoc{\isacharparenright}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   286
\isamarkupfalse%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   287
\isacommand{qed}%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   288
\endisatagproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   289
{\isafoldproof}%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   290
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   291
\isadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   292
\isanewline
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   293
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   294
\endisadelimproof
8890
9a44d8d98731 snapshot of new Isar'ized version;
wenzelm
parents:
diff changeset
   295
\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   296
\isamarkupfalse%
11099
b301d1f72552 \<subseteq>;
wenzelm
parents: 11071
diff changeset
   297
\isacommand{instance}\ group\ {\isasymsubseteq}\ monoid\isanewline
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   298
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   299
\isadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   300
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   301
\endisadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   302
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   303
\isatagproof
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   304
\isamarkupfalse%
10310
d78de58fe368 updated;
wenzelm
parents: 10223
diff changeset
   305
\isacommand{proof}\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   306
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   307
\isacommand{fix}\ x\ y\ z\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharprime}a{\isasymColon}group{\isachardoublequote}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   308
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   309
\isacommand{show}\ {\isachardoublequote}x\ {\isasymodot}\ y\ {\isasymodot}\ z\ {\isacharequal}\ x\ {\isasymodot}\ {\isacharparenleft}y\ {\isasymodot}\ z{\isacharparenright}{\isachardoublequote}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   310
\ \ \ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   311
\isacommand{by}\ {\isacharparenleft}rule\ semigroup{\isachardot}assoc{\isacharparenright}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   312
\ \ \isamarkupfalse%
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
   313
\isacommand{show}\ {\isachardoublequote}{\isasymone}\ {\isasymodot}\ x\ {\isacharequal}\ x{\isachardoublequote}\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   314
\ \ \ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   315
\isacommand{by}\ {\isacharparenleft}rule\ group{\isachardot}left{\isacharunderscore}unit{\isacharparenright}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   316
\ \ \isamarkupfalse%
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
   317
\isacommand{show}\ {\isachardoublequote}x\ {\isasymodot}\ {\isasymone}\ {\isacharequal}\ x{\isachardoublequote}\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   318
\ \ \ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   319
\isacommand{by}\ {\isacharparenleft}rule\ group{\isacharunderscore}right{\isacharunderscore}unit{\isacharparenright}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   320
\isamarkupfalse%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   321
\isacommand{qed}%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   322
\endisatagproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   323
{\isafoldproof}%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   324
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   325
\isadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   326
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   327
\endisadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   328
\isamarkuptrue%
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   329
%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   330
\begin{isamarkuptext}%
10223
wenzelm
parents: 10207
diff changeset
   331
\medskip The $\INSTANCE$ command sets up an appropriate goal that
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   332
  represents the class inclusion (or type arity, see
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   333
  \secref{sec:inst-arity}) to be proven (see also
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   334
  \cite{isabelle-isar-ref}).  The initial proof step causes
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   335
  back-chaining of class membership statements wrt.\ the hierarchy of
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   336
  any classes defined in the current theory; the effect is to reduce
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   337
  to the initial statement to a number of goals that directly
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   338
  correspond to any class axioms encountered on the path upwards
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   339
  through the class hierarchy.%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   340
\end{isamarkuptext}%
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   341
\isamarkuptrue%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   342
%
10395
7ef380745743 updated;
wenzelm
parents: 10310
diff changeset
   343
\isamarkupsubsection{Concrete instantiation \label{sec:inst-arity}%
7ef380745743 updated;
wenzelm
parents: 10310
diff changeset
   344
}
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   345
\isamarkuptrue%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   346
%
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   347
\begin{isamarkuptext}%
11099
b301d1f72552 \<subseteq>;
wenzelm
parents: 11071
diff changeset
   348
So far we have covered the case of the form $\INSTANCE$~\isa{c\isactrlsub {\isadigit{1}}\ {\isasymsubseteq}\ c\isactrlsub {\isadigit{2}}}, namely \emph{abstract instantiation} ---
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   349
  $c@1$ is more special than \isa{c\isactrlsub {\isadigit{1}}} and thus an instance
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   350
  of \isa{c\isactrlsub {\isadigit{2}}}.  Even more interesting for practical
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   351
  applications are \emph{concrete instantiations} of axiomatic type
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   352
  classes.  That is, certain simple schemes \isa{{\isacharparenleft}{\isasymalpha}\isactrlsub {\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isasymalpha}\isactrlsub n{\isacharparenright}\ t\ {\isasymColon}\ c} of class membership may be established at the
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   353
  logical level and then transferred to Isabelle's type signature
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   354
  level.
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   355
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   356
  \medskip As a typical example, we show that type \isa{bool} with
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   357
  exclusive-or as \isa{{\isasymodot}} operation, identity as \isa{{\isasyminv}}, and
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
   358
  \isa{False} as \isa{{\isasymone}} forms an Abelian group.%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   359
\end{isamarkuptext}%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   360
\isamarkupfalse%
9665
2a6d7f1409f9 updated;
wenzelm
parents: 9519
diff changeset
   361
\isacommand{defs}\ {\isacharparenleft}\isakeyword{overloaded}{\isacharparenright}\isanewline
10140
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
   362
\ \ times{\isacharunderscore}bool{\isacharunderscore}def{\isacharcolon}\ {\isachardoublequote}x\ {\isasymodot}\ y\ {\isasymequiv}\ x\ {\isasymnoteq}\ {\isacharparenleft}y{\isasymColon}bool{\isacharparenright}{\isachardoublequote}\isanewline
9672
2c208c98f541 updated;
wenzelm
parents: 9665
diff changeset
   363
\ \ inverse{\isacharunderscore}bool{\isacharunderscore}def{\isacharcolon}\ {\isachardoublequote}x{\isasyminv}\ {\isasymequiv}\ x{\isasymColon}bool{\isachardoublequote}\isanewline
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   364
\ \ unit{\isacharunderscore}bool{\isacharunderscore}def{\isacharcolon}\ {\isachardoublequote}{\isasymone}\ {\isasymequiv}\ False{\isachardoublequote}\isamarkuptrue%
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   365
%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   366
\begin{isamarkuptext}%
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   367
\medskip It is important to note that above $\DEFS$ are just
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   368
  overloaded meta-level constant definitions, where type classes are
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   369
  not yet involved at all.  This form of constant definition with
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   370
  overloading (and optional recursion over the syntactic structure of
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   371
  simple types) are admissible as definitional extensions of plain HOL
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   372
  \cite{Wenzel:1997:TPHOL}.  The Haskell-style type system is not
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   373
  required for overloading.  Nevertheless, overloaded definitions are
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   374
  best applied in the context of type classes.
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   375
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   376
  \medskip Since we have chosen above $\DEFS$ of the generic group
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   377
  operations on type \isa{bool} appropriately, the class membership
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   378
  \isa{bool\ {\isasymColon}\ agroup} may be now derived as follows.%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   379
\end{isamarkuptext}%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   380
\isamarkupfalse%
9672
2c208c98f541 updated;
wenzelm
parents: 9665
diff changeset
   381
\isacommand{instance}\ bool\ {\isacharcolon}{\isacharcolon}\ agroup\isanewline
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   382
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   383
\isadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   384
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   385
\endisadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   386
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   387
\isatagproof
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   388
\isamarkupfalse%
9672
2c208c98f541 updated;
wenzelm
parents: 9665
diff changeset
   389
\isacommand{proof}\ {\isacharparenleft}intro{\isacharunderscore}classes{\isacharcomma}\isanewline
9665
2a6d7f1409f9 updated;
wenzelm
parents: 9519
diff changeset
   390
\ \ \ \ unfold\ times{\isacharunderscore}bool{\isacharunderscore}def\ inverse{\isacharunderscore}bool{\isacharunderscore}def\ unit{\isacharunderscore}bool{\isacharunderscore}def{\isacharparenright}\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   391
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   392
\isacommand{fix}\ x\ y\ z\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   393
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   394
\isacommand{show}\ {\isachardoublequote}{\isacharparenleft}{\isacharparenleft}x\ {\isasymnoteq}\ y{\isacharparenright}\ {\isasymnoteq}\ z{\isacharparenright}\ {\isacharequal}\ {\isacharparenleft}x\ {\isasymnoteq}\ {\isacharparenleft}y\ {\isasymnoteq}\ z{\isacharparenright}{\isacharparenright}{\isachardoublequote}\ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   395
\isacommand{by}\ blast\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   396
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   397
\isacommand{show}\ {\isachardoublequote}{\isacharparenleft}False\ {\isasymnoteq}\ x{\isacharparenright}\ {\isacharequal}\ x{\isachardoublequote}\ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   398
\isacommand{by}\ blast\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   399
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   400
\isacommand{show}\ {\isachardoublequote}{\isacharparenleft}x\ {\isasymnoteq}\ x{\isacharparenright}\ {\isacharequal}\ False{\isachardoublequote}\ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   401
\isacommand{by}\ blast\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   402
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   403
\isacommand{show}\ {\isachardoublequote}{\isacharparenleft}x\ {\isasymnoteq}\ y{\isacharparenright}\ {\isacharequal}\ {\isacharparenleft}y\ {\isasymnoteq}\ x{\isacharparenright}{\isachardoublequote}\ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   404
\isacommand{by}\ blast\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   405
\isamarkupfalse%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   406
\isacommand{qed}%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   407
\endisatagproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   408
{\isafoldproof}%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   409
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   410
\isadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   411
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   412
\endisadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   413
\isamarkuptrue%
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   414
%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   415
\begin{isamarkuptext}%
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   416
The result of an $\INSTANCE$ statement is both expressed as a
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   417
  theorem of Isabelle's meta-logic, and as a type arity of the type
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   418
  signature.  The latter enables type-inference system to take care of
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   419
  this new instance automatically.
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   420
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   421
  \medskip We could now also instantiate our group theory classes to
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   422
  many other concrete types.  For example, \isa{int\ {\isasymColon}\ agroup}
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   423
  (e.g.\ by defining \isa{{\isasymodot}} as addition, \isa{{\isasyminv}} as negation
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
   424
  and \isa{{\isasymone}} as zero) or \isa{list\ {\isasymColon}\ {\isacharparenleft}type{\isacharparenright}\ semigroup}
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   425
  (e.g.\ if \isa{{\isasymodot}} is defined as list append).  Thus, the
12344
7237c6497cb1 use \<zero>, \<one>;
wenzelm
parents: 12338
diff changeset
   426
  characteristic constants \isa{{\isasymodot}}, \isa{{\isasyminv}}, \isa{{\isasymone}}
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   427
  really become overloaded, i.e.\ have different meanings on different
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   428
  types.%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   429
\end{isamarkuptext}%
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   430
\isamarkuptrue%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   431
%
10395
7ef380745743 updated;
wenzelm
parents: 10310
diff changeset
   432
\isamarkupsubsection{Lifting and Functors%
7ef380745743 updated;
wenzelm
parents: 10310
diff changeset
   433
}
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   434
\isamarkuptrue%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   435
%
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   436
\begin{isamarkuptext}%
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   437
As already mentioned above, overloading in the simply-typed HOL
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   438
  systems may include recursion over the syntactic structure of types.
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   439
  That is, definitional equations \isa{c\isactrlsup {\isasymtau}\ {\isasymequiv}\ t} may also
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   440
  contain constants of name \isa{c} on the right-hand side --- if
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   441
  these have types that are structurally simpler than \isa{{\isasymtau}}.
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   442
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   443
  This feature enables us to \emph{lift operations}, say to Cartesian
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   444
  products, direct sums or function spaces.  Subsequently we lift
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   445
  \isa{{\isasymodot}} component-wise to binary products \isa{{\isacharprime}a\ {\isasymtimes}\ {\isacharprime}b}.%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   446
\end{isamarkuptext}%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   447
\isamarkupfalse%
9665
2a6d7f1409f9 updated;
wenzelm
parents: 9519
diff changeset
   448
\isacommand{defs}\ {\isacharparenleft}\isakeyword{overloaded}{\isacharparenright}\isanewline
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   449
\ \ times{\isacharunderscore}prod{\isacharunderscore}def{\isacharcolon}\ {\isachardoublequote}p\ {\isasymodot}\ q\ {\isasymequiv}\ {\isacharparenleft}fst\ p\ {\isasymodot}\ fst\ q{\isacharcomma}\ snd\ p\ {\isasymodot}\ snd\ q{\isacharparenright}{\isachardoublequote}\isamarkuptrue%
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   450
%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   451
\begin{isamarkuptext}%
10140
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
   452
It is very easy to see that associativity of \isa{{\isasymodot}} on \isa{{\isacharprime}a}
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   453
  and \isa{{\isasymodot}} on \isa{{\isacharprime}b} transfers to \isa{{\isasymodot}} on \isa{{\isacharprime}a\ {\isasymtimes}\ {\isacharprime}b}.  Hence the binary type constructor \isa{{\isasymodot}} maps semigroups
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   454
  to semigroups.  This may be established formally as follows.%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   455
\end{isamarkuptext}%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   456
\isamarkupfalse%
9672
2c208c98f541 updated;
wenzelm
parents: 9665
diff changeset
   457
\isacommand{instance}\ {\isacharasterisk}\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}semigroup{\isacharcomma}\ semigroup{\isacharparenright}\ semigroup\isanewline
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   458
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   459
\isadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   460
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   461
\endisadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   462
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   463
\isatagproof
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   464
\isamarkupfalse%
9672
2c208c98f541 updated;
wenzelm
parents: 9665
diff changeset
   465
\isacommand{proof}\ {\isacharparenleft}intro{\isacharunderscore}classes{\isacharcomma}\ unfold\ times{\isacharunderscore}prod{\isacharunderscore}def{\isacharparenright}\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   466
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   467
\isacommand{fix}\ p\ q\ r\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharprime}a{\isasymColon}semigroup\ {\isasymtimes}\ {\isacharprime}b{\isasymColon}semigroup{\isachardoublequote}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   468
\ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   469
\isacommand{show}\isanewline
10140
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
   470
\ \ \ \ {\isachardoublequote}{\isacharparenleft}fst\ {\isacharparenleft}fst\ p\ {\isasymodot}\ fst\ q{\isacharcomma}\ snd\ p\ {\isasymodot}\ snd\ q{\isacharparenright}\ {\isasymodot}\ fst\ r{\isacharcomma}\isanewline
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
   471
\ \ \ \ \ \ snd\ {\isacharparenleft}fst\ p\ {\isasymodot}\ fst\ q{\isacharcomma}\ snd\ p\ {\isasymodot}\ snd\ q{\isacharparenright}\ {\isasymodot}\ snd\ r{\isacharparenright}\ {\isacharequal}\isanewline
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
   472
\ \ \ \ \ \ \ {\isacharparenleft}fst\ p\ {\isasymodot}\ fst\ {\isacharparenleft}fst\ q\ {\isasymodot}\ fst\ r{\isacharcomma}\ snd\ q\ {\isasymodot}\ snd\ r{\isacharparenright}{\isacharcomma}\isanewline
ba9297b71897 major cleanup -- improved typesetting;
wenzelm
parents: 9921
diff changeset
   473
\ \ \ \ \ \ \ \ snd\ p\ {\isasymodot}\ snd\ {\isacharparenleft}fst\ q\ {\isasymodot}\ fst\ r{\isacharcomma}\ snd\ q\ {\isasymodot}\ snd\ r{\isacharparenright}{\isacharparenright}{\isachardoublequote}\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   474
\ \ \ \ \isamarkupfalse%
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   475
\isacommand{by}\ {\isacharparenleft}simp\ add{\isacharcolon}\ semigroup{\isachardot}assoc{\isacharparenright}\isanewline
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   476
\isamarkupfalse%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   477
\isacommand{qed}%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   478
\endisatagproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   479
{\isafoldproof}%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   480
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   481
\isadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   482
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   483
\endisadelimproof
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   484
\isamarkuptrue%
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   485
%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   486
\begin{isamarkuptext}%
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   487
Thus, if we view class instances as ``structures'', then overloaded
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   488
  constant definitions with recursion over types indirectly provide
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   489
  some kind of ``functors'' --- i.e.\ mappings between abstract
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   490
  theories.%
8903
78d6e47469e4 new Isar version;
wenzelm
parents: 8890
diff changeset
   491
\end{isamarkuptext}%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   492
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   493
\isadelimtheory
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   494
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   495
\endisadelimtheory
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   496
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   497
\isatagtheory
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11964
diff changeset
   498
\isamarkupfalse%
17132
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   499
\isacommand{end}%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   500
\endisatagtheory
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   501
{\isafoldtheory}%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   502
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   503
\isadelimtheory
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   504
%
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   505
\endisadelimtheory
153fe83804c9 updated;
wenzelm
parents: 12344
diff changeset
   506
\isanewline
11964
828ea309dc21 updated;
wenzelm
parents: 11099
diff changeset
   507
\end{isabellebody}%
9145
9f7b8de5bfaf updated;
wenzelm
parents: 8922
diff changeset
   508
%%% Local Variables:
9f7b8de5bfaf updated;
wenzelm
parents: 8922
diff changeset
   509
%%% mode: latex
9f7b8de5bfaf updated;
wenzelm
parents: 8922
diff changeset
   510
%%% TeX-master: "root"
9f7b8de5bfaf updated;
wenzelm
parents: 8922
diff changeset
   511
%%% End: