purewhite42/putnambench_solving huggingface dataset:
Problem: Find every real-valued function $f$ whose domain is an interval $I$ (finite or infinite) having 0 as a left-hand endpoint, such that for every positive member $x$ of $I$ the average of $f$ over the closed interval $[0, x]$ is equal to the geometric mean of the numbers $f(0)$ and $f(x)$.

Answer: the set of functions $f(x) = \frac{a}{(1 - c x)^2}$ where $a \geq 0$

Lean 4 formalization:
open MeasureTheory Set
Independent variables:
Hypotheses:
t: Set ℝ → (ℝ → ℝ) → Prop
name: P
t: ∀ s f, P s f ↔ 0 ≤ f ∧ ∀ x ∈ s, ⨍ t in Ico 0 x, f t = √(f 0 * f x)
name: P_def
Conclusion:
((∀ f,
      (P (Ioi 0) f → ∃ g ∈ answer, EqOn f g (Ici 0)) ∧
      (∀ e > 0, P (Ioo 0 e) f → ∃ g ∈ answer, EqOn f g (Ico 0 e))) ∧
    ∀ f ∈ answer, P (Ioi 0) f ∨ (∃ e > 0, P (Ioo 0 e) f))
Formal answer (type: Set (ℝ → ℝ)):
answer =
  ({f : ℝ → ℝ |
      ∃ (a : ℝ) (c : ℝ), a ≥ (0 : ℝ) ∧ f = fun (x : ℝ) => (a / (((1 : ℝ) - (c * x : ℝ) : ℝ) ^ (2 : ℕ) : ℝ) : ℝ)} :
    Set (ℝ → ℝ))
Problem: Evaluate in closed form \[ \sum_{k=1}^n {n \choose k} k^2. \]

Answer: $n(n+1)2^{n-2}$

Lean 4 formalization:
Independent variables:
t: ℕ
name: n
Hypotheses:
t: n ≥ 2
name: hn
Conclusion:
(answer n = ∑ k in Finset.Icc 1 n, Nat.choose n k * k^2)
Formal answer (type: ℕ → ℕ):
answer = fun (n : ℕ) => ((n * (n + (1 : ℕ) : ℕ) : ℕ) * ((2 : ℕ) ^ (n - (2 : ℕ) : ℕ) : ℕ) : ℕ)
Problem: Find an integral formula (i.e., a function $z$ such that $y(x) = \int_{1}^{x} z(t) dt$) for the solution of the differential equation $$\delta (\delta - 1) (\delta - 2) \cdots (\delta - n + 1) y = f(x)$$ with the initial conditions $y(1) = y'(1) = \cdots = y^{(n-1)}(1) = 0$, where $n \in \mathbb{N}$, $f$ is continuous for all $x \ge 1$, and $\delta$ denotes $x\frac{d}{dx}$.

Answer: $(x - t)^{n-1} \cdot f(t) / ((n-1)! \cdot t^n)$

Lean 4 formalization:
open Nat Set Topology Filter
Independent variables:
t: ℕ
name: n
t: ℝ → ℝ
name: f
Hypotheses:
t: ℕ → (ℝ → ℝ) → (ℝ → ℝ)
name: P
t: P 0 = id ∧ ∀ i y, P (i + 1) y = P i (fun x ↦ x * deriv y x - i * y x)
name: hP
t: 0 < n
name: hn
t: ℝ → ℝ
name: y
t: ContinuousOn f (Ici 1)
name: hf
t: ContDiffOn ℝ n y (Ici 1)
name: hy
Conclusion:
((∀ i < n, deriv^[i] y 1 = 0) ∧ (Ici 1).EqOn (P n y) f ↔
    ∀ x ≥ 1, y x = ∫ t in (1 : ℝ)..x, answer f n x t)
Formal answer (type: (ℝ → ℝ) → ℕ → ℝ → ℝ → ℝ):
answer = fun (f : ℝ → ℝ) (n : ℕ) (x t : ℝ) =>
  ((((x - t : ℝ) ^ (n - (1 : ℕ) : ℕ) : ℝ) * (f t : ℝ) : ℝ) / ((↑((n - (1 : ℕ) : ℕ)! : ℕ) : ℝ) * (t ^ n : ℝ) : ℝ) : ℝ)
Problem: For what integer $a$ does $x^2-x+a$ divide $x^{13}+x+90$?

Answer: 2

Lean 4 formalization:
open Topology Filter Polynomial
Independent variables:
Hypotheses:
t: ℤ
name: a
t: Polynomial.X^2 - Polynomial.X + (Polynomial.C a) ∣ (Polynomial.X ^ 13 + Polynomial.X + (Polynomial.C 90))
name: h_div
Conclusion:
(answer = a)
Formal answer (type: ℤ):
answer = (2 : ℤ)
Problem: Let $S$ be the set of all numbers of the form $2^m3^n$, where $m$ and $n$ are integers, and let $P$ be the set of all positive real numbers. Is $S$ dense in $P$?

