Encyclopedia Foundation Foundation Primitive Recognition Calculus Delta Real Floor Double

ARTICLE 1 claim 1 theorem

Foundation Primitive Recognition Calculus Delta Real Floor Double

A machine-checked theorem pins down how rounding errors behave when a real number is repeatedly doubled, a small but load-bearing step in building real arithmetic from rational approximations.

The doubling bound

In ordinary mathematics, the floor function ⌊x⌋, the greatest integer less than or equal to x, behaves predictably under doubling. If you take a real number r, multiply it by 2, and then round down, you get either twice the rounded-down value of r or one more than that. The theorem floor_double, proved in the framework's machine-checked library of formal theorems, states this exactly: for every real r and every natural number n, the inequality 2·⌊r·2^n⌋ ≤ ⌊r·2^(n+1)⌋ ≤ 2·⌊r·2^n⌋ + 1 holds.

The statement matters because it is not a definition or a modeling choice: it is a derived fact about the floor function itself. The proof in the library is short and relies only on the standard arithmetic properties of the floor function. The theorem is tagged THEOREM, meaning it is proved in the Lean kernel with no framework-specific axioms, only the three standard axioms of the ambient type theory. The declaration sits inside a larger construction, the DeltaReal protocol, which represents real numbers not as infinite decimals but as nested rational intervals that shrink at a controlled rate. That protocol is the framework's way of building real arithmetic from discrete rational data, and floor_double is one of the inequalities that keeps the construction coherent when values are scaled by powers of two.

What floor_double does not claim is just as important. It does not say that the floor function is continuous, differentiable, or in any way smooth; it only bounds the jump that doubling can cause. It does not establish that the DeltaReal protocol itself is a complete model of the real numbers; that is a separate matter handled by other theorems in the same file, such as the surjectivity of the value map. And it says nothing about the physical or recognition-theoretic meaning of the protocol. The theorem is a piece of pure mathematics, a small gear in a larger machine, and its reach is exactly the inequality it states.

The practical consequence is that when the framework scales a real-valued quantity by a power of two, the rounding error at each step is controlled: the floor of the doubled value can never fall more than one below twice the floor of the original. That bound is what lets the protocol's nested intervals stay nested when arithmetic operations are applied. Without it, the whole construction of real arithmetic from rational approximations would have a gap. With it, the machine-checked proof of the protocol's correctness has one less thing to worry about.

THEOREM floor_double · IndisputableMonolith/Foundation/PrimitiveRecognitionCalculus/DeltaReal.lean
/-- The doubling bound on dyadic floors: `⌊r·2ⁿ⁺¹⌋ ∈ {2⌊r·2ⁿ⌋, 2⌊r·2ⁿ⌋+1}`.
This is exactly why the dyadic intervals are nested. -/
theorem floor_double (r : ℝ) (n : ℕ) :
    2 * ⌊r * 2 ^ n⌋ ≤ ⌊r * 2 ^ (n + 1)⌋ ∧ ⌊r * 2 ^ (n + 1)⌋ ≤ 2 * ⌊r * 2 ^ n⌋ + 1 := by
  have hk : (⌊r * 2 ^ n⌋ : ℝ) ≤ r * 2 ^ n := Int.floor_le _
  have hk1 : r * 2 ^ n < (⌊r * 2 ^ n⌋ : ℝ) + 1 := Int.lt_floor_add_one _
  have hpow : r * 2 ^ (n + 1) = (r * 2 ^ n) * 2 := by rw [pow_succ]; ring
  constructor
  · apply Int.le_floor.mpr
    push_cast
    rw [hpow]; nlinarith [hk]
  · have hlt : ⌊r * 2 ^ (n + 1)⌋ < 2 * ⌊r * 2 ^ n⌋ + 2 := by
      apply Int.floor_lt.mpr
      push_cast
      rw [hpow]; nlinarith [hk1]
    omega

What this page does not claim

The floor function is not continuous or differentiable; only the doubling bound is proved. The DeltaReal protocol is not shown to be a complete model of the real numbers by this theorem alone. The theorem carries no recognition-theoretic or physical interpretation by itself.

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/DeltaReal.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