math-skill 3.1.1 → 3.3.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 (63) hide show
  1. package/README.en-US.md +90 -12
  2. package/README.md +90 -12
  3. package/SKILL.en.md +122 -0
  4. package/SKILL.md +122 -0
  5. package/agents/math-critic.en.md +42 -16
  6. package/agents/math-critic.md +43 -16
  7. package/commands/ask.en.md +2 -2
  8. package/commands/ask.md +2 -2
  9. package/design-patterns/compression/low-rank-kv-cache.en.md +1 -0
  10. package/design-patterns/loss/orthogonality-loss.en.md +7 -7
  11. package/design-patterns/loss/orthogonality-loss.md +7 -7
  12. package/knowledge-base/algebraic-geometry/grassmannian-plucker.en.md +71 -0
  13. package/knowledge-base/algebraic-geometry/grassmannian-plucker.md +71 -0
  14. package/knowledge-base/algebraic-geometry/index.en.md +47 -0
  15. package/knowledge-base/algebraic-geometry/index.md +47 -0
  16. package/knowledge-base/algebraic-geometry/sheaf-cohomology.en.md +72 -0
  17. package/knowledge-base/algebraic-geometry/sheaf-cohomology.md +72 -0
  18. package/knowledge-base/cryptography/attack-game-framework.en.md +56 -0
  19. package/knowledge-base/cryptography/attack-game-framework.md +56 -0
  20. package/knowledge-base/cryptography/cca-cpa-ae-hierarchy.en.md +57 -0
  21. package/knowledge-base/cryptography/cca-cpa-ae-hierarchy.md +57 -0
  22. package/knowledge-base/cryptography/index.en.md +54 -0
  23. package/knowledge-base/cryptography/index.md +54 -0
  24. package/knowledge-base/cryptography/prf-prg-owf.en.md +62 -0
  25. package/knowledge-base/cryptography/prf-prg-owf.md +62 -0
  26. package/knowledge-base/cryptography/reduction-proof-template.en.md +60 -0
  27. package/knowledge-base/cryptography/reduction-proof-template.md +60 -0
  28. package/knowledge-base/matrix-analysis/low-rank-approximation.en.md +2 -2
  29. package/knowledge-base/matrix-analysis/low-rank-approximation.md +2 -2
  30. package/knowledge-base/matrix-analysis/projection.en.md +11 -12
  31. package/knowledge-base/matrix-analysis/projection.md +11 -12
  32. package/knowledge-base/overview.en.md +9 -3
  33. package/knowledge-base/overview.md +9 -3
  34. package/knowledge-base/probability/kl-divergence.en.md +6 -6
  35. package/knowledge-base/probability/kl-divergence.md +6 -6
  36. package/package.json +11 -3
  37. package/references/agentic-workflow.en.md +2 -2
  38. package/references/agentic-workflow.md +2 -2
  39. package/references/books/abstract-algebra.en.md +18 -29
  40. package/references/books/abstract-algebra.md +18 -29
  41. package/references/books/algebraic-geometry-rising-sea.en.md +1 -1
  42. package/references/books/algebraic-geometry-rising-sea.md +2 -2
  43. package/references/books/applied-cryptography.en.md +112 -0
  44. package/references/books/applied-cryptography.md +127 -0
  45. package/references/books/differential-geometry.md +1 -1
  46. package/references/books/foundations-of-cryptography.en.md +112 -0
  47. package/references/books/foundations-of-cryptography.md +127 -0
  48. package/references/books/introduction-to-modern-cryptography.en.md +130 -0
  49. package/references/books/introduction-to-modern-cryptography.md +155 -0
  50. package/references/books/micro-lie-theory.en.md +1 -1
  51. package/references/books/micro-lie-theory.md +1 -1
  52. package/references/books/smooth-manifolds.en.md +1 -1
  53. package/references/books/smooth-manifolds.md +1 -1
  54. package/references/gpu-friendly-math.en.md +8 -8
  55. package/references/gpu-friendly-math.md +8 -8
  56. package/references/inspiration.en.md +8 -84
  57. package/references/inspiration.md +8 -84
  58. package/references/musings.en.md +87 -0
  59. package/references/musings.md +87 -0
  60. package/references/skill-index.en.md +48 -13
  61. package/references/skill-index.md +48 -13
  62. package/skills/math-research-activator/SKILL.en.md +4 -165
  63. package/skills/math-research-activator/SKILL.md +4 -165
@@ -1,6 +1,6 @@
1
- # Inspirational Musings
1
+ # Inspiration
2
2
 
3
- > Mathematics is more than a computational tool — it is a way of thinking. Sometimes a mathematical concept resonates with life itself, and you suddenly realize that behind those cold formulas lies a warm perspective on understanding the world.
3
+ > Mathematics is more than a computational tool — it is a way of thinking. This file records the technical inspiration of math-skill the cross-domain activation value of mathematical tools far exceeding their original intent. For philosophical and life reflections (split in v3.2.1), see `musings.en.md`.
4
4
 
5
5
  ---
6
6
 
@@ -22,92 +22,16 @@ Mathematical thinking works the same way — you may learn it to review a paper
22
22
 
23
23
  ---
24
24
 
25
- ## 2. Life as an Optimization Problem
25
+ ## Connection to This Project
26
26
 
27
- If you treat a human being as a high-dimensional, nonlinear, dynamic optimization problem with a time-varying objective function, you will find that optimization theory and life paths share a striking philosophical resonance.
27
+ The inspiration for this project stems precisely from this insight:
28
28
 
