agentleFS
rafeeqinearafeeqinea/claude-academic-toolkit/skills/math/derive/SKILL.md

derive

Skill0 starsChanged 9 months agoMITView on GitHub

Perform step-by-step mathematical derivations with full explanations and LaTeX output. Trigger phrases: /derive, "derive this", "show the derivation", "prove that", "mathematical proof", "step by step math"

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 11 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before the first equation, produce a notation table:

    line 44
  2. Distinctive:

    Every variable used in the derivation must appear in this table.

    line 55
  3. Distinctive:

    When a derivation requires case analysis:

    line 94
  4. Distinctive:

    After completing the derivation, perform at least one verification:

    line 112
  5. Distinctive:

    Dimensional analysis: Do the units/dimensions match on both sides?

    line 114
  6. Distinctive:

    Symmetry check: If the result should be symmetric in certain variables, verify it is

    line 118
  7. Distinctive:

    Use these LaTeX conventions:

    line 147
  8. Distinctive:

    Never skip steps: If you think a step is "obvious", show it anyway and mark it as such.

    line 176
  9. Distinctive:

    Flag non-trivial steps: If a step requires knowledge beyond the current derivation, explain it in a sidebar or footnote.

    line 180
  10. Distinctive:

    If the user's starting point contains an error:

    line 185
  11. Distinctive:

    If the target result is incorrect:

    line 191

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Mathematical Derivation Skill

Purpose

Produce rigorous, step-by-step mathematical derivations from premises to conclusion. Every step is justified, every variable is defined, and the output is formatted for direct inclusion in academic reports.

Supported Domains

  • Linear algebra: Matrix operations, eigenvalue problems, decompositions, trace/determinant identities
  • Calculus: Differentiation, integration, Taylor/Maclaurin series, limits, multivariable calculus
  • Probability and statistics: Bayes' theorem, expectations, distributions, maximum likelihood, Bayesian inference
  • Optimisation: Gradient descent convergence, Lagrange multipliers, KKT conditions, convexity proofs
  • Differential equations: ODEs, PDEs, separation of variables, Green's functions, weak formulations
  • Numerical methods: Discretisation error analysis, stability proofs, convergence rates
  • Machine learning: Backpropagation, loss function gradients, kernel tricks, information-theoretic bounds

Workflow

Step 1: Clarify the Derivation

Before starting, establish:

  1. Starting point: What are the premises, axioms, or given equations?
  2. Target: What expression, identity, or result needs to be derived?
  3. Level of rigour: Sketch (key steps only), standard (all steps, informal justification), or formal (proof-level, every inference rule named)
  4. Notation conventions: Does the user follow specific notation? (e.g., bold for vectors, hat for estimates, bar for means)
  5. Context: Is this for a report, homework, or personal understanding? This affects the level of explanation.

Step 2: Define All Variables

Before the first equation, produce a notation table:

Let:
- A ∈ ℝ^{m×n}    : the coefficient matrix
- x ∈ ℝ^n         : the solution vector
- b ∈ ℝ^m         : the right-hand side vector
- ‖·‖_2           : the Euclidean (L2) norm
- κ(A)            : the condition number of A, defined as ‖A‖‖A⁻¹‖

Every variable used in the derivation must appear in this table. No symbol should appear without definition.

Step 3: Perform the Derivation

Structure each step as:

Step k: [Brief description of what this step does]

[Equation from previous step]

    = [New expression]          (by [justification])

    = [Next expression]         (by [justification])

[1-3 sentences explaining WHY this step was taken and WHAT it accomplishes]

Justification Types (always specify one):

