ChristianZ97/putnambench-satp huggingface dataset:
Problem putnam_1979_a4 (geometry, combinatorics)

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?

Solution: Such line segments must exist.

Lean 4 formalization:
import Mathlib
open Set
abbrev putnam_1979_a4_solution : Prop := sorry
theorem putnam_1979_a4
    (A : Finset (Fin 2 → ℝ) × Finset (Fin 2 → ℝ) → Prop)
    (hA : 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 → ℝ)))
    (w : (Fin 2 → ℝ) × (Fin 2 → ℝ) → ℝ → (Fin 2 → ℝ))
    (hw : w = fun (P, Q) => fun x : ℝ => fun i : Fin 2 => x * P i + (1 - x) * Q i) :
    putnam_1979_a4_solution ↔
      (∀ 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) := by
Problem putnam_1979_a5 (algebra)

Let $S(x)$ denote the sequence $\lfloor 0 \rfloor, \lfloor x \rfloor, \lfloor 2x \rfloor, \lfloor 3x \rfloor, \dots$, where $\lfloor x \rfloor$ denotes the greatest integer less than or equal to $x$. Prove that there exist distinct real roots $\alpha$ and $\beta$ of $x^3 - 10x^2 + 29x - 25$ such that infinitely many positive integers appear in both $S(\alpha)$ and $S(\beta)$.

Solution: None.

Lean 4 formalization:
import Mathlib
open Set
theorem putnam_1979_a5
(S : ℝ → ℕ → ℤ)
(hS : S = fun x : ℝ => fun n : ℕ => Int.floor (n*x))
(P : ℝ → Prop)
(hP : ∀ x, P x ↔ x^3 - 10*x^2 + 29*x - 25 = 0)
: ∃ α β : ℝ, α ≠ β ∧ P α ∧ P β ∧ ∀ n : ℕ, ∃ m : ℤ, m > n ∧ ∃ c d : ℕ, S α c = m ∧ S β d = m := by
Problem putnam_1979_a6 (algebra)

For all $i \in \{0, 1, \dots, n - 1\}$, let $p_i \in [0, 1]$. Prove that there exists some $x \in [0, 1]$ such that $$\sum_{i = 0}^{n - 1} \frac{1}{|x - p_i|} \le 8n\left(\sum_{i = 0}^{n-1} \frac{1}{2i + 1}\right).$$

Solution: None.

Lean 4 formalization:
import Mathlib
open Set
theorem putnam_1979_a6
(n : ℕ)
(p : ℕ → ℝ)
(hp : ∀ i ∈ Finset.range n, p i ∈ Icc 0 1)
: ∃ x ∈ Icc 0 1, (∀ i ∈ Finset.range n, x ≠ p i) ∧ ∑ i ∈ Finset.range n, 1/|x - p i| ≤ 8*n*∑ i ∈ Finset.range n, (1 : ℝ)/(2*i + 1) := by
Problem putnam_1979_b2 (analysis)

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$.

Solution: The limit equals $$e^{-1}\left(\frac{b^b}{a^a}\right)^{\frac{1}{b-a}}.$$

Lean 4 formalization:
import Mathlib
open Set Topology Filter
noncomputable abbrev putnam_1979_b2_solution : ℝ × ℝ → ℝ := sorry
theorem putnam_1979_b2
: ∀ a b : ℝ, 0 < a ∧ a < b → Tendsto (fun t : ℝ => (∫ x in Icc 0 1, (b*x + a*(1 - x))^t)^(1/t)) (𝓝[≠] 0) (𝓝 (putnam_1979_b2_solution (a, b))) := by
Problem putnam_1979_b3 (abstract_algebra)

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?

Solution: Show that there are $\frac{n - 1}{2}$ such elements $d$.

Lean 4 formalization:
import Mathlib
open Set Topology Filter Polynomial
abbrev putnam_1979_b3_solution : ℕ → ℤ := sorry
theorem putnam_1979_b3
(F : Type*) [Field F] [Fintype F]
(n : ℕ)
(hn : n = Fintype.card F)
(nodd : Odd n)
(b c : F)
(p : Polynomial F)
(hp : p = X ^ 2 + (C b) * X + (C c) ∧ Irreducible p)
: ({d : F | Irreducible (p + (C d))}.ncard = putnam_1979_b3_solution n) := by
Problem putnam_1979_b5 (geometry, analysis)

