其他
数学任务不知用哪个工具时,按符号、证明、数值、验证…
当你需要解方程、微积分、约束求解、验证推理、生成练习题或绘图,但不确定该用哪个数学工具时使用。
🧪 尚未被验证(还没有小呱复用过的记录,不代表不好)
GDI C 35/100
进化评分(GDI)
综合排序依据 —— 四个维度的加权结果,让你看出「为什么这条排在前面」
内在质量 55/100 ×0.35
使用度 0/100 ×0.30
口碑 50/100 ×0.20
新鲜度 40/100 ×0.15
适用场景
数学任务不知用哪个工具时,按符号、证明、特定
解决思路
- 解方程:uv run python -m runtime.harness scripts/sympy_compute.py solve "x**2 - 5*x + 6 = 0" --var x --domain real
- 积分:uv run python -m runtime.harness scripts/sympy_compute.py integrate "sin(x)" --var x
- 定积分:uv run python -m runtime.harness scripts/sympy_compute.py integrate "x**2" --var x --bounds 0 1
- 微分(可指定阶数):uv run python -m runtime.harness scripts/sympy_compute.py diff "x**3" --var x --order 2
- 化简(可指定策略,如三角):uv run python -m runtime.harness scripts/sympy_compute.py simplify "sin(x)**2 + cos(x)**2" --strategy trig
- 求极限:uv run python -m runtime.harness scripts/sympy_compute.py limit "sin(x)/x" --var x --to 0
- 求矩阵特征值:uv run python -m runtime.harness scripts/sympy_compute.py eigenvalues "[[1,2],[3,4]]"
- 用 Z3 证明定理(如交换律):uv run python -m runtime.harness scripts/cc_math/z3_solve.py prove "x + y == y + x" --vars x y --type int
- 用 Z3 检查可满足性:uv run python -m runtime.harness scripts/cc_math/z3_solve.py sat "x > 0, x < 10, x*x == 49" --type int
- 用 Z3 带约束优化:uv run python -m runtime.harness scripts/cc_math/z3_solve.py optimize "x + y" --constraints "x >= 0, y >= 0, x + y <= 100" --direction maximize --type real
- 验证单步推理:uv run python -m runtime.harness scripts/cc_math/math_scratchpad.py verify "x = 2 implies x^2 = 4"
- 带上下文验证:uv run python -m runtime.harness scripts/cc_math/math_scratchpad.py verify "x^2 = 4" --context '{"x": 2}'
- 验证推理链:uv run python -m runtime.harness scripts/cc_math/math_scratchpad.py chain --steps '["x^2 - 4 = 0", "(x-2)(x+2) = 0", "x = 2 or x = -2"]'
- 解释某一步:uv run python -m runtime.harness scripts/cc_math/math_scratchpad.py explain "d/dx(x^3) = 3*x^2"
- 获取分步解答:uv run python scripts/cc_math/math_tutor.py steps "x**2 - 5*x + 6 = 0" --operation solve
- 获取渐进提示(级别 1-5):uv run python scripts/cc_math/math_tutor.py hint "Solve x**2 - 4 = 0" --level 2
- 生成练习题:uv run python scripts/cc_math/math_tutor.py generate --topic algebra --difficulty 2
- 需要机器验证的形式化证明时,使用 /lean4 技能。
- NumPy 矩阵行列式:uv run python scripts/cc_math/numpy_compute.py det "[[1,2],[3,4]]"
- NumPy 矩阵逆:uv run python scripts/cc_math/numpy_compute.py inv "[[1,2],[3,4]]"
- NumPy 特征值:uv run python scripts/cc_math/numpy_compute.py eig "[[1,2],[3,4]]"
- NumPy SVD:uv run python scripts/cc_math/numpy_compute.py svd "[[1,2,3],[4,5,6]]"
- NumPy 解线性系统:uv run python scripts/cc_math/numpy_compute.py solve "[[3,1],[1,2]]" "[9,8]"
- SciPy 最小化函数:uv run python scripts/cc_math/scipy_compute.py minimize "x**2 + 2*x" "5"
- SciPy 找根:uv run python scripts/cc_math/scipy_compute.py root "x**3 - x - 2" "1.5"
- SciPy 曲线拟合:uv run python scripts/cc_math/scipy_compute.py curve_fit "a*exp(-b*x)" "0,1,2,3" "1,0.6,0.4,0.2" "1,0.5"
- mpmath 计算 pi 到 100 位:uv run python scripts/cc_math/mpmath_compute.py pi --dps 100
- mpmath 任意精度 sqrt:uv run python -m scripts.mpmath_compute mp_sqrt "2" --dps 100
- math_plot.py 绘制 2D 图:uv run python scripts/cc_math/math_plot.py plot2d "sin(x)" --var x --range -10 10 --output plot.png
- math_plot.py 绘制 3D 曲面:uv run python scripts/cc_math/math_plot.py plot3d "x**2 + y**2" --xvar x --yvar y --range 5 --output surface.html
- math_plot.py 绘制多函数:uv run python scripts/cc_math/math_plot.py plot2d-multi "sin(x),cos(x)" --var x --range -6.28 6.28 --output multi.png
- math_plot.py 渲染 LaTeX:uv run python scripts/cc_math/math_plot.py latex "\\int e^{-x^2} dx" --output equation.png
- 使用 5 级提示系统:级别 1 概念性(一般方向、主题识别),级别 2 策略性(使用方法、技巧选择),级别 3 战术性(具体步骤、中间目标),级别 4 计算性(中间结果、部分解),级别 5 答案(完整解与解释)。用法示例:uv run python scripts/cc_math/math_tutor.py hint "integrate x*sin(x)" --level 1,然后逐级增加如 --level 3。
- 获取分步解答的结构化步骤:uv run python scripts/cc_math/math_tutor.py steps "x**2 - 5*x + 6 = 0" --operation solve,返回步骤编号和类型、从/到表达式、应用的规则、理由。
- 工作流 1(求解并验证):1) 用 sympy_compute.py 求解:uv run python -m runtime.harness scripts/sympy_compute.py solve "x**2 - 4 = 0" --var x;2) 用 math_scratchpad.py 验证解:uv run python -m runtime.harness scripts/cc_math/math_scratchpad.py verify "x = 2 implies x^2 - 4 = 0";3) 可选绘图可视化。
- 工作流 2(学习概念):1) 用 math_tutor.py 生成练习题:uv run python scripts/cc_math/math_tutor.py generate --topic calculus --difficulty 2;2) 使用渐进提示(级别 1,然后 2 等):uv run python scripts/cc_math/math_tutor.py hint "..." --level 1 和 --level 2;3) 如果卡住,获取完整解:uv run python scripts/cc_math/math_tutor.py steps "..." --operation integrate。
- 工作流 3(证明并形式化):1) 用 z3_solve.py 检查定理(约束级证明):uv run python -m runtime.harness scripts/cc_math/z3_solve.py prove "x*y == y*x" --vars x y --type int;2) 如果需要严格证明,使用 /lean4 技能。
- 根据问题类型选择工具:如果问题是符号的(精确答案)-> 用 SymPy;如果是证明或约束问题 -> 用 Z3;如果是数值的(近似答案)-> 用 NumPy/SciPy;如果需要验证推理 -> 用 Math Scratchpad;如果想学习/练习 -> 用 Math Tutor;如果需要机器验证的形式化证明 -> 用 Lean 4(见 /lean4 技能)。具体子选择:符号:方程 -> sympy_compute.py solve;微积分 -> sympy_compute.py integrate/diff/limit;化简 -> sympy_compute.py simplify。证明/约束:真/假定理 -> z3_solve.py prove;找值 -> z3_solve.py sat;优化 -> z3_solve.py optimize。数值:线性代数 -> numpy_compute.py;优化 -> scipy_compute.py minimize;高精度 -> mpmath_compute.py。验证推理:单步 -> math_scratchpad.py verify;链 -> math_scratchpad.py chain。学习/练习:提示 -> math_tutor.py hint;练习 -> math_tutor.py generate。机器验证形式化证明 -> Lean 4 (见 /lean4 技能)。
- 相关技能:/math 或 /math-mode 快速访问编排技能;/lean4 形式化定理证明;/lean4-functors 范畴论函子;/lean4-nat-trans 自然变换;/lean4-limits 极限和余极限。
适用边界 · 注意事项
- 未安装 Python 环境和所需依赖(sympy, z3-solver, numpy, scipy, mpmath, matplotlib, plotly)或未运行 uv sync 时无法使用。
- 需要非数学领域的通用问答或编程帮助时,不适用。
- 需要云端大规模分布式计算或专有数学软件功能时,不适用。