From agent-almanac
Derives theoretical results step-by-step from first principles or theorems in math/physics, justifying every step and checking cases. For proofs, formulas, textbook verifications, extensions, papers.
npx claudepluginhub pjt222/agent-almanacThis skill uses the workspace's default tool permissions.
---
Verifies mathematical derivations step-by-step using SymPy via CLI. Checks equality, differentiates, integrates, simplifies expressions, and solves equations.
Performs symbolic mathematics in Python using SymPy: algebraic equation solving, calculus (derivatives, integrals, limits), expression manipulation, matrices, physics, code generation. Use for exact symbolic results.
Solves IMO, Putnam, USAMO, AIME problems with adversarial verification detecting self-check errors. Uses pure reasoning, calibrated confidence, PDF output if verified.
Share bugs, ideas, or general feedback.
Produce a rigorous, step-by-step derivation of a theoretical result starting from stated axioms, first principles, or established theorems. Every algebraic or logical step is explicitly justified, limiting cases are verified, and the final result is presented with a complete notation glossary.
Write the derivation's contract explicitly before any calculation:
## Derivation Contract
- **Starting from**: [axioms, postulates, or established results]
- **Target**: [precise mathematical statement]
- **Domain of validity**: [restrictions and assumptions]
- **Notation**:
- [symbol]: [meaning and units]
- ...
Expected: A complete, unambiguous statement of what is being derived from what, with all notation defined upfront.
On failure: If the target result is ambiguous or the starting assumptions are incomplete, clarify before proceeding. A derivation with hidden assumptions is unreliable.
Survey the tools needed and verify their applicability:
## Mathematical Toolkit
- **Algebra**: [techniques and prerequisites]
- **Analysis**: [calculus tools and regularity conditions]
- **Symmetry**: [group theory tools]
- **Identities to invoke**: [list with precise statements]
Expected: A checklist of mathematical tools with their applicability conditions verified for the specific problem at hand.
On failure: If a required tool has unverified prerequisites (e.g., term-by-term differentiation of a series whose uniform convergence is unknown), flag it as a gap. Either prove the prerequisite or state it as an additional assumption.
Carry out the derivation with every step labeled and justified:
[by assumption] -- invoking a stated axiom or assumption[by definition] -- using a previously declared definition[by {identity name}] -- applying a named identity (e.g., "by Jacobi identity")[by Step N] -- citing a previous step in this derivation[by {theorem name}] -- invoking an external theorem (stated in Step 2)## Derivation
**Step 1.** [Starting expression]
*Justification*: [by assumption / definition]
**Step 2.** [Result of operation on Step 1]
*Justification*: [specific reason]
...
**Checkpoint (after Step N).** Verify:
- Dimensions: [check]
- Symmetry: [check]
...
**Step M.** [Final expression = Target result]
*Justification*: [final operation] QED
Expected: A linear sequence of steps from the starting point to the target result, with no gaps in logic. Every step is independently verifiable.
On failure: If a step does not follow from the previous one, the derivation has a gap. Either insert the missing intermediate steps or identify the additional assumption needed. Never skip a step with "it can be shown that" unless the omitted result is a well-known identity listed in Step 2.
Validate the derived result against known physics or mathematics:
Limiting cases: Identify at least three limiting cases where the result should reduce to something known:
Special values: Substitute specific values of parameters where the answer is known independently (e.g., n=1 for the hydrogen atom, d=3 for three-dimensional results).
Symmetry checks: Verify that the result transforms correctly under the symmetry group. If the result should be a scalar, check that it is invariant. If it should be a vector, check its transformation law.
Consistency with related results: Check that the derived result is consistent with other known results in the same theory (e.g., Ward identities, sum rules, reciprocity relations).
## Limiting Case Verification
| Case | Condition | Expected Result | Derived Result | Match |
|------|-----------|----------------|----------------|-------|
| [name] | [parameter limit] | [known result] | [substitution] | [Yes/No] |
| ... | ... | ... | ... | ... |
Expected: All limiting cases and special values produce the expected results. The derivation is internally consistent.
On failure: A failed limiting case indicates an error in the derivation. Trace the failure back by checking which step first produces an expression that fails the limit. Common causes: incorrect sign, missing factor of 2 or pi, wrong combinatorial coefficient, or a step where an order of limits matters.
Assemble the final, polished derivation:
## Final Result
> **Theorem/Result**: [precise statement with equation number]
## Notation Glossary
| Symbol | Meaning | Units | First appears |
|--------|---------|-------|---------------|
| [sym] | [meaning] | [units or dimensionless] | [Step N] |
| ... | ... | ... | ... |
## Assumptions
1. [Fundamental postulate 1]
2. [Technical assumption 1]
3. ...
Expected: A self-contained document that a reader can follow from start to finish without consulting external references, except for the explicitly cited identities and theorems.
On failure: If the derivation is too long for a single document (more than ~50 steps), break it into lemmas. Derive each lemma separately, then assemble the main result by citing the lemmas.
formulate-quantum-problem -- formulate the quantum mechanical framework before deriving results from itsurvey-theoretical-literature -- find prior derivations of the same or related results for comparison