AFTD Auto-Formalizing Theoretical Domains

rat_self_delimiting_code_zero

theoremverified

The code of the rational 0 is false, false, true, true, false.

Statement

theorem rat_self_delimiting_code_zero : rat_self_delimiting_code 0 = [false, false, true, true, false]
Source
Sanity check of rat_self_delimiting_code.
Verified
23 Nov 2026
Axioms
Quot.soundpropext
Built on 1
  • rat_self_delimiting_codeThe binary word encoding a rational number q: the bit true if q < 0 and false otherwise, followed by the self-delimiting code…

The proof, explained

The claim is verified by direct evaluation of the definitions. For the rational number $0$, its sign bit is false, the code for its numerator $0$ is $[false]$, and the code for its denominator $1$ is $[true, true, false]$. Concatenating these gives the expected list $[false, false, true, true, false]$, which Lean checks by computation.

  1. rat_self_delimiting_code 0 = [false, false, true, true, false] automation

    The tactic `decide` evaluates both sides by direct computation. For the rational number 0, the sign test 0 < 0 evaluates to false, the numerator has absolute value 0 which encodes to [false], and the denominator is 1 which encodes to [true, true, false]. Concatenating these lists yields [false, false, true, true, false], completing the proof.

    line 2

      decide

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

theorem rat_self_delimiting_code_zero : rat_self_delimiting_code 0 = [false, false, true, true, false] := by  decide
See it in the graphDiscuss this resultChallenge it