AFTD Auto-Formalizing Theoretical Domains

prioritized_borel_encoding_controlled_block

theoremverified

At a position controlled by a player, following that player’s strategy in the phase game for a complete block agrees with replaying the encoded block of some legal original edge from that position, including the resulting phase-game memory and position.

Statement

theorem prioritized_borel_encoding_controlled_block {Q M : Type} [Fintype Q]
    (G : PrioritizedBorelGame Q 3) (pl : BorelGamePlayer)
    (σ : FiniteMemoryStrategy (enc1385Game G) pl M)
    (m : M) (node v : List Bool) (q : Q) (hown : G.owner (v,q) = pl) :
    ∃ e ∈ G.edges, e.source_node = v ∧ e.source_state = q ∧
      enc1385Follow G pl σ m node ⟨v,q,[]⟩ (Fintype.card Q + 1) =
        enc1385Replay G pl σ m node ⟨v,q,[]⟩ e
Source
Block replay for arXiv:2611.10136, Conjecture 19.
Verified
17 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 14
  • enc1385GameGiven a finite-state three-priority tree game, construct a phase-state game that encodes each original direction followed by a one-hot…
  • enc1385ReplayReplay the bit-and-priority block of an original edge from a phase-game node, state, and strategy memory, returning the resulting memory,…
  • enc1385FollowStarting with a phase-game memory and position, follow a fixed strategy for a specified number of phase steps, returning the resulting…
  • FiniteMemoryStrategyA structure FiniteMemoryStrategy {Q : Type*} {k : ℕ} (G : PrioritizedBorelGame Q k) (pl : BorelGamePlayer) (M : Type*) representing a…
  • enc1385FollowActionsThe sequence of public bits and priorities selected by a phase-game strategy in its first n steps from a specified memory and position.
  • prioritized_borel_encoding_follow_finalAt a controlled original position, after the proper-prefix phase steps, the strategy’s final phase choice completes the code of some legal…
  • prioritized_borel_encoding_follow_proper_actionsDuring the proper-prefix steps of a controlled block, the recorded action directions equal the current pending bits and every recorded…
  • prioritized_borel_encoding_actions_eq_blockA sequence of zero-priority actions followed by a final action with the original priority equals the encoded edge-action block when its…
  • prioritized_borel_encoding_controlled_choices_legalAt a controlled original position, every strategy choice within one encoded block is a legal phase-game edge from the selected phase-game…
  • prioritized_borel_follow_actions_replayIf each of the first n selected phase-game moves is legal at its selected position, replaying their direction and priority actions…
  • BorelGamePlayerThe two players in a prioritized Borel game, Eve and Adam.
  • PrioritizedBorelGameA structure PrioritizedBorelGame (Q : Type*) (k : ℕ) representing a prioritized Borel game with state space Q and k priorities, with…
  • TreeGameEdgeA structure TreeGameEdge (Q : Type*) (k : ℕ) representing an edge in a binary tree game arena with state space Q and k priorities, with…
  • enc1385BlockMovesThe phase-game actions for one original edge, with the original priority on the final bit and priority zero on preceding bits.
Used by 1

The proof, explained

