
Math Reasoning
- 1.6k installs
- 255 repo stars
- Updated February 27, 2026
- lingzhi227/agent-research-skills
math-reasoning is an agent skill for formal mathematical derivations, proofs, notation, and LaTeX output in research papers.
About
The math-reasoning skill performs formal mathematical reasoning for research papers with publication-quality LaTeX output. Task types include derive for step-by-step equation derivation with boxed results, prove for direct contradiction induction or cases proofs, formalize for variable definitions and assumptions, stats for statistical test selection with p-values and effect sizes, notation for symbol tables, and verify for dimensional consistency and gradient checks. Rules require defining all symbols before use, consistent notation, numbered referenced equations, explicit assumptions, and cited lemmas. References include notation-guide.md and proof-templates.md. Use when users need mathematical derivations, theorem proofs, or statistical analysis formalization for papers.
- Tasks: derive, prove, formalize, stats, notation, verify.
- Step-by-step derivations with rule justification and boxed results.
- Formalize: variables, domains, assumptions, objective functions.
- Stats task uses notation-guide decision tree for test selection.
- Define all symbols; number equations referenced later.
Math Reasoning by the numbers
- 1,572 all-time installs (skills.sh)
- +62 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #152 of 2,064 Data Science & ML skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Aug 5, 2026 (Skillselion catalog sync)
math-reasoning capabilities & compatibility
- Capabilities
- step by step derivation · formal proof writing · problem formalization · notation and stats test tables
- Use cases
- research · data analysis · documentation
What math-reasoning says it does
Perform rigorous mathematical reasoning and produce publication-quality LaTeX output.
Define ALL symbols before first use
npx skills add https://github.com/lingzhi227/agent-research-skills --skill math-reasoningAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1.6k |
|---|---|
| repo stars | ★ 255 |
| Security audit | 3 / 3 scanners passed |
| Last updated | February 27, 2026 |
| Repository | lingzhi227/agent-research-skills ↗ |
How do I derive an equation, write a proof, or formalize a problem setting in LaTeX?
Derive equations, write proofs, formalize problem settings, and generate LaTeX math for research papers.
Who is it for?
Researchers writing papers needing rigorous derivations, proofs, or statistical formalization.
Skip if: Skip for implementation coding or non-mathematical writing without formal math needs.
When should I use this skill?
User needs mathematical derivations, theorem proofs, notation tables, or stats test selection.
What you get
Publication-quality LaTeX math with justified steps, defined symbols, and appropriate proof or test structure.
- LaTeX macro strings
- Unicode symbol reference tables
By the numbers
- Covers 10+ core ML spaces and set symbols in reference tables
- Includes dedicated probability and statistics notation section
Files
Mathematical Reasoning
Perform rigorous mathematical reasoning and produce publication-quality LaTeX output.
Input
$0— Task type:derive,prove,formalize,stats,notation,verify$1— Context: equation, theorem statement, problem description, or data description
Tasks
derive — Step-by-step equation derivation
Show every intermediate step. Justify each with the rule applied. Box final result with \boxed{}. Number important equations with \label{eq:name}.
prove — Formal theorem proof
Use appropriate technique: direct, contradiction, induction, construction, or cases. See references/proof-templates.md for LaTeX templates.
formalize — Problem setting formalization
Convert informal description into formal mathematical framework with: variable definitions, domain/range specifications, assumptions, objective function.
stats — Statistical test selection
Use the decision tree in references/notation-guide.md to select appropriate tests. Report p-values, effect sizes, confidence intervals.
notation — Generate notation table
Create a \begin{table} with all symbols used in the paper. Use standard ML notation from references/notation-guide.md.
verify — Check mathematical correctness
Verify: dimensional consistency, boundary cases, gradient computations, notation consistency across sections.
References
- Standard ML notation + statistical tests:
~/.claude/skills/math-reasoning/references/notation-guide.md - Proof templates and theorem environments:
~/.claude/skills/math-reasoning/references/proof-templates.md
Rules
- Define ALL symbols before first use: "Let $\mathcal{X}$ denote..."
- Use consistent notation throughout the paper
- Number equations that are referenced later
- Use
\tag{reason}for key derivation steps - State assumptions explicitly
- Cite lemmas and prior results used in proofs
Related Skills
- Upstream: research-planning
- Downstream: algorithm-design, paper-writing-section
- See also: symbolic-equation, data-analysis
Standard Mathematical Notation for ML/AI Papers
Spaces and Sets
| Concept | Notation | LaTeX |
|---|---|---|
| Real numbers | ℝ | \mathbb{R} |
| Natural numbers | ℕ | \mathbb{N} |
| Integers | ℤ | \mathbb{Z} |
| d-dimensional reals | ℝ^d | \mathbb{R}^d |
| Input space | 𝒳 | \mathcal{X} |
| Output/label space | 𝒴 | \mathcal{Y} |
| Hypothesis space | 𝒫 | \mathcal{H} |
| Parameter space | Θ | \Theta |
| Dataset | 𝒟 | \mathcal{D} |
| Loss function | ℒ | \mathcal{L} |
| Model family | ℱ | \mathcal{F} |
Probability and Statistics
| Concept | LaTeX |
|---|---|
| Expectation | \mathbb{E}[\cdot] or \mathbb{E}_{p(x)}[\cdot] |
| Probability | \mathbb{P}(\cdot) or p(\cdot) |
| Variance | \mathrm{Var}[\cdot] |
| Covariance | \mathrm{Cov}[\cdot, \cdot] |
| KL divergence | `D_{\mathrm{KL}}(p \ |
| Mutual information | I(X; Y) |
| Entropy | H(X) or \mathcal{H}(X) |
| Normal distribution | \mathcal{N}(\mu, \sigma^2) |
| Indicator function | \mathbb{1}[\cdot] |
Optimization
| Concept | LaTeX |
|---|---|
| Argmin | \arg\min_{\theta \in \Theta} |
| Argmax | \arg\max_{\theta \in \Theta} |
| Optimal params | \theta^* |
| Gradient | \nabla_\theta \mathcal{L} |
| Hessian | \nabla^2 \mathcal{L} |
| Learning rate | \eta or \alpha |
Linear Algebra
| Concept | LaTeX |
|---|---|
| Vectors (bold lowercase) | \mathbf{x} or \bm{x} |
| Matrices (bold uppercase) | \mathbf{W} or \bm{W} |
| Transpose | \mathbf{W}^\top |
| Inverse | \mathbf{W}^{-1} |
| Norm | `\ |
| Inner product | \langle \mathbf{x}, \mathbf{y} \rangle |
| Trace | \mathrm{tr}(\mathbf{A}) |
| Determinant | \det(\mathbf{A}) or ` |
| Frobenius norm | `\ |
| Hadamard product | \mathbf{A} \odot \mathbf{B} |
Common ML Operations
| Concept | LaTeX |
|---|---|
| Softmax | \mathrm{softmax}(\mathbf{z})_i = \frac{e^{z_i}}{\sum_j e^{z_j}} |
| Sigmoid | \sigma(x) = \frac{1}{1 + e^{-x}} |
| ReLU | \mathrm{ReLU}(x) = \max(0, x) |
| Cross-entropy | -\sum_i y_i \log \hat{y}_i |
| MSE | \frac{1}{n}\sum_i (y_i - \hat{y}_i)^2 |
| Attention | \mathrm{Attention}(Q, K, V) = \mathrm{softmax}\left(\frac{QK^\top}{\sqrt{d_k}}\right)V |
Useful LaTeX Declarations
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\diag}{diag}
\DeclareMathOperator{\rank}{rank}
\DeclareMathOperator{\softmax}{softmax}
\DeclareMathOperator{\sigmoid}{\sigma}
\newcommand{\R}{\mathbb{R}}
\newcommand{\E}{\mathbb{E}}
\newcommand{\Prob}{\mathbb{P}}
\newcommand{\bx}{\mathbf{x}}
\newcommand{\by}{\mathbf{y}}
\newcommand{\bW}{\mathbf{W}}
\newcommand{\btheta}{\boldsymbol{\theta}}
\newcommand{\norm}[1]{\left\| #1 \right\|}
\newcommand{\abs}[1]{\left| #1 \right|}
\newcommand{\inner}[2]{\langle #1, #2 \rangle}
\newcommand{\KL}[2]{D_{\mathrm{KL}}\left( #1 \| #2 \right)}Statistical Tests Decision Tree
Comparing two groups
- Normal data → paired/unpaired t-test
- Non-normal → Wilcoxon signed-rank / Mann-Whitney U
Comparing >2 groups
- Normal + equal variance → one-way ANOVA + post-hoc Tukey HSD
- Otherwise → Kruskal-Wallis + post-hoc Dunn
Correlation
- Linear → Pearson's r
- Monotonic → Spearman's ρ
Categorical data
- 2×2 → Fisher's exact test / χ² test
- Larger → χ² test of independence
Multiple comparisons
- Always apply Bonferroni correction or Benjamini-Hochberg FDR
- Report:
α_corrected = α / kwhere k = number of comparisons
Reporting convention
The improvement is statistically significant
($p < 0.01$, paired $t$-test, $t(4) = 5.23$, Cohen's $d = 1.87$).
Results reported as mean $\pm$ std over $N = 5$ random seeds.Proof Templates for Research Papers
Theorem Environment
\begin{theorem}[Name]
\label{thm:name}
Let $f: \mathcal{X} \to \mathcal{Y}$ be a continuous function. Then ...
\end{theorem}
\begin{proof}
We prove by [technique]. ...
[Step 1] ...
[Step 2] ...
Therefore, ... \qed
\end{proof}Supporting Environments
\begin{lemma}[Helper result]
\label{lem:helper}
For all $x \in \mathcal{X}$, ...
\end{lemma}
\begin{proposition}
\label{prop:name}
Under Assumption~\ref{asm:name}, ...
\end{proposition}
\begin{corollary}
\label{cor:name}
As a direct consequence of Theorem~\ref{thm:name}, ...
\end{corollary}
\begin{definition}[Concept Name]
\label{def:name}
We define ... as ...
\end{definition}
\begin{assumption}
\label{asm:name}
We assume that ...
\end{assumption}
\begin{remark}
Note that this result implies ...
\end{remark}Proof Techniques
Direct Proof
\begin{proof}
Assume the premises hold. We have:
\begin{align}
f(x) &= ... \label{eq:step1} \\
&\leq ... \tag{by Lemma~\ref{lem:helper}} \\
&= ... \nonumber
\end{align}
which completes the proof.
\end{proof}Proof by Contradiction
\begin{proof}
Suppose for contradiction that $\neg P$. Then ...
This contradicts the assumption that ..., completing the proof.
\end{proof}Proof by Induction
\begin{proof}
We prove by induction on $n$.
\textbf{Base case} ($n = 1$): ...
\textbf{Inductive step}: Assume the statement holds for $n = k$.
We show it holds for $n = k + 1$:
\begin{align}
f(k+1) &= f(k) + g(k) \\
&\leq ... \tag{by inductive hypothesis} \\
&= ...
\end{align}
By the principle of mathematical induction, the result holds for all $n \geq 1$.
\end{proof}Convergence Proof (common in ML)
\begin{theorem}[Convergence Rate]
\label{thm:convergence}
Under Assumptions~\ref{asm:smoothness} and~\ref{asm:bounded_var}, Algorithm~\ref{alg:method}
with step size $\eta = \frac{1}{\sqrt{T}}$ satisfies:
\begin{equation}
\frac{1}{T} \sum_{t=1}^{T} \mathbb{E}\left[\|\nabla f(\theta_t)\|^2\right] \leq \frac{2(f(\theta_1) - f^*)}{\sqrt{T}} + \frac{L\sigma^2}{\sqrt{T}}
\end{equation}
\end{theorem}Generalization Bound (common in learning theory)
\begin{theorem}[Generalization Bound]
\label{thm:generalization}
Let $\mathcal{F}$ be a function class with Rademacher complexity $\mathfrak{R}_n(\mathcal{F})$.
For any $\delta > 0$, with probability at least $1 - \delta$ over the draw of $n$ samples:
\begin{equation}
\sup_{f \in \mathcal{F}} \left| \hat{R}(f) - R(f) \right| \leq 2\mathfrak{R}_n(\mathcal{F}) + \sqrt{\frac{\log(2/\delta)}{2n}}
\end{equation}
\end{theorem}Complexity Analysis Template
\begin{proposition}[Computational Complexity]
\label{prop:complexity}
Algorithm~\ref{alg:method} has time complexity $\mathcal{O}(nd^2)$ and
space complexity $\mathcal{O}(nd)$, where $n$ is the number of samples
and $d$ is the input dimension.
\end{proposition}Related skills
Forks & variants (2)
Math Reasoning has 2 known copies in the catalog totaling 16 installs. They canonicalize to this original listing.
- lingzhi227 - 15 installs
- lingzhi227 - 1 installs
How it compares
Pick math-reasoning over generic LaTeX guides when symbols must match ML convention for spaces, loss, and expectation notation.
FAQ
What task types are supported?
derive, prove, formalize, stats, notation, and verify for equations, proofs, frameworks, tests, symbol tables, and correctness checks.
How are derivations formatted?
Every intermediate step justified, final result boxed with \boxed{}, important equations labeled.
Is math-reasoning safe to install?
Review the Security Audits panel on this page before installing in production.