AFTD Auto-Formalizing Theoretical Domains

prioritized_borel_bounded_history_trace_tracker

theoremverified

If at most d legal state histories reach each position, an index in Fin d recovers the accumulated encoded branch from the visible position and updates it after every legal original edge.

Statement

theorem prioritized_borel_bounded_history_trace_tracker {Q : Type} [Fintype Q]
    (G : PrioritizedBorelGame Q 3) (d : ℕ)
    (hb : ∀ v q, (op1385StateHistories G v q).ncard ≤ d) :
    ∃ (start : Fin d)
      (view : Fin d → List Bool → Q → Option (List Bool))
      (advance : Fin d → TreeGameEdge Q 3 → Fin d),
      view start [] G.init_state = some [] ∧
      ∀ i (e : TreeGameEdge Q 3) w, e ∈ G.edges →
        view i e.source_node e.source_state = some w →
        view (advance i e) (e.source_node ++ [e.dir]) e.target_state =
          some (w ++ enc1385Block e)
Source
arXiv:2611.10136, Conjecture 19 and Proposition 27. Block-encoding reduction for OP-1385.
Verified
28 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 8
  • prioritized_borel_bounded_state_history_indicesIf at most d state histories lead to each node and current state in a finite-state prioritized tree game, each such history can be…
  • prioritized_borel_state_history_extendAny legal state history to a node and state extends along a legal outgoing edge to a legal state history at the child and target state,…
  • prioritized_borel_encoding_trace_extendExtending a state history by an edge extends its encoded node by the edge's direction-and-target block.
  • enc1385TraceEncode a visible node and its state history as successive blocks, each containing the visible direction followed by the one-hot code of…
  • 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…
  • 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_reverse_state_histories_uniqueIf a tree-game edge is reverse-deterministic in the state at each fixed parent node and child direction, then at most one state history…
Used by 1

The proof, explained

