purewhite42/putnambench_solving huggingface dataset:
Problem: Let $\mathbf{S} = \{(a,b) | a = 1, 2, \dots,n, b = 1,2,3\}$.
A \emph{rook tour} of $\mathbf{S}$ is a polygonal path made up of line segments connecting points $p_1, p_2, \dots, p_{3n}$ in sequence such that
\begin{enumerate}
\item[(i)] $p_i \in \mathbf{S}$,
\item[(ii)] $p_i$ and $p_{i+1}$ are a unit distance apart, for
$1 \leq i <3n$,
\item[(iii)] for each $p \in \mathbf{S}$ there is a unique $i$ such that
$p_i = p$.
\end{enumerate}
How many rook tours are there that begin at $(1,1)$
and end at $(n,1)$?

Answer: fun n ↦ if n = 1 then 0 else 2 ^ (n - 2)

Lean 4 formalization:
open Nat Set
Independent variables:
t: ℕ
name: n
Hypotheses:
t: n > 0
name: npos
t: Set (ℤ × ℤ)
name: S
t: ℤ × ℤ → ℤ × ℤ → Prop
name: unit
t: (ℕ → ℤ × ℤ) → Prop
name: rooktour
t: S = prod (Icc 1 (n : ℤ)) (Icc 1 3)
name: hS
t: unit = fun (a, b) (c, d) ↦ a = c ∧ |d - b| = 1 ∨ b = d ∧ |c - a| = 1
name: hunit
t: rooktour = fun p ↦ (∀ P ∈ S, ∃! i, i ∈ Icc 1 (3 * n) ∧ p i = P) ∧ (∀ i ∈ Icc 1 (3 * n - 1), unit (p i) (p (i + 1))) ∧ p 0 = 0 ∧ ∀ i > 3 * n, p i = 0
name: hrooktour
Conclusion:
({p : ℕ → ℤ × ℤ | rooktour p ∧ p 1 = (1, 1) ∧ p (3 * n) = ((n : ℤ), 1)}.encard = answer n)
Formal answer (type: ℕ → ℕ):
answer = fun (n : ℕ) => (if n = (1 : ℕ) then (0 : ℕ) else ((2 : ℕ) ^ (n - (2 : ℕ) : ℕ) : ℕ) : ℕ)
Problem: Evaluate $\int_0^1 \frac{\ln(x+1)}{x^2+1}\,dx$.

Answer: $\frac{\pi \ln 2}{8}$

Lean 4 formalization:
open Nat Set
Independent variables:
Hypotheses:
Conclusion:
(∫ x in (0:ℝ)..1, (Real.log (x+1))/(x^2 + 1) = answer)
Formal answer (type: ℝ):
answer = (((Real.pi : ℝ) * (Real.log (2 : ℝ) : ℝ) : ℝ) / (8 : ℝ) : ℝ)
Problem: Find a nonzero polynomial $P(x,y)$ such that $P(\lfloor a \rfloor,\lfloor 2a \rfloor)=0$ for all real numbers $a$. (Note: $\lfloor \nu \rfloor$ is the greatest integer less than or equal to $\nu$.)

Answer: (y - 2x)(y - 2x - 1)

Lean 4 formalization:
open Nat Set
Independent variables:
Hypotheses:
Conclusion:
(answer ≠ 0)
(∀ a : ℝ, MvPolynomial.eval (fun n : Fin 2 => if (n = 0) then (Int.floor a : ℝ) else (Int.floor (2 * a))) answer = 0)
Formal answer (type: MvPolynomial (Fin 2) ℝ):
answer =
  (((MvPolynomial.X (1 : Fin (2 : ℕ)) : MvPolynomial (Fin (2 : ℕ)) ℝ) -
          ((2 : MvPolynomial (Fin (2 : ℕ)) ℝ) * (MvPolynomial.X (0 : Fin (2 : ℕ)) : MvPolynomial (Fin (2 : ℕ)) ℝ) :
            MvPolynomial (Fin (2 : ℕ)) ℝ) :
        MvPolynomial (Fin (2 : ℕ)) ℝ) *
      (((MvPolynomial.X (1 : Fin (2 : ℕ)) : MvPolynomial (Fin (2 : ℕ)) ℝ) -
              ((2 : MvPolynomial (Fin (2 : ℕ)) ℝ) * (MvPolynomial.X (0 : Fin (2 : ℕ)) : MvPolynomial (Fin (2 : ℕ)) ℝ) :
                MvPolynomial (Fin (2 : ℕ)) ℝ) :
            MvPolynomial (Fin (2 : ℕ)) ℝ) -
          (1 : MvPolynomial (Fin (2 : ℕ)) ℝ) :
        MvPolynomial (Fin (2 : ℕ)) ℝ) :
    MvPolynomial (Fin (2 : ℕ)) ℝ)
