AFTD Auto-Formalizing Theoretical Domains

prioritized_borel_no_double_cycle_segments

theoremverified

If a finite state-transition graph admits at most one closed state walk for each start and public word, segments that stay inside a strongly connected component have uniquely determined encoded traces given their endpoints.

Statement

theorem prioritized_borel_no_double_cycle_segments {Q : Type} [Fintype Q] (G : PrioritizedBorelGame Q 3)
    (T : Q → Bool → Q → Prop) (hT : ∀ e ∈ G.edges, T e.source_state e.dir e.target_state)
    (hcycle : ∀ q xs ys, Op1385StateWalk T q xs q → Op1385StateWalk T q ys q →
      xs.map Prod.fst = ys.map Prod.fst → xs = ys) :
    let cut := fun (e : TreeGameEdge Q 3) => ¬∃ xs, Op1385StateWalk T e.target_state xs e.source_state
    ∀ u p v q a b, Op1385SegmentTrace G cut u p v q a →
      Op1385SegmentTrace G cut u p v q b → a = b
Source
State projections for arXiv:2611.10136, Conjecture 19. The equal-word double-cycle obstruction is the EDA condition in General Algorithms for Testing the Ambiguity of Finite Automata, https://cs.nyu.edu/~mohri/pub/amb.pdf.
Verified
28 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 5
  • Op1385StateWalkA walk of a fixed binary-labeled state graph records its sequence of public directions and successor states.
  • Op1385SegmentTraceEncoded public bits of a finite original segment starting at a specified position and traversing only legal, unmarked edges.
  • enc1385GameGiven a finite-state three-priority tree game, construct a phase-state game that encodes each original direction followed by a one-hot…
  • 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 2

The proof, explained

