purewhite42/formal_problem_solving_main huggingface dataset:
Problem: Find the volume of the region of points $(x,y,z)$ such that
\[
(x^2 + y^2 + z^2 + 8)^2 \leq 36(x^2 + y^2).
\]

Answer: 6 * Real.pi ^ 2

Lean 4 formalization:
open Real
Conclusions: ((MeasureTheory.volume {a : ℝ × ℝ × ℝ | (a.1 ^ 2 + a.2.1 ^ 2 + a.2.2 ^ 2 + 8) ^ 2 ≤ 36 * (a.1 ^ 2 + a.2.1 ^ 2)}).toReal = answer)
Answer type: ℝ
Formal answer: answer = ((6 : ℝ) * ((π : ℝ) ^ (2 : ℕ) : ℝ) : ℝ)
Problem: Let $S=\{1,2,\dots,n\}$ for some integer $n>1$. Say a permutation $\pi$ of $S$ has a \emph{local maximum} at $k \in S$ if
\begin{enumerate}
\item[(i)] $\pi(k)>\pi(k+1)$ for $k=1$;
\item[(ii)] $\pi(k-1)<\pi(k)$ and $\pi(k)>\pi(k+1)$ for $1<k<n$;
\item[(iii)] $\pi(k-1)<\pi(k)$ for $k=n$.
\end{enumerate}
(For example, if $n=5$ and $\pi$ takes values at $1,2,3,4,5$ of $2,1,4,5,3$, then $\pi$ has a local maximum of 2 at $k=1$, and a local maximum of 5 at $k=4$.) What is the average number of local maxima of a permutation of $S$, averaging over all permutations of $S$?

Answer: (fun n : ℕ => (n + 1) / 3)

Lean 4 formalization:
Independent variables: t: ℕ
name: n
Hypotheses: t: Equiv.Perm (Fin n) → (ℕ → ℕ)
name: pnat
t: Equiv.Perm (Fin n) → ℕ
name: pcount
t: n > 1
name: ngt1
t: ∀ p : Equiv.Perm (Fin n), ∀ k : Fin n, (pnat p) k = p k
name: hpnat
t: ∀ p : Equiv.Perm (Fin n), pcount p = {k : Fin n | (k.1 = 0 ∨ (pnat p) (k - 1) < (pnat p) k) ∧ (k = n - 1 ∨ (pnat p) k > (pnat p) (k + 1))}.encard
name: hpcount
Conclusions: ((∑ p : Equiv.Perm (Fin n), pcount p) / {p : Equiv.Perm (Fin n) | true}.ncard = answer n)
Answer type: ℕ → ℝ
Formal answer: answer = fun (n : ℕ) => (((↑n : ℝ) + (1 : ℝ) : ℝ) / (3 : ℝ) : ℝ)
Problem: Let $n$ be a positive odd integer and let $\theta$ be a real number such that $\theta/\pi$ is irrational. Set $a_k=\tan(\theta+k\pi/n)$, $k=1,2,\dots,n$. Prove that $\frac{a_1+a_2+\cdots+a_n}{a_1a_2 \cdots a_n}$ is an integer, and determine its value.

Answer: (fun n : ℕ => if (n ≡ 1 [MOD 4]) then n else -n)

Lean 4 formalization:
Independent variables: t: ℕ
name: n
Hypotheses: t: ℝ
name: theta
t: Set.Icc 1 n → ℝ
name: a
t: Odd n
name: nodd
t: Irrational (theta / Real.pi)
name: thetairr
t: ∀ k : Set.Icc 1 n, a k = Real.tan (theta + (k * Real.pi) / n)
name: ha
Conclusions: ((∑ k : Set.Icc 1 n, a k) / (∏ k : Set.Icc 1 n, a k) = answer n)
Answer type: ℕ → ℤ
Formal answer: answer = fun (n : ℕ) => (if n ≡ (1 : ℕ) [MOD (4 : ℕ)] then (↑n : ℤ) else (-(↑n : ℤ) : ℤ) : ℤ)
Problem: Show that the curve $x^3 + 3xy + y^3 = 1$ contains only one set of three distinct points, $A$, $B$, and $C$, which are vertices of an equilateral triangle, and find its area.

Answer: 3 * Real.sqrt 3 / 2

Lean 4 formalization:
Hypotheses: t: Set (ℝ × ℝ)
name: curve
t: curve = {c | c.1 ^ 3 + 3 * c.1 * c.2 + c.2 ^ 3 = 1}
name: hcurve
t: Set (ℝ × ℝ) → Prop
name: equilateral
t: ∀ S, equilateral S ↔ S.encard = 3 ∧
  ∃ d : ℝ, ∀ P ∈ S, ∀ Q ∈ S, P ≠ Q →
    Real.sqrt ((P.1 - Q.1)^2 + (P.2 - Q.2)^2) = d