In the plane, let $C$ be a closed convex set that contains $(0,0) but no other point with integer coordinations. Suppose that $A(C)$, the area of $C$, is equally distributed among the four quadrants. Prove that $A(C) \leq 4$.

Solution: None.

Lean 4 formalization:
import Mathlib
open Set Topology Filter Polynomial MeasureTheory
theorem putnam_1979_b5
(C : Set (ℝ × ℝ))
(hC : IsClosed C ∧ Convex ℝ C ∧ (0,0) ∈ C)
(hCnint : ∀ a b : ℤ, (a ≠ 0 ∨ b ≠ 0) → ((a : ℝ), (b : ℝ)) ∉ C)
(hCeven : volume (C ∩ {p : ℝ × ℝ | p.1 ≥ 0 ∧ p.2 ≥ 0}) = volume (C ∩ {p : ℝ × ℝ | p.1 ≥ 0 ∧ p.2 ≤ 0}) ∧ volume (C ∩ {p : ℝ × ℝ | p.1 ≥ 0 ∧ p.2 ≤ 0}) = volume (C ∩ {p : ℝ × ℝ | p.1 ≤ 0 ∧ p.2 ≥ 0}) ∧ volume (C ∩ {p : ℝ × ℝ | p.1 ≤ 0 ∧ p.2 ≥ 0}) = volume (C ∩ {p : ℝ × ℝ | p.1 ≤ 0 ∧ p.2 ≤ 0}))
: volume C ≤ 4 := by
Problem putnam_1979_b6 (analysis)

Let $z_i$ be complex numbers for $i = 1, 2, \dots, n$. Show that
\[
\left \lvert \mathrm{Re} \, [(z_1^2 + z_2^2 + \dots + z_n^2)^{1/2} ] \right \rvert \leq \lvert \mathrm{Re} \, z_1 \rvert + \lvert \mathrm{Re} \, z_2 \rvert + \dots + \lvert \mathrm{Re} \, z_n \rvert.
\]

Solution: None.

Lean 4 formalization:
import Mathlib
open Set Topology Filter Polynomial MeasureTheory
theorem putnam_1979_b6
(n : ℕ)
(z : Fin n → ℂ)
: (|((∑ i : Fin n, (z i) ^ 2) ^ ((1 : ℂ) / 2)).re| ≤ ∑ i : Fin n, |(z i).re|) := by
Problem putnam_1980_a2 (number_theory)

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$.)

Solution: Show that the number is $(1+4r+6r^2)(1+4s+6s^2)$.

Lean 4 formalization:
import Mathlib
abbrev putnam_1980_a2_solution : ℕ → ℕ → ℕ := sorry
theorem putnam_1980_a2
    (r s : ℕ)
    (abcdlcm : ℕ → ℕ → ℕ → ℕ → Prop)
    (rspos : r > 0 ∧ s > 0)
    (habcdlcm : ∀ 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))) :
    {(a, b, c, d) : ℕ × ℕ × ℕ × ℕ | abcdlcm a b c d}.encard = putnam_1980_a2_solution r s := by
Problem putnam_1980_a3 (analysis)

Evaluate $\int_0^{\pi/2}\frac{dx}{1+(\tan x)^{\sqrt{2}}}$.

Solution: Show that the integral is $\pi/4$.

Lean 4 formalization:
import Mathlib
noncomputable abbrev putnam_1980_a3_solution : ℝ := sorry
theorem putnam_1980_a3
: ∫ x in Set.Ioo 0 (Real.pi / 2), 1 / (1 + (Real.tan x) ^ (Real.sqrt 2)) = putnam_1980_a3_solution := by
Problem putnam_1980_a4 (algebra)

\begin{enumerate}
\item[(a)] Prove that there exist integers $a,b,c$, not all zero and each of absolute value less than one million, such that $|a+b\sqrt{2}+c\sqrt{3}|<10^{-11}$.
\item[(b)] Let $a,b,c$ be integers, not all zero and each of absolute value less than one million. Prove that $|a+b\sqrt{2}+c\sqrt{3}|>10^{-21}$.
\end{enumerate}

Solution: None.