To show that executing a complete block of |Q| + 1 steps from a player-controlled position simulates traversing an original edge e, the proof shows that the sequence of actions chosen by the strategy coincides with the canonical block moves of e. By structural lemmas on the encoding, the first |Q| steps make pure priority-0 moves accumulating bits into the pending buffer, while the (|Q| + 1)-th move supplies the final bit and priority of an original edge e. Because every choice made along the way is legal in the encoded game, following the strategy matches replaying its action sequence, which by definition equals replaying the encoded block of e.

  1. Let st be the state after |Q| steps and a the strategy's next choice; then hypothesis hfinal yields an original edge e from (v, q) whose encoded block extends the accumulated bits by a.dir with priority matching a.prio.

    Working classically, we introduce the state st after |Q| steps and the strategy's next chosen edge a. Deconstructing hypothesis hfinal yields a bit string bits of length |Q|, an original edge e ∈ G.edges from node v and state q, and guarantees that the node at step |Q| is node ++ bits, the pending state is bits, the concatenation bits ++ [a.dir] equals enc1385Block e, and a.prio = e.prio. We also define xs to be the list of actions taken over the first |Q| steps.

    lines 22–26

      classical
      let st := enc1385Follow G pl σ m node ⟨v,q,[]⟩ (Fintype.card Q)
      let a := σ.choice st.1 st.2.1 st.2.2
      obtain ⟨bits, hlen, hnode, hstate, e, he, hv, hq, hcode, hprio⟩ := hfinal
      let xs := enc1385FollowActions G pl σ m node ⟨v,q,[]⟩ (Fintype.card Q)
  2. The direction bits of the first |Q| actions taken by the strategy equal bits.

    By hypothesis hproper.1, mapping Prod.fst over xs yields the pending buffer of the phase-game state at step |Q|. Rewriting with the fact from hstate that this pending buffer is bits gives xs.map Prod.fst = bits.

    lines 27–31

      have hbits : xs.map Prod.fst = bits := by
        have h := hproper.1
        change xs.map Prod.fst = st.2.2.pending at h
        rw [hstate] at h
        exact h
  3. The sequence of actions taken over |Q| + 1 steps equals the complete block moves enc1385BlockMoves e.

    By definition, following for |Q| + 1 steps appends the action (a.dir, a.prio) to xs. Since a.prio = e.prio, this action is (a.dir, e.prio). Hypothesis hlist reconstructs the full block moves enc1385BlockMoves e provided that all actions in xs have priority 0 (given by hproper.2) and the direction bits followed by a.dir equal enc1385Block e (which holds because xs.map Prod.fst = bits and bits ++ [a.dir] = enc1385Block e).

    lines 32–39

      have hacts : enc1385FollowActions G pl σ m node ⟨v,q,[]⟩ (Fintype.card Q + 1) =
          enc1385BlockMoves e := by
        change xs ++ [(a.dir,a.prio)] = enc1385BlockMoves e
        rw [hprio]
        apply hlist e xs a.dir
        · exact hproper.2
        · rw [hbits]
          exact hcode
  4. Following the strategy for |Q| + 1 steps equals replaying the encoded block of e, completing the proof of enc1385Assemble.

    Hypothesis hreplay asserts that following the strategy for |Q| + 1 steps matches folding the replay step over the actions taken. Substituting the equality hacts turns this fold into enc1385Replay along e by definition. Taking the symmetric equality provides the required edge e with its source node, source state, and the equality with enc1385Replay.

    lines 40–44

      have hr := hreplay
      rw [hacts] at hr
      change enc1385Replay G pl σ m node ⟨v,q,[]⟩ e =
        enc1385Follow G pl σ m node ⟨v,q,[]⟩ (Fintype.card Q + 1) at hr
      exact ⟨e, he, hv, hq, hr.symm⟩
  5. At the controlled position (v, q), the hypotheses of enc1385Assemble are satisfied by the structural properties of the game encoding.

    Because player pl owns the position (v, q), we instantiate four properties: prioritized_borel_encoding_follow_final provides the edge e encoded by the final choice; prioritized_borel_encoding_follow_proper_actions (using reflexivity le_refl on |Q|) ensures that the first |Q| actions have priority 0 and match the pending state; prioritized_borel_encoding_controlled_choices_legal establishes that every choice made during the block is legal in the encoded game; and prioritized_borel_follow_actions_replay converts this legality into the equivalence between following the strategy and replaying the action list.

    lines 53–58

    uses prioritized_borel_encoding_follow_final, prioritized_borel_encoding_follow_proper_actions, le_refl, prioritized_borel_encoding_controlled_choices_legal, prioritized_borel_follow_actions_replay

      have hfinal := prioritized_borel_encoding_follow_final G pl σ m node v q hown
      have hproper := prioritized_borel_encoding_follow_proper_actions G pl σ m node v q hown
        (Fintype.card Q) (le_refl _)
      have hlegal := prioritized_borel_encoding_controlled_choices_legal G pl σ m node v q hown
      have hreplay := prioritized_borel_follow_actions_replay G pl σ m node ⟨v,q,[]⟩
        (Fintype.card Q + 1) hlegal
  6. Following the player's strategy for a full block of |Q| + 1 steps agrees with replaying the encoded block of a legal edge e from (v, q).

    We invoke enc1385Assemble with the hypotheses assembled in the previous step, supplying prioritized_borel_encoding_actions_eq_block as the list reconstruction lemma hlist. This yields a legal original edge e starting at (v, q) such that following the strategy for |Q| + 1 steps produces the same configuration as enc1385Replay of e.

    lines 59–60

    uses enc1385Assemble, prioritized_borel_encoding_actions_eq_block

      exact enc1385Assemble G pl σ m node v q hfinal hproper
        (fun e xs bit hzero hbits => prioritized_borel_encoding_actions_eq_block e xs bit hzero hbits) hreplay
