Adversarial Math From First Principles cover
Programmer.ie Book In development

Adversarial Math From First Principles

A new approach to mathematical investigation using AI, proof assistants, counterexamples, reproducible experiments, and independently checked evidence.

A mathematical answer is only as trustworthy as the claim being tested, the assumptions behind it, and the evidence supporting it.

AI can generate mathematical arguments, construct proofs, identify patterns, and propose solutions. But a convincing explanation is not necessarily a correct proof, and a formally verified theorem may not establish what its author intended.

Adversarial Math From First Principles explores a different approach: mathematics in which AI proposes, independent tools check, counterexamples challenge, and every conclusion remains connected to the evidence that supports it.

The objective is not to replace mathematical reasoning with software. It is to make mathematical investigations more precise, reproducible, inspectable, and open to challenge.

Why this book exists

Mathematics has traditionally depended on a combination of reasoning, proof, criticism, and independent examination. AI makes generating mathematical arguments dramatically easier, but it also introduces a new problem: producing plausible mathematics is not the same as establishing its correctness.

A language model can propose a theorem, write a convincing derivation, or generate code for a proof assistant. Yet several questions remain.

What exactly was proved? Which assumptions were required? Did the formal statement match the original claim? Could a counterexample invalidate it? Would another proof system reach the same conclusion? Can someone else reproduce the result?

This book investigates how those questions can become part of a systematic mathematical process.

Rather than trusting one AI model or one mathematical tool, we construct a framework in which claims are explicitly defined, challenged, checked, and recorded.

The central distinction

The book separates seven stages of mathematical investigation:

  1. The claim — the precise mathematical statement being investigated.
  2. The assumptions — the definitions, domains, axioms, and conditions under which it is meaningful.
  3. The proposed reasoning — a derivation, proof, formalization, or counterexample proposed by a person or AI.
  4. The verification — the actual work performed by symbolic systems, solvers, or theorem-prover kernels.
  5. The correspondence — whether different tools checked the intended mathematical statements, and what relationships between those statements have been established.
  6. The evidence — reproducible records of what ran, what succeeded, what failed, and what remains unresolved.
  7. The conclusion — a carefully bounded statement of what the investigation established.

A proof accepted by Lean is not automatically equivalent to a proof accepted by Rocq. A symbolic identity is not automatically a formally verified theorem. A theorem about a mathematical model does not establish that the physical universe follows that model.

Each transition must be justified separately.

The investigation loop in seven stages: 1 claim, 2 assumptions, 3 reasoning, 4 verification, 5 correspondence, 6 evidence, 7 conclusion. A dashed red path labelled challenge or repair returns from the conclusion to the claim. A note says each transition is a separate claim: a solver result is not a proof, a proof is not a statement match, and a statement match is not a physical result.

The investigation loop. Each transition is a separate claim; a later success does not repair an earlier gap.

The cumulative investigation

The book develops one mathematical investigation progressively, using special relativity as its principal worked example.

We begin with the one-dimensional Lorentz transformation and the question of whether it preserves the spacetime interval:

\[ t'=\gamma(t-vx), \qquad x'=\gamma(x-vt) \]

The investigation examines the condition:

\[ \gamma^2(1-v^2)=1 \]

and establishes, under the corresponding assumptions, that:

\[ t'^2-x'^2=t^2-x^2 \]

The mathematical result is well established. The experiment is about the process of checking it.

We use SymPy for symbolic algebra, Z3 for constraint solving and counterexample search, and Lean 4 and Rocq for kernel-checked proofs.

The investigation also includes deliberately false transformations, missing assumptions, mismatched formalizations, proof placeholders, and incomplete evidence.

Isabelle/HOL and SageMath are considered as additional tools, but their unexecuted checks are not presented as successful verification.

The result is a worked example of adversarial mathematical investigation: an approach designed to discover weaknesses rather than simply confirm expected answers.

Chapter plan

The thirty-chapter development manuscript is organized into four parts, with supporting appendices.

Part Chapters Focus
I. Claims, Proof and Evidence 01–09 Mathematical claims, assumptions, proof, counterexamples, uncertainty, AI reasoning, provenance
II. The Tools and the Contract Between Them 10–16 SymPy, Z3, Lean, Rocq, tool limitations, cross-system contracts, investigation engine
III. Special Relativity in One Dimension 17–22 Reference frames, postulates, Lorentz transformations, invariant interval, time dilation, causality
IV. Challenge, Repair and Reproduction 23–30 Criticism, assumption audits, source reconstruction, alternative formulations, repairs, independent reproduction, conclusions

