AFTD Auto-Formalizing Theoretical Domains

prioritized_borel_encoding_actions_eq_block

theoremverified

A sequence of zero-priority actions followed by a final action with the original priority equals the encoded edge-action block when its bits form the edge's full code.

Statement

theorem prioritized_borel_encoding_actions_eq_block {Q : Type} [Fintype Q] (e : TreeGameEdge Q 3) (xs : List (Bool × Fin 3)) (bit : Bool) (hzero : ∀ a ∈ xs, a.2 = 0) (hbits : xs.map Prod.fst ++ [bit] = enc1385Block e) : xs ++ [(bit,e.prio)] = enc1385BlockMoves e
Source
Controlled block simulation 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…
  • enc1385BlockMovesThe phase-game actions for one original edge, with the original priority on the final bit and priority zero on preceding bits.
  • 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…
Used by 2

The proof, explained

The theorem proves that appending a final prioritized action (bit, e.prio) to a sequence of zero-priority actions xs produces the encoded edge moves enc1385BlockMoves e whenever the concatenated bits match the block code enc1385Block e. First, taking lengths in the bit-equality hypothesis shows that |xs| = |Q|. Next, list extensionality reduces the goal to pointwise equality: indices i < |xs| have priority 0 and matching bits, while the final index i = |xs| = |Q| carries the edge priority e.prio and the final bit. The main theorem then follows immediately from this lemma.

  1. The length of xs equals the cardinality of the state space Q.

    Taking the length of both sides of the hypothesis xs.map Prod.fst ++ [bit] = enc1385Block e gives |xs| + 1 = |enc1385Block e|. Expanding the definitions of enc1385Block and enc1385StateCode reveals that the block encoding has length |Q| + 1, so linear arithmetic concludes |xs| = |Q|.

    lines 6–10

    uses congrArg, List.length

      classical
      have hlen : xs.length = Fintype.card Q := by
        have h := congrArg List.length hbits
        simp [enc1385Block, enc1385StateCode] at h
        omega
  2. The action list xs ++ [(bit, e.prio)] and the block move list enc1385BlockMoves e have the same length, reducing equality of the two lists to equality at each index.

    By List.ext_getElem, it suffices to prove that both lists have identical length and identical elements at every index. The length equality simplifies to |xs| + 1 = |Q| + 1, which holds because |xs| = |Q|.

    lines 11–12

    uses List.ext_getElem

      apply List.ext_getElem
      · simp [enc1385BlockMoves, hlen]
  3. For every index i < |xs|, the i-th element of xs ++ [(bit, e.prio)] equals the i-th element of enc1385BlockMoves e.

    For i < |xs|, the LHS action is xs[i]. Its priority is 0 by the assumption hzero, matching the zero priority in enc1385BlockMoves e since i ≠ |Q|. Its bit component xs[i].1 matches the i-th bit of enc1385Block e by decomposing the appended list in the hypothesis hbits. Thus both coordinates agree by Prod.ext.

    lines 13–23

    uses List.getElem_mem, List.getD_append, List.getD_eq_getElem, List.getElem_append_left, Prod.ext, List.getD_eq_getElem?_getD

      · intro i hiL hiR
        by_cases hi : i < xs.length
        · have hz : xs[i].2 = 0 := hzero _ (List.getElem_mem hi)
          have hb : (enc1385Block e).getD i false = xs[i].1 := by
            rw [← hbits, List.getD_append _ _ _ _ (by simpa using hi)]
            simp [List.getD_eq_getElem, hi]
          have hne : i ≠ Fintype.card Q := by omega
          simp [enc1385BlockMoves, List.getElem_append_left hi, hne]
          apply Prod.ext
          · simpa only [List.getD_eq_getElem?_getD] using hb.symm
          · exact hz
  4. At the final index i = |xs|, the elements of both lists are equal.

    Since i < |xs| + 1 and i ≥ |xs|, we must have i = |xs| = |Q|. The element of the LHS at this index is the appended pair (bit, e.prio). For enc1385BlockMoves e, the priority at index |Q| is e.prio, and the bit is the |xs|-th element of enc1385Block e, which simplifies to bit by indexing into the singleton suffix of the append in hbits.

    lines 24–32

    uses List.length_append, List.length_singleton, List.getD_append_right, List.getD_eq_getElem?_getD

        · have hieq : i = xs.length := by
            simp only [List.length_append, List.length_singleton] at hiL
            omega
          subst i
          have hb : (enc1385Block e).getD xs.length false = bit := by
            rw [← hbits, List.getD_append_right _ _ _ _ (by simp)]
            simp
          simp [enc1385BlockMoves, hlen]
          simpa only [hlen, List.getD_eq_getElem?_getD] using hb.symm
  5. The main theorem prioritized_borel_encoding_actions_eq_block holds.

    The statement of prioritized_borel_encoding_actions_eq_block is identical to enc1385LocalActionsEqBlock, and is completed by directly applying that lemma to the assumed hypotheses.

    line 35

    uses enc1385LocalActionsEqBlock

      exact enc1385LocalActionsEqBlock e xs bit hzero hbits
