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,105 @@
1
+ # Smooth Manifolds
2
+
3
+ > **Book**: John M. Lee, *Introduction to Smooth Manifolds*, 2nd Edition. Graduate Texts in Mathematics 218, Springer, 2013. ISBN 978-1-4419-9981-8 / DOI 10.1007/978-1-4419-9982-5. MSC 53-01 / 58-01 / 57-01.
4
+ > **Positioning**: Equipping objects that "locally look like Euclidean space but can bend globally" (manifolds) with calculus (tangent spaces, vector fields, differential forms, flows, Lie derivatives) -- the mathematical mother of **manifold optimization, latent-space geometry, and differentiable structures**.
5
+
6
+ ## Overview
7
+
8
+ Smooth manifold = a space that can be locally linearized by coordinate charts, with charts glued together by smooth transition maps. The main thread of the book: **first transplant Euclidean calculus onto curved spaces, then study geometric and topological invariants on them**. For AI, the most valuable part is the "differentiable machinery" in the first half -- tangent/cotangent spaces, vector fields, flows, Riemannian metrics.
9
+
10
+ Actual chapter map (2nd ed., chapter numbers match the book):
11
+
12
+ - **Ch 1-2 Smooth Manifolds / Smooth Maps**: topological manifolds, smooth structures (atlases), smooth maps, partitions of unity. -> The language of local linearization + global patching.
13
+ - **Ch 3 Tangent Vectors**: tangent space T_pM, differential / pushforward df_p, tangent bundle TM. -> **The core of local linearization**, the geometric prototype of backpropagation.
14
+ - **Ch 4-5 Submersions, Immersions, Embeddings / Submanifolds**: constant rank theorem, embeddings, regular level sets -> submanifolds. -> Constraint sets = submanifolds.
15
+ - **Ch 6 Sard's Theorem**: critical values have measure zero, Whitney embedding theorem (n-dimensional manifolds embed in R^{2n}). -> Embedding dimensions / manifold hypothesis.
16
+ - **Ch 7 Lie Groups**: both group and manifold (SO(n), U(n), GL(n), Stiefel...), Lie algebra = tangent space at the identity. -> Orthogonal/unitary weight constraints, equivariance.
17
+ - **Ch 8-9 Vector Fields / Integral Curves and Flows**: vector fields, integral curves, flows (one-parameter diffeomorphism groups), Lie derivatives and Lie brackets [X,Y]. -> **The mother structure of Neural ODE / diffusion / continuous normalizing flows**.
18
+ - **Ch 10-12 Vector Bundles / Cotangent Bundle / Tensors**: bundles, covector fields (1-forms), pullbacks, tensors. -> The true nature of gradients is covectors.
19
+ - **Ch 13 Riemannian Metrics**: inner product at each point, length/distance/volume, tangent-cotangent isomorphism (musical sharp/flat, raising/lowering indices). -> **The metric source for natural gradients / Riemannian optimization**.
20
+ - **Ch 14-16 Differential Forms / Orientations / Integration**: k-forms, wedge products, exterior derivative d (d^2=0), orientations, volume forms, integration on manifolds and change of variables. -> The log-det-Jacobian in normalizing flows = pullback of volume forms.
21
+ - **Ch 17-18 De Rham Cohomology / de Rham Theorem**: closed forms modulo exact forms = topological invariants read from differential data. -> Global obstructions / cohomological regularization.
22
+ - **Ch 19-22 Distributions & Foliations / Exponential Map / Quotient Manifolds / Symplectic Manifolds**: integrable distributions (Frobenius), exponential map (retraction prototype), quotient manifolds (Grassmannian etc.), symplectic forms and Hamiltonian flows. -> Retractions, quotient-space constraints, symplectic integrators / HMC.
23
+
24
+ **Author's stated boundary (preface)**: the book stops at "building the tools," **deliberately omitting** connections, geodesics, curvature, fiber bundles, and Hodge theory -- these are covered in Lee's sequel *Riemannian Manifolds*. So if a problem truly requires the deep geometry of curvature/parallel transport, this book only provides the entry point via metrics and the exponential map; one must continue with a Riemannian geometry text.
25
+
26
+ ## Core Structures Transferable to AI/Infra
27
+
28
+ - **Tangent space = local linearization of parameter/latent space**. `df_p: T_pM -> T_{f(p)}N` is the Jacobian / pushforward; backpropagation = pushforward along composed maps (the geometric version of the chain rule). All first-order methods live in the tangent space.
29
+ - **Gradients are covectors, not vectors**. Autodiff produces 1-forms (elements of the cotangent space); to obtain a descent direction (tangent vector) one must use the **metric to raise indices** (sharp). Euclidean metric -> ordinary gradient; Fisher metric -> natural gradient. **This is the manifold-level root cause of natural gradients / mirror descent**.
30
+ - **Constraint sets = submanifolds**. Regular level set theorem: when g is a submersion, the solution set `g(x)=c` is a smooth submanifold; constrained optimization = unconstrained optimization on a submanifold.
31
+ - **Lie groups = differentiable symmetry groups**. SO(n)/U(n)/Stiefel/Grassmannian are all manifolds; their Lie algebras (e.g., skew-symmetric matrices so(n)) are linear spaces, mapped back to the group via `exp` -> **reparameterize "constrained weights" as "unconstrained Lie algebra + exp"**.
32
+ - **Flows = time-parameterized families of diffeomorphisms**. Learning a vector field + integrating along it = Neural ODE / continuous normalizing flows / diffusion sampling. Flow invertibility and volume preservation directly correspond to model properties.
33
+ - **Riemannian metric = designable/learnable "local geometry"**. It determines distances, angles, volumes, and orthogonality relations; changing the metric changes optimization trajectories and sampling measures.
34
+ - **Differential forms + volume forms = the language of change of variables**. The `log|det J|` term in normalizing flows is precisely the pullback of a volume form under a map; choosing the right structure (triangular/coupling Jacobians) makes it cheap.
35
+
36
+ ## Problem Types Suited for Activation
37
+
38
+ - Parameters should satisfy **geometric constraints**: orthogonality, unit norm, unit determinant, SPD, low-rank manifolds, hyperbolic/spherical latent spaces.
39
+ - Optimization is more natural on **curved spaces**: subspace learning on Stiefel/Grassmannian, rotation/pose estimation, hyperspherical representations.
40
+ - Need **structure-preserving dynamics**: invertible generative models, volume-preserving flows, Hamiltonian systems, energy-conserving long-horizon simulations.
41
+ - **Latent space geometry**: interpolation, geodesics, metric learning, clustering/nearest-neighbor on manifolds.
42
+ - Need to upgrade from correlations to **topological invariants**: detecting "holes" in latent spaces, global obstructions, cohomology-based consistency regularization.
43
+
44
+ ## Possible Algorithmic Inspirations
45
+
46
+ - **Riemannian/manifold optimizers**: transplanting Adam/SGD onto Stiefel, Grassmannian, SPD, hyperbolic spaces -- projecting gradients to the tangent space + retraction back to the manifold.
47
+ - **Orthogonal/Stiefel constrained weights**: using Cayley transforms or QR-retractions to maintain `W^T W = I`, mitigating gradient explosion/vanishing in RNNs/deep networks; or using so(n) Lie algebra + matrix-exp to reparameterize rotations.
48
+ - **Geodesic interpolation**: using closed-form geodesics for interpolation and mixing in spherical/hyperbolic/SPD latent spaces, replacing Euclidean linear interpolation.
49
+ - **Normalization on manifolds**: interpreting LayerNorm/feature normalization as projection onto spheres/unit manifolds; hyperspherical softmax and spectral normalization are instances of this.
50
+ - **Neural ODE / continuous normalizing flows / diffusion**: learning a vector field X_theta, solving via flows; structured Jacobians make `log-det` cheap.
51
+ - **Symplectic integrators / HMC**: using leapfrog-style symplectic, volume-preserving explicit updates for sampling and "optimization with momentum," stable over long horizons.
52
+ - **Equivariant networks**: using Lie group actions + quotient manifolds to bake symmetries into the architecture (geometric deep learning).
53
+
54
+ ## GPU Friendliness Warning
55
+
56
+ > The sole authority for the acceptance gate: the **eight dimensions** in `../gpu-friendly-math.md`. The success or failure of manifold methods almost entirely hinges on one point: **whether the retraction / exponential map can be tensorized and expressed as GEMM, or must be solved iteratively.**
57
+
58
+ Dimension-by-dimension comparison:
59
+
60
+ - **D1-D2 Tensorization / GEMM**: tangent-space operations (pushforward/pullback, Jacobian-vector products, projecting gradients to the tangent space) are **naturally batched GEMM** [v] -- backpropagation itself is pushforward, which is extremely GPU-friendly. **However**, retractions/exp typically require QR, eigendecomposition, matrix exponentials, or small-matrix inverses: QR/eig are **not clean GEMM**, they are decompositions with serial dependencies (cuSOLVER batched small matrices are acceptable, but large matrices are O(n^3) with poor parallelism) -> **reformable** rather than natively friendly.
61
+ - **D3 Complexity**: geodesic distances, parallel transport, general `log|det J|` are all O(n^3) or worse. **Fix**: restrict to manifolds with closed-form geodesics (spheres/hyperbolic/SO(3)); use triangular/coupling layers in normalizing flows so that log-det reduces to a diagonal sum (O(n)).
62
+ - **D5 Low-precision**: [~] **biggest pitfall**. Matrix `exp / log / sqrt`, eigendecompositions, and the affine-invariant metric for SPD are **catastrophically unstable** under bf16/fp16, often silently requiring fp32/fp64. Manifold primitives frequently "appear to run but have numerically diverged long ago."
63
+ - **D6 Parallelism & communication**: the squaring chain in scaling-and-squaring, ODE integration steps, Householder/QR all have **serial recurrences**, making cross-SM/device overlap difficult. Positive counter-example: explicit symplectic integrators (leapfrog) are highly parallel [v].
64
+ - **D4/D7/D8 Memory / Sparsity / Fusion**: if Lie algebra/rotation parameterizations are restricted to **small matrices or block-diagonal** structures (e.g., per-head rotations, SO(3) Rodrigues closed form), they can be fused into kernels and use Tensor Cores; large dense manifold operators require materializing large intermediate tensors.
65
+
66
+ **Conclusions and reform strategies (echoing the toolbox in gpu-friendly-math.md)**:
67
+
68
+ 1. **Prefer manifolds with closed-form retractions** (spheres, Stiefel-QR, SO(3), hyperbolic).
69
+ 2. **Soften whenever possible**: replace hard constraints with pure-GEMM regularization terms (e.g., `lambda ||W^T W - I||^2` instead of strict orthogonal manifold) -- for most training this suffices.
70
+ 3. **Small matrices / blocking**: restrict exp/Cayley/QR to small blocks or per-head, batched as batched GEMM.
71
+ 4. **Structured Jacobians**: insist on triangular/coupling structures in normalizing flows, avoiding general LU for computing determinants.
72
+ 5. **Precision guardrails**: for all matrix exp/log/eig, enforce fp32 accumulation and numerical stabilization (log-sum-exp style).
73
+
74
+ ## Which Design Lens to Invoke
75
+
76
+ - **variational (primary)**: constrained optimization, Riemannian/manifold optimization, retraction selection.
77
+ - **symmetry**: Lie groups, equivariance, quotient manifolds, invariants under group actions.
78
+ - **duality**: coordinate chart transitions, pushforward/pullback, change of variables in normalizing flows, diffeomorphisms.
79
+ - **topological**: de Rham cohomology, global obstructions, "holes" and connectivity of latent spaces.
80
+ - **categorical**: extracting the "locally linear + smoothly patched" manifold skeleton from high-dimensional messy ambient data (the manifold hypothesis).
81
+
82
+ ## Anti-patterns
83
+
84
+ - **Confusing ML "tensors" (arrays) with mathematical tensors (multilinear, with covariant/contravariant transformation laws)**, mistakenly assuming coordinate-independent invariance comes for free.
85
+ - **Putting exp / geodesics / matrix-log into bf16 hot training loops**: both slow (serial decomposition) and silently divergent. Ask first: "is there a closed-form retraction / can it be softened?"
86
+ - **Not softening when you should**: using strict manifold constraints for marginal gains while paying the throughput and stability cost of QR/eig; for many tasks, an orthogonality regularization term suffices.
87
+ - **Confusing gradients (covectors) with descent directions (vectors)**: forgetting the metric and treating raw autodiff output directly as natural gradients.
88
+ - **The illusion of a single global coordinate chart**: covering an entire manifold with one global parameterization inevitably introduces singularities (e.g., Euler angle gimbal lock); manifolds inherently require atlases / redundant parameterizations.
89
+ - **Manifold hypothesis overuse**: deploying the full Riemannian machinery when the parameter space is already flat Euclidean -- pure over-engineering (violates simplicity-first).
90
+
91
+ ## Deep Dive Entry
92
+
93
+ > **Bibliographic info**: John M. Lee, *Introduction to Smooth Manifolds*, 2nd Edition, Graduate Texts in Mathematics 218, Springer, 2013. ISBN 978-1-4419-9981-8.
94
+ >
95
+ > **Activation method**: Place `Introduction to Smooth Manifolds.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); obtain it independently.
96
+
97
+ > **Full-fidelity lookup**: when original definitions/theorems/proofs are needed, have the Agent **automatically search the local PDF** `math_book/Introduction to Smooth Manifolds.pdf` (locate by chapter number / keywords, do not rely on memory to restate). The following are actual chapter numbers (2nd ed.):
98
+
99
+ - **Ch 3 Tangent Vectors** -- tangent spaces, differentials/pushforwards, tangent bundles: local linearization and the geometric prototype of backpropagation.
100
+ - **Ch 11 The Cotangent Bundle** -- covector fields (1-forms), `df` as a covector, pullbacks: the true nature of gradients = covectors.
101
+ - **Ch 13 Riemannian Metrics** -- metrics, tangent-cotangent isomorphism (sharp/flat), distances: the root of natural gradients / Riemannian optimization.
102
+ - **Ch 9 Integral Curves and Flows** -- flows, integral curves, Lie derivatives/Lie brackets: Neural ODE / diffusion / structure-preserving dynamics.
103
+ - **Ch 20 The Exponential Map** -- the exponential map: the retraction prototype, and also the main bottleneck for GPU feasibility.
104
+
105
+ (Extensions: Ch 7 Lie Groups -> orthogonal/unitary constraints and equivariance; Ch 14 Differential Forms -> volume forms and log-det-Jacobian; Ch 22 Symplectic Manifolds -> symplectic integrators / HMC.)
@@ -1,4 +1,4 @@
1
- # 🌐 光滑流形 / Smooth Manifolds
1
+ # 光滑流形 / Smooth Manifolds
2
2
 
3
3
  > **书目**:John M. Lee, *Introduction to Smooth Manifolds*, 2nd Edition. Graduate Texts in Mathematics 218, Springer, 2013. ISBN 978-1-4419-9981-8 / DOI 10.1007/978-1-4419-9982-5. MSC 53-01 / 58-01 / 57-01.
4
4
  > **定位**:把"局部像欧氏空间、整体可弯曲"的对象(manifold)配上微积分(切空间、向量场、微分形式、流、李导数),是 **流形优化、隐空间几何、可微结构** 的数学母体。
@@ -16,7 +16,7 @@
16
16
  - **Ch 7 Lie Groups**:既是群又是流形(SO(n), U(n), GL(n), Stiefel…),李代数 = 单位元处切空间。→ 正交/酉权重约束、等变。
17
17
  - **Ch 8–9 Vector Fields / Integral Curves and Flows**:向量场、积分曲线、流(flow,单参数微分同胚群)、李导数与李括号 [X,Y]。→ **Neural ODE / 扩散 / 连续归一化流** 的母结构。
18
18
  - **Ch 10–12 Vector Bundles / Cotangent Bundle / Tensors**:丛、余向量场(1-form)、拉回(pullback)、张量。→ 梯度的真身是余向量。
19
- - **Ch 13 Riemannian Metrics**:每点内积、长度/距离/体积、切-余切同构(musical ♯/♭,升降指标)。→ **自然梯度 / 黎曼优化的度量来源**。
19
+ - **Ch 13 Riemannian Metrics**:每点内积、长度/距离/体积、切-余切同构(musical (sharp)/(flat),升降指标)。→ **自然梯度 / 黎曼优化的度量来源**。
20
20
  - **Ch 14–16 Differential Forms / Orientations / Integration**:k-形式、楔积、外微分 d(d²=0)、定向、体积形式、流形上积分与变量替换。→ 归一化流的 log-det-Jacobian = 体积形式拉回。
21
21
  - **Ch 17–18 De Rham Cohomology / de Rham Theorem**:闭形式模去恰当形式 = 从微分数据读出的拓扑不变量。→ 全局障碍 / 上同调正则。
22
22
  - **Ch 19–22 Distributions & Foliations / Exponential Map / Quotient Manifolds / Symplectic Manifolds**:可积分布(Frobenius)、指数映射(retraction 原型)、商流形(Grassmann 等)、辛形式与 Hamilton 流。→ retraction、商空间约束、辛积分器 / HMC。
@@ -26,7 +26,7 @@
26
26
  ## 可迁移到 AI/Infra 的核心结构
27
27
 
28
28
  - **切空间 = 参数/隐空间的局部线性化(local linearization)**。`df_p: T_pM → T_{f(p)}N` 就是 Jacobian / pushforward;反向传播 = 沿复合映射做 pushforward(链式法则的几何版)。一切一阶方法都活在切空间里。
29
- - **梯度是余向量(covector),不是向量**。autodiff 给出的是 1-form(余切空间元素);要变成可下降的方向(切向量)必须用 **度量升指标**(♯)。欧氏度量 → 普通梯度;Fisher 度量 → 自然梯度(natural gradient)。**这是自然梯度 / 镜像下降的流形根因**。
29
+ - **梯度是余向量(covector),不是向量**。autodiff 给出的是 1-form(余切空间元素);要变成可下降的方向(切向量)必须用 **度量升指标**((sharp))。欧氏度量 → 普通梯度;Fisher 度量 → 自然梯度(natural gradient)。**这是自然梯度 / 镜像下降的流形根因**。
30
30
  - **约束集 = 子流形(submanifold)**。正则水平集定理:当 g 是 submersion 时 `g(x)=c` 的解集是光滑子流形;约束优化 = 在子流形上做无约束优化。
31
31
  - **李群 = 可微的对称群**。SO(n)/U(n)/Stiefel/Grassmann 都是流形;其李代数(如反对称矩阵 so(n))是线性空间,用 `exp` 映射回群 → **把"约束权重"重参数化为"无约束李代数 + exp"**。
32
32
  - **流(flow)= 时间参数化的微分同胚族**。学一个向量场 + 沿它积分 = Neural ODE / 连续归一化流 / 扩散采样。流的可逆性、保体积性直接对应模型性质。
@@ -57,10 +57,10 @@
57
57
 
58
58
  逐维对照:
59
59
 
60
- - **维度 1–2 张量化 / GEMM**:切空间运算(pushforward/pullback、Jacobian-向量积、把梯度投影到切空间)**天然是 batched GEMM** ✅——反向传播本就是 pushforward,这部分对 GPU 极友好。**但** retraction/exp 多半要 QR、特征分解、矩阵指数或小矩阵求逆:QR/eig **不是干净的 GEMM**,是带串行依赖的分解(cuSOLVER 批量小矩阵尚可,大矩阵 O(n³) 且并行差)→ **可改造** 而非天然友好。
60
+ - **维度 1–2 张量化 / GEMM**:切空间运算(pushforward/pullback、Jacobian-向量积、把梯度投影到切空间)**天然是 batched GEMM** [v]——反向传播本就是 pushforward,这部分对 GPU 极友好。**但** retraction/exp 多半要 QR、特征分解、矩阵指数或小矩阵求逆:QR/eig **不是干净的 GEMM**,是带串行依赖的分解(cuSOLVER 批量小矩阵尚可,大矩阵 O(n³) 且并行差)→ **可改造** 而非天然友好。
61
61
  - **维度 3 复杂度**:测地线距离、平行移动、一般 `log|det J|` 都是 O(n³) 起。**改造**:限定有闭式测地线的流形(球面/双曲/SO(3));归一化流用三角/耦合层让 log-det 退化成对角和(O(n))。
62
- - **维度 5 低精度**:⚠️ **最大坑**。矩阵 `exp / log / sqrt`、特征分解、SPD 的仿射不变度量在 bf16/fp16 下 **灾难性不稳定**,常静默地需要 fp32/fp64。流形原语经常"表面能跑、数值早已发散"。
63
- - **维度 6 并行与通信**:scaling-and-squaring 的平方链、ODE 积分步、Householder/QR 都有 **串行递推**,难跨 SM/设备 overlap。反例向好:显式辛积分器(leapfrog)高并行 ✅。
62
+ - **维度 5 低精度**:[~] **最大坑**。矩阵 `exp / log / sqrt`、特征分解、SPD 的仿射不变度量在 bf16/fp16 下 **灾难性不稳定**,常静默地需要 fp32/fp64。流形原语经常"表面能跑、数值早已发散"。
63
+ - **维度 6 并行与通信**:scaling-and-squaring 的平方链、ODE 积分步、Householder/QR 都有 **串行递推**,难跨 SM/设备 overlap。反例向好:显式辛积分器(leapfrog)高并行 [v]。
64
64
  - **维度 4/7/8 显存 / 稀疏 / 融合**:李代数/旋转参数化若限制在 **小矩阵或块对角**(如逐头旋转、SO(3) 的 Rodrigues 闭式),可融进 kernel、走 Tensor Core;大稠密流形算子则要物化大中间张量。
65
65
 
66
66
  **结论与改造手法(呼应 gpu-friendly-math.md 工具箱)**:
@@ -71,13 +71,13 @@
71
71
  4. **结构化 Jacobian**:归一化流坚持三角/耦合结构,杜绝通用 LU 求 det。
72
72
  5. **精度护栏**:凡矩阵 exp/log/eig,强制 fp32 累加并做数值稳定(log-sum-exp 式)。
73
73
 
74
- ## 该调用哪个思想武器
74
+ ## 该调用哪个思想透镜
75
75
 
76
- - **optimization(⚖️ 优化思想)**:主武器——约束下寻最优、黎曼/流形优化、retraction 选型。
77
- - **symmetry-invariance(⚛️ 对称与不变性)**:李群、等变、商流形、群作用下的不变量。
78
- - **transformation(🔄 变换思想)**:坐标卡变换、pushforward/pullback、归一化流的变量替换、微分同胚。
79
- - **topological-thinking(🌀 拓扑思想)**:de Rham 上同调、全局障碍、隐空间的"洞"与连通性。
80
- - **abstraction(🧩 抽象化思想)**:从高维杂乱的环境数据中抽出"局部线性 + 光滑拼接"的流形骨架(流形假设)。
76
+ - **variational(变分透镜)**:主透镜——约束下寻最优、黎曼/流形优化、retraction 选型。
77
+ - **symmetry(对称与不变性)**:李群、等变、商流形、群作用下的不变量。
78
+ - **duality(对偶透镜)**:坐标卡变换、pushforward/pullback、归一化流的变量替换、微分同胚。
79
+ - **topological(拓扑透镜)**:de Rham 上同调、全局障碍、隐空间的"洞"与连通性。
80
+ - **categorical(范畴化透镜)**:从高维杂乱的环境数据中抽出"局部线性 + 光滑拼接"的流形骨架(流形假设)。
81
81
 
82
82
  ## 反模式
83
83
 
@@ -90,7 +90,7 @@
90
90
 
91
91
  ## 深挖入口
92
92
 
93
- > **📖 书目信息**:John M. Lee, *Introduction to Smooth Manifolds*, 2nd Edition, Graduate Texts in Mathematics 218, Springer, 2013. ISBN 978-1-4419-9981-8.
93
+ > **书目信息**:John M. Lee, *Introduction to Smooth Manifolds*, 2nd Edition, Graduate Texts in Mathematics 218, Springer, 2013. ISBN 978-1-4419-9981-8.
94
94
  >
95
95
  > **启用方式**:将 `Introduction to Smooth Manifolds.pdf` 放入项目根目录的 `math_book/` 文件夹,Agent 即可自动搜索原文。PDF 不随 npm/git 分发(版权原因),需自行获取。
96
96
 
@@ -98,7 +98,7 @@
98
98
 
99
99
  - **Ch 3 Tangent Vectors** — 切空间、微分/pushforward、切丛:局部线性化与反传的几何原型。
100
100
  - **Ch 11 The Cotangent Bundle** — 余向量场(1-form)、`df` 作为余向量、pullback:梯度真身 = 余向量。
101
- - **Ch 13 Riemannian Metrics** — 度量、切-余切同构(♯/♭)、距离:自然梯度 / 黎曼优化的根。
101
+ - **Ch 13 Riemannian Metrics** — 度量、切-余切同构((sharp)/(flat))、距离:自然梯度 / 黎曼优化的根。
102
102
  - **Ch 9 Integral Curves and Flows** — 流、积分曲线、李导数/李括号:Neural ODE / 扩散 / 保结构动力学。
103
103
  - **Ch 20 The Exponential Map** — 指数映射:retraction 原型,也是 GPU 可行性的主瓶颈。
104
104
 
@@ -1,9 +1,22 @@
1
1
  # GPU-Friendly Math Checklist
2
2
 
3
3
  > This file is the **single source of truth** for the "GPU-feasibility" acceptance gate.
4
- > The activator, the 16 thinking weapons, `books/*.md`, and `../agents/math-critic.md` all reference this file; no duplicate definitions elsewhere.
4
+ > The activator, the 15 thinking lenses, `books/*.md`, and `../agents/math-critic.md` all reference this file; no duplicate definitions elsewhere.
5
5
  >
6
- > This file is the single source of truth for the "GPU-feasibility" acceptance gate. The activator, the 16 weapons, the book references, and the math-critic all point here.
6
+ > This file is the single source of truth for the "GPU-feasibility" acceptance gate. The activator, the 15 thinking lenses, the book references, and the math-critic all point here.
7
+
8
+ ## Eight-Dimension Abbreviations
9
+
10
+ | Abbrev. | Full Name |
11
+ |---------|-----------|
12
+ | D1 | Tensorization |
13
+ | D2 | GEMM-mappability |
14
+ | D3 | Complexity |
15
+ | D4 | Memory & KV-Cache |
16
+ | D5 | Low-precision stability |
17
+ | D6 | Parallelism & communication |
18
+ | D7 | Sparse structure |
19
+ | D8 | Operator fusion |
7
20
 
8
21
  ## Core Proposition
9
22
 
@@ -16,20 +29,20 @@ Many "beautiful on paper" modern mathematical structures cannot run at high perf
16
29
 
17
30
  ## The 8-Dimension Scorecard
18
31
 
19
- For any candidate structure (operator, attention variant, routing mechanism, regularization term, compression scheme…) rate each dimension as `Friendly / Adaptable / Unfriendly` and provide adaptation recommendations.
32
+ For any candidate structure (operator, attention variant, routing mechanism, regularization term, compression scheme…) rate each dimension as `Friendly / Retrofittable / Unfriendly` and provide adaptation recommendations.
20
33
 
21
- | # | Dimension | Key Question | Friendly | Unfriendly |
34
+ | # | Dimension | Key Question | Friendly [v] | Unfriendly [x] |
22
35
  |---|-----------|-------------|------------|--------------|
23
36
  | 1 | **Tensorization** | Can it be expressed as dense tensor operations, avoiding element-wise irregular control flow? | Batched tensor algebra | Scalar loops, data-dependent branches |
24
- | 2 | **GEMM Mappability** | Can it be reduced to matrix multiplication / batched GEMM / convolution to fully utilize Tensor Cores? | Expressible as a GEMM chain | Irregular computations that cannot be expressed as matrix operations |
37
+ | 2 | **GEMM-mappability** | Can it be reduced to matrix multiplication / batched GEMM / convolution to fully utilize Tensor Cores? | Expressible as a GEMM chain | Irregular computations that cannot be expressed as matrix operations |
25
38
  | 3 | **Complexity** | Is the forward/backward pass sub-quadratic? How does it scale with sequence length / model size? | Linear / sub-quadratic, blockable | $O(n^2)$ or worse memory/compute blowup |
26
39
  | 4 | **Memory & KV-Cache** | Peak memory usage; activation / state / KV footprint; can it be compressed? | Low-rank / quantized / block-summary compressible | Must materialize large intermediate tensors |
27
40
  | 5 | **Low-Precision Stability** | Is it stable under fp16/bf16/fp8 with deterministic reproducibility? | Controlled dynamic range, numerically robust | Catastrophic cancellation, ill-conditioned, requires fp64 |
28
41
  | 6 | **Parallelism & Communication** | Can it be parallelized across SMs / devices? Communication-to-compute ratio; can overlap be achieved? | Highly parallel, communication overlap-able | Long serial recurrences, communication bottleneck |
29
- | 7 | **Sparsity** | Structured or unstructured sparsity? | Block / banded structured sparsity | Random gather/scatter |
30
- | 8 | **Kernel Fusion** | Can kernels be fused to avoid materializing large intermediates (FlashAttention-style)? | Fusible, recomputable | Frequent small kernels, divergent control flow |
42
+ | 7 | **Sparse structure** | Structured or unstructured sparsity? | Block / banded structured sparsity | Random gather/scatter |
43
+ | 8 | **Operator Fusion** | Can kernels be fused to avoid materializing large intermediates (FlashAttention-style)? | Fusible, recomputable | Frequent small kernels, divergent control flow |
31
44
 
32
- **Scoring conclusion**: Retain only candidates that are **mathematically beautiful AND (all eight dimensions friendly or adaptable)**; any dimension rated "unfriendly and non-adaptable" means the candidate must be adapted or eliminated.
45
+ **Scoring conclusion**: Retain only candidates that are **mathematically beautiful AND (all eight dimensions friendly or retrofittable)**; any dimension rated "unfriendly and non-retrofittable" means the candidate must be adapted or eliminated.
33
46
 
34
47
  ## Common "Beautiful but Non-Computable" Anti-Patterns
35
48
 
@@ -48,7 +61,7 @@ Common techniques for transforming "beautiful but non-computable" into "both bea
48
61
  - **Block sparsification**: Dense attention within blocks, structured sparse between blocks (e.g., DeepSeek CSA-style blocking).
49
62
  - **Low-rank / projection compression**: Restriction maps via low-rank linear transformations; **low-rank basis-style block summaries** for KV-Cache compression (store the basis rather than Plücker coordinates — the latter expands when low-rank).
50
63
  - **Numerical reparameterization**: log-sum-exp, normalization, stable softmax — ensuring low-precision stability.
51
- - **Kernel fusion / recomputation**: Fused kernels, activation recompute to save memory.
64
+ - **Operator fusion / recomputation**: Fused kernels, activation recompute to save memory.
52
65
  - **Embedding structure into GEMM**: Express algebraic/geometric transformations as **learnable linear maps** so they naturally map onto Tensor Cores.
53
66
 
54
67
  ## Worked Example: Tropical Sheaf Attention
@@ -57,7 +70,7 @@ Drawn from the auto-research directions cited in `agentic-workflow.md`, demonstr
57
70
 
58
71
  | Component | Mathematical Source | GPU Friendliness |
59
72
  |-----------|-------------------|-----------------|
60
- | Tropical Gating | Tropical semiring, piecewise-linear | Replaces Top-K: element-wise max-plus — dim 1 Tensorization / dim 2 Not a Tensor Core GEMM (runs on CUDA cores) / dim 3 Per-token gating only, sub-quadratic (min-plus matmul is APSP-hard, not sub-quadratic); sub-differentiable, kinks require LogSumExp smoothing (smoothing recovers standard softmax) |
73
+ | Tropical Gating | Tropical semiring, piecewise-linear | Replaces Top-K: element-wise max-plus — dim 1 [v] Tensorization / dim 2 [x] Not a Tensor Core GEMM (runs on CUDA cores) / dim 3 [v] Per-token gating only, sub-quadratic (min-plus matmul is APSP-hard, not sub-quadratic); sub-differentiable, kinks require LogSumExp smoothing (smoothing recovers standard softmax) |
61
74
  | Cellular Sheaf Diffusion | Algebraic geometry / topology (sheaves, restriction maps) | Each edge is a low-rank linear transform = small GEMM (dim 2/4) |
62
75
  | Čech Cohomology Regularization | Algebraic topology (first cohomology $H^1$) | Local, inexpensive; serves as an algebraic criterion for hallucination (dim 3/8) |
63
76
  | Low-Rank Basis KV Compression (Plücker/Grassmannian perspective) | Projective geometry | Store the basis rather than Plücker coordinates (the latter expands when low-rank); block-summary candidate — compression ratio / error / throughput must be benchmarked (dim 4) |
@@ -3,9 +3,22 @@
3
3
  # GPU 友好性总清单 / GPU-Friendly Math Checklist
4
4
 
5
5
  > 本文件是「GPU 可行性」验收门的**唯一权威来源(single source of truth)**。
6
- > activator、16 个思想武器、`books/*.md`、以及 `../agents/math-critic.md` 都引用此处,不重复定义。
6
+ > activator、15 个思想透镜、`books/*.md`、以及 `../agents/math-critic.md` 都引用此处,不重复定义。
7
7
  >
8
- > This file is the single source of truth for the "GPU-feasibility" acceptance gate. The activator, the 16 weapons, the book references, and the math-critic all point here.
8
+ > This file is the single source of truth for the "GPU-feasibility" acceptance gate. The activator, the 15 thinking lenses, the book references, and the math-critic all point here.
9
+
10
+ ## 八维缩写速查
11
+
12
+ | 缩写 | 全称 |
13
+ |------|------|
14
+ | D1 | 张量化 |
15
+ | D2 | GEMM 可映射 |
16
+ | D3 | 复杂度 |
17
+ | D4 | 显存与 KV-Cache |
18
+ | D5 | 低精度稳定 |
19
+ | D6 | 并行与通信 |
20
+ | D7 | 稀疏结构 |
21
+ | D8 | 算子融合 |
9
22
 
10
23
  ## 核心命题 / Core Proposition
11
24
 
@@ -20,7 +33,7 @@
20
33
 
21
34
  对任何候选结构(算子、注意力变体、路由、正则项、压缩方案……)逐项评 `友好 / 可改造 / 不友好`,并给出改造建议。
22
35
 
23
- | # | 维度 | 关键问题 | 友好 | 不友好 |
36
+ | # | 维度 | 关键问题 | 友好 [v] | 不友好 [x] |
24
37
  |---|------|---------|--------|----------|
25
38
  | 1 | **张量化 / Tensorization** | 能否表达为稠密张量运算,避免逐元素不规则控制流? | 批量张量代数 | 标量循环、数据相关分支 |
26
39
  | 2 | **GEMM 可映射 / GEMM mappability** | 能否落到 矩阵乘 / batched GEMM / 卷积,吃满 Tensor Core? | 可写成 GEMM 链 | 无法矩阵化的不规则运算 |
@@ -59,7 +72,7 @@
59
72
 
60
73
  | 组件 | 数学来源 | GPU 友好性 |
61
74
  |------|---------|-----------|
62
- | 热带门控 Tropical Gating | 热带半环分段线性 | 替代 Top-K:逐元素 max-plus——dim 1 张量化 / dim 2 非 Tensor Core GEMM(落 CUDA core)/ dim 3 仅逐 token 门控亚二次(min-plus matmul 则 APSP-hard 非亚二次);次可微,折点需 LogSumExp 软化(软化退回标准 softmax)|
75
+ | 热带门控 Tropical Gating | 热带半环分段线性 | 替代 Top-K:逐元素 max-plus——dim 1 [v] 张量化 / dim 2 [x] 非 Tensor Core GEMM(落 CUDA core)/ dim 3 [v] 仅逐 token 门控亚二次(min-plus matmul 则 APSP-hard 非亚二次);次可微,折点需 LogSumExp 软化(软化退回标准 softmax)|
63
76
  | 胞腔层扩散 Cellular Sheaf Diffusion | 代数几何/拓扑(层、限制映射)| 每边低秩线性变换 = 小 GEMM(维度 2/4)|
64
77
  | Čech 上同调正则 | 代数拓扑(一阶上同调 H¹)| 局部、廉价;作幻觉的代数判据(维度 3/8)|
65
78
  | 低秩基底 KV 压缩(Plücker/Grassmannian 视角) | 射影几何 | 存基底而非 Plücker 坐标(后者低秩时反扩张);块摘要候选,压缩率/误差/吞吐需实测(维度 4)|
@@ -108,6 +108,6 @@ What matters is not finding the legendary "global optimum," but rather, at each
108
108
 
109
109
  The inspiration for this project stems precisely from these two insights:
110
110
 
111
- 1. **The value of mathematical tools far exceeds their original intent** — Sophus Lie's dragon-slaying blade story teaches us that a tool invented for solving differential equations ultimately became the universal language for describing symmetry. This is the core idea behind "thinking weapons": every mathematical concept carries transferable value far beyond its original application domain.
111
+ 1. **The value of mathematical tools far exceeds their original intent** — Sophus Lie's dragon-slaying blade story teaches us that a tool invented for solving differential equations ultimately became the universal language for describing symmetry. This is the core idea behind "thinking lenses": every mathematical concept carries transferable value far beyond its original application domain.
112
112
 
113
113
  2. **Mathematics is a lens for understanding life** — Optimization theory is not just about algorithms; it is a framework for understanding the structure of life decisions. When you transfer the "exploration–exploitation trade-off" from reinforcement learning to career choices, or the "local optimum trap" from convex optimization to everyday decisions, mathematics steps off the blackboard and into daily life.
@@ -20,7 +20,7 @@ Sophus Lie 是一个想打造一把**屠龙刀**(解通微分方程)的铁
20
20
 
21
21
  一个为解决特定问题而发明的工具,最终在完全不同的领域展现出远超初衷的价值。公理化思想最初是为了让几何严密,后来却成了所有数学分支的基础语言;傅里叶变换最初是为了解热方程,后来却成了信号处理和量子力学的核心;欧拉的生成函数最初是为了算整数分拆,后来却成了组合学和概率论的通用工具。
22
22
 
23
- 数学思想武器也是如此——你学习它,可能是为了审查一篇论文或解决一个具体问题,但它真正的价值,在于它改变了你看世界的方式。
23
+ 数学思想透镜也是如此——你学习它,可能是为了审查一篇论文或解决一个具体问题,但它真正的价值,在于它改变了你看世界的方式。
24
24
 
25
25
  ---
26
26
 
@@ -110,6 +110,6 @@ $x_0$ 是你的出身、天赋、起点。
110
110
 
111
111
  本项目的灵感来源,正是这两段感悟:
112
112
 
113
- 1. **数学工具的价值远超初衷** —— Sophus Lie 的屠龙刀故事告诉我们,一个为解微分方程而发明的工具,最终成为描述对称性的通用语言。这正是"思想武器"的核心理念:每个数学思想方法,都有远超其原始应用场景的迁移价值。
113
+ 1. **数学工具的价值远超初衷** —— Sophus Lie 的屠龙刀故事告诉我们,一个为解微分方程而发明的工具,最终成为描述对称性的通用语言。这正是"思想透镜"的核心理念:每个数学思想方法,都有远超其原始应用场景的迁移价值。
114
114
 
115
115
  2. **数学是理解生活的透镜** —— 最优化理论不只是算法,它还是一种理解人生决策结构的方式。当你把"探索与利用的权衡"从强化学习迁移到职业选择,把"局部最优陷阱"从凸优化迁移到生活决策,数学就从黑板走进了日常。