SuperAPI AI Directory

proof-writer

Data & analytics

View repository

Updated 10-16 01:17

About this skill

proof-writer: Mathematical proof writing skill

Overview

This skill focuses on writing mathematical proofs in academic papers. It covers an end-to-end workflow from claim extraction and strategy selection to complete LaTeX typesetting. All explanations use Traditional Chinese, while mathematical expressions and LaTeX code use English.


Workflow Overview

Proof writing is divided into five stages, executed in order:

主張提取 → 文獻掃描 → 策略選擇 → 逐步推導 → LaTeX 排版

Each stage has clear inputs, outputs, and quality checkpoints. They are explained one by one below.


Stage One: Claim Extraction

Purpose

From the paper draft or user input, precisely extract the mathematical claim that needs to be proved. The claim must be a formalized proposition with clear preconditions and conclusions.

Steps

  1. Identify the claim type: determine whether it is a Theorem, Lemma, Corollary, Proposition, or Claim.
  2. Extract preconditions: list all assumptions, constraints, and scope of applicability.
  3. Extract the conclusion: clearly write out the equality, inequality, or property to be proved.
  4. Symbol confirmation: confirm the definitions and scope of all symbols, referring to symbol conventions。
  5. Formalized statement: write the claim in standard mathematical statement format.

Output Format

主張類型:[Theorem | Lemma | Corollary | Proposition | Claim]
前提條件:
  - 條件 1
  - 條件 2
  - ...
結論:[形式化的數學陳述]
相關符號:[符號清單及定義]

Common Issues

  • Incomplete preconditions: go back and check the assumptions paragraph in the paper.
  • Undefined symbols: consult the paper's notation section or confirm with the user.
  • Claim too vague: ask the user to provide a more precise formalized statement.

Quality Check

  • Is the claim a decidable mathematical proposition?
  • Are all symbols defined?
  • Are the preconditions sufficient to derive the conclusion?
  • Is the claim type correctly classified?

Stage Two: Literature Scan

Purpose

Find known theorems, lemmas, and results related to the claim to establish a foundation for the proof. This step determines which giants' shoulders we can stand on.

Steps

  1. Keyword extraction: extract mathematical keywords from the claim (such as convergence, bound, concentration inequality, etc.).
  2. Theorem matching: search the known theorem library for related results, referring to theorem linking methods。
  3. Relevance assessment: assess the degree of relevance of each found theorem to the current claim.
  4. Dependency establishment: determine which theorems can be used directly and which require moderate modification.
  5. Gap analysis: identify the gap between known results and the target claim.