congrArg
Applying a function to both sides of an equality preserves the equality.
List.length
The number of elements in a list.
List.ext_getElem
Two lists are equal if they have the same length and their elements agree at every index.
List.getElem_mem
An element accessed at a valid index in a list is a member of that list.
List.getD_append
Accessing an index within the length of the first list in an appended list yields the corresponding element of the first list.
List.getD_eq_getElem
Accessing a list with a default value at an index strictly less than its length returns the element at that index.
List.getElem_append_left
Indexing into the concatenation of two lists at an index strictly less than the length of the first list retrieves the corresponding element of the first list.
Prod.ext
Two ordered pairs are equal if their first components are equal and their second components are equal.
List.getD_eq_getElem?_getD
Accessing a list element with a default value equals looking up the optional element and defaulting if absent.
List.length_append
The length of the concatenation of two lists is the sum of their lengths.
List.length_singleton
A singleton list has length 1.
List.getD_append_right
Accessing an appended list at an index at least the length of the first list accesses the offset index in the second list.
enc1385LocalActionsEqBlock
A list of zero-priority actions followed by a final prioritized action equals the encoded edge move block if their concatenated bits match the edge's block encoding.

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

lemma enc1385LocalActionsEqBlock {Q : Type} [Fintype Q] (e : TreeGameEdge Q 3)    (xs : List (Bool × Fin 3)) (bit : Bool)    (hzero : ∀ a ∈ xs, a.2 = 0)    (hbits : xs.map Prod.fst ++ [bit] = enc1385Block e) :    xs ++ [(bit,e.prio)] = enc1385BlockMoves e := by  classical  have hlen : xs.length = Fintype.card Q := by    have h := congrArg List.length hbits    simp [enc1385Block, enc1385StateCode] at h    omega  apply List.ext_getElem  · simp [enc1385BlockMoves, hlen]  · intro i hiL hiR    by_cases hi : i < xs.length    · have hz : xs[i].2 = 0 := hzero _ (List.getElem_mem hi)      have hb : (enc1385Block e).getD i false = xs[i].1 := by        rw [← hbits, List.getD_append _ _ _ _ (by simpa using hi)]        simp [List.getD_eq_getElem, hi]      have hne : i ≠ Fintype.card Q := by omega      simp [enc1385BlockMoves, List.getElem_append_left hi, hne]      apply Prod.ext      · simpa only [List.getD_eq_getElem?_getD] using hb.symm      · exact hz    · have hieq : i = xs.length := by        simp only [List.length_append, List.length_singleton] at hiL        omega      subst i      have hb : (enc1385Block e).getD xs.length false = bit := by        rw [← hbits, List.getD_append_right _ _ _ _ (by simp)]        simp      simp [enc1385BlockMoves, hlen]      simpa only [hlen, List.getD_eq_getElem?_getD] using hb.symmtheorem prioritized_borel_encoding_actions_eq_block {Q : Type} [Fintype Q] (e : TreeGameEdge Q 3) (xs : List (Bool × Fin 3)) (bit : Bool) (hzero : ∀ a ∈ xs, a.2 = 0) (hbits : xs.map Prod.fst ++ [bit] = enc1385Block e) : xs ++ [(bit,e.prio)] = enc1385BlockMoves e := by  exact enc1385LocalActionsEqBlock e xs bit hzero hbits
See it in the graphDiscuss this resultChallenge it