AFTD Auto-Formalizing Theoretical Domains

op75_block_encoding_template

theoremverified

The seven-layer block encoding is a fixed prefix, the positive coefficient encoding, a fixed middle, the negative coefficient encoding, and a fixed suffix.

Statement

theorem op75_block_encoding_template (a : ℕ) :
    (op75_compact_block a).flatMap (fun l => true :: relu_encode_hidden_layer3 l) =
      op75_block_template_prefix ++ relu_encode_rat (a : ℚ) ++ op75_block_template_middle ++
        relu_encode_rat (-(a : ℚ)) ++ op75_block_template_suffix
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 12
  • op75_compact_blockSeven width-three hidden layers for one nonnegative integer weight in the one-pass subset-sum construction.
  • relu_encode_hidden_layer3Encoding of a width-3 ReLU hidden layer as a Bool word: its 3 by 3 weight matrix row by row, then its bias vector.
  • relu_encode_vec3Encoding of a rational vector of length 3 as the concatenation of the encodings of its three entries.
  • 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…
  • op75_block_template_prefixA fixed Boolean word used as a fragment of the explicit network-encoding compiler.
  • op75_block_template_middleA fixed Boolean word used as a fragment of the explicit network-encoding compiler.
  • op75_block_template_suffixA fixed Boolean word used as a fragment of the explicit network-encoding compiler.
  • ReLUHiddenLayerA hidden layer of width k consists of a k-by-k rational weight matrix and a rational bias vector of length k.
  • LinearOrder.toTotalPreorderEvery LinearOrder is a TotalPreorder.
  • TotalPreorderA total preorder: a preorder where ≤ is total (complete). This is weaker than LinearOrder — it does NOT require antisymmetry or…

Lean source view module on GitHub

theorem op75_block_encoding_template (a : ℕ) :
    (op75_compact_block a).flatMap (fun l => true :: relu_encode_hidden_layer3 l) =
      op75_block_template_prefix ++ relu_encode_rat (a : ℚ) ++ op75_block_template_middle ++
        relu_encode_rat (-(a : ℚ)) ++ op75_block_template_suffix := by
  simp [op75_compact_block, op75_compact_layer, relu_encode_hidden_layer3, relu_encode_vec3,
    relu_encode_rat, relu_encode_int, relu_encode_nat, op75_block_template_prefix, op75_block_template_middle,
    op75_block_template_suffix, List.append_assoc] <;> norm_num <;>
    simp [not_lt_of_ge (show (0:ℚ) ≤ (a:ℚ) by positivity),
      not_lt_of_ge (show (0:ℤ) ≤ (a:ℤ) by positivity)]
See it in the graphDiscuss this resultChallenge it