name: hequilateral
Conclusions: ((∃! S : Set (ℝ × ℝ), S ⊆ curve ∧ equilateral S) ∧ (∃ S : Set (ℝ × ℝ), S ⊆ curve ∧ equilateral S ∧ (MeasureTheory.volume (convexHull ℝ S)).toReal = answer))
Answer type: ℝ
Formal answer: answer = (((3 : ℝ) * (√(3 : ℝ) : ℝ) : ℝ) / (2 : ℝ) : ℝ)
Problem: Let $S$ be a finite set of points in the plane. A linear partition of $S$ is an unordered pair $\{A,B\}$ of subsets of $S$ such that $A \cup B=S$, $A \cap B=\emptyset$, and $A$ and $B$ lie on opposite sides of some straight line disjoint from $S$ ($A$ or $B$ may be empty). Let $L_S$ be the number of linear partitions of $S$. For each positive integer $n$, find the maximum of $L_S$ over all sets $S$ of $n$ points.

Answer: $\binom{n}{2} + 1$

Lean 4 formalization:
Independent variables: t: ℕ
name: n
Hypotheses: t: Finset (Fin 2 → ℝ) → Finset (Finset (Fin 2 → ℝ)) → Prop
name: IsLinearPartition
t: ∀ S AB, IsLinearPartition S AB ↔
      (AB.card = 2 ∧ ∃ A ∈ AB, ∃ B ∈ AB,
        A ≠ B ∧ (A ∪ B = S) ∧ (A ∩ B = ∅) ∧
        (∃ m b : ℝ,
          (∀ p ∈ A, p 1 > m * p 0 + b) ∧
          (∀ p ∈ B, p 1 < m * p 0 + b)))
name: IsLinearPartition_def
t: Finset (Fin 2 → ℝ) → ℕ
name: L
t: ∀ S, L S = {AB | IsLinearPartition S AB}.encard
name: hL
t: 0 < n
name: npos
Conclusions: (IsGreatest {L S | (S) (hS : S.card = n)} (answer n))
Answer type: ℕ → ℕ
Formal answer: answer = fun (n : ℕ) => ((n.choose (2 : ℕ) : ℕ) + (1 : ℕ) : ℕ)
Problem: Let $Z$ denote the set of points in $\mathbb{R}^n$ whose coordinates are $0$ or $1$. (Thus $Z$ has $2^n$ elements, which are the vertices of a unit hypercube in $\mathbb{R}^n$.) Given a vector subspace $V$ of $\mathbb{R}^n$, let $Z(V)$ denote the number of members of $Z$ that lie in $V$. Let $k$ be given, $0 \leq k \leq n$. Find the maximum, over all vector subspaces $V \subseteq \mathbb{R}^n$ of dimension $k$, of the number of points in $V \cap Z$.

Answer: $2^k$

Lean 4 formalization:
Independent variables: t: ℕ
name: k
Hypotheses: t: ℕ
name: n
t: n > 0
name: npos
t: k ≤ n
name: hk
t: Set (Fin n → ℝ)
name: Z
t: Z = {P : Fin n → ℝ | ∀ j : Fin n, P j = 0 ∨ P j = 1}
name: hZ
Conclusions: (IsGreatest
      {y | ∃ V : Subspace ℝ (Fin n → ℝ), Module.rank ℝ V = k ∧ (Z ∩ V).ncard = y}
      (answer k))
Answer type: ℕ → ℕ
Formal answer: answer = fun (k : ℕ) => ((2 : ℕ) ^ k : ℕ)
Problem: For each continuous function $f: [0,1] \to \mathbb{R}$, let $I(f) = \int_0^1 x^2 f(x)\,dx$ and $J(x) = \int_0^1 x \left(f(x)\right)^2\,dx$. Find the maximum value of $I(f) - J(f)$ over all such functions $f$.

Answer: $\frac{1}{16}$

Lean 4 formalization:
open Set
Hypotheses: t: (ℝ → ℝ) → ℝ
name: I
t: (ℝ → ℝ) → ℝ
name: J
t: I = fun f ↦ ∫ x in (0)..1, x ^ 2 * (f x)
name: hI
t: J = fun f ↦ ∫ x in (0)..1, x * (f x) ^ 2
name: hJ
Conclusions: (IsGreatest {y | ∃ f : ℝ → ℝ, ContinuousOn f (Icc 0 1) ∧ I f - J f = y} answer)
Answer type: ℝ
Formal answer: answer = (1 / 16 : ℝ)
Problem: Let $k$ be an integer greater than 1. Suppose $a_0 > 0$, and define \[ a_{n+1} = a_n + \frac{1}{\sqrt[k]{a_n}} \] for $n > 0$. Evaluate \[\lim_{n \to \infty} \frac{a_n^{k+1}}{n^k}.\]

