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