Answer: True

Lean 4 formalization:
open Topology Filter Polynomial
Independent variables:
Hypotheses:
t: Set ℝ
name: S
t: S = {2 ^ m * 3 ^ n | (m : ℤ) (n : ℤ)}
name: hS
Conclusion:
(answer ↔ (closure S ⊇ Set.Ioi (0 : ℝ)))
Formal answer (type: Prop):
answer = True
Problem: Find every twice-differentiable real-valued function $f$ with domain the set of all real numbers and satisfying the functional equation $(f(x))^2-(f(y))^2=f(x+y)f(x-y)$ for all real numbers $x$ and $y$.

Answer: the set of functions of the form $A \sinh(k u)$, $A u$, or $A \sin(k u)$

Lean 4 formalization:
open Topology Filter Polynomial
Independent variables:
Hypotheses:
t: ℝ → ℝ
name: f
Conclusion:
(f ∈ answer ↔
      (ContDiff ℝ 1 f ∧ Differentiable ℝ (deriv f) ∧
      ∀ x y : ℝ, (f x) ^ 2 - (f y) ^ 2 = f (x + y) * f (x - y)))
Formal answer (type: Set (ℝ → ℝ)):
answer =
  ((({x : ℝ → ℝ | ∃ (A : ℝ) (k : ℝ), (fun (u : ℝ) => (A * (Real.sinh (k * u : ℝ) : ℝ) : ℝ)) = x} : Set (ℝ → ℝ)) ∪
          ({x : ℝ → ℝ | ∃ (A : ℝ), (fun (u : ℝ) => (A * u : ℝ)) = x} : Set (ℝ → ℝ)) :
        Set (ℝ → ℝ)) ∪
      ({x : ℝ → ℝ | ∃ (A : ℝ) (k : ℝ), (fun (u : ℝ) => (A * (Real.sin (k * u : ℝ) : ℝ) : ℝ)) = x} : Set (ℝ → ℝ)) :
    Set (ℝ → ℝ))
Problem: Let $\alpha$ be a real number. Find all continuous real-valued functions $f : [0, 1] \to (0, \infty)$ such that
\begin{align*}
\int_0^1 f(x) dx &= 1, \\
\int_0^1 x f(x) dx &= \alpha, \\
\int_0^1 x^2 f(x) dx &= \alpha^2. \\
\end{align*}

Answer: the empty set

Lean 4 formalization:
open Set
Independent variables:
Hypotheses:
t: ℝ
name: α
Conclusion:
(answer α = {f : ℝ → ℝ | (∀ x ∈ Icc 0 1, f x > 0) ∧ ContinuousOn f (Icc 0 1) ∧ ∫ x in (0)..1, f x = 1 ∧ ∫ x in (0)..1, x * f x = α ∧ ∫ x in (0)..1, x^2 * f x = α^2})
Formal answer (type: ℝ → Set (ℝ → ℝ)):
answer = fun (x : ℝ) => (∅ : Set (ℝ → ℝ))
Problem: Let $\triangle ABC$ satisfy $\angle CAB < \angle BCA < \frac{\pi}{2} < \angle ABC$. If the bisector of the external angle at $A$ meets line $BC$ at $P$, the bisector of the external angle at $B$ meets line $CA$ at $Q$, and $AP = BQ = AB$, find $\angle CAB$.

Answer: π / 15

Lean 4 formalization:
open EuclideanGeometry Real
Independent variables:
Hypotheses:
t: EuclideanSpace ℝ (Fin 2)
name: A
t: EuclideanSpace ℝ (Fin 2)
name: B
t: EuclideanSpace ℝ (Fin 2)
name: C
t: EuclideanSpace ℝ (Fin 2)
name: X
t: EuclideanSpace ℝ (Fin 2)
name: Y
t: ¬Collinear ℝ {A, B, C}
name: hABC
t: ∠ C A B < ∠ B C A ∧ ∠ B C A < π/2 ∧ π/2 < ∠ A B C
name: hangles
t: Collinear ℝ {X, B, C} ∧ ∠ X A B = (π - ∠ C A B)/2 ∧ dist A X = dist A B
name: hX
t: Collinear ℝ {Y, C, A} ∧ ∠ Y B C = (π - ∠ A B C)/2 ∧ dist B Y = dist A B
name: hY
Conclusion:
(∠ C A B = answer)
Formal answer (type: ℝ):
answer = ((π : ℝ) / (15 : ℝ) : ℝ)
Problem: How many orderings of the integers from $1$ to $n$ satisfy the condition that, for every integer $i$ except the first, there exists some earlier integer in the ordering which differs from $i$ by $1$?

