AFTD Auto-Formalizing Theoretical Domains

randomized_littlestone

def

The rational-valued randomised Littlestone dimension of a finite concept class H : Finset (α → Bool) on a finite type α with decidable equality, taking values in ℚ, defined recursively: 0 if H.card ≤ 1, and otherwise the maximum over all points x : α that split H (having both fibers nonempty) of (1 + RL(H_x^false) + RL(H_x^true)) / 2 (or 0 if no point splits H).

Statement

def randomized_littlestone {α : Type*} [Fintype α] [DecidableEq α] (H : Finset (α → Bool)) : ℚ
Defined in
arXiv:2611.28727 Lemma 27(a)
Verified
24 Nov 2026
Axioms
none listed

Read back from the Lean

Given a finite type α with decidable equality ([Fintype α] and [DecidableEq α]) and a finite set of hypotheses H : Finset (α → Bool), randomized_littlestone H defines a rational number (ℚ) representing the randomized Littlestone dimension (or randomized mistake bound) of H. It is defined using an auxiliary recursive function fuel : ℕ → Finset (α → Bool) → ℚ initialized with fuel H.card and input H: - On (0, _), fuel returns 0. - On (f + 1, V): - If V.card ≤ 1, it returns 0. - Otherwise, let splits be the set of all x : α such that both {h ∈ V | h x = false} and {h ∈ V | h x = true} are nonempty. - It takes the maximum (via splits.fold max 0) over all x ∈ splits of: (1 + fuel f {h ∈ V | h x = false} + fuel f {h ∈ V | h x = true}) / 2. The function returns fuel H.card H.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The rational-valued randomised Littlestone dimension of a finite concept class on a finite domain, via recursive minimax. -/
def randomized_littlestone {α : Type*} [Fintype α] [DecidableEq α] (H : Finset (α → Bool)) : ℚ :=
  let rec fuel : ℕ → Finset (α → Bool) → ℚ
    | 0, _ => 0
    | f + 1, V =>
      if V.card ≤ 1 then 0
      else
        let splits := Finset.univ.filter fun x =>
          (V.filter (· x = false)).Nonempty ∧ (V.filter (· x = true)).Nonempty
        splits.fold max 0 fun x =>
          (1 + fuel f (V.filter (· x = false)) + fuel f (V.filter (· x = true))) / 2
  fuel H.card H
See it in the graphDiscuss this resultChallenge it