src/Doc/Isar_Ref/Proof.thy
changeset 58618 782f0b662cae
parent 58552 66fed99e874f
child 58619 4b41df5fef81
equal deleted inserted replaced
58617:4f169d2cf6f3 58618:782f0b662cae
     1 theory Proof
     1 theory Proof
     2 imports Base Main
     2 imports Base Main
     3 begin
     3 begin
     4 
     4 
     5 chapter {* Proofs \label{ch:proofs} *}
     5 chapter \<open>Proofs \label{ch:proofs}\<close>
     6 
     6 
     7 text {*
     7 text \<open>
     8   Proof commands perform transitions of Isar/VM machine
     8   Proof commands perform transitions of Isar/VM machine
     9   configurations, which are block-structured, consisting of a stack of
     9   configurations, which are block-structured, consisting of a stack of
    10   nodes with three main components: logical proof context, current
    10   nodes with three main components: logical proof context, current
    11   facts, and open goals.  Isar/VM transitions are typed according to
    11   facts, and open goals.  Isar/VM transitions are typed according to
    12   the following three different modes of operation:
    12   the following three different modes of operation:
    39 
    39 
    40   \Appref{ap:refcard} gives a simplified grammar of the (extensible)
    40   \Appref{ap:refcard} gives a simplified grammar of the (extensible)
    41   language emerging that way from the different types of proof
    41   language emerging that way from the different types of proof
    42   commands.  The main ideas of the overall Isar framework are
    42   commands.  The main ideas of the overall Isar framework are
    43   explained in \chref{ch:isar-framework}.
    43   explained in \chref{ch:isar-framework}.
    44 *}
    44 \<close>
    45 
    45 
    46 
    46 
    47 section {* Proof structure *}
    47 section \<open>Proof structure\<close>
    48 
    48 
    49 subsection {* Formal notepad *}
    49 subsection \<open>Formal notepad\<close>
    50 
    50 
    51 text {*
    51 text \<open>
    52   \begin{matharray}{rcl}
    52   \begin{matharray}{rcl}
    53     @{command_def "notepad"} & : & @{text "local_theory \<rightarrow> proof(state)"} \\
    53     @{command_def "notepad"} & : & @{text "local_theory \<rightarrow> proof(state)"} \\
    54   \end{matharray}
    54   \end{matharray}
    55 
    55 
    56   @{rail \<open>
    56   @{rail \<open>
    67 
    67 
    68   The notepad can be closed by @{command "end"} or discontinued by
    68   The notepad can be closed by @{command "end"} or discontinued by
    69   @{command "oops"}.
    69   @{command "oops"}.
    70 
    70 
    71   \end{description}
    71   \end{description}
    72 *}
    72 \<close>
    73 
    73 
    74 
    74 
    75 subsection {* Blocks *}
    75 subsection \<open>Blocks\<close>
    76 
    76 
    77 text {*
    77 text \<open>
    78   \begin{matharray}{rcl}
    78   \begin{matharray}{rcl}
    79     @{command_def "next"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
    79     @{command_def "next"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
    80     @{command_def "{"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
    80     @{command_def "{"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
    81     @{command_def "}"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
    81     @{command_def "}"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
    82   \end{matharray}
    82   \end{matharray}
   109   of @{command "assume"} and @{command "presume"} in this mode of
   109   of @{command "assume"} and @{command "presume"} in this mode of
   110   forward reasoning --- in contrast to plain backward reasoning with
   110   forward reasoning --- in contrast to plain backward reasoning with
   111   the result exported at @{command "show"} time.
   111   the result exported at @{command "show"} time.
   112 
   112 
   113   \end{description}
   113   \end{description}
   114 *}
   114 \<close>
   115 
   115 
   116 
   116 
   117 subsection {* Omitting proofs *}
   117 subsection \<open>Omitting proofs\<close>
   118 
   118 
   119 text {*
   119 text \<open>
   120   \begin{matharray}{rcl}
   120   \begin{matharray}{rcl}
   121     @{command_def "oops"} & : & @{text "proof \<rightarrow> local_theory | theory"} \\
   121     @{command_def "oops"} & : & @{text "proof \<rightarrow> local_theory | theory"} \\
   122   \end{matharray}
   122   \end{matharray}
   123 
   123 
   124   The @{command "oops"} command discontinues the current proof
   124   The @{command "oops"} command discontinues the current proof
   136   preparation tools of Isabelle described in \chref{ch:document-prep}.
   136   preparation tools of Isabelle described in \chref{ch:document-prep}.
   137   Thus partial or even wrong proof attempts can be discussed in a
   137   Thus partial or even wrong proof attempts can be discussed in a
   138   logically sound manner.  Note that the Isabelle {\LaTeX} macros can
   138   logically sound manner.  Note that the Isabelle {\LaTeX} macros can
   139   be easily adapted to print something like ``@{text "\<dots>"}'' instead of
   139   be easily adapted to print something like ``@{text "\<dots>"}'' instead of
   140   the keyword ``@{command "oops"}''.
   140   the keyword ``@{command "oops"}''.
   141 *}
   141 \<close>
   142 
   142 
   143 
   143 
   144 section {* Statements *}
   144 section \<open>Statements\<close>
   145 
   145 
   146 subsection {* Context elements \label{sec:proof-context} *}
   146 subsection \<open>Context elements \label{sec:proof-context}\<close>
   147 
   147 
   148 text {*
   148 text \<open>
   149   \begin{matharray}{rcl}
   149   \begin{matharray}{rcl}
   150     @{command_def "fix"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
   150     @{command_def "fix"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
   151     @{command_def "assume"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
   151     @{command_def "assume"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
   152     @{command_def "presume"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
   152     @{command_def "presume"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
   153     @{command_def "def"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
   153     @{command_def "def"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
   223   \end{description}
   223   \end{description}
   224 
   224 
   225   The special name @{fact_ref prems} refers to all assumptions of the
   225   The special name @{fact_ref prems} refers to all assumptions of the
   226   current context as a list of theorems.  This feature should be used
   226   current context as a list of theorems.  This feature should be used
   227   with great care!  It is better avoided in final proof texts.
   227   with great care!  It is better avoided in final proof texts.
   228 *}
   228 \<close>
   229 
   229 
   230 
   230 
   231 subsection {* Term abbreviations \label{sec:term-abbrev} *}
   231 subsection \<open>Term abbreviations \label{sec:term-abbrev}\<close>
   232 
   232 
   233 text {*
   233 text \<open>
   234   \begin{matharray}{rcl}
   234   \begin{matharray}{rcl}
   235     @{command_def "let"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
   235     @{command_def "let"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
   236     @{keyword_def "is"} & : & syntax \\
   236     @{keyword_def "is"} & : & syntax \\
   237   \end{matharray}
   237   \end{matharray}
   238 
   238 
   290   assumptions or finished goals.  In case @{variable this} refers to
   290   assumptions or finished goals.  In case @{variable this} refers to
   291   an object-logic statement that is an application @{text "f t"}, then
   291   an object-logic statement that is an application @{text "f t"}, then
   292   @{text t} is bound to the special text variable ``@{variable "\<dots>"}''
   292   @{text t} is bound to the special text variable ``@{variable "\<dots>"}''
   293   (three dots).  The canonical application of this convenience are
   293   (three dots).  The canonical application of this convenience are
   294   calculational proofs (see \secref{sec:calculation}).
   294   calculational proofs (see \secref{sec:calculation}).
   295 *}
   295 \<close>
   296 
   296 
   297 
   297 
   298 subsection {* Facts and forward chaining \label{sec:proof-facts} *}
   298 subsection \<open>Facts and forward chaining \label{sec:proof-facts}\<close>
   299 
   299 
   300 text {*
   300 text \<open>
   301   \begin{matharray}{rcl}
   301   \begin{matharray}{rcl}
   302     @{command_def "note"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
   302     @{command_def "note"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
   303     @{command_def "then"} & : & @{text "proof(state) \<rightarrow> proof(chain)"} \\
   303     @{command_def "then"} & : & @{text "proof(state) \<rightarrow> proof(chain)"} \\
   304     @{command_def "from"} & : & @{text "proof(state) \<rightarrow> proof(chain)"} \\
   304     @{command_def "from"} & : & @{text "proof(state) \<rightarrow> proof(chain)"} \\
   305     @{command_def "with"} & : & @{text "proof(state) \<rightarrow> proof(chain)"} \\
   305     @{command_def "with"} & : & @{text "proof(state) \<rightarrow> proof(chain)"} \\
   375 
   375 
   376   Automated methods (such as @{method simp} or @{method auto}) just
   376   Automated methods (such as @{method simp} or @{method auto}) just
   377   insert any given facts before their usual operation.  Depending on
   377   insert any given facts before their usual operation.  Depending on
   378   the kind of procedure involved, the order of facts is less
   378   the kind of procedure involved, the order of facts is less
   379   significant here.
   379   significant here.
   380 *}
   380 \<close>
   381 
   381 
   382 
   382 
   383 subsection {* Goals \label{sec:goals} *}
   383 subsection \<open>Goals \label{sec:goals}\<close>
   384 
   384 
   385 text {*
   385 text \<open>
   386   \begin{matharray}{rcl}
   386   \begin{matharray}{rcl}
   387     @{command_def "lemma"} & : & @{text "local_theory \<rightarrow> proof(prove)"} \\
   387     @{command_def "lemma"} & : & @{text "local_theory \<rightarrow> proof(prove)"} \\
   388     @{command_def "theorem"} & : & @{text "local_theory \<rightarrow> proof(prove)"} \\
   388     @{command_def "theorem"} & : & @{text "local_theory \<rightarrow> proof(prove)"} \\
   389     @{command_def "corollary"} & : & @{text "local_theory \<rightarrow> proof(prove)"} \\
   389     @{command_def "corollary"} & : & @{text "local_theory \<rightarrow> proof(prove)"} \\
   390     @{command_def "schematic_lemma"} & : & @{text "local_theory \<rightarrow> proof(prove)"} \\
   390     @{command_def "schematic_lemma"} & : & @{text "local_theory \<rightarrow> proof(prove)"} \\
   522   The optional case names of @{element_ref "obtains"} have a twofold
   522   The optional case names of @{element_ref "obtains"} have a twofold
   523   meaning: (1) in the proof of this claim they refer to the local context
   523   meaning: (1) in the proof of this claim they refer to the local context
   524   introductions, (2) in the resulting rule they become annotations for
   524   introductions, (2) in the resulting rule they become annotations for
   525   symbolic case splits, e.g.\ for the @{method_ref cases} method
   525   symbolic case splits, e.g.\ for the @{method_ref cases} method
   526   (\secref{sec:cases-induct}).
   526   (\secref{sec:cases-induct}).
   527 *}
   527 \<close>
   528 
   528 
   529 
   529 
   530 section {* Refinement steps *}
   530 section \<open>Refinement steps\<close>
   531 
   531 
   532 subsection {* Proof method expressions \label{sec:proof-meth} *}
   532 subsection \<open>Proof method expressions \label{sec:proof-meth}\<close>
   533 
   533 
   534 text {* Proof methods are either basic ones, or expressions composed
   534 text \<open>Proof methods are either basic ones, or expressions composed
   535   of methods via ``@{verbatim ","}'' (sequential composition),
   535   of methods via ``@{verbatim ","}'' (sequential composition),
   536   ``@{verbatim "|"}'' (alternative choices), ``@{verbatim "?"}''
   536   ``@{verbatim "|"}'' (alternative choices), ``@{verbatim "?"}''
   537   (try), ``@{verbatim "+"}'' (repeat at least once), ``@{verbatim
   537   (try), ``@{verbatim "+"}'' (repeat at least once), ``@{verbatim
   538   "["}@{text n}@{verbatim "]"}'' (restriction to first @{text n}
   538   "["}@{text n}@{verbatim "]"}'' (restriction to first @{text n}
   539   sub-goals, with default @{text "n = 1"}).  In practice, proof
   539   sub-goals, with default @{text "n = 1"}).  In practice, proof
   566 
   566 
   567   @{rail \<open>
   567   @{rail \<open>
   568     @{syntax_def goal_spec}:
   568     @{syntax_def goal_spec}:
   569       '[' (@{syntax nat} '-' @{syntax nat} | @{syntax nat} '-' | @{syntax nat} | '!' ) ']'
   569       '[' (@{syntax nat} '-' @{syntax nat} | @{syntax nat} '-' | @{syntax nat} | '!' ) ']'
   570   \<close>}
   570   \<close>}
   571 *}
   571 \<close>
   572 
   572 
   573 
   573 
   574 subsection {* Initial and terminal proof steps \label{sec:proof-steps} *}
   574 subsection \<open>Initial and terminal proof steps \label{sec:proof-steps}\<close>
   575 
   575 
   576 text {*
   576 text \<open>
   577   \begin{matharray}{rcl}
   577   \begin{matharray}{rcl}
   578     @{command_def "proof"} & : & @{text "proof(prove) \<rightarrow> proof(state)"} \\
   578     @{command_def "proof"} & : & @{text "proof(prove) \<rightarrow> proof(state)"} \\
   579     @{command_def "qed"} & : & @{text "proof(state) \<rightarrow> proof(state) | local_theory | theory"} \\
   579     @{command_def "qed"} & : & @{text "proof(state) \<rightarrow> proof(state) | local_theory | theory"} \\
   580     @{command_def "by"} & : & @{text "proof(prove) \<rightarrow> proof(state) | local_theory | theory"} \\
   580     @{command_def "by"} & : & @{text "proof(prove) \<rightarrow> proof(state) | local_theory | theory"} \\
   581     @{command_def ".."} & : & @{text "proof(prove) \<rightarrow> proof(state) | local_theory | theory"} \\
   581     @{command_def ".."} & : & @{text "proof(prove) \<rightarrow> proof(state) | local_theory | theory"} \\
   677   
   677   
   678   The most important application of @{command "sorry"} is to support
   678   The most important application of @{command "sorry"} is to support
   679   experimentation and top-down proof development.
   679   experimentation and top-down proof development.
   680 
   680 
   681   \end{description}
   681   \end{description}
   682 *}
   682 \<close>
   683 
   683 
   684 
   684 
   685 subsection {* Fundamental methods and attributes \label{sec:pure-meth-att} *}
   685 subsection \<open>Fundamental methods and attributes \label{sec:pure-meth-att}\<close>
   686 
   686 
   687 text {*
   687 text \<open>
   688   The following proof methods and attributes refer to basic logical
   688   The following proof methods and attributes refer to basic logical
   689   operations of Isar.  Further methods and attributes are provided by
   689   operations of Isar.  Further methods and attributes are provided by
   690   several generic and object-logic specific tools and packages (see
   690   several generic and object-logic specific tools and packages (see
   691   \chref{ch:gen-tools} and \partref{part:hol}).
   691   \chref{ch:gen-tools} and \partref{part:hol}).
   692 
   692 
   829 
   829 
   830   An optional context of local variables @{text "\<FOR> x\<^sub>1 \<dots> x\<^sub>m"} may
   830   An optional context of local variables @{text "\<FOR> x\<^sub>1 \<dots> x\<^sub>m"} may
   831   be specified as for @{attribute "of"} above.
   831   be specified as for @{attribute "of"} above.
   832 
   832 
   833   \end{description}
   833   \end{description}
   834 *}
   834 \<close>
   835 
   835 
   836 
   836 
   837 subsection {* Emulating tactic scripts \label{sec:tactic-commands} *}
   837 subsection \<open>Emulating tactic scripts \label{sec:tactic-commands}\<close>
   838 
   838 
   839 text {*
   839 text \<open>
   840   The Isar provides separate commands to accommodate tactic-style
   840   The Isar provides separate commands to accommodate tactic-style
   841   proof scripts within the same system.  While being outside the
   841   proof scripts within the same system.  While being outside the
   842   orthodox Isar proof language, these might come in handy for
   842   orthodox Isar proof language, these might come in handy for
   843   interactive exploration and debugging, or even actual tactical proof
   843   interactive exploration and debugging, or even actual tactical proof
   844   within new-style theories (to benefit from document preparation, for
   844   within new-style theories (to benefit from document preparation, for
   906 
   906 
   907   Any proper Isar proof method may be used with tactic script commands
   907   Any proper Isar proof method may be used with tactic script commands
   908   such as @{command "apply"}.  A few additional emulations of actual
   908   such as @{command "apply"}.  A few additional emulations of actual
   909   tactics are provided as well; these would be never used in actual
   909   tactics are provided as well; these would be never used in actual
   910   structured proofs, of course.
   910   structured proofs, of course.
   911 *}
   911 \<close>
   912 
   912 
   913 
   913 
   914 subsection {* Defining proof methods *}
   914 subsection \<open>Defining proof methods\<close>
   915 
   915 
   916 text {*
   916 text \<open>
   917   \begin{matharray}{rcl}
   917   \begin{matharray}{rcl}
   918     @{command_def "method_setup"} & : & @{text "local_theory \<rightarrow> local_theory"} \\
   918     @{command_def "method_setup"} & : & @{text "local_theory \<rightarrow> local_theory"} \\
   919   \end{matharray}
   919   \end{matharray}
   920 
   920 
   921   @{rail \<open>
   921   @{rail \<open>
   936   addressing.
   936   addressing.
   937 
   937 
   938   Here are some example method definitions:
   938   Here are some example method definitions:
   939 
   939 
   940   \end{description}
   940   \end{description}
   941 *}
   941 \<close>
   942 
   942 
   943   method_setup my_method1 = {*
   943   method_setup my_method1 = \<open>
   944     Scan.succeed (K (SIMPLE_METHOD' (fn i: int => no_tac)))
   944     Scan.succeed (K (SIMPLE_METHOD' (fn i: int => no_tac)))
   945   *}  "my first method (without any arguments)"
   945 \<close>  "my first method (without any arguments)"
   946 
   946 
   947   method_setup my_method2 = {*
   947   method_setup my_method2 = \<open>
   948     Scan.succeed (fn ctxt: Proof.context =>
   948     Scan.succeed (fn ctxt: Proof.context =>
   949       SIMPLE_METHOD' (fn i: int => no_tac))
   949       SIMPLE_METHOD' (fn i: int => no_tac))
   950   *}  "my second method (with context)"
   950 \<close>  "my second method (with context)"
   951 
   951 
   952   method_setup my_method3 = {*
   952   method_setup my_method3 = \<open>
   953     Attrib.thms >> (fn thms: thm list => fn ctxt: Proof.context =>
   953     Attrib.thms >> (fn thms: thm list => fn ctxt: Proof.context =>
   954       SIMPLE_METHOD' (fn i: int => no_tac))
   954       SIMPLE_METHOD' (fn i: int => no_tac))
   955   *}  "my third method (with theorem arguments and context)"
   955 \<close>  "my third method (with theorem arguments and context)"
   956 
   956 
   957 
   957 
   958 section {* Generalized elimination \label{sec:obtain} *}
   958 section \<open>Generalized elimination \label{sec:obtain}\<close>
   959 
   959 
   960 text {*
   960 text \<open>
   961   \begin{matharray}{rcl}
   961   \begin{matharray}{rcl}
   962     @{command_def "obtain"} & : & @{text "proof(state) | proof(chain) \<rightarrow> proof(prove)"} \\
   962     @{command_def "obtain"} & : & @{text "proof(state) | proof(chain) \<rightarrow> proof(prove)"} \\
   963     @{command_def "guess"}@{text "\<^sup>*"} & : & @{text "proof(state) | proof(chain) \<rightarrow> proof(prove)"} \\
   963     @{command_def "guess"}@{text "\<^sup>*"} & : & @{text "proof(state) | proof(chain) \<rightarrow> proof(prove)"} \\
   964   \end{matharray}
   964   \end{matharray}
   965 
   965 
  1030   specify a prefix of obtained parameters explicitly in the text.
  1030   specify a prefix of obtained parameters explicitly in the text.
  1031 
  1031 
  1032   It is important to note that the facts introduced by @{command
  1032   It is important to note that the facts introduced by @{command
  1033   "obtain"} and @{command "guess"} may not be polymorphic: any
  1033   "obtain"} and @{command "guess"} may not be polymorphic: any
  1034   type-variables occurring here are fixed in the present context!
  1034   type-variables occurring here are fixed in the present context!
  1035 *}
  1035 \<close>
  1036 
  1036 
  1037 
  1037 
  1038 section {* Calculational reasoning \label{sec:calculation} *}
  1038 section \<open>Calculational reasoning \label{sec:calculation}\<close>
  1039 
  1039 
  1040 text {*
  1040 text \<open>
  1041   \begin{matharray}{rcl}
  1041   \begin{matharray}{rcl}
  1042     @{command_def "also"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
  1042     @{command_def "also"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
  1043     @{command_def "finally"} & : & @{text "proof(state) \<rightarrow> proof(chain)"} \\
  1043     @{command_def "finally"} & : & @{text "proof(state) \<rightarrow> proof(chain)"} \\
  1044     @{command_def "moreover"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
  1044     @{command_def "moreover"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
  1045     @{command_def "ultimately"} & : & @{text "proof(state) \<rightarrow> proof(chain)"} \\
  1045     @{command_def "ultimately"} & : & @{text "proof(state) \<rightarrow> proof(chain)"} \\
  1141   explicit single-step elimination proof, such as ``@{command
  1141   explicit single-step elimination proof, such as ``@{command
  1142   "assume"}~@{text "x = y"}~@{command "then"}~@{command "have"}~@{text
  1142   "assume"}~@{text "x = y"}~@{command "then"}~@{command "have"}~@{text
  1143   "y = x"}~@{command ".."}''.
  1143   "y = x"}~@{command ".."}''.
  1144 
  1144 
  1145   \end{description}
  1145   \end{description}
  1146 *}
  1146 \<close>
  1147 
  1147 
  1148 
  1148 
  1149 section {* Proof by cases and induction \label{sec:cases-induct} *}
  1149 section \<open>Proof by cases and induction \label{sec:cases-induct}\<close>
  1150 
  1150 
  1151 subsection {* Rule contexts *}
  1151 subsection \<open>Rule contexts\<close>
  1152 
  1152 
  1153 text {*
  1153 text \<open>
  1154   \begin{matharray}{rcl}
  1154   \begin{matharray}{rcl}
  1155     @{command_def "case"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
  1155     @{command_def "case"} & : & @{text "proof(state) \<rightarrow> proof(state)"} \\
  1156     @{command_def "print_cases"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
  1156     @{command_def "print_cases"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
  1157     @{attribute_def case_names} & : & @{text attribute} \\
  1157     @{attribute_def case_names} & : & @{text attribute} \\
  1158     @{attribute_def case_conclusion} & : & @{text attribute} \\
  1158     @{attribute_def case_conclusion} & : & @{text attribute} \\
  1279   rarely needed; this is already taken care of automatically by the
  1279   rarely needed; this is already taken care of automatically by the
  1280   higher-level @{attribute cases}, @{attribute induct}, and
  1280   higher-level @{attribute cases}, @{attribute induct}, and
  1281   @{attribute coinduct} declarations.
  1281   @{attribute coinduct} declarations.
  1282 
  1282 
  1283   \end{description}
  1283   \end{description}
  1284 *}
  1284 \<close>
  1285 
  1285 
  1286 
  1286 
  1287 subsection {* Proof methods *}
  1287 subsection \<open>Proof methods\<close>
  1288 
  1288 
  1289 text {*
  1289 text \<open>
  1290   \begin{matharray}{rcl}
  1290   \begin{matharray}{rcl}
  1291     @{method_def cases} & : & @{text method} \\
  1291     @{method_def cases} & : & @{text method} \\
  1292     @{method_def induct} & : & @{text method} \\
  1292     @{method_def induct} & : & @{text method} \\
  1293     @{method_def induction} & : & @{text method} \\
  1293     @{method_def induction} & : & @{text method} \\
  1294     @{method_def coinduct} & : & @{text method} \\
  1294     @{method_def coinduct} & : & @{text method} \\
  1495   usually 0 for plain cases and induction rules of datatypes etc.\ and
  1495   usually 0 for plain cases and induction rules of datatypes etc.\ and
  1496   1 for rules of inductive predicates or sets and the like.  The
  1496   1 for rules of inductive predicates or sets and the like.  The
  1497   remaining facts are inserted into the goal verbatim before the
  1497   remaining facts are inserted into the goal verbatim before the
  1498   actual @{text cases}, @{text induct}, or @{text coinduct} rule is
  1498   actual @{text cases}, @{text induct}, or @{text coinduct} rule is
  1499   applied.
  1499   applied.
  1500 *}
  1500 \<close>
  1501 
  1501 
  1502 
  1502 
  1503 subsection {* Declaring rules *}
  1503 subsection \<open>Declaring rules\<close>
  1504 
  1504 
  1505 text {*
  1505 text \<open>
  1506   \begin{matharray}{rcl}
  1506   \begin{matharray}{rcl}
  1507     @{command_def "print_induct_rules"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
  1507     @{command_def "print_induct_rules"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
  1508     @{attribute_def cases} & : & @{text attribute} \\
  1508     @{attribute_def cases} & : & @{text attribute} \\
  1509     @{attribute_def induct} & : & @{text attribute} \\
  1509     @{attribute_def induct} & : & @{text attribute} \\
  1510     @{attribute_def coinduct} & : & @{text attribute} \\
  1510     @{attribute_def coinduct} & : & @{text attribute} \\
  1545   declaration is taken care of automatically: @{attribute
  1545   declaration is taken care of automatically: @{attribute
  1546   consumes}~@{text 0} is specified for ``type'' rules and @{attribute
  1546   consumes}~@{text 0} is specified for ``type'' rules and @{attribute
  1547   consumes}~@{text 1} for ``predicate'' / ``set'' rules.
  1547   consumes}~@{text 1} for ``predicate'' / ``set'' rules.
  1548 
  1548 
  1549   \end{description}
  1549   \end{description}
  1550 *}
  1550 \<close>
  1551 
  1551 
  1552 end
  1552 end