29
- ### The Objective Function: What Do You Want to "Optimize"?
29
+ **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 math-skill's "thinking lenses" and "activation anchors": every mathematical concept carries transferable value far beyond its original application domain. The skill's job is to guide the activation of such cross-domain transfer, not to fixate on specific application scenarios.
30
30
 
31
- In mathematics, the first step is to define the objective function $f(x)$. In life, this is the value you pursue: happiness, achievement, meaning, wealth, balance…
31
+ > After the v3.2.1 design philosophy refinement, this idea is made explicit: knowledge-base/ anchors describe mathematical structures themselves (manifolds, spectra, sheaf cohomology, etc.), not specific AI architectures; design-patterns/ is translation-prototype demonstration, not a template library. This is exactly what the "dragon-slaying blade" story reflects in the skill's positioning — **the true value of a tool lies in cross-domain activation, not in being fixated on a single application**.
32
32
 
33
- The difficulty is that life goals are often **multi-objective, vague, and time-varying** and may even conflict with one another.
34
-
35
- ### Initial Point and Resource Constraints
36
-
37
- $x_0$ is your origin, talent, and starting point.
38
-
39
- Constraint conditions: time, money, health, social rules… These are like the constraints $g(x) \leq 0$ in an optimization problem, delineating the feasible region.
40
-
41
- ### Step Size and Direction: Everyday Decisions
42
-
43
- **Direction**: The direction you choose to invest effort — career, relationships, fields of study.
44
-
45
- **Step size**: The intensity and time you devote to a given direction.
46
-
47
- Precision requirement: if every step only pursues immediate returns (e.g., short-term profit maximization), you may fall into a "local optimum" trap — for example, a high-paying but meaningless job, or a busy but stagnant life.
48
-
49
- ### Local Optimum vs. Global Optimum
50
-
51
- This is the core dilemma of "life optimization":
52
-
53
- - **Local optimum**: The seemingly best choice within your city, industry, and social circle.
54
- - **Global optimum**: Perhaps in another country, another field, or another lifestyle, there exists a life that better aligns with your true nature. But you cannot foresee the global landscape, just as an optimization algorithm can only access local information at its current position.
55
-
56
- ### Randomness and Noise
57
-
58
- Life is not a smooth numerical function — it is full of random noise:
59
-
60
- Luck, opportunities, unexpected events… These are equivalent to stochastic perturbations $f(x) + \epsilon$ on the objective function.
61
-
62
- Therefore, pursuing excessive precision is often uneconomical; what you need is **robustness and adaptability**.
63
-
64
- ### The Exploration–Exploitation Trade-off
65
-
66
- This is the fundamental tension of life:
67
-
68
- - **Exploration**: Trying new fields, new relationships, new knowledge — risky, but potentially discovering an entirely new "basin of attraction."
69
- - **Exploitation**: Deepening your current domain to harvest stable returns.
70
-
71
- Explore more when young, exploit more in middle age? But the rule is not fixed.
72
-
73
- ### Dynamic Objectives and Lifelong Learning
74
-
75
- Life goals change: passion at 20, meaning at 40, legacy at 60…
76
-
77
- This means the objective function $f(x)$ itself is constantly evolving. Therefore, "optimizing yourself" is more important than "optimizing a fixed target" — this is **meta-optimization** (learning how to learn, adapting how to adapt).
78
-
79
- ### Algorithm Choice: Your Life Strategy
80
-
81
- | Algorithm | Life Strategy |
82
- |-----------|--------------|
83
- | Gradient Descent | Follow the most pressing direction at each step (salary, social pressure) |
84
- | Momentum | Maintain historical inertia (persist in long-term goals, resist short-term fluctuations) |
85
- | Stochastic Gradient Descent | Accept mini-batch random samples, adjust flexibly |
86
- | Evolutionary Algorithms | Try multiple life paths, discard ineffective strategies, retain effective patterns |
87
-
88
- No single algorithm is universally best; what matters is knowing which strategy you are using and adjusting it at the right time.
89
-
90
- ### The Most Important Insight
91
-
92
- In mathematical optimization, we assume a global optimum $x^*$ exists. But in life, there may be no "absolutely optimal life" at all.
93
-
94
- We are merely "participants" in our own lives, searching for a satisfactory solution and striving to make the process full of learning, growth, and meaning.
95
-
96
- What matters is not finding the legendary "global optimum," but rather, at each iteration:
97
-
98
- - Keeping the general direction roughly correct
99
- - Balancing exploration and exploitation
100
- - Accepting noise and constraints
101
- - Allowing the objective function to evolve gracefully as experience grows
102
-
103
- **The process itself is the meaning; optimization is life.**
33
+ > The philosophical and life reflection part ("Life as an Optimization Problem," etc.) has been moved to `musings.en.md`, separated from the skill's rigorous technical core.
104
34
 
105
35
  ---
106
36
 
107
- ## How These Stories Connect to This Project
108
-
109
- The inspiration for this project stems precisely from these two insights:
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 lenses": every mathematical concept carries transferable value far beyond its original application domain.
112
-
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.
37
+ > **The "Life as an Optimization Problem" section below has been moved to `musings.en.md`.** This file no longer retains it. For philosophical reflections, see `musings.en.md`.
@@ -1,8 +1,8 @@
1
1
  > **语言路由**:若用户消息为英文,请读取并遵循同目录下的 `inspiration.en.md`。
2
2
 
3
- # 灵感杂谈 / Inspirational Musings
3
+ # 灵感来源 / Inspiration
4
4
 
