> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/ja/fen-ye-bie/01-theorems-and-proofs.md).

# 定理と証明

## はじめに

数学文書には、定理、定義、命題、注記、系、補題など、特別な書式設定や番号付けを必要とする要素が含まれます。この記事では、LaTeX でこれらの環境を定義する方法を説明します。

LaTeX の番号付き環境は、コマンド `\newtheorem` を使って定義できます。このコマンドは 2 つの引数を取ります:

```latex
\newtheorem{theorem}{Theorem}
```

* 1 つ目は、定義される環境の名前です
* 2 つ目は、その環境の冒頭で太字で表示される単語です。

この新しい環境が定義されると、文書内で通常どおり使用でき、次のもので区切られます `\begin{theorem}` や `\end{theorem}`。以下に例を示します:

```latex
\documentclass{article}
\usepackage[english]{babel}
\newtheorem{theorem}{Theorem}
\begin{document}

\section{導入}
定理は簡単に定義できます:

\begin{theorem}
\(f\) を、各点で導関数が存在する関数とすると、\(f\) は
連続関数です。
\end{theorem}
\end{document}
```

[この例を Overleaf で開く。](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=newtheorem+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Benglish%5D%7Bbabel%7D%0A%5Cnewtheorem%7Btheorem%7D%7BTheorem%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%5Csection%7BIntroduction%7D%0ATheorems+can+easily+be+defined%3A%0A%0A%5Cbegin%7Btheorem%7D%0ALet+%5C%28f%5C%29+be+a+function+whose+derivative+exists+in+every+point%2C+then+%5C%28f%5C%29+%0Ais+a+continuous+function.%0A%5Cend%7Btheorem%7D%0A%5Cend%7Bdocument%7D)

この例では次の出力が生成されます:

![OLV2TheoremsProofsEx1.png](/files/6e24e27de60d8b11637849c754395e8ac37c0a89)

## 番号付きの定理、定義、系、および補題

環境の番号付けは、 `\newtheorem` コマンド内の 2 つの追加パラメータによって制御できます。見てみましょう:

```latex
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}

\begin{document}
\section{導入}
定理は簡単に定義できます:

\begin{theorem}
\(f\) を、各点で導関数が存在する関数とすると、\(f\) は
連続関数です。
\end{theorem}

\begin{theorem}[Pythagorean theorem]
\label{pythagorean}
これは直角三角形に関する定理で、次の式で要約できます
equation
\[ x^2 + y^2 = z^2 \]
\end{theorem}

そして定理 \ref{pythagorean} の帰結は、次の
系の命題です。

\begin{corollary}
辺の長さが 3cm、4cm、6cm の直角四角形は存在しません。
\end{corollary}

ラベルが付けられている場合、\ref{pythagorean} のように定理を参照できます。

\begin{lemma}
長さがそれぞれ \(a\) と \(b\) の 2 つの線分が与えられると、
\(b=ra\) となる実数 \(r\) が存在します。
\end{lemma}
```

[この例を Overleaf で開く。](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Numbering+of+theorems\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Benglish%5D%7Bbabel%7D%0A%5Cnewtheorem%7Btheorem%7D%7BTheorem%7D%5Bsection%5D%0A%5Cnewtheorem%7Bcorollary%7D%7BCorollary%7D%5Btheorem%5D%0A%5Cnewtheorem%7Blemma%7D%5Btheorem%5D%7BLemma%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%5Csection%7BIntroduction%7D%0ATheorems+can+easily+be+defined%3A%0A%0A%5Cbegin%7Btheorem%7D%0ALet+%5C%28f%5C%29+be+a+function+whose+derivative+exists+in+every+point%2C+then+%5C%28f%5C%29+is+%0Aa+continuous+function.%0A%5Cend%7Btheorem%7D%0A%0A%5Cbegin%7Btheorem%7D%5BPythagorean+theorem%5D%0A%5Clabel%7Bpythagorean%7D%0AThis+is+a+theorem+about+right+triangles+and+can+be+summarised+in+the+next+%0Aequation+%0A%5C%5B+x%5E2+%2B+y%5E2+%3D+z%5E2+%5C%5D%0A%5Cend%7Btheorem%7D%0A%0AAnd+a+consequence+of+theorem+%5Cref%7Bpythagorean%7D+is+the+statement+in+the+next+%0Acorollary.%0A%0A%5Cbegin%7Bcorollary%7D%0AThere%27s+no+right+rectangle+whose+sides+measure+3cm%2C+4cm%2C+and+6cm.%0A%5Cend%7Bcorollary%7D%0A%0AYou+can+reference+theorems+such+as+%5Cref%7Bpythagorean%7D+when+a+label+is+assigned.%0A%0A%5Cbegin%7Blemma%7D%0AGiven+two+line+segments+whose+lengths+are+%5C%28a%5C%29+and+%5C%28b%5C%29+respectively+there+is+a+%0Areal+number+%5C%28r%5C%29+such+that+%5C%28b%3Dra%5C%29.%0A%5Cend%7Blemma%7D%0A%5Cend%7Bdocument%7D)