Problem: Find all positive integers $n,k_1,\dots,k_n$ such that $k_1+\cdots+k_n=5n-4$ and $\frac{1}{k_1}+\cdots+\frac{1}{k_n}=1$.

Answer: {(n, k) : ℕ × (ℕ → ℤ) | (n = 1 ∧ k 0 = 1) ∨ (n = 3 ∧ (k '' {0, 1, 2} = {2, 3, 6})) ∨ (n = 4 ∧ (∀ i : Fin 4, k i = 4))}

Lean 4 formalization:
open Nat Set
Independent variables:
Hypotheses:
Conclusion:
({((n : ℕ), (k : ℕ → ℤ)) | (n > 0) ∧ (∀ i ∈ Finset.range n, k i > 0) ∧ (∑ i in Finset.range n, k i = 5 * n - 4) ∧ (∑ i : Finset.range n, (1 : ℝ) / (k i) = 1)} = answer)
Formal answer (type: Set (ℕ × (ℕ → ℤ))):
answer =
  ({((n, k) : ℕ × (ℕ → ℤ)) : ℕ × (ℕ → ℤ) |
      n = (1 : ℕ) ∧ (k (0 : ℕ) : ℤ) = (1 : ℤ) ∨
        n = (3 : ℕ) ∧
            (k '' (Insert.insert (0 : ℕ) (Insert.insert (1 : ℕ) ({(2 : ℕ)} : Set ℕ) : Set ℕ) : Set ℕ) : Set ℤ) =
              (Insert.insert (2 : ℤ) (Insert.insert (3 : ℤ) ({(6 : ℤ)} : Set ℤ) : Set ℤ) : Set ℤ) ∨
          n = (4 : ℕ) ∧ ∀ (i : Fin (4 : ℕ)), (k (↑i : ℕ) : ℤ) = (4 : ℤ)} :
    Set (ℕ × (ℕ → ℤ)))
Problem: Find all differentiable functions $f:(0,\infty) \to (0,\infty)$ for which there is a positive real number $a$ such that $f'(\frac{a}{x})=\frac{x}{f(x)}$ for all $x>0$.

Answer: the set of functions $f$ such that $f(x) = c x^d$ for some $c > 0$ and $d > 0$, with $d = 1$ implying $c = 1$