Answer: fun k => ((k+1)/k)^k

Lean 4 formalization:
open Set Topology Filter
Independent variables: t: ℕ
name: k
Hypotheses: t: k > 1
name: hk
t: ℕ → ℝ
name: a
t: a 0 > 0
name: ha0
t: ∀ n : ℕ, a (n + 1) = a n + 1/((a n)^((1 : ℝ)/k))
name: ha
Conclusions: (Tendsto (fun n => (a n)^(k+1)/(n ^ k)) atTop (𝓝 (answer k)))
Answer type: ℕ → ℝ
Formal answer: answer = fun (k : ℕ) => ((((↑k : ℝ) + (1 : ℝ) : ℝ) / (↑k : ℝ) : ℝ) ^ k : ℝ)
Problem: Find all values of $\alpha$ for which the curves $y = \alpha*x^2 + \alpha*x + 1/24$ and $x = \alpha*y^2 + \alpha*y + 1/24$ are tangent to each other.

Answer: {2 / 3, 3 / 2, (13 + √601) / 12, (13 - √601) / 12}

Lean 4 formalization:
Hypotheses: t: ℝ
name: α
t: (ℝ → ℝ) → Prop
name: P
t: ∀ f, P f ↔ ∃ x y, f x = y ∧ f y = x ∧ deriv f x * deriv f y = 1
name: P_def
Conclusions: (P (fun t ↦ α * t ^ 2 + α * t + 1 / 24) ↔ α ∈ answer)
Answer type: Set ℝ
Formal answer: answer =
  (Insert.insert (2 / 3 : ℝ)
      (Insert.insert (3 / 2 : ℝ)
          (Insert.insert (((13 : ℝ) + (√(601 : ℝ) : ℝ) : ℝ) / (12 : ℝ) : ℝ)
              ({(((13 : ℝ) - (√(601 : ℝ) : ℝ) : ℝ) / (12 : ℝ) : ℝ)} : Set ℝ) :
            Set ℝ) :
        Set ℝ) :
    Set ℝ)
Problem: Find the least possible area of a convex set in the plane that intersects both branches of the hyperbola $xy=1$ and both branches of the hyperbola $xy=-1$. (A set $S$ in the plane is called \emph{convex} if for any two points in $S$ the line segment connecting them is contained in $S$.)

Answer: 4

Lean 4 formalization:
open MeasureTheory
Conclusions: (IsLeast
    {y | ∃ S : Set (Fin 2 → ℝ),
      Convex ℝ S ∧
      (∃ p ∈ S, p 0 > 0 ∧ p 1 > 0 ∧ p 0 * p 1 = 1) ∧
      (∃ p ∈ S, p 0 < 0 ∧ p 1 < 0 ∧ p 0 * p 1 = 1) ∧
      (∃ p ∈ S, p 0 < 0 ∧ p 1 > 0 ∧ p 0 * p 1 = -1) ∧
      (∃ p ∈ S, p 0 > 0 ∧ p 1 < 0 ∧ p 0 * p 1 = -1) ∧
    volume S = y} answer)
Answer type: ENNReal
Formal answer: answer = (4 : ENNReal)
Problem: Let $k$ be a positive integer. Suppose that the integers $1, 2, 3, \dots, 3k+1$ are written down in random order. What is the probability that at no time during this process, the sum of the integers that have been written up to that time is a positive integer divisible by $3$? Your answer should be in closed form, but may include factorials.

Answer: fun k ↦ (k)! * (k + 1)! / ((3 * k + 1) * (2 * k)!)

Lean 4 formalization:
open Set Nat
Independent variables: t: ℕ
name: k
Hypotheses: t: k > 0
name: kpos
t: Set (Fin (3 * k + 1) → ℤ)
name: perms
t: Set (Fin (3 * k + 1) → ℤ)
name: goodperms
t: goodperms = {f ∈ perms | ¬∃ j : Fin (3 * k + 1), 3 ∣ ∑ i : Fin (3 * k + 1), ite (i ≤ j) (f i) 0}
name: hgoodperms
t: perms = {f : Fin (3 * k + 1) → ℤ | ∀ y ∈ Icc 1 (3 * k + 1), ∃! x : Fin (3 * k + 1), f x = y}
name: hperms
Conclusions: (goodperms.ncard = perms.ncard * (answer k))
Answer type: ℕ → ℚ
Formal answer: answer = fun (k : ℕ) =>
  (((↑(k ! : ℕ) : ℚ) * (↑((k + (1 : ℕ) : ℕ)! : ℕ) : ℚ) : ℚ) /
      ((((3 : ℚ) * (↑k : ℚ) : ℚ) + (1 : ℚ) : ℚ) * (↑(((2 : ℕ) * k : ℕ)! : ℕ) : ℚ) : ℚ) :
    ℚ)
