AFTD Auto-Formalizing Theoretical Domains

is_valid_consecutive_sum_seq

def

A sequence s of integers of length n ≥ 1 starting at s(1) = a is valid with step bound K if it is strictly increasing with adjacent differences at most K and has pairwise distinct consecutive sums.

Statement

def is_valid_consecutive_sum_seq (a K : ℤ) (n : ℕ) (s : ℕ → ℤ) : Prop
Defined in
arXiv:2611.30462 Section 3
Verified
25 Nov 2026
Axioms
none listed
Used by 1
  • consecutive_sum_max_termsFor integers a and K, the set of all integers x such that there exist a length n : ℕ and a sequence s : ℕ → ℤ satisfying…

Read back from the Lean

is_valid_consecutive_sum_seq a K n s asserts that for integers a and K, a natural number n, and a sequence s : ℕ → ℤ: 1. 1 ≤ n, 2. s 1 = a, 3. For every natural number i with 1 ≤ i < n, s i < s (i + 1) and s (i + 1) - s i ≤ K, 4. For all natural numbers u, r, v, s_len, if u + r ≤ n, v + s_len ≤ n, r > 0, and s_len > 0, then $$\sum_{i = u + 1}^{u + r} s i = \sum_{j = v + 1}^{v + s_len} s j \implies u = v \land r = s_len$$ (that is, all non-empty contiguous subsegment sums of (s 1, ..., s n) are distinct).

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

/-- Predicate that s is a valid sequence of length n starting at a with differences at most K and distinct consecutive sums. -/
def is_valid_consecutive_sum_seq (a K : ℤ) (n : ℕ) (s : ℕ → ℤ) : Prop :=
  1 ≤ n ∧
  s 1 = a ∧
  (∀ i ∈ Finset.Ico 1 n, s i < s (i + 1) ∧ s (i + 1) - s i ≤ K) ∧
  ∀ u r v s_len : ℕ, u + r ≤ n → v + s_len ≤ n → 0 < r → 0 < s_len →
    (∑ i ∈ Finset.Ioc u (u + r), s i = ∑ j ∈ Finset.Ioc v (v + s_len), s j) →
      u = v ∧ r = s_len
See it in the graphDiscuss this resultChallenge it