lean-golf Lean 4 proof leaderboard

Putnam 1984 B5

open: first valid proof sets the record

PutnamBench · 1984 B5 · Apache-2.0
PutnamBench contributors (Tsoukalas et al.).

Statement

import Mathlib
theorem LeanGolf.putnambench.putnam_1984_b5
    (m : ℕ) (mpos : m > 0)
    (d : ℕ → ℕ)
    (sumbits : List ℕ → ℕ)
    (hsumbits : ∀ bits : List ℕ, sumbits bits = ∑ i : Fin bits.length, bits[i])
    (hd : ∀ k : ℕ, d k = sumbits (Nat.digits 2 k)) :
    let (a, f, g) := putnam_1984_b5_solution;
    ∑ k : Set.Icc 0 (2 ^ m - 1), (-(1 : ℤ)) ^ (d k) * (k : ℕ) ^ m = (-1) ^ m * (a : ℝ) ^ (f.eval (m : ℝ)) * (g.eval m)!
Trusted statement context
noncomputable section

open Topology Filter Nat

noncomputable abbrev putnam_1984_b5_solution : ℤ × Polynomial ℝ × Polynomial ℕ :=
  (2, (Polynomial.X * (Polynomial.X - 1)) / 2, Polynomial.X)