math-skill 2.1.0 → 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 (234) hide show
  1. package/README.en-US.md +159 -200
  2. package/README.md +159 -200
  3. package/agents/math-critic.en.md +2 -2
  4. package/agents/math-critic.md +8 -8
  5. package/commands/ask.md +3 -10
  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 +29 -218
  97. package/knowledge-base/overview.md +29 -220
  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 +9 -3
  145. package/references/books/abstract-algebra.md +5 -5
  146. package/references/books/algebraic-geometry-rising-sea.md +5 -5
  147. package/references/books/differential-geometry.md +3 -3
  148. package/references/books/matrix-analysis.md +4 -4
  149. package/references/books/micro-lie-theory.md +3 -3
  150. package/references/books/optimization-ml.md +1 -1
  151. package/references/books/smooth-manifolds.md +3 -3
  152. package/references/gpu-friendly-math.en.md +8 -8
  153. package/references/gpu-friendly-math.md +2 -2
  154. package/references/inspiration.en.md +1 -1
  155. package/references/inspiration.md +2 -2
  156. package/skills/math-research-activator/SKILL.en.md +161 -106
  157. package/skills/math-research-activator/SKILL.md +162 -110
  158. package/skills/math-research-activator/original-texts.en.md +9 -9
  159. package/skills/math-research-activator/original-texts.md +11 -11
  160. package/commands/abstraction.md +0 -11
  161. package/commands/algorithmic-thinking.md +0 -11
  162. package/commands/axiomatization.md +0 -11
  163. package/commands/causal-inference.md +0 -11
  164. package/commands/discrete-combinatorial.md +0 -11
  165. package/commands/game-theory.md +0 -11
  166. package/commands/induction-analogy.md +0 -11
  167. package/commands/information-theory.md +0 -11
  168. package/commands/logic-deduction.md +0 -11
  169. package/commands/modeling.md +0 -11
  170. package/commands/optimization.md +0 -11
  171. package/commands/probability-statistics.md +0 -11
  172. package/commands/symmetry-invariance.md +0 -11
  173. package/commands/topological-thinking.md +0 -11
  174. package/commands/transformation.md +0 -11
  175. package/skills/abstraction/SKILL.en.md +0 -117
  176. package/skills/abstraction/SKILL.md +0 -121
  177. package/skills/abstraction/original-texts.en.md +0 -163
  178. package/skills/abstraction/original-texts.md +0 -175
  179. package/skills/algorithmic-thinking/SKILL.en.md +0 -132
  180. package/skills/algorithmic-thinking/SKILL.md +0 -138
  181. package/skills/algorithmic-thinking/original-texts.en.md +0 -253
  182. package/skills/algorithmic-thinking/original-texts.md +0 -256
  183. package/skills/axiomatization/SKILL.en.md +0 -144
  184. package/skills/axiomatization/SKILL.md +0 -151
  185. package/skills/axiomatization/original-texts.en.md +0 -154
  186. package/skills/axiomatization/original-texts.md +0 -160
  187. package/skills/causal-inference/SKILL.en.md +0 -147
  188. package/skills/causal-inference/SKILL.md +0 -151
  189. package/skills/causal-inference/original-texts.en.md +0 -136
  190. package/skills/causal-inference/original-texts.md +0 -167
  191. package/skills/discrete-combinatorial/SKILL.en.md +0 -124
  192. package/skills/discrete-combinatorial/SKILL.md +0 -131
  193. package/skills/discrete-combinatorial/original-texts.en.md +0 -184
  194. package/skills/discrete-combinatorial/original-texts.md +0 -185
  195. package/skills/game-theory/SKILL.en.md +0 -117
  196. package/skills/game-theory/SKILL.md +0 -123
  197. package/skills/game-theory/original-texts.en.md +0 -131
  198. package/skills/game-theory/original-texts.md +0 -131
  199. package/skills/induction-analogy/SKILL.en.md +0 -145
  200. package/skills/induction-analogy/SKILL.md +0 -152
  201. package/skills/induction-analogy/original-texts.en.md +0 -140
  202. package/skills/induction-analogy/original-texts.md +0 -154
  203. package/skills/information-theory/SKILL.en.md +0 -134
  204. package/skills/information-theory/SKILL.md +0 -140
  205. package/skills/information-theory/original-texts.en.md +0 -127
  206. package/skills/information-theory/original-texts.md +0 -127
  207. package/skills/logic-deduction/SKILL.en.md +0 -130
  208. package/skills/logic-deduction/SKILL.md +0 -135
  209. package/skills/logic-deduction/original-texts.en.md +0 -160
  210. package/skills/logic-deduction/original-texts.md +0 -173
  211. package/skills/modeling/SKILL.en.md +0 -135
  212. package/skills/modeling/SKILL.md +0 -139
  213. package/skills/modeling/original-texts.en.md +0 -162
  214. package/skills/modeling/original-texts.md +0 -165
  215. package/skills/optimization/SKILL.en.md +0 -129
  216. package/skills/optimization/SKILL.md +0 -135
  217. package/skills/optimization/original-texts.en.md +0 -167
  218. package/skills/optimization/original-texts.md +0 -168
  219. package/skills/probability-statistics/SKILL.en.md +0 -146
  220. package/skills/probability-statistics/SKILL.md +0 -151
  221. package/skills/probability-statistics/original-texts.en.md +0 -191
  222. package/skills/probability-statistics/original-texts.md +0 -193
  223. package/skills/symmetry-invariance/SKILL.en.md +0 -135
  224. package/skills/symmetry-invariance/SKILL.md +0 -139
  225. package/skills/symmetry-invariance/original-texts.en.md +0 -206
  226. package/skills/symmetry-invariance/original-texts.md +0 -221
  227. package/skills/topological-thinking/SKILL.en.md +0 -124
  228. package/skills/topological-thinking/SKILL.md +0 -128
  229. package/skills/topological-thinking/original-texts.en.md +0 -134
  230. package/skills/topological-thinking/original-texts.md +0 -164
  231. package/skills/transformation/SKILL.en.md +0 -120
  232. package/skills/transformation/SKILL.md +0 -124
  233. package/skills/transformation/original-texts.en.md +0 -204
  234. package/skills/transformation/original-texts.md +0 -216
