math-skill 2.0.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/README.en-US.md +167 -175
  2. package/README.md +167 -175
  3. package/agents/math-critic.en.md +235 -0
  4. package/agents/math-critic.md +10 -8
  5. package/commands/ask.md +3 -12
  6. package/design-patterns/attention/equivariant-attention.en.md +72 -0
  7. package/design-patterns/attention/equivariant-attention.md +72 -0
  8. package/design-patterns/attention/geometry-aware-attention.en.md +73 -0
  9. package/design-patterns/attention/geometry-aware-attention.md +72 -0
  10. package/design-patterns/attention/information-bottleneck-attention.en.md +72 -0
  11. package/design-patterns/attention/information-bottleneck-attention.md +72 -0
  12. package/design-patterns/attention/projection-attention.en.md +68 -0
  13. package/design-patterns/attention/projection-attention.md +68 -0
  14. package/design-patterns/attention/spectral-attention.en.md +71 -0
  15. package/design-patterns/attention/spectral-attention.md +71 -0
  16. package/design-patterns/compression/leverage-score-selection.en.md +71 -0
  17. package/design-patterns/compression/leverage-score-selection.md +71 -0
  18. package/design-patterns/compression/low-rank-kv-cache.en.md +60 -0
  19. package/design-patterns/compression/low-rank-kv-cache.md +60 -0
  20. package/design-patterns/compression/spectral-token-pruning.en.md +61 -0
  21. package/design-patterns/compression/spectral-token-pruning.md +61 -0
  22. package/design-patterns/compression/topology-preserving-compression.en.md +64 -0
  23. package/design-patterns/compression/topology-preserving-compression.md +64 -0
  24. package/design-patterns/loss/constraint-penalty.en.md +67 -0
  25. package/design-patterns/loss/constraint-penalty.md +78 -0
  26. package/design-patterns/loss/contrastive-loss.en.md +59 -0
  27. package/design-patterns/loss/contrastive-loss.md +68 -0
  28. package/design-patterns/loss/information-bottleneck-loss.en.md +69 -0
  29. package/design-patterns/loss/information-bottleneck-loss.md +74 -0
  30. package/design-patterns/loss/orthogonality-loss.en.md +56 -0
  31. package/design-patterns/loss/orthogonality-loss.md +60 -0
  32. package/design-patterns/loss/variational-loss.en.md +61 -0
  33. package/design-patterns/loss/variational-loss.md +71 -0
  34. package/design-patterns/representation/equivariant-split.en.md +87 -0
  35. package/design-patterns/representation/equivariant-split.md +89 -0
  36. package/design-patterns/representation/manifold-representation.en.md +85 -0
  37. package/design-patterns/representation/manifold-representation.md +87 -0
  38. package/design-patterns/representation/shared-private-decomposition.en.md +84 -0
  39. package/design-patterns/representation/shared-private-decomposition.md +86 -0
  40. package/design-patterns/representation/subspace-alignment.en.md +90 -0
  41. package/design-patterns/representation/subspace-alignment.md +92 -0
  42. package/design-patterns/routing/graph-routing.en.md +79 -0
  43. package/design-patterns/routing/graph-routing.md +81 -0
  44. package/design-patterns/routing/moe-routing.en.md +85 -0
  45. package/design-patterns/routing/moe-routing.md +87 -0
  46. package/design-patterns/routing/optimal-transport-routing.en.md +68 -0
  47. package/design-patterns/routing/optimal-transport-routing.md +72 -0
  48. package/design-patterns/routing/spectral-clustering-routing.en.md +88 -0
  49. package/design-patterns/routing/spectral-clustering-routing.md +90 -0
  50. package/knowledge-base/differential-geometry/connection.en.md +51 -0
  51. package/knowledge-base/differential-geometry/connection.md +51 -0
  52. package/knowledge-base/differential-geometry/curvature.en.md +49 -0
  53. package/knowledge-base/differential-geometry/curvature.md +49 -0
  54. package/knowledge-base/differential-geometry/geodesic.en.md +51 -0
  55. package/knowledge-base/differential-geometry/geodesic.md +51 -0
  56. package/knowledge-base/differential-geometry/manifold.en.md +47 -0
  57. package/knowledge-base/differential-geometry/manifold.md +47 -0
  58. package/knowledge-base/differential-geometry/metric-tensor.en.md +50 -0
  59. package/knowledge-base/differential-geometry/metric-tensor.md +50 -0
  60. package/knowledge-base/differential-geometry/tangent-space.en.md +48 -0
  61. package/knowledge-base/differential-geometry/tangent-space.md +48 -0
  62. package/knowledge-base/information-geometry/fisher-metric.en.md +56 -0
  63. package/knowledge-base/information-geometry/fisher-metric.md +56 -0
  64. package/knowledge-base/information-geometry/natural-gradient.en.md +54 -0
  65. package/knowledge-base/information-geometry/natural-gradient.md +54 -0
  66. package/knowledge-base/lie-theory/equivariance.en.md +54 -0
  67. package/knowledge-base/lie-theory/equivariance.md +54 -0
  68. package/knowledge-base/lie-theory/group-action.en.md +51 -0
  69. package/knowledge-base/lie-theory/group-action.md +51 -0
  70. package/knowledge-base/lie-theory/lie-algebra.en.md +51 -0
  71. package/knowledge-base/lie-theory/lie-algebra.md +51 -0
  72. package/knowledge-base/lie-theory/lie-group.en.md +51 -0
  73. package/knowledge-base/lie-theory/lie-group.md +51 -0
  74. package/knowledge-base/lie-theory/representation.en.md +52 -0
  75. package/knowledge-base/lie-theory/representation.md +52 -0
  76. package/knowledge-base/matrix-analysis/low-rank-approximation.en.md +49 -0
  77. package/knowledge-base/matrix-analysis/low-rank-approximation.md +49 -0
  78. package/knowledge-base/matrix-analysis/matrix-perturbation.en.md +49 -0
  79. package/knowledge-base/matrix-analysis/matrix-perturbation.md +49 -0
  80. package/knowledge-base/matrix-analysis/positive-semidefinite.en.md +50 -0
  81. package/knowledge-base/matrix-analysis/positive-semidefinite.md +50 -0
  82. package/knowledge-base/matrix-analysis/projection.en.md +47 -0
  83. package/knowledge-base/matrix-analysis/projection.md +47 -0
  84. package/knowledge-base/matrix-analysis/spectral-decomposition.en.md +48 -0
  85. package/knowledge-base/matrix-analysis/spectral-decomposition.md +48 -0
  86. package/knowledge-base/optimization/constrained-optimization.en.md +53 -0
  87. package/knowledge-base/optimization/constrained-optimization.md +53 -0
  88. package/knowledge-base/optimization/convex-optimization.en.md +50 -0
  89. package/knowledge-base/optimization/convex-optimization.md +50 -0
  90. package/knowledge-base/optimization/lagrangian-duality.en.md +50 -0
  91. package/knowledge-base/optimization/lagrangian-duality.md +50 -0
  92. package/knowledge-base/optimization/proximal-method.en.md +52 -0
  93. package/knowledge-base/optimization/proximal-method.md +52 -0
  94. package/knowledge-base/optimization/riemannian-optimization.en.md +51 -0
  95. package/knowledge-base/optimization/riemannian-optimization.md +51 -0
  96. package/knowledge-base/overview.en.md +39 -0
  97. package/knowledge-base/overview.md +29 -218
  98. package/knowledge-base/probability/concentration-inequality.en.md +45 -0
  99. package/knowledge-base/probability/concentration-inequality.md +45 -0
  100. package/knowledge-base/probability/entropy.en.md +47 -0
  101. package/knowledge-base/probability/entropy.md +47 -0
  102. package/knowledge-base/probability/fisher-information.en.md +48 -0
  103. package/knowledge-base/probability/fisher-information.md +48 -0
  104. package/knowledge-base/probability/information-bottleneck.en.md +49 -0
  105. package/knowledge-base/probability/information-bottleneck.md +49 -0
  106. package/knowledge-base/probability/kl-divergence.en.md +51 -0
  107. package/knowledge-base/probability/kl-divergence.md +51 -0
  108. package/knowledge-base/topology/euler-characteristic.en.md +54 -0
  109. package/knowledge-base/topology/euler-characteristic.md +54 -0
  110. package/knowledge-base/topology/fundamental-group.en.md +52 -0
  111. package/knowledge-base/topology/fundamental-group.md +52 -0
  112. package/knowledge-base/topology/persistent-homology.en.md +54 -0
  113. package/knowledge-base/topology/persistent-homology.md +54 -0
  114. package/lenses/algorithmic.en.md +49 -0
  115. package/lenses/algorithmic.md +49 -0
  116. package/lenses/axiomatization.en.md +48 -0
  117. package/lenses/axiomatization.md +48 -0
  118. package/lenses/categorical.en.md +48 -0
  119. package/lenses/categorical.md +48 -0
  120. package/lenses/causal.en.md +49 -0
  121. package/lenses/causal.md +49 -0
  122. package/lenses/duality.en.md +47 -0
  123. package/lenses/duality.md +47 -0
  124. package/lenses/game.en.md +50 -0
  125. package/lenses/game.md +50 -0
  126. package/lenses/geometric.en.md +53 -0
  127. package/lenses/geometric.md +53 -0
  128. package/lenses/local-to-global.en.md +52 -0
  129. package/lenses/local-to-global.md +52 -0
  130. package/lenses/perturbation.en.md +51 -0
  131. package/lenses/perturbation.md +51 -0
  132. package/lenses/probabilistic.en.md +48 -0
  133. package/lenses/probabilistic.md +48 -0
  134. package/lenses/projection.en.md +50 -0
  135. package/lenses/projection.md +50 -0
  136. package/lenses/spectral.en.md +52 -0
  137. package/lenses/spectral.md +52 -0
  138. package/lenses/symmetry.en.md +49 -0
  139. package/lenses/symmetry.md +49 -0
  140. package/lenses/topological.en.md +48 -0
  141. package/lenses/topological.md +48 -0
  142. package/lenses/variational.en.md +48 -0
  143. package/lenses/variational.md +48 -0
  144. package/package.json +11 -3
  145. package/references/agentic-workflow.en.md +53 -0
  146. package/references/agentic-workflow.md +2 -0
  147. package/references/books/abstract-algebra.md +9 -5
  148. package/references/books/algebraic-geometry-rising-sea.md +9 -5
  149. package/references/books/differential-geometry.md +7 -3
  150. package/references/books/matrix-analysis.md +8 -4
  151. package/references/books/micro-lie-theory.md +7 -3
  152. package/references/books/optimization-ml.md +5 -1
  153. package/references/books/smooth-manifolds.md +7 -3
  154. package/references/gpu-friendly-math.en.md +65 -0
  155. package/references/gpu-friendly-math.md +4 -2
  156. package/references/inspiration.en.md +113 -0
  157. package/references/inspiration.md +4 -2
  158. package/skills/math-research-activator/SKILL.en.md +187 -0
  159. package/skills/math-research-activator/SKILL.md +162 -108
  160. package/skills/math-research-activator/original-texts.en.md +105 -0
  161. package/skills/math-research-activator/original-texts.md +11 -11
  162. package/commands/abstraction.md +0 -13
  163. package/commands/algorithmic-thinking.md +0 -13
  164. package/commands/axiomatization.md +0 -13
  165. package/commands/causal-inference.md +0 -13
  166. package/commands/discrete-combinatorial.md +0 -13
  167. package/commands/game-theory.md +0 -13
  168. package/commands/induction-analogy.md +0 -13
  169. package/commands/information-theory.md +0 -13
  170. package/commands/logic-deduction.md +0 -13
  171. package/commands/modeling.md +0 -13
  172. package/commands/optimization.md +0 -13
  173. package/commands/probability-statistics.md +0 -13
  174. package/commands/symmetry-invariance.md +0 -13
  175. package/commands/topological-thinking.md +0 -13
  176. package/commands/transformation.md +0 -13
  177. package/skills/abstraction/SKILL.md +0 -119
  178. package/skills/abstraction/original-texts.md +0 -175
  179. package/skills/algorithmic-thinking/SKILL.md +0 -136
  180. package/skills/algorithmic-thinking/original-texts.md +0 -256
  181. package/skills/axiomatization/SKILL.md +0 -149
  182. package/skills/axiomatization/original-texts.md +0 -160
  183. package/skills/causal-inference/SKILL.md +0 -149
  184. package/skills/causal-inference/original-texts.md +0 -167
  185. package/skills/discrete-combinatorial/SKILL.md +0 -129
  186. package/skills/discrete-combinatorial/original-texts.md +0 -185
  187. package/skills/game-theory/SKILL.md +0 -121
  188. package/skills/game-theory/original-texts.md +0 -131
  189. package/skills/induction-analogy/SKILL.md +0 -150
  190. package/skills/induction-analogy/original-texts.md +0 -154
  191. package/skills/information-theory/SKILL.md +0 -138
  192. package/skills/information-theory/original-texts.md +0 -127
  193. package/skills/logic-deduction/SKILL.md +0 -133
  194. package/skills/logic-deduction/original-texts.md +0 -173
  195. package/skills/modeling/SKILL.md +0 -137
  196. package/skills/modeling/original-texts.md +0 -165
  197. package/skills/optimization/SKILL.md +0 -133
  198. package/skills/optimization/original-texts.md +0 -168
  199. package/skills/probability-statistics/SKILL.md +0 -149
  200. package/skills/probability-statistics/original-texts.md +0 -193
  201. package/skills/symmetry-invariance/SKILL.md +0 -137
  202. package/skills/symmetry-invariance/original-texts.md +0 -221
  203. package/skills/topological-thinking/SKILL.md +0 -126
  204. package/skills/topological-thinking/original-texts.md +0 -164
  205. package/skills/transformation/SKILL.md +0 -122
  206. package/skills/transformation/original-texts.md +0 -216
