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.
- package/README.en-US.md +165 -198
- package/README.md +165 -198
- package/agents/math-critic.en.md +28 -26
- package/agents/math-critic.md +33 -33
- package/commands/ask.en.md +10 -0
- 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/agentic-workflow.en.md +1 -1
- package/references/agentic-workflow.md +1 -1
- package/references/books/abstract-algebra.en.md +124 -0
- package/references/books/abstract-algebra.md +22 -22
- package/references/books/algebraic-geometry-rising-sea.en.md +171 -0
- package/references/books/algebraic-geometry-rising-sea.md +11 -11
- package/references/books/differential-geometry.en.md +140 -0
- package/references/books/differential-geometry.md +19 -19
- package/references/books/matrix-analysis.en.md +146 -0
- package/references/books/matrix-analysis.md +10 -10
- package/references/books/micro-lie-theory.en.md +116 -0
- package/references/books/micro-lie-theory.md +17 -17
- package/references/books/optimization-ml.en.md +163 -0
- package/references/books/optimization-ml.md +7 -8
- package/references/books/smooth-manifolds.en.md +105 -0
- package/references/books/smooth-manifolds.md +14 -14
- package/references/gpu-friendly-math.en.md +23 -10
- package/references/gpu-friendly-math.md +17 -4
- package/references/inspiration.en.md +1 -1
- package/references/inspiration.md +2 -2
- package/skills/math-research-activator/SKILL.en.md +195 -114
- package/skills/math-research-activator/SKILL.md +194 -119
- 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
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: logic-deduction
|
|
3
|
-
description: |
|
|
4
|
-
触发:检查证明严谨性、形式逻辑分析、前提审查、谓词逻辑推理验证、量词结构分析、发现逻辑漏洞;或为算法正确性/不变量做形式推导与证明验证时调用。
|
|
5
|
-
English: Trigger when checking proof rigor, formal logic analysis, premise auditing, predicate logic verification, quantifier structure analysis, discovering logical loopholes; or doing formal derivation and proof verification for algorithm correctness or invariants.
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
> **语言路由**:若用户消息为英文,请读取并遵循同目录下的 `SKILL.en.md`,按其操作规程以英文输出;中文消息则继续使用本文件。
|
|
9
|
-
|
|
10
|
-
# 🧠 逻辑演绎 / Logic Deduction
|
|
11
|
-
|
|
12
|
-
> "逻辑是数学的家规——一切推理必须在形式规则的监督下进行。"
|
|
13
|
-
> "Logic is the house rule of mathematics — all reasoning must proceed under the supervision of formal rules."
|
|
14
|
-
>
|
|
15
|
-
> —— 哥德尔完备性定理 (1929),一阶逻辑
|
|
16
|
-
> —— Gödel's Completeness Theorem (1929), First-Order Logic
|
|
17
|
-
|
|
18
|
-
## 核心原则 / Core Principle
|
|
19
|
-
|
|
20
|
-
从真前提严格推理新真命题——推理链条的每一步都必须合法。推理类型:演绎(前提真+规则有效→结论必然真,最可靠)、归纳(实例→一般,或然性)、溯因(观察+理论→最佳解释,假设性)。
|
|
21
|
-
|
|
22
|
-
> **数学形式化 / Mathematical Formalization**
|
|
23
|
-
>
|
|
24
|
-
> 逻辑演绎具有两层结构:命题逻辑处理真值函数连接词(¬, ∧, ∨, →, ↔),谓词逻辑在此基础上添加量词(∀, ∃)与个体变元。数学证明生活在谓词逻辑之中——仅靠命题逻辑无法表达 "对所有 x,若 P(x) 则 Q(x)" 这类陈述,因此也无法对实际数学论证进行证明检验。
|
|
25
|
-
>
|
|
26
|
-
> 哥德尔完备性定理(Gödel's Completeness Theorem, 1929):一阶谓词逻辑中,所有有效论证都是可证明的——若 φ 是一阶逻辑的有效公式,则存在一个形式证明序列从空前提集推导出 φ。这保证了一阶逻辑的演绎能力与语义有效性完全吻合(可靠性+完备性),但仅限一阶逻辑;二阶逻辑不具备此性质。
|
|
27
|
-
>
|
|
28
|
-
> 详细数学依据见 `original-texts.md`
|
|
29
|
-
|
|
30
|
-
## GPU 友好性 / GPU-Friendliness(横切检查)
|
|
31
|
-
|
|
32
|
-
逻辑/形式验证结构映射 GPU 时需警惕:**符号推理常「美但不可算」**——证明搜索、归结(Resolution)回溯本质串行,难以张量化。当逻辑用于算法/不变量设计时,过 `../../references/gpu-friendly-math.md` 八维门:
|
|
33
|
-
|
|
34
|
-
- **SAT/SMT 批量求解**:独立子句可批量并行(友好),但 CDCL 回溯串行。
|
|
35
|
-
- **定理证明(Coq/Lean)**:tactic 求解器高度串行、依赖图复杂——不可训练,应**离线验证**产物后仅部署结论。
|
|
36
|
-
- **模型检查(Model Checking)**:状态空间爆炸→符号 BDD 可压缩;GPU 上可改用并行 SAT / 局部可达性(可改造)。
|
|
37
|
-
- **类型/不变量检查**:作为编译期/离线静态检查,运行期零开销(友好)。
|
|
38
|
-
- **反模式**:把归结/自然演绎证明搜索塞进训练循环——不可微分、不可并行;应松弛为可微近似(概率/神经符号逻辑)或离线证毕后仅部署结论。
|
|
39
|
-
|
|
40
|
-
八维最低判定(正式术语):**张量化**通常不友好,除非子句/状态可批量编码;**GEMM 可映射**只适合可微逻辑、SAT 打分或布尔半环近似;**复杂度**必须标注证明搜索/模型检查的指数或不可判定边界;**显存与 KV-Cache**看状态空间、证明树、BDD 是否爆炸;**低精度稳定**看松弛逻辑在 fp16/bf16 下是否保持语义边界;**并行与通信**看分支搜索能否批量或离线;**稀疏结构**看约束图是否规则;**算子融合**看逻辑 loss/mask 是否能融合,证明搜索本身不应进 kernel。
|
|
41
|
-
|
|
42
|
-
> 配合 `../../references/books/abstract-algebra.md`(形式系统)、`../../references/books/algebraic-geometry-rising-sea.md`(范畴论推理)。
|
|
43
|
-
|
|
44
|
-
## 不适用场景 / When NOT to Use
|
|
45
|
-
|
|
46
|
-
- **前提本身不确定**——先确定前提真假,再进行演绎。
|
|
47
|
-
- **需要创造性突破而非逻辑验证**——演绎只能发现已有信息蕴含的结论,不能产生新信息。
|
|
48
|
-
- **二阶逻辑问题**——哥德尔完备性仅覆盖一阶逻辑;二阶有效性不可完全公理化。
|
|
49
|
-
|
|
50
|
-
## 何时使用 / When to Use
|
|
51
|
-
|
|
52
|
-
- 阅读论文或代码时,检查其证明/推导/不变量的严谨性。
|
|
53
|
-
- 发现论证中可能存在逻辑跳跃或漏洞,需形式化定位。
|
|
54
|
-
- 验证某个结论是否真的能从前提推导出来(Γ ⊢ φ 是否成立)。
|
|
55
|
-
- 分析含 ∀ / ∃ 的数学陈述时,验证量词推理的正确性。
|
|
56
|
-
- 检查二阶逻辑论证的有效性边界。
|
|
57
|
-
- 为算法正确性、循环不变量、程序性质做形式推导与证明验证。
|
|
58
|
-
|
|
59
|
-
## 方法流程 / Method
|
|
60
|
-
|
|
61
|
-
### 第一步:识别前提 / Identify the Premises
|
|
62
|
-
列出论证中所有前提(假设、已知条件、引用定理),标注状态:**已证定理**(如"素数无穷")、**公理**(如 ZF 集合论公理)、**假设**(如"黎曼猜想")、**经验事实**。同时标注逻辑层次:纯命题前提(不含量词)还是谓词前提(含 ∀ / ∃)。前提质量决定推理质量——前提不成立则结论必然不可靠。
|
|
63
|
-
|
|
64
|
-
### 第二步:检查推理规则 / Check the Rules of Inference
|
|
65
|
-
验证每一步是否使用有效推理规则。
|
|
66
|
-
|
|
67
|
-
**命题逻辑规则**:假言推理(Modus Ponens)P→Q, P ⊢ Q;拒取式(Modus Tollens)P→Q, ¬Q ⊢ ¬P;假言三段论 P→Q, Q→R ⊢ P→R;析取三段论 P∨Q, ¬P ⊢ Q;合取引入 P, Q ⊢ P∧Q;双重否定消除 ¬¬P ⊢ P。
|
|
68
|
-
|
|
69
|
-
**谓词逻辑规则**:全称实例化(UI)∀x P(x) ⊢ P(a);全称泛化(UG)P(a) 对任意 a 成立 ⊢ ∀x P(x)(a 必须任意,不能是特定常元);存在实例化(EI)∃x P(x) ⊢ P(c)(c 必须为新名称,不与已有常元冲突);存在泛化(EG)P(a) ⊢ ∃x P(x)。
|
|
70
|
-
|
|
71
|
-
**其他框架**:消解原理(Resolution)从 (P∨Q) 与 (¬P∨R) 消解出 (Q∨R),适于自动化证明;自然演绎系统(Natural Deduction)以引入/消除规则对称组织,更贴近人类推理习惯。
|
|
72
|
-
|
|
73
|
-
### 第三步:检查常见逻辑谬误 / Check for Common Fallacies
|
|
74
|
-
**命题逻辑谬误**:肯定后件 P→Q, Q ⊢ P(无效);否定前件 P→Q, ¬P ⊢ ¬Q(无效);混淆充分与必要条件;循环论证(结论隐含用作前提);稻草人谬误。
|
|
75
|
-
|
|
76
|
-
**谓词逻辑谬误**:量词移位谬误 ∀x∃y R(x,y) ≠ ∃y∀x R(x,y)(前者"每人各有其所爱",后者"有人被所有人所爱");非法全称泛化(从特定 a 的 P(a) 推 ∀x P(x),违反 UG 任意性);混淆自由与约束变量;混淆 ∀ 与 ∃ 强度;偷换概念(Equivocation);虚假二分(False Dilemma,将 P∨Q 呈现为仅有选择,隐含排除 ¬P∧¬Q)。
|
|
77
|
-
|
|
78
|
-
### 第四步:分析量词结构 / Analyze Quantifier Structure
|
|
79
|
-
∀ 与 ∃ 的嵌套顺序决定逻辑强度:
|
|
80
|
-
- **∀∃ 结构**(较弱):∀x∃y R(x,y)——对每个 x 可构造各自的 y,构造性可满足。
|
|
81
|
-
- **∃∀ 结构**(较强):∃y∀x R(x,y)——存在统一 y 对所有 x 成立,往往需选择公理(Axiom of Choice)。
|
|
82
|
-
|
|
83
|
-
要点:嵌套层数越多推理越需谨慎;相邻同类型量词可交换(∀x∀y = ∀y∀x,∃x∃y = ∃y∃x),不同类型不可交换;量词否定等值 ¬∀x P(x) ≡ ∃x ¬P(x),¬∃x P(x) ≡ ∀x ¬P(x)。
|
|
84
|
-
|
|
85
|
-
### 第五步:验证推理链完备性 / Verify Completeness of the Inference Chain
|
|
86
|
-
检查前提集 Γ 能否形式推导出结论 φ:是否存在有限序列 φ₁, φ₂, ..., φₙ = φ,其中每个 φᵢ 或属于 Γ,或由前面公式通过有效规则得出?若链不完整,标注缺失的中间步骤及其所需规则。缺失一步,整条链断裂。
|
|
87
|
-
|
|
88
|
-
### 第六步:评估结论强度 / Assess the Strength of the Conclusion
|
|
89
|
-
逻辑强度分类:**必然的**(演绎有效,前提真则结论必然真)、**或然的**(归纳支持,概率性证据)、**假设性的**(溯因,最佳解释但未验证)。同时评估适用范围:全称(∀)还是存在(∃)?条件性(→)还是无条件?不要把"可能"夸大为"必然"。
|
|
90
|
-
|
|
91
|
-
### 第七步:证明策略选择 / Select Proof Strategy
|
|
92
|
-
- **直接证明**:从前提逐步推导至结论,最自然。
|
|
93
|
-
- **反证法**:假设 ¬φ 推导出矛盾从而证明 φ,适于否定性结论或难以直接构造的论证。
|
|
94
|
-
- **逆否证明**:证明 ¬Q → ¬P 以建立 P → Q,当逆否方向更易推理时使用。
|
|
95
|
-
- **穷举证明**:将所有情况逐一验证,适于有限可枚举情形。
|
|
96
|
-
- **构造性证明**:直接构造满足条件的对象,比纯存在性证明(仅证 ∃x P(x) 不给出 x)更有信息量。
|
|
97
|
-
|
|
98
|
-
## 常见错误 / Common Errors
|
|
99
|
-
|
|
100
|
-
| 错误 / Error | 批评 / Critique | 正确做法 / Correct Approach |
|
|
101
|
-
|---|---|---|
|
|
102
|
-
| 混淆充分与必要条件 | P → Q 成立不代表 Q → P 成立 | 明确区分充分、必要、充要条件 |
|
|
103
|
-
| 肯定后件谬误 | P → Q, Q ⊬ P;只有 Modus Ponens/Tollens 有效 | 拒绝 P→Q, Q ⊢ P 这类无效推理 |
|
|
104
|
-
| 隐藏前提 | 推理中使用了未声明的前提 | 暴露所有前提,逐一检验 |
|
|
105
|
-
| 无限倒退 | 每个前提都需要另一个前提来证明 | 找到不需要证明的起点(公理/经验事实)|
|
|
106
|
-
| 量词移位谬误 | ∀x∃y R(x,y) ≠ ∃y∀x R(x,y),前者弱后者强 | 严格遵守量词顺序,不可交换不同类型量词 |
|
|
107
|
-
| 非法全称泛化 | 从特定 a 的 P(a) 推 ∀x P(x),违反 UG 任意性 | UG 仅适用于任意个体 a,不适用于特定常元 |
|
|
108
|
-
| 混淆自由与约束变量 | x 在 ∀x P(x) 中约束、在 P(x) 中自由,含义不同 | 明确标注变元约束/自由状态,避免混用 |
|
|
109
|
-
| 混淆 ∀ 与 ∃ | "所有元素满足 P" 远强于 "存在元素满足 P" | 严格区分全称断言与存在断言的逻辑强度 |
|
|
110
|
-
| 符号推理塞进训练循环 | 证明搜索/归结本质串行、不可微分,"美但不可算" | 松弛为可微近似(概率/神经符号)或离线证毕后仅部署结论 |
|
|
111
|
-
|
|
112
|
-
## 操作规程 / Operating Procedure
|
|
113
|
-
|
|
114
|
-
当本 skill 被触发时,输出必须包含:
|
|
115
|
-
|
|
116
|
-
1. **[前提清单]** — 列出所有前提,标注 `[已证]` / `[公理]` / `[假设]` / `[经验]`,并标注逻辑层次 `[命题]` / `[谓词]`
|
|
117
|
-
2. **[推理链重构]** — 用形式逻辑语言重述推理过程,每一步标注使用的推理规则(含 UI/UG/EI/EG 等谓词规则)
|
|
118
|
-
3. **[谬误检查]** — 逐一检查命题逻辑与谓词逻辑谬误,标注 `✅ 无此谬误` 或 `❌ 发现 [具体谬误]`
|
|
119
|
-
4. **[量词结构分析]** — 若有 ∀ / ∃ 嵌套,标注量词顺序与逻辑强度 `∀∃(弱)` / `∃∀(强)`
|
|
120
|
-
5. **[完整性评估]** — 推理链是否完整?标注 `✅ 完整` 或 `⚠️ 跳跃:[说明]`
|
|
121
|
-
6. **[结论强度]** — 标注 `[必然]` / `[或然]` / `[假设性]`,并标注适用范围 `[全称]` / `[存在]` / `[条件]`
|
|
122
|
-
7. **[证明策略评估]** — 当前论证使用了何种证明策略?是否有更优策略?标注 `✅ 策略适当` 或 `💡 建议:[更优策略]`
|
|
123
|
-
8. **[GPU 可行性]**(若用于算法/不变量验证)— 形式验证是否离线进行、结论可否部署;证明搜索是否需松弛为可微近似,过八维门。
|
|
124
|
-
|
|
125
|
-
**输出不得只给分析而无结论。**
|
|
126
|
-
|
|
127
|
-
## 与其他 skill 的关系 / Relations to Other Skills
|
|
128
|
-
|
|
129
|
-
- **公理化思想**:逻辑演绎是公理体系的推理引擎;公理提供前提,演绎提供推导机制,二者共同构成形式系统。
|
|
130
|
-
- **抽象化思想**:形式逻辑本身就是高度抽象的结构——将具体内容剥离后只保留推理形式。
|
|
131
|
-
- **归纳与类比**:演绎与归纳互补——演绎保证正确性,归纳提供新前提。
|
|
132
|
-
- **概率与统计**:在不确定性下,经典逻辑需扩展为概率逻辑。
|
|
133
|
-
- **算法思想**:逻辑演绎为算法正确性证明提供形式框架——程序性质验证本质上是一阶谓词推理。
|
|
134
|
-
- **反例思想**:反例是证伪 ∀ 断言的直接手段,与演绎证真构成双重验证体系。
|
|
135
|
-
- **现代数学激活**:`../../references/books/abstract-algebra.md`(形式系统)、`../../references/books/algebraic-geometry-rising-sea.md`(范畴论推理)。
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
# Mathematical Sources and Classic Texts
|
|
2
|
-
|
|
3
|
-
## Propositional Logic
|
|
4
|
-
|
|
5
|
-
**Basic inference rules**:
|
|
6
|
-
|
|
7
|
-
| Rule Name | Form | Validity |
|
|
8
|
-
|-----------|------|----------|
|
|
9
|
-
| Modus Ponens | P → Q, P ⊢ Q | Valid |
|
|
10
|
-
| Modus Tollens | P → Q, ¬Q ⊢ ¬P | Valid |
|
|
11
|
-
| Hypothetical Syllogism | P → Q, Q → R ⊢ P → R | Valid |
|
|
12
|
-
| Disjunctive Syllogism | P ∨ Q, ¬P ⊢ Q | Valid |
|
|
13
|
-
| Affirming the Consequent | P → Q, Q ⊢ P | Invalid |
|
|
14
|
-
| Denying the Antecedent | P → Q, ¬P ⊢ ¬Q | Invalid |
|
|
15
|
-
|
|
16
|
-
## Boolean Algebra (Boole, 1854)
|
|
17
|
-
|
|
18
|
-
George Boole, in *An Investigation of the Laws of Thought* (1854), established an algebraic system for propositional logic, transforming logical reasoning into algebraic computation:
|
|
19
|
-
|
|
20
|
-
> "Logic is a species of algebra whose variables take only the values 0 and 1."
|
|
21
|
-
|
|
22
|
-
The core operations of Boolean algebra — ∧ (multiplication), ∨ (addition), ¬ (complement) — satisfy algebraic properties such as distributivity and De Morgan's laws. This is the algebraic dual of propositional logic: the same inferential structure can be handled either deductively or computationally. Boolean algebra later became the mathematical foundation of digital circuit design (Shannon, 1938) and computer science.
|
|
23
|
-
|
|
24
|
-
## Frege's *Begriffsschrift* (1879)
|
|
25
|
-
|
|
26
|
-
Frege invented the first complete formal system of first-order logic, introducing quantifiers (∀, ∃) and function symbols, demonstrating that logical reasoning can be fully mechanized. This is the starting point of modern mathematical logic — henceforth, mathematical proofs had precise syntactic rules rather than relying solely on intuitive narration.
|
|
27
|
-
|
|
28
|
-
> "Can arithmetical truths be proved purely logically? The Begriffsschrift provides the instrument for this."
|
|
29
|
-
|
|
30
|
-
## Peano Axioms (1889)
|
|
31
|
-
|
|
32
|
-
Constructing the natural number system from logic:
|
|
33
|
-
|
|
34
|
-
> 1. 0 is a natural number.
|
|
35
|
-
> 2. Every natural number n has a successor S(n).
|
|
36
|
-
> 3. 0 is not the successor of any natural number.
|
|
37
|
-
> 4. Different natural numbers have different successors.
|
|
38
|
-
> 5. (Induction Axiom) If a property holds for 0, and if it holds for n then it also holds for S(n), then the property holds for all natural numbers.
|
|
39
|
-
|
|
40
|
-
This demonstrates how to construct a complete mathematical system from a minimal set of logical assumptions. The Peano axioms are a paradigm of first-order theories — a single second-order induction axiom (or a first-order induction schema) suffices to characterize the entire structure of the natural numbers.
|
|
41
|
-
|
|
42
|
-
## Russell's Paradox (1901)
|
|
43
|
-
|
|
44
|
-
> "Consider the set R of all sets that do not contain themselves: does R contain R?"
|
|
45
|
-
|
|
46
|
-
If R ∈ R, then by definition R ∉ R; if R ∉ R, then by definition R ∈ R. The contradiction is irresolvable. This paradox directly demolished Frege's naive set theory (Frege acknowledged the fundamental flaw in his system upon receiving Russell's letter), triggering the "third crisis" of the foundations of mathematics. It gave rise to:
|
|
47
|
-
|
|
48
|
-
- **ZFC Set Theory** (Zermelo-Fraenkel + Choice): Eliminates the paradox by restricting set construction rules (the Separation schema rather than unrestricted Comprehension)
|
|
49
|
-
- **Type Theory** (Russell, 1908): Prohibits self-reference through a hierarchy of types
|
|
50
|
-
- **Intuitionism** (Brouwer): Rejects treating infinite sets as completed objects
|
|
51
|
-
|
|
52
|
-
Russell's paradox profoundly reveals that the consistency of a logical system cannot be taken for granted — it must be proved or constructively guaranteed.
|
|
53
|
-
|
|
54
|
-
## ZFC as Background Logic for Mathematics
|
|
55
|
-
|
|
56
|
-
Zermelo-Fraenkel set theory with the Axiom of Choice (ZFC) is the default foundational language of contemporary mathematics — virtually all mathematical objects (numbers, functions, spaces, groups) can be defined as sets within ZFC, and all mathematical theorems can (in principle) be translated into formal proofs in ZFC.
|
|
57
|
-
|
|
58
|
-
> "Mathematicians do not write ZFC proofs in daily work, but they presuppose that all proofs can in principle be formalized in ZFC."
|
|
59
|
-
|
|
60
|
-
ZFC's nine axioms (Extensionality, Empty Set, Pairing, Union, Power Set, Infinity, Separation, Replacement, Choice) carefully circumvent Russell's paradox while preserving sufficient constructive power. The Axiom of Choice (AC) has provoked ongoing controversy — it permits non-constructive selections (as in Zorn's Lemma and the Well-Ordering Theorem), revealing its cost in counterintuitive results such as the Banach-Tarski decomposition.
|
|
61
|
-
|
|
62
|
-
## First-Order vs Higher-Order Logic
|
|
63
|
-
|
|
64
|
-
**First-Order Logic (FOL)**: Quantifiers range only over individuals (∀x, ∃x), not over predicates or functions. This is the "standard language" of mathematical logic, possessing completeness (Gödel 1929) and compactness.
|
|
65
|
-
|
|
66
|
-
**Higher-Order Logic (HOL)**: Allows quantification over predicates (∀P) and functions (∀f), offering greater expressive power at a steep cost — higher-order logic is **incomplete** (no recursively enumerable proof system can capture all valid inferences) and non-compact.
|
|
67
|
-
|
|
68
|
-
> "First-order logic is complete but limited in expressive power; higher-order logic is expressive but incomplete. This is a fundamental trade-off."
|
|
69
|
-
|
|
70
|
-
Peano Arithmetic (PA) is a first-order theory whose induction axiom is encoded as infinitely many first-order axiom schemas; the genuine Peano axioms (with second-order induction) uniquely characterize ℕ, but first-order PA has non-standard models. This connects directly to the Löwenheim-Skolem theorem.
|
|
71
|
-
|
|
72
|
-
## Gödel: Completeness (1929) vs Incompleteness (1931)
|
|
73
|
-
|
|
74
|
-
**Completeness Theorem (1929)**: The deductive system of first-order logic is complete — every logically valid formula can be formally proved.
|
|
75
|
-
|
|
76
|
-
> "In first-order logic, all logically valid formulas can be proved from the axioms through formal inference."
|
|
77
|
-
|
|
78
|
-
**Incompleteness Theorem (1931)**: Any consistent formal system that includes basic arithmetic contains undecidable propositions — neither provable nor refutable.
|
|
79
|
-
|
|
80
|
-
> "In any sufficiently strong consistent formal system T, there exists a sentence G such that T ⊬ G and T ⊬ ¬G."
|
|
81
|
-
|
|
82
|
-
The crucial distinction: the Completeness Theorem states that the **logical system itself** does not miss any valid inference; the Incompleteness Theorem states that **arithmetic theory** cannot exhaust all truths. The two are not contradictory — completeness guarantees "the inference rules are sufficient," while incompleteness reveals "arithmetical truth transcends any fixed set of axioms."
|
|
83
|
-
|
|
84
|
-
## Löwenheim-Skolem Theorem (1920, 1922)
|
|
85
|
-
|
|
86
|
-
> "If a first-order theory T has an infinite model, then T has a model of every infinite cardinality κ ≥ ℵ₀."
|
|
87
|
-
|
|
88
|
-
Downward Löwenheim-Skolem: T must have a countable model. Upward Löwenheim-Skolem: T must have models of arbitrarily large cardinality.
|
|
89
|
-
|
|
90
|
-
A startling corollary: a first-order theory **cannot control the cardinality of its models**. Even though ZFC aims to describe an uncountable universe of sets, ZFC itself has countable models (the Skolem paradox). This reveals a fundamental limitation of first-order logic's expressive power — first-order sentences cannot distinguish the "internal" and "external" perspectives on "countable" versus "uncountable."
|
|
91
|
-
|
|
92
|
-
## Tarski's Semantic Theory of Truth (1933)
|
|
93
|
-
|
|
94
|
-
> "'Snow is white' is true if and only if snow is white."
|
|
95
|
-
|
|
96
|
-
Tarski provided a formal definition of truth (the T-schema), illuminating the distinction between "truth" and "provability" in logic — "truth" is a semantic concept (dependent on models), while "provability" is a syntactic concept (dependent on proof systems). The Completeness Theorem bridges the two (in FOL, T ⊢ φ ⇔ T ⊨ φ), but in strong theories such as arithmetic they are permanently separated (Gödel's incompleteness).
|
|
97
|
-
|
|
98
|
-
Tarski also proved that a sufficiently expressive language **cannot consistently define truth within itself** — a truth definition must employ a stronger metalanguage. This, together with Russell's paradox and Gödel's incompleteness, forms a triad of impossibility results concerning self-reference.
|
|
99
|
-
|
|
100
|
-
## Gentzen's Natural Deduction and Sequent Calculus (1935)
|
|
101
|
-
|
|
102
|
-
Gerhard Gentzen, in *Investigations into Logical Deduction*, invented two entirely new proof structures:
|
|
103
|
-
|
|
104
|
-
**Natural Deduction**: Inference rules are organized around the introduction (I) and elimination (E) of each logical connective — ∧I, ∧E, →I, →E, ∀I, ∀E, etc. This captures the way mathematicians actually reason: assume a premise, derive a conclusion, then discharge the assumption (→I, i.e., conditional proof).
|
|
105
|
-
|
|
106
|
-
**Sequent Calculus**: The objects of proof are sequents Γ ⊢ Δ (assumptions on the left, conclusions on the right), and rules operate between sequents. The key breakthrough: the **Cut-Elimination Theorem** (Hauptsatz) — any proof using the Cut rule can be transformed into a cut-free proof.
|
|
107
|
-
|
|
108
|
-
> "The Hauptsatz states that all proofs can be transformed into cut-free proofs, eliminating all 'intermediate formulas'."
|
|
109
|
-
|
|
110
|
-
Cut-elimination is the central tool of proof theory: it guarantees the subformula property (every step of a cut-free proof involves only subformulas of the final conclusion), making consistency and decidability proofs possible. Gentzen's work shifted logic from an "axiomatic" to a "structural" paradigm, founding the discipline of Proof Theory.
|
|
111
|
-
|
|
112
|
-
## Turing's Halting Problem (1936)
|
|
113
|
-
|
|
114
|
-
Alan Turing, in *On Computable Numbers*, defined the Turing machine and proved:
|
|
115
|
-
|
|
116
|
-
> "There is no general algorithm that can decide whether an arbitrary Turing machine halts on an arbitrary input."
|
|
117
|
-
|
|
118
|
-
The undecidability of the halting problem is a fundamental limitation on computation and logic. Its logical essence is equivalent to Gödel's incompleteness: if the halting problem were decidable, arithmetic incompleteness could be circumvented; if arithmetic were complete, the halting problem would be decidable. The two are duals — two faces of the same wall.
|
|
119
|
-
|
|
120
|
-
A direct corollary of the halting problem: the **Entscheidungsproblem** for first-order logic is also undecidable (Church, 1936; Turing, 1936) — there is no general algorithm that can decide whether an arbitrary first-order formula is logically valid. Logical deduction can be executed, but it cannot be mechanically and fully predicted.
|
|
121
|
-
|
|
122
|
-
## Resolution and Unification (Robinson, 1965)
|
|
123
|
-
|
|
124
|
-
J. A. Robinson, in *A Machine-Oriented Logic Based on the Resolution Principle*, introduced the resolution rule:
|
|
125
|
-
|
|
126
|
-
> "Resolve P ∨ Q and ¬P ∨ R to obtain Q ∨ R."
|
|
127
|
-
|
|
128
|
-
Resolution compresses all inference into a single rule combined with the Unification algorithm — automatically finding an algebraic substitution σ that makes two terms equal, so that σ(P) = σ(P'), thereby enabling resolution on complementary literals.
|
|
129
|
-
|
|
130
|
-
Resolution-unification is the mathematical core of Automated Theorem Proving and Logic Programming (e.g., Prolog). It demonstrates that proof search in first-order logic can be unified into a single algorithmic process, although efficiency issues (search space explosion) remain a severe practical challenge.
|
|
131
|
-
|
|
132
|
-
## Curry-Howard Correspondence (1969)
|
|
133
|
-
|
|
134
|
-
> "Propositions as types, proofs as programs."
|
|
135
|
-
|
|
136
|
-
Curry (1958) first observed the correspondence between types in combinatory logic and formulas in propositional logic; Howard (1969) extended it to constructive predicate logic:
|
|
137
|
-
|
|
138
|
-
| Logic Concept | Type Theory / Programming Concept |
|
|
139
|
-
|---------------|-----------------------------------|
|
|
140
|
-
| Proposition A | Type A |
|
|
141
|
-
| A ∧ B | A × B (product type) |
|
|
142
|
-
| A ∨ B | A + B (sum type) |
|
|
143
|
-
| A → B | A → B (function type) |
|
|
144
|
-
| ∀x. P(x) | Πx:A. P(x) (dependent function type) |
|
|
145
|
-
| ∃x. P(x) | Σx:A. P(x) (dependent pair type) |
|
|
146
|
-
| Constructive proof | Executable program |
|
|
147
|
-
|
|
148
|
-
The Curry-Howard correspondence reveals a deep isomorphism between logical deduction and computation: a constructive proof is a program, and the execution of the program is proof normalization. This is the computational counterpart of Gentzen's cut-elimination — β-reduction is cut-elimination.
|
|
149
|
-
|
|
150
|
-
This correspondence became the theoretical foundation of type theory (Martin-Löf, 1972), dependently typed programming (Coq, Agda), and Homotopy Type Theory (HoTT, 2013), unifying "proof correctness" and "program correctness" into a single problem.
|
|
151
|
-
|
|
152
|
-
## Formalization of Common Logical Fallacies
|
|
153
|
-
|
|
154
|
-
| Fallacy Name | Form | Counterexample |
|
|
155
|
-
|--------------|------|----------------|
|
|
156
|
-
| Affirming the Consequent | P → Q, Q ∴ P | "If it rains, the ground is wet; the ground is wet, therefore it rained" (could be a sprinkler) |
|
|
157
|
-
| Denying the Antecedent | P → Q, ¬P ∴ ¬Q | "If it rains, the ground is wet; it did not rain, therefore the ground is not wet" (could be a sprinkler) |
|
|
158
|
-
| Begging the Question (Circular Reasoning) | P ∴ P | "This book tells the truth because the book says so" |
|
|
159
|
-
| Straw Man | Attacking P' ≠ P | A: "We should increase the education budget." B: "You want to give all the money to schools." |
|
|
160
|
-
| Slippery Slope | A → B → ... → Z, ∴ ¬A | "Allow this → that → disaster, therefore we must not allow it." |
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
# 数学出处与经典文献 / Mathematical Sources and Classic Texts
|
|
2
|
-
|
|
3
|
-
## 命题逻辑 / Propositional Logic
|
|
4
|
-
|
|
5
|
-
**基本推理规则**:
|
|
6
|
-
|
|
7
|
-
| 规则名 | 形式 | 有效性 |
|
|
8
|
-
|--------|------|--------|
|
|
9
|
-
| 假言推理 (Modus Ponens) | P → Q, P ⊢ Q | ✅ 有效 |
|
|
10
|
-
| 拒取式 (Modus Tollens) | P → Q, ¬Q ⊢ ¬P | ✅ 有效 |
|
|
11
|
-
| 假言三段论 | P → Q, Q → R ⊢ P → R | ✅ 有效 |
|
|
12
|
-
| 析取三段论 | P ∨ Q, ¬P ⊢ Q | ✅ 有效 |
|
|
13
|
-
| 肯定后件 | P → Q, Q ⊢ P | ❌ 无效 |
|
|
14
|
-
| 否定前件 | P → Q, ¬P ⊢ ¬Q | ❌ 无效 |
|
|
15
|
-
|
|
16
|
-
## Boole 布尔代数 / Boolean Algebra (1854)
|
|
17
|
-
|
|
18
|
-
George Boole 在 *An Investigation of the Laws of Thought* (1854) 中建立了命题逻辑的代数化系统,将逻辑推理转化为代数运算:
|
|
19
|
-
|
|
20
|
-
> "逻辑是代数的一种,其变量仅取 0 与 1 两个值。"
|
|
21
|
-
> "Logic is a species of algebra whose variables take only the values 0 and 1."
|
|
22
|
-
|
|
23
|
-
布尔代数的核心运算:∧ (乘法), ∨ (加法), ¬ (补), 满足分配律、德摩根律等代数性质。这是命题逻辑的代数对偶——同一推理结构既可用演绎方式也可用计算方式处理。布尔代数后来成为数字电路设计(Shannon, 1938)与计算机科学的数学基础。
|
|
24
|
-
|
|
25
|
-
## Frege《概念文字》/ Frege's *Begriffsschrift* (1879)
|
|
26
|
-
|
|
27
|
-
Frege 发明了第一个完整的一阶逻辑形式系统,引入量词 (∀, ∃) 和函数符号,展示了逻辑推理可以被完全机械化。这是现代数理逻辑的起点——从此,数学证明有了精确的语法规则,而非仅靠直觉叙述。
|
|
28
|
-
|
|
29
|
-
> "算术真理能否被纯逻辑地证明?概念文字为此提供了工具。"
|
|
30
|
-
> "Can arithmetical truths be proved purely logically? The Begriffsschrift provides the instrument for this."
|
|
31
|
-
|
|
32
|
-
## Peano 公理 / Peano Axioms (1889)
|
|
33
|
-
|
|
34
|
-
从逻辑出发构建自然数体系:
|
|
35
|
-
|
|
36
|
-
> 1. 0 是一个自然数。
|
|
37
|
-
> 2. 每个自然数 n 有一个后继 S(n)。
|
|
38
|
-
> 3. 0 不是任何自然数的后继。
|
|
39
|
-
> 4. 不同的自然数有不同的后继。
|
|
40
|
-
> 5. (归纳公理)如果一个性质对 0 成立,且对 n 成立则对 S(n) 也成立,则该性质对所有自然数成立。
|
|
41
|
-
|
|
42
|
-
这展示了如何从最少量的逻辑假设出发构建一个完整的数学体系。Peano 公理是一阶理论的典范——仅用一条二阶归纳公理(或一阶归纳公理模式)即可刻画自然数的全部结构。
|
|
43
|
-
|
|
44
|
-
## Russell 悖论 / Russell's Paradox (1901)
|
|
45
|
-
|
|
46
|
-
> "考虑所有不包含自身的集合所组成的集合 R:R 是否包含 R?"
|
|
47
|
-
> "Consider the set R of all sets that do not contain themselves: does R contain R?"
|
|
48
|
-
|
|
49
|
-
若 R ∈ R,则按定义 R ∉ R;若 R ∉ R,则按定义 R ∈ R。矛盾不可消解。此悖论直接摧毁了 Frege 的朴素集合论(Frege 在收到 Russell 信后承认其系统存在根本缺陷),引发了数学基础的"第三次危机"。由此催生了:
|
|
50
|
-
|
|
51
|
-
- **ZFC 集合论** (Zermelo-Fraenkel + Choice):通过限制集合构造规则(分离公理模式而非概括公理)排除悖论
|
|
52
|
-
- **类型论** (Russell, 1908):通过类型层级禁止自指
|
|
53
|
-
- **直觉主义** (Brouwer):拒绝将无穷集视为已完成对象
|
|
54
|
-
|
|
55
|
-
Russell 悖论深刻揭示:逻辑系统的一致性不能被默认,必须被证明或被构造性地保证。
|
|
56
|
-
|
|
57
|
-
## ZFC 集合论 / ZFC as Background Logic for Mathematics
|
|
58
|
-
|
|
59
|
-
Zermelo-Fraenkel 集合论加选择公理 (ZFC) 是当代数学的默认基础语言——几乎所有数学对象(数、函数、空间、群)都可以在 ZFC 中被定义为集合,所有数学定理都可以(原则上)被翻译为 ZFC 中的形式证明。
|
|
60
|
-
|
|
61
|
-
> "数学家在日常工作中不写 ZFC 证明,但他们默认所有证明都可以在 ZFC 中被形式化。"
|
|
62
|
-
> "Mathematicians do not write ZFC proofs in daily work, but they presuppose that all proofs can in principle be formalized in ZFC."
|
|
63
|
-
|
|
64
|
-
ZFC 的九条公理(外延、空集、配对、并集、幂集、无穷、分离、替换、选择)精心规避了 Russell 悖论,同时保留了足够强的构造能力。选择公理 (AC) 引发了持续争议——它允许非构造性选择(如 Zorn 引理、良序定理),在 Banach-Tarski 分球等反直觉结果中显露其代价。
|
|
65
|
-
|
|
66
|
-
## 一阶逻辑 vs 高阶逻辑 / First-Order vs Higher-Order Logic
|
|
67
|
-
|
|
68
|
-
**一阶逻辑 (FOL)**:量词仅作用于个体 (∀x, ∃x),不允许量化谓词或函数。这是数理逻辑的"标准语言",拥有完备性(Gödel 1929)和紧致性。
|
|
69
|
-
|
|
70
|
-
**高阶逻辑 (HOL)**:允许量化谓词 (∀P) 和函数 (∀f),表达力更强但代价沉重——高阶逻辑**不完备**(无递归可枚举的证明系统能覆盖所有有效推理),且不可紧致。
|
|
71
|
-
|
|
72
|
-
> "一阶逻辑是完备的但表达力受限;高阶逻辑表达力强但不可完备。这是一个根本性的权衡。"
|
|
73
|
-
> "First-order logic is complete but limited in expressive power; higher-order logic is expressive but incomplete. This is a fundamental trade-off."
|
|
74
|
-
|
|
75
|
-
Peano 算术 (PA) 是一阶理论,其归纳公理被编码为无穷多条一阶公理模式;真正的 Peano 公理(二阶归纳)唯一刻画 ℕ,但一阶 PA 有非标准模型。这直接联系到 Löwenheim-Skolem 定理。
|
|
76
|
-
|
|
77
|
-
## Gödel 完备性 vs 不完备性 / Completeness (1929) vs Incompleteness (1931)
|
|
78
|
-
|
|
79
|
-
**完备性定理 (1929)**:一阶逻辑的演绎系统是完备的——每个逻辑上有效的公式都可被形式证明。
|
|
80
|
-
|
|
81
|
-
> "一阶逻辑中,所有逻辑上有效的公式都可以从公理出发通过形式推理得到证明。"
|
|
82
|
-
> "In first-order logic, all logically valid formulas can be proved from the axioms through formal inference."
|
|
83
|
-
|
|
84
|
-
**不完备性定理 (1931)**:任何包含基本算术的一致形式系统都存在不可判定命题——既不可证也不可否证。
|
|
85
|
-
|
|
86
|
-
> "任何足够强的一致形式系统 T 中,存在语句 G 使得 T ⊬ G 且 T ⊬ ¬G。"
|
|
87
|
-
> "In any sufficiently strong consistent formal system T, there exists a sentence G such that T ⊬ G and T ⊬ ¬G."
|
|
88
|
-
|
|
89
|
-
关键区别:完备性定理说的是**逻辑系统本身**不遗漏有效推理;不完备性定理说的是**算术理论**无法穷尽所有真理。二者不矛盾——完备性保证"推理规则够用",不完备性揭示"算术真理超出任何固定公理集"。
|
|
90
|
-
|
|
91
|
-
## Löwenheim-Skolem 定理 / Löwenheim-Skolem Theorem (1920, 1922)
|
|
92
|
-
|
|
93
|
-
> "若一阶理论 T 有无穷模型,则 T 对每个无穷基数 κ ≥ ℵ₀ 都有模型。"
|
|
94
|
-
> "If a first-order theory T has an infinite model, then T has a model of every infinite cardinality κ ≥ ℵ₀."
|
|
95
|
-
|
|
96
|
-
下 Löwenheim-Skolem:T 必有可数模型。上 Löwenheim-Skolem:T 必有任意大基数模型。
|
|
97
|
-
|
|
98
|
-
震撼性推论:一阶理论**无法控制其模型的基数**。即使 ZFC 旨在描述一个不可数集合宇宙,ZFC 本身也有可数模型(Skolem 悖论)。这揭示了一阶逻辑的表达力根本性限制——一阶语句无法区分"可数"与"不可数"的内部视角与外部视角。
|
|
99
|
-
|
|
100
|
-
## Tarski 真理的语义理论 / Tarski's Semantic Theory of Truth (1933)
|
|
101
|
-
|
|
102
|
-
> "'雪是白的'为真,当且仅当雪是白的。"
|
|
103
|
-
> "'Snow is white' is true if and only if snow is white."
|
|
104
|
-
|
|
105
|
-
Tarski 给出了真理的形式定义 (T-schema),展示了逻辑中"真"与"可证"的区别——"真"是语义概念(取决于模型),"可证"是语法概念(取决于证明系统)。完备性定理连接二者(在 FOL 中 T ⊢ φ ⇔ T ⊨ φ),但在算术等强理论中二者永久分离(Gödel 不完备性)。
|
|
106
|
-
|
|
107
|
-
Tarski 还证明了:足够强的语言**不可能在自身内部一致地定义真理**——真理定义必须使用更强的元语言。这与 Russell 悖论和 Gödel 不完备性形成三重不可自指限制。
|
|
108
|
-
|
|
109
|
-
## Gentzen 自然演绎与相继演算 / Gentzen's Natural Deduction and Sequent Calculus (1935)
|
|
110
|
-
|
|
111
|
-
Gerhard Gentzen 在 *Investigations into Logical Deduction* 中发明了两种全新的证明结构:
|
|
112
|
-
|
|
113
|
-
**自然演绎 (Natural Deduction)**:推理规则围绕引入 (I) 和消除 (E) 每个逻辑联结词组织——∧I, ∧E, →I, →E, ∀I, ∀E 等。这捕捉了数学家的实际推理方式:假设一个前提,推导结论,然后取消假设(→I 即条件证明)。
|
|
114
|
-
|
|
115
|
-
**相继演算 (Sequent Calculus)**:证明的对象是相继式 Γ ⊢ Δ(左边假设,右边结论),规则在相继式之间操作。关键突破:**切割消除定理** (Hauptsatz)——任何使用切割规则 (Cut) 的证明都可以被转化为无切割证明。
|
|
116
|
-
|
|
117
|
-
> "主定理 (Hauptsatz) 表明:所有证明都可以被转化为无切割的证明,即消除一切'中间公式'。"
|
|
118
|
-
> "The Hauptsatz states that all proofs can be transformed into cut-free proofs, eliminating all 'intermediate formulas'."
|
|
119
|
-
|
|
120
|
-
切割消除是证明论的核心工具:它保证了子公式性质(无切割证明的每一步只涉及最终结论的子公式),使得一致性和可判定性证明成为可能。Gentzen 的工作将逻辑从"公理化"转向"结构化",开创了证明论 (Proof Theory) 这一学科。
|
|
121
|
-
|
|
122
|
-
## Turing 停机问题 / Turing's Halting Problem (1936)
|
|
123
|
-
|
|
124
|
-
Alan Turing 在 *On Computable Numbers* 中定义了 Turing 机,并证明了:
|
|
125
|
-
|
|
126
|
-
> "不存在通用算法能判定任意 Turing 机是否在任意输入上停机。"
|
|
127
|
-
> "There is no general algorithm that can decide whether an arbitrary Turing machine halts on an arbitrary input."
|
|
128
|
-
|
|
129
|
-
停机问题的不可判定性是计算与逻辑的根本性限制。它的逻辑本质与 Gödel 不完备性等价:若停机可判定,则算术不完备性可被绕过;若算术完备,则停机可被判定。二者互为对偶——同一堵墙的两个面。
|
|
130
|
-
|
|
131
|
-
停机问题的直接推论:一阶逻辑的**有效性判定问题** (Entscheidungsproblem) 也是不可判定的(Church, 1936; Turing, 1936)——不存在通用算法能判定任意一阶公式是否逻辑有效。逻辑演绎可以被执行,但不可被机械地全面预判。
|
|
132
|
-
|
|
133
|
-
## Robinson 消解与合一 / Resolution and Unification (1965)
|
|
134
|
-
|
|
135
|
-
J. A. Robinson 在 *A Machine-Oriented Logic Based on the Resolution Principle* 中引入了消解规则:
|
|
136
|
-
|
|
137
|
-
> "从 P ∨ Q 和 ¬P ∨ R 消解得到 Q ∨ R。"
|
|
138
|
-
> "Resolve P ∨ Q and ¬P ∨ R to obtain Q ∨ R."
|
|
139
|
-
|
|
140
|
-
消解将所有推理压缩为一条规则加上合一算法 (Unification)——自动寻找使两个项相等的代数替换 σ,使得 σ(P) = σ(P'),从而对互补文字执行消解。
|
|
141
|
-
|
|
142
|
-
消解-合一是自动定理证明 (Automated Theorem Proving) 和逻辑编程 (Logic Programming, e.g. Prolog) 的数学核心。它证明了:一阶逻辑的证明搜索可以被统一为一个算法过程,尽管效率问题(搜索空间爆炸)在实践中仍然严峻。
|
|
143
|
-
|
|
144
|
-
## Curry-Howard 对应 / Curry-Howard Correspondence (1969)
|
|
145
|
-
|
|
146
|
-
> "命题即类型,证明即程序。"
|
|
147
|
-
> "Propositions as types, proofs as programs."
|
|
148
|
-
|
|
149
|
-
Curry (1958) 首先观察到组合逻辑的类型与命题逻辑的公式之间的对应;Howard (1969) 将其扩展到构造性谓词逻辑:
|
|
150
|
-
|
|
151
|
-
| 逻辑概念 | 类型论/编程概念 |
|
|
152
|
-
|----------|----------------|
|
|
153
|
-
| 命题 A | 类型 A |
|
|
154
|
-
| A ∧ B | A × B (积类型) |
|
|
155
|
-
| A ∨ B | A + B (和类型) |
|
|
156
|
-
| A → B | A → B (函数类型) |
|
|
157
|
-
| ∀x. P(x) | Πx:A. P(x) (依赖函数类型) |
|
|
158
|
-
| ∃x. P(x) | Σx:A. P(x) (依赖对类型) |
|
|
159
|
-
| 构造性证明 | 可执行程序 |
|
|
160
|
-
|
|
161
|
-
Curry-Howard 对应揭示了逻辑演绎与计算之间的深层同构:一个构造性证明就是一个程序,程序的执行就是证明的归约 (proof normalization)。这是 Gentzen 切割消除在计算层面的对应——β-归约就是切割消除。
|
|
162
|
-
|
|
163
|
-
此对应成为类型论 (Martin-Löf, 1972)、依赖类型编程 (Coq, Agda) 和同伦类型论 (HoTT, 2013) 的理论基础,将"证明正确性"与"程序正确性"统一为同一问题。
|
|
164
|
-
|
|
165
|
-
## 常见逻辑谬误的形式化
|
|
166
|
-
|
|
167
|
-
| 谬误名 | 形式 | 反例 |
|
|
168
|
-
|--------|------|------|
|
|
169
|
-
| 肯定后件 | P → Q, Q ∴ P | "如果下雨则地湿,地湿,所以下雨了"(可能是洒水车) |
|
|
170
|
-
| 否定前件 | P → Q, ¬P ∴ ¬Q | "如果下雨则地湿,没下雨,所以地不湿"(可能是洒水车) |
|
|
171
|
-
| 循环论证 | P ∴ P | "这本书说的是真话,因为书上这么写的" |
|
|
172
|
-
| 稻草人 | 攻击 P' ≠ P | A: "应该增加教育预算" B: "你想把所有钱都给学校" |
|
|
173
|
-
| 滑坡 | A → B → ... → Z, ∴ ¬A | "允许这个→那个→灾难,所以不能允许" |
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: modeling
|
|
3
|
-
description: |
|
|
4
|
-
Trigger when translating real-world problems into mathematics (reality->math->interpretation), building predictive/explanatory models, performing dimensional analysis and model selection, or establishing computable models for algorithms/operators/structures.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Modeling
|
|
8
|
-
|
|
9
|
-
> "Transforming real-world problems into mathematical problems, solving them mathematically to explain and predict reality. All models are wrong, but some are useful."
|
|
10
|
-
>
|
|
11
|
-
> -- Applied Mathematics, Mathematical Modeling
|
|
12
|
-
|
|
13
|
-
## Core Principle
|
|
14
|
-
|
|
15
|
-
**A model is a simplified representation of reality, not reality itself. A good model is not one that is "true," but one that makes accurate predictions within its domain of applicability.**
|
|
16
|
-
|
|
17
|
-
The golden cycle of modeling: (1) **Real-world problem -> Mathematical problem** (translation); (2) **Mathematical problem -> Mathematical solution** (solving); (3) **Mathematical solution -> Real-world interpretation** (back-translation); (4) **Real-world interpretation -> Experimental validation** (verification).
|
|
18
|
-
|
|
19
|
-
> **Mathematical Formalization**
|
|
20
|
-
>
|
|
21
|
-
> **Dimensional Analysis & Buckingham Pi Theorem**: Before constructing equations, one must verify dimensional consistency. If a system involves $n$ physical quantities spanning $m$ fundamental dimensions, one can construct $k=n-m$ dimensionless Pi terms, thereby reducing the number of variables and simplifying the equations; dimensionally inconsistent equations are physically inadmissible.
|
|
22
|
-
>
|
|
23
|
-
> **Model Specification**: Let the system output be $y$, with inputs $x_1,\dots,x_p$, and model $y=f(x_1,\dots,x_p;\theta)+\varepsilon$, where $f$ is the model function, $\theta$ is the parameter vector, and $\varepsilon$ is the error term. Model selection amounts to choosing the bias-variance-optimal $f$ from a candidate set $\{f_1,f_2,\dots\}$.
|
|
24
|
-
|
|
25
|
-
## GPU-Friendliness (Cross-Cutting Check)
|
|
26
|
-
|
|
27
|
-
When a model is used for **algorithm/operator/training design**, model selection and parameterization directly determine GPU viability -- pass the eight-dimensional gate in `../../references/gpu-friendly-math.md`:
|
|
28
|
-
|
|
29
|
-
- **Linear / GEMM-compatible parameterization**: $y=f(x;\theta)$ where $f$ can be expressed as dense tensor algebra or a chain of matrix multiplications (linear regression, MLP) -- friendly, fully utilizes Tensor Cores.
|
|
30
|
-
- **Low-rank parameterization**: $\theta$ uses low-rank / block structure instead of dense representation -- memory-friendly, compressible (see `../../references/books/matrix-analysis.md`).
|
|
31
|
-
- **Operator splitting / block parallelism**: PDE/ODE models decomposed by spatial/temporal blocks, serial recurrence converted to parallel scan -- amenable to adaptation.
|
|
32
|
-
- **Anti-patterns**: Model requires $O(n^2)$ dense global operations (naive full attention), data-dependent branching / scalar loops, ill-conditioned numerics requiring fp64, non-differentiable operations requiring discrete search -- "beautiful but incomputable"; switch to a tensorizable, fusible, numerically stable equivalent parameterization.
|
|
33
|
-
|
|
34
|
-
Eight-dimensional minimum assessment (formal terms): **Tensorization** -- whether model equations can be evaluated in batch; **GEMM-mappability** -- whether the parameterization can be expressed as matrix multiplication / convolution / low-rank factors; **Complexity** -- growth of state dimension, time steps, interaction terms; **Memory & KV-Cache** -- whether hidden states, activations, and caches can be compressed; **Low-precision stability** -- whether equations are ill-conditioned or require fp64; **Parallelism & communication** -- whether the dynamical system can be decomposed into blocks / scans; **Sparse structure** -- whether the coupling graph is structured; **Operator fusion** -- whether model updates and loss computation can be fused.
|
|
35
|
-
|
|
36
|
-
> Cross-reference `../../references/books/optimization-ml.md` (model parameterization and training), `matrix-analysis.md` (low-rank, condition number, compression).
|
|
37
|
-
|
|
38
|
-
## When NOT to Use
|
|
39
|
-
|
|
40
|
-
- **The problem cannot be quantified or structured** -- modeling requires well-defined variables and relationships.
|
|
41
|
-
- **Only qualitative understanding is needed** (e.g., "roughly how does this phenomenon work") -- modeling would be overly precise.
|
|
42
|
-
- **Fundamental data is lacking** -- a model without data is merely conjecture.
|
|
43
|
-
|
|
44
|
-
## When to Use
|
|
45
|
-
|
|
46
|
-
- When a real-world problem needs to be precisely formulated in mathematical language (reality -> math -> interpretation).
|
|
47
|
-
- Building predictive / explanatory models to interpret experimental data or predict new phenomena.
|
|
48
|
-
- Understanding interactions and sensitivities among factors in complex systems.
|
|
49
|
-
- Performing dimensional analysis, model selection (AIC/BIC/CV), and sensitivity analysis.
|
|
50
|
-
- **Establishing computable models for algorithms/operators/structures** and evaluating the GPU viability of their parameterizations.
|
|
51
|
-
|
|
52
|
-
## Method
|
|
53
|
-
|
|
54
|
-
### Step 1: Define the Real-World Problem
|
|
55
|
-
Describe the problem to be solved in the clearest possible language. Key questions: What are the **inputs** of the system? What are the **outputs**? Is the goal prediction, explanation, or optimization? Without clear direction, modeling goes astray.
|
|
56
|
-
|
|
57
|
-
### Step 2: State Assumptions
|
|
58
|
-
This is the most critical and most perilous step in modeling. All models require simplification, but one must **explicitly document every assumption**: Which factors are important and which can be neglected? Is the system deterministic or stochastic? Static or dynamic? Are variable relationships linear or nonlinear? Every assumption must be justified.
|
|
59
|
-
|
|
60
|
-
### Step 3: Establish Mathematical Structure / Dimensional Analysis
|
|
61
|
-
Choose a mathematical framework based on the assumptions:
|
|
62
|
-
|
|
63
|
-
| Phenomenon Characteristics | Mathematical Framework |
|
|
64
|
-
|---|---|
|
|
65
|
-
| Causal relationships among variables | ODE/PDE (ordinary/partial differential equations) |
|
|
66
|
-
| Spatial distribution and propagation | Partial differential equations (heat conduction, wave, diffusion) |
|
|
67
|
-
| Relationships among discrete objects | Graph theory |
|
|
68
|
-
| Decision-making under uncertainty | Probabilistic models |
|
|
69
|
-
| Resource allocation | Optimization models |
|
|
70
|
-
| Population behavior and interactions | Statistical models / Markov chains / Agent-based models |
|
|
71
|
-
| Classification and prediction | Function approximation / Regression |
|
|
72
|
-
|
|
73
|
-
Before constructing equations, one must verify dimensional consistency and construct $k=n-m$ dimensionless Pi terms to reduce variables and simplify equations; dimensionally inconsistent equations are physically inadmissible.
|
|
74
|
-
|
|
75
|
-
### Step 4: Solve
|
|
76
|
-
Solve the model using mathematical methods: **analytical solutions** (exact but possibly nonexistent), **numerical solutions** (approximate but always obtainable), **qualitative analysis** (seeking properties such as stability and monotonicity rather than explicit solutions).
|
|
77
|
-
|
|
78
|
-
### Step 5: Interpret and Validate
|
|
79
|
-
Translate the mathematical solution back into real-world language; compare with existing data or experimental results; perform sanity checks to verify whether predictions are reasonable. Conclusions inconsistent with reality are invalid no matter how "elegant" they may be.
|
|
80
|
-
|
|
81
|
-
### Step 6: Sensitivity Analysis and Model Selection
|
|
82
|
-
**Sensitivity analysis**: If a small perturbation in a parameter causes a large change in output, that parameter is sensitive and its precision must be carefully controlled.
|
|
83
|
-
**Bias-variance trade-off**: Simple models have high bias and low variance (underfitting); complex models have low bias and high variance (overfitting); the optimal model strikes a balance between the two.
|
|
84
|
-
**Model selection criteria**: AIC $= -2\log L + 2k$ (favors slightly more complex models, suitable for prediction); BIC $= -2\log L + k\log n$ (heavier penalty, favors parsimony, suitable for explanation); Cross-validation (CV) evaluates out-of-sample predictive performance and guards against overfitting.
|
|
85
|
-
|
|
86
|
-
### Step 7: Iterate and Improve
|
|
87
|
-
Models almost always require refinement. If predictions conflict with evidence: Which assumption is at fault? Should new factors be introduced? Should the mathematical framework be changed? When predictions disagree with reality, the response is not to abandon modeling but to revise the model.
|
|
88
|
-
|
|
89
|
-
### Step 8: Declare Scope of Applicability
|
|
90
|
-
Explicitly state the conditions under which the model is valid and those under which it fails. All models have boundaries -- a scope-of-applicability declaration is the model's "expiration label" and is the key safeguard against misuse.
|
|
91
|
-
|
|
92
|
-
## Common Errors
|
|
93
|
-
|
|
94
|
-
| Error | Critique | Correct Approach |
|
|
95
|
-
|---|---|---|
|
|
96
|
-
| Overfitting | Model is too complex, fitting noise rather than signal | Apply Occam's razor: do not multiply entities beyond necessity |
|
|
97
|
-
| Underfitting | Model is too simple to capture key phenomena | Inspect residual patterns to identify missing factors |
|
|
98
|
-
| Ignoring assumption validity | Assumptions are made for mathematical convenience rather than physical plausibility | Every assumption must be grounded in real-world justification |
|
|
99
|
-
| Extrapolating beyond the domain of applicability | Model is valid only within a certain range; beyond it, predictions fail | Explicitly declare the model's scope of applicability |
|
|
100
|
-
| Confusing correlation with causation | Relationships in a model do not imply causation | Distinguish descriptive models from causal models |
|
|
101
|
-
| Forgetting validation | Using a model immediately after construction without checking predictions | Validate with independent data |
|
|
102
|
-
| Ignoring dimensional consistency | Dimensions on both sides of an equation do not match; physically inadmissible | Perform dimensional analysis before constructing equations; construct dimensionless Pi terms |
|
|
103
|
-
| Selecting models based only on in-sample fit | In-sample error underestimates true prediction error | Use AIC/BIC or cross-validation to assess out-of-sample performance |
|
|
104
|
-
| Neglecting sensitivity analysis | Not knowing which parameters drive the results | Perform sensitivity analysis on key parameters and focus on sensitive ones |
|
|
105
|
-
| Confusing validation with model selection | Validation tests a given model; selection compares among candidates | First select a model using AIC/BIC/CV, then validate with independent data |
|
|
106
|
-
| Excessively complex model leading to incomputability | Parameterization cannot be tensorized / GEMM-mapped; $O(n^2)$ memory explosion | Choose a tensorizable, fusible, numerically stable equivalent parameterization; pass the GPU eight-dimensional gate |
|
|
107
|
-
|
|
108
|
-
## Operating Procedure
|
|
109
|
-
|
|
110
|
-
When this skill is triggered, the output must include:
|
|
111
|
-
|
|
112
|
-
1. **Problem definition**: A one-sentence description of the real-world problem to be solved
|
|
113
|
-
2. **Assumption list**: `[Assumption N]: [Content] (Plausibility: High/Medium/Low)`
|
|
114
|
-
3. **Dimensional check**: Perform dimensional analysis on key physical quantities and construct dimensionless Pi terms
|
|
115
|
-
4. **Model selection**: `[Framework]: [Choice] because [Reason]`
|
|
116
|
-
5. **Variable definitions**: Define all variables, parameters, and their physical meanings
|
|
117
|
-
6. **Solution approach**: Specify the solving method (analytical / numerical / qualitative)
|
|
118
|
-
7. **Sensitivity analysis**: Identify sensitive parameters and assess their impact on the output
|
|
119
|
-
8. **Model selection criteria**: If candidate models exist, compare them using AIC/BIC/CV and select the best
|
|
120
|
-
9. **Validation plan**: How will the model's validity be tested?
|
|
121
|
-
10. **Scope of applicability**: Explicitly state the conditions under which the model is valid and those under which it fails
|
|
122
|
-
11. **[GPU viability]** (if used for algorithm/operator/structure): Whether the model parameterization is tensorizable / GEMM-mappable, whether complexity and memory are acceptable; pass the eight-dimensional gate in `../../references/gpu-friendly-math.md`; label as friendly / retrofittable / unfriendly, with adaptation recommendations.
|
|
123
|
-
|
|
124
|
-
**Output must not consist of analysis alone without conclusions.**
|
|
125
|
-
|
|
126
|
-
## Relations to Other Skills
|
|
127
|
-
|
|
128
|
-
- **Axiomatic thinking**: The assumptions of a model are analogous to axioms; their consistency must be verified.
|
|
129
|
-
- **Abstraction**: Modeling is an application of abstraction -- abstracting from reality to a mathematical structure.
|
|
130
|
-
- **Optimization**: The objective function of many models is itself an optimization problem.
|
|
131
|
-
- **Probability and statistics**: Modeling uncertainty requires the tools of probability theory.
|
|
132
|
-
- **Transformation**: Solving a model often requires transforming it into a more tractable representation.
|
|
133
|
-
- **Algorithmic thinking**: Computational models (agent-based, cellular automata) employ algorithms as the modeling framework.
|
|
134
|
-
- **Causal inference**: Causal models (DAGs, structural causal models) explicitly distinguish causation from correlation.
|
|
135
|
-
- **Modern mathematics activation**: `../../references/books/smooth-manifolds.md` (manifold constraints / latent-space geometry), `../../references/books/differential-geometry.md` (metrics / curvature), `../../references/books/optimization-ml.md` (parameterization and training).
|