lean-golf Lean 4 proof leaderboard

USA2020 P5

open: first valid proof sets the record

Compfiles · Usa · Apache-2.0
Copyright (c) 2026 The Compfiles Contributors. All rights reserved. Authors: Kimi K3

Statement

import Mathlib.Algebra.Order.Archimedean.Real.Basic
import Mathlib.Algebra.Polynomial.Roots
theorem _root_.LeanGolf.compfiles.usa2020_p5 (n : ℕ) (hn : 2 ≤ n) :
    IsGreatest {k : ℕ | ∃ S : Finset (ℝ × ℝ), S.card = n ∧ ¬ Overdetermined S ∧
      (S.powerset.filter Overdetermined).card = k} (solution n)
Trusted statement context
noncomputable section

open Classical Polynomial

namespace Usa2020P5

def Overdetermined (S : Finset (ℝ × ℝ)) : Prop :=
  2 ≤ S.card ∧ ∃ P : ℝ[X], P ≠ 0 ∧ P.natDegree ≤ S.card - 2 ∧ ∀ p ∈ S, P.eval p.1 = p.2

abbrev solution (n : ℕ) : ℕ := 2 ^ (n - 1) - n