定理和证明

简介

数学文档包括需要特殊格式和编号的元素,例如定理、定义、命题、注释、推论、引理等。本文介绍如何在 LaTeX 中定义这些环境。
LaTeX 中的编号环境可以通过命令 \newtheorem 来定义,该命令有两个参数:
\newtheorem{theorem}{Theorem}
  • 第一个是定义的环境的名称
  • 第二个是将在环境开头以粗体字体打印的单词。
    一旦定义了这个新环境,它就可以在文档中正常使用,由 \begin{theorem}\end{theorem} 分隔。下面给出了一个示例:
\newtheorem{theorem}{Theorem}

\section{Introduction}
Theorems can easily be defined:

\begin{theorem}
Let \(f\) be a function whose derivative exists in every point, then \(f\)
is a continuous function.
\end{theorem}
此示例产生以下输出:
Output

编号定理、定义、推论和引理

环境的编号可以通过 \newtheorem 命令中的两个附加参数来控制。让我们看看:
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}

\section{Introduction}
Theorems can easily be defined:

\begin{theorem}
Let \(f\) be a function whose derivative exists in every point, then \(f\) is 
a continuous function.
\end{theorem}

\begin{theorem}[Pythagorean theorem]
\label{pythagorean}
This is a theorem about right triangles and can be summarised in the next 
equation 
\[ x^2 + y^2 = z^2 \]
\end{theorem}

And a consequence of theorem \ref{pythagorean} is the statement in the next 
corollary.

\begin{corollary}
There's no right rectangle whose sides measure 3cm, 4cm, and 6cm.
\end{corollary}

You can reference theorems such as \ref{pythagorean} when a label is assigned.

\begin{lemma}
Given two line segments whose lengths are \(a\) and \(b\) respectively there is a 
real number \(r\) such that \(b=ra\).
\end{lemma}
此示例产生以下输出:
Output
序言中定义了三个新环境。
\newtheorem{theorem}{Theorem}[section] 这是介绍中提供的示例,但它具有附加参数 [section],该参数在每个新部分重新启动定理计数器。
\newtheorem{corollary}{Corollary}[theorem] 创建了一个名为 corollary 的环境,每次使用新的定理环境时,都会重置此新环境的计数器。
\newtheorem{lemma}[theorem]{Lemma} 在这种情况下,即使创建了一个名为 lemma 的新环境,它也将使用与定理环境相同的计数器。
一些著名的定理有自己的名称,对于这些情况,您可以在环境打开命令的括号内添加所述名称。在示例中,行 `
一些著名的定理有自己的名称,对于这些情况,您可以在环境打开命令的括号内添加所述名称。在示例中,行 \begin{theorem}[Pythagorean theorem] 在段落开头打印“Pythagorean theorem”。
与 LaTeX 中的许多其他编号元素一样,命令 \label 可用于引用文档中的定理类环境。

未编号的定理类环境

拥有未编号的定理类环境来向数学文档添加备注、评论或示例非常有用。
\newtheorem*{remark}{Remark}

Unnumbered theorem-like environments are also possible.

\begin{remark}
This statement is true, I guess.
\end{remark}
This example produces the following output:
Output
命令 \newtheorem* 的语法与非星号版本相同,除了计数器参数之外。在此示例中,创建了一个名为 remark 的新无编号环境。

定理样式

在处理数学文档时,一个重要的功能是通过其格式轻松区分定义和定理。
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]

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

\section{Introduction}
Unnumbered theorem-like environments are also possible.

\begin{remark}
This statement is true, I guess.
\end{remark}

And the next is a somewhat informal definition

\begin{definition}[Fibration]
A fibration is a mapping between two topological spaces that has the homotopy lifting property for every space \(X\).
\end{definition}
此示例产生以下输出:
Output
命令 \theoremstyle{ } 为其下方定义的编号环境设置样式。在上面的示例中,使用了样式 remarkdefinition。请注意,remark 现在为斜体,环境中的文本使用普通(罗马)字体,而定义也使用罗马字体,但单词“Definition”以粗体字体打印。

证明

证明是数学论文和书籍的核心,通常将它们在视觉上与文档中的普通文本区分开来。
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}

\section{Introduction}
\begin{lemma}
Given two line segments whose lengths are \(a\) and \(b\) respectively there 
is a real number \(r\) such that \(b=ra\).
\end{lemma}

\begin{proof}
To prove it by contradiction try and assume that the statement is false,
proceed from there and at some point you will arrive to a contradiction.
\end{proof}
此示例产生以下输出:
Output

更改 QED 符号

在证明末尾打印的符号称为“QED 符号”。引用 Wikipedia 中 QED 的含义:
QED 是拉丁语短语 quod erat demonstrandum 的首字母缩写,意思是“因此已经证明”
使用您选择的符号或措辞来表示 QED 符号很简单。命令
\re​​newcommand\qedsymbol{$\blacksquare$}
您可以使用括号内的参数 $\blacksquare$ 将默认的白色方块替换为黑色方块。或者,您可以明确地写出 QED 这个词:
\re​​newcommand\qedsymbol{QED}
下面是演示这两个选项的示例:
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}

\section{Introduction}

\begin{lemma}
Given two line segments whose lengths are \(a\) and \(b\) respectively there 
is a real number \(r\) such that \(b=ra\).
\end{lemma}

\renewcommand\qedsymbol{$\blacksquare$}

\begin{proof}
To prove it by contradiction try and assume that the statement is false,
proceed from there and at some point you will arrive to a contradiction.
\end{proof}

\renewcommand\qedsymbol{QED}

\begin{proof}
To prove it by contradiction try and assume that the statement is false,
proceed from there and at some point you will arrive to a contradiction.
\end{proof}
此示例产生以下输出:
Output

从特定数字开始定理计数器

\setcounter{theoremenv}{number} 设置 theoremenv 的计数以包含值数字。
  • *注意:*数字可以是正数或负数。
\newtheorem{theorem}{Theorem}

\section{Introduction}
Theorems can easily be defined:

\begin{theorem}
Let \(f\) be a function whose derivative exists in every point, then \(f\) 
is a continuous function.
\end{theorem}

\setcounter{theorem}{0}

\begin{theorem}
Let \(f\) be a function whose derivative exists in every point, then \(f\) 
is a continuous function.
\end{theorem}

\setcounter{theorem}{-3}

\begin{theorem}
Let \(f\) be a function whose derivative exists in every point, then \(f\) 
is a continuous function.
\end{theorem}
此示例产生以下输出:
Output

参考指南

定理样式
  • definition 粗体标题,罗马体。常用于定义、条件、问题和示例中。
  • plain 粗体标题,斜体。常用于定理、引理、推论、命题和猜想中。
  • remark 斜体标题,罗马体。常用于备注、注释、注解、主张、案例、致谢和结论中。