purewhite42/formal_problem_solving_main huggingface dataset:
Problem: If $a$, $b$, and $c$ are real numbers satisfying $0 < a < b < c$, at what points in the set $$\{(x, y, z) \in \mathbb{R}^3 : x^b + y^b + z^b = 1, x \ge 0, y \ge 0, z \ge 0\}$$ does $f(x, y, z) = x^a + y^b + z^c$ attain its maximum and minimum?

Answer: (fun (a, b, c) => ((a/b)^(1/(b - a)), (1 - ((a/b)^(1/(b - a)))^b)^(1/b), 0), fun (a, b, c) => (0, (1 - ((b/c)^(1/(c - b)))^b)^(1/b), (b/c)^(1/(c - b))))

Lean 4 formalization:
open Polynomial
Independent variables: t: ℝ
name: a
t: ℝ
name: b
t: ℝ
name: c
Hypotheses: t: 0 < a ∧ a < b ∧ b < c
name: hi
t: (ℝ × ℝ × ℝ) → Prop
name: P
t: (ℝ × ℝ × ℝ) → ℝ
name: f
t: P = fun (x, y, z) => x ≥ 0 ∧ y ≥ 0 ∧ z ≥ 0 ∧ x^b + y^b + z^b = 1
name: hP
t: f = fun (x, y, z) => x^a + y^b + z^c
name: hf
Conclusions: ((P (answer.1 (a, b, c)) ∧ ∀ x y z : ℝ, P (x, y, z) →
f (x, y, z) ≤ f (answer.1 (a, b, c))) ∧
(P (answer.2 (a, b, c)) ∧ ∀ x y z : ℝ, P (x, y, z) →
f (x, y, z) ≥ f (answer.2 (a, b, c))))
Answer type: ((ℝ × ℝ × ℝ) → (ℝ × ℝ × ℝ)) × ((ℝ × ℝ × ℝ) → (ℝ × ℝ × ℝ))
Formal answer: answer =
  ((fun (x : ℝ × ℝ × ℝ) =>
      match x with
      | ((a, ((b, c) : ℝ × ℝ)) : ℝ × ℝ × ℝ) =>
        ((((a / b : ℝ) ^ ((1 : ℝ) / (b - a : ℝ) : ℝ) : ℝ),
            (((((1 : ℝ) - (((a / b : ℝ) ^ ((1 : ℝ) / (b - a : ℝ) : ℝ) : ℝ) ^ b : ℝ) : ℝ) ^ ((1 : ℝ) / b : ℝ) : ℝ),
                (0 : ℝ)) :
              ℝ × ℝ)) :
          ℝ × ℝ × ℝ),
      fun (x : ℝ × ℝ × ℝ) =>
      match x with
      | ((a, ((b, c) : ℝ × ℝ)) : ℝ × ℝ × ℝ) =>
        (((0 : ℝ),
            (((((1 : ℝ) - (((b / c : ℝ) ^ ((1 : ℝ) / (c - b : ℝ) : ℝ) : ℝ) ^ b : ℝ) : ℝ) ^ ((1 : ℝ) / b : ℝ) : ℝ),
                ((b / c : ℝ) ^ ((1 : ℝ) / (c - b : ℝ) : ℝ) : ℝ)) :
              ℝ × ℝ)) :
          ℝ × ℝ × ℝ)) :
    (ℝ × ℝ × ℝ → ℝ × ℝ × ℝ) × (ℝ × ℝ × ℝ → ℝ × ℝ × ℝ))
Problem: Let $n = 2m$, where $m$ is an odd integer greater than 1. Let $\theta = e^{2\pi i/n}$. Expression $(1 - \theta)^{-1}$ explicitly as a polynomial in $\theta$ \[ a_k \theta^k  + a_{k-1}\theta^{k-1} + \dots + a_1\theta + a_0\], with integer coefficients $a_i$.

Answer: $\sum_{j=0}^{(m-1)/2} \theta^{2j+1}$

Lean 4 formalization:
open Polynomial Real Complex
Independent variables: t: ℕ
name: m
Hypotheses: t: Odd m ∧ m > 1
name: hm
t: ℂ
name: θ
t: θ = cexp (2 * Real.pi * I / (2 * m))
name: hθ
Conclusions: (1/(1 - θ) = Polynomial.aeval θ (answer m))
Answer type: ℕ → Polynomial ℤ
Formal answer: answer = fun (m : ℕ) =>
  ∑ j ∈ (Finset.range ((m - (1 : ℕ) : ℕ) / (2 : ℕ) : ℕ) : Finset ℕ),
    ((Polynomial.X : ℤ[X]) ^ (((2 : ℕ) * j : ℕ) + (1 : ℕ) : ℕ) : ℤ[X])
Problem: Let $H$ be a subgroup of the additive group of ordered pairs of integers under componentwise addition. If $H$ is generated by the elements $(3, 8)$, $(4, -1)$, and $(5, 4)$, then $H$ is also generated by two elements $(1, b)$ and $(0, a)$ for some integer $b$ and positive integer $a$. Find $a$.

