AFTD Auto-Formalizing Theoretical Domains

switch_seq

def

For natural numbers n and k, switch_seq n k is the finite set of functions from Fin n to Bool having at most k switches in their sequence of values.

Statement

def switch_seq (n k : ℕ) : Finset (Fin n → Bool)
Defined in
arXiv:2611.28727 Fig. 9
Verified
29 Nov 2026
Axioms
none listed
Built on 1
  • list_switchesThe function list_switches counts the number of indices where adjacent elements in a list of booleans differ, defined recursively.

Read back from the Lean

Given natural numbers $n$ and $k$, switch_seq n k is defined as the finset of all functions $h : \mathrm{Fin}\ n \to \mathrm{Bool}$ such that list_switches (List.ofFn h) ≤ k.

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 concept class C_{n,k} of binary sequences on Fin n with at most k switches. -/
def switch_seq (n k : ℕ) : Finset (Fin n → Bool) := Finset.univ.filter (fun h => list_switches (List.ofFn h) ≤ k)
See it in the graphDiscuss this resultChallenge it