@@ -1,164 +0,0 @@
1
- # 数学出处与经典文献 / Mathematical Sources and Classic Texts
2
-
3
- ## 欧拉示性数 / Euler Characteristic (Euler, 1752)
4
-
5
- > "对于任何凸多面体,顶点数 - 边数 + 面数 = 2。"
6
- > "For any convex polyhedron, the number of vertices minus edges plus faces equals 2."
7
-
8
- **Leonhard Euler**(1707-1783)在 1752 年发现了多面体的这一不变量:
9
-
10
- V - E + F = 2
11
-
12
- 这一公式看似简单,实则深刻——它对所有凸多面体成立,无论多面体是立方体(8-12+6=2)、四面体(4-6+4=2)还是十二面体(20-30+12=2)。欧拉示性数是曲面的拓扑不变量:连续变形不改变 χ 的值。球面 χ = 2,环面 χ = 0,双环面 χ = -2——每增加一个洞,χ 减少 2。
13
-
14
- **推广**:对任意曲面 S,χ(S) = 2 - 2g(可定向,亏格 g)或 χ(S) = 2 - g(不可定向,亏格 g)。欧拉示性数与可定向性共同构成紧致曲面的完全分类不变量。
15
-
16
- This formula seems simple but is profound — it holds for all convex polyhedra, whether cube (8-12+6=2), tetrahedron (4-6+4=2), or dodecahedron (20-30+12=2). The Euler characteristic is a topological invariant of surfaces: continuous deformations do not change χ. Sphere χ = 2, torus χ = 0, double torus χ = -2 — each additional hole reduces χ by 2. Generalization: for any surface S, χ(S) = 2 - 2g (orientable, genus g) or χ(S) = 2 - g (non-orientable, genus g). Euler characteristic and orientability together form a complete set of classification invariants for compact surfaces.
17
-
18
- ## Poincaré 猜想与 Perelman 证明 / Poincaré Conjecture & Perelman's Proof (2004)
19
-
20
- > "每一个单连通的紧致三维流形都同胚于三维球面 S³。"
21
- > "Every simply-connected closed 3-manifold is homeomorphic to the 3-sphere S³."
22
-
23
- **Henri Poincaré**(1854-1912)在 1904 年提出这一猜想——它成为数学史上最著名的未解问题之一,困扰数学家整整一百年。
24
-
25
- **Grigori Perelman**(1966-)在 2002-2003 年间在网上发布三篇论文,利用 **Ricci 流**(Hamilton 提出的微分几何工具)结合手术(surgery)技术完成了证明。Perelman 拒绝了 2006 年的 Fields 奖和 2010 年的 Clay 千禧奖百万美元奖金——数学史上最戏剧性的一幕。
26
-
27
- **Ricci 流**的直觉:流形上的度量随时间演化,使得曲率趋于均匀——就像热传导使温度分布趋于均匀。当曲率集中在某处时("脖子"),用手术切除并补上标准球面,继续 Ricci 流。最终流形被分解为若干几何片(Thurston 的几何化猜想),每片都有标准度量——Poincaré 猜想是几何化猜想的特例。
28
-
29
- Perelman's proof used **Ricci flow** (a tool introduced by Hamilton) combined with surgery. The intuition: the metric on a manifold evolves over time, making curvature tend toward uniformity — like heat diffusion making temperature uniform. When curvature concentrates at a "neck," surgery cuts it out and caps it with a standard sphere, then Ricci flow continues. The manifold is eventually decomposed into geometric pieces (Thurston's geometrization conjecture); Poincaré is a special case. Perelman declined the 2006 Fields Medal and 2010 Clay Millennium Prize — the most dramatic episode in mathematical history.
30
-
31
- ## 基本群 / Fundamental Group (Poincaré, 1895)
32
-
33
- > "基本群 π₁(X) 是所有基于基点的环路在同伦变形下的等价类——它捕获空间的'不可收缩环路'结构。"
34
- > "The fundamental group π₁(X) consists of equivalence classes of loops based at a point modulo homotopic deformation — it captures the 'non-contractible loops' structure of a space."
35
-
36
- **Poincaré** 在 1895 年的论文 *Analysis Situs* 中引入了基本群的概念——这是代数拓扑的奠基之作。
37
-
38
- 核心例子:
39
- - **π₁(S¹) = Z**——圆周上的环路按绕圈次数分类:绕 n 次的环路不能连续变形为绕 m 次的环路(n ≠ m)
40
- - **π₁(S²) = 0**——球面上所有环路都可收缩为一点——球面"没有洞"
41
- - **π₁(环面) = Z × Z**——两个独立方向的绕圈,组合为 (m, n) 绕圈次数
42
- - **π₁(实射影平面 RP²) = Z₂**——只有两类环路:可收缩的(绕偶数次)和不可收缩的(绕奇数次)
43
-
44
- **关键性质**:同胚空间有同构的基本群(拓扑不变量);但基本群不是完备不变量——不同空间可以有相同的基本群(如 S² 和 S³ 的 π₁ 都是 0,但它们不同胚)。
45
-
46
- Core examples: π₁(S¹) = Z (winding number classifies loops); π₁(S²) = 0 (all loops contractible — sphere has "no holes"); π₁(torus) = Z × Z (winding in two independent directions); π₁(RP²) = Z₂ (even vs odd winding). Key property: homeomorphic spaces have isomorphic fundamental groups (topological invariant); but π₁ is not a complete invariant — different spaces can share the same π₁ (e.g., S² and S³ both have π₁ = 0 but are not homeomorphic).
47
-
48
- ## 同调群 / Homology Groups
49
-
50
- > "同调群 H_n(X) 计算空间中 n 维'洞'的数量——它将拓扑直觉转化为可计算的代数量。"
51
- > "Homology groups H_n(X) count n-dimensional 'holes' in a space — translating topological intuition into computable algebraic quantities."
52
-
53
- **单纯同调的计算流程**:
54
- 1. 构造单纯复形 K(用三角形/四面体等单纯形近似空间)
55
- 2. 定义边界算子 ∂_n: C_n → C_{n-1}(每个 n-单纯形的边界是 (n-1)-单纯形的组合)
56
- 3. 关键性质 ∂² = 0(边界的边界为零)
57
- 4. 同调群 H_n(K) = ker(∂_n) / im(∂_{n+1})——"环路"模去"边界"——真正的洞不是任何更高维单纯形的边界
58
-
59
- **直觉**:H₀ = 连通分量数(零维"洞"= 分离的碎片),H₁ = 1 维洞数(不可填充的环路),H₂ = 2 维空洞数(不可填充的空腔)。Betti 数 β_n = rank H_n(X) 是洞的计数。
60
-
61
- **同调 vs 同伦**:H₁(X) 是 π₁(X) 的 Abel 化(H₁ = π₁/[π₁, π₁],去掉交换子的约束)。同调计算更容易(线性代数),但信息更少(丢失了非交换结构);同伦信息更丰富但计算更难。选择取决于问题需求——需要精细分类用 π₁,需要快速计算用 H₁。
62
-
63
- Simplicial homology computation: (1) build simplicial complex K; (2) define boundary operator ∂_n: C_n → C_{n-1}; (3) key property ∂² = 0; (4) H_n(K) = ker(∂_n) / im(∂_{n+1}) — "cycles" modulo "boundaries" — true holes are not boundaries of higher-dimensional simplices. Intuition: H₀ = connected components, H₁ = 1-holes (unfillable loops), H₂ = 2-voids (unfillable cavities). Betti numbers β_n = rank H_n. Homology vs homotopy: H₁(X) = π₁(X) abelianized. Homology is easier to compute (linear algebra) but less informative; homotopy is richer but harder. Choose based on needs — π₁ for fine classification, H₁ for fast computation.
64
-
65
- ## 拓扑数据分析 / Topological Data Analysis (Carlsson, 2009)
66
-
67
- > "持续同调让数据'说话'——它发现的不是均值和方差,而是数据的形状。"
68
- > "Persistent homology lets data 'speak' — it discovers not means and variances, but the shape of data."
69
-
70
- **Gunnar Carlsson**(Stanford)在 2009 年创立了 Ayasdi 公司,将持续同调推向应用。
71
-
72
- **持续同调的计算流程**:
73
- 1. 从点云数据出发,构造滤流(filtration):从小到大改变邻域半径 ε
74
- 2. 对每个 ε,构建 Vietoris-Rips 复形 VR_ε(距离 ≤ ε 的点对连线,三点互距 ≤ ε 则填三角形)
75
- 3. 对每个 ε 计算同调群 H_n(VR_ε)
76
- 4. 记录每个拓扑特征的"出生时间"(ε_birth)和"死亡时间"(ε_death)
77
- 5. 输出条形码图(barcode)或持续图(persistence diagram: 点 (ε_birth, ε_death))
78
-
79
- **稳定性定理**:持续图之间的 Wasserstein 蕴距离 ≤ 数据之间的 Hausdorff 蕴距离——数据的微小扰动只导致持续图的微小变化。这保证了 TDA 的鲁棒性:噪声产生短条,真实特征产生长条。
80
-
81
- **应用**:肿瘤基因数据的拓扑结构发现新的癌症亚型;传感器网络覆盖空洞检测;材料科学中相变拓扑标志;金融市场中市场崩溃前的拓扑预警。
82
-
83
- Computation: (1) from point cloud, build filtration by varying neighborhood radius ε; (2) for each ε, construct Vietoris-Rips complex; (3) compute H_n at each ε; (4) record birth and death times; (5) output barcode or persistence diagram. Stability theorem: Wasserstein distance between diagrams ≤ Hausdorff distance between data — small data perturbation → small diagram perturbation. Noise produces short bars, real features produce long bars. Applications: tumor genomic topology revealing new cancer subtypes; sensor network coverage hole detection; phase transition signatures in materials science; topological early warning of market crashes in finance.
84
-
85
- ## Brouwer 不动点定理 / Brouwer Fixed Point Theorem (1911)
86
-
87
- > "每一个连续映射 f: Dⁿ → Dⁿ 都有不动点——即存在 x₀ 使得 f(x₀) = x₀。"
88
- > "Every continuous map f: Dⁿ → Dⁿ has a fixed point — there exists x₀ with f(x₀) = x₀."
89
-
90
- **L.E.J. Brouwer**(1881-1966)在 1911 年证明此定理——讽刺的是,Brouwer 后来成为直觉主义的创始人,反对他自己定理所依赖的排中律。
91
-
92
- **直觉**:搅动杯中的咖啡,停搅后必有至少一点回到原位——因为搅动是圆盘上的连续映射,必有不动点。
93
-
94
- **应用**:
95
- - **博弈论**(Nash,1950):Nash 均衡的存在性依赖于 Brouwer 不动点定理——每个有限博弈至少存在一个混合策略 Nash 均衡
96
- - **经济学**:一般均衡理论(Arrow-Debreu)的不动点证明——市场均衡的存在性
97
- - **微分方程**:Peano 存在定理的证明用到不动点方法
98
-
99
- Intuition: stir coffee in a cup, stop — some point must return to its original position, since stirring is a continuous map on a disk, which must have a fixed point. Applications: Nash equilibrium existence (Nash 1950) — every finite game has at least one mixed-strategy Nash equilibrium; economics — general equilibrium theory (Arrow-Debreu) uses fixed-point proof; differential equations — Peano existence theorem via fixed-point methods.
100
-
101
- ## Jordan 曲线定理 / Jordan Curve Theorem
102
-
103
- > "R² 中每条简单闭曲线将平面分成两个区域——内部和外部。"
104
- > "Every simple closed curve in R² divides the plane into two regions — interior and exterior."
105
-
106
- **看似显然却极难证明**——Jordan(1892)的原始证明有漏洞,Veblen(1905)给出第一个严格证明。定理的困难在于:闭曲线可以有极其复杂的拓扑行为(如 Osgood 曲线,面积可以任意大),直觉上的"显然"在数学上需要精细的拓扑论证。
107
-
108
- **推广**:Jordan-Brouwer 分离定理——Rⁿ 中每个与 S^{n-1} 同胚的子集将 Rⁿ 分成两个连通区域。维数越高,证明越复杂。
109
-
110
- Seemingly obvious yet extremely hard to prove — Jordan's original proof (1892) had gaps; Veblen (1905) gave the first rigorous proof. The difficulty: closed curves can have extremely complex topological behavior (e.g., Osgood curves with arbitrarily large area); what seems "obvious" intuitively requires fine topological argumentation mathematically. Generalization: Jordan-Brouwer separation theorem — every subset of Rⁿ homeomorphic to S^{n-1} divides Rⁿ into two connected components. Higher dimensions = more complex proofs.
111
-
112
- ## 纽结理论 / Knot Theory
113
-
114
- > "纽结的分类依靠不变量——Jones 多项式、Alexander 多项式等区分不同纽结类型。"
115
- > "Knot classification relies on invariants — Jones polynomial, Alexander polynomial, etc. distinguish different knot types."
116
-
117
- 纽结理论研究 R³ 中简单闭曲线的等价类(同痕 isotopy 下的分类)。核心问题:两个纽结能否通过连续变形(不切断不粘合)相互转化?
118
-
119
- **关键不变量**:
120
- - **Alexander 多项式**(1928):第一个纽结多项式不变量,但不完备(不同纽结可有相同 Alexander 多项式)
121
- - **Jones 多项式**(1984):Vaughan Jones 的发现——与统计力学和量子场论有深层联系,Jones 因此获 1990 年 Fields 奖
122
- - **纽结群** π₁(R³ - K):纽结在三维空间中的补空间的基本群
123
-
124
- **应用**:DNA 拓扑——超螺旋(supercoiling)、纽结(knotted DNA)和链环(catenanes)影响 DNA 复制与转录;酶(拓扑异构酶 topoisomerase)改变 DNA 的拓扑结构,相当于进行"拓扑手术"。分子纽结化学——合成拓扑复杂的分子结构。
125
-
126
- Knot theory studies equivalence classes of simple closed curves in R³ under isotopy. Key invariants: Alexander polynomial (1928, first polynomial invariant but incomplete); Jones polynomial (1984, deep connections to statistical mechanics and QFT, Jones won 1990 Fields Medal); knot group π₁(R³ - K). Applications: DNA topology — supercoiling, knotted DNA, and catenanes affect replication and transcription; topoisomerase enzymes perform "topological surgery" on DNA. Molecular knot chemistry — synthesizing topologically complex molecular structures.
127
-
128
- ## 曲面分类定理 / Classification of Surfaces
129
-
130
- > "紧致曲面由可定向性和欧拉示性数完全分类——这是拓扑分类的典范。"
131
- > "Compact surfaces are completely classified by orientability and Euler characteristic — the paradigm of topological classification."
132
-
133
- **分类定理**(Möbius 1861, Dyck 1888 完善):
134
-
135
- 可定向曲面:S² (χ=2), 环面 T² (χ=0), 双环面 (χ=-2), 三环面 (χ=-4), ... — 亏格 g 的曲面 χ = 2 - 2g
136
-
137
- 不可定向曲面:RP² (χ=1), Klein 瓶 (χ=0), ... — 亏格 g 的不可定向曲面 χ = 2 - g
138
-
139
- **标准形式**:每个紧致曲面同胚于若干环面或若干 RP² 的连通和(connected sum)。可定向:#g T²(g 个环面的连通和);不可定向:#g RP²(g 个射影平面的连通和)。
140
-
141
- **分类的完备性**:(可定向性, χ) 是完备不变量集——两个紧致曲面同胚 iff 它们有相同的可定向性和相同的 χ。
142
-
143
- Classification theorem: orientable surfaces S² (χ=2), torus T² (χ=0), double torus (χ=-2), ... genus g surface χ = 2-2g. Non-orientable: RP² (χ=1), Klein bottle (χ=0), ... genus g non-orientable χ = 2-g. Standard form: every compact surface is homeomorphic to a connected sum of tori or projective planes. Completeness: (orientability, χ) is a complete invariant set — two compact surfaces are homeomorphic iff they share the same orientability and Euler characteristic.
144
-
145
- ## Morse 理论 / Morse Theory
146
-
147
- > "光滑函数的临界点编码了流形的拓扑——Morse 理论将分析与拓扑联系起来。"
148
- > "Critical points of a smooth function encode the manifold's topology — Morse theory bridges analysis and topology."
149
-
150
- **Marston Morse**(1892-1977)建立了这一理论:
151
-
152
- **Morse 函数** f: M → R 的每个临界点 p(df(p) = 0)都是非退化的(Hessian 矩阵的行列式 ≠ 0)。临界点的指标(index)= Hessian 中负特征值的个数 = 临界点处"向下方向"的维数。
153
-
154
- **核心定理**:Morse 不等式将临界点数与 Betti 数联系起来:
155
- - c_k ≥ β_k(k 维临界点数 ≥ k 维 Betti 数)
156
- - c_k - c_{k-1} + ... ± c_0 ≥ β_k - β_{k-1} + ... ± β_0
157
-
158
- **直觉**:随着 f 的值从低到高扫描 M,每次经过一个指标为 k 的临界点,流形的拓扑发生一次"k 维附着"——相当于粘上一个 k 维胞腔。整个流形的拓扑由所有临界点及其指标完全决定。
159
-
160
- Intuition: scanning M from low to high values of f, each critical point of index k triggers a "k-dimensional attachment" — gluing a k-cell. The manifold's entire topology is determined by all critical points and their indices. Core theorem: Morse inequalities relate critical point counts to Betti numbers — c_k ≥ β_k. Morse theory bridges differential analysis (critical points) and algebraic topology (homology).
161
-
162
- ---
163
-
164
- **总结 / Summary**:拓扑思想贯穿数学的核心——从 Euler 的示性数到 Poincaré 的基本群,从同调群的可计算性到持续同调的数据应用,从不动点定理的应用力量到纽结理论的生物关联,拓扑提供了"连续变形下什么不变"的统一视角。它告诉我们:真正重要的性质,不是精确的度量,而是结构的本质——连通、洞、维数、可定向性。这些性质在拉伸与弯曲中存活,在撕裂与粘合中改变——这正是拓扑区别于几何的根本界限。
@@ -1,120 +0,0 @@
1
- ---
2
- name: transformation
3
- description: |
4
- Trigger when a problem is intractable in its current representation and needs a mathematical transform into an equivalent simpler problem; or finding an equivalent but more GPU-friendly representation (e.g. convolution->GEMM, spectral transform) for algorithm/operator design.
5
- ---
6
-
7
- # Transformation
8
-
9
- > "Complex problem -> equivalent simple problem; the key is finding the right transformation and its inverse."
10
- >
11
- > -- Fourier, Laplace, Coordinate Transform
12
-
13
- ## Core Principle
14
-
15
- **The same problem can have different representations. Choosing a good representation (or transformation) can make a difficult problem simple.** The essence of a transformation is not to change the problem itself, but to change the perspective from which it is viewed.
16
-
17
- > **Mathematical Formalization**
18
- >
19
- > Let a transformation $T: D_1 \to D_2$. $T$ is useful if and only if three conditions hold simultaneously: (1) **Computability**: $T(x)$ can be explicitly computed; (2) **Simplification**: the problem is more tractable in $D_2$ (e.g., differentiation -> multiplication, convolution -> multiplication); (3) **$T^{-1}$ exists**: the solution in $D_2$ can be mapped back to the original solution in $D_1$.
20
- >
21
- > Core question: **Under what conditions does $T^{-1}$ exist?** Existence determines equivalence, and the domain of convergence determines validity. Properties: equivalence (no information loss, requiring $T^{-1}$ to exist), simplification, invertibility (when $T^{-1}$ exists and is computable, the transformation is exact rather than approximate).
22
-
23
- ## GPU-Friendliness (Cross-Cutting Check)
24
-
25
- In algorithm design, the value of a transformation often manifests as "converting an unfriendly operation into a GPU-friendly one" -- pass the eight-dimensional gate in `../../references/gpu-friendly-math.md`:
26
-
27
- - **Convolution -> GEMM** (im2col / Winograd): Converts irregular convolution into matrix multiplication, fully utilizing Tensor Cores (friendly, but watch for memory expansion).
28
- - **Spectral transforms (FFT / DCT)**: $O(N^2)\to O(N\log N)$, batch-parallelizable; but butterfly communication patterns require attention to memory access.
29
- - **Duality transforms (Legendre / Fenchel)**: Converts constrained optimization into a dual problem -- friendly if the dual is more GEMM-amenable.
30
- - **Transforms as compression**: Frequency-domain sparsity means only significant coefficients need to be stored (KV / activation compression, friendly).
31
- - **Anti-patterns**: The transform itself requires $O(n^2)$ global rearrangement and cannot be fused -- "beautiful but incomputable"; the inverse transform is not numerically stable (ill-conditioned).
32
-
33
- Eight-dimensional minimum assessment (formal terms): **Tensorization** -- whether the transform / inverse transform can be batched; **GEMM-mappability** -- whether it can be rewritten as GEMM / convolution / FFT / batched solve; **Complexity** -- the transform must reduce, not increase, the computational order; **Memory & KV-Cache** -- whether im2col, frequency-domain caches, and block summaries save memory rather than explode it; **Low-precision stability** -- inverse transform, orthogonalization, normalization; **Parallelism & communication** -- butterfly / scan / block communication patterns; **Sparse structure** -- whether frequency-domain / block sparsity is structured; **Operator fusion** -- whether the transform-core operation-inverse transform chain can be fused or recomputed.
34
-
35
- > Cross-reference `../../references/books/matrix-analysis.md` (spectral / low-rank), `optimization-ml.md` (duality).
36
-
37
- ## When NOT to Use
38
-
39
- - **The problem is already simple enough** -- no transformation is needed.
40
- - **The transformation loses critical information** (irreversible, and the lost information is precisely what matters) -- choose an information-preserving transformation.
41
- - **Only qualitative understanding is needed** -- transformations are typically quantitative tools.
42
- - **Convergence conditions are not satisfied** -- forcing a transformation produces meaningless results.
43
-
44
- ## When to Use
45
-
46
- - The problem is difficult to analyze or solve in its current form; revealing hidden structure in data (periodic signals -> frequency spectrum).
47
- - Simplifying complex operations into simpler ones (convolution -> multiplication); linearizing nonlinear problems; decoupling coupled variables.
48
- - **Finding an equivalent but more GPU-friendly representation for an operator** (convolution -> GEMM, sparse -> structured, frequency-domain compression).
49
-
50
- ## Method
51
-
52
- ### Step 1: Analyze the Difficulty of the Current Representation
53
- Why is the current form hard to work with? Is the computation complex (e.g., ODEs are hard to solve directly)? Is the structure opaque (periodicity is invisible in the time domain)? Are variables coupled? Identifying "where the difficulty lies" is a prerequisite for choosing a transformation; selecting a transform without diagnosis is blind operation.
54
-
55
- ### Step 2: Select the Transformation
56
- Choose based on the type of difficulty; for each candidate, verify the formula, domain mapping, convergence conditions, and simplification effect:
57
-
58
- | Transform | Formula | Domain Mapping | Convergence / Validity | Simplification Effect |
59
- |---|---|---|---|---|
60
- | Fourier | $F(\omega)=\int f(t)e^{-i\omega t}\,dt$ | $t\in\mathbb{R}\to\omega\in\mathbb{R}$ | Dirichlet: absolutely integrable, finitely many extrema/discontinuities | Differentiation -> multiplication, convolution -> multiplication |
61
- | Laplace | $F(s)=\int_0^\infty f(t)e^{-st}\,dt$ | $t\in[0,\infty)\to s\in\mathbb{C},\;\text{Re}(s)>\alpha$ | $\exists\alpha: \int|f(t)|e^{-\alpha t}\,dt<\infty$ | Constant-coefficient ODE -> algebraic equation, incorporates initial conditions |
62
- | Z-transform | $F(z)=\sum f[n]z^{-n}$ | $n\in\mathbb{N}\to z\in\mathbb{C},\;|z|>R$ | $\exists R: \sum|f[n]|R^{-n}<\infty$ | Difference equation -> algebraic equation |
63
- | Generating function | $G(x)=\sum a_n x^n$ | $n\in\mathbb{N}\to x,\;|x|<\rho$ | $\exists\rho: \sum|a_n|\rho^n$ converges | Recurrence -> differential equation |
64
- | Legendre | $f^*(p)=\sup_x(px-f(x))$ | $x\to p=f'(x)$ | When $f$ is convex and differentiable, $p\leftrightarrow x$ is a bijection | Convex optimization -> dual, Lagrangian -> Hamiltonian |
65
- | Wavelet | $W(a,b)=\int f(t)\psi_{a,b}(t)\,dt$ | $t\in\mathbb{R}\to(a,b)$ | $f\in L^2$, $\psi$ admissible | Time-frequency localization, multi-scale analysis |
66
-
67
- ### Step 3: Execute the Transformation
68
- Transform the problem into the new representation space, strictly following the formula. A transformation is not an escape from the problem; it is a re-expression of the same problem in a more effective language.
69
-
70
- ### Step 4: Verify Convergence and Domain Conditions
71
- **Before applying transformation results, one must verify convergence conditions**: For Fourier, check Dirichlet conditions ($\int|f|\,dt<\infty$); for Laplace, determine the region of convergence $\text{Re}(s)>\alpha$ (outside this region $F(s)$ is undefined); for the Z-transform, determine $|z|>R$ (the inverse transform depends on the choice of region of convergence); for generating functions, determine the radius of convergence $\rho$; for wavelets, verify the admissibility condition of the mother wavelet. Skipping this step is the largest source of errors.
72
-
73
- ### Step 5: Solve in the Transformed Space
74
- In the new representation the problem is often simpler; all operations must be carried out within the valid domain of the transform. The value of the transformed space lies in making originally hidden structure visible.
75
-
76
- ### Step 6: Apply the Inverse Transform to Return to the Original Space
77
- Map the solution back to the language of the original problem. The existence of the inverse transform requires conditions: Fourier inverse $f(t)=(1/2\pi)\int F(\omega)e^{i\omega t}\,d\omega$ (requires $F$ to be absolutely integrable); Laplace inverse via the Bromwich integral $f(t)=(1/2\pi i)\int F(s)e^{st}\,ds$ ($\gamma>\alpha$, to the right of the region of convergence); Z-inverse $f[n]=(1/2\pi i)\oint F(z)z^{n-1}\,dz$ (contour within the region of convergence); generating function $a_n=G^{(n)}(0)/n!$ or $[x^n]G(x)$. The transformation is merely a means; the final answer must be in the original space.
78
-
79
- ### Step 7: Verify Equivalence
80
- Confirm that the transformation has not lost critical information and that the inverse-transformed result is indeed a solution of the original problem: Was the inverse transform executed within the correct region of convergence? Does the original function satisfy the prerequisite conditions? Were boundary / initial conditions correctly encoded? Equivalence is the bottom line of transformation theory -- a transformation must be a verifiably equivalent operation, not an approximation or an evasion.
81
-
82
- ## Common Errors
83
-
84
- | Error | Critique | Correct Approach |
85
- |---|---|---|
86
- | Choosing an inappropriate transformation | Fails to simplify and instead increases complexity | Select the transformation based on problem characteristics |
87
- | Using an irreversible transformation that loses information | Cannot return to the original problem after transformation | Verify invertibility or confirm that the lost information is not critical |
88
- | Forgetting the inverse transform | After obtaining a solution in the new space, forgetting to transform back | The final answer must be in the original space |
89
- | Ignoring domain changes after transformation | The transformation may alter the domain or introduce singularities | Check the post-transformation domain and boundary conditions |
90
- | Treating the transformation as magic | A transformation only changes the representation, not the essence of the problem | A transformation is a tool; understanding is the core competency |
91
- | Applying Fourier to non-integrable functions | When $\int|f|\,dt=\infty$, $F(\omega)$ may be meaningless | First check Dirichlet conditions; if not satisfied, use generalized functions or Laplace |
92
- | Ignoring the Laplace region of convergence | $F(s)$ is defined only for $\text{Re}(s)>\alpha$ | Restrict all operations to the region of convergence |
93
- | Assuming all transformations are invertible | Some transformations are not invertible under certain conditions (e.g., non-convex Legendre) | Verify invertibility conditions before applying the inverse transform |
94
- | Overlooking discrete transforms (DFT/FFT) | Continuous transforms are not applicable to discrete data | Use the DFT for discrete data: $X[k]=\sum x[n]e^{-i2\pi kn/N}$ |
95
- | Post-transformation incomputability / non-fusibility | The transform requires $O(n^2)$ global rearrangement or an ill-conditioned inverse | Evaluate the GPU eight-dimensional gate; if necessary, choose a fusible, numerically stable equivalent transformation |
96
-
97
- ## Operating Procedure
98
-
99
- The output must include:
100
-
101
- 1. **Difficulty of the current representation**: `[Difficulty]: [Description]`
102
- 2. **Transformation selection**: `[Transform]: [Choice] because [Reason], formula [Formula], convergence conditions [Conditions], expected simplification [Effect]`
103
- 3. **Transformation execution**: The problem form after transformation
104
- 4. **Convergence and domain verification**: `[Verification]: [Whether conditions are satisfied, region of convergence]`
105
- 5. **Solution in transformed space**: The solution method under the new representation
106
- 6. **Inverse transform**: The solution translated back to the original space, noting inverse-transform conditions
107
- 7. **Equivalence verification**: Is it invertible? Is information lost? Is the region of convergence correct?
108
- 8. **[GPU viability]** (if used for operator design) -- whether the transformation converts the operation into GEMM / fusible / numerically stable form; pass the eight-dimensional gate
109
-
110
- **Output must not consist of analysis alone without conclusions.**
111
-
112
- ## Relations to Other Skills
113
-
114
- - **Abstraction**: A transformation is also an act of abstraction -- representing the same object in a new structure.
115
- - **Symmetry and invariance**: Properties that remain unchanged under a transformation are precisely the symmetries of that transformation.
116
- - **Optimization**: Transforming to the dual space sometimes makes optimization easier.
117
- - **Modeling**: A transformation is often a key step in solving a model.
118
- - **Algorithmic thinking**: The FFT reduces the DFT from $O(N^2)$ to $O(N\log N)$, exemplifying how transformation ideas serve computational efficiency.
119
- - **Information theory**: Coding is transformation -- source coding transforms data into an efficient representation; channel coding transforms it into a noise-resistant representation.
120
- - **Modern mathematics activation**: `../../references/books/matrix-analysis.md` (spectral / low-rank transforms), `algebraic-geometry-rising-sea.md` (Plücker coordinates for KV compression, tropical gating), `optimization-ml.md` (duality transforms).
@@ -1,124 +0,0 @@
1
- ---
2
- name: transformation
3
- description: |
4
- 触发:数学推导、方程求解、信号处理等问题在当前表示下难处理,需通过数学变换转为更简单的等价问题;或为算法/算子设计寻找等价但更 GPU 友好的表示(如卷积→GEMM、谱变换)时调用。
5
- English: Trigger when a problem is intractable in its current representation and needs a mathematical transform into an equivalent simpler problem; or finding an equivalent but more GPU-friendly representation (e.g. convolution→GEMM, spectral transform) for algorithm/operator design.
6
- ---
7
-
8
- > **语言路由**:若用户消息为英文,请读取并遵循同目录下的 `SKILL.en.md`,按其操作规程以英文输出;中文消息则继续使用本文件。
9
-
10
- # 🔄 变换思想 / Transformation
11
-
12
- > "复杂问题→等价简单问题,关键是找到合适的变换和逆变换。"
13
- > "Complex problem → equivalent simple problem; the key is finding the right transformation and its inverse."
14
- >
15
- > —— 傅里叶变换、拉普拉斯变换、坐标变换 / Fourier, Laplace, Coordinate Transform
16
-
17
- ## 核心原则 / Core Principle
18
-
19
- **同一个问题可以有不同的表示方式。选择一个好的表示(或变换),可以让困难的问题变得简单。** 变换的精髓不是改变问题本身,而是改变看问题的视角。
20
-
21
- > **数学形式化 / Mathematical Formalization**
22
- >
23
- > 设变换 T: D₁ → D₂,T 有用当且仅当三条件同时成立:① **可计算**:T(x) 可显式求出;② **简化性**:问题在 D₂ 中更易处理(如微分→乘法、卷积→乘法);③ **T⁻¹ 存在**:可从 D₂ 的解恢复 D₁ 原解。
24
- >
25
- > 核心追问:**T⁻¹ 在什么条件下存在?** 存在性决定等价性,收敛域决定有效性。性质:等价性(信息不丢失,需 T⁻¹ 存在)、简化性、可逆性(T⁻¹ 存在且可计算时为等价而非近似)。
26
-
27
- ## GPU 友好性 / GPU-Friendliness(横切检查)
28
-
29
- 变换的价值在算法设计中常体现为「把不友好的运算变成 GPU 友好的运算」——过 `../../references/gpu-friendly-math.md` 八维:
30
-
31
- - **卷积→GEMM**(im2col/Winograd):把不规则卷积变成矩阵乘,吃满 Tensor Core(友好,但注意显存扩张)。
32
- - **谱变换(FFT/DCT)**:O(N²)→O(N log N),可批量并行;但 butterfly 通信模式需注意访存。
33
- - **对偶变换(Legendre/Fenchel)**:把约束优化变成对偶问题——若对偶更易 GEMM 化则友好。
34
- - **变换作为压缩**:频域稀疏→只存显著系数(KV/激活压缩,友好)。
35
- - **反模式**:变换本身需 O(n²) 全局重排且不可融合→"美但不可算";逆变换不可数值稳定(病态)。
36
-
37
- 八维最低判定(正式术语):**张量化**看变换/逆变换是否可批量;**GEMM 可映射**看能否改写为 GEMM/conv/FFT/batched solve;**复杂度**要求变换后降阶而非升阶;**显存与 KV-Cache**检查 im2col、频域缓存、块摘要是否省而不是爆;**低精度稳定**检查逆变换、正交化、归一化;**并行与通信**看 butterfly/scan/分块通信;**稀疏结构**看频域/块稀疏是否结构化;**算子融合**看变换-核心算子-逆变换能否融合或重计算。
38
-
39
- > 配合 `../../references/books/matrix-analysis.md`(谱/低秩)、`optimization-ml.md`(对偶)。
40
-
41
- ## 不适用场景 / When NOT to Use
42
-
43
- - **问题已足够简单**——不需要变换。
44
- - **变换会丢失关键信息**(不可逆且丢失的正是关心的)——选保信息的变换。
45
- - **只需定性理解**——变换通常是定量工具。
46
- - **收敛条件不满足**——强行变换产生无意义结果。
47
-
48
- ## 何时使用 / When to Use
49
-
50
- - 问题在当前形式下难分析或求解;揭示数据隐藏结构(周期信号→频谱)。
51
- - 将复杂运算简化为简单运算(卷积→乘法);非线性问题线性化;解耦耦合变量。
52
- - **为算子寻找等价但更 GPU 友好的表示**(卷积→GEMM、稀疏→结构化、频域压缩)。
53
-
54
- ## 方法流程 / Method
55
-
56
- ### 第一步:分析当前表示的困难
57
- 为什么当前形式难处理?运算复杂(如 ODE 直接求解难)?结构不清晰(时域看不出周期)?变量耦合?明确"困难在哪"是选择变换的前提,不诊断就选变换是盲目操作。
58
-
59
- ### 第二步:选择变换
60
- 根据困难类型选择,每种检查公式、域映射、收敛条件、简化效果:
61
-
62
- | 变换 | 公式 | 域映射 | 收敛/有效性 | 简化效果 |
63
- |---|---|---|---|---|
64
- | 傅里叶 Fourier | F(ω)=∫f(t)e⁻ⁱωᵗdt | t∈ℝ→ω∈ℝ | Dirichlet:绝对可积、有限极值/间断点 | 微分→乘法,卷积→乘法 |
65
- | 拉普拉斯 Laplace | F(s)=∫₀∞f(t)e⁻ˢᵗdt | t∈[0,∞)→s∈ℂ, Re(s)>α | ∃α: ∫|f(t)|e⁻αᵗdt<∞ | 常系数ODE→代数方程,含初值 |
66
- | Z 变换 | F(z)=Σf[n]z⁻ⁿ | n∈ℕ→z∈ℂ, |z|>R | ∃R: Σ|f[n]|R⁻ⁿ<∞ | 差分方程→代数方程 |
67
- | 生成函数 | G(x)=Σaₙxⁿ | n∈ℕ→x, |x|<ρ | ∃ρ: Σ|aₙ|ρⁿ收敛 | 递推→微分方程 |
68
- | Legendre | f*(p)=supₓ(px−f(x)) | x→p=f'(x) | f 凸可微时 p↔x 一一对应 | 凸优化→对偶,Lagrange→Hamilton |
69
- | 小波 Wavelet | W(a,b)=∫f(t)ψₐᵇ(t)dt | t∈ℝ→(a,b) | f∈L², ψ 容许 | 时频局部化,多尺度 |
70
-
71
- ### 第三步:执行变换
72
- 将问题变换到新表示空间,严格按公式执行。变换不是逃避问题,是用更有效的语言重新表达同一问题。
73
-
74
- ### 第四步:验证收敛与域条件
75
- **应用变换结果前必须验证收敛条件**:傅里叶检查 Dirichlet(∫|f|dt<∞);拉普拉斯定收敛域 Re(s)>α,域外 F(s) 无定义;Z 变换定 |z|>R(逆变换依赖收敛域选择);生成函数定收敛半径 ρ;小波验证母小波容许条件。跳过此步是最大错误来源。
76
-
77
- ### 第五步:在变换空间求解
78
- 在新表示下问题往往更简单,所有运算须在变换有效域内进行。变换空间的价值在于让原本隐蔽的结构可见。
79
-
80
- ### 第六步:逆变换回原空间
81
- 将解逆变换回原问题语言,逆变换存在性需条件:傅里叶逆 f(t)=(1/2π)∫F(ω)eⁱωᵗdω(需 F 绝对可积);拉普拉斯逆 Bromwich 积分 f(t)=(1/2πi)∫F(s)eˢᵗds(γ>α 在收敛域右侧);Z 逆 f[n]=(1/2πi)∮F(z)zⁿ⁻¹dz(围道在收敛域内);生成函数 aₙ=G⁽ⁿ⁾(0)/n! 或 [xⁿ]G(x)。变换只是手段,最终答案必须在原空间。
82
-
83
- ### 第七步:验证等价性
84
- 确认变换未丢关键信息、逆变换结果确是原问题解:逆变换是否在收敛域内执行?原函数是否满足前置条件?边界/初值条件是否正确编码?等价性是变换思想的底线——变换必须是可验证的等价操作,而非近似或逃避。
85
-
86
- ## 常见错误 / Common Errors
87
-
88
- | 错误 / Error | 批评 / Critique | 正确做法 / Correct Approach |
89
- |---|---|---|
90
- | 选择不合适的变换 | 没简化反而增加复杂度 | 根据问题特征选择变换 |
91
- | 用不可逆变换且丢信息 | 变换后无法回到原问题 | 检查可逆性或确认丢失信息不重要 |
92
- | 忘记逆变换 | 新空间得解后忘记变回来 | 最终答案必须在原空间 |
93
- | 变换后忽略定义域变化 | 变换可能改定义域或引入奇点 | 检查变换后定义域与边界条件 |
94
- | 把变换当魔法 | 变换只换表示,不改问题本质 | 变换是工具,理解力才是核心 |
95
- | 对不可积函数用傅里叶 | ∫|f|dt=∞ 时 F(ω) 可能无意义 | 先检查 Dirichlet,不满足用广义函数或 Laplace |
96
- | 忽略 Laplace 收敛域 | F(s) 仅 Re(s)>α 有定义 | 所有运算限制在收敛域内 |
97
- | 假设所有变换可逆 | 部分变换特定条件下不可逆(如非凸 Legendre) | 验证可逆条件后再逆变换 |
98
- | 忽略离散变换 DFT/FFT | 连续变换不适用离散数据 | 离散数据用 DFT: X[k]=Σx[n]e⁻ⁱ2πkn/N |
99
- | 变换后不可算/不可融合 | 变换需 O(n²) 全局重排或病态逆 | 评估 GPU 八维,必要时选可融合/数值稳定的等价变换 |
100
-
101
- ## 操作规程 / Operating Procedure
102
-
103
- 输出必须包含:
104
-
105
- 1. **当前表示的困难**:`[困难]: [描述]`
106
- 2. **变换选择**:`[变换]: [选择] 因 [理由],公式 [公式],收敛条件 [条件],预期简化 [效果]`
107
- 3. **变换执行**:变换后的问题形式
108
- 4. **收敛与域条件验证**:`[验证]: [条件是否满足,收敛域]`
109
- 5. **变换空间求解**:新表示下的解法
110
- 6. **逆变换**:解翻译回原空间,注明逆变换条件
111
- 7. **等价性验证**:是否可逆、是否丢信息、收敛域是否正确
112
- 8. **[GPU 可行性]**(若用于算子设计)— 变换是否把运算变成 GEMM/可融合/数值稳定,过八维门
113
-
114
- **输出不得只给分析而无结论。**
115
-
116
- ## 与其他 skill 的关系 / Relations to Other Skills
117
-
118
- - **抽象化思想**:变换也是一种抽象——在新结构中表示同一对象。
119
- - **对称与不变性**:变换下保持不变的性质就是对变换的对称性。
120
- - **优化思想**:变换到对偶空间有时使优化更容易。
121
- - **建模思想**:变换常是模型求解的关键步骤。
122
- - **算法思想**:FFT 将 DFT 的 O(N²) 降为 O(N log N),是变换思想在计算效率上的体现。
123
- - **信息论思想**:编码即变换——信源编码变换为高效表示,信道编码变换为抗干扰表示。
124
- - **现代数学激活**:`../../references/books/matrix-analysis.md`(谱/低秩变换)、`algebraic-geometry-rising-sea.md`(Plücker 坐标压缩 KV、热带门控)、`optimization-ml.md`(对偶变换)。
@@ -1,204 +0,0 @@
1
- # Mathematical Sources and Classic Texts
2
-
3
- ## Fourier Transform (1822)
4
-
5
- > "Any periodic function can be expressed as an infinite series of sine and cosine functions."
6
-
7
- Fourier series: f(x) = a₀/2 + Σ[aₙcos(nx) + bₙsin(nx)]
8
-
9
- Fourier transform: F(ω) = ∫f(t)e^(-iωt)dt
10
-
11
- **Core idea**: A complex signal in the time domain may be simple in the frequency domain. The power of the transform lies in changing the representation of the problem.
12
-
13
- **The magic of the transform**:
14
- - Convolution in the time domain = multiplication in the frequency domain
15
- - Differentiation in the time domain = multiplication (by iω) in the frequency domain
16
- - This allows differential equations to be converted into algebraic equations
17
-
18
- **Source**: Joseph Fourier, *Théorie analytique de la chaleur* (1822) — originally developed for heat conduction problems, its influence extends far beyond thermodynamics.
19
-
20
- ## Fast Fourier Transform — Cooley-Tukey Algorithm (1965)
21
-
22
- > O(n log n) vs O(n²): Fourier transform went from theoretical tool to engineering reality.
23
-
24
- **Core idea**: Exploiting a divide-and-conquer strategy, the complexity of the discrete Fourier transform (DFT) is reduced from O(n²) to O(n log n). For n = 10⁶ data points, this yields a speedup of approximately 10⁶/log(10⁶) ≈ 50,000×.
25
-
26
- **Historical background**: Cooley & Tukey (1965) popularized the FFT, although the same idea can be traced back to Gauss (1805). It is widely regarded as the most important numerical algorithm of the 20th century.
27
-
28
- **Applications**: Signal processing, image compression (JPEG), spectral analysis, large-integer multiplication, numerical solution of partial differential equations.
29
-
30
- ## Laplace Transform (1780s)
31
-
32
- > L{f(t)} = ∫₀^∞ f(t)e^(-st)dt
33
-
34
- **Core idea**: Convert differential equations into algebraic equations, solve them, and then apply the inverse transform to recover the solution. Compared with the Fourier transform, the Laplace transform can handle functions that do not converge (by introducing the convergence factor e^(-st)).
35
-
36
- **Source**: Laplace developed this transform in the 1780s for probability theory; it was later systematically applied to circuit analysis by Heaviside.
37
-
38
- ## Wavelet Transform — Morlet (1980s), Daubechies (1988)
39
-
40
- > Fourier tells you "what frequencies exist"; wavelets also tell you "when they exist."
41
-
42
- **Core idea**: The Fourier transform has frequency resolution but no time resolution; the wavelet transform achieves time-frequency localization through scalable and translatable basis functions.
43
-
44
- **History**: Morlet (1982) introduced the continuous wavelet transform in seismic signal analysis; Daubechies (1988) constructed compactly supported orthogonal wavelet bases, making the discrete wavelet transform a practical reality.
45
-
46
- **Mathematical significance**: Wavelet bases are not a single family of trigonometric functions but are generated from a single mother wavelet ψ through scaling and translation: ψ_{a,b}(t) = |a|^(-1/2) ψ((t-b)/a). Multiresolution analysis (MRA) provides the unifying mathematical framework.
47
-
48
- ## Legendre Transform
49
-
50
- > The duality transform in convex analysis: describes a convex function by its slopes instead of its values.
51
-
52
- f*(p) = sup_x [px - f(x)]
53
-
54
- **Core idea**: For a convex function, "function values" and "derivatives (slopes)" carry the same information — they are dual descriptions. This is a central instance of **duality** in mathematics.
55
-
56
- **Dual roles in physics**:
57
- - **Thermodynamics**: Entropy S ↔ Free energy F (dual via temperature T); Internal energy ↔ Gibbs energy
58
- - **Mechanics**: Lagrangian L(v,q) ↔ Hamiltonian H(p,q) (dual via v ↔ p)
59
- - **Optimization**: Primal problem ↔ Dual problem (Lagrangian duality)
60
-
61
- **Source**: Legendre (1787) introduced it in the context of minimal surface problems; it has since become a cornerstone of convex analysis and the calculus of variations.
62
-
63
- ## Generating Functions — Euler (1748), Laplace
64
-
65
- > Encode a sequence as coefficients of a power series; convolution becomes multiplication.
66
-
67
- G(x) = Σ aₙxⁿ
68
-
69
- **Core idea**: An infinite sequence {a₀, a₁, a₂, ...} is compressed into a single function G(x). Recurrence relations of the sequence become differential equations of the function; the convolution of two sequences becomes the product of two functions.
70
-
71
- **Classical applications**:
72
- - **Combinatorial counting**: Euler used generating functions to solve the integer partition problem
73
- - **Probability theory**: Moment generating function M(t) = E[e^(tX)], characteristic function φ(t) = E[e^(itX)]
74
- - **Number theory**: The Riemann ζ function is essentially the generating function of the prime distribution
75
- - **Solving recurrences**: Fibonacci recurrence → generating function → closed-form solution
76
-
77
- **Source**: Euler, *Introductio in analysin infinitorum* (1748); Laplace made systematic use of generating functions in probability theory.
78
-
79
- ## Conformal Mapping — Riemann Mapping Theorem (1851)
80
-
81
- > Any simply connected domain can be conformally mapped onto the unit disk.
82
-
83
- **Core idea**: Conformal mappings preserve angles and local shapes but may distort sizes and global shapes. Under a complex analytic function f(z), infinitesimal circles remain circles, merely scaled and rotated.
84
-
85
- **Mathematical foundation**: The Riemann mapping theorem (1851) — one of the most profound results in complex analysis — guarantees the existence of such a mapping.
86
-
87
- **Applications**:
88
- - **2D boundary value problems**: Map a complex boundary region to a simple region (disk / half-plane), solve there, and map back
89
- - **Fluid mechanics**: Classical solution method for potential flow problems
90
- - **Aerodynamics**: Airfoil design (Joukowski transform z → z + 1/z)
91
- - **Electrostatics**: Potential computation in complex geometries
92
-
93
- ## Z-Transform — Discrete Counterpart of Laplace
94
-
95
- > X(z) = Σ x[n]z^(-n) — the Laplace transform for the sampled world.
96
-
97
- **Core idea**: The Laplace transform handles continuous-time signals s = σ + iω; the Z-transform handles discrete-time signals z = re^(iω). The two are related by setting z = e^(sT).
98
-
99
- **Central role in digital signal processing**:
100
- - System stability analysis: the unit circle |z| = 1 corresponds to the frequency axis; poles inside the circle = stable
101
- - Digital filter design: transfer functions of FIR / IIR filters are expressed directly in terms of the Z-transform
102
- - Difference equations → algebraic equations (exactly analogous to how the Laplace transform converts differential equations → algebraic equations)
103
-
104
- **History**: Introduced in 1947 by Hurewicz et al. in the context of sampled-data control systems; the name "Z-transform" was coined by Ragazzini & Zadeh (1952).
105
-
106
- ## Plancherel Theorem / Parseval's Theorem — Transforms Preserve Information
107
-
108
- > ∫|f(t)|²dt = ∫|F(ω)|²dω — energy is conserved between time domain and frequency domain.
109
-
110
- **Core idea**: A good transform does not lose information — the total energy (the square of the L² norm) is exactly the same before and after the transform. This means the transform is an **isometry**.
111
-
112
- **Parseval's theorem** (1799): Fourier series form — Σ|aₙ|² + Σ|bₙ|² = (1/π)∫|f(x)|²dx
113
-
114
- **Plancherel theorem** (1910): Fourier transform form — ∫|f|² = ∫|F|², establishing the unitarity of the transform on L² space.
115
-
116
- **Philosophical implication**: Invertible transforms guarantee conservation of information — we can freely switch perspectives without losing anything. This is the mathematical foundation of "reversibility" in the theory of transforms.
117
-
118
- ## Mellin Transform — Scaling Analysis
119
-
120
- > M{f}(s) = ∫₀^∞ f(t)t^(s-1)dt — the Fourier transform under scaling changes.
121
-
122
- **Core idea**: Substituting t = e^(-x), the Mellin transform becomes a Fourier transform. It is naturally dual to the **scaling** operation — scaling f(at) merely multiplies by a^(-s) in the Mellin domain.
123
-
124
- **Key applications**:
125
- - **Analytic number theory**: The Mellin transform representation of the Riemann ζ function is the bridge to the prime counting function
126
- - **Asymptotic analysis**: Mellin transform techniques can extract asymptotic expansions of functions (leading term + correction terms)
127
- - **Fractals and self-similarity**: Self-similar functions have particularly simple representations in Mellin space
128
-
129
- **Source**: Hjalmar Mellin (1904) developed it systematically; earlier roots can be traced to Euler's work on the ζ function.
130
-
131
- ## Radon Transform (1917) — Mathematical Basis of CT Scanning
132
-
133
- > Integrate a function along lines to get "projections"; inverse transform reconstructs the original from projections.
134
-
135
- R{f}(θ, s) = ∫ f(x·nθ + tnθ⊥)dt (line integral along direction θ)
136
-
137
- **Core idea**: Projections of an object in all directions contain sufficient information to completely reconstruct the object. This is the mathematical foundation of **tomography**.
138
-
139
- **History and applications**:
140
- - **Radon** (1917): A pure mathematics paper proving the existence and uniqueness of the inverse transform
141
- - **Cormack** (1963-64): Independently rediscovered the result and applied it to medical imaging
142
- - **Hounsfield** (1971): Invented the CT scanner; Cormack and Hounsfield shared the 1979 Nobel Prize in Medicine
143
- - **Seismology**: Velocity reconstruction from reflection seismic data
144
-
145
- ## Coordinate Transformation
146
-
147
- **Polar coordinates**: (x, y) → (r, θ), suited to problems with rotational symmetry
148
- **Spherical coordinates**: (x, y, z) → (r, θ, φ), suited to problems with spherical symmetry
149
- **Fourier space**: Time signal → frequency representation
150
-
151
- **Core idea**: Choosing the right coordinate system can turn a complex problem into a simple one.
152
-
153
- ## Diagonalization (Linear Algebra)
154
-
155
- > For a diagonalizable matrix A, there exists an invertible matrix P such that P⁻¹AP = D (a diagonal matrix).
156
-
157
- **Core idea**: In the eigenvector basis, a linear transformation becomes as simple as possible — each coordinate direction is scaled independently.
158
-
159
- ## Jordan Normal Form — Non-Diagonalizable Matrices
160
-
161
- > What if a matrix cannot be diagonalized? Jordan form is the closest thing to diagonal.
162
-
163
- A = PJP⁻¹, J = diag(J₁, J₂, ...), Jₖ = λₖI + Nₖ (λₖ is an eigenvalue, Nₖ is a nilpotent matrix)
164
-
165
- **Core idea**: When a matrix does not have enough independent eigenvectors (geometric multiplicity < algebraic multiplicity), Jordan blocks introduce "approximate eigenvectors" — chains of generalized eigenvectors. The nilpotent part Nₖ allows the behavior of iterates Aⁿ to be computed exactly.
166
-
167
- **Source**: Camille Jordan (1870), *Traité des substitutions et des équations algébriques*.
168
-
169
- **Applications**: Solutions of linear ODE systems (especially with repeated roots), computation of the matrix exponential e^(At), explicit solutions of linear recurrences.
170
-
171
- ## Eigenvalue Theory & Spectral Theory — Mathematical Heart of Transformation
172
-
173
- > Eigenvalues are the "DNA" of a transformation — they determine its essential behavior.
174
-
175
- Av = λv
176
-
177
- **Spectral theorem** (Hilbert, 1909-1912): Self-adjoint operators have real spectra and can be spectrally decomposed — "diagonalization" in continuous dimensions.
178
-
179
- **Core ideas**:
180
- - **Finite dimensions**: The eigenvalues of a matrix determine stability (|λ|<1 implies convergence), oscillatory behavior (imaginary part of λ), and growth rate (real part of λ)
181
- - **Infinite dimensions**: Spectral theory generalizes eigenvalues to self-adjoint operators on Hilbert spaces; in quantum mechanics, observables = self-adjoint operators, and their spectra = possible measurement outcomes
182
- - **Stability analysis**: The stability of any dynamical system reduces to the location of its spectrum
183
-
184
- **Key theorems**:
185
- - **Gershgorin circle theorem** (1931): Geometric localization of eigenvalues
186
- - **Courant-Fischer min-max theorem**: Variational characterization of eigenvalues
187
- - **Weyl inequalities**: Continuity of the spectrum under matrix perturbations
188
-
189
- ## Philosophical Implications of Transforms
190
-
191
- > "Look at a problem from a different angle, and it may already be solved."
192
-
193
- The deeper meaning of the transform idea:
194
- - **Relativity of representation**: The same object has different appearances under different representations
195
- - **Invariance under transformation**: Some properties remain unchanged under transformation (this is symmetry)
196
- - **Choice of representation**: A good representation simplifies the problem; a poor one complicates it
197
- - **Reversibility**: Ideally, a transform loses no information — we can freely switch perspectives (the guarantee of the Plancherel theorem)
198
-
199
- ## "Transforms" in Everyday Life
200
-
201
- - **Time-scale transform**: Current difficulties may be negligible when viewed on a 10-year timescale
202
- - **Perspective transform**: Seeing a problem from the other person's point of view (essentially a coordinate transformation)
203
- - **Scale transform**: Macro and micro perspectives may reveal different patterns (the intuition behind the Mellin transform)
204
- - **Domain transform**: A problem that is unsolvable in one domain may have a ready-made solution in another (Fourier: differential → algebraic; Legendre: mechanics → dual mechanics)