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
@@ -0,0 +1,48 @@
1
+ # Topological Lens
2
+
3
+ > Stretching and bending are allowed, but tearing is not — the truly important properties are those invariant under continuous deformation
4
+
5
+ ## What Perspective It Offers
6
+
7
+ Topology is a way of "ignoring precise measurements and focusing only on qualitative structure": when exact distances do not matter, topology captures the essential structure — connectedness, the number of holes, and dimension. A donut and a coffee cup are topologically equivalent because each has exactly one hole. The core insight is that shape matters more than size; invariants that survive continuous deformation are the truly robust properties. Cohomology (especially Čech cohomology) can also detect whether "local fragments can be assembled into a globally consistent object."
8
+
9
+ ## What Problems It Is Suited to Diagnose
10
+
11
+ - Qualitative classification — not "how large" or "how far," but "is it connected?" and "how many holes does it have?"
12
+ - Robustness analysis — topological invariants guarantee that properties do not vanish under continuous perturbation
13
+ - Data whose shape standard statistics cannot capture — clusters, voids, and ring-like structures
14
+ - Detecting global consistency obstructions — whether local fragments can be assembled into a globally consistent object
15
+
16
+ ## What Problems It Is Not Suited For
17
+
18
+ - Precise measurements are required — topology concerns only qualitative structure and does not provide distances or angles
19
+ - Metric properties are central — topologically equivalent spaces can have entirely different metric behavior
20
+ - Precise numerical decisions are needed — the topological perspective is too coarse to answer "how much" questions
21
+
22
+ ## Which Knowledge Domains It Routes To
23
+
24
+ - `topology/persistent-homology`: Fundamental group, homology groups, Betti numbers, and cohomology — computational tools for topological invariants
25
+ - **tda**: Persistent homology, filtrations, and simplicial complexes — extracting topological features from data
26
+ - `topology/fundamental-group`: Sheaf cohomology and Čech cohomology — algebraic criteria for local-to-global consistency
27
+
28
+ ## What AI Designs It May Inspire
29
+
30
+ - **Topological Feature Extractor**: Builds filtrations from point-cloud data and computes persistent homology barcodes
31
+ - **Consistency Detector**: Uses Čech cohomology H¹ to detect obstructions to global consistency among local fragments
32
+ - **Shape Classifier**: Uses combinations of invariants (χ, π₁, βₙ) to perform topological classification of spaces
33
+
34
+ ## Reasoning Protocol
35
+
36
+ 1. **Specify the Equivalence Standard**: Determine whether the relevant notion is homeomorphism, homotopy equivalence, or diffeomorphism; distinguish what may vary (distance) from what must remain invariant (number of holes)
37
+ 2. **Compute Topological Invariants**: Euler characteristic, connected components, fundamental group, homology groups, and Betti numbers
38
+ 3. **Classify Using Invariants**: Same χ implies same surface type; same π₁ implies same homotopy type
39
+ 4. **Construct a Topological Model**: Build a filtration from a point cloud, a graph from a network, or a phase space from a dynamical system
40
+ 5. **Verify Equivalence**: Attempt to construct an explicit homeomorphism or homotopy; check whether all invariants match
41
+
42
+ ## Acceptance Criteria
43
+
44
+ - The equivalence standard has been explicitly stated (homeomorphism, homotopy equivalence, or diffeomorphism)
45
+ - Invariants have been computed: at minimum, χ, π₁, and βₙ (where obtainable) have been provided
46
+ - A classification conclusion has been given, with a note on whether the invariants are complete
47
+ - Equivalence verification has been completed (match, mismatch, or inconclusive)
48
+ - The reasoning chain is complete: "because [topological property] → [conclusion]"
@@ -0,0 +1,48 @@
1
+ # 拓扑透镜
2
+
3
+ > 可以拉伸弯曲但不能撕裂——真正重要的性质在连续变形中不变
4
+
5
+ ## 它是什么视角
6
+
7
+ 拓扑是一种"忽略精确度量、只看定性结构"的眼光:当精确距离不重要时,拓扑捕获本质结构——连通性、洞的个数、维数。甜甜圈与咖啡杯拓扑等价,因为都恰好有一个洞。核心洞察:形状比大小重要,连续变形下存活的不变量才是真正鲁棒的性质。上同调(特别是 Cech 上同调)还能检测"局部片段能否拼成全局相容对象"。
8
+
9
+ ## 适合诊断什么问题
10
+
11
+ - 需要定性分类——不在乎"多大""多远",只在乎"是否连通""有多少洞"
12
+ - 需要鲁棒性分析——拓扑不变量保证性质在连续扰动下不消失
13
+ - 数据有标准统计无法捕获的形状——聚类、空洞、环状结构
14
+ - 检测全局一致性障碍——局部片段能否拼成全局相容对象
15
+
16
+ ## 不适合什么问题
17
+
18
+ - 需要精确测量——拓扑只关心定性结构,不给距离/角度
19
+ - 度量性质是核心——拓扑等价空间可有完全不同的度量行为
20
+ - 需要精确数值决策——拓扑视角过粗,回答不了"多少"的问题
21
+
22
+ ## 会路由到哪些知识域
23
+
24
+ - `topology/persistent-homology`:基本群、同调群、Betti 数、上同调——拓扑不变量的计算工具
25
+ - **tda**:持续同调、滤流、单纯复形——从数据中提取拓扑特征
26
+ - `topology/fundamental-group`:层上同调、Cech 上同调——从局部到全局的一致性代数判据
27
+
28
+ ## 可能产生哪些 AI 设计
29
+
30
+ - **拓扑特征提取器**:从数据点云构建滤流,计算持续同调条形码
31
+ - **一致性检测器**:用 Cech 上同调 H^1 检测局部片段的全局相容性障碍
32
+ - **形状分类器**:利用不变量组合(chi, pi_1, beta_n)对空间做拓扑分类
33
+
34
+ ## 推理协议
35
+
36
+ 1. **明确等价标准**:确定同胚/同伦/微分同胚,区分什么可变(距离)什么不变(洞数)
37
+ 2. **计算拓扑不变量**:欧拉示性数、连通分量、基本群、同调群、Betti 数
38
+ 3. **用不变量分类**:同 chi 同类型曲面;同 pi_1 同同伦类型
39
+ 4. **构造拓扑模型**:点云建滤流/网络建图/系统建相空间
40
+ 5. **验证等价性**:尝试构造显式同胚/同伦,检查不变量是否全部匹配
41
+
42
+ ## 验收标准
43
+
44
+ - 等价标准已明确(同胚/同伦/微分同胚)
45
+ - 不变量已计算:chi, pi_1, beta_n 至少给出可得的
46
+ - 分类结论已给出,标注了不变量是否完备
47
+ - 等价验证已完成(匹配/不匹配/不确定)
48
+ - 推理链条完整:"因为[拓扑性质] → [结论]"
@@ -0,0 +1,48 @@
1
+ # Variational Lens
2
+
3
+ > Pursue the best among the feasible under constraints — convexity determines difficulty, duality reveals structure
4
+
5
+ ## What Perspective It Offers
6
+
7
+ The variational perspective (formerly "Optimization") is a way of viewing "rational decision-making under constraints": any decision problem can be formulated as maximizing or minimizing an objective subject to constraints. The core idea is not to pursue an abstract "best," but to find the optimum within the feasible region. Convexity is the critical watershed — for convex problems, a local optimum is the global optimum; for non-convex problems, one must guard against local traps. Shadow prices (Lagrange multipliers) reveal which constraints truly matter.
8
+
9
+ ## What Problems It Is Suited to Diagnose
10
+
11
+ - Resource allocation and trade-off decisions — maximizing or minimizing a quantifiable objective under constraints
12
+ - Convexity determination — assessing problem difficulty and selecting solution strategies
13
+ - Duality structure analysis — when the primal problem is hard, the dual may be more tractable
14
+ - Sensitivity analysis — how the optimal solution responds to changes in constraints
15
+
16
+ ## What Problems It Is Not Suited For
17
+
18
+ - Problems with no clear evaluation criterion — define the objective before optimizing
19
+ - Purely executional tasks — there is no room for optimization
20
+ - Problems that are inherently qualitative rather than quantitative extrema — model first, then optimize
21
+
22
+ ## Which Knowledge Domains It Routes To
23
+
24
+ - `optimization/convex-optimization`: Convexity determination, properties of convex sets and functions — determines the difficulty class of the problem
25
+ - **optimization**: Solution methods for LP, QP, convex, non-convex, combinatorial, and stochastic optimization
26
+ - **matrix-analysis**: Condition numbers, preconditioning, and low-rank approximation — feasibility analysis for second-order methods
27
+
28
+ ## What AI Designs It May Inspire
29
+
30
+ - **Objective–Constraint Decomposer**: Automatically extracts the objective function, hard and soft constraints, and the feasible region from a problem description
31
+ - **Dual-Solution Router**: Detects whether the primal or dual problem is more tractable and selects the optimal solution path
32
+ - **Sensitivity Monitor**: Tracks active constraints and shadow prices, triggering re-optimization when constraints change
33
+
34
+ ## Reasoning Protocol
35
+
36
+ 1. **Define the Objective**: Specify what to maximize or minimize; determine convexity (if convex, local = global)
37
+ 2. **List Constraints**: Distinguish hard from soft constraints, inequality from equality, linear from nonlinear
38
+ 3. **Classify Problem Type**: LP, QP, convex, non-convex, combinatorial, or stochastic — match to an appropriate solution method
39
+ 4. **Solve and Verify**: Exploit convexity or employ global search; check feasibility and optimality
40
+ 5. **Sensitivity Analysis**: Compute shadow prices, identify active constraints, and assess robustness
41
+
42
+ ## Acceptance Criteria
43
+
44
+ - The objective function and its convexity status have been explicitly annotated
45
+ - All constraints (including implicit ones) have been exhaustively listed
46
+ - The problem type has been classified and a solution method has been matched
47
+ - Sensitivity analysis has been provided (at minimum, active constraints are identified)
48
+ - Multi-objective scenarios have been subjected to Pareto analysis
@@ -0,0 +1,48 @@
1
+ # 变分透镜
2
+
3
+ > 在约束下追求可行中的最优——凸性决定难度,对偶揭示结构
4
+
5
+ ## 它是什么视角
6
+
7
+ 变分(原"优化")是一种"约束下的理性决策"眼光:任何决策问题都可以表述为在约束条件下最大化或最小化某个目标。核心不是追求抽象的"最好",而是在可行域中寻找最优。凸性是关键分水岭——凸问题局部最优即全局最优,非凸问题则需警惕局部陷阱。影子价格(拉格朗日乘子)揭示哪些约束真正重要。
8
+
9
+ ## 适合诊断什么问题
10
+
11
+ - 资源分配与取舍决策——在约束下最大化/最小化可量化目标
12
+ - 凸性判定——判断问题难度,选择求解策略
13
+ - 对偶结构分析——原问题难解时,对偶问题可能更易处理
14
+ - 灵敏度分析——约束变化时最优解如何响应
15
+
16
+ ## 不适合什么问题
17
+
18
+ - 没有明确评价标准——先定义目标再优化
19
+ - 纯执行性任务——没有优化空间
20
+ - 本质是定性判断而非定量极值——应先建模再优化
21
+
22
+ ## 会路由到哪些知识域
23
+
24
+ - `optimization/convex-optimization`:凸性判定、凸集/凸函数性质——决定问题难度等级
25
+ - **optimization**:LP/QP/凸/非凸/组合/随机优化的求解方法
26
+ - **matrix-analysis**:条件数、预条件、低秩近似——二阶法的可行性分析
27
+
28
+ ## 可能产生哪些 AI 设计
29
+
30
+ - **目标-约束分解器**:从问题描述中自动提取目标函数、硬/软约束、可行域
31
+ - **对偶求解路由**:检测原问题与对偶问题哪个更易解,选择最优路径
32
+ - **灵敏度监控器**:跟踪活跃约束与影子价格,约束变化时触发重优化
33
+
34
+ ## 推理协议
35
+
36
+ 1. **定义目标**:明确最大化/最小化什么,判断凸性(凸则局部=全局)
37
+ 2. **列出约束**:区分硬/软约束、不等式/等式、线性/非线性
38
+ 3. **分类问题类型**:LP/QP/凸/非凸/组合/随机,匹配求解方法
39
+ 4. **求解与验证**:利用凸性或全局搜索求解,检查可行性与最优性
40
+ 5. **灵敏度分析**:计算影子价格,识别活跃约束,评估鲁棒性
41
+
42
+ ## 验收标准
43
+
44
+ - 目标函数与凸性已明确标注
45
+ - 所有约束(含隐式约束)已穷尽列出
46
+ - 问题类型已分类,求解方法已匹配
47
+ - 灵敏度分析已给出(至少标注活跃约束)
48
+ - 多目标场景已做帕累托分析
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "math-skill",
3
- "version": "2.1.0",
4
- "description": "数学思想武器 v2:自动触发的现代数学能力激活器,把代数几何/微分几何/李理论等现代数学激活到算法与 GPU 协同设计研究中——既在 math beautiful,又 GPU friendly。Mathematical Thinking Weapons v2: an auto-triggered activator that brings modern mathematics (algebraic geometry, differential geometry, Lie theory, …) into algorithm & GPU co-design research beautiful in math, friendly to GPUs.",
3
+ "version": "3.0.1",
4
+ "description": "面向 AI 架构创新的数学研究操作系统 v3:三层正交架构(思想透镜 / 数学知识库 / 设计翻译层),自动诊断用户意图并路由。Math Research OS for AI architecture design: thinking lenses + math knowledge base + design translation layer with auto intent diagnosis.",
5
5
  "keywords": [
6
6
  "math",
7
7
  "mathematics",
@@ -42,7 +42,11 @@
42
42
  "auto-trigger",
43
43
  "co-design",
44
44
  "research",
45
- "bilingual"
45
+ "bilingual",
46
+ "lenses",
47
+ "knowledge-base",
48
+ "design-patterns",
49
+ "math-research-os"
46
50
  ],
