]> gitweb.michael.orlitzky.com - mjotex.git/blobdiff - mjo-common.tex
New \restrict macro to restrict a function to a subset of its domain.
[mjotex.git] / mjo-common.tex
index 38b262ba403c705e5fb0b543ce1b2df997c6970d..284d5a5fe9460a2ef4e32c7e5c5320784f0402fd 100644 (file)
@@ -8,6 +8,10 @@
   \usepackage{amsfonts}
 \fi
 
+\ifx\restriction\undefined
+  \usepackage{amssymb}
+\fi
+
 % Place the argument in matching left/right parentheses.
 \newcommand*{\of}[1]{ \left({#1}\right) }
 
 % The factorial operator.
 \newcommand*{\factorial}[1]{ {#1}! }
 
+% Restrict the first argument (a function) to the second argument (a
+% subset of that functions domain). Abused for polynomials to specify
+% an associated function with a particular domain (also its codomain,
+% in the case of univariate polynomials).
+\newcommand*{\restrict}[2]{{#1}{\restriction}_{#2}}
+\ifdefined\newglossaryentry
+  \newglossaryentry{restriction}{
+    name={\ensuremath{\restrict{f}{X}}},
+    description={the restriction of $f$ to $X$},
+    sort=r
+  }
+\fi
+
 %
 % Product spaces
 %