This repository checks ports from pinned Lean and mathlib releases with a pinned Omega compiler. Each port pairs a valid theorem with a small source change that Omega must refuse. A separate receiver also checks proofs saved in Psi, Omega's portable program format, for four Boolean laws and sixteen integer order laws.
The kernel soundness work checks properties of the
checker itself and records the remaining proof obligations. Run it with
python -B verify_soundness.py.
| Lean reference | Statement checked in Omega | Saved Psi proof |
|---|---|---|
| Eq.symm | Identity is symmetric for borrowed values of generic type T | Omega checks the generic source. A named citation could not resolve the generic callable type. |
| Eq.symm on Bool | From x = y, derive y = x | Replayed with one premise and zero axioms |
| Option.bind and Option.join laws | Sequencing optional computations, mapping before or after bind, and flattening nested options | Omega checks ten generic laws, including associativity for arbitrary functions between types in three independent universes |
| Nested Option laws | Binding a flattened option and mapping and flattening nested options | Omega checks four laws for two or three layers of optional values |
| Option.map_none and Option.map_some | Mapping an empty option and mapping a present value | Omega checks both equations for every function between types in independent universes |
| Option.map_id_apply | Mapping the identity function preserves each optional value | Omega checks the equality separately for empty and present values |
| Six optional sum projections | Read a left or right payload before or after swapping the sum | The extractor returns the bundled Omega Optional type. The swap proofs check both constructor branches. |
| Six sum laws | Swap and map both constructors, recover a sum after two swaps, and compose maps | The fully applied composition proof checks both branches with four arbitrary functions and six independent type universes. |
| Sum.elim_inl, elim_inr and elim_map | Eliminate a sum at either constructor or after mapping both branches | Omega checks arbitrary data and strict proof results. Lean checks that observing both results in every data type recovers equality at any result sort, including Prop. |
| Four Sum map observations | Mapping preserves the side and applies the chosen function to the optional payload | Omega checks each constructor for arbitrary functions between four independently quantified types. |
| Two mathlib Sum inverse laws | Swapping twice returns the original sum | Both inverse declarations unfold pointwise to the checked double-swap equation. |
| Four mathlib product map and inverse laws | Map an arbitrary pair, exchange its component maps by swapping, and reverse either swap | Lean checks both inverse APIs against the same pointwise double-swap proof. |
| Four product projection laws | Project a component after swapping a pair or mapping a function over each component | The two map laws quantify over independent functions and all four carrier universes. |
| Five product laws | Rebuild a pair from its projections, swap its components, and map and compose component functions | The source proofs quantify over two, four or six independent universes and arbitrary mathematical functions. |
| Five function equalities for product maps and swaps | Whole curried functions over arbitrary component types | Lean proves currying preserves and reflects function equality. Omega checks the two functions in every reflexive relation, including equality. A separate false control substitutes an unrelated function of the correct type. |
| Std.IsPreorder.le_refl and le_trans | Reflexivity and transitivity for any proposition-valued relation with both preorder laws | Each projection uses the same bundle interface. Lean checks its equivalence to the two fields of the standard preorder class. |
| Twelve Option fallback laws | Choose the first present value and extract a default | Covers associativity, mapping, and nested options at arbitrary element types. Lean checks that equality after every observation is equivalent to the four equations expressed in that form. |
| Option.map_map | Mapping twice is mapping the composition, for arbitrary functions between types in three independent universes | Omega checks both constructor cases during compilation |
| List.append_nil | Appending an empty list on the right preserves the list | Omega checks the induction during compilation |
| List.append_assoc | Regrouping three finite lists preserves their concatenation for any element type | Omega checks the induction during compilation |
| Semigroup associativity (mathlib) | Use the supplied associativity law for an arbitrary multiplication operation | Omega checks the supplied law during compilation |
| Multiplication in a commutative semigroup (mathlib) | Swap the first two factors of a three-factor product for any commutative semigroup | Omega checks the three law citations during compilation |
| Left commutativity of Boolean conjunction | The generic theorem applied to the actual AND operation | Omega checks both operation laws and refuses first projection at commutativity |
| Four factor-rearrangement laws (mathlib) | Swap or rotate arbitrary factors, including inside a four-factor product | Omega checks each source and refuses a conclusion with one factor changed |
| List.replicate_add (mathlib) | Repeating an arbitrary value m + n times equals appending m copies to n copies | Omega checks the induction over unbounded natural numbers during compilation |
| List splitting and offsets (Lean) and suffix slicing (mathlib) | Reassemble the input after taking a prefix, and advance past concatenated chunks | The source proofs use arbitrary input lengths, counts and element types at Type 0. Omega checks both citations in each of the two combined proofs. |
| Five List.map laws | Map over constructors, append, the identity function and composition | The equations quantify over arbitrary mathematical functions and list element types at independent universes. |
| Bird–Wadler list fold duality | Left and right folds, commuting actions, duality laws, reversal | Two actions commute through an arbitrary list. The central-accumulator law requires only the starting value to commute with every element. Lean checks the folds and reversal against the standard list operations. |
| Five List.map consumer laws | Mapping a singleton, reading the head or tail, and appending one final element | Omega checks the optional and ordinary tail operations and proves the concat equation by induction for arbitrary element functions. |
| Six List.flatten laws | Combine variable-length rows, groups, and three-level nested lists | The concatenation proof uses flattening of append and singleton. The three-level proof uses flattening of append at each induction step. Lean checks every element universe. Omega checks arbitrary elements at Type 0. |
| Padded list prefixes (mathlib) | Take exactly n elements, filling any missing elements with a caller-supplied value | Omega proves the result length, recovers the left input of an append, and proves agreement with ordinary take whenever the request fits. The recursive Omega proofs use an arbitrary element type at Type 0; Lean checks the upstream statements at every universe. |
| Natural-number list intervals (mathlib) | Length, emptiness in both directions, singletons, head decomposition, upper-endpoint extension, concatenation, zero-based ranges, and shifting endpoints by addition or subtraction | Omega proves these identities for unbounded natural endpoints. Lean verifies that the recursive operations agree with Mathlib and that the Omega order premises characterize the upstream bounds. |
| List.length_append | The length of two concatenated lists equals the sum of their lengths for any element type | Omega checks the induction during compilation |
| List.length_append on Bool | The length of two concatenated Boolean lists equals the sum of their lengths | Omega checks the induction during compilation |
| Six addition laws for Nat | Zero, successor, associativity, left and right commutativity, and four-addend interchange on unbounded natural numbers | Omega checks the induction and the use of each cited law during compilation |
| Six natural-number multiplication laws | Multiplication by zero and one on either side, the successor rule, and doubling | Omega checks the equations for unbounded naturals and the induction where required |
| Seven natural-number product laws | Commutativity, right distributivity, successor on the left, doubling on the left and three rearrangements | Omega proves the laws for unbounded natural numbers |
| Thirteen natural-number power laws | Zero, successor and small exponents, powers of one, sums and products of exponents, and powers of products | Omega checks the equations for unbounded natural numbers by reduction, cited laws and induction |
| Nine natural-number addition and cancellation laws | Cancel a common left or right addend from equal sums, and add it back to equal inputs | Omega checks both implications on unbounded naturals, together with the zero, one, successor and subtraction equations. |
| Eleven mathlib laws for natural-number distance | Absolute difference on unbounded naturals | Adding the same number to both inputs preserves distance. From equal sums, Omega proves that the distances between corresponding addends are equal. The conditional laws recover subtraction from an order premise. Lean checks that zero truncated subtraction expresses that premise in both directions. |
| Six mathlib theorems on distance bounds and equality | Triangle inequality, four endpoint bounds, and equality at zero distance | Omega checks the triangle inequality for three arbitrary natural numbers and rejects removing either leg of the route. |
| Five mathlib distance equations and implications | Multiplicative scaling and the defining equation, extrema and positivity | Distinct naturals have positive distance. Lean checks the source equality test and the recurrences for minimum and maximum. Together the three distance groups cover all 22 exported theorem declarations in the pinned module, including the generated defining equation. |
| Sixteen private arithmetic proofs from mathlib’s natural-distance module | The unfolded statements about addition and truncated subtraction | Lean checks the exact private constant behind each wrapper. These are generated proof obligations for 16 of the module’s 22 exported theorems. The inventory reports their visibility separately. |
| The first five prime ranks | Divisibility checks and counting primes below a candidate | Omega checks every proper divisor and counts primes strictly below each candidate. Lean proves these two tests characterize the exact Nat.nth Nat.Prime equations for the five positive candidates. |
| Casting positive naturals in arithmetic propositions | Comparison in both directions and subtraction that saturates at one | All seven exported and three private declarations in Mathlib.Tactic.PNatToNat have source proofs. Omega proves both arithmetic branches on arbitrary natural inputs and checks both directions of each comparison on positive values. |
| The ordered multiplicative equivalence with natural non-zero-divisors | The two zero-product tests, inverse maps, multiplication and order | Omega checks all eight exported and one private theorem in Mathlib.Algebra.Order.Monoid.PNat over unbounded naturals. Both orders of multiplication are tested separately at zero. |
| Finite intervals of positive naturals | Increasing lists for four endpoint conventions and unordered closed intervals | All 24 exported theorems of Mathlib.Data.PNat.Interval have source checks. These cover embeddings, restriction to positive values, cardinality, and the bounds for membership in each ordered interval. |
| Positive naturals, successors and the equivalence with naturals | Unbounded positive values and explicit larger witnesses | The unique predecessor represents each positive value. Both positive-natural equivalence theorems and all five theorem declarations about successor order, including three generated proofs, have source checks. |
| Parity equivalences on unbounded naturals | Doubling, halving and both inverse laws | Lean identifies both Boolean and sum constructors with tags zero and one and checks the pointwise interpretation of function equality. Omega proves each coordinate for arbitrary natural payloads. All seven exported declarations in Mathlib.Logic.Equiv.Nat, including three generated proofs, are registered. |
| The 49 declarations for natural square roots | Floor bounds and perfect-square witnesses, strict bounds and gaps between squares, strict comparison in an arbitrary linear order | Omega covers every unbounded input by its remainder above the preceding square and its distance from the following square. Lean checks all 34 exported and 15 private declarations from Mathlib.Data.Nat.Sqrt, including the two order rules over arbitrary types. |
| Partial predecessor and subtraction | Returning an optional natural and composing partial subtraction, equality under predicate transport | Lean checks the bijection between optional naturals and their Omega codes. The recursive and comparison-based algorithms distinguish underflow from a result of zero on every input. All 19 exported and two private declarations in Mathlib.Data.Nat.PSub have source proofs. |
| Products and sums of integer units | Classifying both factors of a product and both orders of a pair | The 19 exported and four private declarations cover integer products equal to either unit, natural casts, and equality of sums of two units up to permutation. The source derives each magnitude from an inverse product and checks the sign of each factor. |
| Classifying integer units and comparing their values | Classifying a signed integer from its inverse, uniqueness of inverses in an arbitrary monoid | Omega derives the two possible integer units from multiplication, then checks when they are negatives. The module’s two private value-equality laws retain the arbitrary carrier, operation and universe of their Lean declarations. |
| The twelve order laws for integer units | Multiplication by a sign, powers and small nonzero squares | Omega checks inverse, division and arbitrary exponents for both integer units. For an arbitrary integer whose square is below four, the source proof retains the nonzero premise and constructs the bound on its magnitude. |
| Order comparisons for integer squares and square roots | Constructing the difference between ordered squares and recovering the difference of their roots | Omega proves all five equivalences on unbounded integers. The two square-root bounds retain their nonnegative-input premise and cover both multiplication and exponentiation by two. |
| Unbounded integer square roots | Counting steps between consecutive squares | Lean proves that the two-field countdown gives the floor square root for every natural. Omega proves the signed square and witness equivalence, nonnegativity, and both natural-cast declarations from the complete six-theorem integer module. |
| Integer absolute values and association | Construction of a unit witness and recovery of the common magnitude | Omega constructs the multiplier from two arbitrary integer signs and proves the converse for any supplied unit. Lean checks that the encoding represents every integer and unit, including both signs of zero. |
| Five declarations for integer absolute value | Absolute values of arbitrary integer representatives and both orders of natural subtraction | Lean checks that every integer occurs as a difference of naturals. Omega proves that equivalent representatives give the same value. The pinned module records three exported and two private theorem declarations. |
| Four mathlib theorems classifying natural-number units | Only 1 has a multiplicative inverse, and only 0 has an additive inverse | Omega checks both components of any two-sided inverse. It also constructs the witnesses for the reverse directions. The pinned module has four exported theorems and zero private theorems. |
| Two mathlib type-tag laws for naturals | Multiplicative-tag powers as repeated addition | Lean verifies the carrier, both conversions and the additive scalar action used for tagged powers. These are both exported theorems in the pinned module, which has zero private theorems. |
| Boolean sets | The universe and singleton complements, the image of an arbitrary function | For any target type, the image proof locates a Boolean witness in the pair and constructs a witness from either member. The Lean wrapper checks all three private declarations and the pointwise meaning of set equality. |
| Boolean quantifiers over lists | Finding a witness or counterexample in the original list | Each element keeps its predicate result. Omega recovers the skipped prefix and the complete suffix starting at the witness, and checks both folds on lists of arbitrary length. |
| Natural and integer casts into dependent functions | Dependent functions and both orientations of their equality, constant functions on sums | Casts may vary with the index and its result type. Both branches of a sum produce the same cast, and function extensionality establishes equality of the functions. |
| Nonzero natural casts | A nonzero cast has a positive natural preimage | Omega uses congruence and the image of zero for an arbitrary target carrier. Splitting the preimage into zero and successor supplies a predecessor for each lower bound. |
| Natural casts into products | Projections, numerals, zero and successors in a pair | Each component has its own type, universe and cast. Omega applies the component zero and successor laws to the actual pair constructor and uses two successors for the numeral declarations. |
| Integer casts and additive group laws in products | Paired casts, subtraction, signed scalar multiplication and additive inverses, the projections | Omega applies the component laws independently. Both coordinates preserve the full signed scalar, including zero and negative successors. |
| Four mathlib Option eliminator laws | The fallback and mapping branches, reconstruction of an arbitrary function, and agreement with Option.elim | The two types range over independent universes. Lean checks that pointwise reconstruction is equivalent to the upstream function equality. These are all four exported theorem declarations of the module, which has zero private theorems. |
| Thirteen declarations from mathlib’s superfactorial module | Factorial products over intervals and ranges, including the 2n and 4n formulas | Omega proves the identities for every natural number. Lean checks the source product recurrences against the exact finite sets used upstream. The compiled module emits four recursion equations and nine named theorems. |
| Seventeen predecessor and subtraction laws | Truncated subtraction on unbounded natural numbers, including cancellation and subtraction in either grouping | Omega checks the zero and successor equations and the inductions that use them |
| Nat.mul_add | Multiplication distributes over addition for all natural numbers | Omega checks the induction during compilation |
| Nat.mul_assoc | Regrouping three natural-number factors preserves the product | Omega checks the induction and its use of distributivity during compilation |
| Minimum and maximum on eight fixed-width word types | Signed and unsigned comparisons | Each machine returns the operand selected by the Lean conditional. Two false guarantees switch each branch separately. The signed 8-bit and unsigned 64-bit callers check both argument orders and equal operands. |
| Bitwise equations for eight fixed-width integer types | AND, OR, XOR, complement and their arithmetic identities | The 316 Lean declarations include the two’s-complement relationship between negation and complement, and both directions of XOR cancellation. Six signed and unsigned callers pass named proofs to another function. A separate reader checks their saved proofs and rejects substitutions across operations and integer types. |
| Complement, zero and all-ones bitwise results | Conjunctions and disequalities | Across eight integer types, an OR is zero exactly when both operands are zero, an AND is all ones exactly when both operands are all ones, complement differs from its operand in both comparison orders, and zero differs from one. |
| Modular cancellation on eight integer types | Both directions of 96 addition, subtraction and negation equivalences | Omega proves the implications by adding or subtracting equal operands and applying the inverse arithmetic law. Each direction has its own false conclusion. |
| Wrapping arithmetic on eight integer types | Addition, subtraction, negation and multiplication | Lean reads all 308 upstream equations with their operand types and axioms. Omega proves each equation for all inputs and refuses the result offset by one modulo the width. |
| Fixed-width integer bounds | Signed minimum and maximum and unsigned comparisons with zero and one | The 44 source proofs check all four widths. Lean checks each signed endpoint against the literal used in Omega. |
| Order laws for eight fixed-width integers | Reflexivity, strict comparison, antisymmetry, mixed transitivity, totality, order alternatives, zero below one, and negated comparisons | Lean checks each of the 176 upstream constants against its complete type. Omega checks each signed or unsigned machine and its individual negative controls. |
| Order bounds for unsigned bit masks | AND, OR, and the wrapping successor | At each width, AND is at most either operand and OR is at least either operand. The strict successor bounds require the operand to be below the all-ones value. |
| UInt64.le_trans | If x ≤ y and y ≤ z, then x ≤ z for unsigned 64-bit integers | Replayed with both premises and five integer-theory assumptions |
| UInt8, UInt16, UInt32, Int8, Int16, Int32 and Int64 transitivity | If x ≤ y and y ≤ z, then x ≤ z at each width, for unsigned and signed integers | Receiver checks each saved proof against its declared integer type and both premises |
| Strict order transitivity for all eight integer types | If x < y and y < z, then x < z for unsigned and signed integers | Receiver replays both strict premises and rejects substitutions with the non-strict theorem |
| Nat.add_comm | Swapping the operands of addition preserves the sum for all natural numbers | Omega checks the induction during compilation |
| 24 logical equivalences on Booleans | When AND and OR are true or false, equality under negation, and cancellation of exclusive OR | Lean checks the translation of decidable propositions to Boolean tests. Omega checks their equivalence for arbitrary Boolean inputs and refuses each negation. |
| 12 further Boolean equivalences | Equality under AND and OR, including both cancellation laws | Omega checks both implications and refuses a false conclusion for each. The cancellation proofs use the contrapositive of the reverse implication. |
| Exclusive OR on Booleans | 16 equations for Boolean inequality, Lean’s definition of exclusive OR | Omega checks each equation and refuses its negation |
| Boolean equations from compiled Lean declarations | 27 equalities for AND, OR, NOT and the Boolean constants | Omega checks each source and refuses its negation |
| Six Boolean algebra laws | Both De Morgan laws and the four left/right distributive laws for AND and OR | Omega checks both Boolean cases during compilation |
| Bool.and_comm | Swapping two Boolean operands preserves AND | Replayed |
| Bool.and_assoc | Regrouping three Boolean operands preserves AND | Replayed |
| Eq.trans | Identity composes on borrowed values of generic type T | Named citation could not resolve the generic callable type |
| Eq.trans on Bool | From x = y and y = z, derive x = z | Replayed with both premises |
| List.length_reverse | Reversal preserves the length of a list of any element type | Omega checks the induction during compilation |
| List.reverse_append | Reversing two concatenated lists gives the reversed second list followed by the reversed first | Omega checks the induction during compilation |
| List reversal and its accumulator | Reversal of empty, singleton, cons and suffix-extended lists, and the relation between reverseAux and append · Reversing the accumulator twice | Omega checks the generic laws and their helper proofs during compilation |
| List.reverse_reverse for any element type | Reversing twice restores every finite list of elements of an arbitrary type | Omega checks the proof with its element type left arbitrary during compilation |
| List.reverse_reverse on UInt64 | Reversing twice restores every finite list of u64 values | Omega checks this law during compilation and publishes its list type |
| List.reverse_reverse on Bool and UInt64 | Two callers use the same generic proof on Boolean and u64 lists | Both callers and their guarantees are checked during compilation |
The declaration inventory lists the theorem declarations present in the pinned Lean distribution or a compiled external library. Its registration report groups specialized ports under the upstream theorem they reference. The verification runner checks the actual proof and its controls.
Install Git, Python 3.9 or newer, the pinned Lean toolchain using elan, and
Omega's qualified mbx adapter and Rust build prerequisites. Run from the
repository root:
python verify.pyUse python verify.py --jobs 4 to run four proof batches concurrently. Registrations that share an Omega source file stay together so the verifier can reuse its positive result. Each mutation and saved proof still gets its own check. Batches also share the Lean report for a wrapper compiled with the same inputs.
With a standalone Lean installation, set LEAN to its executable. The runner
checks Lean's commit, fetches the revision in omega-revision into .omega/,
and builds Omega. Each run writes the Lean axiom reports, Omega diagnostics,
and applicable Psi files and replay logs under a fresh .out/verification-*/
directory. Within one run, entries with identical Omega source, local dependencies,
compiler settings and environment share the successful positive check. Each entry
gets its own log. The runner checks each Lean theorem binding and runs each negative
on its own source copy. It also emits, runs and replays each registered Psi artifact
separately. The runner builds the receiver once and launches it for each saved
proof and substitution. It checks that the compiler and bundled library are
unchanged before reporting a successful run.
To test a candidate Omega compiler, run
python verify.py --omega-revision <full-commit-hash>. The runner builds that
revision in .omega/ and links the proof receiver against the same checkout.
The next default run selects the repository pin again.
For ports that import mathlib, the runner checks out the commit in
mathlib-revision under .out/upstream/mathlib4/. It uses the pinned Lean
toolchain’s Lake executable to fetch the compiled modules needed by those
ports and checks the Lean wrappers in that project’s environment. The first
run needs network access to mathlib, its locked dependencies and the build cache.
Composing optional maps. Applying two functions successively to an optional
value gives the same result as applying their composition once. The Omega
source defines map on None and Some, then proves the equality for
arbitrary functions by splitting on those two cases. The Lean wrapper also checks that moving the independent function
arguments after the optional value preserves the theorem. Replacing the
right-hand side with None fails in the Some case. Removing either
constructor arm identifies the missing case.
Lean’s Option.map_map
Equality symmetry. Omega checks the reversed equality on borrowed values of an arbitrary type. Removing the premise or negating the conclusion makes the generic proof fail. For the Boolean specialization, Psi stores both orders as the same equality. The receiver checks its two endpoints and its premise, then asks the kernel to check the saved proof against disequality. The kernel rejects it. Lean equality symmetry
Appending an empty list. The nonempty case uses the induction hypothesis on the tail. Omega refuses this case if the hypothesis is removed or if the second argument to append is changed to the original list. Lean checks that the latter claim fails for a singleton. Lean proof
Boolean observations of a sum. The two constructor tests distinguish left and right payloads at independent universes. Swapping a sum exchanges the tests. Omega checks both swap branches and refuses the reversed Boolean claims. Lean theorems · Omega proofs
Associativity of concatenation. Omega proves the law by induction on the first list, with all three lists and their element type left arbitrary. The empty case follows from the definition of append. The nonempty case uses the same law on the tail. Removing that recursive call makes the nonempty case fail. Swapping the last two lists on the right makes the empty case fail. Lean checks a counterexample to the swap using two distinct Boolean elements. Lean append associativity
Multiplication in a commutative semigroup. Omega proves
a * (b * c) = b * (a * c) for an arbitrary type and multiplication
operation. The caller supplies proofs that the operation is associative and
commutative. The proof uses associativity twice and commutativity once.
Removing any one of those citations makes Omega reject the proof. The
separate mul_assoc port checks that the caller supplied associativity
for the same multiplication. Lean reports zero axioms for both theorems.
mathlib associativity · mathlib left commutativity
Boolean conjunction as a semigroup. Lean applies the same mathlib theorem
to a local commutative semigroup whose multiplication is Boolean AND. In
Omega, the operation evaluates a && b and returns the corresponding
Boolean literal. Its postconditions say that a true right input returns
the left input, and a false right input returns false. The two operation laws
use these guarantees to establish equality before the concrete caller cites
the generic theorem. Substituting first projection preserves associativity
but fails the commutativity guarantee. On false, true, swapping the inputs
changes the projection from false to true. The verifier also refuses the
concrete caller with one factor changed. The verifier then publishes the caller
to Psi, loads the saved file and executes the law with both orderings of
false and true. Conjunction implementation · Rejected projection
Splitting a repeated list. Mathlib proves that making m + n copies
of a value gives the same list as appending m copies to n copies.
Omega proves the equality by induction on m for any element type and
unbounded natural numbers. Lean checks the upstream statement at Type u
and at Type, and reports propositional extensionality as its sole axiom.
The Omega controls change the second block to m copies and, separately,
remove each of the three proof calls needed in the induction.
mathlib proof
Length after concatenation. Both input lists can have any finite length. The generic proof also leaves their common element type arbitrary. Adding one to the claimed result fails on the empty-list case. Deleting the recursive proof call fails on the nonempty case. The port also checks what happens when each case loses the arithmetic lemma it needs. Lean list length proof
Multiplication of natural numbers. The associativity proof uses the
distributive law in its successor case. Removing that citation makes Omega
reject associativity at the successor case even though the distributive law
itself still checks. Changing the distributive law to the false claim
a * (b + c) = a * b + c makes Omega reject both the changed theorem and
the proof that depends on it. Lean multiplication proofs
Integer order. For signed and unsigned 8-, 16-, 32- and 64-bit integers,
Lean proves transitivity for both < and ≤. Each strict wrapper assigns
the compiled Lean declaration directly to the type x < y → y < z → x < z.
Omega refuses all 16 theorems when either premise is removed or the conclusion
is reversed. It also refuses a strict conclusion when both premises use ≤.
Each signed caller applies the theorem across zero. The verifier runs every
saved caller and checks that Psi exits successfully.
For each saved theorem, the receiver checks its integer type, both premises and its conclusion, then replays the certificate and checks that the kernel refuses it at the reversed conclusion. Supplying a proof for a different width, sign or comparison also fails.
The receiver compares the saved theory declarations and the assumptions the
proof uses with its own reconstruction. Unsigned non-strict proofs use five
assumptions. These introduce the integer type, non-strict order, zero,
the operation n ↦ 2n + 1 used in the upper bound, and order transitivity.
Unsigned strict proofs use six assumptions because the theorem uses < while
the bounds still use ≤. Signed proofs also use doubling and negation to
express the minimum, bringing the counts to seven for ≤ and eight for <.
Lean reports propext for all 16 upstream declarations.
Lean unsigned order
and Lean signed order.
Addition of natural numbers. The Omega port defines zero, successor and
addition on unbounded natural numbers. It follows Lean's induction on the
second operand. Changing the conclusion to a + b = b fails at zero, with
a = 1 as a counterexample. Independently, removing the induction hypothesis
or the lemma that moves a successor through addition makes the successor case
fail. Lean reports zero axioms for the upstream theorem. Lean addition proof
Checking a Boolean statement against Lean. The Lean reader finds theorem
declarations directly in the Bool namespace whose types quantify only over
Booleans and equate expressions built from variables, true, false, AND, OR,
NOT and exclusive OR. It reads all binders, both sides and the upstream
axioms from Lean’s environment. The verifier compares that statement with the complete Omega
machine header, then compiles a copy with the entire equality negated.
For example, Bool.and_not_self checks b && !b == false for both possible
inputs. Its changed claim fails in that machine.
All 35 matching declarations using AND, OR, NOT and constants have Omega ports. Eight have separately registered ports. The grouped source checks the other 27 against their compiled Lean statements, including the three laws for repeated OR operands. Lean reports zero axioms for those 27.
Lean defines Boolean exclusive OR as inequality. The reader checks that
definition and translates its two operands to Omega’s Boolean !=.
Omega verifies all 16 additional declarations, including associativity and
both distributive laws for AND over exclusive OR. The left distributive law
cites the right distributive law with its arguments reordered. Replacing
the exclusive OR on the right with inclusive OR gives a false equality
when all three inputs are true. Omega rejects that change. Lean reports propext and Quot.sound
for Bool.not_xor_not and zero axioms for the other 15.
Boolean conjunction. Omega sorts and flattens pure conjunctions. The receiver checks that the stored guarantee still contains each distinct Boolean input. Changing a right-hand AND to OR produces a false claim. Lean checks a concrete counterexample, Omega refuses the changed source, and the kernel rejects the original proof at the changed goal. Lean commutativity · Lean associativity
Transitivity. Lean quantifies over any Sort u. Omega's generic source
states identity on three borrowed values of the same type. Removing the
second premise makes that source fail. For the Boolean specialization, the
receiver reconstructs the exact two equality premises and their endpoints.
Changing the conclusion to x ≠ z keeps both premises and makes the saved
proof fail kernel type checking. The Lean and Omega checks of the Boolean
proof report zero axioms. Lean transitivity
Length and order under reversal. Moving the head of a list into the accumulator preserves their combined length. Omega checks that invariant for arbitrary lists, then uses it with an empty accumulator to prove that reversal preserves length. For concatenation, two helper laws describe how reversal processes the two inputs and how it preserves a suffix already in the accumulator. Omitting either helper leaves the final equality unproved. Reversing both inputs while leaving them in their original order also fails. Lean length proof · Lean reverse-append proof
List reversal. The Omega port follows Lean's accumulator proof. It proves
the helper law by induction on the input list, then applies it with an empty
accumulator. Deleting the recursive proof call fails at the nonempty list
case. Changing the conclusion to say that a single reversal restores every
list also fails. The general Omega port checks the theorem as written, without a caller.
Its only assumption about the elements is that they form a type. The
kernel checks that the final proof cites the accumulator law at this type. Deleting
the helper call in the final theorem also makes that theorem fail. The Lean
reference checks this statement at α : Type and the upstream statement at
α : Type u. Lean reports propext (propositional extensionality) for both. Omega's saved
Psi carries the list type; its compiler checks the plain-data law before
publication. Lean reverse definitions · Lean reversal proof · Omega's checks on the two proofs · Omega publication contract
A separate source checks two concrete callers. One asks for the theorem at
List<bool> and one at List<u64>. Each states double reversal as its own
guarantee and cites the generic proof. Changing just the Boolean caller to
claim that a single reverse suffices fails at that caller. Changing just the
integer caller fails at the integer caller. The UInt64-only source also checks the
monomorphic proof directly.