The appendices contain the detailed evidence references, reproduction instructions, source commentary, tool notes, and technical terminology needed to inspect the investigation.

The book is designed to be read sequentially, but the mathematical examples and evidence records can also be examined independently.

The verification tools

The investigation uses tools with different responsibilities.

Tool Role
Python / SymPy Symbolic manipulation, exact arithmetic, and computational checks
Z3 Constraint solving, satisfiability testing, and counterexample discovery
Lean 4 / Mathlib Formally checked mathematical statements and proofs
Rocq / Coq Additional kernel-checked formalization using a different foundational system
Isabelle/HOL Candidate independent formal-verification system
SageMath Candidate computational mathematics environment

The distinction between executed and planned integrations matters.

A missing tool is not a successful check. A solver result is not automatically a kernel proof. Agreement between proof assistants does not by itself establish semantic equivalence between their encodings.

The book preserves these boundaries rather than assigning confidence percentages to mathematical results.

Beyond the Lorentz example

The method extends beyond one result in special relativity.

The manuscript also examines:

  • Pythagorean theorem reconstruction: moving from a historical mathematical source to a modern coordinate theorem without confusing the two.
  • Hidden-assumption testing: removing hypotheses and searching for counterexamples.
  • Claim repair: distinguishing a corrected statement from the original false claim.
  • Formal proof inspection: identifying placeholders, unexpected axioms, and limitations in proof artifacts.
  • External mathematical formalizations: examining the relationship between a mathematical problem, its supporting records, and the statements actually checked.
  • Reproducibility: determining what it means for another execution, environment, or independent reviewer to reproduce a mathematical result.

These investigations demonstrate why mathematical verification involves more than obtaining a successful return code from a proof assistant.

Evidence and reproducibility

The accompanying Math project stores mathematical claims, formal proof sources, execution results, counterexamples, and reproducibility evidence.

Claims are versioned and associated with precise assumptions. The verification system records tool versions, source fingerprints, execution outcomes, and outstanding obligations.

The publication system is designed to keep mathematical explanations connected to inspectable supporting evidence.

This does not eliminate the need for human mathematical judgment. A proof kernel checks the formal proposition it receives; it cannot establish that the proposition faithfully represents the author’s original intention.

The project therefore separates machine verification, cross-system correspondence, human mathematical review, and publication approval.

Development edition

This book is currently a development edition.

Its central Lorentz investigation has recorded formal and computational results. Other chapters contain explanatory mathematics, illustrative experiments, methodological proposals, and investigations whose evidence remains incomplete.

Human mathematical review, independent reproduction, some cross-system correspondence obligations, and publication qualification remain separate activities.

The presence of a chapter does not imply that every example in it has been independently verified.

Detailed editorial assessments, chapter reviews, and development tasks are maintained separately from the reading text.

Method

The working method is:

Formulate → Challenge → Formalize → Verify → Compare → Reproduce → Explain

A claim is defined before it is tested. Assumptions are made explicit. Counterexamples are sought deliberately. Formal systems check precisely encoded statements. Independent results are compared without assuming equivalence. Reproduction records preserve both successes and failures.

Finally, the result is explained in ordinary mathematical language, with its limitations intact.

The central principle is simple:

AI may propose the mathematics. The evidence must establish what can legitimately be concluded.

Contents

Chapters

01

The Claim Before the Proof

The engine's primary object is a versioned claim, not a proof: what a claim contract contains, how fingerprints bind evidence to exact claim versions, and why one sentence can be three different claims.

02

Definitions and Assumptions

Every assumption carries an ID, a formula, and a role: the five assumption roles and how they expose which conditions a theorem actually needs.

03

What Counts as Proof?

Five things people call proof, from algebra to kernel-checked theorems: the evidence-status ladder and how the engine refuses to be fooled by a compiling file with sorry.

04

Mathematical Models and Physical Theories

Why the physical Lorentz claim is a statement about real numbers, not relativity verified: separating mathematical results, modeling assumptions, and experimental evidence.

05

Counterexamples

A universal claim is refuted by one validated witness: how the engine produces, re-evaluates, and records counterexamples, starting from the false shear.

