doc-src/TutorialI/Types/Typedef.thy
changeset 10983 59961d32b1ae
parent 10885 90695f46440b
child 11149 e258b536a137
equal deleted inserted replaced
10982:55c0f9a8df78 10983:59961d32b1ae
    94 @{term three} &::& @{typ"nat set"} \\
    94 @{term three} &::& @{typ"nat set"} \\
    95 @{term Rep_three} &::& @{typ"three \<Rightarrow> nat"}\\
    95 @{term Rep_three} &::& @{typ"three \<Rightarrow> nat"}\\
    96 @{term Abs_three} &::& @{typ"nat \<Rightarrow> three"}
    96 @{term Abs_three} &::& @{typ"nat \<Rightarrow> three"}
    97 \end{tabular}
    97 \end{tabular}
    98 \end{center}
    98 \end{center}
    99 Constant @{term three} is just an abbreviation (@{thm[source]three_def}):
    99 Constant @{term three} is explicitly defined as the representing set:
   100 @{thm[display]three_def}
   100 \begin{center}
       
   101 @{thm three_def}\hfill(@{thm[source]three_def})
       
   102 \end{center}
   101 The situation is best summarized with the help of the following diagram,
   103 The situation is best summarized with the help of the following diagram,
   102 where squares are types and circles are sets:
   104 where squares are types and circles are sets:
   103 \begin{center}
   105 \begin{center}
   104 \unitlength1mm
   106 \unitlength1mm
   105 \thicklines
   107 \thicklines
   116 \end{center}
   118 \end{center}
   117 Finally, \isacommand{typedef} asserts that @{term Rep_three} is
   119 Finally, \isacommand{typedef} asserts that @{term Rep_three} is
   118 surjective on the subset @{term three} and @{term Abs_three} and @{term
   120 surjective on the subset @{term three} and @{term Abs_three} and @{term
   119 Rep_three} are inverses of each other:
   121 Rep_three} are inverses of each other:
   120 \begin{center}
   122 \begin{center}
   121 \begin{tabular}{rl}
   123 \begin{tabular}{@ {}r@ {\qquad\qquad}l@ {}}
   122 @{thm Rep_three[no_vars]} &~~ (@{thm[source]Rep_three}) \\
   124 @{thm Rep_three[no_vars]} & (@{thm[source]Rep_three}) \\
   123 @{thm Rep_three_inverse[no_vars]} &~~ (@{thm[source]Rep_three_inverse}) \\
   125 @{thm Rep_three_inverse[no_vars]} & (@{thm[source]Rep_three_inverse}) \\
   124 @{thm Abs_three_inverse[no_vars]} &~~ (@{thm[source]Abs_three_inverse})
   126 @{thm Abs_three_inverse[no_vars]} & (@{thm[source]Abs_three_inverse})
   125 \end{tabular}
   127 \end{tabular}
   126 \end{center}
   128 \end{center}
   127 %
   129 %
   128 From this example it should be clear what \isacommand{typedef} does
   130 From this example it should be clear what \isacommand{typedef} does
   129 in general given a name (here @{text three}) and a set
   131 in general given a name (here @{text three}) and a set