math-skill 2.0.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/README.en-US.md +167 -175
  2. package/README.md +167 -175
  3. package/agents/math-critic.en.md +235 -0
  4. package/agents/math-critic.md +10 -8
  5. package/commands/ask.md +3 -12
  6. package/design-patterns/attention/equivariant-attention.en.md +72 -0
  7. package/design-patterns/attention/equivariant-attention.md +72 -0
  8. package/design-patterns/attention/geometry-aware-attention.en.md +73 -0
  9. package/design-patterns/attention/geometry-aware-attention.md +72 -0
  10. package/design-patterns/attention/information-bottleneck-attention.en.md +72 -0
  11. package/design-patterns/attention/information-bottleneck-attention.md +72 -0
  12. package/design-patterns/attention/projection-attention.en.md +68 -0
  13. package/design-patterns/attention/projection-attention.md +68 -0
  14. package/design-patterns/attention/spectral-attention.en.md +71 -0
  15. package/design-patterns/attention/spectral-attention.md +71 -0
  16. package/design-patterns/compression/leverage-score-selection.en.md +71 -0
  17. package/design-patterns/compression/leverage-score-selection.md +71 -0
  18. package/design-patterns/compression/low-rank-kv-cache.en.md +60 -0
  19. package/design-patterns/compression/low-rank-kv-cache.md +60 -0
  20. package/design-patterns/compression/spectral-token-pruning.en.md +61 -0
  21. package/design-patterns/compression/spectral-token-pruning.md +61 -0
  22. package/design-patterns/compression/topology-preserving-compression.en.md +64 -0
  23. package/design-patterns/compression/topology-preserving-compression.md +64 -0
  24. package/design-patterns/loss/constraint-penalty.en.md +67 -0
  25. package/design-patterns/loss/constraint-penalty.md +78 -0
  26. package/design-patterns/loss/contrastive-loss.en.md +59 -0
  27. package/design-patterns/loss/contrastive-loss.md +68 -0
  28. package/design-patterns/loss/information-bottleneck-loss.en.md +69 -0
  29. package/design-patterns/loss/information-bottleneck-loss.md +74 -0
  30. package/design-patterns/loss/orthogonality-loss.en.md +56 -0
  31. package/design-patterns/loss/orthogonality-loss.md +60 -0
  32. package/design-patterns/loss/variational-loss.en.md +61 -0
  33. package/design-patterns/loss/variational-loss.md +71 -0
  34. package/design-patterns/representation/equivariant-split.en.md +87 -0
  35. package/design-patterns/representation/equivariant-split.md +89 -0
  36. package/design-patterns/representation/manifold-representation.en.md +85 -0
  37. package/design-patterns/representation/manifold-representation.md +87 -0
  38. package/design-patterns/representation/shared-private-decomposition.en.md +84 -0
  39. package/design-patterns/representation/shared-private-decomposition.md +86 -0
  40. package/design-patterns/representation/subspace-alignment.en.md +90 -0
  41. package/design-patterns/representation/subspace-alignment.md +92 -0
  42. package/design-patterns/routing/graph-routing.en.md +79 -0
  43. package/design-patterns/routing/graph-routing.md +81 -0
  44. package/design-patterns/routing/moe-routing.en.md +85 -0
  45. package/design-patterns/routing/moe-routing.md +87 -0
  46. package/design-patterns/routing/optimal-transport-routing.en.md +68 -0
  47. package/design-patterns/routing/optimal-transport-routing.md +72 -0
  48. package/design-patterns/routing/spectral-clustering-routing.en.md +88 -0
  49. package/design-patterns/routing/spectral-clustering-routing.md +90 -0
  50. package/knowledge-base/differential-geometry/connection.en.md +51 -0
  51. package/knowledge-base/differential-geometry/connection.md +51 -0
  52. package/knowledge-base/differential-geometry/curvature.en.md +49 -0
  53. package/knowledge-base/differential-geometry/curvature.md +49 -0
  54. package/knowledge-base/differential-geometry/geodesic.en.md +51 -0
  55. package/knowledge-base/differential-geometry/geodesic.md +51 -0
  56. package/knowledge-base/differential-geometry/manifold.en.md +47 -0
  57. package/knowledge-base/differential-geometry/manifold.md +47 -0
  58. package/knowledge-base/differential-geometry/metric-tensor.en.md +50 -0
  59. package/knowledge-base/differential-geometry/metric-tensor.md +50 -0
  60. package/knowledge-base/differential-geometry/tangent-space.en.md +48 -0
  61. package/knowledge-base/differential-geometry/tangent-space.md +48 -0
  62. package/knowledge-base/information-geometry/fisher-metric.en.md +56 -0
  63. package/knowledge-base/information-geometry/fisher-metric.md +56 -0
  64. package/knowledge-base/information-geometry/natural-gradient.en.md +54 -0
  65. package/knowledge-base/information-geometry/natural-gradient.md +54 -0
  66. package/knowledge-base/lie-theory/equivariance.en.md +54 -0
  67. package/knowledge-base/lie-theory/equivariance.md +54 -0
  68. package/knowledge-base/lie-theory/group-action.en.md +51 -0
  69. package/knowledge-base/lie-theory/group-action.md +51 -0
  70. package/knowledge-base/lie-theory/lie-algebra.en.md +51 -0
  71. package/knowledge-base/lie-theory/lie-algebra.md +51 -0
  72. package/knowledge-base/lie-theory/lie-group.en.md +51 -0
  73. package/knowledge-base/lie-theory/lie-group.md +51 -0
  74. package/knowledge-base/lie-theory/representation.en.md +52 -0
  75. package/knowledge-base/lie-theory/representation.md +52 -0
  76. package/knowledge-base/matrix-analysis/low-rank-approximation.en.md +49 -0
  77. package/knowledge-base/matrix-analysis/low-rank-approximation.md +49 -0
  78. package/knowledge-base/matrix-analysis/matrix-perturbation.en.md +49 -0
  79. package/knowledge-base/matrix-analysis/matrix-perturbation.md +49 -0
  80. package/knowledge-base/matrix-analysis/positive-semidefinite.en.md +50 -0
  81. package/knowledge-base/matrix-analysis/positive-semidefinite.md +50 -0
  82. package/knowledge-base/matrix-analysis/projection.en.md +47 -0
  83. package/knowledge-base/matrix-analysis/projection.md +47 -0
  84. package/knowledge-base/matrix-analysis/spectral-decomposition.en.md +48 -0
  85. package/knowledge-base/matrix-analysis/spectral-decomposition.md +48 -0
  86. package/knowledge-base/optimization/constrained-optimization.en.md +53 -0
  87. package/knowledge-base/optimization/constrained-optimization.md +53 -0
  88. package/knowledge-base/optimization/convex-optimization.en.md +50 -0
  89. package/knowledge-base/optimization/convex-optimization.md +50 -0
  90. package/knowledge-base/optimization/lagrangian-duality.en.md +50 -0
  91. package/knowledge-base/optimization/lagrangian-duality.md +50 -0
  92. package/knowledge-base/optimization/proximal-method.en.md +52 -0
  93. package/knowledge-base/optimization/proximal-method.md +52 -0
  94. package/knowledge-base/optimization/riemannian-optimization.en.md +51 -0
  95. package/knowledge-base/optimization/riemannian-optimization.md +51 -0
  96. package/knowledge-base/overview.en.md +39 -0
  97. package/knowledge-base/overview.md +29 -218
  98. package/knowledge-base/probability/concentration-inequality.en.md +45 -0
  99. package/knowledge-base/probability/concentration-inequality.md +45 -0
  100. package/knowledge-base/probability/entropy.en.md +47 -0
  101. package/knowledge-base/probability/entropy.md +47 -0
  102. package/knowledge-base/probability/fisher-information.en.md +48 -0
  103. package/knowledge-base/probability/fisher-information.md +48 -0
  104. package/knowledge-base/probability/information-bottleneck.en.md +49 -0
  105. package/knowledge-base/probability/information-bottleneck.md +49 -0
  106. package/knowledge-base/probability/kl-divergence.en.md +51 -0
  107. package/knowledge-base/probability/kl-divergence.md +51 -0
  108. package/knowledge-base/topology/euler-characteristic.en.md +54 -0
  109. package/knowledge-base/topology/euler-characteristic.md +54 -0
  110. package/knowledge-base/topology/fundamental-group.en.md +52 -0
  111. package/knowledge-base/topology/fundamental-group.md +52 -0
  112. package/knowledge-base/topology/persistent-homology.en.md +54 -0
  113. package/knowledge-base/topology/persistent-homology.md +54 -0
  114. package/lenses/algorithmic.en.md +49 -0
  115. package/lenses/algorithmic.md +49 -0
  116. package/lenses/axiomatization.en.md +48 -0
  117. package/lenses/axiomatization.md +48 -0
  118. package/lenses/categorical.en.md +48 -0
  119. package/lenses/categorical.md +48 -0
  120. package/lenses/causal.en.md +49 -0
  121. package/lenses/causal.md +49 -0
  122. package/lenses/duality.en.md +47 -0
  123. package/lenses/duality.md +47 -0
  124. package/lenses/game.en.md +50 -0
  125. package/lenses/game.md +50 -0
  126. package/lenses/geometric.en.md +53 -0
  127. package/lenses/geometric.md +53 -0
  128. package/lenses/local-to-global.en.md +52 -0
  129. package/lenses/local-to-global.md +52 -0
  130. package/lenses/perturbation.en.md +51 -0
  131. package/lenses/perturbation.md +51 -0
  132. package/lenses/probabilistic.en.md +48 -0
  133. package/lenses/probabilistic.md +48 -0
  134. package/lenses/projection.en.md +50 -0
  135. package/lenses/projection.md +50 -0
  136. package/lenses/spectral.en.md +52 -0
  137. package/lenses/spectral.md +52 -0
  138. package/lenses/symmetry.en.md +49 -0
  139. package/lenses/symmetry.md +49 -0
  140. package/lenses/topological.en.md +48 -0
  141. package/lenses/topological.md +48 -0
  142. package/lenses/variational.en.md +48 -0
  143. package/lenses/variational.md +48 -0
  144. package/package.json +11 -3
  145. package/references/agentic-workflow.en.md +53 -0
  146. package/references/agentic-workflow.md +2 -0
  147. package/references/books/abstract-algebra.md +9 -5
  148. package/references/books/algebraic-geometry-rising-sea.md +9 -5
  149. package/references/books/differential-geometry.md +7 -3
  150. package/references/books/matrix-analysis.md +8 -4
  151. package/references/books/micro-lie-theory.md +7 -3
  152. package/references/books/optimization-ml.md +5 -1
  153. package/references/books/smooth-manifolds.md +7 -3
  154. package/references/gpu-friendly-math.en.md +65 -0
  155. package/references/gpu-friendly-math.md +4 -2
  156. package/references/inspiration.en.md +113 -0
  157. package/references/inspiration.md +4 -2
  158. package/skills/math-research-activator/SKILL.en.md +187 -0
  159. package/skills/math-research-activator/SKILL.md +162 -108
  160. package/skills/math-research-activator/original-texts.en.md +105 -0
  161. package/skills/math-research-activator/original-texts.md +11 -11
  162. package/commands/abstraction.md +0 -13
  163. package/commands/algorithmic-thinking.md +0 -13
  164. package/commands/axiomatization.md +0 -13
  165. package/commands/causal-inference.md +0 -13
  166. package/commands/discrete-combinatorial.md +0 -13
  167. package/commands/game-theory.md +0 -13
  168. package/commands/induction-analogy.md +0 -13
  169. package/commands/information-theory.md +0 -13
  170. package/commands/logic-deduction.md +0 -13
  171. package/commands/modeling.md +0 -13
  172. package/commands/optimization.md +0 -13
  173. package/commands/probability-statistics.md +0 -13
  174. package/commands/symmetry-invariance.md +0 -13
  175. package/commands/topological-thinking.md +0 -13
  176. package/commands/transformation.md +0 -13
  177. package/skills/abstraction/SKILL.md +0 -119
  178. package/skills/abstraction/original-texts.md +0 -175
  179. package/skills/algorithmic-thinking/SKILL.md +0 -136
  180. package/skills/algorithmic-thinking/original-texts.md +0 -256
  181. package/skills/axiomatization/SKILL.md +0 -149
  182. package/skills/axiomatization/original-texts.md +0 -160
  183. package/skills/causal-inference/SKILL.md +0 -149
  184. package/skills/causal-inference/original-texts.md +0 -167
  185. package/skills/discrete-combinatorial/SKILL.md +0 -129
  186. package/skills/discrete-combinatorial/original-texts.md +0 -185
  187. package/skills/game-theory/SKILL.md +0 -121
  188. package/skills/game-theory/original-texts.md +0 -131
  189. package/skills/induction-analogy/SKILL.md +0 -150
  190. package/skills/induction-analogy/original-texts.md +0 -154
  191. package/skills/information-theory/SKILL.md +0 -138
  192. package/skills/information-theory/original-texts.md +0 -127
  193. package/skills/logic-deduction/SKILL.md +0 -133
  194. package/skills/logic-deduction/original-texts.md +0 -173
  195. package/skills/modeling/SKILL.md +0 -137
  196. package/skills/modeling/original-texts.md +0 -165
  197. package/skills/optimization/SKILL.md +0 -133
  198. package/skills/optimization/original-texts.md +0 -168
  199. package/skills/probability-statistics/SKILL.md +0 -149
  200. package/skills/probability-statistics/original-texts.md +0 -193
  201. package/skills/symmetry-invariance/SKILL.md +0 -137
  202. package/skills/symmetry-invariance/original-texts.md +0 -221
  203. package/skills/topological-thinking/SKILL.md +0 -126
  204. package/skills/topological-thinking/original-texts.md +0 -164
  205. package/skills/transformation/SKILL.md +0 -122
  206. package/skills/transformation/original-texts.md +0 -216