Common Theorem Sources

  • Lemmas already proved earlier in the paper itself
  • References cited by the paper
  • Classical results in the field (such as Cauchy-Schwarz, Jensen's inequality, etc.)
  • Fundamental theorems in standard textbooks

Output format

相關定理:
  1. [定理名稱] — [簡述] — 相關度:[高|中|低]
  2. ...
可直接引用:[定理列表]
需要修改後使用:[定理列表及修改方向]
證明缺口:[需要自行推導的部分]

Quality check

  • Are any important known results missing?
  • Are the prerequisites of the cited theorems satisfied?
  • Is the version of the theorem correct (some theorems have multiple variants)?

Phase 3: Strategy selection

Purpose

Based on the structure of the claim and the available known results, choose the most appropriate proof strategy. The choice of strategy directly affects the clarity and length of the proof.

Available strategies

This skill supports the following eight proof strategies. For detailed explanations of each strategy, see Proof strategy reference。

1. Direct Proof

Starting from the premises, reach the conclusion directly through a series of logical deductions. Suitable for claims with a clear structure and a well-defined derivation path.

Applicable scenarios: proofs of equalities, derivations of inequalities, set inclusion relations.

2. Proof by Contradiction

Assume the conclusion does not hold and derive a contradiction. Suitable for claims that are difficult to prove directly or whose conclusion is in negative form.

Applicable scenarios: negation of existence, uniqueness proofs, impossibility results.

3. Mathematical Induction

Induction over natural numbers or well-orderable structures. Includes weak induction, strong induction, and structural induction.

Applicable scenarios: recursive structures, properties of sequences, propositions in discrete mathematics.

4. Constructive Proof

Explicitly construct an object satisfying the conditions, thereby proving existence. Provides more information than a purely existential proof.

Applicable scenarios: existence propositions, algorithm correctness, establishment of concrete bounds.

5. Proof by Reduction

Reduce the problem to be proved to a known problem. Commonly used in computational complexity and decision problems.

Applicable scenarios: NP-hardness proofs, lower bound proofs, equivalence proofs.

6. Probabilistic Method

Prove the existence of an object satisfying the conditions by showing that the probability that a random choice satisfies the conditions is greater than zero.

Applicable scenarios: combinatorics, graph theory, analysis of randomized algorithms.

7. Convexity Arguments

Derive using properties of convex functions or convex sets. Especially common in optimization and machine learning theory.

Applicable scenarios: optimization problems, applications of Jensen's inequality, convex relaxation.

8. Information-theoretic Methods

Derive using information-theoretic tools such as entropy, mutual information, and KL divergence.

Applicable scenarios: communication theory, lower bounds in learning theory, privacy analysis.

Strategy selection decision tree

主張結構分析
├─ 等式或不等式?
│  ├─ 是 → 考慮直接證明、凸性論證
│  └─ 否 → 繼續
├─ 存在性命題?
│  ├─ 是 → 考慮構造性證明、機率法
│  └─ 否 → 繼續
├─ 涉及遞迴或序列?
│  ├─ 是 → 考慮數學歸納法
│  └─ 否 → 繼續
├─ 可歸約為已知問題?
│  ├─ 是 → 考慮歸約法
│  └─ 否 → 繼續
├─ 涉及資訊量度?
│  ├─ 是 → 考慮資訊論方法
│  └─ 否 → 繼續
└─ 直接證明困難?
   ├─ 是 → 考慮反證法
   └─ 否 → 使用直接證明

Composite strategies

Many complex proofs require combining multiple strategies. Common combinations include:

  • Induction + Direct: use a direct proof in the induction step
  • Contradiction + Construction: assume nonexistence, then construct an object that yields a contradiction
  • Reduction + Information theory: reduce to an information-theoretic problem and then use information-theoretic tools

Output format

選擇策略:[主要策略名稱]
輔助策略:[如有]
選擇理由:[為什麼這個策略最適合]
預期證明結構:[大綱]
預期難度:[低|中|高]

Phase 4: Step-by-step derivation

Purpose

Based on the selected strategy, write a complete and rigorous proof process. Every step must have a clear logical basis.

Principles

  1. Completeness: Do not skip any non-obvious steps.
  2. Rigor: Every step of the derivation must have a clear mathematical basis.
  3. Readability: Use clear language to guide the reader.
  4. Modularity: Complex proofs should be split into multiple lemmas.

Writing Guidelines

Derivation Step Format

Each derivation step should include:

  • Statement: The intermediate conclusion to be established in this step
  • Derivation: The specific mathematical derivation process
  • Basis: The cited theorem, lemma, or previous steps

Transitional Phrases

Use appropriate transitional phrases between steps to guide the reader through the logical flow of the proof:

  • "By assumption, ..."
  • "It follows from Theorem X that ..."
  • "Combining (1) and (2), we obtain ..."
  • "Without loss of generality, ..."
  • "By the definition of ..., we have ..."

Common Warnings

  • Avoid using "clearly", "obviously", "trivially" to skip steps.
  • If a step requires more than three lines of derivation, consider extracting it as an independent lemma.
  • Ensure all variables are defined before use.
  • Ensure the scope of quantifiers (for all, there exists) is clear.

Quality Check

  • Does every derivation step have a clear logical basis?
  • Are there any unstated assumptions?
  • Is the use of quantifiers correct?
  • Are the symbols consistent with the rest of the paper?
  • Is the proof complete (ending with QED or $\square$)?

Phase 5: LaTeX Typesetting

Purpose

Convert the proof into LaTeX code that can be directly inserted into the paper. The typesetting should conform to the standard format of academic papers.

Typesetting Guidelines

For detailed LaTeX typesetting patterns, see LaTeX Mathematical Typesetting Reference。

Basic Environments

\begin{theorem}[Theorem Name]
\label{thm:theorem-label}
  Statement of the theorem.
\end{theorem}

\begin{proof}
  Proof content here. \qed
\end{proof}

Numbering and Referencing

  • All theorems, lemmas, and corollaries must have \label。
  • Use \ref or \eqref for cross-referencing.
  • Use equation or align environments for equation numbering.

Typesetting Style

  • Use $...$。
  • Use \[...\] or numbered environments for displayed formulas.
  • Use the align environment for multi-line alignment.
  • Use the cases environment for case discussions.

Output Format

The final output should include:

  1. A complete LaTeX code snippet (ready to copy and paste)
  2. A list of required additional packages (such as amsthm, amsmath , etc.)
  3. If custom commands are needed, include the \newcommand definitions

Quality Check

  • Does the LaTeX code compile successfully?
  • Are the mathematical symbols rendered correctly?
  • Are the numbering and references correct?
  • Is the typesetting aesthetically pleasing (alignment, spacing, etc.)?
  • Does it conform to the formatting requirements of the target journal?

Symbols and Typesetting Reference


Usage Examples

Example 1: Simple Inequality Proof

Input: Prove that for all $x > 0$, we have $e^x \geq 1 + x$.

Stage 1 Output:

主張類型:Proposition
前提條件:
  - x > 0, x ∈ ℝ
結論:e^x ≥ 1 + x
相關符號:e 為自然對數的底

Stage 3 Output:

選擇策略:直接證明
選擇理由:可通過分析 f(x) = e^x - 1 - x 的性質直接推導
預期證明結構:
  1. 定義 f(x) = e^x - 1 - x
  2. 計算 f'(x) = e^x - 1
  3. 分析 f 的單調性
  4. 利用 f(0) = 0 得出結論
預期難度:低

Stage 5 Output:

\begin{proposition}
\label{prop:exp-lower-bound}
  For all $x > 0$, we have $e^x \geq 1 + x$.
\end{proposition}

\begin{proof}
  Define $f(x) = e^x - 1 - x$. We have $f(0) = 0$ and
  $f'(x) = e^x - 1 > 0$ for all $x > 0$. Therefore, $f$ is
  strictly increasing on $(0, \infty)$, which implies
  $f(x) > f(0) = 0$ for all $x > 0$. That is, $e^x > 1 + x$.
  \qed
\end{proof}

Example 2: Generalization Bounds in Machine Learning

Input: Prove the upper bound on sample complexity for finite hypothesis classes under the PAC learning framework.

Stage 1 Output:

主張類型:Theorem
前提條件:
  - H 為有限假設類,|H| < ∞
  - 樣本 S 由分布 D 上的 m 個 i.i.d. 樣本組成
  - ε > 0, δ > 0
結論:若 m ≥ (1/ε)(ln|H| + ln(1/δ)),則以機率至少 1-δ,
      對所有 h ∈ H 有 |R(h) - R̂(h)| ≤ ε
相關符號:R(h) 為真實風險,R̂(h) 為經驗風險

Stage 3 Output:

選擇策略:直接證明 + 機率法
輔助策略:歸約到 Hoeffding's inequality
選擇理由:經典的 union bound + concentration inequality 組合
預期證明結構:
  1. 對單一假設 h 應用 Hoeffding's inequality
  2. 對所有假設取 union bound
  3. 解出 m 的下界
預期難度:中

Common Working Modes

Mode 1: Full Proof Writing

The user provides a claim, and the system executes the complete five-stage process, outputting directly usable LaTeX code.

Mode 2: Proof Repair

The user provides a problematic proof, and the system diagnoses the problem and repairs it. Common problems include:

  • Logical gaps (missing intermediate steps)
  • Quantifier errors
  • Unhandled edge cases
  • Preconditions of cited theorems not satisfied

Mode 3: Proof Translation

Convert informal intuitive arguments into rigorous mathematical proofs.

Mode 4: Strategy Consultation

The user describes the goal to be proved, and the system suggests possible proof strategies and approaches, but does not write a complete proof.


Notes

  1. Rigor First: Better to be verbose than to skip steps. Readers can skip obvious steps, but cannot fill in missing steps.
  2. Notation Consistency: All notation must be consistent with the rest of the paper. If there is a conflict, state it clearly at the beginning of the proof. Refer to Notation Conventions。
  3. Compilability: The output LaTeX must be directly compilable, with no syntax errors.
  4. Academic Tone: Write the mathematical parts in formal academic English, avoiding colloquial expressions.
  5. Citation Standards: All results used that are not proved in this paper must be provided with citations.