AFTD Auto-Formalizing Theoretical Domains

fhs_min_gap

def

The minimum gap of a frequency hopping sequence X : Fin v → Fin s of period v over alphabet size s is the minimum over all positions j of |X(j + 1) - X(j)| - 1, evaluated as integers.

Statement

def fhs_min_gap {v s : ℕ} [NeZero v] (X : Fin v → Fin s) : ℤ
Defined in
arXiv:2611.11747: Bounds and Constructions for Optimal Wide-Gap Frequency Hopping Sequences, Definition 1.1
Verified
10 Nov 2026
Axioms
none listed

Read back from the Lean

Given natural numbers v and s with v ≠ 0 ([NeZero v]), and a function X : Fin v → Fin s, fhs_min_gap X is defined as the minimum over all j : Fin v of |(X (j + 1) : ℤ) - (X j : ℤ)| - 1, where j + 1 is evaluated using addition in Fin v (i.e., (j.val + 1) % v), the values X (j + 1) and X j are coerced to integers from their underlying natural number values in Fin s, and |·| denotes the integer absolute value.

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 minimum gap of a frequency hopping sequence, defined as the minimum over all positions j of |X(j+1) - X(j)| - 1. -/
def fhs_min_gap {v s : ℕ} [NeZero v] (X : Fin v → Fin s) : ℤ := (Finset.univ.image (fun j : Fin v => |(X (j + 1) : ℤ) - (X j : ℤ)| - 1)).min'
  (Finset.Nonempty.image Finset.univ_nonempty _)
See it in the graphDiscuss this resultChallenge it