Answer: 7

Lean 4 formalization:
open Polynomial Real Complex
Hypotheses: t: Set (ℤ × ℤ)
name: H
t: H = {h : (ℤ × ℤ) | ∃ u v w : ℤ, h = (u*3 + v*4 + w*5, u*8 + v*(-1) + w*4)}
name: hH
Conclusions: ((∃ b : ℤ, H = {h : (ℤ × ℤ) | ∃ u v : ℤ, h = (u, u*b + v*answer)}) ∧ answer > 0)
Answer type: ℤ
Formal answer: answer = (7 : ℤ)
Problem: Let $s_k (a_1, a_2, \dots, a_n)$ denote the $k$-th elementary symmetric function; that is, the sum of all $k$-fold products of the $a_i$. For example, $s_1 (a_1, \dots, a_n) = \sum_{i=1}^{n} a_i$, and $s_2 (a_1, a_2, a_3) = a_1a_2 + a_2a_3 + a_1a_3$. Find the supremum $M_k$ (which is never attained) of $$\frac{s_k (a_1, a_2, \dots, a_n)}{(s_1 (a_1, a_2, \dots, a_n))^k}$$ across all $n$-tuples $(a_1, a_2, \dots, a_n)$ of positive real numbers with $n \ge k$.

Answer: fun k : ℕ => (1: ℝ)/(Nat.factorial k)

Lean 4 formalization:
open Polynomial Real Complex Matrix Filter Topology Multiset
Conclusions: (∀ k : ℕ, k > 0 → (∀ a : Multiset ℝ, (∀ i ∈ a, i > 0) ∧ card a ≥ k →
(esymm a k)/(esymm a 1)^k ≤ answer k) ∧
∀ M : ℝ, M < answer k → (∃ a : Multiset ℝ, (∀ i ∈ a, i > 0) ∧ card a ≥ k ∧
(esymm a k)/(esymm a 1)^k > M))
Answer type: ℕ → ℝ
Formal answer: answer = fun (k : ℕ) => ((1 : ℝ) / (↑(k.factorial : ℕ) : ℝ) : ℝ)
Problem: Let $C = \{(x, y) \in \mathbb{R}^2 : x^2 + y^2 = 1\}$ denote the unit circle. Does there exist $B \subseteq C$ for which $B$ is topologically closed and contains exactly one point from each pair of diametrically opposite points in $C$?

Answer: False