47
51
  "license": "MIT",
48
52
  "author": "the-thinker0",
@@ -60,6 +64,8 @@
60
64
  "LICENSE",
61
65
  "commands/",
62
66
  "skills/",
67
+ "lenses/",
68
+ "design-patterns/",
63
69
  "agents/",
64
70
  "knowledge-base/",
65
71
  "references/"
@@ -38,7 +38,7 @@ Record research tasks in a table that the Agent can continuously update:
38
38
  ```markdown
39
39
  | Candidate Structure | Math Correctness | GPU 8-Dim | Complexity | Status | Notes / Next Steps |
40
40
  |--------------------|-----------------|-----------|------------|--------|-------------------|
41
- | Tropical gating replacing TopK | Differentiable relaxation | 123✅… | Sub-quadratic (per-token) | Verifying | Compare with SWA baseline |
41
+ | Tropical gating replacing TopK | [v] Differentiable relaxation | 1[v]2[x]3[v]… | Sub-quadratic (per-token) | Verifying | Compare with SWA baseline |
42
42
  | … | | | | Todo | |
43
43
  ```
44
44
 
@@ -40,7 +40,7 @@
40
40
  ```markdown
41
41
  | 候选结构 | 数学正确性 | GPU 八维 | 复杂度 | 状态 | 备注/下一步 |
42
42
  |---------|-----------|---------|-------|------|-----------|
43
- | 热带门控替代 TopK | 可微松弛 | 123✅… | 亚二次(逐token) | 验证中 | 对比 SWA 基线 |
43
+ | 热带门控替代 TopK | [v] 可微松弛 | 1[v]2[x]3[v]… | 亚二次(逐token) | 验证中 | 对比 SWA 基线 |
44
44
  | … | | | | 待办 | |
45
45
  ```