JustificationWhen to Use
by definitionSubstituting a definition
by [Named Theorem]Applying a known theorem (state it)
by [algebraic operation]Factoring, expanding, combining like terms
by substitution of (k)Substituting result from step k
by linearity of [operator]Using linearity of expectation, integral, etc.
by chain ruleComposite function differentiation
by product ruleProduct differentiation
by integration by partsThe standard IBP formula
by Cauchy-SchwarzApplying the inequality
by triangle inequalityApplyinga+b≤a+b
by assumptionSomething stated in the premises
by symmetry of AUsing A = A^T
by positive definitenessUsing x^T A x > 0 for x ≠ 0
rearrangingSimple algebraic manipulation

Step 4: Handle Branches and Cases

When a derivation requires case analysis:

We consider two cases:

Case 1: [Condition]
  [Derivation for this case]
  ∴ [Result for case 1]

Case 2: [Condition]
  [Derivation for this case]
  ∴ [Result for case 2]

Combining both cases: [Final result]

Step 5: Verify the Result

After completing the derivation, perform at least one verification:

  • Dimensional analysis: Do the units/dimensions match on both sides?
  • Special case check: Substitute a simple known case (e.g., n=1, A=I) and verify
  • Boundary check: Does the result behave correctly at extremes (x→0, x→∞)?
  • Numerical check: Plug in specific numbers and verify both sides agree
  • Symmetry check: If the result should be symmetric in certain variables, verify it is

State which verification was performed and show the check.

Step 6: Output Format

Provide the derivation in two formats:

A. Annotated Markdown (for understanding)

Each step with full English explanation, motivation, and commentary. Use this for teaching and personal notes.

B. LaTeX (for reports)

Clean, publication-ready LaTeX using proper environments:

\begin{theorem}[Name if applicable]
  Statement of the result.
\end{theorem}

\begin{proof}
  Using \texttt{align} or \texttt{align*} for multi-line equations:
  \begin{align}
    \text{LHS} &= \text{expression 1} \label{eq:step1} \\
               &= \text{expression 2} \quad \text{(by justification)} \label{eq:step2} \\
               &= \text{RHS}. \label{eq:final}
  \end{align}
\end{proof}

Use these LaTeX conventions:

  • \boldsymbol{} or \mathbf{} for vectors and matrices
  • \operatorname{} for named operators (e.g., \operatorname{tr}, \operatorname{diag})
  • \text{} for inline justifications within align environments
  • \label{} and \eqref{} for cross-referencing equations
  • \qed or \qedhere at the end of proofs
  • Number all equations that are referenced later

Step 7: Common Derivation Patterns

Have these ready as building blocks:

Gradient of quadratic form: ∇_x (x^T A x) = (A + A^T)x, and = 2Ax when A is symmetric.

Matrix calculus chain rule: ∂L/∂W = ∂L/∂Y · ∂Y/∂W for Y = f(W).

CG convergence bound: ‖e_k‖_A ≤ 2 · ((√κ - 1)/(√κ + 1))^k · ‖e_0‖_A

Bayes' theorem expansion: P(θ|D) = P(D|θ)P(θ) / ∫P(D|θ')P(θ')dθ'

Taylor expansion to second order: f(x+δ) ≈ f(x) + ∇f(x)^T δ + ½ δ^T ∇²f(x) δ

Rules

  • Never skip steps. If you think a step is "obvious", show it anyway and mark it as such. The user wants to learn.
  • Never introduce a variable without defining it first.
  • Never use "it can be shown that" without actually showing it. If a sub-result is needed, derive it or cite the specific theorem.
  • State assumptions explicitly at each step where they are used (e.g., "since A is symmetric positive definite...").
  • Flag non-trivial steps: If a step requires knowledge beyond the current derivation, explain it in a sidebar or footnote.
  • Maintain consistent notation throughout. Do not switch between x and \mathbf{x} for the same vector.

Error Handling

If the user's starting point contains an error:

  1. State clearly what the error is
  2. Show what the correct starting point should be
  3. Derive from the corrected premise
  4. Explain the impact of the error on the final result

If the target result is incorrect:

  1. Derive the correct result
  2. Show where the target result diverges
  3. Identify the likely source of the error

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.