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
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
# Mathematical Sources and Classic Texts
|
|
2
|
-
|
|
3
|
-
## Shannon's Information Theory (1948)
|
|
4
|
-
|
|
5
|
-
> H(X) = -Sum p(x) log p(x) -- Entropy, the average uncertainty of an information source
|
|
6
|
-
> I(X;Y) = H(X) - H(X|Y) -- Mutual information, the information contribution of observing Y about X
|
|
7
|
-
> C = max_{p(x)} I(X;Y) -- Channel capacity, the upper bound on the rate of reliable communication
|
|
8
|
-
>
|
|
9
|
-
> Source coding theorem: optimal compression >= H(X) bits/symbol
|
|
10
|
-
> Channel coding theorem: when R < C, there exists a coding scheme that drives the error rate to zero
|
|
11
|
-
|
|
12
|
-
**Meaning**: Information can be precisely quantified; there exist insurmountable mathematical limits on compression and communication, not merely limits imposed by the current state of engineering. Entropy measures "average surprise" -- low-probability events carry more information when they occur. Mutual information measures "reduction in uncertainty" -- how much observing Y reduces our uncertainty about X.
|
|
13
|
-
|
|
14
|
-
**Mathematical background**: Claude Shannon founded information theory in "A Mathematical Theory of Communication" (1948). Core contributions: (1) Defined entropy H(X) = -Sum p(x) log p(x), where the choice of logarithm base determines the unit (base 2 -> bits, base e -> nats); (2) The source coding theorem proves that the average length L of an optimal prefix code satisfies L >= H(X), with equality if and only if all probabilities are powers of 2; (3) The channel coding theorem proves that when R < C there exist coding sequences such that P(error) -> 0, while for R > C, P(error) > 0 is unavoidable. Shannon's proofs use random coding arguments -- constructing a random codebook and then showing that the error rate of a "typical" code approaches zero, thereby establishing the existence of at least one such code.
|
|
15
|
-
|
|
16
|
-
## Huffman Coding (1952)
|
|
17
|
-
|
|
18
|
-
> Greedy construction of optimal prefix codes: repeatedly merge the two symbols with the smallest probabilities, building the tree bottom-up.
|
|
19
|
-
> Average code length L(Huffman) <= H(X) + 1; when probabilities are powers of 2, L = H(X).
|
|
20
|
-
|
|
21
|
-
**Meaning**: An optimal prefix code (unambiguously decodable) can be constructed exactly via a greedy algorithm, with average length approaching the entropy bound.
|
|
22
|
-
|
|
23
|
-
**Mathematical background**: David Huffman published this algorithm in 1952 as an MIT student, proving its optimality. Huffman coding is a variable-length prefix code -- more frequent symbols receive shorter codewords, and the prefix condition guarantees that no codeword is a prefix of another, enabling instantaneous decoding. When symbol probabilities are not all powers of 2, the average length of Huffman coding is strictly greater than H(X); arithmetic coding encodes an entire message as an interval and can approach the entropy bound more closely.
|
|
24
|
-
|
|
25
|
-
## Hamming Codes (1950)
|
|
26
|
-
|
|
27
|
-
> [7,4] Hamming code: 4 information bits + 3 parity bits = 7-bit codeword, minimum Hamming distance d_min = 3
|
|
28
|
-
> Can correct 1-bit errors or detect 2-bit errors
|
|
29
|
-
> General [2^r - 1, 2^r - 1 - r] Hamming code: r parity bits, minimum distance 3
|
|
30
|
-
|
|
31
|
-
**Meaning**: The first systematic construction of error-correcting codes -- a small amount of redundancy can protect information from corruption by noise.
|
|
32
|
-
|
|
33
|
-
**Mathematical background**: Richard Hamming, working at Bell Labs, designed the first systematic error-correcting code after hardware errors in early computers caused his programs to crash. Hamming distance d(x,y) = the number of positions at which two binary strings differ; a minimum distance d_min >= 2t+1 allows correction of t-bit errors. Hamming codes are perfect codes -- the sphere packing exactly fills the entire space. Subsequent developments: Reed-Solomon codes (1960) for burst error correction and CD/DVD; LDPC codes (Gallager 1962) and Turbo codes (1993) approach the Shannon limit.
|
|
34
|
-
|
|
35
|
-
## Kolmogorov Complexity (1965)
|
|
36
|
-
|
|
37
|
-
> K(x) = the length of the shortest program that outputs x (on a universal Turing machine)
|
|
38
|
-
> Kolmogorov complexity is an algorithmic measure of information -- complementary to Shannon entropy
|
|
39
|
-
>
|
|
40
|
-
> Uncomputability: K(x) is not computable in general (Chaitin's incompleteness theorem)
|
|
41
|
-
|
|
42
|
-
**Meaning**: The shortest program description length is the intrinsic information content of an object -- a more fundamental measure of information than Shannon entropy, independent of any probability distribution.
|
|
43
|
-
|
|
44
|
-
**Mathematical background**: Andrey Kolmogorov proposed algorithmic information theory in 1965, defining K(x) as the length |p| of the shortest program p that outputs x on a universal Turing machine U: K_U(x) = min{|p| : U(p) = x}. Key properties: (1) Uncomputability -- no algorithm can compute K(x) in general; (2) Invariance theorem -- the values of K_U(x) on different universal Turing machines differ by at most a constant c (depending on the choice of machine); (3) Relation to entropy -- for i.i.d. sequences, E[K(x)] is approximately nH(X) (the algorithmic analogue of Shannon entropy); (4) Chaitin's incompleteness theorem -- a formal system cannot prove K(x) > c for most x. Kolmogorov complexity is the theoretical foundation of the MDL principle.
|
|
45
|
-
|
|
46
|
-
## KL Divergence (Kullback-Leibler, 1951)
|
|
47
|
-
|
|
48
|
-
> D(P||Q) = Sum p(x) log(p(x)/q(x)) = E_P[log(p(X)/q(X))]
|
|
49
|
-
>
|
|
50
|
-
> D(P||Q) >= 0, with equality if and only if P = Q
|
|
51
|
-
> D(P||Q) is not equal to D(Q||P) -- it is asymmetric
|
|
52
|
-
> D(P||Q) is not a distance (asymmetric, does not satisfy the triangle inequality)
|
|
53
|
-
|
|
54
|
-
**Meaning**: KL divergence measures "the number of extra bits needed to encode data from distribution P using distribution Q" -- a one-directional measure of information loss.
|
|
55
|
-
|
|
56
|
-
**Mathematical background**: Solomon Kullback and Richard Leibler proposed relative entropy in 1951, defined as D(P||Q) = Sum p(x) log(p(x)/q(x)). Core properties: (1) Non-negativity D(P||Q) >= 0 (proved via Gibbs' inequality); (2) Asymmetry D(P||Q) is not equal to D(Q||P) -- the interpretation of D(P||Q) is "the expected extra length of encoding data from P using Q," and the direction cannot be interchanged; (3) Relation to mutual information: I(X;Y) = D(p(x,y)||p(x)p(y)) -- mutual information is the KL divergence between the joint distribution and the product of the marginals; (4) Relation to entropy: H(P) + D(P||Q) = Sum p(x)(-log q(x)) -- cross-entropy equals entropy plus KL divergence. The cross-entropy loss function is central to deep learning: minimizing H(P) + D(P||Q) = minimizing Sum p(x)(-log q(x)).
|
|
57
|
-
|
|
58
|
-
## Rate-Distortion Theory (Shannon, 1959)
|
|
59
|
-
|
|
60
|
-
> R(D) = min_{p(z|x): E[d(x,z)] <= D} I(X;Z)
|
|
61
|
-
>
|
|
62
|
-
> The minimum rate R(D) required under an allowed distortion D
|
|
63
|
-
> R(0) = H(X) (lossless compression), R(D_max) = 0 (maximum allowable distortion)
|
|
64
|
-
|
|
65
|
-
**Meaning**: Lossy compression has a fundamental limit given by the rate-distortion function R(D) -- lower rates require accepting greater distortion.
|
|
66
|
-
|
|
67
|
-
**Mathematical background**: Shannon extended the source coding theorem to lossy compression in 1959. The rate-distortion function R(D) is defined as the minimum of mutual information I(X;Z) subject to the constraint that expected distortion E[d(x,z)] <= D. The distortion measure d(x,z) can be Hamming distortion (binary), squared error (continuous), etc. R(D) is monotonically decreasing and convex -- greater tolerance for distortion yields lower required rate. The inverse function D(R) gives the minimum achievable distortion at a given rate. Practical applications: JPEG/MPEG compression, speech coding, and related technologies follow this theoretical framework.
|
|
68
|
-
|
|
69
|
-
## Fisher Information (1925)
|
|
70
|
-
|
|
71
|
-
> I(theta) = E[(d log f(X;theta)/d theta)^2] = -E[d^2 log f(X;theta)/d theta^2]
|
|
72
|
-
>
|
|
73
|
-
> Cramer-Rao lower bound: Var(theta_hat) >= 1/I(theta), for any unbiased estimator theta_hat
|
|
74
|
-
> Fisher information measures the information content of data about parameter theta
|
|
75
|
-
|
|
76
|
-
**Meaning**: Fisher information is the information-theoretic measure in statistical inference -- it connects information theory to the theoretical limits of parameter estimation.
|
|
77
|
-
|
|
78
|
-
**Mathematical background**: R.A. Fisher proposed the concept of information content I(theta) in 1925, measuring the discriminative power of a single observation with respect to parameter theta. Cramer (1946) and Rao (1945) independently proved the Cramer-Rao lower bound Var(theta_hat) >= 1/(nI(theta)). Key connections: (1) Fisher information and KL divergence -- I(theta) = lim_{theta' -> theta} 2D(f(x;theta)||f(x;theta'))/(theta - theta')^2, the local second-order approximation of KL divergence; (2) Fisher information and Bayesian information -- the Jeffreys prior p(theta) proportional to |I(theta)|^(1/2) makes the volume uniform under the Fisher information metric in parameter space; (3) Large-sample properties of maximum likelihood estimation -- theta_hat_MLE is asymptotically normal N(theta, 1/(nI(theta))), achieving the Cramer-Rao lower bound. Fisher information is the bridge between information theory and statistical inference.
|
|
79
|
-
|
|
80
|
-
## MDL Principle (Rissanen, 1978)
|
|
81
|
-
|
|
82
|
-
> MDL(M, D) = L(D|M) + L(M)
|
|
83
|
-
>
|
|
84
|
-
> Choose the model that minimizes "description length of data given the model + description length of the model itself"
|
|
85
|
-
> L(D|M) = -log P(D|M) (negative log-likelihood of the data)
|
|
86
|
-
> L(M) = model encoding length (complexity penalty)
|
|
87
|
-
|
|
88
|
-
**Meaning**: MDL is the information-theoretic version of Occam's razor -- a good model is both accurate (short data description) and parsimonious (short model description).
|
|
89
|
-
|
|
90
|
-
**Mathematical background**: Jorma Rissanen proposed the Minimum Description Length principle in 1978, reducing model selection to a coding problem. Relationships between MDL and other criteria: (1) MDL and BIC -- two-part MDL (L(D|M) + L(M)) is asymptotically equivalent to BIC (-2 ln L + k ln(n)) for large samples; (2) MDL and Kolmogorov complexity -- ideal MDL uses Kolmogorov complexity K(M) to measure model complexity, but K(M) is uncomputable; practical MDL approximates it with parameter encoding length. Normalized MDL (1996) uses mixture coding to handle parameters, avoiding the arbitrary-precision problem. The central insight of MDL: model selection is fundamentally data compression -- the best model is the one that compresses the data best.
|
|
91
|
-
|
|
92
|
-
## Mutual Information and Channel Capacity
|
|
93
|
-
|
|
94
|
-
> I(X;Y) = H(X) - H(X|Y) = H(Y) - H(Y|X) = H(X) + H(Y) - H(X,Y)
|
|
95
|
-
>
|
|
96
|
-
> Symmetry of mutual information: I(X;Y) = I(Y;X)
|
|
97
|
-
> Non-negativity of mutual information: I(X;Y) >= 0, with equality if and only if X and Y are independent
|
|
98
|
-
>
|
|
99
|
-
> Channel capacity C = max_{p(x)} I(X;Y)
|
|
100
|
-
> Typical set A_epsilon^n: {x^n : |-log p(x^n)/n - H(X)| < epsilon}
|
|
101
|
-
|
|
102
|
-
**Meaning**: Mutual information is a precise measure of the dependence between two random variables -- it is zero if and only if they are independent, and positive if statistical association exists. Channel capacity is the maximum of mutual information over all input distributions, defining the theoretical limit of reliable communication.
|
|
103
|
-
|
|
104
|
-
**Mathematical background**: Mutual information I(X;Y) = Sum p(x,y) log(p(x,y)/(p(x)p(y))) = D(p(x,y)||p(x)p(y)) -- the KL divergence between the joint distribution and the product of the marginals. The typical set is the key tool in Shannon's proofs of coding theorems: for an i.i.d. source X^n, typical sequences x^n satisfy |-1/n log p(x^n) - H(X)| < epsilon; the probability of the typical set approaches 1 (as n -> infinity), yet the size of the typical set is approximately 2^{nH(X)}, far smaller than the entire space 2^n (when H(X) < 1). This explains why compression to nH(X) bits suffices to cover nearly all valid sequences.
|
|
105
|
-
|
|
106
|
-
## Joint Entropy, Conditional Entropy, and Chain Rules
|
|
107
|
-
|
|
108
|
-
> H(X,Y) = H(X) + H(Y|X) -- Chain rule for joint entropy
|
|
109
|
-
> H(Y|X) = Sum p(x) H(Y|X=x) -- Conditional entropy
|
|
110
|
-
> I(X;Y) = H(X) - H(X|Y) = H(Y) - H(Y|X) -- Mutual information
|
|
111
|
-
> I(X;Y|Z) = H(X|Z) - H(X|Y,Z) -- Conditional mutual information
|
|
112
|
-
> Chain expansion of I(X1;X2;...;Xn): I(X;Y,Z) = I(X;Y) + I(X;Z|Y)
|
|
113
|
-
|
|
114
|
-
**Meaning**: The chain rule for entropy decomposes joint uncertainty into the contributions of individual variables -- enabling an understanding of the information structure of multivariate systems.
|
|
115
|
-
|
|
116
|
-
**Mathematical background**: Joint entropy H(X,Y) = -Sum p(x,y) log p(x,y) measures the total uncertainty of a pair of random variables. The chain rule H(X,Y) = H(X) + H(Y|X) states: once X is known, the additional uncertainty of Y is H(Y|X). Generalized to n variables: H(X1,...,Xn) = Sum_i H(Xi|X1,...,Xi-1). Conditional mutual information I(X;Y|Z) measures "the additional information that Y provides about X, given that Z is already known" -- a key tool in information bottleneck methods and causal inference. The chain expansion of multivariate mutual information: I(X;Y,Z) = I(X;Y) + I(X;Z|Y), showing that the joint information of Y and Z about X equals the direct information from Y plus the conditional information from Z.
|
|
117
|
-
|
|
118
|
-
## Everyday Insights from Information Theory and Coding Theory
|
|
119
|
-
|
|
120
|
-
> "The core of information theory is not about computing precise bit counts, but about cultivating the habit of mind that uncertainty is quantifiable, information has value, and fundamental limits cannot be transcended."
|
|
121
|
-
|
|
122
|
-
- Do not ignore uncertainty -- entropy H(X) quantifies it
|
|
123
|
-
- Information has direction and magnitude -- mutual information I(X;Y) measures it
|
|
124
|
-
- Compression has limits -- the source coding theorem defines them
|
|
125
|
-
- Communication has limits -- the channel coding theorem defines them
|
|
126
|
-
- Model selection has information-theoretic criteria -- AIC/BIC/MDL guide it
|
|
127
|
-
- There is an information-theoretic distance between probability distributions -- KL divergence measures it
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
# 数学出处与经典文献 / Mathematical Sources and Classic Texts
|
|
2
|
-
|
|
3
|
-
## Shannon 信息论 / Shannon's Information Theory (1948)
|
|
4
|
-
|
|
5
|
-
> H(X) = −Σ p(x) log p(x) —— 熵,信息源的平均不确定性
|
|
6
|
-
> I(X;Y) = H(X) − H(X|Y) —— 互信息,观察 Y 对 X 的信息贡献
|
|
7
|
-
> C = max_{p(x)} I(X;Y) —— 信道容量,可靠通信的速率上限
|
|
8
|
-
>
|
|
9
|
-
> 信源编码定理:最优压缩 ≥ H(X) bits/symbol
|
|
10
|
-
> 信道编码定理:R < C 时存在编码方案使误码率趋零
|
|
11
|
-
|
|
12
|
-
**含义**:信息可以被精确量化;压缩与通信存在不可逾越的数学极限,而非仅受工程水平限制。熵度量"平均惊奇"——低概率事件发生时带来的信息量更大。互信息度量"不确定性减少"——观察 Y 使我们对 X 的不确定降低了多少。
|
|
13
|
-
|
|
14
|
-
**数学背景**:Claude Shannon 在《A Mathematical Theory of Communication》(1948) 中创立信息论。核心贡献:(1) 定义熵 H(X) = −Σ p(x) log p(x),对数基底选择决定单位(基底 2 → bits,基底 e → nats);(2) 信源编码定理证明最优前缀码平均长度 L ≥ H(X),等号当且仅当所有概率为 2 的幂次时成立;(3) 信道编码定理证明 R < C 时存在编码序列使 P(error) → 0,R > C 时 P(error) > 0 不可避免。Shannon 的证明是随机编码论证——构造随机码本后证明"典型"码的误码率趋零,再指出至少存在一个这样的码。
|
|
15
|
-
|
|
16
|
-
## Huffman 编码 / Huffman Coding (1952)
|
|
17
|
-
|
|
18
|
-
> 贪心构造最优前缀码:每次合并概率最小的两个符号,自底向上建树。
|
|
19
|
-
> 平均编码长度 L(Huffman) ≤ H(X) + 1,当概率为 2 的幂次时 L = H(X)。
|
|
20
|
-
|
|
21
|
-
**含义**:最优前缀码(无歧义解码)可通过贪心算法精确构造,平均长度接近熵限。
|
|
22
|
-
|
|
23
|
-
**数学背景**:David Huffman 在 1952 年作为 MIT 学生发表此算法,证明其最优性。Huffman 编码是变长前缀码——较频繁的符号用较短的码字,保证任何码字不是另一码字的前缀(前缀条件),从而可即时解码(instantaneous decoding)。当符号概率不全是 2 的幂次时,Huffman 编码平均长度严格大于 H(X);算术编码将整个消息编码为一个区间,可更接近熵限。
|
|
24
|
-
|
|
25
|
-
## Hamming 码 / Hamming Codes (1950)
|
|
26
|
-
|
|
27
|
-
> [7,4] Hamming 码:4 位信息 + 3 位校验 = 7 位码字,最小 Hamming 距离 d_min = 3
|
|
28
|
-
> 可纠正 1 位错误或检测 2 位错误
|
|
29
|
-
> 一般 [2^r−1, 2^r−1−r] Hamming 码:r 位校验,最小距离 3
|
|
30
|
-
|
|
31
|
-
**含义**:纠错编码的第一个系统构造——少量冗余即可保护信息免受噪声损坏。
|
|
32
|
-
|
|
33
|
-
**数学背景**:Richard Hamming 在 Bell 实验室工作时,因早期计算机的硬件错误导致程序崩溃,于是设计了第一个系统化的纠错码。Hamming 距离 d(x,y) = 两个二进制串不同位置的个数;最小距离 d_min ≥ 2t+1 时可纠正 t 位错误。Hamming 码是完美码(perfect code)——球 packing 恰好填满整个空间。后续发展:Reed-Solomon 码(1960)用于突发纠错和 CD/DVD;LDPC 码(Gallager 1962)和 Turbo 码(1993)逼近 Shannon 极限。
|
|
34
|
-
|
|
35
|
-
## Kolmogorov 复杂度 / Kolmogorov Complexity (1965)
|
|
36
|
-
|
|
37
|
-
> K(x) = 输出 x 的最短程序长度(在通用 Turing 机上)
|
|
38
|
-
> Kolmogorov 复杂度是信息的算法度量——与 Shannon 熵互补
|
|
39
|
-
>
|
|
40
|
-
> 不可计算性:K(x) 不可一般计算(Chaitin 不完备定理)
|
|
41
|
-
|
|
42
|
-
**含义**:最短程序描述长度是对象的内在信息量——比 Shannon 熵更本质的信息度量,不依赖概率分布。
|
|
43
|
-
|
|
44
|
-
**数学背景**:Andrey Kolmogorov 在 1965 年提出算法信息论,定义 K(x) 为在通用 Turing 机 U 上输出 x 的最短程序 |p| 的长度:K_U(x) = min{|p| : U(p) = x}。关键性质:(1) 不可计算性——不存在算法一般地计算 K(x);(2) 不变定理——不同通用 Turing 机上的 K_U(x) 差异至多为常数 c(依赖于机器选择);(3) 与熵的关系——对 i.i.d. 序列,E[K(x)] ≈ nH(X)(Shannon 熵的算法版本);(4) Chaitin 不完备定理——形式系统不能证明 K(x) > c 对大多数 x 成立。Kolmogorov 复杂度是 MDL 原则的理论根基。
|
|
45
|
-
|
|
46
|
-
## KL 散度 / KL Divergence (Kullback-Leibler, 1951)
|
|
47
|
-
|
|
48
|
-
> D(P||Q) = Σ p(x) log(p(x)/q(x)) = E_P[log(p(X)/q(X))]
|
|
49
|
-
>
|
|
50
|
-
> D(P||Q) ≥ 0,等号当且仅当 P = Q
|
|
51
|
-
> D(P||Q) ≠ D(Q||P)——不对称
|
|
52
|
-
> D(P||Q) 不是距离(不对称、不满足三角不等式)
|
|
53
|
-
|
|
54
|
-
**含义**:KL 散度度量"用 Q 分布编码 P 分布的数据所需的额外比特数"——信息损失的单向度量。
|
|
55
|
-
|
|
56
|
-
**数学背景**:Solomon Kullback 与 Richard Leibler 在 1951 年提出相对熵(relative entropy),定义为 D(P||Q) = Σ p(x) log(p(x)/q(x))。核心性质:(1) 非负性 D(P||Q) ≥ 0(由 Gibbs 不等式证明);(2) 不对称性 D(P||Q) ≠ D(Q||P)——D(P||Q) 的解释是"用 Q 编码 P 的数据的期望额外长度",方向不可互换;(3) 与互信息的关系 I(X;Y) = D(p(x,y)||p(x)p(y))——互信息是联合分布与独立假设分布间的 KL 散度;(4) 与熵的关系 H(P) + D(P||Q) = Σ p(x)(−log q(x))——交叉熵 = 熵 + KL 散度。交叉熵损失函数是深度学习的核心:min H(P) + D(P||Q) = min Σ p(x)(−log q(x))。
|
|
57
|
-
|
|
58
|
-
## 码率-失真理论 / Rate-Distortion Theory (Shannon, 1959)
|
|
59
|
-
|
|
60
|
-
> R(D) = min_{p(z|x): E[d(x,z)]≤D} I(X;Z)
|
|
61
|
-
>
|
|
62
|
-
> 在允许失真 D 的条件下,所需的最小码率 R(D)
|
|
63
|
-
> R(0) = H(X)(无损压缩),R(D_max) = 0(最大允许失真)
|
|
64
|
-
|
|
65
|
-
**含义**:有损压缩存在码率-失真函数 R(D) 的基本极限——更低的码率需要接受更大的失真。
|
|
66
|
-
|
|
67
|
-
**数学背景**:Shannon 在 1959 年扩展信源编码定理到有损压缩情形。码率-失真函数 R(D) 定义为在期望失真 E[d(x,z)] ≤ D 的约束下最小化互信息 I(X;Z)。失真度量 d(x,z) 可选 Hamming 失真(二元)、平方误差(连续)等。R(D) 单调递减、凸函数——失真容忍越大,所需码率越低。逆函数 D(R) 给出给定码率下的最小可达失真。实际应用:JPEG/MPEG 压缩、语音编码等遵循此理论框架。
|
|
68
|
-
|
|
69
|
-
## Fisher 信息 / Fisher Information (1925)
|
|
70
|
-
|
|
71
|
-
> I(θ) = E[(∂log f(X;θ)/∂θ)²] = −E[∂²log f(X;θ)/∂θ²]
|
|
72
|
-
>
|
|
73
|
-
> Cramér-Rao 下界:Var(θ̂) ≥ 1/I(θ),对任何无偏估计量 θ̂
|
|
74
|
-
> Fisher 信息度量数据对参数 θ 的信息含量
|
|
75
|
-
|
|
76
|
-
**含义**:Fisher 信息是统计推断的信息论度量——它连接了信息论与参数估计的理论极限。
|
|
77
|
-
|
|
78
|
-
**数学背景**:R.A. Fisher 在 1925 年提出信息量概念 I(θ),度量一个观测对参数 θ 的区分能力。Cramér (1946) 与 Rao (1945) 分别独立证明了 Cramér-Rao 下界 Var(θ̂) ≥ 1/nI(θ)。关键联系:(1) Fisher 信息与 KL 散度——I(θ) = lim_{θ'→θ} 2D(f(x;θ)||f(x;θ'))/(θ−θ')²,KL 散度的局部二阶近似;(2) Fisher 信息与 Bayesian 信息——Jeffreys 先验 p(θ) ∝ |I(θ)|^(1/2) 使得参数空间中 Fisher 信息度量下的体积均匀;(3) 最大似然估计的大样本性质——θ̂_MLE 渐近正态 N(θ, 1/nI(θ)),达到 Cramér-Rao 下界。Fisher 信息是信息论与统计推断的桥梁。
|
|
79
|
-
|
|
80
|
-
## MDL 原则 / MDL Principle (Rissanen, 1978)
|
|
81
|
-
|
|
82
|
-
> MDL(M, D) = L(D|M) + L(M)
|
|
83
|
-
>
|
|
84
|
-
> 选择使"数据给定模型的描述长度 + 模型本身的描述长度"最小的模型
|
|
85
|
-
> L(D|M) = −log P(D|M)(数据的负对数似然)
|
|
86
|
-
> L(M) = 模型编码长度(复杂度惩罚)
|
|
87
|
-
|
|
88
|
-
**含义**:MDL 是信息论版本的奥卡姆剃刀——好模型既准确(数据描述短)又简约(模型描述短)。
|
|
89
|
-
|
|
90
|
-
**数学背景**:Jorma Rissanen 在 1978 年提出最小描述长度原则,将模型选择转化为编码问题。MDL 与其他准则的关系:(1) MDL 与 BIC——两参数 MDL(L(D|M)+L(M))与 BIC (−2lnL+k·ln(n)) 在大样本下等价;(3) MDL 与 Kolmogorov 复杂度——理想 MDL 用 Kolmogorov 复杂度 K(M) 庡量模型复杂度,但 K(M) 不可计算;实际 MDL 用参数编码长度近似。先验 MDL(1996)用混合编码处理参数,避免任意精度问题。MDL 的核心洞见:模型选择本质上是数据压缩——最好的模型是压缩数据最好的模型。
|
|
91
|
-
|
|
92
|
-
## 互信息与信道容量 / Mutual Information and Channel Capacity
|
|
93
|
-
|
|
94
|
-
> I(X;Y) = H(X) − H(X|Y) = H(Y) − H(Y|X) = H(X) + H(Y) − H(X,Y)
|
|
95
|
-
>
|
|
96
|
-
> 互信息的对称性:I(X;Y) = I(Y;X)
|
|
97
|
-
> 互信息的非负性:I(X;Y) ≥ 0,等号当且仅当 X,Y 独立
|
|
98
|
-
>
|
|
99
|
-
> 信道容量 C = max_{p(x)} I(X;Y)
|
|
100
|
-
> 典型集 A_ε^n:{x^n : |−log p(x^n)/n − H(X)| < ε}
|
|
101
|
-
|
|
102
|
-
**含义**:互信息是两个随机变量间依赖关系的精确度量——为零等价于独立,为正则存在统计关联。信道容量是互信息在所有输入分布上的最大值,定义可靠通信的理论极限。
|
|
103
|
-
|
|
104
|
-
**数学背景**:互信息 I(X;Y) = Σ p(x,y) log(p(x,y)/p(x)p(y)) = D(p(x,y)||p(x)p(y))——联合分布与独立假设分布间的 KL 散度。典型集是 Shannon 证明编码定理的关键工具:对 i.i.d. 信源 X^n,典型序列 x^n 满足 |−1/n log p(x^n) − H(X)| < ε;典型集的概率趋近 1(当 n→∞),但典型集的大小 ≈ 2^{nH(X)},远小于整个空间 2^n(当 H(X) < 1)。这解释了为何压缩到 nH(X) bits 即可覆盖几乎所有有效序列。
|
|
105
|
-
|
|
106
|
-
## 联合熵、条件熵与链式规则 / Joint Entropy, Conditional Entropy, and Chain Rules
|
|
107
|
-
|
|
108
|
-
> H(X,Y) = H(X) + H(Y|X) —— 联合熵链式规则
|
|
109
|
-
> H(Y|X) = Σ p(x) H(Y|X=x) —— 条件熵
|
|
110
|
-
> I(X;Y) = H(X) − H(X|Y) = H(Y) − H(Y|X) —— 互信息
|
|
111
|
-
> I(X;Y|Z) = H(X|Z) − H(X|Y,Z) —— 条件互信息
|
|
112
|
-
> I(X₁;X₂;...;Xₙ) 的链式展开:I(X;Y,Z) = I(X;Y) + I(X;Z|Y)
|
|
113
|
-
|
|
114
|
-
**含义**:熵的链式规则将联合不确定性拆解为逐个变量的贡献——理解多变量系统的信息结构。
|
|
115
|
-
|
|
116
|
-
**数学背景**:联合熵 H(X,Y) = −Σ p(x,y) log p(x,y) 度量一对随机变量的总不确定性。链式规则 H(X,Y) = H(X) + H(Y|X) 说明:知道 X 后,Y 的额外不确定性是 H(Y|X)。推广到 n 个变量:H(X₁,...,Xₙ) = Σᵢ H(Xᵢ|X₁,...,Xᵢ₋₁)。条件互信息 I(X;Y|Z) 度量"在已知 Z 的条件下,Y 对 X 的额外信息量"——这是信息瓶颈和因果推断的关键工具。多变量互信息的链式展开:I(X;Y,Z) = I(X;Y) + I(X;Z|Y),说明 Y 和 Z 对 X 的联合信息等于 Y 的直接信息加上 Z 的条件信息。
|
|
117
|
-
|
|
118
|
-
## 信息论与编码理论的日常洞见
|
|
119
|
-
|
|
120
|
-
> "信息论的核心不是计算精确的比特数,而是养成'不确定性可量化、信息有价值、极限不可逾越'的思维习惯。"
|
|
121
|
-
|
|
122
|
-
- 不要忽视不确定性——熵 H(X) 量化它
|
|
123
|
-
- 信息有方向和大小——互信息 I(X;Y) 度量它
|
|
124
|
-
- 压缩有极限——信源编码定理限定它
|
|
125
|
-
- 通信有极限——信道编码定理限定它
|
|
126
|
-
- 模型选择有信息论标准——AIC/BIC/MDL 指导它
|
|
127
|
-
- 概率分布间有信息距离——KL 散度衡量它
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: logic-deduction
|
|
3
|
-
description: |
|
|
4
|
-
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.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# 🧠 Logic Deduction
|
|
8
|
-
|
|
9
|
-
> "Logic is the house rule of mathematics — all reasoning must proceed under the supervision of formal rules."
|
|
10
|
-
>
|
|
11
|
-
> — Gödel's Completeness Theorem (1929), First-Order Logic
|
|
12
|
-
|
|
13
|
-
## Core Principle
|
|
14
|
-
|
|
15
|
-
Deriving new true propositions rigorously from true premises — every step in the chain of inference must be legitimate. Types of inference: deduction (true premises + valid rules → necessarily true conclusion, most reliable), induction (instances → general, probabilistic), abduction (observation + theory → best explanation, hypothetical).
|
|
16
|
-
|
|
17
|
-
> **Mathematical Formalization**
|
|
18
|
-
>
|
|
19
|
-
> Logical deduction has a two-layer structure: propositional logic handles truth-functional connectives (¬, ∧, ∨, →, ↔), and predicate logic adds quantifiers (∀, ∃) and individual variables on top of this foundation. Mathematical proofs live within predicate logic — propositional logic alone cannot express statements such as "for all x, if P(x) then Q(x)," and therefore cannot proof-check actual mathematical arguments.
|
|
20
|
-
>
|
|
21
|
-
> Gödel's Completeness Theorem (1929): In first-order predicate logic, all valid arguments are provable — if φ is a valid formula of first-order logic, there exists a formal proof sequence deriving φ from the empty premise set. This guarantees that the deductive power of first-order logic coincides exactly with semantic validity (soundness + completeness), but this holds only for first-order logic; second-order logic does not enjoy this property.
|
|
22
|
-
>
|
|
23
|
-
> See `original-texts.md` for detailed mathematical foundations.
|
|
24
|
-
|
|
25
|
-
## GPU-Friendliness (Cross-Cutting Check)
|
|
26
|
-
|
|
27
|
-
When logical/formal verification structures are mapped to GPU, caution is required: **symbolic reasoning is often "beautiful but not computable"** — proof search and resolution backtracking are inherently serial and difficult to tensorize. When logic is used for algorithm/invariant design, pass the eight-dimension gate of `../../references/gpu-friendly-math.md`:
|
|
28
|
-
|
|
29
|
-
- **Batch SAT/SMT solving**: Independent clauses can be batch-parallelized (friendly), but CDCL backtracking is serial.
|
|
30
|
-
- **Theorem proving (Coq/Lean)**: Tactic solvers are highly serial with complex dependency graphs — not trainable; **verify offline** and deploy only the conclusions.
|
|
31
|
-
- **Model Checking**: State-space explosion → symbolic BDDs can compress; on GPU, switch to parallel SAT / local reachability (retrofittable).
|
|
32
|
-
- **Type/invariant checking**: Used as compile-time/offline static checks with zero runtime overhead (friendly).
|
|
33
|
-
- **Anti-pattern**: Embedding resolution/natural-deduction proof search inside the training loop — non-differentiable and non-parallelizable; should be relaxed to differentiable approximations (probabilistic/neuro-symbolic logic) or proved offline with only conclusions deployed.
|
|
34
|
-
|
|
35
|
-
Eight-dimension minimum assessment (formal terminology): **Tensorization** — typically unfriendly unless clauses/states can be batch-encoded; **GEMM-Mappability** — suitable only for differentiable logic, SAT scoring, or Boolean semiring approximations; **Complexity** — must flag the exponential or undecidable boundary of proof search/model checking; **Memory & KV-Cache** — whether state spaces, proof trees, or BDDs explode; **Low-Precision Stability** — whether relaxed logic preserves semantic boundaries under fp16/bf16; **Parallelism & Communication** — whether branching search can be batched or offloaded; **Sparsity Structure** — whether the constraint graph is regular; **Operator Fusion** — whether logic loss/mask can be fused; proof search itself should never enter a kernel.
|
|
36
|
-
|
|
37
|
-
> In conjunction with `../../references/books/abstract-algebra.md` (formal systems), `../../references/books/algebraic-geometry-rising-sea.md` (category-theoretic reasoning).
|
|
38
|
-
|
|
39
|
-
## When NOT to Use
|
|
40
|
-
|
|
41
|
-
- **The premises themselves are uncertain** — first establish the truth of premises, then deduce.
|
|
42
|
-
- **A creative breakthrough is needed rather than logical verification** — deduction can only discover conclusions already implicit in existing information; it cannot generate new information.
|
|
43
|
-
- **Second-order logic problems** — Gödel's completeness covers only first-order logic; second-order validity cannot be fully axiomatized.
|
|
44
|
-
|
|
45
|
-
## When to Use
|
|
46
|
-
|
|
47
|
-
- When reading a paper or code, checking the rigor of its proofs/derivations/invariants.
|
|
48
|
-
- When suspecting logical leaps or gaps in an argument and needing to locate them formally.
|
|
49
|
-
- When verifying whether a conclusion truly follows from the premises (whether Γ ⊢ φ holds).
|
|
50
|
-
- When analyzing mathematical statements containing ∀ / ∃, verifying the correctness of quantifier reasoning.
|
|
51
|
-
- When checking the validity boundary of a second-order logic argument.
|
|
52
|
-
- When performing formal derivation and proof verification for algorithm correctness, loop invariants, or program properties.
|
|
53
|
-
|
|
54
|
-
## Method
|
|
55
|
-
|
|
56
|
-
### Step 1: Identify the Premises
|
|
57
|
-
List all premises (assumptions, known conditions, cited theorems) in the argument, annotating their status: **proven theorem** (e.g., "there are infinitely many primes"), **axiom** (e.g., ZF set theory axioms), **hypothesis** (e.g., "the Riemann Hypothesis"), **empirical fact**. Also annotate the logical level: purely propositional premises (no quantifiers) or predicate premises (containing ∀ / ∃). Premise quality determines inference quality — if the premises do not hold, the conclusion is inevitably unreliable.
|
|
58
|
-
|
|
59
|
-
### Step 2: Check the Rules of Inference
|
|
60
|
-
Verify that each step uses a valid rule of inference.
|
|
61
|
-
|
|
62
|
-
**Propositional logic rules**: Modus Ponens P→Q, P ⊢ Q; Modus Tollens P→Q, ¬Q ⊢ ¬P; Hypothetical Syllogism P→Q, Q→R ⊢ P→R; Disjunctive Syllogism P∨Q, ¬P ⊢ Q; Conjunction Introduction P, Q ⊢ P∧Q; Double Negation Elimination ¬¬P ⊢ P.
|
|
63
|
-
|
|
64
|
-
**Predicate logic rules**: Universal Instantiation (UI) ∀x P(x) ⊢ P(a); Universal Generalization (UG) P(a) holds for arbitrary a ⊢ ∀x P(x) (a must be arbitrary, not a specific constant); Existential Instantiation (EI) ∃x P(x) ⊢ P(c) (c must be a fresh name, not conflicting with existing constants); Existential Generalization (EG) P(a) ⊢ ∃x P(x).
|
|
65
|
-
|
|
66
|
-
**Other frameworks**: Resolution Principle — from (P∨Q) and (¬P∨R), resolve to (Q∨R), suitable for automated proving; Natural Deduction systems — organized symmetrically by introduction/elimination rules, more closely mirroring human reasoning habits.
|
|
67
|
-
|
|
68
|
-
### Step 3: Check for Common Fallacies
|
|
69
|
-
**Propositional logic fallacies**: Affirming the consequent P→Q, Q ⊢ P (invalid); Denying the antecedent P→Q, ¬P ⊢ ¬Q (invalid); confusing sufficient and necessary conditions; circular reasoning (the conclusion is implicitly used as a premise); straw man fallacy.
|
|
70
|
-
|
|
71
|
-
**Predicate logic fallacies**: Quantifier shift fallacy ∀x∃y R(x,y) ≠ ∃y∀x R(x,y) (the former means "each person has their own beloved," the latter means "there is someone beloved by everyone"); illegal universal generalization (inferring ∀x P(x) from P(a) for a specific a, violating UG's arbitrariness requirement); confusing free and bound variables; confusing the strength of ∀ and ∃; equivocation; false dilemma (presenting P∨Q as the only options, implicitly excluding ¬P∧¬Q).
|
|
72
|
-
|
|
73
|
-
### Step 4: Analyze Quantifier Structure
|
|
74
|
-
The nesting order of ∀ and ∃ determines logical strength:
|
|
75
|
-
- **∀∃ structure** (weaker): ∀x∃y R(x,y) — for each x, a respective y can be constructed; constructively satisfiable.
|
|
76
|
-
- **∃∀ structure** (stronger): ∃y∀x R(x,y) — there exists a uniform y that holds for all x, often requiring the Axiom of Choice.
|
|
77
|
-
|
|
78
|
-
Key points: the more nesting layers, the more carefully one must reason; adjacent quantifiers of the same type commute (∀x∀y = ∀y∀x, ∃x∃y = ∃y∃x), but quantifiers of different types do not; quantifier negation equivalences: ¬∀x P(x) ≡ ∃x ¬P(x), ¬∃x P(x) ≡ ∀x ¬P(x).
|
|
79
|
-
|
|
80
|
-
### Step 5: Verify Completeness of the Inference Chain
|
|
81
|
-
Check whether the premise set Γ can formally derive the conclusion φ: does there exist a finite sequence φ₁, φ₂, ..., φₙ = φ, where each φᵢ either belongs to Γ or follows from earlier formulas by a valid rule? If the chain is incomplete, flag the missing intermediate steps and the rules they would require. A single missing step breaks the entire chain.
|
|
82
|
-
|
|
83
|
-
### Step 6: Assess the Strength of the Conclusion
|
|
84
|
-
Logical strength classification: **necessary** (deductively valid; if premises are true, the conclusion is necessarily true), **probable** (inductively supported, probabilistic evidence), **hypothetical** (abductive, best explanation but unverified). Also assess scope: universal (∀) or existential (∃)? Conditional (→) or unconditional? Do not inflate "possible" into "necessary."
|
|
85
|
-
|
|
86
|
-
### Step 7: Select Proof Strategy
|
|
87
|
-
- **Direct proof**: Proceed step by step from premises to conclusion; the most natural approach.
|
|
88
|
-
- **Proof by contradiction**: Assume ¬φ and derive a contradiction, thereby proving φ; suited for negative conclusions or arguments difficult to construct directly.
|
|
89
|
-
- **Contrapositive proof**: Prove ¬Q → ¬P to establish P → Q; used when the contrapositive direction is easier to reason about.
|
|
90
|
-
- **Proof by exhaustion**: Verify all cases one by one; suited for finitely enumerable situations.
|
|
91
|
-
- **Constructive proof**: Directly construct an object satisfying the conditions; more informative than a pure existence proof (which merely shows ∃x P(x) without specifying x).
|
|
92
|
-
|
|
93
|
-
## Common Errors
|
|
94
|
-
|
|
95
|
-
| Error | Critique | Correct Approach |
|
|
96
|
-
|---|---|---|
|
|
97
|
-
| Confusing sufficient and necessary conditions | P → Q holding does not mean Q → P holds | Clearly distinguish sufficient, necessary, and necessary-and-sufficient conditions |
|
|
98
|
-
| Affirming the consequent fallacy | P → Q, Q ⊬ P; only Modus Ponens/Tollens are valid | Reject invalid inferences such as P→Q, Q ⊢ P |
|
|
99
|
-
| Hidden premises | Using unstated premises in the reasoning | Expose all premises and examine each one |
|
|
100
|
-
| Infinite regress | Every premise requires another premise to prove it | Find a starting point that needs no proof (axioms / empirical facts) |
|
|
101
|
-
| Quantifier shift fallacy | ∀x∃y R(x,y) ≠ ∃y∀x R(x,y); the former is weaker, the latter stronger | Strictly respect quantifier order; do not swap quantifiers of different types |
|
|
102
|
-
| Illegal universal generalization | Inferring ∀x P(x) from P(a) for a specific a, violating UG's arbitrariness requirement | UG applies only to arbitrary individuals a, not to specific constants |
|
|
103
|
-
| Confusing free and bound variables | x is bound in ∀x P(x) but free in P(x); the meanings differ | Clearly annotate the bound/free status of variables; avoid conflating them |
|
|
104
|
-
| Confusing ∀ and ∃ | "All elements satisfy P" is far stronger than "some element satisfies P" | Strictly distinguish the logical strength of universal and existential assertions |
|
|
105
|
-
| Embedding symbolic reasoning in the training loop | Proof search/resolution is inherently serial and non-differentiable — "beautiful but not computable" | Relax to differentiable approximations (probabilistic/neuro-symbolic) or prove offline and deploy only conclusions |
|
|
106
|
-
|
|
107
|
-
## Operating Procedure
|
|
108
|
-
|
|
109
|
-
When this skill is triggered, the output must contain:
|
|
110
|
-
|
|
111
|
-
1. **[Premise Inventory]** — List all premises, annotated `[proven]` / `[axiom]` / `[hypothesis]` / `[empirical]`, and annotated with logical level `[propositional]` / `[predicate]`
|
|
112
|
-
2. **[Inference Chain Reconstruction]** — Restate the reasoning process in formal logic language, annotating the inference rule used at each step (including predicate rules such as UI/UG/EI/EG)
|
|
113
|
-
3. **[Fallacy Check]** — Check for propositional and predicate logic fallacies one by one, annotating `✅ No such fallacy` or `❌ Found [specific fallacy]`
|
|
114
|
-
4. **[Quantifier Structure Analysis]** — If ∀ / ∃ nesting is present, annotate quantifier order and logical strength `∀∃ (weak)` / `∃∀ (strong)`
|
|
115
|
-
5. **[Completeness Assessment]** — Is the inference chain complete? Annotate `✅ Complete` or `⚠️ Gap: [explanation]`
|
|
116
|
-
6. **[Conclusion Strength]** — Annotate `[necessary]` / `[probable]` / `[hypothetical]`, and annotate scope `[universal]` / `[existential]` / `[conditional]`
|
|
117
|
-
7. **[Proof Strategy Assessment]** — What proof strategy does the current argument use? Is there a better strategy? Annotate `✅ Strategy appropriate` or `💡 Suggestion: [better strategy]`
|
|
118
|
-
8. **[GPU Feasibility]** (if used for algorithm/invariant verification) — Whether formal verification is conducted offline and conclusions can be deployed; whether proof search needs to be relaxed to a differentiable approximation; pass the eight-dimension gate.
|
|
119
|
-
|
|
120
|
-
**Output must never provide analysis alone without a conclusion.**
|
|
121
|
-
|
|
122
|
-
## Relations to Other Skills
|
|
123
|
-
|
|
124
|
-
- **Axiomatization**: Logical deduction is the inference engine of axiom systems; axioms provide the premises, deduction provides the derivation mechanism, and together they constitute a formal system.
|
|
125
|
-
- **Abstraction**: Formal logic is itself a highly abstract structure — stripping away specific content to retain only the form of inference.
|
|
126
|
-
- **Induction and Analogy**: Deduction and induction are complementary — deduction guarantees correctness, induction provides new premises.
|
|
127
|
-
- **Probability and Statistics**: Under uncertainty, classical logic must be extended to probabilistic logic.
|
|
128
|
-
- **Algorithmic Thinking**: Logical deduction provides the formal framework for proving algorithm correctness — verifying program properties is essentially first-order predicate reasoning.
|
|
129
|
-
- **Counterexample Thinking**: Counterexamples are the direct means of falsifying ∀ assertions, forming a dual verification system with deductive proof of truth.
|
|
130
|
-
- **Modern Math Activation**: `../../references/books/abstract-algebra.md` (formal systems), `../../references/books/algebraic-geometry-rising-sea.md` (category-theoretic reasoning).
|
|
@@ -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`(范畴论推理)。
|