Encyclopedia Foundation Foundation Primitive Recognition Calculus Grow Eta Completion M0a Cross Diff Sel

ARTICLE 3 claims 2 theorems 1 model

Foundation Primitive Recognition Calculus Grow Eta Completion M0a Cross Diff Sel

A single line in a machine-checked library proves that subtracting a rational number from itself always yields zero, a small but load-bearing step in building real numbers from recognition sequences.

The self-difference lemma

The declaration crossDiff_self proves a basic fact about rational numbers: for any rational number a, the cross-difference of a with itself is zero. The cross-difference is an integer that encodes the difference between two rationals without using fractions directly. For a rational written as numerator over denominator, the cross-difference of a and b is a.num times b.den minus b.num times a.den. When a equals b, both products are identical, so their difference is zero. The proof in the library is immediate: it unfolds the definition and applies integer arithmetic.

This lemma appears inside a construction of real numbers from sequences of rationals. The framework builds a ledger, a discrete record of events, where each entry is a rational number. To compare two entries, it uses the cross-difference rather than ordinary subtraction, which avoids the display of fractions entirely. The self-difference lemma is the reflexivity condition: it guarantees that a sequence is always equivalent to itself, a requirement for the equivalence relation that groups sequences into real numbers. Without this lemma, the relation could not be shown to be reflexive, and the entire construction would fail at its first step.

The lemma also supports a stronger statement: if two rationals have cross-difference zero, they are equal in the sense the framework uses. This is the bridge from the integer-valued cross-difference to the equality of rationals. The self-difference case is the simplest instance, where the two rationals are literally the same object. The library proves this as a separate theorem, crossDiff_of_crossEq, which uses the same integer arithmetic after unfolding definitions.

What the lemma does not claim is more limited than it might appear. It does not assert that any two distinct rationals have nonzero cross-difference; that would require the stronger theorem about equality. It does not define what a real number is, only that a sequence is equivalent to itself. It does not show that the equivalence relation is symmetric or transitive, though those properties are proved elsewhere in the same file. The lemma is a single reflexivity fact, nothing more, but it is the kind of small step that a machine-checked proof needs to build larger structures.

In Recognition Science, this lemma is part of the eta completion, the process of adding limits to the rational ledger to obtain real numbers. The construction embeds each rational as a constant sequence, and the self-difference lemma ensures that this embedding is well-defined. It is a technical but necessary piece: it shows that the ledger's own arithmetic is consistent, that no rational is confused with itself. The consequence is that the framework can talk about real numbers as equivalence classes of rational sequences, with the reflexivity of the relation guaranteed from the start.

THEOREM crossDiff_self · IndisputableMonolith/Foundation/PrimitiveRecognitionCalculus/Grow/EtaCompletionM0a.lean
/-- A rational minus itself has zero cross-difference. -/
theorem crossDiff_self (a : RatioOrbit) : crossDiff a a = 0 := by
  unfold crossDiff
  omega
MODEL crossDiff · IndisputableMonolith/Foundation/PrimitiveRecognitionCalculus/Grow/EtaCompletionM0a.lean
/-- The cross-difference: the integer numerator of `a - b`,
i.e., `a.num * b.den - b.num * a.den`. This avoids the ℚ display entirely. -/
def crossDiff (a b : RatioOrbit) : ℤ :=
  a.num.toInt * (b.den.toNat : ℤ) - b.num.toInt * (a.den.toNat : ℤ)
THEOREM crossDiff_of_crossEq · IndisputableMonolith/Foundation/PrimitiveRecognitionCalculus/Grow/EtaCompletionM0a.lean
/-- Cross-equal rationals have zero cross-difference. -/
theorem crossDiff_of_crossEq (a b : RatioOrbit) (h : RatioOrbit.crossEq a b) :
    crossDiff a b = 0 := by
  rw [RatioOrbit.crossEq_iff_toIntCross] at h
  unfold crossDiff
  omega

What this page does not claim

The lemma does not assert that any two distinct rationals have nonzero cross-difference. The lemma does not define real numbers or show that the equivalence relation is symmetric or transitive. The lemma does not prove that the embedding of rationals into reals is injective.

Verify this page

Every tagged claim above names its theorem. To check one yourself rather than trust this page, elaborate the source module with Lean 4 and audit its axiom basis:

$ lake env lean IndisputableMonolith/Foundation/PrimitiveRecognitionCalculus/Grow/EtaCompletionM0a.lean
expected axiom basis: [propext, Classical.choice, Quot.sound] (the Lean kernel's standard three; no RS-specific axioms)

A page whose claims cannot be reproduced this way does not ship. In production, every anchor links to the exact declaration in the public source release, and this block carries the build receipt for the page itself.

Derived articles

This page is generated by a question-recursion engine: the questions its answers raise become the next pages. The current agenda, with open targets marked red:

MACHINE LAYER · GROUNDED CLAIM TABLE · CLICK TO EXPAND