この例では次の出力が生成されます:

![OLV2TheoremsProofsEx2-updated.png](/files/987c2ddfa100dc4877e14e72d15fb636df70f172)

前文には 3 つの新しい環境が定義されています。

**\newtheorem{theorem}{Theorem}\[section]**

これは導入部で示した例ですが、\[section] という追加パラメータがあり、これにより各新しいセクションごとに定理カウンタがリセットされます。

**\newtheorem{corollary}{Corollary}\[theorem]**

corollary という環境が作成され、この新しい環境のカウンタは、新しい theorem 環境が使われるたびにリセットされます。

**\newtheorem{lemma}\[theorem]{Lemma}**

この場合、lemma という新しい環境が作成されますが、theorem 環境と同じカウンタを使用します。

有名な定理の中には独自の名前を持つものがあり、そのような場合は環境を開始するコマンドの角括弧内にその名前を追加できます。例では、次の行 `\begin{theorem}[Pythagorean theorem]` が段落の冒頭に「Pythagorean theorem」と表示します。

LaTeX の他の多くの番号付き要素と同様に、コマンド `\label` を使って、文書内で定理風の環境を参照できます。

## 番号のない定理風環境

数学文書に注記、コメント、例を追加するために、番号のない定理風環境があると便利です。 `amsthm` パッケージがこの機能を提供します。

```latex
\documentclass{article}
\usepackage[english]{babel}
\usepackage{amsthm}

\newtheorem*{remark}{Remark}

\begin{document}
番号のない定理風環境も可能です。

\begin{remark}
この主張は真だと思います。
\end{remark}
\end{document}
```

[この例を Overleaf で開く。](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Unnumbered+theorem-like+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Benglish%5D%7Bbabel%7D%0A%5Cusepackage%7Bamsthm%7D%0A%0A%5Cnewtheorem%2A%7Bremark%7D%7BRemark%7D%0A%0A%5Cbegin%7Bdocument%7D%0AUnnumbered+theorem-like+environments+are+also+possible.%0A%0A%5Cbegin%7Bremark%7D%0AThis+statement+is+true%2C+I+guess.%0A%5Cend%7Bremark%7D%0A%5Cend%7Bdocument%7D)

この例では次の出力が生成されます:

![OLV2heoremsProofsEx3.png](/files/7921daa6637e6886bbbc0fd5f899f4dbaf57bce2)

コマンド `\newtheorem*` の構文は、カウンタのパラメータを除けば、星なし版と同じです。この例では、 `remark` という新しい番号なし環境が作成されています。

## 定理スタイル

数学文書で作業する際に重要な機能の 1 つは、書式によって、たとえば定義と定理を簡単に見分けられることです。 `amsthm` パッケージはこれを実現するための特別なコマンドを提供します。

```latex
\documentclass{article}
\usepackage[english]{babel}
\usepackage{amsthm}

\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]

\theoremstyle{remark}
\newtheorem*{remark}{Remark}

\begin{document}
\section{導入}
番号のない定理風環境も可能です。

\begin{remark}
この主張は真だと思います。
\end{remark}

そして次は、ややくだけた定義です

\begin{definition}[Fibration]
ファイバー化とは、すべての空間 \(X\) に対してホモトピー持ち上げ性をもつ、2 つの位相空間の間の写像です。
\end{definition}
\end{document}
```

