math-skill 1.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.en-US.md +313 -0
  2. package/README.md +313 -278
  3. package/agents/math-critic.en.md +235 -0
  4. package/agents/math-critic.md +237 -203
  5. package/commands/abstraction.md +11 -34
  6. package/commands/algorithmic-thinking.md +11 -34
  7. package/commands/ask.md +18 -21
  8. package/commands/axiomatization.md +11 -34
  9. package/commands/causal-inference.md +11 -34
  10. package/commands/discrete-combinatorial.md +11 -34
  11. package/commands/game-theory.md +11 -34
  12. package/commands/induction-analogy.md +11 -34
  13. package/commands/information-theory.md +11 -34
  14. package/commands/logic-deduction.md +11 -34
  15. package/commands/modeling.md +11 -37
  16. package/commands/optimization.md +11 -33
  17. package/commands/probability-statistics.md +11 -36
  18. package/commands/symmetry-invariance.md +11 -34
  19. package/commands/topological-thinking.md +11 -33
  20. package/commands/transformation.md +11 -33
  21. package/knowledge-base/overview.en.md +228 -0
  22. package/knowledge-base/overview.md +230 -230
  23. package/package.json +73 -59
  24. package/references/agentic-workflow.en.md +53 -0
  25. package/references/agentic-workflow.md +55 -0
  26. package/references/books/abstract-algebra.md +124 -0
  27. package/references/books/algebraic-geometry-rising-sea.md +171 -0
  28. package/references/books/differential-geometry.md +140 -0
  29. package/references/books/matrix-analysis.md +146 -0
  30. package/references/books/micro-lie-theory.md +116 -0
  31. package/references/books/optimization-ml.md +164 -0
  32. package/references/books/smooth-manifolds.md +105 -0
  33. package/references/gpu-friendly-math.en.md +65 -0
  34. package/references/gpu-friendly-math.md +67 -0
  35. package/references/inspiration.en.md +113 -0
  36. package/{docs → references}/inspiration.md +2 -0
  37. package/skills/abstraction/SKILL.en.md +117 -0
  38. package/skills/abstraction/SKILL.md +121 -264
  39. package/skills/abstraction/original-texts.en.md +163 -0
  40. package/skills/algorithmic-thinking/SKILL.en.md +132 -0
  41. package/skills/algorithmic-thinking/SKILL.md +138 -371
  42. package/skills/algorithmic-thinking/original-texts.en.md +253 -0
  43. package/skills/axiomatization/SKILL.en.md +144 -0
  44. package/skills/axiomatization/SKILL.md +151 -213
  45. package/skills/axiomatization/original-texts.en.md +154 -0
  46. package/skills/causal-inference/SKILL.en.md +147 -0
  47. package/skills/causal-inference/SKILL.md +151 -374
  48. package/skills/causal-inference/original-texts.en.md +136 -0
  49. package/skills/discrete-combinatorial/SKILL.en.md +124 -0
  50. package/skills/discrete-combinatorial/SKILL.md +131 -286
  51. package/skills/discrete-combinatorial/original-texts.en.md +184 -0
  52. package/skills/game-theory/SKILL.en.md +117 -0
  53. package/skills/game-theory/SKILL.md +123 -318
  54. package/skills/game-theory/original-texts.en.md +131 -0
  55. package/skills/induction-analogy/SKILL.en.md +145 -0
  56. package/skills/induction-analogy/SKILL.md +152 -310
  57. package/skills/induction-analogy/original-texts.en.md +140 -0
  58. package/skills/information-theory/SKILL.en.md +134 -0
  59. package/skills/information-theory/SKILL.md +140 -242
  60. package/skills/information-theory/original-texts.en.md +127 -0
  61. package/skills/logic-deduction/SKILL.en.md +130 -0
  62. package/skills/logic-deduction/SKILL.md +135 -280
  63. package/skills/logic-deduction/original-texts.en.md +160 -0
  64. package/skills/math-research-activator/SKILL.en.md +132 -0
  65. package/skills/math-research-activator/SKILL.md +136 -0
  66. package/skills/math-research-activator/original-texts.en.md +105 -0
  67. package/skills/{meta-selector → math-research-activator}/original-texts.md +104 -104
  68. package/skills/modeling/SKILL.en.md +135 -0
  69. package/skills/modeling/SKILL.md +139 -318
  70. package/skills/modeling/original-texts.en.md +162 -0
  71. package/skills/optimization/SKILL.en.md +129 -0
  72. package/skills/optimization/SKILL.md +135 -292
  73. package/skills/optimization/original-texts.en.md +167 -0
  74. package/skills/probability-statistics/SKILL.en.md +146 -0
  75. package/skills/probability-statistics/SKILL.md +151 -312
  76. package/skills/probability-statistics/original-texts.en.md +191 -0
  77. package/skills/symmetry-invariance/SKILL.en.md +135 -0
  78. package/skills/symmetry-invariance/SKILL.md +139 -358
  79. package/skills/symmetry-invariance/original-texts.en.md +206 -0
  80. package/skills/topological-thinking/SKILL.en.md +124 -0
  81. package/skills/topological-thinking/SKILL.md +128 -273
  82. package/skills/topological-thinking/original-texts.en.md +134 -0
  83. package/skills/transformation/SKILL.en.md +120 -0
  84. package/skills/transformation/SKILL.md +124 -264
  85. package/skills/transformation/original-texts.en.md +204 -0
  86. package/docs/CLAUDE.md +0 -187
  87. package/skills/meta-selector/SKILL.md +0 -188
