lean-golf Lean 4 proof leaderboard

USA1980 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.Analysis.Normed.Field.Basic
import Mathlib.Analysis.Real.Sqrt
import Mathlib.Tactic.LinearCombination
import Mathlib.Tactic.LinearCombination.Lemmas
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.Ring
theorem _root_.LeanGolf.compfiles.usa1980_p1 {A a B b C h k x₁ x₂ x₃ : ℝ} (hh : 0 < h)
    (h1 : x₁ = h * A + k) (h2 : a = h * x₁ + k)
    (h3 : x₂ = h * B + k) (h4 : b = h * x₂ + k)
    (h5 : x₃ = h * C + k) (hne : x₁ ≠ x₂) :
    x₃ = solution A a B b C
Trusted statement context
noncomputable section

namespace Usa1980P1

open Real

noncomputable abbrev solution (A a B b C : ℝ) : ℝ :=
  C * sqrt ((a - b) / (A - B)) +
    (b * A - a * B) / ((A - B) * (sqrt ((a - b) / (A - B)) + 1))