math
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/math - Unified Math Capabilities
/math - 统一数学能力
One entry point for all computation and explanation. I route to the right tool based on your request.
For formal proofs, use instead.
/prove所有计算与讲解的统一入口。我会根据你的请求匹配合适的工具。
如需形式化证明,请使用 。
/proveQuick Examples
快速示例
| You Say | I Use |
|---|---|
| "Solve x² - 4 = 0" | SymPy solve |
| "Integrate sin(x) from 0 to π" | SymPy integrate |
| "Eigenvalues of [[1,2],[3,4]]" | SymPy eigenvalues |
| "Is x² + 1 > 0 for all x?" | Z3 prove |
| "Convert 5 miles to km" | Pint |
| "Explain what a functor is" | Category theory skill |
| 你输入 | 我使用 |
|---|---|
| "Solve x² - 4 = 0" | SymPy solve |
| "Integrate sin(x) from 0 to π" | SymPy integrate |
| "Eigenvalues of [[1,2],[3,4]]" | SymPy eigenvalues |
| "Is x² + 1 > 0 for all x?" | Z3 prove |
| "Convert 5 miles to km" | Pint |
| "Explain what a functor is" | 范畴论技能 |
Computation Scripts
计算脚本
SymPy (Symbolic Math)
SymPy(符号数学)
bash
uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/sympy_compute.py" <command> <args>| Command | Description | Example |
|---|---|---|
| Solve equations | |
| Definite/indefinite integral | |
| Derivative | |
| Simplify expression | |
| Compute limit | |
| Taylor expansion | |
| Solve ODE | |
| Laplace transform | |
Matrix Operations:
| Command | Description |
|---|---|
| Determinant |
| Eigenvalues |
| Eigenvectors with multiplicities |
| Matrix inverse |
| Transpose |
| Row echelon form |
| Matrix rank |
| Null space basis |
| Linear system Ax=b |
| Characteristic polynomial |
Number Theory:
| Command | Description |
|---|---|
| Factor polynomial |
| Prime factorization |
| Primality test |
| Greatest common divisor |
| Least common multiple |
| Modular inverse |
Combinatorics:
| Command | Description |
|---|---|
| C(n,k) |
| n! |
| P(n,k) |
| Integer partitions p(n) |
| Catalan numbers |
| Bell numbers |
bash
uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/sympy_compute.py" <command> <args>| 命令 | 描述 | 示例 |
|---|---|---|
| 求解方程 | |
| 定积分/不定积分 | |
| 求导 | |
| 化简表达式 | |
| 计算极限 | |
| 泰勒展开 | |
| 求解常微分方程 | |
| 拉普拉斯变换 | |
矩阵运算:
| 命令 | 描述 |
|---|---|
| 行列式 |
| 特征值 |
| 特征向量(含重数) |
| 矩阵逆 |
| 转置 |
| 行最简形 |
| 矩阵秩 |
| 零空间基 |
| 线性方程组Ax=b求解 |
| 特征多项式 |
数论:
| 命令 | 描述 |
|---|---|
| 多项式因式分解 |
| 素因数分解 |
| 素性测试 |
| 最大公约数 |
| 最小公倍数 |
| 模逆元 |
组合数学:
| 命令 | 描述 |
|---|---|
| 组合数C(n,k) |
| 阶乘n! |
| 排列数P(n,k) |
| 整数分拆p(n) |
| 卡特兰数 |
| 贝尔数 |
Z3 (Constraint Solving)
Z3(约束求解)
bash
uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/z3_solve.py" <command> <args>| Command | Use Case |
|---|---|
| Is this satisfiable? |
| Is this always true? |
| Find min/max subject to constraints |
bash
uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/z3_solve.py" <command> <args>| 命令 | 使用场景 |
|---|---|
| 判断是否可满足 |
| 判断是否恒成立 |
| 带约束的极值求解 |
Pint (Units)
Pint(单位转换)
bash
uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/pint_compute.py" convert <value> <from_unit> <to_unit>Example:
convert 5 miles kilometersbash
uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/pint_compute.py" convert <value> <from_unit> <to_unit>示例:
convert 5 miles kilometersMath Router (Auto-Route)
数学路由工具(自动匹配)
bash
uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/math_router.py" route "<natural language request>"Returns the exact command to run. Use when unsure which script.
bash
uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/math_router.py" route "<natural language request>"返回要执行的具体命令。当你不确定使用哪个脚本时使用此工具。
Topic Skills (For Explanation)
主题技能(用于讲解)
When the request is "explain X" or "what is X", I reference these:
| Topic | Skill Location | Key Concepts |
|---|---|---|
| Abstract Algebra | | Groups, rings, fields, homomorphisms |
| Category Theory | | Functors, natural transformations, limits |
| Complex Analysis | | Analytic functions, residues, contour integrals |
| Functional Analysis | | Banach spaces, operators, spectra |
| Linear Algebra | | Matrices, eigenspaces, decompositions |
| Mathematical Logic | | Propositional, predicate, proof theory |
| Measure Theory | | Lebesgue, σ-algebras, integration |
| Real Analysis | | Limits, continuity, convergence |
| Topology | | Open sets, compactness, connectedness |
| ODEs/PDEs | | Differential equations, boundary problems |
| Optimization | | Convex, LP, gradient methods |
| Numerical Methods | | Approximation, error analysis |
| Graph/Number Theory | | Graphs, primes, modular arithmetic |
| Information Theory | | Entropy, coding, channels |
当请求为“解释X”或“什么是X”时,我会参考以下内容:
| 主题 | 技能位置 | 核心概念 |
|---|---|---|
| 抽象代数 | | 群、环、域、同态 |
| 范畴论 | | 函子、自然变换、极限 |
| 复分析 | | 解析函数、留数、围道积分 |
| 泛函分析 | | 巴拿赫空间、算子、谱 |
| 线性代数 | | 矩阵、特征空间、分解 |
| 数理逻辑 | | 命题逻辑、谓词逻辑、证明论 |
| 测度论 | | 勒贝格测度、σ-代数、积分 |
| 实分析 | | 极限、连续性、收敛性 |
| 拓扑学 | | 开集、紧性、连通性 |
| 常微分方程/偏微分方程 | | 微分方程、边值问题 |
| 优化理论 | | 凸优化、线性规划、梯度方法 |
| 数值方法 | | 近似计算、误差分析 |
| 图论/数论 | | 图、素数、模算术 |
| 信息论 | | 熵、编码、信道 |
Routing Logic
路由逻辑
I decide based on your request:
"solve/calculate/compute" → SymPy (exact symbolic)
"is X always true?" → Z3 (constraint proving)
"convert units" → Pint
"explain/what is" → Topic skill for context
"prove formally" → Redirect to /prove我会根据你的请求做出判断:
"solve/calculate/compute" → SymPy(精确符号计算)
"is X always true?" → Z3(约束证明)
"convert units" → Pint
"explain/what is" → 主题技能(提供上下文)
"prove formally" → 重定向到 /proveExamples
示例
Solve Equation
求解方程
User: Solve x² - 5x + 6 = 0
Claude: uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/sympy_compute.py" solve "x**2 - 5*x + 6" --var x
Result: x = 2 or x = 3用户:Solve x² - 5x + 6 = 0
Claude: uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/sympy_compute.py" solve "x**2 - 5*x + 6" --var x
结果:x = 2 或 x = 3Compute Eigenvalues
计算特征值
User: Find eigenvalues of [[2, 1], [1, 2]]
Claude: uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/sympy_compute.py" eigenvalues "[[2,1],[1,2]]"
Result: {1: 1, 3: 1} (eigenvalue 1 with multiplicity 1, eigenvalue 3 with multiplicity 1)用户:Find eigenvalues of [[2, 1], [1, 2]]
Claude: uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/sympy_compute.py" eigenvalues "[[2,1],[1,2]]"
结果:{1: 1, 3: 1} (特征值1的重数为1,特征值3的重数为1)Prove Inequality
证明不等式
User: Is x² + y² ≥ 2xy always true?
Claude: uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/z3_solve.py" prove "x**2 + y**2 >= 2*x*y"
Result: PROVED (equivalent to (x-y)² ≥ 0)用户:Is x² + y² ≥ 2xy always true?
Claude: uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/z3_solve.py" prove "x**2 + y**2 >= 2*x*y"
结果:PROVED(等价于(x-y)² ≥ 0)Convert Units
单位转换
User: How many kilometers in 26.2 miles?
Claude: uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/pint_compute.py" convert 26.2 miles kilometers
Result: 42.16 km用户:26.2英里等于多少公里?
Claude: uv run python "$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/pint_compute.py" convert 26.2 miles kilometers
结果:42.16 kmWhen to Use /prove Instead
何时使用 /prove 替代
Use when you need:
/prove- Machine-verified formal proof (Lean 4)
- Category theory proofs (functors, Yoneda, etc.)
- Publication-quality verification
- Abstract algebra proofs
/math/prove当你需要以下功能时,使用 :
/prove- 机器验证的形式化证明(Lean 4)
- 范畴论证明(函子、米田引理等)
- 可用于发表的验证结果
- 抽象代数证明
/math/prove