Playground Documentation Challenges Full Docs

Formall Documentation

A formal logic programming language for constructing and verifying mathematical proofs

What is Formall?

Formall is a language for writing and verifying formal mathematical proofs. You define your axioms, declare types and symbols, and build proofs step by step — Formall checks every step mechanically.

Unlike most proof assistants, Formall has no hidden automation and no tactics engine. Every step is written in the text; the one command that writes steps for you (decide) is named in the proof and expand into ordinary commands. Every run can also write a journal of all steps, which an independent checker verifies with four rules — hypotheses, axioms, rewriting and applying a theorem (a call T[…]): contradiction, generalization, calls on quantified facts, implication, equality and enumerations all come down to calls of theorems and axioms the files write (Command Reducibility). What you see is exactly what is verified.

Despite this minimalism, Formall is expressive enough for serious mathematics:

  • Second-order logic — quantify over predicates and functions, not just values
  • Any axiom system — Peano arithmetic, ZFC set theory, or your own foundations
  • Type polymorphism — prove a theorem once for a type parameter, instantiate it with any concrete type by a call T[…]
  • Parametric theorems — the lock/axiom/call mechanism lets theorems accept proof arguments, analogous to how higher-order functions accept function arguments
  • Full reuse — every proved theorem becomes a lemma applicable anywhere by a call

The included library covers propositional logic, quantifiers and equality; Peano arithmetic up to the fundamental theorem of arithmetic; set theory from axioms (the Russell paradox, Kuratowski pairs, and the integers, positive rationals and reals built from sets); ordered fields and completeness, limits and continuity; Hilbert's geometry (incidence and order, synthetically and in coordinates); groups and commutative rings; Cantor's diagonal argument and logic puzzles. Each theory is a module that can be imported or interpreted in another model.

ℹ
Formall verifies proofs, it doesn't find them automatically. You write the proof, Formall checks it. This means every proof is fully transparent — there is no step you did not reason about yourself.

Quick Start

Here's a minimal Formall program that proves a simple logical identity:

Your First Proof

This program defines boolean logic and demonstrates proof by contradiction.

▶ Run

Core Concepts

Types and Atoms

Formall is strongly typed. You declare types with type(...) and atoms (values/functions) with for:

Type declarations

▶ Run

Statements and Proofs

A statement in Formall has the form expression -> expression. The if command introduces assumptions, and a proof <…> derives new statements:

Making statements

▶ Run

Labels for Reuse

Labels let you name and reuse proven statements:

Using labels

▶ Run

Documentation Structure

📚 Basics

Types, atoms, expressions, and fundamental concepts

⚡ Commands

all commands by what they do with scopes — context, proof steps, generators, labels, notation, import

⚙️ Rules

define, bijective — the rules that generate axiom schemes; hint — the theorems a rewrite rests on

🎯 Examples

Peano arithmetic, set theory, logic puzzles