Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 70 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,71 @@
.workbuddy/
.codebuddy/
```markdown
# Compiled and build artifacts
*.pyc
__pycache__/
*.o
*.obj
*.so
*.dll
*.exe
*.class
*.out

# Dependencies
.venv/
venv/
node_modules/
dist/
build/
target/
.gradle/
.mypy_cache/
.pytest_cache/

# Logs and temp files
*.log
*.tmp
*.swp
*.swo

# Environment
.env
.env.local
.env.*

# Editors
.vscode/
.idea/

# System files
.DS_Store
Thumbs.db

# Coverage
coverage/
htmlcov/
.coverage

# Compressed files
*.zip
*.gz
*.tar
*.tgz
*.bz2
*.xz
*.7z
*.rar
*.zst
*.lz4
*.lzh
*.cab
*.arj
*.rpm
*.deb
*.Z
*.lz
*.lzo
*.tar.gz
*.tar.bz2
*.tar.xz
*.tar.zst
```
99 changes: 99 additions & 0 deletions modules/error_prevention.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,102 @@ This module defines concrete error prevention rules, common pitfalls, and preven

---

## 9. Complex Analysis Error Prevention

### Rules

1. **Analyticity domain check**: Before applying Cauchy's theorem or residue calculus, verify the function is analytic on and inside the contour except at isolated singularities.
2. **Branch cut handling**: For multi-valued functions ($\log z$, $z^\alpha$, $\sqrt{z}$), explicitly define the branch cut and ensure the contour does not cross it.
3. **Singularity classification**: Correctly classify singularities as removable, pole (with order), or essential before applying residue formulas.
4. **Residue calculation verification**: For a pole of order $n$ at $z_0$: $\text{Res}(f, z_0) = \frac{1}{(n-1)!}\lim_{z\to z_0}\frac{d^{n-1}}{dz^{n-1}}[(z-z_0)^n f(z)]$. Verify the order before differentiating.
5. **Contour orientation**: Standard positive orientation is counterclockwise. Reversing orientation changes the sign of the integral.
6. **Jordan's lemma conditions**: For $\int_{-\infty}^\infty f(x)e^{iax}dx$ with $a > 0$, the semicircular arc contribution vanishes only if $|f(z)| \to 0$ uniformly as $|z| \to \infty$ in the upper half-plane.
7. **Argument principle application**: $\frac{1}{2\pi i}\oint_\gamma \frac{f'(z)}{f(z)}dz = N - P$ where $N$ = zeros, $P$ = poles (counted with multiplicity). Ensure $f$ has no zeros or poles ON the contour.
8. **Conformal mapping boundary correspondence**: When using conformal maps, verify that boundary points map correctly and the orientation is preserved.

### Common Pitfalls with Examples

| Pitfall | Wrong | Correct |
|---|---|---|
| Applying residue theorem across branch cut | Integrating $\log z$ around a circle centered at origin without accounting for branch cut | Define branch cut (e.g., negative real axis) and use keyhole contour |
| Miscounting pole order | $\frac{1}{(z-1)^2(z+1)}$ has a simple pole at $z=1$ | Pole at $z=1$ is order 2; pole at $z=-1$ is order 1 |
| Forgetting $2\pi i$ factor | $\oint \frac{dz}{z} = 1$ around unit circle | $\oint \frac{dz}{z} = 2\pi i$ |
| Wrong residue for essential singularity | Using pole formula for $e^{1/z}$ at $z=0$ | Use Laurent series: $\text{Res}(e^{1/z}, 0) = 1$ (coefficient of $1/z$) |

### Prevention Strategy

1. **Draw the contour and mark all singularities** before computing
2. **Identify branch cuts explicitly** for multi-valued functions
3. **Classify each singularity** before choosing a residue calculation method
4. **Check contour orientation** and apply sign accordingly
5. **Verify decay conditions** for infinite contours (Jordan's lemma, estimation lemma)

---

## 10. Topology Error Prevention

### Rules

1. **Open set definition dependence**: "Open" is relative to the topology. Always specify which topology is being used (standard, discrete, indiscrete, subspace, quotient, etc.).
2. **Continuity definition**: $f: X \to Y$ is continuous iff $f^{-1}(U)$ is open in $X$ for every open $U \subseteq Y$. Do NOT assume "$f$ maps open sets to open sets" (that's an open map, a different concept).
3. **Compactness vs closed+bounded**: In $\mathbb{R}^n$, compact $\iff$ closed and bounded (Heine-Borel). In general metric/topological spaces, this equivalence FAILS.
4. **Connectedness verification**: A space is connected if it cannot be written as a union of two disjoint non-empty open sets. Path-connected $\implies$ connected, but the converse fails (e.g., topologist's sine curve).
5. **Hausdorff property**: A space is Hausdorff if any two distinct points have disjoint neighborhoods. $\mathbb{R}^n$ is Hausdorff, but quotient spaces may not be.
6. **Homeomorphism requirements**: A homeomorphism must be bijective, continuous, AND have a continuous inverse. Bijective + continuous is NOT sufficient.
7. **Subspace topology**: For $A \subseteq X$, open sets in $A$ are intersections $U \cap A$ where $U$ is open in $X$. Do not assume $A$ inherits properties like compactness or connectedness without verification.
8. **Product topology basis**: Open sets in $\prod X_i$ are unions of products $\prod U_i$ where each $U_i$ is open in $X_i$ and $U_i = X_i$ for all but finitely many $i$ (for infinite products).

### Common Pitfalls with Examples

| Pitfall | Wrong | Correct |
|---|---|---|
| Assuming closed+bounded $\implies$ compact | "The set $(0,1)$ is bounded, so it's compact" | $(0,1)$ is NOT compact (not closed); $[0,1]$ IS compact in $\mathbb{R}$ |
| Confusing continuity with open mapping | "$f(x)=x^2$ is continuous, so it maps open sets to open sets" | $f((-1,1)) = [0,1)$ which is NOT open |
| Assuming connected components are open | "Connected components are always open" | Only true in locally connected spaces; false in general |
| Quotient space Hausdorff assumption | "The quotient of a Hausdorff space is Hausdorff" | Generally false; requires additional conditions |

### Prevention Strategy

1. **State the topology explicitly** at the start of any topological argument
2. **Use the correct definition of continuity** (preimage of open is open)
3. **Distinguish between properties that hold in $\mathbb{R}^n$ vs general spaces**
4. **Construct standard counterexamples** (topologist's sine curve, line with two origins, etc.) to test intuition
5. **Verify all homeomorphism conditions**, especially continuity of the inverse

---

## 11. Number Theory Error Prevention

### Rules

1. **Divisibility definition**: $a \mid b$ means $\exists k \in \mathbb{Z}$ such that $b = ak$. Note that $0 \mid 0$ is true (since $0 = k \cdot 0$ for any $k$), but $0 \mid b$ for $b \neq 0$ is false.
2. **Modular arithmetic domain**: Congruences $a \equiv b \pmod{n}$ are defined for integers. Extending to rationals or reals requires careful interpretation.
3. **Prime factorization uniqueness**: The Fundamental Theorem of Arithmetic applies to $\mathbb{Z}^+$ (positive integers). In other rings (e.g., $\mathbb{Z}[\sqrt{-5}]$), unique factorization may fail.
4. **Fermat's Little Theorem conditions**: $a^p \equiv a \pmod{p}$ for prime $p$ and any integer $a$. The form $a^{p-1} \equiv 1 \pmod{p}$ requires $\gcd(a,p) = 1$.
5. **Euler's totient function**: $\phi(n)$ counts integers in $\{1, 2, \ldots, n\}$ coprime to $n$. For $n = p_1^{e_1} \cdots p_k^{e_k}$: $\phi(n) = n \prod_{i=1}^k (1 - \frac{1}{p_i})$.
6. **Chinese Remainder Theorem**: The system $x \equiv a_i \pmod{n_i}$ has a unique solution mod $\text{lcm}(n_1, \ldots, n_k)$ if the moduli are pairwise coprime. Without coprimality, solutions may not exist or may not be unique.
7. **Quadratic reciprocity**: For odd primes $p, q$: $\left(\frac{p}{q}\right)\left(\frac{q}{p}\right) = (-1)^{\frac{p-1}{2} \cdot \frac{q-1}{2}}$. Check that both primes are odd before applying.
8. **Infinite descent validity**: Proof by infinite descent requires showing that assuming a solution exists leads to a smaller positive integer solution, contradicting well-ordering of $\mathbb{N}$.

### Common Pitfalls with Examples

| Pitfall | Wrong | Correct |
|---|---|---|
| Applying FLT without coprimality | "$2^4 \equiv 1 \pmod{4}$" (using $a^{p-1} \equiv 1$ with $p=2$) | FLT in form $a^{p-1} \equiv 1$ requires $\gcd(a,p)=1$; here $\gcd(2,4) \neq 1$ |
| Assuming unique factorization in all rings | "$6 = 2 \cdot 3 = (1+\sqrt{-5})(1-\sqrt{-5})$ shows non-uniqueness in $\mathbb{Z}$" | Non-uniqueness occurs in $\mathbb{Z}[\sqrt{-5}]$, NOT in $\mathbb{Z}$ |
| CRT without checking coprimality | Solving $x \equiv 1 \pmod{4}$, $x \equiv 2 \pmod{6}$ assuming unique solution mod 24 | $\gcd(4,6) = 2 \neq 1$; check consistency first ($1 \not\equiv 2 \pmod{2}$), no solution exists |
| Quadratic reciprocity for $p=2$ | Applying reciprocity formula with $p=2$ | Handle $p=2$ separately: $\left(\frac{2}{q}\right) = (-1)^{\frac{q^2-1}{8}}$ |

### Prevention Strategy

1. **Verify primality** before applying prime-specific theorems
2. **Check gcd conditions** for modular arithmetic results
3. **Specify the ring** when discussing factorization
4. **Test small cases** numerically before generalizing
5. **Use the extended Euclidean algorithm** to verify Bezout coefficients

---

## Cross-Domain Prevention Checklist

Before finalizing any mathematical answer, run through this summary checklist:
Expand All @@ -297,3 +393,6 @@ Before finalizing any mathematical answer, run through this summary checklist:
- [ ] **Calculus**: L'Hôpital conditions checked, $+C$ added, convergence verified, limits checked
- [ ] **Linear Algebra**: Dimensions matched, eigenvalues verified by substitution, determinants double-checked
- [ ] **Abstract Math**: Definitions complete, quantifier order correct, constructions well-defined, all equivalence properties checked
- [ ] **Complex Analysis**: Analyticity verified, branch cuts handled, singularities classified, contour orientation correct
- [ ] **Topology**: Topology specified, continuity definition correct, compactness/connectedness properly verified
- [ ] **Number Theory**: Primality verified, gcd conditions checked, ring specified for factorization
136 changes: 135 additions & 1 deletion modules/output_templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,139 @@ n-1, n, n+1 是三个连续整数,因此:

---

## 模板 G:研究级问题深度分析 (Research-Level Deep Analysis)

### 何时使用
- 用户明确提出研究级别的数学问题
- 问题涉及多个数学分支的交叉
- 需要展示深入的理论分析和多种可能的解决路径
- 用户具备研究生或以上数学背景

### 标准结构

```markdown
## 问题分类与定位
[问题所属的数学领域,与已知问题的关联]

## 核心难点分析
[问题的本质困难在哪里,为何标准方法失效]

## 相关理论框架
[可能需要用到的深层理论和工具]

## 已知结果综述
[与该问题最接近的已知定理和结论]

## 尝试路径一:[方法名称]
[第一种解决思路的详细推导]
### 进展
[该方法能走多远]
### 障碍
[遇到的具体困难]

## 尝试路径二:[方法名称]
[第二种解决思路的详细推导]
### 进展
### 障碍

## 尝试路径三:[方法名称]
[第三种解决思路的详细推导]
### 进展
### 障碍

## 部分结果与引理
[可以严格证明的中间结果]

## 数值/符号计算验证
[计算机辅助验证的结果]

## 可能的突破方向
[基于上述分析,最有希望的研究方向]

## 开放性结论
[诚实说明当前分析的局限性]
```

### 完整示例

```markdown
## 问题分类与定位
**领域**: 解析数论 × 代数几何
**问题类型**: L-函数零点分布与算术对象的关联
**关联猜想**:广义 Riemann 假设,Birch and Swinnerton-Dyer 猜想

## 核心难点分析
1. **解析延拓的存在性**: 该 L-函数的解析延拓尚未被证明
2. **函数方程未知**: 缺乏函数方程使得零点分布分析极为困难
3. **算术信息编码**: L-函数系数与椭圆曲线秩的关系不明确

## 相关理论框架
- **模形式理论**: 若该 L-函数来自模形式,可利用 modularity theorem
- **Iwasawa 理论**: 研究 p-进 L-函数的性质
- **Trace formula**: Arthur-Selberg trace formula 可能提供谱信息

## 已知结果综述
- **最接近的定理**: Wiles (1995) 证明了半稳定椭圆曲线的模性
- **部分结果**: Kolyvagin (1988) 对秩为 0 或 1 的情况证明了 BSD 猜想
- **数值证据**: Cremona 数据库验证了 conductor < 500000 的情况

## 尝试路径一:模性提升
通过已知的模性提升定理,尝试将该椭圆曲线与模形式关联。

### 进展
对于 good reduction 的素数 p,可以计算局部因子...

### 障碍
在 p = 2, 3 处的 bad reduction 类型不明,无法应用现有的提升定理。

## 尝试路径二:p-进方法
构造 p-进 L-函数并研究其零点。

### 进展
利用 Klingen-Stackelberg 构造可以得到 p-进插值公式...

### 障碍
p-进 L-函数的非平凡零点与原 L-函数的对应关系未明。

## 尝试路径三:平均结果
考虑一族类似的 L-函数,研究统计性质。

### 进展
可以证明平均意义下的零点密度估计...

### 障碍
平均结果无法推出单个 L-函数的性质。

## 部分结果与引理
**引理 1**: 在 Re(s) > 3/2 区域,该 L-函数绝对收敛。
**引理 2**: 若存在函数方程,则临界线为 Re(s) = 1。
**命题**: 对于 90% 的素数 p,局部因子满足预期界限。

## 数值/符号计算验证
使用 SageMath 计算前 1000 个 Dirichlet 系数:
- 系数增长符合 Ramanujan-Petersson 猜想
- 前 100 个非平凡零点均位于临界线上(精度 10⁻¹⁰)

## 可能的突破方向
1. **确定 bad reduction 类型**: 计算 discriminant 和 conductor
2. **寻找函数方程**: 通过数值拟合猜测函数方程形式
3. **应用 converse theorem**: 验证足够的 analytic properties 以推出模性

## 开放性结论
**当前状态**: 该问题的完整解决超出已知数学工具的范围。
上述分析展示了多种可能的研究路径,但每条路径都存在实质性障碍。
建议将此问题分解为若干可处理的子问题逐个击破。
```

### 特殊注意事项
- 必须明确区分"已证明"、"推测"、"数值证据"三种断言强度
- 引用的定理必须准确陈述条件,不可模糊处理
- 对于开放问题,不提供虚假的"解答"
- 建议的研究方向应具体且可行
- 如涉及计算,应说明所用工具和精度

---

## 模板选择决策树

```
Expand All @@ -456,7 +589,8 @@ n-1, n, n+1 是三个连续整数,因此:
│ ├─ "只要答案" → 模板 B:仅答案
│ ├─ "帮我看看对不对" → 模板 D:解答检查
│ ├─ "证明……" → 模板 C:证明
│ ├─ 已知开放问题 / 研究级 → 模板 F:研究/开放
│ ├─ 已知开放问题 / 一般研究级 → 模板 F:研究/开放
│ ├─ 深度研究级问题(多分支交叉) → 模板 G:研究级深度分析
│ ├─ 高等数学领域 → 模板 E:高等数学
│ └─ 其他情况 → 模板 A:标准解答(默认)
```
Expand Down
20 changes: 20 additions & 0 deletions modules/verification_engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ This document defines all 11 verification methods (A through K), including:

The following table maps problem classifications to recommended verification methods. The first listed method is the primary; the second is the fallback or complement. At least two must be applied; three or more increase confidence for difficult or high-stakes problems.

**Method Numbering Note**: Methods are labeled A through K (11 total). The letters are mnemonic: A=Back-substitution, B=Boundary/Domain, C=Continuity/Boundary, D=Derivation(reverse), E=Estimation(numerical), F=Dimension(Formula), G=Special cases/limits, H=Independent method, I=Counterexample, J=Logic(formal), K=Consistency(computational).

| Problem Classification | Primary Method | Secondary Method | Tertiary Method |
|---|---|---|---|
| `calculation` | E (Numerical) | A (Back-substitution) | — |
Expand Down Expand Up @@ -50,6 +52,24 @@ The following table maps problem classifications to recommended verification met
| `problem_generation` | A (Back-substitution) | E (Numerical) | H (Independent method) |
| `research_level_problem` | All applicable | All applicable | All applicable |

### Method Applicability Matrix

To avoid overlap and clarify when each method should be used:

| Method | Best For | Not Suitable For | Unique Strength |
|---|---|---|---|
| A (Back-substitution) | Equations, systems, explicit solutions | Proofs, existence claims | Directly verifies solution satisfies original conditions |
| B (Domain check) | ALL problems (universal pre-check) | None — always applicable | Catches extraneous solutions from non-reversible steps |
| C (Boundary check) | Inequalities, optimization, intervals | Discrete problems without natural boundaries | Tests edge behavior where errors often hide |
| D (Reverse derivation) | Proofs, derivations, integration | Numerical answers without derivation chain | Validates logical flow reversibility |
| E (Numerical sampling) | Quantitative problems, identities | Pure existence proofs, symbolic manipulation only | Quick sanity check with concrete values |
| F (Dimensional analysis) | Physics problems, formulas with units | Pure mathematics without physical interpretation | Structural validation of formula form |
| G (Limits/special cases) | Functions, sequences, series, calculus | Finite combinatorics without parameters | Reveals asymptotic and degenerate behavior |
| H (Independent method) | Problems with multiple solution approaches | Problems with only one known method | Strongest confidence via independent derivation |
| I (Counterexample) | Universal claims, conjectures, "true/false" | Constructive existence proofs | Definitively disproves false claims |
| J (Formal logic) | Proofs, abstract math, quantified statements | Computational problems | Catches reasoning errors that survive algebraic checks |
| K (Computational consistency) | Matrix operations, statistics, multi-step computation | Simple single-step calculations | Uses invariants to catch propagation errors |

---

## Method A: Back-Substitution
Expand Down