使证明引用自动绑定到已证明的定理或按升序标记证明

使证明引用自动绑定到已证明的定理或按升序标记证明

我想知道是否有办法让每个证明自动引用我文本中使用的最新定理,或者,让证明标有升序数字。请允许我用 MWE 进行演示:

\documentclass[a4paper, 12pt]{article}

\usepackage{amsmath, amssymb, amsthm}
\newtheorem{thm}{Theorem}[section]
\newtheorem{prop}[thm]{Proposition}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{defn}[thm]{Definition}

\begin{document}

\section{A section}

\begin{defn}
 An integer $n$ has odd parity (equiv.: ``is odd") if and only if there exists an integer $k$ such that $n = 2k+1$. $n$ has even parity (equiv.: ``is even") if and only if it does not have odd parity.
 \label{defn:oddAndEvenParity}
\end{defn}

\begin{thm}{(Squares of odds are also odd)}
    If $n$ is an odd integer, then $n^2$ is also an odd integer.    
    \label{thm:oddSquares}
\end{thm}

\begin{cor}{(Even perfect squares have even square roots)}
    If $n^2$ is an even integer, then $n$ is also even.
    \label{cor:evenSquareRoots}
\end{cor}

\begin{proof}
    We prove the statement directly. Since $n$ is odd, we have that there exists an integer $k$ such that $n = 2k+1$. By algebra, we have that $n^2 = (2k + 1)^2 = 4k^2 + 4k + 1 = 2\underbrace{k(2k + 2)}_{r \in \mathbb{Z}} + 1 = 2r + 1$. Therefore, $n^2$ is odd.
    \label{prf:evenSquareRoots}
\end{proof}

Referring to the proof above through its label yields the section number: \ref{prf:evenSquareRoots}.
\end{document}

输出如下: 证明本身并未引用该定理。另外,当我引用它时,会使用章节编号。

当然,我可以通过标记定理来引用文中定理的证明,但给定的定理可以有许多不同的证明。因此,在这种情况下,我真正需要的是一些补救措施,使我能够做到以下其中一件事

  1. 将开始证明的“证明”字符串替换为“定理 1.2 的证明”,并将其反映在参考文献中,或
  2. 说出这个证明Proof 1,然后是下一个Proof 2,等等。

我发现尝试执行第一个操作的线程,但 op 使用的是不同的文档类elsarticle。我不熟悉该特定文档类,并且我发现该newproof包与 相冲突amsthm,而 是我对定理、定义、引理等绝对需要的。我尝试了一些补救措施,通过使用\newtheorem来定义替代proof的环境,但它们都无法完全满足我的需要。有什么想法吗?

答案1

  1. 通过提供适当的参考作为可选参数来更新证明的标题:

    在此处输入图片描述

    \documentclass{article}
    
    \usepackage{amsmath,amssymb,amsthm}
    \newtheorem{thm}{Theorem}[section]
    \newtheorem{cor}[thm]{Corollary}
    \newtheorem{defn}[thm]{Definition}
    
    \begin{document}
    
    \section{A section}
    
    \begin{defn}
    An integer~$n$ has odd parity (equiv.: ``is odd") if and only if there exists an 
    integer~$k$ such that $n = 2k + 1$.~$n$ has even parity (equiv.: ``is even") if 
    and only if it does not have odd parity.
    \label{defn:oddAndEvenParity}
    \end{defn}
    
    \begin{thm}{(Squares of odds are also odd)}
    If~$n$ is an odd integer, then~$n^2$ is also an odd integer.    
    \label{thm:oddSquares}
    \end{thm}
    
    \begin{cor}{(Even perfect squares have even square roots)}
    If~$n^2$ is an even integer, then $n$ is also even.
    \label{cor:evenSquareRoots}
    \end{cor}
    
    \begin{proof}[Proof of Theorem~\ref{thm:oddSquares}]
    We prove the statement directly. Since $n$ is odd, we have that there exists an 
    integer~$k$ such that $n = 2k + 1$. Subsequently, $n^2 = (2k + 1)^2 = 4k^2 + 4k + 1 = 
    2k(2k + 2) + 1 = 2r + 1$, where $r = 2k + 1$. Therefore,~$n^2$ is odd.
    \end{proof}
    
    \end{document}
    
  2. 您可以通过在序言中添加以下内容来创建自动校样编号机制

    \newcounter{proof}
    \renewcommand{\proofname}{\refstepcounter{proof}Proof~\theproof}
    

    这会按顺序对您的证明进行编号为Proof 1、、Proof 2...,并允许您引用它们。

    如果你不想要自动编号,我建议使用

    \begin{proof}[Proof~1]
      <first proof>
    \end{proof}
    
    ...
    
    \begin{proof}[Proof~2]
      <second proof>
    \end{proof}
    
    ...
    

相关内容