AFTD Auto-Formalizing Theoretical Domains

min_two_insertion_collision

deforiginal

For a natural number n, min_two_insertion_collision n is the minimum over all binary words w of length n of two_insertion_collision (n - 2) w if 2 ≤ n, and 0 otherwise.

Statement

def min_two_insertion_collision (n : ℕ) : ℕ
Related work
arXiv:2611.01064, Section 2
Verified
03 Nov 2026
Axioms
none listed
Built on 1
  • two_insertion_collisionFor a binary word w of length m + 2, two_insertion_collision m w is the sum over all binary words u of length m of the square of…
Used by 4

Read back from the Lean

min_two_insertion_collision is a function from ℕ to ℕ. Given n : ℕ: - If 2 ≤ n, it evaluates to the minimum value, taken over all binary words w : Fin (n - 2 + 2) → Bool, of two_insertion_collision (n - 2) w. - If n < 2 (i.e., ¬ 2 ≤ n), it evaluates to 0.

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 two-insertion collision sum C_n over all binary words of length n. -/
def min_two_insertion_collision (n : ℕ) : ℕ := if 2 ≤ n then
    (Finset.univ.image (fun w : Fin (n - 2 + 2) → Bool => two_insertion_collision (n - 2) w)).min'
      (Finset.Nonempty.image Finset.univ_nonempty _)
  else 0
See it in the graphDiscuss this resultChallenge it