diff -r c8a2755bf220 -r ff784d5a5bfb src/Doc/Tutorial/Inductive/Mutual.thy --- a/src/Doc/Tutorial/Inductive/Mutual.thy Sat Jan 05 17:00:43 2019 +0100 +++ b/src/Doc/Tutorial/Inductive/Mutual.thy Sat Jan 05 17:24:33 2019 +0100 @@ -58,7 +58,7 @@ subsection\Inductively Defined Predicates\label{sec:ind-predicates}\ text\\index{inductive predicates|(} -Instead of a set of even numbers one can also define a predicate on @{typ nat}: +Instead of a set of even numbers one can also define a predicate on \<^typ>\nat\: \ inductive evn :: "nat \ bool" where @@ -67,13 +67,13 @@ text\\noindent Everything works as before, except that you write \commdx{inductive} instead of \isacommand{inductive\_set} and -@{prop"evn n"} instead of @{prop"n \ Even"}. +\<^prop>\evn n\ instead of \<^prop>\n \ Even\. When defining an n-ary relation as a predicate, it is recommended to curry the predicate: its type should be \mbox{\\\<^sub>1 \ \ \ \\<^sub>n \ bool\} rather than \\\<^sub>1 \ \ \ \\<^sub>n \ bool\. The curried version facilitates inductions. -When should you choose sets and when predicates? If you intend to combine your notion with set theoretic notation, define it as an inductive set. If not, define it as an inductive predicate, thus avoiding the \\\ notation. But note that predicates of more than one argument cannot be combined with the usual set theoretic operators: @{term"P \ Q"} is not well-typed if \P, Q :: \\<^sub>1 \ \\<^sub>2 \ bool\, you have to write @{term"%x y. P x y & Q x y"} instead. +When should you choose sets and when predicates? If you intend to combine your notion with set theoretic notation, define it as an inductive set. If not, define it as an inductive predicate, thus avoiding the \\\ notation. But note that predicates of more than one argument cannot be combined with the usual set theoretic operators: \<^term>\P \ Q\ is not well-typed if \P, Q :: \\<^sub>1 \ \\<^sub>2 \ bool\, you have to write \<^term>\%x y. P x y & Q x y\ instead. \index{inductive predicates|)} \