math-skill 2.1.0 → 3.0.1

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 (244) hide show
  1. package/README.en-US.md +165 -198
  2. package/README.md +165 -198
  3. package/agents/math-critic.en.md +28 -26
  4. package/agents/math-critic.md +33 -33
  5. package/commands/ask.en.md +10 -0
  6. package/commands/ask.md +3 -10
  7. package/design-patterns/attention/equivariant-attention.en.md +72 -0
  8. package/design-patterns/attention/equivariant-attention.md +72 -0
  9. package/design-patterns/attention/geometry-aware-attention.en.md +73 -0
  10. package/design-patterns/attention/geometry-aware-attention.md +72 -0
  11. package/design-patterns/attention/information-bottleneck-attention.en.md +72 -0
  12. package/design-patterns/attention/information-bottleneck-attention.md +72 -0
  13. package/design-patterns/attention/projection-attention.en.md +68 -0
  14. package/design-patterns/attention/projection-attention.md +68 -0
  15. package/design-patterns/attention/spectral-attention.en.md +71 -0
  16. package/design-patterns/attention/spectral-attention.md +71 -0
  17. package/design-patterns/compression/leverage-score-selection.en.md +71 -0
  18. package/design-patterns/compression/leverage-score-selection.md +71 -0
  19. package/design-patterns/compression/low-rank-kv-cache.en.md +60 -0
  20. package/design-patterns/compression/low-rank-kv-cache.md +60 -0
  21. package/design-patterns/compression/spectral-token-pruning.en.md +61 -0
  22. package/design-patterns/compression/spectral-token-pruning.md +61 -0
  23. package/design-patterns/compression/topology-preserving-compression.en.md +64 -0
  24. package/design-patterns/compression/topology-preserving-compression.md +64 -0
  25. package/design-patterns/loss/constraint-penalty.en.md +67 -0
  26. package/design-patterns/loss/constraint-penalty.md +78 -0
  27. package/design-patterns/loss/contrastive-loss.en.md +59 -0
  28. package/design-patterns/loss/contrastive-loss.md +68 -0
  29. package/design-patterns/loss/information-bottleneck-loss.en.md +69 -0
  30. package/design-patterns/loss/information-bottleneck-loss.md +74 -0
  31. package/design-patterns/loss/orthogonality-loss.en.md +56 -0
  32. package/design-patterns/loss/orthogonality-loss.md +60 -0
  33. package/design-patterns/loss/variational-loss.en.md +61 -0
  34. package/design-patterns/loss/variational-loss.md +71 -0
  35. package/design-patterns/representation/equivariant-split.en.md +87 -0
  36. package/design-patterns/representation/equivariant-split.md +89 -0
  37. package/design-patterns/representation/manifold-representation.en.md +85 -0
  38. package/design-patterns/representation/manifold-representation.md +87 -0
  39. package/design-patterns/representation/shared-private-decomposition.en.md +84 -0
  40. package/design-patterns/representation/shared-private-decomposition.md +86 -0
  41. package/design-patterns/representation/subspace-alignment.en.md +90 -0
  42. package/design-patterns/representation/subspace-alignment.md +92 -0
  43. package/design-patterns/routing/graph-routing.en.md +79 -0
  44. package/design-patterns/routing/graph-routing.md +81 -0
  45. package/design-patterns/routing/moe-routing.en.md +85 -0
  46. package/design-patterns/routing/moe-routing.md +87 -0
  47. package/design-patterns/routing/optimal-transport-routing.en.md +68 -0
  48. package/design-patterns/routing/optimal-transport-routing.md +72 -0
  49. package/design-patterns/routing/spectral-clustering-routing.en.md +88 -0
  50. package/design-patterns/routing/spectral-clustering-routing.md +90 -0
  51. package/knowledge-base/differential-geometry/connection.en.md +51 -0
  52. package/knowledge-base/differential-geometry/connection.md +51 -0
  53. package/knowledge-base/differential-geometry/curvature.en.md +49 -0
  54. package/knowledge-base/differential-geometry/curvature.md +49 -0
  55. package/knowledge-base/differential-geometry/geodesic.en.md +51 -0
  56. package/knowledge-base/differential-geometry/geodesic.md +51 -0
  57. package/knowledge-base/differential-geometry/manifold.en.md +47 -0
  58. package/knowledge-base/differential-geometry/manifold.md +47 -0
  59. package/knowledge-base/differential-geometry/metric-tensor.en.md +50 -0
  60. package/knowledge-base/differential-geometry/metric-tensor.md +50 -0
  61. package/knowledge-base/differential-geometry/tangent-space.en.md +48 -0
  62. package/knowledge-base/differential-geometry/tangent-space.md +48 -0
  63. package/knowledge-base/information-geometry/fisher-metric.en.md +56 -0
  64. package/knowledge-base/information-geometry/fisher-metric.md +56 -0
  65. package/knowledge-base/information-geometry/natural-gradient.en.md +54 -0
  66. package/knowledge-base/information-geometry/natural-gradient.md +54 -0
  67. package/knowledge-base/lie-theory/equivariance.en.md +54 -0
  68. package/knowledge-base/lie-theory/equivariance.md +54 -0
  69. package/knowledge-base/lie-theory/group-action.en.md +51 -0
  70. package/knowledge-base/lie-theory/group-action.md +51 -0
  71. package/knowledge-base/lie-theory/lie-algebra.en.md +51 -0
  72. package/knowledge-base/lie-theory/lie-algebra.md +51 -0
  73. package/knowledge-base/lie-theory/lie-group.en.md +51 -0
  74. package/knowledge-base/lie-theory/lie-group.md +51 -0
  75. package/knowledge-base/lie-theory/representation.en.md +52 -0
  76. package/knowledge-base/lie-theory/representation.md +52 -0
  77. package/knowledge-base/matrix-analysis/low-rank-approximation.en.md +49 -0
  78. package/knowledge-base/matrix-analysis/low-rank-approximation.md +49 -0
  79. package/knowledge-base/matrix-analysis/matrix-perturbation.en.md +49 -0
  80. package/knowledge-base/matrix-analysis/matrix-perturbation.md +49 -0
  81. package/knowledge-base/matrix-analysis/positive-semidefinite.en.md +50 -0
  82. package/knowledge-base/matrix-analysis/positive-semidefinite.md +50 -0
  83. package/knowledge-base/matrix-analysis/projection.en.md +47 -0
  84. package/knowledge-base/matrix-analysis/projection.md +47 -0
  85. package/knowledge-base/matrix-analysis/spectral-decomposition.en.md +48 -0
  86. package/knowledge-base/matrix-analysis/spectral-decomposition.md +48 -0
  87. package/knowledge-base/optimization/constrained-optimization.en.md +53 -0
  88. package/knowledge-base/optimization/constrained-optimization.md +53 -0
  89. package/knowledge-base/optimization/convex-optimization.en.md +50 -0
  90. package/knowledge-base/optimization/convex-optimization.md +50 -0
  91. package/knowledge-base/optimization/lagrangian-duality.en.md +50 -0
  92. package/knowledge-base/optimization/lagrangian-duality.md +50 -0
  93. package/knowledge-base/optimization/proximal-method.en.md +52 -0
  94. package/knowledge-base/optimization/proximal-method.md +52 -0
  95. package/knowledge-base/optimization/riemannian-optimization.en.md +51 -0
  96. package/knowledge-base/optimization/riemannian-optimization.md +51 -0
  97. package/knowledge-base/overview.en.md +29 -218
  98. package/knowledge-base/overview.md +29 -220
  99. package/knowledge-base/probability/concentration-inequality.en.md +45 -0
  100. package/knowledge-base/probability/concentration-inequality.md +45 -0
  101. package/knowledge-base/probability/entropy.en.md +47 -0
  102. package/knowledge-base/probability/entropy.md +47 -0
  103. package/knowledge-base/probability/fisher-information.en.md +48 -0
  104. package/knowledge-base/probability/fisher-information.md +48 -0
  105. package/knowledge-base/probability/information-bottleneck.en.md +49 -0
  106. package/knowledge-base/probability/information-bottleneck.md +49 -0
  107. package/knowledge-base/probability/kl-divergence.en.md +51 -0
  108. package/knowledge-base/probability/kl-divergence.md +51 -0
  109. package/knowledge-base/topology/euler-characteristic.en.md +54 -0
  110. package/knowledge-base/topology/euler-characteristic.md +54 -0
  111. package/knowledge-base/topology/fundamental-group.en.md +52 -0
  112. package/knowledge-base/topology/fundamental-group.md +52 -0
  113. package/knowledge-base/topology/persistent-homology.en.md +54 -0
  114. package/knowledge-base/topology/persistent-homology.md +54 -0
  115. package/lenses/algorithmic.en.md +49 -0
  116. package/lenses/algorithmic.md +49 -0
  117. package/lenses/axiomatization.en.md +48 -0
  118. package/lenses/axiomatization.md +48 -0
  119. package/lenses/categorical.en.md +48 -0
  120. package/lenses/categorical.md +48 -0
  121. package/lenses/causal.en.md +49 -0
  122. package/lenses/causal.md +49 -0
  123. package/lenses/duality.en.md +47 -0
  124. package/lenses/duality.md +47 -0
  125. package/lenses/game.en.md +50 -0
  126. package/lenses/game.md +50 -0
  127. package/lenses/geometric.en.md +53 -0
  128. package/lenses/geometric.md +53 -0
  129. package/lenses/local-to-global.en.md +52 -0
  130. package/lenses/local-to-global.md +52 -0
  131. package/lenses/perturbation.en.md +51 -0
  132. package/lenses/perturbation.md +51 -0
  133. package/lenses/probabilistic.en.md +48 -0
  134. package/lenses/probabilistic.md +48 -0
  135. package/lenses/projection.en.md +50 -0
  136. package/lenses/projection.md +50 -0
  137. package/lenses/spectral.en.md +52 -0
  138. package/lenses/spectral.md +52 -0
  139. package/lenses/symmetry.en.md +49 -0
  140. package/lenses/symmetry.md +49 -0
  141. package/lenses/topological.en.md +48 -0
  142. package/lenses/topological.md +48 -0
  143. package/lenses/variational.en.md +48 -0
  144. package/lenses/variational.md +48 -0
  145. package/package.json +9 -3
  146. package/references/agentic-workflow.en.md +1 -1
  147. package/references/agentic-workflow.md +1 -1
  148. package/references/books/abstract-algebra.en.md +124 -0
  149. package/references/books/abstract-algebra.md +22 -22
  150. package/references/books/algebraic-geometry-rising-sea.en.md +171 -0
  151. package/references/books/algebraic-geometry-rising-sea.md +11 -11
  152. package/references/books/differential-geometry.en.md +140 -0
  153. package/references/books/differential-geometry.md +19 -19
  154. package/references/books/matrix-analysis.en.md +146 -0
  155. package/references/books/matrix-analysis.md +10 -10
  156. package/references/books/micro-lie-theory.en.md +116 -0
  157. package/references/books/micro-lie-theory.md +17 -17
  158. package/references/books/optimization-ml.en.md +163 -0
  159. package/references/books/optimization-ml.md +7 -8
  160. package/references/books/smooth-manifolds.en.md +105 -0
  161. package/references/books/smooth-manifolds.md +14 -14
  162. package/references/gpu-friendly-math.en.md +23 -10
  163. package/references/gpu-friendly-math.md +17 -4
  164. package/references/inspiration.en.md +1 -1
  165. package/references/inspiration.md +2 -2
  166. package/skills/math-research-activator/SKILL.en.md +195 -114
  167. package/skills/math-research-activator/SKILL.md +194 -119
  168. package/skills/math-research-activator/original-texts.en.md +9 -9
  169. package/skills/math-research-activator/original-texts.md +11 -11
  170. package/commands/abstraction.md +0 -11
  171. package/commands/algorithmic-thinking.md +0 -11
  172. package/commands/axiomatization.md +0 -11
  173. package/commands/causal-inference.md +0 -11
  174. package/commands/discrete-combinatorial.md +0 -11
  175. package/commands/game-theory.md +0 -11
  176. package/commands/induction-analogy.md +0 -11
  177. package/commands/information-theory.md +0 -11
  178. package/commands/logic-deduction.md +0 -11
  179. package/commands/modeling.md +0 -11
  180. package/commands/optimization.md +0 -11
  181. package/commands/probability-statistics.md +0 -11
  182. package/commands/symmetry-invariance.md +0 -11
  183. package/commands/topological-thinking.md +0 -11
  184. package/commands/transformation.md +0 -11
  185. package/skills/abstraction/SKILL.en.md +0 -117
  186. package/skills/abstraction/SKILL.md +0 -121
  187. package/skills/abstraction/original-texts.en.md +0 -163
  188. package/skills/abstraction/original-texts.md +0 -175
  189. package/skills/algorithmic-thinking/SKILL.en.md +0 -132
  190. package/skills/algorithmic-thinking/SKILL.md +0 -138
  191. package/skills/algorithmic-thinking/original-texts.en.md +0 -253
  192. package/skills/algorithmic-thinking/original-texts.md +0 -256
  193. package/skills/axiomatization/SKILL.en.md +0 -144
  194. package/skills/axiomatization/SKILL.md +0 -151
  195. package/skills/axiomatization/original-texts.en.md +0 -154
  196. package/skills/axiomatization/original-texts.md +0 -160
  197. package/skills/causal-inference/SKILL.en.md +0 -147
  198. package/skills/causal-inference/SKILL.md +0 -151
  199. package/skills/causal-inference/original-texts.en.md +0 -136
  200. package/skills/causal-inference/original-texts.md +0 -167
  201. package/skills/discrete-combinatorial/SKILL.en.md +0 -124
  202. package/skills/discrete-combinatorial/SKILL.md +0 -131
  203. package/skills/discrete-combinatorial/original-texts.en.md +0 -184
  204. package/skills/discrete-combinatorial/original-texts.md +0 -185
  205. package/skills/game-theory/SKILL.en.md +0 -117
  206. package/skills/game-theory/SKILL.md +0 -123
  207. package/skills/game-theory/original-texts.en.md +0 -131
  208. package/skills/game-theory/original-texts.md +0 -131
  209. package/skills/induction-analogy/SKILL.en.md +0 -145
  210. package/skills/induction-analogy/SKILL.md +0 -152
  211. package/skills/induction-analogy/original-texts.en.md +0 -140
  212. package/skills/induction-analogy/original-texts.md +0 -154
  213. package/skills/information-theory/SKILL.en.md +0 -134
  214. package/skills/information-theory/SKILL.md +0 -140
  215. package/skills/information-theory/original-texts.en.md +0 -127
  216. package/skills/information-theory/original-texts.md +0 -127
  217. package/skills/logic-deduction/SKILL.en.md +0 -130
  218. package/skills/logic-deduction/SKILL.md +0 -135
  219. package/skills/logic-deduction/original-texts.en.md +0 -160
  220. package/skills/logic-deduction/original-texts.md +0 -173
  221. package/skills/modeling/SKILL.en.md +0 -135
  222. package/skills/modeling/SKILL.md +0 -139
  223. package/skills/modeling/original-texts.en.md +0 -162
  224. package/skills/modeling/original-texts.md +0 -165
  225. package/skills/optimization/SKILL.en.md +0 -129
  226. package/skills/optimization/SKILL.md +0 -135
  227. package/skills/optimization/original-texts.en.md +0 -167
  228. package/skills/optimization/original-texts.md +0 -168
  229. package/skills/probability-statistics/SKILL.en.md +0 -146
  230. package/skills/probability-statistics/SKILL.md +0 -151
  231. package/skills/probability-statistics/original-texts.en.md +0 -191
  232. package/skills/probability-statistics/original-texts.md +0 -193
  233. package/skills/symmetry-invariance/SKILL.en.md +0 -135
  234. package/skills/symmetry-invariance/SKILL.md +0 -139
  235. package/skills/symmetry-invariance/original-texts.en.md +0 -206
  236. package/skills/symmetry-invariance/original-texts.md +0 -221
  237. package/skills/topological-thinking/SKILL.en.md +0 -124
  238. package/skills/topological-thinking/SKILL.md +0 -128
  239. package/skills/topological-thinking/original-texts.en.md +0 -134
  240. package/skills/topological-thinking/original-texts.md +0 -164
  241. package/skills/transformation/SKILL.en.md +0 -120
  242. package/skills/transformation/SKILL.md +0 -124
  243. package/skills/transformation/original-texts.en.md +0 -204
  244. package/skills/transformation/original-texts.md +0 -216
