purewhite42/putnambench_solving huggingface dataset:
Problem: Let $C_1$ and $C_2$ be circles whose centers are $10$ units apart, and whose radii are $1$ and $3$. Find, with proof, the locus of all points $M$ for which there exist points $X$ on $C_1$ and $Y$ on $C_2$ such that $M$ is the midpoint of the line segment $XY$.

Answer: the set of points $p$ such that the distance from $p$ to the midpoint of $O_1$ and $O_2$ is between 1 and 2

Lean 4 formalization:
open Metric
Independent variables:
t: EuclideanSpace ℝ (Fin 2)
name: O1
t: EuclideanSpace ℝ (Fin 2)
name: O2
Hypotheses:
t: Set (EuclideanSpace ℝ (Fin 2))
name: C1
t: Set (EuclideanSpace ℝ (Fin 2))
name: C2
t: C1 = Metric.sphere O1 1
name: hC1
t: C2 = Metric.sphere O2 3
name: hC2
t: dist O1 O2 = 10
name: hO1O2
Conclusion:
({M : EuclideanSpace ℝ (Fin 2) | ∃ X Y, X ∈ C1 ∧ Y ∈ C2 ∧ M = midpoint ℝ X Y} = answer O1 O2)
Formal answer (type: (EuclideanSpace ℝ (Fin 2)) → (EuclideanSpace ℝ (Fin 2)) → Set (EuclideanSpace ℝ (Fin 2))):
answer = fun (O1 O2 : EuclideanSpace ℝ (Fin (2 : ℕ))) =>
  ({p : EuclideanSpace ℝ (Fin (2 : ℕ)) |
      (Dist.dist p (midpoint ℝ O1 O2 : EuclideanSpace ℝ (Fin (2 : ℕ))) : ℝ) ≥ (1 : ℝ) ∧
        (Dist.dist p (midpoint ℝ O1 O2 : EuclideanSpace ℝ (Fin (2 : ℕ))) : ℝ) ≤ (2 : ℝ)} :
    Set (EuclideanSpace ℝ (Fin (2 : ℕ))))
Problem: Suppose that each of 20 students has made a choice of anywhere from 0 to 6 courses from a total of 6 courses offered. Prove or disprove: there are 5 students and 2 courses such that all 5 have chosen both courses or all 5 have chosen neither course.

Answer: False

Lean 4 formalization:
Independent variables:
Hypotheses:
t: Fin 20 → Set (Fin 6)
name: choices
Conclusion:
(answer ↔ (∃ (students : Finset (Fin 20)) (courses : Finset (Fin 6)),
                        students.card = 5 ∧
                        courses.card = 2 ∧
                        (↑courses ⊆ ⋂ s ∈ students, choices s ∨ ↑courses ⊆ ⋂ s ∈ students, (choices s)ᶜ)))
Formal answer (type: Prop):
answer = False
Problem: Let $c>0$ be a constant. Give a complete description, with proof, of the set of all continuous functions $f:\mathbb{R} \to \mathbb{R}$ such that $f(x)=f(x^2+c)$ for all $x \in \mathbb{R}$.

Answer: the set of functions described by the condition

Lean 4 formalization:
open Function
Independent variables:
t: ℝ
name: c
t: ℝ → ℝ
name: f
Hypotheses:
t: c > 0
name: cgt0
Conclusion:
((Continuous f ∧ ∀ x : ℝ, f x = f (x ^ 2 + c)) ↔ f ∈ answer c)
Formal answer (type: ℝ → Set (ℝ → ℝ)):
answer = fun (c : ℝ) =>
  (if c ≤ (1 / 4 : ℝ) then ({f : ℝ → ℝ | ∃ (d : ℝ), ∀ (x : ℝ), (f x : ℝ) = d} : Set (ℝ → ℝ))
    else
      ({f : ℝ → ℝ |
          ContinuousOn f (Set.Icc (0 : ℝ) c : Set ℝ) ∧
            (f (0 : ℝ) : ℝ) = (f c : ℝ) ∧
              (∀ (x : ℝ), x > (0 : ℝ) → (f x : ℝ) = (f ((x ^ (2 : ℕ) : ℝ) + c : ℝ) : ℝ)) ∧
                ∀ (x : ℝ), x < (0 : ℝ) → (f x : ℝ) = (f (-x : ℝ) : ℝ)} :
        Set (ℝ → ℝ)) :
    Set (ℝ → ℝ))
Problem: Define a \emph{selfish} set to be a set which has its own cardinality (number of elements) as an element. Find, with proof, the number of subsets of $\{1,2,\ldots,n\}$ which are \emph{minimal} selfish sets, that is, selfish sets none of whose proper subsets is selfish.

Answer: the nth Fibonacci number