Problem: A \emph{repunit} is a positive integer whose digits in base 10 are all ones. Find all polynomials $f$ with real coefficients such that if $n$ is a repunit, then so is $f(n)$.

Answer: the set of polynomials of the form $f(n) = \frac{1}{9} \left(10^c (9n + 1)^d - 1\right)$ where $d \in \mathbb{N}$ and $c \geq 1 - d$

Lean 4 formalization:
open Set Nat
Hypotheses: t: Set (Polynomial ℝ)
name: S
t: ℝ → Prop
name: repunit
t: ∀ x, repunit x ↔ x > 0 ∧ x = floor x ∧ ∀ d ∈ (digits 10 (floor x)), d = 1
name: hrepunit
t: ∀ f, f ∈ S ↔ (∀ n : ℝ, repunit n → repunit (f.eval n))
name: hS
Conclusions: (S = answer)
Answer type: Set (Polynomial ℝ)
Formal answer: answer =
  ({f : Polynomial ℝ |
      ∃ (d : ℕ),
        ∃ c ≥ ((1 : ℤ) - (↑d : ℤ) : ℤ),
          ∀ (n : ℝ),
            (Polynomial.eval n f : ℝ) =
              ((1 / 9 : ℝ) * ((((10 : ℝ) ^ c : ℝ) * ((((9 : ℝ) * n : ℝ) + (1 : ℝ) : ℝ) ^ d : ℝ) : ℝ) - (1 : ℝ) : ℝ) :
                ℝ)} :
    Set (Polynomial ℝ))
Problem: Let $x_0 = 1$ and for $n \geq 0$, let $x_{n+1} = 3x_n + \lfloor x_n \sqrt{5} \rfloor$. In particular, $x_1 = 5$, $x_2 = 26$, $x_3 = 136$, $x_4 = 712$. Find a closed-form expression for $x_{2007}$. ($\lfloor a \rfloor$ means the largest integer $\leq a$.)

Answer: $\frac{2^{2006}}{\sqrt{5}} \left( \left( \frac{1 + \sqrt{5}}{2} \right)^{3997} - \left( \frac{1 + \sqrt{5}}{2} \right)^{-3997} \right)$

Lean 4 formalization:
open Set Nat Function
Hypotheses: t: ℕ → ℝ
name: x
t: x 0 = 1
name: hx0
t: ∀ n : ℕ, x (n + 1) = 3 * (x n) + ⌊(x n) * Real.sqrt 5⌋
name: hx
Conclusions: (x 2007 = answer)
Answer type: ℝ
Formal answer: answer =
  ((((2 : ℝ) ^ (2006 : ℕ) : ℝ) / (√(5 : ℝ) : ℝ) : ℝ) *
      (((((1 : ℝ) + (√(5 : ℝ) : ℝ) : ℝ) / (2 : ℝ) : ℝ) ^ (3997 : ℕ) : ℝ) -
          ((((1 : ℝ) + (√(5 : ℝ) : ℝ) : ℝ) / (2 : ℝ) : ℝ) ^ (-3997 : ℤ) : ℝ) :
        ℝ) :
    ℝ)
Problem: Let $n$ be a positive integer. Find the number of pairs $P, Q$ of polynomials with real coefficients such that
\[
(P(X))^2 + (Q(X))^2 = X^{2n} + 1
\]
and $\deg P > \deg Q$.

Answer: fun n ↦ 2 ^ (n + 1)

Lean 4 formalization:
open Set Nat Function
Independent variables: t: ℕ
name: n
Hypotheses: t: n > 0
name: npos
Conclusions: ({a : (Polynomial ℝ) × (Polynomial ℝ) | a.1 ^ 2 + a.2 ^ 2 = Polynomial.X ^ (2 * n) + 1 ∧ a.1.degree > a.2.degree}.ncard = answer n)
Answer type: ℕ → ℕ
Formal answer: answer = fun (n : ℕ) => ((2 : ℕ) ^ (n + (1 : ℕ) : ℕ) : ℕ)
Problem: Define $f : \mathbb{R} \to \mathbb{R} by $f(x) = x$ if $x \leq e$ and $f(x) = x * f(\ln(x))$ if $x > e$. Does $\sum_{n=1}^{\infty} 1/(f(n))$ converge?

Answer: False

Lean 4 formalization:
open Filter Topology
Hypotheses: t: ℝ → ℝ
name: f
t: f = fun x => if x ≤ Real.exp 1 then x else x * (f (Real.log x))
name: hf
Conclusions: ((∃ r : ℝ, Tendsto (fun N : ℕ => ∑ n in Finset.range N, 1/(f (n + 1))) atTop (𝓝 r)) ↔ answer)
Answer type: Prop
Formal answer: answer = False
Problem: What is the maximum number of rational points that can lie on a circle in $\mathbb{R}^2$ whose center is not a rational point? (A \emph{rational point} is a point both of whose coordinates are rational numbers.)

