lean-golf Lean 4 proof leaderboard

USA2012 P1

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.Ring.Star
import Mathlib.Analysis.Real.Sqrt
import Mathlib.Data.Fin.Tuple.Sort
import Mathlib
import Mathlib.Data.Nat.Fib.Basic
import Mathlib.Tactic.IntervalCases
theorem _root_.LeanGolf.compfiles.usa2012_p1 (n : ℕ) : 3 ≤ n ∧ IsGood n ↔ n ∈ solution_set
Trusted statement context
noncomputable section

namespace Usa2012P1

def IsAcuteTriple (x y z : ℝ) : Prop :=
  x + y > z ∧ y + z > x ∧ z + x > y ∧
  x ^ 2 + y ^ 2 > z ^ 2 ∧ y ^ 2 + z ^ 2 > x ^ 2 ∧ z ^ 2 + x ^ 2 > y ^ 2

def IsGood (n : ℕ) : Prop :=
  ∀ a : Fin n → ℝ,
    (∀ i, 0 < a i) →
    (∀ i j, a i ≤ (n : ℝ) * a j) →
    ∃ i j k, i ≠ j ∧ j ≠ k ∧ k ≠ i ∧ IsAcuteTriple (a i) (a j) (a k)

abbrev solution_set : Set ℕ := {n | 13 ≤ n}