Lean 4 formalization:
open Function
Independent variables:
Hypotheses:
t: Finset ℕ → Prop
name: selfish
t: ℕ
name: n
t: ∀ s : Finset ℕ, selfish s = (s.card ∈ s)
name: hselfish
t: n ≥ 1
name: npos
Conclusion:
({s : Finset ℕ | (s : Set ℕ) ⊆ Set.Icc 1 n ∧ selfish s ∧ (∀ ss : Finset ℕ, ss ⊂ s → ¬selfish ss)}.encard = answer n)
Formal answer (type: ℕ → ℕ):
answer = (Nat.fib : ℕ → ℕ)
Problem: Given that $\{x_1,x_2,\ldots,x_n\}=\{1,2,\ldots,n\}$, find, with proof, the largest possible value, as a function of $n$ (with $n \geq 2$), of $x_1x_2+x_2x_3+\cdots+x_{n-1}x_n+x_nx_1$.

Answer: $(2n^3 + 3n^2 - 11n + 18) / 6$

Lean 4 formalization:
open Function
Independent variables:
t: ℕ
name: n
Hypotheses:
t: n ≥ 2
name: hn
Conclusion:
(IsGreatest
  {k | ∃ x : ℕ → ℤ,
    (x '' (Finset.range n) = Set.Icc (1 : ℤ) n) ∧
    ∑ i : Fin n, x i * x ((i + 1) % n) = k}
  (answer n))
Formal answer (type: ℕ → ℕ):
answer = fun (n : ℕ) =>
  ((((((2 : ℕ) * (n ^ (3 : ℕ) : ℕ) : ℕ) + ((3 : ℕ) * (n ^ (2 : ℕ) : ℕ) : ℕ) : ℕ) - ((11 : ℕ) * n : ℕ) : ℕ) + (18 : ℕ) :
        ℕ) /
      (6 : ℕ) :
    ℕ)
Problem: For any square matrix $A$, we can define $\sin A$ by the usual power series: $\sin A=\sum_{n=0}^\infty \frac{(-1)^n}{(2n+1)!}A^{2n+1}$. Prove or disprove: there exists a $2 \times 2$ matrix $A$ with real entries such that $\sin A=\begin{pmatrix} 1 & 1996 \\ 0 & 1 \end{pmatrix}$.

Answer: False

Lean 4 formalization:
open Function Nat
Independent variables:
Hypotheses:
t: Matrix (Fin 2) (Fin 2) ℝ → Matrix (Fin 2) (Fin 2) ℝ
name: matsin
t: Matrix (Fin 2) (Fin 2) ℝ
name: mat1996
t: ∀ A, matsin A = ∑' n : ℕ, ((-(1 : ℝ)) ^ n / (2 * n + 1)!) • A ^ (2 * n + 1)
name: hmatsin
t: mat1996 0 0 = 1 ∧ mat1996 0 1 = 1996 ∧ mat1996 1 0 = 0 ∧ mat1996 1 1 = 1
name: hmat1996
Conclusion:
((∃ A, matsin A = mat1996) ↔ answer)
Formal answer (type: Prop):
answer = False
Problem: Given a finite string $S$ of symbols $X$ and $O$, we write $\Delta(S)$ for the number of $X$'s in $S$ minus the number of $O$'s. For example, $\Delta(XOOXOOX)=-1$. We call a string $S$ \emph{balanced} if every substring $T$ of (consecutive symbols of) $S$ has $-2 \leq \Delta(T) \leq 2$. Thus, $XOOXOOX$ is not balanced, since it contains the substring $OOXOO$. Find, with proof, the number of balanced strings of length $n$.

Answer: $2^{\lfloor (n + 2) / 2 \rfloor} + 2^{\lfloor (n + 1) / 2 \rfloor} - 2$

Lean 4 formalization:
open Function Nat
Independent variables:
t: ℕ
name: n
Hypotheses:
t: (Fin n → ℤˣ) → Fin n → Fin n → ℤ
name: Δ
t: (Fin n → ℤˣ) → Prop
name: balanced
t: ∀ S, ∀ a b, a ≤ b → Δ S a b = ∑ i in Finset.Icc a b, (S i : ℤ)
name: hΔ
t: ∀ S, balanced S ↔ ∀ a b, a ≤ b → |Δ S a b| ≤ 2
name: hbalanced
Conclusion:
({S : Fin n → ℤˣ | balanced S}.ncard = answer n)
Formal answer (type: ℕ → ℕ):
answer = fun (n : ℕ) =>
  ((((2 : ℕ) ^ (⌊((n + (2 : ℕ) : ℕ) / (2 : ℕ) : ℕ)⌋₊ : ℕ) : ℕ) +
          ((2 : ℕ) ^ (⌊((n + (1 : ℕ) : ℕ) / (2 : ℕ) : ℕ)⌋₊ : ℕ) : ℕ) :
        ℕ) -
      (2 : ℕ) :
    ℕ)