@@ -1,256 +0,0 @@
1
- # 算法思维 — 原始文献与历史语境 / Algorithmic Thinking — Original Texts & Historical Context
2
-
3
- ---
4
-
5
- ## 1. Turing Machine (1936) / 图灵机 (1936)
6
-
7
- Alan Turing 的论文 **"On Computable Numbers, with an Application to the Entscheidungsproblem"** (1936) 定义了"可计算性"的精确数学模型——图灵机 (Turing machine)。
8
-
9
- > "The 'computable' numbers may be described briefly as the real numbers whose expressions as a decimal are calculable by finite means."
10
- > — Alan Turing, 1936
11
-
12
- **核心定义 / Core definition:**
13
- - 图灵机 $M = (Q, \Sigma, \Gamma, \delta, q_0, q_{\text{accept}}, q_{\text{reject}})$,其中 $\delta: Q \times \Gamma \to Q \times \Gamma \times \{L, R\}$ 为转移函数。
14
- - 通用图灵机 (universal Turing machine): 可模拟任意图灵机 $M$ 在输入 $w$ 上的执行,即 $U(\langle M \rangle, w) = M(w)$。
15
-
16
- **停机问题 / Halting problem:**
17
- - 停机问题 $H = \{\langle M, w \rangle : M \text{ halts on } w\}$ 是不可判定的 (undecidable)。
18
- - 证明:假设 $H$ 可判定,则构造 $D(\langle M \rangle) = \text{run } H(\langle M, \langle M \rangle \rangle)$;若 $M$ 在 $\langle M \rangle$ 上停机则 $D$ 永不停机,反之 $D$ 停机。令 $D(\langle D \rangle)$ 产生矛盾。
19
-
20
- **Entscheidungsproblem (判定问题):**
21
- - Hilbert 1928 年提出:是否存在算法判定一阶逻辑语句的有效性?
22
- - Turing 与 Church 分别独立证明:不存在。一阶逻辑的有效性是不可判定的。
23
-
24
- ---
25
-
26
- ## 2. Church-Turing Thesis / Church-Turing 论题
27
-
28
- **论题 (thesis, not theorem):**
29
- > 任何"可有效计算"的函数都是图灵可计算的。
30
- > Every "effectively calculable" function is Turing-computable.
31
-
32
- **等价表述 / Equivalent formulations:**
33
- - Church: $\lambda$-可定义函数 (lambda calculus, 1936)
34
- - Gödel–Herbrand–Kleene: 一般递归函数 (general recursive functions)
35
- - Post: Post 系统 (Post canonical systems)
36
- - 以上模型计算的函数集完全相同,佐证论题的合理性。
37
-
38
- **强 Church-Turing 论题 / Strong Church-Turing thesis:**
39
- - 任何可在物理设备上于时间 $T$ 内求解的问题,均可在图灵机上于时间 $O(T^k)$($k$ 为常数)内求解。
40
- - 即:所有合理的计算模型在多项式时间内等价。
41
- - 量子计算对此提出挑战——是否存在 $k > 1$ 的多项式加速?
42
-
43
- ---
44
-
45
- ## 3. Euclid's Algorithm (~300 BC) / 欧几里得算法 (约公元前300年)
46
-
47
- **最古老且仍在使用的算法 / The oldest algorithm still in use.**
48
-
49
- **GCD 计算 / GCD computation:**
50
- $$\gcd(a, b) = \gcd(b, a \bmod b), \quad a \bmod b \neq 0$$
51
- $$\gcd(a, 0) = a$$
52
-
53
- **终止性证明 / Termination proof:**
54
- - 每一步 $b' = a \bmod b < b$,故序列 $b_0 > b_1 > b_2 > \cdots \geq 0$ 严格递减。
55
- - 有限步内必有 $b_k = 0$,算法终止。
56
-
57
- **扩展欧几里得算法 / Extended Euclidean algorithm:**
58
- - 计算 $\gcd(a, b)$ 同时求出 $x, y$ 使得 $ax + by = \gcd(a, b)$。
59
- - 应用:模逆元 $a^{-1} \bmod m$——当 $\gcd(a, m) = 1$ 时,$ax \equiv 1 \pmod{m}$,$x = a^{-1}$。
60
-
61
- **时间复杂度:**
62
- - Lamé 定理 (1844): 欧几里得算法的步数 $\leq 5 \times$ 较小数的十进制位数,即 $O(\log \min(a, b))$。
63
-
64
- ---
65
-
66
- ## 4. Knuth — The Art of Computer Programming (1968–) / Knuth — 计算机程序设计艺术 (1968–)
67
-
68
- Donald Knuth 的多卷巨著 **TAOCP** 系统化了算法分析学科。
69
-
70
- > "The process of preparing programs for a digital computer is especially attractive, not only because it can be economically and scientifically rewarding, but also because it can be an aesthetic experience much like composing poetry or music."
71
- > — Donald Knuth, TAOCP Vol. 1, Preface
72
-
73
- **贡献 / Contributions:**
74
- - 将 big-O 记号从数论引入计算机科学并普及。$O(f(n))$: 存在常数 $c, n_0$ 使得 $T(n) \leq c \cdot f(n)$ 对所有 $n \geq n_0$。
75
- - 系统化的算法分类体系 (sorting, searching, arithmetic, combinatorial 等)。
76
- - MMIX / MIX 混合伪机器用于算法分析的精确模型。
77
- - 卷目: Vol. 1 (Fundamental Algorithms, 1968), Vol. 2 (Seminumerical Algorithms, 1969), Vol. 3 (Sorting and Searching, 1973), Vol. 4A (Combinatorial Algorithms, 2011).
78
-
79
- ---
80
-
81
- ## 5. Cook-Levin Theorem (1971) / Cook-Levin 定理 (1971)
82
-
83
- **NP-完全性 / NP-completeness:**
84
-
85
- > "The question 'is P = NP?' is one of the most important open questions in theoretical computer science."
86
- > — Stephen Cook, 1971
87
-
88
- **Cook-Levin 定理:**
89
- - SAT (布尔可满足性问题) 是 NP-完全的 (NP-complete)。
90
- - 证明:任意 NP 语言 $L$ 的非确定图灵机 $M$ 在 $w$ 上的接受计算可编码为 SAT 公式 $\varphi_{M,w}$;$w \in L \iff \varphi_{M,w}$ 可满足。
91
- - 规约: $L \leq_p \text{SAT}$ 对所有 $L \in \text{NP}$ 成立。
92
-
93
- **Karp 的 21 个 NP-完全问题 (1972):**
94
- - Richard Karp 在 "Reducibility among Combinatorial Problems" 中证明 21 个经典问题均为 NP-完全,包括:
95
- - 3SAT, CLIQUE, VERTEX-COVER, HAM-CYCLE, TSP, SUBSET-SUM, PARTITION 等。
96
-
97
- **P vs NP:**
98
- - $\text{P} = \text{NP}$?若成立,则所有 NP 问题均有多项式时间算法。普遍猜测 $\text{P} \neq \text{NP}$。Clay 数学研究所千禧年大奖问题之一。
99
-
100
- ---
101
-
102
- ## 6. Divide-and-Conquer / 分治法
103
-
104
- **思想 / Key idea:** 将问题分解为若干子问题,递归求解,合并结果。
105
-
106
- **经典算法 / Canonical examples:**
107
- - **合并排序 (Merge sort):** $T(n) = 2T(n/2) + O(n) \Rightarrow T(n) = O(n \log n)$。稳定排序。
108
- - **快速排序 (Quicksort):** 平均 $O(n \log n)$,最坏 $O(n^2)$。Hoare (1962)。
109
- - **二分查找 (Binary search):** $T(n) = T(n/2) + O(1) \Rightarrow T(n) = O(\log n)$。有序数组前提。
110
-
111
- **主定理 / Master theorem:**
112
- $$T(n) = a\,T(n/b) + f(n)$$
113
- - 情形1: 若 $f(n) = O(n^{\log_b a - \varepsilon})$,则 $T(n) = \Theta(n^{\log_b a})$。
114
- - 情形2: 若 $f(n) = \Theta(n^{\log_b a} \log^k n)$,则 $T(n) = \Theta(n^{\log_b a} \log^{k+1} n)$。
115
- - 情形3: 若 $f(n) = \Omega(n^{\log_b a + \varepsilon})$ 且 $af(n/b) \leq cf(n)$,则 $T(n) = \Theta(f(n))$。
116
-
117
- ---
118
-
119
- ## 7. Dynamic Programming / 动态规划
120
-
121
- > "I decided to use the word 'dynamic' … it was something not even a Congressman could object to."
122
- > — Richard Bellman, on naming "dynamic programming" (1957)
123
-
124
- **核心要素 / Core principles:**
125
- 1. **最优子结构 (optimal substructure):** 最优解包含子问题的最优解。
126
- 2. **重叠子问题 (overlapping subproblems):** 不同子问题共享更小的子问题,递归会重复计算。
127
-
128
- **经典算法:**
129
- - **最短路径:** Dijkstra (1959)——单源最短路径,$O((V+E)\log V)$。
130
- - **Floyd-Warshall (1962):** 所有顶点对最短路径,$O(V^3)$。递推 $d_{ij}^{(k)} = \min(d_{ij}^{(k-1)}, d_{ik}^{(k-1)} + d_{kj}^{(k-1)})$。
131
- - **背包问题 (knapsack):** $O(nW)$ 伪多项式时间。
132
-
133
- **自底向上 vs 自顶向下 / Bottom-up vs Top-down (memoization):**
134
- - 自底向上:按子问题规模从小到大填表。
135
- - 自顶向下 + 记忆化 (memoization):递归但缓存已解子问题的结果。
136
-
137
- ---
138
-
139
- ## 8. Greedy Algorithms / 贪心算法
140
-
141
- **思想 / Key idea:** 每一步选择局部最优,期望达到全局最优。
142
-
143
- **经典算法:**
144
- - **Kruskal 最小生成树 (1956):** 按边权升序加入不形成环的边。$O(E \log E)$。贪心在 MST 问题中有效。
145
- - **Huffman 编码 (1952):** 每次合并频率最低的两个节点。最优前缀编码。
146
-
147
- **贪心何时有效 / When greedy works:**
148
- - **拟阵 (matroid) 结构:** 若问题的可行解集构成拟阵 $(E, \mathcal{I})$——即满足遗传性 (hereditary) 与交换性 (exchange property)——则贪心算法对任何权函数均给出最优解。
149
- - 交换性: 若 $A, B \in \mathcal{I}$,$|A| < |B|$,则存在 $e \in B \setminus A$ 使得 $A \cup \{e\} \in \mathcal{I}$。
150
-
151
- ---
152
-
153
- ## 9. Backtracking and Search / 回溯与搜索
154
-
155
- **深度优先搜索 (DFS) / 广度优先搜索 (BFS):**
156
- - DFS: 用栈(或递归),优先深入;用于拓扑排序、连通分量。
157
- - BFS: 用队列,优先扩展;用于最短路径(无权图)。
158
-
159
- **回溯 (backtracking):**
160
- - 系统地枚举候选解,发现不满足约束即回退。
161
- - 例: N-皇后问题、子集枚举、排列枚举。
162
-
163
- **剪枝与分支限界 / Pruning and branch-and-bound:**
164
- - 剪枝 (pruning): 利用约束提前排除不可能的分支,减少搜索空间。
165
- - 分支限界 (branch-and-bound): 对优化问题,维护当前最优解的界,剪去不可能更优的分支。常用于 TSP、整数规划。
166
-
167
- **约束满足问题 (CSP) / Constraint satisfaction:**
168
- - 变量集 + 值域 + 约束集。回溯搜索 + 约束传播 (AC-3 等)。
169
-
170
- ---
171
-
172
- ## 10. Randomized Algorithms / 随机化算法
173
-
174
- **两类 / Two types:**
175
- - **Las Vegas 算法:** 结果始终正确,运行时间随机。例:随机化 quicksort。
176
- - **Monte Carlo 算法:** 运行时间确定,结果可能错误(但错误概率可控制在任意小)。例:Miller-Rabin 素性测试。
177
-
178
- **Miller-Rabin 素性测试 (1976/1980):**
179
- - 对奇数 $n$,选取随机 $a \in \{2, \ldots, n-1\}$,检验 $a^{d} \bmod n$ 的序列是否满足 Fermat 小定理的强化条件。
180
- - 单次测试的错误概率 $\leq 1/4$;$k$ 次独立测试后错误概率 $\leq 4^{-k}$。
181
- - 时间 $O(k \log^3 n)$。
182
-
183
- **随机化快速排序 / Randomized quicksort:**
184
- - 随机选取 pivot,期望比较次数 $2n \ln n \approx 1.39 n \log_2 n$,期望运行时间 $O(n \log n)$。
185
- - 最坏 $O(n^2)$ 的概率可证明极低。
186
-
187
- ---
188
-
189
- ## 11. Decidability and Undecidability / 可判定性与不可判定性
190
-
191
- **停机问题不可判定 / Halting problem is undecidable (see §1).**
192
-
193
- **Rice 定理 (1953):**
194
- > 关于图灵机的任何非平凡语义性质都是不可判定的。
195
- > Every non-trivial semantic property of Turing machines is undecidable.
196
-
197
- - "语义性质": 仅取决于 $M$ 计算的函数,不取决于 $M$ 的结构。
198
- - "非平凡": 对某些图灵机成立,对某些不成立。
199
- - 例:"M 是否计算常数函数""M 是否在某输入上停机""M 是否计算可判定语言"——均不可判定。
200
-
201
- **Post 对应问题 / Post correspondence problem (PCP, 1946):**
202
- - 给定 domino 集合 $\{(t_1, b_1), \ldots, (t_k, b_k)\}$($t_i, b_i$ 为字符串),是否存在序列 $i_1, i_2, \ldots, i_m$ 使得 $t_{i_1} t_{i_2} \cdots t_{i_m} = b_{i_1} b_{i_2} \cdots b_{i_m}$?
203
- - PCP 是不可判定的。常用于证明其他问题的不可判定性。
204
-
205
- ---
206
-
207
- ## 12. Complexity Classes / 复杂度类
208
-
209
- | 类 / Class | 定义 / Definition | 中文说明 |
210
- |---|---|---|
211
- | **P** | $\{L : L \text{ 可在 } O(n^k) \text{ 时间内判定}\}$ | 多项式时间可判定 |
212
- | **NP** | $\{L : L \text{ 有多项式长度的验证证书}\}$ | 非确定多项式时间可判定 |
213
- | **co-NP** | $\{L : \bar{L} \in \text{NP}\}$ | NP 的补类 |
214
- | **EXP** | $\{L : L \text{ 可在 } O(2^{n^k}) \text{ 时间内判定}\}$ | 指数时间可判定 |
215
- | **R** | $\{L : L \text{ 是可判定的}\}$ | 递归语言 / 可判定语言 |
216
- | **RE** | $\{L : L \text{ 可被图灵机识别}\}$ | 递归可枚举语言 |
217
-
218
- **层次关系 / Hierarchies:**
219
- $$\text{P} \subseteq \text{NP} \subseteq \text{PSPACE} \subseteq \text{EXP} \subseteq \text{R} \subseteq \text{RE}$$
220
- $$\text{P} \neq \text{EXP} \quad (\text{time hierarchy theorem, Hartmanis–Stearns 1965})$$
221
- $$\text{R} \neq \text{RE} \quad (\text{halting problem} \in \text{RE} \setminus \text{R})$$
222
-
223
- ---
224
-
225
- ## 13. Sorting Lower Bound / 排序下界
226
-
227
- **比较排序的下界 / Lower bound for comparison-based sorting:**
228
-
229
- $$T(n) \geq \Omega(n \log n)$$
230
-
231
- **信息论论证 / Information-theoretic argument:**
232
- - $n$ 个元素的排列数 $= n!$,每次比较至多将搜索空间减半。
233
- - 决策树高度 $h$ 须满足 $2^h \geq n!$,故 $h \geq \log_2(n!) = \Omega(n \log n)$。
234
- - 由 Stirling 公式: $\log_2(n!) \approx n \log_2 n - n \log_2 e + O(\log n)$。
235
-
236
- **突破下界的方法 / Breaking the bound:**
237
- - 非比较排序可超越 $\Omega(n \log n)$:计数排序 $O(n+k)$,基数排序 $O(d(n+k))$——但要求输入有特殊结构。
238
-
239
- ---
240
-
241
- ## 14. Algorithm Design Paradigms — Summary Table / 算法设计范式总结表
242
-
243
- | 范式 / Paradigm | 核心思想 / Key Idea | 适用条件 / When to Use | 典型例子 / Canonical Example |
244
- |---|---|---|---|
245
- | 分治 / Divide-and-Conquer | 分解→递归→合并 | 问题可自然分为独立子问题 | Merge sort, Binary search |
246
- | 动态规划 / Dynamic Programming | 子问题重叠+最优子结构,填表避免重复 | 子问题重叠严重,有最优子结构 | Floyd-Warshall, Knapsack |
247
- | 贪心 / Greedy | 每步取局部最优 | 拟阵结构或可证贪心正确性 | Kruskal MST, Huffman coding |
248
- | 回溯 / Backtracking | 系统搜索+剪枝 | 搜索空间有限但巨大 | N-Queens, CSP |
249
- | 分支限界 / Branch-and-Bound | 搜索+维护上下界剪枝 | 优化问题,可计算解的界 | TSP (exact), Integer programming |
250
- | 随机化 / Randomized | 引入随机性降低期望代价或错误概率 | 需要概率保证或期望高效 | Miller-Rabin, Randomized quicksort |
251
- | 归约/规约 / Reduction | 将问题变换为已知问题 | 已有高效算法求解目标问题 | SAT → 3SAT (Cook-Levin) |
252
-
253
- ---
254
-
255
- *本文件为算法思维技能的数学参考与历史语境,涵盖从古希腊到现代计算理论的核心成果。*
256
- *This file provides mathematical references and historical context for the algorithmic-thinking skill, covering core results from ancient Greece to modern computational theory.*
@@ -1,149 +0,0 @@
1
- ---
2
- name: axiomatization
3
- description: |
4
- 触发:审查论文/理论的假设合理性、构建新公理系统、发现理论内部矛盾、验证相容性/独立性/完备性;或为算法/算子/结构定公理与不变量并检验其可计算性时调用。
5
- English: Trigger when examining the reasonableness of a theory's assumptions, constructing an axiom system, discovering internal contradictions, verifying consistency/independence/completeness; or defining axioms and invariants for an algorithm/operator/structure and checking their computability.
6
- ---
7
-
8
- # 📐 公理化思想 / Axiomatization
9
-
10
- > "从最少假设出发,用严格逻辑构建——审查前提比检查结论更重要"
11
- > "Starting from minimal assumptions, building through rigorous logic — examining premises matters more than checking conclusions"
12
- >
13
- > —— 欧几里得《几何原本》、希尔伯特《几何基础》、公理集合论
14
- > —— Euclid's *Elements*, Hilbert's *Foundations of Geometry*, Axiomatic Set Theory
15
-
16
- ## 核心原则 / Core Principle
17
-
18
- **任何理论体系都可以(且应该)被还原为一组基本公理,从这些公理出发,通过严格逻辑推理,可以推导出该领域的所有定理。审查前提比检查结论更重要——前提错了,结论再精巧也站不住脚。**
19
-
20
- **Any theoretical system can (and should) be reduced to a set of fundamental axioms, from which all theorems in that domain can be derived through rigorous logical inference. Examining premises matters more than checking conclusions — if premises are wrong, no amount of elegant reasoning can save the conclusion.**
21
-
22
- > **数学形式化 / Mathematical Formalization**
23
- >
24
- > 评判一个公理系统的质量,有以下核心标准:
25
- >
26
- > - **相容性(Consistency)**:公理之间不能互相矛盾。若公理集合矛盾,则由爆炸原理(ex falso quodlibet)可推出任意命题,体系崩溃
27
- > - **独立性(Independence)**:每条公理都不能由其他公理推导出来
28
- > - **完备性(Completeness)**:该领域的所有真命题都能从公理出发被证明(注意:完备性因逻辑系统阶数而异,见方法流程)
29
- >
30
- > **范畴性(Categoricity)**:若一个公理系统的所有模型彼此同构,则该系统是范畴的。范畴系统唯一确定其研究对象的结构——例如二阶 Peano 公理是范畴的(唯一模型为自然数结构 ℕ),而一阶 Peano 公理不是范畴的(存在非标准模型)。
31
- >
32
- > **相对一致性(Relative Consistency)**:若公理系统 A 的所有公理可嵌入为系统 B 中的真命题,且系统 B 已知相容,则系统 A 相容。这是证明相容性的标准方法——例如 PA 的相容性可在 ZFC 中证明(PA 的公理在 ZFC 中皆为真),但 ZFC 自身的相容性只能在更强的系统(如 ZFC+存在不可达基数)中相对证明。
33
- >
34
- > 详细数学依据见 `original-texts.md`
35
-
36
- ## GPU 友好性 / GPU-Friendliness(横切检查)
37
-
38
- 当公理化用于**为算法/算子/结构定公理与不变量**时,所定义的结构必须过 `../../references/gpu-friendly-math.md` 八维门——「公理自洽」不等于「可算」:
39
-
40
- - **友好**:公理系统天然落到线性代数——群作用公理 → 等变层 = GEMM(权重沿轨道共享);环公理松弛为半环 → 广义 GEMM(min-plus/热带)。过维度 1/2/3。
41
- - **可改造**:本质离散/符号的公理(硬 Top-K、精确有限域算术、符号证明搜索)阻断梯度 → 松弛公理:热带半环分段线性门控、Gumbel-softmax、可微代理。
42
- - **反模式**:不变量要求全局符号推理或精确离散满足(如精确 Čech 上同调、精确轨道相等判断)→「美但不可算」;改为局部/连续近似。
43
-
44
- 八维最低判定(正式术语):**张量化**看公理实例是否能批量检查;**GEMM 可映射**看运算公理是否能落线性/半环矩阵乘;**复杂度**看一致性/独立性检查是否退化为不可判定或指数搜索;**显存与 KV-Cache**看不变量是否需要全局状态表;**低精度稳定**看公理是否容忍近似等式;**并行与通信**看局部公理能否分块验证;**稀疏结构**看约束图是否结构化;**算子融合**看公理检查能否编译成轻量 loss/guard。
45
-
46
- > 配合 `../../references/books/abstract-algebra.md`(群/环/域公理、环→半环松弛)与 `../../references/books/algebraic-geometry-rising-sea.md`(层/范畴/上同调公理)。
47
-
48
- ## 不适用场景 / When NOT to Use
49
-
50
- - **纯粹的事实查询**(如"这个公式是什么")——没有理论体系需要审查。
51
- - **用户已接受某个理论框架,只需应用**——公理已选定。
52
- - **经验性问题**(需实验数据而非逻辑推理)——公理化不能替代实证。
53
- - **构造性语境下默认使用经典工具**——若用户要求构造性证明,不应默认排中律或选择公理。
54
-
55
- ## 何时使用 / When to Use
56
-
57
- - 阅读论文时,审查其理论基础假设是否合理、是否自洽。
58
- - 构建理论框架时,从最小公理集出发。
59
- - 发现某理论体系内部存在矛盾或不一致。
60
- - 需判断形式系统是否可判定(decidable)或是否完备。
61
- - 需比较不同公理选择的后果(构造性 vs 经典、一阶 vs 二阶)。
62
- - **为算子/结构定公理与不变量**,并检验其在 GPU 上的可计算性。
63
-
64
- ## 方法流程 / Method
65
-
66
- ### 第一步:识别公理 / Identify the Axioms
67
- 找出该理论体系的所有基本假设(公理),区分:**显式公理**(作者明确声明)、**隐式公理**(未声明但论证实际使用)、**背景公理**(默认接受的更大框架假设,如默认 ZFC)。
68
-
69
- > "每一门科学只有当它被公理化之后,才算是真正成熟了。" —— 希尔伯特
70
-
71
- ### 第二步:规定形式语言 / Specify the Formal Language
72
- 公理体系表达力取决于所选形式语言,公理化前必须明确:
73
-
74
- - **一阶逻辑(First-order Logic)**:量词只作用于个体元素。表达力有限,但拥有完备证明理论(哥德尔完备性定理:可证明的恰好是有效的)。一阶理论模型不唯一(非范畴性),但证明系统可靠且完备。
75
- - **二阶逻辑(Second-order Logic)**:量词可作用于子集和函数。表达力更强(可表达范畴性,如二阶 Peano 唯一刻画 ℕ),但不存在完备证明系统——其语义不可被任何递归公理集完全捕获。
76
- - **构造性逻辑(Constructive / Intuitionistic Logic)**:不接受排中律(∀P, P∨¬P)。存在量词证明必须给出显式见证(witness):证明 ∃x.φ(x) 必须构造出具体 x₀ 使 φ(x₀) 成立。推理规则更严格,但保证所有证明可计算。
77
-
78
- > 选择语言不仅是技术细节,而是根本性哲学决定:一阶逻辑承诺可穷尽的证明系统,二阶逻辑承诺结构唯一性,构造性逻辑承诺可计算性。
79
-
80
- ### 第三步:检验相容性 / Check Consistency
81
- 检查公理之间是否互相矛盾。若公理集合矛盾,则由爆炸原理可推出任意命题,体系崩溃。检验方法:
82
-
83
- - 寻找是否存在两个公理 P 与 ¬P 同时成立。
84
- - 尝试构造模型使所有公理同时为真(模型存在 ⇒ 相容)。
85
- - **相对一致性证明**:将系统 A 的公理嵌入为系统 B 中的真命题,若 B 已知相容则 A 相容。例如 PA 相容(PA 公理在 ZFC 的 von Neumann 自然数模型中皆为真)。
86
- - **有限模型方法**:对较弱的形式系统(命题逻辑、某些有穷公理化弱算术),可构造有限模型直接验证相容性。
87
-
88
- ### 第四步:检验独立性 / Check Independence
89
- 检查是否有某条公理可由其他公理推导出来。若存在,它不是真正的公理而是定理。检验方法:
90
-
91
- - 对每条公理 A,构造模型使 A 不成立但其他公理都成立。
92
- - 若这样的模型存在,则 A 独立于其他公理。
93
- - 经典案例:平行公理独立于欧氏几何其余公理(非欧几何模型);选择公理独立于 ZF(Cohen 力迫法)。
94
-
95
- ### 第五步:评估完备性 / Assess Completeness
96
- 检查公理体系是否足以推导出该领域所有重要结论。完备性性质因逻辑阶数和理论内容而异:
97
-
98
- - **一阶理论可以完备**:稠密线性序(DLO)、固定特征的代数封闭域(ACF_p)等一阶理论完备且可判定。完备 ≠ 不存在未决问题;完备指对每个闭公式 φ,φ 或 ¬φ 可由公理证明。
99
- - **哥德尔不完备定理的适用范围**:不完备性特指包含足够算术的一阶递归可枚举理论(PA、ZFC 等),其中必然存在不可判定命题(如 PA 中的 Gödel 句、ZFC 中的 CH)。
100
- - **可判定性(Decidability)是独立问题**:完备的一阶理论通常可判定(有算法判定任意公式是否为定理),但不完备理论未必不可判定——可判定性取决于是否存在判定定理的算法,而非是否所有命题都有证明。
101
-
102
- ### 第六步:分析公理选择的影响 / Analyze the Impact of Axiom Choice
103
- 改变或放松某条公理,理论会发生什么变化?许多数学分支的发展正是通过改变公理实现的:
104
-
105
- - 改变平行公理 → 非欧几何(双曲几何、椭圆几何)。
106
- - **构造性 vs 经典**:去除排中律 → 构造性数学(Brouwer, Heyting),存在性证明必须提供显式构造;添加选择公理 → 更强的经典数学,但产生非构造性证明(如 Banach-Tarski 分球定理)。
107
- - **Zorn 引理、良序定理与选择公理**:在 ZF 中三者等价——接受任何一个即接受全部,这一等价性本身是非构造性的。
108
- - 改变归纳公理 → 非标准分析。
109
-
110
- ### 第七步:应用与结论 / Apply and Conclude
111
- 综合以上分析,给出对该公理体系的整体评价:是否适合其预期应用领域?是否存在需补充或修改的公理?该体系的局限性是什么(不可判定命题、非范畴性、构造性缺失等)?
112
-
113
- ## 常见错误 / Common Errors
114
-
115
- | 错误 / Error | 批评 / Critique | 正确做法 / Correct Approach |
116
- |---|---|---|
117
- | 混淆公理和定理 | 把需证明的命题当作不证自明的公理 | 明确区分:公理是起点,定理是终点 |
118
- | 忽视隐式假设 | 论证中使用了未声明的假设,推理不严密 | 审查每一步推理,暴露所有隐含假设 |
119
- | 接受矛盾公理集 | 从矛盾公理可推出任意结论(爆炸原理) | 检验公理集合的相容性 |
120
- | 把公理当真理 | 公理只是选择出发点的约定,非绝对真理 | 公理的价值在于其推论的有用性 |
121
- | 忽略公理变更的可能性 | 认为公理是唯一可能的选择 | 考虑改变公理会得到什么新理论 |
122
- | 混淆一阶与二阶完备性 | 一阶有完备证明系统(哥德尔完备性),二阶没有;二者"完备"含义不同 | 区分证明论完备性与模型论完备性,明确逻辑阶数 |
123
- | 忽视构造性义务 | 构造性语境中使用排中律或仅证 ¬¬∃x.φ(x) 而不给见证 | 构造性证明须对 ∃x.φ(x) 给出显式见证 x₀;构造性语境禁用排中律 |
124
- | 假设所有不完备理论同样不完备 | 不同不完备理论的不可判定命题数量与性质差异巨大 | 分析具体理论:哪些命题不可判定、其结构性质如何 |
125
- | 把离散/符号公理硬塞进训练 | 本质离散/符号的公理系统不可微、不可算 | 过八维门,必要时松弛为可微/近似(热带半环、Gumbel-softmax) |
126
-
127
- ## 操作规程 / Operating Procedure
128
-
129
- 当本 skill 被触发时,输出必须包含:
130
-
131
- 1. **公理清单**:`[公理N]: [内容](来源:显式/隐式/背景)`
132
- 2. **形式语言规定**:`[语言类型]: [一阶/二阶/构造性](理由:...)`
133
- 3. **相容性检查**:`✅ 相容` 或 `❌ 发现矛盾:[具体矛盾]`;若用相对一致性,注明嵌入的目标系统
134
- 4. **独立性分析**:标注是否存在冗余公理 `⚠️ [公理N] 可能由 [公理M] 推出`
135
- 5. **完备性评估**:`✅ 完备` / `⚠️ 不完备:缺少 [X]`;注明是否属哥德尔不完备定理适用范围,标注可判定性
136
- 6. **公理变更分析**:若改变某条公理(去除排中律、添加/去除选择公理),理论会如何变化?
137
- 7. **结论**:对该理论体系相容性、独立性、完备性、范畴性、可判定性的综合判定
138
- 8. **[GPU 可行性]**(若用于算法/算子/结构设计)— 所定公理与不变量导出的结构过 `../../references/gpu-friendly-math.md` 八维门,标注友好/可改造/不友好 + 改造建议
139
-
140
- **输出不得只给分析而无结论。每项必须给出明确判定,不可悬置。**
141
-
142
- ## 与其他 skill 的关系 / Relations to Other Skills
143
-
144
- - **逻辑演绎**:公理化需要逻辑演绎作为推理工具;形式推理规则是公理体系的证明机制。
145
- - **抽象化**:公理化是最高层次的抽象——把一切还原为最少假设。
146
- - **建模思想**:公理体系本身也是一种模型,需检验其对现实的适用性;模型论直接服务于相容性与独立性检验。
147
- - **归纳与类比**:公理的选择往往通过归纳和类比获得灵感。
148
- - **算法思想**:形式系统与可判定性直接关联——可判定理论存在算法判定定理,不可判定理论则不存在。
149
- - **现代数学激活**:`../../references/books/abstract-algebra.md`(公理系统/群环域、环→半环松弛)、`../../references/books/algebraic-geometry-rising-sea.md`(层/范畴/上同调基础)。
@@ -1,160 +0,0 @@
1
- # 数学出处与经典文献 / Mathematical Sources and Classic Texts
2
-
3
- ## 欧几里得《几何原本》/ Euclid's *Elements* (~300 BC)
4
-
5
- **公理体系(五大公设)**:
6
-
7
- > 1. 任意两点之间可以作一条直线。
8
- > 2. 一条有限直线可以不断延长。
9
- > 3. 以任意中心和半径可以画一个圆。
10
- > 4. 所有直角都相等。
11
- > 5. (平行公设)若一条直线与两条直线相交,在同一侧的内角之和小于两直角,则这两条直线无限延长后在该侧相交。
12
-
13
- 1. A straight line segment can be drawn joining any two points.
14
- 2. Any straight line segment can be extended indefinitely in a straight line.
15
- 3. Given any straight line segment, a circle can be drawn having the segment as radius and one endpoint as center.
16
- 4. All right angles are congruent.
17
- 5. (Parallel Postulate) If two lines are drawn which intersect a third in such a way that the sum of the inner angles on one side is less than two right angles, then the two lines inevitably must intersect on that side if extended far enough.
18
-
19
- **意义**:人类历史上第一个公理化体系,展示了从 5 条公设和 5 条公理出发,通过严格逻辑推理可以推导出 465 个命题。
20
-
21
- ## 平行公设之争 / The Parallel Postulate Controversy (~300 BC – 1820s)
22
-
23
- 欧几里得第五公设从一开始就令人不安:它的表述远比前四条复杂,更像是一条定理而非公理。两千年来,无数数学家试图从前四条公设推导出它,均告失败。
24
-
25
- 关键人物与进展:
26
- - **Saccheri** (1733):试图通过假设平行公设为假来推导矛盾,虽未成功,但首次系统探索了非欧几何的性质。
27
- - **Lambert** (1766):类似思路,更深入地研究了钝角假设与锐角假设下的几何结论。
28
- - **Gauss** (~1820):私下已认识到非欧几何的逻辑自洽性,但因怕引起争议而未发表。
29
- - **Bolyai** (1832) & **Lobachevsky** (1829):各自独立发表双曲几何——一种平行公设为假但完全自洽的几何体系。
30
-
31
- > "我已从虚无中创造了另一个全新的世界。" — Bolyai
32
- > "I have created a new universe from nothing." — Bolyai
33
-
34
- **意义**:平行公设独立于其余四条——它既不能被证明也不能被证伪。这是公理独立性最早的实例,比哥德尔不完备定理早一百年就揭示了"公理不可被迫为真"的深刻事实。非欧几何的诞生直接催生了黎曼几何,后者成为广义相对论的数学基础。
35
-
36
- ## 希尔伯特《几何基础》/ Hilbert's *Foundations of Geometry* (1899)
37
-
38
- > "我们可以用'桌子、椅子、啤酒杯'代替'点、线、面'——只要它们满足公理之间的关系。"
39
- > "We must be able to replace 'points, lines, planes' with 'tables, chairs, beer mugs'—as long as they satisfy the relations between the axioms."
40
-
41
- 希尔伯特提出了更严格的公理体系要求:
42
- - **相容性**:公理不能互相矛盾
43
- - **独立性**:每条公理不能由其他公数推出
44
- - **完备性**:所有几何命题都能在体系内判定
45
-
46
- ## 皮亚诺算术公理 / Peano Axioms for Arithmetic (1889)
47
-
48
- 皮亚诺给出自然数的五条公理,是算术公理化最经典的形式:
49
-
50
- > P1. 0 是自然数。 / 0 is a natural number.
51
- > P2. 每个自然数 n 都有唯一后继 S(n)。 / Every natural number n has a unique successor S(n).
52
- > P3. 0 不是任何自然数的后继。 / 0 is not the successor of any natural number.
53
- > P4. 不同自然数有不同的后继。 / Different natural numbers have different successors.
54
- > P5. (归纳公理)若性质 P 对 0 成立,且对 n 成立则对 S(n) 成立,则 P 对所有自然数成立。 / (Induction) If P(0) and P(n) → P(S(n)), then P holds for all natural numbers.
55
-
56
- **意义**:一阶皮亚诺公理(PA)是哥德尔不完备定理的标准研究对象——PA 相容但不完备。二阶皮亚诺公理是范畴性的(见下文),唯一刻画自然数结构。
57
-
58
- ## ZFC 公理 / Zermelo-Fraenkel Set Theory with Choice (1908–1922)
59
-
60
- ZFC 是当代数学的标准公理基础,由 9 条公理组成:
61
-
62
- > Z1. 外延公理:两个集合相等当且仅当它们有相同的元素。 / Extensionality: sets with the same elements are equal.
63
- > Z2. 空集公理:存在不含任何元素的集合。 / Empty set: ∅ exists.
64
- > Z3. 配对公理:对任意 a, b,存在集合 {a, b}。 / Pairing: {a, b} exists.
65
- > Z4. 并集公理:任意集合族的并集存在。 / Union: the union of any family of sets exists.
66
- > Z5. 幂集公理:任意集合的所有子集构成一个集合。 / Power set: P(A) exists.
67
- > Z6. 无穷公理:存在含 0 且对后继封闭的集合。 / Infinity: an infinite set exists.
68
- > Z7. 替换公理(Fraenkel 补充):函数像在集合范围内。 / Replacement (Fraenkel's addition): images of functions on sets are sets.
69
- > Z8. 基础公理:每个非空集合有最小元,禁止集合包含自身。 / Foundation: every nonempty set has a minimal element; no set contains itself.
70
- > Z9. 选择公理(AC):对任意非空集合族,存在选择函数从每个集合中选取一个元素。 / Axiom of Choice: for any family of nonempty sets, a choice function exists.
71
-
72
- **选择公理争议**:AC 看似直观,却导致反直觉结论——最著名的是 **Banach-Tarski 悖论** (1924):一个球可以被切成五块,经旋转重组后变成两个与原球同样大小的球。Zermelo 用 AC 证明了每个集合都可良序化 (1904),这本身也令人困惑。
73
-
74
- > "选择公理显然为真,良序定理显然为假,而谁又能分辨?" — Jerry Bona
75
- > "The Axiom of Choice is obviously true, the Well-Ordering Theorem obviously false, and who can tell the difference?" — Jerry Bona
76
-
77
- **意义**:ZFC 的 9 条公理足以推导几乎所有现代数学。但 ZFC 本身也是哥德尔不完备定理的适用对象——ZFC 相容但无法在内部证明其相容性。
78
-
79
- ## 连续统假设 / Continuum Hypothesis (Cantor 1878, Gödel 1940, Cohen 1963)
80
-
81
- 康托尔在 1878 年提出:实数集(连续统)的势恰好是 ℵ₁——即不存在介于自然数势 ℵ₀ 与实数势之间的无穷基数。
82
-
83
- > CH: 2^ℵ₀ = ℵ₁。不存在"中等大小"的无穷集。 / There is no cardinal between ℵ₀ and 2^ℵ₀.
84
-
85
- - **Gödel** (1940):证明了 CH 与 ZFC 相容——在 ZFC 中无法反驳 CH。构造了可构造集 L,在其中 CH 成立。
86
- - **Cohen** (1963):用力迫法(forcing)证明了 ¬CH 也与 ZFC 相容——在 ZFC 中无法证明 CH。这是力迫法的诞生。
87
-
88
- **意义**:CH 是哥德尔不完备定理最具体的实例——一条关于无穷大小的自然命题,在数学的标准公理体系中既不可证也不可驳。这深刻揭示了公理体系的局限:即使是最基本的数学问题,也可能超出公理的力量。
89
-
90
- ## 哥德尔不完备定理 / Gödel's Incompleteness Theorems (1931)
91
-
92
- > **第一不完备定理**:任何一个包含算术的相容公理体系,都存在既不能证明也不能证伪的命题。
93
- > **第二不完备定理**:一个相容的公理体系不能在体系内部证明自身的相容性。
94
-
95
- **对公理化思想的启示**:完美的公理化是不可能的。但这不意味着公理化没有价值——它帮助我们理解理论的边界。
96
-
97
- ## Whitehead & Russell《数学原理》/ *Principia Mathematica* (1910–1913)
98
-
99
- 尝试将所有数学还原为逻辑和集合论公理,是公理化思想的巅峰尝试。虽然哥德尔后来证明了这种完全还原的不可能性,但《原理》展示了公理化方法的巨大力量。
100
-
101
- ## 范畴性 / Categoricity (Veblen 1904)
102
-
103
- Veblen 在 1904 年引入范畴性概念:一个公理体系称为范畴性的(categorical),如果它的所有模型都同构——即公理唯一地刻画了研究对象。
104
-
105
- > 范畴性 = 公理体系的所有模型彼此同构。/ Categoricity = all models of the axiom system are isomorphic.
106
-
107
- **关键例子**:
108
- - **二阶皮亚诺公理**是范畴性的——所有满足二阶 PA 的模型都是标准自然数结构 ℕ,唯一的。
109
- - **一阶皮亚诺公理**不是范畴性的——存在非标准模型,其中有"无穷大"的自然数(Skolem 1934)。
110
- - **一阶实闭域公理**是范畴性的(Tarski)——唯一刻画 ℝ。
111
-
112
- **意义**:范畴性是公理体系的理想性质——公理真正"钉住"了唯一的数学对象。但 L\"owenheim-Skolem 定理表明,任何一阶公理体系如果有无穷模型,就有任意大小的无穷模型,因此一阶体系永远不可能范畴性(除非只有有限模型)。二阶体系可以范畴性,但二阶逻辑没有完备的证明系统。这是公理化方法中一阶与二阶的根本张力。
113
-
114
- ## 塔斯基几何公理化 / Tarski's Axiomatization of Geometry (1926–1959)
115
-
116
- 塔斯基用一阶逻辑公理化欧几里得平面几何,只使用点(point)与介于(betweenness)、等距(equidistance)两个基本关系。
117
-
118
- > 塔斯基几何 = 一阶逻辑 + 点 + 介于 + 等距,共约 10 条公理(短版本仅需 7 条)。
119
- > Tarski's geometry = first-order logic + points + betweenness + equidistance, ~10 axioms (7 in the short version).
120
-
121
- **决定性与完备性**:塔斯基在 1959 年证明了这个公理体系是**完备且可判定的**——每条几何命题都可在体系内判定真伪,且存在算法自动判定。
122
-
123
- **对比哥德尔**:这似乎与哥德尔不完备定理矛盾。关键在于:塔斯基几何不含算术——它无法编码自然数,因此哥德尔定理的条件"包含算术"不满足。这深刻说明了:公理体系的完备与否取决于它能否表达足够的算术。
124
-
125
- **意义**:塔斯基的成果是公理化方法论上的奇迹——存在既完备又可判定的一阶公理体系。代价是必须牺牲对算术的表达能力。
126
-
127
- ## 布尔巴基 / Bourbaki (1935–)
128
-
129
- 布尔巴基是一群法国数学家的集体笔名,致力于以公理化方法系统重构全部数学。其巨著《数学原理》(*Éléments de mathématique*)以集合论为根基,逐层构建代数、分析、拓扑、微分等分支。
130
-
131
- > "数学不是关于数的,而是关于结构的。" — 布尔巴基的精神
132
- > "Mathematics is not about numbers, but about structures." — The Bourbaki spirit
133
-
134
- **三大母结构**:
135
- - **代数结构**:群、环、域——刻画运算与组合规律。
136
- - **序结构**:偏序、全序、格——刻画比较与排序规律。
137
- - **拓扑结构**:拓扑空间、度量空间——刻画连续与邻近规律。
138
-
139
- 布尔巴基认为一切数学结构都可从这三种母结构复合生成。这个纲领深刻影响了现代数学的分类方式与教学方式。
140
-
141
- **意义**:布尔巴基将公理化从"为单一学科建基础"提升到"为全部数学建统一架构"的宏大尺度。尽管后来范畴论提供了更灵活的视角,布尔巴aki的结构主义仍是数学公理化思想的核心遗产之一。
142
-
143
- ## 构造性数学 / Constructive Mathematics (Brouwer 1908, Heyting 1930, Bishop 1967)
144
-
145
- 构造性数学拒绝经典逻辑中的排中律(Law of Excluded Middle)和选择公理,要求每个存在性证明必须提供具体的构造方法——即"存在 x"必须伴随"如何找到 x"。
146
-
147
- > "存在即构造。" — 构造性数学的核心信条
148
- > "To exist is to construct." — Core credo of constructive mathematics
149
-
150
- **关键人物与体系**:
151
- - **Brouwer** (1908–):直觉主义创始人,认为数学是心智的自由创造,反对将排中律视为普遍有效。
152
- - **Heyting** (1930):为直觉主义逻辑建立了形式化公理体系——直觉主义逻辑(Heyting 算术)。
153
- - **Bishop** (1967):在《构造性分析》中展示了构造性方法可以重建经典分析的大部分内容,无需排中律也无需选择公理。
154
-
155
- **构造性逻辑与经典逻辑的关键差异**:
156
- - 排中律 ¬¬P → P 在构造性逻辑中不成立。/ Excluded middle ¬¬P → P is not valid in constructive logic.
157
- - 选择公理在构造性框架中几乎不可接受。/ AC is nearly unacceptable in constructive frameworks.
158
- - 证明 ¬P = 构造一个从 P 到矛盾的函数;证明 P ∨ Q = 给出 P 的证明或 Q 的证明。/ Proving ¬P means constructing a function from P to contradiction; proving P ∨ Q means providing a proof of P or a proof of Q.
159
-
160
- **意义**:构造性数学不仅是哲学立场,更是实际需要——计算机可执行证明必须提供算法(即构造)。这与哥德尔不完备定理也有深刻关联:如果拒绝排中律,许多经典逻辑下的"证明"不再成立,公理体系的"不完备"面目也随之改变。