AFTD Auto-Formalizing Theoretical Domains

prioritized_borel_encoding_trace_length

theoremverified

An encoded state history has one fixed-length block per original edge.

Statement

theorem prioritized_borel_encoding_trace_length {Q : Type} [Fintype Q] (v : List Bool) (h : Fin (v.length + 1) → Q) : (enc1385Trace v h).length = v.length * (Fintype.card Q + 1)
Source
Phase-state encoding for arXiv:2611.10136, Conjecture 19.
Verified
17 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 3
  • enc1385TraceEncode a visible node and its state history as successive blocks, each containing the visible direction followed by the one-hot code of…
  • prioritized_borel_encoding_state_code_lengthThe one-hot code of a state has length equal to the number of states.
  • enc1385GameGiven a finite-state three-priority tree game, construct a phase-state game that encodes each original direction followed by a one-hot…

The proof, explained

By definition, the encoded trace is formed by flattening a list of `v.length` blocks, where each block consists of a bit from `v` followed by the encoded state of the corresponding step. The length of the flattened list is the sum of the lengths of these individual blocks. Because each state encoding has length `|Q|`, each block has length `|Q| + 1`, and summing this constant over all `|v|` steps gives `|v| * (|Q| + 1)`.

  1. The length of the trace equals the sum over `i : Fin v.length` of the lengths of the blocks `v[i] :: enc1385StateCode (h i.succ)`.

    Unfolding the definition of `enc1385Trace`, the trace is the concatenation (`flatten`) of a list of blocks constructed from an index function on `Fin v.length`. The length of a flattened list is the sum of the lengths of its sublists (`List.length_flatten`). Applying the length function to each element of the generated list distributes the function over the index mapping (`List.map_ofFn`), and the sum of the resulting list becomes a finite sum over `Fin v.length` (`List.sum_ofFn`).

    lines 2–3

    uses List.length_flatten, List.map_ofFn, List.sum_ofFn

      dsimp [enc1385Trace]
      rw [List.length_flatten, List.map_ofFn, List.sum_ofFn]
  2. The sum evaluates to `v.length * (Fintype.card Q + 1)`. automation

    Each block consists of one bit prepended to the encoded state `h i.succ`. Since each encoded state has length `Fintype.card Q` by `prioritized_borel_encoding_state_code_length`, each block has constant length `Fintype.card Q + 1`. Summing this constant over all `v.length` elements of `Fin v.length` yields `v.length * (Fintype.card Q + 1)`.

    line 4

    uses prioritized_borel_encoding_state_code_length

      simp [prioritized_borel_encoding_state_code_length]
List.length_flatten
The length of a flattened list of lists is the sum of the lengths of its sublists.
List.map_ofFn
Mapping a function `g` over a list generated from a function `f` on `Fin n` produces the list generated from `g ∘ f`.
List.sum_ofFn
The sum of the elements in a list generated from a function `f` on `Fin n` equals the sum `∑ i, f i` over all `i : Fin n`.
prioritized_borel_encoding_state_code_length
The encoded state code of any state `q : Q` has length equal to the cardinality of `Q`.

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 prioritized_borel_encoding_trace_length {Q : Type} [Fintype Q] (v : List Bool) (h : Fin (v.length + 1) → Q) : (enc1385Trace v h).length = v.length * (Fintype.card Q + 1) := by  dsimp [enc1385Trace]  rw [List.length_flatten, List.map_ofFn, List.sum_ofFn]  simp [prioritized_borel_encoding_state_code_length]
See it in the graphDiscuss this resultChallenge it