Lean 4 formalization:
open Nat Set
Independent variables:
t: ℝ → ℝ
name: f
Hypotheses:
t: ∀ x > 0, 0 < f x
name: hf
t: DifferentiableOn ℝ f (Ioi 0)
name: hf'
Conclusion:
((∃ a > 0, ∀ x > 0, deriv f (a / x) = x / f x) ↔ f ∈ answer)
Formal answer (type: Set (ℝ → ℝ)):
answer =
  ({f : ℝ → ℝ |
      ∃ c > (0 : ℝ),
        ∃ d > (0 : ℝ),
          (d = (1 : ℝ) → c = (1 : ℝ)) ∧ Set.EqOn f (fun (x : ℝ) => (c * (x ^ d : ℝ) : ℝ)) (Set.Ioi (0 : ℝ) : Set ℝ)} :
    Set (ℝ → ℝ))
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
Independent variables:
Hypotheses:
Conclusion:
((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)
Formal answer (type: ℝ):
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
Conclusion:
((∑ p : Equiv.Perm (Fin n), pcount p) / {p : Equiv.Perm (Fin n) | true}.ncard = answer n)
Formal answer (type: ℕ → ℝ):
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
Conclusion:
((∑ k : Set.Icc 1 n, a k) / (∏ k : Set.Icc 1 n, a k) = answer n)
Formal answer (type: ℕ → ℤ):
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:
Independent variables:
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
Conclusion:
((∃! S : Set (ℝ × ℝ), S ⊆ curve ∧ equilateral S) ∧ (∃ S : Set (ℝ × ℝ), S ⊆ curve ∧ equilateral S ∧ (MeasureTheory.volume (convexHull ℝ S)).toReal = answer))
Formal answer (type: ℝ):
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
Conclusion:
(IsGreatest {L S | (S) (hS : S.card = n)} (answer n))
Formal answer (type: ℕ → ℕ):
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
Conclusion:
(IsGreatest
      {y | ∃ V : Subspace ℝ (Fin n → ℝ), Module.rank ℝ V = k ∧ (Z ∩ V).ncard = y}
      (answer k))
Formal answer (type: ℕ → ℕ):
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
Independent variables:
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
Conclusion:
(IsGreatest {y | ∃ f : ℝ → ℝ, ContinuousOn f (Icc 0 1) ∧ I f - J f = y} answer)
Formal answer (type: ℝ):
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
Conclusion:
(Tendsto (fun n => (a n)^(k+1)/(n ^ k)) atTop (𝓝 (answer k)))
Formal answer (type: ℕ → ℝ):
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:
Independent variables:
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
Conclusion:
(P (fun t ↦ α * t ^ 2 + α * t + 1 / 24) ↔ α ∈ answer)
Formal answer (type: Set ℝ):
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
Independent variables:
Hypotheses:
Conclusion:
(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)
Formal answer (type: ENNReal):
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
Conclusion:
(goodperms.ncard = perms.ncard * (answer k))
Formal answer (type: ℕ → ℚ):
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
Independent variables:
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
Conclusion:
(S = answer)
Formal answer (type: Set (Polynomial ℝ)):
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
Independent variables:
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
Conclusion:
(x 2007 = answer)
Formal answer (type: ℝ):
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
Conclusion:
({a : (Polynomial ℝ) × (Polynomial ℝ) | a.1 ^ 2 + a.2 ^ 2 = Polynomial.X ^ (2 * n) + 1 ∧ a.1.degree > a.2.degree}.ncard = answer n)
Formal answer (type: ℕ → ℕ):
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
Independent variables:
Hypotheses:
t: ℝ → ℝ
name: f
t: f = fun x => if x ≤ Real.exp 1 then x else x * (f (Real.log x))
name: hf
Conclusion:
((∃ r : ℝ, Tendsto (fun N : ℕ => ∑ n in Finset.range N, 1/(f (n + 1))) atTop (𝓝 r)) ↔ answer)
Formal answer (type: Prop):
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
Independent variables:
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
Conclusion:
(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)
Formal answer (type: ℕ):
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
Independent variables:
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
Conclusion:
(Tendsto (fun n : ℕ => ((n)! * F n 1) / Real.log n) atTop (𝓝 answer))
Formal answer (type: ℝ):
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
Independent variables:
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
Conclusion:
(IsGreatest contains answer)
Formal answer (type: ℝ):
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
Independent variables:
Hypotheses:
t: (ℝ → ℝ) → ℚ → Prop
name: fqsat
t: ∀ f q, fqsat f q ↔ ContDiff ℝ 1 f ∧ (∃ p : ℚ, p = f q ∧ p.den = q.den)
name: hfqsat
Conclusion:
(∀ f : (ℝ → ℝ), (∀ q : ℚ, fqsat f q) ↔ f ∈ answer)
Formal answer (type: Set (ℝ → ℝ)):
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
Independent variables:
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
Conclusion:
((∀ P : ℝ × ℝ, f P = 0) ↔ answer)
Formal answer (type: Prop):
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
Independent variables:
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
Conclusion:
(∃ c d : ℝ, 0 ∈ Ioo c d ∧ ∀ x ∈ Ioo c d, f x = answer x)
Formal answer (type: ℝ → ℝ):
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
Independent variables:
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
Conclusion:
(Tendsto (fun n => (cos_matrix n).det) atTop (𝓝 answer))
Formal answer (type: ℝ):
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
Independent variables:
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
Conclusion:
((∀ r : ℚ, r ∈ S) ↔ answer)
Formal answer (type: Prop):
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
Independent variables:
Hypotheses:
Conclusion:
(answer ↔ (∃ (G : Type*) (_ : CommGroup G) (_ : Fintype G), ∏ g : G, orderOf g = 2^2009))
Formal answer (type: Prop):
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
Independent variables:
Hypotheses:
Conclusion:
({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)
Formal answer (type: Set ℝ):
answer = (Set.Ioc (1 / 3 : ℝ) (1 : ℝ) : Set ℝ)