lean-golf Lean 4 proof leaderboard

USA1997 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.CharP.Defs
import Mathlib.Algebra.Order.Archimedean.Real.Basic
import Mathlib.Algebra.Order.Ring.Star
import Mathlib
import Mathlib.Data.Nat.Nth
import Mathlib.Data.Nat.PrimeFin
theorem _root_.LeanGolf.compfiles.usa1997_p1 (x₀ : ℝ) (hx₀ : x₀ ∈ Set.Ioo (0 : ℝ) 1) :
    (∃ k, seq (Nat.nth Nat.Prime) x₀ k = 0) ↔ x₀ ∈ solution_set
Trusted statement context
noncomputable section

namespace Usa1997P1

noncomputable def seq (p : ℕ → ℕ) (x₀ : ℝ) : ℕ → ℝ
  | 0 => x₀
  | k + 1 => if seq p x₀ k = 0 then 0 else Int.fract ((p k : ℝ) / seq p x₀ k)

abbrev solution_set : Set ℝ := Set.Ioo 0 1 ∩ Set.range ((↑) : ℚ → ℝ)