Lean 4 formalization:
import Mathlib
theorem putnam_1980_a4
    (abcvals : ℤ → ℤ → ℤ → Prop)
    (habcvals : ∀ a b c : ℤ, abcvals a b c ↔ ¬(a = 0 ∧ b = 0 ∧ c = 0) ∧ |a| < 1000000 ∧ |b| < 1000000 ∧ |c| < 1000000) :
    (∃ a b c : ℤ,
      abcvals a b c ∧
      |a + b * Real.sqrt 2 + c * Real.sqrt 3| < 10 ^ (-(11 : ℝ))) ∧
      (∀ a b c : ℤ, abcvals a b c → |a + b * Real.sqrt 2 + c * Real.sqrt 3| > 10 ^ (-(21 : ℝ))) := by
Problem putnam_1980_a5 (analysis)

Let $P(t)$ be a nonconstant polynomial with real coefficients. Prove that the system of simultaneous equations $0=\int_0^xP(t)\sin t\,dt=\int_0^xP(t)\cos t\,dt$ has only finitely many real solutions $x$.

Solution: None.

Lean 4 formalization:
import Mathlib
theorem putnam_1980_a5
    (P : Polynomial ℝ)
    (Pnonconst : P.degree > 0) :
    Set.Finite {x : ℝ |
      0 = (∫ t in (0)..x, P.eval t * Real.sin t) ∧
      0 = (∫ t in (0)..x, P.eval t * Real.cos t)} := by
Problem putnam_1980_a6 (analysis)

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$.

Solution: Show that $u=1/e$.

Lean 4 formalization:
import Mathlib
noncomputable abbrev putnam_1980_a6_solution : ℝ := sorry
theorem putnam_1980_a6
    (C : Set (ℝ → ℝ))
    (hC : C = {f : ℝ → ℝ | ContDiffOn ℝ 1 f (Set.Icc 0 1) ∧ f 0 = 0 ∧ f 1 = 1}) :
    IsGreatest
      {(u : ℝ) | ∀ f ∈ C, u ≤ (∫ x in Set.Ioo 0 1, |deriv f x - f x|)}
      putnam_1980_a6_solution := by
Problem putnam_1980_b1 (analysis)

For which real numbers $c$ is $(e^x+e^{-x})/2 \leq e^{cx^2}$ for all real $x$?

Solution: Show that the inequality holds if and only if $c \geq 1/2$.

Lean 4 formalization:
import Mathlib
open Real
abbrev putnam_1980_b1_solution : Set ℝ := sorry
theorem putnam_1980_b1
(c : ℝ)
: (∀ x : ℝ, (exp x + exp (-x)) / 2 ≤ exp (c * x ^ 2)) ↔ c ∈ putnam_1980_b1_solution := by
Problem putnam_1980_b3 (algebra)

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.)

Solution: Show that $u_n>0$ for all $n \geq 0$ if and only if $a \geq 3$.

Lean 4 formalization:
import Mathlib
abbrev putnam_1980_b3_solution : Set ℝ := sorry
theorem putnam_1980_b3
(a : ℝ)
(u : ℕ → ℝ)
(hu : u 0 = a ∧ (∀ n : ℕ, u (n + 1) = 2 * u n - n ^ 2))
: (∀ n : ℕ, u n > 0) ↔ a ∈ putnam_1980_b3_solution := by
Problem putnam_1980_b4 (set_theory, combinatorics)

Let $X$ be a finite set with at least $10$ elements; for each $i \in \{0, 1, ..., 1065\}$, let $A_i \subseteq X$ satisfy $|A_i| > \frac{1}{2}|X|$. Prove that there exist $10$ elements $x_1, x_2, \dots, x_{10} \in X$ such that each $A_i$ contains at least one of $x_1, x_2, \dots, x_{10}$.

Solution: None.

Lean 4 formalization:
import Mathlib
theorem putnam_1980_b4
{T : Type}
(X : Finset T)
(A : Fin 1066 → Finset T)
(hX : X.card ≥ 10)
(hA : ∀ i : Fin 1066, A i ⊆ X ∧ (A i).card > ((1 : ℚ)/2) * X.card)
: ∃ Y : Finset T, Y ⊆ X ∧ Y.card = 10 ∧ ∀ i : Fin 1066, ∃ y ∈ Y, y ∈ A i := by
Problem putnam_1980_b5 (analysis, algebra)

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?

