relu_network3_encode
def
Encoding of a width-3 ReLU network as a Bool word, of length linear in the total bit length of its rational entries: input weights, input biases, the hidden layers each preceded by true and the list closed by false, output weights, output bias.
Statement
def relu_network3_encode (net : ReLUNetwork 3) : List Bool- Source
- Helper encoding serving OP-75 (arXiv:2610.06092, Remark 5.15). Section 2.1 of the paper writes rational entries as pairs of integers in binary; the bit-level layout is a choice made here.
- Verified
- 09 Nov 2026
- Axioms
- none listed
- Built on 5
- 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_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.
- ReLUNetworkA feedforward ReLU neural network from the real line to the real line with hidden layers of width k, specified by rational affine input…
- ReLUHiddenLayerA hidden layer of width k consists of a k-by-k rational weight matrix and a rational bias vector of length k.
- Used by 8
- op75_invalid_input_fallback_nonmemberThe encoding of the empty-weight target-one network is a no-instance of the width-three unit-interval zero language.
- relu_width3_unit_interval_zero_languageThe verification language at width 3 on the unit interval, for the fixed encoding relu_network3_encode: the set of Bool words w such that…
- op75_subset_compiler_correct_reductionA total polynomial-time Boolean compiler with the specified canonical output and a no-instance output on malformed words gives the desired…
- op75_subset_compiler_functionCompile a canonical subset-sum input to the explicit width-three network encoding; map malformed input to the fixed no-instance.
- op75_subset_compiler_semanticsAny total binary function that maps canonical subset-sum instances to their specified networks and maps malformed inputs outside the zero…
- op75_subset_compiler_function_correctThe explicit total compiler preserves language membership.
- relu_network3_encode_injectiveSanity check of the encoding: distinct width-3 ReLU networks have distinct Bool encodings.
- relu_width3_language_mem_iffSanity check of the language: the encoding of a width-3 ReLU network lies in the verification language exactly when the network has a zero…
Lean source view module on GitHub
def relu_network3_encode (net : ReLUNetwork 3) : List Bool := relu_encode_vec3 net.in_weight ++ relu_encode_vec3 net.in_bias ++ (net.layers.flatMap (fun l => true :: relu_encode_hidden_layer3 l) ++ [false]) ++ relu_encode_vec3 net.out_weight ++ relu_encode_rat net.out_bias