46
46
 
@@ -0,0 +1,124 @@
1
+ # Abstract Algebra
2
+
3
+ > **Contemporary Abstract Algebra**, Eighth Edition -- Joseph A. Gallian -- Brooks/Cole, Cengage Learning.
4
+ > This file is an "activation" reference: mapping the book's group/ring/field structures to ML/algorithms/Infra, not reproducing the original text. For full-fidelity lookups see the "Deep-dive Entry" at the end.
5
+
6
+ ## Overview
7
+
8
+ This book is a standard undergraduate abstract algebra textbook whose main thread is a three-part progression: **groups -> rings -> fields**. Starting from axioms, it emphasizes **symmetry, structure-preserving maps (homomorphisms/isomorphisms), quotient structures, and the classification and counting of finite objects**. The value for AI lies not in the theorems themselves but in the **language of "remaining invariant under some transformation"** that it provides -- this is the algebraic foundation for equivariant networks, permutation-invariant aggregation, coding, and hashing.
9
+
10
+ One-sentence activation insight: **Symmetry is a free inductive bias**. Rather than forcing the model to learn from data that "a rotated cat is still the same cat," one can build the symmetry group G's action directly into the network architecture, sharing parameters along orbits -- saving parameters while providing generalization guarantees. The main line -- groups (the transformations themselves) -> rings (algebra with two operations, whose relaxation yields generalized matrix multiplication) -> fields (arithmetically closed and exact, yielding coding and hashing) -- exactly covers the three Infra needs of "equivariance / generalized GEMM / fault-tolerant computation."
11
+
12
+ **Boundaries of this book (to avoid misuse)**: Gallian is an elementary undergraduate textbook; it **covers rings but not semirings** (the tropical semiring requires axiom relaxation on your own); representation theory only reaches the level of finite abelian groups and **does not develop non-abelian representation theory or character theory**; it does not touch category theory, modules, or homological algebra. When these more modern tools are needed, this book serves only as an "activation starting point," and deeper study requires turning to specialized texts on representation theory / algebraic geometry.
13
+
14
+ Actual chapter map (grouped by topic; chapter numbers taken from the book's table of contents):
15
+
16
+ - **Group foundations**: 1 Introduction to Groups (dihedral group D_n as the symmetry group exemplar), 2 Groups, 3 Finite Groups; Subgroups, 4 Cyclic Groups.
17
+ - **Symmetry and actions**: 5 Permutation Groups (orbit / stabilizer), 6 Isomorphisms, 7 Cosets and Lagrange's Theorem, 8 External Direct Products.
18
+ - **Quotients and homomorphisms**: 9 Normal Subgroups and Factor Groups, 10 Group Homomorphisms, 11 Fundamental Theorem of Finite Abelian Groups.
19
+ - **Rings**: 12 Introduction to Rings, 13 Integral Domains, 14 Ideals and Factor Rings, 15 Ring Homomorphisms, 16 Polynomial Rings, 17 Factorization of Polynomials, 18 Divisibility in Integral Domains.
20
+ - **Fields and extensions**: 19 Vector Spaces, 20 Extension Fields, 21 Algebraic Extensions, **22 Finite Fields**, 23 Geometric Constructions.
21
+ - **Advanced group theory**: 24 Sylow Theorems, 25 Finite Simple Groups, 26 Generators and Relations.
22
+ - **Applications of symmetry**: 27 Symmetry Groups, 28 Frieze and Crystallographic Groups, **29 Symmetry and Counting** (Burnside counting), 30 Cayley Digraphs of Groups.
23
+ - **Coding and Galois**: **31 Introduction to Algebraic Coding Theory** (Hamming codes, linear codes over finite fields), **32 An Introduction to Galois Theory**, 33 Cyclotomic Extensions.
24
+
25
+ ## Core Structures Transferable to AI/Infra
26
+
27
+ | Algebraic structure (Ch) | One-line essence | ML/Infra correspondence |
28
+ |---|---|---|
29
+ | **Group action** (5, 29) | G acts on input space; orbit-stabilizer theorem \|orbit\|=\|G\|/\|stab\| | Equivariant layers + **weight sharing**: parameters reused along an orbit |
30
+ | **Homomorphism** (10, 15) | Operation-preserving map phi(ab)=phi(a)phi(b) | **Representation** = homomorphism G->GL(V) (in the book GL(2,F)); learnable linear actions |
31
+ | **Quotient structure** (9, 14) | Quotienting by a normal subgroup/ideal = "forgetting" a symmetry direction | Pooling / coarsening / equivariant downsampling: quotienting by S_n = permutation-invariant aggregation |
32
+ | **Cyclic & finite abelian groups** (4, 11) | Z_n's periodic structure; any finite abelian group ~ product of cyclic groups | DFT/FFT, cyclic convolution, RoPE (representation of SO(2)/cyclic rotations) |
33
+ | **Ring** (12-14) -> axiom relaxation | Drop the additive inverse axiom -> **semiring** (the book only covers rings; semirings require axiom relaxation) | Generalized matrix multiply: replacing (x,+) with (+, min/max) yields **min-plus / tropical semiring** GEMM |
34
+ | **Finite field GF(p^n)** (22, 16, 17) | Finite elements, arithmetically closed and exact | Error-correcting codes, hashing/LSH, CRC, Shamir secret sharing, quantization codebooks |
35
+ | **Linear code** (31) | k-dimensional subspace over finite field F, generator matrix G, Hamming distance/weight | Robust storage/communication, gradient compression, fault-tolerant training, secure aggregation |
36
+
37
+ ### Three Most Valuable Activated Mappings (Expanded)
38
+
39
+ - **Group action -> Equivariance + weight sharing**: The orbit-stabilizer theorem \|orbit\|=\|G\|/\|stab\| (Ch 5) is precisely the algebraic explanation for "weight sharing" -- inputs on the same orbit share a single set of parameters, and the number of independent parameters is compressed by a factor of \|G\|. The equivariance constraint f(g x)=rho(g) f(x) unifies a family of real models: CNN (translation group), Group Equivariant CNN (D_n rotation/reflection steerable filters), DeepSets / Set Transformer (S_n permutation-invariant), E(3)-equivariant GNN (rigid-body group, molecules/point clouds).
40
+ - **Ring axiom relaxation -> Semiring -> Generalized GEMM**: Chapters 12-14 of this book give the two operations (+,x) and axioms of a ring; **dropping the additive inverse** (i.e., no longer requiring subtraction to be invertible) yields a semiring. Abstracting the general matrix multiply C=A (x) B by replacing (x,+) with an arbitrary semiring ((.),(+)) allows a single codebase to express standard GEMM, Boolean reachability (AND,OR), shortest path/Viterbi/DTW (+, min). This is the unified perspective that puts "dynamic programming" inside matrix multiplication.
41
+ - **Finite fields -> Exactly reproducible arithmetic**: GF(p^n) (Ch 22, constructed from a polynomial ring modulo an irreducible polynomial, see Ch 16-17) has arithmetically closed and **floating-point-error-free** operations, making it naturally suited for scenarios requiring reproducibility, verifiability, and error correction: Reed-Solomon / Hamming error-correcting codes (Ch 31), Shamir secret sharing (polynomial interpolation over GF(p)), consistent hashing and LSH.
42
+
43
+ ## Problem Types Suited for Activation
44
+
45
+ - Input has **clear symmetry**: translation, rotation, reflection (D_n), permutation (S_n), periodicity (Z_n) -- want equivariance/invariance rather than learning it from data augmentation.
46
+ - Need **hard selection / discrete routing** that remains end-to-end differentiable (Top-K, shortest path, alignment) -- can use semiring relaxation.
47
+ - Need **robust compression / communication / storage**: fault tolerance and compression for KV-Cache, gradients, checkpoints.
48
+ - Need to embed **periodic / cyclic structure** into positional encoding or token mixing.
49
+ - Need to express a **constraint / conservation law** as a learnable linear map that naturally maps to GEMM.
50
+
51
+ ## Possible Algorithmic Inspirations
52
+
53
+ 1. **G-equivariant layer** (source: 5, 6, 10): Implement the symmetry group G's action as permutation/rotation matrices rho(g), with weights shared along orbits, enforcing f(g x)=rho(g) f(x). In practice, for each g in G the input is transformed by rho(g) then passed through the same set of weights, and the results are aggregated -- equivalent to expanding the convolution kernel into a [\|G\|, C_out, C_in] batched GEMM, reducing independent parameters by a factor of \|G\|. Deployed models: CNN (translation), G-CNN (D_n steerable filters), DeepSets/Set Transformer (S_n), E(3)-equivariant GNN (point clouds/molecules).
54
+ 2. **Tropical / min-plus attention and routing** (source: 12-14 ring axiom relaxation): Replace softmax's (x,)+exp with (+, min/max) min-plus matmul: score(+) = min_k(Q_ik + K_kj). Hard Top-K routing -> tropical semiring **piecewise-linear gating** (sub-differentiable -- breakpoints need LogSumExp smoothing, which recovers standard softmax; an alternative to the non-differentiable argmax). Viterbi, DTW, and shortest paths are all instances of this min-plus matmul -- see the Tropical Gating example in `../gpu-friendly-math.md` (used only for low-dimensional gating and **not on Tensor Cores** -- max/min runs on CUDA cores, while the main trunk still uses standard (x,+) GEMM).
55
+ 3. **Permutation-invariant aggregation** (source: 9, 29): Quotienting by the S_n action yields sum/max/mean pooling -- naturally O(n) and parallel-friendly, the algebraic foundation for DeepSets rho(Sigma phi(x_i)) and GNN message passing. Burnside counting (Ch 29) can estimate "how many essentially distinct configurations exist" at design time, for predicting parameter savings and data deduplication benefits.
56
+ 4. **Finite-field coding for Infra** (source: 22, 31): Linear codes c=mG (generator matrix G over GF(q)) for fault-tolerant storage and gradient compression, with Hamming distance providing a lower bound on error-correcting capability; Shamir secret sharing (polynomial interpolation over GF(p), recoverable from t shards) for secure aggregation in federated learning; finite-field hashing/CRC for deduplication and consistency verification. Commonality: pure int/bitwise operations, placed in pre/post-processing on data flows.
57
+ 5. **Cyclic group representations -> Frequency-domain token mixing** (source: 4, 11): The irreducible representations of Z_n are the DFT basis, giving rise to FFT convolution (O(n log n) replacing O(n^2)), RoPE (encoding positions as SO(2) rotations, i.e., unitary representations of Z), and cyclic/relative positional encodings. The finite abelian group classification theorem (Ch 11) guarantees that any such periodic structure can be decomposed into cyclic components for FFT.
58
+ 6. **Fourier / spectral methods on groups** (source: 10 homomorphism + 4/11): Extending the irreducible decomposition of representation theory to general finite groups yields the group convolution theorem -- spectral GNNs and spherical CNNs (harmonic analysis on SO(3)) are special cases; the cost is that fast transforms for non-abelian groups may not exist and complexity must be assessed.
59
+
60
+ ## GPU Friendliness Warning
61
+
62
+ > The sole source for eight-dimension criteria and scoring rules: `../gpu-friendly-math.md` (Tensorization / GEMM-mappability / Complexity / Memory / Low-precision / Parallelism / Sparsity / Operator fusion). Here we give only per-dimension verdicts for the book's structures.
63
+
64
+ **Focus A: Can semiring GEMM run on Tensor Cores? -- Not by default.**
65
+
66
+ - **Dimension 2 GEMM-mappability ([x] unfriendly)**: Tensor Core hardware only performs (x,+) MAC (fp16/bf16/fp8 accumulated into fp32). Min-plus / max-plus uses (+, min/max), which is **not natively supported**; naive tropical GEMM degenerates to CUDA core scalar comparisons and cannot leverage Tensor Cores.
67
+ - **Dimension 3 Complexity ([x])**: Min-plus matrix multiplication has no Strassen-style sub-cubic speedup (equivalent to the APSP hard problem); naive O(n^3).
68
+ - **Dimension 5 Low-precision ([v])**: Tropical uses max/min, no exp overflow risk; numerically robust.
69
+ - **Dimension 8 Differentiability / Operator fusion ([~] adaptable)**: min/max is non-differentiable; requires relaxation.
70
+ - **Adaptations (-> eight-dimension friendly)**: (1) log-sum-exp smoothing of min/max recovers (x,+) stable softmax, back on Tensor Cores; (2) confine tropical operations **to low-dimensional gating only**, keeping the main trunk on standard (x,+) GEMM (the Tropical Gating example in the reference file = Dimension 1 [v] Tensorization / Dimension 2 [x] not Tensor Core GEMM / Dimension 3 [v] per-token gating sub-quadratic, Dimension 8 needs LogSumExp smoothing); (3) blocking -- standard GEMM within blocks, min-plus reduction between blocks.
71
+
72
+ **Focus B: Can group operations be tensorized? -- Small groups yes, large groups and exact arithmetic no.**
73
+
74
+ - **Finite group actions (Dimension 1/2 [v])**: Permutation matrices / dense representation matrices -> batched GEMM; G-CNN has been engineered. Orthogonal rotation/permutation matrices are numerically stable under bf16 (Dimension 5 [v]).
75
+ - **Large group enumeration (Dimension 3/4 [x])**: \|S_n\|=n! explodes; explicitly enumerating group elements -> memory and compute blow up. **Adaptation**: Use only generators (Ch 26 Generators and Relations) + Cayley graphs (Ch 30) for local propagation, without materializing the entire group.
76
+ - **Permutation = gather/scatter (Dimension 7/1/8 [x])**: Implementation as irregular gather/scatter causes warp divergence. **Adaptation**: Pre-compile fixed permutation patterns into structured sparsity or dense indexing.
77
+ - **Finite fields / modular arithmetic (Dimension 2 [x], Dimension 1/6 [v])**: mod p, GF(2^n), XOR, table lookups **are not floating-point MAC** and cannot use Tensor Cores, but are highly parallel on int/bitwise kernels. Conclusion: **suitable for pre/post-processing in coding/hashing, never to be placed in the training main-trunk GEMM**. Galois / exact-field arithmetic requires int, is non-differentiable, violating Dimension 8.
78
+
79
+ **Scoring conclusion**: Group equivariance (small groups, dense representations) and frequency-domain structures = mathematical beauty x GPU friendliness, can enter the main trunk; semirings, finite fields, exact Galois = require relaxation/isolation first, otherwise can only serve as auxiliary operators or offline tools.
80
+
81
+ **Worked example comparison (candidate x eight-dimension verdict):**
82
+
83
+ | Candidate design | Algebraic source (Ch) | Key dimension verdicts | Enter main trunk? |
84
+ |---|---|---|---|
85
+ | Equivariant layer (small groups D_n/S_n, permutation+rotation matrices) | 5, 6, 10 | 1[v] 2[v] 5[v], large groups 3/4[x] | [v] (limited to small groups/generators) |
86
+ | Tropical gating (low-dim min-plus replacing hard Top-K) | 12-14 relaxation | 1[v] 2[v] 8 needs relaxation, main trunk still (x,+) | [v] (gating only) |
87
+ | Pure min-plus main-trunk attention | 12-14 relaxation | 2[x] Tensor Core unsupported, 3[x] O(n^3) | [x] (needs log-sum-exp smoothing first) |
88
+ | Finite-field coding for KV/gradient compression | 22, 31 | 2[x] not floating-point MAC, 1/6[v] int parallel | [x] main trunk / [v] pre/post-processing |
89
+ | Cyclic group representations (FFT/RoPE token mixing) | 4, 11 | 1[v] 2[v] 3[v] (n log n) | [v] |
90
+
91
+ ## Which Thinking Lens to Invoke
92
+
93
+ - **Primary: `symmetry` (symmetry and invariance)** -- group actions, equivariance/invariance, orbit-stabilizer are the largest interface between this book and ML.
94
+ - **Secondary: `categorical`** -- extract the common structure of groups/rings/fields, see through "different modules are actually the same algebraic object."
95
+ - **Secondary: `axiomatization`** -- relax ring axioms to get semirings, check one by one whether assumed algebraic properties truly hold (guard against false symmetry).
96
+ - **Secondary: `duality`** -- homomorphisms/isomorphisms as equivalence transformations, FFT/frequency-domain transforms to simplify problems.
97
+ - **Secondary: `algorithmic`** -- finite group counting (Burnside, Ch 29), coding (Ch 31), finite field enumeration (Ch 22).
98
+
99
+ Typical combination chain: First `symmetry` to identify the group and invariants in the problem -> `categorical` to extract the common algebraic structure -> `axiomatization` to verify axioms truly hold (guard against false symmetry, guard against misusing subtraction) -> `duality` to realize as a learnable linear map -> finally pass through the `../gpu-friendly-math.md` eight-dimension acceptance gate.
100
+
101
+ ## Anti-patterns
102
+
103
+ - **Forcing "group elegance" into the main trunk without Tensor Core support**: tropical / finite-field arithmetic used as GEMM, actually runs as CUDA core scalar throughout.
104
+ - **Enumerating the entire group** instead of using generators (\|S_n\|=n! / \|GL\| blows memory).
105
+ - **Insisting on exact Galois / finite-field structures**: leads to non-differentiability, requires int, blocks end-to-end gradients.
106
+ - **Over-constraining with symmetry**: writing "approximately symmetric / pseudo-symmetric" patterns as hard equivariance, stifling expressiveness and model exploration (echoing the agentic-workflow principle of "don't hardcode subjective biases").
107
+ - **Confusing rings with semirings**: assuming additive inverses exist for subtraction/inversion, which fails under min-plus -> correctness errors.
108
+ - **Building a pile of modules for "group elegance"**: when existing equivariant libraries/FFT suffice, don't create new skills; first exhaust existing model capabilities, then add structure (echoing the agentic-workflow principle of "don't create a bunch of skills right away").
109
+ - **Treating homomorphisms as isomorphisms**: Homomorphisms can lose information (have a kernel); mistakenly treating them as invertible bijections leads to reconstruction/decoding errors.
110
+
111
+ ## Deep-dive Entry
112
+
113
+ > **Bibliographic information**: Joseph A. Gallian, *Contemporary Abstract Algebra*, 8th Edition, Brooks/Cole, Cengage Learning, 2013. ISBN 978-1-133-59971-5.
114
+ >
115
+ > **Activation method**: Place `Contemporary Abstract Algebra.pdf` in the `math_book/` folder at the project root; the Agent can then automatically search the original text. The PDF is not distributed via npm/git (copyright reasons) and must be obtained separately.
116
+
117
+ > **Full-fidelity lookup = Agent automatically searches the local PDF**: `math_book/Contemporary Abstract Algebra.pdf`. When precise definitions/theorems/examples are needed, have the Agent do targeted skimming by the following actual chapter numbers; do not paraphrase from memory. If the deployment environment lacks `math_book/`, stop at this distillation level.
118
+
119
+ - **Ch 5 Permutation Groups** -- Orbit / stabilizer: the root of equivariant weight sharing.
120
+ - **Ch 22 Finite Fields** -- GF(p^n) construction and arithmetic: the foundation for coding/hashing/secure aggregation.
121
+ - **Ch 29 Symmetry and Counting** -- Burnside counting: estimating equivalence class count / parameter savings.
122
+ - **Ch 31 Introduction to Algebraic Coding Theory** -- Hamming codes, linear codes over finite fields (generator matrix, Hamming distance/weight): compression and fault tolerance.
123
+ - **Ch 32 An Introduction to Galois Theory** -- The symmetry group of field extensions: an exemplar of structured transformations (deployment requires passing the GPU gate first).
124
+ - (Semiring relaxation starting point: Ch 12-14 ring axioms -> drop additive inverse -> tropical semiring.)
@@ -1,4 +1,4 @@
1
- # 🔢 抽象代数 / Abstract Algebra
1
+ # 抽象代数 / Abstract Algebra
2
2
 
3
3
  > **Contemporary Abstract Algebra**, Eighth Edition · Joseph A. Gallian · Brooks/Cole, Cengage Learning.
4
4
  > 本文件是「激活」参考:把书里的群/环/域结构映射到 ML/算法/Infra,不复述原文。全保真回查见文末「深挖入口」。
@@ -63,18 +63,18 @@
63
63
 
64
64
  **焦点 A:半环 GEMM 能上 Tensor Core 吗?——默认不能。**
65
65
 
66
- - **维度 2 GEMM 可映射(❌不友好)**:Tensor Core 硬件只做 (×,+) 的 MAC(fp16/bf16/fp8 累加到 fp32)。min-plus / max-plus 用的是 (+, min/max),**非原生**,朴素 tropical GEMM 退化到 CUDA core 标量比较,吃不到 Tensor Core。
67
- - **维度 3 复杂度(❌)**:min-plus 矩阵乘没有 Strassen 式亚立方加速(等价于 APSP 难题),朴素 O(n³)。
68
- - **维度 5 低精度(✅)**:tropical 用 max/min,无 exp 上溢,反而数值稳健。
69
- - **维度 8 可微/融合(⚠️可改造)**:min/max 不可微,需松弛。
70
- - **改造(→ 八维转友好)**:① log-sum-exp 软化 min/max 退回 (×,+) 稳定 softmax,重上 Tensor Core;② 把热带运算**只放在低维门控**,主干仍走标准 (×,+) GEMM(范例文件中 Tropical Gating = dim 1✅张量化 / 2❌非 Tensor Core GEMM / 3✅逐 token 门控亚二次,dim 8 需 LogSumExp 软化);③ 分块——块内标准 GEMM、块间 min-plus 归约。
66
+ - **维度 2 GEMM 可映射([x]不友好)**:Tensor Core 硬件只做 (×,+) 的 MAC(fp16/bf16/fp8 累加到 fp32)。min-plus / max-plus 用的是 (+, min/max),**非原生**,朴素 tropical GEMM 退化到 CUDA core 标量比较,吃不到 Tensor Core。
67
+ - **维度 3 复杂度([x])**:min-plus 矩阵乘没有 Strassen 式亚立方加速(等价于 APSP 难题),朴素 O(n³)。
68
+ - **维度 5 低精度([v])**:tropical 用 max/min,无 exp 上溢,反而数值稳健。
69
+ - **维度 8 可微/融合([~]可改造)**:min/max 不可微,需松弛。
70
+ - **改造(→ 八维转友好)**:① log-sum-exp 软化 min/max 退回 (×,+) 稳定 softmax,重上 Tensor Core;② 把热带运算**只放在低维门控**,主干仍走标准 (×,+) GEMM(范例文件中 Tropical Gating = dim 1[v]张量化 / 2[x]非 Tensor Core GEMM / 3[v]逐 token 门控亚二次,dim 8 需 LogSumExp 软化);③ 分块——块内标准 GEMM、块间 min-plus 归约。
71
71
 
72
72
  **焦点 B:群操作能张量化吗?——小群能,大群和精确算术不能。**
73
73
 
74
- - **有限群作用(维度 1/2 ✅)**:置换矩阵 / 稠密表示矩阵 → batched GEMM,G-CNN 已工程化。正交的旋转/置换矩阵在 bf16 下数值稳定(维度 5 ✅)。
75
- - **大群枚举(维度 3/4 ❌)**:\|Sₙ\|=n! 爆炸,显式枚举群元素 → 显存与算力爆。**改造**:只用生成元(26 Generators and Relations)+ Cayley 图(30)做局部传播,不物化整群。
76
- - **置换 = gather/scatter(维度 7/1/8 ❌)**:实现为不规则 gather/scatter 会 warp divergence。**改造**:固定置换模式预编译为结构化稀疏或 dense 索引。
77
- - **有限域 / 模算术(维度 2 ❌、维度 1/6 ✅)**:mod p、GF(2ⁿ)、XOR、查表**不是浮点 MAC**,吃不到 Tensor Core,但在 int/bitwise kernel 上高并行。结论:**适合放编码/哈希的前后处理,绝不放进训练主干 GEMM**。Galois/精确域算术要求 int、不可微,违反维度 8。
74
+ - **有限群作用(维度 1/2 [v])**:置换矩阵 / 稠密表示矩阵 → batched GEMM,G-CNN 已工程化。正交的旋转/置换矩阵在 bf16 下数值稳定(维度 5 [v])。
75
+ - **大群枚举(维度 3/4 [x])**:\|Sₙ\|=n! 爆炸,显式枚举群元素 → 显存与算力爆。**改造**:只用生成元(26 Generators and Relations)+ Cayley 图(30)做局部传播,不物化整群。
76
+ - **置换 = gather/scatter(维度 7/1/8 [x])**:实现为不规则 gather/scatter 会 warp divergence。**改造**:固定置换模式预编译为结构化稀疏或 dense 索引。
77
+ - **有限域 / 模算术(维度 2 [x]、维度 1/6 [v])**:mod p、GF(2ⁿ)、XOR、查表**不是浮点 MAC**,吃不到 Tensor Core,但在 int/bitwise kernel 上高并行。结论:**适合放编码/哈希的前后处理,绝不放进训练主干 GEMM**。Galois/精确域算术要求 int、不可微,违反维度 8。
78
78
 
79
79
  **判分结论**:群等变(小群、稠密表示)与频域结构 = 数学美 × GPU 友好,可进主干;半环、有限域、精确 Galois = 需先松弛/隔离,否则只能当辅助算子或离线工具。
80
80
 
@@ -82,21 +82,21 @@
82
82
 
83
83
  | 候选设计 | 代数来源(章) | 关键维度裁决 | 进主干? |
84
84
  |---|---|---|---|
85
- | 群等变层(小群 Dₙ/Sₙ,置换+旋转矩阵)| 5, 6, 10 | 1 2 5✅,群大时 3/4 | ✅(限小群/生成元)|
86
- | 热带门控(低维 min-plus 取代硬 Top-K)| 12–14 松弛 | 1 2 8 需松弛,主干仍 (×,+) | ✅(仅门控)|
87
- | 纯 min-plus 主干注意力 | 12–14 松弛 | 2 Tensor Core 不支持、3 O(n³) | ❌(先 log-sum-exp 软化)|
88
- | 有限域编码压缩 KV/梯度 | 22, 31 | 2 非浮点 MAC,1/6 int 并行 | ❌主干 / ✅前后处理 |
89
- | 循环群表示(FFT/RoPE token mixing)| 4, 11 | 1 2 3✅(n log n)| |
85
+ | 群等变层(小群 Dₙ/Sₙ,置换+旋转矩阵)| 5, 6, 10 | 1[v] 2[v] 5[v],群大时 3/4[x] | [v](限小群/生成元)|
86
+ | 热带门控(低维 min-plus 取代硬 Top-K)| 12–14 松弛 | 1[v] 2[v] 8 需松弛,主干仍 (×,+) | [v](仅门控)|
87
+ | 纯 min-plus 主干注意力 | 12–14 松弛 | 2[x] Tensor Core 不支持、3[x] O(n³) | [x](先 log-sum-exp 软化)|
88
+ | 有限域编码压缩 KV/梯度 | 22, 31 | 2[x] 非浮点 MAC,1/6[v] int 并行 | [x]主干 / [v]前后处理 |
89
+ | 循环群表示(FFT/RoPE token mixing)| 4, 11 | 1[v] 2[v] 3[v](n log n)| [v] |
90
90
 
91
- ## 该调用哪个思想武器
91
+ ## 该调用哪个思想透镜
92
92
 
93
- - **主:`symmetry-invariance`(对称与不变性)**——群作用、等变/不变、轨道-稳定子是本书与 ML 的最大接口。
94
- - **副:`abstraction`**——提取群/环/域的公共结构,看穿"不同模块其实是同一代数对象"。
93
+ - **主:`symmetry`(对称与不变性)**——群作用、等变/不变、轨道-稳定子是本书与 ML 的最大接口。
94
+ - **副:`categorical`**——提取群/环/域的公共结构,看穿"不同模块其实是同一代数对象"。
95
95
  - **副:`axiomatization`**——放松环公理得半环、逐条核对所设代数性质是否真成立(防伪对称)。
96
- - **副:`transformation`**——同态/同构作等价转换、FFT/频域变换简化问题。
97
- - **副:`discrete-combinatorial`**——有限群计数(Burnside, 29)、编码(31)、有限域枚举(22)。
96
+ - **副:`duality`**——同态/同构作等价转换、FFT/频域变换简化问题。
97
+ - **副:`algorithmic`**——有限群计数(Burnside, 29)、编码(31)、有限域枚举(22)。
98
98
 
99
- 典型组合链:先 `symmetry-invariance` 识别问题里的群与不变量 → `abstraction` 抽出公共代数结构 → `axiomatization` 核对公理是否真成立(防伪对称、防误用减法)→ `transformation` 落成可学习线性映射 → 最后过 `../gpu-friendly-math.md` 八维门。
99
+ 典型组合链:先 `symmetry` 识别问题里的群与不变量 → `categorical` 抽出公共代数结构 → `axiomatization` 核对公理是否真成立(防伪对称、防误用减法)→ `duality` 落成可学习线性映射 → 最后过 `../gpu-friendly-math.md` 八维门。
100
100
 
101
101
  ## 反模式
102
102
 
@@ -110,7 +110,7 @@
110
110
 
111
111
  ## 深挖入口
112
112
 
113
- > **📖 书目信息**:Joseph A. Gallian, *Contemporary Abstract Algebra*, 8th Edition, Brooks/Cole, Cengage Learning, 2013. ISBN 978-1-133-59971-5.
113
+ > **书目信息**:Joseph A. Gallian, *Contemporary Abstract Algebra*, 8th Edition, Brooks/Cole, Cengage Learning, 2013. ISBN 978-1-133-59971-5.
114
114
  >
115
115
  > **启用方式**:将 `Contemporary Abstract Algebra.pdf` 放入项目根目录的 `math_book/` 文件夹,Agent 即可自动搜索原文。PDF 不随 npm/git 分发(版权原因),需自行获取。
116
116