06

Uncertainty Without Confidence Theatre

No probabilities, no confidence scores, no tool votes: the evidence vocabulary, precedence rules, and why one claim can get different conclusions from different tools.

07

AI as Proposer, Not Authority

Model output enters as an unverified candidate and can never become evidence by itself: the typed agent boundary, itself AI-drafted and speculative.

08

Provenance and Reproducibility

Every result carries replayable provenance: what is recorded, how fresh runs are compared to committed ones, and the reproduction gap that remains.

09

Symbolic Algebra with SymPy

Exact symbolic algebra for expanding residuals and substituting rationals, and what it does not establish: SymPy never checked the subluminal domain it is credited with.

10

Constraints and Models with Z3

Z3 as a satisfiability checker for encoded nonlinear real arithmetic: the negated-goal method, its three outcomes, and why unsat is a fact about one formula, not a theorem.

11

Lean 4 and Mathlib

Lean's kernel as the first-class proof checker: how the engine invokes it, junk values for square roots of negatives, and four ways a Lean file can look finished without being proved.

12

Rocq as an Independent Kernel

A second, independently built kernel checking the same statements: what independence buys against checker bugs, and why kernel agreement is not statement equivalence.

13

Isabelle/HOL and Countermodels

Isabelle2026 in Docker builds a repaired copy of the advisory theory and Nitpick finds a finite countermodel; the accepted formal source remains pinned and the engine result remains not_evaluated.

14

SageMath and Scientific Computation

SageMath 10.9 ran a focused exact symbolic check in a pinned Docker image, while the engine still has no Sage adapter or claim-bound result.

15

The Cross-System Claim Contract

Five graded levels of agreement between tools checking the same claim, and why the engine refuses to say equivalent until the strongest level is proved.

16

The Investigation Engine

The layer turning claims into replayable hashed fail-closed evidence bundles: a tour of the pipeline parts and the design rules holding them together.

17

Events and Reference Frames

The vocabulary for relativity without hidden meaning: events, frames, simultaneity at three-fifths light speed, and what is frame-dependent.

18

The Postulates and Their Roles

Six premises behind the Lorentz derivation, sorted into empirical, mathematical, and conventional: what each contributes and what the repository never formalized.

19

The Lorentz Transformation

Deriving the boost from stated premises in light-cone coordinates, with paper-only steps labelled, plus rapidity and Doppler-factor parameterizations.

20

The Invariant Interval

The anchor chapter: the algebraic identity, the gamma bridge, their physical composition, and the false shear control, pinned to kernel-checked claims.

21

Time Dilation and Length Contraction

Two routinely misquoted effects stated precisely with hidden conditions explicit: symmetric clock-slowing at three-fifths light speed and what slow actually compares.

22

Velocity, Light Cones, and Causality

Timelike, lightlike, and spacelike separation; velocity composition keeping speeds below light; and why time order survives boosts for exactly one kind.

23

Anatomy of a Challenge

Turning prose criticism into a versioned claim a tool can test: the hypothetical gamma-blowup objection read three ways, with no real criticism yet ingested.

24

Hidden-Assumption Audits

Drop each hypothesis and ask Z3 for a model of the rest: the deletion audit for load-bearing premises plus the catalogue of audits the engine runs.

25

From a Source Page to a Checked Theorem

Pinning Heath's Euclid to an exact page: byte integrity established, transcription fidelity not evaluated, and why the modern coordinate theorem is not Euclid verified.

26

Alternative Formulations

A vocabulary for comparing formulations of the same idea by hypotheses, conclusions, and instance scope, with illustrative Z3 comparisons and undelivered observational discrimination.

27

Repairing a Refuted Claim

From the refuted Pythagorean claim to candidate repairs with explicit semantic deltas: satisfiability checks, overfitting control, and trade-offs with no automatic winner.

28

The `sorry` That Wasn't the Proof

One external Lean formalization, six true records, no verdict: placeholder, kernel, comparator, and catalogue reconciled into an evidence vector.

29

Independent Reproduction

A proposed six-level ladder for what reproduced can mean, from reruns to independent reimplementation, with the project's actual standing at each level.

30

What We Can Conclude

The synthesis: bounded mathematical findings, open obligations, and the novelty question, adding no new evidence and wrong wherever an earlier chapter is wrong.