Answer: 2

Lean 4 formalization:
open Filter Topology Set
Hypotheses: t: EuclideanSpace ℝ (Fin 2) → Prop
name: is_rational_point
t: ∀ p : EuclideanSpace ℝ (Fin 2), is_rational_point p ↔ ∃ (a b : ℚ), a = p 0 ∧ b = p 1
name: h_rational_point
t: EuclideanSpace ℝ (Fin 2) → ℝ → Set (EuclideanSpace ℝ (Fin 2))
name: real_circle
t: ∀ (c : EuclideanSpace ℝ (Fin 2)) (r : ℝ), real_circle c r = {p | dist p c = r}
name: h_real_circle
Conclusions: (IsGreatest {n : ℕ | ∃ (c : EuclideanSpace ℝ (Fin 2)) (r : ℝ), ¬ is_rational_point c ∧ (Set.ncard {p : EuclideanSpace ℝ (Fin 2) | p ∈ real_circle c r ∧ is_rational_point p} = n)} answer)
Answer type: ℕ
Formal answer: answer = (2 : ℕ)
Problem: Let $F_0(x)=\ln x$. For $n \geq 0$ and $x>0$, let $F_{n+1}(x)=\int_0^x F_n(t)\,dt$. Evaluate $\lim_{n \to \infty} \frac{n!F_n(1)}{\ln n}$.

Answer: -1

Lean 4 formalization:
open Filter Topology Set Nat
Hypotheses: t: ℕ → ℝ → ℝ
name: F
t: ∀ x : ℝ, F 0 x = Real.log x
name: hF0
t: ∀ n : ℕ, ∀ x > 0, F (n + 1) x = ∫ t in Set.Ioo 0 x, F n t
name: hFn
Conclusions: (Tendsto (fun n : ℕ => ((n)! * F n 1) / Real.log n) atTop (𝓝 answer))
Answer type: ℝ
Formal answer: answer = (-1 : ℝ)
Problem: What is the largest possible radius of a circle contained in a $4$-dimensional hypercube of side length $1$?

Answer: √2 / 2

Lean 4 formalization:
open Metric Filter Topology Set Nat
Hypotheses: t: Set (EuclideanSpace ℝ (Fin 4))
name: H
t: H = {P : Fin 4 → ℝ | ∀ i : Fin 4, |P i| ≤ 1 / 2}
name: H_def
t: ℝ → Prop
name: contains
t: ∀ r, contains r ↔
      ∃ᵉ (A : AffineSubspace ℝ (EuclideanSpace ℝ (Fin 4))) (C ∈ A),
        Module.finrank ℝ A.direction = 2 ∧
        sphere C r ∩ A ⊆ H
name: contains_def
Conclusions: (IsGreatest contains answer)
Answer type: ℝ
Formal answer: answer = ((√(2 : ℝ) : ℝ) / (2 : ℝ) : ℝ)
Problem: Find all continuously differentiable functions f : \mathbb{R} \to \mathbb{R} such that for every rational number $q$, the number $f(q)$ is rational and has the same denominator as $q$.

Answer: {fun (x : ℝ) => x + n | n : ℤ} ∪ {fun (x : ℝ) => -x + n | n : ℤ}

Lean 4 formalization:
open Filter Topology Set Nat
Hypotheses: t: (ℝ → ℝ) → ℚ → Prop
name: fqsat
t: ∀ f q, fqsat f q ↔ ContDiff ℝ 1 f ∧ (∃ p : ℚ, p = f q ∧ p.den = q.den)
name: hfqsat
Conclusions: (∀ f : (ℝ → ℝ), (∀ q : ℚ, fqsat f q) ↔ f ∈ answer)
Answer type: Set (ℝ → ℝ)
Formal answer: answer =
  (({x : ℝ → ℝ | ∃ (n : ℤ), (fun (x : ℝ) => (x + (↑n : ℝ) : ℝ)) = x} : Set (ℝ → ℝ)) ∪
      ({x : ℝ → ℝ | ∃ (n : ℤ), (fun (x : ℝ) => ((-x : ℝ) + (↑n : ℝ) : ℝ)) = x} : Set (ℝ → ℝ)) :
    Set (ℝ → ℝ))
Problem: Let $f$ be a real-valued function on the plane such that for every square $ABCD$ in the plane, $f(A)+f(B)+f(C)+f(D)=0$. Does it follow that $f(P)=0$ for all points $P$ in the plane?

Answer: True