We first establish that state walks can be concatenated (op1385_walk_append). To prove that any two segment traces within the same strongly connected component between identical endpoints have identical encoded bit traces, we use an extraction lemma showing that an uncut trace corresponds to a state walk and a return walk preserving node sequence and trace encoding. Appending the return walk to each of two such traces yields two closed walks with the same public word. By the no-double-cycle hypothesis, these closed walks coincide, implying the original state walks and their encoded traces are equal.

  1. Lemma op1385_walk_append: Concatenating two valid state walks yields a valid state walk.

    We prove by induction on the second walk hy that if xs is a state walk from p to q and ys is a state walk from q to r, then xs ++ ys is a valid state walk from p to r. In the base case (ys = []), the concatenation simplifies to xs, which is valid by hx. In the inductive step, appending an edge step (b, r) relies on list concatenation associativity (List.append_assoc) to extend the induction hypothesis.

    lines 6–8

    uses List.append_assoc

      induction hy with
      | root => simpa using hx
      | step _ b r he ih => simpa only [List.append_assoc] using ih.step b r he
  2. Define the cut predicate for edges leaving a strongly connected component, and define the bit encoding for transition steps.

    An edge e is defined to be cut if there is no state walk in T from its target state back to its source state, so uncut edges remain within the same strongly connected component. The helper bits encodes each transition step (b, q) as the direction bit b followed by the binary code for state q.

    lines 17–18

      let cut (e : TreeGameEdge Q 3) := ¬∃ xs, Op1385StateWalk T e.target_state xs e.source_state
      let bits (a : Bool × Q) := a.1 :: enc1385StateCode a.2
  3. Formulate the extraction lemma and prove the base case for the root trace.

    We state the auxiliary lemma extract: any segment trace from (u, p) to (v, q) with encoded trace w corresponds to a state walk xs from p to q and a return walk z from q to p, satisfying v = u ++ map(xs) and w = flatMap(xs, bits). We proceed by induction on the segment trace hh. In the base case (root), the empty walk xs = [] and empty return walk z = [] trivially satisfy all properties.

    lines 19–23

      have extract {u p v q w} (hh : Op1385SegmentTrace G cut u p v q w) :
          ∃ xs, Op1385StateWalk T p xs q ∧ (∃ z, Op1385StateWalk T q z p) ∧
            v = u ++ xs.map Prod.fst ∧ w = xs.flatMap bits := by
        induction hh with
        | root => exact ⟨[],.root,⟨[],.root⟩,by simp,rfl⟩
  4. Prove the inductive step of the extraction lemma when extending by an uncut edge.

    In the step case, an uncut edge e is appended to an existing trace. By the induction hypothesis, there is a walk xs from p to e.source_state and a return walk z to p. Since e is uncut, double negation elimination (Classical.not_not.mp) provides a return walk t from e.target_state to e.source_state. Appending e extends xs to a valid walk to e.target_state, while concatenating t and z via op1385_walk_append gives a return walk from e.target_state back to p. List append associativity (List.append_assoc) and unfolding enc1385Block confirm that the node word and trace encoding update correctly.

    lines 24–29

    uses Classical.not_not.mp, op1385_walk_append, List.append_assoc, enc1385Block

        | step e _ he hc ih =>
          obtain ⟨xs,hxs,⟨z,hz⟩,hv,hw⟩ := ih
          have hback : ∃ t, Op1385StateWalk T e.target_state t e.source_state := Classical.not_not.mp hc
          obtain ⟨t,ht⟩ := hback
          exact ⟨xs ++ [(e.dir,e.target_state)],hxs.step _ _ (hT e he),⟨_,op1385_walk_append ht hz⟩,
            by simp [hv,List.append_assoc],by simp [hw,bits,enc1385Block]⟩
  5. Introduce the two segment traces sharing the same start and end endpoints.

    We simplify the goal and introduce the starting endpoint (u, p), destination endpoint (v, q), and the two segment traces ha and hb with trace encodings a and b.

    lines 30–31

      dsimp only
      intro u p v q a b ha hb
  6. Extract the underlying state walks and return walk from both segment traces.

    Applying the extraction lemma to ha yields a state walk x from p to q, a return walk z from q to p, with v = u ++ map(x) and a = flatMap(x, bits). Applying it to hb yields a state walk y from p to q with v = u ++ map(y) and b = flatMap(y, bits).

    lines 32–33

      obtain ⟨x,hx,⟨z,hz⟩,hv,hw⟩ := extract ha
      obtain ⟨y,hy,_,hv',hw'⟩ := extract hb
  7. The closed walks x ++ z and y ++ z from p to p are identical.

    From u ++ map(x) = v = u ++ map(y), left cancellation of u (List.append_cancel_left) gives map(x) = map(y). Concatenating the return walk z to each produces two closed walks x ++ z and y ++ z starting and ending at p with identical public direction words (op1385_walk_append). By the no-double-cycle hypothesis (hcycle), these two closed walks must be identical: x ++ z = y ++ z.

    lines 34–35

    uses List.append_cancel_left, op1385_walk_append

      have hword := List.append_cancel_left (hv.symm.trans hv')
      have heq := hcycle p (x ++ z) (y ++ z) (op1385_walk_append hx hz) (op1385_walk_append hy hz) (by simp [hword])
  8. The encoded traces a and b are equal.

    Cancelling the common return walk z on the right from x ++ z = y ++ z (List.append_cancel_right) implies x = y. Applying the trace mapping List.flatMap bits to both sides via congrArg and connecting with the equalities for a and b proves a = b.

    line 36

    uses List.append_cancel_right, congrArg, List.flatMap

      exact hw.trans ((congrArg (List.flatMap bits) (List.append_cancel_right heq)).trans hw'.symm)
Classical.not_not.mp
Double negation elimination: if ¬¬P holds, then P holds.
List.append_assoc
List concatenation is associative: (as ++ bs) ++ cs = as ++ (bs ++ cs).
List.append_cancel_left
Left cancellation for list concatenation: if as ++ bs = as ++ cs, then bs = cs.
List.append_cancel_right
Right cancellation for list concatenation: if as ++ bs = cs ++ bs, then as = cs.
List.flatMap
Maps a function returning lists over each element of a list and concatenates the resulting lists.
congrArg
Function application preserves equality: if a₁ = a₂, then f(a₁) = f(a₂).
enc1385Block
The encoded bit block of an edge consists of its direction bit followed by the encoded state code of its target state.
op1385_walk_append
Concatenating two valid state walks, where the target state of the first is the source state of the second, yields a valid state walk.

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

set_option maxHeartbeats 900000theorem op1385_walk_append {Q : Type} {T : Q → Bool → Q → Prop} {p q r : Q}    {xs ys : List (Bool × Q)} (hx : Op1385StateWalk T p xs q) (hy : Op1385StateWalk T q ys r) :    Op1385StateWalk T p (xs ++ ys) r := by  induction hy with  | root => simpa using hx  | step _ b r he ih => simpa only [List.append_assoc] using ih.step b r hetheorem prioritized_borel_no_double_cycle_segments {Q : Type} [Fintype Q] (G : PrioritizedBorelGame Q 3)    (T : Q → Bool → Q → Prop) (hT : ∀ e ∈ G.edges, T e.source_state e.dir e.target_state)    (hcycle : ∀ q xs ys, Op1385StateWalk T q xs q → Op1385StateWalk T q ys q →      xs.map Prod.fst = ys.map Prod.fst → xs = ys) :    let cut := fun (e : TreeGameEdge Q 3) => ¬∃ xs, Op1385StateWalk T e.target_state xs e.source_state    ∀ u p v q a b, Op1385SegmentTrace G cut u p v q a →      Op1385SegmentTrace G cut u p v q b → a = b := by  let cut (e : TreeGameEdge Q 3) := ¬∃ xs, Op1385StateWalk T e.target_state xs e.source_state  let bits (a : Bool × Q) := a.1 :: enc1385StateCode a.2  have extract {u p v q w} (hh : Op1385SegmentTrace G cut u p v q w) :      ∃ xs, Op1385StateWalk T p xs q ∧ (∃ z, Op1385StateWalk T q z p) ∧        v = u ++ xs.map Prod.fst ∧ w = xs.flatMap bits := by    induction hh with    | root => exact ⟨[],.root,⟨[],.root⟩,by simp,rfl⟩    | step e _ he hc ih =>      obtain ⟨xs,hxs,⟨z,hz⟩,hv,hw⟩ := ih      have hback : ∃ t, Op1385StateWalk T e.target_state t e.source_state := Classical.not_not.mp hc      obtain ⟨t,ht⟩ := hback      exact ⟨xs ++ [(e.dir,e.target_state)],hxs.step _ _ (hT e he),⟨_,op1385_walk_append ht hz⟩,        by simp [hv,List.append_assoc],by simp [hw,bits,enc1385Block]⟩  dsimp only  intro u p v q a b ha hb  obtain ⟨x,hx,⟨z,hz⟩,hv,hw⟩ := extract ha  obtain ⟨y,hy,_,hv',hw'⟩ := extract hb  have hword := List.append_cancel_left (hv.symm.trans hv')  have heq := hcycle p (x ++ z) (y ++ z) (op1385_walk_append hx hz) (op1385_walk_append hy hz) (by simp [hword])  exact hw.trans ((congrArg (List.flatMap bits) (List.append_cancel_right heq)).trans hw'.symm)
See it in the graphDiscuss this resultChallenge it