AFTD Auto-Formalizing Theoretical Domains

prioritized_borel_encoding_real_prefix_has_next

theoremverified

A proper prefix of the code of a legal edge always admits a real next encoding move at the matching source position.

Statement

theorem prioritized_borel_encoding_real_prefix_has_next {Q : Type} [Fintype Q] (G : PrioritizedBorelGame Q 3) (s : Enc1385State Q) (e : TreeGameEdge Q 3) (he : e ∈ G.edges) (hv : e.source_node = s.origNode) (hq : e.source_state = s.origState) (hp : s.pending <+: enc1385Block e) (hlt : s.pending.length < Fintype.card Q + 1) : ∃ bit prio, enc1385Real G s bit prio
Source
Phase-state encoding for arXiv:2611.10136, Conjecture 19.
Verified
17 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 4
  • enc1385GameGiven a finite-state three-priority tree game, construct a phase-state game that encodes each original direction followed by a one-hot…
  • prioritized_borel_encoding_state_code_lengthThe one-hot code of a state has length equal to the number of states.
  • TreeGameEdgeA structure TreeGameEdge (Q : Type*) (k : ℕ) representing an edge in a binary tree game arena with state space Q and k priorities, with…
  • PrioritizedBorelGameA structure PrioritizedBorelGame (Q : Type*) (k : ℕ) representing a prioritized Borel game with state space Q and k priorities, with…
Used by 3

The proof, explained

The theorem shows that whenever the pending sequence of bits at a state is a proper prefix of the block encoding a legal edge e, a valid next real encoding move exists. Because the pending list length is strictly less than the full block length |Q| + 1, the suffix completing the block cannot be empty and begins with some bit. Appending this bit yields a longer prefix of the block, and setting the priority to e.prio upon completing the block and 0 otherwise satisfies the real encoding relation.

  1. The encoding block of edge e has total length |Q| + 1.

    By definition of enc1385Block and enc1385StateCode, an edge block consists of a 1-bit direction followed by a |Q|-bit encoding of the target state, yielding a list of length |Q| + 1.

    lines 2–4

      classical
      have hb : (enc1385Block e).length = Fintype.card Q + 1 := by
        simp [enc1385Block, enc1385StateCode]
  2. The pending list s.pending decomposes as a prefix with a non-empty suffix tail to reach enc1385Block e.

    Because s.pending is a prefix of enc1385Block e, there exists a suffix list tail such that s.pending ++ tail = enc1385Block e (by List.prefix_iff_exists_append_eq.mp). If tail were empty, then s.pending would equal enc1385Block e by List.append_nil, meaning s.pending has length |Q| + 1. But this contradicts the hypothesis hlt that the length of s.pending is strictly less than |Q| + 1. Linear arithmetic (omega) closes this impossible branch.

    lines 5–10

    uses List.prefix_iff_exists_append_eq.mp, List.append_nil

      obtain ⟨tail, ht⟩ := List.prefix_iff_exists_append_eq.mp hp
      cases tail with
      | nil =>
        simp only [List.append_nil] at ht
        rw [← ht] at hb
        omega
  3. The suffix tail decomposes into a leading bit and a remainder, and extending s.pending by this bit remains a prefix of enc1385Block e.

    Since tail is non-empty, it can be written as bit :: rest. Associativity of concatenation (List.append_assoc) shows that (s.pending ++ [bit]) ++ rest = s.pending ++ (bit :: rest) = enc1385Block e. By List.prefix_iff_exists_append_eq.mpr, this suffix rest witnesses that s.pending ++ [bit] is a prefix of enc1385Block e.

    lines 11–15

    uses List.prefix_iff_exists_append_eq.mpr, List.append_assoc

      | cons bit rest =>
        have hnext : s.pending ++ [bit] <+: enc1385Block e := by
          apply List.prefix_iff_exists_append_eq.mpr
          refine ⟨rest, ?_⟩
          simpa [List.append_assoc] using ht
  4. The chosen bit and corresponding priority witness enc1385Real G s bit prio.

    We set priority p to be e.prio if the new pending list s.pending ++ [bit] has reached full block length |Q| + 1, and 0 otherwise. Edge e satisfies all conditions of enc1385Real: it belongs to G.edges, matches the source node and source state of s, extends the pending prefix, and its priority matches the definition of p by construction.

    lines 16–19

        let p : Fin 3 := if (s.pending ++ [bit]).length = Fintype.card Q + 1 then e.prio else 0
        refine ⟨bit, p, e, he, hv, hq, hnext, ?_⟩
        dsimp [p]
        split <;> rfl
List.prefix_iff_exists_append_eq.mp
If a list is a prefix of another, there exists a suffix which appended to the former produces the latter.
List.append_nil
Appending the empty list to any list leaves it unchanged: as ++ [] = as.
List.prefix_iff_exists_append_eq.mpr
If appending some suffix list produces a target list, then the first list is a prefix of the target list.
List.append_assoc
List concatenation is associative: as ++ bs ++ cs = as ++ (bs ++ cs).

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_real_prefix_has_next {Q : Type} [Fintype Q] (G : PrioritizedBorelGame Q 3) (s : Enc1385State Q) (e : TreeGameEdge Q 3) (he : e ∈ G.edges) (hv : e.source_node = s.origNode) (hq : e.source_state = s.origState) (hp : s.pending <+: enc1385Block e) (hlt : s.pending.length < Fintype.card Q + 1) : ∃ bit prio, enc1385Real G s bit prio := by  classical  have hb : (enc1385Block e).length = Fintype.card Q + 1 := by    simp [enc1385Block, enc1385StateCode]  obtain ⟨tail, ht⟩ := List.prefix_iff_exists_append_eq.mp hp  cases tail with  | nil =>    simp only [List.append_nil] at ht    rw [← ht] at hb    omega  | cons bit rest =>    have hnext : s.pending ++ [bit] <+: enc1385Block e := by      apply List.prefix_iff_exists_append_eq.mpr      refine ⟨rest, ?_⟩      simpa [List.append_assoc] using ht    let p : Fin 3 := if (s.pending ++ [bit]).length = Fintype.card Q + 1 then e.prio else 0    refine ⟨bit, p, e, he, hv, hq, hnext, ?_⟩    dsimp [p]    split <;> rfl
See it in the graphDiscuss this resultChallenge it