Lean 4 formalization:
open Topology MvPolynomial Filter
Hypotheses: t: ℝ × ℝ → ℝ
name: f
t: ∀ O v : ℝ × ℝ, v ≠ (0, 0) → f (O.1, O.2) + f (O.1 + v.1, O.2 + v.2) + f (O.1 + v.1 - v.2, O.2 + v.2 + v.1) + f (O.1 - v.2, O.2 + v.1) = 0
name: h_square
Conclusions: ((∀ P : ℝ × ℝ, f P = 0) ↔ answer)
Answer type: Prop
Formal answer: answer = True
Problem: Functions $f,g,h$ are differentiable on some open interval around $0$
and satisfy the equations and initial conditions
\begin{gather*}
f' = 2f^2gh+\frac{1}{gh},\quad f(0)=1, \\
g'=fg^2h+\frac{4}{fh}, \quad g(0)=1, \\
h'=3fgh^2+\frac{1}{fg}, \quad h(0)=1.
\end{gather*}
Find an explicit formula for $f(x)$, valid in some open interval around $0$.

Answer: $2^{-1/12} \left(\frac{\sin(6x+\pi/4)}{\cos^2(6x+\pi/4)}\right)^{1/6}$

Lean 4 formalization:
open Topology MvPolynomial Filter Set
Hypotheses: t: ℝ → ℝ
name: f
t: ℝ → ℝ
name: g
t: ℝ → ℝ
name: h
t: ℝ
name: a
t: ℝ
name: b
t: 0 ∈ Ioo a b
name: hab
t: DifferentiableOn ℝ f (Ioo a b) ∧ DifferentiableOn ℝ g (Ioo a b) ∧ DifferentiableOn ℝ h (Ioo a b)
name: hdiff
t: (∀ x ∈ Ioo a b, deriv f x = 2 * (f x)^2 * (g x) * (h x) + 1 / ((g x) * (h x))) ∧ f 0 = 1
name: hf
t: (∀ x ∈ Ioo a b, deriv g x = (f x) * (g x)^2 * (h x) + 4 / ((f x) * (h x))) ∧ g 0 = 1
name: hg
t: (∀ x ∈ Ioo a b, deriv h x = 3 * (f x) * (g x) * (h x)^2 + 1 / ((f x) * (g x))) ∧ h 0 = 1
name: hh
Conclusions: (∃ c d : ℝ, 0 ∈ Ioo c d ∧ ∀ x ∈ Ioo c d, f x = answer x)
Answer type: ℝ → ℝ
Formal answer: answer = fun (x : ℝ) =>
  (((2 : ℝ) ^ (-1 / 12 : ℝ) : ℝ) *
      (((Real.sin (((6 : ℝ) * x : ℝ) + ((Real.pi : ℝ) / (4 : ℝ) : ℝ) : ℝ) : ℝ) /
              ((Real.cos (((6 : ℝ) * x : ℝ) + ((Real.pi : ℝ) / (4 : ℝ) : ℝ) : ℝ) : ℝ) ^ (2 : ℕ) : ℝ) :
            ℝ) ^
          (1 / 6 : ℝ) :
        ℝ) :
    ℝ)
Problem: Let $d_n$ be the determinant of the $n \times n$ matrix whose entries, from left to right and then from top to bottom, are $\cos 1, \cos 2, \dots, \cos n^2$. (For example,\[ d_3 = \left|\begin{matrix} \cos 1 & \cos 2 & \cos 3 \\ \cos 4 & \cos 5 & \cos 6 \\  \cos 7 & \cos 8 & \cos 9 \end{matrix} \right|. \]The argument of $\cos$ is always in radians, not degrees.) Evaluate $\lim_{n\to\infty} d_n$.

Answer: 0

Lean 4 formalization:
open Topology MvPolynomial Filter Set
Hypotheses: t: (n : ℕ) → Matrix (Fin n) (Fin n) ℝ
name: cos_matrix
t: ∀ n : ℕ, ∀ i j : Fin n, (cos_matrix n) i j = Real.cos (1 + n * i + j)
name: hM
Conclusions: (Tendsto (fun n => (cos_matrix n).det) atTop (𝓝 answer))
Answer type: ℝ
Formal answer: answer = (0 : ℝ)
Problem: Let $S$ be a set of rational numbers such that
\begin{enumerate}
\item[(a)] $0 \in S$;
\item[(b)] If $x \in S$ then $x+1\in S$ and $x-1\in S$; and
\item[(c)] If $x\in S$ and $x\not\in\{0,1\}$, then $\frac{1}{x(x-1)}\in S$.
\end{enumerate}
Must $S$ contain all rational numbers?

Answer: False

