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 |
---|---|---|---|---|---|---|---|---|---|
Imo2010P3
| false |
[
"algebra"
] |
Imo2010P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2010, Problem 3
Determine all functions g : β€>0 β β€>0 such that
(g(m) + n)(g(n) + m)
is always a perfect square.
-/
|
abbrev PosInt : Type := { x : β€ // 0 < x }
notation "β€>0" => PosInt
abbrev SolutionSet : Set (β€>0 β β€>0) := { f | f = id β¨ β c, β x, f x = x + c }
theorem imo2010_p3 (g : β€>0 β β€>0) :
g β SolutionSet β β m n, IsSquare ((g m + n) * (g n + m)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2010, Problem 3
Determine all functions g : β€>0 β β€>0 such that
(g(m) + n)(g(n) + m)
is always a perfect square.
-/
abbrev PosInt : Type := { x : β€ // 0 < x }
notation "β€>0" => PosInt
abbrev SolutionSet : Set (β€>0 β β€>0) := { f | f = id β¨ β c, β x, f x = x + c }
theorem imo2010_p3 (g : β€>0 β β€>0) :
g β SolutionSet β β m n, IsSquare ((g m + n) * (g n + m)) := by sorry
|
algebra
|
Imo2021P1
| true |
[
"algebra"
] |
Imo2021P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2021, Problem 1
Let `nβ₯100` be an integer. Ivan writes the numbers `n, n+1,..., 2n` each on different cards.
He then shuffles these `n+1` cards, and divides them into two piles. Prove that at least one
of the piles contains two cards such that the sum of their numbers is a perfect square.
-/
|
theorem imo2021_p1 :
β n : β, 100 β€ n β β (A) (_ : A β Finset.Icc n (2 * n)),
(β (a : _) (_ : a β A) (b : _) (_ : b β A), a β b β§ β k : β, a + b = k ^ 2) β¨
β (a : _) (_ : a β Finset.Icc n (2 * n) \ A) (b : _) (_ : b β Finset.Icc n (2 * n) \ A),
a β b β§ β k : β, a + b = k ^ 2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2021, Problem 1
Let `nβ₯100` be an integer. Ivan writes the numbers `n, n+1,..., 2n` each on different cards.
He then shuffles these `n+1` cards, and divides them into two piles. Prove that at least one
of the piles contains two cards such that the sum of their numbers is a perfect square.
-/
theorem imo2021_p1 :
β n : β, 100 β€ n β β (A) (_ : A β Finset.Icc n (2 * n)),
(β (a : _) (_ : a β A) (b : _) (_ : b β A), a β b β§ β k : β, a + b = k ^ 2) β¨
β (a : _) (_ : a β Finset.Icc n (2 * n) \ A) (b : _) (_ : b β Finset.Icc n (2 * n) \ A),
a β b β§ β k : β, a + b = k ^ 2 := by sorry
|
algebra
|
Usa2017P5
| false |
[
"combinatorics"
] |
Usa2017P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 2017, Problem 5
Determine the set of positive real numbers c such that there exists
a labeling of the lattice points in β€Β² with positive integers for which:
1. only finitely many distinct labels occur, and
2. for each label i, the distance between any two points labeled i
is at most cβ±.
-/
|
abbrev solution_set : Set β := {c : β | 0 < c β§ c < Real.sqrt 2}
noncomputable def _dist : β€ Γ β€ β β€ Γ β€ β β
| β¨x1, y1β©, β¨x2, y2β© => Real.sqrt ((x2 - x1)^2 + (y2 - y1)^2)
theorem usa2017_p5 (c : β) :
c β solution_set β
(0 < c β§
β l : β€ Γ β€ β β,
(Set.range l).Finite β§
(β p, 0 < l p) β§
β {p1 p2}, p1 β p2 β (l p1 = l p2) β
_dist (l p1) (l p2) β€ c ^ (l p1)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 2017, Problem 5
Determine the set of positive real numbers c such that there exists
a labeling of the lattice points in β€Β² with positive integers for which:
1. only finitely many distinct labels occur, and
2. for each label i, the distance between any two points labeled i
is at most cβ±.
-/
abbrev solution_set : Set β := {c : β | 0 < c β§ c < Real.sqrt 2}
noncomputable def _dist : β€ Γ β€ β β€ Γ β€ β β
| β¨x1, y1β©, β¨x2, y2β© => Real.sqrt ((x2 - x1)^2 + (y2 - y1)^2)
theorem usa2017_p5 (c : β) :
c β solution_set β
(0 < c β§
β l : β€ Γ β€ β β,
(Set.range l).Finite β§
(β p, 0 < l p) β§
β {p1 p2}, p1 β p2 β (l p1 = l p2) β
_dist (l p1) (l p2) β€ c ^ (l p1)) := by sorry
|
combinatorics
|
Imo2014P4
| false |
[
"geometry"
] |
Imo2014P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2014, Problem 4
Let P and Q be on segment BC of an acute triangle ABC such that
β PAB = β BCA and β CAQ = β ABC. Let M and N be points on lines AB
and AQ, respectively, such that P is the midpoint of AM and Q
is the midpoint of AN. Prove that BM and CN meet on the
circumcircle of triangle ABC.
-/
|
/- special open -/ open EuclideanGeometry
theorem imo2014_p4
(A B C P Q M N : EuclideanSpace β (Fin 2))
(hABC : AffineIndependent β ![A, B, C])
(acuteA : β C A B < Real.pi / 2)
(acuteB : β A B C < Real.pi / 2)
(acuteC : β B C A < Real.pi / 2)
(hP : Sbtw β P B C)
(hQ : Sbtw β Q B C)
(hPAB : β P A B = β B C A)
(hCAQ : β C A Q = β A B C)
(hM : M β line[β, A, M])
(hN : Q β line[β, A, N])
(hPAM : P = midpoint β A M)
(hQAN : Q = midpoint β A N)
: let ABC : Affine.Triangle _ _ := β¨![A, B, C], hABCβ©
let D := (line[β, B, M] : Set _) β© (line[β, C, N] : Set (EuclideanSpace β (Fin 2)))
Set.Nonempty D β§ D β Affine.Simplex.circumsphere ABC := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2014, Problem 4
Let P and Q be on segment BC of an acute triangle ABC such that
β PAB = β BCA and β CAQ = β ABC. Let M and N be points on lines AB
and AQ, respectively, such that P is the midpoint of AM and Q
is the midpoint of AN. Prove that BM and CN meet on the
circumcircle of triangle ABC.
-/
/- special open -/ open EuclideanGeometry
theorem imo2014_p4
(A B C P Q M N : EuclideanSpace β (Fin 2))
(hABC : AffineIndependent β ![A, B, C])
(acuteA : β C A B < Real.pi / 2)
(acuteB : β A B C < Real.pi / 2)
(acuteC : β B C A < Real.pi / 2)
(hP : Sbtw β P B C)
(hQ : Sbtw β Q B C)
(hPAB : β P A B = β B C A)
(hCAQ : β C A Q = β A B C)
(hM : M β line[β, A, M])
(hN : Q β line[β, A, N])
(hPAM : P = midpoint β A M)
(hQAN : Q = midpoint β A N)
: let ABC : Affine.Triangle _ _ := β¨![A, B, C], hABCβ©
let D := (line[β, B, M] : Set _) β© (line[β, C, N] : Set (EuclideanSpace β (Fin 2)))
Set.Nonempty D β§ D β Affine.Simplex.circumsphere ABC := by sorry
|
geometry
|
Russia1998P42
| true |
[
"algebra"
] |
Russia1998P42
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
Russian Mathematical Olympiad 1998, problem 42
A binary operation β on real numbers has the property that
(a β b) β c = a + b + c.
Prove that a β b = a + b.
-/
|
variable (star : β β β β β)
local infixl:80 " β " => star
theorem russia1998_p42
(stardef : β a b c, a β b β c = a + b + c) :
(β a b, a β b = a + b) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
Russian Mathematical Olympiad 1998, problem 42
A binary operation β on real numbers has the property that
(a β b) β c = a + b + c.
Prove that a β b = a + b.
-/
variable (star : β β β β β)
local infixl:80 " β " => star
theorem russia1998_p42
(stardef : β a b c, a β b β c = a + b + c) :
(β a b, a β b = a + b) := by sorry
|
algebra
|
Imo2024P2
| true |
[
"number theory"
] |
Imo2024P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2024, Problem 2
Determine all pairs (a,b) of positive integers for which there exist positive integers
g and N such that
gcd(aβΏ + b, bβΏ + a), n = 1, 2, ...
holds for all integers n β₯ N.
-/
|
abbrev solutionSet : Set (β+ Γ β+) := {(1, 1)}
theorem imo2024_p2 (a b : β+) :
(a, b) β solutionSet β
β g N : β+,
β n : β, N β€ n β Nat.gcd (a^n + b) (b^n + a) = g := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2024, Problem 2
Determine all pairs (a,b) of positive integers for which there exist positive integers
g and N such that
gcd(aβΏ + b, bβΏ + a), n = 1, 2, ...
holds for all integers n β₯ N.
-/
abbrev solutionSet : Set (β+ Γ β+) := {(1, 1)}
theorem imo2024_p2 (a b : β+) :
(a, b) β solutionSet β
β g N : β+,
β n : β, N β€ n β Nat.gcd (a^n + b) (b^n + a) = g := by sorry
|
number theory
|
Usa1974P2
| true |
[
"algebra",
"inequality"
] |
Usa1974P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1974, Problem 2
Prove that if a, b, and c are positive real numbers, then
a^a * b^b * c^c β₯ (abc)^((a+b+c)/3)
-/
|
theorem usa1974_p2 :
β (a b c : β), a > 0 β b > 0 β c > 0 β a^a * b^b * c^c β₯ (a*b*c)^((a+b+c)/3) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1974, Problem 2
Prove that if a, b, and c are positive real numbers, then
a^a * b^b * c^c β₯ (abc)^((a+b+c)/3)
-/
theorem usa1974_p2 :
β (a b c : β), a > 0 β b > 0 β c > 0 β a^a * b^b * c^c β₯ (a*b*c)^((a+b+c)/3) := by sorry
|
algebra
|
Imo1961P1a
| false |
[
"algebra"
] |
Imo1961P1a
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1961, Problem 1.
Given constants a and b, solve the system of equations
x + y + z = a
xΒ² + yΒ² + zΒ² = bΒ²
xy = zΒ²
for x,y,z. Give the conditions that a and b must satisfy so that
the solutions x,y,z are distinct positive numbers.
-/
|
abbrev IsSolution (a b x y z : β) : Prop :=
x + y + z = a β§
x^2 + y^2 + z^2 = b^2 β§
x * y = z^2
abbrev xyz_of_ab (a b : β) : Set (β Γ β Γ β) :=
{ p | let β¨x,y,zβ© := p
z = (a^2 - b^2) / (2 * a) β§
β m, (m - x) * (m - y) =
m^2 - (a^2 + b^2) / (2 * a) * m + ((a^2 - b^2) / (2 * a))^2 }
theorem imo1961_p1a (a b x y z : β) :
β¨x,y,zβ© β xyz_of_ab a b β IsSolution a b x y z := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1961, Problem 1.
Given constants a and b, solve the system of equations
x + y + z = a
xΒ² + yΒ² + zΒ² = bΒ²
xy = zΒ²
for x,y,z. Give the conditions that a and b must satisfy so that
the solutions x,y,z are distinct positive numbers.
-/
abbrev IsSolution (a b x y z : β) : Prop :=
x + y + z = a β§
x^2 + y^2 + z^2 = b^2 β§
x * y = z^2
abbrev xyz_of_ab (a b : β) : Set (β Γ β Γ β) :=
{ p | let β¨x,y,zβ© := p
z = (a^2 - b^2) / (2 * a) β§
β m, (m - x) * (m - y) =
m^2 - (a^2 + b^2) / (2 * a) * m + ((a^2 - b^2) / (2 * a))^2 }
theorem imo1961_p1a (a b x y z : β) :
β¨x,y,zβ© β xyz_of_ab a b β IsSolution a b x y z := by sorry
|
algebra
|
Usa2008P1
| false |
[
"number theory"
] |
Usa2008P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 2008, Problem 1
Prove that for each positive integer n, there are pairwise relatively prime
integers kβ,kβ,...,kβ, all strictly greater than 1, such that kβkβ...kβ - 1
is a product of two consecutive integers.
-/
|
theorem usa2008_p1 (n : β) (hn : 0 < n) :
β k : Fin (n + 1) β β,
(β i, 1 < k i) β§
(β i j, i β j β Nat.Coprime (k i) (k j)) β§
β m, β i : Fin (n + 1), k i = 1 + m * (m + 1) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 2008, Problem 1
Prove that for each positive integer n, there are pairwise relatively prime
integers kβ,kβ,...,kβ, all strictly greater than 1, such that kβkβ...kβ - 1
is a product of two consecutive integers.
-/
theorem usa2008_p1 (n : β) (hn : 0 < n) :
β k : Fin (n + 1) β β,
(β i, 1 < k i) β§
(β i j, i β j β Nat.Coprime (k i) (k j)) β§
β m, β i : Fin (n + 1), k i = 1 + m * (m + 1) := by sorry
|
number theory
|
Usa2023P4
| false |
[
"number theory"
] |
Usa2023P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 2023, Problem 4
Positive integers a and N are fixed, and N positive integers are written on
a blackboard. Alice and Bob play the following game. On Alice's turn, she must
replace some integer n on the board with n + a, and on Bob's turn he must
replace some even integer n on the board with n/2. Alice goes first and they
alternate turns. If Bob has no valid moves on his turn the game ends.
After analyzing the N integers on the board, Bob realizes that, regardless of
what moves Alices makes, he will be able to force the game to end eventually.
Show that, in fact, no matter what either player does, for these values of a and N
and these particular N integers, the game is guaranteed to end, regardless of
either player's moves.
-/
|
inductive Player where
| Alice : Player
| Bob : Player
abbrev Blackboard (n : β) := Fin n β β+
structure State (n : β) where
board : Blackboard n
turn : Player
lemma halve_even (x : β+) (he : Even x.val) : 0 < x.val / 2 := by
obtain β¨x, hxβ© := x
obtain β¨t, htβ© := he
dsimp at *; omega
def valid_moves (a : β+) (n : β) : State n β Set (State n)
| β¨b, .Aliceβ© =>
{s | β i : Fin n, s = β¨Function.update b i (b i + a), .Bobβ©}
| β¨b, .Bobβ© =>
{s | β i : Fin n,
β he : Even (b i).val,
s = β¨Function.update b i β¨b i / 2, halve_even _ heβ©,
.Aliceβ©}
inductive BobCanForceEnd (a : β+) (n : β) : State n β Prop where
| BaseCase (b : Blackboard n) :
valid_moves a n β¨b, .Bobβ© = β
β BobCanForceEnd a n β¨b, .Bobβ©
| BobTurn (b : Blackboard n) (m : State n) :
(m β valid_moves a n β¨b, .Bobβ©) β BobCanForceEnd a n m β
BobCanForceEnd a n β¨b, .Bobβ©
| AliceTurn (b : Blackboard n) :
(β m β valid_moves a n β¨b, .Aliceβ©, BobCanForceEnd a n m) β
BobCanForceEnd a n β¨b, .Aliceβ©
inductive EndInevitable (a : β+) (n : β) : State n β Prop where
| BaseCase (s : State n) : valid_moves a n s = β
β EndInevitable a n s
| Step (s : State n)
(h : β m β valid_moves a n s, EndInevitable a n m) :
EndInevitable a n s
theorem usa2023_p4 (a : β+) (N : β) (hN : 0 < N) (b0 : Blackboard N)
(he : BobCanForceEnd a N β¨b0, .Aliceβ©) :
EndInevitable a N β¨b0, .Aliceβ© := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 2023, Problem 4
Positive integers a and N are fixed, and N positive integers are written on
a blackboard. Alice and Bob play the following game. On Alice's turn, she must
replace some integer n on the board with n + a, and on Bob's turn he must
replace some even integer n on the board with n/2. Alice goes first and they
alternate turns. If Bob has no valid moves on his turn the game ends.
After analyzing the N integers on the board, Bob realizes that, regardless of
what moves Alices makes, he will be able to force the game to end eventually.
Show that, in fact, no matter what either player does, for these values of a and N
and these particular N integers, the game is guaranteed to end, regardless of
either player's moves.
-/
inductive Player where
| Alice : Player
| Bob : Player
abbrev Blackboard (n : β) := Fin n β β+
structure State (n : β) where
board : Blackboard n
turn : Player
lemma halve_even (x : β+) (he : Even x.val) : 0 < x.val / 2 := by
obtain β¨x, hxβ© := x
obtain β¨t, htβ© := he
dsimp at *; omega
def valid_moves (a : β+) (n : β) : State n β Set (State n)
| β¨b, .Aliceβ© =>
{s | β i : Fin n, s = β¨Function.update b i (b i + a), .Bobβ©}
| β¨b, .Bobβ© =>
{s | β i : Fin n,
β he : Even (b i).val,
s = β¨Function.update b i β¨b i / 2, halve_even _ heβ©,
.Aliceβ©}
inductive BobCanForceEnd (a : β+) (n : β) : State n β Prop where
| BaseCase (b : Blackboard n) :
valid_moves a n β¨b, .Bobβ© = β
β BobCanForceEnd a n β¨b, .Bobβ©
| BobTurn (b : Blackboard n) (m : State n) :
(m β valid_moves a n β¨b, .Bobβ©) β BobCanForceEnd a n m β
BobCanForceEnd a n β¨b, .Bobβ©
| AliceTurn (b : Blackboard n) :
(β m β valid_moves a n β¨b, .Aliceβ©, BobCanForceEnd a n m) β
BobCanForceEnd a n β¨b, .Aliceβ©
inductive EndInevitable (a : β+) (n : β) : State n β Prop where
| BaseCase (s : State n) : valid_moves a n s = β
β EndInevitable a n s
| Step (s : State n)
(h : β m β valid_moves a n s, EndInevitable a n m) :
EndInevitable a n s
theorem usa2023_p4 (a : β+) (N : β) (hN : 0 < N) (b0 : Blackboard N)
(he : BobCanForceEnd a N β¨b0, .Aliceβ©) :
EndInevitable a N β¨b0, .Aliceβ© := by sorry
|
number theory
|
Imo2020P5
| false |
[
"algebra"
] |
Imo2020P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2020, Problem 5
A deck of n > 1 cards is given. A positive integer is written on
each card. The deck has the property that the arithmetic mean of
the numbers on each pair of cards is also the geometric mean of
the numbers on some collection of one or more cards.
For which n does it follow that the numbers on the cards are all equal?
-/
|
abbrev SolutionSet : Set β := {n : β | n > 1}
noncomputable def geometric_mean {Ξ± : Type} (f : Ξ± β β+) (s : Finset Ξ±) : β :=
(β i β s, (f i : β))^((1:β)/s.card)
theorem imo2020_p5 (n : β) :
n β SolutionSet β
(1 < n β§
(β Ξ± : Type, [Fintype Ξ±] β Fintype.card Ξ± = n β
β f : Ξ± β β+,
(Pairwise fun a b β¦ β s : Finset Ξ±,
s.Nonempty β§ geometric_mean f s = (((f a):β) + f b) / 2)
β β y, β a, f a = y )) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2020, Problem 5
A deck of n > 1 cards is given. A positive integer is written on
each card. The deck has the property that the arithmetic mean of
the numbers on each pair of cards is also the geometric mean of
the numbers on some collection of one or more cards.
For which n does it follow that the numbers on the cards are all equal?
-/
abbrev SolutionSet : Set β := {n : β | n > 1}
noncomputable def geometric_mean {Ξ± : Type} (f : Ξ± β β+) (s : Finset Ξ±) : β :=
(β i β s, (f i : β))^((1:β)/s.card)
theorem imo2020_p5 (n : β) :
n β SolutionSet β
(1 < n β§
(β Ξ± : Type, [Fintype Ξ±] β Fintype.card Ξ± = n β
β f : Ξ± β β+,
(Pairwise fun a b β¦ β s : Finset Ξ±,
s.Nonempty β§ geometric_mean f s = (((f a):β) + f b) / 2)
β β y, β a, f a = y )) := by sorry
|
algebra
|
Imo1998P2
| true |
[
"combinatorics"
] |
Imo1998P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1998, Problem 2
In a competition, there are `a` contestants and `b` judges, where `b β₯ 3` is an odd integer. Each
judge rates each contestant as either "pass" or "fail". Suppose `k` is a number such that, for any
two judges, their ratings coincide for at most `k` contestants.
Prove that `k / a β₯ (b - 1) / (2b)`.
-/
|
/- special open -/ open Classical
variable {C J : Type*} (r : C β J β Prop)
noncomputable section
/-- An ordered pair of judges. -/
abbrev JudgePair (J : Type*) :=
J Γ J
/-- The first judge from an ordered pair of judges. -/
abbrev JudgePair.judgeβ : JudgePair J β J :=
Prod.fst
/-- The second judge from an ordered pair of judges. -/
abbrev JudgePair.judgeβ : JudgePair J β J :=
Prod.snd
/-- The proposition that the judges in an ordered pair are distinct. -/
abbrev JudgePair.Distinct (p : JudgePair J) :=
p.judgeβ β p.judgeβ
/-- The proposition that the judges in an ordered pair agree about a contestant's rating. -/
abbrev JudgePair.Agree (p : JudgePair J) (c : C) :=
r c p.judgeβ β r c p.judgeβ
/-- The set of contestants on which two judges agree. -/
def agreedContestants [Fintype C] (p : JudgePair J) : Finset C :=
Finset.univ.filter fun c => p.Agree r c
theorem imo1998_p2 [Fintype J] [Fintype C] (a b k : β) (hC : Fintype.card C = a)
(hJ : Fintype.card J = b) (ha : 0 < a) (hb : Odd b)
(hk : β p : JudgePair J, p.Distinct β (agreedContestants r p).card β€ k) :
(b - 1 : β) / (2 * b) β€ k / a := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1998, Problem 2
In a competition, there are `a` contestants and `b` judges, where `b β₯ 3` is an odd integer. Each
judge rates each contestant as either "pass" or "fail". Suppose `k` is a number such that, for any
two judges, their ratings coincide for at most `k` contestants.
Prove that `k / a β₯ (b - 1) / (2b)`.
-/
/- special open -/ open Classical
variable {C J : Type*} (r : C β J β Prop)
noncomputable section
/-- An ordered pair of judges. -/
abbrev JudgePair (J : Type*) :=
J Γ J
/-- The first judge from an ordered pair of judges. -/
abbrev JudgePair.judgeβ : JudgePair J β J :=
Prod.fst
/-- The second judge from an ordered pair of judges. -/
abbrev JudgePair.judgeβ : JudgePair J β J :=
Prod.snd
/-- The proposition that the judges in an ordered pair are distinct. -/
abbrev JudgePair.Distinct (p : JudgePair J) :=
p.judgeβ β p.judgeβ
/-- The proposition that the judges in an ordered pair agree about a contestant's rating. -/
abbrev JudgePair.Agree (p : JudgePair J) (c : C) :=
r c p.judgeβ β r c p.judgeβ
/-- The set of contestants on which two judges agree. -/
def agreedContestants [Fintype C] (p : JudgePair J) : Finset C :=
Finset.univ.filter fun c => p.Agree r c
theorem imo1998_p2 [Fintype J] [Fintype C] (a b k : β) (hC : Fintype.card C = a)
(hJ : Fintype.card J = b) (ha : 0 < a) (hb : Odd b)
(hk : β p : JudgePair J, p.Distinct β (agreedContestants r p).card β€ k) :
(b - 1 : β) / (2 * b) β€ k / a := by sorry
|
combinatorics
|
Imo1983P1
| true |
[
"algebra"
] |
Imo1983P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1983, Problem 1
Let β+ be the set of positive real numbers.
Determine all functions f : β+ β β+ which satisfy:
i) f(xf(y)) = yf(x) for all x y β β+.
ii) f(x) β 0 as x β β.
-/
|
abbrev PosReal : Type := { x : β // 0 < x }
notation "β+" => PosReal
abbrev SolutionSet : Set (β+ β β+) := { fun x β¦ 1 / x }
theorem imo1983_p1 (f : β+ β β+) :
f β SolutionSet β
((β x y, f (x * f y) = y * f x) β§
(β Ξ΅, β x, β y, x < y β f y < Ξ΅)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1983, Problem 1
Let β+ be the set of positive real numbers.
Determine all functions f : β+ β β+ which satisfy:
i) f(xf(y)) = yf(x) for all x y β β+.
ii) f(x) β 0 as x β β.
-/
abbrev PosReal : Type := { x : β // 0 < x }
notation "β+" => PosReal
abbrev SolutionSet : Set (β+ β β+) := { fun x β¦ 1 / x }
theorem imo1983_p1 (f : β+ β β+) :
f β SolutionSet β
((β x y, f (x * f y) = y * f x) β§
(β Ξ΅, β x, β y, x < y β f y < Ξ΅)) := by sorry
|
algebra
|
Imo1999P6
| true |
[
"algebra"
] |
Imo1999P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1999, Problem 6
Determine all functions f : β β β such that
f(x - f(y)) = f(f(y)) + xf(y) + f(x) - 1
for all x,y β β.
-/
|
abbrev SolutionSet : Set (β β β) := { fun x β¦ 1 - x^2 / 2 }
theorem imo1999_p6 (f : β β β) :
f β SolutionSet β
β x y, f (x - f y) = f (f y) + x * f y + f x - 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1999, Problem 6
Determine all functions f : β β β such that
f(x - f(y)) = f(f(y)) + xf(y) + f(x) - 1
for all x,y β β.
-/
abbrev SolutionSet : Set (β β β) := { fun x β¦ 1 - x^2 / 2 }
theorem imo1999_p6 (f : β β β) :
f β SolutionSet β
β x y, f (x - f y) = f (f y) + x * f y + f x - 1 := by sorry
|
algebra
|
Imo1987P6
| true |
[
"number theory"
] |
Imo1987P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1987, Problem 6
Let $n$ be an integer greater than or equal to 2. Prove that
if $k^2 + k + n$ is prime for all integers $k$ such that
$0 <= k <= \sqrt{n/3}$, then $k^2 + k + n$ is prime for all
integers $k$ such that $0 <= k <= n - 2$.
-/
|
theorem imo1987_p6
(p : β)
(hβ : β k : β, k β€ Nat.floor (Real.sqrt ((p:β) / 3)) β Nat.Prime (k^2 + k + p)) :
β i β€ p - 2, Nat.Prime (i^2 + i + p) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1987, Problem 6
Let $n$ be an integer greater than or equal to 2. Prove that
if $k^2 + k + n$ is prime for all integers $k$ such that
$0 <= k <= \sqrt{n/3}$, then $k^2 + k + n$ is prime for all
integers $k$ such that $0 <= k <= n - 2$.
-/
theorem imo1987_p6
(p : β)
(hβ : β k : β, k β€ Nat.floor (Real.sqrt ((p:β) / 3)) β Nat.Prime (k^2 + k + p)) :
β i β€ p - 2, Nat.Prime (i^2 + i + p) := by sorry
|
number theory
|
Usa1983P5
| false |
[
"number theory"
] |
Usa1983P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1983, Problem 5
Consider an open interval of length 1/2 on the real number line, where
n is a positive integer. Prove that the number of irreducible fractions
p/q, with 1 β€ q β€ n, contained in the given interval is at most (n + 1) / 2.
-/
|
theorem usa1983_p5 (x : β) (n : β) (hn : 0 < n) :
let fracs := { q : β | q.den β€ n β§ βq β Set.Ioo x (x + 1 / n)}
fracs.Finite β§ fracs.ncard β€ (n + 1) / 2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1983, Problem 5
Consider an open interval of length 1/2 on the real number line, where
n is a positive integer. Prove that the number of irreducible fractions
p/q, with 1 β€ q β€ n, contained in the given interval is at most (n + 1) / 2.
-/
theorem usa1983_p5 (x : β) (n : β) (hn : 0 < n) :
let fracs := { q : β | q.den β€ n β§ βq β Set.Ioo x (x + 1 / n)}
fracs.Finite β§ fracs.ncard β€ (n + 1) / 2 := by sorry
|
number theory
|
India1998P1b
| true |
[
"number theory"
] |
India1998P1b
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
Indian Mathematical Olympiad 1998, problem 1
(b) If an integer n is such that 7n is of the form aΒ² + 3bΒ², prove that n is also of that form.
-/
|
theorem india1998_p1b (n a b : β€) (hn : a^2 + 3 * b^2 = 7 * n) :
(β a b : β€, a^2 + 3 * b^2 = n) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
Indian Mathematical Olympiad 1998, problem 1
(b) If an integer n is such that 7n is of the form aΒ² + 3bΒ², prove that n is also of that form.
-/
theorem india1998_p1b (n a b : β€) (hn : a^2 + 3 * b^2 = 7 * n) :
(β a b : β€, a^2 + 3 * b^2 = n) := by sorry
|
number theory
|
Poland2016S1P8
| true |
[
"number theory"
] |
Poland2016S1P8
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
Polish Mathematical Olympiad 2016, Stage 1, Problem 8
Author of the problem: Nguyen Hung Son
Source of the problem: https://om.sem.edu.pl/static/app_main/problems/om68_1r.pdf
Let a, b, c be integers. Show that there exists a positive integer n, such that
nΒ³ + anΒ² + bn + c
is not a square of any integer.
-/
|
theorem poland2016_s1_p8 (a b c : β€) : β n : β€, n > 0 β§ Β¬ IsSquare (n^3 + a * n^2 + b * n + c) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
Polish Mathematical Olympiad 2016, Stage 1, Problem 8
Author of the problem: Nguyen Hung Son
Source of the problem: https://om.sem.edu.pl/static/app_main/problems/om68_1r.pdf
Let a, b, c be integers. Show that there exists a positive integer n, such that
nΒ³ + anΒ² + bn + c
is not a square of any integer.
-/
theorem poland2016_s1_p8 (a b c : β€) : β n : β€, n > 0 β§ Β¬ IsSquare (n^3 + a * n^2 + b * n + c) := by sorry
|
number theory
|
Imo1988P3
| false |
[
"algebra"
] |
Imo1988P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1988, Problem 3
A function $f$ defined on the positive integers (and taking positive integers values) is given by:
f(1) = 1
f(3) = 3
f(2 \cdot n) = f(n)
f(4 \cdot n + 1) = 2 \cdot f(2 \cdot n + 1) - f(n)
f(4 \cdot n + 3) = 3 \cdot f(2 \cdot n + 1) - 2 \cdot f(n)
for all positive integers $n.$
Determine with proof the number of positive integers $\leq 1988$ for which $f(n) = n.$
-/
|
abbrev solution : β := 92
theorem imo1988_p3 (f : β β β)
(hβ : f 1 = 1)
(hβ : f 3 = 3)
(hβ : β n, f (2 * n) = f n)
(hβ : β n, f (4 * n + 1) + f n = 2 * f (2 * n + 1))
(hβ : β n, f (4 * n + 3) + 2 * f n = 3 * f (2 * n + 1))
(A: Finset {n | 0 < n β§ n β€ 1988 β§ f n = n}) :
A.card = solution := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1988, Problem 3
A function $f$ defined on the positive integers (and taking positive integers values) is given by:
f(1) = 1
f(3) = 3
f(2 \cdot n) = f(n)
f(4 \cdot n + 1) = 2 \cdot f(2 \cdot n + 1) - f(n)
f(4 \cdot n + 3) = 3 \cdot f(2 \cdot n + 1) - 2 \cdot f(n)
for all positive integers $n.$
Determine with proof the number of positive integers $\leq 1988$ for which $f(n) = n.$
-/
abbrev solution : β := 92
theorem imo1988_p3 (f : β β β)
(hβ : f 1 = 1)
(hβ : f 3 = 3)
(hβ : β n, f (2 * n) = f n)
(hβ : β n, f (4 * n + 1) + f n = 2 * f (2 * n + 1))
(hβ : β n, f (4 * n + 3) + 2 * f n = 3 * f (2 * n + 1))
(A: Finset {n | 0 < n β§ n β€ 1988 β§ f n = n}) :
A.card = solution := by sorry
|
algebra
|
Imo1959P2c
| true |
[
"algebra"
] |
Imo1959P2c
|
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_two : Set β := { 3 / 2 }
theorem imo1959_p2c : IsGood x 2 β x β solution_set_two := 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_two : Set β := { 3 / 2 }
theorem imo1959_p2c : IsGood x 2 β x β solution_set_two := by sorry
|
algebra
|
Imo1996P3
| false |
[
"algebra"
] |
Imo1996P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1996, Problem 3
Let S denote the set of nonnegative integers. Find
all functions f from S to itself such that
f(m + f(n)) = f(f(m)) + f(n)
for all m,n in S.
-/
|
abbrev SolutionSet : Set (β β β) :=
{f : β β β | β (k : β) (n : Fin k β β),
(k = 0 β§ f = Ξ» _ => 0) β¨
(k > 0 β§ β (q r : β) (h : r < k), f (q * k + r) = q * k + n β¨r, hβ© * k)}
theorem imo1996_p3 (f : β β β) :
f β SolutionSet β β m n, f (m + f n) = f (f m) + f n := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1996, Problem 3
Let S denote the set of nonnegative integers. Find
all functions f from S to itself such that
f(m + f(n)) = f(f(m)) + f(n)
for all m,n in S.
-/
abbrev SolutionSet : Set (β β β) :=
{f : β β β | β (k : β) (n : Fin k β β),
(k = 0 β§ f = Ξ» _ => 0) β¨
(k > 0 β§ β (q r : β) (h : r < k), f (q * k + r) = q * k + n β¨r, hβ© * k)}
theorem imo1996_p3 (f : β β β) :
f β SolutionSet β β m n, f (m + f n) = f (f m) + f n := by sorry
|
algebra
|
Imo1986P1
| true |
[
"number theory"
] |
Imo1986P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1986, Problem 1
Let d be any positive integer not equal to 2, 5 or 13.
Show that one can find distinct a, b in the set {2, 5, 13, d} such that ab - 1
is not a perfect square.
-/
|
theorem imo1986_p1 (d : β€) (_hdpos : 1 β€ d) (h2 : d β 2) (h5 : d β 5) (h13 : d β 13) :
β a b :({2, 5, 13, d} : Finset β€), (a β b) β§ Β¬ β z, z^2 = (a * (b : β€) - 1) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1986, Problem 1
Let d be any positive integer not equal to 2, 5 or 13.
Show that one can find distinct a, b in the set {2, 5, 13, d} such that ab - 1
is not a perfect square.
-/
theorem imo1986_p1 (d : β€) (_hdpos : 1 β€ d) (h2 : d β 2) (h5 : d β 5) (h13 : d β 13) :
β a b :({2, 5, 13, d} : Finset β€), (a β b) β§ Β¬ β z, z^2 = (a * (b : β€) - 1) := by sorry
|
number theory
|
Imo1994P1
| true |
[
"combinatorics"
] |
Imo1994P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathmatical Olympiad 1994, Problem 1
Let `m` and `n` be two positive integers.
Let `aβ, aβ, ..., aβ` be `m` different numbers from the set `{1, 2, ..., n}`
such that for any two indices `i` and `j` with `1 β€ i β€ j β€ m` and `aα΅’ + aβ±Ό β€ n`,
there exists an index `k` such that `aα΅’ + aβ±Ό = aβ`.
Show that `(aβ+aβ+...+aβ)/m β₯ (n+1)/2`
-/
|
/- special open -/ open Finset
theorem imo1994_p1 (n : β) (m : β) (A : Finset β) (hm : A.card = m + 1)
(hrange : β a β A, 0 < a β§ a β€ n)
(hadd : β a β A, β b β A, a + b β€ n β a + b β A) :
(m + 1) * (n + 1) β€ 2 * β x β A, x := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathmatical Olympiad 1994, Problem 1
Let `m` and `n` be two positive integers.
Let `aβ, aβ, ..., aβ` be `m` different numbers from the set `{1, 2, ..., n}`
such that for any two indices `i` and `j` with `1 β€ i β€ j β€ m` and `aα΅’ + aβ±Ό β€ n`,
there exists an index `k` such that `aα΅’ + aβ±Ό = aβ`.
Show that `(aβ+aβ+...+aβ)/m β₯ (n+1)/2`
-/
/- special open -/ open Finset
theorem imo1994_p1 (n : β) (m : β) (A : Finset β) (hm : A.card = m + 1)
(hrange : β a β A, 0 < a β§ a β€ n)
(hadd : β a β A, β b β A, a + b β€ n β a + b β A) :
(m + 1) * (n + 1) β€ 2 * β x β A, x := by sorry
|
combinatorics
|
Usa1990P2
| true |
[
"algebra"
] |
Usa1990P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1990, Problem 2
A sequence of functions {fβ(x)} is defined recursively as follows:
fβ(x) = 8
fβββ(x) = β(xΒ² + 6fβ(x)).
For each nonnegative integer n, find all real solutions of the equation
fβ(x) = 2x.
-/
|
noncomputable def f : β β β β β
| 0, _ => 8
| n + 1, x => Real.sqrt (x^2 + 6 * f n x)
abbrev solution_set (n : β) : Set β := { 4 }
theorem usa1990_p2 (n : β) (x : β) : x β solution_set n β f n x = 2 * x := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1990, Problem 2
A sequence of functions {fβ(x)} is defined recursively as follows:
fβ(x) = 8
fβββ(x) = β(xΒ² + 6fβ(x)).
For each nonnegative integer n, find all real solutions of the equation
fβ(x) = 2x.
-/
noncomputable def f : β β β β β
| 0, _ => 8
| n + 1, x => Real.sqrt (x^2 + 6 * f n x)
abbrev solution_set (n : β) : Set β := { 4 }
theorem usa1990_p2 (n : β) (x : β) : x β solution_set n β f n x = 2 * x := by sorry
|
algebra
|
Usa1999P1
| false |
[
"combinatorics"
] |
Usa1999P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
USA Mathematical Olympiad 1999, Problem 1
Some checkers placed on an n Γ n checkerboard satisfy the following conditions:
a. every square that does not contain a checker shares a side with one that does;
b. given any pair of squares that contain checkers, there is a sequence of squares
containing checkers, starting and ending with the given squares, such that
every two consecutive squares of the sequence share a side.
Prove that at least (nΒ²-2)/3 checkers have been placed on the board.
-/
|
def checkerboard (n : β) := Fin n Γ Fin n
def adjacent {n : β} : checkerboard n β checkerboard n β Prop
| β¨a1, a2β©, β¨b1, b2β© =>
(a1.val = b1.val β§ a2.val = b2.val + 1) β¨
(a1.val = b1.val β§ a2.val + 1 = b2.val) β¨
(a2.val = b2.val β§ a1.val = b1.val + 1) β¨
(a2.val = b2.val β§ a1.val + 1 = b1.val )
theorem usa1999_p1 (n : β) (c : Finset (checkerboard n))
(ha : β x : checkerboard n, x β c β¨ (β y β c, adjacent x y))
(hb : β x β c, β y β c,
β p : List (checkerboard n),
List.Chain' adjacent p β§
List.head? p = x β§
List.getLast? p = y) :
n^2 β€ c.card * 3 + 2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
USA Mathematical Olympiad 1999, Problem 1
Some checkers placed on an n Γ n checkerboard satisfy the following conditions:
a. every square that does not contain a checker shares a side with one that does;
b. given any pair of squares that contain checkers, there is a sequence of squares
containing checkers, starting and ending with the given squares, such that
every two consecutive squares of the sequence share a side.
Prove that at least (nΒ²-2)/3 checkers have been placed on the board.
-/
def checkerboard (n : β) := Fin n Γ Fin n
def adjacent {n : β} : checkerboard n β checkerboard n β Prop
| β¨a1, a2β©, β¨b1, b2β© =>
(a1.val = b1.val β§ a2.val = b2.val + 1) β¨
(a1.val = b1.val β§ a2.val + 1 = b2.val) β¨
(a2.val = b2.val β§ a1.val = b1.val + 1) β¨
(a2.val = b2.val β§ a1.val + 1 = b1.val )
theorem usa1999_p1 (n : β) (c : Finset (checkerboard n))
(ha : β x : checkerboard n, x β c β¨ (β y β c, adjacent x y))
(hb : β x β c, β y β c,
β p : List (checkerboard n),
List.Chain' adjacent p β§
List.head? p = x β§
List.getLast? p = y) :
n^2 β€ c.card * 3 + 2 := by sorry
|
combinatorics
|
India1998P1a
| true |
[
"number theory"
] |
India1998P1a
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
Indian Mathematical Olympiad 1998, problem 1
(a) Show that the product of two numbers of the form aΒ² + 3bΒ² is again of that form.
-/
|
theorem india1998_p1a (aβ aβ bβ bβ : β€) :
(β aβ bβ, (aβ^2 + 3 * bβ^2) * (aβ^2 + 3 * bβ^2) = (aβ^2 + 3 * bβ^2)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
Indian Mathematical Olympiad 1998, problem 1
(a) Show that the product of two numbers of the form aΒ² + 3bΒ² is again of that form.
-/
theorem india1998_p1a (aβ aβ bβ bβ : β€) :
(β aβ bβ, (aβ^2 + 3 * bβ^2) * (aβ^2 + 3 * bβ^2) = (aβ^2 + 3 * bβ^2)) := by sorry
|
number theory
|
Usa1987P1
| true |
[
"algebra"
] |
Usa1987P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1987, Problem 1
Determine all solutions to
(mΒ² + n)(m + nΒ²) = (m - n)Β³
where m and n are non-zero integers.
-/
|
abbrev solution_set : Set (β€ Γ β€) :=
{ (-1, -1), (8, -10), (9, -6), (9, -21) }
theorem usa1987_p1 (m n : β€) :
(m, n) β solution_set β
m β 0 β§ n β 0 β§ (m^2 + n) * (m + n^2) = (m - n)^3 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1987, Problem 1
Determine all solutions to
(mΒ² + n)(m + nΒ²) = (m - n)Β³
where m and n are non-zero integers.
-/
abbrev solution_set : Set (β€ Γ β€) :=
{ (-1, -1), (8, -10), (9, -6), (9, -21) }
theorem usa1987_p1 (m n : β€) :
(m, n) β solution_set β
m β 0 β§ n β 0 β§ (m^2 + n) * (m + n^2) = (m - n)^3 := by sorry
|
algebra
|
Imo1981P3
| true |
[
"algebra"
] |
Imo1981P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1981, Problem 3
Determine the maximum value of `m ^ 2 + n ^ 2`, where `m` and `n` are integers in
`{1, 2, ..., 1981}` and `(n ^ 2 - m * n - m ^ 2) ^ 2 = 1`.
-/
|
/- special open -/ open Int Set
/-
We generalize the problem to `{1, 2, ..., N}` and then specialize to `N = 1981`.
-/
variable (N : β)
-- N = 1981
@[mk_iff]
structure ProblemPredicate (m n : β€) : Prop where
m_range : m β Ioc 0 (N : β€)
n_range : n β Ioc 0 (N : β€)
eq_one : (n ^ 2 - m * n - m ^ 2) ^ 2 = 1
def specifiedSet : Set β€ :=
{k : β€ | β m : β€, β n : β€, k = m ^ 2 + n ^ 2 β§ ProblemPredicate N m n}
abbrev solution : β := 3524578
theorem imo1981_p3 : IsGreatest (specifiedSet 1981) solution := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1981, Problem 3
Determine the maximum value of `m ^ 2 + n ^ 2`, where `m` and `n` are integers in
`{1, 2, ..., 1981}` and `(n ^ 2 - m * n - m ^ 2) ^ 2 = 1`.
-/
/- special open -/ open Int Set
/-
We generalize the problem to `{1, 2, ..., N}` and then specialize to `N = 1981`.
-/
variable (N : β)
-- N = 1981
@[mk_iff]
structure ProblemPredicate (m n : β€) : Prop where
m_range : m β Ioc 0 (N : β€)
n_range : n β Ioc 0 (N : β€)
eq_one : (n ^ 2 - m * n - m ^ 2) ^ 2 = 1
def specifiedSet : Set β€ :=
{k : β€ | β m : β€, β n : β€, k = m ^ 2 + n ^ 2 β§ ProblemPredicate N m n}
abbrev solution : β := 3524578
theorem imo1981_p3 : IsGreatest (specifiedSet 1981) solution := by sorry
|
algebra
|
Usa1998P5
| true |
[
"number theory"
] |
Usa1998P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1998, Problem 5
Prove that for each n β₯ 2, there is a set S of n integers such that
(a-b)Β² divides ab for every distinct a,b β S.
-/
|
theorem usa1998_p5 (n : β) (_hn : 2 β€ n) :
β S : Finset β€,
S.card = n β§
β a β S, β b β S, a β b β (a - b)^2 β£ a * b := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1998, Problem 5
Prove that for each n β₯ 2, there is a set S of n integers such that
(a-b)Β² divides ab for every distinct a,b β S.
-/
theorem usa1998_p5 (n : β) (_hn : 2 β€ n) :
β S : Finset β€,
S.card = n β§
β a β S, β b β S, a β b β (a - b)^2 β£ a * b := by sorry
|
number theory
|
Imo1985P4
| false |
[
"number theory"
] |
Imo1985P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1985, Problem 4
Given a set M of 1985 distinct positive integers, none of which has a prime
divisor greater than 23, prove that M contains a subset of 4 elements
whose product is the 4th power of an integer.
-/
|
theorem imo1985_p4 (M : Finset β) (Mpos : β m β M, 0 < m)
(Mdivisors : β m β M, β n, m.Prime β§ n β£ m β m β€ 23)
: β M' : Finset β, M' β M β§ β k, M'.prod id = k^4 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1985, Problem 4
Given a set M of 1985 distinct positive integers, none of which has a prime
divisor greater than 23, prove that M contains a subset of 4 elements
whose product is the 4th power of an integer.
-/
theorem imo1985_p4 (M : Finset β) (Mpos : β m β M, 0 < m)
(Mdivisors : β m β M, β n, m.Prime β§ n β£ m β m β€ 23)
: β M' : Finset β, M' β M β§ β k, M'.prod id = k^4 := by sorry
|
number theory
|
Bulgaria1998P11
| true |
[
"number theory"
] |
Bulgaria1998P11
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
Bulgarian Mathematical Olympiad 1998, Problem 11
Let m,n be natural numbers such that
A = ((m + 3)βΏ + 1) / (3m)
is an integer. Prove that A is odd.
-/
|
theorem bulgaria1998_p11
(m n A : β)
(h : 3 * m * A = (m + 3)^n + 1) : Odd A := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
Bulgarian Mathematical Olympiad 1998, Problem 11
Let m,n be natural numbers such that
A = ((m + 3)βΏ + 1) / (3m)
is an integer. Prove that A is odd.
-/
theorem bulgaria1998_p11
(m n A : β)
(h : 3 * m * A = (m + 3)^n + 1) : Odd A := by sorry
|
number theory
|
Singapore2019P7
| true |
[
"algebra"
] |
Singapore2019P7
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# Singapore Math Olympiad (Senior) 2019 (Round 1), Problem 7
http://www.realsutra.com/limjeck/SMO_Senior_2019.pdf
Suppose that $\tan x = 5$. Find the value of $\frac{6 + \sin 2x}{1 + \cos 2x}$.
-/
|
noncomputable abbrev solution : β := 83
theorem singapore2019_r1_p7 (x : β) (hx : tan x = 5) :
(6 + sin (2 * x)) / (1 + cos (2 * x)) = 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 7
http://www.realsutra.com/limjeck/SMO_Senior_2019.pdf
Suppose that $\tan x = 5$. Find the value of $\frac{6 + \sin 2x}{1 + \cos 2x}$.
-/
noncomputable abbrev solution : β := 83
theorem singapore2019_r1_p7 (x : β) (hx : tan x = 5) :
(6 + sin (2 * x)) / (1 + cos (2 * x)) = solution := by sorry
|
algebra
|
Imo1974P5
| true |
[
"algebra"
] |
Imo1974P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1974, Problem 5
What are the possible values of
a / (a + b + d) + b / (a + b + c) + c / (b + c + d) + d / (a + c + d)
as a,b,c,d range over the positive real numbers?
-/
|
abbrev solution_set : Set β := Set.Ioo 1 2
theorem imo1974_p5 (s : β) :
s β solution_set β
β a b c d : β, 0 < a β§ 0 < b β§ 0 < c β§ 0 < d β§
s = a / (a + b + d) + b / (a + b + c) +
c / (b + c + d) + d / (a + c + d) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1974, Problem 5
What are the possible values of
a / (a + b + d) + b / (a + b + c) + c / (b + c + d) + d / (a + c + d)
as a,b,c,d range over the positive real numbers?
-/
abbrev solution_set : Set β := Set.Ioo 1 2
theorem imo1974_p5 (s : β) :
s β solution_set β
β a b c d : β, 0 < a β§ 0 < b β§ 0 < c β§ 0 < d β§
s = a / (a + b + d) + b / (a + b + c) +
c / (b + c + d) + d / (a + c + d) := by sorry
|
algebra
|
Imo1979P1
| true |
[
"number theory"
] |
Imo1979P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1979, Problem 1
Suppose that p and q are positive integers such that
p / q = 1 - 1/2 + 1/3 - 1/4 + ... - 1/1318 + 1/1319.
Prove that p is divisible by 1979.
-/
|
theorem imo1979_p1 (p q : β€) (hp : 0 < p) (hq : 0 < q)
(h : (p : β) / q = β i β Finset.range 1319, (-1 : β)^i / (i + 1)) :
1979 β£ p := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1979, Problem 1
Suppose that p and q are positive integers such that
p / q = 1 - 1/2 + 1/3 - 1/4 + ... - 1/1318 + 1/1319.
Prove that p is divisible by 1979.
-/
theorem imo1979_p1 (p q : β€) (hp : 0 < p) (hq : 0 < q)
(h : (p : β) / q = β i β Finset.range 1319, (-1 : β)^i / (i + 1)) :
1979 β£ p := by sorry
|
number theory
|
Imo2023P3
| false |
[
"number theory"
] |
Imo2023P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2023, Problem 3
For each integer k β₯ 2, determine all infinite sequences of positive
integers aβ, aβ, ... for which there exists a polynomial P of the form
P(x) = xα΅ + cβββxα΅β»ΒΉ + ... + cβx + cβ,
where cβ, cβ, ..., cβββ are non-negative integers, such that
P(aβ) = aβββaββββ―aβββ
for every integer n β₯ 1.
-/
|
abbrev SolutionSet {k : β} (hk : 2 β€ k) : Set (β+ β β+) :=
{a | β (aβ m : β), 0 < aβ β§ 0 β€ m β§ β n : β+, a n = aβ + (n - 1) * m}
theorem imo2023_p3 {k : β} (hk : 2 β€ k) (a : β+ β β+) :
a β SolutionSet hk β
(β P : Polynomial β€, P.Monic β§ P.degree = k β§
(β n, n β€ k β 0 β€ P.coeff n) β§
β n : β+,
P.eval ((a n) : β€) =
β i β Finset.range k, a β¨n + i + 1, Nat.succ_pos _β©) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2023, Problem 3
For each integer k β₯ 2, determine all infinite sequences of positive
integers aβ, aβ, ... for which there exists a polynomial P of the form
P(x) = xα΅ + cβββxα΅β»ΒΉ + ... + cβx + cβ,
where cβ, cβ, ..., cβββ are non-negative integers, such that
P(aβ) = aβββaββββ―aβββ
for every integer n β₯ 1.
-/
abbrev SolutionSet {k : β} (hk : 2 β€ k) : Set (β+ β β+) :=
{a | β (aβ m : β), 0 < aβ β§ 0 β€ m β§ β n : β+, a n = aβ + (n - 1) * m}
theorem imo2023_p3 {k : β} (hk : 2 β€ k) (a : β+ β β+) :
a β SolutionSet hk β
(β P : Polynomial β€, P.Monic β§ P.degree = k β§
(β n, n β€ k β 0 β€ P.coeff n) β§
β n : β+,
P.eval ((a n) : β€) =
β i β Finset.range k, a β¨n + i + 1, Nat.succ_pos _β©) := by sorry
|
number theory
|
Imo2013P5
| true |
[
"algebra"
] |
Imo2013P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2013, Problem 5
Let β>β be the set of positive rational numbers. Let f: β>β β β be a function satisfying
the conditions
(1) f(x) * f(y) β₯ f(x * y)
(2) f(x + y) β₯ f(x) + f(y)
for all x,y β β>β. Given that f(a) = a for some rational a > 1, prove that f(x) = x for
all x β β>β.
-/
|
theorem imo2013_p5
(f : β β β)
(H1 : β x y, 0 < x β 0 < y β f (x * y) β€ f x * f y)
(H2 : β x y, 0 < x β 0 < y β f x + f y β€ f (x + y))
(H_fixed_point : β a, 1 < a β§ f a = a) :
β x, 0 < x β f x = x := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2013, Problem 5
Let β>β be the set of positive rational numbers. Let f: β>β β β be a function satisfying
the conditions
(1) f(x) * f(y) β₯ f(x * y)
(2) f(x + y) β₯ f(x) + f(y)
for all x,y β β>β. Given that f(a) = a for some rational a > 1, prove that f(x) = x for
all x β β>β.
-/
theorem imo2013_p5
(f : β β β)
(H1 : β x y, 0 < x β 0 < y β f (x * y) β€ f x * f y)
(H2 : β x y, 0 < x β 0 < y β f x + f y β€ f (x + y))
(H_fixed_point : β a, 1 < a β§ f a = a) :
β x, 0 < x β f x = x := by sorry
|
algebra
|
Imo1964P1a
| true |
[
"number theory"
] |
Imo1964P1a
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1964, Problem 1
(a) Find all natural numbers n for which 2βΏ - 1 is divisible by 7.
-/
|
abbrev solution_set : Set β := { n | n % 3 = 0 }
theorem imo_1964_p1a (n : β) : n β solution_set β 2^n β‘ 1 [MOD 7] := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1964, Problem 1
(a) Find all natural numbers n for which 2βΏ - 1 is divisible by 7.
-/
abbrev solution_set : Set β := { n | n % 3 = 0 }
theorem imo_1964_p1a (n : β) : n β solution_set β 2^n β‘ 1 [MOD 7] := by sorry
|
number theory
|
Iran1998P9
| true |
[
"algebra",
"inequality"
] |
Iran1998P9
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# Iranian Mathematical Olympiad 1998, Problem 9
Let x,y,z > 1 and 1/x + 1/y + 1/z = 2. Prove that
β(x + y + z) β₯ β(x - 1) + β(y - 1) + β(z - 1).
-/
|
theorem iran1998_p9
(x y z : β)
(hx : 1 < x)
(hy : 1 < y)
(hz : 1 < z)
(h : 1/x + 1/y + 1/z = 2) :
β(x - 1) + β(y - 1) + β(z - 1) β€ β(x + y + z) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# Iranian Mathematical Olympiad 1998, Problem 9
Let x,y,z > 1 and 1/x + 1/y + 1/z = 2. Prove that
β(x + y + z) β₯ β(x - 1) + β(y - 1) + β(z - 1).
-/
theorem iran1998_p9
(x y z : β)
(hx : 1 < x)
(hy : 1 < y)
(hz : 1 < z)
(h : 1/x + 1/y + 1/z = 2) :
β(x - 1) + β(y - 1) + β(z - 1) β€ β(x + y + z) := by sorry
|
algebra
|
Imo1975P1
| true |
[
"algebra"
] |
Imo1975P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1975, Problem 1
Let `xβ, xβ, ... , xβ` and `yβ, yβ, ... , yβ` be two sequences of real numbers, such that
`xβ β₯ xβ β₯ ... β₯ xβ` and `yβ β₯ yβ β₯ ... β₯ yβ`. Prove that if `zβ, zβ, ... , zβ` is any permutation
of `yβ, yβ, ... , yβ`, then `β (xα΅’ - yα΅’)^2 β€ β (xα΅’ - zα΅’)^2`
-/
|
/- Let `n` be a natural number, `x` and `y` be as in the problem statement and `Ο` be the
permutation of natural numbers such that `z = y β Ο` -/
variable (n : β) (Ο : Equiv.Perm β) (x y : β β β)
theorem imo1975_p1
(hx : AntitoneOn x (Finset.Icc 1 n)) (hy : AntitoneOn y (Finset.Icc 1 n))
(hΟ : {x | Ο x β x} β Finset.Icc 1 n) :
β i β Finset.Icc 1 n, (x i - y i) ^ 2 β€ β i β Finset.Icc 1 n, (x i - y (Ο i)) ^ 2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1975, Problem 1
Let `xβ, xβ, ... , xβ` and `yβ, yβ, ... , yβ` be two sequences of real numbers, such that
`xβ β₯ xβ β₯ ... β₯ xβ` and `yβ β₯ yβ β₯ ... β₯ yβ`. Prove that if `zβ, zβ, ... , zβ` is any permutation
of `yβ, yβ, ... , yβ`, then `β (xα΅’ - yα΅’)^2 β€ β (xα΅’ - zα΅’)^2`
-/
/- Let `n` be a natural number, `x` and `y` be as in the problem statement and `Ο` be the
permutation of natural numbers such that `z = y β Ο` -/
variable (n : β) (Ο : Equiv.Perm β) (x y : β β β)
theorem imo1975_p1
(hx : AntitoneOn x (Finset.Icc 1 n)) (hy : AntitoneOn y (Finset.Icc 1 n))
(hΟ : {x | Ο x β x} β Finset.Icc 1 n) :
β i β Finset.Icc 1 n, (x i - y i) ^ 2 β€ β i β Finset.Icc 1 n, (x i - y (Ο i)) ^ 2 := by sorry
|
algebra
|
Bulgaria1998P6
| false |
[
"number theory"
] |
Bulgaria1998P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# Bulgarian Mathematical Olympiad 1998, Problem 6
Prove that the equation
xΒ²yΒ² = zΒ²(zΒ² - xΒ² - yΒ²)
has no solutions in positive integers.
-/
|
theorem bulgaria1998_p6
(x y z : β€)
(hx : 0 < x)
(hy : 0 < y)
(_hz : 0 < z)
(h : x^2 * y^2 = z^2 * (z^2 - x^2 - y^2)) :
False := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# Bulgarian Mathematical Olympiad 1998, Problem 6
Prove that the equation
xΒ²yΒ² = zΒ²(zΒ² - xΒ² - yΒ²)
has no solutions in positive integers.
-/
theorem bulgaria1998_p6
(x y z : β€)
(hx : 0 < x)
(hy : 0 < y)
(_hz : 0 < z)
(h : x^2 * y^2 = z^2 * (z^2 - x^2 - y^2)) :
False := by sorry
|
number theory
|
Imo2017P2
| true |
[
"algebra"
] |
Imo2017P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2017, Problem 2
Find all functions `f : β β β` that satisfy
β x,y β β, f(f(x)f(y)) + f(x + y) = f(xy).
-/
|
abbrev solution_set : Set (β β β) :=
{ fun _ β¦ 0, fun x β¦ x - 1, fun x β¦ 1 - x }
theorem imo2017_p2 (f : β β β) :
f β solution_set β β x y, f (f x * f y) + f (x + y) = f (x * y) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2017, Problem 2
Find all functions `f : β β β` that satisfy
β x,y β β, f(f(x)f(y)) + f(x + y) = f(xy).
-/
abbrev solution_set : Set (β β β) :=
{ fun _ β¦ 0, fun x β¦ x - 1, fun x β¦ 1 - x }
theorem imo2017_p2 (f : β β β) :
f β solution_set β β x y, f (f x * f y) + f (x + y) = f (x * y) := by sorry
|
algebra
|
Imo2004P6
| false |
[
"number theory"
] |
Imo2004P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2004, Problem 6
We call a positive integer *alternating* if every two consecutive
digits in its decimal representation are of different parity.
Find all positive integers n such that n has a multiple that is
alternating.
-/
|
abbrev SolutionSet : Set β :=
{n : β | 0 < n β§ Β¬(20 β£ n)}
abbrev Alternating (n : Nat) : Prop :=
(n.digits 10).Chain' (fun k l β¦ Β¬ k β‘ l [MOD 2])
theorem imo2004_p6 (n : β) :
n β SolutionSet β 0 < n β§ β k, Alternating (n * k) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2004, Problem 6
We call a positive integer *alternating* if every two consecutive
digits in its decimal representation are of different parity.
Find all positive integers n such that n has a multiple that is
alternating.
-/
abbrev SolutionSet : Set β :=
{n : β | 0 < n β§ Β¬(20 β£ n)}
abbrev Alternating (n : Nat) : Prop :=
(n.digits 10).Chain' (fun k l β¦ Β¬ k β‘ l [MOD 2])
theorem imo2004_p6 (n : β) :
n β SolutionSet β 0 < n β§ β k, Alternating (n * k) := by sorry
|
number theory
|
UK2024R1P2
| true |
[
"algebra"
] |
UK2024R1P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# British Mathematical Olympiad 2024, Round 1, Problem 2
The sequence of integers aβ, aβ, β― has the property that for each
i β₯ 2, aα΅’ is either 2 * aα΅’ββ - aα΅’ββ, or 2 * aα΅’ββ - aα΅’ββ.
Given that aββββ and aββββ are consecutive integers, prove that aβ
and aβ are consecutive.
-/
|
theorem uk2024_r1_p2 (a : β β β€)
(ha : β i β₯ 2, a i = 2 * a (i - 1) - a (i - 2) β¨ a i = 2 * a (i - 2) - a (i - 1))
(ha' : |a 2023 - a 2024| = 1) :
|a 0 - a 1| = 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# British Mathematical Olympiad 2024, Round 1, Problem 2
The sequence of integers aβ, aβ, β― has the property that for each
i β₯ 2, aα΅’ is either 2 * aα΅’ββ - aα΅’ββ, or 2 * aα΅’ββ - aα΅’ββ.
Given that aββββ and aββββ are consecutive integers, prove that aβ
and aβ are consecutive.
-/
theorem uk2024_r1_p2 (a : β β β€)
(ha : β i β₯ 2, a i = 2 * a (i - 1) - a (i - 2) β¨ a i = 2 * a (i - 2) - a (i - 1))
(ha' : |a 2023 - a 2024| = 1) :
|a 0 - a 1| = 1 := by sorry
|
algebra
|
Imo1962P2
| true |
[
"algebra"
] |
Imo1962P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1962, Problem 2
Determine all real numbers x which satisfy
β(3 - x) - β(x + 1) > 1/2.
-/
|
abbrev SolutionSet : Set β := Set.Ico (-1) (1 - β31 / 8)
theorem imo1962_p2 (x : β) :
x β SolutionSet β
x β€ 3 β§ -1 β€ x β§ 1/2 < β(3 - x) - β(x + 1) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1962, Problem 2
Determine all real numbers x which satisfy
β(3 - x) - β(x + 1) > 1/2.
-/
abbrev SolutionSet : Set β := Set.Ico (-1) (1 - β31 / 8)
theorem imo1962_p2 (x : β) :
x β SolutionSet β
x β€ 3 β§ -1 β€ x β§ 1/2 < β(3 - x) - β(x + 1) := by sorry
|
algebra
|
Imo1978P5
| true |
[
"algebra"
] |
Imo1978P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1978, Problem 5
Let a_k be a sequence of distinct positive integers for k = 1,2,3, ...
Prove that for all natral numbers n, we have:
sum_{k=1}^{n} a(k)/(k^2) >= sum_{k=1}^{n} (1/k).
-/
|
/- special open -/ open Finset
theorem imo_1978_p5
(n : β)
(f : β β β)
(hβ : β (m : β), 0 < m β 0 < f m)
(hβ : β (p q : β), 0 < p β 0 < q β p β q β f p β f q)
(hβ : 0 < n) :
(β k β Finset.Icc 1 n, (1 : β) / k) β€ β k β Finset.Icc 1 n, ((f k):β) / k ^ 2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1978, Problem 5
Let a_k be a sequence of distinct positive integers for k = 1,2,3, ...
Prove that for all natral numbers n, we have:
sum_{k=1}^{n} a(k)/(k^2) >= sum_{k=1}^{n} (1/k).
-/
/- special open -/ open Finset
theorem imo_1978_p5
(n : β)
(f : β β β)
(hβ : β (m : β), 0 < m β 0 < f m)
(hβ : β (p q : β), 0 < p β 0 < q β p β q β f p β f q)
(hβ : 0 < n) :
(β k β Finset.Icc 1 n, (1 : β) / k) β€ β k β Finset.Icc 1 n, ((f k):β) / k ^ 2 := by sorry
|
algebra
|
Imo1976P4
| false |
[
"number theory"
] |
Imo1976P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1976, Problem 4
Determine, with proof, the largest number which is the product
of positive integers whose sum is 1976.
-/
|
abbrev solution : β := 2 * 3^658
theorem imo1976_p4 :
IsGreatest
{ n | β s : Finset β, β i β s, i = 1976 β§ β i β s, i = n }
solution := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1976, Problem 4
Determine, with proof, the largest number which is the product
of positive integers whose sum is 1976.
-/
abbrev solution : β := 2 * 3^658
theorem imo1976_p4 :
IsGreatest
{ n | β s : Finset β, β i β s, i = 1976 β§ β i β s, i = n }
solution := by sorry
|
number theory
|
Usa2000P5
| false |
[
"geometry"
] |
Usa2000P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# Usa Mathematical Olympiad 2000, Problem 5
Let AβAβAβ be a triangle, and let Οβ be a circle in its plane
passing through Aβ and Aβ. Suppose there exist circles Οβ,Οβ,β―,Οβ
such that for k=2,3,β―,7, circle Οβ is externally tangent to Οβββ
and passes through Aβ and Aβββ (indices mod 3).
Prove that Οβ = Οβ.
-/
|
/- special open -/ open EuclideanGeometry
abbrev Circle := EuclideanGeometry.Sphere (EuclideanSpace β (Fin 2))
def ExternallyTangent (c1 c2 : Circle) : Prop :=
dist c1.center c2.center = c1.radius + c2.radius
theorem imo2000_p5
(A : ZMod 3 β EuclideanSpace β (Fin 2))
(hABC : AffineIndependent β ![A 0, A 1, A 2])
(Ο : Fin 7 β Circle)
(hTangent : β i, i < 6 β ExternallyTangent (Ο i) (Ο (i + 1)))
(hA : β i : Fin 7, (A i β Ο i β§ A (i + 1) β Ο i))
: Ο 0 = Ο 6 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# Usa Mathematical Olympiad 2000, Problem 5
Let AβAβAβ be a triangle, and let Οβ be a circle in its plane
passing through Aβ and Aβ. Suppose there exist circles Οβ,Οβ,β―,Οβ
such that for k=2,3,β―,7, circle Οβ is externally tangent to Οβββ
and passes through Aβ and Aβββ (indices mod 3).
Prove that Οβ = Οβ.
-/
/- special open -/ open EuclideanGeometry
abbrev Circle := EuclideanGeometry.Sphere (EuclideanSpace β (Fin 2))
def ExternallyTangent (c1 c2 : Circle) : Prop :=
dist c1.center c2.center = c1.radius + c2.radius
theorem imo2000_p5
(A : ZMod 3 β EuclideanSpace β (Fin 2))
(hABC : AffineIndependent β ![A 0, A 1, A 2])
(Ο : Fin 7 β Circle)
(hTangent : β i, i < 6 β ExternallyTangent (Ο i) (Ο (i + 1)))
(hA : β i : Fin 7, (A i β Ο i β§ A (i + 1) β Ο i))
: Ο 0 = Ο 6 := by sorry
|
geometry
|
Usa2022P3
| true |
[
"algebra"
] |
Usa2022P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 2022, Problem 3
Let β+ be the set of all positive real numbers. Find all
functions β+ β β+ such that for all x, y β β+ we have
f(x) = f(f(f(x)) + y) + f(xf(y))f(x+y).
-/
|
abbrev PosReal : Type := { x : β // 0 < x }
notation "β+" => PosReal
abbrev solution_set : Set (β+ β β+) :=
{ f : β+ β β+ | β c : β+, f = fun x β¦ c / x }
theorem usa2022_p3 (f : β+ β β+) :
f β solution_set β
(β x y : β+, f x = f (f (f x) + y) + f (x * f y) * f (x + y)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 2022, Problem 3
Let β+ be the set of all positive real numbers. Find all
functions β+ β β+ such that for all x, y β β+ we have
f(x) = f(f(f(x)) + y) + f(xf(y))f(x+y).
-/
abbrev PosReal : Type := { x : β // 0 < x }
notation "β+" => PosReal
abbrev solution_set : Set (β+ β β+) :=
{ f : β+ β β+ | β c : β+, f = fun x β¦ c / x }
theorem usa2022_p3 (f : β+ β β+) :
f β solution_set β
(β x y : β+, f x = f (f (f x) + y) + f (x * f y) * f (x + y)) := by sorry
|
algebra
|
Imo2021P2
| false |
[
"algebra"
] |
Imo2021P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2021, Problem 2
Let n be a natural number, and let xβ, ..., xβ be real numbers.
Show that
βα΅’ββ±Ό β|xα΅’ - xβ±Ό| β€ βα΅’ββ±Ό β|xα΅’ + xβ±Ό|.
-/
|
theorem imo2021_p2 (n : β) (x : Fin n β β) :
β i, β j, β|x i - x j| β€ β i, β j, β|x i + x j| := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2021, Problem 2
Let n be a natural number, and let xβ, ..., xβ be real numbers.
Show that
βα΅’ββ±Ό β|xα΅’ - xβ±Ό| β€ βα΅’ββ±Ό β|xα΅’ + xβ±Ό|.
-/
theorem imo2021_p2 (n : β) (x : Fin n β β) :
β i, β j, β|x i - x j| β€ β i, β j, β|x i + x j| := by sorry
|
algebra
|
Imo1972P3
| true |
[
"number theory"
] |
Imo1972P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1972, Problem 3
Let m and n be non-negative integers. Prove that
(2m)!(2n)! / (m!n!(m + n)!)
is an integer.
-/
|
theorem imo1972_p3 (m n : β) :
m ! * n ! * (m + n)! β£ (2 * m)! * (2 * n)! := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1972, Problem 3
Let m and n be non-negative integers. Prove that
(2m)!(2n)! / (m!n!(m + n)!)
is an integer.
-/
theorem imo1972_p3 (m n : β) :
m ! * n ! * (m + n)! β£ (2 * m)! * (2 * n)! := by sorry
|
number theory
|
Usa1978P1
| true |
[
"algebra",
"inequality"
] |
Usa1978P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1978, Problem 1
Given that a,b,c,d,e are real numbers such that
a + b + c + d + e = 8
aΒ² + bΒ² + cΒ² + dΒ² + eΒ² = 16,
determine the maximum value of e.
-/
|
noncomputable abbrev max_e : β := (16 : β) / 5
abbrev IsGood (a b c d e : β) : Prop :=
a + b + c + d + e = 8 β§ a^2 + b^2 + c^2 + d^2 + e^2 = 16
theorem usa1978_p1 :
IsGreatest { e : β | β a b c d : β, IsGood a b c d e } max_e := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1978, Problem 1
Given that a,b,c,d,e are real numbers such that
a + b + c + d + e = 8
aΒ² + bΒ² + cΒ² + dΒ² + eΒ² = 16,
determine the maximum value of e.
-/
noncomputable abbrev max_e : β := (16 : β) / 5
abbrev IsGood (a b c d e : β) : Prop :=
a + b + c + d + e = 8 β§ a^2 + b^2 + c^2 + d^2 + e^2 = 16
theorem usa1978_p1 :
IsGreatest { e : β | β a b c d : β, IsGood a b c d e } max_e := by sorry
|
algebra
|
Imo2024P1
| true |
[
"algebra"
] |
Imo2024P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2024, Problem 1
Determine all real numbers Ξ± such that, for every positive integer n, the
integer
βΞ±β + β2Ξ±β + ... + βnΞ±β
is a multiple of n.
-/
|
abbrev solutionSet : Set β := {Ξ± : β | β m : β€, Ξ± = 2 * m}
theorem imo2024_p1 (Ξ± : β) :
Ξ± β solutionSet β
β n : β, 0 < n β (n : β€) β£ β i β Finset.Icc 1 n, βi * Ξ±β := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2024, Problem 1
Determine all real numbers Ξ± such that, for every positive integer n, the
integer
βΞ±β + β2Ξ±β + ... + βnΞ±β
is a multiple of n.
-/
abbrev solutionSet : Set β := {Ξ± : β | β m : β€, Ξ± = 2 * m}
theorem imo2024_p1 (Ξ± : β) :
Ξ± β solutionSet β
β n : β, 0 < n β (n : β€) β£ β i β Finset.Icc 1 n, βi * Ξ±β := by sorry
|
algebra
|
Imo1964P4
| true |
[
"combinatorics"
] |
Imo1964P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1964, Problem 4
Seventeen people correspond by mail with one another -- each one with
all the rest. In their letters only three different topics are
discussed. Each pair of correspondents deals with only one of the topics.
Prove that there are at least three people who write to each other
about the same topic.
-/
|
theorem imo1964_p4
(Person Topic : Type)
[Fintype Person] [DecidableEq Person]
[Fintype Topic] [DecidableEq Topic]
(card_person : Fintype.card Person = 17)
(card_topic : Fintype.card Topic = 3)
(discusses : Person β Person β Topic)
(discussion_sym : β p1 p2 : Person, discusses p1 p2 = discusses p2 p1) :
β t : Topic, β s : Finset Person,
2 < s.card β§
β p1 β s, β p2 β s, p1 β p2 β discusses p1 p2 = t := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1964, Problem 4
Seventeen people correspond by mail with one another -- each one with
all the rest. In their letters only three different topics are
discussed. Each pair of correspondents deals with only one of the topics.
Prove that there are at least three people who write to each other
about the same topic.
-/
theorem imo1964_p4
(Person Topic : Type)
[Fintype Person] [DecidableEq Person]
[Fintype Topic] [DecidableEq Topic]
(card_person : Fintype.card Person = 17)
(card_topic : Fintype.card Topic = 3)
(discusses : Person β Person β Topic)
(discussion_sym : β p1 p2 : Person, discusses p1 p2 = discusses p2 p1) :
β t : Topic, β s : Finset Person,
2 < s.card β§
β p1 β s, β p2 β s, p1 β p2 β discusses p1 p2 = t := by sorry
|
combinatorics
|
Imo1961P1b
| false |
[
"algebra"
] |
Imo1961P1b
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1961, Problem 1.
Given constants a and b, solve the system of equations
x + y + z = a
xΒ² + yΒ² + zΒ² = bΒ²
xy = zΒ²
for x,y,z. Give the conditions that a and b must satisfy so that
the solutions x,y,z are distinct positive numbers.
-/
|
abbrev IsSolution (a b x y z : β) : Prop :=
x + y + z = a β§
x^2 + y^2 + z^2 = b^2 β§
x * y = z^2
abbrev ab_that_make_xyz_positive_distinct : Set (β Γ β) :=
{ q | let β¨a,bβ© := q
b^2 < a^2 β§ a^2 < 3 * b ^ 2 }
theorem imo1961_p1b (a b : β) :
β¨a,bβ© β ab_that_make_xyz_positive_distinct β
(β x y z, IsSolution a b x y z β 0 < x β§ 0 < y β§ 0 < z β§ [x,y,z].Nodup) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1961, Problem 1.
Given constants a and b, solve the system of equations
x + y + z = a
xΒ² + yΒ² + zΒ² = bΒ²
xy = zΒ²
for x,y,z. Give the conditions that a and b must satisfy so that
the solutions x,y,z are distinct positive numbers.
-/
abbrev IsSolution (a b x y z : β) : Prop :=
x + y + z = a β§
x^2 + y^2 + z^2 = b^2 β§
x * y = z^2
abbrev ab_that_make_xyz_positive_distinct : Set (β Γ β) :=
{ q | let β¨a,bβ© := q
b^2 < a^2 β§ a^2 < 3 * b ^ 2 }
theorem imo1961_p1b (a b : β) :
β¨a,bβ© β ab_that_make_xyz_positive_distinct β
(β x y z, IsSolution a b x y z β 0 < x β§ 0 < y β§ 0 < z β§ [x,y,z].Nodup) := by sorry
|
algebra
|
Usa2001P1
| false |
[
"combinatorics"
] |
Usa2001P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 2001, Problem 1
Each of eight boxes contains six balls.
Each ball has been colored with one of n colors, such that no two balls
in the same box are the same color, and no two colors occur together in
more than one box. Determine, with justification, the smallest integer n
for which this is possible.
-/
|
def possible_num_colors : Set β :=
{ n : β | β f : Fin 8 β Finset (Fin n),
(β i, (f i).card = 6) β§
(β x y : Fin n, β i j : Fin 8,
i β j β x β f i β y β f i β
(Β¬ (x β f j β§ y β f j))) }
abbrev min_colors : β := 23
theorem usa2001_p1 : IsLeast possible_num_colors min_colors := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 2001, Problem 1
Each of eight boxes contains six balls.
Each ball has been colored with one of n colors, such that no two balls
in the same box are the same color, and no two colors occur together in
more than one box. Determine, with justification, the smallest integer n
for which this is possible.
-/
def possible_num_colors : Set β :=
{ n : β | β f : Fin 8 β Finset (Fin n),
(β i, (f i).card = 6) β§
(β x y : Fin n, β i j : Fin 8,
i β j β x β f i β y β f i β
(Β¬ (x β f j β§ y β f j))) }
abbrev min_colors : β := 23
theorem usa2001_p1 : IsLeast possible_num_colors min_colors := by sorry
|
combinatorics
|
Imo2015P2
| false |
[
"number theory"
] |
Imo2015P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2015, Problem 2
Determine all triples of positive integers a, b, c such that each of
ab - c, bc - a, ca - b is a power of two.
-/
|
abbrev SolutionSet : Set (β€ Γ β€ Γ β€) :=
{(2, 2, 2), (2, 2, 3), (3, 2, 2), (2, 3, 2),
(2, 6, 11), (2, 11, 6), (6, 2, 11), (6, 11, 2), (11, 2, 6), (11, 6, 2),
(3, 5, 7), (3, 7, 5), (5, 3, 7), (5, 7, 3), (7, 3, 5), (7, 5, 3)}
def is_power_of_two (n : β€) : Prop := β m : β, n = 2 ^ m
theorem imo2015_p2 (a b c : β€) :
(a,b,c) β SolutionSet β
0 < a β§ 0 < b β§ 0 < c β§
is_power_of_two (a * b - c) β§
is_power_of_two (b * c - a) β§
is_power_of_two (c * a - b) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2015, Problem 2
Determine all triples of positive integers a, b, c such that each of
ab - c, bc - a, ca - b is a power of two.
-/
abbrev SolutionSet : Set (β€ Γ β€ Γ β€) :=
{(2, 2, 2), (2, 2, 3), (3, 2, 2), (2, 3, 2),
(2, 6, 11), (2, 11, 6), (6, 2, 11), (6, 11, 2), (11, 2, 6), (11, 6, 2),
(3, 5, 7), (3, 7, 5), (5, 3, 7), (5, 7, 3), (7, 3, 5), (7, 5, 3)}
def is_power_of_two (n : β€) : Prop := β m : β, n = 2 ^ m
theorem imo2015_p2 (a b c : β€) :
(a,b,c) β SolutionSet β
0 < a β§ 0 < b β§ 0 < c β§
is_power_of_two (a * b - c) β§
is_power_of_two (b * c - a) β§
is_power_of_two (c * a - b) := by sorry
|
number theory
|
Imo1960P2
| true |
[
"algebra"
] |
Imo1960P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1960, Problem 2
For what values of the variable $x$ does the following inequality hold:
\[\dfrac{4x^2}{(1 - \sqrt {2x + 1})^2} < 2x + 9 \ ?\]
-/
|
/- special open -/ open Set
/-- The predicate says that `x` satisfies the inequality
\[\dfrac{4x^2}{(1 - \sqrt {2x + 1})^2} < 2x + 9\]
and belongs to the domain of the function on the left-hand side.
-/
@[mk_iff isGood_iff']
structure IsGood (x : β) : Prop where
/-- The number satisfies the inequality. -/
ineq : 4 * x ^ 2 / (1 - sqrt (2 * x + 1)) ^ 2 < 2 * x + 9
/-- The number belongs to the domain of \(\sqrt {2x + 1}\). -/
sqrt_dom : 0 β€ 2 * x + 1
/-- The number belongs to the domain of the denominator. -/
denom_dom : (1 - sqrt (2 * x + 1)) ^ 2 β 0
abbrev SolutionSet : Set β := Ico (-1/2) (45/8) \ {0}
theorem imo1960_p2 {x} : IsGood x β x β SolutionSet := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1960, Problem 2
For what values of the variable $x$ does the following inequality hold:
\[\dfrac{4x^2}{(1 - \sqrt {2x + 1})^2} < 2x + 9 \ ?\]
-/
/- special open -/ open Set
/-- The predicate says that `x` satisfies the inequality
\[\dfrac{4x^2}{(1 - \sqrt {2x + 1})^2} < 2x + 9\]
and belongs to the domain of the function on the left-hand side.
-/
@[mk_iff isGood_iff']
structure IsGood (x : β) : Prop where
/-- The number satisfies the inequality. -/
ineq : 4 * x ^ 2 / (1 - sqrt (2 * x + 1)) ^ 2 < 2 * x + 9
/-- The number belongs to the domain of \(\sqrt {2x + 1}\). -/
sqrt_dom : 0 β€ 2 * x + 1
/-- The number belongs to the domain of the denominator. -/
denom_dom : (1 - sqrt (2 * x + 1)) ^ 2 β 0
abbrev SolutionSet : Set β := Ico (-1/2) (45/8) \ {0}
theorem imo1960_p2 {x} : IsGood x β x β SolutionSet := by sorry
|
algebra
|
Imo1969P1
| true |
[
"number theory"
] |
Imo1969P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1969, Problem 1
Prove that there are infinitely many natural numbers a with the following property:
the number z = nβ΄ + a is not prime for any natural number n.
-/
|
/- special open -/ open Int
theorem imo1969_p1 : Set.Infinite {a : β | β n : β, Β¬Nat.Prime (n ^ 4 + a)} := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1969, Problem 1
Prove that there are infinitely many natural numbers a with the following property:
the number z = nβ΄ + a is not prime for any natural number n.
-/
/- special open -/ open Int
theorem imo1969_p1 : Set.Infinite {a : β | β n : β, Β¬Nat.Prime (n ^ 4 + a)} := by sorry
|
number theory
|
Imo2011P5
| false |
[
"number theory"
] |
Imo2011P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2011, Problem 5
Let f be a function from the set of integers to the set
of positive integers. Suppose that, for any two integers
m and n, the difference f(m) - f(n) is divisible by
f (m - n). Prove that, for all integers m and n with
f(m) β€ f(n), the number f(n) is divisible by f(m).
-/
|
theorem imo2011_p5 (f : β€ β β€)
(fpos : β n, 0 < f n)
(fpos : β m n, f (m - n) β£ f m - f n)
: β m n, f m β€ f n β f m β£ f n := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2011, Problem 5
Let f be a function from the set of integers to the set
of positive integers. Suppose that, for any two integers
m and n, the difference f(m) - f(n) is divisible by
f (m - n). Prove that, for all integers m and n with
f(m) β€ f(n), the number f(n) is divisible by f(m).
-/
theorem imo2011_p5 (f : β€ β β€)
(fpos : β n, 0 < f n)
(fpos : β m n, f (m - n) β£ f m - f n)
: β m n, f m β€ f n β f m β£ f n := by sorry
|
number theory
|
Imo2019P2
| true |
[
"geometry"
] |
Imo2019P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2019, Problem 2
In triangle `ABC`, point `Aβ` lies on side `BC` and point `Bβ` lies on side `AC`. Let `P` and
`Q` be points on segments `AAβ` and `BBβ`, respectively, such that `PQ` is parallel to `AB`.
Let `Pβ` be a point on line `PBβ`, such that `Bβ` lies strictly between `P` and `Pβ`, and
`β PPβC = β BAC`. Similarly, let `Qβ` be a point on line `QAβ`, such that `Aβ` lies strictly
between `Q` and `Qβ`, and `β CQβQ = β CBA`.
Prove that points `P`, `Q`, `Pβ`, and `Qβ` are concyclic.
-/
|
/- special open -/ open Affine EuclideanGeometry FiniteDimensional Module Simplex
attribute [local instance] FiniteDimensional.of_fact_finrank_eq_two
variable (V : Type*) (Pt : Type*)
variable [NormedAddCommGroup V] [InnerProductSpace β V] [MetricSpace Pt]
variable [NormedAddTorsor V Pt]
theorem imo2019_p2 [Fact (finrank β V = 2)] (A B C Aβ Bβ P Q Pβ Qβ : Pt)
(affine_independent_ABC : AffineIndependent β ![A, B, C]) (wbtw_B_Aβ_C : Wbtw β B Aβ C)
(wbtw_A_Bβ_C : Wbtw β A Bβ C) (wbtw_A_P_Aβ : Wbtw β A P Aβ) (wbtw_B_Q_Bβ : Wbtw β B Q Bβ)
(PQ_parallel_AB : line[β, P, Q] β₯ line[β, A, B]) (P_ne_Q : P β Q)
(sbtw_P_Bβ_Pβ : Sbtw β P Bβ Pβ) (angle_PPβC_eq_angle_BAC : β P Pβ C = β B A C)
(C_ne_Pβ : C β Pβ) (sbtw_Q_Aβ_Qβ : Sbtw β Q Aβ Qβ)
(angle_CQβQ_eq_angle_CBA : β C Qβ Q = β C B A) (C_ne_Qβ : C β Qβ) :
Concyclic ({P, Q, Pβ, Qβ} : Set Pt) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2019, Problem 2
In triangle `ABC`, point `Aβ` lies on side `BC` and point `Bβ` lies on side `AC`. Let `P` and
`Q` be points on segments `AAβ` and `BBβ`, respectively, such that `PQ` is parallel to `AB`.
Let `Pβ` be a point on line `PBβ`, such that `Bβ` lies strictly between `P` and `Pβ`, and
`β PPβC = β BAC`. Similarly, let `Qβ` be a point on line `QAβ`, such that `Aβ` lies strictly
between `Q` and `Qβ`, and `β CQβQ = β CBA`.
Prove that points `P`, `Q`, `Pβ`, and `Qβ` are concyclic.
-/
/- special open -/ open Affine EuclideanGeometry FiniteDimensional Module Simplex
attribute [local instance] FiniteDimensional.of_fact_finrank_eq_two
variable (V : Type*) (Pt : Type*)
variable [NormedAddCommGroup V] [InnerProductSpace β V] [MetricSpace Pt]
variable [NormedAddTorsor V Pt]
theorem imo2019_p2 [Fact (finrank β V = 2)] (A B C Aβ Bβ P Q Pβ Qβ : Pt)
(affine_independent_ABC : AffineIndependent β ![A, B, C]) (wbtw_B_Aβ_C : Wbtw β B Aβ C)
(wbtw_A_Bβ_C : Wbtw β A Bβ C) (wbtw_A_P_Aβ : Wbtw β A P Aβ) (wbtw_B_Q_Bβ : Wbtw β B Q Bβ)
(PQ_parallel_AB : line[β, P, Q] β₯ line[β, A, B]) (P_ne_Q : P β Q)
(sbtw_P_Bβ_Pβ : Sbtw β P Bβ Pβ) (angle_PPβC_eq_angle_BAC : β P Pβ C = β B A C)
(C_ne_Pβ : C β Pβ) (sbtw_Q_Aβ_Qβ : Sbtw β Q Aβ Qβ)
(angle_CQβQ_eq_angle_CBA : β C Qβ Q = β C B A) (C_ne_Qβ : C β Qβ) :
Concyclic ({P, Q, Pβ, Qβ} : Set Pt) := by sorry
|
geometry
|
Imo2010P1
| true |
[
"algebra"
] |
Imo2010P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2010, Problem 1
Determine all functions f : β β β such that for all x,y β β,
f(βxβy) = f(x)βf(y)β.
-/
|
abbrev solution_set : Set (β β β) :=
{ f | (β C, βCβ = 1 β§ f = Function.const _ C) β¨ f = Function.const _ 0 }
theorem imo2010_p1 (f : β β β) :
f β solution_set β β x y, f (βxβ * y) = f x * βf yβ := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2010, Problem 1
Determine all functions f : β β β such that for all x,y β β,
f(βxβy) = f(x)βf(y)β.
-/
abbrev solution_set : Set (β β β) :=
{ f | (β C, βCβ = 1 β§ f = Function.const _ C) β¨ f = Function.const _ 0 }
theorem imo2010_p1 (f : β β β) :
f β solution_set β β x y, f (βxβ * y) = f x * βf yβ := by sorry
|
algebra
|
Imo1965P1
| true |
[
"algebra"
] |
Imo1965P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1965, Problem 1
Determine all values x in the interval 0 β€ x β€ 2Ο which
satisfy the inequality
2 cos x β€ |β(1 + sin 2x) β β(1 β sin 2x)| β€ β2.
-/
|
/- special open -/ open Set
abbrev the_answer : Set β := Set.Icc (Real.pi/4) (7*Real.pi/4)
theorem imo1965_p1 :
{x β Set.Icc 0 (2*Real.pi) |
|Real.sqrt (1 + Real.sin (2*x)) - Real.sqrt (1 - Real.sin (2*x))| β Set.Icc (2 * Real.cos x) (Real.sqrt 2)}
= the_answer := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1965, Problem 1
Determine all values x in the interval 0 β€ x β€ 2Ο which
satisfy the inequality
2 cos x β€ |β(1 + sin 2x) β β(1 β sin 2x)| β€ β2.
-/
/- special open -/ open Set
abbrev the_answer : Set β := Set.Icc (Real.pi/4) (7*Real.pi/4)
theorem imo1965_p1 :
{x β Set.Icc 0 (2*Real.pi) |
|Real.sqrt (1 + Real.sin (2*x)) - Real.sqrt (1 - Real.sin (2*x))| β Set.Icc (2 * Real.cos x) (Real.sqrt 2)}
= the_answer := by sorry
|
algebra
|
Imo1966P4
| true |
[
"algebra"
] |
Imo1966P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1966, Problem 4
Prove that for every natural number n and for every real
number x that is not of the form kΟ/2α΅ for t a non-negative
integer and k any integer,
1 / (sin 2x) + 1 / (sin 4x) + ... + 1 / (sin 2βΏx) = cot x - cot 2βΏ x.
-/
|
theorem imo1966_p4 (n : β) (x : β)
(hx : β t : β, β k : β€, x β k * Real.pi / 2^t) :
β i β Finset.range n, 1 / Real.sin (2^(i + 1) * x) =
Real.cot x - Real.cot (2^n * x) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1966, Problem 4
Prove that for every natural number n and for every real
number x that is not of the form kΟ/2α΅ for t a non-negative
integer and k any integer,
1 / (sin 2x) + 1 / (sin 4x) + ... + 1 / (sin 2βΏx) = cot x - cot 2βΏ x.
-/
theorem imo1966_p4 (n : β) (x : β)
(hx : β t : β, β k : β€, x β k * Real.pi / 2^t) :
β i β Finset.range n, 1 / Real.sin (2^(i + 1) * x) =
Real.cot x - Real.cot (2^n * x) := by sorry
|
algebra
|
Usa2003P1
| true |
[
"number theory"
] |
Usa2003P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 2003, Problem 1
Prove that for every positive integer n there exists an n-digit
number divisible by 5βΏ, all of whose digits are odd.
-/
|
theorem usa2003_p1 (n : β) :
β m, (Nat.digits 10 m).length = n β§
5^n β£ m β§ (Nat.digits 10 m).all (Odd Β·) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 2003, Problem 1
Prove that for every positive integer n there exists an n-digit
number divisible by 5βΏ, all of whose digits are odd.
-/
theorem usa2003_p1 (n : β) :
β m, (Nat.digits 10 m).length = n β§
5^n β£ m β§ (Nat.digits 10 m).all (Odd Β·) := by sorry
|
number theory
|
Imo2023P2
| false |
[
"geometry"
] |
Imo2023P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2023, Problem 2
Let ABC be an acute-angled triangle with AB < AC.
Let Ξ© be the circumcircle of ABC.
Let S be the midpoint of the arc CB of Ξ© containing A.
The perpendicular from A to BC meets BS at D and meets Ξ© again at E β A.
The line through D parallel to BC meets line BE at L.
Denote the circumcircle of triangle BDL by Ο.
Let Ο meet Ξ© again at P β B.
Prove that the line tangent to Ο at P meets line BS on the internal angle bisector of β BAC.
-/
|
/- special open -/ open Affine EuclideanGeometry FiniteDimensional InnerProductSpace Module Simplex
attribute [local instance] FiniteDimensional.of_fact_finrank_eq_two
variable (V : Type*) (Pt : Type*)
variable [NormedAddCommGroup V] [InnerProductSpace β V] [MetricSpace Pt]
variable [NormedAddTorsor V Pt] [hd2 : Fact (finrank β V = 2)]
variable [Module.Oriented β V (Fin 2)]
def acute (A B C : Pt) : Prop :=
β A B C < Real.pi / 2 β§ β B C A < Real.pi / 2 β§ β C A B < Real.pi / 2
def perp_to (l : AffineSubspace β Pt) (m : AffineSubspace β Pt) : Prop :=
β x β l.direction, β y β m.direction, βͺx, yβ«_β = 0
/-- A space is tangent to a sphere if it intersects it at exactly one point -/
def is_tangent (L : AffineSubspace β Pt) (Ο : Sphere Pt) : Prop :=
β! P : Pt, P β (Ο : Set Pt) β§ P β L
theorem imo2023_p1
-- Points
( A B C D E L S P : Pt )
-- Circles
( Ξ© Ο : Sphere Pt )
-- Lines
( perp_A_BC prll_D_BC tang_P_Ο : AffineSubspace β Pt )
-- Let ABC be an acute-angled triangle
( h_acute_ABC : acute V Pt A B C )
-- with AB < AC.
( h_AB_lt_BC : dist A B < dist A C )
-- Let Ξ© be the circumcircle of ABC.
( h_Ξ© : {A, B, C} β (Ξ© : Set Pt) )
-- Let S be the midpoint of the arc CB of Ξ©
( h_S_Ξ© : dist S C = dist S B β§ S β (Ξ© : Set Pt))
-- ... containing A.
(h_S_A : (β‘ C B S).sign = (β‘ C B A).sign)
-- The perpendicular from A to BC ...
(h_perp_A_BC : perp_to V Pt perp_A_BC (affineSpan β {B, C}) β§ A β perp_A_BC)
-- ... meets BS at D
( h_D : D β (perp_A_BC : Set Pt) β© (affineSpan β {B, S}) )
-- ... and meets Ξ© again at E ...
( h_E : E β (perp_A_BC : Set Pt) β© Ξ© )
-- ... E β A.
( h_E_ne_A : E β A )
-- The line through D parallel to BC ...
( h_prll_D_BC : D β prll_D_BC β§ AffineSubspace.Parallel prll_D_BC (affineSpan β {B, C}))
--- ... meets line BE at L.
( h_L : L β (prll_D_BC : Set Pt) β© affineSpan β {B, E} )
-- Denote the circumcircle of triangle BDL by Ο.
( h_Ο : {B, D, L} β (Ο : Set Pt) )
-- Let Ο meet Ξ© again at P ...
( h_P : P β (Ο : Set Pt) β© Ξ© )
-- P β B.
( h_P_ne_B : P β B )
-- Prove that the line tangent to Ο at P ...
( h_tang_P_Ο : is_tangent V Pt tang_P_Ο Ο β§ P β tang_P_Ο) :
-- meets line BS on the internal angle bisector of β BAC.
β X : Pt,
X β (tang_P_Ο : Set Pt) β© affineSpan β {B, S}
β§ β B A X = β X A C
β§ β B A X < Real.pi / 2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2023, Problem 2
Let ABC be an acute-angled triangle with AB < AC.
Let Ξ© be the circumcircle of ABC.
Let S be the midpoint of the arc CB of Ξ© containing A.
The perpendicular from A to BC meets BS at D and meets Ξ© again at E β A.
The line through D parallel to BC meets line BE at L.
Denote the circumcircle of triangle BDL by Ο.
Let Ο meet Ξ© again at P β B.
Prove that the line tangent to Ο at P meets line BS on the internal angle bisector of β BAC.
-/
/- special open -/ open Affine EuclideanGeometry FiniteDimensional InnerProductSpace Module Simplex
attribute [local instance] FiniteDimensional.of_fact_finrank_eq_two
variable (V : Type*) (Pt : Type*)
variable [NormedAddCommGroup V] [InnerProductSpace β V] [MetricSpace Pt]
variable [NormedAddTorsor V Pt] [hd2 : Fact (finrank β V = 2)]
variable [Module.Oriented β V (Fin 2)]
def acute (A B C : Pt) : Prop :=
β A B C < Real.pi / 2 β§ β B C A < Real.pi / 2 β§ β C A B < Real.pi / 2
def perp_to (l : AffineSubspace β Pt) (m : AffineSubspace β Pt) : Prop :=
β x β l.direction, β y β m.direction, βͺx, yβ«_β = 0
/-- A space is tangent to a sphere if it intersects it at exactly one point -/
def is_tangent (L : AffineSubspace β Pt) (Ο : Sphere Pt) : Prop :=
β! P : Pt, P β (Ο : Set Pt) β§ P β L
theorem imo2023_p1
-- Points
( A B C D E L S P : Pt )
-- Circles
( Ξ© Ο : Sphere Pt )
-- Lines
( perp_A_BC prll_D_BC tang_P_Ο : AffineSubspace β Pt )
-- Let ABC be an acute-angled triangle
( h_acute_ABC : acute V Pt A B C )
-- with AB < AC.
( h_AB_lt_BC : dist A B < dist A C )
-- Let Ξ© be the circumcircle of ABC.
( h_Ξ© : {A, B, C} β (Ξ© : Set Pt) )
-- Let S be the midpoint of the arc CB of Ξ©
( h_S_Ξ© : dist S C = dist S B β§ S β (Ξ© : Set Pt))
-- ... containing A.
(h_S_A : (β‘ C B S).sign = (β‘ C B A).sign)
-- The perpendicular from A to BC ...
(h_perp_A_BC : perp_to V Pt perp_A_BC (affineSpan β {B, C}) β§ A β perp_A_BC)
-- ... meets BS at D
( h_D : D β (perp_A_BC : Set Pt) β© (affineSpan β {B, S}) )
-- ... and meets Ξ© again at E ...
( h_E : E β (perp_A_BC : Set Pt) β© Ξ© )
-- ... E β A.
( h_E_ne_A : E β A )
-- The line through D parallel to BC ...
( h_prll_D_BC : D β prll_D_BC β§ AffineSubspace.Parallel prll_D_BC (affineSpan β {B, C}))
--- ... meets line BE at L.
( h_L : L β (prll_D_BC : Set Pt) β© affineSpan β {B, E} )
-- Denote the circumcircle of triangle BDL by Ο.
( h_Ο : {B, D, L} β (Ο : Set Pt) )
-- Let Ο meet Ξ© again at P ...
( h_P : P β (Ο : Set Pt) β© Ξ© )
-- P β B.
( h_P_ne_B : P β B )
-- Prove that the line tangent to Ο at P ...
( h_tang_P_Ο : is_tangent V Pt tang_P_Ο Ο β§ P β tang_P_Ο) :
-- meets line BS on the internal angle bisector of β BAC.
β X : Pt,
X β (tang_P_Ο : Set Pt) β© affineSpan β {B, S}
β§ β B A X = β X A C
β§ β B A X < Real.pi / 2 := by sorry
|
geometry
|
Imo2005P3
| true |
[
"algebra"
] |
Imo2005P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2005, Problem 3
Let `x`, `y` and `z` be positive real numbers such that `xyz β₯ 1`. Prove that:
`(x^5 - x^2)/(x^5 + y^2 + z^2) + (y^5 - y^2)/(y^5 + z^2 + x^2) + (z^5 - z^2)/(z^5 + x^2 + y^2) β₯ 0`
-/
|
theorem imo2005_p3 (x y z : β) (hx : x > 0) (hy : y > 0) (hz : z > 0) (h : x * y * z β₯ 1) :
(x ^ 5 - x ^ 2) / (x ^ 5 + y ^ 2 + z ^ 2) + (y ^ 5 - y ^ 2) / (y ^ 5 + z ^ 2 + x ^ 2) +
(z ^ 5 - z ^ 2) / (z ^ 5 + x ^ 2 + y ^ 2) β₯
0 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2005, Problem 3
Let `x`, `y` and `z` be positive real numbers such that `xyz β₯ 1`. Prove that:
`(x^5 - x^2)/(x^5 + y^2 + z^2) + (y^5 - y^2)/(y^5 + z^2 + x^2) + (z^5 - z^2)/(z^5 + x^2 + y^2) β₯ 0`
-/
theorem imo2005_p3 (x y z : β) (hx : x > 0) (hy : y > 0) (hz : z > 0) (h : x * y * z β₯ 1) :
(x ^ 5 - x ^ 2) / (x ^ 5 + y ^ 2 + z ^ 2) + (y ^ 5 - y ^ 2) / (y ^ 5 + z ^ 2 + x ^ 2) +
(z ^ 5 - z ^ 2) / (z ^ 5 + x ^ 2 + y ^ 2) β₯
0 := by sorry
|
algebra
|
KolmogorovStreams
| true |
[
"combinatorics"
] |
KolmogorovStreams
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
Puzzle referenced from this tweet: https://twitter.com/sigfpe/status/1474173467016589323
From the book _Out of their Minds: The Lives and Discoveries of 15 Great Computer Scientists_
by Dennis Shasha and Cathy Lazere.
Problem: Suppose each (finite) word is either "decent" or "indecent". Given an infinite
sequence of characters, can you always break it into finite words so that all of them
except perhaps the first one belong to the same class?
-/
|
/- special open -/ open Stream
variable {Ξ± : Type}
def break_into_words :
(Stream' β) β -- word lengths
(Stream' Ξ±) β -- original sequence
(Stream' (List Ξ±)) -- sequence of words
:= Function.curry
(Stream'.corec
(Ξ» β¨lengths, a'β© β¦ a'.take lengths.head)
(Ξ» β¨lengths, a'β© β¦ β¨lengths.tail, a'.drop lengths.headβ©))
def all_same_class
(is_decent : List Ξ± β Prop)
(b : Stream' (List Ξ±))
: Prop :=
b.All is_decent β¨ b.All (Ξ» w β¦ Β¬is_decent w)
theorem kolmogorov_streams
(is_decent : List Ξ± β Prop)
(a : Stream' Ξ±)
: (β (lengths : Stream' β),
(lengths.All (0 < Β·) β§
all_same_class is_decent (break_into_words lengths a).tail)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
Puzzle referenced from this tweet: https://twitter.com/sigfpe/status/1474173467016589323
From the book _Out of their Minds: The Lives and Discoveries of 15 Great Computer Scientists_
by Dennis Shasha and Cathy Lazere.
Problem: Suppose each (finite) word is either "decent" or "indecent". Given an infinite
sequence of characters, can you always break it into finite words so that all of them
except perhaps the first one belong to the same class?
-/
/- special open -/ open Stream
variable {Ξ± : Type}
def break_into_words :
(Stream' β) β -- word lengths
(Stream' Ξ±) β -- original sequence
(Stream' (List Ξ±)) -- sequence of words
:= Function.curry
(Stream'.corec
(Ξ» β¨lengths, a'β© β¦ a'.take lengths.head)
(Ξ» β¨lengths, a'β© β¦ β¨lengths.tail, a'.drop lengths.headβ©))
def all_same_class
(is_decent : List Ξ± β Prop)
(b : Stream' (List Ξ±))
: Prop :=
b.All is_decent β¨ b.All (Ξ» w β¦ Β¬is_decent w)
theorem kolmogorov_streams
(is_decent : List Ξ± β Prop)
(a : Stream' Ξ±)
: (β (lengths : Stream' β),
(lengths.All (0 < Β·) β§
all_same_class is_decent (break_into_words lengths a).tail)) := by sorry
|
combinatorics
|
ZeroesOnesAndTwos2
| false |
[] |
ZeroesOnesAndTwos2
|
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
(b) 2^n has a multiple whose representation contains only ones and twos.
-/
|
theorem ones_and_twos
(n : β) : β k : β+, β e β Nat.digits 10 (2^n * k), e = 1 β¨ e = 2 := 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
(b) 2^n has a multiple whose representation contains only ones and twos.
-/
theorem ones_and_twos
(n : β) : β k : β+, β e β Nat.digits 10 (2^n * k), e = 1 β¨ e = 2 := by sorry
|
number theory
|
Imo1959P2a
| true |
[
"algebra"
] |
Imo1959P2a
|
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_sqrt2 : Set β := Icc (1 / 2) 1
theorem imo1959_p2a : IsGood x (Real.sqrt 2) β x β solution_set_sqrt2 := 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_sqrt2 : Set β := Icc (1 / 2) 1
theorem imo1959_p2a : IsGood x (Real.sqrt 2) β x β solution_set_sqrt2 := by sorry
|
algebra
|
Imo1968P5b
| true |
[
"algebra"
] |
Imo1968P5b
|
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.
(b) For a = 1, give an example of a non-constant function with the required properties.
-/
|
abbrev P (a : β) (f : β β β) : Prop :=
0 < a β§
β x, (f x)^2 β€ f x β§ f (x + a) = 1/2 + β(f x - (f x)^2)
noncomputable abbrev solution_func : β β β := fun x β¦
if Even βxβ then 1 else 1/2
theorem imo1968_p5b :
P 1 solution_func β§ Β¬βc, solution_func = Function.const β c := 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.
(b) For a = 1, give an example of a non-constant function with the required properties.
-/
abbrev P (a : β) (f : β β β) : Prop :=
0 < a β§
β x, (f x)^2 β€ f x β§ f (x + a) = 1/2 + β(f x - (f x)^2)
noncomputable abbrev solution_func : β β β := fun x β¦
if Even βxβ then 1 else 1/2
theorem imo1968_p5b :
P 1 solution_func β§ Β¬βc, solution_func = Function.const β c := by sorry
|
algebra
|
Usa1998P4
| false |
[
"combinatorics"
] |
Usa1998P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1998, Problem 4
A computer screen shows a 98 Γ 98 chessboard, colored in the usual way.
One can select with a mouse any rectangle with sides on the lines of the
chessboard and click the mouse button: as a result, the colors in the
selected rectangle switch (black becomes white, white becomes black).
Find, with proof, the minimum number of mouse clicks needed to make the
chessboard all one color.
-/
|
def chessboard : Type := Fin 98 Γ Fin 98
def coloring := chessboard β ZMod 2
def all_same_color (f : coloring) : Prop :=
β c : ZMod 2, β s : chessboard, f s = c
structure Rectangle where
x : β
y : β
width : β
height : β
def recolor_rect (f : coloring) (r : Rectangle) : coloring :=
fun β¨x, yβ© β¦ if r.x β€ x.val β§
r.y β€ y.val β§
x.val < r.x + r.width β§
y.val < r.y + r.height
then
f β¨x, yβ© + 1
else
f β¨x, yβ©
def start_coloring : coloring := fun β¨x, yβ© β¦ x.val + y.val
def possible_num_clicks : Set β :=
{ n : β | β rs : List Rectangle,
(all_same_color (rs.foldl recolor_rect start_coloring) β§
rs.length = n) }
abbrev min_clicks : β := 98
theorem usa1998_p4 : IsLeast possible_num_clicks min_clicks := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1998, Problem 4
A computer screen shows a 98 Γ 98 chessboard, colored in the usual way.
One can select with a mouse any rectangle with sides on the lines of the
chessboard and click the mouse button: as a result, the colors in the
selected rectangle switch (black becomes white, white becomes black).
Find, with proof, the minimum number of mouse clicks needed to make the
chessboard all one color.
-/
def chessboard : Type := Fin 98 Γ Fin 98
def coloring := chessboard β ZMod 2
def all_same_color (f : coloring) : Prop :=
β c : ZMod 2, β s : chessboard, f s = c
structure Rectangle where
x : β
y : β
width : β
height : β
def recolor_rect (f : coloring) (r : Rectangle) : coloring :=
fun β¨x, yβ© β¦ if r.x β€ x.val β§
r.y β€ y.val β§
x.val < r.x + r.width β§
y.val < r.y + r.height
then
f β¨x, yβ© + 1
else
f β¨x, yβ©
def start_coloring : coloring := fun β¨x, yβ© β¦ x.val + y.val
def possible_num_clicks : Set β :=
{ n : β | β rs : List Rectangle,
(all_same_color (rs.foldl recolor_rect start_coloring) β§
rs.length = n) }
abbrev min_clicks : β := 98
theorem usa1998_p4 : IsLeast possible_num_clicks min_clicks := by sorry
|
combinatorics
|
Imo1997P5
| true |
[
"number theory"
] |
Imo1997P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1997, Problem 5
Determine all pairs of integers 1 β€ a,b that satisfy a ^ (b ^ 2) = b ^ a.
-/
|
abbrev solution_set : Set (β Γ β) := {(1, 1), (16, 2), (27, 3)}
theorem imo1997_p5 (a b : β) (ha : 1 β€ a) (hb : 1 β€ b) :
β¨a,bβ© β solution_set β a ^ (b ^ 2) = b ^ a := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1997, Problem 5
Determine all pairs of integers 1 β€ a,b that satisfy a ^ (b ^ 2) = b ^ a.
-/
abbrev solution_set : Set (β Γ β) := {(1, 1), (16, 2), (27, 3)}
theorem imo1997_p5 (a b : β) (ha : 1 β€ a) (hb : 1 β€ b) :
β¨a,bβ© β solution_set β a ^ (b ^ 2) = b ^ a := by sorry
|
number theory
|
Imo1984P1
| true |
[
"algebra"
] |
Imo1984P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1984, Problem 1
Let $x$, $y$, $z$ be nonnegative real numbers with $x + y + z = 1$.
Show that $0 \leq xy+yz+zx-2xyz \leq \frac{7}{27}$
-/
|
theorem imo1984_p1 (x y z : β)
(hβ : 0 β€ x β§ 0 β€ y β§ 0 β€ z)
(hβ : x + y + z = 1) :
0 β€ x * y + y * z + z * x - 2 * x * y * z β§ x * y + y * z + z * x - 2 * x * y * z β€
(7:β) / 27 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1984, Problem 1
Let $x$, $y$, $z$ be nonnegative real numbers with $x + y + z = 1$.
Show that $0 \leq xy+yz+zx-2xyz \leq \frac{7}{27}$
-/
theorem imo1984_p1 (x y z : β)
(hβ : 0 β€ x β§ 0 β€ y β§ 0 β€ z)
(hβ : x + y + z = 1) :
0 β€ x * y + y * z + z * x - 2 * x * y * z β§ x * y + y * z + z * x - 2 * x * y * z β€
(7:β) / 27 := by sorry
|
algebra
|
Imo1989P5
| true |
[
"number theory"
] |
Imo1989P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1989, Problem 5
Prove that for each positive integer n there exist n consecutive positive
integers, none of which is an integral power of a prime number.
-/
|
theorem imo1989_p5 (n : β) : β m, β j < n, Β¬IsPrimePow (m + j) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1989, Problem 5
Prove that for each positive integer n there exist n consecutive positive
integers, none of which is an integral power of a prime number.
-/
theorem imo1989_p5 (n : β) : β m, β j < n, Β¬IsPrimePow (m + j) := by sorry
|
number theory
|
Imo1987P4
| true |
[
"algebra"
] |
Imo1987P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1987, Problem 4
Prove that there is no function f : β β β such that f(f(n)) = n + 1987
for every n.
-/
|
theorem imo1987_p4 : Β¬β f : β β β, β n, f (f n) = n + 1987 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1987, Problem 4
Prove that there is no function f : β β β such that f(f(n)) = n + 1987
for every n.
-/
theorem imo1987_p4 : Β¬β f : β β β, β n, f (f n) = n + 1987 := by sorry
|
algebra
|
Imo1999P4
| false |
[
"number theory"
] |
Imo1999P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1999, Problem 4
Determine all pairs of positive integers (x,p) such that p is
a prime and xα΅β»ΒΉ is a divisor of (p-1)Λ£ + 1.
-/
|
abbrev SolutionSet : Set (β Γ β) :=
{β¨x, pβ© | (x = 1 β§ Nat.Prime p) β¨ (x = 2 β§ p = 2) β¨ (x = 3 β§ p = 3)}
theorem imo1999_p4 (x p : β) :
β¨x,pβ© β SolutionSet β
0 < x β§ p.Prime β§ x^(p - 1) β£ (p - 1)^x + 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1999, Problem 4
Determine all pairs of positive integers (x,p) such that p is
a prime and xα΅β»ΒΉ is a divisor of (p-1)Λ£ + 1.
-/
abbrev SolutionSet : Set (β Γ β) :=
{β¨x, pβ© | (x = 1 β§ Nat.Prime p) β¨ (x = 2 β§ p = 2) β¨ (x = 3 β§ p = 3)}
theorem imo1999_p4 (x p : β) :
β¨x,pβ© β SolutionSet β
0 < x β§ p.Prime β§ x^(p - 1) β£ (p - 1)^x + 1 := by sorry
|
number theory
|
Usa1985P1
| true |
[
"algebra"
] |
Usa1985P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1985, Problem 1
Determine whether or not there are any positive integral solutions of
the simultaneous equations
xβΒ² + xβΒ² + β― + xββββ
Β² = yΒ³
xβΒ³ + xβΒ³ + β― + xββββ
Β³ = zΒ²
with distinct integers xβ, xβ, β―, xββββ
.
-/
|
abbrev does_exist : Bool := true
abbrev is_valid (x : β β β€) (y z : β€) : Prop :=
(β i β Finset.range 1985, 0 < x i) β§
0 < y β§ 0 < z β§
β i β Finset.range 1985, x i ^ 2 = y ^ 3 β§
β i β Finset.range 1985, x i ^ 3 = z ^ 2 β§
β i β Finset.range 1985, β j β Finset.range 1985, i β j β x i β x j
theorem usa1985_p1 :
if does_exist
then β x y z, is_valid x y z
else Β¬ β x y z, is_valid x y z := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1985, Problem 1
Determine whether or not there are any positive integral solutions of
the simultaneous equations
xβΒ² + xβΒ² + β― + xββββ
Β² = yΒ³
xβΒ³ + xβΒ³ + β― + xββββ
Β³ = zΒ²
with distinct integers xβ, xβ, β―, xββββ
.
-/
abbrev does_exist : Bool := true
abbrev is_valid (x : β β β€) (y z : β€) : Prop :=
(β i β Finset.range 1985, 0 < x i) β§
0 < y β§ 0 < z β§
β i β Finset.range 1985, x i ^ 2 = y ^ 3 β§
β i β Finset.range 1985, x i ^ 3 = z ^ 2 β§
β i β Finset.range 1985, β j β Finset.range 1985, i β j β x i β x j
theorem usa1985_p1 :
if does_exist
then β x y z, is_valid x y z
else Β¬ β x y z, is_valid x y z := by sorry
|
algebra
|
Imo1995P4
| false |
[
"algebra"
] |
Imo1995P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1995, Problem 4
The positive real numbers $x_0, x_1, x_2,.....x_{1994}, x_{1995}$ satisfy the relations
$x_0=x_{1995}$ and $x_{i-1}+\frac{2}{x_{i-1}}=2{x_i}+\frac{1}{x_i}$
for $i=1,2,3,....1995$
Find the maximum value that $x_0$ can have.
-/
|
abbrev solution : β := 2^997
theorem imo1995_p4
(x : β β β)
(h : x 0 = x 1995)
(h1 : β i : β, 0 < i β§ i β€ 1995 β x (i - 1) + (2 / x (i - 1)) = 2 * x i + (1 / x i)) :
x 0 β€ solution β§
(β x : β β β, x 0 = solution β§
x 0 = x 1995 β§
β i : β, 0 < i β§ i β€ 1995 β x (i - 1) + (2 / x (i - 1)) = 2 * x i + (1 / x i)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1995, Problem 4
The positive real numbers $x_0, x_1, x_2,.....x_{1994}, x_{1995}$ satisfy the relations
$x_0=x_{1995}$ and $x_{i-1}+\frac{2}{x_{i-1}}=2{x_i}+\frac{1}{x_i}$
for $i=1,2,3,....1995$
Find the maximum value that $x_0$ can have.
-/
abbrev solution : β := 2^997
theorem imo1995_p4
(x : β β β)
(h : x 0 = x 1995)
(h1 : β i : β, 0 < i β§ i β€ 1995 β x (i - 1) + (2 / x (i - 1)) = 2 * x i + (1 / x i)) :
x 0 β€ solution β§
(β x : β β β, x 0 = solution β§
x 0 = x 1995 β§
β i : β, 0 < i β§ i β€ 1995 β x (i - 1) + (2 / x (i - 1)) = 2 * x i + (1 / x i)) := by sorry
|
algebra
|
Usa1992P2
| true |
[
"algebra"
] |
Usa1992P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1992, Problem 2
Prove that
1 / cos 0Β° / cos 1Β° + 1 / cos 1Β° / cos 2Β° + ... + 1 / cos 88Β° / cos 99Β° = cos 1Β° / sinΒ² 1Β°
-/
|
theorem usa1992_p2 :
β i β Finset.range 89, 1 / Real.cos (i * Real.pi / 180) / Real.cos ((i + 1) * Real.pi / 180) =
Real.cos (Real.pi / 180) / Real.sin (Real.pi / 180) ^ 2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1992, Problem 2
Prove that
1 / cos 0Β° / cos 1Β° + 1 / cos 1Β° / cos 2Β° + ... + 1 / cos 88Β° / cos 99Β° = cos 1Β° / sinΒ² 1Β°
-/
theorem usa1992_p2 :
β i β Finset.range 89, 1 / Real.cos (i * Real.pi / 180) / Real.cos ((i + 1) * Real.pi / 180) =
Real.cos (Real.pi / 180) / Real.sin (Real.pi / 180) ^ 2 := by sorry
|
algebra
|
Imo2001P3
| true |
[
"combinatorics"
] |
Imo2001P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2001, Problem 3
Twenty-one girls and twenty-one boys took part in a mathematical competition.
It turned out that each contestant solved at most six problems, and for each
pair of a girl and a boy, there was at most one problem solved by both the
girl and the boy. Show that there was a problem solved by at least three
girls and at least three boys.
-/
|
/- special open -/ open Finset
/-- A problem is easy for a cohort (boys or girls) if at least three
of its members solved it. -/
def Easy {Ξ± : Type} [Fintype Ξ±] (F : Ξ± β Finset β) (p : β) : Prop :=
3 β€ Finset.card (filter (Ξ» i => p β F i) (univ : Finset Ξ±))
theorem imo2001_p3
{Girl Boy : Type}
[Fintype Girl] [Fintype Boy] [DecidableEq Girl] [DecidableEq Boy]
{G : Girl β Finset β} {B : Boy β Finset β} -- solved problems
(hcard_girl : 21 = Fintype.card Girl)
(hcard_boy : 21 = Fintype.card Boy)
(G_le_6 : β i, Finset.card (G i) β€ 6) -- Every girl solved at most six problems.
(B_le_6 : β j, Finset.card (B j) β€ 6) -- Every boy solved at most six problems.
(G_inter_B : β i j, Β¬Disjoint (G i) (B j)) :
β p, Easy G p β§ Easy B p := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2001, Problem 3
Twenty-one girls and twenty-one boys took part in a mathematical competition.
It turned out that each contestant solved at most six problems, and for each
pair of a girl and a boy, there was at most one problem solved by both the
girl and the boy. Show that there was a problem solved by at least three
girls and at least three boys.
-/
/- special open -/ open Finset
/-- A problem is easy for a cohort (boys or girls) if at least three
of its members solved it. -/
def Easy {Ξ± : Type} [Fintype Ξ±] (F : Ξ± β Finset β) (p : β) : Prop :=
3 β€ Finset.card (filter (Ξ» i => p β F i) (univ : Finset Ξ±))
theorem imo2001_p3
{Girl Boy : Type}
[Fintype Girl] [Fintype Boy] [DecidableEq Girl] [DecidableEq Boy]
{G : Girl β Finset β} {B : Boy β Finset β} -- solved problems
(hcard_girl : 21 = Fintype.card Girl)
(hcard_boy : 21 = Fintype.card Boy)
(G_le_6 : β i, Finset.card (G i) β€ 6) -- Every girl solved at most six problems.
(B_le_6 : β j, Finset.card (B j) β€ 6) -- Every boy solved at most six problems.
(G_inter_B : β i j, Β¬Disjoint (G i) (B j)) :
β p, Easy G p β§ Easy B p := by sorry
|
combinatorics
|
Imo1974P3
| true |
[
"number theory"
] |
Imo1974P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1974, Problem 3
Prove that the sum from k = 0 to n inclusive of
Choose[2n + 1, 2k + 1] * 2Β³α΅
is not divisible by 5 for any integer n β₯ 0.
-/
|
theorem imo1974_p3
(n : β) :
Β¬ 5 β£ β k β Finset.range (n + 1),
(Nat.choose (2 * n + 1) (2 * k + 1)) * (2^(3 * k)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1974, Problem 3
Prove that the sum from k = 0 to n inclusive of
Choose[2n + 1, 2k + 1] * 2Β³α΅
is not divisible by 5 for any integer n β₯ 0.
-/
theorem imo1974_p3
(n : β) :
Β¬ 5 β£ β k β Finset.range (n + 1),
(Nat.choose (2 * n + 1) (2 * k + 1)) * (2^(3 * k)) := by sorry
|
number theory
|
Imo2005P4
| true |
[
"number theory"
] |
Imo2005P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# Intertional Mathematical Olympiad 2005, Problem 4
Determine all positive integers relatively prime to all the terms of the infinite sequence
`a n = 2 ^ n + 3 ^ n + 6 ^ n - 1`, for `n β₯ 1`.
-/
|
def a (n : β) : β€ := 2 ^ n + 3 ^ n + 6 ^ n - 1
abbrev SolutionSet : Set β+ := { 1 }
theorem imo2005_p4 {k : β} (hk : 0 < k) :
(β n : β, 1 β€ n β IsCoprime (a n) k) β β¨k, hkβ© β SolutionSet := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# Intertional Mathematical Olympiad 2005, Problem 4
Determine all positive integers relatively prime to all the terms of the infinite sequence
`a n = 2 ^ n + 3 ^ n + 6 ^ n - 1`, for `n β₯ 1`.
-/
def a (n : β) : β€ := 2 ^ n + 3 ^ n + 6 ^ n - 1
abbrev SolutionSet : Set β+ := { 1 }
theorem imo2005_p4 {k : β} (hk : 0 < k) :
(β n : β, 1 β€ n β IsCoprime (a n) k) β β¨k, hkβ© β SolutionSet := by sorry
|
number theory
|
Usa2015P1
| true |
[
"number theory"
] |
Usa2015P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 2015, Problem 1
Solve in integers the equation xΒ² + xy + yΒ² = ((x + y) / 3 + 1)Β³.
-/
|
abbrev SolutionSet : Set (β€ Γ β€) :=
{β¨x, yβ© | β n, x = n ^ 3 + 3 * n ^ 2 - 1 β§ y = -n ^ 3 + 3 * n + 1} βͺ
{β¨x, yβ© | β n, y = n ^ 3 + 3 * n ^ 2 - 1 β§ x = -n ^ 3 + 3 * n + 1}
theorem usa2015_p1 (x y : β€) :
β¨x, yβ© β SolutionSet β
x^2 + x * y + y^2 = ((x + y) / (3 : β) + 1)^3 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 2015, Problem 1
Solve in integers the equation xΒ² + xy + yΒ² = ((x + y) / 3 + 1)Β³.
-/
abbrev SolutionSet : Set (β€ Γ β€) :=
{β¨x, yβ© | β n, x = n ^ 3 + 3 * n ^ 2 - 1 β§ y = -n ^ 3 + 3 * n + 1} βͺ
{β¨x, yβ© | β n, y = n ^ 3 + 3 * n ^ 2 - 1 β§ x = -n ^ 3 + 3 * n + 1}
theorem usa2015_p1 (x y : β€) :
β¨x, yβ© β SolutionSet β
x^2 + x * y + y^2 = ((x + y) / (3 : β) + 1)^3 := by sorry
|
number theory
|
Imo2023P5
| false |
[
"combinatorics"
] |
Imo2023P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2023, Problem 5
Let n be a positive integer. A _Japanese triangle_ is defined as
a set of 1 + 2 + ... + n dots arranged as an equilateral
triangle. Each dot is colored white or red, such that each row
has exactly one red dot.
A _ninja path_ is a sequence of n dots obtained by starting in the
top row (which has length 1), and then at each step going to one of
the dot immediately below the current dot, until the bottom
row is reached.
In terms of n, determine the greatest k such that in each Japanese triangle
there is a ninja path containing at least k red dots.
-/
|
structure JapaneseTriangle (n : β) where
red : (i : Finset.Icc 1 n) β Fin i.val
def next_row {n} (i : Finset.Icc 1 n) (h : i.val + 1 β€ n) : Finset.Icc 1 n :=
β¨i.val + 1, by aesopβ©
structure NinjaPath (n : β) where
steps : (i : Finset.Icc 1 n) β Fin i.val
steps_valid : β i : Finset.Icc 1 n, (h : i.val + 1 β€ n) β
((steps i).val = steps (next_row i h) β¨
(steps i).val + 1 = steps (next_row i h))
noncomputable abbrev solution_value (n : β) : β := Nat.floor (Real.log n / Real.log 2) + 1
theorem imo2023_p5 (n : β) :
IsGreatest {k | β j : JapaneseTriangle n,
β p : NinjaPath n,
k β€ Fintype.card {i // j.red i = p.steps i}}
(solution_value n) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2023, Problem 5
Let n be a positive integer. A _Japanese triangle_ is defined as
a set of 1 + 2 + ... + n dots arranged as an equilateral
triangle. Each dot is colored white or red, such that each row
has exactly one red dot.
A _ninja path_ is a sequence of n dots obtained by starting in the
top row (which has length 1), and then at each step going to one of
the dot immediately below the current dot, until the bottom
row is reached.
In terms of n, determine the greatest k such that in each Japanese triangle
there is a ninja path containing at least k red dots.
-/
structure JapaneseTriangle (n : β) where
red : (i : Finset.Icc 1 n) β Fin i.val
def next_row {n} (i : Finset.Icc 1 n) (h : i.val + 1 β€ n) : Finset.Icc 1 n :=
β¨i.val + 1, by aesopβ©
structure NinjaPath (n : β) where
steps : (i : Finset.Icc 1 n) β Fin i.val
steps_valid : β i : Finset.Icc 1 n, (h : i.val + 1 β€ n) β
((steps i).val = steps (next_row i h) β¨
(steps i).val + 1 = steps (next_row i h))
noncomputable abbrev solution_value (n : β) : β := Nat.floor (Real.log n / Real.log 2) + 1
theorem imo2023_p5 (n : β) :
IsGreatest {k | β j : JapaneseTriangle n,
β p : NinjaPath n,
k β€ Fintype.card {i // j.red i = p.steps i}}
(solution_value n) := by sorry
|
combinatorics
|
Imo1970P4
| true |
[
"number theory"
] |
Imo1970P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1970, Problem 4
Determine the set of all positive integers n with the property that
the set {n, n + 1, n + 2, n + 3, n + 4, n + 5} can be partitioned
into two sets such that the product of the numbers in one set
equals the product of the numbers in the other set.
-/
|
abbrev SolutionSet : Finset β+ := {}
theorem imo1970_p4 (n : β+):
n β SolutionSet β
β s1 s2 : Finset β,
s1 βͺ s2 = Finset.Icc n.val (n.val + 5) β§
s1 β© s2 = β
β§
β m β s1, m = β m β s2, m := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1970, Problem 4
Determine the set of all positive integers n with the property that
the set {n, n + 1, n + 2, n + 3, n + 4, n + 5} can be partitioned
into two sets such that the product of the numbers in one set
equals the product of the numbers in the other set.
-/
abbrev SolutionSet : Finset β+ := {}
theorem imo1970_p4 (n : β+):
n β SolutionSet β
β s1 s2 : Finset β,
s1 βͺ s2 = Finset.Icc n.val (n.val + 5) β§
s1 β© s2 = β
β§
β m β s1, m = β m β s2, m := by sorry
|
number theory
|
Usa2019P1
| true |
[
"algebra"
] |
Usa2019P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 2019, Problem 1
Let β+ be the set of positive integers.
A function f: β+ β β+ satisfies the equation
fαΆ β½βΏβΎ(n)β¬fΒ²(n) = n^2
for all positive integers n, where fα΅(m) means f iterated k times on m.
Given this information, determine all possible values of f(1000).
-/
|
abbrev solution_set : Set β+ := { x : β+ | Even x.val }
theorem usa2019_p1 (m : β+) :
m β solution_set β
(β f : β+ β β+,
(β n, f^[f n] n * f (f n) = n ^ 2) β§
m = f 1000) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 2019, Problem 1
Let β+ be the set of positive integers.
A function f: β+ β β+ satisfies the equation
fαΆ β½βΏβΎ(n)β¬fΒ²(n) = n^2
for all positive integers n, where fα΅(m) means f iterated k times on m.
Given this information, determine all possible values of f(1000).
-/
abbrev solution_set : Set β+ := { x : β+ | Even x.val }
theorem usa2019_p1 (m : β+) :
m β solution_set β
(β f : β+ β β+,
(β n, f^[f n] n * f (f n) = n ^ 2) β§
m = f 1000) := by sorry
|
algebra
|
Imo1962P4
| true |
[
"algebra"
] |
Imo1962P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematics Olympiad 1962, Problem 4
Solve the equation
cosΒ² x + cosΒ² (2 * x) + cosΒ² (3 * x) = 1.
-/
|
def ProblemEquation (x : β) : Prop :=
cos x ^ 2 + cos (2 * x) ^ 2 + cos (3 * x) ^ 2 = 1
abbrev solutionSet : Set β :=
{x : β | β k : β€, x = (2 * βk + 1) * Real.pi / 4 β¨ x = (2 * βk + 1) * Real.pi / 6}
theorem imo1962_p4 {x : β} : ProblemEquation x β x β solutionSet := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematics Olympiad 1962, Problem 4
Solve the equation
cosΒ² x + cosΒ² (2 * x) + cosΒ² (3 * x) = 1.
-/
def ProblemEquation (x : β) : Prop :=
cos x ^ 2 + cos (2 * x) ^ 2 + cos (3 * x) ^ 2 = 1
abbrev solutionSet : Set β :=
{x : β | β k : β€, x = (2 * βk + 1) * Real.pi / 4 β¨ x = (2 * βk + 1) * Real.pi / 6}
theorem imo1962_p4 {x : β} : ProblemEquation x β x β solutionSet := by sorry
|
algebra
|
Imo2003P2
| false |
[
"number theory"
] |
Imo2003P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2003, Problem 2
Determine all pairs of positive integers (a,b) such that
aΒ²/(2abΒ² - bΒ³ + 1)
is a positive integer.
-/
|
abbrev solution_set : Set (β€ Γ β€) :=
{p | β k : β€, 0 < k β§ (p = (2*k, 1) β¨ p = (k, 2*k) β¨ p = (8*k^4 - k, 2*k))}
theorem imo2003_p2 (a b : β€) :
(a,b) β solution_set β
0 < a β§ a < b β§
β c, 0 < c β§ c * (2 * a * b^2 - b^3 + 1) = a^2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2003, Problem 2
Determine all pairs of positive integers (a,b) such that
aΒ²/(2abΒ² - bΒ³ + 1)
is a positive integer.
-/
abbrev solution_set : Set (β€ Γ β€) :=
{p | β k : β€, 0 < k β§ (p = (2*k, 1) β¨ p = (k, 2*k) β¨ p = (8*k^4 - k, 2*k))}
theorem imo2003_p2 (a b : β€) :
(a,b) β solution_set β
0 < a β§ a < b β§
β c, 0 < c β§ c * (2 * a * b^2 - b^3 + 1) = a^2 := by sorry
|
number theory
|
Imo1968P2
| true |
[
"number theory"
] |
Imo1968P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1968, Problem 2
Determine the set of natural numbers x such that
the sum of the decimal digits of x is equal to xΒ² - 10x - 22.
-/
|
abbrev solution_set : Set β := { 12 }
theorem imo1968_p2 (x : β) :
x β solution_set β
x^2 = 10 * x + 22 + (Nat.digits 10 x).prod := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1968, Problem 2
Determine the set of natural numbers x such that
the sum of the decimal digits of x is equal to xΒ² - 10x - 22.
-/
abbrev solution_set : Set β := { 12 }
theorem imo1968_p2 (x : β) :
x β solution_set β
x^2 = 10 * x + 22 + (Nat.digits 10 x).prod := by sorry
|
number theory
|
Imo1972P5
| true |
[
"algebra"
] |
Imo1972P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1972, Problem 5
`f` and `g` are real-valued functions defined on the real line. For all `x` and `y`,
`f(x + y) + f(x - y) = 2f(x)g(y)`. `f` is not identically zero and `|f(x)| β€ 1` for all `x`.
Prove that `|g(x)| β€ 1` for all `x`.
-/
|
theorem imo1972_p5 (f g : β β β) (hf1 : β x, β y, f (x + y) + f (x - y) = 2 * f x * g y)
(hf2 : BddAbove (Set.range fun x => βf xβ)) (hf3 : β x, f x β 0) (y : β) : βg yβ β€ 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1972, Problem 5
`f` and `g` are real-valued functions defined on the real line. For all `x` and `y`,
`f(x + y) + f(x - y) = 2f(x)g(y)`. `f` is not identically zero and `|f(x)| β€ 1` for all `x`.
Prove that `|g(x)| β€ 1` for all `x`.
-/
theorem imo1972_p5 (f g : β β β) (hf1 : β x, β y, f (x + y) + f (x - y) = 2 * f x * g y)
(hf2 : BddAbove (Set.range fun x => βf xβ)) (hf3 : β x, f x β 0) (y : β) : βg yβ β€ 1 := by sorry
|
algebra
|
Imo2014P1
| true |
[
"algebra"
] |
Imo2014P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2014, Problem 1
Let aβ < aβ < aβ < ... an infinite sequence of positive integers.
Prove that there exists a unique integer n β₯ 1 such that
aβ < (aβ + aβ + ... + aβ)/n β€ aβββ.
-/
|
theorem imo2014_p1 (a : β β β€) (apos : β i, 0 < a i) (ha : β i, a i < a (i + 1)) :
β! n : β, 0 < n β§
n * a n < (β i β Finset.range (n + 1), a i) β§
(β i β Finset.range (n + 1), a i) β€ n * a (n + 1) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2014, Problem 1
Let aβ < aβ < aβ < ... an infinite sequence of positive integers.
Prove that there exists a unique integer n β₯ 1 such that
aβ < (aβ + aβ + ... + aβ)/n β€ aβββ.
-/
theorem imo2014_p1 (a : β β β€) (apos : β i, 0 < a i) (ha : β i, a i < a (i + 1)) :
β! n : β, 0 < n β§
n * a n < (β i β Finset.range (n + 1), a i) β§
(β i β Finset.range (n + 1), a i) β€ n * a (n + 1) := by sorry
|
algebra
|
Imo2007P5
| true |
[
"number theory"
] |
Imo2007P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2007, Problem 5
Let a and b be positive integers. Show that if 4ab - 1 divides (4aΒ² - 1)Β²
then a = b.
-/
|
theorem imo2007_p5 (a b : β€) (ha : 0 < a) (hb : 0 < b)
(hab : 4 * a * b - 1 β£ (4 * a^2 - 1)^2) : a = b := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2007, Problem 5
Let a and b be positive integers. Show that if 4ab - 1 divides (4aΒ² - 1)Β²
then a = b.
-/
theorem imo2007_p5 (a b : β€) (ha : 0 < a) (hb : 0 < b)
(hab : 4 * a * b - 1 β£ (4 * a^2 - 1)^2) : a = b := by sorry
|
number theory
|
Imo1977P6
| true |
[
"algebra"
] |
Imo1977P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1977, Problem 6
Suppose `f : β+ β β+` satisfies `f(f(n)) < f(n + 1)` for all `n`.
Prove that `f(n) = n` for all `n`.
-/
|
theorem imo1977_p6 (f : β+ β β+) (h : β n, f (f n) < f (n + 1)) : β n, f n = n := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1977, Problem 6
Suppose `f : β+ β β+` satisfies `f(f(n)) < f(n + 1)` for all `n`.
Prove that `f(n) = n` for all `n`.
-/
theorem imo1977_p6 (f : β+ β β+) (h : β n, f (f n) < f (n + 1)) : β n, f n = n := by sorry
|
algebra
|
Imo1964P2
| true |
[
"algebra",
"inequality"
] |
Imo1964P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1964, Problem 2
Suppose that a,b,c are the side lengths of a triangle. Prove that
aΒ²(b + c - a) + bΒ²(c + a - b) + cΒ²(a + b - c) β€ 3abc.
-/
|
theorem imo1964_p2
(T : Affine.Triangle β (EuclideanSpace β (Fin 2)))
(a b c : β)
(ha : a = dist (T.points 1) (T.points 2))
(hb : b = dist (T.points 2) (T.points 0))
(hc : c = dist (T.points 0) (T.points 1)) :
a^2 * (b + c - a) + b^2 * (c + a - b) + c^2 * (a + b - c) β€
3 * a * b * c := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1964, Problem 2
Suppose that a,b,c are the side lengths of a triangle. Prove that
aΒ²(b + c - a) + bΒ²(c + a - b) + cΒ²(a + b - c) β€ 3abc.
-/
theorem imo1964_p2
(T : Affine.Triangle β (EuclideanSpace β (Fin 2)))
(a b c : β)
(ha : a = dist (T.points 1) (T.points 2))
(hb : b = dist (T.points 2) (T.points 0))
(hc : c = dist (T.points 0) (T.points 1)) :
a^2 * (b + c - a) + b^2 * (c + a - b) + c^2 * (a + b - c) β€
3 * a * b * c := by sorry
|
algebra
|
Imo2015P5
| true |
[
"algebra"
] |
Imo2015P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2015, Problem 5
Determine all functions f : β β β that satisfy
f(x + f(x + y)) + f(xy) = x + f(x + y) + yf(x)
for all x,y.
-/
|
abbrev SolutionSet : Set (β β β) := { fun x β¦ x, fun x β¦ 2 - x }
theorem imo2015_p5 (f : β β β) :
f β SolutionSet β
β x y, f (x + f (x + y)) + f (x * y) = x + f (x + y) + y * f x := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2015, Problem 5
Determine all functions f : β β β that satisfy
f(x + f(x + y)) + f(xy) = x + f(x + y) + yf(x)
for all x,y.
-/
abbrev SolutionSet : Set (β β β) := { fun x β¦ x, fun x β¦ 2 - x }
theorem imo2015_p5 (f : β β β) :
f β SolutionSet β
β x y, f (x + f (x + y)) + f (x * y) = x + f (x + y) + y * f x := by sorry
|
algebra
|
Usa1993P1
| true |
[
"algebra"
] |
Usa1993P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1993, Problem 1
For each integer n β₯ 2, determine whether a or b is larger,
where a and b are positive real numbers satisfying
aβΏ = a + 1, bΒ²βΏ = b + 3a.
-/
|
abbrev a_is_larger : β β Bool := fun _ β¦ true
theorem usa1993_p1 (n : β) (hn : 2 β€ n) (a b : β) (ha : 0 < a) (hb : 0 < b)
(han : a^n = a + 1) (hbn : b^(2 * n) = b + 3 * a) :
if a_is_larger n then b < a else a < b := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1993, Problem 1
For each integer n β₯ 2, determine whether a or b is larger,
where a and b are positive real numbers satisfying
aβΏ = a + 1, bΒ²βΏ = b + 3a.
-/
abbrev a_is_larger : β β Bool := fun _ β¦ true
theorem usa1993_p1 (n : β) (hn : 2 β€ n) (a b : β) (ha : 0 < a) (hb : 0 < b)
(han : a^n = a + 1) (hbn : b^(2 * n) = b + 3 * a) :
if a_is_larger n then b < a else a < b := by sorry
|
algebra
|
Usa1980P5
| false |
[
"algebra",
"inequality"
] |
Usa1980P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1980, Problem 5
Let x,y,z be real numbers in the closed interval [0,1]. Show that
x/(y + z + 1) + y/(z + x + 1) + z/(x + y + 1) β€ 1 + (1 - x)(1 - y)(1 - z).
-/
|
theorem usa1980_p5 (x y z : β)
(hx : x β Set.Icc 0 1)
(hy : y β Set.Icc 0 1)
(hz : z β Set.Icc 0 1) :
x / (y + z + 1) + y / (z + x + 1) + z / (x + y + 1) β€
1 + (1 - x) * (1 - y) * (1 - z) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1980, Problem 5
Let x,y,z be real numbers in the closed interval [0,1]. Show that
x/(y + z + 1) + y/(z + x + 1) + z/(x + y + 1) β€ 1 + (1 - x)(1 - y)(1 - z).
-/
theorem usa1980_p5 (x y z : β)
(hx : x β Set.Icc 0 1)
(hy : y β Set.Icc 0 1)
(hz : z β Set.Icc 0 1) :
x / (y + z + 1) + y / (z + x + 1) + z / (x + y + 1) β€
1 + (1 - x) * (1 - y) * (1 - z) := by sorry
|
algebra
|
CIIM2022P6
| false |
[
"number theory"
] |
CIIM2022P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# Iberoamerican Interuniversity Mathematics Competition 2022, Problem 6
Given a positive integer m, let d(m) be the number of postive
divisors of m. Show that for every positive integer n, one
has
d((n + 1)!) β€ 2d(n!).
-/
|
def d : β β β
| m => (Nat.divisors m).card
theorem ciim2022_p6 (n : β) (hn : 0 < n) :
d (Nat.factorial (n + 1)) β€ 2 * d (Nat.factorial n) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# Iberoamerican Interuniversity Mathematics Competition 2022, Problem 6
Given a positive integer m, let d(m) be the number of postive
divisors of m. Show that for every positive integer n, one
has
d((n + 1)!) β€ 2d(n!).
-/
def d : β β β
| m => (Nat.divisors m).card
theorem ciim2022_p6 (n : β) (hn : 0 < n) :
d (Nat.factorial (n + 1)) β€ 2 * d (Nat.factorial n) := by sorry
|
number theory
|
Iran1998P3
| true |
[
"algebra"
] |
Iran1998P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# Iranian Mathematical Olympiad 1998, problem 3
Let xβ, xβ, xβ, xβ be positive real numbers such that
xβ β¬ xβ β¬ xβ β¬ xβ = 1.
Prove that
xβΒ³ + xβΒ³ + xβΒ³ + xβΒ³ β₯ max(xβ + xβ + xβ + xβ, 1/xβ + 1/xβ + 1/xβ + 1/xβ).
-/
|
theorem iran1998_p3
(x : β β β)
(x_positive : β i, 0 < x i)
(h : β i β Finset.range 4, x i = 1)
: max (β i β Finset.range 4, x i) (β i β Finset.range 4, 1 / x i)
β€ β i β Finset.range 4, (x i)^(3 : β) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# Iranian Mathematical Olympiad 1998, problem 3
Let xβ, xβ, xβ, xβ be positive real numbers such that
xβ β¬ xβ β¬ xβ β¬ xβ = 1.
Prove that
xβΒ³ + xβΒ³ + xβΒ³ + xβΒ³ β₯ max(xβ + xβ + xβ + xβ, 1/xβ + 1/xβ + 1/xβ + 1/xβ).
-/
theorem iran1998_p3
(x : β β β)
(x_positive : β i, 0 < x i)
(h : β i β Finset.range 4, x i = 1)
: max (β i β Finset.range 4, x i) (β i β Finset.range 4, 1 / x i)
β€ β i β Finset.range 4, (x i)^(3 : β) := by sorry
|
algebra
|
IntegersInACircle
| true |
[
"combinatorics"
] |
IntegersInACircle
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
There are 101 positive integers arranged in a circle.
Suppose that the integers sum to 300.
Prove that there exists a contiguous subarray that sums to 200.
https://mathstodon.xyz/@alexdbolton/110292738044661739
https://math.stackexchange.com/questions/282589/101-positive-integers-placed-on-a-circle
-/
|
theorem integers_in_a_circle
(a : ZMod 101 β β€)
(ha : β i, 1 β€ a i)
(ha_sum : β i : ZMod 101, a i = 300)
: β j : ZMod 101, β n : β, β i β Finset.range n, a (j + i) = 200 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
There are 101 positive integers arranged in a circle.
Suppose that the integers sum to 300.
Prove that there exists a contiguous subarray that sums to 200.
https://mathstodon.xyz/@alexdbolton/110292738044661739
https://math.stackexchange.com/questions/282589/101-positive-integers-placed-on-a-circle
-/
theorem integers_in_a_circle
(a : ZMod 101 β β€)
(ha : β i, 1 β€ a i)
(ha_sum : β i : ZMod 101, a i = 300)
: β j : ZMod 101, β n : β, β i β Finset.range n, a (j + i) = 200 := by sorry
|
combinatorics
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.