5
- > 数学不只是一种计算工具,更是一种思想方法。有时,某个数学概念与人生之间的共鸣,会让你突然意识到——那些冰冷的公式背后,藏着理解世界的温暖视角。
5
+ > 数学不只是一种计算工具,更是一种思想方法。本文件记录 math-skill 的技术灵感来源——数学工具远超初衷的跨领域激活价值。哲学与人生感悟部分(v3.2.1 拆分)见 `musings.md`。
6
6
 
7
7
  ---
8
8
 
@@ -24,92 +24,16 @@ Sophus Lie 是一个想打造一把**屠龙刀**(解通微分方程)的铁
24
24
 
25
25
  ---
26
26
 
27
- ## 二、人生就是一场最优化
27
+ ## 与本项目的联系
28
28
 
29
- 如果你把人看作一个高维、非线性、动态且目标函数还在变化的复杂优化问题,你会发现——最优化理论和人生路径有着惊人的哲学共鸣。
29
+ 本项目的灵感来源,正是这段感悟:
30
30
 
31
- ### 目标函数:你想"优化"什么?
31
+ **数学工具的价值远超初衷** —— Sophus Lie 的屠龙刀故事告诉我们,一个为解微分方程而发明的工具,最终成为描述对称性的通用语言。这正是 math-skill "思想透镜"与"激活锚点"的核心理念:每个数学思想方法都有远超其原始应用场景的迁移价值,skill 的工作是引导激活这种跨域迁移,而不是固化具体应用场景。
32
32
 
33
- 在数学中,首先要定义目标函数 $f(x)$。在人生中,这就是你追求的价值:幸福、成就、意义、财富、平衡……
33
+ > v3.2.1 设计哲学修正后,这一理念进一步明确:knowledge-base/ 锚点描述数学结构本身(流形、谱、层上同调等),不固化具体 AI 架构;design-patterns/ 是翻译范式示范,不是模板库。这正是"屠龙刀"故事在 skill 定位上的体现——**工具的真正价值在跨域激活,而非固化为某一种应用**。
34
34
 
35
- 难点在于:人生目标往往是**多目标的、模糊的、随时间变化的**,甚至可能相互冲突。
36
-
37
- ### 初始点与资源约束
38
-
39
- $x_0$ 是你的出身、天赋、起点。
40
-
41
- 约束条件:时间、金钱、健康、社会规则……这些像优化问题中的约束 $g(x) \leq 0$,限定了可行域。
42
-
43
- ### 步长与方向:日常决策
44
-
45
- **方向**:你选择努力的方向——职业、关系、学习领域。
46
-
47
- **步长**:你在某个方向上投入的强度和时间。
48
-
49
- 精确度要求:如果每一步都只追求眼前收益(比如短期利益最大化),可能会陷入"局部最优"的人生陷阱——例如高薪但无意义的工作,忙碌但无成长的生活。
50
-
51
- ### 局部最优 vs 全局最优
52
-
53
- 这是"人生最优化"的核心困境:
54
-
55
- - **局部最优**:你所在的城市、行业、社交圈中看似最好的选择。
56
- - **全局最优**:也许在另一个国家、另一个领域、另一种生活方式里,有更契合你本质的人生。但你无法预知全局,就像优化算法只能看到当前位置的局部信息。
57
-
58
- ### 随机性与噪声
59
-
60
- 人生不是平滑的数字函数,而是充满随机噪声:
61
-
62
- 运气、机遇、意外事件……相当于目标函数有随机扰动 $f(x) + \epsilon$。
63
-
64
- 因此,过分追求精确化往往不经济,你需要的是**鲁棒性和适应力**。
65
-
66
- ### 探索与利用的权衡
67
-
68
- 这是人生的根本张力:
69
-
70
- - **探索**:尝试新领域、新关系、新知识,可能失败,但可能发现全新的"磁场"。
71
- - **利用**:深耕现有领域,获取稳定收益。
72
-
73
- 年轻时多探索,中年后多利用?但规则并非固定。
74
-
75
- ### 动态目标与终身学习
76
-
77
- 人生目标会变:20 岁追求激情,40 岁追求意义,60 岁追求传承……
78
-
79
- 这意味着目标函数 $f(x)$ 本身在不断变化。因此,"优化自己"比"优化某个固定目标"更重要——也就是**元优化**(学习如何学习,调整如何调整)。
80
-
81
- ### 算法选择:你的人生策略
82
-
83
- | 算法 | 人生策略 |
84
- |------|---------|
85
- | 梯度下降 | 跟随当前最迫切的方向(薪资、社会压力)一步步走 |
86
- | 动量法 | 保持一定的历史惯性(坚持长期目标,抵抗短期波动) |
87
- | 随机梯度下降 | 接受小批量随机样本,灵活调整 |
88
- | 进化算法 | 尝试多种人生路径,淘汰无效策略,保留有效模式 |
89
-
90
- 没有一种算法绝对最好,重要的是知道自己在用什么策略,并适时调整。
91
-
92
- ### 最重要的启示
93
-
94
- 数学优化中,我们假设存在一个全局最优解 $x^*$。但在人生中,可能根本不存在一个"绝对最优的人生"。
95
-
96
- 我们只是生活的"局中人",寻找一个满意解,并努力让这个过程充满学习、成长和意义。
97
-
98
- 重要的不是找到那个传说中的"全局最优",而是在每一步迭代中:
99
-
100
- - 保持方向的大致正确
101
- - 在探索与利用间平衡
102
- - 接受噪声与约束
103
- - 允许目标函数随着阅历增长而优雅地演变
104
-
105
- **过程即意义,优化本身就是生活。**
35
+ > 哲学与人生感悟部分("人生就是一场最优化"等)已移至 `musings.md`,与 skill 的严谨技术核心分离。
106
36
 
107
37
  ---
108
38
 