Lean 4 formalization:
open Topology MvPolynomial Filter Set
Hypotheses: t: Set ℚ
name: S
t: 0 ∈ S
name: h0
t: ∀ x ∈ S, x + 1 ∈ S ∧ x - 1 ∈ S
name: h1
t: ∀ x ∈ S, x ∉ ({0, 1} : Set ℚ) → 1 / (x * (x - 1)) ∈ S
name: h2
Conclusions: ((∀ r : ℚ, r ∈ S) ↔ answer)
Answer type: Prop
Formal answer: answer = False
Problem: Is there a finite abelian group $G$ such that the product of the orders of all its elements is 2^{2009}?

Answer: False

Lean 4 formalization:
open Topology MvPolynomial Filter Set
Conclusions: (answer ↔ (∃ (G : Type*) (_ : CommGroup G) (_ : Fintype G), ∏ g : G, orderOf g = 2^2009))
Answer type: Prop
Formal answer: answer = False
Problem: A game involves jumping to the right on the real number line. If $a$ and $b$ are real numbers and $b > a$, the cost of jumping from $a$ to $b$ is $b^3-ab^2$. For what real numbers $c$ can one travel from $0$ to $1$ in a finite number of jumps with total cost exactly $c$?

Answer: the interval (1/3, 1]

Lean 4 formalization:
open Topology MvPolynomial Filter Set
Conclusions: ({c : ℝ | ∃ s : ℕ → ℝ, s 0 = 0 ∧ StrictMono s ∧ (∃ n : ℕ, s n = 1 ∧ ((∑ i in Finset.range n, ((s (i + 1)) ^ 3 - (s i) * (s (i + 1)) ^ 2)) = c))} = answer)
Answer type: Set ℝ
Formal answer: answer = (Set.Ioc (1 / 3 : ℝ) (1 : ℝ) : Set ℝ)
Problem: Call a subset $S$ of $\{1, 2, \dots, n\}$ \emph{mediocre} if it has the following property: Whenever $a$ and $b$ are elements of $S$ whose average is an integer, that average is also an element of $S$. Let $A(n)$ be the number of mediocre subsets of $\{1,2,\dots,n\}$. [For instance, every subset of $\{1,2,3\}$ except $\{1,3\}$ is mediocre, so $A(3) = 7$.] Find all positive integers $n$ such that $A(n+2) - 2A(n+1) + A(n) = 1$.

Answer: {n : ℤ | ∃ k ≥ 1, n = 2 ^ k - 1}

Lean 4 formalization:
open Topology MvPolynomial Filter Set
Hypotheses: t: ℤ → Set ℤ → Prop
name: mediocre
t: ∀ n S, mediocre n S ↔ (S ⊆ Icc 1 n) ∧ ∀ a ∈ S, ∀ b ∈ S, 2 ∣ a + b → (a + b) / 2 ∈ S
name: hmediocre
t: ℤ → ℤ
name: A
t: A = fun n ↦ ({S : Set ℤ | mediocre n S}.ncard : ℤ)
name: hA
Conclusions: ({n : ℤ | n > 0 ∧ A (n + 2) - 2 * A (n + 1) + A n = 1} = answer)
Answer type: Set ℤ
Formal answer: answer = ({n : ℤ | ∃ k ≥ (1 : ℕ), n = (((2 : ℤ) ^ k : ℤ) - (1 : ℤ) : ℤ)} : Set ℤ)
Problem: Say that a polynomial with real coefficients in two variables, $x,y$, is \emph{balanced} if the average value of the polynomial on each circle centered at the origin is $0$. The balanced polynomials of degree at most $2009$ form a vector space $V$ over $\mathbb{R}$. Find the dimension of $V$.

Answer: 2020050

Lean 4 formalization:
open intervalIntegral MvPolynomial Real
Hypotheses: t: MvPolynomial (Fin 2) ℝ → Prop
name: IsBalanced
t: ∀ P, IsBalanced P ↔ ∀ r > 0,
      (∫ t in (0 : ℝ)..(2 * π), eval ![r * cos t, r * sin t] P) / (2 * π * r) = 0
name: IsBalanced_def
t: Submodule ℝ (MvPolynomial (Fin 2) ℝ)
name: V
t: ∀ P, P ∈ V ↔ IsBalanced P ∧ P.totalDegree ≤ 2009
name: V_def
Conclusions: (Module.rank ℝ V = answer)
Answer type: ℕ
Formal answer: answer = (2020050 : ℕ)
Problem: Given a positive integer $n$, what is the largest $k$ such that the numbers $1,2,\dots,n$ can be put into $k$ boxes so that the sum of the numbers in each box is the same? [When $n=8$, the example $\{1,2,3,6\},\{4,8\},\{5,7\}$ shows that the largest $k$ is \emph{at least} $3$.]

Answer: the ceiling of n/2