package/README.en-US.md CHANGED
@@ -2,58 +2,105 @@
2
2
  <a href="README.md">中文</a> | <a href="README.en-US.md">English</a>
3
3
  </p>
4
4
 
5
- # ⚔️ Math Skill — Math Research Activator
5
+ # ⚔️ Math Skill — A Mathematical Research Operating System for AI Architecture Design
6
6
 
7
- > **Activating modern mathematics (algebraic geometry / differential geometry / Lie theory / category theory / matrix analysis / optimization) into algorithm × GPU co-design beautiful in math, friendly to GPUs.**
7
+ > **The thinking system does not hand out theorems. The knowledge system does not improvise inspiration. The design layer does not fake profundity.**
8
8
 
9
9
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
10
10
  [![npm version](https://img.shields.io/npm/v/math-skill.svg)](https://www.npmjs.com/package/math-skill)
11
+ [![npm downloads](https://img.shields.io/npm/dt/math-skill.svg)](https://www.npmjs.com/package/math-skill)
11
12
 
12
13
  ---
13
14
 
14
- ## Philosophy
15
+ > **If this project inspires you, please consider leaving a Star⭐.** Every Star is a resonance with the beauty of mathematics — and the fuel that keeps this project alive. Welcome, every fellow traveler who loves math and sails its vast ocean.
15
16
 
16
- The mathematical foundation of this AI revolution is **20th-century mathematics stepping onto the commercial computing stage for the first time** — category theory, algebraic topology, algebraic geometry. Most mainstream algorithms today still rest on the 1800–1900s calculus / linear algebra. Activating modern mathematics into algorithm design is the most important thing in the algorithm exploration phase.
17
+ ---
17
18
 
18
- This skill packages sixteen core mathematical ideas into callable thinking frameworks, and **steps in automatically** when the workspace contains ML / model code, CUDA / kernels, or algorithm research notes: diagnose the problem → map modern mathematical structures → route thinking weapons → GPU feasibility screening. Every deliverable must pass a **double acceptance gate**:
19
+ ## Inspiration
19
20
 
20
- 1. **Beautiful in math** self-consistent, differentiable (or relaxable to differentiable), with correctness guarantees.
21
- 2. **Friendly to GPU** — passes the eight-dimensional gate in `references/gpu-friendly-math.md`.
21
+ The story of Sophus Lie forging a "dragon-slaying blade" tells us this: the Lie group–Lie algebra machinery invented to solve differential equations ended up becoming the lingua franca for describing symmetry and robot state estimation — the value of a mathematical tool far outlives its original intent, which is exactly the prototype of "cross-domain activation." See [`references/inspiration.md`](references/inspiration.md).
22
22
 
23
- > "The model already has enough math inside; what's missing is a single cross-domain activation. Humans pick direction; the agent searches, enumerates, and verifies."
23
+ > The most fascinating thing about mathematics: a tool invented for one problem reveals unforeseen power in an entirely different domain.
24
24
 
25
25
  ---
26
26
 
27
- ## What v2.0.1 Does
27
+ ## Philosophy
28
+
29
+ When you face an AI research problem, this system helps you answer four questions:
28
30
 
29
- - **Auto-trigger entry**: `math-research-activator` only intervenes when both environment signals (workspace contains architecture core code / CUDA kernel / research notes) AND task signals (designing new architectures / operators, analyzing theoretical properties, transferring mathematical structures) are hit. Pure engineering tasks (debugging, code review, refactoring, hyperparameter tuning) do NOT trigger.
30
- - **Modern math activation layer**: `references/books/*.md` × 7 (algebraic geometry, differential geometry, Lie theory, abstract algebra, matrix analysis, optimization, manifolds) serve as low-token activation indices, loaded by problem type — they do not replace the full books.
31
- - **GPU 8-D cross-cut**: all 15 thinking weapons are explicitly mapped to the formal eight dimensions of `references/gpu-friendly-math.md`: tensorization / GEMM-mappability / complexity / memory & KV-Cache / low-precision stability / parallelism & communication / sparse structure / operator fusion.
32
- - **Single research path**: oriented toward research, algorithms, operators, and training/inference infra; the life-advice mode has been dropped.
33
- - **Progressive disclosure**: resident layer (activator + description) → methodology layer (on demand) → book layer (on demand), keeping irrelevant context out of the prompt.
31
+ 1. **What mathematical perspective should I use?** Thinking Lenses
32
+ 2. **What specific math do I need?** Knowledge Base
33
+ 3. **How do I turn math into model design?** Design Translation
34
+ 4. **Is it mathematically sound and engineering-feasible?** Critic
35
+
36
+ ```
37
+ Problem
38
+
39
+ Thinking Lenses: What perspective fits this problem?
40
+
41
+ Math Knowledge: What specific tools does this perspective need?
42
+
43
+ Design Translation: How do these tools become model structures / losses / operators?
44
+
45
+ Critic: Mathematically sound? Engineering-feasible?
46
+ ```
34
47
 
35
48
  ---
36
49
 
37
- ## Sixteen Thinking Weapons
38
-
39
- | # | Thinking Weapon | Core Idea | Algorithm / GPU Application |
40
- |---|----------------|-----------|----------------------------|
41
- | 0 | 🧭 [Math Research Activator](skills/math-research-activator/SKILL.md) | Auto-trigger entry: diagnose → map → route → GPU filter, with a double acceptance gate | Intervenes only when both environment AND task signals hit; pure engineering tasks are excluded |
42
- | 1 | 📐 [Axiomatization](skills/axiomatization/SKILL.md) | Build rigorous logic from the fewest assumptions | Review algorithm assumptions; pin down axioms and invariants for structures |
43
- | 2 | 🧩 [Abstraction](skills/abstraction/SKILL.md) | Grasp the essence, ignore non-essential detail | Extract transferable structures; discover cross-domain commonalities |
44
- | 3 | 🧠 [Logic Deduction](skills/logic-deduction/SKILL.md) | Rigorously derive new truths from existing truths | Formally verify algorithm correctness; loop invariants |
45
- | 4 | 🌉 [Modeling](skills/modeling/SKILL.md) | Real problem → math problem → explain reality | Build computable models; parameterized selection |
46
- | 5 | ⚖️ [Optimization](skills/optimization/SKILL.md) | Find the optimum under constraints | Optimizer selection; second-order GPU feasibility; duality |
47
- | 6 | 🎲 [Probability & Statistics](skills/probability-statistics/SKILL.md) | Quantify uncertainty; extract patterns from data | Randomized algorithms, sampling, quantization, training dynamics |
48
- | 7 | 🔄 [Transformation](skills/transformation/SKILL.md) | Complex problem → equivalent simpler problem | Conv → GEMM, spectral transforms, KV frequency-domain compression |
49
- | 8 | ⚛️ [Symmetry & Invariance](skills/symmetry-invariance/SKILL.md) | Properties preserved under transformations | Equivariant networks (SO(3)/SE(3)), tropical semiring routing |
50
- | 9 | 📈 [Induction & Analogy](skills/induction-analogy/SKILL.md) | From special to general, known to unknown | Cross-domain structure transfer; inductive bias design |
51
- | 10 | 🖥️ [Algorithmic Thinking](skills/algorithmic-thinking/SKILL.md) | Reduce to finite steps; evaluate cost and feasibility | Sub-quadratic complexity, parallelism, operator fusion |
52
- | 11 | 📡 [Information Theory](skills/information-theory/SKILL.md) | Information is the reduction of uncertainty | Compression, pruning, quantization, KV compression, routing |
53
- | 12 | 🎯 [Game Theory](skills/game-theory/SKILL.md) | Optimal strategy depends on others' choices | Multi-agent, adversarial training, routing games |
54
- | 13 | 🔗 [Causal Inference](skills/causal-inference/SKILL.md) | Correlation causation, but causation can be formalized | Interpretability, OOD generalization, DGP modeling |
55
- | 14 | 🌀 [Topological Thinking](skills/topological-thinking/SKILL.md) | Properties preserved under continuous deformation | Čech cohomology regularization, sheaf attention, TDA |
56
- | 15 | 🧮 [Discrete & Combinatorial Thinking](skills/discrete-combinatorial/SKILL.md) | Counting, enumeration, laws of finite objects | Sparse structure, routing, finite-field / semiring algorithms |
50
+ ## Three-Layer Orthogonal Architecture
51
+
52
+ | Layer | Role | Directory | Files |
53
+ |-------|------|-----------|-------|
54
+ | **Thinking Lenses** | Diagnose problem structure, recommend math perspectives | `lenses/*.md` | 15 |
55
+ | **Math Knowledge** | Provide concrete math tools (definitions/theorems/formulas) | `knowledge-base/*/*.md` | 31 |
56
+ | **Design Translation** | Bridge math to AI modules/losses/operators | `design-patterns/*/*.md` | 22 |
57
+
58
+ Supporting layers:
59
+ - `references/books/*.md`: 7 book distillations for deep context
60
+ - `references/gpu-friendly-math.md`: GPU 8-dimension acceptance gate
61
+ - `agents/math-critic.md`: Math-engineering dual critic
62
+
63
+ ### 15 Thinking Lenses
64
+
65
+ | Lens | File | Core Perspective |
66
+ |------|------|-----------------|
67
+ | Axiomatization | `lenses/axiomatization.md` | Audit assumptions for consistency/independence/completeness |
68
+ | Duality | `lenses/duality.md` | Transform to dual space to expose constraints and invariants |
69
+ | Symmetry | `lenses/symmetry.md` | Invariants and conservation laws under transformations |
70
+ | Spectral | `lenses/spectral.md` | Eigenvalues/singular values reveal dominant structure |
71
+ | Geometric | `lenses/geometric.md` | Metric/curvature/manifold spatial structure |
72
+ | Projection | `lenses/projection.md` | Orthogonal decomposition, subspace separation, conflict elimination |
73
+ | Variational | `lenses/variational.md` | Constrained extrema, energy minimization |
74
+ | Local-to-Global | `lenses/local-to-global.md` | Assemble local properties into global structure |
75
+ | Topological | `lenses/topological.md` | Continuous-deformation invariants, connectivity, holes |
76
+ | Categorical | `lenses/categorical.md` | Universal properties, functors, natural transformations |
77
+ | Perturbation | `lenses/perturbation.md` | Propagation of small perturbations, stability, robustness |
78
+ | Causal | `lenses/causal.md` | Correlation ≠ causation, interventions, counterfactuals |
79
+ | Game | `lenses/game.md` | Multi-agent strategic interaction, equilibrium, mechanism design |
80
+ | Probabilistic | `lenses/probabilistic.md` | Quantify uncertainty, Bayesian updating |
81
+ | Algorithmic | `lenses/algorithmic.md` | Complexity, feasibility, parallelism |
82
+
83
+ ### Knowledge Base (by math domain)
84
+
85
+ | Domain | Cards |
86
+ |--------|-------|
87
+ | Matrix Analysis | projection, spectral-decomposition, low-rank-approximation, positive-semidefinite, matrix-perturbation |
88
+ | Optimization | lagrangian-duality, convex-optimization, constrained-optimization, riemannian-optimization, proximal-method |
89
+ | Differential Geometry | manifold, tangent-space, metric-tensor, geodesic, curvature, connection |
90
+ | Lie Theory | group-action, lie-group, lie-algebra, representation, equivariance |
91
+ | Topology | persistent-homology, euler-characteristic, fundamental-group |
92
+ | Probability & Information | concentration-inequality, entropy, kl-divergence, information-bottleneck, fisher-information |
93
+ | Information Geometry | natural-gradient, fisher-metric |
94
+
95
+ ### Design Patterns (by AI component)
96
+
97
+ | Component | Patterns |
98
+ |-----------|----------|
99
+ | Attention | projection-attention, spectral-attention, equivariant-attention, geometry-aware-attention, information-bottleneck-attention |
100
+ | Loss | orthogonality-loss, contrastive-loss, variational-loss, information-bottleneck-loss, constraint-penalty |
101
+ | Routing | optimal-transport-routing, graph-routing, moe-routing, spectral-clustering-routing |
102
+ | Representation | shared-private-decomposition, manifold-representation, equivariant-split, subspace-alignment |
103
+ | Compression | low-rank-kv-cache, spectral-token-pruning, topology-preserving-compression, leverage-score-selection |
57
104
 
58
105
  ---
59
106
 
@@ -61,199 +108,144 @@ This skill packages sixteen core mathematical ideas into callable thinking frame
61
108
 
62
109
  ### Installation
63
110
 
64
- Just paste the following into Claude Code or any other terminal-style AI assistant:
65
-
66
111
  ```
67
112
  Please help me install math-skill: https://github.com/the-thinker0/math-skill, and show me how to use it
68
113
  ```
69
114
 
70
- Manual-install alternative (downloads the source; does not register the skill automatically):
115
+ Manual install:
71
116
 
72
117
  ```bash
73
118
  git clone https://github.com/the-thinker0/math-skill.git
74
119
  ```
75
120
 
76
- Claude Code / Codex-style platforms: copy or symlink `skills/` and `commands/` according to the platform's skills / commands directory conventions, keeping `references/` at the same repo depth. Don't copy a single `SKILL.md` in isolation — `../../references/*` won't resolve.
77
-
78
- Cursor / other Markdown-rule platforms: treat `commands/*.md` as the manual entry points and `skills/*/SKILL.md` as the rule / skill body, and keep `references/`. If the platform has no auto-trigger mechanism, fire manually with `/ask` or the matching command.
79
-
80
- You can also inspect the npm package first:
81
-
82
- ```bash
83
- npm pack math-skill --dry-run
84
- ```
85
-
86
121
  ### Usage
87
122
 
88
- **Auto-trigger**: fires only when both conditions hold (1) the workspace contains architecture core code (attention / transformer / MoE, `*.cu` / kernel, Triton) or research notes, AND (2) the user's task involves **designing / improving** new architectures / operators, **analyzing** theoretical properties, or **transferring** mathematical structures. Pure engineering tasks (debugging, argument-passing checks, refactoring, hyperparameter tuning, loss implementation tweaks) do not trigger.
89
-
90
- ### Does it auto-trigger in normal chat?
91
-
92
- Yes, but it depends on whether the install platform supports **skill metadata auto-routing**. In skills-aware environments like Claude Code / Codex, you don't need `/ask` on every turn after installing. As of v2.0.1 the trigger has been tightened: the skill loads only when **both environment and task signals hit** — routine code review, debugging, and refactoring will not fire it.
93
-
94
- For example, you can simply ask:
95
-
96
- ```
97
- I want to design a long-context attention that uses less KV-Cache — any modern math angle?
98
- ```
99
-
100
- Or:
101
-
102
- ```
103
- Can the memory access and fusion pattern of this Triton kernel be improved at the algorithmic-structure level?
104
- ```
123
+ **Auto-trigger**: The system auto-diagnoses user intent and routes to the appropriate layer:
105
124
 
106
- Such questions trigger `math-research-activator`, which loads `references/gpu-friendly-math.md` and `references/books/*.md` on demand. `/ask` and the slash commands below are the **explicit / fallback entry**: use them only when the platform has no auto-trigger, or when you want to force a specific thinking weapon.
125
+ | Scenario | Signal | Path |
126
+ |----------|--------|------|
127
+ | Problem Analysis | "Is this design sound?" | Lenses → Critic |
128
+ | Mechanism Design | "Design a new attention" | Lenses → Knowledge → Design → Critic |
129
+ | Knowledge Query | "What is tangent space and how does it relate to gradient optimization?" | Knowledge |
130
+ | Verification | "Does this formula hold?" | Knowledge → Critic |
131
+ | Pure Engineering | debug, refactoring, tuning | **Not triggered** |
107
132
 
108
- **Manual fallback** (when in doubt, start with `/ask`):
133
+ **Manual trigger**:
109
134
 
110
135
  ```
111
- /ask <your question> # activator: diagnose + map + route + GPU filter
112
- /axiomatization <your question> # axiomatization
113
- /abstraction <your question> # abstraction
114
- /logic-deduction <your question> # logic deduction
115
- /modeling <your question> # modeling
116
- /optimization <your question> # optimization
117
- /probability-statistics <your question> # probability & statistics
118
- /transformation <your question> # transformation
119
- /symmetry-invariance <your question> # symmetry & invariance
120
- /induction-analogy <your question> # induction & analogy
121
- /algorithmic-thinking <your question> # algorithmic thinking
122
- /information-theory <your question> # information theory
123
- /game-theory <your question> # game theory
124
- /causal-inference <your question> # causal inference
125
- /topological-thinking <your question> # topological thinking
126
- /discrete-combinatorial <your question> # discrete & combinatorial thinking
136
+ /ask <your question> # Smart diagnosis: auto-detect scenario and route
127
137
  ```
128
138
 
129
139
  ### Language Switching
130
140
 
131
- Default output is **Chinese**. For **English** output, append `in English` to a command:
132
-
133
- ```
134
- /optimization Is K-FAC feasible on H100 with this batch size? in English
135
- ```
141
+ Auto-detects user language: Chinese messages get Chinese output, English messages get English output.
136
142
 
137
143
  ---
138
144
 
139
- ## Usage Examples
145
+ ## Workflow Example
140
146
 
141
- ### Auto-trigger (research / algorithm / GPU)
147
+ **User**: "Design a new KV Cache compression method that preserves long-range dependencies without just doing top-k"
142
148
 
143
- The activator steps in only when the workspace contains a kernel or attention core implementation **and the task involves design / analysis / transfer**: problem diagnosis, transferable modern-math structure candidates, weapon routing, 8-D GPU screening. Pure engineering tasks (debugging, code review, hyperparameter tuning) do not trigger. See the **Tropical Sheaf Attention** example in `skills/math-research-activator/SKILL.md`: it is a candidate exploration template, not a pre-baked benchmark result — it has to be validated on complexity, memory, low-precision stability, and kernel fusibility before adoption.
144
-
145
- ### Manual trigger (research scenarios)
146
-
147
- **Review an algorithm's theoretical assumptions**:
148
- ```
149
- /axiomatization This attention variant claims permutation invariance, yet its positional encoding smuggles in an implicit total order — is it self-consistent?
150
- ```
151
-
152
- **Check a proof / invariant**:
153
- ```
154
- /logic-deduction Does the step from line 5 to line 6 in this convergence proof skip a premise? Does the loop invariant hold?
155
- ```
156
-
157
- **Optimizer / second-order feasibility**:
158
- ```
159
- /optimization I want to replace Adam with K-FAC but memory is tight — is this second-order method feasible on GPU? Is there a retrofittable low-rank approximation?
160
- ```
161
-
162
- **Change representation via transformation**:
163
- ```
164
- /transformation Can this custom convolution operator be rewritten as a GEMM that fully saturates Tensor Cores? Is the inverse transform numerically stable?
165
- ```
166
-
167
- **Equivariance / symmetry**:
168
149
  ```
169
- /symmetry-invariance Design an SO(3)-equivariant feature layer — can the group action be tensorized into a GEMM?
150
+ Step 1 Diagnosis: Scenario B (Mechanism Design)
151
+ Problem type: sequence memory compression + information preservation + long-range structure
152
+ Core tension: compress token count vs. preserve long-range dependencies
153
+
154
+ Step 2 Lens Selection:
155
+ 1. Spectral (preserve dominant subspace)
156
+ 2. Information-theoretic (preserve max mutual information states)
157
+ 3. Topological (preserve key connection points in sequence structure)
158
+
159
+ Step 3 Knowledge Query:
160
+ → low-rank-approximation (matrix analysis)
161
+ → leverage-score-selection (matrix analysis)
162
+ → information-bottleneck (probability & information)
163
+
164
+ Step 4 Design Translation:
165
+ Candidate A: Spectral KV Compression (low-rank + leverage score)
166
+ Candidate B: Information-Preserving Cache (query sensitivity)
167
+ Candidate C: Topology-Preserving Cache (graph bridge node retention)
168
+
169
+ Step 5 Critic Review:
170
+ A is most GPU-friendly, B needs future query estimation (uncertainty), C graph construction too expensive
171
+ Recommendation: prioritize A, use B as a lightweight gate
170
172
  ```
171
173
 
172
174
  ---
173
175
 
174
- ## Progressive Disclosure
175
-
176
- | Layer | Content | Load timing |
177
- |-------|---------|-------------|
178
- | Resident trigger | `skills/math-research-activator/SKILL.md` + each weapon's short `description` | Loaded on auto / manual trigger |
179
- | Methodology | `references/agentic-workflow.md` (Human-in-the-Agent-Loop), `references/gpu-friendly-math.md` (8-D gate) | Referenced by activator on demand |
180
- | Book activation | `references/books/*.md` × 7 (modern-math structure distillations) | Loaded by problem type on demand |
181
-
182
- **Deep dive / look-up**: the distillations are self-sufficient. When you need the full original text and have `math_book/<PDF>` locally, let the agent run `pdftotext` + grep + Read on the matching page (no pre-embedded anchors required). PDFs are never bundled into npm / git (copyright + 110MB).
183
-
184
- ---
185
-
186
176
  ## Directory Structure
187
177
 
188
178
  ```
189
179
  math-skill/
190
- ├── package.json # v2.0.1, files[] includes references/
191
- ├── .gitignore / .npmignore # excludes math_book/ PDFs
192
- ├── commands/ # manual slash-command entries (15 weapons + ask)
193
- ├── skills/ # 16 thinking weapons (15 weapons + math-research-activator)
194
- │ ├── math-research-activator/ # auto-trigger entry
195
- └── <weapon>/{SKILL.md, original-texts.md}
196
- ├── references/ # v2 addition: methodology + book activation layer
197
- │ ├── agentic-workflow.md # collaboration style
198
- │ ├── gpu-friendly-math.md # 8-D GPU acceptance gate
199
- │ ├── inspiration.md # inspiration
200
- │ └── books/ # 7 modern-math distillations
201
- ├── agents/math-critic.md # critic agent (18 dimensions, incl. GPU + modern-math activation)
202
- ├── knowledge-base/overview.md
203
- ├── tests/{validate.sh, validate.ps1}
204
- ├── math_book/ # local PDFs (ignored by git/npm, not published)
180
+ ├── skills/
181
+ │ └── math-research-activator/ # Orchestrator: intent diagnosis + routing
182
+ ├── lenses/ # 15 thinking lenses (reasoning methodology)
183
+ ├── knowledge-base/ # Math knowledge (by domain)
184
+ │ ├── matrix-analysis/ # Matrix analysis (5 cards)
185
+ ├── optimization/ # Optimization (5 cards)
186
+ ├── differential-geometry/ # Differential geometry (6 cards)
187
+ │ ├── lie-theory/ # Lie theory (5 cards)
188
+ │ ├── topology/ # Topology (3 cards)
189
+ │ ├── probability/ # Probability & information (5 cards)
190
+ │ └── information-geometry/ # Information geometry (2 cards)
191
+ ├── design-patterns/ # Design translation (by AI component)
192
+ ├── attention/ # Attention mechanisms (5 patterns)
193
+ ├── loss/ # Loss functions (5 patterns)
194
+ ├── routing/ # Routing (4 patterns)
195
+ │ ├── representation/ # Representation (4 patterns)
196
+ │ └── compression/ # Compression (4 patterns)
197
+ ├── references/ # Reference layer
198
+ │ ├── books/ # 7 book distillations
199
+ │ ├── gpu-friendly-math.md # GPU 8-dimension gate
200
+ │ ├── agentic-workflow.md # Collaboration style
201
+ │ └── inspiration.md # Inspiration
202
+ ├── agents/math-critic.md # Math-engineering dual critic
203
+ ├── commands/ask.md # /ask manual entry
204
+ ├── math_book/ # Local PDFs (not published)
205
205
  └── README.md / LICENSE
206
206
  ```
207
207
 
208
208
  ---
209
209
 
210
- ## What Each Skill Contains
211
-
212
- Each `skills/*/SKILL.md` (v2 single research / algorithm path):
210
+ ## Recommended Books
213
211
 
214
- 1. **Core principle** + blockquote sub-section **Mathematical Formalization** (definitions / theorems / formulas)
215
- 2. **GPU friendliness (cross-cut check)** — how this weapon's structure maps to GPU, passing the 8-D gate
216
- 3. **When NOT to use** / **When to use** (research trigger, including algorithm / operator-design usage)
217
- 4. **Method flow** single research path (all math retained)
218
- 5. **Common mistakes** including a one-liner on GPU computability
219
- 6. **Operating procedure** single output format, ending with a `[GPU Feasibility]` item
220
- 7. **Relationship to other skills** includes a "modern math activation" row, pointing to `references/books/*`
212
+ | # | Title | Author(s) | Publisher / Edition | Year | ISBN | Distillation |
213
+ |---|-------|-----------|-------------------|------|------|-------------|
214
+ | 1 | *Contemporary Abstract Algebra* | Joseph A. Gallian | Brooks/Cole, Cengage, 8th ed. | 2013 | 978-1-133-59971-5 | `abstract-algebra.md` |
215
+ | 2 | *The Rising Sea: Foundations of Algebraic Geometry* | Ravi Vakil | Princeton University Press | 2025 | 978-0-691-26866-8 | `algebraic-geometry-rising-sea.md` |
216
+ | 3 | *Manifolds and Differential Geometry* | Jeffrey M. Lee | AMS, Graduate Studies in Math Vol. 107 | 2009 | 978-0-8218-4815-9 | `differential-geometry.md` |
217
+ | 4 | *Matrix Analysis* | Roger A. Horn, Charles R. Johnson | Cambridge University Press, 2nd ed. | 2013 | 978-0-521-83940-2 | `matrix-analysis.md` |
218
+ | 5 | *A micro Lie theory for state estimation in robotics* | Joan Solà et al. | arXiv:1812.01537v9 | 2021 | — | `micro-lie-theory.md` |
219
+ | 6 | *An Introduction to Optimization, With Applications to ML* | Chong, Lu, Żak | John Wiley & Sons, 5th ed. | 2024 | 978-1-119-87763-9 | `optimization-ml.md` |
220
+ | 7 | *Introduction to Smooth Manifolds* | John M. Lee | Springer, GTM 218, 2nd ed. | 2013 | 978-1-4419-9981-8 | `smooth-manifolds.md` |
221
221
 
222
- Each weapon also ships an `original-texts.md` (math sources and classical references). Outputs can be sent to `agents/math-critic.md` (18 dimensions, including GPU feasibility + modern-math activation) for a second pass.
222
+ Distillation files ship with the npm package. For full-fidelity lookups, place PDFs in the `math_book/` folder.
223
223
 
224
224
  ---
225
225
 
226
- ## Mathematical Knowledge System
227
-
228
- `knowledge-base/overview.md` provides a math knowledge map: three pillars (algebra / geometry / analysis), main branches, knowledge layers (foundation → algebra → synthesis → frontier), and the mapping from thinking weapons to math branches.
226
+ ## Changelog
229
227
 
230
- ---
228
+ ### v3.0.0 — Mathematical Research Operating System
231
229
 
232
- ## Inspiration
230
+ **Architecture overhaul**: from "thinking weapon arsenal" to "math general staff" — three-layer orthogonal architecture:
233
231
 
234
- The story of Sophus Lie forging a "dragon-slaying blade" tells us this: the Lie group–Lie algebra machinery invented to solve differential equations ended up becoming the lingua franca for describing symmetry and robot state estimation the value of a mathematical tool far outlives its original intent, which is exactly the prototype of "cross-domain activation." See [`references/inspiration.md`](references/inspiration.md).
232
+ - **Thinking Lenses** (15): slimmed down from v2's "thinking weapons"reasoning methodology only, no concrete math knowledge mixed in
233
+ - **Knowledge Base** (31 cards): concrete math tools organized by domain, with definitions/formulas/AI design translation/GPU feasibility
234
+ - **Design Translation Layer** (new): the bridge from math to AI modules, organized by AI component (attention/loss/routing/representation/compression)
235
+ - **Activator rewrite**: from environment-signal matching to intent diagnosis (5 scenarios: analysis/design/query/verification/engineering)
236
+ - **Knowledge activation protocol**: fixed output format for knowledge cards (minimal definition → formula → applicable problems → AI translation → engineering feasibility → risks)
235
237
 
236
- ---
237
-
238
- ## Changelog
238
+ ### v2.1.0 — Full Bilingual Support
239
+ - 37 .en.md files, auto language routing, same commands for both languages, no double token cost
239
240
 
240
241
  ### v2.0.1
241
- - **Tightened auto-trigger conditions**: `math-research-activator` changed from "any environment OR conversation signal hits → trigger" to "environment AND task signals must both hit" (Gate 1 + Gate 2 as dual necessary conditions).
242
- - **Added an exclusion gate (Gate 0)**: pure engineering tasks — code review, debugging, argument-passing checks, refactoring, hyperparameter tuning, loss implementation tweaks — are now on an explicit exclusion list with the highest priority.
243
- - **Narrowed environment signals**: mere `model.py`, `trainer.py`, `config.json` and other routine ML engineering files no longer count as environment signals; architecture core code (attention / transformer / MoE, CUDA / Triton kernel) or research notes is required.
244
- - **Updated `description` field**: explicitly lists "does not trigger on" scenarios, reducing skill metadata mis-matches on AI platforms.
242
+ - Tightened auto-trigger conditions, added exclusion gate, narrowed environment signals
245
243
 
246
244
  ### v2.0.0
247
- - Initial v2 release: 16 thinking weapons, modern-math activation layer, 8-D GPU cross-cut, progressive disclosure.
245
+ - 16 thinking weapons, modern math activation layer, GPU 8-D cross-cut
248
246
 
249
247
  ### v1.0.0
250
- - Initial release: fifteen thinking weapons (axiomatization / abstraction / logic deduction / modeling / optimization / probability & statistics / transformation / symmetry & invariance / induction & analogy / algorithmic thinking / information theory / game theory / causal inference / topology / discrete & combinatorial) + dual research-and-life paths.
251
- - Fifteen `skills/*/SKILL.md` files (core principle, when-not-to-use, method flow, common mistakes, operating procedure) + matching `original-texts.md` (math sources and classical references).
252
- - Fifteen manual slash-command entries (`commands/*.md`).
253
- - `knowledge-base/overview.md` (three pillars / main branches / knowledge layers / weapon mapping).
254
- - `agents/math-critic.md` critic agent.
255
- - Validation scripts `tests/{validate.sh, validate.ps1}`.
256
- - Published to npm (`math-skill`), MIT license.
248
+ - Initial release: fifteen thinking weapons + dual research/life paths
257
249
 
258
250
  ---
259
251
 
@@ -265,7 +257,7 @@ MIT License. See `LICENSE`.
265
257
 
266
258
  ## Contributing
267
259
 
268
- Issues and Pull Requests are welcome — let's learn and build together!
260
+ Issues and Pull Requests are welcome!
269
261
 
270
262
  ---
271
263