109
- ## 这些故事与本项目的联系
110
-
111
- 本项目的灵感来源,正是这两段感悟:
112
-
113
- 1. **数学工具的价值远超初衷** —— Sophus Lie 的屠龙刀故事告诉我们,一个为解微分方程而发明的工具,最终成为描述对称性的通用语言。这正是"思想透镜"的核心理念:每个数学思想方法,都有远超其原始应用场景的迁移价值。
114
-
115
- 2. **数学是理解生活的透镜** —— 最优化理论不只是算法,它还是一种理解人生决策结构的方式。当你把"探索与利用的权衡"从强化学习迁移到职业选择,把"局部最优陷阱"从凸优化迁移到生活决策,数学就从黑板走进了日常。
39
+ > **以下"人生就是一场最优化"部分已移至 `musings.md`**,本文件不再保留。如需查阅哲学感悟,请见 `musings.md`。
@@ -0,0 +1,87 @@
1
+ > **Language Routing**: If the user's message is in English, please read and follow `musings.en.md` in the same directory.
2
+
3
+ # Musings: Mathematics and Life
4
+
5
+ > This file was split from `inspiration.en.md` (v3.2.1) and preserves the philosophical reflections on mathematics and life. These contents are **not part of the skill's core mechanism** — the Domain Router will not auto-load this file — it is referenced only when the user explicitly seeks inspiration or philosophical reflection. The skill's rigorous technical core lives in `inspiration.en.md` and the anchor cards.
6
+
7
+ ---
8
+
9
+ ## Life as an Optimization
10
+
11
+ If you treat a person as a high-dimensional, non-linear, dynamic optimization problem with a shifting objective function, you find a striking philosophical resonance between optimization theory and the path of life.
12
+
13
+ ### Objective Function: What Do You "Optimize" For?
14
+
15
+ In mathematics, we first define the objective function $f(x)$. In life, this is the value you pursue: happiness, achievement, meaning, wealth, balance...
16
+
17
+ The difficulty: life goals are often **multi-objective, fuzzy, time-varying, and even mutually conflicting**.
18
+
19
+ ### Initial Point and Resource Constraints
20
+
21
+ $x_0$ is your origin, talent, starting point.
22
+
23
+ Constraints: time, money, health, social rules... these are like the constraints $g(x) \le 0$ in optimization problems, defining the feasible region.
24
+
25
+ ### Step Size and Direction: Daily Decisions
26
+
27
+ **Direction**: the direction you choose to exert effort — career, relationships, learning domains.
28
+
29
+ **Step size**: the intensity and time you invest in a direction.
30
+
31
+ Precision requirement: if every step only pursues immediate gains (e.g., short-term profit maximization), you may fall into the "local optimum" trap of life — such as high-paying but meaningless work, busy but growthless living.
32
+
33
+ ### Local Optimum vs Global Optimum
34
+
35
+ This is the core dilemma of "life optimization":
36
+
37
+ - **Local optimum**: the seemingly best choice in your current city, industry, social circle.
38
+ - **Global optimum**: perhaps in another country, another field, another lifestyle, there is a life more aligned with your essence. But you cannot know the global picture, just as optimization algorithms only see local information at the current position.
39
+
40
+ ### Randomness and Noise
41
+
42
+ Life is not a smooth numerical function but full of random noise:
43
+
44
+ Luck, opportunity, accidents... equivalent to the objective function having random perturbation $f(x) + \epsilon$.
45
+
46
+ Therefore, excessive pursuit of precision is often uneconomical; what you need is **robustness and adaptability**.
47
+
48
+ ### Exploration vs Exploitation Trade-off
49
+
50
+ This is the fundamental tension in life:
51
+
52
+ - **Exploration**: trying new fields, new relationships, new knowledge, possibly failing, but possibly discovering entirely new "fields."
53
+ - **Exploitation**: deepening existing fields for stable gains.
54
+
55
+ More exploration when young, more exploitation in midlife? But the rules are not fixed.
56
+
57
+ ### Dynamic Objectives and Lifelong Learning
58
+
59
+ Life goals change: passion at 20, meaning at 40, legacy at 60...
60
+
61
+ This means the objective function $f(x)$ itself is constantly changing. Therefore, "optimizing yourself" is more important than "optimizing a fixed objective" — that is, **meta-optimization** (learning how to learn, adjusting how to adjust).
62
+
63
+ ### Algorithm Choice: Your Life Strategy
64
+
65
+ | Algorithm | Life Strategy |
66
+ |-----------|---------------|
67
+ | Gradient descent | Follow the most pressing direction (salary, social pressure) step by step |
68
+ | Momentum | Maintain historical inertia (persist in long-term goals, resist short-term fluctuations) |
69
+ | Stochastic gradient descent | Accept small-batch random samples, flexibly adjust |
70
+ | Evolutionary algorithm | Try multiple life paths, eliminate ineffective strategies, retain effective patterns |
71
+
72
+ No algorithm is absolutely best; what matters is knowing which strategy you're using and adjusting in time.
73
+
74
+ ### The Most Important Insight
75
+
76
+ In mathematical optimization, we assume the existence of a global optimum $x^*$. But in life, there may be no "absolutely optimal life."
77
+
78
+ We are merely "players" in life, seeking a satisfying solution and striving to make the process full of learning, growth, and meaning.
79
+
80
+ What matters is not finding the legendary "global optimum," but in each iteration:
81
+
82
+ - Keeping the direction roughly correct
83
+ - Balancing exploration and exploitation
84
+ - Accepting noise and constraints
85
+ - Allowing the objective function to gracefully evolve as experience grows
86
+
87
+ **The process is the meaning; optimization itself is life.**
@@ -0,0 +1,87 @@
1
+ > **语言路由**:若用户消息为英文,请读取并遵循同目录下的 `musings.en.md`。
2
+
3
+ # 杂谈:数学与人生 / Musings: Mathematics and Life
4
+
5
+ > 本文件从 `inspiration.md` 拆分而来(v3.2.1),保留数学与人生的哲学感悟部分。这些内容**不属于 skill 的核心机制**,Domain Router 不会自动加载本文件——只在用户显式查阅灵感或哲学思考时引用。skill 的严谨技术核心在 `inspiration.md` 与各锚点卡。
6
+
7
+ ---
8
+
9
+ ## 人生就是一场最优化 / Life as an Optimization
10
+
11
+ 如果你把人看作一个高维、非线性、动态且目标函数还在变化的复杂优化问题,你会发现——最优化理论和人生路径有着惊人的哲学共鸣。
12
+
13
+ ### 目标函数:你想"优化"什么?
14
+
15
+ 在数学中,首先要定义目标函数 $f(x)$。在人生中,这就是你追求的价值:幸福、成就、意义、财富、平衡……
16
+
17
+ 难点在于:人生目标往往是**多目标的、模糊的、随时间变化的**,甚至可能相互冲突。
18
+
19
+ ### 初始点与资源约束
20
+
21
+ $x_0$ 是你的出身、天赋、起点。
22
+
23
+ 约束条件:时间、金钱、健康、社会规则……这些像优化问题中的约束 $g(x) \leq 0$,限定了可行域。
24
+
25
+ ### 步长与方向:日常决策
26
+
27
+ **方向**:你选择努力的方向——职业、关系、学习领域。
28
+
29
+ **步长**:你在某个方向上投入的强度和时间。
30
+
31
+ 精确度要求:如果每一步都只追求眼前收益(比如短期利益最大化),可能会陷入"局部最优"的人生陷阱——例如高薪但无意义的工作,忙碌但无成长的生活。
32
+
33
+ ### 局部最优 vs 全局最优
34
+
35
+ 这是"人生最优化"的核心困境:
36
+
37
+ - **局部最优**:你所在的城市、行业、社交圈中看似最好的选择。
38
+ - **全局最优**:也许在另一个国家、另一个领域、另一种生活方式里,有更契合你本质的人生。但你无法预知全局,就像优化算法只能看到当前位置的局部信息。
39
+
40
+ ### 随机性与噪声
41
+
42
+ 人生不是平滑的数字函数,而是充满随机噪声:
43
+
44
+ 运气、机遇、意外事件……相当于目标函数有随机扰动 $f(x) + \epsilon$。
45
+
46
+ 因此,过分追求精确化往往不经济,你需要的是**鲁棒性和适应力**。
47
+
48
+ ### 探索与利用的权衡
49
+
50
+ 这是人生的根本张力:
51
+
52
+ - **探索**:尝试新领域、新关系、新知识,可能失败,但可能发现全新的"磁场"。
53
+ - **利用**:深耕现有领域,获取稳定收益。
54
+
55
+ 年轻时多探索,中年后多利用?但规则并非固定。
56
+
57
+ ### 动态目标与终身学习
58
+
59
+ 人生目标会变:20 岁追求激情,40 岁追求意义,60 岁追求传承……
60
+
61
+ 这意味着目标函数 $f(x)$ 本身在不断变化。因此,"优化自己"比"优化某个固定目标"更重要——也就是**元优化**(学习如何学习,调整如何调整)。
62
+
63
+ ### 算法选择:你的人生策略
64
+
65
+ | 算法 | 人生策略 |
66
+ |------|---------|
67
+ | 梯度下降 | 跟随当前最迫切的方向(薪资、社会压力)一步步走 |
68
+ | 动量法 | 保持一定的历史惯性(坚持长期目标,抵抗短期波动) |
69
+ | 随机梯度下降 | 接受小批量随机样本,灵活调整 |
70
+ | 进化算法 | 尝试多种人生路径,淘汰无效策略,保留有效模式 |
71
+
72
+ 没有一种算法绝对最好,重要的是知道自己在用什么策略,并适时调整。
73
+
74
+ ### 最重要的启示
75
+
76
+ 数学优化中,我们假设存在一个全局最优解 $x^*$。但在人生中,可能根本不存在一个"绝对最优的人生"。
77
+
78
+ 我们只是生活的"局中人",寻找一个满意解,并努力让这个过程充满学习、成长和意义。
79
+
80
+ 重要的不是找到那个传说中的"全局最优",而是在每一步迭代中:
81
+
82
+ - 保持方向的大致正确
83
+ - 在探索与利用间平衡
84
+ - 接受噪声与约束
85
+ - 允许目标函数随着阅历增长而优雅地演变
86
+
87
+ **过程即意义,优化本身就是生活。**
@@ -1,6 +1,27 @@
1
1
  # Skill Index: Lens Library, Activation Anchors, Design Translation Prototypes, Workflow Examples
