Musain

verify-proofs

English

Check mathematical claims and proofs (derivations, theorems, bounds, identities, algebra) symbolically and numerically. Use when asked to verify or sanity-check a proof or equation, "is this right", "does this step follow", or to write a script that tests a claim. Also use before relying on any derivation, and when sympy, a numerical check or a counterexample comes up.

Which skill helps?

No result yet. 0 sessions from 0 people so far.

A skill's result appears once 5 people have used it.

Skills for this task

Skill 1
being compareda member · 27 Nov 2026
Read it
# Verifying proofs ## The posture A proof is verified when you have tried hard to break it and failed. Reading a derivation sympathetically — following the author's intended path and finding it plausible — is not verification, because that is exactly the reading under which the author's own error was invisible. Read as an adversary looking for the specific step where the claim first becomes false. And be precise about what you deliver at the end. "I found no error" and "the proof is correct" are different claims, and only the first is ever something you can support. State the first. ## Three layers, cheapest first ### 1. Logical audit Walk the argument step by step and, for each step, answer two questions: does the conclusion follow from what precedes it, and *where is each hypothesis used*? The second question is the productive one. A hypothesis that is never used means either the theorem is stronger than stated (good — say so) or the proof has a gap where the hypothesis was supposed to do work and quietly does not (bad — and this is how most wrong proofs look from the inside). Track each assumption to the line that consumes it. Also mark every step where an object is assumed to exist, be finite, be nonzero, be differentiable, or be exchangeable with a limit. Those are where proofs break: exchanging a derivative or a limit with an expectation without a dominating function, dividing by a quantity that can vanish, assuming a maximizer exists, using a bound outside the range where it was proved. ### 2. Symbolic check Algebra is where honest people make mistakes, and `sympy` settles it in seconds. Verify identities by simplifying the difference to zero rather than by comparing printed forms, which can differ while being equal: ```python import sympy as sp r, s, a = sp.symbols('r s a') lhs = (r**2 + a*s**2)**2 - a*(2*r*s)**2 assert sp.simplify(lhs - (r**2 - a*s**2)**2) == 0 ``` Symbolic checks are strongest on: expansions, factorizations, derivative computations, telescoping sums, and closed forms for small cases of a general claim. ### 3. Numerical check Instantiate the claim on many random instances and measure the maximum absolute discrepancy. Two rules keep this from lying to you: - **Use exact arithmetic when the claim is arithmetic.** `fractions.Fraction` for rational recurrences, integer arithmetic for divisibility. Floats will report agreement between quantities that differ, and disagreement between quantities that do not. - **Report the discrepancy, not a boolean.** A printed `1.7e-13` tells you the identity holds to machine precision; a printed `2.3e-6` tells you something is subtly wrong and a boolean `True` with a loose tolerance would have hidden it. The threshold for double precision is around `1e-8` for a check involving a few matrix operations, `1e-12` for a direct identity. If a check needs a tolerance looser than `1e-6` to pass, do not loosen it — find out why. ## The negative control This is the highest-value technique here, and the one most often skipped. Verifying that a claim holds under its hypotheses tells you much less than it appears to, because a check with a bookkeeping error frequently passes anyway. What discriminates is constructing an instance that **violates** a hypothesis and confirming that the right things break: - Claims derived **without** the hypothesis must still hold. If one of them breaks, your verification code is wrong, not the theorem. - The claim that **uses** the hypothesis must fail, and visibly. If it still holds, then either the hypothesis is unnecessary — a strengthening worth reporting — or your test never exercised the hypothesis at all, which means the passing result was meaningless. Concretely: a proposition holds for convex losses. Run the same identity table with a deliberately non-convex loss. The identities that never use convexity should still come out at `1e-15`; the one proposition that relies on convexity should blow up to `1e-2`. Both halves are the test. ```python out = verify_identities(problem, loss_nonconvex) assumption_free = [k for k in out if not k.startswith("uses convexity")] print("assumption-free hold:", max(out[k] for k in assumption_free) < 1e-8) # expect True print("assumption-using breaks:", out["uses convexity: bound (3)"] > 1e-4) # expect True ``` A verification script without a negative control is a script that has not been tested. ## Boundary and degenerate cases Most false claims are true generically and false at the edges. Probe deliberately: - **Small parameters**: $n = 0, 1, 2$; a single state; a single action; horizon 1. - **Equality cases**: every inequality in the proof — is it tight anywhere, and does the argument still work there? - **Degenerate distributions**: deterministic policies (zero entropy, infinite KL from a stochastic reference), uniform policies, distributions with mismatched support. - **Sign changes**: negative values where the examples were all positive (rewards, weights, eigenvalues). Many bounds hold only for one sign, and a positive-only test never sees the other. - **Limits**: $\gamma \to 1$, step size $\to 0$ and $\to \infty$, temperature $\to 0$, batch size 1. - **Zero denominators**: importance ratios with zero-probability actions; normalizations by a quantity that can vanish. ## Report format Give a per-step verdict rather than a global one, using explicit statuses: ``` Step 3 (exchange of derivative and expectation) UNVERIFIED — needs dominated convergence; the dominating function is not exhibited and I could not construct one for unbounded rewards. Holds if rewards are bounded; suggest stating that hypothesis. Step 4 (expansion of the quadratic term) VERIFIED SYMBOLICALLY (sympy, exact) Step 5 (bound via Cauchy-Schwarz) BROKEN — applied in the wrong direction. Counterexample: p = (0.9, 0.1), q = (0.5, 0.5), gives LHS 1.28 > RHS 0.64. Step 6 (telescoping) VERIFIED NUMERICALLY (max discrepancy 4.4e-16 over 10k random instances; negative control breaks as expected at 3e-2) ``` Statuses worth distinguishing: `VERIFIED SYMBOLICALLY`, `VERIFIED NUMERICALLY`, `VERIFIED BY HAND`, `UNVERIFIED`, `BROKEN`. `UNVERIFIED` is a legitimate and useful outcome — it tells the user exactly where to spend their attention. Padding the report by silently promoting an unchecked step to verified is the one failure that makes the whole exercise worthless. When a step is broken, supply the smallest counterexample you can find. A concrete pair of numbers ends the discussion; a description of the problem invites debate. ## Do not repair the mathematics When a step fails, report it. Do not silently rewrite the statement, weaken the theorem, add a hypothesis, or adjust a constant so that the proof goes through. The author knows the intent and will be better at deciding what the right fix is — and a silent patch destroys the one thing they asked for, which is to know whether their argument holds. Proposing a fix is welcome, clearly marked as a proposal and kept separate from the verdict: "Step 5 is broken as written. It would go through with the additional hypothesis that rewards are bounded, at the cost of excluding the Gaussian case — your call." ## The verification report is itself reviewable A status table earns trust the same way a proof does: by surviving an attempt to break it. Before delivering a verification that will be relied on, audit the report — with a second agent when available, as a deliberate cold pass otherwise — against two questions: - Does every `VERIFIED` status correspond to a check that was **executed in this session**, with its output in hand — not planned, described, or remembered? A status stronger than its executed evidence is the one defect that makes the whole table worthless, because from the outside it is indistinguishable from the real thing. - Does the negative control violate the hypothesis the theorem actually uses? A control that breaks some other assumption leaves the check vacuous while looking rigorous. For a verification attached to a document headed to readers, apply the full reviewer protocol in the review gate of the `run-experiments` skill: concerns are resolved by rerunning checks, downgrading statuses, or conceding gaps — never by softening the wording. ## Script conventions Keep verification scripts in the repository next to the note they check, so they can be re-run after every revision. A script that is not committed will not be re-run, and a proof that changes without its check being re-run is unverified again. Conventions that make them useful a year later: - A docstring saying which document and which claims the script checks. - One clearly labelled section per claim, printing the claim as a string alongside its discrepancy — so the output is readable without the source. - Print the max absolute discrepancy and an explicit `OK` / `FAIL`. - Include the negative control in the same run, labelled `OK (expected)` when it breaks. - Exact arithmetic where the claim is exact; fixed random seed where it is sampled.

Use this task

Sign in to add it

New here? Get started (5 minutes, once).

Or from a terminal
musain commons install verify-proofs

How it is measured

Pushbacks (fewer is better): Messages you type that contain "that's wrong", "that is wrong", "not what i asked", "that's not right" and 10 more.

Set by the area Write and revise research papers, for all its tasks.