name
stringlengths 9
20
| solved
bool 2
classes | tags
listlengths 0
2
| problem_id
stringlengths 7
20
| header
stringclasses 1
value | informal_prefix
stringlengths 89
1.15k
| formal_statement
stringlengths 58
2.76k
| split
stringclasses 1
value | lean4_code
stringlengths 268
3.5k
| category
stringclasses 4
values |
---|---|---|---|---|---|---|---|---|---|
Usa2005P2
| true |
[
"number theory"
] |
Usa2005P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 2005, Problem 2
Prove that there do not exist integers x,y,z such that
xβΆ + xΒ³ + xΒ³y + y = 147ΒΉβ΅β·
xΒ³ + xΒ³y + yΒ² + y + zβΉ = 157ΒΉβ΄β·.
-/
|
theorem usa2005_p2 :
Β¬β (x y z : β€),
x^6 + x^3 + x^3 * y + y = 147^157 β§
x^3 + x^3 * y + y^2 + y + z^9 = 157^147 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 2005, Problem 2
Prove that there do not exist integers x,y,z such that
xβΆ + xΒ³ + xΒ³y + y = 147ΒΉβ΅β·
xΒ³ + xΒ³y + yΒ² + y + zβΉ = 157ΒΉβ΄β·.
-/
theorem usa2005_p2 :
Β¬β (x y z : β€),
x^6 + x^3 + x^3 * y + y = 147^157 β§
x^3 + x^3 * y + y^2 + y + z^9 = 157^147 := by sorry
|
number theory
|
Imo2006P3
| true |
[
"algebra"
] |
Imo2006P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2006, Problem 3
Determine the least real number $M$ such that
$$
\left| ab(a^2 - b^2) + bc(b^2 - c^2) + ca(c^2 - a^2) \right|
β€ M (a^2 + b^2 + c^2)^2
$$
for all real numbers $a$, $b$, $c$.
-/
|
noncomputable abbrev solution : β := 9 * Real.sqrt 2 / 32
theorem imo2006_p3 :
IsLeast
{ M | (β a b c : β,
|a * b * (a ^ 2 - b ^ 2) + b * c * (b ^ 2 - c ^ 2) + c * a * (c ^ 2 - a ^ 2)| β€
M * (a ^ 2 + b ^ 2 + c ^ 2) ^ 2) } solution := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2006, Problem 3
Determine the least real number $M$ such that
$$
\left| ab(a^2 - b^2) + bc(b^2 - c^2) + ca(c^2 - a^2) \right|
β€ M (a^2 + b^2 + c^2)^2
$$
for all real numbers $a$, $b$, $c$.
-/
noncomputable abbrev solution : β := 9 * Real.sqrt 2 / 32
theorem imo2006_p3 :
IsLeast
{ M | (β a b c : β,
|a * b * (a ^ 2 - b ^ 2) + b * c * (b ^ 2 - c ^ 2) + c * a * (c ^ 2 - a ^ 2)| β€
M * (a ^ 2 + b ^ 2 + c ^ 2) ^ 2) } solution := by sorry
|
algebra
|
Imo2020P2
| true |
[
"algebra",
"inequality"
] |
Imo2020P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2020, Problem 2
The real numbers `a`, `b`, `c`, `d` are such that `a β₯ b β₯ c β₯ d > 0` and `a + b + c + d = 1`.
Prove that `(a + 2b + 3c + 4d) a^a b^b c^c d^d < 1`.
-/
|
theorem imo2020_q2 (a b c d : β) (hd0 : 0 < d) (hdc : d β€ c) (hcb : c β€ b) (hba : b β€ a)
(h1 : a + b + c + d = 1) : (a + 2 * b + 3 * c + 4 * d) * a ^ a * b ^ b * c ^ c * d ^ d < 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2020, Problem 2
The real numbers `a`, `b`, `c`, `d` are such that `a β₯ b β₯ c β₯ d > 0` and `a + b + c + d = 1`.
Prove that `(a + 2b + 3c + 4d) a^a b^b c^c d^d < 1`.
-/
theorem imo2020_q2 (a b c d : β) (hd0 : 0 < d) (hdc : d β€ c) (hcb : c β€ b) (hba : b β€ a)
(h1 : a + b + c + d = 1) : (a + 2 * b + 3 * c + 4 * d) * a ^ a * b ^ b * c ^ c * d ^ d < 1 := by sorry
|
algebra
|
Usa1979P1
| true |
[
"algebra",
"inequality"
] |
Usa1979P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1979, Problem 1
Determine all non-negative integral solutions $(n_1,n_2,\dots , n_{14})$ if any,
apart from permutations, of the Diophantine Equation $n_1^4+n_2^4+\cdots +n_{14}^4=1599$.
-/
|
/--
A type representing assignments to the variables $n_1$, $n_2$, ..., $n_{14}$,
quotiented by permutations of indices.
-/
structure MultisetNatOfLen14 where
s : Multiset β
p : Multiset.card s = 14
abbrev SolutionSet : Set MultisetNatOfLen14 := β
theorem usa1979_p1 : β e, e β SolutionSet β (e.s.map (fun x β¦ x ^ 4)).sum = 1599 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1979, Problem 1
Determine all non-negative integral solutions $(n_1,n_2,\dots , n_{14})$ if any,
apart from permutations, of the Diophantine Equation $n_1^4+n_2^4+\cdots +n_{14}^4=1599$.
-/
/--
A type representing assignments to the variables $n_1$, $n_2$, ..., $n_{14}$,
quotiented by permutations of indices.
-/
structure MultisetNatOfLen14 where
s : Multiset β
p : Multiset.card s = 14
abbrev SolutionSet : Set MultisetNatOfLen14 := β
theorem usa1979_p1 : β e, e β SolutionSet β (e.s.map (fun x β¦ x ^ 4)).sum = 1599 := by sorry
|
algebra
|
Imo2018P3
| false |
[
"combinatorics"
] |
Imo2018P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2018, Problem 3
An anti-Pascal triangle is an equilateral triangular array of numbers such that,
except for the numbers in the bottom row, each number is the absolute value
of the difference of the two numbers immediately below it. For example,
the following array is an anti-Pascal triangle with four rows
which contains every integer from 1 to 10:
4
2 6
5 7 1
8 3 10 9
Does there exist an anti-Pascal triangle with 2018 rows which contains every
integer from 1 to 1 + 2 + ... + 2018?
-/
|
structure Coords where
(row : β) (col : β)
def left_child (c : Coords) : Coords :=
β¨c.row.succ, c.colβ©
def right_child (c : Coords) : Coords :=
β¨c.row.succ, c.col.succβ©
/--
antipascal triangle with n rows
-/
structure antipascal_triangle (n : β) where
(f : Coords β β)
(antipascal : β x : Coords, x.row + 1 < n β§ x.col β€ x.row β
f x + f (left_child x) = f (right_child x) β¨
f x + f (right_child x) = f (left_child x))
def exists_desired_triangle : Prop :=
β t : antipascal_triangle 2018,
β n, 1 β€ n β n β€ β i β Finset.range 2018, (i + 1) β
β r, r β€ 2018 β§ β c, c < r β§ t.f β¨r,cβ© = n
abbrev does_exist : Bool := false
theorem imo2018_p3 :
if does_exist then exists_desired_triangle else Β¬ exists_desired_triangle := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2018, Problem 3
An anti-Pascal triangle is an equilateral triangular array of numbers such that,
except for the numbers in the bottom row, each number is the absolute value
of the difference of the two numbers immediately below it. For example,
the following array is an anti-Pascal triangle with four rows
which contains every integer from 1 to 10:
4
2 6
5 7 1
8 3 10 9
Does there exist an anti-Pascal triangle with 2018 rows which contains every
integer from 1 to 1 + 2 + ... + 2018?
-/
structure Coords where
(row : β) (col : β)
def left_child (c : Coords) : Coords :=
β¨c.row.succ, c.colβ©
def right_child (c : Coords) : Coords :=
β¨c.row.succ, c.col.succβ©
/--
antipascal triangle with n rows
-/
structure antipascal_triangle (n : β) where
(f : Coords β β)
(antipascal : β x : Coords, x.row + 1 < n β§ x.col β€ x.row β
f x + f (left_child x) = f (right_child x) β¨
f x + f (right_child x) = f (left_child x))
def exists_desired_triangle : Prop :=
β t : antipascal_triangle 2018,
β n, 1 β€ n β n β€ β i β Finset.range 2018, (i + 1) β
β r, r β€ 2018 β§ β c, c < r β§ t.f β¨r,cβ© = n
abbrev does_exist : Bool := false
theorem imo2018_p3 :
if does_exist then exists_desired_triangle else Β¬ exists_desired_triangle := by sorry
|
combinatorics
|
Imo2024P5
| true |
[
"combinatorics"
] |
Imo2024P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2024, Problem 5
Turbo the snail plays a game on a board with $2024$ rows and $2023$ columns. There are hidden
monsters in $2022$ of the cells. Initially, Turbo does not know where any of the monsters are,
but he knows that there is exactly one monster in each row except the first row and the last
row, and that each column contains at most one monster.
Turbo makes a series of attempts to go from the first row to the last row. On each attempt,
he chooses to start on any cell in the first row, then repeatedly moves to an adjacent cell
sharing a common side. (He is allowed to return to a previously visited cell.) If he reaches a
cell with a monster, his attempt ends and he is transported back to the first row to start a
new attempt. The monsters do not move, and Turbo remembers whether or not each cell he has
visited contains a monster. If he reaches any cell in the last row, his attempt ends and the
game is over.
Determine the minimum value of $n$ for which Turbo has a strategy that guarantees reaching
the last row on the $n$th attempt or earlier, regardless of the locations of the monsters.
-/
|
/-! ### Definitions for setting up the problem -/
-- There are N monsters, N+1 columns and N+2 rows.
variable {N : β}
/-- A cell on the board for the game. -/
abbrev Cell (N : β) : Type := Fin (N + 2) Γ Fin (N + 1)
/-- A row that is neither the first nor the last (and thus contains a monster). -/
abbrev InteriorRow (N : β) : Type := (Set.Icc 1 β¨N, by omegaβ© : Set (Fin (N + 2)))
/-- Data for valid positions of the monsters. -/
abbrev MonsterData (N : β) : Type := InteriorRow N βͺ Fin (N + 1)
/-- The cells with monsters as a Set, given an injection from rows to columns. -/
def MonsterData.monsterCells (m : MonsterData N) :
Set (Cell N) :=
Set.range (fun x : InteriorRow N β¦ ((x : Fin (N + 2)), m x))
/-- Whether two cells are adjacent. -/
def Adjacent (x y : Cell N) : Prop :=
Nat.dist x.1 y.1 + Nat.dist x.2 y.2 = 1
/-- A valid path from the first to the last row. -/
structure _Path (N : β) where
/-- The cells on the path. -/
cells : List (Cell N)
nonempty : cells β []
head_first_row : (cells.head nonempty).1 = 0
last_last_row : (cells.getLast nonempty).1 = Fin.last (N + 1)
valid_move_seq : cells.Chain' Adjacent
/-- The first monster on a path, or `none`. -/
noncomputable def _Path.firstMonster (p : _Path N) (m : MonsterData N) : Option (Cell N) :=
letI := Classical.propDecidable
p.cells.find? (fun x β¦ (x β m.monsterCells : Bool))
/-- A strategy, given the results of initial attempts, returns a path for the next attempt. -/
abbrev Strategy (N : β) : Type := β¦k : ββ¦ β (Fin k β Option (Cell N)) β _Path N
/-- Playing a strategy, k attempts. -/
noncomputable def Strategy.play (s : Strategy N) (m : MonsterData N) :
(k : β) β Fin k β Option (Cell N)
| 0 => Fin.elim0
| k + 1 => Fin.snoc (s.play m k) ((s (s.play m k)).firstMonster m)
/-- The predicate for a strategy winning within the given number of attempts. -/
def Strategy.WinsIn (s : Strategy N) (m : MonsterData N) (k : β) : Prop :=
none β Set.range (s.play m k)
/-- Whether a strategy forces a win within the given number of attempts. -/
def Strategy.ForcesWinIn (s : Strategy N) (k : β) : Prop :=
β m, s.WinsIn m k
abbrev answer : β := 3
theorem imo2024_p5 : IsLeast {k | β s : Strategy 2022, s.ForcesWinIn k} answer := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2024, Problem 5
Turbo the snail plays a game on a board with $2024$ rows and $2023$ columns. There are hidden
monsters in $2022$ of the cells. Initially, Turbo does not know where any of the monsters are,
but he knows that there is exactly one monster in each row except the first row and the last
row, and that each column contains at most one monster.
Turbo makes a series of attempts to go from the first row to the last row. On each attempt,
he chooses to start on any cell in the first row, then repeatedly moves to an adjacent cell
sharing a common side. (He is allowed to return to a previously visited cell.) If he reaches a
cell with a monster, his attempt ends and he is transported back to the first row to start a
new attempt. The monsters do not move, and Turbo remembers whether or not each cell he has
visited contains a monster. If he reaches any cell in the last row, his attempt ends and the
game is over.
Determine the minimum value of $n$ for which Turbo has a strategy that guarantees reaching
the last row on the $n$th attempt or earlier, regardless of the locations of the monsters.
-/
/-! ### Definitions for setting up the problem -/
-- There are N monsters, N+1 columns and N+2 rows.
variable {N : β}
/-- A cell on the board for the game. -/
abbrev Cell (N : β) : Type := Fin (N + 2) Γ Fin (N + 1)
/-- A row that is neither the first nor the last (and thus contains a monster). -/
abbrev InteriorRow (N : β) : Type := (Set.Icc 1 β¨N, by omegaβ© : Set (Fin (N + 2)))
/-- Data for valid positions of the monsters. -/
abbrev MonsterData (N : β) : Type := InteriorRow N βͺ Fin (N + 1)
/-- The cells with monsters as a Set, given an injection from rows to columns. -/
def MonsterData.monsterCells (m : MonsterData N) :
Set (Cell N) :=
Set.range (fun x : InteriorRow N β¦ ((x : Fin (N + 2)), m x))
/-- Whether two cells are adjacent. -/
def Adjacent (x y : Cell N) : Prop :=
Nat.dist x.1 y.1 + Nat.dist x.2 y.2 = 1
/-- A valid path from the first to the last row. -/
structure _Path (N : β) where
/-- The cells on the path. -/
cells : List (Cell N)
nonempty : cells β []
head_first_row : (cells.head nonempty).1 = 0
last_last_row : (cells.getLast nonempty).1 = Fin.last (N + 1)
valid_move_seq : cells.Chain' Adjacent
/-- The first monster on a path, or `none`. -/
noncomputable def _Path.firstMonster (p : _Path N) (m : MonsterData N) : Option (Cell N) :=
letI := Classical.propDecidable
p.cells.find? (fun x β¦ (x β m.monsterCells : Bool))
/-- A strategy, given the results of initial attempts, returns a path for the next attempt. -/
abbrev Strategy (N : β) : Type := β¦k : ββ¦ β (Fin k β Option (Cell N)) β _Path N
/-- Playing a strategy, k attempts. -/
noncomputable def Strategy.play (s : Strategy N) (m : MonsterData N) :
(k : β) β Fin k β Option (Cell N)
| 0 => Fin.elim0
| k + 1 => Fin.snoc (s.play m k) ((s (s.play m k)).firstMonster m)
/-- The predicate for a strategy winning within the given number of attempts. -/
def Strategy.WinsIn (s : Strategy N) (m : MonsterData N) (k : β) : Prop :=
none β Set.range (s.play m k)
/-- Whether a strategy forces a win within the given number of attempts. -/
def Strategy.ForcesWinIn (s : Strategy N) (k : β) : Prop :=
β m, s.WinsIn m k
abbrev answer : β := 3
theorem imo2024_p5 : IsLeast {k | β s : Strategy 2022, s.ForcesWinIn k} answer := by sorry
|
combinatorics
|
Imo1977P4
| false |
[
"algebra"
] |
Imo1977P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1977, Problem 4
Define f(x) = 1 - a cos x - b sin x - A cos 2x - B sin 2x,
where a, b, A, B are real constants.
Suppose that f(x) β₯ 0 for all real x.
Prove that a^2 + b^2 β€ 2 and A^2 + B^2 β€ 1.
-/
|
theorem imo1977_p4 (f : β β β) (a b A B : β)
(hβ : β x, f x =
1 - a * Real.cos x - b * Real.sin x - A * Real.cos (2 * x) - B * Real.sin (2 * x))
(hβ : β x, f x β₯ 0) :
a ^ 2 + b ^ 2 β€ 2 β§ A ^ 2 + B ^ 2 β€ 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1977, Problem 4
Define f(x) = 1 - a cos x - b sin x - A cos 2x - B sin 2x,
where a, b, A, B are real constants.
Suppose that f(x) β₯ 0 for all real x.
Prove that a^2 + b^2 β€ 2 and A^2 + B^2 β€ 1.
-/
theorem imo1977_p4 (f : β β β) (a b A B : β)
(hβ : β x, f x =
1 - a * Real.cos x - b * Real.sin x - A * Real.cos (2 * x) - B * Real.sin (2 * x))
(hβ : β x, f x β₯ 0) :
a ^ 2 + b ^ 2 β€ 2 β§ A ^ 2 + B ^ 2 β€ 1 := by sorry
|
algebra
|
Imo2021P6
| false |
[
"algebra"
] |
Imo2021P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2021, Problem 6
Let m β₯ 2 be an integer, A a finite set of integers (not necessarily
positive) and Bβ, Bβ, ... Bβ subsets of A. Suppose that for every
k = 1, 2, ..., m, the sum of the elements of Bβ is m^k. Prove that
A contains at least m/2 elements.
-/
|
theorem imo2021_p6 (m : β) (hm : 2 β€ m) (A : Finset β€)
(B : Fin m β Finset β€) (hB : β k, B k β A)
(hs : β k, β b β B k, b = (m : β€) ^ (k.val + 1))
: m β€ 2 * A.card := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2021, Problem 6
Let m β₯ 2 be an integer, A a finite set of integers (not necessarily
positive) and Bβ, Bβ, ... Bβ subsets of A. Suppose that for every
k = 1, 2, ..., m, the sum of the elements of Bβ is m^k. Prove that
A contains at least m/2 elements.
-/
theorem imo2021_p6 (m : β) (hm : 2 β€ m) (A : Finset β€)
(B : Fin m β Finset β€) (hB : β k, B k β A)
(hs : β k, β b β B k, b = (m : β€) ^ (k.val + 1))
: m β€ 2 * A.card := by sorry
|
algebra
|
Imo1961P3
| true |
[
"algebra"
] |
Imo1961P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1961, Problem 3
Solve the equation
cosβΏ x - sinβΏ x = 1,
where n is a given positive integer.
-/
|
abbrev solutionSet (n : β+) : Set β :=
{ x | (β k : β€, k * Real.pi = x) β§ Even n.val β¨ (β k : β€, k * (2 * Real.pi) = x) β§ Odd n.val β¨
(β k : β€, -(Real.pi / 2) + k * (2 * Real.pi) = x) β§ Odd n.val }
theorem imo1961_p3 {n : β} {x : β} (npos : 0 < n) :
x β solutionSet β¨n, nposβ© β
(cos x) ^ n - (sin x) ^ n = 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1961, Problem 3
Solve the equation
cosβΏ x - sinβΏ x = 1,
where n is a given positive integer.
-/
abbrev solutionSet (n : β+) : Set β :=
{ x | (β k : β€, k * Real.pi = x) β§ Even n.val β¨ (β k : β€, k * (2 * Real.pi) = x) β§ Odd n.val β¨
(β k : β€, -(Real.pi / 2) + k * (2 * Real.pi) = x) β§ Odd n.val }
theorem imo1961_p3 {n : β} {x : β} (npos : 0 < n) :
x β solutionSet β¨n, nposβ© β
(cos x) ^ n - (sin x) ^ n = 1 := by sorry
|
algebra
|
Usa2000P1
| true |
[
"algebra"
] |
Usa2000P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
USA Mathematical Olympiad 2000, Problem 1
A function f : β β β is called "very convex" if it satisfies
β x y : β, (f(x) + f(y))/2 β₯ f((x + y)/2) + |x - y|.
Show that there exist no very convex functions.
-/
|
theorem usa2000_p1 :
Β¬β f : β β β,
β x y : β, f ((x + y) / 2) + |x - y| β€ (f x + f y) / 2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
USA Mathematical Olympiad 2000, Problem 1
A function f : β β β is called "very convex" if it satisfies
β x y : β, (f(x) + f(y))/2 β₯ f((x + y)/2) + |x - y|.
Show that there exist no very convex functions.
-/
theorem usa2000_p1 :
Β¬β f : β β β,
β x y : β, f ((x + y) / 2) + |x - y| β€ (f x + f y) / 2 := by sorry
|
algebra
|
Imo2022P3
| false |
[
"number theory"
] |
Imo2022P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2022, Problem 3
Let k be a positive integer and let S be a finite set of odd prime
integers. Prove that there is at most one way (up to rotation and reflection)
to place the elements of S around a circle such that the product of any
two neighbors is of the form xΒ² + x + k for some positive integer x.
-/
|
/- special open -/ open Finset
/-- The condition of the problem on a placement of numbers round a circle. -/
def Condition (k : β) (S : Finset β) (p : Fin (Finset.card S) β S) : Prop :=
β i, have : NeZero (Finset.card S) := β¨i.pos.ne'β©
β x : β, 0 < x β§ ((p i : β) * (p (i + 1) : β)) = x ^ 2 + x + k
theorem imo2023_p3
{k : β} (hk : 0 < k) (S : Finset β) (hS : β p β S, Odd p β§ Nat.Prime p)
{pβ pβ : Fin (Finset.card S) β S} (hpβ : Condition k S pβ) (hpβ : Condition k S pβ) :
(β i, β j, pβ j = pβ (j + i)) β¨ β i, β j, pβ j = pβ (Fin.rev j + i) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2022, Problem 3
Let k be a positive integer and let S be a finite set of odd prime
integers. Prove that there is at most one way (up to rotation and reflection)
to place the elements of S around a circle such that the product of any
two neighbors is of the form xΒ² + x + k for some positive integer x.
-/
/- special open -/ open Finset
/-- The condition of the problem on a placement of numbers round a circle. -/
def Condition (k : β) (S : Finset β) (p : Fin (Finset.card S) β S) : Prop :=
β i, have : NeZero (Finset.card S) := β¨i.pos.ne'β©
β x : β, 0 < x β§ ((p i : β) * (p (i + 1) : β)) = x ^ 2 + x + k
theorem imo2023_p3
{k : β} (hk : 0 < k) (S : Finset β) (hS : β p β S, Odd p β§ Nat.Prime p)
{pβ pβ : Fin (Finset.card S) β S} (hpβ : Condition k S pβ) (hpβ : Condition k S pβ) :
(β i, β j, pβ j = pβ (j + i)) β¨ β i, β j, pβ j = pβ (Fin.rev j + i) := by sorry
|
number theory
|
Imo1978P1
| true |
[
"number theory"
] |
Imo1978P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1978, Problem 1
m and n are positive integers with m < n.
The last three decimal digits of 1978α΅ are the same as the
last three decimal digits of 1978βΏ.
Find m and n such that m + n has the least possible value.
-/
|
abbrev solution : β Γ β := (3, 103)
abbrev ValidPair : β Γ β β Prop
| (m, n) => 1 β€ m β§ m < n β§ (1978^m) % 1000 = (1978^n) % 1000
theorem imo1978_p1 (m n : β)
(hmn : (m, n) = solution) :
ValidPair (m, n) β§
(β m' n' : β, ValidPair (m', n') β m + n β€ m' + n') := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1978, Problem 1
m and n are positive integers with m < n.
The last three decimal digits of 1978α΅ are the same as the
last three decimal digits of 1978βΏ.
Find m and n such that m + n has the least possible value.
-/
abbrev solution : β Γ β := (3, 103)
abbrev ValidPair : β Γ β β Prop
| (m, n) => 1 β€ m β§ m < n β§ (1978^m) % 1000 = (1978^n) % 1000
theorem imo1978_p1 (m n : β)
(hmn : (m, n) = solution) :
ValidPair (m, n) β§
(β m' n' : β, ValidPair (m', n') β m + n β€ m' + n') := by sorry
|
number theory
|
Imo2004P2
| false |
[
"algebra"
] |
Imo2004P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2004, Problem 2
Find all polynomials P with real coefficients such that
for all reals a,b,c such that ab + bc + ca = 0 we have
P(a - b) + P(b - c) + P(c - a) = 2P(a + b + c).
-/
|
abbrev SolutionSet : Set (Polynomial β) :=
{P | β (aβ aβ : β), P = Polynomial.monomial 2 aβ + Polynomial.monomial 4 aβ}
theorem imo2004_p2 (P : Polynomial β) :
P β SolutionSet β
β a b c, a * b + b * c + c * a = 0 β
P.eval (a - b) + P.eval (b - c) + P.eval (c - a) =
2 * P.eval (a + b + c) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2004, Problem 2
Find all polynomials P with real coefficients such that
for all reals a,b,c such that ab + bc + ca = 0 we have
P(a - b) + P(b - c) + P(c - a) = 2P(a + b + c).
-/
abbrev SolutionSet : Set (Polynomial β) :=
{P | β (aβ aβ : β), P = Polynomial.monomial 2 aβ + Polynomial.monomial 4 aβ}
theorem imo2004_p2 (P : Polynomial β) :
P β SolutionSet β
β a b c, a * b + b * c + c * a = 0 β
P.eval (a - b) + P.eval (b - c) + P.eval (c - a) =
2 * P.eval (a + b + c) := by sorry
|
algebra
|
Bulgaria1998P2
| false |
[
"geometry"
] |
Bulgaria1998P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# Bulgarian Mathematical Olympiad 1998, Problem 2
A convex quadrilateral ABCD has AD = CD and β DAB = β ABC < 90Β°.
The line through D and the midpoint of BC intersects line AB
in point E. Prove that β BEC = β DAC. (Note: The problem is valid
without the assumption β ABC < 90Β°.)
-/
|
/- special open -/ open EuclideanGeometry
theorem bulgaria1998_p2
(A B C D E M : EuclideanSpace β (Fin 2))
(H1 : dist D A = dist D C)
(H2 : β D A B = β A B C)
(H3 : M = midpoint β B C) :
β B E C = β D A C := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# Bulgarian Mathematical Olympiad 1998, Problem 2
A convex quadrilateral ABCD has AD = CD and β DAB = β ABC < 90Β°.
The line through D and the midpoint of BC intersects line AB
in point E. Prove that β BEC = β DAC. (Note: The problem is valid
without the assumption β ABC < 90Β°.)
-/
/- special open -/ open EuclideanGeometry
theorem bulgaria1998_p2
(A B C D E M : EuclideanSpace β (Fin 2))
(H1 : dist D A = dist D C)
(H2 : β D A B = β A B C)
(H3 : M = midpoint β B C) :
β B E C = β D A C := by sorry
|
geometry
|
Imo2017P6
| false |
[
"number theory"
] |
Imo2017P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2017, Problem 6
A point (x,y) β β€ Γ β€ is called primitive if gcd(x,y) = 1.
Let S be a finite set of primitive points.
Prove that there exists n > 0 and integers aβ,aβ,...,aβ
such that
aβxβΏ + aβxβΏβ»ΒΉy + aβxβΏβ»Β²yΒ² + ... + aβββxyβΏβ»ΒΉ + aβyβΏ = 1
for each (x,y) β S.
-/
|
theorem imo2017_p6 (S : Finset (β€ Γ β€)) (hS : β s β S, gcd s.1 s.2 = 1) :
β n : β, 0 < n β§ β a : β β β€,
β s β S, β i β Finset.range n, a i * s.1 ^ i * s.2 ^ (n - i) = 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2017, Problem 6
A point (x,y) β β€ Γ β€ is called primitive if gcd(x,y) = 1.
Let S be a finite set of primitive points.
Prove that there exists n > 0 and integers aβ,aβ,...,aβ
such that
aβxβΏ + aβxβΏβ»ΒΉy + aβxβΏβ»Β²yΒ² + ... + aβββxyβΏβ»ΒΉ + aβyβΏ = 1
for each (x,y) β S.
-/
theorem imo2017_p6 (S : Finset (β€ Γ β€)) (hS : β s β S, gcd s.1 s.2 = 1) :
β n : β, 0 < n β§ β a : β β β€,
β s β S, β i β Finset.range n, a i * s.1 ^ i * s.2 ^ (n - i) = 1 := by sorry
|
number theory
|
Imo2009P6
| false |
[
"combinatorics"
] |
Imo2009P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2009, Problem 6
Let aβ, aβ, ..., aβ be distinct positive integers and let M
be a set of n - 1 positive integers not containing
s = aβ + aβ + ... + aβ. A grasshopper is to jump along the
real axis, starting at the point 0 and making n jumps to
the right with lengths aβ, aβ, ..., aβ in some order. Prove
that the order can be chosen in such a way that the
grasshopper never lands on any point in M.
-/
|
theorem imo2009_p6 (n : β) (hn : 0 < n)
(a : Fin n β β€)
(ainj : a.Injective)
(apos : β i, 0 < a i)
(M : Finset β€)
(Mpos : β m β M, 0 < m)
(Mcard : M.card = n - 1)
(hM : β i, a i β M)
: β p : Equiv.Perm (Fin n),
β i : Fin n,
β j β Finset.univ.filter (Β· β€ i), a (p j) β M := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2009, Problem 6
Let aβ, aβ, ..., aβ be distinct positive integers and let M
be a set of n - 1 positive integers not containing
s = aβ + aβ + ... + aβ. A grasshopper is to jump along the
real axis, starting at the point 0 and making n jumps to
the right with lengths aβ, aβ, ..., aβ in some order. Prove
that the order can be chosen in such a way that the
grasshopper never lands on any point in M.
-/
theorem imo2009_p6 (n : β) (hn : 0 < n)
(a : Fin n β β€)
(ainj : a.Injective)
(apos : β i, 0 < a i)
(M : Finset β€)
(Mpos : β m β M, 0 < m)
(Mcard : M.card = n - 1)
(hM : β i, a i β M)
: β p : Equiv.Perm (Fin n),
β i : Fin n,
β j β Finset.univ.filter (Β· β€ i), a (p j) β M := by sorry
|
combinatorics
|
Imo2013P1
| true |
[
"number theory"
] |
Imo2013P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2013, Problem 1
Prove that for any pair of positive integers k and n, there exist k positive integers
mβ, mβ, ..., mβ (not necessarily different) such that
1 + (2α΅ - 1)/ n = (1 + 1/mβ) * (1 + 1/mβ) * ... * (1 + 1/mβ).
-/
|
theorem imo2013_p1 (n : β+) (k : β) :
β m : β β β+,
(1 : β) + (2 ^ k - 1) / n = β i β Finset.range k, (1 + 1 / (m i : β)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2013, Problem 1
Prove that for any pair of positive integers k and n, there exist k positive integers
mβ, mβ, ..., mβ (not necessarily different) such that
1 + (2α΅ - 1)/ n = (1 + 1/mβ) * (1 + 1/mβ) * ... * (1 + 1/mβ).
-/
theorem imo2013_p1 (n : β+) (k : β) :
β m : β β β+,
(1 : β) + (2 ^ k - 1) / n = β i β Finset.range k, (1 + 1 / (m i : β)) := by sorry
|
number theory
|
Imo1979P5
| false |
[
"algebra"
] |
Imo1979P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1979, Problem 5
Find all real numbers a for which there exist
non-negative real numbers x1, x2, x3, x4, x5 satisfying:
x1 + 2x_2 + 3x_3 + 4x_4 + 5x_5 = a,
x1 + 2^3x_2 + 3^3x_3 + 4^3x_4 + 5^3x_5 = a^2,
x1 + 2^5x_2 + 3^5x_3 + 4^5x_4 + 5^5x_5 = a^3.
-/
|
abbrev solution_set : Set β := {0, 1, 4, 9, 16, 25}
theorem imo1979_p5 (a : β) :
(β x1 x2 x3 x4 x5 : β,
x1 β₯ 0 β§ x2 β₯ 0 β§ x3 β₯ 0 β§ x4 β₯ 0 β§ x5 β₯ 0 β§
x1 + 2*x2 + 3*x3 + 4*x4 + 5*x5 = a β§
x1 + 2^3*x2 + 3^3*x3 + 4^3*x4 + 5^3*x5 = a^2 β§
x1 + 2^5*x2 + 3^5*x3 + 4^5*x4 + 5^5*x5 = a^3 ) β a β solution_set := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1979, Problem 5
Find all real numbers a for which there exist
non-negative real numbers x1, x2, x3, x4, x5 satisfying:
x1 + 2x_2 + 3x_3 + 4x_4 + 5x_5 = a,
x1 + 2^3x_2 + 3^3x_3 + 4^3x_4 + 5^3x_5 = a^2,
x1 + 2^5x_2 + 3^5x_3 + 4^5x_4 + 5^5x_5 = a^3.
-/
abbrev solution_set : Set β := {0, 1, 4, 9, 16, 25}
theorem imo1979_p5 (a : β) :
(β x1 x2 x3 x4 x5 : β,
x1 β₯ 0 β§ x2 β₯ 0 β§ x3 β₯ 0 β§ x4 β₯ 0 β§ x5 β₯ 0 β§
x1 + 2*x2 + 3*x3 + 4*x4 + 5*x5 = a β§
x1 + 2^3*x2 + 3^3*x3 + 4^3*x4 + 5^3*x5 = a^2 β§
x1 + 2^5*x2 + 3^5*x3 + 4^5*x4 + 5^5*x5 = a^3 ) β a β solution_set := by sorry
|
algebra
|
Imo1970P6
| false |
[
"combinatorics"
] |
Imo1970P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# 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.
-/
|
/- special open -/ open EuclideanGeometry
abbrev Pt := EuclideanSpace β (Fin 2)
def AcuteTriangle (T : Affine.Triangle β Pt) : Prop :=
β (T.points 1) (T.points 2) (T.points 3) < Real.pi / 2 β§
β (T.points 2) (T.points 3) (T.points 1) < Real.pi / 2 β§
β (T.points 3) (T.points 1) (T.points 2) < Real.pi / 2
theorem imo1970_p6
(P : Fin 100 β Pt)
(hP : β a b c : Fin 100,
List.Nodup [a, b, c] β Β¬ Collinear β {P c, P b, P c}) :
let cardAll := Nat.card { t : Affine.Triangle β Pt |
β a b c : Fin 100, ![P a, P b, P c] = t.points }
let cardAcute :=
Nat.card { t : Affine.Triangle β Pt | β a b c : Fin 100, ![P a, P b, P c] = t.points β§
AcuteTriangle t }
(cardAcute : β) / cardAll β€ 7 / 10 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# 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.
-/
/- special open -/ open EuclideanGeometry
abbrev Pt := EuclideanSpace β (Fin 2)
def AcuteTriangle (T : Affine.Triangle β Pt) : Prop :=
β (T.points 1) (T.points 2) (T.points 3) < Real.pi / 2 β§
β (T.points 2) (T.points 3) (T.points 1) < Real.pi / 2 β§
β (T.points 3) (T.points 1) (T.points 2) < Real.pi / 2
theorem imo1970_p6
(P : Fin 100 β Pt)
(hP : β a b c : Fin 100,
List.Nodup [a, b, c] β Β¬ Collinear β {P c, P b, P c}) :
let cardAll := Nat.card { t : Affine.Triangle β Pt |
β a b c : Fin 100, ![P a, P b, P c] = t.points }
let cardAcute :=
Nat.card { t : Affine.Triangle β Pt | β a b c : Fin 100, ![P a, P b, P c] = t.points β§
AcuteTriangle t }
(cardAcute : β) / cardAll β€ 7 / 10 := by sorry
|
combinatorics
|
Imo2008P2a
| true |
[
"algebra"
] |
Imo2008P2a
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2008, Problem 2
(a) Prove that
```
x^2 / (x-1)^2 + y^2 / (y-1)^2 + z^2 / (z-1)^2 β₯ 1
```
for all real numbers `x`,`y`, `z`, each different from 1, and satisfying `xyz = 1`.
-/
|
theorem imo2008_p2a (x y z : β) (h : x * y * z = 1) (hx : x β 1) (hy : y β 1) (hz : z β 1) :
x ^ 2 / (x - 1) ^ 2 + y ^ 2 / (y - 1) ^ 2 + z ^ 2 / (z - 1) ^ 2 β₯ 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2008, Problem 2
(a) Prove that
```
x^2 / (x-1)^2 + y^2 / (y-1)^2 + z^2 / (z-1)^2 β₯ 1
```
for all real numbers `x`,`y`, `z`, each different from 1, and satisfying `xyz = 1`.
-/
theorem imo2008_p2a (x y z : β) (h : x * y * z = 1) (hx : x β 1) (hy : y β 1) (hz : z β 1) :
x ^ 2 / (x - 1) ^ 2 + y ^ 2 / (y - 1) ^ 2 + z ^ 2 / (z - 1) ^ 2 β₯ 1 := by sorry
|
algebra
|
Usa2011P4
| true |
[
"number theory"
] |
Usa2011P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 2011, Problem 4
For any integer n β₯ 2, define P(n) to be the proposition:
P(n) β‘ 2^(2^n) % (2^n - 1) is a power of 4
Either prove that P(n) is always true, or find a counterexample.
-/
|
abbrev P (n : β) : Prop := β k, 4^k = 2^(2^n) % (2^n - 1)
inductive SolutionData where
| AlwaysTrue : SolutionData
| Counterexample : β β SolutionData
abbrev solution_data : SolutionData := SolutionData.Counterexample 25
theorem usa2011_p4 :
match solution_data with
| .AlwaysTrue => β n, 2 β€ n β P n
| .Counterexample m => 2 β€ m β§ Β¬ P m := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 2011, Problem 4
For any integer n β₯ 2, define P(n) to be the proposition:
P(n) β‘ 2^(2^n) % (2^n - 1) is a power of 4
Either prove that P(n) is always true, or find a counterexample.
-/
abbrev P (n : β) : Prop := β k, 4^k = 2^(2^n) % (2^n - 1)
inductive SolutionData where
| AlwaysTrue : SolutionData
| Counterexample : β β SolutionData
abbrev solution_data : SolutionData := SolutionData.Counterexample 25
theorem usa2011_p4 :
match solution_data with
| .AlwaysTrue => β n, 2 β€ n β P n
| .Counterexample m => 2 β€ m β§ Β¬ P m := by sorry
|
number theory
|
Imo2007P1b
| false |
[
"algebra"
] |
Imo2007P1b
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2007, Problem 1
Real numbers aβ, aβ, ..., aβ are fixed. For each 1 β€ i β€ n,
we let dα΅’ = max {aβ±Ό : 1 β€ j β€ i} - min {aβ±Ό : i β€ j β€ n},
and let d = max {dα΅’ : 1 β€ i β€ n}.
(b) Show that there exists some choice of xβ β€ ... β€ xβ which achieves equality.
-/
|
noncomputable abbrev d {n : β} (a : Fin n β β) (i : Fin n) :=
(β¨ j : {j // j β€ i}, a j - β¨
j : {j // i β€ j}, a j)
theorem imo2007_p1b {n : β} (hn : 0 < n) {a : Fin n β β} :
β x : Fin n β β, Monotone x β§
(β¨ i, d a i) / 2 = β¨ i, |x i - a i| := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2007, Problem 1
Real numbers aβ, aβ, ..., aβ are fixed. For each 1 β€ i β€ n,
we let dα΅’ = max {aβ±Ό : 1 β€ j β€ i} - min {aβ±Ό : i β€ j β€ n},
and let d = max {dα΅’ : 1 β€ i β€ n}.
(b) Show that there exists some choice of xβ β€ ... β€ xβ which achieves equality.
-/
noncomputable abbrev d {n : β} (a : Fin n β β) (i : Fin n) :=
(β¨ j : {j // j β€ i}, a j - β¨
j : {j // i β€ j}, a j)
theorem imo2007_p1b {n : β} (hn : 0 < n) {a : Fin n β β} :
β x : Fin n β β, Monotone x β§
(β¨ i, d a i) / 2 = β¨ i, |x i - a i| := by sorry
|
algebra
|
Imo2001P1
| false |
[
"geometry"
] |
Imo2001P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2001, Problem 1
Let ABC be an acute-angled triangle with O as its circumcenter. Let P
on line BC be the foot of the altitude from A. Assume that
β BCA β₯ β ABC + 30Β°. Prove that β CAB + β COP < 90Β°.
-/
|
/- special open -/ open EuclideanGeometry
theorem imo2001_p1
(A B C : EuclideanSpace β (Fin 2))
(hABC : AffineIndependent β ![A, B, C])
(hAcuteA : β C A B < Real.pi / 2)
(hAcuteB : β A B C < Real.pi / 2)
(hAcuteC : β B C A < Real.pi / 2)
(hAB : β A B C + Real.pi / 6 β€ β B C A)
: let ABC : Affine.Triangle _ _ := β¨![A, B, C], hABCβ©
let P := EuclideanGeometry.orthogonalProjection line[β, B, C] A
β C A B + β C ABC.circumcenter P < Real.pi / 2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2001, Problem 1
Let ABC be an acute-angled triangle with O as its circumcenter. Let P
on line BC be the foot of the altitude from A. Assume that
β BCA β₯ β ABC + 30Β°. Prove that β CAB + β COP < 90Β°.
-/
/- special open -/ open EuclideanGeometry
theorem imo2001_p1
(A B C : EuclideanSpace β (Fin 2))
(hABC : AffineIndependent β ![A, B, C])
(hAcuteA : β C A B < Real.pi / 2)
(hAcuteB : β A B C < Real.pi / 2)
(hAcuteC : β B C A < Real.pi / 2)
(hAB : β A B C + Real.pi / 6 β€ β B C A)
: let ABC : Affine.Triangle _ _ := β¨![A, B, C], hABCβ©
let P := EuclideanGeometry.orthogonalProjection line[β, B, C] A
β C A B + β C ABC.circumcenter P < Real.pi / 2 := by sorry
|
geometry
|
Usa1998P1
| true |
[
"number theory"
] |
Usa1998P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1998, Problem 1
Suppose that the set { 1, 2, ..., 1998 } has been partitioned into disjoint
pairs {aα΅’, bα΅’}, where 1 β€ i β€ 999, so that for all i, |aα΅’ - bα΅’| = 1 or 6.
Prove that the sum
|aβ - bβ| + |aβ - bβ| + ... + |aβββ - bβββ|
-/
|
/--
`ab 0 i` is aα΅’ and `ab 1 i` is `bα΅’`
-/
theorem usa1998_p1
(ab : Fin 2 β Fin 999 β Finset.Icc 1 1998)
(hab : (ab.uncurry).Bijective)
(habd : β i : Fin 999,
|(ab 0 i : β€) - (ab 1 i : β€)| = 1 β¨
|(ab 0 i : β€) - (ab 1 i : β€)| = 6) :
(β i : Fin 999, |(ab 0 i : β€) - (ab 1 i : β€)|) % 10 = 9 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1998, Problem 1
Suppose that the set { 1, 2, ..., 1998 } has been partitioned into disjoint
pairs {aα΅’, bα΅’}, where 1 β€ i β€ 999, so that for all i, |aα΅’ - bα΅’| = 1 or 6.
Prove that the sum
|aβ - bβ| + |aβ - bβ| + ... + |aβββ - bβββ|
-/
/--
`ab 0 i` is aα΅’ and `ab 1 i` is `bα΅’`
-/
theorem usa1998_p1
(ab : Fin 2 β Fin 999 β Finset.Icc 1 1998)
(hab : (ab.uncurry).Bijective)
(habd : β i : Fin 999,
|(ab 0 i : β€) - (ab 1 i : β€)| = 1 β¨
|(ab 0 i : β€) - (ab 1 i : β€)| = 6) :
(β i : Fin 999, |(ab 0 i : β€) - (ab 1 i : β€)|) % 10 = 9 := by sorry
|
number theory
|
Imo1982P3b
| true |
[
"algebra"
] |
Imo1982P3b
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1982, Problem 3
Consider infinite sequences $\{x_n \}$ of positive reals such that $x_0 = 0$ and
$x_0 \geq x_1 \geq x_2 \geq ...$
b) Find such a sequence such that for all n:
$\frac{x_0^2}{x_1} + \ldots + \frac{x_{n-1}^2}{x_n} < 4$
-/
|
noncomputable abbrev sol : β β β := fun k β¦ 2β»ΒΉ ^ k
theorem imo1982_q3b : Antitone sol β§ sol 0 = 1 β§ (β k, 0 < sol k)
β§ β n, β k β Finset.range n, sol k ^ 2 / sol (k + 1) < 4 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1982, Problem 3
Consider infinite sequences $\{x_n \}$ of positive reals such that $x_0 = 0$ and
$x_0 \geq x_1 \geq x_2 \geq ...$
b) Find such a sequence such that for all n:
$\frac{x_0^2}{x_1} + \ldots + \frac{x_{n-1}^2}{x_n} < 4$
-/
noncomputable abbrev sol : β β β := fun k β¦ 2β»ΒΉ ^ k
theorem imo1982_q3b : Antitone sol β§ sol 0 = 1 β§ (β k, 0 < sol k)
β§ β n, β k β Finset.range n, sol k ^ 2 / sol (k + 1) < 4 := by sorry
|
algebra
|
Romania1998P12
| true |
[
"algebra"
] |
Romania1998P12
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# Romanian Mathematical Olympiad 1998, Problem 12
Find all functions u : β β β for which there exists a strictly monotonic
function f : β β β such that
β x,y β β, f(x + y) = f(x)u(y) + f(y)
-/
|
abbrev solution_set : Set (β β β) :=
{ u | β k : β, β x : β, u x = Real.exp (k * x) }
theorem romania1998_p12 (u : β β β) :
(β f : β β β, (StrictMono f β¨ StrictAnti f)
β§ β x y : β, f (x + y) = f x * u y + f y) β
u β solution_set := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# Romanian Mathematical Olympiad 1998, Problem 12
Find all functions u : β β β for which there exists a strictly monotonic
function f : β β β such that
β x,y β β, f(x + y) = f(x)u(y) + f(y)
-/
abbrev solution_set : Set (β β β) :=
{ u | β k : β, β x : β, u x = Real.exp (k * x) }
theorem romania1998_p12 (u : β β β) :
(β f : β β β, (StrictMono f β¨ StrictAnti f)
β§ β x y : β, f (x + y) = f x * u y + f y) β
u β solution_set := by sorry
|
algebra
|
Imo1987P1
| true |
[
"combinatorics"
] |
Imo1987P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# 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!$.
-/
|
/-- Given `Ξ± : Type*` and `k : β`, `fiber Ξ± k` is the set of permutations of
`Ξ±` with exactly `k` fixed points. -/
def fiber (Ξ± : Type*) [Fintype Ξ±] [DecidableEq Ξ±] (k : β) : Set (Equiv.Perm Ξ±) :=
{Ο : Equiv.Perm Ξ± | Fintype.card (Function.fixedPoints Ο) = k}
instance {k : β} (Ξ± : Type*) [Fintype Ξ±] [DecidableEq Ξ±] :
Fintype (fiber Ξ± k) := by unfold fiber; infer_instance
/-- `p Ξ± k` is the number of permutations of `Ξ±` with exactly `k` fixed points. -/
def p (Ξ± : Type*) [Fintype Ξ±] [DecidableEq Ξ±] (k : β) : β := Fintype.card (fiber Ξ± k)
theorem imo1987_p1 {n : β} (hn : 1 β€ n) :
β k β Finset.range (n + 1), k * p (Fin n) k = n ! := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# 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!$.
-/
/-- Given `Ξ± : Type*` and `k : β`, `fiber Ξ± k` is the set of permutations of
`Ξ±` with exactly `k` fixed points. -/
def fiber (Ξ± : Type*) [Fintype Ξ±] [DecidableEq Ξ±] (k : β) : Set (Equiv.Perm Ξ±) :=
{Ο : Equiv.Perm Ξ± | Fintype.card (Function.fixedPoints Ο) = k}
instance {k : β} (Ξ± : Type*) [Fintype Ξ±] [DecidableEq Ξ±] :
Fintype (fiber Ξ± k) := by unfold fiber; infer_instance
/-- `p Ξ± k` is the number of permutations of `Ξ±` with exactly `k` fixed points. -/
def p (Ξ± : Type*) [Fintype Ξ±] [DecidableEq Ξ±] (k : β) : β := Fintype.card (fiber Ξ± k)
theorem imo1987_p1 {n : β} (hn : 1 β€ n) :
β k β Finset.range (n + 1), k * p (Fin n) k = n ! := by sorry
|
combinatorics
|
Imo1994P5
| true |
[
"algebra"
] |
Imo1994P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1994, Problem 5
Let S be the set of all real numbers greater than -1.
Find all functions f : SβS such that f(x + f(y) + xf(y)) = y + f(x) + yf(x)
for all x and y, and f(x)/x is strictly increasing on each of the
intervals -1 < x < 0 and 0 < x.
-/
|
def S := { x : β // -1 < x }
abbrev op (f : S β S) (a b : S) : S :=
β¨a.val + (f b).val + a.val * (f b).val, by nlinarith [a.property, (f b).property]β©
axiom sol_prop {a : β} (ha : -1 < a) : -1 < -a / (1 + a)
abbrev solution_set : Set (S β S) := { fun x β¦ β¨-x.val / (1 + x.val), sol_prop x.propertyβ© }
theorem imo1994_p5 (f : S β S) :
f β solution_set β
((β x y : S, f (op f x y) = op f y x) β§
(β x y : S, x.val β Set.Ioo (-1) 0 β y.val β Set.Ioo (-1) 0 β
x.val < y.val β (f x).val / x.val < (f y).val / y.val) β§
(β x y : S, 0 < x.val β 0 < y.val β
x.val < y.val β (f x).val / x.val < (f y).val / y.val)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1994, Problem 5
Let S be the set of all real numbers greater than -1.
Find all functions f : SβS such that f(x + f(y) + xf(y)) = y + f(x) + yf(x)
for all x and y, and f(x)/x is strictly increasing on each of the
intervals -1 < x < 0 and 0 < x.
-/
def S := { x : β // -1 < x }
abbrev op (f : S β S) (a b : S) : S :=
β¨a.val + (f b).val + a.val * (f b).val, by nlinarith [a.property, (f b).property]β©
axiom sol_prop {a : β} (ha : -1 < a) : -1 < -a / (1 + a)
abbrev solution_set : Set (S β S) := { fun x β¦ β¨-x.val / (1 + x.val), sol_prop x.propertyβ© }
theorem imo1994_p5 (f : S β S) :
f β solution_set β
((β x y : S, f (op f x y) = op f y x) β§
(β x y : S, x.val β Set.Ioo (-1) 0 β y.val β Set.Ioo (-1) 0 β
x.val < y.val β (f x).val / x.val < (f y).val / y.val) β§
(β x y : S, 0 < x.val β 0 < y.val β
x.val < y.val β (f x).val / x.val < (f y).val / y.val)) := by sorry
|
algebra
|
Imo1983P6
| true |
[
"algebra",
"inequality"
] |
Imo1983P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1983, Problem 6
Suppose that a,b,c are the side lengths of a triangle. Prove that
aΒ²b(a - b) + bΒ²c(b - c) + cΒ²a(c - a) β₯ 0.
Determine when equality occurs.
-/
|
abbrev EqualityCondition (a b c : β) : Prop := a = b β§ a = c
theorem imo1983_p6 (T : Affine.Triangle β (EuclideanSpace β (Fin 2))) :
let a := dist (T.points 1) (T.points 2)
let b := dist (T.points 0) (T.points 2)
let c := dist (T.points 0) (T.points 1)
0 β€ a^2 * b * (a - b) + b^2 * c * (b - c) + c^2 * a * (c - a) β§
(0 = a^2 * b * (a - b) + b^2 * c * (b - c) + c^2 * a * (c - a) β
EqualityCondition a b c) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1983, Problem 6
Suppose that a,b,c are the side lengths of a triangle. Prove that
aΒ²b(a - b) + bΒ²c(b - c) + cΒ²a(c - a) β₯ 0.
Determine when equality occurs.
-/
abbrev EqualityCondition (a b c : β) : Prop := a = b β§ a = c
theorem imo1983_p6 (T : Affine.Triangle β (EuclideanSpace β (Fin 2))) :
let a := dist (T.points 1) (T.points 2)
let b := dist (T.points 0) (T.points 2)
let c := dist (T.points 0) (T.points 1)
0 β€ a^2 * b * (a - b) + b^2 * c * (b - c) + c^2 * a * (c - a) β§
(0 = a^2 * b * (a - b) + b^2 * c * (b - c) + c^2 * a * (c - a) β
EqualityCondition a b c) := by sorry
|
algebra
|
Usa1993P3
| false |
[
"algebra"
] |
Usa1993P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1993, Problem 3
Consider functions f : [0,1] β β which satisfy
(i) f(x) β₯ 0 for all x β [0,1]
(ii) f(1) = 1
(iii) f(x) + f(y) β€ f (x + y) whenever x, y and x + y are all in [0,1].
Determine the smallest constant c such that
f(x) β€ cx
for every function satisfying (i) - (iii) and every x β [0,1].
-/
|
def valid (f : Set.Icc 0 1 β β) : Prop :=
(β x, 0 β€ f x) β§
f 1 = 1 β§
β x y, (h : x.val + y.val β Set.Icc 0 1) β f x + f y β€ f β¨x.val + y.val, hβ©
abbrev min_c : β := 2
theorem usa1993_p5 :
IsLeast {c | β f, valid f β§ β x, f x β€ c * x } min_c := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1993, Problem 3
Consider functions f : [0,1] β β which satisfy
(i) f(x) β₯ 0 for all x β [0,1]
(ii) f(1) = 1
(iii) f(x) + f(y) β€ f (x + y) whenever x, y and x + y are all in [0,1].
Determine the smallest constant c such that
f(x) β€ cx
for every function satisfying (i) - (iii) and every x β [0,1].
-/
def valid (f : Set.Icc 0 1 β β) : Prop :=
(β x, 0 β€ f x) β§
f 1 = 1 β§
β x y, (h : x.val + y.val β Set.Icc 0 1) β f x + f y β€ f β¨x.val + y.val, hβ©
abbrev min_c : β := 2
theorem usa1993_p5 :
IsLeast {c | β f, valid f β§ β x, f x β€ c * x } min_c := by sorry
|
algebra
|
Imo1986P5
| true |
[
"algebra"
] |
Imo1986P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1986, Problem 5
Find all functions `f`, defined on the non-negative real numbers and taking nonnegative real values,
such that:
- $f(xf(y))f(y) = f(x + y)$ for all $x, y \ge 0$,
- $f(2) = 0$,
- $f(x) \ne 0$ for $0 \le x < 2$.
-/
|
/- special open -/ open NNReal
structure IsGood (f : ββ₯0 β ββ₯0) : Prop where
map_add_rev x y : f (x * f y) * f y = f (x + y)
map_two : f 2 = 0
map_ne_zero : β x < 2, f x β 0
abbrev SolutionSet : Set (ββ₯0 β ββ₯0) := { fun x β¦ 2 / (2 - x) }
theorem imo1986_p5 {f : ββ₯0 β ββ₯0} : IsGood f β f β SolutionSet := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1986, Problem 5
Find all functions `f`, defined on the non-negative real numbers and taking nonnegative real values,
such that:
- $f(xf(y))f(y) = f(x + y)$ for all $x, y \ge 0$,
- $f(2) = 0$,
- $f(x) \ne 0$ for $0 \le x < 2$.
-/
/- special open -/ open NNReal
structure IsGood (f : ββ₯0 β ββ₯0) : Prop where
map_add_rev x y : f (x * f y) * f y = f (x + y)
map_two : f 2 = 0
map_ne_zero : β x < 2, f x β 0
abbrev SolutionSet : Set (ββ₯0 β ββ₯0) := { fun x β¦ 2 / (2 - x) }
theorem imo1986_p5 {f : ββ₯0 β ββ₯0} : IsGood f β f β SolutionSet := by sorry
|
algebra
|
Imo1991P6
| false |
[
"algebra"
] |
Imo1991P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1991, Problem 6
An infinite sequence xβ,xβ,xβ,... of real numbers is said to be *bounded*
if there is a constant C such that |xα΅’| β€ C for every i β₯ 0.
Given any real number a > 1, construct a bounded infinite sequence
xβ,xβ,xβ,... such that
|xα΅’ - xβ±Ό|β¬|i - j| β₯ 1
for every pair of distinct nonnegative integers i, j.
-/
|
abbrev Bounded (x : β β β) : Prop := β C, β i, |x i| β€ C
noncomputable abbrev solution (a : β) (ha : 1 < a) : β β β :=
let t := 1/(2^a)
let c := 1 - t/(1 - t)
Ξ» n => if n = 0 then 0 else
(1/c) * (β i β Finset.filter (Ξ» i => (n / 2^i) % 2 = 1) (Finset.range (Nat.log2 n + 1)), t^i)
theorem imo1991_p6 (a : β) (ha : 1 < a) :
Bounded (solution a ha) β§
β i j, i β j β
1 β€ |solution a ha i - solution a ha j| * |(i:β) - j| := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1991, Problem 6
An infinite sequence xβ,xβ,xβ,... of real numbers is said to be *bounded*
if there is a constant C such that |xα΅’| β€ C for every i β₯ 0.
Given any real number a > 1, construct a bounded infinite sequence
xβ,xβ,xβ,... such that
|xα΅’ - xβ±Ό|β¬|i - j| β₯ 1
for every pair of distinct nonnegative integers i, j.
-/
abbrev Bounded (x : β β β) : Prop := β C, β i, |x i| β€ C
noncomputable abbrev solution (a : β) (ha : 1 < a) : β β β :=
let t := 1/(2^a)
let c := 1 - t/(1 - t)
Ξ» n => if n = 0 then 0 else
(1/c) * (β i β Finset.filter (Ξ» i => (n / 2^i) % 2 = 1) (Finset.range (Nat.log2 n + 1)), t^i)
theorem imo1991_p6 (a : β) (ha : 1 < a) :
Bounded (solution a ha) β§
β i j, i β j β
1 β€ |solution a ha i - solution a ha j| * |(i:β) - j| := by sorry
|
algebra
|
Imo1998P4
| false |
[
"number theory"
] |
Imo1998P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1998, Problem 4
Determine all pairs (a, b) of positive integers such that ab^2 + b + 7 divides a^2b + a + b.
-/
|
abbrev solution_set : Set (β Γ β) := {(11, 1), (49, 1)} βͺ
{(x,y) | β k : β , (x = 7 * k^2 β§ y = 7 * k)}
theorem imo1998_p4 (a b : β) :
(0 < a β§ 0 < b β§ a * b^2 + b + 7 β£ a^2 * b + a + b) β
(a, b) β solution_set := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1998, Problem 4
Determine all pairs (a, b) of positive integers such that ab^2 + b + 7 divides a^2b + a + b.
-/
abbrev solution_set : Set (β Γ β) := {(11, 1), (49, 1)} βͺ
{(x,y) | β k : β , (x = 7 * k^2 β§ y = 7 * k)}
theorem imo1998_p4 (a b : β) :
(0 < a β§ 0 < b β§ a * b^2 + b + 7 β£ a^2 * b + a + b) β
(a, b) β solution_set := by sorry
|
number theory
|
Usa1996P1
| true |
[
"algebra"
] |
Usa1996P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1996, Problem 1
Prove that the average of the numbers nβ¬sin(n Ο / 180)
for n β {2,4,6,β¦,180} is 1/tan(Ο/180).
-/
|
theorem usa1996_p1 :
(1 / (90:β)) * β n β Finset.range 90, (2 * (n+1)) * Real.sin ((2 * (n+1)) * Real.pi / 180)
= 1 / Real.tan (Real.pi / 180) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1996, Problem 1
Prove that the average of the numbers nβ¬sin(n Ο / 180)
for n β {2,4,6,β¦,180} is 1/tan(Ο/180).
-/
theorem usa1996_p1 :
(1 / (90:β)) * β n β Finset.range 90, (2 * (n+1)) * Real.sin ((2 * (n+1)) * Real.pi / 180)
= 1 / Real.tan (Real.pi / 180) := by sorry
|
algebra
|
Usa1989P5
| true |
[
"algebra"
] |
Usa1989P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1989, Problem 5
Let u and v be real numbers such that
(u + uΒ² + uΒ³ + β― + uβΈ) + 10uβΉ = (v + vΒ² + vΒ³ + β― + vΒΉβ°) + 10vΒΉΒΉ = 8.
Determine, with proof, which of the two numbers, u or v, is larger.
-/
|
abbrev u_is_larger : Bool := false
theorem usa1989_p5
(u v : β)
(hu : (β i β Finset.range 8, u^(i + 1)) + 10 * u^9 = 8)
(hv : (β i β Finset.range 10, v^(i + 1)) + 10 * v^11 = 8) :
if u_is_larger then v < u else u < v := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1989, Problem 5
Let u and v be real numbers such that
(u + uΒ² + uΒ³ + β― + uβΈ) + 10uβΉ = (v + vΒ² + vΒ³ + β― + vΒΉβ°) + 10vΒΉΒΉ = 8.
Determine, with proof, which of the two numbers, u or v, is larger.
-/
abbrev u_is_larger : Bool := false
theorem usa1989_p5
(u v : β)
(hu : (β i β Finset.range 8, u^(i + 1)) + 10 * u^9 = 8)
(hv : (β i β Finset.range 10, v^(i + 1)) + 10 * v^11 = 8) :
if u_is_larger then v < u else u < v := by sorry
|
algebra
|
Imo1990P3
| true |
[
"number theory"
] |
Imo1990P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1990, Problem 3
Find all integers n > 1 such that nΒ² divides 2βΏ + 1.
-/
|
abbrev solution_set : Set β := { 3 }
theorem imo1990_p3 (n : β) (hn : 1 < n) : n β solution_set β n^2 β£ 2^n + 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1990, Problem 3
Find all integers n > 1 such that nΒ² divides 2βΏ + 1.
-/
abbrev solution_set : Set β := { 3 }
theorem imo1990_p3 (n : β) (hn : 1 < n) : n β solution_set β n^2 β£ 2^n + 1 := by sorry
|
number theory
|
Imo1994P4
| false |
[
"number theory"
] |
Imo1994P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1994, Problem 4
Determine all ordered pairs of positive integers (m, n) such that
(nΒ³ + 1) / (mn - 1)
is an integer.
-/
|
abbrev SolutionSet : Set (β€ Γ β€) :=
{(1, 2), (1, 3), (2, 1), (2, 2), (2, 5), (3, 1), (3, 5), (5, 2), (5, 3)}
theorem imo1994_p4 (m n : β€) :
(m, n) β SolutionSet β
0 < m β§ 0 < n β§ (m * n - 1) β£ (n^3 + 1) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1994, Problem 4
Determine all ordered pairs of positive integers (m, n) such that
(nΒ³ + 1) / (mn - 1)
is an integer.
-/
abbrev SolutionSet : Set (β€ Γ β€) :=
{(1, 2), (1, 3), (2, 1), (2, 2), (2, 5), (3, 1), (3, 5), (5, 2), (5, 3)}
theorem imo1994_p4 (m n : β€) :
(m, n) β SolutionSet β
0 < m β§ 0 < n β§ (m * n - 1) β£ (n^3 + 1) := by sorry
|
number theory
|
Imo1992P2
| true |
[
"algebra"
] |
Imo1992P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1992, Problem 2
Determine all functions f : β β β such that
for all x,y β β, f(xΒ² + f(y)) = y + (f(x))Β².
-/
|
abbrev solution_set : Set (β β β) := { fun x β¦ x }
theorem imo1992_p2 (f : β β β) :
f β solution_set β
β x y, f (x^2 + f y) = y + f x ^ 2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1992, Problem 2
Determine all functions f : β β β such that
for all x,y β β, f(xΒ² + f(y)) = y + (f(x))Β².
-/
abbrev solution_set : Set (β β β) := { fun x β¦ x }
theorem imo1992_p2 (f : β β β) :
f β solution_set β
β x y, f (x^2 + f y) = y + f x ^ 2 := by sorry
|
algebra
|
Imo1981P6
| true |
[
"algebra"
] |
Imo1981P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1981, Problem 6
Suppose that f : β Γ β β β satisfies
1) f (0, y) = y + 1
2) f (x + 1, 0) = f (x, 1),
3) f (x + 1, y + 1) = f (x, f (x + 1, y))
for all x y β β.
Determine f (4, 1981).
-/
|
def no_eval (x : β) : β := x
abbrev solution_value : β := no_eval ((2^Β·)^[1984] 1 - 3)
theorem imo1981_p6 (f : β β β β β)
(h1 : β y, f 0 y = y + 1)
(h2 : β x, f (x + 1) 0 = f x 1)
(h3 : β x y, f (x + 1) (y + 1) = f x (f (x + 1) y)) :
f 4 1981 = solution_value := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1981, Problem 6
Suppose that f : β Γ β β β satisfies
1) f (0, y) = y + 1
2) f (x + 1, 0) = f (x, 1),
3) f (x + 1, y + 1) = f (x, f (x + 1, y))
for all x y β β.
Determine f (4, 1981).
-/
def no_eval (x : β) : β := x
abbrev solution_value : β := no_eval ((2^Β·)^[1984] 1 - 3)
theorem imo1981_p6 (f : β β β β β)
(h1 : β y, f 0 y = y + 1)
(h2 : β x, f (x + 1) 0 = f x 1)
(h3 : β x y, f (x + 1) (y + 1) = f x (f (x + 1) y)) :
f 4 1981 = solution_value := by sorry
|
algebra
|
Singapore2019P2
| true |
[
"algebra"
] |
Singapore2019P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# Singapore Math Olympiad (Senior) 2019 (Round 1), Problem 2
http://www.realsutra.com/limjeck/SMO_Senior_2019.pdf
Simplify $(sqrt{10} - sqrt{2})^{1/3} * (sqrt{10} + sqrt{2})^{7/3}$.
-/
|
noncomputable abbrev solution : β := 24 + 8 * β5
theorem singapore2019_r1_p2 : (β10 - β2)^(1 / 3 : β) * (β10 + β2)^(7 / 3 : β) = solution := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# Singapore Math Olympiad (Senior) 2019 (Round 1), Problem 2
http://www.realsutra.com/limjeck/SMO_Senior_2019.pdf
Simplify $(sqrt{10} - sqrt{2})^{1/3} * (sqrt{10} + sqrt{2})^{7/3}$.
-/
noncomputable abbrev solution : β := 24 + 8 * β5
theorem singapore2019_r1_p2 : (β10 - β2)^(1 / 3 : β) * (β10 + β2)^(7 / 3 : β) = solution := by sorry
|
algebra
|
Imo2012P4
| true |
[
"algebra"
] |
Imo2012P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2012, Problem 4
Determine all functions f : β€ β β€ such that for all integers a,b,c with a + b + c = 0,
the following equality holds:
f(a)Β² + f(b)Β² + f(c)Β² = 2f(a)f(b) + 2f(b)f(c) + 2f(c)f(a).
-/
|
def odd_const : Set (β€ β β€) := fun f =>
β c : β€, β x : β€,
(Odd x β f x = c) β§ (Even x β f x = 0)
def mod4_cycle : Set (β€ β β€) := fun f =>
β c : β€, β x : β€, f x =
match x % 4 with
| 0 => 0
| 2 => 4 * c
| _ => c
def square_set : Set (β€ β β€) := fun f =>
β c : β€, β x : β€, f x = x ^ 2 * c
abbrev solution_set : Set (β€ β β€) := odd_const βͺ mod4_cycle βͺ square_set
theorem imo2012_p4 (f : β€ β β€) :
f β solution_set β
β a b c : β€, a + b + c = 0 β
(f a)^2 + (f b)^2 + (f c)^2 =
2 * f a * f b + 2 * f b * f c + 2 * f c * f a := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2012, Problem 4
Determine all functions f : β€ β β€ such that for all integers a,b,c with a + b + c = 0,
the following equality holds:
f(a)Β² + f(b)Β² + f(c)Β² = 2f(a)f(b) + 2f(b)f(c) + 2f(c)f(a).
-/
def odd_const : Set (β€ β β€) := fun f =>
β c : β€, β x : β€,
(Odd x β f x = c) β§ (Even x β f x = 0)
def mod4_cycle : Set (β€ β β€) := fun f =>
β c : β€, β x : β€, f x =
match x % 4 with
| 0 => 0
| 2 => 4 * c
| _ => c
def square_set : Set (β€ β β€) := fun f =>
β c : β€, β x : β€, f x = x ^ 2 * c
abbrev solution_set : Set (β€ β β€) := odd_const βͺ mod4_cycle βͺ square_set
theorem imo2012_p4 (f : β€ β β€) :
f β solution_set β
β a b c : β€, a + b + c = 0 β
(f a)^2 + (f b)^2 + (f c)^2 =
2 * f a * f b + 2 * f b * f c + 2 * f c * f a := by sorry
|
algebra
|
Imo2008P3
| true |
[
"number theory"
] |
Imo2008P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2008, Problem 3
Prove that there exist infinitely many positive integers `n` such that `n^2 + 1` has a prime
divisor which is greater than `2n + β(2n)`.
-/
|
theorem imo2008_p3 : β N : β, β n : β, n β₯ N β§
β p : β, Nat.Prime p β§ p β£ n ^ 2 + 1 β§ (p : β) > 2 * (n : β) + Real.sqrt (2 * (n : β)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2008, Problem 3
Prove that there exist infinitely many positive integers `n` such that `n^2 + 1` has a prime
divisor which is greater than `2n + β(2n)`.
-/
theorem imo2008_p3 : β N : β, β n : β, n β₯ N β§
β p : β, Nat.Prime p β§ p β£ n ^ 2 + 1 β§ (p : β) > 2 * (n : β) + Real.sqrt (2 * (n : β)) := by sorry
|
number theory
|
Usa2002P1
| true |
[
"combinatorics"
] |
Usa2002P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# 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 of any two blue subsets is blue;
c) there are exactly N red subsets.
-/
|
inductive Color : Type where
| red : Color
| blue : Color
deriving DecidableEq, Fintype
theorem usa2002_p1
{Ξ± : Type} [DecidableEq Ξ±] [Fintype Ξ±] (hs : Fintype.card Ξ± = 2002)
(N : β) (hN : N β€ 2 ^ 2002) :
β f : Finset Ξ± β Color,
((β s1 s2 : Finset Ξ±, f s1 = f s2 β f (s1 βͺ s2) = f s1) β§
(Fintype.card
{ a : Finset Ξ± // f a = Color.red } = N)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# 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 of any two blue subsets is blue;
c) there are exactly N red subsets.
-/
inductive Color : Type where
| red : Color
| blue : Color
deriving DecidableEq, Fintype
theorem usa2002_p1
{Ξ± : Type} [DecidableEq Ξ±] [Fintype Ξ±] (hs : Fintype.card Ξ± = 2002)
(N : β) (hN : N β€ 2 ^ 2002) :
β f : Finset Ξ± β Color,
((β s1 s2 : Finset Ξ±, f s1 = f s2 β f (s1 βͺ s2) = f s1) β§
(Fintype.card
{ a : Finset Ξ± // f a = Color.red } = N)) := by sorry
|
combinatorics
|
Bulgaria1998P3
| true |
[
"algebra"
] |
Bulgaria1998P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# Bulgarian Mathematical Olympiad 1998, Problem 3
Let ββΊ be the set of positive real numbers. Prove that there does not exist a function
f: ββΊ β ββΊ such that
(f(x))Β² β₯ f(x + y) * (f(x) + y)
for every x,y β ββΊ.
-/
|
theorem bulgaria1998_p3
(f : β β β)
(hpos : β x : β, 0 < x β 0 < f x)
(hf : (β x y : β, 0 < x β 0 < y β (f (x + y)) * (f x + y) β€ (f x)^2)) :
False := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# Bulgarian Mathematical Olympiad 1998, Problem 3
Let ββΊ be the set of positive real numbers. Prove that there does not exist a function
f: ββΊ β ββΊ such that
(f(x))Β² β₯ f(x + y) * (f(x) + y)
for every x,y β ββΊ.
-/
theorem bulgaria1998_p3
(f : β β β)
(hpos : β x : β, 0 < x β 0 < f x)
(hf : (β x y : β, 0 < x β 0 < y β (f (x + y)) * (f x + y) β€ (f x)^2)) :
False := by sorry
|
algebra
|
Imo2022P2
| true |
[
"algebra"
] |
Imo2022P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2022, Problem 2
Let β+ be the set of positive real numbers.
Determine all functions f: β+ β β+ such that
for each x β β+, there is exactly one y β β+
satisfying
xΒ·f(y) + yΒ·f(x) β€ 2
-/
|
abbrev PosReal : Type := { x : β // 0 < x }
notation "β+" => PosReal
abbrev solution_set : Set (β+ β β+) := { fun x β¦ 1 / x }
theorem imo2022_p2 (f : β+ β β+) :
f β solution_set β
β x, β! y, x * f y + y * f x β€ β¨2, two_posβ© := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2022, Problem 2
Let β+ be the set of positive real numbers.
Determine all functions f: β+ β β+ such that
for each x β β+, there is exactly one y β β+
satisfying
xΒ·f(y) + yΒ·f(x) β€ 2
-/
abbrev PosReal : Type := { x : β // 0 < x }
notation "β+" => PosReal
abbrev solution_set : Set (β+ β β+) := { fun x β¦ 1 / x }
theorem imo2022_p2 (f : β+ β β+) :
f β solution_set β
β x, β! y, x * f y + y * f x β€ β¨2, two_posβ© := by sorry
|
algebra
|
Imo1971P3
| false |
[
"number theory"
] |
Imo1971P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1971, Problem 3
Prove that we can find an infinite set of positive integers of the form 2^n - 3
(where n is a positive integer) every pair of which are relatively prime.
-/
|
theorem imo1971_p3 : Set.Infinite
{(n, m) : β Γ β | Nat.Coprime (2 ^ n - 3) (2 ^ m - 3)} := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1971, Problem 3
Prove that we can find an infinite set of positive integers of the form 2^n - 3
(where n is a positive integer) every pair of which are relatively prime.
-/
theorem imo1971_p3 : Set.Infinite
{(n, m) : β Γ β | Nat.Coprime (2 ^ n - 3) (2 ^ m - 3)} := by sorry
|
number theory
|
Imo2003P1
| false |
[
"combinatorics"
] |
Imo2003P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2003, Problem 1
Let A be a 101-element subset of S = {1,2,...10βΆ}. Prove that
there exist numbers tβ, tβ, ..., tβββ in S such that the sets
Aβ±Ό = {x + tβ±Ό | x β A}, j = 1,2, ..., 100
are pairwise disjoint.
-/
|
abbrev S : Finset β := Finset.Icc 1 (10^6)
theorem imo2003_p1 (A : Finset β) (hA : A β S) :
β t : Fin 100 β S,
β i j, i β j β Disjoint {x + t i | x β A} {x + t j | x β A} := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2003, Problem 1
Let A be a 101-element subset of S = {1,2,...10βΆ}. Prove that
there exist numbers tβ, tβ, ..., tβββ in S such that the sets
Aβ±Ό = {x + tβ±Ό | x β A}, j = 1,2, ..., 100
are pairwise disjoint.
-/
abbrev S : Finset β := Finset.Icc 1 (10^6)
theorem imo2003_p1 (A : Finset β) (hA : A β S) :
β t : Fin 100 β S,
β i j, i β j β Disjoint {x + t i | x β A} {x + t j | x β A} := by sorry
|
combinatorics
|
Canada1998P5
| false |
[
"algebra"
] |
Canada1998P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
Canadian Mathematical Olympiad 1998, Problem 5
Let m be a positive integer. Define the sequence {aβ} by aβ = 0,
aβ = m, and aβββ = mΒ²aβ - aβββ for n β₯ 1. Prove that an ordered pair
(a,b) of nonegative integers, with a β€ b, is a solution of the equation
(aΒ² + bΒ²) / (ab + 1) = mΒ²
if an only if (a,b) = (aβ,aβββ) for some n β₯ 0.
-/
|
def A (m : β) (hm : 0 < m) : β β β€
| 0 => 0
| 1 => (βm)
| n + 2 => (m : β€)^2 * A m hm (n + 1) - A m hm n
theorem canada1998_p5 (m : β) (hm : 0 < m) (a b : β) (hab : a β€ b) :
a^2 + b^2 = m^2 * (a * b + 1) β
β n : β, (a:β€) = A m hm n β§ (b:β€) = A m hm (n + 1) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
Canadian Mathematical Olympiad 1998, Problem 5
Let m be a positive integer. Define the sequence {aβ} by aβ = 0,
aβ = m, and aβββ = mΒ²aβ - aβββ for n β₯ 1. Prove that an ordered pair
(a,b) of nonegative integers, with a β€ b, is a solution of the equation
(aΒ² + bΒ²) / (ab + 1) = mΒ²
if an only if (a,b) = (aβ,aβββ) for some n β₯ 0.
-/
def A (m : β) (hm : 0 < m) : β β β€
| 0 => 0
| 1 => (βm)
| n + 2 => (m : β€)^2 * A m hm (n + 1) - A m hm n
theorem canada1998_p5 (m : β) (hm : 0 < m) (a b : β) (hab : a β€ b) :
a^2 + b^2 = m^2 * (a * b + 1) β
β n : β, (a:β€) = A m hm n β§ (b:β€) = A m hm (n + 1) := by sorry
|
algebra
|
Imo2018P2
| true |
[
"algebra"
] |
Imo2018P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2018, Problem 2
Determine all integers n β₯ 3 such that there exist real numbers
aβ, aβ, ..., aβ satisfying
aα΅’aα΅’ββ + 1 = aα΅’ββ,
where the indices are taken mod n.
-/
|
abbrev P {n : β} (a : ZMod n β β) :=
β (i : ZMod n), a i * a (i + 1) + 1 = a (i + 2)
abbrev solution_set : Set β := { n | 3 β€ n β§ 3 β£ n }
theorem imo2018_p2 (n : β) :
n β solution_set β 3 β€ n β§ β a : ZMod n β β, P a := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2018, Problem 2
Determine all integers n β₯ 3 such that there exist real numbers
aβ, aβ, ..., aβ satisfying
aα΅’aα΅’ββ + 1 = aα΅’ββ,
where the indices are taken mod n.
-/
abbrev P {n : β} (a : ZMod n β β) :=
β (i : ZMod n), a i * a (i + 1) + 1 = a (i + 2)
abbrev solution_set : Set β := { n | 3 β€ n β§ 3 β£ n }
theorem imo2018_p2 (n : β) :
n β solution_set β 3 β€ n β§ β a : ZMod n β β, P a := by sorry
|
algebra
|
Imo2002P5
| true |
[
"algebra"
] |
Imo2002P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2002, Problem 5
Determine all functions f : β β β such that
(f(x) + f(z))(f(y) + f(t)) = f(xy - zt) + f(xt + yz)
for all real numbers x,y,z,t.
-/
|
abbrev SolutionSet : Set (β β β) :=
{ fun x β¦ 0, fun x β¦ 1/2, fun x β¦ x^2 }
theorem imo2002_p5 (f : β β β) :
f β SolutionSet β
β x y z t, (f x + f z) * (f y + f t) =
f (x * y - z * t) + f (x * t + y * z) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2002, Problem 5
Determine all functions f : β β β such that
(f(x) + f(z))(f(y) + f(t)) = f(xy - zt) + f(xt + yz)
for all real numbers x,y,z,t.
-/
abbrev SolutionSet : Set (β β β) :=
{ fun x β¦ 0, fun x β¦ 1/2, fun x β¦ x^2 }
theorem imo2002_p5 (f : β β β) :
f β SolutionSet β
β x y z t, (f x + f z) * (f y + f t) =
f (x * y - z * t) + f (x * t + y * z) := by sorry
|
algebra
|
Usa2001P4
| true |
[
"geometry"
] |
Usa2001P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 2001, Problem 4
Let ABC be a triangle and P be any point such that PA, PB, PC
are the sides of an obtuse triangle, with PA the longest side.
Prove that β BAC is acute.
-/
|
/- special open -/ open EuclideanGeometry
theorem usa2001_p4
(A B C P X Y Z : EuclideanSpace β (Fin 2))
(hABC : AffineIndependent β ![A, B, C])
(hXYZ : AffineIndependent β ![X, Y, Z])
(hPA : dist X Y = dist P A)
(hPB : dist Y Z = dist P B)
(hPC : dist Z X = dist P C)
(hObtuse : Real.pi / 2 < β X Z Y)
: β B A C < Real.pi / 2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 2001, Problem 4
Let ABC be a triangle and P be any point such that PA, PB, PC
are the sides of an obtuse triangle, with PA the longest side.
Prove that β BAC is acute.
-/
/- special open -/ open EuclideanGeometry
theorem usa2001_p4
(A B C P X Y Z : EuclideanSpace β (Fin 2))
(hABC : AffineIndependent β ![A, B, C])
(hXYZ : AffineIndependent β ![X, Y, Z])
(hPA : dist X Y = dist P A)
(hPB : dist Y Z = dist P B)
(hPC : dist Z X = dist P C)
(hObtuse : Real.pi / 2 < β X Z Y)
: β B A C < Real.pi / 2 := by sorry
|
geometry
|
Imo2020P3
| false |
[
"combinatorics"
] |
Imo2020P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2020, Problem 3
There are 4n pebbles of weights 1,2,3,...,4n. Each pebble is colored
in one of n colors and there are four pebbles of each color. Show
that we can arrange the pebbles into two piles such that the total
weights of both piles are the same, and each pile contains two
pebbles of each color.
-/
|
/- special open -/ open Finset
theorem imo2020_p3 {n : β} {c : Fin (4 * n) β Fin n} (h : β i, Finset.card (filter (Ξ» j => c j = i) univ) = 4) :
β S : Finset (Fin (4 * n)), β i β S, ((i : β) + 1) = β i β SαΆ, ((i : β) + 1) β§
β i, Finset.card (filter (Ξ» j => c j = i) S) = 2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2020, Problem 3
There are 4n pebbles of weights 1,2,3,...,4n. Each pebble is colored
in one of n colors and there are four pebbles of each color. Show
that we can arrange the pebbles into two piles such that the total
weights of both piles are the same, and each pile contains two
pebbles of each color.
-/
/- special open -/ open Finset
theorem imo2020_p3 {n : β} {c : Fin (4 * n) β Fin n} (h : β i, Finset.card (filter (Ξ» j => c j = i) univ) = 4) :
β S : Finset (Fin (4 * n)), β i β S, ((i : β) + 1) = β i β SαΆ, ((i : β) + 1) β§
β i, Finset.card (filter (Ξ» j => c j = i) S) = 2 := by sorry
|
combinatorics
|
Usa2023P2
| true |
[
"algebra"
] |
Usa2023P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 2023, Problem 2
Let β+ be the set of positive real numbers.
Find all functions f: β+ β β+ that satisfy the equation
f(xβ¬y + f(x)) = xβ¬f(y) + 2
for all x,y β β+.
-/
|
abbrev PosReal : Type := { x : β // 0 < x }
notation "β+" => PosReal
abbrev solution_set : Set (β+ β β+) := { fun x β¦ x + 1 }
theorem usa2023_p2 (f : β+ β β+) :
f β solution_set β
β x y, f (x * y + (f x)) = x * (f y) + β¨2, two_posβ© := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 2023, Problem 2
Let β+ be the set of positive real numbers.
Find all functions f: β+ β β+ that satisfy the equation
f(xβ¬y + f(x)) = xβ¬f(y) + 2
for all x,y β β+.
-/
abbrev PosReal : Type := { x : β // 0 < x }
notation "β+" => PosReal
abbrev solution_set : Set (β+ β β+) := { fun x β¦ x + 1 }
theorem usa2023_p2 (f : β+ β β+) :
f β solution_set β
β x y, f (x * y + (f x)) = x * (f y) + β¨2, two_posβ© := by sorry
|
algebra
|
Imo2015P6
| true |
[
"algebra"
] |
Imo2015P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2015, Problem 6
The sequence $a_1, a_2, \dots$ of integers satisfies the conditions
1. $1 β€ a_j β€ 2015$ for all $j β₯ 1$,
2. $k + a_k β l + a_l$ for all $1 β€ k < l$.
Prove that there exist two positive integers $b$ and $N$ for which
$$\left|\sum_{j=m+1}^n (a_j-b)\right| β€ 1007^2$$
for all integers $m,n$ such that $N β€ m < n$.
-/
|
/-- The conditions on `a` in the problem. We reindex `a` to start from 0 rather than 1;
`N` then only has to be nonnegative rather than positive, and the sum in the problem statement
is over `Ico m n` rather than `Ioc m n`. -/
def Condition (a : β β β€) : Prop :=
(β i, a i β Finset.Icc 1 2015) β§ Function.Injective fun i β¦ i + a i
theorem imo2015_p6 (ha : Condition a) :
β b > 0, β N, β m β₯ N, β n > m, |β j β Finset.Ico m n, (a j - b)| β€ 1007 ^ 2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2015, Problem 6
The sequence $a_1, a_2, \dots$ of integers satisfies the conditions
1. $1 β€ a_j β€ 2015$ for all $j β₯ 1$,
2. $k + a_k β l + a_l$ for all $1 β€ k < l$.
Prove that there exist two positive integers $b$ and $N$ for which
$$\left|\sum_{j=m+1}^n (a_j-b)\right| β€ 1007^2$$
for all integers $m,n$ such that $N β€ m < n$.
-/
/-- The conditions on `a` in the problem. We reindex `a` to start from 0 rather than 1;
`N` then only has to be nonnegative rather than positive, and the sum in the problem statement
is over `Ico m n` rather than `Ioc m n`. -/
def Condition (a : β β β€) : Prop :=
(β i, a i β Finset.Icc 1 2015) β§ Function.Injective fun i β¦ i + a i
theorem imo2015_p6 (ha : Condition a) :
β b > 0, β N, β m β₯ N, β n > m, |β j β Finset.Ico m n, (a j - b)| β€ 1007 ^ 2 := by sorry
|
algebra
|
Imo1985P6
| true |
[
"algebra"
] |
Imo1985P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1985, Problem 6
For every real number x_1, construct the sequence {x_1,x_2, ...}
by setting x_{n+1} = x_n * (x_n + 1 / n) for each n >= 1.
Prove that there exists exactly one value of x_1 for which
0 < x_n , x_n < x_{n+1}, and x_{n+1} < 1 for every n.
-/
|
theorem imo_1985_p6
(f : β β β β β)
(hβ : β x, f 1 x = x)
(hβ : β n x, 0 < n β f (n + 1) x = f n x * (f n x + 1 / n)) :
β! a, β n, 0 < n β 0 < f n a β§ f n a < f (n + 1) a β§ f (n + 1) a < 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1985, Problem 6
For every real number x_1, construct the sequence {x_1,x_2, ...}
by setting x_{n+1} = x_n * (x_n + 1 / n) for each n >= 1.
Prove that there exists exactly one value of x_1 for which
0 < x_n , x_n < x_{n+1}, and x_{n+1} < 1 for every n.
-/
theorem imo_1985_p6
(f : β β β β β)
(hβ : β x, f 1 x = x)
(hβ : β n x, 0 < n β f (n + 1) x = f n x * (f n x + 1 / n)) :
β! a, β n, 0 < n β 0 < f n a β§ f n a < f (n + 1) a β§ f (n + 1) a < 1 := by sorry
|
algebra
|
Imo1959P2b
| true |
[
"algebra"
] |
Imo1959P2b
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1959, Problem 2
For what real values of x is
β(x+β(2x-1)) + β(x-β(2x-1)) = A,
given:
(a) A = β2
(b) A = 1
(c) A = 2,
where only non-negative real numbers are admitted for square roots?
-/
|
/- special open -/ open Set
def IsGood (x A : β) : Prop :=
sqrt (x + sqrt (2 * x - 1)) + sqrt (x - sqrt (2 * x - 1)) = A β§ 0 β€ 2 * x - 1 β§
0 β€ x + sqrt (2 * x - 1) β§ 0 β€ x - sqrt (2 * x - 1)
variable {x A : β}
abbrev solution_set_one : Set β := β
theorem imo1959_p2b : IsGood x 1 β x β solution_set_one := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1959, Problem 2
For what real values of x is
β(x+β(2x-1)) + β(x-β(2x-1)) = A,
given:
(a) A = β2
(b) A = 1
(c) A = 2,
where only non-negative real numbers are admitted for square roots?
-/
/- special open -/ open Set
def IsGood (x A : β) : Prop :=
sqrt (x + sqrt (2 * x - 1)) + sqrt (x - sqrt (2 * x - 1)) = A β§ 0 β€ 2 * x - 1 β§
0 β€ x + sqrt (2 * x - 1) β§ 0 β€ x - sqrt (2 * x - 1)
variable {x A : β}
abbrev solution_set_one : Set β := β
theorem imo1959_p2b : IsGood x 1 β x β solution_set_one := by sorry
|
algebra
|
Imo1968P5a
| true |
[
"algebra"
] |
Imo1968P5a
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1968, Problem 5
Let f be a real-valued function defined for all real numbers x such that,
for some positive constant a, the equation
f(x + a) = a/2 + β(f(x) - (f(x))Β²)
holds for all x.
(a) Prove that the function f is periodic.
-/
|
abbrev P (a : β) (f : β β β) : Prop :=
0 < a β§
β x, (f x)^2 β€ f x β§ f (x + a) = 1/2 + β(f x - (f x)^2)
theorem imo1968_p5a (f : β β β) (a : β) (hf : P a f) :
β b, 0 < b β§ f.Periodic b := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1968, Problem 5
Let f be a real-valued function defined for all real numbers x such that,
for some positive constant a, the equation
f(x + a) = a/2 + β(f(x) - (f(x))Β²)
holds for all x.
(a) Prove that the function f is periodic.
-/
abbrev P (a : β) (f : β β β) : Prop :=
0 < a β§
β x, (f x)^2 β€ f x β§ f (x + a) = 1/2 + β(f x - (f x)^2)
theorem imo1968_p5a (f : β β β) (a : β) (hf : P a f) :
β b, 0 < b β§ f.Periodic b := by sorry
|
algebra
|
Imo1984P2
| true |
[
"number theory"
] |
Imo1984P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1984, Problem 2
Find a pair of positive integers a and b such that
(i) ab(a + b) is not divisible by 7.
(ii) (a + b)β· - aβ· - bβ· is divisible by 7β·.
-/
|
abbrev a : β€ := 18
abbrev b : β€ := 1
theorem imo1984_p2 :
(0 < a) β§ (0 < b) β§
(Β¬ 7 β£ a * b * (a + b)) β§
7^7 β£ (a + b)^7 - a^7 - b^7 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1984, Problem 2
Find a pair of positive integers a and b such that
(i) ab(a + b) is not divisible by 7.
(ii) (a + b)β· - aβ· - bβ· is divisible by 7β·.
-/
abbrev a : β€ := 18
abbrev b : β€ := 1
theorem imo1984_p2 :
(0 < a) β§ (0 < b) β§
(Β¬ 7 β£ a * b * (a + b)) β§
7^7 β£ (a + b)^7 - a^7 - b^7 := by sorry
|
number theory
|
Bulgaria1998P8
| true |
[
"algebra"
] |
Bulgaria1998P8
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# Bulgarian Mathematical Olympiad 1998, Problem 8
The polynomials Pβ(x,y) for n = 1, 2, ... are defined by Pβ(x,y) = 1 and
Pβββ(x,y) = (x + y - 1)(y + 1)Pβ(x,y+2) + (y - yΒ²)Pβ(x,y)
Prove that Pβ(x,y) = Pβ(y,x) for all x,y,n.
-/
|
variable {R : Type} [CommRing R]
def P : β β R β R β R
| 0, _, _ => 1
| n+1, x, y => (x + y - 1) * (y + 1) * P n x (y + 2) + (y - y^2) * P n x y
theorem bulgaria1998_p8 (n : β) (x y : R) : P n x y = P n y x := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# Bulgarian Mathematical Olympiad 1998, Problem 8
The polynomials Pβ(x,y) for n = 1, 2, ... are defined by Pβ(x,y) = 1 and
Pβββ(x,y) = (x + y - 1)(y + 1)Pβ(x,y+2) + (y - yΒ²)Pβ(x,y)
Prove that Pβ(x,y) = Pβ(y,x) for all x,y,n.
-/
variable {R : Type} [CommRing R]
def P : β β R β R β R
| 0, _, _ => 1
| n+1, x, y => (x + y - 1) * (y + 1) * P n x (y + 2) + (y - y^2) * P n x y
theorem bulgaria1998_p8 (n : β) (x y : R) : P n x y = P n y x := by sorry
|
algebra
|
Imo1998P3
| false |
[
"number theory"
] |
Imo1998P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1998, Problem 3
For any positive integer $n$,
let $d(n)$ denote the number of positive divisors of $n$ (including 1 and $n$ itself).
Determine all positive integers $k$ such that $d(n^2)/d(n) = k$ for some $n$.
-/
|
abbrev solution_set : Set β := {x | β k : β , x = 2 * k + 1}
theorem imo1998_p3 (k : β) :
k β solution_set β
β n : β,
(Finset.card (Nat.divisors (n ^ 2))) = k * Finset.card (Nat.divisors n) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1998, Problem 3
For any positive integer $n$,
let $d(n)$ denote the number of positive divisors of $n$ (including 1 and $n$ itself).
Determine all positive integers $k$ such that $d(n^2)/d(n) = k$ for some $n$.
-/
abbrev solution_set : Set β := {x | β k : β , x = 2 * k + 1}
theorem imo1998_p3 (k : β) :
k β solution_set β
β n : β,
(Finset.card (Nat.divisors (n ^ 2))) = k * Finset.card (Nat.divisors n) := by sorry
|
number theory
|
Usa1992P1
| true |
[
"algebra"
] |
Usa1992P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1992, Problem 1
Find, as a function of n, the sum of the digits of
9 Γ 99 Γ 9999 Γ ... Γ (10^2βΏ - 1),
where each factor has twice as many digits as the last one.
-/
|
abbrev solution : β β β := fun n β¦ 9 * 2 ^ n
theorem usa1992_p1 (n : β) :
(Nat.digits 10
(β i β Finset.range (n + 1), (10^(2^i) - 1))).sum = solution n := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1992, Problem 1
Find, as a function of n, the sum of the digits of
9 Γ 99 Γ 9999 Γ ... Γ (10^2βΏ - 1),
where each factor has twice as many digits as the last one.
-/
abbrev solution : β β β := fun n β¦ 9 * 2 ^ n
theorem usa1992_p1 (n : β) :
(Nat.digits 10
(β i β Finset.range (n + 1), (10^(2^i) - 1))).sum = solution n := by sorry
|
algebra
|
Imo1982P4
| false |
[
"number theory"
] |
Imo1982P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1982, Problem 4
Prove that if n is a positive integer such that the equation
x3 - 3xy^2 + y^3 = n
has a solution in integers x, y, then it has at least three such solutions.
Show that the equation has no solutions in integers for n = 2891.
-/
|
theorem imo1982_p4 (n : β)
(hn : 0 < n)
(hxy : β x y : β€, x^3 - 3 * x * y^2 + y^3 = n) :
(n β 2891) β§
β x1 x2 x3 y1 y2 y3 : β€, (x1^3 - 3 * x1 * y1^2 + y1^3 = n β§
x2^3 - 3 * x2 * y2^2 + y2^3 = n β§
x3^3 - 3 * x3 * y3^2 + y3^3 = n β§
(x1 β x2 β¨ y1 β y2) β§
(x1 β x3 β¨ y1 β y3) β§
(x2 β x3 β¨ y2 β y3)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1982, Problem 4
Prove that if n is a positive integer such that the equation
x3 - 3xy^2 + y^3 = n
has a solution in integers x, y, then it has at least three such solutions.
Show that the equation has no solutions in integers for n = 2891.
-/
theorem imo1982_p4 (n : β)
(hn : 0 < n)
(hxy : β x y : β€, x^3 - 3 * x * y^2 + y^3 = n) :
(n β 2891) β§
β x1 x2 x3 y1 y2 y3 : β€, (x1^3 - 3 * x1 * y1^2 + y1^3 = n β§
x2^3 - 3 * x2 * y2^2 + y2^3 = n β§
x3^3 - 3 * x3 * y3^2 + y3^3 = n β§
(x1 β x2 β¨ y1 β y2) β§
(x1 β x3 β¨ y1 β y3) β§
(x2 β x3 β¨ y2 β y3)) := by sorry
|
number theory
|
Usa1981P5
| true |
[
"algebra"
] |
Usa1981P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1981, Problem 5
Show that for any positive real number x and any nonnegative
integer n,
ββ (βkxβ/k) β€ βnxβ
where the sum goes from k = 1 to k = n, inclusive.
-/
|
theorem usa1981_p5 (x : β) (n : β) :
β k β Finset.Icc 1 n, ((βk * xβ:β)/k) β€ βn * xβ := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1981, Problem 5
Show that for any positive real number x and any nonnegative
integer n,
ββ (βkxβ/k) β€ βnxβ
where the sum goes from k = 1 to k = n, inclusive.
-/
theorem usa1981_p5 (x : β) (n : β) :
β k β Finset.Icc 1 n, ((βk * xβ:β)/k) β€ βn * xβ := by sorry
|
algebra
|
Imo2006P5
| true |
[
"number theory"
] |
Imo2006P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2006, Problem 5
Let $P(x)$ be a polynomial of degree $n>1$ with integer coefficients, and let $k$ be a positive
integer. Consider the polynomial $Q(x) = P(P(\ldots P(P(x))\ldots))$, where $P$ occurs $k$ times.
Prove that there are at most $n$ integers $t$ such that $Q(t)=t$.
-/
|
/- special open -/ open Function Polynomial
theorem imo2006_p5 {P : Polynomial β€} (hP : 1 < P.natDegree) {k : β} (hk : 0 < k) :
(P.comp^[k] X - X).roots.toFinset.card β€ P.natDegree := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2006, Problem 5
Let $P(x)$ be a polynomial of degree $n>1$ with integer coefficients, and let $k$ be a positive
integer. Consider the polynomial $Q(x) = P(P(\ldots P(P(x))\ldots))$, where $P$ occurs $k$ times.
Prove that there are at most $n$ integers $t$ such that $Q(t)=t$.
-/
/- special open -/ open Function Polynomial
theorem imo2006_p5 {P : Polynomial β€} (hP : 1 < P.natDegree) {k : β} (hk : 0 < k) :
(P.comp^[k] X - X).roots.toFinset.card β€ P.natDegree := by sorry
|
number theory
|
Imo1969P2
| true |
[
"algebra"
] |
Imo1969P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1969, Problem 2
Let aβ, aβ, ..., aβ be real constants, x be a real variable, and
f(x) = cos(aβ + x) + (1/2)cos(aβ + x) + (1/4)cos(aβ + x) + ...
+ (1/2βΏβ»ΒΉ)cos(aβ + x).
Given that f(xβ) = f(xβ) = 0 for some xβ, xβ, prove that
xβ - xβ = mΟ for some integer m.
-/
|
theorem imo1969_p2
(xβ xβ : β)
(n : β)
(a : β β β)
(f : β β β)
(hβ : β x, f x = β i β Finset.range n, (Real.cos (a i + x)) / (2^i))
(hβ : f xβ = 0)
(hβ : f xβ = 0)
(hβ: β i β Finset.range n, (Real.cos (a i) / (2 ^ i)) β 0) :
β m : β€, xβ - xβ = m * Real.pi := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1969, Problem 2
Let aβ, aβ, ..., aβ be real constants, x be a real variable, and
f(x) = cos(aβ + x) + (1/2)cos(aβ + x) + (1/4)cos(aβ + x) + ...
+ (1/2βΏβ»ΒΉ)cos(aβ + x).
Given that f(xβ) = f(xβ) = 0 for some xβ, xβ, prove that
xβ - xβ = mΟ for some integer m.
-/
theorem imo1969_p2
(xβ xβ : β)
(n : β)
(a : β β β)
(f : β β β)
(hβ : β x, f x = β i β Finset.range n, (Real.cos (a i + x)) / (2^i))
(hβ : f xβ = 0)
(hβ : f xβ = 0)
(hβ: β i β Finset.range n, (Real.cos (a i) / (2 ^ i)) β 0) :
β m : β€, xβ - xβ = m * Real.pi := by sorry
|
algebra
|
Imo1960P1
| true |
[
"number theory"
] |
Imo1960P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1960, Problem 1
Determine all three-digit numbers N having the property that N is divisible by 11, and
N/11 is equal to the sum of the squares of the digits of N.
-/
|
def sumOfSquares (L : List β) : β :=
(L.map fun x => x * x).sum
def ProblemPredicate (n : β) : Prop :=
(Nat.digits 10 n).length = 3 β§ 11 β£ n β§ n / 11 = sumOfSquares (Nat.digits 10 n)
abbrev SolutionPredicate (n : β) : Prop :=
n = 550 β¨ n = 803
theorem imo1960_p1 (n : β) : ProblemPredicate n β SolutionPredicate n := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1960, Problem 1
Determine all three-digit numbers N having the property that N is divisible by 11, and
N/11 is equal to the sum of the squares of the digits of N.
-/
def sumOfSquares (L : List β) : β :=
(L.map fun x => x * x).sum
def ProblemPredicate (n : β) : Prop :=
(Nat.digits 10 n).length = 3 β§ 11 β£ n β§ n / 11 = sumOfSquares (Nat.digits 10 n)
abbrev SolutionPredicate (n : β) : Prop :=
n = 550 β¨ n = 803
theorem imo1960_p1 (n : β) : ProblemPredicate n β SolutionPredicate n := by sorry
|
number theory
|
Usa2023P5
| false |
[
"combinatorics"
] |
Usa2023P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 2023, Problem 5
Let n be an integer greater than 2. We will be arranging the numbers
1, 2, ... nΒ² into an n Γ n grid. Such an arrangement is called *row-valid*
if the numbers in each row can be permuted to make an arithmetic progression.
Similarly, such an arrangement is called *column-valid* if the numbers
in each column can be permuted to make an arithmetic progression.
Determine the values of n for which it possible to transform
any row-valid arrangement into a column-valid arrangement by permuting
the numbers in each row.
-/
|
def PermutedArithSeq {n : β} (hn : 0 < n) (a : Fin n βͺ Fin (n^2)) : Prop :=
β p : Fin n β Fin n, p.Bijective β§
β k : β, β m : Fin n, (a (p m)).val = a (p β¨0, hnβ©) + m.val * k
def row_valid {n : β} (hn : 0 < n) (a : Fin n β Fin n β Fin (n^2)) (ha : a.Injective2) : Prop :=
β r : Fin n, PermutedArithSeq hn β¨(a r Β·), Function.Injective2.right ha rβ©
def col_valid {n : β} (hn : 0 < n) (a : Fin n β Fin n β Fin (n^2)) (ha : a.Injective2) : Prop :=
β c : Fin n, PermutedArithSeq hn β¨(a Β· c), Function.Injective2.left ha cβ©
lemma injective_of_permuted_rows {Ξ± Ξ² Ξ³ : Type}
{f : Ξ± β Ξ² β Ξ³} (hf : f.Injective2) {p : Ξ± β Ξ² β Ξ²} (hp : β a, (p a).Injective) :
Function.Injective2 (fun r c β¦ f r (p r c)) := by
intro a1 a2 b1 b2 hab
obtain β¨ha1, hp1β© := hf hab
rw [ha1] at *
rw [hp a2 hp1]
simp only [and_self]
abbrev solution_set : Set β := { n | n.Prime }
theorem usa2023_p5 (n : β) (hn : 2 < n) :
n β solution_set β
(β a : (Fin n β Fin n β Fin (n^2)),
(ha : a.Injective2) β row_valid (Nat.zero_lt_of_lt hn) a ha β
β p : Fin n β Fin n β Fin n, β hp : (β r, (p r).Injective),
col_valid (Nat.zero_lt_of_lt hn) (fun r c β¦ a r (p r c))
(injective_of_permuted_rows ha hp)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 2023, Problem 5
Let n be an integer greater than 2. We will be arranging the numbers
1, 2, ... nΒ² into an n Γ n grid. Such an arrangement is called *row-valid*
if the numbers in each row can be permuted to make an arithmetic progression.
Similarly, such an arrangement is called *column-valid* if the numbers
in each column can be permuted to make an arithmetic progression.
Determine the values of n for which it possible to transform
any row-valid arrangement into a column-valid arrangement by permuting
the numbers in each row.
-/
def PermutedArithSeq {n : β} (hn : 0 < n) (a : Fin n βͺ Fin (n^2)) : Prop :=
β p : Fin n β Fin n, p.Bijective β§
β k : β, β m : Fin n, (a (p m)).val = a (p β¨0, hnβ©) + m.val * k
def row_valid {n : β} (hn : 0 < n) (a : Fin n β Fin n β Fin (n^2)) (ha : a.Injective2) : Prop :=
β r : Fin n, PermutedArithSeq hn β¨(a r Β·), Function.Injective2.right ha rβ©
def col_valid {n : β} (hn : 0 < n) (a : Fin n β Fin n β Fin (n^2)) (ha : a.Injective2) : Prop :=
β c : Fin n, PermutedArithSeq hn β¨(a Β· c), Function.Injective2.left ha cβ©
lemma injective_of_permuted_rows {Ξ± Ξ² Ξ³ : Type}
{f : Ξ± β Ξ² β Ξ³} (hf : f.Injective2) {p : Ξ± β Ξ² β Ξ²} (hp : β a, (p a).Injective) :
Function.Injective2 (fun r c β¦ f r (p r c)) := by
intro a1 a2 b1 b2 hab
obtain β¨ha1, hp1β© := hf hab
rw [ha1] at *
rw [hp a2 hp1]
simp only [and_self]
abbrev solution_set : Set β := { n | n.Prime }
theorem usa2023_p5 (n : β) (hn : 2 < n) :
n β solution_set β
(β a : (Fin n β Fin n β Fin (n^2)),
(ha : a.Injective2) β row_valid (Nat.zero_lt_of_lt hn) a ha β
β p : Fin n β Fin n β Fin n, β hp : (β r, (p r).Injective),
col_valid (Nat.zero_lt_of_lt hn) (fun r c β¦ a r (p r c))
(injective_of_permuted_rows ha hp)) := by sorry
|
combinatorics
|
Imo1973P5
| false |
[
"algebra"
] |
Imo1973P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1973, Problem 5
$G$ is a set of non-constant functions of the real variable $x$ of the form
\[f(x) = ax + b, a \text{ and } b \text{ are real numbers,}\] and $G$ has the following properties:
(a) If $f$ and $g$ are in $G$, then $g \circ f$ is in $G$; here $(g \circ f)(x) = g[f(x)]$.
(b) If $f$ is in $G$, then its inverse $f^{-1}$ is in $G$;
here the inverse of $f(x) = ax + b$ is $f^{-1}(x) = (x - b) / a$.
(c) For every $f$ in $G$, there exists a real number $x_f$ such that $f(x_f) = x_f$.
Prove that there exists a real number $k$ such that $f(k) = k$ for all $f$ in $G$.
-/
|
theorem imo1973_p5 {G : Set (β β β)}
(hf: β f β G, β a b : β, a β 0 β§ β x : β, f x = a * x + b)
(hG : β f β G, β g β G, g β f β G)
(hinv : β f β G, (β x, f x β 0) β fβ»ΒΉ β G)
(hfix : β f β G, β x, f x = x) :
β k : β, β f β G, f k = k := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1973, Problem 5
$G$ is a set of non-constant functions of the real variable $x$ of the form
\[f(x) = ax + b, a \text{ and } b \text{ are real numbers,}\] and $G$ has the following properties:
(a) If $f$ and $g$ are in $G$, then $g \circ f$ is in $G$; here $(g \circ f)(x) = g[f(x)]$.
(b) If $f$ is in $G$, then its inverse $f^{-1}$ is in $G$;
here the inverse of $f(x) = ax + b$ is $f^{-1}(x) = (x - b) / a$.
(c) For every $f$ in $G$, there exists a real number $x_f$ such that $f(x_f) = x_f$.
Prove that there exists a real number $k$ such that $f(k) = k$ for all $f$ in $G$.
-/
theorem imo1973_p5 {G : Set (β β β)}
(hf: β f β G, β a b : β, a β 0 β§ β x : β, f x = a * x + b)
(hG : β f β G, β g β G, g β f β G)
(hinv : β f β G, (β x, f x β 0) β fβ»ΒΉ β G)
(hfix : β f β G, β x, f x = x) :
β k : β, β f β G, f k = k := by sorry
|
algebra
|
Imo2018P5
| false |
[
"number theory"
] |
Imo2018P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2018, Problem 5
Let aβ, aβ, ... be an infinite sequence of positive integers.
Suppose that there is an integer N > 1 such that for each n β₯ N
the number
aβ/aβ + aβ/aβ ... + aβββ/aβ + aβ/aβ
is an integer. Prove that there is a positive integer M such that
aβ = aβββ for all m β₯ M.
-/
|
theorem imo2018_p5
(a : β β β€)
(apos : β n, 0 < a n)
(N : β)
(hN : 0 < N)
(h : β n, N β€ n β
β z : β€,
z = β i β Finset.range n, (a i : β) / a ((i + 1) % n))
: β M, β m, M β€ m β a m = a (m + 1) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2018, Problem 5
Let aβ, aβ, ... be an infinite sequence of positive integers.
Suppose that there is an integer N > 1 such that for each n β₯ N
the number
aβ/aβ + aβ/aβ ... + aβββ/aβ + aβ/aβ
is an integer. Prove that there is a positive integer M such that
aβ = aβββ for all m β₯ M.
-/
theorem imo2018_p5
(a : β β β€)
(apos : β n, 0 < a n)
(N : β)
(hN : 0 < N)
(h : β n, N β€ n β
β z : β€,
z = β i β Finset.range n, (a i : β) / a ((i + 1) % n))
: β M, β m, M β€ m β a m = a (m + 1) := by sorry
|
number theory
|
Usa2001P3
| true |
[
"algebra"
] |
Usa2001P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 2001, Problem 3
Let a,b,c β₯ 0 be real numbers satsifying
aΒ² + bΒ² + cΒ² + abc = 4.
Show that
0 β€ ab + bc + ca - abc β€ 2.
-/
|
theorem usa2001_p3 (a b c : β) (ha : 0 β€ a) (hb : 0 β€ b) (hc : 0 β€ c)
(h : a^2 + b^2 + c^2 + a * b * c = 4) :
0 β€ a * b + b * c + c * a - a * b * c β§
a * b + b * c + c * a - a * b * c β€ 2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 2001, Problem 3
Let a,b,c β₯ 0 be real numbers satsifying
aΒ² + bΒ² + cΒ² + abc = 4.
Show that
0 β€ ab + bc + ca - abc β€ 2.
-/
theorem usa2001_p3 (a b c : β) (ha : 0 β€ a) (hb : 0 β€ b) (hc : 0 β€ c)
(h : a^2 + b^2 + c^2 + a * b * c = 4) :
0 β€ a * b + b * c + c * a - a * b * c β§
a * b + b * c + c * a - a * b * c β€ 2 := by sorry
|
algebra
|
Imo2024P3
| true |
[
"combinatorics"
] |
Imo2024P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2024, Problem 3
Let aβ, aβ, aβ, ... be an infinite sequence of positive integers,
and let N be a positive integer. Suppose that, for each n > N,
aβ is equal to the number of times aβββ appears in the list
aβ, aβ, ..., aβββ.
Prove that at least one of the sequences aβ, aβ, aβ
, ... and
aβ, aβ, aβ, ... is eventually periodic.
-/
|
/- special open -/ open Finset
def Condition (a : β β β) (N : β) : Prop :=
(β i, 0 < a i) β§ β n, N < n β a n = Finset.card (filter (Ξ» i => a i = a (n - 1)) (Finset.range n))
def EventuallyPeriodic (b : β β β) : Prop :=
β p M, 0 < p β§ β m, M β€ m β b (m + p) = b m
theorem imo2024_p3 {a : β β β} {N : β} (h : Condition a N) :
EventuallyPeriodic (fun i β¦ a (2 * i)) β¨ EventuallyPeriodic (fun i β¦ a (2 * i + 1)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2024, Problem 3
Let aβ, aβ, aβ, ... be an infinite sequence of positive integers,
and let N be a positive integer. Suppose that, for each n > N,
aβ is equal to the number of times aβββ appears in the list
aβ, aβ, ..., aβββ.
Prove that at least one of the sequences aβ, aβ, aβ
, ... and
aβ, aβ, aβ, ... is eventually periodic.
-/
/- special open -/ open Finset
def Condition (a : β β β) (N : β) : Prop :=
(β i, 0 < a i) β§ β n, N < n β a n = Finset.card (filter (Ξ» i => a i = a (n - 1)) (Finset.range n))
def EventuallyPeriodic (b : β β β) : Prop :=
β p M, 0 < p β§ β m, M β€ m β b (m + p) = b m
theorem imo2024_p3 {a : β β β} {N : β} (h : Condition a N) :
EventuallyPeriodic (fun i β¦ a (2 * i)) β¨ EventuallyPeriodic (fun i β¦ a (2 * i + 1)) := by sorry
|
combinatorics
|
Imo1972P1
| true |
[
"combinatorics"
] |
Imo1972P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# 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.
-/
|
theorem imo1972_p1 (S : Finset β)
(Scard : S.card = 10)
(Sdigits : β n β S, (Nat.digits 10 n).length = 2) :
β S1 S2 : Finset β, S1 β S β§ S2 β S β§
Disjoint S1 S2 β§ β n β S1, n = β n β S2, n := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# 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.
-/
theorem imo1972_p1 (S : Finset β)
(Scard : S.card = 10)
(Sdigits : β n β S, (Nat.digits 10 n).length = 2) :
β S1 S2 : Finset β, S1 β S β§ S2 β S β§
Disjoint S1 S2 β§ β n β S1, n = β n β S2, n := by sorry
|
combinatorics
|
Usa2022P1
| false |
[
"combinatorics"
] |
Usa2022P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 2022, Problem 1
Let a and b be positive integers. The cells of an (a+b+1) Γ (a+b+1) grid
are colored amber and bronze such that there are at least aΒ² + ab - b
amber cells and at least bΒ² + ab - a bronze cells. Prove that it is
possible to choose a amber cells and b bronze cells such that no two
of the a + b chosen cells lie in the same row or column.
-/
|
theorem usa2022_p1
(a b : β)
(ha : 0 < a)
(hb : 0 < b)
(color : Fin (a + b + 1) Γ Fin (a + b + 1) β Fin 2)
(c0 : a^2 + a * b - b β€ Fintype.card {s // color s = 0})
(c1 : b^2 + a * b - a β€ Fintype.card {s // color s = 1}) :
β A B : Finset (Fin (a + b + 1) Γ Fin (a + b + 1)),
A.card = a β§ B.card = b β§
(β x β A, color x = 0) β§
(β y β B, color y = 1) β§
β x β A βͺ B, β y β A βͺ B, x β y β x.fst β y.fst β§ x.snd β y.snd := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 2022, Problem 1
Let a and b be positive integers. The cells of an (a+b+1) Γ (a+b+1) grid
are colored amber and bronze such that there are at least aΒ² + ab - b
amber cells and at least bΒ² + ab - a bronze cells. Prove that it is
possible to choose a amber cells and b bronze cells such that no two
of the a + b chosen cells lie in the same row or column.
-/
theorem usa2022_p1
(a b : β)
(ha : 0 < a)
(hb : 0 < b)
(color : Fin (a + b + 1) Γ Fin (a + b + 1) β Fin 2)
(c0 : a^2 + a * b - b β€ Fintype.card {s // color s = 0})
(c1 : b^2 + a * b - a β€ Fintype.card {s // color s = 1}) :
β A B : Finset (Fin (a + b + 1) Γ Fin (a + b + 1)),
A.card = a β§ B.card = b β§
(β x β A, color x = 0) β§
(β y β B, color y = 1) β§
β x β A βͺ B, β y β A βͺ B, x β y β x.fst β y.fst β§ x.snd β y.snd := by sorry
|
combinatorics
|
Imo2003P6
| true |
[
"number theory"
] |
Imo2003P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2003, Problem 6
Let p be a prime number. Prove that there exists a prime number q
such that for every integer n, the number nα΅ - p is not divisible
by q.
-/
|
theorem imo2003_p6 (p : β) (hp : p.Prime) :
β q : β, q.Prime β§ β n, Β¬((q : β€) β£ (n : β€)^p - (p : β€)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2003, Problem 6
Let p be a prime number. Prove that there exists a prime number q
such that for every integer n, the number nα΅ - p is not divisible
by q.
-/
theorem imo2003_p6 (p : β) (hp : p.Prime) :
β q : β, q.Prime β§ β n, Β¬((q : β€) β£ (n : β€)^p - (p : β€)) := by sorry
|
number theory
|
Imo2019P1
| true |
[
"algebra"
] |
Imo2019P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2019, Problem 1
Let β€ be the set of integers. Determine all functions f : β€ β β€ such that,
for all integers a and b,οΏΌ
f(2 * a) + 2 * f(b) = f(f(a + b)).
-/
|
abbrev solution_set : Set (β€ β β€) :=
{ f | (β z, f z = 0) β¨ β c, β z, f z = 2 * z + c }
theorem imo2019_p1 (f : β€ β β€) :
(β a b, f (2 * a) + 2 * (f b) = f (f (a + b))) β f β solution_set := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2019, Problem 1
Let β€ be the set of integers. Determine all functions f : β€ β β€ such that,
for all integers a and b,οΏΌ
f(2 * a) + 2 * f(b) = f(f(a + b)).
-/
abbrev solution_set : Set (β€ β β€) :=
{ f | (β z, f z = 0) β¨ β c, β z, f z = 2 * z + c }
theorem imo2019_p1 (f : β€ β β€) :
(β a b, f (2 * a) + 2 * (f b) = f (f (a + b))) β f β solution_set := by sorry
|
algebra
|
Imo1976P6
| false |
[
"algebra"
] |
Imo1976P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1976, Problem 6
The sequence u_0, u_1, u_2, ... is defined by:
u_0 = 2, u1 = 5/2, u_{n+1} = un(u_{n-1}^2 - 2) - u_1 for n = 1, 2, ... .
Prove that \[un\] = 2^(2^n - (-1)^n)/3, where \[x\] denotes the greatest integer
less than or equal to x.
-/
|
theorem imo1976_p6 (u : β β β)
(hβ : u 0 = 2)
(hβ : u 1 = 5 / 2)
(hβ : β n, u (n + 2) = u (n + 1) * ((u n)^2 - 2) - u 1) :
β n, βu nβ = (2:β) ^((2^n - (-1 : β)^n) / 3):= by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1976, Problem 6
The sequence u_0, u_1, u_2, ... is defined by:
u_0 = 2, u1 = 5/2, u_{n+1} = un(u_{n-1}^2 - 2) - u_1 for n = 1, 2, ... .
Prove that \[un\] = 2^(2^n - (-1)^n)/3, where \[x\] denotes the greatest integer
less than or equal to x.
-/
theorem imo1976_p6 (u : β β β)
(hβ : u 0 = 2)
(hβ : u 1 = 5 / 2)
(hβ : β n, u (n + 2) = u (n + 1) * ((u n)^2 - 2) - u 1) :
β n, βu nβ = (2:β) ^((2^n - (-1 : β)^n) / 3):= by sorry
|
algebra
|
Imo1965P2
| true |
[
"algebra"
] |
Imo1965P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1965, Problem 2
Suppose that
aββxβ + aββxβ + aββxβ = 0
aββxβ + aββxβ + aββxβ = 0
aββxβ + aββxβ + aββxβ = 0
where
(A) aββ, aββ, aββ are positive
(B) the remaining aα΅’β±Ό are negative
(C) in each row i, the sum of the coefficients aα΅’β±Ό is positive.
Prove that xβ = xβ = xβ = 0.
-/
|
theorem imo1965_p2 (x : Fin 3 β β) (a : Fin 3 β Fin 3 β β)
(heqs : β i, β j : Fin 3, (a i j * x j) = 0)
(hab : β i j, if i = j then 0 < a i j else a i j < 0)
(hc : β i, 0 < β j : Fin 3, a i j)
: β i, x i = 0 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1965, Problem 2
Suppose that
aββxβ + aββxβ + aββxβ = 0
aββxβ + aββxβ + aββxβ = 0
aββxβ + aββxβ + aββxβ = 0
where
(A) aββ, aββ, aββ are positive
(B) the remaining aα΅’β±Ό are negative
(C) in each row i, the sum of the coefficients aα΅’β±Ό is positive.
Prove that xβ = xβ = xβ = 0.
-/
theorem imo1965_p2 (x : Fin 3 β β) (a : Fin 3 β Fin 3 β β)
(heqs : β i, β j : Fin 3, (a i j * x j) = 0)
(hab : β i j, if i = j then 0 < a i j else a i j < 0)
(hc : β i, 0 < β j : Fin 3, a i j)
: β i, x i = 0 := by sorry
|
algebra
|
Imo2022P5
| true |
[
"number theory"
] |
Imo2022P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2022, Problem 5
Determine all possible triples of positive integers a,b,p that satisfy
aα΅ = b! + p
where p is prime.
-/
|
abbrev solution_set : Set (β Γ β Γ β) := { β¨2,2,2β©, β¨3,4,3β© }
theorem imo2022_p5 (a b p : β) (ha : 0 < a) (hb : 0 < b) (hp : p.Prime) :
β¨a,b,pβ© β solution_set β a^p = Nat.factorial b + p := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2022, Problem 5
Determine all possible triples of positive integers a,b,p that satisfy
aα΅ = b! + p
where p is prime.
-/
abbrev solution_set : Set (β Γ β Γ β) := { β¨2,2,2β©, β¨3,4,3β© }
theorem imo2022_p5 (a b p : β) (ha : 0 < a) (hb : 0 < b) (hp : p.Prime) :
β¨a,b,pβ© β solution_set β a^p = Nat.factorial b + p := by sorry
|
number theory
|
Imo1963P4
| false |
[
"algebra"
] |
Imo1963P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1963, Problem 4
Find all solutions xβ,xβ,xβ,xβ,xβ
of the system
xβ
+ xβ = yxβ
xβ + xβ = yxβ
xβ + xβ = yxβ
xβ + xβ
= yxβ
xβ + xβ = yxβ
where y is a parameter.
-/
|
abbrev SolutionSet (y : β) : Set (β Γ β Γ β Γ β Γ β) :=
if y = 2 then
-- When y = 2, all variables are equal: xα΅’ = s for any s
{p | β s : β, p = (s, s, s, s, s)}
else if y * y + y - 1 = 0 then
-- When yΒ² + y - 1 = 0, we can have two free parameters
{p | β (s t : β),
p = (s, t, -s + y*t, -y*s - y*t, y*s - t)}
else
-- Otherwise, either all xα΅’ = 0 or the system has no solution
{(0, 0, 0, 0, 0)}
theorem imo1963_p4 (xβ xβ xβ xβ xβ
y : β) :
(xβ, xβ, xβ, xβ, xβ
) β SolutionSet y β
(xβ
+ xβ = y * xβ β§
xβ + xβ = y * xβ β§
xβ + xβ = y * xβ β§
xβ + xβ
= y * xβ β§
xβ + xβ = y * xβ
) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1963, Problem 4
Find all solutions xβ,xβ,xβ,xβ,xβ
of the system
xβ
+ xβ = yxβ
xβ + xβ = yxβ
xβ + xβ = yxβ
xβ + xβ
= yxβ
xβ + xβ = yxβ
where y is a parameter.
-/
abbrev SolutionSet (y : β) : Set (β Γ β Γ β Γ β Γ β) :=
if y = 2 then
-- When y = 2, all variables are equal: xα΅’ = s for any s
{p | β s : β, p = (s, s, s, s, s)}
else if y * y + y - 1 = 0 then
-- When yΒ² + y - 1 = 0, we can have two free parameters
{p | β (s t : β),
p = (s, t, -s + y*t, -y*s - y*t, y*s - t)}
else
-- Otherwise, either all xα΅’ = 0 or the system has no solution
{(0, 0, 0, 0, 0)}
theorem imo1963_p4 (xβ xβ xβ xβ xβ
y : β) :
(xβ, xβ, xβ, xβ, xβ
) β SolutionSet y β
(xβ
+ xβ = y * xβ β§
xβ + xβ = y * xβ β§
xβ + xβ = y * xβ β§
xβ + xβ
= y * xβ β§
xβ + xβ = y * xβ
) := by sorry
|
algebra
|
Imo2023P1
| true |
[
"number theory"
] |
Imo2023P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2023, Problem 1
Determine all composite integers n>1 that satisfy the following property:
if dβ,dβ,...,dβ are all the positive divisors of n with
1 = dβ < dβ < ... < dβ = n, then dα΅’ divides dα΅’ββ + dα΅’ββ for every
1 β€ i β€ k - 2.
-/
|
abbrev ConsecutiveFactors (n a b : β) :=
a β£ n β§ b β£ n β§ a < b β§ Β¬β c, (c β£ n β§ a < c β§ c < b)
abbrev Dividable (n : β) :=
β {a b c : β},
ConsecutiveFactors n a b β§ ConsecutiveFactors n b c
β a β£ b + c
abbrev solution_set : Set β := { n | Β¬n.Prime β§ IsPrimePow n }
theorem imo2023_p1 : solution_set = { n | 1 < n β§ Β¬n.Prime β§ Dividable n } := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2023, Problem 1
Determine all composite integers n>1 that satisfy the following property:
if dβ,dβ,...,dβ are all the positive divisors of n with
1 = dβ < dβ < ... < dβ = n, then dα΅’ divides dα΅’ββ + dα΅’ββ for every
1 β€ i β€ k - 2.
-/
abbrev ConsecutiveFactors (n a b : β) :=
a β£ n β§ b β£ n β§ a < b β§ Β¬β c, (c β£ n β§ a < c β§ c < b)
abbrev Dividable (n : β) :=
β {a b c : β},
ConsecutiveFactors n a b β§ ConsecutiveFactors n b c
β a β£ b + c
abbrev solution_set : Set β := { n | Β¬n.Prime β§ IsPrimePow n }
theorem imo2023_p1 : solution_set = { n | 1 < n β§ Β¬n.Prime β§ Dividable n } := by sorry
|
number theory
|
Imo2016P4
| false |
[
"number theory"
] |
Imo2016P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2016, Problem 4
A set of positive integers is called *fragrant* if it contains
at least two elements and each of its elements has a prime
factor in common with at least one of the other elements.
Let P(n) = nΒ² + n + 1. What is the least possible value of
positive integer b such that there exists a non-negative integer
a for which the set
{ P(a + 1), P(a + 2), ..., P(a + b) }
is fragrant?
-/
|
abbrev Fragrant (s : Set β+) : Prop :=
2 β€ s.ncard β§ β m β s, β n β s, Β¬Nat.Coprime m n
abbrev P (n : β) : β := n^2 + n + 1
abbrev Solution : β+ := 6
theorem imo2016_p4 :
IsLeast
{b : β+ | β a : β, Fragrant {p | β i < b, p = P (a + 1 + i)}}
Solution := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2016, Problem 4
A set of positive integers is called *fragrant* if it contains
at least two elements and each of its elements has a prime
factor in common with at least one of the other elements.
Let P(n) = nΒ² + n + 1. What is the least possible value of
positive integer b such that there exists a non-negative integer
a for which the set
{ P(a + 1), P(a + 2), ..., P(a + b) }
is fragrant?
-/
abbrev Fragrant (s : Set β+) : Prop :=
2 β€ s.ncard β§ β m β s, β n β s, Β¬Nat.Coprime m n
abbrev P (n : β) : β := n^2 + n + 1
abbrev Solution : β+ := 6
theorem imo2016_p4 :
IsLeast
{b : β+ | β a : β, Fragrant {p | β i < b, p = P (a + 1 + i)}}
Solution := by sorry
|
number theory
|
Usa2018P1
| true |
[
"algebra",
"inequality"
] |
Usa2018P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 2018, Problem 1
Given that a,b,c are positive real numbers such that
a + b + c = 4 β(abc)
prove that 2(ab + bc + ca) + 4min(aΒ²,bΒ²,cΒ²) β₯ aΒ² + bΒ² + cΒ²
-/
|
theorem usa2018_p1 (a b c : β) :
a > 0 β b > 0 β c > 0 β a + b + c = 4 * (a * b * c) ^ ((1 : β) / 3) β
2 * (a * b + b * c + c * a) +
4 * (min (min (a * a) (b * b)) (c * c)) β₯ a^2 + b^2 + c^2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 2018, Problem 1
Given that a,b,c are positive real numbers such that
a + b + c = 4 β(abc)
prove that 2(ab + bc + ca) + 4min(aΒ²,bΒ²,cΒ²) β₯ aΒ² + bΒ² + cΒ²
-/
theorem usa2018_p1 (a b c : β) :
a > 0 β b > 0 β c > 0 β a + b + c = 4 * (a * b * c) ^ ((1 : β) / 3) β
2 * (a * b + b * c + c * a) +
4 * (min (min (a * a) (b * b)) (c * c)) β₯ a^2 + b^2 + c^2 := by sorry
|
algebra
|
ZeroesOnesAndTwos1
| false |
[] |
ZeroesOnesAndTwos1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
(From Mathematical Puzzles: A Connoisseur's Collection by Peter Winkler.)
Let n be a natural number. Prove that
(a) n has a (nonzero) multiple whose representation in base 10 contains
only zeroes and ones; and
-/
|
theorem zeroes_and_ones
(n : β) : β k : β+, β e β Nat.digits 10 (n * k), e = 0 β¨ e = 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
(From Mathematical Puzzles: A Connoisseur's Collection by Peter Winkler.)
Let n be a natural number. Prove that
(a) n has a (nonzero) multiple whose representation in base 10 contains
only zeroes and ones; and
-/
theorem zeroes_and_ones
(n : β) : β k : β+, β e β Nat.digits 10 (n * k), e = 0 β¨ e = 1 := by sorry
|
number theory
|
Imo2008P4
| true |
[
"algebra"
] |
Imo2008P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2008, Problem 4
Determine all functions f from the positive reals to the positive reals
such that
(f(w)Β² + f(x)Β²) / (f(y)Β² + f(z)Β²) = (wΒ² + xΒ²) / (yΒ² + zΒ²)
for all positive real numbers w,x,y,z satisfying xw = yz.
-/
|
abbrev PosReal : Type := { x : β // 0 < x }
abbrev solution_set : Set (PosReal β PosReal) := { f | f = id β¨ f = fun x β¦ 1 / x }
theorem imo2008_p4 (f : PosReal β PosReal) :
f β solution_set β
β w x y z, w * x = y * z β
((f w)^2 + (f x)^2) * (y^2 + z^2) = (w^2 + x^2) * (f (y^2) + f (z^2)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2008, Problem 4
Determine all functions f from the positive reals to the positive reals
such that
(f(w)Β² + f(x)Β²) / (f(y)Β² + f(z)Β²) = (wΒ² + xΒ²) / (yΒ² + zΒ²)
for all positive real numbers w,x,y,z satisfying xw = yz.
-/
abbrev PosReal : Type := { x : β // 0 < x }
abbrev solution_set : Set (PosReal β PosReal) := { f | f = id β¨ f = fun x β¦ 1 / x }
theorem imo2008_p4 (f : PosReal β PosReal) :
f β solution_set β
β w x y z, w * x = y * z β
((f w)^2 + (f x)^2) * (y^2 + z^2) = (w^2 + x^2) * (f (y^2) + f (z^2)) := by sorry
|
algebra
|
Imo2012P2
| false |
[
"algebra"
] |
Imo2012P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2012, Problem 2
Let aβ, aβ, ..., aβ be positive reals with product 1, where n β₯ 3.
Show that
(1 + aβ)Β²(1 + aβ)Β³...(1 + aβ)βΏ > nβΏ.
-/
|
theorem imo2012_p2 (n : β) (hn : 3 β€ n) (a : Finset.Icc 2 n β β)
(apos : β i, 0 < a i) (aprod : β i, a i = 1) :
(n:β)^n < β i, (1 + a i)^i.val := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2012, Problem 2
Let aβ, aβ, ..., aβ be positive reals with product 1, where n β₯ 3.
Show that
(1 + aβ)Β²(1 + aβ)Β³...(1 + aβ)βΏ > nβΏ.
-/
theorem imo2012_p2 (n : β) (hn : 3 β€ n) (a : Finset.Icc 2 n β β)
(apos : β i, 0 < a i) (aprod : β i, a i = 1) :
(n:β)^n < β i, (1 + a i)^i.val := by sorry
|
algebra
|
Singapore2019P4
| true |
[
"algebra"
] |
Singapore2019P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# Singapore Math Olympiad (Senior) 2019 (Round 1), Problem 4
http://www.realsutra.com/limjeck/SMO_Senior_2019.pdf
If $\log_{21} 3 = x$, express $\log_7 9$ in terms of $x$.
-/
|
noncomputable abbrev solution (x : β) : β := 2*x / (1-x)
theorem singapore2019_r1_p4 (x : β) (hx : Real.logb 21 3 = x) :
Real.logb 7 9 = solution x := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# Singapore Math Olympiad (Senior) 2019 (Round 1), Problem 4
http://www.realsutra.com/limjeck/SMO_Senior_2019.pdf
If $\log_{21} 3 = x$, express $\log_7 9$ in terms of $x$.
-/
noncomputable abbrev solution (x : β) : β := 2*x / (1-x)
theorem singapore2019_r1_p4 (x : β) (hx : Real.logb 21 3 = x) :
Real.logb 7 9 = solution x := by sorry
|
algebra
|
Imo2001P6
| true |
[
"number theory"
] |
Imo2001P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2001, Problem 6
Let a, b, c, d be integers with a > b > c > d > 0. Suppose that
ac + bd = (a + b - c + d) * (-a + b + c + d).
Prove that ab + cd is not prime.
-/
|
theorem imo2001_p6 {a b c d : β€} (hd : 0 < d) (hdc : d < c) (hcb : c < b) (hba : b < a)
(h : a * c + b * d = (a + b - c + d) * (-a + b + c + d)) : Β¬Prime (a * b + c * d) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2001, Problem 6
Let a, b, c, d be integers with a > b > c > d > 0. Suppose that
ac + bd = (a + b - c + d) * (-a + b + c + d).
Prove that ab + cd is not prime.
-/
theorem imo2001_p6 {a b c d : β€} (hd : 0 < d) (hdc : d < c) (hcb : c < b) (hba : b < a)
(h : a * c + b * d = (a + b - c + d) * (-a + b + c + d)) : Β¬Prime (a * b + c * d) := by sorry
|
number theory
|
Imo2008P5
| false |
[
"combinatorics"
] |
Imo2008P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2008, Problem 5
Let n and k be positive integers with k β₯ n and k - n an even number.
There are 2n lamps labelled 1, 2, ..., 2n each of which can be
either on or off. Initially all the lamps are off. We consider
sequences of steps: at each step one of the lamps is switched (from
on to off or from off to on). Let N be the number of such sequences
consisting of k steps and resulting in the state where lamps 1 through
n are all on, and lamps n + 1 through 2n are all off. Let M be the
number of such sequences consisting of k steps, resulting in the state
where lamps 1 through n are all on, and lamps n + 1 through 2n are all off,
but where none of the lamps n + 1 through 2n is ever switched on.
Determine N/M.
-/
|
abbrev Sequence (n k : β) := Fin k β Fin (2 * n)
abbrev NSequence (n k : β) (f : Sequence n k) : Prop :=
(β i < n, Odd (Nat.card { j | f j = i })) β§
(β i, n β€ i β i < 2 * n β Even (Nat.card { j | f j = i }))
abbrev MSequence (n k : β) (f : Sequence n k) : Prop :=
NSequence n k f β§
(β i : Fin (2 * n), n β€ i β β j : Fin k, f j β i)
abbrev solution (n k : β) : β := 2 ^ (k - n)
theorem imo2008_p5 (n k : β) (hn : 0 < n)
(hnk : n β€ k) (he : Even (k - n))
: Set.ncard (MSequence n k) * solution n k = Set.ncard (NSequence n k) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2008, Problem 5
Let n and k be positive integers with k β₯ n and k - n an even number.
There are 2n lamps labelled 1, 2, ..., 2n each of which can be
either on or off. Initially all the lamps are off. We consider
sequences of steps: at each step one of the lamps is switched (from
on to off or from off to on). Let N be the number of such sequences
consisting of k steps and resulting in the state where lamps 1 through
n are all on, and lamps n + 1 through 2n are all off. Let M be the
number of such sequences consisting of k steps, resulting in the state
where lamps 1 through n are all on, and lamps n + 1 through 2n are all off,
but where none of the lamps n + 1 through 2n is ever switched on.
Determine N/M.
-/
abbrev Sequence (n k : β) := Fin k β Fin (2 * n)
abbrev NSequence (n k : β) (f : Sequence n k) : Prop :=
(β i < n, Odd (Nat.card { j | f j = i })) β§
(β i, n β€ i β i < 2 * n β Even (Nat.card { j | f j = i }))
abbrev MSequence (n k : β) (f : Sequence n k) : Prop :=
NSequence n k f β§
(β i : Fin (2 * n), n β€ i β β j : Fin k, f j β i)
abbrev solution (n k : β) : β := 2 ^ (k - n)
theorem imo2008_p5 (n k : β) (hn : 0 < n)
(hnk : n β€ k) (he : Even (k - n))
: Set.ncard (MSequence n k) * solution n k = Set.ncard (NSequence n k) := by sorry
|
combinatorics
|
Imo2016P5
| false |
[
"algebra"
] |
Imo2016P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2016, Problem 5
The equation
(x - 1)(x - 2) ... (x - 2016) = (x - 1)(x - 2) ... (x - 2016)
is written on the board. What is the least possible value of k
for which it is possible to erase exactly k of these 4032 factors
such that at least one factor remains on each side and the resulting
equation has no real solutions?
-/
|
abbrev solution_value : β := 2016
theorem imo2015_p5 :
IsLeast { k | β L R : Finset β,
L β Finset.Icc 1 2016 β§
R β Finset.Icc 1 2016 β§
L.card + R.card = k β§
Β¬β x : β,
β i β Finset.Icc 1 2016 \ L, (x - (i : β)) =
β i β Finset.Icc 1 2016 \ R, (x - (i : β)) }
solution_value := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2016, Problem 5
The equation
(x - 1)(x - 2) ... (x - 2016) = (x - 1)(x - 2) ... (x - 2016)
is written on the board. What is the least possible value of k
for which it is possible to erase exactly k of these 4032 factors
such that at least one factor remains on each side and the resulting
equation has no real solutions?
-/
abbrev solution_value : β := 2016
theorem imo2015_p5 :
IsLeast { k | β L R : Finset β,
L β Finset.Icc 1 2016 β§
R β Finset.Icc 1 2016 β§
L.card + R.card = k β§
Β¬β x : β,
β i β Finset.Icc 1 2016 \ L, (x - (i : β)) =
β i β Finset.Icc 1 2016 \ R, (x - (i : β)) }
solution_value := by sorry
|
algebra
|
Imo1963P5
| true |
[
"algebra"
] |
Imo1963P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1963, Problem 5
Prove that cos(Ο/7) - cos(2Ο/7) + cos(3Ο/7) = 1/2.
-/
|
theorem imo1963_p5 :
Real.cos (Real.pi/7) - Real.cos (2*Real.pi/7) + Real.cos (3*Real.pi/7) = 1/2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1963, Problem 5
Prove that cos(Ο/7) - cos(2Ο/7) + cos(3Ο/7) = 1/2.
-/
theorem imo1963_p5 :
Real.cos (Real.pi/7) - Real.cos (2*Real.pi/7) + Real.cos (3*Real.pi/7) = 1/2 := by sorry
|
algebra
|
Imo1964P1b
| true |
[
"number theory"
] |
Imo1964P1b
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1964, Problem 1
(b) Prove that there is no positive integer n for which 2βΏ + 1 is divisible by 7.
-/
|
theorem imo_1964_p1b (n : β) : Β¬ 7 β£ (2^n + 1) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1964, Problem 1
(b) Prove that there is no positive integer n for which 2βΏ + 1 is divisible by 7.
-/
theorem imo_1964_p1b (n : β) : Β¬ 7 β£ (2^n + 1) := by sorry
|
number theory
|
Imo2000P2
| true |
[
"algebra",
"inequality"
] |
Imo2000P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2000, Problem 2
Let a, b, c be positive real numbers such that abc = 1. Show that
(a - 1 + 1/b)(b - 1 + 1/c)(c - 1 + 1/a) β€ 1.
-/
|
theorem imo2000_p2 (a b c : β) (ha : 0 < a) (hb : 0 < b) (hc : 0 < c)
(habc : a * b * c = 1) :
(a - 1 + 1 / b) * (b - 1 + 1 / c) * (c - 1 + 1 / a) β€ 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2000, Problem 2
Let a, b, c be positive real numbers such that abc = 1. Show that
(a - 1 + 1/b)(b - 1 + 1/c)(c - 1 + 1/a) β€ 1.
-/
theorem imo2000_p2 (a b c : β) (ha : 0 < a) (hb : 0 < b) (hc : 0 < c)
(habc : a * b * c = 1) :
(a - 1 + 1 / b) * (b - 1 + 1 / c) * (c - 1 + 1 / a) β€ 1 := by sorry
|
algebra
|
Imo1975P2
| false |
[
"algebra"
] |
Imo1975P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1975, Problem 2
Let a1 < a2 < a3 < ... be positive integers.
Prove that for every i >= 1,
there are infinitely many a_n that can be written in the form a_n = ra_i + sa_j,
with r, s positive integers and j > i.
-/
|
theorem imo1975_p2 (a : β β β€)
(apos : β i : β, 0 < a i)
(ha : β i : β, a i < a (i + 1)) :
( β i n0 : β ,
β n, n0 β€ n β§
β r s : β,
β j : β,
a n = r * a i + s * a j β§
i < j β§
0 < r β§
0 < s ):= by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1975, Problem 2
Let a1 < a2 < a3 < ... be positive integers.
Prove that for every i >= 1,
there are infinitely many a_n that can be written in the form a_n = ra_i + sa_j,
with r, s positive integers and j > i.
-/
theorem imo1975_p2 (a : β β β€)
(apos : β i : β, 0 < a i)
(ha : β i : β, a i < a (i + 1)) :
( β i n0 : β ,
β n, n0 β€ n β§
β r s : β,
β j : β,
a n = r * a i + s * a j β§
i < j β§
0 < r β§
0 < s ):= by sorry
|
algebra
|
UpperLowerContinuous
| true |
[] |
UpperLowerContinuous
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
Suppose f : β -> β is continuous in both the upper topology (where
the basic open sets are half-open intervals (a, b]) and lower topology
(where the basic open sets are half-open intervals [a,b)).
Then f is continuous in the usual topology (where the basic open sets are
-/
|
def upper_intervals : Set (Set β) := {s : Set β | β a b : β, Set.Ioc a b = s}
def lower_intervals : Set (Set β) := {s : Set β | β a b : β, Set.Ico a b = s}
def open_intervals : Set (Set β) := {s : Set β | β a b : β, Set.Ioo a b = s}
/-- Generate the toplogy on β by intervals of the form (a, b]. -/
def tα΅€ : TopologicalSpace β := TopologicalSpace.generateFrom upper_intervals
/-- Generate the toplogy on β by intervals of the form [a, b). -/
def tβ : TopologicalSpace β := TopologicalSpace.generateFrom lower_intervals
/-- This should be equivalent to the default instance
for `TopologicalSpace β`, which goes through `UniformSpace`, but for
now I don't want to bother with proving that equivalence.
-/
def tβ : TopologicalSpace β := TopologicalSpace.generateFrom open_intervals
-- activate the Continuous[t1, t2] notation
theorem properties_of_upper_lower_continuous
(f : β β β)
(huc : Continuous[tα΅€, tα΅€] f)
(hlc : Continuous[tβ, tβ] f)
: Continuous[tβ, tβ] f β§ Monotone f := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
Suppose f : β -> β is continuous in both the upper topology (where
the basic open sets are half-open intervals (a, b]) and lower topology
(where the basic open sets are half-open intervals [a,b)).
Then f is continuous in the usual topology (where the basic open sets are
-/
def upper_intervals : Set (Set β) := {s : Set β | β a b : β, Set.Ioc a b = s}
def lower_intervals : Set (Set β) := {s : Set β | β a b : β, Set.Ico a b = s}
def open_intervals : Set (Set β) := {s : Set β | β a b : β, Set.Ioo a b = s}
/-- Generate the toplogy on β by intervals of the form (a, b]. -/
def tα΅€ : TopologicalSpace β := TopologicalSpace.generateFrom upper_intervals
/-- Generate the toplogy on β by intervals of the form [a, b). -/
def tβ : TopologicalSpace β := TopologicalSpace.generateFrom lower_intervals
/-- This should be equivalent to the default instance
for `TopologicalSpace β`, which goes through `UniformSpace`, but for
now I don't want to bother with proving that equivalence.
-/
def tβ : TopologicalSpace β := TopologicalSpace.generateFrom open_intervals
-- activate the Continuous[t1, t2] notation
theorem properties_of_upper_lower_continuous
(f : β β β)
(huc : Continuous[tα΅€, tα΅€] f)
(hlc : Continuous[tβ, tβ] f)
: Continuous[tβ, tβ] f β§ Monotone f := by sorry
|
number theory
|
UK2024R1P1
| true |
[
"combinatorics"
] |
UK2024R1P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# 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 than one letter early). Thus, when trying to type MATHS, the
typist may type MATHS, MTAHS or TMASH, but not ATMSH.
Determine, with proof, the number of possible spellings of OLYMPIADS
that might be typed.
-/
|
abbrev solution_value : β := 256
/-
Since OLYMPIADS has no duplicate letters, then the set of spellings is just a
subset of the permutations of 9 elements.
-/
theorem uk2024_r1_p1 :
{f : Equiv.Perm (Fin 9) | β k, (f k : β) β€ k + 1}.ncard = solution_value := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# 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 than one letter early). Thus, when trying to type MATHS, the
typist may type MATHS, MTAHS or TMASH, but not ATMSH.
Determine, with proof, the number of possible spellings of OLYMPIADS
that might be typed.
-/
abbrev solution_value : β := 256
/-
Since OLYMPIADS has no duplicate letters, then the set of spellings is just a
subset of the permutations of 9 elements.
-/
theorem uk2024_r1_p1 :
{f : Equiv.Perm (Fin 9) | β k, (f k : β) β€ k + 1}.ncard = solution_value := by sorry
|
combinatorics
|
Imo2017P1
| false |
[
"number theory"
] |
Imo2017P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2017, Problem 1
For any integer aβ > 1, define the sequence
aβββ = βaβ, if aβ is a perfect square
or aβ + 3 otherwise.
Find all values of aβ for which there exists A such that aβ = A for
infinitely many values of n.
-/
|
noncomputable def a (a0 : β) : β β β
| 0 => a0
| n + 1 => if (Nat.sqrt (a a0 n))^2 = a a0 n
then Nat.sqrt (a a0 n)
else a a0 n + 3
abbrev solution_set : Set β := {n : β | n > 1 β§ n % 3 = 0}
theorem imo2017_p1 (a0 : β) :
a0 β solution_set β β A, { n | a a0 n = A }.Infinite := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2017, Problem 1
For any integer aβ > 1, define the sequence
aβββ = βaβ, if aβ is a perfect square
or aβ + 3 otherwise.
Find all values of aβ for which there exists A such that aβ = A for
infinitely many values of n.
-/
noncomputable def a (a0 : β) : β β β
| 0 => a0
| n + 1 => if (Nat.sqrt (a a0 n))^2 = a a0 n
then Nat.sqrt (a a0 n)
else a a0 n + 3
abbrev solution_set : Set β := {n : β | n > 1 β§ n % 3 = 0}
theorem imo2017_p1 (a0 : β) :
a0 β solution_set β β A, { n | a a0 n = A }.Infinite := by sorry
|
number theory
|
Imo1978P6
| false |
[
"combinatorics"
] |
Imo1978P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# 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 distinct) members from his own country.
-/
|
theorem imo1978_p6 (n : β) (hn : n = 1978) (C : Fin n β Fin 6) :
β j : Fin n, β i : Fin n, β k : Fin n,
C i = C j β§
C j = C k β§
(i:β) + 1 + (k:β) + 1 = (j:β) + 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# 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 distinct) members from his own country.
-/
theorem imo1978_p6 (n : β) (hn : n = 1978) (C : Fin n β Fin 6) :
β j : Fin n, β i : Fin n, β k : Fin n,
C i = C j β§
C j = C k β§
(i:β) + 1 + (k:β) + 1 = (j:β) + 1 := by sorry
|
combinatorics
|
Imo1971P5
| false |
[
"combinatorics"
] |
Imo1971P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1971, Problem 5
Prove that for every natural number m there exists a 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.
-/
|
/- special open -/ open EuclideanGeometry
abbrev Pt := EuclideanSpace β (Fin 2)
theorem imo1971_p5 (m : β) :
β S : Set Pt, S.Finite β§ β s β S, Nat.card {t | dist s t = 1} = m := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1971, Problem 5
Prove that for every natural number m there exists a 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.
-/
/- special open -/ open EuclideanGeometry
abbrev Pt := EuclideanSpace β (Fin 2)
theorem imo1971_p5 (m : β) :
β S : Set Pt, S.Finite β§ β s β S, Nat.card {t | dist s t = 1} = m := by sorry
|
combinatorics
|
Imo1962P1
| true |
[
"number theory"
] |
Imo1962P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1962, Problem 1
Find the smallest natural number $n$ which has the following properties:
(a) Its decimal representation has 6 as the last digit.
(b) If the last digit 6 is erased and placed in front of the remaining digits,
the resulting number is four times as large as the original number $n$.
-/
|
def ProblemPredicate (n : β) : Prop :=
(digits 10 n).headI = 6 β§ ofDigits 10 ((digits 10 n).tail.concat 6) = 4 * n
abbrev solution : β := 153846
theorem imo1962_p1 : IsLeast {n | ProblemPredicate n} solution := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1962, Problem 1
Find the smallest natural number $n$ which has the following properties:
(a) Its decimal representation has 6 as the last digit.
(b) If the last digit 6 is erased and placed in front of the remaining digits,
the resulting number is four times as large as the original number $n$.
-/
def ProblemPredicate (n : β) : Prop :=
(digits 10 n).headI = 6 β§ ofDigits 10 ((digits 10 n).tail.concat 6) = 4 * n
abbrev solution : β := 153846
theorem imo1962_p1 : IsLeast {n | ProblemPredicate n} solution := by sorry
|
number theory
|
Canada1998P3
| true |
[
"algebra",
"inequality"
] |
Canada1998P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
Canadian Mathematical Olympiad 1998, Problem 3
Let n be a natural number such that n β₯ 2. Show that
(1/(n + 1))(1 + 1/3 + ... + 1/(2n - 1)) > (1/n)(1/2 + 1/4 + ... + 1/2n).
-/
|
theorem canada1998_p3 (n : β) (hn : 2 β€ n) :
(1/(n:β)) * β i β Finset.range n, (1/(2 * (i:β) + 2)) <
(1/((n:β) + 1)) * β i β Finset.range n, (1/(2 * (i:β) + 1)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
Canadian Mathematical Olympiad 1998, Problem 3
Let n be a natural number such that n β₯ 2. Show that
(1/(n + 1))(1 + 1/3 + ... + 1/(2n - 1)) > (1/n)(1/2 + 1/4 + ... + 1/2n).
-/
theorem canada1998_p3 (n : β) (hn : 2 β€ n) :
(1/(n:β)) * β i β Finset.range n, (1/(2 * (i:β) + 2)) <
(1/((n:β) + 1)) * β i β Finset.range n, (1/(2 * (i:β) + 1)) := by sorry
|
algebra
|
MathOlympiadBench (Math Olympiad) comprises human-verified formalizations of Olympiad-level mathematical competition problems, sourced from Compfiles and IMOSLLean4 repository. MathOlympiadBench contains 360 problems, including 158 IMO problems from 1959 to 2024, 131 IMO shortlist problems covering 2006 to 2023, 68 national mathematical Olympiad problems, and 3 additional mathematical puzzles.
MathOlympiadBench is human-processed to eliminate several issues presented in the source problems: 1. incomplete problem statements, 2. distribution across multiple files, 3. multiple theorems per problem, and 4. incompatibility with the commonly used Mathlib. The verification process ensures that each problem contains exactly one formal theorem with its corresponding informal statement, and confirms that all formal statements can pass the compilation with the sorry tactic.
We compared the IMO problems shared between MathOlympiadBench and MiniF2F, and identified at least 3 cases in MiniF2F exhibiting issues such as: 1. the formal statement to be proved is strictly weaker than the informal statement, and 2. the formal statement does not match the informal statement. Notably, similar issues are not observed for these problems in MathOlympiadBench.
- Downloads last month
- 292