2
2
 
3
- > This file is extracted from `../skills/math-research-activator/SKILL.en.md` for reference when the full catalogs are needed. SKILL.en.md retains condensed summaries with links to this file.
3
+ > This is the on-demand catalog for `../SKILL.md`. The main entry keeps only selection rules; do not load this index by default for a clear request.
4
+
5
+ ## Domain Router Overview (v3.2.0+; routing rules follow root `../SKILL.md`)
6
+
7
+ > Full definition: see the Domain Router section in `../SKILL.md`. Only a summary table appears here:
8
+
9
+ | Domain | Loaded Content | Signal Keywords |
10
+ |--------|----------------|------------------|
11
+ | **Shared Mathematics** | 33 anchors across 8 non-cryptography domains plus relevant lenses | probability/information/algebra/geometry/matrix/spectral/optimization/topology/complexity |
12
+ | **AI Research** | Shared mathematics on demand + `../design-patterns/` (5 types, 22 patterns); books only for deep checks | attention/loss/routing/representation/compression/MoE/transformer/KV-cache/LoRA/SSM/diffusion/RL |
13
+ | **Cryptography** | 4 crypto anchors; only then 3 crypto books if needed; shared mathematics on demand | encryption/signature/MAC/PRF/PRG/PRP/OWF/CCA/CPA/AE/ZK/reduction/DL/CDH/DDH/RSA/ECC/lattice |
14
+ | **AI×Crypto** | dual-domain load + intersection annotation | "PRF for watermarking," "adversarial example reduction," "verifiable inference" |
15
+
16
+ > Core rules: domain judgment precedes lens invocation; shared math loads on demand by problem structure (not by domain tag); no pollution across non-cross domains; gap-protocol temporary cards are domain-tagged.
17
+
18
+ ## v3.2.1 Design Philosophy Refinement
19
+
20
+ > Full definition: see the objective, Domain Router, and progressive-loading sections in `../SKILL.md`. Key points:
21
+ >
22
+ > 1. knowledge-base/ anchors describe mathematical structures themselves (manifolds, spectra, sheaf cohomology, pseudorandom function families, etc.), not specific AI architectures (diffusion, SSM, transformer variants).
23
+ > 2. design-patterns/ is a paradigmatic demonstration of "math→AI module" translation, not a copy-paste template library; for new problems, generate temporary design candidates from the mathematical structure.
24
+ > 3. Compatibility principle: research problems with architectures the skill did not pre-specify (e.g., future paradigms) are handled through lens-routing + anchor-activation + temporary-knowledge-card pipeline, not declared "not covered."
4
25
 