@@ -1,152 +0,0 @@
1
- ---
2
- name: induction-analogy
3
- description: |
4
- 触发:从数据/经验找规律、特殊→一般、已知→未知、数学归纳证明(弱/强/结构/超限)、跨域类比迁移结构、为算法/算子设计借鉴其他领域结构等科研语境时调用。
5
- English: Trigger when finding patterns from data/experience, specific→general, known→unknown, mathematical induction proofs (weak/strong/structural/transfinite), cross-domain analogical transfer of structures, or borrowing structures from other fields for algorithm/operator design.
6
- ---
7
-
8
- > **语言路由**:若用户消息为英文,请读取并遵循同目录下的 `SKILL.en.md`,按其操作规程以英文输出;中文消息则继续使用本文件。
9
-
10
- # 📈 归纳与类比 / Induction & Analogy
11
-
12
- > "从特殊到一般,从已知到未知——归纳发现规律,类比迁移经验,两者都不等于证明"
13
- > "From the specific to the general, from the known to the unknown—induction discovers patterns, analogy transfers experience, but neither equals proof"
14
- >
15
- > —— Pólya《数学与猜想》、Lakatos《证明与反驳》
16
- > —— Pólya "Mathematics and Plausible Reasoning", Lakatos "Proofs and Refutations"
17
-
18
- ## 核心原则 / Core Principle
19
-
20
- **归纳是从有限实例中发现一般规律的过程,是创造新知识的引擎;类比是将一个领域的理解迁移到另一个领域的桥梁。两者都不是严格证明,但都是发现定理、提出假说、产生创新的根本方法。严格性是验证的工具,而非发现的工具——Pólya。**
21
-
22
- **Induction discovers general patterns from limited instances—the engine of new knowledge; analogy transfers understanding across domains. Neither is rigorous proof, but both are fundamental to discovering theorems, proposing hypotheses, and generating innovation. Rigor is a tool of verification, not of discovery—Pólya.**
23
-
24
- 归纳与类比的区别:**归纳**从 N 个具体案例 → 一般规律(纵向深入);**类比**从领域 A 的结构 → 领域 B 的结构(横向迁移);两者都产生假设而非定理,需后续验证。
25
-
26
- > **数学形式化 / Mathematical Formalization**
27
- >
28
- > 归纳推理与归纳证明的严格区分:
29
- > - 归纳推理(inductive reasoning):经验性的,从观察中提出假说
30
- > - 归纳证明(inductive proof):逻辑性的,数学归纳法是严格的演绎证明格式
31
- > - 关键:归纳推理产生猜想,归纳证明验证猜想——两者不可混淆
32
- >
33
- > 归纳证明的变体及其适用场景:
34
- > - **弱归纳法(Weak Induction)**:证明 P(1) 成立 + 证明 ∀k(P(k)→P(k+1)) → 得出 ∀n P(n);适用:P(k+1) 仅依赖 P(k)
35
- > - **强归纳法(Strong / Complete Induction)**:假设 P(1), P(2), …, P(k) 全部成立,证明 P(k+1) 成立;适用:P(k+1) 依赖多个前驱
36
- > - **结构归纳法(Structural Induction)**:证明 P(base) 成立 + P(composite) 由 P(components) 推出;适用:递归定义的结构(树、列表、表达式)
37
- > - **超限归纳法(Transfinite Induction)**:对良序集 (W, <),证明 ∀α∈W(∀β<α P(β) → P(α)) → ∀α∈W P(α);适用:索引超越自然数的良序集
38
- >
39
- > Lakatos 方法论的形式化描述:
40
- > - **怪物排除(monster-barring)**:将反例归为不属于假说本意范围的对象,在假说中显式排除——最简单的修正,但需警惕过度排除导致假说空洞化
41
- > - **引理吸收(lemma-incorporation)**:将反例暴露的隐藏条件纳入假说作为新引理——使假说更精确
42
- > - **证明策略修订(proof-strategy revision)**:反例揭示原证明思路有根本缺陷,需换一种证明框架——最深刻的修正
43
- >
44
- > 类比的结构性相似度度量:
45
- > - 结构相似度 = (成功映射的关系数 + 成功映射的组件数) / (源关系总数 + 源组件总数)
46
- > - 高有效性(同态映射 homomorphism):大部分结构有对应,关键关系保持
47
- > - 中有效性(部分同态 partial homomorphism):部分结构和关系保持,部分失真
48
- > - 低有效性(表面相似 surface similarity):仅外观或术语相似,深层结构不同
49
-
50
- ## GPU 友好性 / GPU-Friendliness(横切检查)
51
-
52
- 归纳与类比本身偏**元启发式**——它们产生猜想、迁移结构,但不直接规定计算。真正要过 GPU 八维门的是它们的**产物**:被迁移到算法/算子设计中的那个结构。类比迁移来的结构若不可算则需改造。
53
-
54
- - **友好**:迁移来的结构能写成稠密 GEMM 链或低秩线性映射——如结构归纳思路落到递归算子的可融合实现、代数同态类比成低秩 GEMM(维度 1/2/4)。
55
- - **可改造**:迁移来的全局/串行结构(朴素上同调计算、非结构化图遍历、朴素 RNN 式递推)→ 用块稀疏化、低秩投影、热带半环松弛改造(见 `../../references/gpu-friendly-math.md` 改造手法)。
56
- - **反模式**:仅因结构同构/同态优美就采用,却忽略 O(n²) 显存、fp64 依赖或长串行递推——"数学美 ≠ 可算",类比结论即便数学正确也未必硬件可行。
57
-
58
- 八维最低判定(正式术语):**张量化**检查迁移结构的可批量表达;**GEMM 可映射**检查类比后的核心算子是否落矩阵乘;**复杂度**检查从源领域带来的全局构造是否爆炸;**显存与 KV-Cache**检查是否引入大表或长缓存;**低精度稳定**检查类比结构是否依赖精确符号/高精度;**并行与通信**检查递推或交互能否分块;**稀疏结构**检查稀疏是否规则;**算子融合**检查迁移结构是否可实现为少量 fused ops。
59
-
60
- > 配合 `../../references/gpu-friendly-math.md`(八维门)、`../../references/books/abstract-algebra.md`(同态/同构结构)、`../../references/books/algebraic-geometry-rising-sea.md`(跨域结构迁移与压缩)。
61
-
62
- ## 不适用场景 / When NOT to Use
63
-
64
- - **需要严格证明**——归纳推理和类比只能产生假设,不是证明;但数学归纳法本身是证明方法。
65
- - **样本只有一个或极少**——归纳推理需要足够的实例支撑。
66
- - **两个领域差异太大**——类比需要结构相似性,而非表面相似。
67
- - **结论必须零误差**——归纳推理有不确定性,类比有失真风险。
68
- - **问题可用演绎直接解决**——不必绕道归纳。
69
-
70
- ## 何时使用 / When to Use
71
-
72
- - 观察到多个案例有共同模式,想要提出一般性假说。
73
- - 在科研中尝试发现新定理或新规律。
74
- - 需要对递归定义的结构(树、列表、表达式)进行性质证明——使用结构归纳法。
75
- - 需要证明涉及分解的命题(如整数的素因子分解)——使用强归纳法。
76
- - 需要对超越自然数的良序集进行论证——使用超限归纳法。
77
- - 跨学科借鉴——其他领域的方法能否用到我的问题?
78
- - **为算法/算子设计借鉴其他领域的结构**——跨域类比迁移结构(如代数同态→低秩映射、层扩散→块摘要),迁移后过 GPU 八维门再采用。
79
-
80
- ## 方法流程 / Method
81
-
82
- ### 第一步:收集具体案例 / Collect Concrete Cases
83
- 系统收集与观察具体实例:阅读文献提取关键案例、收集实验数据中的模式、整理已知定理;确保案例覆盖边界值、典型值与极端值。案例的多样性与覆盖度决定归纳质量——太少或太单一会误导。
84
-
85
- ### 第二步:识别模式 / Identify Patterns
86
- 比较案例的共同点与差异:什么特征在所有(或大多数)案例中出现?什么只出现在部分?差异是否有规律?注意模式可能在若干案例后突然破坏(如 Borwein 积分现象)——只看共同点会忽视反例。
87
-
88
- ### 第三步:提出假说 / Formulate a Hypothesis
89
- 基于观察到的模式提出一般性假说:**强假说** ∀n P(n)(所有情况成立);**弱假说** P(n) 对足够大的 n 成立(存在例外);**条件假说** ∀n∈S P(n)(特定子集)。选择原则:优先尝试强假说,再用反例逐级弱化。假说必须足够明确以至于可被推翻。
90
-
91
- ### 第四步:搜索反例 / Search for Counterexamples
92
- 主动寻找推翻假说的反例——区分科学与伪科学的关键。找到反例则修改(弱化或加条件);找不到则假说暂时成立。特别关注边界条件、极端值、参数变化时模式是否突然失效。
93
-
94
- ### 第五步:尝试证明 / Attempt a Proof
95
- 对数学假说尝试严格证明,选择正确的归纳变体是关键:
96
-
97
- - **弱归纳法(Weak Induction)**:证明 P(1) + ∀k(P(k)→P(k+1)) → ∀n P(n);适用 P(k+1) 仅依赖 P(k)(求和公式、简单递推);示例 1+2+…+n = n(n+1)/2。
98
- - **强归纳法(Strong Induction)**:假设 P(1)..P(k) 全部成立证 P(k+1);适用 P(k+1) 依赖多个前驱(分解、拆分命题);示例:每个大于 1 的整数都是素数乘积、斐波那契性质。关键:P(k+1) 需引用 P(j)(j<k) 时必须用强归纳。
99
- - **结构归纳法(Structural Induction)**:证 P(base) + P(composite) 由 P(components) 推出;适用递归定义结构(树、列表、表达式、公式、程序语义);示例:二叉树叶节点数 = 内部节点数 + 1。它是数学归纳法在递归结构上的自然推广。
100
- - **超限归纳法(Transfinite Induction)**:对良序集 (W,<) 证 ∀α∈W(∀β<α P(β)→P(α)) → ∀α∈W P(α);适用索引超越自然数的良序集(序数、偏序集、拓扑传递闭包);示例:Zorn 引理应用、集合论递归构造。
101
- - **良序原理等价性**:每个非空子集有最小元 ↔ 自然数归纳法 ↔ 强归纳法 ↔ 良序集上的超限归纳。实践意义:选最自然的形式。
102
-
103
- ### 第六步:类比迁移 / Analogical Transfer
104
- 使用类比必须定量评估而非仅凭直觉:
105
-
106
- - **结构性相似度度量**:结构相似度 = (成功映射的关系数 + 成功映射的组件数) / (源关系总数 + 源组件总数)。
107
- - **类比有效性分级**:**高有效性(同态映射 homomorphism)**——大部分结构有对应、关键关系保持,结论可信度高;**中有效性(部分同态)**——部分保持部分失真,结论需修正后使用;**低有效性(表面相似)**——仅外观/术语相似,深层结构不同,结论基本不可信。
108
- - **系统性检验清单**:① 源领域每个组件,目标领域是否有对应?② 每个关系在目标领域是否成立?③ 每个操作在目标领域是否有定义?④ 映射一致性:若 a↦a', b↦b',则 R(a,b) 是否蕴含 R'(a',b')?
109
-
110
- ### 第七步:假说修正 / Hypothesis Revision
111
- 据反例与证明尝试结果修正假说,遵循 Lakatos 方法论:**怪物排除(monster-barring)**——将反例归为不属于假说本意范围并显式排除(最简单,警惕过度排除致空洞化);**引理吸收(lemma-incorporation)**——将反例暴露的隐藏条件纳入为新引理(使假说更精确);**证明策略修订(proof-strategy revision)**——反例揭示原证明思路根本缺陷,换证明框架(最深刻)。修正后回到第四步,迭代直至假说稳定。
112
-
113
- ## 常见错误 / Common Errors
114
-
115
- | 错误 / Error | 批评 / Critique | 正确做法 / Correct Approach |
116
- |---|---|---|
117
- | 样本不足就归纳 | 从 2-3 个案例归纳的"规律"极不可靠 | 样本量要足够大,且覆盖各种情况 |
118
- | 把归纳推理当证明 | 归纳推理只产生假设,不是证明;数学归纳法才是证明 | 区分归纳推理与归纳证明,前者产猜想后者验证 |
119
- | 确认偏差 | 只看到支持假说的案例,忽视反例 | 主动寻找反例——最关键的一步 |
120
- | 表面类比 | 基于表面相似而非结构相似的类比 | 类比的依据是结构同构/同态,不是表面相似 |
121
- | 类比过度 | 两个领域不完全同构,类比结论不完全成立 | 用结构性相似度量化评估类比强度 |
122
- | 归纳后不验证 | 提出假说后不去检验 | 假说必须经过反例检验和/或证明 |
123
- | 需强归纳却用弱归纳 | P(k+1) 依赖多个前驱时,弱归纳无法完成归纳步骤 | 识别依赖结构:若 P(k+1) 需引用 P(j)(j<k),用强归纳 |
124
- | 仅凭表面特征评估类比 | 表面特征相似不意味着结构相似,结论可能完全错误 | 用系统映射逐一比较组件、关系、操作 |
125
- | 混淆归纳推理与归纳证明 | 归纳推理是经验性的,归纳证明是演绎性的——性质完全不同 | 明确区分:推理→假说,证明→定理 |
126
- | 忽略模式破坏(Borwein积分) | 模式在前若干案例中成立后可能突然失效,归纳推理有盲区 | 检查足够多案例,关注边界与参数变化时的模式突变 |
127
- | 类比迁移来不可算的结构 | 仅因结构同构优美就采用,忽略 O(n²) 显存或 fp64 依赖——"数学美 ≠ 可算" | 迁移来的结构先过 GPU 八维门,不可算则改造(低秩/块稀疏/松弛)后再采用 |
128
-
129
- ## 操作规程 / Operating Procedure
130
-
131
- 当本 skill 被触发时,输出必须包含:
132
-
133
- 1. **案例清单**:`[案例N]: [描述] [关键特征]`,确保覆盖边界值与极端值。
134
- 2. **模式识别**:`[共同模式]: [描述] [出现频率: N/M] [差异模式]: [描述]`,注意是否有 Borwein 型突然破坏。
135
- 3. **假说表述**:`[假说]: [内容] [类型: 强/弱/条件]`,优先尝试强假说。
136
- 4. **反例搜索**:`[反例]: [找到/未找到]。如找到: [描述],假说修正: [新表述]`。
137
- 5. **证明方向**:`[归纳类型: 弱/强/结构/超限]` 并给出证明思路;说明为何选择该变体。
138
- 6. **类比映射**:`[源领域A] → [目标领域B]: [对应关系] [结构相似度: X/Y] [有效性: 高/中/低]`,逐项检验组件、关系、操作。
139
- 7. **假说修正**:`[修正方式: 怪物排除/引理吸收/策略修订] [修正后假说]`。
140
- 8. **[GPU 可行性]**(若迁移结构用于算法/算子设计)— 迁移来的结构过 `../../references/gpu-friendly-math.md` 八维门,标注友好/可改造/不友好 + 改造建议。
141
-
142
- **输出不得只给分析而无结论;需要继续执行时,在结尾用一句话说明接下来将做什么。**
143
-
144
- ## 与其他 skill 的关系 / Relations to Other Skills
145
-
146
- - **逻辑演绎**:归纳产生假说,演绎证明假说——发现与验证的双翼。
147
- - **抽象化思想**:类比本质上是识别两个领域的共同抽象结构。
148
- - **概率与统计**:归纳推理的概率版本就是统计推断。
149
- - **建模思想**:从数据中发现规律的归纳过程也是建模的一部分。
150
- - **算法思想**:归纳作为正确性证明范式——循环不变量即归纳假设,递归程序正确性依赖结构归纳。
151
- - **离散/组合思想**:组合归纳——对组合对象的归纳论证,如图论归纳、生成函数方法中的归纳递推。
152
- - **现代数学激活**:`../../references/books/abstract-algebra.md`(结构类比:同态/同构作为类比的形式化)、`../../references/books/algebraic-geometry-rising-sea.md`(跨域结构迁移:层/限制映射/Plücker 压缩)。
@@ -1,140 +0,0 @@
1
- # Mathematical Sources and Classic Texts
2
-
3
- ## Mathematical Induction (Pascal, 1654)
4
-
5
- **Principle**:
6
- > If P(1) holds and P(n) -> P(n+1), then P(n) holds for all positive integers n.
7
-
8
- **Philosophical implication**: Deriving the "infinite" from the "finite" -- requiring only a base case and an inductive step.
9
-
10
- **Classic examples**: 1+2+...+n = n(n+1)/2; Fibonacci properties; proofs in graph theory
11
-
12
- ## Strong (Complete) Induction
13
-
14
- > If P(1)...P(k) all holding implies P(k+1), then P(n) holds for all positive integers n.
15
-
16
- **Applicable scenarios**: When P(k+1) depends on many or even all preceding propositions, not just P(k).
17
-
18
- **Examples**: Unique factorization theorem; Fibonacci recurrence F(n)=F(n-1)+F(n-2); Fundamental Theorem of Arithmetic
19
-
20
- ## Structural Induction
21
-
22
- > For recursively defined structures (lists, trees, expressions): prove the property holds for base elements and is preserved under construction steps, then it holds for all instances.
23
-
24
- **Applications in computer science**: Compiler correctness; type system safety (well-typed programs do not crash); data structure invariants (red-black tree balance); algorithm termination proofs
25
-
26
- **Examples**: |L1 ++ L2| = |L1| + |L2|; tree height <= number of nodes
27
-
28
- ## Transfinite Induction (Cantor Ordinals)
29
-
30
- > If P(gamma) for all gamma < beta implies P(beta), then P(alpha) holds for all ordinals alpha.
31
-
32
- **Significance**: Induction extends beyond the natural numbers -- it applies to any well-ordered set.
33
-
34
- **Key concepts**: Cantor ordinals omega, omega+1, omega*2, omega^2, omega^omega...; equivalence with Zorn's lemma; application: proving that every vector space has a basis
35
-
36
- ## Well-Ordering Principle
37
-
38
- > Every nonempty subset of the natural numbers has a least element; logically equivalent to mathematical induction.
39
-
40
- **Equivalence proofs**: Well-ordering implies induction: the set of counterexamples has a least element m, so P(m-1) holds while P(m) does not -- contradiction. Induction implies well-ordering: use induction to prove that every nonempty subset contains a least element.
41
-
42
- **Generalization**: The Well-Ordering Theorem (Zermelo 1904) -- every set can be well-ordered; equivalent to the Axiom of Choice.
43
-
44
- ## Polya's *Mathematics and Plausible Reasoning* (1954)
45
-
46
- > "Induction, analogy, specialization, generalization -- principal methods of discovering mathematical truths."
47
-
48
- **Inductive pattern**: 1. Observe cases -> 2. Discover patterns -> 3. Formulate conjectures -> 4. Verify (prove or disprove)
49
-
50
- ## Mathematical Status of Analogy
51
-
52
- > "Analogy is a tool for discovery, not for proof."
53
-
54
- **Classic analogies**: Sound waves -> wave theory of light; Planetary orbits -> Bohr atomic model; Water flow -> electric current (voltage analogous to water pressure)
55
-
56
- ## Euler and the Basel Problem (1735)
57
-
58
- > Euler discovered Sum(1/n^2) = pi^2/6 by inductive reasoning -- the most celebrated inductive discovery in mathematics.
59
-
60
- **Inductive process**: Computed partial sums approximately 1.6449 -> recognized pi^2/6 -> drew an analogy between the infinite product of sin(x) and the root-coefficient relations of polynomials -> rigorous proof. Polya specifically used this to illustrate "plausible reasoning."
61
-
62
- ## Fermi Estimation
63
-
64
- > Solve unknowns via analogy and order-of-magnitude estimation.
65
-
66
- **Classic problem**: "How many piano tuners are there in Chicago?" Population ~3 million -> ~1 million households -> 1/20 own pianos -> ~50,000 pianos -> tuned once per year, 2 hours each -> tuner works 2000 hours/year -> approximately 50 tuners.
67
-
68
- **Value**: Reasonable analogical estimates yield order-of-magnitude correct results.
69
-
70
- ## Mill's Five Methods (1843)
71
-
72
- > Mill systematized inductive reasoning in *A System of Logic*.
73
-
74
- 1. **Method of Agreement**: Multiple instances share only one common circumstance -> that circumstance is likely the cause
75
- 2. **Method of Difference**: Two instances differ in only one circumstance -> that difference is likely the cause
76
- 3. **Joint Method**: Combining agreement and difference to strengthen credibility
77
- 4. **Method of Concomitant Variations**: A phenomenon varies as a certain circumstance varies -> causal relationship
78
- 5. **Method of Residues**: After subtracting the effects of known causes, remaining effects are explained by remaining causes
79
-
80
- ## Ramanujan: Intuitive Induction (1887-1920)
81
-
82
- > Ramanujan discovered formulas via astonishing pattern recognition, often without formal proof -- a genius of intuitive induction.
83
-
84
- **Examples**: Series for 1/pi extrapolated from a few terms to general form; mock theta functions (pattern described, proof delayed by decades). Hardy: "His intuition was almost supernatural, yet logical rigor was often lacking."
85
-
86
- **Lesson**: Inductive discovery can far outpace proof -- the tension between intuition and rigor is a driving force of mathematical progress.
87
-
88
- ## Borwein Integrals: A Cautionary Tale (2000s)
89
-
90
- > A pattern holds for many terms then suddenly breaks -- a profound warning about inductive reasoning.
91
-
92
- **Phenomenon**: Integral of sin(x)/x dx = pi/2; adding sin(x/3) still gives pi/2; ... continues through sin(x/13); but upon adding sin(x/15) it suddenly deviates! Mathematical root cause: the Patel-Vitali condition.
93
-
94
- **Lesson**: The first N cases may hold while case N+1 breaks the pattern. Inductive conclusions require theoretical support and cannot rely solely on empirical evidence.
95
-
96
- ## Lakatos's *Proofs and Refutations* (1963/1976)
97
-
98
- > Mathematical discovery evolves through counterexamples, monster-barring, and lemma-incorporation -- not a linear "conjecture -> proof" process.
99
-
100
- **Core concepts**: Monster-barring (modifying definitions to exclude counterexamples); Lemma-incorporation (adding the conditions of counterexamples to the premises); Concept-stretching (counterexamples driving the expansion of concepts)
101
-
102
- **Example**: The proof history of Euler's polyhedron formula V-E+F=2 -- from Cauchy's naive proof to successive corrections for holes and tunnels.
103
-
104
- ## Hume's Problem of Induction (1739)
105
-
106
- > "The sun has risen every day in the past; this does not logically guarantee it will rise tomorrow."
107
-
108
- **Fundamental flaw**: Deriving the infinite from the finite always carries uncertainty.
109
-
110
- **Scientific method's response**: Induction produces hypotheses (not theorems) -> falsifiable (Popper) -> continuously tested -> counterexamples lead to revision or abandonment
111
-
112
- ## Carnap's Inductive Logic (1950s)
113
-
114
- > Carnap attempted to formalize and quantify inductive reasoning -- a logical foundation for inductive probability.
115
-
116
- **Core idea**: Confirmation function c(h,e) -- the degree to which evidence e confirms hypothesis h. Inductive logic should have rigorous rules; prior probabilities should be based on logical symmetry rather than subjective belief.
117
-
118
- **Limitations**: The system is highly sensitive to the linguistic framework -- different predicate sets yield different degrees of confirmation; Goodman's "grue paradox" further reveals the difficulties.
119
-
120
- ## Problem of Underdetermination
121
-
122
- > Multiple analogies or theories can equally fit the same data -- data underdetermines theory choice.
123
-
124
- **Mathematical analogy**: Finitely many data points can be fit by infinitely many functions; multiple inductive hypotheses may be simultaneously consistent with experience; theory choice requires additional criteria: simplicity, explanatory power, predictive power.
125
-
126
- **Philosophical roots**: The Quine-Duhem thesis -- any hypothesis can be shielded from falsification by adjusting auxiliary hypotheses.
127
-
128
- ## Machine Learning as Induction
129
-
130
- > Machine learning is the engineering of inductive reasoning -- inferring general rules from data.
131
-
132
- **Statistical learning theory**: PAC learning (Valiant 1984) -- outputting a hypothesis with low error with high probability; generalization bounds -- the quantitative relationship between sample complexity and hypothesis class complexity; VC dimension -- a mathematical measure of "inductive capacity."
133
-
134
- **Contrast with mathematical induction**: Mathematical induction = deterministic reasoning over an infinite domain; statistical induction = probabilistic reasoning from finite samples; generalization = the inductive leap
135
-
136
- ## Power and Limits of Analogy
137
-
138
- **Power**: Transferring knowledge across domains (one of the most important sources of innovation); converting the unknown into the known; generating new ideas and hypotheses
139
-
140
- **Limits**: Analogy is not proof -- conclusions require independent verification; surface similarity does not imply structural similarity; every analogy has a breaking point -- two domains can never be perfectly isomorphic
@@ -1,154 +0,0 @@
1
- # 数学出处与经典文献 / Mathematical Sources and Classic Texts
2
-
3
- ## 数学归纳法 / Mathematical Induction (Pascal, 1654)
4
-
5
- **原理**:
6
- > 如果 P(1) 成立,且 P(n) → P(n+1),则 P(n) 对所有正整数 n 成立。
7
- > If P(1) holds and P(n) → P(n+1), then P(n) holds for all positive integers n.
8
-
9
- **哲学含义**:从"有限"推导"无限"——只需基础与递推两步 / Deriving "infinite" from "finite" — just base case and inductive step.
10
-
11
- **经典案例**:1+2+...+n = n(n+1)/2;Fibonacci 性质;图论证明
12
-
13
- ## 强归纳法 / Strong (Complete) Induction
14
-
15
- > 若 P(1)...P(k) 全部成立可推出 P(k+1),则 P(n) 对所有正整数成立。
16
- > If P(1)...P(k) all holding implies P(k+1), then P(n) holds for all n.
17
-
18
- **适用场景**:P(k+1) 依赖多个甚至全部前命题,而非仅 P(k) / When P(k+1) depends on many or all preceding propositions, not just P(k).
19
-
20
- **案例**:唯一分解定理 / Unique factorization;Fibonacci 递推 F(n)=F(n-1)+F(n-2);算术基本定理
21
-
22
- ## 结构归纳法 / Structural Induction
23
-
24
- > 对递归定义结构(列表、树、表达式),证明性质对基础元素成立且在递推步骤中保持,则对所有实例成立。
25
- > For recursively defined structures: prove property holds for base elements and is preserved under construction steps → holds for all instances.
26
-
27
- **计算机科学应用**:编译器正确性;类型系统安全性(良类型程序不崩溃);数据结构不变量(红黑树平衡);算法终止性证明
28
-
29
- **案例**:|L₁ ++ L₂| = |L₁| + |L₂|;树高度 ≤ 节点数
30
-
31
- ## 超限归纳法 / Transfinite Induction (Cantor Ordinals)
32
-
33
- > 若对所有 γ < β,P(γ) 成立可推出 P(β) 成立,则 P(α) 对所有序数 α 成立。
34
- > If P(γ) for all γ < β implies P(β), then P(α) holds for all ordinals α.
35
-
36
- **意义**:归纳超越自然数——对任意良序集成立 / Induction extends beyond naturals — applies to any well-ordered set.
37
-
38
- **关键概念**:Cantor 序数 ω, ω+1, ω·2, ω², ω^ω...;Zorn 引理等价性;应用:证明每个向量空间都有基
39
-
40
- ## 良序原理 / Well-Ordering Principle
41
-
42
- > 自然数的每个非空子集有最小元素,与数学归纳法逻辑等价。
43
- > Every nonempty subset of naturals has a least element; logically equivalent to mathematical induction.
44
-
45
- **等价论证**:良序→归纳:反例集有最小元 m,则 P(m-1) 成立而 P(m) 不成立,矛盾。归纳→良序:用归纳法证每个非空子集含最小元。
46
-
47
- **推广**:良序定理(Zermelo 1904)——任何集合可良序化,与选择公理等价。
48
-
49
- ## Pólya《数学与猜想》/ *Mathematics and Plausible Reasoning* (1954)
50
-
51
- > "归纳、类比、特例化、一般化——发现数学真理的主要方法。"
52
- > "Induction, analogy, specialization, generalization—principal methods of discovering mathematical truths."
53
-
54
- **归纳模式**:1. 观察案例 → 2. 发现模式 → 3. 提出猜想 → 4. 验证(证明或证伪)
55
-
56
- ## 类比的数学地位 / Mathematical Status of Analogy
57
-
58
- > "类比是发现的工具,不是证明的工具。" / "Analogy is a tool for discovery, not for proof."
59
-
60
- **经典类比**:声波→光波动理论;行星轨道→Bohr 原子模型;水流→电流(电压≈水压)
61
-
62
- ## Euler 与 Basel 问题 / Euler and the Basel Problem (1735)
63
-
64
- > Euler 通过归纳发现 ∑1/n² = π²/6 ——数学史上最著名的归纳发现。
65
- > Euler discovered ∑1/n² = π²/6 by inductive reasoning — the most celebrated inductive discovery in mathematics.
66
-
67
- **归纳过程**:计算部分和 ≈1.6449 → 识别 π²/6 → 类比 sin(x) 无穷乘积与多项式根系数关系 → 严格证明。Pólya 专门以此说明"合情推理"。
68
-
69
- ## Fermi 方法 / Fermi Estimation
70
-
71
- > 通过类比和数量级估计解决未知问题 / Solve unknowns via analogy and order-of-magnitude estimation.
72
-
73
- **经典问题**:"芝加哥有多少钢琴调音师?":人口~300万→~100万户→1/20有钢琴→~5万台→每年调1次×2小时→调音师2000小时/年→≈50名调音师
74
-
75
- **价值**:合理的类比估计可得数量级正确答案 / Reasonable analogy yields order-of-magnitude correct results.
76
-
77
- ## Mill 五种归纳方法 / Mill's Five Methods (1843)
78
-
79
- > Mill 在《逻辑体系》中系统化归纳推理 / Mill systematized inductive reasoning in *A System of Logic*.
80
-
81
- 1. **一致法 / Agreement**:多场合仅一共同情况→该情况可能为原因
82
- 2. **差异法 / Difference**:两场合仅一情况不同→该差异可能为原因
83
- 3. **联合法 / Joint Method**:一致+差异结合,增强可信度
84
- 4. **共变法 / Concomitant Variations**:现象随某情况变化而变化→因果关系
85
- 5. **残差法 / Residue**:扣除已知原因效应后,剩余效应由剩余原因解释
86
-
87
- ## Ramanujan:直觉归纳 / Ramanujan: Intuitive Induction (1887–1920)
88
-
89
- > Ramanujan 以惊人模式识别发现公式,常无形式证明——直觉归纳天才。
90
- > Ramanujan discovered formulas via astonishing pattern recognition, often without formal proof — genius of intuitive induction.
91
-
92
- **案例**:1/π 级数从少数项推广到一般形式;mock theta 函数(模式描述了,证明延迟数十年)。Hardy:"他的直觉近乎超自然,但逻辑常缺。"
93
-
94
- **教训**:归纳发现可远超前于证明——直觉与严格性的张力是数学发展的动力。
95
-
96
- ## Borwein 积分:归纳警醒 / Borwein Integrals: Cautionary Tale (2000s)
97
-
98
- > 模式持续很久然后突然断裂——归纳推理的深刻警示。
99
- > A pattern holds for many terms then suddenly breaks — a profound warning about inductive reasoning.
100
-
101
- **现象**:∫sin(x)/x dx = π/2;加入 sin(x/3) 仍 = π/2;...持续到 sin(x/13);但加入 sin(x/15) 时突然偏离!数学根源:Patel-Vital 条件。
102
-
103
- **教训**:前 N 个案例成立,第 N+1 个可能打破模式。归纳结论需理论支撑,不能仅依赖经验 / First N cases may hold while case N+1 breaks. Inductive conclusions need theoretical support.
104
-
105
- ## Lakatos《证明与反驳》/ *Proofs and Refutations* (1963/1976)
106
-
107
- > 数学发现不是线性"猜想→证明",而是通过反驳、怪物排除、引理嵌入不断演进。
108
- > Mathematical discovery evolves through counterexamples, monster-barring, and lemma-incorporation — not linear "conjecture→proof".
109
-
110
- **核心概念**:怪物排除 / Monster-barring(修改定义排除反例);引理嵌入 / Lemma-incorporation(将反例条件加入前提);概念拉伸 / Concept-stretching(反例推动概念扩展)
111
-
112
- **案例**:多面体 Euler 公式 V-E+F=2 的证明生成——从 Cauchy 朴素证明到对空洞、隧道的逐步修正。
113
-
114
- ## Hume 归纳问题 / Hume's Problem of Induction (1739)
115
-
116
- > "过去太阳每天升起,不能逻辑保证明天也会升起。"
117
- > "The sun has risen every day in the past; this does not logically guarantee it will rise tomorrow."
118
-
119
- **本质缺陷**:从有限到无限永远存在不确定性 / Deriving infinite from finite always carries uncertainty.
120
-
121
- **科学方法解决**:归纳产假说(非定理)→ 可证伪(Popper)→ 持续检验 → 反例则修正/放弃
122
-
123
- ## Carnap 归纳逻辑 / Carnap's Inductive Logic (1950s)
124
-
125
- > Carnap 试图形式化量化归纳推理——为归纳概率建立逻辑基础。
126
- > Carnap attempted to formalize and quantify inductive reasoning — a logical foundation for inductive probability.
127
-
128
- **核心**:确证函数 c(h,e)——证据 e 对假说 h 的确证度 / Confirmation function c(h,e): degree of confirmation. 归纳逻辑应有严格规则;先验概率基于逻辑对称性而非主观信念。
129
-
130
- **局限**:系统对语言框架高度敏感——不同谓词集导致不同确证度;Goodman "绿蓝悖论"(grue paradox) 进一步揭示困难。
131
-
132
- ## 不充分决定 / Problem of Underdetermination
133
-
134
- > 多个类比或理论可同等吻合同一数据——数据不充分决定理论选择。
135
- > Multiple analogies or theories equally fit the same data — data underdetermines theory choice.
136
-
137
- **数学类比**:有限数据点→无数函数可拟合;多个归纳假说可能同时与经验一致;理论选择需额外准则:简洁性、解释力、预测力。
138
-
139
- **哲学根源**:Quine-Duhem 论题——任何假说可通过调整辅助假说免于证伪。
140
-
141
- ## 机器学习作为归纳 / Machine Learning as Induction
142
-
143
- > 机器学习是归纳推理的工程化——从数据推断一般规律。
144
- > Machine learning is the engineering of inductive reasoning — inferring general rules from data.
145
-
146
- **统计学习理论**:PAC 学习(Valiant 1984)——以高概率输出低误差假说;泛化界限——样本复杂度与假说类复杂度定量关系;VC 维度——衡量"归纳能力"的数学指标。
147
-
148
- **与数学归纳对比**:数学归纳=无限域确定性推理;统计归纳=有限样本概率性推理;泛化=归纳跳跃
149
-
150
- ## 类比思维的力量与局限 / Power and Limits of Analogy
151
-
152
- **力量**:跨领域迁移知识(最重要创新来源之一);将未知转化为已知;产生新思路和假说
153
-
154
- **局限**:类比不是证明——结论需独立验证;表面相似 ≠ 结构相似;每个类比有失效点——两个领域不可能完全同构
@@ -1,134 +0,0 @@
1
- ---
2
- name: information-theory
3
- description: |
4
- Trigger when a problem needs to quantify uncertainty, measure information value as "information = reduction of uncertainty"; or compute entropy / mutual information / KL divergence / channel capacity, or design information criteria for compression / KV-cache compression / quantization / routing.
5
- ---
6
-
7
- # 📡 Information Theory
8
-
9
- > "Information is reduction of uncertainty — knowing more means doubting less."
10
- >
11
- > — Information Theory, Coding Theory, Statistical Inference
12
-
13
- ## Core Principle
14
-
15
- **Information is reduction of uncertainty — uncertainty is precisely quantified by entropy; compression and communication have unbreakable limits set by the entropy bound and channel capacity; information gain guides which observation to prioritize under uncertainty.**
16
-
17
- > **Mathematical Formalization**
18
- >
19
- > Shannon entropy $H(X) = -\sum_x p(x)\log p(x)$ quantifies the average "surprise" of a random variable — the lower the probability of an event, the greater the surprise when it occurs; entropy is the expected value of surprise.
20
- >
21
- > Mutual information $I(X;Y) = H(X) - H(X|Y) = \sum_{x,y} p(x,y)\log\frac{p(x,y)}{p(x)p(y)}$ measures the reduction in uncertainty about $X$ after observing $Y$ — this is precisely the mathematical definition of "information."
22
- >
23
- > KL divergence $D_{KL}(P\|Q) = \sum_x p(x)\log\frac{p(x)}{q(x)}$ measures the information loss when $Q$ is used in place of $P$; it is **asymmetric**: $D(P\|Q)\neq D(Q\|P)$.
24
- >
25
- > Source coding theorem: The average code length of the optimal compression satisfies $\ge H(X)$ bits/symbol; compression below the entropy bound inevitably loses information.
26
- >
27
- > Channel coding theorem: The upper bound on the rate of reliable communication is the channel capacity $C = \max_{p(x)} I(X;Y)$; when $R<C$, there exist codes that drive the error rate to zero; when $R>C$, reliable communication is impossible.
28
- >
29
- > Rate-distortion function $R(D) = \min_{p(\hat{x}|x):\,\mathbb{E}[d(x,\hat{x})]\le D} I(X;\hat{X})$ gives the minimum information rate for a given distortion $D$ — the fundamental limit of lossy compression.
30
- >
31
- > See `original-texts.md` for detailed mathematical foundations.
32
-
33
- ## GPU-Friendliness (Cross-Cutting Check)
34
-
35
- When information-theoretic quantities are used for **compression/pruning/quantization/KV-cache compression/routing design**, they must pass the `../../references/gpu-friendly-math.md` eight-dimension gate. Core criterion: **local, fusible entropy/KL estimation = friendly; global exact information estimation = unfriendly**.
36
-
37
- - **Quantization calibration (per-block entropy/Hessian)**: Local, batchable via GEMM, feasible at low precision — friendly (dimensions 1/2/5).
38
- - **KV-Cache compression (information bottleneck/block summary)**: Low-rank block summary compresses memory — friendly (dimension 4); Plücker-style block summaries are discussed in `../../references/books/algebraic-geometry-rising-sea.md`.
39
- - **Mutual information pruning / feature selection**: Adaptable if $I(X;Y)$ is estimated using local or low-rank approximations; unfriendly if full-distribution exact estimation is required.
40
- - **Information gain routing**: Global exact $I(X;Y)$ requires $O(n^2)$ memory, high precision, and is unfusable — anti-pattern; replace with continuous differentiable approximations such as softmax/tropical gating (dimensions 3/6/8).
41
- - **Anti-pattern**: Computing exact entropy/mutual information over the full token distribution — memory explosion, requires fp64, serial dependencies — "beautiful but intractable."
42
-
43
- Eight-dimension minimum criteria (formal terms): **Tensorization** checks whether entropy/KL/MI can be estimated per token/block/batch; **GEMM-mappability** checks whether compression, projection, and calibration reduce to linear algebra; **complexity** avoids full-distribution exact estimation; **memory and KV-cache** quantifies KV/activation/codebook footprint; **low-precision stability** checks log/softmax/KL dynamic range; **parallelism and communication** checks whether block-wise statistics can be reduced across devices; **sparse structure** checks whether codebooks/routing are block-structured; **operator fusion** checks whether statistics, masking, and quantization can be fused.
44
-
45
- > Used together with `../../references/books/matrix-analysis.md` (low-rank compression), `../../references/books/abstract-algebra.md` (coding/finite fields).
46
-
47
- ## When NOT to Use
48
-
49
- - **The problem has no probabilistic structure** (e.g., purely symbolic reasoning, logical deduction) — entropy and information gain require probability distributions; without probability there is no information theory.
50
- - **Purely deterministic scenarios with no uncertainty** (e.g., mathematical problems with known exact answers) — when entropy is zero, information theory degenerates to trivial conclusions.
51
- - **Qualitative judgments that need no quantification** (e.g., aesthetic evaluations, emotional judgments) — information theory quantifies uncertainty in the probabilistic sense, not semantic ambiguity.
52
-
53
- ## When to Use
54
-
55
- - Measuring the magnitude of uncertainty (entropy $H(X)$ quantifies the "disorder" of a random variable).
56
- - Comparing the value of different information sources (mutual information $I(X;Y)$ measures which observation $Y$ best reduces uncertainty about $X$).
57
- - Achieving optimal data compression (the source coding theorem guarantees the optimal compression limit is $H(X)$ bits/symbol).
58
- - Communicating reliably under noise (the channel coding theorem guarantees reliable transmission is feasible when $R<C$).
59
- - Feature selection or model selection (mutual information screens features; AIC/BIC/MDL serve as information criteria for model selection).
60
- - Bayesian model comparison (KL divergence $D(P\|Q)$ measures the information distance between distributions; Bayes factors quantify the evidence ratio between models).
61
- - **Designing information criteria for compression / KV-cache compression / quantization / routing**, and evaluating their GPU feasibility.
62
-
63
- ## Method
64
-
65
- ### Step 1: Identify Source and Uncertainty
66
- - What is the **random variable $X$**? — Define the information source and clarify the object of uncertainty.
67
- - The **probability distribution $p(x)$** — use a probability table for discrete distributions, a density function for continuous distributions.
68
- - **Compute $H(X) = -\sum p(x)\log p(x)$** — quantify the current level of uncertainty.
69
- - **Identify the uncertainty to be reduced** — clarify "knowing what would reduce uncertainty?"
70
-
71
- ### Step 2: Quantify Information Gain
72
- - **Compute conditional entropy $H(X|Y)$** — the residual uncertainty about $X$ after observing $Y$.
73
- - **Compute mutual information $I(X;Y) = H(X) - H(X|Y)$** — the amount of information $Y$ provides about $X$.
74
- - **Identify the optimal observation** — which $Y$ maximizes $I(X;Y)$? That observation is the most worth acquiring.
75
- - **Chain rule** — $H(X_1,\dots,X_n) = H(X_1) + H(X_2|X_1) + \dots + H(X_n|X_1,\dots,X_{n-1})$, decomposing joint uncertainty variable by variable.
76
-
77
- ### Step 3: Choose Coding Strategy
78
- - **Source coding (compression)**: Huffman coding (greedy optimal prefix code, average length approaching $H(X)$), arithmetic coding (closer to the entropy bound), universal coding (LZ77/LZ78/LZW, no prior distribution needed).
79
- - **Channel coding (error correction)**: Hamming codes (minimum distance 3, corrects 1-bit errors), Reed–Solomon codes (burst error correction), LDPC/Turbo codes (approaching the Shannon limit).
80
- - **Coding selection principle**: Compression needs → source coding → approach $H(X)$; noise protection needs → channel coding → approach the Shannon limit ($R\to C$).
81
-
82
- ### Step 4: Evaluate Channel Capacity
83
- - **Compute channel capacity $C = \max_{p(x)} I(X;Y)$** — maximize mutual information over all input distributions.
84
- - **Compare transmission rate $R$ with capacity $C$**: $R<C$ → reliable communication is feasible; $R>C$ → errors are inevitable.
85
- - **Noise models**: BSC (binary symmetric channel, flip probability $p$), BEC (binary erasure channel, erasure probability $\varepsilon$), AWGN (additive white Gaussian noise channel).
86
- - **Capacity formula examples**: BSC capacity $C = 1 - H(p)$; AWGN capacity $C = \frac{1}{2}\log(1 + S/N)$.
87
-
88
- ### Step 5: Apply Information Criteria
89
- - **AIC (Akaike Information Criterion)**: $\text{AIC} = -2\ln L + 2k$ — favors goodness of fit, suited for prediction objectives.
90
- - **BIC (Bayesian Information Criterion)**: $\text{BIC} = -2\ln L + k\ln n$ — favors parsimony, suited for explanation objectives.
91
- - **KL divergence $D_{KL}(P\|Q) = \sum p(x)\log\frac{p(x)}{q(x)}$** — measures the information loss when $Q$ is used in place of $P$; note the asymmetry.
92
- - **MDL principle (Minimum Description Length)**: Choose the model that minimizes "data description length + model description length" — the information-theoretic version of Occam's razor.
93
-
94
- ### Step 6: Make Information-Optimal Decision
95
- - **Bayesian experimental design**: Choose the experiment that maximizes expected information gain $\max\,\mathbb{E}[I(\theta;Y)]$ — prioritize acquiring the data that most reduces uncertainty.
96
- - **Minimize KL divergence**: The output distribution $Q$ of a decision should be as close as possible to the target distribution $P$, i.e., $\min D(P\|Q)$.
97
- - **Maximum entropy principle**: Under known constraints, choose the distribution that maximizes $H(X)$ — fewest assumptions, most conservative inference.
98
- - **Information bottleneck**: $\min I(X;T) - \beta I(T;Y)$ — when compressing $X$ into $T$, retain the maximum relevant information about $Y$.
99
-
100
- ## Common Errors
101
-
102
- | Error | Critique | Correct Approach |
103
- |-------|----------|-----------------|
104
- | Equating information with bits rather than probabilistic reduction | Entropy $H(X)$ is a function of the probability distribution; bits are merely the unit of measurement | Understand information as reduction of uncertainty: $I(X;Y)=H(X)-H(X\|Y)$ |
105
- | Ignoring channel capacity limits | When $R>C$, no coding scheme achieves reliable communication | Compute capacity $C=\max I(X;Y)$ and ensure $R<C$ |
106
- | Confusing entropy with variance | Entropy measures the "spread" of the probability structure; variance measures the "spread" of numerical values; they are not equivalent | Use entropy for probabilistic uncertainty; use variance for numerical deviation; continuous entropy can be negative |
107
- | Over-compressing below the entropy bound | Optimal compression satisfies $\ge H(X)$ bits/symbol; compression below this bound inevitably loses information | Accept the entropy bound and design codes accordingly |
108
- | Ignoring the asymmetry of KL divergence | $D(P\|Q)\ne D(Q\|P)$; the direction determines the meaning | Be explicit about direction: $D(P\|Q)$ means "the extra cost of encoding $P$ using $Q$" |
109
- | Equating correlation with information | Correlation $\rho$ measures only linear association; $I(X;Y)=0 \Leftrightarrow$ independence, but $\rho=0 \not\Rightarrow$ independence | Use mutual information $I(X;Y)$ to assess dependence |
110
- | Forcing quantification on qualitative judgments | Information theory quantifies probabilistic uncertainty, not semantic ambiguity or subjective experience | Distinguish probabilistic uncertainty from semantic ambiguity; do not apply entropy formulas to qualitative problems |
111
- | Global exact entropy / mutual information is intractable | Exact estimation of $I(X;Y)$ over the full distribution requires $O(n^2)$ memory and high precision; infeasible on GPU | Use local/sampled/low-rank estimation; pass the GPU eight-dimension gate |
112
-
113
- ## Operating Procedure
114
-
115
- When this skill is triggered, the output must include:
116
-
117
- 1. **[Information source]: [description]** $H(X)=$ [value] — define the random variable $X$, compute its entropy, and quantify the current uncertainty.
118
- 2. **[Information gain]: [description]** $I(X;Y)=$ [value] — compute mutual information and identify the most valuable observation $Y$.
119
- 3. **[Coding strategy]: [choice]** — source coding (compression) or channel coding (error correction), stating which limit is being approached.
120
- 4. **[Channel capacity]: [description]** $C=$ [value] — compute channel capacity and compare transmission rate $R$ with $C$.
121
- 5. **[Information criterion]: [AIC/BIC/KL/MDL]** — state the chosen information criterion and the rationale.
122
- 6. **[Optimal decision]: [explanation]** — decision recommendation based on information gain maximization or KL divergence minimization.
123
- 7. **[GPU feasibility]** (if used for compression/KV-cache compression/quantization/routing) — is entropy/KL/mutual information estimation local and fusible, or global and exact? Pass the eight-dimension gate; annotate as friendly / retrofittable / unfriendly + adaptation suggestions.
124
-
125
- **The output must not present analysis alone without a conclusion.**
126
-
127
- ## Relations to Other Skills
128
-
129
- - **Probability and statistics**: Entropy and information gain complement probabilistic reasoning — $H(X)$ measures distributional uncertainty, and $I(X;Y)$ is the information-theoretic expression of Bayesian updating.
130
- - **Optimization thinking**: Channel capacity maximization is an optimization problem — $C=\max_{p(x)} I(X;Y)$ is optimization over input distributions.
131
- - **Transformation thinking**: Coding is a transformation of the information space — source coding transforms into efficient representations; channel coding transforms into noise-resistant representations.
132
- - **Modeling thinking**: Information criteria guide model selection — AIC/BIC/MDL quantify the fit-complexity trade-off from an information-theoretic perspective.
133
- - **Algorithmic thinking**: Compression algorithms are computational implementations — Huffman/LZ/LDPC and related algorithms are approximation implementations of information-theoretic limits.
134
- - **Modern mathematics activation**: `../../references/books/matrix-analysis.md` (low-rank compression), `../../references/books/abstract-algebra.md` (coding/finite fields), `../../references/books/algebraic-geometry-rising-sea.md` (Plücker KV compression).