[この例を Overleaf で開く。](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=An+amsthm+package+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Benglish%5D%7Bbabel%7D%0A%5Cusepackage%7Bamsthm%7D%0A%0A%5Ctheoremstyle%7Bdefinition%7D%0A%5Cnewtheorem%7Bdefinition%7D%7BDefinition%7D%5Bsection%5D%0A%0A%5Ctheoremstyle%7Bremark%7D%0A%5Cnewtheorem%2A%7Bremark%7D%7BRemark%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%5Csection%7BIntroduction%7D%0AUnnumbered+theorem-like+environments+are+also+possible.%0A%0A%5Cbegin%7Bremark%7D%0AThis+statement+is+true%2C+I+guess.%0A%5Cend%7Bremark%7D%0A%0AAnd+the+next+is+a+somewhat+informal+definition%0A%0A%5Cbegin%7Bdefinition%7D%5BFibration%5D%0AA+fibration+is+a+mapping+between+two+topological+spaces+that+has+the+homotopy+lifting+property+for+every+space+%5C%28X%5C%29.%0A%5Cend%7Bdefinition%7D%0A%5Cend%7Bdocument%7D)

この例では次の出力が生成されます:

![OLV2TheoremsProofsEx4.png](/files/a2da6b8755e6ca67c8c0ff67262339fa22642560)

コマンド `\theoremstyle{ }` その直下で定義される番号付き環境の書式を設定します。上の例では、 *remark* や *definition* スタイルが使われています。注記は現在イタリック体で表示され、環境内の本文は通常の（ローマン体の）書体を使い、一方で定義では本文にもローマン体が使われますが、「Definition」という単語は太字で表示されます。