Problem: Evaluate \begin{gather*} \int_0^\infty \left(x-\frac{x^3}{2}+\frac{x^5}{2\cdot 4}-\frac{x^7}{2\cdot 4\cdot 6}+\cdots\right) \\ \left(1+\frac{x^2}{2^2}+\frac{x^4}{2^2\cdot 4^2}+\frac{x^6}{2^2\cdot 4^2 \cdot 6^2}+\cdots\right)\,dx. \end{gather*}

Answer: \(\sqrt{e}\)

Lean 4 formalization:
open Filter Topology
Independent variables:
Hypotheses:
t: ℝ → ℝ
name: series1
t: ℝ → ℝ
name: series2
t: series1 = fun x => ∑' n : ℕ, (-1)^n * x^(2*n + 1)/(∏ i : Finset.range n, 2 * ((i : ℝ) + 1))
name: hseries1
t: series2 = fun x => ∑' n : ℕ, x^(2*n)/(∏ i : Finset.range n, (2 * ((i : ℝ) + 1))^2)
name: hseries2
Conclusion:
(Tendsto (fun t => ∫ x in Set.Icc 0 t, series1 x * series2 x) atTop (𝓝 answer))
Formal answer (type: ℝ):
answer = (√(Real.exp (1 : ℝ) : ℝ) : ℝ)
Problem: Let $N_n$ denote the number of ordered $n$-tuples of positive integers $(a_1,a_2,\ldots,a_n)$ such that $1/a_1 + 1/a_2 +\ldots + 1/a_n=1$.  Determine whether $N_{10}$ is even or odd.

Answer: True

Lean 4 formalization:
open Filter Topology
Independent variables:
Hypotheses:
t: (n : ℕ+) → Set (Fin n → ℕ+)
name: N
t: N = fun (n : ℕ+) => {t : Fin n → ℕ+ | (∀ i j : Fin n, i < j → t i <= t j) ∧ (∑ i : Fin n, (1 : ℝ)/(t i) = 1) }
name: hN
Conclusion:
(Odd (N 10).ncard ↔ answer)
Formal answer (type: Prop):
answer = True
Problem: For a positive integer $n$ and any real number $c$, define $x_k$ recursively by $x_0=0$, $x_1=1$, and for $k\geq 0$, \[x_{k+2}=\frac{cx_{k+1}-(n-k)x_k}{k+1}.\] Fix $n$ and then take $c$ to be the largest value for which $x_{n+1}=0$. Find $x_k$ in terms of $n$ and $k$, $1\leq k\leq n$.

Answer: fun n k => Nat.choose (n.toNat-1) (k.toNat-1)

Lean 4 formalization:
open Filter Topology
Independent variables:
t: ℤ
name: n
Hypotheses:
t: n > 0
name: hn
t: ℝ → (ℤ → ℝ)
name: x
t: ∀ c, x c 0 = 0
name: hx0
t: ∀ c, x c 1 = 1
name: hx1
t: ∀ c, ∀ k ≥ 0, x c (k + 2) = (c*(x c (k + 1)) - (n - k)*(x c k))/(k + 1)
name: hxk
t: Set ℝ
name: S
t: S = {c : ℝ | x c (n + 1) = 0}
name: hS
Conclusion:
(∀ k : Set.Icc 1 n, x (sSup S) k = answer n k)
Formal answer (type: ℤ → ℤ → ℝ):
answer = fun (n k : ℤ) => (↑(((n.toNat : ℕ) - (1 : ℕ) : ℕ).choose ((k.toNat : ℕ) - (1 : ℕ) : ℕ) : ℕ) : ℝ)
Problem: Let $\{x\}$ denote the distance between the real number $x$ and the nearest integer.  For each positive integer $n$, evaluate \[F_n=\sum_{m=1}^{6n-1} \min(\{\frac{m}{6n}\},\{\frac{m}{3n}\}).\] (Here $\min(a,b)$ denotes the minimum of $a$ and $b$.)

Answer: fun n => n

Lean 4 formalization:
open Filter Topology
Independent variables:
t: ℝ
name: r
Hypotheses:
t: ℝ → ℝ
name: dist_to_int
t: dist_to_int r = |r - round r|
name: h_dist_to_int
t: ℕ → ℝ
name: F
t: F = fun (n : ℕ) => ∑ m in Finset.Icc 1 (6 * n - 1), min (dist_to_int (m/(6*n)) ) (dist_to_int (m/(3*n)))
name: hF
Conclusion:
(∀ n, n > 0 → F n = answer n)
Formal answer (type: ℕ → ℝ):
answer = fun (n : ℕ) => (↑n : ℝ)
Problem: For each positive integer $n$, write the sum $\sum_{m=1}^n 1/m$ in the form $p_n/q_n$, where $p_n$ and $q_n$ are relatively prime positive integers.  Determine all $n$ such that 5 does not divide $q_n$.