@@ -0,0 +1,130 @@
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,280 +1,135 @@
1
- ---
2
- name: logic-deduction
3
- description: |
4
- 科研模式触发:检查证明严谨性、形式逻辑分析、谓词逻辑推理验证、量词结构分析、发现逻辑漏洞。
5
- 生活模式触发:理性辩论时识别逻辑谬误、评估日常论证的有效性、检查推理跳跃、决策时确保推理链条可靠。
6
- English (Research): Trigger when checking proof rigor, formal logic analysis, predicate logic verification, quantifier structure analysis, or discovering logical loopholes.
7
- English (Life): Trigger when engaging in rational debate, identifying logical fallacies in everyday arguments, evaluating argument validity in daily life, or ensuring reasoning chains are sound for decision-making.
8
- ---
9
-
10
- # 🧠 逻辑演绎 / Logical 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
- Strictly inferring new true propositions from true premises — every step in the reasoning chain must be legitimate.
23
-
24
- 推理的类型与可靠性:
25
- - **演绎推理(Deduction)**:前提为真 + 规则有效 → 结论必然为真(最可靠)
26
- - **归纳推理(Induction)**:大量具体实例 一般性结论(或然性)
27
- - **溯因推理(Abduction)**:观察结果 + 理论 → 最佳解释(假设性)
28
-
29
- > **数学形式化**(科研模式参考 / Research Mode Reference)
30
- >
31
- > 逻辑演绎具有两层结构:命题逻辑处理真值函数连接词(¬, ∧, ∨, →, ↔),谓词逻辑在此基础上添加量词(∀, ∃)与个体变元。数学证明生活在谓词逻辑之中——仅靠命题逻辑无法表达 "对所有 x,若 P(x) 则 Q(x)" 这类陈述,因此也无法对实际数学论证进行证明检验。
32
- >
33
- > Logical deduction has a two-level structure: propositional logic handles truth-functional connectives (¬, ∧, ∨, →, ↔), while predicate logic adds quantifiers (∀, ∃) and individual variables on top of that. Mathematical proofs live in predicate logic — propositional logic alone cannot express statements like "for all x, if P(x) then Q(x)," and therefore cannot operationalize proof-checking for actual mathematical arguments.
34
- >
35
- > 哥德尔完备性定理(Gödel's Completeness Theorem, 1929):一阶谓词逻辑中,所有有效论证都是可证明的——即若 φ 是一阶逻辑的有效公式,则存在一个形式证明序列从空前提集推导出 φ。这保证了一阶逻辑的演绎能力与语义有效性完全吻合,但仅限于一阶逻辑;二阶逻辑不具备此性质。
36
- >
37
- > 详细数学依据见 `original-texts.md`
38
-
39
- ## 不适用场景 / When NOT to Use
40
-
41
- - **前提本身不确定** `[科研/通用]` ——先确定前提的真假,再进行演绎
42
- - **需要创造性突破而非逻辑验证** `[科研/通用]` ——演绎只能发现已有信息蕴含的结论,不能产生新信息
43
- - **纯粹的估算或直觉判断** `[通用/生活]` ——不需要严格逻辑的场合
44
- - **二阶逻辑问题** `[科研]` ——哥德尔完备性仅覆盖一阶逻辑;二阶有效性不可完全公理化
45
- - **情绪驱动而非逻辑驱动的讨论** `[生活]` ——对方不接受逻辑框架时,演绎无着力点
46
-
47
- ## 何时使用 / When to Use
48
-
49
- ### 科研触发条件 / Research Triggers
50
-
51
- - 阅读论文时,检查其证明或推导的严谨性
52
- - 发现论证中可能存在逻辑跳跃或漏洞
53
- - 验证某个结论是否真的能从前提推导出来
54
- - 分析含 / ∃ 的数学陈述时,验证量词推理的正确性
55
- - 检查二阶逻辑论证的有效性边界
56
-
57
- ### 生活触发条件 / Life Triggers
58
-
59
- - 理性辩论时,识别对方的逻辑谬误
60
- - 做重要决策时,确保推理链条的每一步都站得住脚
61
- - 评估新闻报道或社交媒体论断的可靠性
62
- - 区分 "有人这样说" "所有人都这样"——避免以偏概全
63
- - 识别因果混淆:两件事相关 ≠ 一件事导致另一件事
64
-
65
- ## 方法流程 / Method
66
-
67
- ### 第一步:识别前提 / Identify the Premises
68
-
69
- **科研模式 / Research Mode:**
70
- 列出论证中的所有前提(假设、已知条件、引用的定理)。标注每个前提的状态:
71
- - **已证定理**:有严格证明的命题(如 "素数无穷")
72
- - **公理**:被接受的起点(如 ZF 集合论公理)
73
- - **假设**:尚未证明但被暂时接受的命题(如 "黎曼猜想")
74
- - **经验事实**:来自观察或实验的命题
75
-
76
- 同时标注前提的逻辑层次:纯命题前提(不含量词)还是谓词前提(含/ ∃)。
77
-
78
- **生活模式 / Life Mode:**
79
- 找出论证的前提——这个论点基于什么事实或假设?前提是否成立?有没有未说出的前提?
80
- - 哪些是已经确认的事实?哪些只是假设?
81
- - 有没有被省略但暗中使用的前提?
82
-
83
- **共通要点 / Shared Key Point:**
84
- 前提的质量决定推理的质量——前提不成立,结论必然不可靠。
85
-
86
- ### 第二步:检查推理规则 / Check the Rules of Inference
87
-
88
- **科研模式 / Research Mode:**
89
- 验证每一步推理是否使用了有效的推理规则。
90
-
91
- **命题逻辑规则:**
92
- - **假言推理(Modus Ponens)**:P → Q, P ⊢ Q
93
- - **拒取式(Modus Tollens)**:P Q, ¬Q ⊢ ¬P
94
- - **假言三段论**:P Q, Q R P → R
95
- - **析取三段论**:P ∨ Q, ¬P ⊢ Q
96
- - **合取引入**:P, Q P Q
97
- - **双重否定消除**:¬¬P ⊢ P
98
-
99
- **谓词逻辑规则:**
100
- - **全称实例化(UI)**:∀x P(x) P(a),从普遍到特殊
101
- - **全称泛化(UG)**:P(a) 对任意 a 成立 ⊢ ∀x P(x),从特殊到普遍(要求 a 是任意个体,不能是特定常元)
102
- - **存在实例化(EI)**:∃x P(x) P(c),引入新常元 c 使得 P(c) 成立(c 必须是新名称,不能与已有常元冲突)
103
- - **存在泛化(EG)**:P(a)∃x P(x),从特定个体推出存在性
104
-
105
- **其他推理框架:**
106
- - **消解原理(Resolution)**:从 (P Q) (¬P R) 消解出 (Q ∨ R),适用于自动化证明
107
- - **自然演绎系统(Natural Deduction)**:引入/消除规则对称组织,更贴近人类推理习惯
108
-
109
- **生活模式 / Life Mode:**
110
- 检查每一步推理是否合理——从A到B的跳跃是否真的有逻辑支撑?是"因此"还是"碰巧"?
111
- - 从 "因为A" 到 "所以B"——这个 "因此" 是真的有逻辑支撑,还是只是碰巧?
112
- - 常见的有效推理:"如果下雨地就会湿" + "下雨了" → "地湿了"(这是可靠的)
113
- - 常见的无效推理:"如果下雨地就会湿" + "地湿了" → "下雨了"(地湿可能有其他原因)
114
-
115
- **共通要点 / Shared Key Point:**
116
- 推理规则是推理的合法性来源——没有有效规则支撑的步骤就是跳跃。
117
-
118
- ### 第三步:检查常见逻辑谬误 / Check for Common Fallacies
119
-
120
- **科研模式 / Research Mode:**
121
-
122
- **命题逻辑谬误:**
123
- - **肯定后件**:P Q, Q ⊢ P(无效!)
124
- - **否定前件**:P → Q, ¬P ⊢ ¬Q(无效!)
125
- - **混淆充分与必要条件**:P 是 Q 的充分条件 ≠ P 是 Q 的必要条件
126
- - **循环论证**:结论被隐含地用作前提
127
- - **稻草人谬误**:攻击被歪曲的版本而非原论证
128
-
129
- **谓词逻辑谬误:**
130
- - **量词移位谬误**:∀x∃y R(x,y) ≠ ∃y∀x R(x,y)——前者为"每人各有其所爱",后者为"有人被所有人所爱"
131
- - **非法全称泛化**:从 P(a) 对特定 a 成立推出 ∀x P(x)——UG 要求 a 必须是任意个体
132
- - **混淆自由与约束变量**:同一变元在公式不同位置的角色不同
133
- - **混淆 ∀ 与 ∃**:"所有天鹅是白的"(∀)与 "存在白色天鹅"(∃)强度不同
134
- - **偷换概念(Equivocation)**:同一词项在不同前提中被赋予不同含义
135
- - **虚假二分(False Dilemma)**:将 P ∨ Q 呈现为仅有的两种选择,隐含地排除 ¬P ∧ ¬Q
136
-
137
- **生活模式 / Life Mode:**
138
- 用日常语言识别常见谬误:
139
- - **偷换概念**:讨论中悄悄改变了关键词的含义——你说的 "成功" 和我说的 "成功" 是同一件事吗?
140
- - **循环论证**:用结论来证明前提——"他是对的,因为他说的没错;他说的没错,因为他是对的"
141
- - **以偏概全**:从少数例子推导一般规律——"我认识三个人都这样,所以所有人都这样"
142
- - **因果倒置**:把结果当成了原因——"成功的人都早起"≠"早起就能成功"
143
- - **肯定后件**:把结果当作原因的证据——"地湿了,所以一定下雨了"(地湿可能因为洒水车)
144
- - **否定前件**:条件没触发就否定结论——"如果下雨地就会湿" + "没下雨" → "地不会湿"(错误)
145
- - **虚假二分**:只给出两个选项,忽略其他可能——"你要么支持我,要么反对我"
146
-
147
- **共通要点 / Shared Key Point:**
148
- 谬误是推理的漏洞——识别谬误比记住谬误的名称更重要,关键是看每一步推理是否真正成立。
149
-
150
- ### 第四步:分析量词结构 / Analyze Quantifier Structure
151
-
152
- **科研模式 / Research Mode:**
153
- ∀ 与 ∃ 的嵌套顺序决定逻辑强度:
154
- - **∀∃ 结构**(较弱):∀x∃y R(x,y)——对每个 x,可以构造各自的 y。这是构造性可满足的。
155
- - **∃∀ 结构**(较强):∃y∀x R(x,y)——存在一个统一的 y 对所有 x 成立。这往往需要选择公理(Axiom of Choice)才能保证。
156
-
157
- 分析要点:
158
- - 量词嵌套层数越多,逻辑结构越精密,推理越需谨慎
159
- - 相邻同类型量词可交换(∀x∀y = ∀y∀x,∃x∃y = ∃y∃x),但不同类型量词不可交换
160
- - 量词否定等值:¬∀x P(x) ≡ ∃x ¬P(x),¬∃x P(x) ≡ ∀x ¬P(x)
161
-
162
- **生活模式 / Life Mode:**
163
- 这个论点说的是"所有"还是"有些"?——"大多数人这样"≠"所有人这样","有时有效"≠"总是有效"
164
- - "所有人都这样"是一个非常强的断言——只需要一个反例就能推翻
165
- - "有些人这样"是一个较弱的断言——更容易成立,但推论力也较弱
166
- - "大多数人这样"介于两者之间——既不是全称也不是存在,是概率性断言
167
-
168
- **共通要点 / Shared Key Point:**
169
- 论断的范围决定其强度和脆弱性——范围越广,越容易被推翻;范围越窄,推论力越弱。
170
-
171
- ### 第五步:验证推理链完备性 / Verify the Completeness of the Inference Chain
172
-
173
- **科研模式 / Research Mode:**
174
- 检查从前提到结论的推理链是否完整,是否存在逻辑跳跃。每一步是否都有明确的理由?
175
- - 前提集 Γ 能否形式推导出结论 φ?即是否存在有限序列 φ₁, φ₂, ..., φₙ = φ,其中每个 φᵢ 或属于 Γ,或由前面公式通过有效规则得出?
176
- - 若推理链不完整,标注缺失的中间步骤及其所需规则
177
-
178
- **生活模式 / Life Mode:**
179
- 从前提到结论的每一步是否都站得住脚?——有没有哪一步是跳跃而非推理?
180
- - 逐一检查:从前提到结论,每一步是否都有逻辑支撑?
181
- - 跳跃是最常见的漏洞——从A直接跳到C,但A到C之间缺少B的支撑
182
- - 完整的推理链:A→B→C,每一步都有理由;跳跃的推理链:A→?→C,中间缺失
183
-
184
- **共通要点 / Shared Key Point:**
185
- 推理链的完整性是论证的命脉——缺失一步,整条链断裂。
186
-
187
- ### 第六步:评估结论强度 / Assess the Strength of the Conclusion
188
-
189
- **科研模式 / Research Mode:**
190
- 结论的逻辑强度分类:
191
- - **必然的(Necessary)**:演绎有效,前提真则结论必然真
192
- - **或然的(Probable)**:归纳支持,前提提供概率性证据
193
- - **假设性的(Hypothetical)**:溯因推理,结论是最佳解释但未被验证
194
-
195
- 同时评估结论的适用范围:全称性结论(∀)还是存在性结论(∃)?条件性结论(→)还是无条件结论?
196
-
197
- **生活模式 / Life Mode:**
198
- 结论有多强?——"必然如此"还是"可能如此"?是确定性结论还是倾向性推断?
199
- - **确定性结论**:前提成立则结论一定成立——"如果他是独生子,则他没有兄弟姐妹"
200
- - **倾向性推断**:前提支持结论但不保证——"经常锻炼的人通常更健康"
201
- - **猜测性结论**:只是可能性,远未确认——"他可能是故意这么做的"
202
-
203
- 区分清楚再下判断——不要把倾向性推断当成确定性结论来使用。
204
-
205
- **共通要点 / Shared Key Point:**
206
- 结论的强度必须如实评估——不要把"可能"夸大为"必然",也不要把"必然"削弱为"可能"。
207
-
208
- ### 第七步:证明策略选择 / Select Proof Strategy
209
-
210
- **科研模式 / Research Mode:**
211
- 根据论证特征选择合适的证明方法:
212
- - **直接证明(Direct Proof)**:从前提逐步推导至结论,最自然
213
- - **反证法(Proof by Contradiction)**:假设 ¬φ,推导出矛盾,从而证明 φ。适用于否定性结论或难以直接构造的论证
214
- - **逆否证明(Proof by Contrapositive)**:证明 ¬Q → ¬P 以建立 P → Q,当逆否方向更易推理时使用
215
- - **穷举证明(Proof by Exhaustion)**:将所有情况逐一验证,适用于有限且可枚举的情形
216
- - **构造性证明(Constructive Proof)**:直接构造满足条件的对象,比存在性证明(仅证明 ∃x P(x) 而不给出 x)更有信息量
217
-
218
- **生活模式 / Life Mode:**
219
- 如何组织你的论证——从已知事实出发逐步推导,比直接断言更有说服力
220
- - **逐步推导**:从对方认可的事实出发,一步步推导到你想要的结论——比直接断言更有说服力
221
- - **反面质疑**:如果对方论点成立,会出现什么矛盾或荒谬结果?——让对方自己看到问题
222
- - **举证责任**:谁做出更强的断言,谁就需要更强的证据——"所有人都这样"需要大量证据,"有些人这样"只需一例
223
-
224
- **共通要点 / Shared Key Point:**
225
- 论证策略的选择决定了论证的说服力和可靠性——好的策略让推理清晰可见,而不是跳跃式断言。
226
-
227
- ## 常见错误 / Common Errors
228
-
229
- | 错误 / Error | 数学批评 / Mathematical Critique | 正确做法 / Correct Approach |
230
- |-------------|-------------------------------|---------------------------|
231
- | 混淆充分条件与必要条件 `[科研]` | P → Q 成立不代表 Q → P 成立 | 明确区分充分、必要、充要条件 |
232
- | 肯定后件谬误 `[科研/生活]` | 从 "如果下雨则地湿" 和 "地湿" 推出 "下雨了" 是无效的 | 只有 Modus Ponens 和 Modus Tollens 是有效的假言推理 |
233
- | 隐藏前提 `[科研/通用]` | 推理中使用了未声明的前提 | 暴露所有前提,逐一检验 |
234
- | 无限倒退 `[科研]` | 每个前提都需要另一个前提来证明 | 找到不需要证明的起点(公理/经验事实)|
235
- | 把相关性当作因果性 `[生活]` | 两个变量相关不等于一个导致另一个 | 相关只是因果的必要非充分条件 |
236
- | 以偏概全 `[生活]` | 从少数例子推导一般规律 | 全称断言需要全称证据,或降低断言范围 |
237
- | 偷换概念 `[生活]` | 同一词项在不同位置含义不同 | 明确每个关键词的精确含义,保持一致 |
238
- | 量词移位谬误 `[科研]` | ∀x∃y R(x,y) ≠ ∃y∀x R(x,y),前者弱后者强 | 严格遵守量词顺序,不可随意交换不同类型量词 |
239
- | 非法全称泛化 `[科研]` | 从 P(a) 对特定 a 成立推出 ∀x P(x),违反 UG 的任意性要求 | UG 仅适用于任意个体 a,不适用于特定常元 |
240
- | 混淆自由与约束变量 `[科研]` | 同一变元 x 在 ∀x P(x) 中约束、在 P(x) 中自由,含义不同 | 明确标注变元的约束/自由状态,避免在同一证明中混用 |
241
- | 混淆 ∀ 与 ∃ `[科研/生活]` | "所有元素满足 P" 远强于 "存在元素满足 P" | 严格区分全称断言与存在断言的逻辑强度 |
242
-
243
- ## 操作规程 / Operating Procedure
244
-
245
- 当本 skill 被触发时,首先选择模式:
246
-
247
- - **科研模式**:涉及形式逻辑证明、谓词逻辑、量词结构、数学论证验证
248
- - **生活模式**:涉及日常论证评估、辩论谬误识别、决策推理检查
249
-
250
- ### 科研模式输出格式 / Research Mode Output Format
251
-
252
- 1. **[前提清单]** — 列出所有前提,标注 `[已证]` / `[公理]` / `[假设]` / `[经验]`,并标注逻辑层次 `[命题]` / `[谓词]`
253
- 2. **[推理链重构]** — 用形式逻辑语言重述推理过程,每一步标注使用的推理规则(含 UI/UG/EI/EG 等谓词规则)
254
- 3. **[谬误检查]** — 逐一检查命题逻辑与谓词逻辑谬误,标注 `✅ 无此谬误` 或 `❌ 发现 [具体谬误]`
255
- 4. **[量词结构分析]** — 若有 ∀ / ∃ 嵌套,标注量词顺序与逻辑强度 `∀∃(弱)` / `∃∀(强)`
256
- 5. **[完整性评估]** — 推理链是否完整?标注 `✅ 完整` 或 `⚠️ 跳跃:[说明]`
257
- 6. **[结论强度]** — 标注 `[必然]` / `[或然]` / `[假设性]`,并标注适用范围 `[全称]` / `[存在]` / `[条件]`
258
- 7. **[证明策略评估]** — 当前论证使用了何种证明策略?是否有更优策略?标注 `✅ 策略适当` 或 `💡 建议:[更优策略]`
259
-
260
- **输出必须包含以上 7 项,不得只输出分析性文字而不给出结论。**
261
-
262
- ### 生活模式输出格式 / Life Mode Output Format
263
-
264
- 1. **[前提]:[列出]** — 论证基于什么事实或假设?哪些是确认的?哪些是未说出的?
265
- 2. **[推理步骤]:[逐步]** — 从前提到结论每一步是否合理?有没有跳跃?
266
- 3. **[谬误检查]:[排查]** — 有没有偷换概念、循环论证、以偏概全、因果倒置等?
267
- 4. **[量词分析]:[区分]** — 是"所有"还是"有些"?"大多数人"≠"所有人"
268
- 5. **[结论强度]:[评估]** — 结论是确定性的还是倾向性的?是"必然"还是"可能"?
269
- 6. **[论证改进]:[建议]** — 如何让论证更有说服力?哪些步骤需要补强?
270
-
271
- **输出必须包含以上 6 项,不得只输出分析性文字而不给出结论。**
272
-
273
- ## 与其他 skill 的关系 / Relations to Other Skills
274
-
275
- - **公理化思想**:逻辑演绎是公理体系的推理引擎;公理提供前提,演绎提供推导机制,二者共同构成形式系统
276
- - **抽象化思想**:形式逻辑本身就是高度抽象的结构——将具体内容剥离后只保留推理形式
277
- - **归纳与类比**:演绎与归纳互补——演绎保证正确性,归纳提供新前提
278
- - **概率与统计**:在不确定性下,经典逻辑需要扩展为概率逻辑
279
- - **算法思想**:逻辑演绎为算法的正确性证明提供形式框架——程序的性质验证本质上是一阶谓词推理
280
- - **反例思想**:反例是证伪 ∀ 断言的直接手段,与演绎证真构成双重验证体系
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`(范畴论推理)。