USA2012 P4
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.Algebra.Ring.Divisibility.Basic
import Mathlib.Data.Int.NatAbs
import Mathlib.Tactic.IntervalCases
import Mathlib.Tactic.Ring
theorem _root_.LeanGolf.compfiles.usa2012_p4 (f : ℕ → ℕ) :
f ∈ solution_set ↔ IsSolution fTrusted statement context
noncomputable section
namespace Usa2012P4
open Nat
def IsSolution (f : ℕ → ℕ) : Prop :=
(∀ n, 0 < n → 0 < f n) ∧
(∀ n, 0 < n → f (n !) = (f n)!) ∧
∀ (m n : ℕ), 0 < m → 0 < n → m ≠ n → (m : ℤ) - n ∣ (f m : ℤ) - f n
abbrev solution_set : Set (ℕ → ℕ) :=
{ f | (∀ n, 0 < n → f n = 1) ∨ (∀ n, 0 < n → f n = 2) ∨ (∀ n, 0 < n → f n = n) }