5
26
  ## Language Routing & Mixed-Input Rules (Full Version)
6
27
 
@@ -23,8 +44,8 @@ Language routing only determines "which language version to read" and "what lang
23
44
  - If there is no prior context, default to Chinese.
24
45
 
25
46
  5. **Output language matches primary language**
26
- - Chinese primary read `../skills/math-research-activator/SKILL.md`, respond in Chinese, retaining necessary English terms.
27
- - English primary read `../skills/math-research-activator/SKILL.en.md`, respond in English.
47
+ - Codex always reads canonical `../SKILL.md` and answers in the user's primary language; it does not load a second body for English input.
48
+ - An explicit English command entry may read `../SKILL.en.md` directly, but must not also load the Chinese entry.
28
49
  - If the user explicitly requests "in English" / "in Chinese," follow the explicit request.
29
50
 
30
51
  ## Lens Library (15 Mathematical Perspectives)
@@ -62,6 +83,7 @@ Each anchor is not a closed knowledge card but answers: what math structure to a
62
83
  | Topology | `../knowledge-base/topology/` | persistent-homology, euler-characteristic, fundamental-group |
63
84
  | Probability & Information | `../knowledge-base/probability/` | concentration-inequality, entropy, kl-divergence, information-bottleneck, fisher-information |
64
85
  | Information Geometry | `../knowledge-base/information-geometry/` | natural-gradient, fisher-metric |
86
+ | Algebraic Geometry | `../knowledge-base/algebraic-geometry/` | sheaf-cohomology, grassmannian-plucker |
65
87
 
66
88
  ## Design Pattern Library (Organized by AI Component)
67
89
 
@@ -75,6 +97,20 @@ Each design pattern answers: Mathematical origin, AI module form, implementable
75
97
  | Representation | `../design-patterns/representation/` | shared-private-decomposition, manifold-representation, equivariant-split, subspace-alignment |
76
98
  | Compression | `../design-patterns/compression/` | low-rank-kv-cache, spectral-token-pruning, topology-preserving-compression, leverage-score-selection |
77
99
 
100
+ ## Cryptography Book Distillations (3 New Books)
101
+
102
+ The reference layer covers 10 books, all paired in Chinese and English. The three cryptography distillations below support security definitions, constructions, reductions, and protocol analysis. English requests use the .en.md files and load them only when anchors are insufficient.
103
+
104
+ | Book | File | Primary Use | Activation Family |
105
+ |------|------|-------------|--------------------|
106
+ | Boneh & Shoup, *A Graduate Course in Applied Cryptography* | `books/applied-cryptography.en.md` | Attack games, reduction proofs, symmetric/public-key constructions, zero knowledge, and protocols | Definitions/Reductions/Primitives/Protocols |
107
+ | Goldreich, *Foundations of Cryptography, Volume 1: Basic Tools* | `books/foundations-of-cryptography.en.md` | Computational indistinguishability, OWF/PRG/PRF, zero knowledge, and commitments | Definitions/Proofs/Constructions/Meta-theorems |
108
+ | Katz & Lindell, *Introduction to Modern Cryptography*, 2nd ed. | `books/introduction-to-modern-cryptography.en.md` | Formal security definitions, IND/CCA, MACs, hashing, and digital signatures | Definitions/Proofs/Primitives/Assumptions/Constructions |
109
+
110
+ > **Domain Router note**: These three books belong to the **Cryptography Layer** and are loaded only when Domain Router determines the problem is cryptography or AI×crypto intersection. Pure AI problems do not load them. Shared math anchors (probability/information/algebra) are loaded on demand without redundancy.
111
+ >
112
+ > **v3.2.1 backfill**: new knowledge-base/cryptography/ anchor directory (with prf-prg-owf, reduction-proof-template, attack-game-framework, cca-cpa-ae-hierarchy cards) and knowledge-base/algebraic-geometry/ directory (with sheaf-cohomology, grassmannian-plucker cards). The cryptography layer no longer has only books — it has structured anchors for light consultation.
113
+
78
114
  ## Workflow Example