Answer: $2^{n-1}$

Lean 4 formalization:
open EuclideanGeometry Topology Filter Complex
Independent variables:
t: ℕ
name: n
Hypotheses:
t: n > 0
name: npos
Conclusion:
({p ∈ permsOfFinset (Finset.Icc 1 n) | ∀ m ∈ Finset.Icc 2 n, ∃ k ∈ Finset.Ico 1 m, p m = p k + 1 ∨ p m = p k - 1}.card = answer n)
Formal answer (type: ℕ → ℕ):
answer = fun (n : ℕ) => ((2 : ℕ) ^ (n - (1 : ℕ) : ℕ) : ℕ)
Problem: Find $$\lim_{n \to \infty} \int_{0}^{1} \int_{0}^{1} \cdots \int_{0}^{1} \cos^2\left(\frac{\pi}{2n}(x_1 + x_2 + \cdots + x_n)\right) dx_1 dx_2 \cdots dx_n.$$

Answer: 1 / 2

Lean 4 formalization:
open EuclideanGeometry Topology Filter Complex
Independent variables:
Hypotheses:
Conclusion:
(Tendsto (fun n : ℕ ↦ ∫ x in {x : Fin (n+1) → ℝ | ∀ k : Fin (n+1), x k ∈ Set.Icc 0 1}, (Real.cos (Real.pi/(2 * (n+1)) * ∑ k : Fin (n+1), x k))^2) atTop (𝓝 answer))
Formal answer (type: ℝ):
answer = (1 / 2 : ℝ)
Problem: Consider polynomial forms $ax^2-bx+c$ with integer coefficients which have two distinct zeros in the open interval $0<x<1$. Exhibit with a proof the least positive integer value of $a$ for which such a polynomial exists.

Answer: 5

Lean 4 formalization:
open Polynomial
Independent variables:
Hypotheses:
t: Set ℤ
name: S
t: S = {a | ∃ P : Polynomial ℤ, P.degree = 2 ∧ (∃ z1 z2 : Set.Ioo (0 : ℝ) 1, z1 ≠ z2 ∧ aeval (z1 : ℝ) P = 0 ∧ aeval (z2 : ℝ) P = 0) ∧P.coeff 2 = a ∧ a > 0}
name: hS
Conclusion:
(IsLeast S answer)
Formal answer (type: ℕ):
answer = (5 : ℕ)
Problem: Given real numbers $\{a_i\}$ and $\{b_i\}$, ($i=1,2,3,4$), such that $a_1b_2-a_2b_1 \neq 0$. Consider the set of all solutions $(x_1,x_2,x_3,x_4)$ of the simultaneous equations $a_1x_1+a_2x_2+a_3x_3+a_4x_4=0$ and $b_1x_1+b_2x_2+b_3x_3+b_4x_4=0$, for which no $x_i$ ($i=1,2,3,4$) is zero. Each such solution generates a $4$-tuple of plus and minus signs $(\text{signum }x_1,\text{signum }x_2,\text{signum }x_3,\text{signum }x_4)$. Determine, with a proof, the maximum number of distinct $4$-tuples possible.

Answer: 8

Lean 4 formalization:
open Nat Topology Filter
Independent variables:
Hypotheses:
t: (Fin 4 → ℝ) → (Fin 4 → ℝ) → Prop
name: abneq0
t: abneq0 = (fun a b : Fin 4 → ℝ => a 0 * b 1 - a 1 * b 0 ≠ 0)
name: habneq0
t: (Fin 4 → ℝ) → (Fin 4 → ℝ) → ℕ
name: numtuples
t: ∀ a b : Fin 4 → ℝ, numtuples a b = {s : Fin 4 → ℝ | ∃ x : Fin 4 → ℝ, (∀ i : Fin 4, x i ≠ 0) ∧ (∑ i : Fin 4, a i * x i) = 0 ∧ (∑ i : Fin 4, b i * x i) = 0 ∧ (∀ i : Fin 4, s i = Real.sign (x i))}.encard
name: hnumtuples
Conclusion:
((∃ a b : Fin 4 → ℝ, abneq0 a b ∧ numtuples a b = answer) ∧ (∀ a b : Fin 4 → ℝ, abneq0 a b → numtuples a b ≤ answer))
Formal answer (type: ℕ):
answer = (8 : ℕ)
Problem: Let $V$ be the set of all quadratic polynomials with real coefficients such that $|P(x)| \le 1$ for all $x \in [0, 1]$. Find the supremum of $|P'(0)|$ across all $P \in V$.

Answer: 8

