Dataset Viewer
Auto-converted to Parquet Duplicate
Problem ID
stringlengths
6
27
Problem
stringlengths
60
1.99k
⌀
Lean Statement
stringlengths
74
27.3k
Category
stringclasses
1 value
Level
stringclasses
4 values
Difficulty
float64
6
9
⌀
Source
stringclasses
128 values
Formalization
float64
compfiles-Imo1963P6
Five students A, B, C, D, E were placed 1 to 5 in a contest with no ties. One prediction was that the result would be the order A, B, C, D, E. But no student finished in the position predicted, and no two students predicted to finish consecutively did so. For example, the outcome for C and D was not 1, 2 (respectively)...
import Mathlib /-! # International Mathematical Olympiad 1963, Problem 6 Five students A, B, C, D, E were placed 1 to 5 in a contest with no ties. One prediction was that the result would be the order A, B, C, D, E. But no student finished in the position predicted, and no two students predicted to finish consecutive...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1963, Problem 6
null
compfiles-Imo1964P4
Seventeen people correspond by mail with one another -- each one with all the rest. In their letters only three different topics are discussed. Each pair of correspondents deals with only one of the topics. Prove that there are at least three people who write to each other about the same topic.
import Mathlib /-! # International Mathematical Olympiad 1964, Problem 4 Seventeen people correspond by mail with one another -- each one with all the rest. In their letters only three different topics are discussed. Each pair of correspondents deals with only one of the topics. Prove that there are at least three pe...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1964, Problem 4
null
compfiles-Imo1966P1
In a mathematical contest, three problems, A, B, C were posed. Among the participants there were 25 students who solved at least one problem each. Of all the contestants who did not solve problem A, the number who solved B was twice the number who solved C. The number of students who solved only problem A was one more ...
import Mathlib /-! # International Mathematical Olympiad 1966, Problem 1. In a mathematical contest, three problems, A, B, C were posed. Among the participants there were 25 students who solved at least one problem each. Of all the contestants who did not solve problem A, the number who solved B was twice the number ...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1966, Problem 1.
null
compfiles-Imo1970P6
In a plane there are 100 points, no three of which are collinear. Consider all possible triangles having these points as vertices. Prove that no more that 70% of these triangles are acute.
import Mathlib /-! # International Mathematical Olympiad 1970, Problem 6 In a plane there are 100 points, no three of which are collinear. Consider all possible triangles having these points as vertices. Prove that no more that 70% of these triangles are acute. -/ namespace Imo1970P6 open scoped EuclideanGeometry R...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1970, Problem 6
null
compfiles-Imo1971P5
Prove that for every natural number m there exists a nonempty finite set S of points in the plane with the following property: For every point s in S, there are exactly m points which are at a unit distance from s.
import Mathlib /-! # International Mathematical Olympiad 1971, Problem 5 Prove that for every natural number m there exists a nonempty finite set S of points in the plane with the following property: For every point s in S, there are exactly m points which are at a unit distance from s. -/ namespace Imo1971P5 open ...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1971, Problem 5
null
compfiles-Imo1972P1
Prove that from a set of ten distinct two-digit numbers (in decimal), it is possible to select two disjoint subsets whose members have the same sum.
import Mathlib /-! # International Mathematical Olympiad 1972, Problem 1 Prove that from a set of ten distinct two-digit numbers (in decimal), it is possible to select two disjoint subsets whose members have the same sum. -/ namespace Imo1972P1 theorem imo1972_p1 (S : Finset ℕ) (Scard : S.card = 10) (Sdigit...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1972, Problem 1
null
compfiles-Imo1974P1
Three players $A, B$ and $C$ play the following game: * On each of three cards an integer is written. * These three numbers $p, q, r$ satisfy $0 < p < q < r$. * The three cards are shuffled and one is dealt to each player. * Each then receives the number of counters indicated by the card he holds. * Then the cards are...
import Mathlib /-! # International Mathematical Olympiad 1974, Problem 1 Three players $A, B$ and $C$ play the following game: * On each of three cards an integer is written. * These three numbers $p, q, r$ satisfy $0 < p < q < r$. * The three cards are shuffled and one is dealt to each player. * Each then receives...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1974, Problem 1
null
compfiles-Imo1974P4
Consider decompositions of an 8 × 8 chessboard into p non-overlapping rectangles, subject to the following conditions: (i) Each rectangle has as many white squares as black squares. (ii) If aᵢ is the number of white squares in the i-th rectangle, then a₁ < a₂ < ... < aₚ. Find the maximum value of p for which suc...
import Mathlib /-! # International Mathematical Olympiad 1974, Problem 4 Consider decompositions of an 8 × 8 chessboard into p non-overlapping rectangles, subject to the following conditions: (i) Each rectangle has as many white squares as black squares. (ii) If aᵢ is the number of white squares in the i-th rectangl...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1974, Problem 4
null
compfiles-Imo1975P5
Determine, with proof, whether or not one can find $1975$ points on the circumference of a circle with unit radius such that the distance between any two of them is a rational number.
import Mathlib /-! # International Mathematical Olympiad 1975, Problem 5 Determine, with proof, whether or not one can find $1975$ points on the circumference of a circle with unit radius such that the distance between any two of them is a rational number. -/ namespace Imo1975P5 abbrev constructible : Bool := true ...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1975, Problem 5
null
compfiles-Imo1976P5
n is a positive integer and m = 2n. aᵢⱼ = 0, 1 or -1 for 1 ≤ i ≤ n, 1 ≤ j ≤ m. The m unknowns x₁, x₂, ... , xₘ satisfy the n equations: aᵢ₁x₁ + aᵢ₂x₂ + ... + aᵢₘxₘ = 0, for i = 1, 2, ... , n. Prove that the system has a solution in integers of absolute value at most m, not all zero.
import Mathlib /-! # International Mathematical Olympiad 1976, Problem 5 n is a positive integer and m = 2n. aᵢⱼ = 0, 1 or -1 for 1 ≤ i ≤ n, 1 ≤ j ≤ m. The m unknowns x₁, x₂, ... , xₘ satisfy the n equations: aᵢ₁x₁ + aᵢ₂x₂ + ... + aᵢₘxₘ = 0, for i = 1, 2, ... , n. Prove that the system has a solution in integers ...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1976, Problem 5
null
compfiles-Imo1977P2
In a finite sequence of real numbers the sum of any seven successive terms is negative and the sum of any eleven successive terms is positive. Determine the maximum number of terms in the sequence.
import Mathlib /-! # International Mathematical Olympiad 1977, Problem 2 In a finite sequence of real numbers the sum of any seven successive terms is negative and the sum of any eleven successive terms is positive. Determine the maximum number of terms in the sequence. -/ namespace Imo1977P2 def sum_successive_te...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1977, Problem 2
null
compfiles-Imo1978P6
An international society has its members from six different countries. The list of members has 1978 names, numbered $1, 2, \ldots, 1978$. Prove that there is at least one member whose number is the sum of the numbers of two (not necessarily distinct) members from his own country.
import Mathlib /-! # International Mathematical Olympiad 1978, Problem 6 An international society has its members from six different countries. The list of members has 1978 names, numbered $1, 2, \ldots, 1978$. Prove that there is at least one member whose number is the sum of the numbers of two (not necessarily dist...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1978, Problem 6
null
compfiles-Imo1979P2
A prism with pentagons $A_1A_2A_3A_4A_5$ and $B_1B_2B_3B_4B_5$ as the top and bottom faces is given. Each side of the two pentagons and each of the 25 segments $A_iB_j$ is colored red or green. Every triangle whose vertices are vertices of the prism and whose sides have all been colored has two sides of a different col...
import Mathlib /-! # International Mathematical Olympiad 1979, Problem 2 A prism with pentagons $A_1A_2A_3A_4A_5$ and $B_1B_2B_3B_4B_5$ as the top and bottom faces is given. Each side of the two pentagons and each of the 25 segments $A_iB_j$ is colored red or green. Every triangle whose vertices are vertices of the p...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1979, Problem 2
null
compfiles-Imo1979P6
Let $A$ and $E$ be opposite vertices of an octagon. A frog starts at vertex $A.$ From any vertex except $E$ it jumps to one of the two adjacent vertices. When it reaches $E$ it stops. Let $a_n$ be the number of distinct paths of exactly $n$ jumps ending at $E$. Prove that: \[a_{2n-1}=0, \quad a_{2n}={(2+\sqrt2)^{n-1} -...
import Mathlib /-! # International Mathematical Olympiad 1979, Problem 6 Let $A$ and $E$ be opposite vertices of an octagon. A frog starts at vertex $A.$ From any vertex except $E$ it jumps to one of the two adjacent vertices. When it reaches $E$ it stops. Let $a_n$ be the number of distinct paths of exactly $n$ jump...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1979, Problem 6
null
compfiles-Imo1981P2
Let $1 \le r \le n$ and consider all subsets of $r$ elements of the set $\{ 1, 2, \ldots , n \}$. Each of these subsets has a smallest member. Let $F(n,r)$ denote the arithmetic mean of these smallest numbers; prove that \[ F(n,r) = \frac{n+1}{r+1}. \]
import Mathlib namespace Imo1981P2 /-! # International Mathematical Olympiad 1981, Problem 2 Let $1 \le r \le n$ and consider all subsets of $r$ elements of the set $\{ 1, 2, \ldots , n \}$. Each of these subsets has a smallest member. Let $F(n,r)$ denote the arithmetic mean of these smallest numbers; prove that \[ ...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1981, Problem 2
null
compfiles-Imo1983P5
Is it possible to choose $1983$ distinct positive integers, all less than or equal to $10^5$, no three of which are consecutive terms of an arithmetic progression? Justify your answer.
import Mathlib /-! # International Mathematical Olympiad 1983, Problem 5 Is it possible to choose $1983$ distinct positive integers, all less than or equal to $10^5$, no three of which are consecutive terms of an arithmetic progression? Justify your answer. -/ namespace Imo1983P5 theorem imo1983_p5 : ∃ S : Finse...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1983, Problem 5
null
compfiles-Imo1984P3
In the plane two different points O and A are given. For each point X of the plane, other than O, denote by a(X) the measure of the angle between OA and OX in radians, counterclockwise from OA (0 ≤ a(X) < 2π). Let C(X) be the circle with center O and radius of length OX + a(X)/OX. Each point of the plane is colored by ...
import Mathlib /-! # International Mathematical Olympiad 1984, Problem 3 In the plane two different points O and A are given. For each point X of the plane, other than O, denote by a(X) the measure of the angle between OA and OX in radians, counterclockwise from OA (0 ≤ a(X) < 2π). Let C(X) be the circle with center ...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1984, Problem 3
null
compfiles-Imo1985P2
Fix a natural number $n ≥ 3$ and define $N=\{1, 2, 3, \dots, n-1\}$. Fix another natural number $j ∈ N$ coprime to $n$. Each number in $N$ is now colored with one of two colors, say red or black, so that: 1. $i$ and $n-i$ always receive the same color, and 2. $i$ and $|j-i|$ receive the same color for all $i ∈ N, i ≠ ...
import Mathlib /-! # International Mathematical Olympiad 1985, Problem 2 Fix a natural number $n ≥ 3$ and define $N=\{1, 2, 3, \dots, n-1\}$. Fix another natural number $j ∈ N$ coprime to $n$. Each number in $N$ is now colored with one of two colors, say red or black, so that: 1. $i$ and $n-i$ always receive the sam...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1985, Problem 2
null
compfiles-Imo1986P3
To each vertex of a regular pentagon, an integer is assigned, in such a way that the sum of all five numbers is positive. If three consecutive vertices are assigned the numbers $x, y, z$ respectively and $y < 0$, then the following operation is allowed: $x, y, z$ are replaced by $x+y, -y, z+y$ respectively. Such an ope...
import Mathlib /-! # International Mathematical Olympiad 1986, Problem 3 To each vertex of a regular pentagon, an integer is assigned, in such a way that the sum of all five numbers is positive. If three consecutive vertices are assigned the numbers $x, y, z$ respectively and $y < 0$, then the following operation is ...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1986, Problem 3
null
compfiles-Imo1986P6
Given a finite set of points in the plane, each with integer coordinates, is it always possible to color the points red or white so that for any straight line L parallel to one of the coordinate axes the difference (in absolute value) between the numbers of white and red points on L is not greater than 1?
import Mathlib /-! # International Mathematical Olympiad 1986, Problem 6 Given a finite set of points in the plane, each with integer coordinates, is it always possible to color the points red or white so that for any straight line L parallel to one of the coordinate axes the difference (in absolute value) between th...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1986, Problem 6
null
compfiles-Imo1987P1
Let $p_{n, k}$ be the number of permutations of a set of cardinality `n ≥ 1` that fix exactly `k` elements. Prove that $∑_{k=0}^n k p_{n,k}=n!$.
import Mathlib /-! # International Mathematical Olympiad 1987, Problem 1 Let $p_{n, k}$ be the number of permutations of a set of cardinality `n ≥ 1` that fix exactly `k` elements. Prove that $∑_{k=0}^n k p_{n,k}=n!$. -/ namespace Imo1987P1 /-- Given `α : Type*` and `k : ℕ`, `fiber α k` is the set of permutations o...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1987, Problem 1
null
compfiles-Imo1988P2
Let n be a positive integer and let A₁, A₂, ..., A₂ₙ₊₁ be subsets of a set B. Suppose that (i) each Aᵢ has exactly 2n elements, (ii) each intersection Aᵢ ∩ Aⱼ (i ≠ j) contains exactly one element, and (iii) every element of B belongs to at least two of the Aᵢ. For which values of n can one assign to every element of ...
import Mathlib /-! # International Mathematical Olympiad 1988, Problem 2 Let n be a positive integer and let A₁, A₂, ..., A₂ₙ₊₁ be subsets of a set B. Suppose that (i) each Aᵢ has exactly 2n elements, (ii) each intersection Aᵢ ∩ Aⱼ (i ≠ j) contains exactly one element, and (iii) every element of B belongs to at leas...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1988, Problem 2
null
compfiles-Imo1989P1
Prove that the integers from 1 to 1989 can be partitioned in 117 sets of 17 elements each, all with the same sum of elements.
import Mathlib /-! # International Mathematical Olympiad 1989, Problem 1 Prove that the integers from 1 to 1989 can be partitioned in 117 sets of 17 elements each, all with the same sum of elements. -/ namespace Imo1989P1 abbrev S := Finset.Icc 1 1989 theorem imo1989_p1 : ∃ (P : Finpartition S), P.parts.card ...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1989, Problem 1
null
compfiles-Imo1989P3
Let $n$ and $k$ be positive integers and let $S$ be a set of $n$ points in the plane such that (i) no three points of $S$ are collinear, and (ii) for each point $P$ of $S$ there are at least $k$ points of $S$ equidistant from $P$. Prove that $k < \frac{1}{2} + \sqrt{2n}$.
import Mathlib /-! # International Mathematical Olympiad 1989, Problem 3 Let $n$ and $k$ be positive integers and let $S$ be a set of $n$ points in the plane such that (i) no three points of $S$ are collinear, and (ii) for each point $P$ of $S$ there are at least $k$ points of $S$ equidistant from $P$. Pro...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1989, Problem 3
null
compfiles-Imo1990P2
Take n ≥ 3 and consider a set E of 2n - 1 distinct points on a circle. Suppose that exactly k of these points are to be colored black. Such a coloring is said to be "good" if there is at least one pair of black points such that the interior of one of the arcs between them contains exactly n points from E. Find the smal...
import Mathlib /-! # International Mathematical Olympiad 1990, Problem 2 Take n ≥ 3 and consider a set E of 2n - 1 distinct points on a circle. Suppose that exactly k of these points are to be colored black. Such a coloring is said to be "good" if there is at least one pair of black points such that the interior of o...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1990, Problem 2
null
compfiles-Imo1990P5
Given an initial integer n₀ > 1, two players A and B choose integers n₁, n₂, n₃, ... alternately according to the following rules: Knowing n₂ₖ, A chooses any integer n₂ₖ₊₁ such that n₂ₖ ≤ n₂ₖ₊₁ ≤ n₂ₖ². Knowing n₂ₖ₊₁, B chooses any integer n₂ₖ₊₂ such that n₂ₖ₊₁/n₂ₖ₊₂ = p^r for some prime p and integer r ≥ 1. Player A...
import Mathlib /-! # International Mathematical Olympiad 1990, Problem 5 Given an initial integer n₀ > 1, two players A and B choose integers n₁, n₂, n₃, ... alternately according to the following rules: Knowing n₂ₖ, A chooses any integer n₂ₖ₊₁ such that n₂ₖ ≤ n₂ₖ₊₁ ≤ n₂ₖ². Knowing n₂ₖ₊₁, B chooses any integer n₂ₖ₊...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1990, Problem 5
null
compfiles-Imo1991P3
Let S = {1, 2, ..., 280}. Find the smallest natural number n such that every n-element subset of S contains five numbers which are pairwise relatively prime.
import Mathlib /-! # International Mathematical Olympiad 1991, Problem 3 Let S = {1, 2, ..., 280}. Find the smallest natural number n such that every n-element subset of S contains five numbers which are pairwise relatively prime. -/ namespace Imo1991P3 abbrev solution : ℕ := 217 theorem imo1991_p3 : IsLeast ...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1991, Problem 3
null
compfiles-Imo1991P4
Suppose G is a connected graph with k edges. Prove that it is possible to label the edges 1, 2, ... , k in such a way that at each vertex which belongs to two or more edges, the greatest common divisor of the integers labeling those edges is equal to 1.
import Mathlib /-! # International Mathematical Olympiad 1991, Problem 4 Suppose G is a connected graph with k edges. Prove that it is possible to label the edges 1, 2, ... , k in such a way that at each vertex which belongs to two or more edges, the greatest common divisor of the integers labeling those edges is equ...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1991, Problem 4
null
compfiles-Imo1992P3
Consider 9 points in space, no 4 coplanar. Each pair of points is joined by a line segment which is colored either blue or red or left uncolored. Find the smallest value of n such that whenever exactly n edges are colored, the set of colored edges necessarily contains a triangle all of whose edges have the same color.
import Mathlib /-! # International Mathematical Olympiad 1992, Problem 3 Consider 9 points in space, no 4 coplanar. Each pair of points is joined by a line segment which is colored either blue or red or left uncolored. Find the smallest value of n such that whenever exactly n edges are colored, the set of colored edg...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1992, Problem 3
null
compfiles-Imo1992P5
Let S be a finite set of points in three-dimensional space. Let Sx,Sy and Sz be the sets consisting of the orthogonal projections of the points of S onto the yz-plane, zx-plane and xy-plane, respectively. Prove that |S|²≤|Sx|·|Sy|·|Sz|. where |A| denotes the number of elements in the finite set |A|. (Note: The orthogon...
import Mathlib /-! # International Mathematical Olympiad 1992, Problem 5 Let S be a finite set of points in three-dimensional space. Let Sx,Sy and Sz be the sets consisting of the orthogonal projections of the points of S onto the yz-plane, zx-plane and xy-plane, respectively. Prove that |S|²≤|Sx|·|Sy|·|Sz|. where |A...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1992, Problem 5
null
compfiles-Imo1993P3
On an infinite chessboard a game is played as follows. At the start n² pieces are arranged in an n × n block of adjoining squares, one piece on each square. A move in the game is a jump in a horizontal or vertical direction over an adjacent occupied square to an unoccupied square immediately beyond. The piece which has...
import Mathlib /-! # International Mathematical Olympiad 1993, Problem 3 On an infinite chessboard a game is played as follows. At the start n² pieces are arranged in an n × n block of adjoining squares, one piece on each square. A move in the game is a jump in a horizontal or vertical direction over an adjacent occu...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1993, Problem 3
null
compfiles-Imo1994P1
Let `m` and `n` be two positive integers. Let `a₁, a₂, ..., aₘ` be `m` different numbers from the set `{1, 2, ..., n}` such that for any two indices `i` and `j` with `1 ≤ i ≤ j ≤ m` and `aᵢ + aⱼ ≤ n`, there exists an index `k` such that `aᵢ + aⱼ = aₖ`. Show that `(a₁+a₂+...+aₘ)/m ≥ (n+1)/2`
import Mathlib /-! # International Mathmatical Olympiad 1994, Problem 1 Let `m` and `n` be two positive integers. Let `a₁, a₂, ..., aₘ` be `m` different numbers from the set `{1, 2, ..., n}` such that for any two indices `i` and `j` with `1 ≤ i ≤ j ≤ m` and `aᵢ + aⱼ ≤ n`, there exists an index `k` such that `aᵢ + aⱼ ...
Combinatorics
1. Named contest
null
Compfiles: International Mathmatical Olympiad 1994, Problem 1
null
compfiles-Imo1995P6
Let p be an odd prime number. How many p-element subsets A of {1, 2, ..., 2p} are there, the sum of whose elements is divisible by p?
import Mathlib /-! # International Mathematical Olympiad 1995, Problem 6 Let p be an odd prime number. How many p-element subsets A of {1, 2, ..., 2p} are there, the sum of whose elements is divisible by p? -/ namespace Imo1995P6 abbrev solution (p : ℕ) : ℕ := 2 + (Nat.choose (2 * p) p - 2) / p theorem imo1995_p6...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1995, Problem 6
null
compfiles-Imo1997P4
An $n \times n$ matrix whose entries come from the set $S = \{1, 2, \ldots, 2n - 1\}$ is called a *silver matrix* if, for each $i = 1, \ldots, n$, the $i$-th row and the $i$-th column together contain all elements of $S$. Show that: (a) there is no silver matrix for $n = 1997$; (b) silver matrices exist for infin...
import Mathlib /-! # International Mathematical Olympiad 1997, Problem 4 An $n \times n$ matrix whose entries come from the set $S = \{1, 2, \ldots, 2n - 1\}$ is called a *silver matrix* if, for each $i = 1, \ldots, n$, the $i$-th row and the $i$-th column together contain all elements of $S$. Show that: (a) there...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1997, Problem 4
null
compfiles-Imo1997P6
For each positive integer n, let f(n) denote the number of ways of representing n as a sum of powers of 2 with non-negative integer exponents. Representations which differ only in the ordering of their summands are considered to be the same. For example, f(4) = 4, because 4 can be represented as 4, 2 + 2, 2 + 1 + 1 or ...
import Mathlib /-! # International Mathematical Olympiad 1997, Problem 6 For each positive integer n, let f(n) denote the number of ways of representing n as a sum of powers of 2 with non-negative integer exponents. Representations which differ only in the ordering of their summands are considered to be the same. For...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1997, Problem 6
null
compfiles-Imo1998P2
In a competition, there are `a` contestants and `b` judges, where `b ≥ 3` is an odd integer. Each judge rates each contestant as either "pass" or "fail". Suppose `k` is a number such that, for any two judges, their ratings coincide for at most `k` contestants. Prove that `k / a ≥ (b - 1) / (2b)`.
import Mathlib /-! # International Mathematical Olympiad 1998, Problem 2 In a competition, there are `a` contestants and `b` judges, where `b ≥ 3` is an odd integer. Each judge rates each contestant as either "pass" or "fail". Suppose `k` is a number such that, for any two judges, their ratings coincide for at most `...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1998, Problem 2
null
compfiles-Imo1999P3
Consider an `n × n` square board, where `n` is a fixed even positive integer. The board is divided into `n^2` unit squares. We say that two different squares on the board are adjacent if they have a common side. `N` unit squares on the board are marked in such a way that every square (marked or unmarked) on the board i...
import Mathlib /-! # International Mathematical Olympiad 1999, Problem 3 Consider an `n × n` square board, where `n` is a fixed even positive integer. The board is divided into `n^2` unit squares. We say that two different squares on the board are adjacent if they have a common side. `N` unit squares on the board are...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 1999, Problem 3
null
compfiles-Imo2000P3
Let n ≥ 2 be a positive integer and λ a positive real number. Initially there are n fleas on a horizontal line, not all at the same point. We define a move as choosing two fleas at some points A and B, with A to the left of B, and letting the flea from A jump over the flea from B to the point C so that BC/AB = λ. Dete...
import Mathlib /-! # International Mathematical Olympiad 2000, Problem 3 Let n ≥ 2 be a positive integer and λ a positive real number. Initially there are n fleas on a horizontal line, not all at the same point. We define a move as choosing two fleas at some points A and B, with A to the left of B, and letting the fl...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 2000, Problem 3
null
compfiles-Imo2014P5
For every positive integer n, the Bank of Cape Town issues coins of denomination 1/n. Given a finite collection of such coins (of not necessarily different denominations) with total value at most 99 + 1/2, prove that it is possible to split this collection into 100 or fewer groups, such that each group has total value ...
import Mathlib /-! # International Mathematical Olympiad 2014, Problem 5 For every positive integer n, the Bank of Cape Town issues coins of denomination 1/n. Given a finite collection of such coins (of not necessarily different denominations) with total value at most 99 + 1/2, prove that it is possible to split this...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 2014, Problem 5
null
compfiles-Imo2020P6
Consider an integer n > 1, and a set S of n points in the plane such that the distance between any two points in S is at least 1. Prove that there is a line l separating S such that the distance from any point of S to l is at least Ω(n ^ (-1/3)). (A line l separates a set of points S if some segment jointing two point...
import Mathlib /-! # International Mathematical Olympiad 2020, Problem 6 Consider an integer n > 1, and a set S of n points in the plane such that the distance between any two points in S is at least 1. Prove that there is a line l separating S such that the distance from any point of S to l is at least Ω(n ^ (-1/3))...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 2020, Problem 6
null
compfiles-Imo2025P6
Consider a 2025 × 2025 grid of unit squares. Matilda wishes to place on the grid some rectangular tiles, possibly of different sizes, such that each side of every tile lies on a grid line and every unit square is covered by at most one tile. Determine the minimum number of tiles Matilda needs to place so that each row ...
import Mathlib open Finset Function /-! # International Mathematical Olympiad 2025, Problem 6 Consider a 2025 × 2025 grid of unit squares. Matilda wishes to place on the grid some rectangular tiles, possibly of different sizes, such that each side of every tile lies on a grid line and every unit square is covered b...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 2025, Problem 6
null
compfiles-Imo2026P3
Let n be a positive integer. Liu Bang and Xiang Yu have a stick of length 1 and want to divide it between themselves. Liu marks at most n points on the stick, and then Xiang marks at most n points on the stick. The marked points are distinct. Then, the stick is cut at all marked points, creating a number of pieces. Aft...
import Mathlib /-! # International Mathematical Olympiad 2026, Problem 3 Let n be a positive integer. Liu Bang and Xiang Yu have a stick of length 1 and want to divide it between themselves. Liu marks at most n points on the stick, and then Xiang marks at most n points on the stick. The marked points are distinct. Th...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 2026, Problem 3
null
compfiles-Imo2026P4
Shan-Yu and Mulan are playing a game. Let θ be an angle with 0° < θ < 180° known to both players. Initially, Shan-Yu makes a paper triangle T with measurements of his choice. Then, they repeatedly perform the following steps: * If T has at least one angle measuring exactly θ, then the game stops and Mulan wins. * Ot...
import Mathlib /-! # International Mathematical Olympiad 2026, Problem 4 Shan-Yu and Mulan are playing a game. Let θ be an angle with 0° < θ < 180° known to both players. Initially, Shan-Yu makes a paper triangle T with measurements of his choice. Then, they repeatedly perform the following steps: * If T has at leas...
Combinatorics
1. Named contest
null
Compfiles: International Mathematical Olympiad 2026, Problem 4
null
compfiles-IntegersInACircle
null
import Mathlib /-! There are 101 positive integers arranged in a circle. Suppose that the integers sum to 300. Prove that there exists a contiguous subarray that sums to 200. https://mathstodon.xyz/@alexdbolton/110292738044661739 https://math.stackexchange.com/questions/282589/101-positive-integers-placed-on-a-circle...
Combinatorics
1. Named contest
null
Compfiles: IntegersInACircle
null
compfiles-KolmogorovStreams
null
import Mathlib /-! Puzzle referenced from this tweet: https://twitter.com/sigfpe/status/1474173467016589323 From the book _Out of their Minds: The Lives and Discoveries of 15 Great Computer Scientists_ by Dennis Shasha and Cathy Lazere. Problem: Suppose each (finite) word is either "decent" or "indecent". Given an...
Combinatorics
1. Named contest
null
Compfiles: KolmogorovStreams
null
compfiles-UK2024R1P1
An unreliable typist can guarantee that when they try to type a word with different letters, every letter of the word will appear exactly once in what they type, and each letter will occur at most one letter late (though it may occur more than one letter early). Thus, when trying to type MATHS, the typist may type MATH...
import Mathlib /-! # British Mathematical Olympiad 2024, Round 1, Problem 1 An unreliable typist can guarantee that when they try to type a word with different letters, every letter of the word will appear exactly once in what they type, and each letter will occur at most one letter late (though it may occur more tha...
Combinatorics
1. Named contest
null
Compfiles: British Mathematical Olympiad 2024, Round 1, Problem 1
null
compfiles-Usa1974P4
A, B, C play a series of games. Each game is between two players. The next game is between the winner and the person who was not playing. The series continues until one player has won two games. He wins the series. A is the weakest player, C the strongest. Each player has a fixed probability of winning against a given ...
import Mathlib /-! # USA Mathematical Olympiad 1974, Problem 4 A, B, C play a series of games. Each game is between two players. The next game is between the winner and the person who was not playing. The series continues until one player has won two games. He wins the series. A is the weakest player, C the strongest...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1974, Problem 4
null
compfiles-Usa1975P5
A pack of n cards, including three aces, is well shuffled. Cards are turned over in turn. Show that the expected number of cards that must be turned over to reach the second ace is (n+1)/2. ## Formalization notes We model the well-shuffled pack by the set of positions occupied by the three aces, which is uniformly di...
import Mathlib /-! # USA Mathematical Olympiad 1975, Problem 5 A pack of n cards, including three aces, is well shuffled. Cards are turned over in turn. Show that the expected number of cards that must be turned over to reach the second ace is (n+1)/2. ## Formalization notes We model the well-shuffled pack by the s...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1975, Problem 5
null
compfiles-Usa1978P5
There are 9 delegates at a conference, each speaking at most three languages. Given any three delegates, at least 2 speak a common language. Show that there are three delegates with a common language.
import Mathlib /-! # USA Mathematical Olympiad 1978, Problem 5 There are 9 delegates at a conference, each speaking at most three languages. Given any three delegates, at least 2 speak a common language. Show that there are three delegates with a common language. -/ namespace Usa1978P5 /-- Delegate `a` and delegate...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1978, Problem 5
null
compfiles-Usa1979P5
X has n members. Given n+1 subsets of X, each with 3 members, show that we can always find two which have just one member in common.
import Mathlib /-! # USA Mathematical Olympiad 1979, Problem 5 X has n members. Given n+1 subsets of X, each with 3 members, show that we can always find two which have just one member in common. -/ namespace Usa1979P5 open Finset theorem usa1979_p5 {α : Type*} [DecidableEq α] (n : ℕ) (X : Finset α) (hX : X.card ...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1979, Problem 5
null
compfiles-Usa1981P2
What is the largest number of towns that can meet the following criteria? Each pair is directly linked by just one of air, bus or train. At least one pair is linked by air, at least one pair by bus and at least one pair by train. No town has an air link, a bus link and a train link. No three towns, A, B, C are such tha...
import Mathlib /-! # USA Mathematical Olympiad 1981, Problem 2 What is the largest number of towns that can meet the following criteria? Each pair is directly linked by just one of air, bus or train. At least one pair is linked by air, at least one pair by bus and at least one pair by train. No town has an air link, ...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1981, Problem 2
null
compfiles-Usa1982P1
A graph has 1982 points. Given any four points, there is at least one joined to the other three. What is the smallest number of points which are joined to 1981 points?
import Mathlib /-! # USA Mathematical Olympiad 1982, Problem 1 A graph has 1982 points. Given any four points, there is at least one joined to the other three. What is the smallest number of points which are joined to 1981 points? -/ namespace Usa1982P1 open Classical /-- The hypothesis of the problem: among any f...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1982, Problem 1
null
compfiles-Usa1983P3
S₁, S₂, ..., Sₙ are subsets of the real line. Each Sᵢ is the union of two closed intervals. Any three Sᵢ have a point in common. Show that there is a point which belongs to at least half the Sᵢ.
import Mathlib /-! # USA Mathematical Olympiad 1983, Problem 3 S₁, S₂, ..., Sₙ are subsets of the real line. Each Sᵢ is the union of two closed intervals. Any three Sᵢ have a point in common. Show that there is a point which belongs to at least half the Sᵢ. -/ namespace Usa1983P3 theorem usa1983_p3 {n : ℕ} (hn : 0...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1983, Problem 3
null
compfiles-Usa1984P4
A maths exam has two papers, each with at least one question and 28 questions in total. Each pupil attempted 7 questions. Each pair of questions was attempted by just two pupils. Show that one pupil attempted either nil or at least 4 questions in the first paper.
import Mathlib /-! # USA Mathematical Olympiad 1984, Problem 4 A maths exam has two papers, each with at least one question and 28 questions in total. Each pupil attempted 7 questions. Each pair of questions was attempted by just two pupils. Show that one pupil attempted either nil or at least 4 questions in the firs...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1984, Problem 4
null
compfiles-Usa1985P4
A graph has n > 2 points. Show that we can find two points A and B such that at least ⌊n/2⌋ - 1 of the remaining points are joined to either both or neither of A and B.
import Mathlib /-! # USA Mathematical Olympiad 1985, Problem 4 A graph has n > 2 points. Show that we can find two points A and B such that at least ⌊n/2⌋ - 1 of the remaining points are joined to either both or neither of A and B. -/ namespace Usa1985P4 open Finset theorem usa1985_p4 (n : ℕ) (hn : 2 < n) (G : Si...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1985, Problem 4
null
compfiles-Usa1985P5
0 < a₁ ≤ a₂ ≤ a₃ ≤ ⋯ is an unbounded sequence of integers. Let bₙ = m if aₘ is the first member of the sequence to equal or exceed n. Given that a₁₉ = 85, what is the maximum possible value of a₁ + a₂ + ⋯ + a₁₉ + b₁ + b₂ + ⋯ + b₈₅?
import Mathlib /-! # USA Mathematical Olympiad 1985, Problem 5 0 < a₁ ≤ a₂ ≤ a₃ ≤ ⋯ is an unbounded sequence of integers. Let bₙ = m if aₘ is the first member of the sequence to equal or exceed n. Given that a₁₉ = 85, what is the maximum possible value of a₁ + a₂ + ⋯ + a₁₉ + b₁ + b₂ + ⋯ + b₈₅? -/ namespace Usa1985P5...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1985, Problem 5
null
compfiles-Usa1986P2
Five professors attended a lecture. Each fell asleep just twice. For each pair there was a moment when both were asleep. Show that there was a moment when three of them were asleep.
import Mathlib /-! # USA Mathematical Olympiad 1986, Problem 2 Five professors attended a lecture. Each fell asleep just twice. For each pair there was a moment when both were asleep. Show that there was a moment when three of them were asleep. -/ namespace Usa1986P2 /-- Each professor `p : Fin 5` takes two naps, a...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1986, Problem 2
null
compfiles-Usa1986P5
A partition of n is an increasing sequence of integers with sum n. For example, the partitions of 5 are: 1, 1, 1, 1, 1; 1, 1, 1, 2; 1, 1, 3; 1, 4; 5; 1, 2, 2; and 2, 3. If p is a partition, f(p) = the number of 1s in p, and g(p) = the number of distinct integers in the partition. Show that ∑ f(p) = ∑ g(p), where the su...
import Mathlib /-! # USA Mathematical Olympiad 1986, Problem 5 A partition of n is an increasing sequence of integers with sum n. For example, the partitions of 5 are: 1, 1, 1, 1, 1; 1, 1, 1, 2; 1, 1, 3; 1, 4; 5; 1, 2, 2; and 2, 3. If p is a partition, f(p) = the number of 1s in p, and g(p) = the number of distinct i...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1986, Problem 5
null
compfiles-Usa1988P3
Let X be the set {1, 2, ... , 20} and let P be the set of all 9-element subsets of X. Show that for any map f : P → X we can find a 10-element subset Y of X, such that f(Y - {k}) ≠ k for any k in Y.
import Mathlib /-! # USA Mathematical Olympiad 1988, Problem 3 Let X be the set {1, 2, ... , 20} and let P be the set of all 9-element subsets of X. Show that for any map f : P → X we can find a 10-element subset Y of X, such that f(Y - {k}) ≠ k for any k in Y. -/ namespace Usa1988P3 open Finset theorem usa1988_p...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1988, Problem 3
null
compfiles-Usa1989P2
The 20 members of a local tennis club have scheduled exactly 14 two-person games among themselves, with each member playing in at least one game. Prove that within this schedule can be found a set of six games with 12 distinct players.
import Mathlib /-! # USA Mathematical Olympiad 1989, Problem 2 The 20 members of a local tennis club have scheduled exactly 14 two-person games among themselves, with each member playing in at least one game. Prove that within this schedule can be found a set of six games with 12 distinct players. -/ namespace Usa19...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1989, Problem 2
null
compfiles-Usa1990P1
A license plate has six digits from 0 to 9 and may have leading zeros. If two plates must always differ in at least two places, what is the largest number of plates that is possible?
import Mathlib /-! # USA Mathematical Olympiad 1990, Problem 1 A license plate has six digits from 0 to 9 and may have leading zeros. If two plates must always differ in at least two places, what is the largest number of plates that is possible? -/ namespace Usa1990P1 /-- A license plate: six digits, each from 0 to...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1990, Problem 1
null
compfiles-Usa1990P4
How many positive integers can be written in base n so that (1) the integer has no two digits the same, and (2) each digit after the first differs by one from an earlier digit? For example, in base 3, the possible numbers are 1, 2, 10, 12, 21, 102, 120, 210.
import Mathlib /-! # USA Mathematical Olympiad 1990, Problem 4 How many positive integers can be written in base n so that (1) the integer has no two digits the same, and (2) each digit after the first differs by one from an earlier digit? For example, in base 3, the possible numbers are 1, 2, 10, 12, 21, 102, 120, 2...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1990, Problem 4
null
compfiles-Usa1992P3
A set of 11 distinct positive integers has the property that we can find a subset with sum n for any n between 1 and 1500 inclusive. What is the smallest possible value for the second largest element?
import Mathlib /-! # USA Mathematical Olympiad 1992, Problem 3 A set of 11 distinct positive integers has the property that we can find a subset with sum n for any n between 1 and 1500 inclusive. What is the smallest possible value for the second largest element? -/ namespace Usa1992P3 /-- Formalization of "a set ...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1992, Problem 3
null
compfiles-Usa1994P2
The sequence a₁, a₂, ... , a₉₉ has a₁ = a₃ = a₅ = ... = a₉₇ = 1, a₂ = a₄ = a₆ = ... = a₉₈ = 2, and a₉₉ = 3. We interpret subscripts greater than 99 by subtracting 99, so that a₁₀₀ means a₁ etc. An allowed move is to change the value of any one of the aₙ to another member of {1, 2, 3} different from its two neighbors, a...
import Mathlib /-! # USA Mathematical Olympiad 1994, Problem 2 The sequence a₁, a₂, ... , a₉₉ has a₁ = a₃ = a₅ = ... = a₉₇ = 1, a₂ = a₄ = a₆ = ... = a₉₈ = 2, and a₉₉ = 3. We interpret subscripts greater than 99 by subtracting 99, so that a₁₀₀ means a₁ etc. An allowed move is to change the value of any one of the aₙ t...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1994, Problem 2
null
compfiles-Usa1994P5
Let |U|, σ(U) and π(U) denote the number of elements, the sum, and the product, respectively, of a finite set U of positive integers. (If U is the empty set, |U| = 0, σ(U) = 0, π(U) = 1.) Let S be a finite set of positive integers. As usual, we define (n k) = n! / (k! (n-k)!) for 0 ≤ k ≤ n and (n k) = 0 otherwise. Prov...
import Mathlib /-! # USA Mathematical Olympiad 1994, Problem 5 Let |U|, σ(U) and π(U) denote the number of elements, the sum, and the product, respectively, of a finite set U of positive integers. (If U is the empty set, |U| = 0, σ(U) = 0, π(U) = 1.) Let S be a finite set of positive integers. As usual, we define (n ...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1994, Problem 5
null
compfiles-Usa1995P5
A graph with n points and k edges has no triangles. Show that it has a point P such that there are at most k(1 - 4k/n²) edges between points not joined to P (by an edge).
import Mathlib /-! # USA Mathematical Olympiad 1995, Problem 5 A graph with n points and k edges has no triangles. Show that it has a point P such that there are at most k(1 - 4k/n²) edges between points not joined to P (by an edge). -/ namespace Usa1995P5 open Finset SimpleGraph variable {n : ℕ} (G : SimpleGraph ...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1995, Problem 5
null
compfiles-Usa1996P2
Let S be a set of n positive integers. Let P be the set of all integers which are the sum of one or more distinct elements of S. Show that we can find n subsets of P whose union is P such that if a, b belong to the same subset, then a ≤ 2b.
import Mathlib /-! # USA Mathematical Olympiad 1996, Problem 2 Let S be a set of n positive integers. Let P be the set of all integers which are the sum of one or more distinct elements of S. Show that we can find n subsets of P whose union is P such that if a, b belong to the same subset, then a ≤ 2b. -/ namespace ...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1996, Problem 2
null
compfiles-Usa1996P4
An n-term sequence (x₁, x₂, …, xₙ) in which each term is either 0 or 1 is called a binary sequence of length n. Let aₙ be the number of binary sequences of length n containing no three consecutive terms equal to 0, 1, 0 in that order. Let bₙ be the number of binary sequences of length n that contain no four consecutive...
import Mathlib /-! # USA Mathematical Olympiad 1996, Problem 4 An n-term sequence (x₁, x₂, …, xₙ) in which each term is either 0 or 1 is called a binary sequence of length n. Let aₙ be the number of binary sequences of length n containing no three consecutive terms equal to 0, 1, 0 in that order. Let bₙ be the number...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1996, Problem 4
null
compfiles-Usa1996P6
Determine, with proof, whether there is a subset X of the integers with the following property: for any integer n there is exactly one pair (a, b) of elements of X satisfying a + 2b = n.
import Mathlib /-! # USA Mathematical Olympiad 1996, Problem 6 Determine, with proof, whether there is a subset X of the integers with the following property: for any integer n there is exactly one pair (a, b) of elements of X satisfying a + 2b = n. -/ namespace Usa1996P6 def UniqueRepresentationSet (X : Set ℤ) : P...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1996, Problem 6
null
compfiles-Usa1998P4
A computer screen shows a 98 × 98 chessboard, colored in the usual way. One can select with a mouse any rectangle with sides on the lines of the chessboard and click the mouse button: as a result, the colors in the selected rectangle switch (black becomes white, white becomes black). Find, with proof, the minimum numbe...
import Mathlib /-! # USA Mathematical Olympiad 1998, Problem 4 A computer screen shows a 98 × 98 chessboard, colored in the usual way. One can select with a mouse any rectangle with sides on the lines of the chessboard and click the mouse button: as a result, the colors in the selected rectangle switch (black becomes...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 1998, Problem 4
null
compfiles-Usa1999P1
null
import Mathlib /-! USA Mathematical Olympiad 1999, Problem 1 Some checkers placed on an n × n checkerboard satisfy the following conditions: a. every square that does not contain a checker shares a side with one that does; b. given any pair of squares that contain checkers, there is a sequence of squares contai...
Combinatorics
1. Named contest
null
Compfiles: Usa1999P1
null
compfiles-Usa2000P3
A player starts with A blue cards, B red cards and C white cards. He scores points as he plays each card. If he plays a blue card, his score is the number of white cards remaining in his hand. If he plays a red card it is three times the number of blue cards remaining in his hand. If he plays a white card, it is twice ...
import Mathlib /-! # USA Mathematical Olympiad 2000, Problem 3 A player starts with A blue cards, B red cards and C white cards. He scores points as he plays each card. If he plays a blue card, his score is the number of white cards remaining in his hand. If he plays a red card it is three times the number of blue ca...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2000, Problem 3
null
compfiles-Usa2001P1
Each of eight boxes contains six balls. Each ball has been colored with one of n colors, such that no two balls in the same box are the same color, and no two colors occur together in more than one box. Determine, with justification, the smallest integer n for which this is possible.
import Mathlib /-! # USA Mathematical Olympiad 2001, Problem 1 Each of eight boxes contains six balls. Each ball has been colored with one of n colors, such that no two balls in the same box are the same color, and no two colors occur together in more than one box. Determine, with justification, the smallest integer ...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2001, Problem 1
null
compfiles-Usa2002P1
Let S be a set with 2002 elements, and let N be an integer with 0 ≤ N ≤ 2^2002. Prove that it is possible to color every subset of S either blue or red so that the following conditions hold: a) the union of any two red subsets is red; b) the union of any two blue subsets is blue; c) there are exactly N red subs...
import Mathlib /-! # USA Mathematical Olympiad 2002, Problem 1 Let S be a set with 2002 elements, and let N be an integer with 0 ≤ N ≤ 2^2002. Prove that it is possible to color every subset of S either blue or red so that the following conditions hold: a) the union of any two red subsets is red; b) the union ...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2002, Problem 1
null
compfiles-Usa2002P6
I have an n×n sheet of stamps, from which I've been asked to tear out blocks of three adjacent stamps in a single row or column. (I can only tear along the perforations separating adjacent stamps, and each block must come out of the sheet in one piece.) Let b(n) be the smallest number of blocks I can tear out and make ...
import Mathlib /-! # USA Mathematical Olympiad 2002, Problem 6 I have an n×n sheet of stamps, from which I've been asked to tear out blocks of three adjacent stamps in a single row or column. (I can only tear along the perforations separating adjacent stamps, and each block must come out of the sheet in one piece.) L...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2002, Problem 6
null
compfiles-Usa2003P3
Let n be a positive integer. For every sequence of integers A = (a₀, a₁, a₂, . . . , aₙ) satisfying 0 ≤ aᵢ ≤ i, for i = 0, . . . , n, we define another sequence t(A) = (t(a₀), t(a₁), t(a₂), . . . , t(aₙ)) by setting t(aᵢ) to be the number of terms in the sequence A that precede the term aᵢ and are different from aᵢ. Sh...
import Mathlib /-! # USA Mathematical Olympiad 2003, Problem 3 Let n be a positive integer. For every sequence of integers A = (a₀, a₁, a₂, . . . , aₙ) satisfying 0 ≤ aᵢ ≤ i, for i = 0, . . . , n, we define another sequence t(A) = (t(a₀), t(a₁), t(a₂), . . . , t(aₙ)) by setting t(aᵢ) to be the number of terms in the ...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2003, Problem 3
null
compfiles-Usa2003P6
At the vertices of a regular hexagon are written six nonnegative integers whose sum is 2003^2003. Bert is allowed to make moves of the following form: he may pick a vertex and replace the number written there by the absolute value of the difference between the numbers written at the two neighboring vertices. Prove that...
import Mathlib /-! # USA Mathematical Olympiad 2003, Problem 6 At the vertices of a regular hexagon are written six nonnegative integers whose sum is 2003^2003. Bert is allowed to make moves of the following form: he may pick a vertex and replace the number written there by the absolute value of the difference betwee...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2003, Problem 6
null
compfiles-Usa2004P4
Alice and Bob play a game on a 6 by 6 grid. On his turn, a player chooses a rational number not yet appearing in the grid and writes it in an empty square of the grid. Alice goes first and then the players alternate. When all squares have numbers written in them, in each row, the square with the greatest number in that...
import Mathlib /-! # USA Mathematical Olympiad 2004, Problem 4 Alice and Bob play a game on a 6 by 6 grid. On his turn, a player chooses a rational number not yet appearing in the grid and writes it in an empty square of the grid. Alice goes first and then the players alternate. When all squares have numbers written ...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2004, Problem 4
null
compfiles-Usa2005P4
Legs L₁, L₂, L₃, L₄ of a square table each have length n, where n is a positive integer. For how many ordered 4-tuples (k₁, k₂, k₃, k₄) of nonnegative integers can we cut a piece of length kᵢ from the end of leg Lᵢ (i = 1, 2, 3, 4) and still have a stable table? (The table is stable if it can be placed so that all four...
import Mathlib /-! # USA Mathematical Olympiad 2005, Problem 4 Legs L₁, L₂, L₃, L₄ of a square table each have length n, where n is a positive integer. For how many ordered 4-tuples (k₁, k₂, k₃, k₄) of nonnegative integers can we cut a piece of length kᵢ from the end of leg Lᵢ (i = 1, 2, 3, 4) and still have a stable...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2005, Problem 4
null
compfiles-Usa2005P6
For a positive integer m, let s(m) denote the sum of the decimal digits of m. A set S of positive integers is k-stable if s(∑_{x∈X} x) = k for any nonempty subset X ⊆ S. For each integer n ≥ 2 let f(n) be the minimal k for which there exists a k-stable set with n integers. Prove that there are constants 0 < C₁ < C₂ wit...
import Mathlib /-! # USA Mathematical Olympiad 2005, Problem 6 For a positive integer m, let s(m) denote the sum of the decimal digits of m. A set S of positive integers is k-stable if s(∑_{x∈X} x) = k for any nonempty subset X ⊆ S. For each integer n ≥ 2 let f(n) be the minimal k for which there exists a k-stable se...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2005, Problem 6
null
compfiles-Usa2006P2
For a given positive integer k find, in terms of k, the minimum value of N for which there is a set of 2k + 1 distinct positive integers that has sum greater than N but every subset of size k has sum at most N / 2.
import Mathlib /-! # USA Mathematical Olympiad 2006, Problem 2 For a given positive integer k find, in terms of k, the minimum value of N for which there is a set of 2k + 1 distinct positive integers that has sum greater than N but every subset of size k has sum at most N / 2. -/ namespace Usa2006P2 abbrev solution...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2006, Problem 2
null
compfiles-Usa2006P5
A mathematical frog jumps along the number line. The frog starts at 1, and jumps according to the following rule: if the frog is at integer n, then it can jump either to n + 1 or to n + 2 ^ (mₙ + 1), where 2 ^ mₙ is the largest power of 2 that is a factor of n. Show that if k ≥ 2 is a positive integer and i is a nonneg...
import Mathlib /-! # USA Mathematical Olympiad 2006, Problem 5 A mathematical frog jumps along the number line. The frog starts at 1, and jumps according to the following rule: if the frog is at integer n, then it can jump either to n + 1 or to n + 2 ^ (mₙ + 1), where 2 ^ mₙ is the largest power of 2 that is a factor...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2006, Problem 5
null
compfiles-Usa2007P3
Let S be a set containing n² + n − 1 elements. Suppose that the n-element subsets of S are partitioned into two classes. Prove that there are at least n pairwise disjoint sets in the same class.
import Mathlib /-! # USA Mathematical Olympiad 2007, Problem 3 Let S be a set containing n² + n − 1 elements. Suppose that the n-element subsets of S are partitioned into two classes. Prove that there are at least n pairwise disjoint sets in the same class. -/ namespace Usa2007P3 theorem usa2007_p3 (n : ℕ) (hn : 0...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2007, Problem 3
null
compfiles-Usa2008P3
Let n be a positive integer. Denote by Sₙ the set of points (x, y) with integer coordinates such that |x| + |y + 1/2| < n. A path is a sequence of distinct points (x₁, y₁), (x₂, y₂), ..., (x_ℓ, y_ℓ) in Sₙ such that, for i = 2, ..., ℓ, the distance between (xᵢ, yᵢ) and (xᵢ₋₁, yᵢ₋₁) is 1. Prove that the points in Sₙ ...
import Mathlib /-! # USA Mathematical Olympiad 2008, Problem 3 Let n be a positive integer. Denote by Sₙ the set of points (x, y) with integer coordinates such that |x| + |y + 1/2| < n. A path is a sequence of distinct points (x₁, y₁), (x₂, y₂), ..., (x_ℓ, y_ℓ) in Sₙ such that, for i = 2, ..., ℓ, the distance bet...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2008, Problem 3
null
compfiles-Usa2008P5
Three nonnegative real numbers r₁, r₂, r₃ are written on a blackboard. These numbers have the property that there exist integers a₁, a₂, a₃, not all zero, satisfying a₁r₁ + a₂r₂ + a₃r₃ = 0. We are permitted to perform the following operation: find two numbers x, y on the blackboard with x ≤ y, then erase y and write y ...
import Mathlib /-! # USA Mathematical Olympiad 2008, Problem 5 Three nonnegative real numbers r₁, r₂, r₃ are written on a blackboard. These numbers have the property that there exist integers a₁, a₂, a₃, not all zero, satisfying a₁r₁ + a₂r₂ + a₃r₃ = 0. We are permitted to perform the following operation: find two num...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2008, Problem 5
null
compfiles-Usa2008P6
At a certain mathematical conference, every pair of mathematicians are either friends or strangers. At mealtime, every participant eats in one of two large dining rooms. Each mathematician insists upon eating in a room which contains an even number of his or her friends. Prove that the number of ways that the mathemati...
import Mathlib /-! # USA Mathematical Olympiad 2008, Problem 6 At a certain mathematical conference, every pair of mathematicians are either friends or strangers. At mealtime, every participant eats in one of two large dining rooms. Each mathematician insists upon eating in a room which contains an even number of his...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2008, Problem 6
null
compfiles-Usa2009P2
Let n be a positive integer. Determine the size of the largest subset of {−n, −n+1, ..., n−1, n} which does not contain three elements a, b, c (not necessarily distinct) satisfying a + b + c = 0.
import Mathlib /-! # USA Mathematical Olympiad 2009, Problem 2 Let n be a positive integer. Determine the size of the largest subset of {−n, −n+1, ..., n−1, n} which does not contain three elements a, b, c (not necessarily distinct) satisfying a + b + c = 0. -/ namespace Usa2009P2 /-- A set of integers is called *g...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2009, Problem 2
null
compfiles-Usa2010P2
There are $n$ students standing in a circle, one behind the other. The students have heights $h_1 < h_2 < \dots < h_n$. If a student with height $h_k$ is standing directly behind a student with height $h_{k-2}$ or less, the two students are permitted to switch places. Prove that it is not possible to make more than $\b...
import Mathlib /-! # USA Mathematical Olympiad 2010, Problem 2 There are $n$ students standing in a circle, one behind the other. The students have heights $h_1 < h_2 < \dots < h_n$. If a student with height $h_k$ is standing directly behind a student with height $h_{k-2}$ or less, the two students are permitted to s...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2010, Problem 2
null
compfiles-Usa2010P6
There are 68 ordered pairs (not necessarily distinct) of nonzero integers on a blackboard. It's known that for no integer k does both (k, k) and (−k, −k) appear. A student erases some of the 136 integers such that no two erased integers have sum zero, and scores one point for each ordered pair with at least one erased ...
import Mathlib /-! # USA Mathematical Olympiad 2010, Problem 6 There are 68 ordered pairs (not necessarily distinct) of nonzero integers on a blackboard. It's known that for no integer k does both (k, k) and (−k, −k) appear. A student erases some of the 136 integers such that no two erased integers have sum zero, and...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2010, Problem 6
null
compfiles-Usa2011P2
An integer is assigned to each vertex of a regular pentagon so that the sum of the five integers is 2011. A turn of a solitaire game consists of subtracting an integer m (not necessarily positive) from each of the integers at two neighboring vertices and adding 2m to the opposite vertex, which is not adjacent to either...
import Mathlib /-! # USA Mathematical Olympiad 2011, Problem 2 An integer is assigned to each vertex of a regular pentagon so that the sum of the five integers is 2011. A turn of a solitaire game consists of subtracting an integer m (not necessarily positive) from each of the integers at two neighboring vertices and ...
Combinatorics
1. Named contest
null
Compfiles: USA Mathematical Olympiad 2011, Problem 2
null
End of preview. Expand in Data Studio

Olympiad Lean 4 Geometry and Combinatorics

Two problem sets of Lean 4 theorem statements for training provers on olympiad-level mathematics:

File Problems
geometry.csv 2,500
combinatorics.csv 2,500

Each row is an informal problem paired with a Lean 4 statement whose proof is sorry. No proofs are included. The sets are meant for reinforcement learning or trace collection, where a model writes the proof and Lean checks it.

Every statement compiles (with only the expected sorry warning) on Lean 4.27.0 with Mathlib. Rows are ordered hardest first, in four tiers.

Tiers

Tier Geometry Combinatorics What it is
1. Named contest 8 114 Expert formalizations of IMO, USAMO and national olympiad problems from Compfiles
2. Difficulty 8–10 409 678 FineLeanCorpus problems rated 8–10
3. Difficulty 7 2,065 1,663 FineLeanCorpus problems rated 7
4. Difficulty 6 18 45 FineLeanCorpus problems rated 6, used only to reach 2,500

Only tier 1 is certified contest material. Tiers 2–4 are autoformalized problems whose difficulty was rated by a model.

Calibrating the difficulty scale. FineLeanCorpus rates problems from 1 to 10. We compared those ratings with Omni-MATH's AoPS-standard ratings on the 129 problems the two datasets share:

FineLeanCorpus rating Mean Omni-MATH rating
6 6.3
7 6.9

Shared problems that came from the IMO were rated 6–7. So 6 is roughly olympiad level, and 7 or above is roughly IMO level.

Columns

The columns match IMO-LeanProofBench, so existing loaders work unchanged. Three columns are added.

Column Meaning
Problem ID compfiles-<File> or flc-<FineLeanCorpus id>
Problem Informal problem statement
Lean Statement Complete Lean 4 file: import Mathlib, then definitions and the theorem ending in sorry
Category Geometry or Combinatorics (combinatorics includes FineLeanCorpus "Discrete Mathematics")
Level Tier name, as in the table above
Difficulty FineLeanCorpus rating, 1–10; blank for Compfiles rows
Source Compfiles: <contest and problem> or FineLeanCorpus/<original source>
Formalization Geometry only: synthetic, coordinates or real-arithmetic (see Known issues)

How it was built

The build script, build_geo_comb.py, is included in this repository.

  1. Candidates

    • Compfiles (commit 1745e6c): every problem file tagged .Geometry or .Combinatorics, 183 files. Each file was converted to a plain statement:

      • proof blocks (snip begin … snip end) removed;
      • problem changed to theorem … := by sorry;
      • determine changed to abbrev, so the stated answer stays in the statement.
    • FineLeanCorpus:

      • rows rated 6 or above with a Geometry, Combinatorics or Discrete Mathematics domain label;
      • only rows whose recorded compile result had no errors;
      • duplicates removed by normalized statement text.

      This left about 14,700 candidates. A row with both labels was assigned by its first domain label.

  2. Held-out benchmarks removed. Anything overlapping these benchmarks was dropped, so they can still be used for evaluation:

    A candidate counted as overlapping if either:

    • its contest, year and problem number matched (for example, IMO 2017 P5); or
    • 50% or more of its 8-word sequences matched a benchmark problem's text.

    This removed 40 candidates, including Compfiles' IMO combinatorics problems from 2000 on, which CombiBench covers.

  3. Recompiled on Lean 4.27.0 with Mathlib.

    • Compfiles targets Lean 4.35, and FineLeanCorpus was checked against an older Mathlib, so every candidate was compiled again, one file per statement.
    • A statement passed only if it compiled with no errors and Lean reported declaration uses 'sorry'.
    • Candidates were checked in priority order until each category had more than 2,500 passes. That took 5,662 checks; 92% of geometry and 89% of combinatorics candidates passed.
    • The most common failure was unexpected token 'in', from older Lean syntax.
  4. Ordering. Rows are sorted by tier, then by difficulty, highest first. Within a tier, geometry statements in the real-arithmetic style come last. The first 2,500 of each category were kept.

Source mix:

Source Geometry Combinatorics
FineLeanCorpus: AoPS 1,961 1,731
FineLeanCorpus: DeepTheorem 164 211
FineLeanCorpus: DeepMath-103k 136 145
Compfiles 8 113
Other FineLeanCorpus sources (DeepScaleR, DAPO, BlueMO, NuminaMath-TIR, Multi-Source competitions) 231 300

Known issues

Read these before training on the data.

  • Faithfulness is not verified.

    • FineLeanCorpus statements are autoformalized. Its authors report 79% accuracy from manual sampling of the full corpus, and geometry is likely lower.
    • Spot checks found statements that compile but don't match the problem. In one, the Lean builds a set whose only member is the claimed answer, then asks to prove that answer is the maximum, which is trivially true.
    • Screen statements for faithfulness and triviality before use.
  • Topic labels are loose. Some "Geometry" rows are really calculus or probability over Euclidean space, such as an expected value over a random point in a cone.

  • Geometry formalization style varies:

    Style Rows How the geometry is written
    synthetic 902 Mathlib geometry objects such as EuclideanSpace, ∠ or dist, the style IMO-LeanProofBench uses
    coordinates 307 Points as ℝ × ℝ pairs or complex numbers
    real-arithmetic 1,291 No geometric objects: the problem is restated as equations over side lengths or angles, often a lossy translation

    The style labels come from a simple text-pattern match and are approximate.

  • Synthetic geometry is hard in Mathlib. Mathlib has little support for olympiad geometry: incenters, tangency, touchpoints and similar. Provers tend to stall building that support themselves, so consider supplying a library of proved helper lemmas.

  • No reference proofs. Difficulty ratings are a model's estimate, not measured prover success rates.

  • Tier 1 is small, especially for geometry, because Compfiles has few geometry problems.

Licenses and credits

Released under Apache-2.0, the license of both upstream sources. Please cite them:

Decontamination used IMO-ProofBench, CombiBench and LeanGeo-Bench; none of their problems are included.

Downloads last month
46