Lean 4 formalization:
open Polynomial Real Complex Matrix Filter Topology Multiset
Hypotheses: t: ℝ × ℝ → Prop
name: P
t: P = fun (x, y) => x^2 + y^2 = 1
name: hP
Conclusions: ((∃ B ⊆ setOf P, IsClosed B ∧ ∀ x y : ℝ, P (x, y) → Xor' ((x, y) ∈ B) ((-x, -y) ∈ B)) ↔ answer)
Answer type: Prop
Formal answer: answer = False
Problem: Find all integer solutions $(p, r, q, s)$ of the equation $|p^r - q^s| = 1$, where $p$ and $q$ are prime and $r$ and $s$ are greater than $1$.

Answer: {(3, 2, 2, 3), (2, 3, 3, 2)}

Lean 4 formalization:
Conclusions: ({a : ℕ × ℕ × ℕ × ℕ | Nat.Prime a.1 ∧ Nat.Prime a.2.2.1 ∧ a.2.1 > 1 ∧ a.2.2.2 > 1 ∧ |(a.1^a.2.1 : ℤ) - a.2.2.1^a.2.2.2| = 1} = answer)
Answer type: Set (ℕ × ℕ × ℕ × ℕ)
Formal answer: answer =
  (Insert.insert (((3 : ℕ), (((2 : ℕ), (((2 : ℕ), (3 : ℕ)) : ℕ × ℕ)) : ℕ × ℕ × ℕ)) : ℕ × ℕ × ℕ × ℕ)
      ({(((2 : ℕ), (((3 : ℕ), (((3 : ℕ), (2 : ℕ)) : ℕ × ℕ)) : ℕ × ℕ × ℕ)) : ℕ × ℕ × ℕ × ℕ)} : Set (ℕ × ℕ × ℕ × ℕ)) :
    Set (ℕ × ℕ × ℕ × ℕ))
Problem: Let $r$ be a real root of $P(x) = x^3 + ax^2 + bx - 1$, where $a$ and $b$ are integers and $P$ is irreducible over the rationals. Suppose that $r + 1$ is a root of $x^3 + cx^2 + dx + 1$, where $c$ and $d$ are also integers. Express another root $s$ of $P$ as a function of $r$ that does not depend on the values of $a$, $b$, $c$, or $d$.

Answer: $\left(-\frac{1}{r + 1}, -\frac{r + 1}{r}\right)$

Lean 4 formalization:
open Polynomial
Independent variables: t: ℝ
name: r
Hypotheses: t: ℤ
name: a
t: ℤ
name: b
t: ℤ
name: c
t: ℤ
name: d
t: Polynomial ℚ
name: P
t: Polynomial ℚ
name: Q
t: P = Polynomial.X^3 + (Polynomial.C (a : ℚ))*Polynomial.X^2 + (Polynomial.C (b : ℚ))*Polynomial.X - (Polynomial.C 1) ∧ Polynomial.aeval r P = 0 ∧ Irreducible P
name: hP
t: Q = Polynomial.X^3 + (Polynomial.C (c : ℚ))*Polynomial.X^2 + (Polynomial.C (d : ℚ))*Polynomial.X + (Polynomial.C 1) ∧ Polynomial.aeval (r + 1) Q = 0
name: hQ
Conclusions: (∃ s : ℝ, Polynomial.aeval s P = 0 ∧ (s = answer.1 r ∨ s = answer.2 r))
Answer type: (ℝ → ℝ) × (ℝ → ℝ)
Formal answer: answer =
  ((fun (r : ℝ) => ((-1 : ℝ) / (r + (1 : ℝ) : ℝ) : ℝ), fun (r : ℝ) => ((-(r + (1 : ℝ) : ℝ) : ℝ) / r : ℝ)) :
    (ℝ → ℝ) × (ℝ → ℝ))
Problem: Find $$\lim_{n \to \infty} \frac{1}{n} \sum_{k=1}^{n}\left(\left\lfloor \frac{2n}{k} \right\rfloor - 2\left\lfloor \frac{n}{k} \right\rfloor\right).$$ Your answer should be in the form $\ln(a) - b$, where $a$ and $b$ are positive integers.

Answer: ln(4) - 1

Lean 4 formalization:
open Polynomial Filter Topology
Conclusions: (Tendsto (fun n : ℕ => ((1 : ℝ)/n)*∑ k in Finset.Icc (1 : ℤ) n, (Int.floor ((2*n)/k) - 2*Int.floor (n/k))) atTop
    (𝓝 (Real.log answer.1 - answer.2)))
Answer type: ℕ × ℕ
Formal answer: answer = (((4 : ℕ), (1 : ℕ)) : ℕ × ℕ)
Problem: Let $G$ be a group generated by two elements $A$ and $B$; i.e., every element of $G$ can be expressed as a finite word $A^{n_1}B^{n_2} \cdots A^{n_{k-1}}B^{n_k}$, where the $n_i$ can assume any integer values and $A^0 = B^0 = 1$. Further assume that $A^4 = B^7 = ABA^{-1}B = 1$, but $A^2 \ne 1$ and $B \ne 1$. Find the number of elements of $G$ than can be written as $C^2$ for some $C \in G$ and express each such square as a word in $A$ and $B$.

Answer: (8, {[(0, 0)], [(2, 0)], [(0, 1)], [(0, 2)], [(0, 3)], [(0, 4)], [(0, 5)], [(0, 6)]})

Lean 4 formalization:
open Polynomial Filter Topology
Hypotheses: t: Type*
name: G
t: Group G
t: G
name: A
t: G
name: B
t: List (ℤ × ℤ) → G
name: word
t: word = fun w : List (ℤ × ℤ) => (List.map (fun t : ℤ × ℤ => A^(t.1)*B^(t.2)) w).prod
name: hword
t: ∀ g : G, ∃ w : List (ℤ × ℤ), g = word w
name: hG
t: A^4 = 1 ∧ A^2 ≠ 1
name: hA
t: B^7 = 1 ∧ B ≠ 1
name: hB
t: A*B*A^(-(1 : ℤ))*B = 1
name: h1
t: Set G
name: S
t: S = {g : G | ∃ C : G, C^2 = g}
name: hS
Conclusions: (S.ncard = answer.1 ∧ S = {word w | w ∈ answer.2})
Answer type: ℕ × Set (List (ℤ × ℤ))
Formal answer: answer =
  (((8 : ℕ),
      (Insert.insert ((((0 : ℤ), (0 : ℤ)) : ℤ × ℤ) :: ([] : List (ℤ × ℤ)) : List (ℤ × ℤ))
          (Insert.insert ((((2 : ℤ), (0 : ℤ)) : ℤ × ℤ) :: ([] : List (ℤ × ℤ)) : List (ℤ × ℤ))
              (Insert.insert ((((0 : ℤ), (1 : ℤ)) : ℤ × ℤ) :: ([] : List (ℤ × ℤ)) : List (ℤ × ℤ))
                  (Insert.insert ((((0 : ℤ), (2 : ℤ)) : ℤ × ℤ) :: ([] : List (ℤ × ℤ)) : List (ℤ × ℤ))
                      (Insert.insert ((((0 : ℤ), (3 : ℤ)) : ℤ × ℤ) :: ([] : List (ℤ × ℤ)) : List (ℤ × ℤ))
                          (Insert.insert ((((0 : ℤ), (4 : ℤ)) : ℤ × ℤ) :: ([] : List (ℤ × ℤ)) : List (ℤ × ℤ))
                              (Insert.insert ((((0 : ℤ), (5 : ℤ)) : ℤ × ℤ) :: ([] : List (ℤ × ℤ)) : List (ℤ × ℤ))
                                  ({((((0 : ℤ), (6 : ℤ)) : ℤ × ℤ) :: ([] : List (ℤ × ℤ)) : List (ℤ × ℤ))} :
                                    Set (List (ℤ × ℤ))) :
                                Set (List (ℤ × ℤ))) :
                            Set (List (ℤ × ℤ))) :
                        Set (List (ℤ × ℤ))) :
                    Set (List (ℤ × ℤ))) :
                Set (List (ℤ × ℤ))) :
            Set (List (ℤ × ℤ))) :
        Set (List (ℤ × ℤ)))) :
    ℕ × Set (List (ℤ × ℤ)))
Problem: Find $$\sum_{k=0}^{n} (-1)^k {n \choose k} (x - k)^n.$$

Answer: fun n => C (Nat.factorial n)

Lean 4 formalization:
open Polynomial Filter Topology ProbabilityTheory MeasureTheory
Conclusions: (∀ n : ℕ, ∑ k in Finset.range (n + 1), C ((-(1 : ℤ))^k * Nat.choose n k) * (X - (C (k : ℤ)))^n = answer n)
Answer type: ℕ → Polynomial ℤ
Formal answer: answer = fun (n : ℕ) => (((Polynomial.C : ℤ →+* ℤ[X]) : ℤ → ℤ[X]) (↑(n.factorial : ℕ) : ℤ) : ℤ[X])
Problem: Show that if four distinct points of the curve $y = 2x^4 + 7x^3 + 3x - 5$ are collinear, then their average $x$-coordinate is some constant $k$. Find $k$.

Answer: $-7/8$

Lean 4 formalization:
Hypotheses: t: ℝ → ℝ
name: y
t: y = fun x ↦ 2 * x ^ 4 + 7 * x ^ 3 + 3 * x - 5
name: hy
t: Finset ℝ
name: S
t: S.card = 4
name: hS
t: Collinear ℝ {P : Fin 2 → ℝ | P 0 ∈ S ∧ P 1 = y (P 0)}
name: h_collinear
Conclusions: ((∑ x in S, x) / 4 = answer)
Answer type: ℝ
Formal answer: answer = (-7 / 8 : ℝ)
Problem: Find all real solutions $(a, b, c, d)$ to the equations $a + b + c = d$, $\frac{1}{a} + \frac{1}{b} + \frac{1}{c} = \frac{1}{d}$.

Answer: $d = a \land b = -c \lor d = b \land a = -c \lor d = c \land a = -b$

Lean 4 formalization:
Independent variables: t: ℝ
name: a
t: ℝ
name: b
t: ℝ
name: c
t: ℝ
name: d
Conclusions: (answer a b c d ↔
    a ≠ 0 → b ≠ 0 → c ≠ 0 → d ≠ 0 → (a + b + c = d ∧ 1 / a + 1 / b + 1 / c = 1 / d))
Answer type: ℝ → ℝ → ℝ → ℝ → Prop
Formal answer: answer = fun (a b c d : ℝ) => d = a ∧ b = (-c : ℝ) ∨ d = b ∧ a = (-c : ℝ) ∨ d = c ∧ a = (-b : ℝ)
Problem: Let $f, g, h$ be functions $\mathbb{R} \to \mathbb{R}$. Find an expression for $h(x)$ in terms of $f$ and $g$ such that $f(x) = \frac{h(x + 1) + h(x - 1)}{2}$ and $g(x) = \frac{h(x + 4) + h(x - 4)}{2}$.

Answer: $h(x) = g(x) - f(x - 3) + f(x - 1) + f(x + 1) - f(x + 3)$

Lean 4 formalization:
Independent variables: t: ℝ → ℝ
name: f
t: ℝ → ℝ
name: g
Hypotheses: t: ℝ → ℝ
name: h
t: ∀ x, f x = (h (x + 1) + h (x - 1)) / 2
name: hf
t: ∀ x, g x = (h (x + 4) + h (x - 4)) / 2
name: hg
Conclusions: (h = answer f g)
Answer type: (ℝ → ℝ) → (ℝ → ℝ) → (ℝ → ℝ)
Formal answer: answer = fun (f g : ℝ → ℝ) (x : ℝ) =>
  (((((g x : ℝ) - (f (x - (3 : ℝ) : ℝ) : ℝ) : ℝ) + (f (x - (1 : ℝ) : ℝ) : ℝ) : ℝ) + (f (x + (1 : ℝ) : ℝ) : ℝ) : ℝ) -
      (f (x + (3 : ℝ) : ℝ) : ℝ) :
    ℝ)
Problem: Find $\sum_{n=0}^{\infty} \frac{x^{2^n}}{1 - x^{2^{n+1}}}$ as a rational function of $x$ for $x \in (0, 1)$.

Answer: $\frac{x}{1 - x}$

Lean 4 formalization:
open RingHom Set
Hypotheses: t: ℝ
name: x
t: x ∈ Ioo 0 1
name: hx
Conclusions: (answer.eval (id ℝ) x = ∑' n : ℕ, x ^ 2 ^ n / (1 - x ^ 2 ^ (n + 1)))
Answer type: RatFunc ℝ
Formal answer: answer = ((RatFunc.X : RatFunc ℝ) / ((1 : RatFunc ℝ) - (RatFunc.X : RatFunc ℝ) : RatFunc ℝ) : RatFunc ℝ)
Problem: Let $X$ be the square $[0, 1] \times [0, 1]$, and let $f : X \to \mathbb{R}$ be continuous. If $\int_Y f(x, y) \, dx \, dy = 0$ for all squares $Y$ such that
\begin{itemize}
\item[(1)] $Y \subseteq X$,
\item[(2)] $Y$ has sides parallel to those of $X$,
\item[(3)] at least one of $Y$'s sides is contained in the boundary of $X$,
\end{itemize}
is it true that $f(x, y) = 0$ for all $x, y$?

Answer: True

Lean 4 formalization:
open RingHom Set Nat
Hypotheses: t: Set (ℝ × ℝ)
name: X
t: X = Set.prod (Icc 0 1) (Icc 0 1)
name: hX
t: (ℝ × ℝ) → ℝ
name: room
t: room = fun (a,b) ↦ min (min a (1 - a)) (min b (1 - b))
name: hroom
Conclusions: ((∀ f : (ℝ × ℝ) → ℝ, Continuous f → (∀ P ∈ X, ∫ x in (P.1 - room P)..(P.1 + room P), ∫ y in (P.2 - room P)..(P.2 + room P), f (x, y) = 0) → (∀ P ∈ X, f P = 0)) ↔ answer)
Answer type: Prop
Formal answer: answer = True
Problem: Find $\prod_{n=2}^{\infty} \frac{(n^3 - 1)}{(n^3 + 1)}$.

Answer: 2/3

Lean 4 formalization:
open RingHom Set Nat Filter Topology
Conclusions: (Tendsto (fun N ↦ ∏ n in Finset.Icc (2 : ℤ) N, ((n : ℝ) ^ 3 - 1) / (n ^ 3 + 1)) atTop (𝓝 answer))
Answer type: ℝ
Formal answer: answer = (2 / 3 : ℝ)
Problem: An ordered triple $(a, b, c)$ of positive irrational numbers with $a + b + c = 1$ is considered $\textit{balanced}$ if all three elements are less than $\frac{1}{2}$. If a triple is not balanced, we can perform a ``balancing act'' $B$ defined by $B(a, b, c) = (f(a), f(b), f(c))$, where $f(x) = 2x - 1$ if $x > 1/2$ and $f(x) = 2x$ otherwise. Will finitely many iterations of this balancing act always eventually produce a balanced triple?

Answer: False

Lean 4 formalization:
open RingHom Set Nat Filter Topology
Hypotheses: t: ℝ × ℝ × ℝ → Prop
name: P
t: ℝ × ℝ × ℝ → Prop
name: balanced
t: ℝ × ℝ × ℝ → ℝ × ℝ × ℝ
name: B
t: P = fun (a, b, c) => Irrational a ∧ Irrational b ∧ Irrational c ∧ a > 0 ∧ b > 0 ∧ c > 0 ∧ a + b + c = 1
name: hP
t: balanced = fun (a, b, c) => a < 1/2 ∧ b < 1/2 ∧ c < 1/2
name: hbalanced
t: B = fun (a, b, c) => (ite (a > 1/2) (2*a - 1) (2*a), ite (b > 1/2) (2*b - 1) (2*b), ite (c > 1/2) (2*c - 1) (2*c))
name: hB
Conclusions: ((∀ t : ℝ × ℝ × ℝ, P t → ∃ n : ℕ, balanced (B^[n] t)) ↔ answer)
Answer type: Prop
Formal answer: answer = False
Problem: Let $p(x) = 2(x^6 + 1) + 4(x^5 + x) + 3(x^4 + x^2) + 5x^3$. For $k$ with $0 < k < 5$, let
\[
I_k = \int_0^{\infty} \frac{x^k}{p(x)} \, dx.
\]
For which $k$ is $I_k$ smallest?

Answer: 2

Lean 4 formalization:
open Set Polynomial
Hypotheses: t: Polynomial ℝ
name: p
t: p = 2 * (Polynomial.X ^ 6 + 1) + 4 * (Polynomial.X ^ 5 + Polynomial.X) + 3 * (Polynomial.X ^ 4 + Polynomial.X ^ 2) + 5 * Polynomial.X ^ 3
name: hp
t: ℕ → ℝ
name: I
t: I = fun k ↦ ∫ x in Ioi 0, x ^ k / p.eval x
name: hI
Conclusions: (IsLeast {y | ∃ k ∈ Ioo 0 5, I k = y} answer)
Answer type: ℕ
Formal answer: answer = (2 : ℕ)
Problem: Find
\[
\sum_{i=1}^{\infty} \sum_{j=1}^{\infty} \frac{1}{i^2j + 2ij + ij^2}.
\]

Answer: 7 / 4

Lean 4 formalization:
open Set Real
Conclusions: ((∑' i : ℕ+, ∑' j : ℕ+, (1 : ℚ) / (i ^ 2 * j + 2 * i * j + i * j ^ 2)) = answer)
Answer type: ℚ
Formal answer: answer = (7 / 4 : ℚ)
Problem: Find the real polynomial $p(x)$ of degree $4$ with largest possible coefficient of $x^4$ such that $p([-1, 1]) \subseteq [0, 1]$.

Answer: $4x^4 - 4x^2 + 1$

Lean 4 formalization:
open Set Real Filter Topology Polynomial
Hypotheses: t: Set (Polynomial ℝ)
name: S
t: S = {p : Polynomial ℝ | p.degree = 4 ∧ ∀ x ∈ Icc (-1 : ℝ) 1, p.eval x ∈ Icc 0 1}
name: hS
Conclusions: (answer ∈ S ∧ (∀ p ∈ S, p.coeff 4 ≤ answer.coeff 4))
Answer type: Polynomial ℝ
Formal answer: answer =
  ((((4 : ℝ[X]) * ((Polynomial.X : ℝ[X]) ^ (4 : ℕ) : ℝ[X]) : ℝ[X]) -
          ((4 : ℝ[X]) * ((Polynomial.X : ℝ[X]) ^ (2 : ℕ) : ℝ[X]) : ℝ[X]) :
        ℝ[X]) +
      (1 : ℝ[X]) :
    ℝ[X])
Problem: For which positive integers $n$ and $a_1, a_2, \dots, a_n$ with $\sum_{i = 1}^{n} a_i = 1979$ does $\prod_{i = 1}^{n} a_i$ attain the greatest value?

Answer: Multiset.replicate 659 3 + {2}

Lean 4 formalization:
Hypotheses: t: Multiset ℕ → Prop
name: P
t: ∀ a, P a ↔ Multiset.card a > 0 ∧ (∀ i ∈ a, i > 0) ∧ a.sum = 1979
name: hP
Conclusions: (P answer ∧ ∀ a : Multiset ℕ, P a → answer.prod ≥ a.prod)
Answer type: Multiset ℕ
Formal answer: answer = ((Multiset.replicate (659 : ℕ) (3 : ℕ) : Multiset ℕ) + ({(2 : ℕ)} : Multiset ℕ) : Multiset ℕ)
Problem: For which real numbers $k$ does there exist a continuous function $f : \mathbb{R} \to \mathbb{R}$ such that $f(f(x)) = kx^9$ for all real $x$?

Answer: $k \geq 0$

Lean 4 formalization:
Independent variables: t: ℝ
name: k
Conclusions: (answer k ↔ ∃ f : ℝ → ℝ, Continuous f ∧ ∀ x : ℝ, f (f x) = k * x^9)
Answer type: ℝ → Prop
Formal answer: answer = fun (k : ℝ) => k ≥ (0 : ℝ)
Problem: Let $x_1, x_2, x_3, \dots$ be a sequence of nonzero real numbers such that $$x_n = \frac{x_{n-2}x_{n-1}}{2x_{n-2}-x_{n-1}}$$ for all $n \ge 3$. For which real values of $x_1$ and $x_2$ does $x_n$ attain integer values for infinitely many $n$?

Answer: fun (a, b) => ∃ m : ℤ, a = m ∧ b = m

Lean 4 formalization:
Independent variables: t: ℕ → ℝ
name: x
Hypotheses: t: ∀ n : ℕ, x n ≠ 0 ∧ (n ≥ 3 → x n = (x (n - 2))*(x (n - 1))/(2*(x (n - 2)) - (x (n - 1))))
name: hx
Conclusions: ((∀ m : ℕ, ∃ n : ℕ, n > m ∧ ∃ a : ℤ, a = x n) ↔ answer (x 1, x 2))
Answer type: (ℝ × ℝ) → Prop
Formal answer: answer = fun (x : ℝ × ℝ) =>
  match x with
  | ((a, b) : ℝ × ℝ) => ∃ (m : ℤ), a = (↑m : ℝ) ∧ b = (↑m : ℝ)
Problem: Let $A$ be a set of $2n$ points in the plane, $n$ colored red and $n$ colored blue, such that no three points in $A$ are collinear. Must there exist $n$ closed straight line segments, each connecting one red and one blue point in $A$, such that no two of the $n$ line segments intersect?

Answer: True

Lean 4 formalization:
open Set
Hypotheses: t: Finset (Fin 2 → ℝ) × Finset (Fin 2 → ℝ) → Prop
name: A
t: A = fun (R, B) => R.card = B.card ∧ R ∩ B = ∅ ∧
    ∀ u : Finset (Fin 2 → ℝ), u ⊆ R ∪ B → u.card = 3 → ¬Collinear ℝ (u : Set (Fin 2 → ℝ))
name: hA
t: (Fin 2 → ℝ) × (Fin 2 → ℝ) → ℝ → (Fin 2 → ℝ)
name: w
t: w = fun (P, Q) => fun x : ℝ => fun i : Fin 2 => x * P i + (1 - x) * Q i
name: hw
Conclusions: (answer ↔
      (∀ R B, A (R, B) →
        ∃ v : Finset ((Fin 2 → ℝ) × (Fin 2 → ℝ)),
          (∀ L ∈ v, ∀ M ∈ v, L ≠ M → ∀ x ∈ Icc 0 1, ∀ y ∈ Icc 0 1,
          Real.sqrt ((w (L.1, L.2) x 0 - w (M.1, M.2) y 0)^2 + (w (L.1, L.2) x 1 - w (M.1, M.2) y 1)^2) ≠ 0) ∧
        v.card = R.card ∧ ∀ L ∈ v, L.1 ∈ R ∧ L.2 ∈ B))
Answer type: Prop
Formal answer: answer = True
Problem: If $0 < a < b$, find $$\lim_{t \to 0} \left( \int_{0}^{1}(bx + a(1-x))^t dx \right)^{\frac{1}{t}}$$ in terms of $a$ and $b$.

Answer: fun (a, b) => (Real.exp (-1))*(b^b/a^a)^(1/(b-a))

Lean 4 formalization:
open Set Topology Filter
Conclusions: (∀ a b : ℝ, 0 < a ∧ a < b → Tendsto (fun t : ℝ => (∫ x in Icc 0 1, (b*x + a*(1 - x))^t)^(1/t)) (𝓝[≠] 0) (𝓝 (answer (a, b))))
Answer type: ℝ × ℝ → ℝ
Formal answer: answer = fun (x : ℝ × ℝ) =>
  match x with
  | ((a, b) : ℝ × ℝ) =>
    ((Real.exp (-1 : ℝ) : ℝ) * (((b ^ b : ℝ) / (a ^ a : ℝ) : ℝ) ^ ((1 : ℝ) / (b - a : ℝ) : ℝ) : ℝ) : ℝ)
Problem: Let $F$ be a finite field with $n$ elements, and assume $n$ is odd. Suppose $x^2 + bx + c$ is an irreducible polynomial over $F$. For how many elements $d \in F$ is $x^2 + bx + c + d$ irreducible?

Answer: fun n : ℕ ↦ (n - (1 : ℤ)) / 2

Lean 4 formalization:
open Set Topology Filter Polynomial
Independent variables: t: ℕ
name: n
Hypotheses: t: Type*
name: F
t: Field F
t: Fintype F
t: n = Fintype.card F
name: hn
t: Odd n
name: nodd
t: F
name: b
t: F
name: c
t: Polynomial F
name: p
t: p = X ^ 2 + (C b) * X + (C c) ∧ Irreducible p
name: hp
Conclusions: ({d : F | Irreducible (p + (C d))}.ncard = answer n)
Answer type: ℕ → ℤ
Formal answer: answer = fun (n : ℕ) => (((↑n : ℤ) - (1 : ℤ) : ℤ) / (2 : ℤ) : ℤ)
Problem: Let $r$ and $s$ be positive integers. Derive a formula for the number of ordered quadruples $(a,b,c,d)$ of positive integers such that $3^r \cdot 7^s=\text{lcm}[a,b,c]=\text{lcm}[a,b,d]=\text{lcm}[a,c,d]=\text{lcm}[b,c,d]$. The answer should be a function of $r$ and $s$. (Note that $\text{lcm}[x,y,z]$ denotes the least common multiple of $x,y,z$.)

Answer: (fun r s : ℕ => (1 + 4 * r + 6 * r ^ 2) * (1 + 4 * s + 6 * s ^ 2))

Lean 4 formalization:
Independent variables: t: ℕ
name: r
t: ℕ
name: s
Hypotheses: t: ℕ → ℕ → ℕ → ℕ → Prop
name: abcdlcm
t: r > 0 ∧ s > 0
name: rspos
t: ∀ a b c d : ℕ, abcdlcm a b c d ↔
      (a > 0 ∧ b > 0 ∧ c > 0 ∧ d > 0 ∧
      (3 ^ r * 7 ^ s = Nat.lcm (Nat.lcm a b) c) ∧
      (3 ^ r * 7 ^ s = Nat.lcm (Nat.lcm a b) d) ∧
      (3 ^ r * 7 ^ s = Nat.lcm (Nat.lcm a c) d) ∧
      (3 ^ r * 7 ^ s = Nat.lcm (Nat.lcm b c) d))
name: habcdlcm
Conclusions: ({h : ℕ × ℕ × ℕ × ℕ | abcdlcm h.1 h.2.1 h.2.2.1 h.2.2.2}.encard = answer r s)
Answer type: ℕ → ℕ → ℕ
Formal answer: answer = fun (r s : ℕ) =>
  ((((1 : ℕ) + ((4 : ℕ) * r : ℕ) : ℕ) + ((6 : ℕ) * (r ^ (2 : ℕ) : ℕ) : ℕ) : ℕ) *
      (((1 : ℕ) + ((4 : ℕ) * s : ℕ) : ℕ) + ((6 : ℕ) * (s ^ (2 : ℕ) : ℕ) : ℕ) : ℕ) :
    ℕ)
Problem: Evaluate $\int_0^{\pi/2}\frac{dx}{1+(\tan x)^{\sqrt{2}}}$.

Answer: $\pi / 4$

Lean 4 formalization:
open Real
Conclusions: (answer = ∫ x in Set.Ioo 0 (Real.pi / 2), 1 / (1 + (Real.tan x) ^ (Real.sqrt 2)))
Answer type: ℝ
Formal answer: answer = ((π : ℝ) / (4 : ℝ) : ℝ)
Problem: Let $C$ be the class of all real valued continuously differentiable functions $f$ on the interval $0 \leq x \leq 1$ with $f(0)=0$ and $f(1)=1$. Determine the largest real number $u$ such that $u \leq \int_0^1|f'(x)-f(x)|\,dx$ for all $f$ in $C$.

Answer: $1/e$

Lean 4 formalization:
open Real
Hypotheses: t: Set (ℝ → ℝ)
name: C
t: C = {f : ℝ → ℝ | ContDiffOn ℝ 1 f (Set.Icc 0 1) ∧ f 0 = 0 ∧ f 1 = 1}
name: hC
Conclusions: (IsGreatest {u : ℝ | ∀ f ∈ C, u ≤ (∫ x in Set.Ioo 0 1, |deriv f x - f x|)} answer)
Answer type: ℝ
Formal answer: answer = ((1 : ℝ) / (rexp (1 : ℝ) : ℝ) : ℝ)
Problem: For which real numbers $c$ is $(e^x+e^{-x})/2 \leq e^{cx^2}$ for all real $x$?

Answer: $\{c : \mathbb{R} \mid c \geq 1/2\}$

Lean 4 formalization:
open Real
Independent variables: t: ℝ
name: c
Conclusions: (∀ x : ℝ, (exp x + exp (-x)) / 2 ≤ exp (c * x ^ 2) ↔ c ∈ answer)
Answer type: Set ℝ
Formal answer: answer = ({c : ℝ | c ≥ (1 / 2 : ℝ)} : Set ℝ)
Problem: For which real numbers $a$ does the sequence defined by the initial condition $u_0=a$ and the recursion $u_{n+1}=2u_n-n^2$ have $u_n>0$ for all $n \geq 0$? (Express the answer in the simplest form.)

Answer: $\{a : \mathbb{R} \mid a \geq 3\}$

Lean 4 formalization:
Independent variables: t: ℝ
name: a
Hypotheses: t: ℕ → ℝ
name: u
t: u 0 = a ∧ (∀ n : ℕ, u (n + 1) = 2 * u n - n ^ 2)
name: hu
Conclusions: ((∀ n : ℕ, u n > 0) ↔ a ∈ answer)
Answer type: Set ℝ
Formal answer: answer = ({a : ℝ | a ≥ (3 : ℝ)} : Set ℝ)
Problem: A function $f$ is convex on $[0, 1]$ if and only if $$f(su + (1-s)v) \le sf(u) + (1 - s)f(v)$$ for all $s \in [0, 1]$.
Let $S_t$ denote the set of all nonnegative increasing convex continuous functions $f : [0, 1] \rightarrow \mathbb{R}$ such that $$f(1) - 2f\left(\frac{2}{3}\right) + f\left(\frac{1}{3}\right) \ge t\left(f\left(\frac{2}{3}\right) - 2f\left(\frac{1}{3}\right) + f(0)\right).$$
For which real numbers $t \ge 0$ is $S_t$ closed under multiplication?

Answer: $t \le 1$

Lean 4 formalization:
open Set
Independent variables: t: ℝ
name: t
Hypotheses: t: Set ℝ
name: T
t: T = Icc 0 1
name: hT
t: ℝ → (ℝ → ℝ) → Prop
name: P
t: (ℝ → ℝ) → Prop
name: IsConvex
t: ℝ → Set (ℝ → ℝ)
name: S
t: ∀ t f, P t f ↔ f 1 - 2*f (2/3) + f (1/3) ≥ t*(f (2/3) - 2*f (1/3) + f 0)
name: P_def
t: ∀ f, IsConvex f ↔ ∀ u ∈ T, ∀ v ∈ T, ∀ s ∈ T, f (s*u + (1 - s)*v) ≤ s*(f u) + (1 - s)*(f v)
name: IsConvex_def
t: S = fun t : ℝ => {f : ℝ → ℝ | (∀ x ∈ T, f x ≥ 0) ∧ StrictMonoOn f T ∧ IsConvex f ∧ ContinuousOn f T ∧ P t f}
name: hS
t: t ≥ 0
name: ht
Conclusions: (answer t ↔ (∀ f ∈ S t, ∀ g ∈ S t, f * g ∈ S t))
Answer type: ℝ → Prop
Formal answer: answer = fun (t : ℝ) => t ≤ (1 : ℝ)