Lean 4 formalization:
open Finset Polynomial
Independent variables:
Hypotheses:
t: Set ℝ[X]
name: V
t: V = {P : ℝ[X] | P.degree = 2 ∧ ∀ x ∈ Set.Icc 0 1, |P.eval x| ≤ 1}
name: V_def
Conclusion:
(sSup {|(derivative P).eval 0| | P ∈ V} = answer)
Formal answer (type: ℝ):
answer = (8 : ℝ)
Problem: Let $p$ be a prime number. Find the number of distinct $2 \times 2$ matrices $$\begin{pmatrix} a & b \\ c & d \end{pmatrix}$$ such that $a, b, c, d \in \{0, 1, ..., p - 1\}$, $a + d \equiv 1 \pmod p$, and $ad - bc \equiv 0 \pmod p$.

Answer: $p^2 + p$

Lean 4 formalization:
open Finset Polynomial Topology Filter Metric
Independent variables:
t: ℕ
name: p
Hypotheses:
t: Nat.Prime p
name: hp
Conclusion:
({M : Matrix (Fin 2) (Fin 2) (ZMod p) | M 0 0 + M 1 1 = 1 ∧ M 0 0 * M 1 1 - M 0 1 * M 1 0 = 0}.ncard = answer p)
Formal answer (type: ℕ → ℕ):
answer = fun (p : ℕ) => ((p ^ (2 : ℕ) : ℕ) + p : ℕ)
Problem: What are the possible ranges (across all real inputs $x$ and $y$) of a polynomial $f(x, y)$ with real coefficients?

Answer: {{x} | x : ℝ} ∪ {Set.Ici x | x : ℝ} ∪ {Set.Iic x | x : ℝ} ∪ {Set.Iio x | x : ℝ} ∪ {Set.Ioi x | x : ℝ} ∪ {Set.univ}

Lean 4 formalization:
open Matrix Filter Topology Set Nat
Independent variables:
Hypotheses:
Conclusion:
(answer = {{z : ℝ | ∃ x : Fin 2 → ℝ, MvPolynomial.eval x f = z} | f : MvPolynomial (Fin 2) ℝ})
Formal answer (type: Set (Set ℝ)):
answer =
  (((((({x : Set ℝ | ∃ (x_1 : ℝ), ({x_1} : Set ℝ) = x} : Set (Set ℝ)) ∪
                      ({x : Set ℝ | ∃ (x_1 : ℝ), (Set.Ici x_1 : Set ℝ) = x} : Set (Set ℝ)) :
                    Set (Set ℝ)) ∪
                  ({x : Set ℝ | ∃ (x_1 : ℝ), (Set.Iic x_1 : Set ℝ) = x} : Set (Set ℝ)) :
                Set (Set ℝ)) ∪
              ({x : Set ℝ | ∃ (x_1 : ℝ), (Set.Iio x_1 : Set ℝ) = x} : Set (Set ℝ)) :
            Set (Set ℝ)) ∪
          ({x : Set ℝ | ∃ (x_1 : ℝ), (Set.Ioi x_1 : Set ℝ) = x} : Set (Set ℝ)) :
        Set (Set ℝ)) ∪
      ({(Set.univ : Set ℝ)} : Set (Set ℝ)) :
    Set (Set ℝ))
Problem: Show that a finite group can not be the union of two of its proper subgroups. Does the statement remain true if 'two' is replaced by 'three'?

Answer: False

Lean 4 formalization:
open Matrix Filter Topology Set Nat
Independent variables:
Hypotheses:
t: ℕ → Prop
name: P
t: ∀ n, P n ↔ ∀ (G : Type) [Group G] [Finite G],
      ∀ H : Fin n → Subgroup G, (∀ i, H i < ⊤) → ⋃ i, (H i : Set G) < ⊤
name: P_def
Conclusion:
(answer ↔ (P 3))
Formal answer (type: Prop):
answer = False
Problem: Find the length of the longest possible sequence of equal nonzero digits (in base 10) in which a perfect square can terminate. Also, find the smallest square that attains this length.

Answer: (3, 1444)

Lean 4 formalization:
open Metric Set EuclideanGeometry
Independent variables:
Hypotheses:
t: ℕ → ℕ
name: L
t: ∀ n : ℕ, L n ≤ (Nat.digits 10 n).length ∧
(∀ k : ℕ, k < L n → (Nat.digits 10 n)[k]! = (Nat.digits 10 n)[0]!) ∧
(L n ≠ (Nat.digits 10 n).length → (Nat.digits 10 n)[L n]! ≠ (Nat.digits 10 n)[0]!)
name: hL
Conclusion:
((∃ n : ℕ, (Nat.digits 10 (n^2))[0]! ≠ 0 ∧ L (n^2) = answer.1) ∧
(∀ n : ℕ, (Nat.digits 10 (n^2))[0]! ≠ 0 → L (n^2) ≤ answer.1) ∧
(∃ m : ℕ, m^2 = answer.2) ∧
L (answer.2) = answer.1 ∧
(Nat.digits 10 answer.2)[0]! ≠ 0 ∧
∀ n : ℕ, (Nat.digits 10 (n^2))[0]! ≠ 0 ∧ L (n^2) = answer.1 → n^2 ≥ answer.2)
Formal answer (type: ℕ × ℕ):
answer = (((3 : ℕ), (1444 : ℕ)) : ℕ × ℕ)
Problem: Evaluate the infinite product $\lim_{n \to \infty} \frac{1}{n^4} \prod_{i = 1}^{2n} (n^2 + i^2)^{1/n}$.