The proof constructs an explicit tracker consisting of an initial index start, an observation map view, and an update map advance. Because at each game position at most d valid state histories can arrive, each history is injectively identified by an index in Fin d via a choice-based decoder. The initial index start encodes the unique length-1 history at the game's start, while view decodes an index into its full history to compute its trace. When a legal edge is traversed, advance extends the decoded history along the edge and returns the index of the extended history, which ensures by trace-extension lemmas that the updated view appends the corresponding edge block.

  1. For every tree node and state, the set of reaching state histories injectively embeds into Fin d.

    Under classical logic, let H v q be the subtype of state histories reaching state q at node v. Because hypothesis hb bounds the cardinality of each such set by d, lemma prioritized_borel_bounded_state_history_indices provides an injective index map idx v q from H v q into Fin d.

    lines 12–16

    uses prioritized_borel_bounded_state_history_indices

      classical
      let H (v : List Bool) (q : Q) := ↥(op1385StateHistories G v q)
      have hc := prioritized_borel_bounded_state_history_indices G d hb
      let idx (v : List Bool) (q : Q) : H v q → Fin d := (hc v q).choose
      have hi (v : List Bool) (q : Q) : Function.Injective (idx v q) := (hc v q).choose_spec
  2. There is a partial decoding function that inverts the history index.

    Define decode v q i to test whether an index i corresponds to some history; if so, it picks that history using choice, and otherwise returns none. For any history h, the condition holds trivially with witness h, so by dif_pos the decode function evaluates to that chosen witness. Because idx v q is injective, the chosen witness equals h, so congrArg establishes that decode v q (idx v q h) = some h (the local lemma inverse).

    lines 17–23

    uses dif_pos, congrArg

      let decode (v : List Bool) (q : Q) (i : Fin d) : Option (H v q) :=
        if h : ∃ t, idx v q t = i then some h.choose else none
      have inverse (v : List Bool) (q : Q) (h : H v q) :
          decode v q (idx v q h) = some h := by
        have hx : ∃ t, idx v q t = idx v q h := ⟨h,rfl⟩
        simp only [decode, dif_pos hx]
        exact congrArg some (hi v q hx.choose_spec)
  3. The game starts with a canonical initial state history at the empty node.

    Define root as the unique history of length 1 mapping the single index in Fin 1 to the initial state G.init_state. The edge transition conditions hold vacuously because there are no transitions, handled by Fin.elim0 on the empty domain of transition indices.

    line 24

    uses Fin.elim0

      let root : H [] G.init_state := ⟨fun _ => G.init_state, rfl, rfl, fun i => Fin.elim0 i⟩
  4. Histories extend along legal edges, and extending a history appends the edge's encoding block to its trace.

    Given an edge e in G.edges and a history t at the source node and state, prioritized_borel_state_history_extend extends t to a valid history extend e t he ending at the target state. Lemma prioritized_borel_encoding_trace_extend then proves that the trace of this extended history equals the trace of t concatenated with enc1385Block e (the local lemma extTrace), using the fact that the extension agrees with t on all prior prefixes and ends at e's target state.

    lines 25–33

    uses prioritized_borel_state_history_extend, prioritized_borel_encoding_trace_extend

      let extend (e : TreeGameEdge Q 3) (t : H e.source_node e.source_state) (he : e ∈ G.edges) :
          H (e.source_node ++ [e.dir]) e.target_state :=
        let hh := prioritized_borel_state_history_extend G e.source_node e.source_state t.val t.property e he rfl rfl
        ⟨hh.choose,hh.choose_spec.1⟩
      have extTrace (e : TreeGameEdge Q 3) (t : H e.source_node e.source_state) (he : e ∈ G.edges) :
          enc1385Trace _ (extend e t he).val = enc1385Trace _ t.val ++ enc1385Block e := by
        apply prioritized_borel_encoding_trace_extend
        · exact (prioritized_borel_state_history_extend G _ _ t.val t.property e he rfl rfl).choose_spec.2
        · exact (extend e t he).property.2.1
  5. The tracking system is defined via an initial index start, an observer view, and an update function advance.

    Set start to be the index of root. The observation map view i v q decodes index i at position (v, q) and, if successful, outputs its encoded trace enc1385Trace. The transition function advance i e checks whether e is in G.edges; if so, and if i decodes to a history t at e's source, it advances to the index of extend e t he, defaulting to start otherwise.

    lines 34–42

      let start := idx [] G.init_state root
      let view (i : Fin d) (v : List Bool) (q : Q) :=
        (decode v q i).map (fun h => enc1385Trace v h.val)
      let advance (i : Fin d) (e : TreeGameEdge Q 3) :=
        if he : e ∈ G.edges then
          match decode e.source_node e.source_state i with
          | some t => idx _ _ (extend e t he)
          | none => start
        else start
  6. The tracker starts in the required initial configuration with an empty trace view.

    Instantiate the existential quantifier with start, view, and advance. At the initial position ([], G.init_state), decoding start recovers root by the inverse property, and the trace of root on the empty node is the empty list [], simplifying view start [] G.init_state to some [].

    lines 43–44

      refine ⟨start,view,advance,?_,?_⟩
      · simp [view,start,inverse,enc1385Trace]
  7. Each legal game edge updates the tracked index so that the view appends the edge's encoded block.

    Let e be a legal edge and assume view i e.source_node e.source_state = some w. Case split on whether decode on index i returns none or some t. The none case is ruled out because view would evaluate to none, contradicting that it equals some w. In the some t case, the trace of t must be w, and advance i e produces the index of extend e t he. Evaluating view on this updated index decodes it back to extend e t he via the inverse property, whose trace is w ++ enc1385Block e by extTrace.

    lines 45–50

      · intro i e w he hw
        cases hd : decode e.source_node e.source_state i with
        | none => simp [view,hd] at hw
        | some t =>
          have htr : enc1385Trace e.source_node t.val = w := by simpa [view,hd] using hw
          simp [view,advance,he,hd,inverse,extTrace,htr]