Solution: $S_t$ is closed under multiplication if and only if $1 \ge t$.

Lean 4 formalization:
import Mathlib
open Set
abbrev putnam_1980_b5_solution : ℝ → Prop := sorry
theorem putnam_1980_b5
    (T : Set ℝ)
    (hT : T = Icc 0 1)
    (P : ℝ → (ℝ → ℝ) → Prop)
    (IsConvex : (ℝ → ℝ) → Prop)
    (S : ℝ → Set (ℝ → ℝ))
    (P_def : ∀ t f, P t f ↔ f 1 - 2*f (2/3) + f (1/3) ≥ t*(f (2/3) - 2*f (1/3) + f 0))
    (IsConvex_def : ∀ f, IsConvex f ↔ ∀ u ∈ T, ∀ v ∈ T, ∀ s ∈ T, f (s*u + (1 - s)*v) ≤ s*(f u) + (1 - s)*(f v))
    (hS : S = fun t : ℝ => {f : ℝ → ℝ | (∀ x ∈ T, f x ≥ 0) ∧ StrictMonoOn f T ∧ IsConvex f ∧ ContinuousOn f T ∧ P t f})
    (t : ℝ) (ht : t ≥ 0) :
    putnam_1980_b5_solution t ↔ (∀ f ∈ S t, ∀ g ∈ S t, f * g ∈ S t) := by
Problem putnam_1980_b6 (number_theory, algebra)

For integers $d, n$ with $1 \le d \le n$, let $G(1, n) = \frac{1}{n}$ and $G(d, n) = \frac{d}{n}\sum_{i=d}^{n}G(d - 1, i - 1)$ for all $d > 1$. If $1 < d \le p$ for some prime $p$, prove that the reduced denominator of $G(d, p)$ is not divisible by $p$.

Solution: None.

Lean 4 formalization:
import Mathlib
open Set
theorem putnam_1980_b6
(G : ℤ × ℤ → ℚ)
(hG : ∀ d n : ℕ, d ≤ n → (d = 1 → G (d, n) = 1/(n : ℚ)) ∧ (d > 1 → G (d, n) = (d/(n : ℚ))*∑ i ∈ Finset.Icc d n, G ((d : ℤ) - 1, (i : ℤ) - 1)))
: ∀ d p : ℕ, 1 < d ∧ d ≤ p ∧ Prime p → ¬p ∣ (G (d, p)).den := by
Problem putnam_1981_a1 (analysis, number_theory)

Let $E(n)$ be the greatest integer $k$ such that $5^k$ divides $1^1 2^2 3^3 \cdots n^n$. Find $\lim_{n \rightarrow \infty} \frac{E(n)}{n^2}$.

Solution: The limit equals $\frac{1}{8}$.

Lean 4 formalization:
import Mathlib
open Topology Filter Set Polynomial Function
noncomputable abbrev putnam_1981_a1_solution : ℝ := sorry
theorem putnam_1981_a1
    (P : ℕ → ℕ → Prop)
    (hP : ∀ n k, P n k ↔ 5^k ∣ ∏ m ∈ Finset.Icc 1 n, (m^m : ℤ))
    (E : ℕ → ℕ)
    (hE : ∀ n ∈ Ici 1, P n (E n) ∧ ∀ k : ℕ, P n k → k ≤ E n) :
    Tendsto (fun n : ℕ => ((E n) : ℝ)/n^2) atTop (𝓝 putnam_1981_a1_solution) := by
Problem putnam_1981_a3 (analysis)

Does the limit $$lim_{t \rightarrow \infty}e^{-t}\int_{0}^{t}\int_{0}^{t}\frac{e^x - e^y}{x - y} dx dy$$exist?

Solution: The limit does not exist.

Lean 4 formalization:
import Mathlib
open Topology Filter Set Polynomial Function
abbrev putnam_1981_a3_solution : Prop := sorry
theorem putnam_1981_a3
(f : ℝ → ℝ)
(hf : f = fun t : ℝ => Real.exp (-t) * ∫ y in (Ico 0 t), ∫ x in (Ico 0 t), (Real.exp x - Real.exp y) / (x - y))
: (∃ L : ℝ, Tendsto f atTop (𝓝 L)) ↔ putnam_1981_a3_solution := by
Problem putnam_1981_a5 (algebra)