Answer: $e^{2 \ln 5 - 4 + 2 \arctan 2}$

Lean 4 formalization:
open Metric Set EuclideanGeometry Filter Topology
Independent variables:
Hypotheses:
Conclusion:
(Tendsto (fun n => 1/(n^4) * ∏ i in Finset.Icc (1 : ℤ) (2*n), ((n^2 + i^2) : ℝ)^((1 : ℝ)/n)) atTop (𝓝 answer))
Formal answer (type: ℝ):
answer =
  (Real.exp ((((2 : ℝ) * (Real.log (5 : ℝ) : ℝ) : ℝ) - (4 : ℝ) : ℝ) + ((2 : ℝ) * (Real.arctan (2 : ℝ) : ℝ) : ℝ) : ℝ) :
    ℝ)
Problem: Determine all polynomials $P(x)$ such that $P(x^2 + 1) = (P(x))^2 + 1$ and $P(0) = 0$.

Answer: {Polynomial.X}

Lean 4 formalization:
open Set
Independent variables:
Hypotheses:
t: Polynomial ℝ
name: P
Conclusion:
(∀ P : Polynomial ℝ, P ∈ answer ↔ (P.eval 0 = 0 ∧ (∀ x : ℝ, P.eval (x^2 + 1) = (P.eval x)^2 + 1)))
Formal answer (type: Set (Polynomial ℝ)):
answer = ({(Polynomial.X : Polynomial ℝ)} : Set (Polynomial ℝ))
Problem: After each play of a certain game of solitaire, the player receives either $a$ or $b$ points, where $a$ and $b$ are positive integers with $a > b$; scores accumulate from play to play. If there are $35$ unattainable scores, one of which is $58$, find $a$ and $b$.

Answer: (11, 8)

Lean 4 formalization:
open Set MvPolynomial
Independent variables:
Hypotheses:
t: ℤ
name: a
t: ℤ
name: b
t: a > 0 ∧ b > 0 ∧ a > b
name: hab
t: ℤ → ℤ → Prop
name: pab
t: ∀ x y, pab x y ↔
    {s : ℕ | ¬∃ m n : ℕ, m*x + n*y = s}.ncard = 35 ∧
    ¬∃ m n : ℕ, m*x + n*y = 58
name: hpab
Conclusion:
(pab a b ↔ a = answer.1 ∧ b = answer.2)
Formal answer (type: ℤ × ℤ):
answer = (((11 : ℤ), (8 : ℤ)) : ℤ × ℤ)
Problem: Find all functions $F : \mathbb{R} \setminus \{0, 1\} \to \mathbb{R}$ that satisfy $F(x) + F\left(\frac{x - 1}{x}\right) = 1 + x$ for all $x \in \mathbb{R} \setminus \{0, 1\}$.

Answer: $\left\{x \mapsto \frac{x^3 - x^2 - 1}{2x(x - 1)}\right\}$

Lean 4 formalization:
open Set MvPolynomial
Independent variables:
Hypotheses:
t: Set ℝ
name: S
t: S = univ \ {0, 1}
name: hS
t: (ℝ → ℝ) → Prop
name: P
t: P = fun (F : ℝ → ℝ) => ∀ x ∈ S, F x + F ((x - 1)/x) = 1 + x
name: hP
Conclusion:
(∀ F ∈ answer, P F ∧ ∀ f : ℝ → ℝ, P f → ∃ F ∈ answer, (∀ x ∈ S, f x = F x))
Formal answer (type: Set (ℝ → ℝ)):
answer =
  ({fun (x : ℝ) =>
      ((((x ^ (3 : ℕ) : ℝ) - (x ^ (2 : ℕ) : ℝ) : ℝ) - (1 : ℝ) : ℝ) / (((2 : ℝ) * x : ℝ) * (x - (1 : ℝ) : ℝ) : ℝ) : ℝ)} :
    Set (ℝ → ℝ))
Problem: We call a function $f$ from $[0,1]$ to the reals to be supercontinuous on $[0,1]$ if the Cesaro-limit exists for the sequence $f(x_1), f(x_2), f(x_3), \dots$ whenever it does for the sequence $x_1, x_2, x_3 \dots$. Find all supercontinuous functions on $[0,1]$.