Answer: {n | (1 ≤ n ∧ n ≤ 4) ∨ (20 ≤ n ∧ n ≤ 24) ∨ (100 ≤ n ∧ n ≤ 104) ∨ (120 ≤ n ∧ n ≤ 124)}

Lean 4 formalization:
open Filter Topology Bornology Set
Independent variables:
t: ℕ
name: n
Hypotheses:
t: n > 0
name: hn
Conclusion:
(n ∈ answer ↔ ¬5 ∣ (∑ m in Finset.Icc 1 n, 1/m : ℚ).den)
Formal answer (type: Set ℕ):
answer =
  ({n : ℕ |
      (1 : ℕ) ≤ n ∧ n ≤ (4 : ℕ) ∨
        (20 : ℕ) ≤ n ∧ n ≤ (24 : ℕ) ∨ (100 : ℕ) ≤ n ∧ n ≤ (104 : ℕ) ∨ (120 : ℕ) ≤ n ∧ n ≤ (124 : ℕ)} :
    Set ℕ)
Problem: Let $A_1=0$ and $A_2=1$. For $n>2$, the number $A_n$ is defined by concatenating the decimal expansions of $A_{n-1}$ and $A_{n-2}$ from left to right.  For example $A_3=A_2 A_1=10$, $A_4=A_3 A_2 = 101$, $A_5=A_4 A_3 = 10110$, and so forth.  Determine all $n$ such that $11$ divides $A_n$.

Answer: all $n$ such that $n \equiv 1 \pmod{6}$

Lean 4 formalization:
Independent variables:
Hypotheses:
t: ℕ → List ℕ
name: A
t: A 1 = [0]
name: hA1
t: A 2 = [1]
name: hA2
t: ∀ n > 0, A (n + 2) = A (n + 1) ++ A n
name: hA
Conclusion:
({n | 1 ≤ n ∧ 11 ∣ Nat.ofDigits 10 (A n).reverse} = answer)
Formal answer (type: Set ℕ):
answer = ({n : ℕ | n ≡ (1 : ℕ) [MOD (6 : ℕ)]} : Set ℕ)
Problem: Find the minimum value of \[\frac{(x+1/x)^6-(x^6+1/x^6)-2}{(x+1/x)^3+(x^3+1/x^3)}\] for $x>0$.

Answer: 6

Lean 4 formalization:
open Set Function Metric
Independent variables:
Hypotheses:
Conclusion:
(sInf {((x + 1/x)^6 - (x^6 + 1/x^6) - 2)/((x + 1/x)^3 + (x^3 + 1/x^3)) | x > (0 : ℝ)} = answer)
Formal answer (type: ℝ):
answer = (6 : ℝ)
Problem: Given a point $(a,b)$ with $0<b<a$, determine the minimum perimeter of a triangle with one vertex at $(a,b)$, one on the $x$-axis, and one on the line $y=x$.  You may assume that a triangle of minimum perimeter exists.

Answer: $\sqrt{2a^2 + 2b^2}$ if $a > b$, otherwise $0$

Lean 4 formalization:
open Set Function Metric
Independent variables:
t: ℝ
name: a
t: ℝ
name: b
Hypotheses:
t: 0 < b ∧ b < a
name: hab
Conclusion:
(sInf {d : ℝ | ∃ (c : ℝ) (x : ℝ), d = Real.sqrt ((a - c)^2 + (b - 0)^2) + Real.sqrt ((c - x)^2 + (0 - x)^2) + Real.sqrt ((a - x)^2 + (b - x)^2) ∧
  Real.sqrt ((a - c)^2 + (b - 0)^2) + Real.sqrt ((c - x)^2 + (0 - x)^2) > Real.sqrt ((a - x)^2 + (b - x)^2) ∧
  Real.sqrt ((a - c)^2 + (b - 0)^2) + Real.sqrt ((a - x)^2 + (b - x)^2) > Real.sqrt ((c - x)^2 + (0 - x)^2) ∧
  Real.sqrt ((c - x)^2 + (0 - x)^2) + Real.sqrt ((a - x)^2 + (b - x)^2) > Real.sqrt ((a - c)^2 + (b - 0)^2)} = answer a b)
Formal answer (type: ℝ → ℝ → ℝ):
answer = fun (a b : ℝ) =>
  (if a > b then (√(((2 : ℝ) * (a ^ (2 : ℕ) : ℝ) : ℝ) + ((2 : ℝ) * (b ^ (2 : ℕ) : ℝ) : ℝ) : ℝ) : ℝ) else (0 : ℝ) : ℝ)
Problem: Find necessary and sufficient conditions on positive integers $m$ and $n$ so that \[\sum_{i=0}^{mn-1} (-1)^{\lfloor i/m \rfloor +\lfloor i/n\rfloor}=0.\]

Answer: {nm | let ⟨n,m⟩ := nm; multiplicity 2 n ≠ multiplicity 2 m}

