AFTD Auto-Formalizing Theoretical Domains

op75_negative_rat_bit_encoding

theoremverified

The encoding of the negative of a nonnegative integer has sign bit set exactly when that integer is nonzero, followed by its canonical natural encoding and denominator-one encoding.

Statement

theorem op75_negative_rat_bit_encoding (a : ℕ) :
    relu_encode_rat (-(a : ℚ)) = decide (0 < a) :: relu_encode_nat a ++ relu_encode_nat 1
Source
OP-75: fixed binary output fragments for the subset-sum to width-three ReLU compiler.
Verified
15 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 3
  • relu_encode_ratEncoding of a rational in lowest terms as a Bool word: its numerator and denominator in binary.
  • relu_encode_intEncoding of an integer as a Bool word: a sign bit followed by the binary encoding of its absolute value.
  • relu_encode_natBinary encoding of a natural number as a self-delimiting Bool word: each base-2 digit, least significant first, is preceded by a true…

Lean source view module on GitHub

theorem op75_negative_rat_bit_encoding (a : ℕ) :
    relu_encode_rat (-(a : ℚ)) = decide (0 < a) :: relu_encode_nat a ++ relu_encode_nat 1 := by
  simp [relu_encode_rat, relu_encode_int]
See it in the graphDiscuss this resultChallenge it