Answer: the set of all linear functions on [0,1]

Lean 4 formalization:
open EuclideanGeometry Filter Topology Set
Independent variables:
Hypotheses:
t: (ℕ → ℝ) → Prop
name: climit_exists
t: (ℝ → ℝ) → Prop
name: supercontinuous
t: ∀ x, climit_exists x ↔ ∃ C : ℝ, Tendsto (fun n => (∑ i in Finset.range n, (x i))/(n : ℝ)) atTop (𝓝 C)
name: hclimit_exists
t: ∀ f, supercontinuous f ↔ ∀ (x : ℕ → ℝ), (∀ i : ℕ, x i ∈ Icc 0 1) → climit_exists x → climit_exists (fun i => f (x i))
name: hsupercontinuous
Conclusion:
({f | supercontinuous f} = answer)
Formal answer (type: Set (ℝ → ℝ)):
answer =
  ({f : ℝ → ℝ |
      ∃ (A : ℝ) (B : ℝ), ∀ (x : ℝ), x ∈ (Set.Icc (0 : ℝ) (1 : ℝ) : Set ℝ) → (f x : ℝ) = ((A * x : ℝ) + B : ℝ)} :
    Set (ℝ → ℝ))
Problem: Let $x : \mathbb{R} \to \mathbb{R}$ be a twice differentiable function whose second derivative is nonstrictly decreasing. If $x(t) - x(0) = s$, $x'(0) = 0$, and $x'(t) = v$ for some $t > 0$, find the maximum possible value of $t$ in terms of $s$ and $v$.

Answer: $2s / v$

Lean 4 formalization:
open EuclideanGeometry Filter Topology Set MeasureTheory Metric
Independent variables:
t: ℝ
name: s
t: ℝ
name: v
Hypotheses:
t: s > 0
name: hs
t: v > 0
name: hv
t: ℝ → (ℝ → ℝ) → Prop
name: valid
t: ∀ t x, valid t x ↔
      DifferentiableOn ℝ x (Set.Icc 0 t) ∧ DifferentiableOn ℝ (deriv x) (Set.Icc 0 t) ∧
      AntitoneOn (deriv (deriv x)) (Set.Icc 0 t) ∧
      deriv x 0 = 0 ∧ deriv x t = v ∧ x t - x 0 = s
name: hvalid
Conclusion:
(IsGreatest {t | ∃ x : ℝ → ℝ, valid t x} (answer s v))
Formal answer (type: ℝ → ℝ → ℝ):
answer = fun (s v : ℝ) => (((2 : ℝ) * s : ℝ) / v : ℝ)
Problem: Consider an infinite series whose $n$th term is given by $\pm \frac{1}{n}$, where the actual values of the $\pm$ signs repeat in blocks of $8$ (so the $\frac{1}{9}$ term has the same sign as the $\frac{1}{1}$ term, and so on). Call such a sequence balanced if each block contains four $+$ and four $-$ signs. Prove that being balanced is a sufficient condition for the sequence to converge. Is being balanced also necessary for the sequence to converge?

Answer: True

Lean 4 formalization:
open Nat Set MeasureTheory Topology Filter
Independent variables:
Hypotheses:
t: List ℝ
name: L
t: L.length = 8 ∧ ∀ i : Fin L.length, L[i] = 1 ∨ L[i] = -1
name: hL
t: ℕ
name: pluses
t: pluses = {i : Fin L.length | L[i] = 1}.ncard
name: hpluses
t: ℕ → ℝ
name: S
t: S = fun n : ℕ ↦ ∑ i in Finset.Icc 1 n, L[i % 8]/i
name: hS
Conclusion:
(answer ↔ ((∃ l : ℝ, Tendsto S atTop (𝓝 l)) → pluses = 4))
Formal answer (type: Prop):
answer = True
Problem: How many zeros does the function $f(x) = 2^x - 1 - x^2$ have on the real line?

Answer: 3

Lean 4 formalization:
open Nat Set MeasureTheory Topology Filter
Independent variables:
Hypotheses:
t: ℝ → ℝ
name: f
t: f = fun x => 2^x - 1 - x^2
name: hf
Conclusion:
(answer = {x : ℝ | f x = 0}.ncard)
Formal answer (type: ℕ):
answer = (3 : ℕ)
Problem: Suppose $f$ is a function on $[0,1]$ with continuous derivative satisfying $0 < f'(x) \leq 1$ and $f 0 = 0$. Prove that $\left[\int_0^1 f(x) dx\right]]^2 \geq \int_0^1 (f(x))^3 dx$, and find an example where equality holds.

Answer: the identity function $f(x) = x$