Lean 4 formalization:
open Set Function Metric
Independent variables:
t: ℕ
name: n
t: ℕ
name: m
Hypotheses:
t: ℕ → ℕ → ℤ
name: quantity
t: quantity = fun n m => ∑ i in Finset.range (m * n), (-1)^(i/m + i/n)
name: hquantity
t: n > 0 ∧ m > 0
name: hnm
Conclusion:
(quantity n m = 0 ↔ ⟨n, m⟩ ∈ answer)
Formal answer (type: Set (ℕ × ℕ)):
answer = ({((n, m) : ℕ × ℕ) : ℕ × ℕ | (multiplicity (2 : ℕ) n : ℕ) ≠ (multiplicity (2 : ℕ) m : ℕ)} : Set (ℕ × ℕ))
Problem: Let $N$ be the positive integer with 1998 decimal digits, all of them 1; that is, \[N=1111\cdots 11.\] Find the thousandth digit after the decimal point of $\sqrt N$.

Answer: 1

Lean 4 formalization:
open Set Function Metric
Independent variables:
Hypotheses:
t: ℕ
name: N
t: N = ∑ i in Finset.range 1998, 10^i
name: hN
Conclusion:
(answer = (Nat.floor (10^1000 * Real.sqrt N)) % 10)
Formal answer (type: ℕ):
answer = (1 : ℕ)
Problem: Find polynomials $f(x)$,$g(x)$, and $h(x)$, if they exist, such that for all $x$, \[|f(x)|-|g(x)|+h(x) = \begin{cases} -1 & \mbox{if $x<-1$} \\3x+2 & \mbox{if $-1 \leq x \leq 0$} \\-2x+2 & \mbox{if $x>0$.}\end{cases}\]?

Answer: True

Lean 4 formalization:
Independent variables:
Hypotheses:
Conclusion:
(answer ↔ ∃ f g h : Polynomial ℝ, ∀ x : ℝ, |f.eval x| - |g.eval x| + h.eval x = if x < -1 then -1 else (if (x ≤ 0) then 3 * x + 2 else -2 * x + 2))
Formal answer (type: Prop):
answer = True
Problem: Sum the series \[\sum_{m=1}^\infty \sum_{n=1}^\infty \frac{m^2 n}{3^m(n3^m+m3^n)}.\]

Answer: 9/32

