One example, three worlds: $1 + 2 + \dots + n = \frac{n(n+1)}{2}$
We check the same formula in computer arithmetic, derive it in a computer algebra system and prove it formally in Peano Lab.
World 1 · numerical computation
We compute the sum “one term at a time”, the way an ordinary program in Python or C would: s = 0; for k in 1..n: s += k — in three number types.
The sum computed by a loop
Arithmetic
1 + 2 + … + n (loop)
n(n+1)/2 (exact)
difference
Error of the float32 sum for n = 1 … 20,000
And float64?
float64 stores all integers in the interval $[-2^{53}, 2^{53}]$ exactly, so as long as every partial sum satisfies $\frac{n(n+1)}{2} \le 2^{53}$,
summing term by term is error-free. This guarantees correctness for $n \le 134\,217\,727$. Beyond this bound, however, the error need not appear right away (even numbers up to $2^{54}$ are representable too) — let us check.
n
float64 sum (loop)
n(n+1)/2 (BigInt)
difference
A finite check is evidence, not a proof. In floating-point arithmetic even the check itself can lie: float32 “refutes” a true formula as early as $n = 5793$.
World 2 · symbolic computation (CAS)
A computer algebra system treats $n$ as a symbol, not as a number — it answers the question “for all $n$ at once”.
SymPy (output of a real session)
>>> import sympy as sp
>>> k, n = sp.symbols('k n', integer=True, nonnegative=True)
>>> S = sp.summation(k, (k, 1, n)); S
n**2/2 + n/2
>>> sp.factor(S)
n*(n + 1)/2
>>> T = lambda m: m*(m + 1)/2
>>> sp.simplify(T(n + 1) - T(n) - (n + 1))
0
Checked in SymPy 1.14. The last line is the computation behind the induction step: $T(n+1) - T(n) = n+1$.
How a CAS can “discover” it: undetermined coefficients
Is this a proof?
The symbolic computation verified one step of the argument: the polynomial identity $S(n+1) - S(n) = (n+1)^p$ — in canonical form the difference is $0$.
A human supplies the rest: $S(0) = 0$ and the principle of induction give $S(n) = \sum_{k=1}^n k^p$ for all $n$. That is why we call this a pseudo-proof:
we trust the algorithm and its implementation (millions of lines of SymPy/SageMath code) — a CAS does not issue a certificate that someone could check independently;
the assumption “we are looking for a polynomial of degree $p+1$” has to be justified separately (here: the difference $S(n+1)-S(n)$ is a polynomial of degree $p$);
the base case and the induction scheme remain a pen-and-paper argument.
A CAS gives an answer “for all n” and very strong confidence — but this is trust in a program, not a checkable proof.
World 3 · formal proof (Peano Lab, Heyting arithmetic)
Peano Lab is a simplified proof assistant for intuitionistic Peano arithmetic. Its language knows only $0$, the successor $S$, $+$ and $\cdot$ — there is no $\Sigma$ and no division.
That is why we state the theorem as forall n. exists x. n * (n + 1) = 2 * x (“$n(n+1)$ is even”), and the witness $x$ will be exactly the sum.
The link opens Peano Lab with the command pa prove …; type the remaining lines by hand or use the “paste multiline proof” option.
Proof state after step 1
Witness extraction
The proof is constructive: the step exists x + S n says how to build a witness for $n+1$ from a witness for $n$:
$$x_0 = 0, \qquad x_{n+1} = x_n + (n+1).$$
Running this recursion is exactly the summation $0 + 1 + \dots + n$ — a program “extracted” from the proof.
Axioms used by the proof
PA3 x + 0 = x
PA4 x + S y = S(x + y)
PA5 x · 0 = 0
PA6 x · S y = x · y + x
IND φ(0) ∧ ∀n (φ(n) → φ(S n)) → ∀n φ(n)
Tactics — ring included — are untrusted: they may be arbitrarily clever, or even wrong. At the end, a small kernel re-checks the whole certificate
against the original goal (the de Bruijn criterion). We trust only the kernel and the axioms.
A formal proof covers all n, and every step — including the “obvious” computation — is checked mechanically. As a bonus we get a program that computes the sum.
The three worlds in one table
Numerics
Symbolic computation (CAS)
Formal proof
What do we check?
specific values of n (finitely many)
the symbol n — all n at once
all n, every step of the argument
What do we get?
evidence (which can lie in float32)
the output of an algorithm, with no certificate
a certificate checked by the kernel
Whom do we trust?
the hardware and the arithmetic (and their limitations)
the entire CAS program
a small kernel and the PA axioms
Cost
microseconds
milliseconds
human work on the proof script
Explore on your own
Explain why float32 makes its first mistake exactly at $n = 5793$. (Hint: $2^{24} = 16\,777\,216$, and $\frac{5792\cdot 5793}{2} = 16\,776\,528$.)
In the “Symbolic computation” tab, set $p = 3$. Compare the result with the square of the formula for $p = 1$. What identity have you discovered?
In the Peano Lab script, change the witness in the induction step to x + n. Which step stops working, and why?
Witness extraction for $n = 10^6$: how many additions does the program perform? Can a faster program be “extracted” from a different proof?