Let $P(x)$ be a polynomial with real coefficients; let $$Q(x) = (x^2 + 1)P(x)P'(x) + x((P(x))^2 + (P'(x))^2).$$
Given that $P$ has $n$ distinct real roots all greater than $1$, prove or disprove that $Q$ must have at least $2n - 1$ distinct real roots.

Solution: $Q(x)$ must have at least $2n - 1$ distinct real roots.

Lean 4 formalization:
import Mathlib
open Topology Filter Set Polynomial Function
abbrev putnam_1981_a5_solution : Prop := sorry
theorem putnam_1981_a5
(Q : Polynomial ℝ → Polynomial ℝ)
(hQ : Q = fun P : Polynomial ℝ => (X^2 + 1)*P*(derivative P) + X*(P^2 + (derivative P)^2))
(n : Polynomial ℝ → ℝ)
(hn : n = fun P : Polynomial ℝ => ({x ∈ Ioi 1 | P.eval x = 0}.ncard : ℝ))
: (∀ P : Polynomial ℝ, {x : ℝ | (Q P).eval x = 0}.ncard ≥ 2*(n P) - 1) ↔ putnam_1981_a5_solution := by
Problem putnam_1981_b1 (analysis)

Find the value of $$\lim_{n \rightarrow \infty} \frac{1}{n^5}\sum_{h=1}^{n}\sum_{k=1}^{n}(5h^4 - 18h^2k^2 + 5k^4).$$

Solution: The limit equals $-1$.

Lean 4 formalization:
import Mathlib
open Topology Filter Set Polynomial Function
abbrev putnam_1981_b1_solution : ℝ := sorry
theorem putnam_1981_b1
(f : ℕ → ℝ)
(hf : f = fun n : ℕ => ((1 : ℝ)/n^5) * ∑ h ∈ Finset.Icc 1 n, ∑ k ∈ Finset.Icc 1 n, (5*(h : ℝ)^4 - 18*h^2*k^2 + 5*k^4))
: Tendsto f atTop (𝓝 putnam_1981_b1_solution) := by
Problem putnam_1981_b2 (algebra)

Determine the minimum value attained by $$(r - 1)^2 + (\frac{s}{r} - 1)^2 + (\frac{t}{s} - 1)^2 + (\frac{4}{t} - 1)^2$$ across all choices of real $r$, $s$, and $t$ that satisfy $1 \le r \le s \le t \le 4$.

Solution: The minimum is $12 - 8\sqrt{2}$.

Lean 4 formalization:
import Mathlib
open Topology Filter Set Polynomial Function
noncomputable abbrev putnam_1981_b2_solution : ℝ := sorry
theorem putnam_1981_b2
    (P : ℝ × ℝ × ℝ → Prop)
    (hP : P = fun (r, s, t) => 1 ≤ r ∧ r ≤ s ∧ s ≤ t ∧ t ≤ 4)
    (f : ℝ × ℝ × ℝ → ℝ)
    (hf : f = fun (r, s, t) => (r - 1)^2 + (s/r - 1)^2 + (t/s - 1)^2 + (4/t - 1)^2) :
    IsLeast {y | ∃ r s t, P (r, s, t) ∧ f (r, s, t) = y} putnam_1981_b2_solution := by
Problem putnam_1981_b3 (number_theory)

Prove that, for infinitely many positive integers $n$, all primes $p$ that divide $n^2 + 3$ also divide $k^2 + 3$ for some integer $k$ such that $k^2 < n$.

Solution: None.

Lean 4 formalization:
import Mathlib
open Topology Filter Set Polynomial Function
theorem putnam_1981_b3
    (P : ℕ → Prop)
    (hP : ∀ n, P n ↔
      ∀ p : ℕ, (Nat.Prime p ∧ p ∣ n^2 + 3) →
        ∃ k : ℕ, (p : ℤ) ∣ (k : ℤ)^2 + 3 ∧ k^2 < n) :
    ∀ n : ℕ, ∃ m : ℕ, (m : ℤ) > n ∧ P m := by
Problem putnam_1981_b4 (linear_algebra)

