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