79
115
 
80
116
  **User**: "Design a new KV Cache compression method that preserves long-range dependencies — I don't want to just do top-k."
@@ -84,23 +120,22 @@ Step 1 — Diagnosis: Scenario B (Mechanism Design)
84
120
  Problem type: Sequence memory compression + information preservation + long-range structure
85
121
  Core tension: Compressing token count vs. preserving long-range dependencies
86
122
 
87
- Step 2 — Lens Selection:
123
+ Step 2 — Lens Selection (default ≤2):
88
124
  1. Spectral Decomposition (preserve dominant subspace)
89
- 2. Information Theory (retain states with maximum mutual information)
90
- 3. Topological (preserve critical connectivity points of sequential structure)
125
+ 2. Probabilistic / Information (retain mutual-information-sensitive states)
126
+ (Add Topology only if the user emphasizes connectivity/bridging; it is outside the default budget)
91
127
 
92
128
  Step 3 — Activation Anchors:
93
129
  → low-rank-approximation (Matrix Analysis anchor)
94
- → leverage-score-selection (Design Pattern: compression)
95
130
  → information-bottleneck (Probability & Information anchor)
131
+ → leverage-score-selection or low-rank-kv-cache (0–2 compression design patterns)
96
132
  If existing anchors are insufficient, enter Knowledge Gap Protocol to generate a temporary knowledge card.
97
133
 
98
134
  Step 4 — Design Translation:
99
- Candidate A: Spectral KV Compression (low-rank + leverage score)
100
- Candidate B: Information-Preserving Cache (query sensitivity)
101
- Candidate C: Topology-Preserving Cache (graph bridge-node retention)
135
+ Primary: Spectral KV Compression (low-rank + leverage score)
136
+ Alternative only by decisive difference: Information-Preserving Cache (depends on future-query estimates)
102
137
 
