AFTD Auto-Formalizing Theoretical Domains

descending_band_set

deforiginal

For an integer d and positive integers r ≤ L, the descending band set A_{r,L} is the union over j from 0 to r-1 of the integer intervals [jd, jd + L - j - 1].

Statement

def descending_band_set (d : ℤ) (r L : ℕ) : Finset ℤ
Related work
knowledgebase, OP-1702
Verified
14 Nov 2026
Axioms
none listed
Built on 2
  • TotalPreorderA total preorder: a preorder where ≤ is total (complete). This is weaker than LinearOrder — it does NOT require antisymmetry or…
  • LinearOrder.toTotalPreorderEvery LinearOrder is a TotalPreorder.
Used by 2
  • descending_band_vulnerabilityFor an integer d and natural numbers r and L, let A = descending_band_set d r L and let S : Finset ℤ be the union over a ∈ A of {a, a + 1,…
  • descending_band_costFor integers $d \in \mathbb{Z}$ and $r, L \in \mathbb{N}$, the descending band cost descending_band_cost d r L is the infimum over all…

Read back from the Lean

descending_band_set is a definition taking an integer d : ℤ and two natural numbers r, L : ℕ, and returning the finite set of integers (Finset ℤ) defined as the union over all natural numbers j ∈ Finset.range r (i.e., 0 ≤ j < r) of the half-open integer intervals Finset.Ico (j * d) (j * d + (L - j : ℤ)), that is, the set of integers x such that j * d ≤ x < j * d + (L - j).

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 descending band set A_{r,L} = ⋃_{j=0}^{r-1} {jd, ..., jd + L - j - 1} -/
def descending_band_set (d : ℤ) (r L : ℕ) : Finset ℤ := (Finset.range r).biUnion fun j => Finset.Ico (j * d) (j * d + (L - j : ℤ))
See it in the graphDiscuss this resultChallenge it