Let $V$ be a set of $5$ by $7$ matrices, with real entries and with the property that $rA+sB \in V$ whenever $A,B \in V$ and $r$ and $s$ are scalars (i.e., real numbers). \emph{Prove or disprove} the following assertion: If $V$ contains matrices of ranks $0$, $1$, $2$, $4$, and $5$, then it also contains a matrix of rank $3$. [The rank of a nonzero matrix $M$ is the largest $k$ such that the entries of some $k$ rows and some $k$ columns form a $k$ by $k$ matrix with a nonzero determinant.]

Solution: Show that the assertion is false.

Lean 4 formalization:
import Mathlib
open Topology Filter Set Polynomial Function
abbrev putnam_1981_b4_solution : Prop := sorry
theorem putnam_1981_b4
    (VAB : Set (Matrix (Fin 5) (Fin 7) ℝ) → Prop)
    (Vrank : Set (Matrix (Fin 5) (Fin 7) ℝ) → ℕ → Prop)
    (hVAB : ∀ V, VAB V = (∀ A ∈ V, ∀ B ∈ V, ∀ r s : ℝ, r • A + s • B ∈ V))
    (hVrank : ∀ V k, Vrank V k = ∃ A ∈ V, A.rank = k) :
    putnam_1981_b4_solution ↔
    (∀ V,
      VAB V → Vrank V 0 → Vrank V 1 →
      Vrank V 2 → Vrank V 4 → Vrank V 5 →
    Vrank V 3) := by
Problem putnam_1981_b5 (analysis, algebra)

Let $B(n)$ be the number of ones in the base two expression for the positive integer $n$. For example, $B(6)=B(110_2)=2$ and $B(15)=B(1111_2)=4$. Determine whether or not $\exp \left(\sum_{n=1}^\infty \frac{B(n)}{n(n+1)}\right)$ is a rational number. Here $\exp(x)$ denotes $e^x$.

Solution: Show that the expression is a rational number.