enc1385Assemble
If the first |Q| actions of a strategy have priority 0 and match the prefix of an original edge e, the (|Q| + 1)-th action provides the final bit and priority of e, and replaying actions matches following the strategy, then following the strategy for |Q| + 1 steps equals replaying the block moves of e.
le_refl
The inequality relation ≤ on natural numbers is reflexive, so n ≤ n for every n.
prioritized_borel_encoding_follow_final
From any position (v, q) owned by player pl, following strategy σ for |Q| steps leaves a pending buffer of length |Q|, and the strategy's next choice completes the encoding of some legal original edge e starting at (v, q) with matching priority.
prioritized_borel_encoding_follow_proper_actions
During the first n ≤ |Q| steps from a controlled position, the direction bits of actions taken by the strategy match the pending buffer in the phase-game state, and every action carries priority 0.
prioritized_borel_encoding_controlled_choices_legal
Every choice made by the strategy during the |Q| + 1 steps of a block starting at a position owned by the player is a legal outgoing edge in the encoded game.
prioritized_borel_follow_actions_replay
When all choices made by a strategy up to step n are legal moves in the game, following the strategy for n steps produces the exact same state as folding the replay step across the list of actions taken.
prioritized_borel_encoding_actions_eq_block
If an action list xs has all priorities 0 and its direction bits followed by bit equal the block encoding of edge e, then appending (bit, e.prio) to xs gives the full sequence of block moves of e.

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 enc1385Assemble {Q M : Type} [Fintype Q] (G : PrioritizedBorelGame Q 3)    (pl : BorelGamePlayer) (σ : FiniteMemoryStrategy (enc1385Game G) pl M)    (m : M) (node v : List Bool) (q : Q)    (hfinal : let st := enc1385Follow G pl σ m node ⟨v,q,[]⟩ (Fintype.card Q)      let a := σ.choice st.1 st.2.1 st.2.2      ∃ bits : List Bool, bits.length = Fintype.card Q ∧        st.2.1 = node ++ bits ∧ st.2.2 = ⟨v,q,bits⟩ ∧        ∃ e ∈ G.edges, e.source_node = v ∧ e.source_state = q ∧          bits ++ [a.dir] = enc1385Block e ∧ a.prio = e.prio)    (hproper : (enc1385FollowActions G pl σ m node ⟨v,q,[]⟩ (Fintype.card Q)).map Prod.fst =        (enc1385Follow G pl σ m node ⟨v,q,[]⟩ (Fintype.card Q)).2.2.pending ∧      ∀ a ∈ enc1385FollowActions G pl σ m node ⟨v,q,[]⟩ (Fintype.card Q), a.2 = 0)    (hlist : ∀ (e : TreeGameEdge Q 3) (xs : List (Bool × Fin 3)) (bit : Bool),      (∀ a ∈ xs, a.2 = 0) → xs.map Prod.fst ++ [bit] = enc1385Block e →        xs ++ [(bit,e.prio)] = enc1385BlockMoves e)    (hreplay : (enc1385FollowActions G pl σ m node ⟨v,q,[]⟩ (Fintype.card Q + 1)).foldl      (enc1385ReplayStep G pl σ) (m,node,⟨v,q,[]⟩) =        enc1385Follow G pl σ m node ⟨v,q,[]⟩ (Fintype.card Q + 1)) :    ∃ e ∈ G.edges, e.source_node = v ∧ e.source_state = q ∧      enc1385Follow G pl σ m node ⟨v,q,[]⟩ (Fintype.card Q + 1) =        enc1385Replay G pl σ m node ⟨v,q,[]⟩ e := by  classical  let st := enc1385Follow G pl σ m node ⟨v,q,[]⟩ (Fintype.card Q)  let a := σ.choice st.1 st.2.1 st.2.2  obtain ⟨bits, hlen, hnode, hstate, e, he, hv, hq, hcode, hprio⟩ := hfinal  let xs := enc1385FollowActions G pl σ m node ⟨v,q,[]⟩ (Fintype.card Q)  have hbits : xs.map Prod.fst = bits := by    have h := hproper.1    change xs.map Prod.fst = st.2.2.pending at h    rw [hstate] at h    exact h  have hacts : enc1385FollowActions G pl σ m node ⟨v,q,[]⟩ (Fintype.card Q + 1) =      enc1385BlockMoves e := by    change xs ++ [(a.dir,a.prio)] = enc1385BlockMoves e    rw [hprio]    apply hlist e xs a.dir    · exact hproper.2    · rw [hbits]      exact hcode  have hr := hreplay  rw [hacts] at hr  change enc1385Replay G pl σ m node ⟨v,q,[]⟩ e =    enc1385Follow G pl σ m node ⟨v,q,[]⟩ (Fintype.card Q + 1) at hr  exact ⟨e, he, hv, hq, hr.symm⟩theorem prioritized_borel_encoding_controlled_block {Q M : Type} [Fintype Q]    (G : PrioritizedBorelGame Q 3) (pl : BorelGamePlayer)    (σ : FiniteMemoryStrategy (enc1385Game G) pl M)    (m : M) (node v : List Bool) (q : Q) (hown : G.owner (v,q) = pl) :    ∃ e ∈ G.edges, e.source_node = v ∧ e.source_state = q ∧      enc1385Follow G pl σ m node ⟨v,q,[]⟩ (Fintype.card Q + 1) =        enc1385Replay G pl σ m node ⟨v,q,[]⟩ e := by  have hfinal := prioritized_borel_encoding_follow_final G pl σ m node v q hown  have hproper := prioritized_borel_encoding_follow_proper_actions G pl σ m node v q hown    (Fintype.card Q) (le_refl _)  have hlegal := prioritized_borel_encoding_controlled_choices_legal G pl σ m node v q hown  have hreplay := prioritized_borel_follow_actions_replay G pl σ m node ⟨v,q,[]⟩    (Fintype.card Q + 1) hlegal  exact enc1385Assemble G pl σ m node v q hfinal hproper    (fun e xs bit hzero hbits => prioritized_borel_encoding_actions_eq_block e xs bit hzero hbits) hreplay
See it in the graphDiscuss this resultChallenge it