Lean 4 formalization:
open Nat Set MeasureTheory Topology Filter
Independent variables:
Hypotheses:
Conclusion:
(ContDiff ℝ 1 answer ∧ (∀ x : ℝ, 0 < deriv answer x ∧ deriv answer x ≤ 1) ∧ answer 0 = 0 ∧ (∫ x in Icc 0 1, answer x)^2 = ∫ x in Icc 0 1, (answer x)^3)
Formal answer (type: ℝ → ℝ):
answer = fun (x : ℝ) => x
Problem: Call a set of positive integers 'conspiratorial' if no three of them are pairwise relatively prime. What is the largest number of elements in any conspiratorial subset of the integers 1 through 16?

Answer: 11

Lean 4 formalization:
open Set
Independent variables:
Hypotheses:
t: Set ℤ → Prop
name: conspiratorial
t: ∀ S, conspiratorial S ↔ ∀ a ∈ S, ∀ b ∈ S, ∀ c ∈ S, (a > 0 ∧ b > 0 ∧ c > 0) ∧ ((a ≠ b ∧ b ≠ c ∧ a ≠ c) → (Int.gcd a b > 1 ∨ Int.gcd b c > 1 ∨ Int.gcd a c > 1))
name: hconspiratorial
Conclusion:
(IsGreatest {k | ∃ S, S ⊆ Icc 1 16 ∧ conspiratorial S ∧ S.encard = k} answer)
Formal answer (type: ℕ):
answer = (11 : ℕ)
Problem: A well-known theorem asserts that a prime $p > 2$ can be written as the sum of two perfect squres if and only if $p \equiv 1 \bmod 4$. Find which primes $p > 2$ can be written in each of the following forms, using (not necessarily positive) integers $x$ and $y$: (a) $x^2 + 16y^2$, (b) $4x^2 + 4xy + 5y^2$.

Answer: ({p : ℕ | p.Prime ∧ p ≡ 1 [MOD 8]}, {p : ℕ | p.Prime ∧ p ≡ 5 [MOD 8]})

Lean 4 formalization:
open Set
Independent variables:
t: ℕ
name: p
Hypotheses:
t: ∀ p : ℕ, p.Prime ∧ p > 2 → ((∃ m n : ℤ, p = m^2 + n^2) ↔ p ≡ 1 [MOD 4])
name: h_assumption
Conclusion:
(∀ p : ℕ,
    ((p.Prime ∧ p > 2 ∧ (∃ x y : ℤ, p = x^2 + 16*y^2)) ↔ p ∈ answer.1) ∧
    ((p.Prime ∧ p > 2 ∧ (∃ x y : ℤ, p = 4*x^2 + 4*x*y + 5*y^2)) ↔ p ∈ answer.2))
Formal answer (type: (Set ℕ) × (Set ℕ)):
answer =
  ((({p : ℕ | Nat.Prime p ∧ p ≡ (1 : ℕ) [MOD (8 : ℕ)]} : Set ℕ),
      ({p : ℕ | Nat.Prime p ∧ p ≡ (5 : ℕ) [MOD (8 : ℕ)]} : Set ℕ)) :
    Set ℕ × Set ℕ)
Problem: Evaluate in closed form: $\frac{1}{2^{n-1}} \sum_{k < n/2} (n-2k)*{n \choose k}$.

Answer: (fun n ↦ (1 : ℚ) / ((2 : ℚ) ^ ((n :ℕ) - 1)) * (n * (n - 1).choose ⌊n / 2⌋₊))

Lean 4 formalization:
open Set Nat
Independent variables:
t: ℕ
name: n
Hypotheses:
t: 0 < n
name: hn
Conclusion:
((1 : ℚ) / (2 ^ (n - 1)) * ∑ k in Finset.Icc 0 ⌊n / 2⌋₊, (n - 2 * k) * (n.choose k) = answer n)
Formal answer (type: ℕ → ℚ):
answer = fun (n : ℕ) =>
  (((1 : ℚ) / ((2 : ℚ) ^ (n - (1 : ℕ) : ℕ) : ℚ) : ℚ) *
      ((↑n : ℚ) * (↑((n - (1 : ℕ) : ℕ).choose (⌊(n / (2 : ℕ) : ℕ)⌋₊ : ℕ) : ℕ) : ℚ) : ℚ) :
    ℚ)
Problem: Given $n$, let $k(n)$ be the minimal degree of any monic integral polynomial $f$ such that the value of $f(x)$ is divisible by $n$ for every integer $x$. Find the value of $k(1000000)$.

Answer: 25

Lean 4 formalization:
open Set Nat Polynomial
Independent variables:
Hypotheses:
t: Polynomial ℤ → Prop
name: hdivnallx
t: hdivnallx = fun f => Monic f ∧ (∀ x : ℤ, (10^6 : ℤ) ∣ f.eval x)
name: hdivnallx_def
Conclusion:
(sInf {d : ℕ | ∃ f : Polynomial ℤ, hdivnallx f ∧ d = f.natDegree} = answer)
Formal answer (type: ℕ):
answer = (25 : ℕ)
Problem: For a set with $1000$ elements, how many subsets are there whose candinality is respectively $\equiv 0 \bmod 3, \equiv 1 \bmod 3, \equiv 2 \bmod 3$?