Lean 4 formalization:
open Filter Topology Metric
Independent variables:
Hypotheses:
Conclusion:
(Tendsto (fun i => ∑ m in Finset.range i, ∑' n : ℕ, (((m + 1)^2*(n+1))/(3^(m + 1) * ((n+1)*3^(m + 1) + (m + 1)*3^(n+1))) : ℝ)) atTop (𝓝 answer))
Formal answer (type: ℝ):
answer = (9 / 32 : ℝ)
Problem: Let $A=\{(x,y):0\leq x,y<1\}$.  For $(x,y)\in A$, let \[S(x,y) = \sum_{\frac{1}{2}\leq \frac{m}{n}\leq 2} x^m y^n,\] where the sum ranges over all pairs $(m,n)$ of positive integers satisfying the indicated inequalities.  Evaluate \[\lim_{(x,y)\rightarrow (1,1), (x,y)\in A} (1-xy^2)(1-x^2y)S(x,y).\]

Answer: 3

Lean 4 formalization:
open Filter Topology Metric
Independent variables:
Hypotheses:
t: Set (ℝ × ℝ)
name: A
t: A = {xy | 0 ≤ xy.1 ∧ xy.1 < 1 ∧ 0 ≤ xy.2 ∧ xy.2 < 1}
name: hA
t: ℝ → ℝ → ℝ
name: S
t: S = fun x y => ∑' m : ℕ, ∑' n : ℕ, if (m > 0 ∧ n > 0 ∧ 1/2 ≤ m/n ∧ m/n ≤ 2) then x^m * y^n else 0
name: hS
Conclusion:
(Tendsto (fun xy : (ℝ × ℝ) => (1 - xy.1 * xy.2^2) * (1 - xy.1^2 * xy.2) * (S xy.1 xy.2)) (𝓝[A] ⟨1,1⟩) (𝓝 answer))
Formal answer (type: ℝ):
answer = (3 : ℝ)
Problem: For an integer $n\geq 3$, let $\theta=2\pi/n$.  Evaluate the determinant of the $n\times n$ matrix $I+A$, where $I$ is the $n\times n$ identity matrix and $A=(a_{jk})$ has entries $a_{jk}=\cos(j\theta+k\theta)$ for all $j,k$.

Answer: fun n => 1 - n^2/4

Lean 4 formalization:
open Filter Topology Metric
Independent variables:
t: ℕ
name: n
Hypotheses:
t: n ≥ 3
name: hn
t: ℝ
name: theta
t: theta = 2 * Real.pi / n
name: htheta
t: Matrix (Fin n) (Fin n) ℝ
name: A
t: A = fun j k => Real.cos ((j.1 + 1) * theta + (k.1 + 1) * theta)
name: hA
Conclusion:
((1 + A).det = answer n)
Formal answer (type: ℕ → ℝ):
answer = fun (n : ℕ) => ((1 : ℝ) - (((↑n : ℝ) ^ (2 : ℕ) : ℝ) / (4 : ℝ) : ℝ) : ℝ)
Problem: Let $A$ be a positive real number. What are the possible values of $\sum_{j=0}^\infty x_j^2$, given that $x_0,x_1,\ldots$ are positive numbers for which $\sum_{j=0}^\infty x_j=A$?

Answer: the open interval $(0, A^2)$

Lean 4 formalization:
open Topology Filter
Independent variables:
t: ℝ
name: A
Hypotheses:
t: A > 0
name: Apos
Conclusion:
({S : ℝ |
    ∃ x : ℕ → ℝ,
      (∀ j : ℕ, x j > 0) ∧
      (∑' j : ℕ, x j) = A ∧
      (∑' j : ℕ, (x j) ^ 2) = S}
  = answer A)
Formal answer (type: ℝ → Set ℝ):
answer = fun (A : ℝ) => (Set.Ioo (0 : ℝ) (A ^ (2 : ℕ) : ℝ) : Set ℝ)
Problem: For each integer $m$, consider the polynomial
\[P_m(x)=x^4-(2m+4)x^2+(m-2)^2.\] For what values of $m$ is $P_m(x)$
the product of two non-constant polynomials with integer coefficients?

Answer: {m : ℤ | ∃ k : ℤ, k^2 = m ∨ 2*k^2 = m}

Lean 4 formalization:
open Topology Filter Polynomial Set
Independent variables:
Hypotheses:
t: ℤ → Polynomial ℤ
name: P
t: P = fun m : ℤ => (Polynomial.X)^4 - (Polynomial.C (2*m + 4))*(Polynomial.X)^2 + Polynomial.C ((m - 2)^2)
name: hP
Conclusion:
({m : ℤ | ∃ a b, P m = a * b ∧
(∃ n ∈ Ici 1, a.coeff n ≠ 0) ∧ (∃ n ∈ Ici 1, b.coeff n ≠ 0)} = answer)
Formal answer (type: Set ℤ):
answer = ({m : ℤ | ∃ (k : ℤ), (k ^ (2 : ℕ) : ℤ) = m ∨ ((2 : ℤ) * (k ^ (2 : ℕ) : ℤ) : ℤ) = m} : Set ℤ)
Problem: Find all pairs of real numbers $(x,y)$ satisfying the system of equations
\begin{align*}
\frac{1}{x}+\frac{1}{2y}&=(x^2+3y^2)(3x^2+y^2) \\
\frac{1}{x}-\frac{1}{2y}&=2(y^4-x^4).
\end{align*}

Answer: the set containing the pair $\left(\frac{3^{1/5} + 1}{2}, \frac{3^{1/5} - 1}{2}\right)$

Lean 4 formalization:
open Topology Filter Polynomial Set
Independent variables:
Hypotheses:
t: ℝ
name: x
t: ℝ
name: y
t: x ≠ 0
name: hx
t: y ≠ 0
name: hy
t: Prop
name: eq1
t: Prop
name: eq2
t: eq1 ↔ (1 / x + 1 / (2 * y) = (x ^ 2 + 3 * y ^ 2) * (3 * x ^ 2 + y ^ 2))
name: heq1
t: eq2 ↔ (1 / x - 1 / (2 * y) = 2 * (y ^ 4 - x ^ 4))
name: heq2
Conclusion:
(eq1 ∧ eq2 ↔ (x, y) ∈ answer)
Formal answer (type: Set (ℝ × ℝ)):
answer =
  ({((((((3 : ℝ) ^ (1 / 5 : ℝ) : ℝ) + (1 : ℝ) : ℝ) / (2 : ℝ) : ℝ),
          ((((3 : ℝ) ^ (1 / 5 : ℝ) : ℝ) - (1 : ℝ) : ℝ) / (2 : ℝ) : ℝ)) :
        ℝ × ℝ)} :
    Set (ℝ × ℝ))
Problem: For any positive integer $n$, let $\langle n \rangle$ denote the closest integer to $\sqrt{n}$. Evaluate $\sum_{n=1}^\infty \frac{2^{\langle n \rangle}+2^{-\langle n \rangle}}{2^n}$.

Answer: 3

Lean 4 formalization:
open Topology Filter Polynomial Set
Independent variables:
Hypotheses:
Conclusion:
(∑' n : Set.Ici 1, ((2 : ℝ) ^ (round (Real.sqrt n)) + (2 : ℝ) ^ (-round (Real.sqrt n))) / 2 ^ (n : ℝ) = answer)
Formal answer (type: ℝ):
answer = (3 : ℝ)
Problem: Assume that $(a_n)_{n \geq 1}$ is an increasing sequence of positive real numbers such that $\lim a_n/n=0$. Must there exist infinitely many positive integers $n$ such that $a_{n-i}+a_{n+i}<2a_n$ for $i=1,2,\ldots,n-1$?

Answer: True

Lean 4 formalization:
open Topology Filter Polynomial Set
Independent variables:
Hypotheses:
t: ℤ → ℝ
name: a
t: ∀ n ≥ 1, a n > 0 ∧ a n < a (n + 1)
name: h_pos_inc
t: Tendsto (fun n : ℤ => a (n + 1) / (n + 1)) atTop (𝓝 0)
name: h_limit
Conclusion:
({n : ℤ | n > 0 ∧ (∀ i ∈ Set.Icc 1 (n - 1), a (n - i) + a (n + i) < 2 * a n)}.Infinite ↔ answer)
Formal answer (type: Prop):
answer = True
Problem: Let $k$ be a fixed positive integer. The $n$-th derivative of $\frac{1}{x^k-1}$ has the form $\frac{P_n(x)}{(x^k-1)^{n+1}}$ where $P_n(x)$ is a polynomial. Find $P_n(1)$.

Answer: (-k)^n * n!

Lean 4 formalization:
open Nat
Independent variables:
t: ℕ
name: k
Hypotheses:
t: ℕ → Polynomial ℝ
name: P
t: k > 0
name: kpos
t: ∀ n x, iteratedDeriv n (fun x' : ℝ => 1 / (x' ^ k - 1)) x = ((P n).eval x) / ((x ^ k - 1) ^ (n + 1))
name: Pderiv
Conclusion:
(∀ n, (P n).eval 1 = answer k n)
Formal answer (type: ℕ → ℕ → ℝ):
answer = fun (k n : ℕ) => (((-(↑k : ℝ) : ℝ) ^ n : ℝ) * (↑(n ! : ℕ) : ℝ) : ℝ)
Problem: Fix an integer $b \geq 2$. Let $f(1) = 1$, $f(2) = 2$, and for each
$n \geq 3$, define $f(n) = n f(d)$, where $d$ is the number of
base-$b$ digits of $n$. For which values of $b$ does
\[
\sum_{n=1}^\infty \frac{1}{f(n)}
\]
converge?

Answer: {2}

Lean 4 formalization:
open Nat Set Topology Filter
Independent variables:
Hypotheses:
t: ℕ → ℕ → ℝ
name: f
t: ∀ b : ℕ, f b 1 = 1 ∧ f b 2 = 2 ∧ ∀ n ∈ Ici 3, f b n = n * f b (Nat.digits b n).length
name: hf
Conclusion:
({b ∈ Ici 2 | ∃ L : ℝ, Tendsto (fun m : ℕ => ∑ n in Finset.Icc 1 m, 1/(f b n)) atTop (𝓝 L)} = answer)
Formal answer (type: Set ℕ):
answer = ({(2 : ℕ)} : Set ℕ)
Problem: Let $n$ be a fixed positive integer. How many ways are there to write $n$ as a sum of positive integers, \[ n = a_1 + a_2 + \dots + a_k, \] with $k$ an arbitrary positive integer and $a_1 \leq a_2 \leq \dots \leq a_k \leq a_1 + 1$? For example, with $n = 4$, there are four ways: $4, 2 + 2, 1 + 1 + 2, 1 + 1 + 1 + 1$

Answer: $n$

Lean 4 formalization:
open MvPolynomial
Independent variables:
t: ℕ
name: n
Hypotheses:
t: n > 0
name: hn
Conclusion:
(Set.encard {a : ℕ → ℤ |
  ∃ k > 0, (∑ i : Fin k, a i = n) ∧
    (∀ i : Fin k, a i > 0) ∧
    (∀ i : Fin (k - 1), a i ≤ a (i + 1)) ∧
    a (k - 1) ≤ a 0 + 1 ∧ (∀ i ≥ k, a i = 0)} = answer n)
Formal answer (type: ℕ → ℕ):
answer = fun (n : ℕ) => n
Problem: Find the minimum value of $|\sin x+\cos x+\tan x+\cot x+\sec x+\csc x|$ for real numbers $x$.

Answer: $2\sqrt{2} - 1$

Lean 4 formalization:
open Set
Independent variables:
Hypotheses:
t: ℝ → ℝ
name: f
t: ∀ x : ℝ, f x = |Real.sin x + Real.cos x + Real.tan x + 1 / Real.tan x + 1 / Real.cos x + 1 / Real.sin x|
name: hf
Conclusion:
(IsLeast (Set.range f) answer)
Formal answer (type: ℝ):
answer = (((2 : ℝ) * (√(2 : ℝ) : ℝ) : ℝ) - (1 : ℝ) : ℝ)
Problem: For a set $S$ of nonnegative integers, let $r_S(n)$ denote the number of ordered pairs $(s_1,s_2)$ such that $s_1 \in S$, $s_2 \in S$, $s_1 \ne s_2$, and $s_1+s_2=n$. Is it possible to partition the nonnegative integers into two sets $A$ and $B$ in such a way that $r_A(n)=r_B(n)$ for all $n$?

Answer: True

Lean 4 formalization:
open MvPolynomial Set
Independent variables:
Hypotheses:
t: Set ℕ → ℕ → ℕ
name: r
t: ∀ S n, r S n = ∑' s1 : S, ∑' s2 : S, if (s1 ≠ s2 ∧ s1 + s2 = n) then 1 else 0
name: hr
Conclusion:
((∃ A B : Set ℕ, A ∪ B = ℕ ∧ A ∩ B = ∅ ∧ (∀ n : ℕ, r A n = r B n)) ↔ answer)
Formal answer (type: Prop):
answer = True
Problem: Do there exist polynomials $a(x), b(x), c(y), d(y)$ such that \[ 1 + xy + x^2y^2 = a(x)c(y) + b(x)d(y)\] holds identically?

Answer: False

Lean 4 formalization:
open MvPolynomial Set
Independent variables:
Hypotheses:
Conclusion:
(answer = (∃ a b c d : Polynomial ℝ, (∀ x y : ℝ, 1 + x * y + x ^ 2 * y ^ 2 = a.eval x * c.eval y + b.eval x * d.eval y)))
Formal answer (type: Prop):
answer = False
Problem: Basketball star Shanille O'Keal's team statistician keeps track of the number, $S(N)$, of successful free throws she has made in her first $N$ attempts of the season. Early in the season, $S(N)$ was less than $80\%$ of $N$, but by the end of the season, $S(N)$ was more than $80\%$ of $N$. Was there necessarily a moment in between when $S(N)$ was exactly $80\%$ of $N$?

Answer: True

Lean 4 formalization:
open Nat Topology Filter
Independent variables:
Hypotheses:
t: (ℕ → Fin 2) → ℕ → ℝ
name: S
t: ∀ attempts, ∀ N ≥ 1, S attempts N = (∑ i : Fin N, (attempts i).1) / N
name: hS
Conclusion:
(answer ↔ (∀ attempts a b,
    (1 ≤ a ∧ a < b ∧ S attempts a < 0.8 ∧ S attempts b > 0.8) →
      (∃ c : ℕ, a < c ∧ c < b ∧ S attempts c = 0.8)))
Formal answer (type: Prop):
answer = True
Problem: Let $n$ be a positive integer, $n \ge 2$, and put $\theta = 2 \pi / n$. Define points $P_k = (k,0)$ in the $xy$-plane, for $k = 1, 2, \dots, n$. Let $R_k$ be the map that rotates the plane counterclockwise by the angle $\theta$ about the point $P_k$. Let $R$ denote the map obtained by applying, in order, $R_1$, then $R_2, \dots$, then $R_n$. For an arbitrary point $(x,y)$, find, and simplify, the coordinates of $R(x,y)$.

Answer: fun n z ↦ z + n

Lean 4 formalization:
open Nat Topology Filter
Independent variables:
t: ℕ
name: n
Hypotheses:
t: n ≥ 2
name: nge2
t: ℕ → ℂ → ℂ
name: R
t: ℕ → ℂ → ℂ
name: Rk
t: R 0 = id ∧ ∀ k : ℕ, R (k + 1) = Rk (k + 1) ∘ R k
name: hR
t: Rk = fun (k : ℕ) (Q : ℂ) ↦ k + Complex.exp (Complex.I * 2 * Real.pi / n) * (Q - k)
name: hRk
Conclusion:
(R n = answer n)
Formal answer (type: ℕ → ℂ → ℂ):
answer = fun (n : ℕ) (z : ℂ) => (z + (↑n : ℂ) : ℂ)
Problem: Evaluate $\lim_{x \to 1^-} \prod_{n=0}^\infty \left(\frac{1+x^{n+1}}{1+x^n}\right)^{x^n}$.

Answer: 2 / e

Lean 4 formalization:
open Nat Topology Filter
Independent variables:
Hypotheses:
t: ℝ → ℝ
name: xprod
t: ∀ x ∈ Set.Ioo 0 1,
      Tendsto (fun N ↦ ∏ n in Finset.range N, ((1 + x ^ (n + 1)) / (1 + x ^ n)) ^ (x ^ n))
      atTop (𝓝 (xprod x))
name: hxprod
Conclusion:
(Tendsto xprod (𝓝[<] 1) (𝓝 answer))
Formal answer (type: ℝ):
answer = ((2 : ℝ) / (Real.exp (1 : ℝ) : ℝ) : ℝ)