Work/Formalized mathematics/03

Symmetry, checked by Narya

symmetry-narya is a formalization of the book Symmetry by Bezem, Buchholtz, Cagne, Dundas and Grayson, in the Narya proof assistant (default HOTT mode). It covers chapters 2 to 15 and appendix B. 891 of the 917 blocks of the book have a formal statement and a proof. 16 blocks are false as printed: for each of them, the repository proves a counterexample and a corrected statement.

GPL-3.0-or-later

Research summary

Problem
Can the statements of a mathematics book be translated into machine-checked definitions and proofs without losing their intended meaning?
Result
The inventory for chapters 2–15 and appendix B of Symmetry records 891 mapped blocks, 16 refuted blocks with corrections, 4 partial blocks and 6 informal blocks: 917 in total.
How to check it
The repository supplies the book-to-code inventory, source checks with a pinned Narya build, negative controls and a separate blind statement check. The recorded full typecheck is dated 5 October 2026; it is a historical run, not a new run performed for this page.
Limits
A typecheck does not establish agreement with the book. Narya uses Type : Type and lacks termination, positivity and productivity checking; the heuristic audit is not a soundness proof. Chapters 2, 3 and 11 have no blind statement check.
Research question
Which remaining mapping gaps survive an independent mathematical review and a check in a foundation with explicit universe and termination rules?

Discuss this research or report a correction →

Coverage

891/ 917

  • Mapped891
  • Refuted16
  • Partial4
  • Informal6

One square per block of the book, in chapter order. Point at a square to see its chapter.

917blocks of the book
891with a formal statement and a proof
16false as printed, with counterexamples
864of 1,140 claims of the running text formalized
812Narya modules
2 h 19full check from source, 27 GB

One of the 16 refutations

01 · book
xca:cancel-surjection (circle.tex:3104)
A surjection p : A → B gives an equivalence
(f = g) → (f ∘ p = g ∘ p), for all Y and f, g : B → Y.
02 · Narya
module 40: a counterexample
def surjection_cancellation_counterexample
  (e : isEquiv (Id (TwoSets → TwoSets) (identity TwoSets) two_sets_constant_base)
      (Id (Unit → TwoSets) … …)
      (map_path … (precompose Unit TwoSets TwoSets two_sets_base_inclusion) …))
  : Empty
03 · fix
the corrected statement, for a set Y
def cancel_surjection_into_set (A B Y : Type) (p : A → B)
  (hp : Surjective A B p) (hy : isSet Y) (f g : B → Y)
  : Equiv (Id (B → Y) f g) (Id (A → Y) (precompose A B Y p f) (precompose A B Y p g))
One of the 16 refutations. With A = Unit, B = Y = TwoSets (the groupoid of two-element sets) and p the inclusion of the base point, the identity and the constant map agree after p but are not equal. Module 285 proves the general form for n-connected maps.

Chapters

Each chapter has a status page in the repository. It lists the open gaps and the corrections, and links each block of the book to its principal declarations.

Blocks are the definitions, lemmas, theorems, constructions, exercises, examples and remarks of the book. Mapped: a formal statement and a proof. Refuted: false as printed; a counterexample and a corrected statement are proved. Open gaps: partial blocks, gaps of the blind check, and claims of the running text that are not formalized or only partly formalized.

Blind statement check

The main risk of a formalization is a formal statement that does not say what the book says.

For chapters 4 to 10, 12 to 15 and appendix B, a second set of statements was written from the book text only, without the formal code of the chapter. Bridge files then derive each blind statement from the main declarations. Chapters 2, 3 and 11 have no blind statement check.

547blind statements derived
16derived after a correction; the literal statement is refuted
5gaps, each with a note
15blocks with no mathematical claim

How the result is checked

Full check
make check typechecks all modules from source with the pinned Narya. It rejects axioms and holes in the sources and in the diagnostics of Narya, and records the hashes of the sources and of the executable. The recorded run of 5 October 2026 took 2 h 19 min and 27 GB of memory on one core of an x86_64 Linux server.
Negative controls
Two false proofs must fail with a type mismatch, so that a broken setup cannot pass silently.
Book mapping
Each block has a note that gives every difference between the formal statement and the printed text. The mappings need mathematical review: a successful typecheck does not show that a statement agrees with the book.

Foundations

  • The proofs use the native Id, transport and univalence of Narya. Module 20 proves the two inverse laws of univalence.
  • The pinned Narya has no higher inductive types. A signature record gives each higher inductive type of the book with its induction and computation laws, for example CircleSignature.
  • Where the book needs a specific object, the repository constructs it. The circle is the component of the infinite cycle (Int, succ) in the type of cycles. Propositional truncation is an impredicative encoding.
  • Smallness predicates model the universes of the book. Resizing, replacement and classical principles are explicit hypotheses where a proof uses them.

Limits

The pinned Narya has Type : Type and no checker for termination, positivity or productivity. Thus a successful typecheck is not a consistency result. A heuristic lint scans for unrecognized recursion and non-positive datatypes, but a pass does not prove soundness.

symmetry-narya · GPL-3.0-or-later · Source code on GitHub · formalized.si