Answer: ((2^1000 - 1)/3, (2^1000 - 1)/3, 1 + (2^1000 - 1)/3)

Lean 4 formalization:
open Set Nat Polynomial Filter Topology
Independent variables:
Hypotheses:
t: ℤ
name: n
t: n = 1000
name: hn
t: ℕ
name: count0
t: ℕ
name: count1
t: ℕ
name: count2
t: count0 = {S | S ⊆ Finset.Icc 1 n ∧ S.card ≡ 0 [MOD 3]}.ncard
name: hcount0
t: count1 = {S | S ⊆ Finset.Icc 1 n ∧ S.card ≡ 1 [MOD 3]}.ncard
name: hcount1
t: count2 = {S | S ⊆ Finset.Icc 1 n ∧ S.card ≡ 2 [MOD 3]}.ncard
name: hcount2
Conclusion:
((count0, count1, count2) = answer)
Formal answer (type: ℕ × ℕ × ℕ):
answer =
  ((((((2 : ℕ) ^ (1000 : ℕ) : ℕ) - (1 : ℕ) : ℕ) / (3 : ℕ) : ℕ),
      ((((((2 : ℕ) ^ (1000 : ℕ) : ℕ) - (1 : ℕ) : ℕ) / (3 : ℕ) : ℕ),
          ((1 : ℕ) + ((((2 : ℕ) ^ (1000 : ℕ) : ℕ) - (1 : ℕ) : ℕ) / (3 : ℕ) : ℕ) : ℕ)) :
        ℕ × ℕ)) :
    ℕ × ℕ × ℕ)
Problem: If an integer $n$ can be written as the sum of two triangular numbers (that is, $n = \frac{a^2 + a}{2} + \frac{b^2 + b}{2}$ for some integers $a$ and $b$), express $4n + 1$ as the sum of the squares of two integers $x$ and $y$, giving $x$ and $y$ in terms of $a$ and $b$. Also, show that if $4n + 1 = x^2 + y^2$ for some integers $x$ and $y$, then $n$ can be written as the sum of two triangular numbers.

Answer: (fun (a, b) => a + b + 1, fun (a, b) => a - b)

Lean 4 formalization:
open Polynomial
Independent variables:
Hypotheses:
t: (ℤ × ℤ × ℤ) → Prop
name: nab
t: (ℤ × ℤ × ℤ) → Prop
name: nxy
t: nab = fun (n, a, b) => n = (a^2 + (a : ℚ))/2 + (b^2 + (b : ℚ))/2
name: hnab
t: nxy = fun (n, x, y) => 4*n + 1 = x^2 + y^2
name: hnxy
Conclusion:
((∀ n a b : ℤ, nab (n, a, b) → nxy (n, answer.1 (a, b), answer.2 (a, b))) ∧ ∀ n : ℤ, (∃ x y : ℤ, nxy (n, x, y)) → ∃ a b : ℤ, nab (n, a, b))
Formal answer (type: ((ℤ × ℤ) → ℤ) × ((ℤ × ℤ) → ℤ)):
answer =
  ((fun (x : ℤ × ℤ) =>
      match x with
      | ((a, b) : ℤ × ℤ) => ((a + b : ℤ) + (1 : ℤ) : ℤ),
      fun (x : ℤ × ℤ) =>
      match x with
      | ((a, b) : ℤ × ℤ) => (a - b : ℤ)) :
    (ℤ × ℤ → ℤ) × (ℤ × ℤ → ℤ))
Problem: For which ordered pairs $(b, c)$ of real numbers do both roots of $z^2 + bz + c$ lie strictly inside the unit disk (i.e., $\{|z| < 1\}$) in the complex plane?

Answer: $c < 1 \land c - b > -1 \land c + b > -1$

Lean 4 formalization:
open Polynomial
Independent variables:
Hypotheses:
Conclusion:
(∀ (b : ℝ) (c : ℝ), (∀ z : ℂ, (Polynomial.X^2 + (Polynomial.C (b : ℂ)) * Polynomial.X + (Polynomial.C (c : ℂ)) : Polynomial ℂ).eval z = 0 → ‖z‖ < 1) ↔ answer (b, c))
Formal answer (type: (ℝ × ℝ) → Prop):
∀ (b : ℝ) (c : ℝ), answer ((b, c) : ℝ × ℝ) = (c < (1 : ℝ) ∧ (c - b : ℝ) > (-1 : ℝ) ∧ (c + b : ℝ) > (-1 : ℝ))