Lean 4 formalization:
Independent variables: t: ℕ
name: n
Hypotheses: t: ℕ → Prop
name: kboxes
t: n > 0
name: npos
t: ∀ k : ℕ, kboxes k =
  (∃ boxes : Finset.Icc 1 n → Fin k, ∀ i j : Fin k,
    ∑ x in Finset.univ.filter (boxes · = i), (x : ℕ) =
    ∑ x in Finset.univ.filter (boxes · = j), (x : ℕ))
name: hkboxes
Conclusions: (IsGreatest kboxes (answer n))
Answer type: ℕ → ℕ
Formal answer: answer = fun (n : ℕ) => (⌈((↑n : ℝ) / (2 : ℝ) : ℝ)⌉₊ : ℕ)
Problem: Find all differentiable functions $f:\mathbb{R} \to \mathbb{R}$ such that
\[
f'(x) = \frac{f(x+n)-f(x)}{n}
\]
for all real numbers $x$ and all positive integers $n$.

Answer: {f : ℝ → ℝ | ∃ c d : ℝ, ∀ x : ℝ, f x = c*x + d}

Lean 4 formalization:
Conclusions: ({f : ℝ → ℝ | Differentiable ℝ f ∧
∀ x : ℝ, ∀ n : ℤ, n > 0 → deriv f x = (f (x + n) - f x)/n} = answer)
Answer type: Set (ℝ → ℝ)
Formal answer: answer = ({f : ℝ → ℝ | ∃ (c : ℝ) (d : ℝ), ∀ (x : ℝ), (f x : ℝ) = ((c * x : ℝ) + d : ℝ)} : Set (ℝ → ℝ))
Problem: Is there an infinite sequence of real numbers $a_1, a_2, a_3, \dots$ such that \[ a_1^m + a_2^m + a_3^m + \cdots = m \] for every positive integer $m$?

Answer: False

Lean 4 formalization:
open Filter Topology Set
Conclusions: (answer ↔ (∃ a : ℕ → ℝ, ∀ m : ℕ, m > 0 → ∑' i : ℕ, (a i)^m = m))
Answer type: Prop
Formal answer: answer = False
Problem: Given that $A$, $B$, and $C$ are noncollinear points in the plane with integer coordinates such that the distances $AB$, $AC$, and $BC$ are integers, what is the smallest possible value of $AB$?

Answer: 3

Lean 4 formalization:
open Filter Topology Set
Hypotheses: t: EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2) → Prop
name: ABCintcoords
t: EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2) → Prop
name: ABCintdists
t: EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2) → Prop
name: ABCall
t: ∀ A B C, ABCintcoords A B C ↔ (∀ i : Fin 2, A i = round (A i) ∧ B i = round (B i) ∧ C i = round (C i))
name: hABCintcoords
t: ∀ A B C, ABCintdists A B C ↔ (dist A B = round (dist A B) ∧ dist A C = round (dist A C) ∧ dist B C = round (dist B C))
name: hABCintdists
t: ∀ A B C, ABCall A B C ↔ (¬Collinear ℝ {A, B, C} ∧ ABCintcoords A B C ∧ ABCintdists A B C)
name: hABCall
Conclusions: (IsLeast {y | ∃ A B C, ABCall A B C ∧ y = dist A B} answer)
Answer type: ℕ
Formal answer: answer = (3 : ℕ)
Problem: There are $2010$ boxes labeled $B_1, B_2, \dots, B_{2010}$, and $2010n$ balls have been distributed among them, for some positive integer $n$. You may redistribute the balls by a sequence of moves, each of which consists of choosing an $i$ and moving \emph{exactly} $i$ balls from box $B_i$ into any one other box. For which values of $n$ is it possible to reach the distribution with exactly $n$ balls in each box, regardless of the initial distribution of balls?

Answer: {1005}

Lean 4 formalization:
open Filter Topology Set
Hypotheses: t: ℕ
name: n
t: n > 0
name: hn
t: (ℕ → Fin 2010 → ℕ) → ℕ → Prop
name: trans
t: ∀ P T, trans P T ↔ ∀ t : ℕ, t < T → ∃ i j,
            i ≠ j ∧
            P t i ≥ i.1 + 1 ∧ P (t + 1) i = P t i - (i.1 + 1) ∧ P (t + 1) j = P t j + (i.1 + 1) ∧
            ∀ k : Fin 2010, k ≠ i → k ≠ j → P (t + 1) k = P t k
name: htrans
Conclusions: ((∀ B, ∑ i, B i = 2010 * n → ∃ᵉ (P) (T), P 0 = B ∧ trans P T ∧ ∀ i, P T i = n) ↔ n ∈ answer)
Answer type: Set ℕ
Formal answer: answer = ({(1005 : ℕ)} : Set ℕ)