区分関数と関数定義数学の整合

区分関数と関数定義数学の整合

次のものをin\mathbb{N}と揃える方法がわかりません。試してみましたが、エラーが大量に発生しました。どなたか助けていただければ幸いです。nf(n)\begin{align*}

It suffices to show that $\mathbb{Z}\preceq \mathbb{N}$.
\\* Define $f : \mathbb{N}\longrightarrow \mathbb{Z}$ by \[
f(n) =
\begin{cases}
k &\text{if } n=2k \text{ for } k\in \mathbb{Z},\\
-k &\text{if } n=2k+1 \text{ for } k\in \mathbb{Z}.
\end{cases}
\]

答え1

結果はかなりひどいです。

\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}
It suffices to show that $\mathbb{Z}\preceq \mathbb{N}$.
\[
\begin{array}{@{} r @{} c @{} l @{} }
\text{Define }f \colon &\mathbb{N} & {} \longrightarrow \mathbb{Z} \text{ by}\\[1ex]
&f(n) &{}=\displaystyle
\begin{cases}
k &\text{if } n=2k \text{ for } k\in \mathbb{Z},\\
-k &\text{if } n=2k+1 \text{ for } k\in \mathbb{Z}.
\end{cases}
\end{array}
\]
\end{document}

ここに画像の説明を入力してください

読者のために、伝統的な方法で実行してください。

\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}
It suffices to show that $\mathbb{Z}\preceq \mathbb{N}$.
Define $f \colon\mathbb{N} \to \mathbb{Z}$ by
\[
f(n)=
\begin{cases}
k &\text{if } n=2k \text{ for } k\in \mathbb{Z},\\
-k &\text{if } n=2k+1 \text{ for } k\in \mathbb{Z}.
\end{cases}
\]
\end{document}

ここに画像の説明を入力してください

私は以下の使用を避けます数学的な観点から言えば、

\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}
It suffices to show that $\mathbb{Z}\preceq \mathbb{N}$.
Define $f \colon\mathbb{N} \to \mathbb{Z}$ by
\[
f(n)=
\begin{cases}
\hphantom{-}\dfrac{n}{2} &\text{if $n\in\mathbb{N}$ is even},\\[2ex]
-\dfrac{n-1}{2} &\text{if $n\in\mathbb{N}$ is odd}.
\end{cases}
\]
\end{document}

ここに画像の説明を入力してください

関連情報