103
- Step 5 — Critic Review:
104
- A is most GPU-friendly; B requires estimating future queries with inherent uncertainty; C has prohibitive graph construction cost
105
- Recommendation: Prioritize A; use B as a lightweight gate
138
+ Step 5 — Compact Review (do not load the full critic for ordinary tasks):
139
+ Primary is most GPU-friendly; alternative needs future-query estimates and is more uncertain
140
+ Conclusion: Prefer the primary design; add a lightweight gate only when query-sensitive retention is required
106
141
  ```
@@ -1,6 +1,27 @@
1
1
  # Skill 索引:透镜库、激活锚点、设计翻译原型、工作流范例
2
2
 
3
- > 本文件从 `../skills/math-research-activator/SKILL.md` 提取,供需要查阅完整目录时使用。SKILL.md 保留精简摘要和指向本文件的链接。
3
+ > 本文件是 `../SKILL.md` 的按需目录。主入口只保留选择规则;不要为清晰问题默认加载本索引。
4
+
5
+ ## Domain Router 总览(v3.2.0+;路由规则以根 `../SKILL.md` 为准)
6
+
7
+ > 完整定义见 `../SKILL.md` 的 Domain Router 小节。此处仅列摘要表:
8
+
9
+ | Domain | 加载内容 | 信号词 |
10
+ |--------|---------|--------|
11
+ | **共用数学** | 8 域 33 锚点(排除 cryptography)+ 相关透镜 | 概率/信息/代数/几何/矩阵/谱/优化/拓扑/复杂度 |
12
+ | **AI 研究** | 共用数学按需 + `../design-patterns/`(5 类 22 模式);书稿仅深查 | attention/loss/routing/representation/compression/MoE/transformer/KV-cache/LoRA/SSM/扩散/RL |
13
+ | **密码学** | 4 张密码锚点;不足时才加载 3 本密码学书稿;共用数学按需 | 加密/签名/MAC/PRF/PRG/PRP/OWF/CCA/CPA/AE/零知识/归约/DL/CDH/DDH/RSA/ECC/格密码 |
14
+ | **AI×密码交叉** | 双 domain 加载 + 交叉点标注 | "PRF 做模型水印""对抗样本归约""可验证推理" |
15
+
16
+ > 核心规则:domain 判定先于透镜调用;共用数学按问题结构(非 domain 标签)按需加载;不跨域时不污染;缺口协议临时卡标注 domain。
17
+
18
+ ## v3.2.1 设计哲学修正
19
+
20
+ > 完整定义见 `../SKILL.md` 的目标、Domain Router 与渐进加载小节。要点:
21
+ >
22
+ > 1. knowledge-base/ 锚点描述数学结构本身(流形、谱、层上同调、伪随机函数族等),不固化具体 AI 架构(diffusion、SSM、transformer 变体)。
23
+ > 2. design-patterns/ 是"数学→AI 模块"的翻译范式示范,不是可复制的模板库;遇新问题应基于数学结构临时生成候选设计。
24
+ > 3. 兼容性原则:对未预置架构的研究问题(如未来新范式)通过透镜路由 + 锚点激活 + 临时知识卡完成引导,不声明"不覆盖"。
4
25
 
5
26
  ## 语言路由与混合输入规则(完整版)
6
27
 
@@ -23,8 +44,8 @@
23
44
  - 若没有上下文,默认中文。
24
45
 
25
46
  5. **输出语言与主语言一致**
26
- - 中文主语言 读取中文 `../skills/math-research-activator/SKILL.md`,用中文回答,保留必要英文术语。
27
- - 英文主语言 → 读取 `../skills/math-research-activator/SKILL.en.md`,用英文回答。
47
+ - Codex 始终读取权威入口 `../SKILL.md`,按用户主语言回答,不为英文输入重复加载另一份正文。
48
+ - 显式英文命令入口可直接读取 `../SKILL.en.md`,但不得再加载中文入口。
28
49
  - 用户明确要求"用英文/用中文"时,以用户显式要求为准。
29
50
 
30
51
  ## 透镜库(15 个数学视角)
@@ -62,6 +83,7 @@
62
83
  | 拓扑 | `../knowledge-base/topology/` | persistent-homology, euler-characteristic, fundamental-group |
63
84
  | 概率与信息 | `../knowledge-base/probability/` | concentration-inequality, entropy, kl-divergence, information-bottleneck, fisher-information |
64
85
  | 信息几何 | `../knowledge-base/information-geometry/` | natural-gradient, fisher-metric |
86
+ | 代数几何 | `../knowledge-base/algebraic-geometry/` | sheaf-cohomology, grassmannian-plucker |
65
87
 
66
88
  ## 设计模式库(按 AI 组件组织)
67
89
 
@@ -75,6 +97,20 @@
75
97
  | 表示 | `../design-patterns/representation/` | shared-private-decomposition, manifold-representation, equivariant-split, subspace-alignment |
76
98
  | 压缩 | `../design-patterns/compression/` | low-rank-kv-cache, spectral-token-pruning, topology-preserving-compression, leverage-score-selection |
77
99
 
100
+ ## 密码学参考书蒸馏稿(新增 3 本)
101
+
102
+ 参考层现共 10 本书,全部中英配对。以下 3 本用于密码学安全定义、构造、归约证明与协议分析;按主语言选择 .md 或 .en.md,只有锚点不足时才按需读取。
103
+
104
+ | 书目 | 文件 | 主要用途 | 激活家族 |
105
+ |------|------|---------|---------|
106
+ | Boneh & Shoup, *A Graduate Course in Applied Cryptography* | `books/applied-cryptography.md` | 攻击游戏、归约证明、对称/公钥构造、零知识与协议 | 定义系/归约系/原语系/协议系 |
107
+ | Goldreich, *Foundations of Cryptography, Volume 1: Basic Tools* | `books/foundations-of-cryptography.md` | 计算不可区分、OWF/PRG/PRF、零知识与承诺、元定理 | 定义系/证明系/构造系/元理系 |
108
+ | Katz & Lindell, *Introduction to Modern Cryptography*, 2nd ed. | `books/introduction-to-modern-cryptography.md` | 形式化安全定义、IND/CCA、MAC、哈希与数字签名、构造范式 | 定义系/证明系/原语系/假设系/构造系 |
109
+
110
+ > **Domain Router 提示**:这三本书属**密码学层**,仅当 Domain Router 判定问题属密码学或 AI×密码交叉时加载。纯 AI 问题不加载。共用数学锚点(概率/信息/代数)按需加载,不重复。
111
+ >
112
+ > **v3.2.1 补齐**:新增 knowledge-base/cryptography/ 锚点目录(含 prf-prg-owf、reduction-proof-template、attack-game-framework、cca-cpa-ae-hierarchy 四张卡)与 knowledge-base/algebraic-geometry/ 目录(含 sheaf-cohomology、grassmannian-plucker 两张卡)。密码学层不再仅有书稿,有结构化锚点可供轻度查阅。
113
+
78
114
  ## 工作流范例
79
115
 
80
116
  **用户**:"设计新的 KV Cache 压缩方法,保留长期依赖,不想只做 top-k"
@@ -84,23 +120,22 @@
84
120
  问题类型:序列记忆压缩 + 信息保留 + 长程结构
85
121
  核心张力:压缩 token 数量 vs 不破坏长期依赖
86
122
 
87
- 第二步 透镜选择:
123
+ 第二步 透镜选择(默认 ≤2):
88
124
  1. 谱分解(保留主导子空间)
89
- 2. 信息论(保留最大互信息状态)
90
- 3. 拓扑(保留序列结构关键连接点)
125
+ 2. 概率/信息(保留互信息敏感状态)
126
+ (拓扑仅在用户强调连通/桥接结构时再加,不计入默认预算)
91
127
 
92
128
  第三步 激活锚点:
93
129
  → low-rank-approximation(矩阵分析锚点)
94
- → leverage-score-selection(压缩设计模式)
95
130
  → information-bottleneck(概率与信息锚点)
131
+ → leverage-score-selection 或 low-rank-kv-cache(0–2 个压缩设计模式)
96
132
  若现有锚点不足,进入 Knowledge Gap Protocol 生成临时知识卡。
97
133
 
98
134
  第四步 设计翻译:
99
- 候选 A:Spectral KV Compression(低秩 + leverage score)
100
- 候选 B:Information-Preserving Cachequery sensitivity)
101
- 候选 C:Topology-Preserving Cache(图桥接节点保留)
135
+ 主方案:Spectral KV Compression(低秩 + leverage score)
136
+ 备选仅写关键差异:Information-Preserving Cache(依赖未来 query 估计)
102
137
 
103
- 第五步 Critic 审查:
104
- A GPU 友好,B 需估计未来 query 有不确定性,C 图构建成本过高
105
- 建议:优先 A,B 作轻量 gate
138
+ 第五步 紧凑审查(普通任务不加载完整 critic):
139
+ 主方案最 GPU 友好;备选需估计未来 query,不确定性更高
140
+ 结论:优先主方案;需要 query 敏感保留时再加轻量 gate
106
141
  ```