math-skill 2.1.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en-US.md +159 -200
- package/README.md +159 -200
- package/agents/math-critic.en.md +2 -2
- package/agents/math-critic.md +8 -8
- package/commands/ask.md +3 -10
- package/design-patterns/attention/equivariant-attention.en.md +72 -0
- package/design-patterns/attention/equivariant-attention.md +72 -0
- package/design-patterns/attention/geometry-aware-attention.en.md +73 -0
- package/design-patterns/attention/geometry-aware-attention.md +72 -0
- package/design-patterns/attention/information-bottleneck-attention.en.md +72 -0
- package/design-patterns/attention/information-bottleneck-attention.md +72 -0
- package/design-patterns/attention/projection-attention.en.md +68 -0
- package/design-patterns/attention/projection-attention.md +68 -0
- package/design-patterns/attention/spectral-attention.en.md +71 -0
- package/design-patterns/attention/spectral-attention.md +71 -0
- package/design-patterns/compression/leverage-score-selection.en.md +71 -0
- package/design-patterns/compression/leverage-score-selection.md +71 -0
- package/design-patterns/compression/low-rank-kv-cache.en.md +60 -0
- package/design-patterns/compression/low-rank-kv-cache.md +60 -0
- package/design-patterns/compression/spectral-token-pruning.en.md +61 -0
- package/design-patterns/compression/spectral-token-pruning.md +61 -0
- package/design-patterns/compression/topology-preserving-compression.en.md +64 -0
- package/design-patterns/compression/topology-preserving-compression.md +64 -0
- package/design-patterns/loss/constraint-penalty.en.md +67 -0
- package/design-patterns/loss/constraint-penalty.md +78 -0
- package/design-patterns/loss/contrastive-loss.en.md +59 -0
- package/design-patterns/loss/contrastive-loss.md +68 -0
- package/design-patterns/loss/information-bottleneck-loss.en.md +69 -0
- package/design-patterns/loss/information-bottleneck-loss.md +74 -0
- package/design-patterns/loss/orthogonality-loss.en.md +56 -0
- package/design-patterns/loss/orthogonality-loss.md +60 -0
- package/design-patterns/loss/variational-loss.en.md +61 -0
- package/design-patterns/loss/variational-loss.md +71 -0
- package/design-patterns/representation/equivariant-split.en.md +87 -0
- package/design-patterns/representation/equivariant-split.md +89 -0
- package/design-patterns/representation/manifold-representation.en.md +85 -0
- package/design-patterns/representation/manifold-representation.md +87 -0
- package/design-patterns/representation/shared-private-decomposition.en.md +84 -0
- package/design-patterns/representation/shared-private-decomposition.md +86 -0
- package/design-patterns/representation/subspace-alignment.en.md +90 -0
- package/design-patterns/representation/subspace-alignment.md +92 -0
- package/design-patterns/routing/graph-routing.en.md +79 -0
- package/design-patterns/routing/graph-routing.md +81 -0
- package/design-patterns/routing/moe-routing.en.md +85 -0
- package/design-patterns/routing/moe-routing.md +87 -0
- package/design-patterns/routing/optimal-transport-routing.en.md +68 -0
- package/design-patterns/routing/optimal-transport-routing.md +72 -0
- package/design-patterns/routing/spectral-clustering-routing.en.md +88 -0
- package/design-patterns/routing/spectral-clustering-routing.md +90 -0
- package/knowledge-base/differential-geometry/connection.en.md +51 -0
- package/knowledge-base/differential-geometry/connection.md +51 -0
- package/knowledge-base/differential-geometry/curvature.en.md +49 -0
- package/knowledge-base/differential-geometry/curvature.md +49 -0
- package/knowledge-base/differential-geometry/geodesic.en.md +51 -0
- package/knowledge-base/differential-geometry/geodesic.md +51 -0
- package/knowledge-base/differential-geometry/manifold.en.md +47 -0
- package/knowledge-base/differential-geometry/manifold.md +47 -0
- package/knowledge-base/differential-geometry/metric-tensor.en.md +50 -0
- package/knowledge-base/differential-geometry/metric-tensor.md +50 -0
- package/knowledge-base/differential-geometry/tangent-space.en.md +48 -0
- package/knowledge-base/differential-geometry/tangent-space.md +48 -0
- package/knowledge-base/information-geometry/fisher-metric.en.md +56 -0
- package/knowledge-base/information-geometry/fisher-metric.md +56 -0
- package/knowledge-base/information-geometry/natural-gradient.en.md +54 -0
- package/knowledge-base/information-geometry/natural-gradient.md +54 -0
- package/knowledge-base/lie-theory/equivariance.en.md +54 -0
- package/knowledge-base/lie-theory/equivariance.md +54 -0
- package/knowledge-base/lie-theory/group-action.en.md +51 -0
- package/knowledge-base/lie-theory/group-action.md +51 -0
- package/knowledge-base/lie-theory/lie-algebra.en.md +51 -0
- package/knowledge-base/lie-theory/lie-algebra.md +51 -0
- package/knowledge-base/lie-theory/lie-group.en.md +51 -0
- package/knowledge-base/lie-theory/lie-group.md +51 -0
- package/knowledge-base/lie-theory/representation.en.md +52 -0
- package/knowledge-base/lie-theory/representation.md +52 -0
- package/knowledge-base/matrix-analysis/low-rank-approximation.en.md +49 -0
- package/knowledge-base/matrix-analysis/low-rank-approximation.md +49 -0
- package/knowledge-base/matrix-analysis/matrix-perturbation.en.md +49 -0
- package/knowledge-base/matrix-analysis/matrix-perturbation.md +49 -0
- package/knowledge-base/matrix-analysis/positive-semidefinite.en.md +50 -0
- package/knowledge-base/matrix-analysis/positive-semidefinite.md +50 -0
- package/knowledge-base/matrix-analysis/projection.en.md +47 -0
- package/knowledge-base/matrix-analysis/projection.md +47 -0
- package/knowledge-base/matrix-analysis/spectral-decomposition.en.md +48 -0
- package/knowledge-base/matrix-analysis/spectral-decomposition.md +48 -0
- package/knowledge-base/optimization/constrained-optimization.en.md +53 -0
- package/knowledge-base/optimization/constrained-optimization.md +53 -0
- package/knowledge-base/optimization/convex-optimization.en.md +50 -0
- package/knowledge-base/optimization/convex-optimization.md +50 -0
- package/knowledge-base/optimization/lagrangian-duality.en.md +50 -0
- package/knowledge-base/optimization/lagrangian-duality.md +50 -0
- package/knowledge-base/optimization/proximal-method.en.md +52 -0
- package/knowledge-base/optimization/proximal-method.md +52 -0
- package/knowledge-base/optimization/riemannian-optimization.en.md +51 -0
- package/knowledge-base/optimization/riemannian-optimization.md +51 -0
- package/knowledge-base/overview.en.md +29 -218
- package/knowledge-base/overview.md +29 -220
- package/knowledge-base/probability/concentration-inequality.en.md +45 -0
- package/knowledge-base/probability/concentration-inequality.md +45 -0
- package/knowledge-base/probability/entropy.en.md +47 -0
- package/knowledge-base/probability/entropy.md +47 -0
- package/knowledge-base/probability/fisher-information.en.md +48 -0
- package/knowledge-base/probability/fisher-information.md +48 -0
- package/knowledge-base/probability/information-bottleneck.en.md +49 -0
- package/knowledge-base/probability/information-bottleneck.md +49 -0
- package/knowledge-base/probability/kl-divergence.en.md +51 -0
- package/knowledge-base/probability/kl-divergence.md +51 -0
- package/knowledge-base/topology/euler-characteristic.en.md +54 -0
- package/knowledge-base/topology/euler-characteristic.md +54 -0
- package/knowledge-base/topology/fundamental-group.en.md +52 -0
- package/knowledge-base/topology/fundamental-group.md +52 -0
- package/knowledge-base/topology/persistent-homology.en.md +54 -0
- package/knowledge-base/topology/persistent-homology.md +54 -0
- package/lenses/algorithmic.en.md +49 -0
- package/lenses/algorithmic.md +49 -0
- package/lenses/axiomatization.en.md +48 -0
- package/lenses/axiomatization.md +48 -0
- package/lenses/categorical.en.md +48 -0
- package/lenses/categorical.md +48 -0
- package/lenses/causal.en.md +49 -0
- package/lenses/causal.md +49 -0
- package/lenses/duality.en.md +47 -0
- package/lenses/duality.md +47 -0
- package/lenses/game.en.md +50 -0
- package/lenses/game.md +50 -0
- package/lenses/geometric.en.md +53 -0
- package/lenses/geometric.md +53 -0
- package/lenses/local-to-global.en.md +52 -0
- package/lenses/local-to-global.md +52 -0
- package/lenses/perturbation.en.md +51 -0
- package/lenses/perturbation.md +51 -0
- package/lenses/probabilistic.en.md +48 -0
- package/lenses/probabilistic.md +48 -0
- package/lenses/projection.en.md +50 -0
- package/lenses/projection.md +50 -0
- package/lenses/spectral.en.md +52 -0
- package/lenses/spectral.md +52 -0
- package/lenses/symmetry.en.md +49 -0
- package/lenses/symmetry.md +49 -0
- package/lenses/topological.en.md +48 -0
- package/lenses/topological.md +48 -0
- package/lenses/variational.en.md +48 -0
- package/lenses/variational.md +48 -0
- package/package.json +9 -3
- package/references/books/abstract-algebra.md +5 -5
- package/references/books/algebraic-geometry-rising-sea.md +5 -5
- package/references/books/differential-geometry.md +3 -3
- package/references/books/matrix-analysis.md +4 -4
- package/references/books/micro-lie-theory.md +3 -3
- package/references/books/optimization-ml.md +1 -1
- package/references/books/smooth-manifolds.md +3 -3
- package/references/gpu-friendly-math.en.md +8 -8
- package/references/gpu-friendly-math.md +2 -2
- package/references/inspiration.en.md +1 -1
- package/references/inspiration.md +2 -2
- package/skills/math-research-activator/SKILL.en.md +161 -106
- package/skills/math-research-activator/SKILL.md +162 -110
- package/skills/math-research-activator/original-texts.en.md +9 -9
- package/skills/math-research-activator/original-texts.md +11 -11
- package/commands/abstraction.md +0 -11
- package/commands/algorithmic-thinking.md +0 -11
- package/commands/axiomatization.md +0 -11
- package/commands/causal-inference.md +0 -11
- package/commands/discrete-combinatorial.md +0 -11
- package/commands/game-theory.md +0 -11
- package/commands/induction-analogy.md +0 -11
- package/commands/information-theory.md +0 -11
- package/commands/logic-deduction.md +0 -11
- package/commands/modeling.md +0 -11
- package/commands/optimization.md +0 -11
- package/commands/probability-statistics.md +0 -11
- package/commands/symmetry-invariance.md +0 -11
- package/commands/topological-thinking.md +0 -11
- package/commands/transformation.md +0 -11
- package/skills/abstraction/SKILL.en.md +0 -117
- package/skills/abstraction/SKILL.md +0 -121
- package/skills/abstraction/original-texts.en.md +0 -163
- package/skills/abstraction/original-texts.md +0 -175
- package/skills/algorithmic-thinking/SKILL.en.md +0 -132
- package/skills/algorithmic-thinking/SKILL.md +0 -138
- package/skills/algorithmic-thinking/original-texts.en.md +0 -253
- package/skills/algorithmic-thinking/original-texts.md +0 -256
- package/skills/axiomatization/SKILL.en.md +0 -144
- package/skills/axiomatization/SKILL.md +0 -151
- package/skills/axiomatization/original-texts.en.md +0 -154
- package/skills/axiomatization/original-texts.md +0 -160
- package/skills/causal-inference/SKILL.en.md +0 -147
- package/skills/causal-inference/SKILL.md +0 -151
- package/skills/causal-inference/original-texts.en.md +0 -136
- package/skills/causal-inference/original-texts.md +0 -167
- package/skills/discrete-combinatorial/SKILL.en.md +0 -124
- package/skills/discrete-combinatorial/SKILL.md +0 -131
- package/skills/discrete-combinatorial/original-texts.en.md +0 -184
- package/skills/discrete-combinatorial/original-texts.md +0 -185
- package/skills/game-theory/SKILL.en.md +0 -117
- package/skills/game-theory/SKILL.md +0 -123
- package/skills/game-theory/original-texts.en.md +0 -131
- package/skills/game-theory/original-texts.md +0 -131
- package/skills/induction-analogy/SKILL.en.md +0 -145
- package/skills/induction-analogy/SKILL.md +0 -152
- package/skills/induction-analogy/original-texts.en.md +0 -140
- package/skills/induction-analogy/original-texts.md +0 -154
- package/skills/information-theory/SKILL.en.md +0 -134
- package/skills/information-theory/SKILL.md +0 -140
- package/skills/information-theory/original-texts.en.md +0 -127
- package/skills/information-theory/original-texts.md +0 -127
- package/skills/logic-deduction/SKILL.en.md +0 -130
- package/skills/logic-deduction/SKILL.md +0 -135
- package/skills/logic-deduction/original-texts.en.md +0 -160
- package/skills/logic-deduction/original-texts.md +0 -173
- package/skills/modeling/SKILL.en.md +0 -135
- package/skills/modeling/SKILL.md +0 -139
- package/skills/modeling/original-texts.en.md +0 -162
- package/skills/modeling/original-texts.md +0 -165
- package/skills/optimization/SKILL.en.md +0 -129
- package/skills/optimization/SKILL.md +0 -135
- package/skills/optimization/original-texts.en.md +0 -167
- package/skills/optimization/original-texts.md +0 -168
- package/skills/probability-statistics/SKILL.en.md +0 -146
- package/skills/probability-statistics/SKILL.md +0 -151
- package/skills/probability-statistics/original-texts.en.md +0 -191
- package/skills/probability-statistics/original-texts.md +0 -193
- package/skills/symmetry-invariance/SKILL.en.md +0 -135
- package/skills/symmetry-invariance/SKILL.md +0 -139
- package/skills/symmetry-invariance/original-texts.en.md +0 -206
- package/skills/symmetry-invariance/original-texts.md +0 -221
- package/skills/topological-thinking/SKILL.en.md +0 -124
- package/skills/topological-thinking/SKILL.md +0 -128
- package/skills/topological-thinking/original-texts.en.md +0 -134
- package/skills/topological-thinking/original-texts.md +0 -164
- package/skills/transformation/SKILL.en.md +0 -120
- package/skills/transformation/SKILL.md +0 -124
- package/skills/transformation/original-texts.en.md +0 -204
- package/skills/transformation/original-texts.md +0 -216
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Persistent Homology
|
|
2
|
+
|
|
3
|
+
## Minimal Definition
|
|
4
|
+
|
|
5
|
+
Persistent homology tracks how the homology groups $H_k$ of a topological space change across different scales $\epsilon$: as $\epsilon$ increases from 0, topological features (connected components, holes, voids) are "born" at some scale and "die" at a larger scale. Features with long persistence are intrinsic topological structure; short-lived ones are noise. The output is a barcode or persistence diagram.
|
|
6
|
+
|
|
7
|
+
## Core Formulas
|
|
8
|
+
|
|
9
|
+
- Filtration: $\emptyset = K_0 \subseteq K_1 \subseteq \cdots \subseteq K_n = K$ (e.g., Vietoris-Rips complex $VR_\epsilon$)
|
|
10
|
+
- Vietoris-Rips complex: $VR_\epsilon = \{\sigma \subseteq X \mid d(x_i, x_j) \leq \epsilon, \forall x_i, x_j \in \sigma\}$
|
|
11
|
+
- Persistent homology groups: $H_k^{i,j} = \text{im}(H_k(K_i) \to H_k(K_j))$
|
|
12
|
+
- Persistence diagram: $D_k = \{(b_l, d_l)\}$, where $b_l$ is the birth scale and $d_l$ is the death scale
|
|
13
|
+
- Bottleneck distance: $d_B(D, D') = \inf_\gamma \sup_x \|x - \gamma(x)\|_\infty$
|
|
14
|
+
- Persistence landscape: $\lambda_k(t) = \sup\{m \mid \text{rank } H_k^{t-m, t+m} \geq k\}$
|
|
15
|
+
|
|
16
|
+
## Applicable Problems
|
|
17
|
+
|
|
18
|
+
- Topological feature extraction from point clouds: detecting the number of clusters, loops, voids, and other global structures
|
|
19
|
+
- Latent space quality assessment: whether the latent space generated by a VAE/GAN preserves the topological structure of the data
|
|
20
|
+
- Time series analysis: persistent homology after Takens embedding reveals dynamical topology
|
|
21
|
+
- Graph/network analysis: detecting community structure, bottlenecks, and higher-order correlations
|
|
22
|
+
|
|
23
|
+
## AI Design Translation
|
|
24
|
+
|
|
25
|
+
- **Topological regularization loss**: $L_{\text{topo}} = d_B(D_{\text{latent}}, D_{\text{data}})$, forcing the persistence diagram of the latent space to match that of the data, preserving topology
|
|
26
|
+
- **Persistence diagram featurization layer**: Convert the persistence diagram into a fixed-dimension vector (persistence image/landscape/silhouette) as input for downstream classification/regression
|
|
27
|
+
- **Topology-aware clustering**: Use the persistence intervals of $H_0$ to automatically determine the number of clusters; long-lived connected components correspond to true clusters
|
|
28
|
+
- **Latent space topology monitoring**: Compute $H_1$ (holes) of the latent space during training in real time to detect topological collapse (all holes disappear = posterior collapse)
|
|
29
|
+
|
|
30
|
+
## Engineering Feasibility
|
|
31
|
+
|
|
32
|
+
Limited GPU friendliness, which is the main bottleneck for deploying persistent homology:
|
|
33
|
+
- **Distance matrix computation**: $O(n^2)$, batched pairwise distances, GPU-friendly
|
|
34
|
+
- **Vietoris-Rips construction**: Combinatorial explosion; the VR complex on $n$ points has up to $2^n$ simplices; in practice, truncated to 2-skeleton, $O(n^3)$ worst case
|
|
35
|
+
- **Boundary matrix reduction (core algorithm)**: Column reduction analogous to Gaussian elimination, **highly serial**, standard algorithm cannot be parallelized
|
|
36
|
+
- **GPU-accelerated reduction algorithms**: e.g., Ripser's clearing optimization + GPU-based reduction (Emerald, etc.) can achieve 10--100x speedup, but still far from GEMM-level parallelism
|
|
37
|
+
- **Differentiable alternatives**: Persistence images are differentiable (gradients with respect to point positions can be computed), but the barcode itself is non-differentiable at birth/death events
|
|
38
|
+
- Complexity: exact computation is worst-case $O(n^3)$ (2-skeleton VR); large point clouds ($n > 10^4$) require subsampling
|
|
39
|
+
|
|
40
|
+
## Risks and Failure Conditions
|
|
41
|
+
|
|
42
|
+
- **Seriality of boundary matrix reduction**: The core algorithm is inherently serial, with GPU parallelism far below that of GEMM, making it infeasible for large-scale data
|
|
43
|
+
- **Combinatorial explosion**: The number of simplices in the VR complex grows exponentially with dimension; truncation to 2--3 dimensions is mandatory
|
|
44
|
+
- **Non-differentiability**: The discrete combinatorial structure of the barcode is non-differentiable with respect to input point positions (at birth/death events); differentiable proxies such as landscapes/images are required
|
|
45
|
+
- **Subjectivity of scale selection**: The scale range and truncation threshold for the filtration must be chosen manually
|
|
46
|
+
- **Topology is not geometry**: Persistent homology captures only topological invariants, losing metric information (distances, angles), which may be insufficient to distinguish different datasets
|
|
47
|
+
- **Subsampling bias**: Large datasets must be subsampled, and persistence diagrams from different subsamples may differ significantly
|
|
48
|
+
|
|
49
|
+
## Further References
|
|
50
|
+
|
|
51
|
+
- Distillation notes: references/books/smooth-manifolds.md (Ch 17--18 De Rham Cohomology, conceptual origin of topological invariants)
|
|
52
|
+
- Distillation notes: references/books/algebraic-geometry-rising-sea.md (Section 18 Cech Cohomology, Section 23 Derived Functors, cohomology computations)
|
|
53
|
+
- Original text: John M. Lee, *Introduction to Smooth Manifolds*, Ch 17--18 (de Rham cohomology)
|
|
54
|
+
- Extended reading: Edelsbrunner & Harer, *Computational Topology: An Introduction* (standard textbook on persistent homology)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# 持续同调 (Persistent Homology)
|
|
2
|
+
|
|
3
|
+
## 最小定义
|
|
4
|
+
|
|
5
|
+
持续同调追踪拓扑空间在不同尺度 $\epsilon$ 下的同调群 $H_k$ 变化:当 $\epsilon$ 从 0 增大时,拓扑特征(连通分量、洞、空腔)在某个尺度"诞生",在更大尺度"消亡"。存活时间长的特征是数据的本质拓扑结构,短命的视为噪声。输出是 barcode/persistence diagram。
|
|
6
|
+
|
|
7
|
+
## 核心公式
|
|
8
|
+
|
|
9
|
+
- 滤过(filtration):$\emptyset = K_0 \subseteq K_1 \subseteq \cdots \subseteq K_n = K$(如 Vietoris-Rips 复形 $VR_\epsilon$)
|
|
10
|
+
- Vietoris-Rips 复形:$VR_\epsilon = \{\sigma \subseteq X \mid d(x_i, x_j) \leq \epsilon, \forall x_i, x_j \in \sigma\}$
|
|
11
|
+
- 持续同调群:$H_k^{i,j} = \text{im}(H_k(K_i) \to H_k(K_j))$
|
|
12
|
+
- 持续图(persistence diagram):$D_k = \{(b_l, d_l)\}$,$b_l$ 为诞生尺度,$d_l$ 为消亡尺度
|
|
13
|
+
- Bottleneck 距离:$d_B(D, D') = \inf_\gamma \sup_x \|x - \gamma(x)\|_\infty$
|
|
14
|
+
- 持续性景观(persistence landscape):$\lambda_k(t) = \sup\{m \mid \text{rank } H_k^{t-m, t+m} \geq k\}$
|
|
15
|
+
|
|
16
|
+
## 适用问题
|
|
17
|
+
|
|
18
|
+
- 点云数据的拓扑特征提取:检测聚类数、环、空腔等全局结构
|
|
19
|
+
- 隐空间质量评估:VAE/GAN 生成的隐空间是否保留了数据的拓扑结构
|
|
20
|
+
- 时间序列分析:Takens 嵌入后的持续同调揭示动力学拓扑
|
|
21
|
+
- 图/网络分析:检测社区结构、瓶颈、高阶关联
|
|
22
|
+
|
|
23
|
+
## AI 设计翻译
|
|
24
|
+
|
|
25
|
+
- **拓扑正则化损失**:$L_{\text{topo}} = d_B(D_{\text{latent}}, D_{\text{data}})$,强制隐空间的持续图匹配数据的持续图,保持拓扑
|
|
26
|
+
- **持续图特征化层**:将 persistence diagram 转为固定维向量(persistence image/landscape/silhouette),作为下游分类/回归的输入
|
|
27
|
+
- **拓扑感知的聚类**:用 $H_0$ 的持续区间自动确定聚类数,长存活连通分量 = 真实簇
|
|
28
|
+
- **隐空间拓扑监控**:训练中实时计算 latent space 的 $H_1$(洞),检测拓扑坍塌(所有洞消失 = 后验坍塌)
|
|
29
|
+
|
|
30
|
+
## 工程可行性
|
|
31
|
+
|
|
32
|
+
GPU 友好度有限,是持续同调落地的主要瓶颈:
|
|
33
|
+
- **距离矩阵计算**:$O(n^2)$,batched 成对距离,GPU 友好
|
|
34
|
+
- **Vietoris-Rips 构建**:组合爆炸,$n$ 个点的 VR 复形最多 $2^n$ 个单纯形;实践中截断到 2-维,$O(n^3)$ 最坏
|
|
35
|
+
- **边界矩阵约化(核心算法)**:类似高斯消元的列约化,**高度串行**,标准算法不可并行化
|
|
36
|
+
- **GPU 加速的约化算法**:如 Ripser 的 clearing 优化 + GPU 版约化(Emerald 等),可加速 10-100x,但仍不及 GEMM 的并行度
|
|
37
|
+
- **可微替代**:persistence image 是可微的(对点位置的梯度可算),但 barcode 本身在诞生/消亡点不可微
|
|
38
|
+
- 复杂度:精确计算最坏 $O(n^3)$(2 维 VR),大规模点云($n > 10^4$)需要子采样
|
|
39
|
+
|
|
40
|
+
## 风险与失效条件
|
|
41
|
+
|
|
42
|
+
- **边界矩阵约化的串行性**:核心算法本质串行,GPU 并行度远低于 GEMM,大规模数据不可行
|
|
43
|
+
- **组合爆炸**:VR 复形的单纯形数随维数指数增长,必须截断到 2-3 维
|
|
44
|
+
- **不可微性**:barcode 的离散组合结构对输入点位置不可微(在诞生/消亡事件处),需要 landscape/image 等可微代理
|
|
45
|
+
- **尺度选择的主观性**:滤过的尺度范围和截断阈值需要手动选择
|
|
46
|
+
- **拓扑 ≠ 几何**:持续同调只捕捉拓扑不变量,丢失度量信息(距离、角度),可能不够区分不同数据集
|
|
47
|
+
- **子采样偏差**:大规模数据必须子采样,不同子采样的持续图可能有显著差异
|
|
48
|
+
|
|
49
|
+
## 深入参考
|
|
50
|
+
|
|
51
|
+
- 蒸馏稿:references/books/smooth-manifolds.md(Ch 17-18 De Rham Cohomology,拓扑不变量概念来源)
|
|
52
|
+
- 蒸馏稿:references/books/algebraic-geometry-rising-sea.md(§18 Cech Cohomology, §23 Derived Functors,上同调计算)
|
|
53
|
+
- 原书:John M. Lee, *Introduction to Smooth Manifolds*, Ch 17-18(de Rham 上同调)
|
|
54
|
+
- 延伸:Edelsbrunner & Harer, *Computational Topology: An Introduction*(持续同调标准教材)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# 🖥️ Algorithmic Lens
|
|
2
|
+
|
|
3
|
+
> Algorithms are the automation of thought — converting insights into precise, repeatable steps.
|
|
4
|
+
|
|
5
|
+
## What Perspective It Offers
|
|
6
|
+
|
|
7
|
+
This is an "engineer's" perspective — decomposing problems into finitely executable steps, evaluating costs, and judging feasibility. Its first principle is not "how to solve it," but rather "whether it is solvable and at what cost." Some problems are inherently difficult (NP-complete), and some are inherently unsolvable (undecidable); understanding these limits is as important as finding solutions. Every problem should first be asked: to which complexity class does it belong?
|
|
8
|
+
|
|
9
|
+
## What Problems It Is Suited to Diagnose
|
|
10
|
+
|
|
11
|
+
- Automating processes — applying the same operation repeatedly to large volumes of data
|
|
12
|
+
- Estimating computational cost — evaluating time / space consumption before large-scale execution
|
|
13
|
+
- Judging feasibility — determining whether a problem is in P / NP-hard / undecidable to decide on a solution strategy
|
|
14
|
+
- Confronting combinatorial explosion — search spaces that grow exponentially with input size, requiring pruning or approximation
|
|
15
|
+
|
|
16
|
+
## What Problems It Is Not Suited For
|
|
17
|
+
|
|
18
|
+
- Problems with closed-form solutions that yield answers directly — algorithmization only adds complexity
|
|
19
|
+
- Problems that are inherently qualitative rather than procedural — they cannot be reduced to finite steps
|
|
20
|
+
- Unstructured inputs that cannot be discretized — when preprocessing is more complex than the core problem itself
|
|
21
|
+
|
|
22
|
+
## Which Knowledge Domains It Routes To
|
|
23
|
+
|
|
24
|
+
- Complexity theory (P / NP / undecidability): the fundamental framework for judging problem feasibility
|
|
25
|
+
- Algorithmic paradigms (divide-and-conquer / dynamic programming / greedy / backtracking / randomized): core design decisions that determine the subsequent path
|
|
26
|
+
- Data structures: storage and query efficiency directly affects algorithmic performance
|
|
27
|
+
- Computation theory (Turing machines / the halting problem): understanding the absolute boundaries of computability
|
|
28
|
+
|
|
29
|
+
## What AI Designs It May Inspire
|
|
30
|
+
|
|
31
|
+
- Complexity classifier: input → automatic determination of P / NP-hard / undecidable, with recommended response strategies
|
|
32
|
+
- Algorithmic paradigm selector: automatic paradigm selection based on subproblem independence / overlap / greedy properties
|
|
33
|
+
- Correctness verification pipeline: automated checking of loop invariants + structural induction + termination proofs
|
|
34
|
+
|
|
35
|
+
## Reasoning Protocol
|
|
36
|
+
|
|
37
|
+
1. **Formalize the specification**: Define the input domain, output domain, and constraints; write pre-condition and post-condition predicates
|
|
38
|
+
2. **Judge feasibility**: To which complexity class does the problem belong? P → exact algorithm; NP-hard → approximation / heuristics; undecidable → restricted version
|
|
39
|
+
3. **Select a paradigm**: Independent → divide-and-conquer; overlapping → dynamic programming; greedy property → greedy; structured search → backtracking; high deterministic cost → randomized
|
|
40
|
+
4. **Analyze complexity**: Provide time O(f(n)) and space O(g(n)); distinguish worst-case from average-case; attend to constant factors
|
|
41
|
+
5. **Prove correctness**: Use loop invariants / structural induction / termination proofs to ensure algorithmic reliability
|
|
42
|
+
|
|
43
|
+
## Acceptance Criteria
|
|
44
|
+
|
|
45
|
+
- Input / output specifications have been formalized; pre- and post-conditions can be expressed as predicates
|
|
46
|
+
- Complexity is given in terms of time order and space order, annotated with worst-case / average-case scenarios
|
|
47
|
+
- Feasibility class has been determined (P / NP-hard / undecidable), with a corresponding response strategy stated
|
|
48
|
+
- A correctness proof has been provided (loop invariant or inductive strategy), annotated as proved / unproved
|
|
49
|
+
- Optimization recommendations are based on bottleneck analysis rather than blind parameter tuning
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# 🖥️ 算法透镜 / Algorithmic Lens
|
|
2
|
+
|
|
3
|
+
> 算法是思想的自动化——将洞察转化为可重复执行的精确步骤。
|
|
4
|
+
|
|
5
|
+
## 它是什么视角
|
|
6
|
+
|
|
7
|
+
这是一种"工程师"的视角——把问题拆解为有限可执行步骤,评估代价,判断可行性。它的第一原则不是"如何求解",而是"是否可解、代价几何"。某些问题本质困难(NP 完全),某些本质不可解(不可判定),了解这些极限与找到解同样重要。每一个问题都应先问:它属于哪个复杂度类?
|
|
8
|
+
|
|
9
|
+
## 适合诊断什么问题
|
|
10
|
+
|
|
11
|
+
- 需要将过程自动化——同一操作对大量数据反复执行
|
|
12
|
+
- 需要估算计算代价——大规模运行前评估时间/空间消耗
|
|
13
|
+
- 需要判断可行性——确定 P / NP-hard / 不可判定,决定求解策略
|
|
14
|
+
- 面对组合爆炸——搜索空间随输入指数增长,需剪枝或近似
|
|
15
|
+
|
|
16
|
+
## 不适合什么问题
|
|
17
|
+
|
|
18
|
+
- 问题有闭式解可直接给出答案——算法化反增复杂度
|
|
19
|
+
- 问题本质是定性的而非程序性的——无法化为有限步骤
|
|
20
|
+
- 输入无结构且无法离散化——预处理比核心问题更复杂时
|
|
21
|
+
|
|
22
|
+
## 会路由到哪些知识域
|
|
23
|
+
|
|
24
|
+
- 复杂度理论(P/NP/不可判定):判断问题可行性的根本框架
|
|
25
|
+
- 算法范式(分治/动规/贪心/回溯/随机化):核心设计决策决定后续路径
|
|
26
|
+
- 数据结构:存储与查询的效率直接影响算法性能
|
|
27
|
+
- 计算理论(图灵机/停机问题):理解可计算性的绝对边界
|
|
28
|
+
|
|
29
|
+
## 可能产生哪些 AI 设计
|
|
30
|
+
|
|
31
|
+
- 复杂度分类器:输入→自动判断 P/NP-hard/不可判定,推荐应对策略
|
|
32
|
+
- 算法范式选择器:根据子问题独立性/重叠性/贪心性质自动选范式
|
|
33
|
+
- 正确性验证管线:循环不变量 + 结构归纳 + 终止证明的自动化检查
|
|
34
|
+
|
|
35
|
+
## 推理协议
|
|
36
|
+
|
|
37
|
+
1. **形式化规格**:定义输入域、输出域、约束条件,写出前置/后置条件谓词
|
|
38
|
+
2. **判断可行性**:问题属于哪个复杂度类?P → 精确算法;NP-hard → 近似/启发式;不可判定 → 受限版本
|
|
39
|
+
3. **选择范式**:独立→分治、重叠→动规、贪心性质→贪心、结构化搜索→回溯、确定性代价高→随机化
|
|
40
|
+
4. **分析复杂度**:给出时间 O(f(n)) 和空间 O(g(n)),区分最坏与平均,关注常数因子
|
|
41
|
+
5. **证明正确性**:用循环不变量/结构归纳/终止证明确保算法可靠
|
|
42
|
+
|
|
43
|
+
## 验收标准
|
|
44
|
+
|
|
45
|
+
- 输入/输出规格已形式化,前置/后置条件可写成谓词
|
|
46
|
+
- 复杂度已给出时间阶和空间阶,标注最坏/平均场景
|
|
47
|
+
- 可行性类别已判定(P/NP-hard/不可判定),应对策略已说明
|
|
48
|
+
- 正确性证明已给出(循环不变量或归纳策略),标注已证/未证
|
|
49
|
+
- 优化建议基于瓶颈分析而非盲目调参
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# 📐 Axiomatization Lens
|
|
2
|
+
|
|
3
|
+
> Build from minimal assumptions using rigorous logic — scrutinizing premises matters more than checking conclusions
|
|
4
|
+
|
|
5
|
+
## What Perspective It Offers
|
|
6
|
+
|
|
7
|
+
Axiomatization is not "proving things," but rather a stance of disciplined skepticism: every theoretical system rests on a set of implicit or explicit assumptions, and laying all of these assumptions bare — examining them one by one — is far more likely to reveal fundamental problems than inspecting the conclusions alone. If the premises are wrong, no conclusion, however elegant, can stand. This perspective turns the "taken for granted" into an object requiring verification.
|
|
8
|
+
|
|
9
|
+
## What Problems It Is Suited to Diagnose
|
|
10
|
+
|
|
11
|
+
- Whether the assumptions of a paper or theory are self-consistent, and whether undeclared implicit premises exist
|
|
12
|
+
- Whether two ostensibly equivalent sets of premises are genuinely independent (i.e., whether redundant axioms are present)
|
|
13
|
+
- Whether a formal system is decidable, and whether undecidable propositions exist within it
|
|
14
|
+
- After axiomatizing an operator or structure and identifying its invariants, checking consistency and completeness
|
|
15
|
+
|
|
16
|
+
## What Problems It Is Not Suited For
|
|
17
|
+
|
|
18
|
+
- Purely factual queries — no theoretical framework requires examination
|
|
19
|
+
- The user has already accepted the framework and only needs to apply it — the axioms are already chosen
|
|
20
|
+
- Empirical questions — axiomatization cannot substitute for empirical evidence
|
|
21
|
+
- Constructive contexts where the law of excluded middle or the axiom of choice should not be assumed by default
|
|
22
|
+
|
|
23
|
+
## Which Knowledge Domains It Routes To
|
|
24
|
+
|
|
25
|
+
- formal logic (no KB card yet, use critic): The choice among first-order, second-order, and constructive logic is the foundational decision in axiomatization
|
|
26
|
+
- set theory (no KB card yet, use critic): ZFC/ZF as the background axiomatic system and the host for relative consistency proofs
|
|
27
|
+
- model theory (no KB card yet, use critic): Model existence proves consistency; categoricity determines structural uniqueness
|
|
28
|
+
|
|
29
|
+
## What AI Designs It May Inspire
|
|
30
|
+
|
|
31
|
+
- **Premise Auditing Module**: Automatically extracts explicit and implicit assumptions from papers and annotates their logical hierarchy
|
|
32
|
+
- **Axiom Perturbation Engine**: Given a change to one axiom, derives how the resulting theoretical system shifts
|
|
33
|
+
- **Consistency Guardian**: Detects in real time whether the axiom set generates contradictions during reasoning
|
|
34
|
+
|
|
35
|
+
## Reasoning Protocol
|
|
36
|
+
|
|
37
|
+
1. **Lay Out Premises**: List all explicit axioms, implicit assumptions, and background framework assumptions
|
|
38
|
+
2. **Specify the Language**: Declare the formal language (first-order, second-order, or constructive) and state the rationale for the choice
|
|
39
|
+
3. **Consistency Check**: Construct a model or carry out a relative consistency proof to confirm the axiom set is non-contradictory
|
|
40
|
+
4. **Independence Check**: For each axiom, attempt to construct a model in which it fails while all others hold
|
|
41
|
+
5. **Completeness Assessment**: Determine whether the axiom set suffices to derive all significant results in the target domain, and annotate decidability
|
|
42
|
+
|
|
43
|
+
## Acceptance Criteria
|
|
44
|
+
|
|
45
|
+
- Every axiom has an explicit verdict on consistency, independence, and completeness (none left unresolved)
|
|
46
|
+
- Implicit assumptions have been made explicit
|
|
47
|
+
- The consequences of axiom modifications have been analyzed
|
|
48
|
+
- An overall evaluative conclusion about the theoretical system has been provided
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# 📐 公理化透镜
|
|
2
|
+
|
|
3
|
+
> 从最少假设出发,用严格逻辑构建——审查前提比检查结论更重要
|
|
4
|
+
|
|
5
|
+
## 它是什么视角
|
|
6
|
+
|
|
7
|
+
公理化不是"证明东西",而是一种怀疑的眼光:任何理论体系都建立在一组隐含或显式的假设之上,把这些假设全部摊开、逐一审查,比直接看结论更能发现根本性问题。前提错了,结论再精巧也站不住脚。这种视角把"理所当然"变成需要检验的对象。
|
|
8
|
+
|
|
9
|
+
## 适合诊断什么问题
|
|
10
|
+
|
|
11
|
+
- 论文/理论的假设是否自洽,是否存在未声明的隐式前提
|
|
12
|
+
- 两组看似等价的前提是否真正独立(有无冗余公理)
|
|
13
|
+
- 形式系统是否可判定,是否存在不可判定命题
|
|
14
|
+
- 为算子/结构定公理与不变量后,检查相容性与完备性
|
|
15
|
+
|
|
16
|
+
## 不适合什么问题
|
|
17
|
+
|
|
18
|
+
- 纯粹的事实查询——没有理论体系需要审查
|
|
19
|
+
- 用户已接受框架、只需应用——公理已选定
|
|
20
|
+
- 经验性问题——公理化不能替代实证
|
|
21
|
+
- 构造性语境下不应默认排中律或选择公理
|
|
22
|
+
|
|
23
|
+
## 会路由到哪些知识域
|
|
24
|
+
|
|
25
|
+
- 形式逻辑(暂无知识卡,由 critic 审查):一阶/二阶/构造性逻辑的选择是公理化的基础决定
|
|
26
|
+
- 集合论(暂无知识卡,由 critic 审查):ZFC/ZF 作为背景公理系统,相对一致性证明的宿主
|
|
27
|
+
- 模型论(暂无知识卡,由 critic 审查):模型存在性证明相容性,范畴性判定结构唯一性
|
|
28
|
+
|
|
29
|
+
## 可能产生哪些 AI 设计
|
|
30
|
+
|
|
31
|
+
- **前提审计模块**:自动提取论文中显式/隐式假设,标注逻辑层次
|
|
32
|
+
- **公理变更推演器**:改变某条公理后,推演理论体系如何变化
|
|
33
|
+
- **一致性守卫**:在推理过程中实时检测公理集合是否产生矛盾
|
|
34
|
+
|
|
35
|
+
## 推理协议
|
|
36
|
+
|
|
37
|
+
1. **摊开前提**:列出所有显式公理、隐式假设、背景框架假设
|
|
38
|
+
2. **规定语言**:明确形式语言(一阶/二阶/构造性),标注选择理由
|
|
39
|
+
3. **相容性检验**:构造模型或做相对一致性证明,确认公理集不矛盾
|
|
40
|
+
4. **独立性检验**:对每条公理,尝试构造使其不成立但其余成立的模型
|
|
41
|
+
5. **完备性评估**:判断公理集是否足以推导目标领域所有重要结论,标注可判定性
|
|
42
|
+
|
|
43
|
+
## 验收标准
|
|
44
|
+
|
|
45
|
+
- 每条公理都有明确的相容性/独立性/完备性判定(不可悬置)
|
|
46
|
+
- 隐式假设已被显式化
|
|
47
|
+
- 公理变更的后果已分析
|
|
48
|
+
- 给出了对该理论体系的整体评价结论
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# 🧩 Categorification Lens
|
|
2
|
+
|
|
3
|
+
> Strip away incidental details to reveal essential structure — problems across different domains often share the same abstract skeleton
|
|
4
|
+
|
|
5
|
+
## What Perspective It Offers
|
|
6
|
+
|
|
7
|
+
Categorification (formerly "Abstraction") is a way of "recognizing isomorphisms across domains": when confronted with a complex problem, first strip away surface details and ask, "What does its skeleton look like? Have I seen this skeleton in another domain before?" Essential features — those whose alteration would fundamentally change the nature of the problem — must be preserved; inessential features may be discarded. The category-theoretic viewpoint pays particular attention to the behavior of morphisms between objects rather than to the internal structure of the objects themselves.
|
|
8
|
+
|
|
9
|
+
## What Problems It Is Suited to Diagnose
|
|
10
|
+
|
|
11
|
+
- Facing a complex problem with no clear entry point — extract the core structure first
|
|
12
|
+
- Two seemingly different problems share similarities — find a common abstract framework
|
|
13
|
+
- A need to generalize concrete observations into general principles
|
|
14
|
+
- Identifying transferable structural patterns for algorithm or operator design (group actions, functors, natural transformations)
|
|
15
|
+
|
|
16
|
+
## What Problems It Is Not Suited For
|
|
17
|
+
|
|
18
|
+
- Every detail is critical (e.g., debugging a specific bug) — abstraction discards crucial information
|
|
19
|
+
- A concrete numerical answer is required — categorification does not provide specific computations
|
|
20
|
+
- The problem is already in its simplest form — no further abstraction is needed
|
|
21
|
+
|
|
22
|
+
## Which Knowledge Domains It Routes To
|
|
23
|
+
|
|
24
|
+
- `lie-theory/equivariance`: Objects, morphisms, functors, natural transformations, and the Yoneda lemma — the core language for cross-domain transfer
|
|
25
|
+
- `lie-theory/representation`: Groups, rings, fields, modules, and lattices — axiom-matching to identify algebraic structure
|
|
26
|
+
- **topology**: Open sets, continuity, and connectedness — when the problem involves spatial structure and continuous deformation
|
|
27
|
+
|
|
28
|
+
## What AI Designs It May Inspire
|
|
29
|
+
|
|
30
|
+
- **Structure Recognizer**: Extracts objects and morphisms from a problem description and matches them to known categories
|
|
31
|
+
- **Cross-Domain Analogy Engine**: Uses functors to transfer solution strategies from one domain to another
|
|
32
|
+
- **Abstraction-Level Manager**: Determines whether the current stage involves extraction, generalization, or structuring, and decides whether to ascend to a higher level
|
|
33
|
+
|
|
34
|
+
## Reasoning Protocol
|
|
35
|
+
|
|
36
|
+
1. **Precisely Describe the Concrete**: Use mathematical language to describe all elements of the problem — objects, relations, constraints, and objectives
|
|
37
|
+
2. **Distinguish Essential from Inessential**: Examine each feature one by one; determine whether altering it changes the core structure
|
|
38
|
+
3. **Select a Matching Perspective**: Choose the best-matching framework from category theory, algebra, topology, or analysis, and execute its operations
|
|
39
|
+
4. **Solve at the Abstract Level**: Use universal constructions (products, coproducts, limits) or the Yoneda perspective to solve the problem abstractly
|
|
40
|
+
5. **Concretize Back to the Original Problem**: Translate the abstract solution precisely back into the mathematical language of the original problem, verifying that no information is lost
|
|
41
|
+
|
|
42
|
+
## Acceptance Criteria
|
|
43
|
+
|
|
44
|
+
- Essential and inessential features have been clearly distinguished and annotated
|
|
45
|
+
- A matching abstract perspective has been selected with stated rationale
|
|
46
|
+
- The abstract solution has been concretized back to the original problem
|
|
47
|
+
- The round-trip process has been verified to preserve all critical information intact
|
|
48
|
+
- The current level — extraction, generalization, or structuring — has been annotated
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# 🧩 范畴化透镜
|
|
2
|
+
|
|
3
|
+
> 忽略偶然细节,揭示必然结构——不同领域的问题往往共享相同的抽象骨架
|
|
4
|
+
|
|
5
|
+
## 它是什么视角
|
|
6
|
+
|
|
7
|
+
范畴化(原"抽象化")是一种"跨域识别同构"的眼光:面对复杂问题时,先剥离表面细节,追问"它的骨架长什么样?这个骨架在别的领域见过吗?"本质特征——改变后问题性质根本变化的——必须保留;非本质特征可以丢弃。范畴论视角尤其关注对象间的态射行为,而非对象内部构造。
|
|
8
|
+
|
|
9
|
+
## 适合诊断什么问题
|
|
10
|
+
|
|
11
|
+
- 面对复杂问题不知从何入手——先提取核心结构
|
|
12
|
+
- 两个看似不同的问题有相似之处——寻找共同抽象框架
|
|
13
|
+
- 需要将具体经验推广为一般规律
|
|
14
|
+
- 为算法/算子设计寻找可迁移的结构模式(群作用、函子、自然变换)
|
|
15
|
+
|
|
16
|
+
## 不适合什么问题
|
|
17
|
+
|
|
18
|
+
- 每个细节都至关重要(如调试具体 bug)——抽象会丢失关键信息
|
|
19
|
+
- 需要具体数值答案——范畴化不提供具体计算
|
|
20
|
+
- 问题本身已是最简形式——无需进一步抽象
|
|
21
|
+
|
|
22
|
+
## 会路由到哪些知识域
|
|
23
|
+
|
|
24
|
+
- `lie-theory/equivariance`:对象/态射/函子/自然变换/Yoneda 引理——跨域迁移的核心语言
|
|
25
|
+
- `lie-theory/representation`:群/环/域/模/格——识别运算结构的公理匹配
|
|
26
|
+
- **topology**:开集/连续/连通——当问题涉及空间结构与连续变形时
|
|
27
|
+
|
|
28
|
+
## 可能产生哪些 AI 设计
|
|
29
|
+
|
|
30
|
+
- **结构识别器**:从问题描述中提取对象与态射,匹配已知范畴
|
|
31
|
+
- **跨域类比引擎**:利用函子将一领域的解法迁移到另一领域
|
|
32
|
+
- **抽象层级管理器**:判断当前处于提炼/推广/结构化哪一层,决定是否跃升
|
|
33
|
+
|
|
34
|
+
## 推理协议
|
|
35
|
+
|
|
36
|
+
1. **精确描述具体**:用数学语言描述问题的所有要素——对象、关系、约束、目标
|
|
37
|
+
2. **区分本质与非本质**:逐项检查每个特征,改变后核心结构是否改变
|
|
38
|
+
3. **选择视角匹配**:从范畴论/代数/拓扑/分析中选最匹配的,执行其操作
|
|
39
|
+
4. **抽象层求解**:利用通用构造(积/余积/极限)或 Yoneda 视角在抽象层求解
|
|
40
|
+
5. **具体化回原问题**:将抽象解精确翻译回原问题的数学语言,验证信息无丢失
|
|
41
|
+
|
|
42
|
+
## 验收标准
|
|
43
|
+
|
|
44
|
+
- 本质特征与非本质特征已明确区分并标注
|
|
45
|
+
- 选择了匹配的抽象视角并说明理由
|
|
46
|
+
- 抽象解已具体化回原问题
|
|
47
|
+
- 验证了往返过程中关键信息完整保留
|
|
48
|
+
- 标注了当前处于提炼/推广/结构化的哪一层
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# 🔗 Causal Lens
|
|
2
|
+
|
|
3
|
+
> Correlation does not imply causation — but causation can be clarified. The crucial distinction: "how Y behaves when X is observed" is not the same as "what would happen if X were done."
|
|
4
|
+
|
|
5
|
+
## What Perspective It Offers
|
|
6
|
+
|
|
7
|
+
This is an "interventionist's" perspective — unsatisfied with observed associations, it asks "if I actively change X, what happens to Y?" Pearl's causal hierarchy divides reasoning into three tiers: association (seeing), intervention (doing), and counterfactuals (imagining), each requiring stronger modeling assumptions. The core of causal inference is not "discovering" causation from data, but encoding assumptions in an explicit causal model (DAG) and then using the do-calculus to reduce interventional effects to observable quantities.
|
|
8
|
+
|
|
9
|
+
## What Problems It Is Suited to Diagnose
|
|
10
|
+
|
|
11
|
+
- Distinguishing genuine causal effects from spurious associations in observational data
|
|
12
|
+
- Evaluating the effect of interventions, policies, or treatments ("what would happen if X were done")
|
|
13
|
+
- Counterfactual reasoning ("what would have happened if A had not been done")
|
|
14
|
+
- Modeling the data-generating process for model interpretability or out-of-distribution generalization
|
|
15
|
+
|
|
16
|
+
## What Problems It Is Not Suited For
|
|
17
|
+
|
|
18
|
+
- Pure prediction tasks with no causal question — only P(y|x) is needed; association suffices, and causation is superfluous
|
|
19
|
+
- Problems where no causal assumptions can be encoded — if a plausible DAG cannot be drawn, no causal conclusions can be reached
|
|
20
|
+
- Deterministic systems with no variation — causation is already fully described by the mechanism
|
|
21
|
+
|
|
22
|
+
## Which Knowledge Domains It Routes To
|
|
23
|
+
|
|
24
|
+
- Structural causal models (DAG / SCM / do-calculus): the formal framework for encoding causal assumptions and rendering interventional effects observable
|
|
25
|
+
- Potential outcomes framework (Neyman-Rubin): definitions and estimation of ATE and individual treatment effects
|
|
26
|
+
- Probability and statistics: conditional probability is the foundation of the association tier; causal effects require additional structural assumptions
|
|
27
|
+
- Experimental design (RCT / IV / DD): validation tools for causal conclusions — randomization severs confounding paths
|
|
28
|
+
|
|
29
|
+
## What AI Designs It May Inspire
|
|
30
|
+
|
|
31
|
+
- DAG builder: encoding causal directions among variables, automatically identifying confounding paths and back-door / front-door conditions
|
|
32
|
+
- Interventional effect calculator: back-door adjustment / do-calculus → P(y|do(x)), compared with P(y|x) to quantify confounding bias
|
|
33
|
+
- Sensitivity analyzer: E-value / Rosenbaum Gamma to quantify the fragility of conclusions to unobserved confounding
|
|
34
|
+
|
|
35
|
+
## Reasoning Protocol
|
|
36
|
+
|
|
37
|
+
1. **Construct a causal DAG**: Identify all variables, draw causal arrows encoding direct-cause assumptions, and verify acyclicity
|
|
38
|
+
2. **Identify confounders**: Find all common ancestors of X and Y; distinguish observed from unobserved confounders
|
|
39
|
+
3. **Select an identification strategy**: Based on confounder observability, choose back-door / front-door / do-calculus to reduce P(y|do(x)) to observable quantities
|
|
40
|
+
4. **Compute the interventional effect**: Apply the adjustment formula; compare with observational P(y|x) to measure confounding bias
|
|
41
|
+
5. **Sensitivity analysis**: Quantify how strong an unobserved confounder would need to be to overturn the conclusion (E-value / Rosenbaum Gamma)
|
|
42
|
+
|
|
43
|
+
## Acceptance Criteria
|
|
44
|
+
|
|
45
|
+
- The DAG has been constructed with a justification for every arrow; acyclicity has been confirmed
|
|
46
|
+
- Confounders have been listed, annotated as observed or unobserved
|
|
47
|
+
- P(y|do(x)) has been computed and compared with P(y|x); confounding bias has been quantified
|
|
48
|
+
- Counterfactual analysis (if required) states the necessary structural equations
|
|
49
|
+
- Sensitivity analysis has been performed and the fragility of conclusions has been quantified
|
package/lenses/causal.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# 🔗 因果透镜 / Causal Lens
|
|
2
|
+
|
|
3
|
+
> 相关不等于因果——但因果可以理清。关键区别:"看到 X 时 Y 如何"不等于"如果做了 X 会怎样"。
|
|
4
|
+
|
|
5
|
+
## 它是什么视角
|
|
6
|
+
|
|
7
|
+
这是一种"干预者"的视角——不满足于观察到的关联,追问"如果我主动改变 X,Y 会怎样?"。Pearl 因果层级将推理分为三层:关联(看到)、干预(做到)、反事实(想象),每层需要更强的建模假设。因果推断的核心不是从数据中"发现"因果,而是用显式因果模型(DAG)编码假设,再通过 do-演算将干预效应转化为可观测量。
|
|
8
|
+
|
|
9
|
+
## 适合诊断什么问题
|
|
10
|
+
|
|
11
|
+
- 需要从观察数据中区分真实因果效应与虚假关联
|
|
12
|
+
- 需要评估干预/政策/处理的效果("做了 X 会怎样")
|
|
13
|
+
- 需要反事实推理("若当时没做 A 结果会怎样")
|
|
14
|
+
- 需要为模型可解释性或分布外泛化建模数据生成过程
|
|
15
|
+
|
|
16
|
+
## 不适合什么问题
|
|
17
|
+
|
|
18
|
+
- 纯预测任务且无因果问题——只需 P(y|x),关联足够,因果多余
|
|
19
|
+
- 无可编码的因果假设——画不出合理 DAG 就没有因果结论
|
|
20
|
+
- 确定性系统且无变异——因果已被机制完全描述
|
|
21
|
+
|
|
22
|
+
## 会路由到哪些知识域
|
|
23
|
+
|
|
24
|
+
- 结构因果模型(DAG/SCM/do-演算):编码因果假设并将干预效应可观测化的形式框架
|
|
25
|
+
- 潜在结果框架(Neyman-Rubin):ATE/个体效应的定义与估计
|
|
26
|
+
- 概率与统计:条件概率是关联层的基础,因果效应需要额外的结构假设
|
|
27
|
+
- 实验设计(RCT/IV/DD):因果结论的验证工具——随机化切断混淆路径
|
|
28
|
+
|
|
29
|
+
## 可能产生哪些 AI 设计
|
|
30
|
+
|
|
31
|
+
- DAG 构建器:编码变量间因果方向,自动识别混淆路径与后门/前门条件
|
|
32
|
+
- 干预效应计算器:后门调整 / do-演算 → P(y|do(x)),与 P(y|x) 对比量化混淆偏差
|
|
33
|
+
- 敏感性分析器:E-value / Rosenbaum Gamma 量化结论对未观测混淆的脆弱性
|
|
34
|
+
|
|
35
|
+
## 推理协议
|
|
36
|
+
|
|
37
|
+
1. **构建因果 DAG**:明确所有变量,画因果箭头编码直接原因假设,检查无环性
|
|
38
|
+
2. **识别混淆变量**:找 X、Y 的所有共同祖先,区分可观测与不可观测混淆
|
|
39
|
+
3. **选择识别策略**:据混淆可观测性选后门/前门/do-演算,将 P(y|do(x)) 转化为可观测量
|
|
40
|
+
4. **计算干预效应**:用调整公式计算,与观察性 P(y|x) 对比衡量混淆偏差
|
|
41
|
+
5. **敏感性分析**:量化未观测混淆需要多强才能推翻结论(E-value/Rosenbaum Gamma)
|
|
42
|
+
|
|
43
|
+
## 验收标准
|
|
44
|
+
|
|
45
|
+
- DAG 已构建且每条箭头有假设依据,无环性已确认
|
|
46
|
+
- 混淆变量已列出,可观测/不可观测已标注
|
|
47
|
+
- P(y|do(x)) 已计算并与 P(y|x) 对比,混淆偏差已量化
|
|
48
|
+
- 反事实分析(若需要)已说明所需结构方程
|
|
49
|
+
- 敏感性分析已执行,结论的脆弱性已量化
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# 🔄 Duality Lens
|
|
2
|
+
|
|
3
|
+
> A hard problem is equivalent to an easy problem — the key is finding the right transform and its inverse
|
|
4
|
+
|
|
5
|
+
## What Perspective It Offers
|
|
6
|
+
|
|
7
|
+
Duality (formerly "Transform") is a way of "looking at a problem through a different representation": the same problem can admit multiple representations, and choosing a good transform can make a difficult problem simple. The essence of a transform is not to change the problem itself, but to change the vantage point from which it is viewed — differentiation becomes multiplication, convolution becomes pointwise multiplication, constrained optimization becomes a dual problem. But every transform must have an inverse: a transform without an inverse is evasion, not a solution.
|
|
8
|
+
|
|
9
|
+
## What Problems It Is Suited to Diagnose
|
|
10
|
+
|
|
11
|
+
- A problem is difficult to analyze or solve in its current form — a change of representation space is needed
|
|
12
|
+
- Variables are coupled and need decoupling — transform to an independent coordinate system
|
|
13
|
+
- Hidden structure needs to be revealed — periodicity invisible in the time domain becomes obvious in the frequency domain
|
|
14
|
+
- Finding an equivalent but computationally friendlier representation
|
|
15
|
+
|
|
16
|
+
## What Problems It Is Not Suited For
|
|
17
|
+
|
|
18
|
+
- The problem is already simple enough — no transform is needed
|
|
19
|
+
- The transform discards critical information and is not invertible — choose an information-preserving transform
|
|
20
|
+
- Convergence conditions are not satisfied — forcing a transform produces meaningless results
|
|
21
|
+
|
|
22
|
+
## Which Knowledge Domains It Routes To
|
|
23
|
+
|
|
24
|
+
- `matrix-analysis/spectral-decomposition`: Fourier, Laplace, and Z-transforms — equivalent mappings from the time domain to the frequency domain
|
|
25
|
+
- **matrix-analysis**: Spectral decomposition and low-rank approximation — transforms and simplifications in matrix space
|
|
26
|
+
- **optimization/lagrangian-duality**: Legendre and Fenchel transforms — conversion from constrained optimization to dual problems
|
|
27
|
+
|
|
28
|
+
## What AI Designs It May Inspire
|
|
29
|
+
|
|
30
|
+
- **Difficulty Diagnoser**: Analyzes the type of difficulty in the current representation (computational complexity, unclear structure, variable coupling)
|
|
31
|
+
- **Transform Selector**: Matches the most appropriate transform to the diagnosed difficulty type and checks convergence conditions
|
|
32
|
+
- **Equivalence Verifier**: Confirms that no information is lost during the forward-transform and inverse-transform round trip
|
|
33
|
+
|
|
34
|
+
## Reasoning Protocol
|
|
35
|
+
|
|
36
|
+
1. **Diagnose the Difficulty**: Why is the current representation hard to work with — computational complexity, unclear structure, or variable coupling?
|
|
37
|
+
2. **Select a Transform**: Choose a transform based on the difficulty type; specify the formula, domain mapping, and convergence conditions
|
|
38
|
+
3. **Execute the Transform**: Map the problem into the new representation space, strictly following the formula
|
|
39
|
+
4. **Verify the Region of Convergence**: Before applying transformed results, validate that convergence conditions are satisfied
|
|
40
|
+
5. **Inverse-Transform Back to the Original Space**: Translate the solution back into the language of the original problem and verify equivalence
|
|
41
|
+
|
|
42
|
+
## Acceptance Criteria
|
|
43
|
+
|
|
44
|
+
- The difficulty of the current representation has been clearly diagnosed
|
|
45
|
+
- The transform selection is justified with clear reasoning, and convergence conditions have been verified
|
|
46
|
+
- The inverse transform has been executed and the solution has been returned to the original space
|
|
47
|
+
- Equivalence has been verified: no information loss, correct region of convergence, and correct encoding of boundary conditions
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# 🔄 对偶透镜
|
|
2
|
+
|
|
3
|
+
> 复杂问题等价于简单问题——关键是找到合适的变换和它的逆
|
|
4
|
+
|
|
5
|
+
## 它是什么视角
|
|
6
|
+
|
|
7
|
+
对偶(原"变换")是一种"换个表示看问题"的眼光:同一个问题可以有不同的表示方式,选择一个好的变换,可以让困难的问题变得简单。变换的精髓不是改变问题本身,而是改变看问题的视角——微分变乘法、卷积变乘法、约束优化变对偶问题。但变换必须有逆:没有逆变换的变换是逃避,不是解决。
|
|
8
|
+
|
|
9
|
+
## 适合诊断什么问题
|
|
10
|
+
|
|
11
|
+
- 问题在当前形式下难分析或求解——需要换表示空间
|
|
12
|
+
- 变量耦合需要解耦——变换到独立坐标系
|
|
13
|
+
- 隐藏结构需要揭示——时域看不出周期性,频域一目了然
|
|
14
|
+
- 寻找等价但计算更友好的表示
|
|
15
|
+
|
|
16
|
+
## 不适合什么问题
|
|
17
|
+
|
|
18
|
+
- 问题已足够简单——不需要变换
|
|
19
|
+
- 变换会丢失关键信息且不可逆——选保信息的变换
|
|
20
|
+
- 收敛条件不满足——强行变换产生无意义结果
|
|
21
|
+
|
|
22
|
+
## 会路由到哪些知识域
|
|
23
|
+
|
|
24
|
+
- `matrix-analysis/spectral-decomposition`:傅里叶/拉普拉斯/Z 变换——时域到频域的等价映射
|
|
25
|
+
- **matrix-analysis**:谱分解、低秩近似——矩阵空间的变换与简化
|
|
26
|
+
- **optimization/lagrangian-duality**:Legendre/Fenchel 变换——约束优化到对偶问题的转换
|
|
27
|
+
|
|
28
|
+
## 可能产生哪些 AI 设计
|
|
29
|
+
|
|
30
|
+
- **困难诊断器**:分析当前表示的困难类型(运算复杂/结构不清晰/变量耦合)
|
|
31
|
+
- **变换选择器**:根据困难类型匹配最合适的变换,检查收敛条件
|
|
32
|
+
- **等价性验证器**:确认变换-逆变换往返过程中信息无丢失
|
|
33
|
+
|
|
34
|
+
## 推理协议
|
|
35
|
+
|
|
36
|
+
1. **诊断困难**:当前表示为什么难处理?运算复杂、结构不清晰、还是变量耦合
|
|
37
|
+
2. **选择变换**:根据困难类型选择变换,明确公式、域映射、收敛条件
|
|
38
|
+
3. **执行变换**:将问题变换到新表示空间,严格按公式执行
|
|
39
|
+
4. **验证收敛域**:应用变换结果前必须验证收敛条件是否满足
|
|
40
|
+
5. **逆变换回原空间**:将解翻译回原问题语言,验证等价性
|
|
41
|
+
|
|
42
|
+
## 验收标准
|
|
43
|
+
|
|
44
|
+
- 当前表示的困难已明确诊断
|
|
45
|
+
- 变换选择有明确理由,收敛条件已验证
|
|
46
|
+
- 逆变换已执行,解已回到原空间
|
|
47
|
+
- 等价性已验证:信息无丢失、收敛域正确、边界条件正确编码
|