Lean 4 formalization:
import Mathlib
open Topology Filter Set Polynomial Function
abbrev putnam_1981_b5_solution : Prop := sorry
theorem putnam_1981_b5
(sumbits : List ℕ → ℤ)
(B : ℕ → ℤ)
(hsumbits : ∀ bits : List ℕ, sumbits bits = ∑ i : Fin bits.length, (bits[i] : ℤ))
(hB : ∀ n > 0, B n = sumbits (Nat.digits 2 n))
: (∃ q : ℚ, Real.exp (∑' n : Set.Ici 1, B n / ((n : ℝ) * ((n : ℝ) + 1))) = q) ↔ putnam_1981_b5_solution := by
Problem putnam_1982_a2 (algebra)

Let $B_n(x) = 1^x + 2^x + \dots + n^x$ and let $f(n) = \frac{B_n(\log_n 2)}{(n \log_2 n)^2}$. Does $f(2) + f(3) + f(4) + \dots$ converge?

Solution: Prove that the series converges.

Lean 4 formalization:
import Mathlib
open Set Function Filter Topology Polynomial Real
abbrev putnam_1982_a2_solution : Prop := sorry
theorem putnam_1982_a2
(B : ℕ → ℝ → ℝ)
(hB : B = fun (n : ℕ) (x : ℝ) ↦ ∑ k ∈ Finset.Icc 1 n, (k : ℝ) ^ x)
(f : ℕ → ℝ)
(hf : f = fun n ↦ B n (logb n 2) / (n * logb 2 n) ^ 2)
: (∃ L : ℝ, Tendsto (fun N ↦ ∑ j ∈ Finset.Icc 2 N, f j) atTop (𝓝 L)) ↔ putnam_1982_a2_solution := by
Problem putnam_1982_a3 (analysis)

Evaluate $\int_0^{\infty} \frac{\tan^{-1}(\pi x) - \tan^{-1} x}{x} \, dx$.

Solution: Show that the integral evaluates to $\frac{\pi}{2} \ln \pi$.

Lean 4 formalization:
import Mathlib
open Set Function Filter Topology Polynomial Real
noncomputable abbrev putnam_1982_a3_solution : ℝ := sorry
theorem putnam_1982_a3 :
  Tendsto (fun t ↦ ∫ x in (0)..t, (arctan (Real.pi * x) - arctan x) / x) atTop (𝓝 putnam_1982_a3_solution) := by
Problem putnam_1982_a4 (analysis)

Assume that the system of simultaneous differentiable equations \[y' = -z^3, z' = y^3\] with the initial conditions $y(0) = 1, z(0) = 0$ has a unique solution $y = f(x), z = g(x)$ defined for all real $x$. Prove that there exists a positive constant $L$ such that for all real $x$, \[f(x) + L = f(x), g(x + L) = g(x).\]

Solution: None.

Lean 4 formalization:
import Mathlib
open Function Filter Topology
theorem putnam_1982_a4
    (hdiffeq : (ℝ → ℝ) → (ℝ → ℝ) → Prop)
    (hdiffeq_def : ∀ y z,
      hdiffeq y z ↔
        y 0 = 1 ∧ z 0 = 0 ∧
        ContDiff ℝ 1 y ∧ ContDiff ℝ 1 z ∧
        (∀ x : ℝ, deriv y x = -1 * (z x)^3 ∧ deriv z x = (y x)^3))
    (f g : ℝ → ℝ)
    (hfgsat : hdiffeq f g)
    (hfgonly : ¬(∃ f' g' : ℝ → ℝ, (f ≠ f' ∨ g ≠ g') ∧ hdiffeq f' g')) :
    ∃ L : ℝ, L > 0 ∧ Function.Periodic f L ∧ Function.Periodic g L := by
Problem putnam_1982_a5 (algebra)

Let $a, b, c, d$ be positive integers satisfying $a + c \leq 1982$ and $\frac{a}{b} + \frac{c}{d} < 1$. Prove that $1 - \frac{a}{b} - \frac{c}{d} > \frac{1}{1983^3}$.

Solution: None.

Lean 4 formalization:
import Mathlib
theorem putnam_1982_a5
(a b c d : ℤ)
(hpos : a > 0 ∧ b > 0 ∧ c > 0 ∧ d > 0)
(hac : a + c ≤ 1982)
(hfrac : (a : ℝ) / b + (c : ℝ) / d < 1)
: (1 - (a : ℝ) / b - (c : ℝ) / d > 1 / 1983 ^ 3) := by
Problem putnam_1982_a6 (analysis)

Let $b$ be a bijection from the positive integers to the positive integers. Also, let $x_1, x_2, x_3, \dots$ be an infinite sequence of real numbers with the following properties:
\begin{enumerate}
\item
$|x_n|$ is a strictly decreasing function of $n$;
\item
$\lim_{n \rightarrow \infty} |b(n) - n| \cdot |x_n| = 0$;
\item
$\lim_{n \rightarrow \infty}\sum_{k = 1}^{n} x_k = 1$.
\end{enumerate}
Prove or disprove: these conditions imply that $$\lim_{n \rightarrow \infty} \sum_{k = 1}^{n} x_{b(k)} = 1.$$

Solution: The limit need not equal $1$.

Lean 4 formalization:
import Mathlib
open Set Function Filter Topology Polynomial Real
abbrev putnam_1982_a6_solution : Prop := sorry
theorem putnam_1982_a6 :
  (∀ b : ℕ → ℕ,
    ∀ x : ℕ → ℝ,
      BijOn b (Ici 1) (Ici 1) →
      StrictAntiOn (fun n : ℕ => |x n|) (Ici 1) →
      Tendsto (fun n : ℕ => |b n - (n : ℤ)| * |x n|) atTop (𝓝 0) →
      Tendsto (fun n : ℕ => ∑ k ∈ Finset.Icc 1 n, x k) atTop (𝓝 1) →
      Tendsto (fun n : ℕ => ∑ k ∈ Finset.Icc 1 n, x (b k)) atTop (𝓝 1))
  ↔ putnam_1982_a6_solution := by
Problem putnam_1982_b2 (analysis)

Let $A(x, y)$ denote the number of points $(m, n)$ with integer coordinates $m$ and $n$ where $m^2 + n^2 \le x^2 + y^2$. Also, let $g = \sum_{k = 0}^{\infty} e^{-k^2}$. Express the value $$\int_{-\infty}^{\infty}\int_{-\infty}^{\infty} A(x, y)e^{-x^2 - y^2} dx dy$$ as a polynomial in $g$.

Solution: The desired polynomial is $\pi(2g - 1)^2$.

Lean 4 formalization:
import Mathlib
open Set Function Filter Topology Polynomial Real
noncomputable abbrev putnam_1982_b2_solution : Polynomial ℝ := sorry
theorem putnam_1982_b2
(A : ℝ × ℝ → ℕ)
(g I : ℝ)
(hA : A = fun (x, y) => {(m, n) : ℤ × ℤ | m^2 + n^2 ≤ x^2 + y^2}.ncard)
(hg : g = ∑' k : ℕ, Real.exp (-k^2))
(hI : I = ∫ y : ℝ, ∫ x : ℝ, A (x, y) * Real.exp (-x^2 - y^2))
: I = putnam_1982_b2_solution.eval g := by
Problem putnam_1982_b3 (analysis, number_theory, probability)

Let $p_n$ denote the probability that $c + d$ will be a perfect square if $c$ and $d$ are selected independently and uniformly at random from $\{1, 2, 3, \dots, n\}$. Express $\lim_{n \rightarrow \infty} p_n \sqrt{n}$ in the form $r(\sqrt{s} - t)$ for integers $s$ and $t$ and rational $r$.

Solution: The limit equals $\frac{4}{3}(\sqrt{2} - 1)$.

Lean 4 formalization:
import Mathlib
open Set Function Filter Topology Polynomial Real
noncomputable abbrev putnam_1982_b3_solution : ℝ := sorry
theorem putnam_1982_b3
(p : ℕ → ℝ)
(hp : p = fun n : ℕ => ({(c, d) : Finset.Icc 1 n × Finset.Icc 1 n | ∃ m : ℕ, m^2 = c + d}.ncard : ℝ) / n^2)
: Tendsto (fun n : ℕ => p n * Real.sqrt n) atTop (𝓝 putnam_1982_b3_solution) := by
Problem putnam_1982_b4 (number_theory)

Let $n_1, n_2, \dots, n_s$ be distinct integers such that, for every integer $k$, $n_1n_2\cdots n_s$ divides $(n_1 + k)(n_2 + k) \cdots (n_s + k)$. Prove or provide a counterexample to the following claims:
\begin{enumerate}
\item
For some $i$, $|n_i| = 1$.
\item
If all $n_i$ are positive, then $\{n_1, n_2, \dots, n_s\} = \{1, 2, \dots, s\}$.
\end{enumerate}

Solution: Both claims are true.

Lean 4 formalization:
import Mathlib
open Set Function Filter Topology Polynomial Real
abbrev putnam_1982_b4_solution : Prop × Prop := sorry
theorem putnam_1982_b4
    (P : Finset ℤ → Prop)
    (P_def : ∀ n, P n ↔ n.Nonempty ∧ ∀ k, ∏ i ∈ n, i ∣ ∏ i ∈ n, (i + k)) :
    ((∀ n, P n → 1 ∈ n ∨ -1 ∈ n) ↔ putnam_1982_b4_solution.1) ∧
    ((∀ n, P n → (∀ i ∈ n, 0 < i) → n = Finset.Icc (1 : ℤ) n.card) ↔ putnam_1982_b4_solution.2) := by
Problem putnam_1982_b5 (analysis)

For all $x > e^e$, let $S = u_0, u_1, \dots$ be a recursively defined sequence with $u_0 = e$ and $u_{n+1} = \log_{u_n} x$ for all $n \ge 0$. Prove that $S_x$ converges to some real number $g(x)$ and that this function $g$ is continuous for $x > e^e$.

Solution: None.

Lean 4 formalization:
import Mathlib
open Set Function Filter Topology Polynomial Real
theorem putnam_1982_b5
(T : Set ℝ)
(hT : T = Ioi (Real.exp (Real.exp 1)))
(S : ℝ → ℕ → ℝ)
(hS : ∀ x ∈ T, S x 0 = (Real.exp 1) ∧ ∀ n : ℕ, S x (n + 1) = Real.logb (S x n) x)
(g : ℝ → ℝ)
: ∀ x ∈ T, (∃ L : ℝ, Tendsto (S x) atTop (𝓝 L)) ∧
(∀ x ∈ T, Tendsto (S x) atTop (𝓝 (g x))) → ContinuousOn g T := by