prioritized_borel_bounded_state_history_indices
If the number of state histories reaching any node and state in a prioritized Borel game is bounded by d, there exists an injective encoding from these histories into Fin d.
dif_pos
A dependent if-then-else expression evaluates to its 'then' branch when the condition is shown to hold.
congrArg
If two arguments are equal, applying a function to them yields equal results: a₁ = a₂ implies f a₁ = f a₂.
Fin.elim0
The empty type Fin 0 has no elements, vacuously defining a value of any type from an element of Fin 0.
prioritized_borel_state_history_extend
A valid state history reaching the source node and state of a legal game edge can be extended along that edge to a valid state history ending at the edge's target state.
prioritized_borel_encoding_trace_extend
Extending a history along an edge appends that edge's encoded block to the history's encoded trace.

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_bounded_history_trace_tracker {Q : Type} [Fintype Q]    (G : PrioritizedBorelGame Q 3) (d : ℕ)    (hb : ∀ v q, (op1385StateHistories G v q).ncard ≤ d) :    ∃ (start : Fin d)      (view : Fin d → List Bool → Q → Option (List Bool))      (advance : Fin d → TreeGameEdge Q 3 → Fin d),      view start [] G.init_state = some [] ∧      ∀ i (e : TreeGameEdge Q 3) w, e ∈ G.edges →        view i e.source_node e.source_state = some w →        view (advance i e) (e.source_node ++ [e.dir]) e.target_state =          some (w ++ enc1385Block e) := by  classical  let H (v : List Bool) (q : Q) := ↥(op1385StateHistories G v q)  have hc := prioritized_borel_bounded_state_history_indices G d hb  let idx (v : List Bool) (q : Q) : H v q → Fin d := (hc v q).choose  have hi (v : List Bool) (q : Q) : Function.Injective (idx v q) := (hc v q).choose_spec  let decode (v : List Bool) (q : Q) (i : Fin d) : Option (H v q) :=    if h : ∃ t, idx v q t = i then some h.choose else none  have inverse (v : List Bool) (q : Q) (h : H v q) :      decode v q (idx v q h) = some h := by    have hx : ∃ t, idx v q t = idx v q h := ⟨h,rfl⟩    simp only [decode, dif_pos hx]    exact congrArg some (hi v q hx.choose_spec)  let root : H [] G.init_state := ⟨fun _ => G.init_state, rfl, rfl, fun i => Fin.elim0 i⟩  let extend (e : TreeGameEdge Q 3) (t : H e.source_node e.source_state) (he : e ∈ G.edges) :      H (e.source_node ++ [e.dir]) e.target_state :=    let hh := prioritized_borel_state_history_extend G e.source_node e.source_state t.val t.property e he rfl rfl    ⟨hh.choose,hh.choose_spec.1⟩  have extTrace (e : TreeGameEdge Q 3) (t : H e.source_node e.source_state) (he : e ∈ G.edges) :      enc1385Trace _ (extend e t he).val = enc1385Trace _ t.val ++ enc1385Block e := by    apply prioritized_borel_encoding_trace_extend    · exact (prioritized_borel_state_history_extend G _ _ t.val t.property e he rfl rfl).choose_spec.2    · exact (extend e t he).property.2.1  let start := idx [] G.init_state root  let view (i : Fin d) (v : List Bool) (q : Q) :=    (decode v q i).map (fun h => enc1385Trace v h.val)  let advance (i : Fin d) (e : TreeGameEdge Q 3) :=    if he : e ∈ G.edges then      match decode e.source_node e.source_state i with      | some t => idx _ _ (extend e t he)      | none => start    else start  refine ⟨start,view,advance,?_,?_⟩  · simp [view,start,inverse,enc1385Trace]  · intro i e w he hw    cases hd : decode e.source_node e.source_state i with    | none => simp [view,hd] at hw    | some t =>      have htr : enc1385Trace e.source_node t.val = w := by simpa [view,hd] using hw      simp [view,advance,he,hd,inverse,extTrace,htr]
See it in the graphDiscuss this resultChallenge it