AFTD Auto-Formalizing Theoretical Domains

op1385SparseClockArena

def

The original game with a public exponential clock. Each block consists of forced zero-priority waiting moves followed by one original edge. The winning sets read only the branch directions on the original moves.

Statement

noncomputable def op1385SparseClockArena {Q : Type} (G : PrioritizedBorelGame Q 3) (B : ℕ) : PrioritizedBorelGame Q 3
Source
arXiv:2611.10136, Conjecture 19. Exponential public padding of three-priority Borel games in OP-1385, experiment 44462.
Verified
28 Nov 2026
Axioms
none listed
Built on 3
  • 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…
  • strictStrict preference derived from a weak preference relation.
Used by 7

Lean source view module on GitHub

set_option maxHeartbeats 600000

namespace Op1385Clock

def start (B n : ℕ) := B^n-1
def last (B n : ℕ) := start B (n+1)-1
def gap (B n : ℕ) := last B n - start B n
def slot (B t : ℕ) := Nat.log B (t+1)

theorem start_zero (B : ℕ) : start B 0 = 0 := by simp [start]

theorem strict {B : ℕ} (hB : 1 < B) : StrictMono (start B) := by
  intro i j h
  have hi : 0 < B^i := pow_pos (by omega) _
  have hj := Nat.pow_lt_pow_right hB h
  dsimp [start]
  omega

theorem timings {B : ℕ} (hB : 1 < B) (n : ℕ) :
    start B n + gap B n = last B n ∧ last B n + 1 = start B (n+1) := by
  have h := strict hB (Nat.lt_succ_self n)
  change start B n < start B (n+1) at h
  dsimp [gap,last]; omega

theorem slot_iff {B : ℕ} (hB : 1 < B) (t n : ℕ) :
    slot B t = n ↔ start B n ≤ t ∧ t < start B (n+1) := by
  have hpos : 0 < B^(n+1) := pow_pos (by omega) _
  have hpos' : 0 < B^n := pow_pos (by omega) _
  constructor
  · intro h
    have h1 := Nat.pow_log_le_self B (Nat.succ_ne_zero t)
    have h2 := Nat.lt_pow_of_log_lt hB (Nat.lt_succ_self (slot B t))
    change B^(slot B t) ≤ _ at h1
    change t+1 < B^(slot B t + 1) at h2
    rw [h] at h1 h2
    dsimp [start]; omega
  · rintro ⟨h1,h2⟩
    dsimp [start] at h1 h2
    have lo := Nat.le_log_of_pow_le hB (show B^n ≤ t+1 by omega)
    have up := Nat.log_lt_of_lt_pow (Nat.succ_ne_zero t) (show t+1 < B^(n+1) by omega)
    exact le_antisymm (Nat.le_of_lt_succ up) lo

theorem inside {B : ℕ} (hB : 1 < B) (t : ℕ) :
    start B (slot B t) ≤ t ∧ t ≤ last B (slot B t) := by
  have h := (slot_iff hB t _).mp rfl
  dsimp [last]; omega

theorem slot_start {B : ℕ} (hB : 1 < B) (n : ℕ) : slot B (start B n) = n :=
  (slot_iff hB _ n).mpr ⟨le_rfl,strict hB (Nat.lt_succ_self n)⟩

theorem slot_last {B : ℕ} (hB : 1 < B) (n : ℕ) : slot B (last B n) = n := by
  have h := timings hB n
  apply (slot_iff hB _ n).mpr
  omega

theorem idle_succ {B : ℕ} (hB : 1 < B) (t : ℕ) (h : t ≠ last B (slot B t)) :
    slot B (t+1) = slot B t := by
  have ht := inside hB t
  have he := timings hB (slot B t)
  apply (slot_iff hB _ _).mpr
  omega

theorem last_strict {B : ℕ} (hB : 1 < B) : StrictMono (last B) := by
  intro i j h
  have h1 := timings hB i
  have h2 := timings hB j
  have h3 : start B (i+1) < start B (j+1) := strict hB (Nat.succ_lt_succ h)
  omega

def decode (B : ℕ) (v : List Bool) := List.ofFn (fun i : Fin (slot B v.length) => v.getD (last B i.val) false)

def encodeStep (B : ℕ) (z : ℕ × List Bool) (b : Bool) : ℕ × List Bool :=
  (z.1+1,(z.2 ++ List.replicate (gap B z.1) false) ++ [b])

def encode (B : ℕ) (v : List Bool) : List Bool := (v.foldl (encodeStep B) (0,[])).2

theorem fold_first (B : ℕ) (v : List Bool) (z : ℕ × List Bool) :
    (v.foldl (encodeStep B) z).1 = z.1 + v.length := by
  induction v generalizing z with
  | nil => simp
  | cons b v ih => simp [ih,encodeStep]; omega