次を参照してください [リファレンスガイド](#reference-guide) その他の定理スタイルについては。

## 証明

証明は数学論文や書籍の核心であり、文書内では通常の本文と視覚的に分けておくのが慣例です。 `amsthm` パッケージは環境 `proof` を提供します。

```latex
\documentclass{article}
\usepackage[english]{babel}
\usepackage{amsthm}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}

\begin{document}
\section{導入}
\begin{lemma}
長さがそれぞれ \(a\) と \(b\) の 2 つの線分が与えられると、
\(b=ra\) となる実数 \(r\) が存在します。
\end{lemma}

\begin{proof}
背理法で証明するには、命題が偽であると仮定し、
そこから進めていくと、ある時点で矛盾に到達します。
\end{proof}
\end{document}
```

[この例を Overleaf で開く。](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Example+of+amsthm+proof+environment\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Benglish%5D%7Bbabel%7D%0A%5Cusepackage%7Bamsthm%7D%0A%0A%5Cnewtheorem%7Btheorem%7D%7BTheorem%7D%5Bsection%5D%0A%5Cnewtheorem%7Blemma%7D%5Btheorem%5D%7BLemma%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%5Csection%7BIntroduction%7D%0A%5Cbegin%7Blemma%7D%0AGiven+two+line+segments+whose+lengths+are+%5C%28a%5C%29+and+%5C%28b%5C%29+respectively+there+%0Ais+a+real+number+%5C%28r%5C%29+such+that+%5C%28b%3Dra%5C%29.%0A%5Cend%7Blemma%7D%0A%0A%5Cbegin%7Bproof%7D%0ATo+prove+it+by+contradiction+try+and+assume+that+the+statement+is+false%2C%0Aproceed+from+there+and+at+some+point+you+will+arrive+to+a+contradiction.%0A%5Cend%7Bproof%7D%0A%5Cend%7Bdocument%7D)

この例では次の出力が生成されます:

![OLV2TheoremsProofsEx5.png](/files/8197bf7708227b15da6a612842659ceef2f5ff9b)

単語 `Proof` はイタリック体で表示され、少し余分なスペースがあり、さらに証明の終わりを示す特別な記号が使われています。この記号は簡単に変更できます。方法は次の節で説明します。

## QED 記号の変更

証明の末尾に表示される記号は「QED 記号」と呼ばれます。 [QED の意味を](https://en.wikipedia.org/wiki/Q.E.D.) Wikipedia から引用すると:

> QED はラテン語句 *quod erat demonstrandum*の頭字語で、「したがって証明された」という意味です

QED 記号を表すために、任意の記号や表記を使うのは簡単です。コマンド

```latex
\renewcommand\qedsymbol{$\blacksquare$}
```

を使うと、デフォルトの白い四角を、 `$\blacksquare$`で印字される黒い四角に置き換えられます。これは波括弧内のパラメータです。あるいは、QED という語を明示的に書くこともできます:

```latex
\renewcommand\qedsymbol{QED}
```

両方の विकल्पを示す例を次に示します:

```latex
\documentclass{article}

\usepackage[english]{babel}
\usepackage{amsthm}
\usepackage{amssymb}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}

\begin{document}
\section{導入}

\begin{lemma}
長さがそれぞれ \(a\) と \(b\) の 2 つの線分が与えられると、
\(b=ra\) となる実数 \(r\) が存在します。
\end{lemma}

\renewcommand\qedsymbol{$\blacksquare$}

\begin{proof}
背理法で証明するには、命題が偽であると仮定し、
そこから進めていくと、ある時点で矛盾に到達します。
\end{proof}

\renewcommand\qedsymbol{QED}

\begin{proof}
背理法で証明するには、命題が偽であると仮定し、
そこから進めていくと、ある時点で矛盾に到達します。
\end{proof}
\end{document}
```

[この例を Overleaf で開く。](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Changing+the+QED+symbol\&snip=%5Cdocumentclass%7Barticle%7D%0A%0A%5Cusepackage%5Benglish%5D%7Bbabel%7D%0A%5Cusepackage%7Bamsthm%7D%0A%5Cusepackage%7Bamssymb%7D%0A%0A%5Cnewtheorem%7Btheorem%7D%7BTheorem%7D%5Bsection%5D%0A%5Cnewtheorem%7Blemma%7D%5Btheorem%5D%7BLemma%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%5Csection%7BIntroduction%7D%0A%0A%5Cbegin%7Blemma%7D%0AGiven+two+line+segments+whose+lengths+are+%5C%28a%5C%29+and+%5C%28b%5C%29+respectively+there+%0Ais+a+real+number+%5C%28r%5C%29+such+that+%5C%28b%3Dra%5C%29.%0A%5Cend%7Blemma%7D%0A%0A%5Crenewcommand%5Cqedsymbol%7B%24%5Cblacksquare%24%7D%0A%0A%5Cbegin%7Bproof%7D%0ATo+prove+it+by+contradiction+try+and+assume+that+the+statement+is+false%2C%0Aproceed+from+there+and+at+some+point+you+will+arrive+to+a+contradiction.%0A%5Cend%7Bproof%7D%0A%0A%5Crenewcommand%5Cqedsymbol%7BQED%7D%0A%0A%5Cbegin%7Bproof%7D%0ATo+prove+it+by+contradiction+try+and+assume+that+the+statement+is+false%2C%0Aproceed+from+there+and+at+some+point+you+will+arrive+to+a+contradiction.%0A%5Cend%7Bproof%7D%0A%5Cend%7Bdocument%7D)

この例では次の出力が生成されます:

![OLV2TheoremsProofsEx6.png](/files/80a1f9ae2a3ab3f134d1527c8a678c10ff754e7f)

## リファレンスガイド

***定理スタイル***

* `definition` 太字のタイトル、本文はローマン体。定義、条件、問題、例で一般的に使われます。
* `plain` 太字のタイトル、本文はイタリック体。定理、補題、系、命題、予想で一般的に使われます。
* `remark` イタリック体のタイトル、本文はローマン体。注記、メモ、注釈、主張、場合、謝辞、結論で一般的に使われます。

## さらに読む

詳しくは以下を参照してください：

* [数式](/latex/ja/shu-xue/01-mathematical-expressions.md)
* [環境](/latex/ja/komando/02-environments.md)
* [数式モードでの表示スタイル](/latex/ja/shu-xue/10-display-style-in-math-mode.md)
* [ギリシャ文字と数式記号の一覧](/latex/ja/shu-xue/11-list-of-greek-letters-and-math-symbols.md)
* [数学フォント](/latex/ja/shu-xue/12-mathematical-fonts.md)
* [複数ファイルの LaTeX プロジェクト](/latex/ja/wen-shu-gou-zao/08-multi-file-latex-projects.md)
* [節や数式の相互参照](/latex/ja/wen-shu-gou-zao/03-cross-referencing-sections-equations-and-floats.md)
* [ハイパーリンク](/latex/ja/wen-shu-gou-zao/09-hyperlinks.md)
* [この **amsthm** パッケージのドキュメント](http://www.ctan.org/pkg/amsthm)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/ja/fen-ye-bie/01-theorems-and-proofs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