theorem encode_snoc (B : ℕ) (v : List Bool) (b : Bool) :
    encode B (v ++ [b]) = (encode B v ++ List.replicate (gap B v.length) false) ++ [b] := by
  simp [encode,List.foldl_append,encodeStep,fold_first]

theorem encode_length {B : ℕ} (hB : 1 < B) (v : List Bool) :
    (encode B v).length = start B v.length := by
  induction v using List.reverseRecOn with
  | nil => simp [encode,start]
  | append_singleton v b ih =>
    rw [encode_snoc]
    simp only [List.length_append,List.length_singleton,List.length_replicate,ih]
    have hh := timings hB v.length
    omega

theorem encode_sample {B : ℕ} (hB : 1 < B) (v : List Bool) (i : ℕ) (hi : i < v.length) :
    (encode B v).getD (last B i) false = v.getD i false := by
  induction v using List.reverseRecOn with
  | nil => simp at hi
  | append_singleton v b ih =>
    rw [encode_snoc]
    by_cases h : i < v.length
    · have hsmall : last B i < (encode B v).length := by
        have ht := (timings hB i).2
        have hmono := (strict hB).monotone (show i+1 ≤ v.length from h)
        rw [encode_length hB]
        omega
      simp only [List.append_assoc]
      rw [List.getD_append _ _ _ _ hsmall,List.getD_append _ _ _ _ h]
      exact ih h
    · have he : i = v.length := by simp at hi; omega
      subst i
      have hx : (encode B v ++ List.replicate (gap B v.length) false).length = last B v.length := by
        simpa [encode_length hB] using (timings hB v.length).1
      rw [← hx]
      rw [List.getD_append_right _ _ _ _ le_rfl,List.getD_append_right _ _ _ _ le_rfl]
      simp

theorem decode_phase {B : ℕ} (hB : 1 < B) (v : List Bool) (i : ℕ) (hi : i ≤ gap B v.length) :
    decode B (encode B v ++ List.replicate i false) = v := by
  have hlen : (encode B v ++ List.replicate i false).length = start B v.length + i := by simp [encode_length hB]
  have ht := timings hB v.length
  have hs : slot B (start B v.length+i) = v.length := (slot_iff hB _ _).mpr (by omega)
  apply List.ext_getElem
  · simp [decode,hlen,hs]
  · intro j hj h
    have hsmall : last B j < (encode B v).length := by
      have he := (timings hB j).2
      have hh := (strict hB).monotone (show j+1 ≤ v.length from h)
      rw [encode_length hB]
      omega
    simp only [decode,List.getElem_ofFn]
    rw [List.getD_append _ _ _ _ hsmall,encode_sample hB v j h,List.getD_eq_getElem _ _ h]

end Op1385Clock


namespace Op1385Clock

def readEdge {Q : Type} (B : ℕ) (e : TreeGameEdge Q 3) : TreeGameEdge Q 3 :=
  ⟨decode B e.source_node,e.source_state,e.dir,e.prio,e.target_state⟩

abbrev active (B t : ℕ) := t = last B (slot B t)

noncomputable def arena {Q : Type} (G : PrioritizedBorelGame Q 3) (B : ℕ) : PrioritizedBorelGame Q 3 where
  init_state := G.init_state
  owner := fun z => G.owner (decode B z.1,z.2)
  edges := {e | if active B e.source_node.length then readEdge B e ∈ G.edges
    else e.dir = false ∧ e.prio = 0 ∧ e.target_state = e.source_state}
  edges_outgoing := by
    intro v q
    by_cases ha : active B v.length
    · obtain ⟨e,he,hv,hq⟩ := G.edges_outgoing (decode B v) q
      refine ⟨⟨v,q,e.dir,e.prio,e.target_state⟩,?_,rfl,rfl⟩
      change (if active B v.length then _ else _)
      rw [if_pos ha]
      change (⟨decode B v,q,e.dir,e.prio,e.target_state⟩ : TreeGameEdge Q 3) ∈ _
      rwa [← hv,← hq]
    · refine ⟨⟨v,q,false,0,q⟩,?_,rfl,rfl⟩
      change (if active B v.length then _ else _)
      rw [if_neg ha]
      exact ⟨rfl,rfl,rfl⟩
  winning_sets := fun p => {β | (fun n => β (last B n)) ∈ G.winning_sets p}
  winning_measurable := fun p => (G.winning_measurable p).preimage (measurable_pi_lambda _ (fun n => measurable_pi_apply _))


end Op1385Clock

noncomputable def op1385SparseClockArena {Q : Type} (G : PrioritizedBorelGame Q 3) (B : ℕ) : PrioritizedBorelGame Q 3 := Op1385Clock.arena G B
See it in the graphDiscuss this resultChallenge it