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 |
---|---|---|---|---|---|---|---|---|---|
Imo1993P5
| true |
[
"algebra"
] |
Imo1993P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1993, Problem 5
Does there exist a function f : β β β such that
i) f(1) = 2
ii) f(f(n)) = f(n) + n for all n β β
iii) f(n + 1) > f(n) for all n β β?
-/
|
abbrev DoesExist : Bool := True
abbrev Good (f : β β β) : Prop := f 1 = 2 β§ β n, f (f n) = f n + n β§ β n, f n < f (n + 1)
theorem imo1993_p5 :
if DoesExist then β f, Good f else Β¬β f, Good f := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1993, Problem 5
Does there exist a function f : β β β such that
i) f(1) = 2
ii) f(f(n)) = f(n) + n for all n β β
iii) f(n + 1) > f(n) for all n β β?
-/
abbrev DoesExist : Bool := True
abbrev Good (f : β β β) : Prop := f 1 = 2 β§ β n, f (f n) = f n + n β§ β n, f n < f (n + 1)
theorem imo1993_p5 :
if DoesExist then β f, Good f else Β¬β f, Good f := by sorry
|
algebra
|
Imo1984P6
| true |
[
"number theory"
] |
Imo1984P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1984, Problem 6
Let a, b, c, and d be odd integers such that 0 < a < b < c < d and ad = bc.
Prove that if a + d = 2α΅ and b + c = 2α΅ for some integers k and m, then
a = 1.
-/
|
theorem imo_1984_p6
(a b c d k m : β)
(hβ : 0 < a β§ 0 < b β§ 0 < c β§ 0 < d)
(hβ : Odd a β§ Odd b β§ Odd c β§ Odd d)
(hβ : a < b β§ b < c β§ c < d)
(hβ : a * d = b * c)
(hβ : a + d = 2^k)
(hβ
: b + c = 2^m) :
a = 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1984, Problem 6
Let a, b, c, and d be odd integers such that 0 < a < b < c < d and ad = bc.
Prove that if a + d = 2α΅ and b + c = 2α΅ for some integers k and m, then
a = 1.
-/
theorem imo_1984_p6
(a b c d k m : β)
(hβ : 0 < a β§ 0 < b β§ 0 < c β§ 0 < d)
(hβ : Odd a β§ Odd b β§ Odd c β§ Odd d)
(hβ : a < b β§ b < c β§ c < d)
(hβ : a * d = b * c)
(hβ : a + d = 2^k)
(hβ
: b + c = 2^m) :
a = 1 := by sorry
|
number theory
|
Usa1982P4
| true |
[
"number theory"
] |
Usa1982P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1982, Problem 4
Prove that there exists a positive integer k such that
kβ¬2βΏ + 1 is composite for every integer n.
-/
|
theorem usa1982_p4 :
β k : β, 0 < k β§ β n : β, Β¬ Nat.Prime (k * (2 ^ n) + 1) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1982, Problem 4
Prove that there exists a positive integer k such that
kβ¬2βΏ + 1 is composite for every integer n.
-/
theorem usa1982_p4 :
β k : β, 0 < k β§ β n : β, Β¬ Nat.Prime (k * (2 ^ n) + 1) := by sorry
|
number theory
|
Imo1988P6
| true |
[
"number theory"
] |
Imo1988P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1988, Problem 6
If a and b are two natural numbers such that a*b+1 divides a^2 + b^2,
show that their quotient is a perfect square.
-/
|
theorem imo1988_p6 {a b : β} (h : a * b + 1 β£ a ^ 2 + b ^ 2) :
β d, d ^ 2 = (a ^ 2 + b ^ 2) / (a * b + 1) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1988, Problem 6
If a and b are two natural numbers such that a*b+1 divides a^2 + b^2,
show that their quotient is a perfect square.
-/
theorem imo1988_p6 {a b : β} (h : a * b + 1 β£ a ^ 2 + b ^ 2) :
β d, d ^ 2 = (a ^ 2 + b ^ 2) / (a * b + 1) := by sorry
|
number theory
|
Imo1992P1
| true |
[
"number theory"
] |
Imo1992P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1992, Problem 1
Find all integers 1 < a < b < c such that
(a - 1)(b - 1)(c - 1) divides abc - 1.
-/
|
abbrev solution_set : Set (β€ Γ β€ Γ β€) := {(2, 4, 8), (3, 5, 15)}
theorem imo1992_p1 (a b c : β€) (ha : 1 < a) (hb : a < b) (hc : b < c) :
β¨a, b, cβ© β solution_set β
(a - 1) * (b - 1) * (c - 1) β£ a * b * c - 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1992, Problem 1
Find all integers 1 < a < b < c such that
(a - 1)(b - 1)(c - 1) divides abc - 1.
-/
abbrev solution_set : Set (β€ Γ β€ Γ β€) := {(2, 4, 8), (3, 5, 15)}
theorem imo1992_p1 (a b c : β€) (ha : 1 < a) (hb : a < b) (hc : b < c) :
β¨a, b, cβ© β solution_set β
(a - 1) * (b - 1) * (c - 1) β£ a * b * c - 1 := by sorry
|
number theory
|
Usa1998P3
| true |
[
"algebra",
"inequality"
] |
Usa1998P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 1998, Problem 3
Let aβ,aβ,...,aβ be real numbers from the interval (0,Ο/2) such that
tan(aβ - Ο/4) + tan(aβ - Ο/4) + ... + tan(aβ - Ο/4) β₯ n - 1.
Prove that
tan(aβ)tan(aβ)...tan(aβ) β₯ nβΏβΊΒΉ.
-/
|
theorem usa1998_p3
(n : β)
(a : β β β)
(ha : β i β Finset.range (n + 1), a i β Set.Ioo 0 (Real.pi / 2))
(hs : n - 1 β€ β i β Finset.range (n + 1), Real.tan (a i - (Real.pi / 4)))
: n ^ (n + 1) β€ β i β Finset.range (n + 1), Real.tan (a i) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 1998, Problem 3
Let aβ,aβ,...,aβ be real numbers from the interval (0,Ο/2) such that
tan(aβ - Ο/4) + tan(aβ - Ο/4) + ... + tan(aβ - Ο/4) β₯ n - 1.
Prove that
tan(aβ)tan(aβ)...tan(aβ) β₯ nβΏβΊΒΉ.
-/
theorem usa1998_p3
(n : β)
(a : β β β)
(ha : β i β Finset.range (n + 1), a i β Set.Ioo 0 (Real.pi / 2))
(hs : n - 1 β€ β i β Finset.range (n + 1), Real.tan (a i - (Real.pi / 4)))
: n ^ (n + 1) β€ β i β Finset.range (n + 1), Real.tan (a i) := by sorry
|
algebra
|
Hungary1998P6
| true |
[
"algebra"
] |
Hungary1998P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# Hungarian Mathematical Olympiad 1998, Problem 6
Let x, y, z be integers with z > 1. Show that
(x + 1)Β² + (x + 2)Β² + ... + (x + 99)Β² β yαΆ».
-/
|
theorem hungary1998_p6 (x y : β€) (z : β) (hz : 1 < z) :
β i β Finset.range 99, (x + i + 1)^2 β y^z := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# Hungarian Mathematical Olympiad 1998, Problem 6
Let x, y, z be integers with z > 1. Show that
(x + 1)Β² + (x + 2)Β² + ... + (x + 99)Β² β yαΆ».
-/
theorem hungary1998_p6 (x y : β€) (z : β) (hz : 1 < z) :
β i β Finset.range 99, (x + i + 1)^2 β y^z := by sorry
|
algebra
|
Imo1985P2
| true |
[
"combinatorics"
] |
Imo1985P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1985, Problem 5
Each of the numbers in the set $N=\{1, 2, 3, \dots, n-1\}$,
where $n β₯ 3$, is colored with one of two colors, say red or black,
so that:
1. $i$ and $n-i$ always receive the same color, and
2. for some $j β N$ relatively prime to $n$, $i$ and $|j-i|$ receive
the same color
for all $i β N, i β j$.
Prove that all numbers in $N$ must receive the same color.
-/
|
/-- The conditions on the problem's coloring `C`.
Although its domain is all of `β`, we only care about its values in `Set.Ico 1 n`. -/
def Condition (n j : β) (C : β β Fin 2) : Prop :=
(β i β Set.Ico 1 n, C i = C (n - i)) β§
β i β Set.Ico 1 n, i β j β C i = C (j - i : β€).natAbs
theorem imo2001_p3 {n j : β} (hn : 3 β€ n) (hj : j β Set.Ico 1 n)
(cpj : Nat.Coprime n j) {C : β β Fin 2} (hC : Condition n j C)
{i : β} (hi : i β Set.Ico 1 n) :
C i = C j := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1985, Problem 5
Each of the numbers in the set $N=\{1, 2, 3, \dots, n-1\}$,
where $n β₯ 3$, is colored with one of two colors, say red or black,
so that:
1. $i$ and $n-i$ always receive the same color, and
2. for some $j β N$ relatively prime to $n$, $i$ and $|j-i|$ receive
the same color
for all $i β N, i β j$.
Prove that all numbers in $N$ must receive the same color.
-/
/-- The conditions on the problem's coloring `C`.
Although its domain is all of `β`, we only care about its values in `Set.Ico 1 n`. -/
def Condition (n j : β) (C : β β Fin 2) : Prop :=
(β i β Set.Ico 1 n, C i = C (n - i)) β§
β i β Set.Ico 1 n, i β j β C i = C (j - i : β€).natAbs
theorem imo2001_p3 {n j : β} (hn : 3 β€ n) (hj : j β Set.Ico 1 n)
(cpj : Nat.Coprime n j) {C : β β Fin 2} (hC : Condition n j C)
{i : β} (hi : i β Set.Ico 1 n) :
C i = C j := by sorry
|
combinatorics
|
Imo1982P3a
| true |
[
"algebra"
] |
Imo1982P3a
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1982, Problem 3
Consider infinite sequences $\{x_n \}$ of positive reals such that $x_0 = 0$ and
$x_0 \geq x_1 \geq x_2 \geq ...$
a) Prove that for every such sequence there is an $n \geq 1$ such that:
$\frac{x_0^2}{x_1} + \ldots + \frac{x_{n-1}^2}{x_n} \geq 3.999$
-/
|
theorem imo1982_q3a {x : β β β} (hx : Antitone x) (h0 : x 0 = 1) (hp : β k, 0 < x k) :
β n : β, 3.999 β€ β k β Finset.range n, (x k) ^ 2 / x (k + 1) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1982, Problem 3
Consider infinite sequences $\{x_n \}$ of positive reals such that $x_0 = 0$ and
$x_0 \geq x_1 \geq x_2 \geq ...$
a) Prove that for every such sequence there is an $n \geq 1$ such that:
$\frac{x_0^2}{x_1} + \ldots + \frac{x_{n-1}^2}{x_n} \geq 3.999$
-/
theorem imo1982_q3a {x : β β β} (hx : Antitone x) (h0 : x 0 = 1) (hp : β k, 0 < x k) :
β n : β, 3.999 β€ β k β Finset.range n, (x k) ^ 2 / x (k + 1) := by sorry
|
algebra
|
Imo1983P5
| false |
[
"combinatorics"
] |
Imo1983P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1983, Problem 5
Is it possible to choose $1983$ distinct positive integers,
all less than or equal to $10^5$,
no three of which are consecutive terms of an arithmetic progression?
Justify your answer.
-/
|
theorem imo1983_p5 :
β S : Finset β, S.card = 1983 β§
(β x β S, x β€ 10^5) β§
β x β S, β y β S, β z β S, x < y β§ y < z β x + z β 2 * y := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1983, Problem 5
Is it possible to choose $1983$ distinct positive integers,
all less than or equal to $10^5$,
no three of which are consecutive terms of an arithmetic progression?
Justify your answer.
-/
theorem imo1983_p5 :
β S : Finset β, S.card = 1983 β§
(β x β S, x β€ 10^5) β§
β x β S, β y β S, β z β S, x < y β§ y < z β x + z β 2 * y := by sorry
|
combinatorics
|
Imo1995P2
| true |
[
"algebra",
"inequality"
] |
Imo1995P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1995, Problem 2
Let a, b, c be positive real numbers such that abc = 1. Show that
1 / (aΒ³(b + c)) + 1 / (bΒ³(c + a)) + 1 / (cΒ³(a + b)) β₯ 3/2.
-/
|
/- special open -/ open Finset
theorem imo1995_p2 (a b c : β) (ha : 0 < a) (hb : 0 < b) (hc : 0 < c)
(habc : a * b * c = 1) :
3 / 2 β€ 1 / (a^3 * (b + c)) + 1 / (b^3 * (c + a)) + 1 / (c^3 * (a + b)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1995, Problem 2
Let a, b, c be positive real numbers such that abc = 1. Show that
1 / (aΒ³(b + c)) + 1 / (bΒ³(c + a)) + 1 / (cΒ³(a + b)) β₯ 3/2.
-/
/- special open -/ open Finset
theorem imo1995_p2 (a b c : β) (ha : 0 < a) (hb : 0 < b) (hc : 0 < c)
(habc : a * b * c = 1) :
3 / 2 β€ 1 / (a^3 * (b + c)) + 1 / (b^3 * (c + a)) + 1 / (c^3 * (a + b)) := by sorry
|
algebra
|
Imo1982P1
| true |
[
"algebra"
] |
Imo1982P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1982, Problem 1
Let f be a function from positive integers to nonnegative integers such that
1) f(2) = 0
2) f(3) > 0
3) f(9999) = 3333
4) for all m,n > 0, f (m + n) - f (m) - f(n) = 1 or 0
Determine the value of f(1982).
-/
|
abbrev solution_value : β := 660
theorem imo1982_p1 (f : β β β)
(h2 : f 2 = 0)
(h3 : 0 < f 3)
(h9999 : f 9999 = 3333)
(hf : β m n, 0 < m β 0 < n β f (m + n) = f m + f n β¨ f (m + n) = f m + f n + 1) :
f 1982 = solution_value := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1982, Problem 1
Let f be a function from positive integers to nonnegative integers such that
1) f(2) = 0
2) f(3) > 0
3) f(9999) = 3333
4) for all m,n > 0, f (m + n) - f (m) - f(n) = 1 or 0
Determine the value of f(1982).
-/
abbrev solution_value : β := 660
theorem imo1982_p1 (f : β β β)
(h2 : f 2 = 0)
(h3 : 0 < f 3)
(h9999 : f 9999 = 3333)
(hf : β m n, 0 < m β 0 < n β f (m + n) = f m + f n β¨ f (m + n) = f m + f n + 1) :
f 1982 = solution_value := by sorry
|
algebra
|
Imo1998P6
| false |
[
"algebra"
] |
Imo1998P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1998, Problem 6
Consider all functions f from the set of all positive integers into itself satisfying
f(t^2f(s)) = sf(t)^2 for all s and t.
Determine the least possible value of f(1998).
-/
|
abbrev solution : β+ := 120
theorem imo1998_p6
(f : β+ β β+)
(h : β s t, f (t^2 * f s) = s * (f t)^2) :
IsLeast {n : β | n = f 1998} solution := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1998, Problem 6
Consider all functions f from the set of all positive integers into itself satisfying
f(t^2f(s)) = sf(t)^2 for all s and t.
Determine the least possible value of f(1998).
-/
abbrev solution : β+ := 120
theorem imo1998_p6
(f : β+ β β+)
(h : β s t, f (t^2 * f s) = s * (f t)^2) :
IsLeast {n : β | n = f 1998} solution := by sorry
|
algebra
|
Poland1998P4
| true |
[
"number theory"
] |
Poland1998P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
Polish Mathematical Olympiad 1998, Problem 4
Prove that the sequence {a_n} defined by a_1 = 1 and
a_n = a_{n - 1} + a_{βn/2β} n = 2,3,4,...
contains infinitely many integers divisible by 7.
-/
|
def a : β β β
| 0 => 1 -- unused dummy value
| 1 => 1
| Nat.succ n =>
have _ : (n.succ / 2) < n.succ := Nat.div_lt_self' n 0
a n + a (n.succ / 2)
theorem poland1998_p4 : Set.Infinite { n | 7 β£ a n } := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
Polish Mathematical Olympiad 1998, Problem 4
Prove that the sequence {a_n} defined by a_1 = 1 and
a_n = a_{n - 1} + a_{βn/2β} n = 2,3,4,...
contains infinitely many integers divisible by 7.
-/
def a : β β β
| 0 => 1 -- unused dummy value
| 1 => 1
| Nat.succ n =>
have _ : (n.succ / 2) < n.succ := Nat.div_lt_self' n 0
a n + a (n.succ / 2)
theorem poland1998_p4 : Set.Infinite { n | 7 β£ a n } := by sorry
|
number theory
|
Imo2011P3
| true |
[
"algebra"
] |
Imo2011P3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2011, Problem 3
Let f : β β β be a function that satisfies
f(x + y) β€ y * f(x) + f(f(x))
for all x and y. Prove that f(x) = 0 for all x β€ 0.
-/
|
theorem imo2011_p3 (f : β β β) (hf : β x y, f (x + y) β€ y * f x + f (f x)) :
β x β€ 0, f x = 0 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2011, Problem 3
Let f : β β β be a function that satisfies
f(x + y) β€ y * f(x) + f(f(x))
for all x and y. Prove that f(x) = 0 for all x β€ 0.
-/
theorem imo2011_p3 (f : β β β) (hf : β x y, f (x + y) β€ y * f x + f (f x)) :
β x β€ 0, f x = 0 := by sorry
|
algebra
|
Imo2024P6
| true |
[
"algebra"
] |
Imo2024P6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2024, Problem 6
A function `f: β β β` is called *aquaesulian* if the following
property holds: for every `x, y β β`,
`f(x + f(y)) = f(x) + y` or `f(f(x) + y) = x + f(y)`.
Show that there exists an integer `c` such that for any aquaesulian function `f`
there are at most `c` different rational numbers of the form `f(r)+f(-r)` for
some rational number `r`, and find the smallest possible value of `c`.
-/
|
/- special open -/ open Cardinal
def Aquaesulian (f : β β β) : Prop :=
β x y, f (x + f y) = f x + y β¨ f (f x + y) = x + f y
abbrev solution : β := 2
theorem imo2024_p6 :
(β f, Aquaesulian f β #(Set.range (fun x β¦ f x + f (-x))) β€ solution) β§
β c : β,
(β f, Aquaesulian f β #(Set.range (fun x β¦ f x + f (-x))) β€ c) β
solution β€ c := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2024, Problem 6
A function `f: β β β` is called *aquaesulian* if the following
property holds: for every `x, y β β`,
`f(x + f(y)) = f(x) + y` or `f(f(x) + y) = x + f(y)`.
Show that there exists an integer `c` such that for any aquaesulian function `f`
there are at most `c` different rational numbers of the form `f(r)+f(-r)` for
some rational number `r`, and find the smallest possible value of `c`.
-/
/- special open -/ open Cardinal
def Aquaesulian (f : β β β) : Prop :=
β x y, f (x + f y) = f x + y β¨ f (f x + y) = x + f y
abbrev solution : β := 2
theorem imo2024_p6 :
(β f, Aquaesulian f β #(Set.range (fun x β¦ f x + f (-x))) β€ solution) β§
β c : β,
(β f, Aquaesulian f β #(Set.range (fun x β¦ f x + f (-x))) β€ c) β
solution β€ c := by sorry
|
algebra
|
Imo1972P4
| false |
[
"algebra"
] |
Imo1972P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1972, Problem 4
Find all positive real solutions to:
(x_1^2 - x_3x_5)(x_2^2 - x_3x_5) β€ 0
(x_2^2 - x_4x_1)(x_3^2 - x_4x_1) β€ 0
(x_3^2 - x_5x_2)(x_4^2 - x_5x_2) β€ 0
(x_4^2 - x_1x_3)(x_5^2 - x_1x_3) β€ 0
(x_5^2 - x_2x_4)(x_1^2 - x_2x_4) β€ 0
-/
|
abbrev solution_set : Set (β Γ β Γ β Γ β Γ β) :=
{(a, b, c, d, e) | a = b β§ b = c β§ c = d β§ d = e}
theorem imo1972_p4 (a b c d e : β)
(hβ : 0 < a β§ 0 < b β§ 0 < c β§ 0 < d β§ 0 < e):
(a^2 - c * e) * (b^2 - c * e) β€ 0 β§
(b^2 - d * a) * (c^2 - d * a) β€ 0 β§
(c^2 - e * b) * (d^2 - e * b) β€ 0 β§
(d^2 - a * c) * (e^2 - a * c) β€ 0 β§
(e^2 - b * d) * (a^2 - b * d) β€ 0 β
(a, b, c, d, e) β solution_set := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1972, Problem 4
Find all positive real solutions to:
(x_1^2 - x_3x_5)(x_2^2 - x_3x_5) β€ 0
(x_2^2 - x_4x_1)(x_3^2 - x_4x_1) β€ 0
(x_3^2 - x_5x_2)(x_4^2 - x_5x_2) β€ 0
(x_4^2 - x_1x_3)(x_5^2 - x_1x_3) β€ 0
(x_5^2 - x_2x_4)(x_1^2 - x_2x_4) β€ 0
-/
abbrev solution_set : Set (β Γ β Γ β Γ β Γ β) :=
{(a, b, c, d, e) | a = b β§ b = c β§ c = d β§ d = e}
theorem imo1972_p4 (a b c d e : β)
(hβ : 0 < a β§ 0 < b β§ 0 < c β§ 0 < d β§ 0 < e):
(a^2 - c * e) * (b^2 - c * e) β€ 0 β§
(b^2 - d * a) * (c^2 - d * a) β€ 0 β§
(c^2 - e * b) * (d^2 - e * b) β€ 0 β§
(d^2 - a * c) * (e^2 - a * c) β€ 0 β§
(e^2 - b * d) * (a^2 - b * d) β€ 0 β
(a, b, c, d, e) β solution_set := by sorry
|
algebra
|
Usa2022P4
| true |
[
"number theory"
] |
Usa2022P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 2022, Problem 4
Determine all pairs of primes (p, q) where p - q and pq - q
are both perfect squares.
-/
|
abbrev solution_set : Set (β Γ β) := {(3, 2)}
theorem usa2022_p4 (p q : β) :
(p, q) β solution_set β
p.Prime β§ q.Prime β§
β a, a^2 + q = p β§ β b, b^2 + q = p * q := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 2022, Problem 4
Determine all pairs of primes (p, q) where p - q and pq - q
are both perfect squares.
-/
abbrev solution_set : Set (β Γ β) := {(3, 2)}
theorem usa2022_p4 (p q : β) :
(p, q) β solution_set β
p.Prime β§ q.Prime β§
β a, a^2 + q = p β§ β b, b^2 + q = p * q := by sorry
|
number theory
|
Imo2019P4
| true |
[
"number theory"
] |
Imo2019P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2019, Problem 4
Determine all positive integers n,k that satisfy the equation
k! = (2βΏ - 2β°)(2βΏ - 2ΒΉ) ... (2βΏ - 2βΏβ»ΒΉ).
-/
|
abbrev solution_set : Set (β Γ β) := { (1,1), (2,3) }
theorem imo2018_p2 (n k : β) :
(n, k) β solution_set β
0 < n β§ 0 < k β§
(k ! : β€) = β i β Finset.range n, ((2:β€)^n - (2:β€)^i) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2019, Problem 4
Determine all positive integers n,k that satisfy the equation
k! = (2βΏ - 2β°)(2βΏ - 2ΒΉ) ... (2βΏ - 2βΏβ»ΒΉ).
-/
abbrev solution_set : Set (β Γ β) := { (1,1), (2,3) }
theorem imo2018_p2 (n k : β) :
(n, k) β solution_set β
0 < n β§ 0 < k β§
(k ! : β€) = β i β Finset.range n, ((2:β€)^n - (2:β€)^i) := by sorry
|
number theory
|
Imo1959P1
| true |
[
"number theory"
] |
Imo1959P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1959, Problem 1.
Prove that the fraction `(21n+4)/(14n+3)` is irreducible for every
natural number `n`.
-/
|
/-
Since Lean doesn't have a concept of "irreducible fractions" per se,
we just formalize this as saying the numerator and denominator are
relatively prime.
-/
theorem imo1959_p1 : β n : β, Nat.Coprime (21 * n + 4) (14 * n + 3) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1959, Problem 1.
Prove that the fraction `(21n+4)/(14n+3)` is irreducible for every
natural number `n`.
-/
/-
Since Lean doesn't have a concept of "irreducible fractions" per se,
we just formalize this as saying the numerator and denominator are
relatively prime.
-/
theorem imo1959_p1 : β n : β, Nat.Coprime (21 * n + 4) (14 * n + 3) := by sorry
|
number theory
|
Bulgaria1998P1
| false |
[
"combinatorics"
] |
Bulgaria1998P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# Bulgarian Mathematical Olympiad 1998, Problem 1
We will be considering colorings in 2 colors of n (distinct) points
Aβ, Aβ, ..., Aβ. Call such a coloring "good" if there exist three points
Aα΅’, Aβ±Ό, Aββ±Όβα΅’, 1 β€ i < 2j - i β€ n, which are colored the same color.
Find the least natural number n (n β₯ 3) such that all colorings
of n points are good.
-/
|
abbrev coloring_is_good {m : β} (color : Set.Icc 1 m β Fin 2) : Prop :=
β i j : Set.Icc 1 m,
i < j β§
β h3 : 2 * j.val - i β Set.Icc 1 m,
color i = color j β§ color i = color β¨2 * j - i, h3β©
abbrev all_colorings_are_good (m : β) : Prop :=
3 β€ m β§ β color : Set.Icc 1 m β Fin 2, coloring_is_good color
abbrev solution_value : β := 9
theorem bulgaria1998_p1 : IsLeast { m | all_colorings_are_good m } solution_value := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# Bulgarian Mathematical Olympiad 1998, Problem 1
We will be considering colorings in 2 colors of n (distinct) points
Aβ, Aβ, ..., Aβ. Call such a coloring "good" if there exist three points
Aα΅’, Aβ±Ό, Aββ±Όβα΅’, 1 β€ i < 2j - i β€ n, which are colored the same color.
Find the least natural number n (n β₯ 3) such that all colorings
of n points are good.
-/
abbrev coloring_is_good {m : β} (color : Set.Icc 1 m β Fin 2) : Prop :=
β i j : Set.Icc 1 m,
i < j β§
β h3 : 2 * j.val - i β Set.Icc 1 m,
color i = color j β§ color i = color β¨2 * j - i, h3β©
abbrev all_colorings_are_good (m : β) : Prop :=
3 β€ m β§ β color : Set.Icc 1 m β Fin 2, coloring_is_good color
abbrev solution_value : β := 9
theorem bulgaria1998_p1 : IsLeast { m | all_colorings_are_good m } solution_value := by sorry
|
combinatorics
|
Imo2009P5
| true |
[
"algebra"
] |
Imo2009P5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2009, Problem 5
Determine all functions f: β€>0 β β€>0 such that for all positive integers a and b,
the numbers
a, f(b), and f(b + f(a) - 1)
form the sides of a nondegenerate triangle.
-/
|
abbrev solution_set : Set (β+ β β+) := { id }
theorem imo2009_p5 (f : β+ β β+) :
f β solution_set β
β a b, (f (b + f a - 1) < f b + a β§
a < f b + f (b + f a - 1) β§
f b < f (b + f a - 1) + a) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2009, Problem 5
Determine all functions f: β€>0 β β€>0 such that for all positive integers a and b,
the numbers
a, f(b), and f(b + f(a) - 1)
form the sides of a nondegenerate triangle.
-/
abbrev solution_set : Set (β+ β β+) := { id }
theorem imo2009_p5 (f : β+ β β+) :
f β solution_set β
β a b, (f (b + f a - 1) < f b + a β§
a < f b + f (b + f a - 1) β§
f b < f (b + f a - 1) + a) := by sorry
|
algebra
|
Imo2023P4
| true |
[
"algebra"
] |
Imo2023P4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2023, Problem 4
Let xβ, xβ, ... xββββ be distinct positive real numbers.
Define
aβ := β((xβ + xβ + ... + xβ)(1/xβ + 1/xβ + ... + 1/xβ)).
Suppose that aβ is an integer for all n β {1,...,2023}.
Prove that 3034 β€ aββββ.
-/
|
noncomputable def a (x : Finset.Icc 1 2023 β β) (n : Finset.Icc 1 2023) : β :=
β((β i β Finset.univ.filter (Β· β€ n), x i) *
(β i β Finset.univ.filter (Β· β€ n), (1 / x i)))
theorem imo2023_p4
(x : Finset.Icc 1 2023 β β)
(hxp : β i, 0 < x i)
(hxi : x.Injective)
(hxa : β i : Finset.Icc 1 2023, β k : β€, a x i = k)
: 3034 β€ a x β¨2023, by simpβ© := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2023, Problem 4
Let xβ, xβ, ... xββββ be distinct positive real numbers.
Define
aβ := β((xβ + xβ + ... + xβ)(1/xβ + 1/xβ + ... + 1/xβ)).
Suppose that aβ is an integer for all n β {1,...,2023}.
Prove that 3034 β€ aββββ.
-/
noncomputable def a (x : Finset.Icc 1 2023 β β) (n : Finset.Icc 1 2023) : β :=
β((β i β Finset.univ.filter (Β· β€ n), x i) *
(β i β Finset.univ.filter (Β· β€ n), (1 / x i)))
theorem imo2023_p4
(x : Finset.Icc 1 2023 β β)
(hxp : β i, 0 < x i)
(hxi : x.Injective)
(hxa : β i : Finset.Icc 1 2023, β k : β€, a x i = k)
: 3034 β€ a x β¨2023, by simpβ© := by sorry
|
algebra
|
Imo1963P1
| true |
[
"algebra"
] |
Imo1963P1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 1963, Problem 1
Find all real roots of the equation
β(xΒ²-p) + 2β(xΒ²-1) = x
where *p* is a real parameter.
-/
|
abbrev f (p : β) : Set β :=
if p β₯ 0 β§ p β€ (4 : β) / 3
then { (4 - p) / (2 * Real.sqrt (4 - 2 * p)) }
else β
theorem imo1963_p1 : β (p x : β), (x ^ 2 - p) β₯ 0 β (x ^ 2 - 1) β₯ 0 β
(Real.sqrt (x ^ 2 - p) + 2 * Real.sqrt (x ^ 2 - 1) = x β (x β f p)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 1963, Problem 1
Find all real roots of the equation
β(xΒ²-p) + 2β(xΒ²-1) = x
where *p* is a real parameter.
-/
abbrev f (p : β) : Set β :=
if p β₯ 0 β§ p β€ (4 : β) / 3
then { (4 - p) / (2 * Real.sqrt (4 - 2 * p)) }
else β
theorem imo1963_p1 : β (p x : β), (x ^ 2 - p) β₯ 0 β (x ^ 2 - 1) β₯ 0 β
(Real.sqrt (x ^ 2 - p) + 2 * Real.sqrt (x ^ 2 - 1) = x β (x β f p)) := by sorry
|
algebra
|
Usa2024P2
| false |
[
"combinatorics"
] |
Usa2024P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# USA Mathematical Olympiad 2024, Problem 2
Let Sβ, Sβ, ..., Sβ be finite sets of integers whose intersection
is not empty. For each non-empty T β {Sβ, Sβ, ..., Sβ}, the size of
the intersection of the sets in T is a multiple of the number of
sets in T. What is the least possible number of elements that are in
at least 50 sets?
-/
|
abbrev solution : β := 50 * Nat.choose 100 50
structure Good (S : Fin 100 β Set β€) : Prop where
finite : β i, (S i).Finite
nonempty_inter : β i, S i β β
card : β T : Finset (Fin 100), T.Nonempty β
β k : β, (β i β T, S i).ncard * k = T.card
-- z is in at least k of the sets S.
abbrev InAtLeastKSubsets (S : Fin 100 β Set β€) (k : β) (z : β€) : Prop :=
k β€ {i : Fin 100 | z β S i }.ncard
theorem usa2024_p2 (n : β) :
IsLeast
{ k | β S, Good S β§
k = {z : β€ | InAtLeastKSubsets S k z }.ncard } solution := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# USA Mathematical Olympiad 2024, Problem 2
Let Sβ, Sβ, ..., Sβ be finite sets of integers whose intersection
is not empty. For each non-empty T β {Sβ, Sβ, ..., Sβ}, the size of
the intersection of the sets in T is a multiple of the number of
sets in T. What is the least possible number of elements that are in
at least 50 sets?
-/
abbrev solution : β := 50 * Nat.choose 100 50
structure Good (S : Fin 100 β Set β€) : Prop where
finite : β i, (S i).Finite
nonempty_inter : β i, S i β β
card : β T : Finset (Fin 100), T.Nonempty β
β k : β, (β i β T, S i).ncard * k = T.card
-- z is in at least k of the sets S.
abbrev InAtLeastKSubsets (S : Fin 100 β Set β€) (k : β) (z : β€) : Prop :=
k β€ {i : Fin 100 | z β S i }.ncard
theorem usa2024_p2 (n : β) :
IsLeast
{ k | β S, Good S β§
k = {z : β€ | InAtLeastKSubsets S k z }.ncard } solution := by sorry
|
combinatorics
|
Imo2008P2b
| true |
[
"algebra"
] |
Imo2008P2b
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2008, Problem 2
```
x^2 / (x-1)^2 + y^2 / (y-1)^2 + z^2 / (z-1)^2 β₯ 1
```
(b) Prove that equality holds above for infinitely many triples of rational numbers `x`, `y`, `z`,
each different from 1, and satisfying `xyz = 1`.
-/
|
def rationalSolutions :=
{s : β Γ β Γ β | β x y z : β, s = (x, y, z) β§ x β 1 β§ y β 1 β§ z β 1 β§ x * y * z = 1 β§
x ^ 2 / (x - 1) ^ 2 + y ^ 2 / (y - 1) ^ 2 + z ^ 2 / (z - 1) ^ 2 = 1}
theorem imo2008_p2b : Set.Infinite rationalSolutions := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2008, Problem 2
```
x^2 / (x-1)^2 + y^2 / (y-1)^2 + z^2 / (z-1)^2 β₯ 1
```
(b) Prove that equality holds above for infinitely many triples of rational numbers `x`, `y`, `z`,
each different from 1, and satisfying `xyz = 1`.
-/
def rationalSolutions :=
{s : β Γ β Γ β | β x y z : β, s = (x, y, z) β§ x β 1 β§ y β 1 β§ z β 1 β§ x * y * z = 1 β§
x ^ 2 / (x - 1) ^ 2 + y ^ 2 / (y - 1) ^ 2 + z ^ 2 / (z - 1) ^ 2 = 1}
theorem imo2008_p2b : Set.Infinite rationalSolutions := by sorry
|
algebra
|
Imo2001P2
| true |
[
"algebra",
"inequality"
] |
Imo2001P2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2001, Problem 2
Let a, b, c be positive reals. Prove that
a / β(aΒ² + 8bc) + b / β(bΒ² + 8ca) + c / β(cΒ² + 8ab) β₯ 1.
-/
|
variable {a b c : β}
theorem imo2001_p2 (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) : 1 β€
a / Real.sqrt (a ^ 2 + 8 * b * c) + b / Real.sqrt (b ^ 2 + 8 * c * a) +
c / Real.sqrt (c ^ 2 + 8 * a * b) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2001, Problem 2
Let a, b, c be positive reals. Prove that
a / β(aΒ² + 8bc) + b / β(bΒ² + 8ca) + c / β(cΒ² + 8ab) β₯ 1.
-/
variable {a b c : β}
theorem imo2001_p2 (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) : 1 β€
a / Real.sqrt (a ^ 2 + 8 * b * c) + b / Real.sqrt (b ^ 2 + 8 * c * a) +
c / Real.sqrt (c ^ 2 + 8 * a * b) := by sorry
|
algebra
|
Imo2007P1a
| false |
[
"algebra"
] |
Imo2007P1a
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# International Mathematical Olympiad 2007, Problem 1
Real numbers aβ, aβ, ..., aβ are fixed. For each 1 β€ i β€ n,
we let dα΅’ = max {aβ±Ό : 1 β€ j β€ i} - min {aβ±Ό : i β€ j β€ n},
and let d = max {dα΅’ : 1 β€ i β€ n}.
(a) Prove that for any real numbers xβ β€ ... β€ xβ, we have
max { |xα΅’ - aα΅’| : 1 β€ i β€ n } β₯ d / 2.
-/
|
noncomputable abbrev d {n : β} (a : Fin n β β) (i : Fin n) :=
(β¨ j : {j // j β€ i}, a j - β¨
j : {j // i β€ j}, a j)
theorem imo2007_p1a {n : β} (hn : 0 < n) {a x : Fin n β β} (h : Monotone x) :
(β¨ i, d a i) / 2 β€ β¨ i, |x i - a i| := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# International Mathematical Olympiad 2007, Problem 1
Real numbers aβ, aβ, ..., aβ are fixed. For each 1 β€ i β€ n,
we let dα΅’ = max {aβ±Ό : 1 β€ j β€ i} - min {aβ±Ό : i β€ j β€ n},
and let d = max {dα΅’ : 1 β€ i β€ n}.
(a) Prove that for any real numbers xβ β€ ... β€ xβ, we have
max { |xα΅’ - aα΅’| : 1 β€ i β€ n } β₯ d / 2.
-/
noncomputable abbrev d {n : β} (a : Fin n β β) (i : Fin n) :=
(β¨ j : {j // j β€ i}, a j - β¨
j : {j // i β€ j}, a j)
theorem imo2007_p1a {n : β} (hn : 0 < n) {a x : Fin n β β} (h : Monotone x) :
(β¨ i, d a i) / 2 β€ β¨ i, |x i - a i| := by sorry
|
algebra
|
Singapore2019P11
| true |
[
"algebra"
] |
Singapore2019P11
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# Singapore Math Olympiad (Senior) 2019 (Round 1), Problem 11
http://www.realsutra.com/limjeck/SMO_Senior_2019.pdf
Find the value of 448 * (sin 12 degrees) * (sin 39 degrees) * (sin 51 degrees) / sin 24 degrees
-/
|
noncomputable abbrev solution : β := 112
theorem singapore2019_r1_p11 : 448 * Real.sin (12 * Real.pi / 180) * Real.sin (39 * Real.pi / 180) * Real.sin (51 * Real.pi / 180) / Real.sin (24 * Real.pi / 180) = 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 11
http://www.realsutra.com/limjeck/SMO_Senior_2019.pdf
Find the value of 448 * (sin 12 degrees) * (sin 39 degrees) * (sin 51 degrees) / sin 24 degrees
-/
noncomputable abbrev solution : β := 112
theorem singapore2019_r1_p11 : 448 * Real.sin (12 * Real.pi / 180) * Real.sin (39 * Real.pi / 180) * Real.sin (51 * Real.pi / 180) / Real.sin (24 * Real.pi / 180) = solution := by sorry
|
algebra
|
imo_sl_2006_A1
| true |
[
"algebra"
] |
2006_A1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2006 A1
Let $R$ be an archimedean ring with floor.
Define the function $f : R β R$ by $$ f(x) = βxβ (x - βxβ). $$
Prove that for any $r β R$, there exists $N β β$ such that for all $k β₯ N$,
$$ f^{k + 2}(r) = f^k(r). $$
-/
|
/- special open -/ open Finset
abbrev f [LinearOrderedRing R] [FloorRing R] (r : R) := βrβ * (r - βrβ)
theorem imo_sl_2006_A1 [LinearOrderedRing R] [FloorRing R] [Archimedean R] (r : R) :
β N, β n β₯ N, f^[n + 2] r = f^[n] r := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2006 A1
Let $R$ be an archimedean ring with floor.
Define the function $f : R β R$ by $$ f(x) = βxβ (x - βxβ). $$
Prove that for any $r β R$, there exists $N β β$ such that for all $k β₯ N$,
$$ f^{k + 2}(r) = f^k(r). $$
-/
/- special open -/ open Finset
abbrev f [LinearOrderedRing R] [FloorRing R] (r : R) := βrβ * (r - βrβ)
theorem imo_sl_2006_A1 [LinearOrderedRing R] [FloorRing R] [Archimedean R] (r : R) :
β N, β n β₯ N, f^[n + 2] r = f^[n] r := by sorry
|
algebra
|
imo_sl_2006_A2
| true |
[
"algebra"
] |
2006_A2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2006 A2
Consider the sequence $(a_n)_{n β₯ 0}$ of rational nuimbers defined by $a_0 = 1$ and
$$ a_n = -\sum_{k = 0}^{n - 1} \frac{a_k}{n + 1 - k}. $$
Prove that $a_n > 0$ for all $n β 0$.
-/
|
/- special open -/ open Finset
def a : β β β
| 0 => -1
| n + 1 => -(univ : Finset (Fin (n + 1))).sum Ξ» i β¦ a i / (n + 2 - i : β)
theorem imo_sl_2006_A2 (h : n β 0) : 0 < a n := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2006 A2
Consider the sequence $(a_n)_{n β₯ 0}$ of rational nuimbers defined by $a_0 = 1$ and
$$ a_n = -\sum_{k = 0}^{n - 1} \frac{a_k}{n + 1 - k}. $$
Prove that $a_n > 0$ for all $n β 0$.
-/
/- special open -/ open Finset
def a : β β β
| 0 => -1
| n + 1 => -(univ : Finset (Fin (n + 1))).sum Ξ» i β¦ a i / (n + 2 - i : β)
theorem imo_sl_2006_A2 (h : n β 0) : 0 < a n := by sorry
|
algebra
|
imo_sl_2006_A4
| true |
[
"algebra"
] |
2006_A4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2006 A4
Let $F$ be a totally ordered field and $a_1, a_2, β¦, a_n β F$ be positive.
Prove the inequality
$$ \sum_{i < j} \frac{a_i a_j}{a_i + a_j}
β€ \frac{n}{2(a_1 + a_2 + β¦ + a_n)} \sum_{i < j} a_i a_j. $$
-/
|
theorem imo_sl_2006_A4 [LinearOrderedField F] [LinearOrder ΞΉ]
(a : ΞΉ β F) {S : Finset ΞΉ} (hS : β i β S, 0 < a i) :
let T := (S ΓΛ’ S).filter Ξ» p β¦ p.1 < p.2
T.sum (Ξ» p β¦ a p.1 * a p.2 / (a p.1 + a p.2))
β€ S.card β’ T.sum (Ξ» p β¦ a p.1 * a p.2) / (2 * S.sum a) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2006 A4
Let $F$ be a totally ordered field and $a_1, a_2, β¦, a_n β F$ be positive.
Prove the inequality
$$ \sum_{i < j} \frac{a_i a_j}{a_i + a_j}
β€ \frac{n}{2(a_1 + a_2 + β¦ + a_n)} \sum_{i < j} a_i a_j. $$
-/
theorem imo_sl_2006_A4 [LinearOrderedField F] [LinearOrder ΞΉ]
(a : ΞΉ β F) {S : Finset ΞΉ} (hS : β i β S, 0 < a i) :
let T := (S ΓΛ’ S).filter Ξ» p β¦ p.1 < p.2
T.sum (Ξ» p β¦ a p.1 * a p.2 / (a p.1 + a p.2))
β€ S.card β’ T.sum (Ξ» p β¦ a p.1 * a p.2) / (2 * S.sum a) := by sorry
|
algebra
|
imo_sl_2006_A6
| true |
[
"algebra"
] |
2006_A6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
International Mathematical Olympiad 2006, Problem 3
Find the smallest M β β such that for any a, b, c β β,
|ab(aΒ² - bΒ²) + bc(bΒ² - cΒ²) + ca(cΒ² - aΒ²)| β€ M(aΒ² + bΒ² + cΒ²)Β².
-/
|
def good [LinearOrderedCommRing R] (M : R) :=
β a b c : R, |a * b * (a ^ 2 - b ^ 2) + b * c * (b ^ 2 - c ^ 2) + c * a * (c ^ 2 - a ^ 2)|
β€ M * (a ^ 2 + b ^ 2 + c ^ 2) ^ 2
theorem good_iff : good M β 9 * β2 β€ 32 * M := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
International Mathematical Olympiad 2006, Problem 3
Find the smallest M β β such that for any a, b, c β β,
|ab(aΒ² - bΒ²) + bc(bΒ² - cΒ²) + ca(cΒ² - aΒ²)| β€ M(aΒ² + bΒ² + cΒ²)Β².
-/
def good [LinearOrderedCommRing R] (M : R) :=
β a b c : R, |a * b * (a ^ 2 - b ^ 2) + b * c * (b ^ 2 - c ^ 2) + c * a * (c ^ 2 - a ^ 2)|
β€ M * (a ^ 2 + b ^ 2 + c ^ 2) ^ 2
theorem good_iff : good M β 9 * β2 β€ 32 * M := by sorry
|
algebra
|
imo_sl_2006_N1
| true |
[
"number theory"
] |
2006_N1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2006 N1 (P4)
Determine all pairs $(x, y) β β Γ β€$ such that $1 + 2^x + 2^{2x + 1} = y^2$.
-/
|
/- special open -/ open Finset
def good (x : β) (y : β€) := 2 ^ (2 * x + 1) + 2 ^ x + 1 = y ^ 2
theorem imo_sl_2006_N1 :
good x y β (x = 0 β§ (y = 2 β¨ y = -2)) β¨ (x = 4 β§ (y = 23 β¨ y = -23)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2006 N1 (P4)
Determine all pairs $(x, y) β β Γ β€$ such that $1 + 2^x + 2^{2x + 1} = y^2$.
-/
/- special open -/ open Finset
def good (x : β) (y : β€) := 2 ^ (2 * x + 1) + 2 ^ x + 1 = y ^ 2
theorem imo_sl_2006_N1 :
good x y β (x = 0 β§ (y = 2 β¨ y = -2)) β¨ (x = 4 β§ (y = 23 β¨ y = -23)) := by sorry
|
number theory
|
imo_sl_2006_N3
| true |
[
"number theory"
] |
2006_N3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2006 N3
For each $n β β$, define
$$ f(n) = \frac{1}{n} \sum_{k = 1}^n \left\lfloor \frac{n}{k} \right\rfloor. $$
1. Prove that $f(n + 1) > f(n)$ infinitely often.
2. Prove that $f(n + 1) < f(n)$ infinitely often.
-/
|
/- special open -/ open Finset
def g (n : β) : β := (range n).sum Ξ» k β¦ n / (k + 1)
def f (n : β) : β := ((g n : β€) : β) / ((n : β€) : β)
theorem imo_sl_2006_N3 : {n : β | f n < f n.succ}.Infinite β§ {n : β | f n.succ < f n}.Infinite := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2006 N3
For each $n β β$, define
$$ f(n) = \frac{1}{n} \sum_{k = 1}^n \left\lfloor \frac{n}{k} \right\rfloor. $$
1. Prove that $f(n + 1) > f(n)$ infinitely often.
2. Prove that $f(n + 1) < f(n)$ infinitely often.
-/
/- special open -/ open Finset
def g (n : β) : β := (range n).sum Ξ» k β¦ n / (k + 1)
def f (n : β) : β := ((g n : β€) : β) / ((n : β€) : β)
theorem imo_sl_2006_N3 : {n : β | f n < f n.succ}.Infinite β§ {n : β | f n.succ < f n}.Infinite := by sorry
|
number theory
|
imo_sl_2006_N5
| true |
[
"number theory"
] |
2006_N5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2006 N5
Let $p > 3$ be a prime.
Determine all pairs $(x, y)$ of integers such that
$$ \sum_{k = 0}^{p - 1} x^k = y^{p - 2} - 1. $$
-/
|
/- special open -/ open Finset
theorem imo_sl_2006_N5 {p : β} (hp : p.Prime) (h : 3 < p) (x y : β€) :
Β¬(range p).sum (x ^ Β·) = y ^ (p - 2) - 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2006 N5
Let $p > 3$ be a prime.
Determine all pairs $(x, y)$ of integers such that
$$ \sum_{k = 0}^{p - 1} x^k = y^{p - 2} - 1. $$
-/
/- special open -/ open Finset
theorem imo_sl_2006_N5 {p : β} (hp : p.Prime) (h : 3 < p) (x y : β€) :
Β¬(range p).sum (x ^ Β·) = y ^ (p - 2) - 1 := by sorry
|
number theory
|
imo_sl_2006_N7
| true |
[
"number theory"
] |
2006_N7
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2006 N7
Prove that for any $b β β$ and $n β β^+$, there exists $m β β$ such that $n β£ b^m + m$.
-/
|
theorem imo_sl_2006_N7 (hn : 0 < n) (b) : β m, n β£ b ^ m + m := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2006 N7
Prove that for any $b β β$ and $n β β^+$, there exists $m β β$ such that $n β£ b^m + m$.
-/
theorem imo_sl_2006_N7 (hn : 0 < n) (b) : β m, n β£ b ^ m + m := by sorry
|
number theory
|
imo_sl_2007_A1a
| true |
[
"algebra"
] |
2007_A1a
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2007 A1, Part 1
Fix a linearly ordered abelian group $G$ and a positive integer $n$.
Consider a sequence $(a_i)_{i=0}^n$ of elements of $G$.
Let $(x_i)_{i=0}^n$ be a non-decreasing sequence in $G$, and let
$$ L = \max_{j \le n} |x_j - a_j|. $$
Prove that for any non-decreasing sequence $(x_i)$, the inequality $2L \ge a_k - a_m$ holds for any $k \le m \le n$.
-/
|
/- special open -/ open Finset
variable [LinearOrder Ξ±]
/--
The sequence `seqMax f` represents the running maximum of a sequence `f`.
`seqMax f n = max(f 0, f 1, ..., f n)`.
-/
def seqMax (f : Nat β Ξ±) : Nat β Ξ±
| 0 => f 0
| n + 1 => max (seqMax f n) (f n.succ)
theorem imo_sl_2007_A1a_part1 [LinearOrderedAddCommGroup G]
(a : β β G) (n : β) (x : β β G) (k m : β)
(h_mono : Monotone x) (h_le : k β€ m) (h_n : m β€ n) :
a k - a m β€ 2 β’ seqMax (Ξ» i β¦ |x i - a i|) n := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2007 A1, Part 1
Fix a linearly ordered abelian group $G$ and a positive integer $n$.
Consider a sequence $(a_i)_{i=0}^n$ of elements of $G$.
Let $(x_i)_{i=0}^n$ be a non-decreasing sequence in $G$, and let
$$ L = \max_{j \le n} |x_j - a_j|. $$
Prove that for any non-decreasing sequence $(x_i)$, the inequality $2L \ge a_k - a_m$ holds for any $k \le m \le n$.
-/
/- special open -/ open Finset
variable [LinearOrder Ξ±]
/--
The sequence `seqMax f` represents the running maximum of a sequence `f`.
`seqMax f n = max(f 0, f 1, ..., f n)`.
-/
def seqMax (f : Nat β Ξ±) : Nat β Ξ±
| 0 => f 0
| n + 1 => max (seqMax f n) (f n.succ)
theorem imo_sl_2007_A1a_part1 [LinearOrderedAddCommGroup G]
(a : β β G) (n : β) (x : β β G) (k m : β)
(h_mono : Monotone x) (h_le : k β€ m) (h_n : m β€ n) :
a k - a m β€ 2 β’ seqMax (Ξ» i β¦ |x i - a i|) n := by sorry
|
algebra
|
imo_sl_2007_A1b
| true |
[
"algebra"
] |
2007_A1b
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2007 A1, Part 2
Fix a linearly ordered abelian group $G$ and a positive integer $n$.
Consider a sequence $(a_i)_{i=0}^n$ of elements of $G$.
Let $L(x) = \max_{j \le n} |x_j - a_j|$ for a non-decreasing sequence $(x_i)$.
Prove that for any $g \in G$ such that $2g \ge a_k - a_m$ for any $k \le m \le n$,
there exists a non-decreasing sequence $(x_i)$ such that $L(x) \le g$.
-/
|
/- special open -/ open Finset
variable [LinearOrder Ξ±]
/--
The sequence `seqMax f` represents the running maximum of a sequence `f`.
`seqMax f n = max(f 0, f 1, ..., f n)`.
-/
def seqMax (f : Nat β Ξ±) : Nat β Ξ±
| 0 => f 0
| n + 1 => max (seqMax f n) (f n.succ)
theorem imo_sl_2007_A1b_part2 [LinearOrderedAddCommGroup G]
(a : β β G) (n : β) (g : G)
(h_g : β k m : β, k β€ m β m β€ n β a k - a m β€ 2 β’ g) :
β x : β β G, Monotone x β§ seqMax (Ξ» i β¦ |x i - a i|) n β€ g := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2007 A1, Part 2
Fix a linearly ordered abelian group $G$ and a positive integer $n$.
Consider a sequence $(a_i)_{i=0}^n$ of elements of $G$.
Let $L(x) = \max_{j \le n} |x_j - a_j|$ for a non-decreasing sequence $(x_i)$.
Prove that for any $g \in G$ such that $2g \ge a_k - a_m$ for any $k \le m \le n$,
there exists a non-decreasing sequence $(x_i)$ such that $L(x) \le g$.
-/
/- special open -/ open Finset
variable [LinearOrder Ξ±]
/--
The sequence `seqMax f` represents the running maximum of a sequence `f`.
`seqMax f n = max(f 0, f 1, ..., f n)`.
-/
def seqMax (f : Nat β Ξ±) : Nat β Ξ±
| 0 => f 0
| n + 1 => max (seqMax f n) (f n.succ)
theorem imo_sl_2007_A1b_part2 [LinearOrderedAddCommGroup G]
(a : β β G) (n : β) (g : G)
(h_g : β k m : β, k β€ m β m β€ n β a k - a m β€ 2 β’ g) :
β x : β β G, Monotone x β§ seqMax (Ξ» i β¦ |x i - a i|) n β€ g := by sorry
|
algebra
|
imo_sl_2007_A2
| true |
[
"algebra"
] |
2007_A2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2007 A2
A function $f : \mathbb{N}^+ \to \mathbb{N}^+$ is called *good* if, for any positive integers $m, n$, the following inequality holds:
$$ f(m + n) + 1 \ge f(m) + f(f(n)). $$
For any given $N \in \mathbb{N}^+$, determine all possible values of $k \in \mathbb{N}^+$ for which there exists a good function $f$ such that $f(N) = k$.
The solution states that:
- If $N=1$, the only possible value is $k=1$.
- If $N > 1$, the possible values are all $k$ such that $k \le N+1$.
-/
|
/- special open -/ open Finset
/--
A function `f : β+ β β+` is "good" if it satisfies the problem's inequality.
Note the inequality is rearranged to use `β€` to align with Lean's conventions.
-/
def goodPNat (f : β+ β β+) := β m n, f m + f (f n) β€ f (m + n) + 1
theorem imo_sl_2007_A2 {N k : β+} :
(β f : β+ β β+, goodPNat f β§ f N = k) β if N = 1 then k = 1 else k β€ N + 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2007 A2
A function $f : \mathbb{N}^+ \to \mathbb{N}^+$ is called *good* if, for any positive integers $m, n$, the following inequality holds:
$$ f(m + n) + 1 \ge f(m) + f(f(n)). $$
For any given $N \in \mathbb{N}^+$, determine all possible values of $k \in \mathbb{N}^+$ for which there exists a good function $f$ such that $f(N) = k$.
The solution states that:
- If $N=1$, the only possible value is $k=1$.
- If $N > 1$, the possible values are all $k$ such that $k \le N+1$.
-/
/- special open -/ open Finset
/--
A function `f : β+ β β+` is "good" if it satisfies the problem's inequality.
Note the inequality is rearranged to use `β€` to align with Lean's conventions.
-/
def goodPNat (f : β+ β β+) := β m n, f m + f (f n) β€ f (m + n) + 1
theorem imo_sl_2007_A2 {N k : β+} :
(β f : β+ β β+, goodPNat f β§ f N = k) β if N = 1 then k = 1 else k β€ N + 1 := by sorry
|
algebra
|
imo_sl_2007_A3
| true |
[
"algebra"
] |
2007_A3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2007 A3
Let $F$ be a totally ordered field, and let $n$ be a positive integer.
Let $x, y \in F$ be positive elements such that $x^n + y^n = 1$.
Prove that
$$ \left(\sum_{k = 1}^n \frac{1 + x^{2k}}{1 + x^{4k}}\right)
\left(\sum_{k = 1}^n \frac{1 + y^{2k}}{1 + y^{4k}}\right)
< \frac{1}{(1 - x)(1 - y)}. $$
-/
|
/- special open -/ open Finset
theorem imo_sl_2007_A3 [LinearOrderedField F] (n : Nat) {x y : F} (hx : 0 < x) (hy : 0 < y) (h : x ^ n + y ^ n = 1) :
(range n).sum (Ξ» i β¦ (1 + x ^ (2 * i.succ)) / (1 + x ^ (4 * i.succ)))
* (range n).sum (Ξ» i β¦ (1 + y ^ (2 * i.succ)) / (1 + y ^ (4 * i.succ)))
< ((1 - x) * (1 - y))β»ΒΉ := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2007 A3
Let $F$ be a totally ordered field, and let $n$ be a positive integer.
Let $x, y \in F$ be positive elements such that $x^n + y^n = 1$.
Prove that
$$ \left(\sum_{k = 1}^n \frac{1 + x^{2k}}{1 + x^{4k}}\right)
\left(\sum_{k = 1}^n \frac{1 + y^{2k}}{1 + y^{4k}}\right)
< \frac{1}{(1 - x)(1 - y)}. $$
-/
/- special open -/ open Finset
theorem imo_sl_2007_A3 [LinearOrderedField F] (n : Nat) {x y : F} (hx : 0 < x) (hy : 0 < y) (h : x ^ n + y ^ n = 1) :
(range n).sum (Ξ» i β¦ (1 + x ^ (2 * i.succ)) / (1 + x ^ (4 * i.succ)))
* (range n).sum (Ξ» i β¦ (1 + y ^ (2 * i.succ)) / (1 + y ^ (4 * i.succ)))
< ((1 - x) * (1 - y))β»ΒΉ := by sorry
|
algebra
|
imo_sl_2007_A4
| true |
[
"algebra"
] |
2007_A4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2007 A4
Let $G$ be a totally ordered abelian group and $G_{>0} = \{x \in G : x > 0\}$.
Find all functions $f : G_{>0} \to G_{>0}$ such that for any $x, y \in G_{>0}$,
$$ f(x + f(y)) = f(x + y) + f(y). $$
-/
|
variable [LinearOrderedAddCommGroup G]
/--
This defines the property of a function `f` satisfying the given functional equation
on the subtype of positive elements `{x : G // 0 < x}`.
-/
def IsGood (f : {x : G // 0 < x} β {x : G // 0 < x}) : Prop :=
β x y, f (x + f y) = f (x + y) + f y
/--
The solutions to the functional equation are functions that double the input.
-/
theorem imo_sl_2007_A4 (f : {x : G // 0 < x} β {x : G // 0 < x}) :
IsGood f β f = (fun x β¦ x + x) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2007 A4
Let $G$ be a totally ordered abelian group and $G_{>0} = \{x \in G : x > 0\}$.
Find all functions $f : G_{>0} \to G_{>0}$ such that for any $x, y \in G_{>0}$,
$$ f(x + f(y)) = f(x + y) + f(y). $$
-/
variable [LinearOrderedAddCommGroup G]
/--
This defines the property of a function `f` satisfying the given functional equation
on the subtype of positive elements `{x : G // 0 < x}`.
-/
def IsGood (f : {x : G // 0 < x} β {x : G // 0 < x}) : Prop :=
β x y, f (x + f y) = f (x + y) + f y
/--
The solutions to the functional equation are functions that double the input.
-/
theorem imo_sl_2007_A4 (f : {x : G // 0 < x} β {x : G // 0 < x}) :
IsGood f β f = (fun x β¦ x + x) := by sorry
|
algebra
|
imo_sl_2007_A6
| true |
[
"algebra"
] |
2007_A6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2007 A6
Let $R$ be a totally ordered commutative ring and let $n \ge 5$ be an integer.
Prove that for any sequence $a_1, a_2, \dots, a_n \in R$, the following inequality holds:
$$ \left(3 \sum_{i = 1}^n a_i^2 a_{i + 1}\right)^2 \le 2 \left(\sum_{i = 1}^n a_i^2\right)^3 $$
where the sum is cyclic, i.e., $a_{n+1} = a_1$.
-/
|
/- special open -/ open Finset
theorem imo_sl_2007_A6 [LinearOrderedCommRing R] (n : β) (hn : 5 β€ n) (a : Fin n β R) :
(3 * β i, a i ^ 2 * a (finRotate n i)) ^ 2 β€ 2 * (β i, a i ^ 2) ^ 3 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2007 A6
Let $R$ be a totally ordered commutative ring and let $n \ge 5$ be an integer.
Prove that for any sequence $a_1, a_2, \dots, a_n \in R$, the following inequality holds:
$$ \left(3 \sum_{i = 1}^n a_i^2 a_{i + 1}\right)^2 \le 2 \left(\sum_{i = 1}^n a_i^2\right)^3 $$
where the sum is cyclic, i.e., $a_{n+1} = a_1$.
-/
/- special open -/ open Finset
theorem imo_sl_2007_A6 [LinearOrderedCommRing R] (n : β) (hn : 5 β€ n) (a : Fin n β R) :
(3 * β i, a i ^ 2 * a (finRotate n i)) ^ 2 β€ 2 * (β i, a i ^ 2) ^ 3 := by sorry
|
algebra
|
imo_sl_2007_C3
| true |
[
"combinatorics"
] |
2007_C3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2007 C3
Find all finite groups $G$ such that there exists a subset $S \subseteq G$ for which
the number of triples $(x, y, z) \in S^3 \cup (G \setminus S)^3$ such that $xyz = 1$ is $2007$.
-/
|
/- special open -/ open Finset
variable [Fintype G] [DecidableEq G] [Group G]
def tripleSet (S : Finset G) : Finset (Fin 3 β G) :=
(Fintype.piFinset fun _ β¦ S) βͺ (Fintype.piFinset fun _ β¦ SαΆ)
def filtered_tripleSet (S : Finset G) : Finset (Fin 3 β G) :=
(tripleSet S).filter fun p β¦ p 0 * p 1 * p 2 = 1
theorem imo_sl_2007_C3 :
(β S : Finset G, (filtered_tripleSet S).card = 2007) β
Fintype.card G = 69 β¨ Fintype.card G = 84 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2007 C3
Find all finite groups $G$ such that there exists a subset $S \subseteq G$ for which
the number of triples $(x, y, z) \in S^3 \cup (G \setminus S)^3$ such that $xyz = 1$ is $2007$.
-/
/- special open -/ open Finset
variable [Fintype G] [DecidableEq G] [Group G]
def tripleSet (S : Finset G) : Finset (Fin 3 β G) :=
(Fintype.piFinset fun _ β¦ S) βͺ (Fintype.piFinset fun _ β¦ SαΆ)
def filtered_tripleSet (S : Finset G) : Finset (Fin 3 β G) :=
(tripleSet S).filter fun p β¦ p 0 * p 1 * p 2 = 1
theorem imo_sl_2007_C3 :
(β S : Finset G, (filtered_tripleSet S).card = 2007) β
Fintype.card G = 69 β¨ Fintype.card G = 84 := by sorry
|
combinatorics
|
imo_sl_2007_N1
| true |
[
"number theory"
] |
2007_N1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2007 N1
Find all pairs $(k, n) \in \mathbb{N}^2$ such that $7^k - 3^n \mid k^4 + n^2$.
-/
|
def good (k n : β) : Prop := (7 : β€) ^ k - 3 ^ n β£ (k ^ 4 + n ^ 2 : β)
theorem imo_sl_2007_N1 (k n : β) :
good k n β (k = 0 β§ n = 0) β¨ (k = 2 β§ n = 4) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2007 N1
Find all pairs $(k, n) \in \mathbb{N}^2$ such that $7^k - 3^n \mid k^4 + n^2$.
-/
def good (k n : β) : Prop := (7 : β€) ^ k - 3 ^ n β£ (k ^ 4 + n ^ 2 : β)
theorem imo_sl_2007_N1 (k n : β) :
good k n β (k = 0 β§ n = 0) β¨ (k = 2 β§ n = 4) := by sorry
|
number theory
|
imo_sl_2007_N2
| true |
[
"number theory"
] |
2007_N2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2007 N2
Fix integers $b > 0$ and $n β₯ 0$.
Suppose that for each $k β β^+$, there exists an integer $a$ such that $k β£ b - a^n$.
Prove that $b = A^n$ for some integer $A$.
-/
|
/- special open -/ open Finset
theorem imo_sl_2007_N2 (h : 0 < b) (h0 : β k : β, 0 < k β β c : β€, (k : β€) β£ b - c ^ n) :
β a : β€, b = a ^ n := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2007 N2
Fix integers $b > 0$ and $n β₯ 0$.
Suppose that for each $k β β^+$, there exists an integer $a$ such that $k β£ b - a^n$.
Prove that $b = A^n$ for some integer $A$.
-/
/- special open -/ open Finset
theorem imo_sl_2007_N2 (h : 0 < b) (h0 : β k : β, 0 < k β β c : β€, (k : β€) β£ b - c ^ n) :
β a : β€, b = a ^ n := by sorry
|
number theory
|
imo_sl_2007_N6
| true |
[
"number theory"
] |
2007_N6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2007 N6 (P5)
Fix $n > 1$, and let $a$ and $b$ be positive integers such that $nab - 1 β£ (na^2 - 1)^2$.
Prove that $a = b$.
-/
|
/- special open -/ open Finset
abbrev bad_pair (n : β€) (a b : β) := n * a * b - 1 β£ (n * a ^ 2 - 1) ^ 2
theorem imo_sl_2007_N6 (hn : 1 < n) (ha : 0 < a) (hb : 0 < b) (h : bad_pair n a b) :
a = b := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2007 N6 (P5)
Fix $n > 1$, and let $a$ and $b$ be positive integers such that $nab - 1 β£ (na^2 - 1)^2$.
Prove that $a = b$.
-/
/- special open -/ open Finset
abbrev bad_pair (n : β€) (a b : β) := n * a * b - 1 β£ (n * a ^ 2 - 1) ^ 2
theorem imo_sl_2007_N6 (hn : 1 < n) (ha : 0 < a) (hb : 0 < b) (h : bad_pair n a b) :
a = b := by sorry
|
number theory
|
imo_sl_2008_A1
| true |
[
"algebra"
] |
2008_A1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2008 A1 (P4)
Let $R$ be a totally ordered commutative ring, and let $R_{>0} = \{x β R : x > 0\}$.
Find all functions $f : R_{>0} β R_{>0}$ such that for any $p, q, r, s > 0$ with $pq = rs$,
$$ (f(p)^2 + f(q)^2) (r^2 + s^2) = (p^2 + q^2) (f(r^2) + f(s^2)). $$
-/
|
/- special open -/ open Finset
structure weakGood [OrderedSemiring R] (f : R β R) : Prop where
map_pos_of_pos : β x > 0, f x > 0
good' : β p > 0, β q > 0, β r > 0, β s > 0, p * q = r * s β
(f p ^ 2 + f q ^ 2) * (r ^ 2 + s ^ 2) = (p ^ 2 + q ^ 2) * (f (r ^ 2) + f (s ^ 2))
variable [LinearOrderedField R]
def good (f : {x : R // 0 < x} β {x : R // 0 < x}) :=
β p q r s, p * q = r * s β
(f p ^ 2 + f q ^ 2) * (r ^ 2 + s ^ 2) = (p ^ 2 + q ^ 2) * (f (r ^ 2) + f (s ^ 2))
theorem imo_sl_2008_A1 [ExistsAddOfLE R] {f : {x : R // 0 < x} β {x : R // 0 < x}} :
good f β f = id β¨ β x, x * f x = 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2008 A1 (P4)
Let $R$ be a totally ordered commutative ring, and let $R_{>0} = \{x β R : x > 0\}$.
Find all functions $f : R_{>0} β R_{>0}$ such that for any $p, q, r, s > 0$ with $pq = rs$,
$$ (f(p)^2 + f(q)^2) (r^2 + s^2) = (p^2 + q^2) (f(r^2) + f(s^2)). $$
-/
/- special open -/ open Finset
structure weakGood [OrderedSemiring R] (f : R β R) : Prop where
map_pos_of_pos : β x > 0, f x > 0
good' : β p > 0, β q > 0, β r > 0, β s > 0, p * q = r * s β
(f p ^ 2 + f q ^ 2) * (r ^ 2 + s ^ 2) = (p ^ 2 + q ^ 2) * (f (r ^ 2) + f (s ^ 2))
variable [LinearOrderedField R]
def good (f : {x : R // 0 < x} β {x : R // 0 < x}) :=
β p q r s, p * q = r * s β
(f p ^ 2 + f q ^ 2) * (r ^ 2 + s ^ 2) = (p ^ 2 + q ^ 2) * (f (r ^ 2) + f (s ^ 2))
theorem imo_sl_2008_A1 [ExistsAddOfLE R] {f : {x : R // 0 < x} β {x : R // 0 < x}} :
good f β f = id β¨ β x, x * f x = 1 := by sorry
|
algebra
|
imo_sl_2008_A2a
| true |
[
"algebra"
] |
2008_A2a
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2008 A2
1. Let $F$ be an ordered field, and consider $x, y, z \in F \setminus \{1\}$ with $xyz = 1$.
Prove that $$ \frac{x^2}{(x - 1)^2} + \frac{y^2}{(y - 1)^2} + \frac{z^2}{(z - 1)^2} \ge 1. $$
-/
|
theorem imo_sl_2008_A2a_part1 [LinearOrderedField F]
{x y z : F} (hx : x β 1) (hy : y β 1) (hz : z β 1) (h : x * y * z = 1) :
1 β€ (x / (x - 1)) ^ 2 + (y / (y - 1)) ^ 2 + (z / (z - 1)) ^ 2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2008 A2
1. Let $F$ be an ordered field, and consider $x, y, z \in F \setminus \{1\}$ with $xyz = 1$.
Prove that $$ \frac{x^2}{(x - 1)^2} + \frac{y^2}{(y - 1)^2} + \frac{z^2}{(z - 1)^2} \ge 1. $$
-/
theorem imo_sl_2008_A2a_part1 [LinearOrderedField F]
{x y z : F} (hx : x β 1) (hy : y β 1) (hz : z β 1) (h : x * y * z = 1) :
1 β€ (x / (x - 1)) ^ 2 + (y / (y - 1)) ^ 2 + (z / (z - 1)) ^ 2 := by sorry
|
algebra
|
imo_sl_2008_A2b
| true |
[
"algebra"
] |
2008_A2b
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2008 A2
2. Show that there exists infinitely many triplets $(x, y, z) \in (\mathbb{Q} \setminus \{1\})^3$
with $xyz = 1$ such that the above inequality becomes equality.
-/
|
structure IsGood (p : Fin 3 β β) : Prop where
p_ne_one : β i, p i β 1
p_mul_eq_one : p 0 * p 1 * p 2 = 1
spec : (p 0 / (p 0 - 1)) ^ 2 + (p 1 / (p 1 - 1)) ^ 2 + (p 2 / (p 2 - 1)) ^ 2 = 1
theorem imo_sl_2008_A2b_part2 : {p : Fin 3 β β | IsGood p}.Infinite := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2008 A2
2. Show that there exists infinitely many triplets $(x, y, z) \in (\mathbb{Q} \setminus \{1\})^3$
with $xyz = 1$ such that the above inequality becomes equality.
-/
structure IsGood (p : Fin 3 β β) : Prop where
p_ne_one : β i, p i β 1
p_mul_eq_one : p 0 * p 1 * p 2 = 1
spec : (p 0 / (p 0 - 1)) ^ 2 + (p 1 / (p 1 - 1)) ^ 2 + (p 2 / (p 2 - 1)) ^ 2 = 1
theorem imo_sl_2008_A2b_part2 : {p : Fin 3 β β | IsGood p}.Infinite := by sorry
|
algebra
|
imo_sl_2008_A3a
| true |
[
"algebra"
] |
2008_A3a
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2008 A3
Let $Ξ±$ be a totally ordered type.
A **Spanish couple** on $Ξ±$ is a pair of strictly increasing functions $(f, g)$
from $Ξ±$ to itself such that for all $x \in Ξ±$, $f(g(g(x))) < g(f(x))$.
Determine whether there exists a Spanish couple on:
1. The set of natural numbers $β$.
-/
|
structure SpanishCouple [Preorder Ξ±] (f g : Ξ± β Ξ±) : Prop where
f_mono : StrictMono f
g_mono : StrictMono g
spec : f β g β g < g β f
theorem imo_sl_2008_A3a_part1 : Β¬ β f g : β β β, SpanishCouple f g := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2008 A3
Let $Ξ±$ be a totally ordered type.
A **Spanish couple** on $Ξ±$ is a pair of strictly increasing functions $(f, g)$
from $Ξ±$ to itself such that for all $x \in Ξ±$, $f(g(g(x))) < g(f(x))$.
Determine whether there exists a Spanish couple on:
1. The set of natural numbers $β$.
-/
structure SpanishCouple [Preorder Ξ±] (f g : Ξ± β Ξ±) : Prop where
f_mono : StrictMono f
g_mono : StrictMono g
spec : f β g β g < g β f
theorem imo_sl_2008_A3a_part1 : Β¬ β f g : β β β, SpanishCouple f g := by sorry
|
algebra
|
imo_sl_2008_A3b
| true |
[
"algebra"
] |
2008_A3b
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2008 A3
Let $Ξ±$ be a totally ordered type.
A **Spanish couple** on $Ξ±$ is a pair of strictly increasing functions $(f, g)$
from $Ξ±$ to itself such that for all $x \in Ξ±$, $f(g(g(x))) < g(f(x))$.
Determine whether there exists a Spanish couple on:
2. The set $β \times β$ with the lexicographical order.
-/
|
structure SpanishCouple [Preorder Ξ±] (f g : Ξ± β Ξ±) : Prop where
f_mono : StrictMono f
g_mono : StrictMono g
spec : f β g β g < g β f
theorem imo_sl_2008_A3b_part2 : β f g : (β Γβ β) β (β Γβ β), SpanishCouple f g := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2008 A3
Let $Ξ±$ be a totally ordered type.
A **Spanish couple** on $Ξ±$ is a pair of strictly increasing functions $(f, g)$
from $Ξ±$ to itself such that for all $x \in Ξ±$, $f(g(g(x))) < g(f(x))$.
Determine whether there exists a Spanish couple on:
2. The set $β \times β$ with the lexicographical order.
-/
structure SpanishCouple [Preorder Ξ±] (f g : Ξ± β Ξ±) : Prop where
f_mono : StrictMono f
g_mono : StrictMono g
spec : f β g β g < g β f
theorem imo_sl_2008_A3b_part2 : β f g : (β Γβ β) β (β Γβ β), SpanishCouple f g := by sorry
|
algebra
|
imo_sl_2008_A5
| true |
[
"algebra"
] |
2008_A5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2008 A5
Let $F$ be a totally ordered field and $a_1, a_2, a_3, a_4 \in F$ be positive elements.
Suppose that $a_1 a_2 a_3 a_4 = 1$ and
$$ \sum_{i = 1}^4 \frac{a_i}{a_{i + 1}} < \sum_{i = 1}^4 a_i. $$
Prove that
$$ \sum_{i = 1}^4 a_i < \sum_{i = 1}^4 \frac{a_{i + 1}}{a_i}. $$
-/
|
theorem imo_sl_2008_A5 [LinearOrderedField F]
{a b c d : F} (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) (hd : 0 < d)
(h_prod : a * b * c * d = 1)
(h_ineq : a / b + b / c + c / d + d / a < a + b + c + d) :
a + b + c + d < b / a + c / b + d / c + a / d := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2008 A5
Let $F$ be a totally ordered field and $a_1, a_2, a_3, a_4 \in F$ be positive elements.
Suppose that $a_1 a_2 a_3 a_4 = 1$ and
$$ \sum_{i = 1}^4 \frac{a_i}{a_{i + 1}} < \sum_{i = 1}^4 a_i. $$
Prove that
$$ \sum_{i = 1}^4 a_i < \sum_{i = 1}^4 \frac{a_{i + 1}}{a_i}. $$
-/
theorem imo_sl_2008_A5 [LinearOrderedField F]
{a b c d : F} (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) (hd : 0 < d)
(h_prod : a * b * c * d = 1)
(h_ineq : a / b + b / c + c / d + d / a < a + b + c + d) :
a + b + c + d < b / a + c / b + d / c + a / d := by sorry
|
algebra
|
imo_sl_2008_A7
| true |
[
"algebra"
] |
2008_A7
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2008 A7
Let $F$ be a totally ordered field.
1. Prove that, for any $a, b, c, d \in F$ positive,
$$ \frac{(a - b)(a - c)}{a + b + c} + \frac{(b - c)(b - d)}{b + c + d} +
\frac{(c - d)(c - a)}{c + d + a} + \frac{(d - a)(d - b)}{d + a + b} \ge 0. $$
2. Find all cases of equality.
-/
|
theorem imo_sl_2008_A7 [LinearOrderedField F]
{a b c d : F} (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) (hd : 0 < d) :
(0 β€ (a - b) * (a - c) / (a + b + c) + (b - c) * (b - d) / (b + c + d) +
(c - d) * (c - a) / (c + d + a) + (d - a) * (d - b) / (d + a + b)) β§
((a - b) * (a - c) / (a + b + c) + (b - c) * (b - d) / (b + c + d) +
(c - d) * (c - a) / (c + d + a) + (d - a) * (d - b) / (d + a + b) = 0 β
a = c β§ b = d) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2008 A7
Let $F$ be a totally ordered field.
1. Prove that, for any $a, b, c, d \in F$ positive,
$$ \frac{(a - b)(a - c)}{a + b + c} + \frac{(b - c)(b - d)}{b + c + d} +
\frac{(c - d)(c - a)}{c + d + a} + \frac{(d - a)(d - b)}{d + a + b} \ge 0. $$
2. Find all cases of equality.
-/
theorem imo_sl_2008_A7 [LinearOrderedField F]
{a b c d : F} (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) (hd : 0 < d) :
(0 β€ (a - b) * (a - c) / (a + b + c) + (b - c) * (b - d) / (b + c + d) +
(c - d) * (c - a) / (c + d + a) + (d - a) * (d - b) / (d + a + b)) β§
((a - b) * (a - c) / (a + b + c) + (b - c) * (b - d) / (b + c + d) +
(c - d) * (c - a) / (c + d + a) + (d - a) * (d - b) / (d + a + b) = 0 β
a = c β§ b = d) := by sorry
|
algebra
|
imo_sl_2008_C4
| true |
[
"combinatorics"
] |
2008_C4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2008 C4
Let $n$ and $d$ be positive integers. Consider $2n$ lamps labelled with a pair $(b, m)$ where
$b \in \{0, 1\}$ and $m \in \{0, 1, \ldots, n - 1\}$. Initially, all the lamps are off.
Consider sequences of $k = 2d + n$ steps, where at each step, one of the lamps is switched
(off to on and vice versa).
Let $S_N$ be the set of $k$-step sequences ending in a state where the lamps labelled $(b, m)$
are on if and only if $b = 0$.
Let $S_M \subseteq S_N$ consist of the sequences that do not touch the lamps labelled
$(0, m)$ at all.
Find the ratio $|S_N|/|S_M|$.
-/
|
/- special open -/ open Finset
variable (I Ξ : Type) [Fintype I] [Fintype Ξ]
def IsNSequence [DecidableEq I] [DecidableEq Ξ] (f : I β Fin 2 Γ Ξ) : Prop :=
β p : Fin 2 Γ Ξ, (univ.filter (f Β· = p)).card % 2 = p.1.val
noncomputable instance IsNSequence.instDecidablePred [DecidableEq I] [DecidableEq Ξ] :
DecidablePred (IsNSequence I Ξ) := by
unfold IsNSequence; infer_instance
def IsMSequence [DecidableEq I] [DecidableEq Ξ] (f : I β Ξ) : Prop :=
β l : Ξ, (univ.filter (f Β· = l)).card % 2 = 1
noncomputable instance IsMSequence.instDecidablePred [DecidableEq I] [DecidableEq Ξ] :
DecidablePred (IsMSequence I Ξ) := by
unfold IsMSequence; infer_instance
theorem imo_sl_2008_C4 [DecidableEq I] [DecidableEq Ξ] :
Fintype.card { f : I β Fin 2 Γ Ξ // IsNSequence I Ξ f } =
2 ^ (Fintype.card I - Fintype.card Ξ) * Fintype.card { f : I β Ξ // IsMSequence I Ξ f } := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2008 C4
Let $n$ and $d$ be positive integers. Consider $2n$ lamps labelled with a pair $(b, m)$ where
$b \in \{0, 1\}$ and $m \in \{0, 1, \ldots, n - 1\}$. Initially, all the lamps are off.
Consider sequences of $k = 2d + n$ steps, where at each step, one of the lamps is switched
(off to on and vice versa).
Let $S_N$ be the set of $k$-step sequences ending in a state where the lamps labelled $(b, m)$
are on if and only if $b = 0$.
Let $S_M \subseteq S_N$ consist of the sequences that do not touch the lamps labelled
$(0, m)$ at all.
Find the ratio $|S_N|/|S_M|$.
-/
/- special open -/ open Finset
variable (I Ξ : Type) [Fintype I] [Fintype Ξ]
def IsNSequence [DecidableEq I] [DecidableEq Ξ] (f : I β Fin 2 Γ Ξ) : Prop :=
β p : Fin 2 Γ Ξ, (univ.filter (f Β· = p)).card % 2 = p.1.val
noncomputable instance IsNSequence.instDecidablePred [DecidableEq I] [DecidableEq Ξ] :
DecidablePred (IsNSequence I Ξ) := by
unfold IsNSequence; infer_instance
def IsMSequence [DecidableEq I] [DecidableEq Ξ] (f : I β Ξ) : Prop :=
β l : Ξ, (univ.filter (f Β· = l)).card % 2 = 1
noncomputable instance IsMSequence.instDecidablePred [DecidableEq I] [DecidableEq Ξ] :
DecidablePred (IsMSequence I Ξ) := by
unfold IsMSequence; infer_instance
theorem imo_sl_2008_C4 [DecidableEq I] [DecidableEq Ξ] :
Fintype.card { f : I β Fin 2 Γ Ξ // IsNSequence I Ξ f } =
2 ^ (Fintype.card I - Fintype.card Ξ) * Fintype.card { f : I β Ξ // IsMSequence I Ξ f } := by sorry
|
combinatorics
|
imo_sl_2009_A2
| true |
[
"algebra"
] |
2009_A2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2009 A2
Let $F$ be a totally ordered field, and let $a, b, c \in F$ be positive elements.
Prove that
$$ \frac{1}{(2a + b + c)^2} + \frac{1}{(2b + c + a)^2} + \frac{1}{(2c + a + b)^2}
\le \frac{3}{16(ab+bc+ca)}. $$
-/
|
theorem imo_sl_2009_A2 [LinearOrderedField F]
{a b c : F} (ha : 0 < a) (hb : 0 < b) (hc : 0 < c)
(h_norm : aβ»ΒΉ + bβ»ΒΉ + cβ»ΒΉ = a + b + c) :
((2 * a + b + c) ^ 2)β»ΒΉ + ((2 * b + c + a) ^ 2)β»ΒΉ + ((2 * c + a + b) ^ 2)β»ΒΉ β€ 3 / 16 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2009 A2
Let $F$ be a totally ordered field, and let $a, b, c \in F$ be positive elements.
Prove that
$$ \frac{1}{(2a + b + c)^2} + \frac{1}{(2b + c + a)^2} + \frac{1}{(2c + a + b)^2}
\le \frac{3}{16(ab+bc+ca)}. $$
-/
theorem imo_sl_2009_A2 [LinearOrderedField F]
{a b c : F} (ha : 0 < a) (hb : 0 < b) (hc : 0 < c)
(h_norm : aβ»ΒΉ + bβ»ΒΉ + cβ»ΒΉ = a + b + c) :
((2 * a + b + c) ^ 2)β»ΒΉ + ((2 * b + c + a) ^ 2)β»ΒΉ + ((2 * c + a + b) ^ 2)β»ΒΉ β€ 3 / 16 := by sorry
|
algebra
|
imo_sl_2009_A3a
| true |
[
"algebra"
] |
2009_A3a
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2009 A3
Find all functions $f : \mathbb{N} \to \mathbb{N}$ such that for any $x, y \in \mathbb{N}$, the numbers
$x$, $f(y)$, and $f(y + f(x))$ form the sides of a possibly degenerate triangle.
-/
|
structure IsNatTriangle (x y z : β) : Prop where
side_x : x β€ y + z
side_y : y β€ z + x
side_z : z β€ x + y
def IsGoodNat (f : β β β) : Prop :=
β x y, IsNatTriangle x (f y) (f (y + f x))
theorem imo_sl_2009_A3a_nat (f : β β β) : IsGoodNat f β f = id := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2009 A3
Find all functions $f : \mathbb{N} \to \mathbb{N}$ such that for any $x, y \in \mathbb{N}$, the numbers
$x$, $f(y)$, and $f(y + f(x))$ form the sides of a possibly degenerate triangle.
-/
structure IsNatTriangle (x y z : β) : Prop where
side_x : x β€ y + z
side_y : y β€ z + x
side_z : z β€ x + y
def IsGoodNat (f : β β β) : Prop :=
β x y, IsNatTriangle x (f y) (f (y + f x))
theorem imo_sl_2009_A3a_nat (f : β β β) : IsGoodNat f β f = id := by sorry
|
algebra
|
imo_sl_2009_A3b
| true |
[
"algebra"
] |
2009_A3b
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2009 A3
The original problem statement. Find all functions $f : \mathbb{N}^+ \to \mathbb{N}^+$ such that for any
$x, y \in \mathbb{N}^+$, the numbers $x$, $f(y)$, and $f(y + f(x) - 1)$ form the sides of a
non-degenerate triangle.
-/
|
structure IsPNatTriangle (x y z : β+) : Prop where
side_x : x < y + z
side_y : y < z + x
side_z : z < x + y
def IsGoodPNat (f : β+ β β+) : Prop :=
β x y, IsPNatTriangle x (f y) (f (y + f x - 1))
theorem imo_sl_2009_A3b_pnat (f : β+ β β+) : IsGoodPNat f β f = id := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2009 A3
The original problem statement. Find all functions $f : \mathbb{N}^+ \to \mathbb{N}^+$ such that for any
$x, y \in \mathbb{N}^+$, the numbers $x$, $f(y)$, and $f(y + f(x) - 1)$ form the sides of a
non-degenerate triangle.
-/
structure IsPNatTriangle (x y z : β+) : Prop where
side_x : x < y + z
side_y : y < z + x
side_z : z < x + y
def IsGoodPNat (f : β+ β β+) : Prop :=
β x y, IsPNatTriangle x (f y) (f (y + f x - 1))
theorem imo_sl_2009_A3b_pnat (f : β+ β β+) : IsGoodPNat f β f = id := by sorry
|
algebra
|
imo_sl_2009_A5
| true |
[
"algebra"
] |
2009_A5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2009 A5
Let $R$ be a totally ordered ring.
Prove that there does not exist a function $f : R β R$ such that for all $x, y β R$,
$$ f(x - f(y)) β€ y f(x) + x. $$
-/
|
theorem imo_sl_2009_A5 [LinearOrderedRing R] (f : R β R) :
Β¬β x y, f (x - f y) β€ y * f x + x := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2009 A5
Let $R$ be a totally ordered ring.
Prove that there does not exist a function $f : R β R$ such that for all $x, y β R$,
$$ f(x - f(y)) β€ y f(x) + x. $$
-/
theorem imo_sl_2009_A5 [LinearOrderedRing R] (f : R β R) :
Β¬β x y, f (x - f y) β€ y * f x + x := by sorry
|
algebra
|
imo_sl_2009_A6
| true |
[
"algebra"
] |
2009_A6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2009 A6 (P3)
Let $f : β β β$ be a strictly increasing function.
Suppose that there exists $A, B, C, D β β$ such that
$f(f(n)) = An + B$ and $f(f(n) + 1) = Cn + D$ for any $n β β$.
Prove that there exists $M, N β β$ such that $f(n) = Mn + N$ for all $n β β$.
-/
|
theorem imo_sl_2009_A6 {f : β β β} (hf : StrictMono f)
(h : β A B, β n, f (f n) = A * n + B) (h0 : β C D, β n, f (f n + 1) = C * n + D) :
β M N, β n, f n = M * n + N := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2009 A6 (P3)
Let $f : β β β$ be a strictly increasing function.
Suppose that there exists $A, B, C, D β β$ such that
$f(f(n)) = An + B$ and $f(f(n) + 1) = Cn + D$ for any $n β β$.
Prove that there exists $M, N β β$ such that $f(n) = Mn + N$ for all $n β β$.
-/
theorem imo_sl_2009_A6 {f : β β β} (hf : StrictMono f)
(h : β A B, β n, f (f n) = A * n + B) (h0 : β C D, β n, f (f n + 1) = C * n + D) :
β M N, β n, f n = M * n + N := by sorry
|
algebra
|
imo_sl_2009_A7
| true |
[
"algebra"
] |
2009_A7
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2009 A7
Fix a domain $R$ (a ring with no zero divisors).
Find all functions $f : R \to R$ such that for all $x, y \in R$,
$$ f(x f(x + y)) = f(y f(x)) + x^2. $$
**Note:** There appears to be a typo in the provided formalization's statement
of the problem. The term `f(f(x) y)` from the source code has been changed to `f(y f(x))`
to match the official problem statement.
-/
|
variable [Ring R]
def IsGood (f : R β R) : Prop :=
β x y, f (x * f (x + y)) = f (y * f x) + x ^ 2
theorem imo_sl_2009_A7 [NoZeroDivisors R] (f : R β R) :
IsGood f β f = id β¨ f = neg := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2009 A7
Fix a domain $R$ (a ring with no zero divisors).
Find all functions $f : R \to R$ such that for all $x, y \in R$,
$$ f(x f(x + y)) = f(y f(x)) + x^2. $$
**Note:** There appears to be a typo in the provided formalization's statement
of the problem. The term `f(f(x) y)` from the source code has been changed to `f(y f(x))`
to match the official problem statement.
-/
variable [Ring R]
def IsGood (f : R β R) : Prop :=
β x y, f (x * f (x + y)) = f (y * f x) + x ^ 2
theorem imo_sl_2009_A7 [NoZeroDivisors R] (f : R β R) :
IsGood f β f = id β¨ f = neg := by sorry
|
algebra
|
imo_sl_2009_C1a
| true |
[
"combinatorics"
] |
2009_C1a
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2009 C1
Fix non-negative integers $M$ and $n$.
Two players, $A$ and $B$, play the following game on the board.
The board consists of $M$ cards in a row, one side labelled $0$ and another side labelled $1$.
Initially, all cards are labelled $1$.
Then $A$ and $B$ take turns performing a move of the following form.
Choose an index $i β β$ such that $i + n < M$ and the $(i + n)^{\text{th}}$ card shows $1$.
Then flip the $j^{\text{th}}$ card for any $i β€ j β€ i + n$.
The last player who can make a legal move wins.
Assume that $A$ and $B$ uses the best strategy.
1. Show that the game always ends.
-/
|
/- special open -/ open Relation Finset
structure GameState (n : β) where
board : Finset β
numMoves : β
namespace GameState
def init (M n : β) : GameState n where
board := range M
numMoves := 0
inductive ValidMove (X : GameState n) : GameState n β Prop
| flip (i : β) (h : i + n β X.board) :
ValidMove X β¨symmDiff X.board (Icc i (i + n)), X.numMoves.succβ©
def IsReachable : GameState n β GameState n β Prop := ReflTransGen ValidMove
def Ends (X : GameState n) := β Y : GameState n, Β¬X.ValidMove Y
def P1Wins {X : GameState n} (_ : X.Ends) : Prop := X.numMoves % 2 = 1
theorem imo_sl_2009_C1a_part1 {M n : β} {X : GameState n} (h : (init M n).IsReachable X) :
X.numMoves < 2 ^ M := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2009 C1
Fix non-negative integers $M$ and $n$.
Two players, $A$ and $B$, play the following game on the board.
The board consists of $M$ cards in a row, one side labelled $0$ and another side labelled $1$.
Initially, all cards are labelled $1$.
Then $A$ and $B$ take turns performing a move of the following form.
Choose an index $i β β$ such that $i + n < M$ and the $(i + n)^{\text{th}}$ card shows $1$.
Then flip the $j^{\text{th}}$ card for any $i β€ j β€ i + n$.
The last player who can make a legal move wins.
Assume that $A$ and $B$ uses the best strategy.
1. Show that the game always ends.
-/
/- special open -/ open Relation Finset
structure GameState (n : β) where
board : Finset β
numMoves : β
namespace GameState
def init (M n : β) : GameState n where
board := range M
numMoves := 0
inductive ValidMove (X : GameState n) : GameState n β Prop
| flip (i : β) (h : i + n β X.board) :
ValidMove X β¨symmDiff X.board (Icc i (i + n)), X.numMoves.succβ©
def IsReachable : GameState n β GameState n β Prop := ReflTransGen ValidMove
def Ends (X : GameState n) := β Y : GameState n, Β¬X.ValidMove Y
def P1Wins {X : GameState n} (_ : X.Ends) : Prop := X.numMoves % 2 = 1
theorem imo_sl_2009_C1a_part1 {M n : β} {X : GameState n} (h : (init M n).IsReachable X) :
X.numMoves < 2 ^ M := by sorry
|
combinatorics
|
imo_sl_2009_C1b
| true |
[
"combinatorics"
] |
2009_C1b
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2009 C1
Fix non-negative integers $M$ and $n$.
Two players, $A$ and $B$, play the following game on the board.
The board consists of $M$ cards in a row, one side labelled $0$ and another side labelled $1$.
Initially, all cards are labelled $1$.
Then $A$ and $B$ take turns performing a move of the following form.
Choose an index $i β β$ such that $i + n < M$ and the $(i + n)^{\text{th}}$ card shows $1$.
Then flip the $j^{\text{th}}$ card for any $i β€ j β€ i + n$.
The last player who can make a legal move wins.
Assume that $A$ and $B$ uses the best strategy.
2. Determine the outcome of the game.
-/
|
/- special open -/ open Relation Finset
structure GameState (n : β) where
board : Finset β
numMoves : β
namespace GameState
def init (M n : β) : GameState n where
board := range M
numMoves := 0
inductive ValidMove (X : GameState n) : GameState n β Prop
| flip (i : β) (h : i + n β X.board) :
ValidMove X β¨symmDiff X.board (Icc i (i + n)), X.numMoves.succβ©
def IsReachable : GameState n β GameState n β Prop := ReflTransGen ValidMove
def Ends (X : GameState n) := β Y : GameState n, Β¬X.ValidMove Y
def P1Wins {X : GameState n} (_ : X.Ends) : Prop := X.numMoves % 2 = 1
theorem imo_sl_2009_C1b_part2 {M n : β} {X : GameState n}
(h : (init M n).IsReachable X) (h0 : X.Ends) :
P1Wins h0 β M / n.succ % 2 = 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2009 C1
Fix non-negative integers $M$ and $n$.
Two players, $A$ and $B$, play the following game on the board.
The board consists of $M$ cards in a row, one side labelled $0$ and another side labelled $1$.
Initially, all cards are labelled $1$.
Then $A$ and $B$ take turns performing a move of the following form.
Choose an index $i β β$ such that $i + n < M$ and the $(i + n)^{\text{th}}$ card shows $1$.
Then flip the $j^{\text{th}}$ card for any $i β€ j β€ i + n$.
The last player who can make a legal move wins.
Assume that $A$ and $B$ uses the best strategy.
2. Determine the outcome of the game.
-/
/- special open -/ open Relation Finset
structure GameState (n : β) where
board : Finset β
numMoves : β
namespace GameState
def init (M n : β) : GameState n where
board := range M
numMoves := 0
inductive ValidMove (X : GameState n) : GameState n β Prop
| flip (i : β) (h : i + n β X.board) :
ValidMove X β¨symmDiff X.board (Icc i (i + n)), X.numMoves.succβ©
def IsReachable : GameState n β GameState n β Prop := ReflTransGen ValidMove
def Ends (X : GameState n) := β Y : GameState n, Β¬X.ValidMove Y
def P1Wins {X : GameState n} (_ : X.Ends) : Prop := X.numMoves % 2 = 1
theorem imo_sl_2009_C1b_part2 {M n : β} {X : GameState n}
(h : (init M n).IsReachable X) (h0 : X.Ends) :
P1Wins h0 β M / n.succ % 2 = 1 := by sorry
|
combinatorics
|
imo_sl_2009_C2
| true |
[
"combinatorics"
] |
2009_C2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2009 C2
For each $n β β$, find the largest integer $k$ such that the following holds:
there exists injective functions $a_1, a_2, a_3 : [k] β β$ such that
$a_1(i) + a_2(i) + a_3(i) = n$ for all $i β [k]$.
-/
|
/- special open -/ open Finset
structure GoodTripleFn (n : β) (ΞΉ : Type*) where
toFun : Fin 3 β ΞΉ β β
toFun_inj : β j, (toFun j).Injective
toFun_sum : β i, β j : Fin 3, toFun j i = n
/-- Final solution -/
theorem imo_sl_2009_C2 [Fintype ΞΉ] :
Nonempty (GoodTripleFn n ΞΉ) β Fintype.card ΞΉ β€ 2 * n / 3 + 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2009 C2
For each $n β β$, find the largest integer $k$ such that the following holds:
there exists injective functions $a_1, a_2, a_3 : [k] β β$ such that
$a_1(i) + a_2(i) + a_3(i) = n$ for all $i β [k]$.
-/
/- special open -/ open Finset
structure GoodTripleFn (n : β) (ΞΉ : Type*) where
toFun : Fin 3 β ΞΉ β β
toFun_inj : β j, (toFun j).Injective
toFun_sum : β i, β j : Fin 3, toFun j i = n
/-- Final solution -/
theorem imo_sl_2009_C2 [Fintype ΞΉ] :
Nonempty (GoodTripleFn n ΞΉ) β Fintype.card ΞΉ β€ 2 * n / 3 + 1 := by sorry
|
combinatorics
|
imo_sl_2009_C3
| true |
[
"combinatorics"
] |
2009_C3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2009 C3
Let $\{0, 1\}^*$ denote the set of finite-length binary words with letters $0$ and $1$.
Let $Ξ΅$ denote the empty word.
Define the function $f : \{0, 1\}^* β β$ recursively by $f(Ξ΅) = 1$, $f(0) = f(1) = 7$, and
$$ f(wa0) = 2 f(wa) + 3 f(w) \quad \text{and} \quad f(wa1) = 3 f(wa) + f(w). $$
Fix a word $w β L$, and let $w'$ denote the reversal of $w$.
Prove that $f(w') = f(w)$.
-/
|
/- special open -/ open List
def f : List Bool β Nat Γ Nat :=
foldr (Ξ» a (x, y) β¦ (y, match a with | false => 2 * x + 3 * y | true => 3 * x + y)) (1, 7)
theorem imo_sl_2009_C3 : β l, (f l.reverse).2 = (f l).2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2009 C3
Let $\{0, 1\}^*$ denote the set of finite-length binary words with letters $0$ and $1$.
Let $Ξ΅$ denote the empty word.
Define the function $f : \{0, 1\}^* β β$ recursively by $f(Ξ΅) = 1$, $f(0) = f(1) = 7$, and
$$ f(wa0) = 2 f(wa) + 3 f(w) \quad \text{and} \quad f(wa1) = 3 f(wa) + f(w). $$
Fix a word $w β L$, and let $w'$ denote the reversal of $w$.
Prove that $f(w') = f(w)$.
-/
/- special open -/ open List
def f : List Bool β Nat Γ Nat :=
foldr (Ξ» a (x, y) β¦ (y, match a with | false => 2 * x + 3 * y | true => 3 * x + y)) (1, 7)
theorem imo_sl_2009_C3 : β l, (f l.reverse).2 = (f l).2 := by sorry
|
combinatorics
|
imo_sl_2009_N1
| true |
[
"number theory"
] |
2009_N1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2009 N1 (P1)
Let $n$ be a positive integer.
Let $a_1, a_2, β¦, a_k$ be distinct integers in $\{1, 2, β¦, n\}$, with $k > 1$.
Prove that there exists $i β€ k$ such that $n$ does not divide $a_i (a_{i + 1} - 1)$.
Here, we denote $a_{k + 1} = a_1$.
-/
|
theorem imo_sl_2009_N1 (hk : 1 < Nat.succ k) {a : Fin (Nat.succ k) β β€}
(ha : a.Injective) {n : β} (ha0 : β i, 0 < a i β§ a i β€ n) :
Β¬β i, (n : β€) β£ a i * (a (i + 1) - 1) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2009 N1 (P1)
Let $n$ be a positive integer.
Let $a_1, a_2, β¦, a_k$ be distinct integers in $\{1, 2, β¦, n\}$, with $k > 1$.
Prove that there exists $i β€ k$ such that $n$ does not divide $a_i (a_{i + 1} - 1)$.
Here, we denote $a_{k + 1} = a_1$.
-/
theorem imo_sl_2009_N1 (hk : 1 < Nat.succ k) {a : Fin (Nat.succ k) β β€}
(ha : a.Injective) {n : β} (ha0 : β i, 0 < a i β§ a i β€ n) :
Β¬β i, (n : β€) β£ a i * (a (i + 1) - 1) := by sorry
|
number theory
|
imo_sl_2009_N2b
| true |
[
"number theory"
] |
2009_N2b
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2009 N2
For each positive integer $n$, let $Ξ©(n)$ denote the number of
prime factors of $n$, counting multiplicity.
For convenience, we denote $Ξ©(0) = 0$.
2. Prove that for any $a, b β β$, if $Ξ©((a + k)(b + k))$ is even
for all $k β β$, then $a = b$.
-/
|
/- special open -/ open ArithmeticFunction
theorem imo_sl_2009_N2b_part2 (h : β k, Even (Ξ© ((a + k) * (b + k)))) : a = b := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2009 N2
For each positive integer $n$, let $Ξ©(n)$ denote the number of
prime factors of $n$, counting multiplicity.
For convenience, we denote $Ξ©(0) = 0$.
2. Prove that for any $a, b β β$, if $Ξ©((a + k)(b + k))$ is even
for all $k β β$, then $a = b$.
-/
/- special open -/ open ArithmeticFunction
theorem imo_sl_2009_N2b_part2 (h : β k, Even (Ξ© ((a + k) * (b + k)))) : a = b := by sorry
|
number theory
|
imo_sl_2009_N2a
| true |
[
"number theory"
] |
2009_N2a
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2009 N2
For each positive integer $n$, let $Ξ©(n)$ denote the number of
prime factors of $n$, counting multiplicity.
For convenience, we denote $Ξ©(0) = 0$.
1. Prove that for any $N β β$, there exists $a, b β β$ distinct
such that $Ξ©((a + k)(b + k))$ is even for all $k < N$.
-/
|
/- special open -/ open ArithmeticFunction
theorem imo_sl_2009_N2a_part1 (N) : β a b, a β b β§ β k < N, Even (Ξ© ((a + k) * (b + k))) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2009 N2
For each positive integer $n$, let $Ξ©(n)$ denote the number of
prime factors of $n$, counting multiplicity.
For convenience, we denote $Ξ©(0) = 0$.
1. Prove that for any $N β β$, there exists $a, b β β$ distinct
such that $Ξ©((a + k)(b + k))$ is even for all $k < N$.
-/
/- special open -/ open ArithmeticFunction
theorem imo_sl_2009_N2a_part1 (N) : β a b, a β b β§ β k < N, Even (Ξ© ((a + k) * (b + k))) := by sorry
|
number theory
|
imo_sl_2009_N3
| true |
[
"number theory"
] |
2009_N3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2009 N3
Let $f : β β β€$ be a non-constant function such that
$a - b β£ f(a) - f(b)$ for any $a, b β β$.
Prove that there exists infinitely many primes $p$
that divide $f(c)$ for some $c β β$.
### Notes
In this file, the infinitude of such primes is rephrased as follows:
for any $k β β$, there exists a prime $p β₯ k$ such that
$p β£ f(c)$ for some $c β β$.
The equivalence is clear, and this avoids importing `Mathlib.Data.Set.Finite`.
-/
|
variable {f : β β β€} (h : β a b : β, (a : β€) - b β£ f a - f b)
theorem imo_sl_2009_N3 (h0 : β C : β€, β b : β, f b β C) (K : β) :
β p : β, K β€ p β§ p.Prime β§ β c, (p : β€) β£ f c := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2009 N3
Let $f : β β β€$ be a non-constant function such that
$a - b β£ f(a) - f(b)$ for any $a, b β β$.
Prove that there exists infinitely many primes $p$
that divide $f(c)$ for some $c β β$.
### Notes
In this file, the infinitude of such primes is rephrased as follows:
for any $k β β$, there exists a prime $p β₯ k$ such that
$p β£ f(c)$ for some $c β β$.
The equivalence is clear, and this avoids importing `Mathlib.Data.Set.Finite`.
-/
variable {f : β β β€} (h : β a b : β, (a : β€) - b β£ f a - f b)
theorem imo_sl_2009_N3 (h0 : β C : β€, β b : β, f b β C) (K : β) :
β p : β, K β€ p β§ p.Prime β§ β c, (p : β€) β£ f c := by sorry
|
number theory
|
imo_sl_2010_A1
| true |
[
"algebra"
] |
2010_A1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2010 A1
Let $R$ and $S$ be totally ordered rings with a floor function (i.e., `FloorRing`s).
Find all functions $f : R β S$ such that for any $x, y \in R$,
$$ f(\lfloor x \rfloor y) = f(x) \lfloor f(y) \rfloor. $$
-/
|
/- special open -/ open Classical
/-- A function `f` is "good" if it satisfies the functional equation. -/
def IsGood [LinearOrderedRing R] [FloorRing R] [LinearOrderedRing S] [FloorRing S] (f : R β S) : Prop :=
β x y, f (βxβ β’ y) = f x * βf yβ
/--
A helper definition for the discrete case: `Ξ΅` is "infinitesimal" if all its
natural number multiples are less than 1 in absolute value.
-/
def IsInfinitesimal [LinearOrderedRing S] (Ξ΅ : S) : Prop :=
β n : β, n β’ |Ξ΅| < 1
/--
For the case where `R` is isomorphic to `β€`, the solutions fall into one of
three families, captured by this inductive proposition.
-/
inductive IsAnswer [LinearOrderedRing R] [MulOneClass R]
[LinearOrderedRing S] [FloorRing S] : (R β S) β Prop
/-- Solutions that are integer-valued monoid homomorphisms. -/
| MonoidHom_cast (phi : R β* β€) :
IsAnswer (fun x β¦ (phi x : S))
/-- Solutions of the form `n β¦ (1 + Ξ΅)^n`, where `Ξ΅` is a positive infinitesimal. -/
| one_add_Ξ΅ (Ξ΅ : S) (_ : 0 < Ξ΅) (_ : IsInfinitesimal Ξ΅) (phi : R β* β) :
IsAnswer (fun x β¦ phi x β’ (1 + Ξ΅))
/-- Solutions that are indicator functions on submonoids of `R`. -/
| indicator (A : Set R) (_ : β m n, m * n β A β m β A β§ n β A) (C : S) (_ : βCβ = 1) :
IsAnswer (fun x β¦ if x β A then C else 0)
/--
The final solution, which splits depending on the properties of the domain `R`.
-/
theorem imo_sl_2010_A1 [LinearOrderedRing R] [FloorRing R]
[LinearOrderedRing S] [FloorRing S] (f : R β S) :
IsGood f β if DenselyOrdered R then (β C, βCβ = 1 β§ f = fun _ β¦ C) β¨ f = (fun _ β¦ 0)
else IsAnswer f := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2010 A1
Let $R$ and $S$ be totally ordered rings with a floor function (i.e., `FloorRing`s).
Find all functions $f : R β S$ such that for any $x, y \in R$,
$$ f(\lfloor x \rfloor y) = f(x) \lfloor f(y) \rfloor. $$
-/
/- special open -/ open Classical
/-- A function `f` is "good" if it satisfies the functional equation. -/
def IsGood [LinearOrderedRing R] [FloorRing R] [LinearOrderedRing S] [FloorRing S] (f : R β S) : Prop :=
β x y, f (βxβ β’ y) = f x * βf yβ
/--
A helper definition for the discrete case: `Ξ΅` is "infinitesimal" if all its
natural number multiples are less than 1 in absolute value.
-/
def IsInfinitesimal [LinearOrderedRing S] (Ξ΅ : S) : Prop :=
β n : β, n β’ |Ξ΅| < 1
/--
For the case where `R` is isomorphic to `β€`, the solutions fall into one of
three families, captured by this inductive proposition.
-/
inductive IsAnswer [LinearOrderedRing R] [MulOneClass R]
[LinearOrderedRing S] [FloorRing S] : (R β S) β Prop
/-- Solutions that are integer-valued monoid homomorphisms. -/
| MonoidHom_cast (phi : R β* β€) :
IsAnswer (fun x β¦ (phi x : S))
/-- Solutions of the form `n β¦ (1 + Ξ΅)^n`, where `Ξ΅` is a positive infinitesimal. -/
| one_add_Ξ΅ (Ξ΅ : S) (_ : 0 < Ξ΅) (_ : IsInfinitesimal Ξ΅) (phi : R β* β) :
IsAnswer (fun x β¦ phi x β’ (1 + Ξ΅))
/-- Solutions that are indicator functions on submonoids of `R`. -/
| indicator (A : Set R) (_ : β m n, m * n β A β m β A β§ n β A) (C : S) (_ : βCβ = 1) :
IsAnswer (fun x β¦ if x β A then C else 0)
/--
The final solution, which splits depending on the properties of the domain `R`.
-/
theorem imo_sl_2010_A1 [LinearOrderedRing R] [FloorRing R]
[LinearOrderedRing S] [FloorRing S] (f : R β S) :
IsGood f β if DenselyOrdered R then (β C, βCβ = 1 β§ f = fun _ β¦ C) β¨ f = (fun _ β¦ 0)
else IsAnswer f := by sorry
|
algebra
|
imo_sl_2010_A2
| true |
[
"algebra"
] |
2010_A2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2010 A2
Let $R$ be a totally ordered commutative ring.
Fix some $a, b, c, d \in R$ such that $a + b + c + d = 6$ and $a^2 + b^2 + c^2 + d^2 = 12$.
Prove that
$$ 36 \le 4(a^3 + b^3 + c^3 + d^3) - (a^4 + b^4 + c^4 + d^4) \le 48. $$
-/
|
theorem imo_sl_2010_A2 [LinearOrderedCommRing R] (a b c d : R)
(h_sum : a + b + c + d = 6)
(h_sq_sum : a ^ 2 + b ^ 2 + c ^ 2 + d ^ 2 = 12) :
let S := 4 * (a ^ 3 + b ^ 3 + c ^ 3 + d ^ 3) - (a ^ 4 + b ^ 4 + c ^ 4 + d ^ 4)
36 β€ S β§ S β€ 48 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2010 A2
Let $R$ be a totally ordered commutative ring.
Fix some $a, b, c, d \in R$ such that $a + b + c + d = 6$ and $a^2 + b^2 + c^2 + d^2 = 12$.
Prove that
$$ 36 \le 4(a^3 + b^3 + c^3 + d^3) - (a^4 + b^4 + c^4 + d^4) \le 48. $$
-/
theorem imo_sl_2010_A2 [LinearOrderedCommRing R] (a b c d : R)
(h_sum : a + b + c + d = 6)
(h_sq_sum : a ^ 2 + b ^ 2 + c ^ 2 + d ^ 2 = 12) :
let S := 4 * (a ^ 3 + b ^ 3 + c ^ 3 + d ^ 3) - (a ^ 4 + b ^ 4 + c ^ 4 + d ^ 4)
36 β€ S β§ S β€ 48 := by sorry
|
algebra
|
imo_sl_2010_A3
| true |
[
"algebra"
] |
2010_A3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2010 A3
Fix a positive integer $N$, a totally ordered commutative ring $R$, and an element $c \ge 0$.
Consider all $2N$-periodic sequences $(x_n)_{n \ge 0}$ such that for any $n$,
$$ x_n + x_{n + 1} + x_{n + 2} \le 2c. $$
Determine the maximum possible value of
$$ \sum_{k = 0}^{2N-1} (x_k x_{k + 2} + x_{k + 1} x_{k + 3}). $$
-/
|
/- special open -/ open Finset
variable (R : Type*) [LinearOrderedCommRing R]
/--
A sequence `x` is a "good periodic sequence" if it satisfies the conditions of the problem:
- `nonneg`: All its elements are non-negative.
- `good_sum`: The sum of any three consecutive elements is at most `2c`.
- `periodic`: The sequence is periodic with period `2N`.
-/
structure IsGoodPeriodicSeq (c : R) (N : β) where
x : β β R
nonneg : β i, 0 β€ x i
good_sum : β i, x i + x (i + 1) + x (i + 2) β€ 2 β’ c
periodic : β k, x (k + 2 * N) = x k
/-- The expression to be maximized. -/
def targetSum (x : β β R) (N : β) : R :=
β i β range (2 * N), (x i * x (i + 2) + x (i + 1) * x (i + 3))
/--
The maximum value of the target sum is $2Nc^2$.
`IsGreatest S m` means `m` is the maximum value of the set `S`.
-/
theorem imo_sl_2010_A3 {c : R} (hc : 0 β€ c) {N : β} (hN : 0 < N) :
IsGreatest (Set.range fun (s : IsGoodPeriodicSeq R c N) β¦ targetSum R s.x N) (2 * N β’ c ^ 2) :=
by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2010 A3
Fix a positive integer $N$, a totally ordered commutative ring $R$, and an element $c \ge 0$.
Consider all $2N$-periodic sequences $(x_n)_{n \ge 0}$ such that for any $n$,
$$ x_n + x_{n + 1} + x_{n + 2} \le 2c. $$
Determine the maximum possible value of
$$ \sum_{k = 0}^{2N-1} (x_k x_{k + 2} + x_{k + 1} x_{k + 3}). $$
-/
/- special open -/ open Finset
variable (R : Type*) [LinearOrderedCommRing R]
/--
A sequence `x` is a "good periodic sequence" if it satisfies the conditions of the problem:
- `nonneg`: All its elements are non-negative.
- `good_sum`: The sum of any three consecutive elements is at most `2c`.
- `periodic`: The sequence is periodic with period `2N`.
-/
structure IsGoodPeriodicSeq (c : R) (N : β) where
x : β β R
nonneg : β i, 0 β€ x i
good_sum : β i, x i + x (i + 1) + x (i + 2) β€ 2 β’ c
periodic : β k, x (k + 2 * N) = x k
/-- The expression to be maximized. -/
def targetSum (x : β β R) (N : β) : R :=
β i β range (2 * N), (x i * x (i + 2) + x (i + 1) * x (i + 3))
/--
The maximum value of the target sum is $2Nc^2$.
`IsGreatest S m` means `m` is the maximum value of the set `S`.
-/
theorem imo_sl_2010_A3 {c : R} (hc : 0 β€ c) {N : β} (hN : 0 < N) :
IsGreatest (Set.range fun (s : IsGoodPeriodicSeq R c N) β¦ targetSum R s.x N) (2 * N β’ c ^ 2) :=
by sorry
|
algebra
|
imo_sl_2010_A4
| true |
[
"algebra"
] |
2010_A4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2010 A4
Define the sequence $(x_n)_{n \ge 0}$ recursively by $x_0 = 1$,
$x_{2k} = (-1)^k x_k$, and $x_{2k + 1} = -x_k$ for all $k \in \mathbb{N}$.
Prove that for any $n \in \mathbb{N}$, $$ \sum_{i = 0}^{n-1} x_i \ge 0. $$
**Extra**: Prove that equality holds if and only if the
base $4$ representation of $n$ only contains $0$ and $2$ as its digits.
-/
|
/- special open -/ open Finset
/--
The sequence `x n` is defined recursively on the binary representation of `n`.
`false` corresponds to the integer value `1`, and `true` to `-1`.
-/
def x : β β Bool :=
Nat.binaryRec false fun bit k β¦ xor (bit || Nat.bodd k)
/--
The sum $S(n) = \sum_{i = 0}^{n-1} x_i$.
-/
def S (n : β) : β€ :=
β k in range n, if x k then -1 else 1
/--
This theorem states both parts of the problem:
1. The sum `S n` is always non-negative.
2. The sum is zero if and only if the base-4 digits of `n` are all either 0 or 2.
-/
theorem imo_sl_2010_A4 (n : β) :
(0 β€ S n) β§ (S n = 0 β β c β Nat.digits 4 n, c = 0 β¨ c = 2) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2010 A4
Define the sequence $(x_n)_{n \ge 0}$ recursively by $x_0 = 1$,
$x_{2k} = (-1)^k x_k$, and $x_{2k + 1} = -x_k$ for all $k \in \mathbb{N}$.
Prove that for any $n \in \mathbb{N}$, $$ \sum_{i = 0}^{n-1} x_i \ge 0. $$
**Extra**: Prove that equality holds if and only if the
base $4$ representation of $n$ only contains $0$ and $2$ as its digits.
-/
/- special open -/ open Finset
/--
The sequence `x n` is defined recursively on the binary representation of `n`.
`false` corresponds to the integer value `1`, and `true` to `-1`.
-/
def x : β β Bool :=
Nat.binaryRec false fun bit k β¦ xor (bit || Nat.bodd k)
/--
The sum $S(n) = \sum_{i = 0}^{n-1} x_i$.
-/
def S (n : β) : β€ :=
β k in range n, if x k then -1 else 1
/--
This theorem states both parts of the problem:
1. The sum `S n` is always non-negative.
2. The sum is zero if and only if the base-4 digits of `n` are all either 0 or 2.
-/
theorem imo_sl_2010_A4 (n : β) :
(0 β€ S n) β§ (S n = 0 β β c β Nat.digits 4 n, c = 0 β¨ c = 2) := by sorry
|
algebra
|
imo_sl_2010_A6
| true |
[
"algebra"
] |
2010_A6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2010 A6
Let $f, g : β β β$ be functions such that $f(g(x)) = f(x) + 1$
and $g(f(x)) = g(x) + 1$ for all $x β β$.
Prove that $f = g$.
-/
|
/- special open -/ open Classical
def good (f g : β β β) := β n : β, f (g n) = (f n).succ
variable {f g : β β β} (h : good f g) (h0 : good g f)
theorem imo_sl_2010_A6 : f = g := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2010 A6
Let $f, g : β β β$ be functions such that $f(g(x)) = f(x) + 1$
and $g(f(x)) = g(x) + 1$ for all $x β β$.
Prove that $f = g$.
-/
/- special open -/ open Classical
def good (f g : β β β) := β n : β, f (g n) = (f n).succ
variable {f g : β β β} (h : good f g) (h0 : good g f)
theorem imo_sl_2010_A6 : f = g := by sorry
|
algebra
|
imo_sl_2010_C4
| true |
[
"combinatorics"
] |
2010_C4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2010 C4 (P5)
In the board, $N = 6$ stacks of coins are given, with each stack initially containing one coin.
At any time, one of the following operations can be performed:
* **Type 1:** Remove one coin from a non-empty stack $k+1$ and add two coins to stack $k$ (for $k < 5$).
* **Type 2:** Remove one coin from a non-empty stack $k+2$ and swap the contents of stacks $k$ and $k+1$ (for $k < 4$).
Is it possible that, after some operations, we are left with stack 0
containing $A = 2010^{2010^{2010}}$ coins and all other stacks empty?
-/
|
/- special open -/ open List
inductive isReachable : List Nat β List Nat β Prop
| type1_move (k m) : isReachable [k + 1, m] [k, m + 2]
| type2_move (k m n) : isReachable [k + 1, m, n] [k, n, m]
| refl (l) : isReachable l l
| trans (h : isReachable lβ lβ) (h : isReachable lβ lβ) : isReachable lβ lβ
| append_right (h : isReachable lβ lβ) (l) : isReachable (lβ ++ l) (lβ ++ l)
| cons_left (h : isReachable lβ lβ) (k) : isReachable (k :: lβ) (k :: lβ)
theorem imo_sl_2010_C4 :
isReachable (replicate 6 1) (replicate 5 0 ++ [2010 ^ 2010 ^ 2010]) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2010 C4 (P5)
In the board, $N = 6$ stacks of coins are given, with each stack initially containing one coin.
At any time, one of the following operations can be performed:
* **Type 1:** Remove one coin from a non-empty stack $k+1$ and add two coins to stack $k$ (for $k < 5$).
* **Type 2:** Remove one coin from a non-empty stack $k+2$ and swap the contents of stacks $k$ and $k+1$ (for $k < 4$).
Is it possible that, after some operations, we are left with stack 0
containing $A = 2010^{2010^{2010}}$ coins and all other stacks empty?
-/
/- special open -/ open List
inductive isReachable : List Nat β List Nat β Prop
| type1_move (k m) : isReachable [k + 1, m] [k, m + 2]
| type2_move (k m n) : isReachable [k + 1, m, n] [k, n, m]
| refl (l) : isReachable l l
| trans (h : isReachable lβ lβ) (h : isReachable lβ lβ) : isReachable lβ lβ
| append_right (h : isReachable lβ lβ) (l) : isReachable (lβ ++ l) (lβ ++ l)
| cons_left (h : isReachable lβ lβ) (k) : isReachable (k :: lβ) (k :: lβ)
theorem imo_sl_2010_C4 :
isReachable (replicate 6 1) (replicate 5 0 ++ [2010 ^ 2010 ^ 2010]) := by sorry
|
combinatorics
|
imo_sl_2010_N5
| true |
[
"number theory"
] |
2010_N5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2010 N5 (P3)
Given $c β β$, find all functions $f : β β β$ such that
$(f(m) + n + c)(f(n) + m + c)$ is a square for all $m, n β β$.
-/
|
def good (c : β) (f : β β β) := β m n, β k, (f m + n + c) * (f n + m + c) = k ^ 2
variable (hp : Nat.Prime p) (h : β k : β, a * b = k ^ 2)
theorem imo_sl_2010_N5 : good c f β β k, f = (Β· + k) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2010 N5 (P3)
Given $c β β$, find all functions $f : β β β$ such that
$(f(m) + n + c)(f(n) + m + c)$ is a square for all $m, n β β$.
-/
def good (c : β) (f : β β β) := β m n, β k, (f m + n + c) * (f n + m + c) = k ^ 2
variable (hp : Nat.Prime p) (h : β k : β, a * b = k ^ 2)
theorem imo_sl_2010_N5 : good c f β β k, f = (Β· + k) := by sorry
|
number theory
|
imo_sl_2011_A1
| true |
[
"algebra"
] |
2011_A1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2011 A1
Consider an arbitrary set $A = \{a_1, a_2, a_3, a_4\}$ of four distinct positive integers.
Let $p_A$ be the number of pairs $(i, j)$ with $1 \le i < j \le 4$
such that $a_i + a_j$ divides $a_1 + a_2 + a_3 + a_4$.
Determine all sets $A$ of size $4$ such that $p_A \ge p_B$ for all sets $B$ of size $4$.
-/
|
/- special open -/ open Finset
/--
A `Card4NatSet` represents a set of four distinct positive integers,
formalized as a strictly increasing sequence of length 4.
-/
@[ext] structure Card4NatSet where
f : Fin 4 β β
f_pos : β i, 0 < f i
f_strict_mono : StrictMono f
/--
`p_val A` is the number $p_A$ from the problem statement.
It counts the pairs `(i, j)` with `i < j` such that `aα΅’ + aβ±Ό` divides the total sum.
-/
def p_val (A : Card4NatSet) : β :=
let S := A.f 0 + A.f 1 + A.f 2 + A.f 3
(univ.filter fun (p : Fin 4 Γ Fin 4) β¦ p.1 < p.2 β§ A.f p.1 + A.f p.2 β£ S).card
/--
The main theorem characterizes the sets `A` which maximize `p_val`.
The solutions are precisely the positive integer multiples of the sets
$\{1, 5, 7, 11\}$ and $\{1, 11, 19, 29\}$.
-/
theorem imo_sl_2011_A1 (A : Card4NatSet) :
(β B : Card4NatSet, p_val B β€ p_val A) β
(β (n : β) (_ : 0 < n), A.f = n β’ ![1, 5, 7, 11] β¨ A.f = n β’ ![1, 11, 19, 29]) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2011 A1
Consider an arbitrary set $A = \{a_1, a_2, a_3, a_4\}$ of four distinct positive integers.
Let $p_A$ be the number of pairs $(i, j)$ with $1 \le i < j \le 4$
such that $a_i + a_j$ divides $a_1 + a_2 + a_3 + a_4$.
Determine all sets $A$ of size $4$ such that $p_A \ge p_B$ for all sets $B$ of size $4$.
-/
/- special open -/ open Finset
/--
A `Card4NatSet` represents a set of four distinct positive integers,
formalized as a strictly increasing sequence of length 4.
-/
@[ext] structure Card4NatSet where
f : Fin 4 β β
f_pos : β i, 0 < f i
f_strict_mono : StrictMono f
/--
`p_val A` is the number $p_A$ from the problem statement.
It counts the pairs `(i, j)` with `i < j` such that `aα΅’ + aβ±Ό` divides the total sum.
-/
def p_val (A : Card4NatSet) : β :=
let S := A.f 0 + A.f 1 + A.f 2 + A.f 3
(univ.filter fun (p : Fin 4 Γ Fin 4) β¦ p.1 < p.2 β§ A.f p.1 + A.f p.2 β£ S).card
/--
The main theorem characterizes the sets `A` which maximize `p_val`.
The solutions are precisely the positive integer multiples of the sets
$\{1, 5, 7, 11\}$ and $\{1, 11, 19, 29\}$.
-/
theorem imo_sl_2011_A1 (A : Card4NatSet) :
(β B : Card4NatSet, p_val B β€ p_val A) β
(β (n : β) (_ : 0 < n), A.f = n β’ ![1, 5, 7, 11] β¨ A.f = n β’ ![1, 11, 19, 29]) := by sorry
|
algebra
|
imo_sl_2011_A3
| true |
[
"algebra"
] |
2011_A3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2011 A3
Let $R$ be a commutative ring where $2$ is not a zero divisor.
Find all functions $f, g : R β R$ such that for any $x, y β R$,
$$ g(f(x + y)) = f(x) + (2x + y) g(y). $$
-/
|
def good [NonUnitalNonAssocSemiring R] (f g : R β R) :=
β x y, g (f (x + y)) = f x + (2 β’ x + y) * g y
theorem imo_sl_2011_A3 [CommRing R] [IsDomain R] (hR : (2 : R) β 0) {f g : R β R} :
good f g β (f, g) = (Ξ» _ β¦ 0, Ξ» _ β¦ 0) β¨ β c, (f, g) = (Ξ» x β¦ x * x + c, id) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2011 A3
Let $R$ be a commutative ring where $2$ is not a zero divisor.
Find all functions $f, g : R β R$ such that for any $x, y β R$,
$$ g(f(x + y)) = f(x) + (2x + y) g(y). $$
-/
def good [NonUnitalNonAssocSemiring R] (f g : R β R) :=
β x y, g (f (x + y)) = f x + (2 β’ x + y) * g y
theorem imo_sl_2011_A3 [CommRing R] [IsDomain R] (hR : (2 : R) β 0) {f g : R β R} :
good f g β (f, g) = (Ξ» _ β¦ 0, Ξ» _ β¦ 0) β¨ β c, (f, g) = (Ξ» x β¦ x * x + c, id) := by sorry
|
algebra
|
imo_sl_2011_A4
| true |
[
"algebra"
] |
2011_A4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2011 A4
Find all functions $f, g : β β β$ such that, for any $k β β$,
$$ f^{g(k) + 2}(k) + g^{f(k) + 1}(k) + g(k + 1) + 1 = f(k + 1). $$
### Extra Notes
The original version using signature $β^+ β β^+$ is:
$$ f^{g(k) + 1}(k) + g^{f(k)}(k) + g(k + 1) = f(k + 1) + 1. $$
-/
|
/- special open -/ open Function
theorem imo_sl_2011_A4 {f g : β+ β β+} :
(β n, f^[g n + 1] n + (g^[f n] n + g (n + 1)) = f (n + 1) + 1)
β f = id β§ g = Ξ» _ β¦ 1 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2011 A4
Find all functions $f, g : β β β$ such that, for any $k β β$,
$$ f^{g(k) + 2}(k) + g^{f(k) + 1}(k) + g(k + 1) + 1 = f(k + 1). $$
### Extra Notes
The original version using signature $β^+ β β^+$ is:
$$ f^{g(k) + 1}(k) + g^{f(k)}(k) + g(k + 1) = f(k + 1) + 1. $$
-/
/- special open -/ open Function
theorem imo_sl_2011_A4 {f g : β+ β β+} :
(β n, f^[g n + 1] n + (g^[f n] n + g (n + 1)) = f (n + 1) + 1)
β f = id β§ g = Ξ» _ β¦ 1 := by sorry
|
algebra
|
imo_sl_2011_A6
| true |
[
"algebra"
] |
2011_A6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2011 A6 (P3)
Let $R$ be a totally ordered commutative ring.
Let $f : R β R$ be a function such that, for any $x, y β R$,
$$ f(x + y) β€ y f(x) + f(f(x)). $$
Show that $f(x) = 0$ for any $x β R$ such that $x β€ 0$.
-/
|
theorem imo_sl_2011_A6 [LinearOrderedCommRing R]
{f : R β R} (h : β x y : R, f (x + y) β€ y * f x + f (f x)) :
β x : R, x β€ 0 β f x = 0 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2011 A6 (P3)
Let $R$ be a totally ordered commutative ring.
Let $f : R β R$ be a function such that, for any $x, y β R$,
$$ f(x + y) β€ y f(x) + f(f(x)). $$
Show that $f(x) = 0$ for any $x β R$ such that $x β€ 0$.
-/
theorem imo_sl_2011_A6 [LinearOrderedCommRing R]
{f : R β R} (h : β x y : R, f (x + y) β€ y * f x + f (f x)) :
β x : R, x β€ 0 β f x = 0 := by sorry
|
algebra
|
imo_sl_2011_N5
| true |
[
"number theory"
] |
2011_N5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2011 N5
Let $G$ be an additive group. Find all functions $f : G \to \mathbb{Z}$ such that
for any $x, y \in G$:
1. $f(x) > 0$
2. $f(x - y)$ divides $f(x) - f(y)$.
-/
|
variable [AddGroup G]
/--
A function `f` is "good" if it satisfies the conditions of the problem.
The codomain is taken to be `β€` with a positivity constraint, which is
equivalent to the original problem's `β+` codomain.
-/
structure IsGood (f : G β β€) : Prop where
pos : β x, 0 < f x
dvd : β x y, f (x - y) β£ f x - f y
/--
This theorem establishes a key property of any solution `f`.
It shows that if `f(x) β€ f(y)`, then `f(x)` must divide `f(y)`.
This implies that the set of values taken by `f` must form a divisor chain.
-/
theorem solution_property {f : G β β€} (hf : IsGood f) {x y : G} (h_le : f x β€ f y) :
f x β£ f y := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2011 N5
Let $G$ be an additive group. Find all functions $f : G \to \mathbb{Z}$ such that
for any $x, y \in G$:
1. $f(x) > 0$
2. $f(x - y)$ divides $f(x) - f(y)$.
-/
variable [AddGroup G]
/--
A function `f` is "good" if it satisfies the conditions of the problem.
The codomain is taken to be `β€` with a positivity constraint, which is
equivalent to the original problem's `β+` codomain.
-/
structure IsGood (f : G β β€) : Prop where
pos : β x, 0 < f x
dvd : β x y, f (x - y) β£ f x - f y
/--
This theorem establishes a key property of any solution `f`.
It shows that if `f(x) β€ f(y)`, then `f(x)` must divide `f(y)`.
This implies that the set of values taken by `f` must form a divisor chain.
-/
theorem solution_property {f : G β β€} (hf : IsGood f) {x y : G} (h_le : f x β€ f y) :
f x β£ f y := by sorry
|
number theory
|
imo_sl_2012_A3
| true |
[
"algebra"
] |
2012_A3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2012 A3
Let $m \ge 2$ be an integer, $R$ be a totally ordered commutative ring, and
$x_0, x_1, \dots, x_{m-1} \in R$ be positive elements such that
$x_0 x_1 \cdots x_{m-1} = 1$. Prove that
$$ (1 + x_0)^2 (1 + x_1)^3 \cdots (1 + x_{m-1})^{m+1} > (m + 1)^{m+1}. $$
-/
|
/- special open -/ open Finset
theorem imo_sl_2012_A3 [LinearOrderedCommRing R] (m : Nat) (hm : 2 β€ m)
(x : Fin m β R) (hx_pos : β i, 0 < x i) (hx_prod : β i, x i = 1) :
(m + 1) ^ (m + 1) < β i, (1 + x i) ^ ((i : Nat) + 2) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2012 A3
Let $m \ge 2$ be an integer, $R$ be a totally ordered commutative ring, and
$x_0, x_1, \dots, x_{m-1} \in R$ be positive elements such that
$x_0 x_1 \cdots x_{m-1} = 1$. Prove that
$$ (1 + x_0)^2 (1 + x_1)^3 \cdots (1 + x_{m-1})^{m+1} > (m + 1)^{m+1}. $$
-/
/- special open -/ open Finset
theorem imo_sl_2012_A3 [LinearOrderedCommRing R] (m : Nat) (hm : 2 β€ m)
(x : Fin m β R) (hx_pos : β i, 0 < x i) (hx_prod : β i, x i = 1) :
(m + 1) ^ (m + 1) < β i, (1 + x i) ^ ((i : Nat) + 2) := by sorry
|
algebra
|
imo_sl_2012_A5
| true |
[
"algebra"
] |
2012_A5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2012 A5
Let $R$ be a ring and $S$ be a domain (a ring with no zero divisors).
Find all functions $f : R \to S$ such that for any $x, y \in R$,
$$ f(xy + 1) = f(x) f(y) + f(x + y). $$
-/
|
universe u v
variable {R S : Type*}
/-- A function `f` is "good" if it satisfies the functional equation. -/
def IsGood [Ring R] [Ring S] (f : R β S) : Prop :=
β x y, f (x * y + 1) = f x * f y + f (x + y)
/--
The formal statement of the solution requires bundling the rings with the function
to handle the variety of domains and codomains of the archetypal solutions.
-/
structure RingFunction where
source : Type u
source_ring : Ring source
target : Type v
target_ring : Ring target
f : source β target
-- These instances let the typechecker automatically find the Ring structure for the source/target
instance (X : RingFunction) : Ring X.source := X.source_ring
instance (X : RingFunction) : Ring X.target := X.target_ring
/-- A homomorphism between two `RingFunction`s. -/
structure RingFunctionHom (X Y : RingFunction) where
sourceHom : Y.source β+* X.source
targetHom : X.target β+* Y.target
spec : β r, Y.f r = targetHom (X.f (sourceHom r))
/-- A helper to construct a `RingFunction` from a regular function. -/
def ofFun [hR : Ring R] [hS : Ring S] (f : R β S) : RingFunction :=
β¨R, hR, S, hS, fβ©
/--
The set of all solutions, up to ring homomorphisms. Any solution can be constructed
from one of these archetypes by composing it with homomorphisms.
-/
inductive IsArchetype : RingFunction β Prop
-- Polynomial-like solutions
| sub_one (R) [hR : Ring R] : IsArchetype β¨R, hR, R, hR, fun x β¦ x - 1β©
| sq_sub_one (R) [hR : CommRing R] :
IsArchetype β¨R, inferInstance, R, inferInstance, fun x β¦ x ^ 2 - 1β©
-- Six special solutions on finite rings
| f2_map : IsArchetype β¨ZMod 2, inferInstance, β€, inferInstance, fun x β¦ if x = 0 then -1 else 0β©
| f3_map1 : IsArchetype β¨ZMod 3, inferInstance, β€, inferInstance, fun x β¦
if x = 0 then -1 else if x = 1 then 0 else 1β©
| f3_map2 : IsArchetype β¨ZMod 3, inferInstance, β€, inferInstance, fun x β¦
if x = 0 then -1 else if x = 1 then 0 else -1β©
| z4_map : IsArchetype β¨ZMod 4, inferInstance, β€, inferInstance,
fun x β¦ if x = 0 then -1 else if x = 2 then 1 else 0β©
-- For brevity, the archetypes on Fβ(Ξ΅) and Fβ are omitted from this summary.
/--
A function `f` is a "nontrivial answer" if it can be expressed as a composition
`ΞΉ β g β Ο` where `g` is an archetype, and `Ο`, `ΞΉ` are ring homomorphisms.
-/
def IsNontrivialAnswer [Ring R] [Ring S] (f : R β S) : Prop :=
β (A : RingFunction) (_ : IsArchetype A), Nonempty (RingFunctionHom A (ofFun f))
/--
The final theorem: a function `f` is a solution if and only if it is the zero function
or it is a "nontrivial answer" (a homomorphic image of an archetype).
-/
theorem imo_sl_2012_A5 [Ring R] [Ring S] [IsDomain S] (f : R β S) :
IsGood f β f = 0 β¨ IsNontrivialAnswer f := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2012 A5
Let $R$ be a ring and $S$ be a domain (a ring with no zero divisors).
Find all functions $f : R \to S$ such that for any $x, y \in R$,
$$ f(xy + 1) = f(x) f(y) + f(x + y). $$
-/
universe u v
variable {R S : Type*}
/-- A function `f` is "good" if it satisfies the functional equation. -/
def IsGood [Ring R] [Ring S] (f : R β S) : Prop :=
β x y, f (x * y + 1) = f x * f y + f (x + y)
/--
The formal statement of the solution requires bundling the rings with the function
to handle the variety of domains and codomains of the archetypal solutions.
-/
structure RingFunction where
source : Type u
source_ring : Ring source
target : Type v
target_ring : Ring target
f : source β target
-- These instances let the typechecker automatically find the Ring structure for the source/target
instance (X : RingFunction) : Ring X.source := X.source_ring
instance (X : RingFunction) : Ring X.target := X.target_ring
/-- A homomorphism between two `RingFunction`s. -/
structure RingFunctionHom (X Y : RingFunction) where
sourceHom : Y.source β+* X.source
targetHom : X.target β+* Y.target
spec : β r, Y.f r = targetHom (X.f (sourceHom r))
/-- A helper to construct a `RingFunction` from a regular function. -/
def ofFun [hR : Ring R] [hS : Ring S] (f : R β S) : RingFunction :=
β¨R, hR, S, hS, fβ©
/--
The set of all solutions, up to ring homomorphisms. Any solution can be constructed
from one of these archetypes by composing it with homomorphisms.
-/
inductive IsArchetype : RingFunction β Prop
-- Polynomial-like solutions
| sub_one (R) [hR : Ring R] : IsArchetype β¨R, hR, R, hR, fun x β¦ x - 1β©
| sq_sub_one (R) [hR : CommRing R] :
IsArchetype β¨R, inferInstance, R, inferInstance, fun x β¦ x ^ 2 - 1β©
-- Six special solutions on finite rings
| f2_map : IsArchetype β¨ZMod 2, inferInstance, β€, inferInstance, fun x β¦ if x = 0 then -1 else 0β©
| f3_map1 : IsArchetype β¨ZMod 3, inferInstance, β€, inferInstance, fun x β¦
if x = 0 then -1 else if x = 1 then 0 else 1β©
| f3_map2 : IsArchetype β¨ZMod 3, inferInstance, β€, inferInstance, fun x β¦
if x = 0 then -1 else if x = 1 then 0 else -1β©
| z4_map : IsArchetype β¨ZMod 4, inferInstance, β€, inferInstance,
fun x β¦ if x = 0 then -1 else if x = 2 then 1 else 0β©
-- For brevity, the archetypes on Fβ(Ξ΅) and Fβ are omitted from this summary.
/--
A function `f` is a "nontrivial answer" if it can be expressed as a composition
`ΞΉ β g β Ο` where `g` is an archetype, and `Ο`, `ΞΉ` are ring homomorphisms.
-/
def IsNontrivialAnswer [Ring R] [Ring S] (f : R β S) : Prop :=
β (A : RingFunction) (_ : IsArchetype A), Nonempty (RingFunctionHom A (ofFun f))
/--
The final theorem: a function `f` is a solution if and only if it is the zero function
or it is a "nontrivial answer" (a homomorphic image of an archetype).
-/
theorem imo_sl_2012_A5 [Ring R] [Ring S] [IsDomain S] (f : R β S) :
IsGood f β f = 0 β¨ IsNontrivialAnswer f := by sorry
|
algebra
|
imo_sl_2012_A7
| true |
[
"algebra"
] |
2012_A7
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2012 A7
Let $R$ be a totally ordered commutative ring and $\sigma$ be a set of variables.
Let $R[\sigma]$ denote the set of multivariate polynomials in these variables. A function
$f : R^\sigma \to R$ is called a **metapolynomial** if it can be represented as
$$ f(\mathbf{x}) = \max_{i \le m} \min_{j \le n_i} P_{i, j}(\mathbf{x}) $$
for some polynomials $P_{i, j} \in R[\sigma]$. This set of functions is the "meta-closure"
of the set of functions represented by polynomials.
Prove that the set of metapolynomials forms a subring of the ring of all functions
from $R^\sigma$ to $R$.
-/
|
inductive BinOpClosure {Ξ± : Type*} (op : Ξ± β Ξ± β Ξ±) (P : Ξ± β Prop) : Ξ± β Prop where
| ofMem {a} (h : P a) : BinOpClosure op P a
| ofOp {a b} (ha : BinOpClosure op P a) (hb : BinOpClosure op P b) : BinOpClosure op P (op a b)
def MetaClosure {Ξ± : Type*} [Lattice Ξ±] (S : Set Ξ±) : Set Ξ± :=
{x | BinOpClosure (Β· β Β·) (BinOpClosure (Β· β Β·) (Β· β S)) x}
abbrev MvPolynomialImage (Ο R : Type*) [CommRing R] : Subring ((Ο β R) β R) :=
(Pi.ringHom (MvPolynomial.eval (R := R) (Ο := Ο))).range
theorem imo_sl_2012_A7 (Ο R : Type*) [LinearOrderedCommRing R] :
β (T : Subring ((Ο β R) β R)), T.carrier = MetaClosure (MvPolynomialImage Ο R).carrier := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2012 A7
Let $R$ be a totally ordered commutative ring and $\sigma$ be a set of variables.
Let $R[\sigma]$ denote the set of multivariate polynomials in these variables. A function
$f : R^\sigma \to R$ is called a **metapolynomial** if it can be represented as
$$ f(\mathbf{x}) = \max_{i \le m} \min_{j \le n_i} P_{i, j}(\mathbf{x}) $$
for some polynomials $P_{i, j} \in R[\sigma]$. This set of functions is the "meta-closure"
of the set of functions represented by polynomials.
Prove that the set of metapolynomials forms a subring of the ring of all functions
from $R^\sigma$ to $R$.
-/
inductive BinOpClosure {Ξ± : Type*} (op : Ξ± β Ξ± β Ξ±) (P : Ξ± β Prop) : Ξ± β Prop where
| ofMem {a} (h : P a) : BinOpClosure op P a
| ofOp {a b} (ha : BinOpClosure op P a) (hb : BinOpClosure op P b) : BinOpClosure op P (op a b)
def MetaClosure {Ξ± : Type*} [Lattice Ξ±] (S : Set Ξ±) : Set Ξ± :=
{x | BinOpClosure (Β· β Β·) (BinOpClosure (Β· β Β·) (Β· β S)) x}
abbrev MvPolynomialImage (Ο R : Type*) [CommRing R] : Subring ((Ο β R) β R) :=
(Pi.ringHom (MvPolynomial.eval (R := R) (Ο := Ο))).range
theorem imo_sl_2012_A7 (Ο R : Type*) [LinearOrderedCommRing R] :
β (T : Subring ((Ο β R) β R)), T.carrier = MetaClosure (MvPolynomialImage Ο R).carrier := by sorry
|
algebra
|
imo_sl_2012_N1
| true |
[
"number theory"
] |
2012_N1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2012 N1
Let $R$ be a commutative ring.
A set $A β R$ is called *admissible* if $x^2 + rxy + y^2 β A$ for any $x, y β A$ and $r β R$.
Determine all pairs $(x, y) β R^2$ such that the only
admissible set containing $x$ and $y$ is $R$.
-/
|
def admissible [Semiring R] (A : Set R) :=
β x y : R, x β A β y β A β β r : R, x ^ 2 + r * x * y + y ^ 2 β A
theorem imo_sl_2012_N1 [CommRing R] (x y : R) :
(β A : Set R, admissible A β x β A β y β A β β z : R, z β A) β IsCoprime x y := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2012 N1
Let $R$ be a commutative ring.
A set $A β R$ is called *admissible* if $x^2 + rxy + y^2 β A$ for any $x, y β A$ and $r β R$.
Determine all pairs $(x, y) β R^2$ such that the only
admissible set containing $x$ and $y$ is $R$.
-/
def admissible [Semiring R] (A : Set R) :=
β x y : R, x β A β y β A β β r : R, x ^ 2 + r * x * y + y ^ 2 β A
theorem imo_sl_2012_N1 [CommRing R] (x y : R) :
(β A : Set R, admissible A β x β A β y β A β β z : R, z β A) β IsCoprime x y := by sorry
|
number theory
|
imo_sl_2012_N3
| true |
[
"number theory"
] |
2012_N3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2012 N3
Determine all integers $m > 1$ such that $n β£ \binom{n}{m - 2n}$ for every $n β€ m/2$.
-/
|
theorem imo_sl_2012_N3 (h : 1 < m) :
(β n : β, 2 * n β€ m β n β£ n.choose (m - 2 * n)) β m.Prime := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2012 N3
Determine all integers $m > 1$ such that $n β£ \binom{n}{m - 2n}$ for every $n β€ m/2$.
-/
theorem imo_sl_2012_N3 (h : 1 < m) :
(β n : β, 2 * n β€ m β n β£ n.choose (m - 2 * n)) β m.Prime := by sorry
|
number theory
|
imo_sl_2012_N4
| true |
[
"number theory"
] |
2012_N4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2012 N4
An integer $a$ is called *friendly* if there exist positive integers $m, n$ such that
$$ (m^2 + n)(n^2 + m) = a(m - n)^3. $$
1. Prove that $\{1, 2, \dots, 2012\}$ contains at least $500$ friendly integers.
2. Is $2$ friendly?
-/
|
/- special open -/ open Finset Classical
/-- An integer `a` is friendly if it satisfies the given condition for some positive integers `m` and `n`. -/
def IsFriendly (a : β€) : Prop :=
β m > 0, β n > 0, (m ^ 2 + n) * (n ^ 2 + m) = a * (m - n) ^ 3
theorem imo_sl_2012_N4 :
500 β€ ((Icc 1 2012).filter (IsFriendly)).card β§
Β¬ IsFriendly 2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2012 N4
An integer $a$ is called *friendly* if there exist positive integers $m, n$ such that
$$ (m^2 + n)(n^2 + m) = a(m - n)^3. $$
1. Prove that $\{1, 2, \dots, 2012\}$ contains at least $500$ friendly integers.
2. Is $2$ friendly?
-/
/- special open -/ open Finset Classical
/-- An integer `a` is friendly if it satisfies the given condition for some positive integers `m` and `n`. -/
def IsFriendly (a : β€) : Prop :=
β m > 0, β n > 0, (m ^ 2 + n) * (n ^ 2 + m) = a * (m - n) ^ 3
theorem imo_sl_2012_N4 :
500 β€ ((Icc 1 2012).filter (IsFriendly)).card β§
Β¬ IsFriendly 2 := by sorry
|
number theory
|
imo_sl_2013_A1
| true |
[
"algebra"
] |
2013_A1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2013 A1
Let $R$ be a commutative ring.
Given a list of elements $a_0, \dots, a_{n-1} \in R$, we define a sequence $(u_k)$ by
$u_0 = u_1 = 1$, and $u_{k + 2} = u_{k + 1} + a_k u_k$ for each $0 \le k < n$.
We then define the function $f(a_0, \dots, a_{n-1}) = u_{n + 1}$.
Prove that $f(a_0, \dots, a_{n-1}) = f(a_{n-1}, \dots, a_0)$.
-/
|
variable {R : Type*} [CommRing R]
/--
A helper function to compute the pair `(u_{k+1}, u_k)` recursively.
`f_aux [aβ, aβ, ..., a_{k-1}]` returns `(u_{k+1}, u_k)`.
-/
def f_aux : List R β R Γ R
| [] => (1, 1)
| r :: l => let (a, b) := f_aux l; (a + r * b, a)
def f (l : List R) : R := (f_aux l).1
theorem imo_sl_2013_A1 (l : List R) : f l.reverse = f l := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2013 A1
Let $R$ be a commutative ring.
Given a list of elements $a_0, \dots, a_{n-1} \in R$, we define a sequence $(u_k)$ by
$u_0 = u_1 = 1$, and $u_{k + 2} = u_{k + 1} + a_k u_k$ for each $0 \le k < n$.
We then define the function $f(a_0, \dots, a_{n-1}) = u_{n + 1}$.
Prove that $f(a_0, \dots, a_{n-1}) = f(a_{n-1}, \dots, a_0)$.
-/
variable {R : Type*} [CommRing R]
/--
A helper function to compute the pair `(u_{k+1}, u_k)` recursively.
`f_aux [aβ, aβ, ..., a_{k-1}]` returns `(u_{k+1}, u_k)`.
-/
def f_aux : List R β R Γ R
| [] => (1, 1)
| r :: l => let (a, b) := f_aux l; (a + r * b, a)
def f (l : List R) : R := (f_aux l).1
theorem imo_sl_2013_A1 (l : List R) : f l.reverse = f l := by sorry
|
algebra
|
imo_sl_2013_A5
| true |
[
"algebra"
] |
2013_A5
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2013 A5
Find all functions $f : \mathbb{N} \to \mathbb{N}$ such that for any $n \in \mathbb{N}$,
$$ f(f(f(n))) = f(n + 1) + 1. $$
-/
|
def IsGood (f : β β β) : Prop :=
β n, f^[3] n = f (n + 1) + 1
def answer2 : β β β
| 0 => 1
| 1 => 6
| 2 => 3
| 3 => 0
| n + 4 => answer2 n + 4
theorem imo_sl_2013_A5 (f : β β β) :
IsGood f β f = Nat.succ β¨ f = answer2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2013 A5
Find all functions $f : \mathbb{N} \to \mathbb{N}$ such that for any $n \in \mathbb{N}$,
$$ f(f(f(n))) = f(n + 1) + 1. $$
-/
def IsGood (f : β β β) : Prop :=
β n, f^[3] n = f (n + 1) + 1
def answer2 : β β β
| 0 => 1
| 1 => 6
| 2 => 3
| 3 => 0
| n + 4 => answer2 n + 4
theorem imo_sl_2013_A5 (f : β β β) :
IsGood f β f = Nat.succ β¨ f = answer2 := by sorry
|
algebra
|
imo_sl_2013_N1
| true |
[
"number theory"
] |
2013_N1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2013 N1
Find all functions $f : β^+ β β^+$ such that, for any $m, n : β^+$,
$$ m^2 + f(n) β£ m f(m) + n. $$
-/
|
theorem imo_sl_2013_N1 {f : β+ β β+} :
(β m n : β+, m * m + f n β£ m * f m + n) β f = id := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2013 N1
Find all functions $f : β^+ β β^+$ such that, for any $m, n : β^+$,
$$ m^2 + f(n) β£ m f(m) + n. $$
-/
theorem imo_sl_2013_N1 {f : β+ β β+} :
(β m n : β+, m * m + f n β£ m * f m + n) β f = id := by sorry
|
number theory
|
imo_sl_2013_N2
| true |
[
"number theory"
] |
2013_N2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2013 N2
Prove that for any positive integers $k, n$, there exist positive integers $m_1, m_2, \dots, m_k$
such that
$$ 1 + \frac{2^k - 1}{n} = \prod_{i = 1}^k \left(1 + \frac{1}{m_i}\right). $$
-/
|
/- special open -/ open Finset
theorem imo_sl_2013_N2 (k n : β+) :
β (m : Fin k β β+), (1 : β) + ((2 : β) ^ (k : β) - 1) / (n : β) =
β i : Fin k, (1 + 1 / (m i : β)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2013 N2
Prove that for any positive integers $k, n$, there exist positive integers $m_1, m_2, \dots, m_k$
such that
$$ 1 + \frac{2^k - 1}{n} = \prod_{i = 1}^k \left(1 + \frac{1}{m_i}\right). $$
-/
/- special open -/ open Finset
theorem imo_sl_2013_N2 (k n : β+) :
β (m : Fin k β β+), (1 : β) + ((2 : β) ^ (k : β) - 1) / (n : β) =
β i : Fin k, (1 + 1 / (m i : β)) := by sorry
|
number theory
|
imo_sl_2013_N3
| true |
[
"number theory"
] |
2013_N3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2013 N3
For each positive integer $n$, let $P(n)$ denote the largest prime divisor of $n$.
Prove that there exists infinitely many $n β β$ such that
$$ P(n^4 + n^2 + 1) = P((n + 1)^4 + (n + 1)^2 + 1). $$
-/
|
noncomputable def lpf (n : β) : β :=
((Nat.primeFactors n).toList.maximum?).getD 1
theorem imo_sl_2013_N3 :
β (C : β), β n β₯ C, lpf (n ^ 4 + n ^ 2 + 1)
= lpf ((n + 1) ^ 4 + (n + 1) ^ 2 + 1) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2013 N3
For each positive integer $n$, let $P(n)$ denote the largest prime divisor of $n$.
Prove that there exists infinitely many $n β β$ such that
$$ P(n^4 + n^2 + 1) = P((n + 1)^4 + (n + 1)^2 + 1). $$
-/
noncomputable def lpf (n : β) : β :=
((Nat.primeFactors n).toList.maximum?).getD 1
theorem imo_sl_2013_N3 :
β (C : β), β n β₯ C, lpf (n ^ 4 + n ^ 2 + 1)
= lpf ((n + 1) ^ 4 + (n + 1) ^ 2 + 1) := by sorry
|
number theory
|
imo_sl_2013_N6
| true |
[
"number theory"
] |
2013_N6
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2013 N6
Determine all functions $f : β β β€$ such that for any $x β β$, $a β β€$, and $b β β^+$,
$$ f\left(\frac{f(x) + a}{b}\right) = f\left(\frac{x + a}{b}\right). $$
-/
|
def good (f : β β β€) :=
β (x : β) (a : β€) (b : β), 0 < b β f ((f x + a) / b) = f ((x + a) / b)
theorem imo_sl_2013_N6 : good f β (β C, f = Ξ» _ β¦ C) β¨ f = Int.floor β¨ f = Int.ceil := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2013 N6
Determine all functions $f : β β β€$ such that for any $x β β$, $a β β€$, and $b β β^+$,
$$ f\left(\frac{f(x) + a}{b}\right) = f\left(\frac{x + a}{b}\right). $$
-/
def good (f : β β β€) :=
β (x : β) (a : β€) (b : β), 0 < b β f ((f x + a) / b) = f ((x + a) / b)
theorem imo_sl_2013_N6 : good f β (β C, f = Ξ» _ β¦ C) β¨ f = Int.floor β¨ f = Int.ceil := by sorry
|
number theory
|
imo_sl_2014_A1
| true |
[
"algebra"
] |
2014_A1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2014 A1
Let $(z_n)_{n \ge 0}$ be an infinite sequence of positive integers.
1. Prove that there exists a unique non-negative integer $N$ such that
$$ N z_N < \sum_{j = 0}^N z_j \le (N + 1) z_{N + 1}. $$
(Note: The sum is often written as $\sum_{j=0}^{N-1} z_j \le N z_N < \sum_{j=0}^N z_j$. The version
above is what is used in the formalization).
2. Prove that $N$ is positive.
3. Show that $\binom{N}{2} < z_0$.
-/
|
/- special open -/ open Finset
variable {z : β β β€}
/-- `IsTheN z N` is the property that `N` satisfies the double inequality from the problem. -/
def IsTheN (z : β β β€) (N : β) : Prop :=
(N : β€) * z N < (β i in range (N + 1), z i) β§
(β i in range (N + 1), z i) β€ (N + 1) * z (N + 1)
theorem imo_sl_2014_A1 (hz_pos : β n, 0 < z n) (hz_mono : StrictMono z) :
(β! N, IsTheN z N) β§
(β N, IsTheN z N β 0 < N β§ N.choose 2 < (z 0).natAbs) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2014 A1
Let $(z_n)_{n \ge 0}$ be an infinite sequence of positive integers.
1. Prove that there exists a unique non-negative integer $N$ such that
$$ N z_N < \sum_{j = 0}^N z_j \le (N + 1) z_{N + 1}. $$
(Note: The sum is often written as $\sum_{j=0}^{N-1} z_j \le N z_N < \sum_{j=0}^N z_j$. The version
above is what is used in the formalization).
2. Prove that $N$ is positive.
3. Show that $\binom{N}{2} < z_0$.
-/
/- special open -/ open Finset
variable {z : β β β€}
/-- `IsTheN z N` is the property that `N` satisfies the double inequality from the problem. -/
def IsTheN (z : β β β€) (N : β) : Prop :=
(N : β€) * z N < (β i in range (N + 1), z i) β§
(β i in range (N + 1), z i) β€ (N + 1) * z (N + 1)
theorem imo_sl_2014_A1 (hz_pos : β n, 0 < z n) (hz_mono : StrictMono z) :
(β! N, IsTheN z N) β§
(β N, IsTheN z N β 0 < N β§ N.choose 2 < (z 0).natAbs) := by sorry
|
algebra
|
imo_sl_2014_A4
| true |
[
"algebra"
] |
2014_A4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2014 A4
Let $b$ and $c$ be integers with $|b| > 1$ and $c β 0$.
Find all functions $f : β€ β β€$ such that, for any $x, y β β€$,
$$ f(y + f(x)) - f(y) = f(bx) - f(x) + c. $$
-/
|
/- special open -/ open Finset
def good (b c : β€) (f : β€ β β€) := β x y : β€, f (y + f x) - f y = f (b * x) - f x + c
theorem imo_sl_2014_A4 {b c : β€} (h : 1 < b.natAbs) (h0 : c β 0) :
good b c f β b - 1 β£ c β§ f = ((b - 1) * Β· + c / (b - 1)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2014 A4
Let $b$ and $c$ be integers with $|b| > 1$ and $c β 0$.
Find all functions $f : β€ β β€$ such that, for any $x, y β β€$,
$$ f(y + f(x)) - f(y) = f(bx) - f(x) + c. $$
-/
/- special open -/ open Finset
def good (b c : β€) (f : β€ β β€) := β x y : β€, f (y + f x) - f y = f (b * x) - f x + c
theorem imo_sl_2014_A4 {b c : β€} (h : 1 < b.natAbs) (h0 : c β 0) :
good b c f β b - 1 β£ c β§ f = ((b - 1) * Β· + c / (b - 1)) := by sorry
|
algebra
|
imo_sl_2014_C4
| true |
[
"combinatorics"
] |
2014_C4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2014 C4
Consider 4 types of skew-tetrominoes in $β^2$, classified by its orientation.
Let $S β β^2$ be a multiset, and suppose that it can be partitioned into skew-tetrominos.
Prove that the parity of the number of skew-tetrominoes used for
each type in the partition does not depend on the partition.
-/
|
/- special open -/ open Multiset
/-- Base skew-tetrominoes, representing the four orientations. -/
def BaseSkewT4 : Fin 4 β Multiset (β Γ β)
| 1 => {(0, 0), (1, 0), (1, 1), (2, 1)}
| 2 => {(1, 0), (1, 1), (0, 1), (0, 2)}
| 3 => {(0, 1), (1, 1), (1, 0), (2, 0)}
| 4 => {(0, 0), (0, 1), (1, 1), (1, 2)}
/-- A specific skew-tetromino piece, defined by its type and position. -/
def SkewT4 (q : Fin 4 Γ β Γ β) : Multiset (β Γ β) :=
(BaseSkewT4 q.1).map Ξ» p β¦ q.2 + p
/--
Let `P` and `Q` be two different partitions of the same shape `S` into skew-tetrominoes.
This is formally stated as `(map SkewT4 P).sum = (map SkewT4 Q).sum`.
The theorem asserts that for any type `i`, the number of tetrominoes of that type
has the same parity in both partitions.
-/
theorem imo_sl_2014_C4 {P Q : Multiset (Fin 4 Γ β Γ β)}
(h : (map SkewT4 P).sum = (map SkewT4 Q).sum) (i : Fin 4) :
(P.map Prod.fst).count i % 2 = (Q.map Prod.fst).count i % 2 := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2014 C4
Consider 4 types of skew-tetrominoes in $β^2$, classified by its orientation.
Let $S β β^2$ be a multiset, and suppose that it can be partitioned into skew-tetrominos.
Prove that the parity of the number of skew-tetrominoes used for
each type in the partition does not depend on the partition.
-/
/- special open -/ open Multiset
/-- Base skew-tetrominoes, representing the four orientations. -/
def BaseSkewT4 : Fin 4 β Multiset (β Γ β)
| 1 => {(0, 0), (1, 0), (1, 1), (2, 1)}
| 2 => {(1, 0), (1, 1), (0, 1), (0, 2)}
| 3 => {(0, 1), (1, 1), (1, 0), (2, 0)}
| 4 => {(0, 0), (0, 1), (1, 1), (1, 2)}
/-- A specific skew-tetromino piece, defined by its type and position. -/
def SkewT4 (q : Fin 4 Γ β Γ β) : Multiset (β Γ β) :=
(BaseSkewT4 q.1).map Ξ» p β¦ q.2 + p
/--
Let `P` and `Q` be two different partitions of the same shape `S` into skew-tetrominoes.
This is formally stated as `(map SkewT4 P).sum = (map SkewT4 Q).sum`.
The theorem asserts that for any type `i`, the number of tetrominoes of that type
has the same parity in both partitions.
-/
theorem imo_sl_2014_C4 {P Q : Multiset (Fin 4 Γ β Γ β)}
(h : (map SkewT4 P).sum = (map SkewT4 Q).sum) (i : Fin 4) :
(P.map Prod.fst).count i % 2 = (Q.map Prod.fst).count i % 2 := by sorry
|
combinatorics
|
imo_sl_2014_N2
| true |
[
"number theory"
] |
2014_N2
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-
# IMO 2014 N2
Determine all pairs $(x, y)$ of integers such that
$$ 7x^2 - 13xy + y^2 = (|x - y| + 1)^3. $$
-/
|
def good (x y : β€) := 7 * x ^ 2 - 13 * x * y + 7 * y ^ 2 = (|x - y| + 1) ^ 3
theorem imo_sl_2014_N2 :
good x y β (β m, (x, y) = (m ^ 3 + 2 * m ^ 2 - m - 1, m ^ 3 + m ^ 2 - 2 * m - 1)) β¨
(β m, (x, y) = (m ^ 3 + m ^ 2 - 2 * m - 1, m ^ 3 + 2 * m ^ 2 - m - 1)) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-
# IMO 2014 N2
Determine all pairs $(x, y)$ of integers such that
$$ 7x^2 - 13xy + y^2 = (|x - y| + 1)^3. $$
-/
def good (x y : β€) := 7 * x ^ 2 - 13 * x * y + 7 * y ^ 2 = (|x - y| + 1) ^ 3
theorem imo_sl_2014_N2 :
good x y β (β m, (x, y) = (m ^ 3 + 2 * m ^ 2 - m - 1, m ^ 3 + m ^ 2 - 2 * m - 1)) β¨
(β m, (x, y) = (m ^ 3 + m ^ 2 - 2 * m - 1, m ^ 3 + 2 * m ^ 2 - m - 1)) := by sorry
|
number theory
|
imo_sl_2014_N3
| true |
[
"number theory"
] |
2014_N3
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2014 N3
Consider a collection $C$ of coins, where each coin has a value of $1/n$ for some positive
integer $n$. A partition of $C$ into $N$ groups is called an *$N$-Cape Town* partition
if the total value of coins in each group is at most $1$.
Prove that if the total value of all coins in $C$ is at most $N + 1/2$,
then $C$ has an $(N + 1)$-Cape Town partition.
-/
|
/- special open -/ open Multiset
variable (N : β) (C : Multiset β)
/--
A `CapeTownPartition N C` is a partition of the multiset of coins `C` into `N + 1` groups,
where the sum of the values of the coins in each group is at most 1.
-/
structure CapeTownPartition where
/-- The list of groups in the partition. -/
part : Multiset (Multiset β)
/-- The number of groups is `N + 1`. -/
card_part : card part = N + 1
/-- The groups form a partition of `C`. -/
sum_part : part.sum = C
/-- The total value of coins in each group is at most 1. -/
total_bound : β G β part, (G.map (fun x β¦ (x : β)β»ΒΉ)).sum β€ 1
theorem imo_sl_2014_N3 (h_total_value : (C.map (fun x β¦ (x : β)β»ΒΉ)).sum β€ (N : β) + 1/2) :
Nonempty (CapeTownPartition N C) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2014 N3
Consider a collection $C$ of coins, where each coin has a value of $1/n$ for some positive
integer $n$. A partition of $C$ into $N$ groups is called an *$N$-Cape Town* partition
if the total value of coins in each group is at most $1$.
Prove that if the total value of all coins in $C$ is at most $N + 1/2$,
then $C$ has an $(N + 1)$-Cape Town partition.
-/
/- special open -/ open Multiset
variable (N : β) (C : Multiset β)
/--
A `CapeTownPartition N C` is a partition of the multiset of coins `C` into `N + 1` groups,
where the sum of the values of the coins in each group is at most 1.
-/
structure CapeTownPartition where
/-- The list of groups in the partition. -/
part : Multiset (Multiset β)
/-- The number of groups is `N + 1`. -/
card_part : card part = N + 1
/-- The groups form a partition of `C`. -/
sum_part : part.sum = C
/-- The total value of coins in each group is at most 1. -/
total_bound : β G β part, (G.map (fun x β¦ (x : β)β»ΒΉ)).sum β€ 1
theorem imo_sl_2014_N3 (h_total_value : (C.map (fun x β¦ (x : β)β»ΒΉ)).sum β€ (N : β) + 1/2) :
Nonempty (CapeTownPartition N C) := by sorry
|
number theory
|
imo_sl_2014_N4
| true |
[
"number theory"
] |
2014_N4
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2014 N4
Prove that, for any positive integer $n > 1$, there exists infinitely many
positive integers $k$ such that $βn^k/kβ$ is odd.
-/
|
theorem imo_sl_2014_N4 (hn : 1 < n) (N) : β k > N, Odd (n ^ k / k) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2014 N4
Prove that, for any positive integer $n > 1$, there exists infinitely many
positive integers $k$ such that $βn^k/kβ$ is odd.
-/
theorem imo_sl_2014_N4 (hn : 1 < n) (N) : β k > N, Odd (n ^ k / k) := by sorry
|
number theory
|
imo_sl_2015_A1
| true |
[
"algebra"
] |
2015_A1
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
|
/-!
# IMO 2015 A1
Let $F$ be a totally ordered field.
Let $(a_n)_{n β₯ 0}$ be a sequence of positive elements of $F$ such that
$a_{k + 1} β₯ \dfrac{(k + 1) a_k}{a_k^2 + k}$ for all $k β β$.
Prove that, for every $n β₯ 2$,
$$ a_0 + a_1 + β¦ + a_{n - 1} β₯ n. $$
### Further directions
Generalize to totally ordered semirings `R` with `ExistsAddOfLE R`.
If impossible, we can alternatively generalize the above sequence to
two sequences $(a_n)_{n β₯ 0}$, $(b_n)_{n β₯ 0}$ satisfying
$b_{k + 1} β€ a_k + b_k$ and $a_k b_k β₯ k$ for all $k β β$.
-/
|
/- special open -/ open Finset
theorem imo_sl_2015_A1 [LinearOrderedField F]
{a : β β F} (h : β k : β, 0 < a k)
(h0 : β k : β, ((k.succ : F) * a k) / (a k ^ 2 + (k : F)) β€ a k.succ) :
β n : β, 2 β€ n β (n : F) β€ (range n).sum (fun i => a i) := by sorry
|
test
|
import Mathlib
import Aesop
set_option maxHeartbeats 0
open BigOperators Real Nat Topology Rat
/-!
# IMO 2015 A1
Let $F$ be a totally ordered field.
Let $(a_n)_{n β₯ 0}$ be a sequence of positive elements of $F$ such that
$a_{k + 1} β₯ \dfrac{(k + 1) a_k}{a_k^2 + k}$ for all $k β β$.
Prove that, for every $n β₯ 2$,
$$ a_0 + a_1 + β¦ + a_{n - 1} β₯ n. $$
### Further directions
Generalize to totally ordered semirings `R` with `ExistsAddOfLE R`.
If impossible, we can alternatively generalize the above sequence to
two sequences $(a_n)_{n β₯ 0}$, $(b_n)_{n β₯ 0}$ satisfying
$b_{k + 1} β€ a_k + b_k$ and $a_k b_k β₯ k$ for all $k β β$.
-/
/- special open -/ open Finset
theorem imo_sl_2015_A1 [LinearOrderedField F]
{a : β β F} (h : β k : β, 0 < a k)
(h0 : β k : β, ((k.succ : F) * a k) / (a k ^ 2 + (k : F)) β€ a k.succ) :
β n : β, 2 β€ n β (n : F) β€ (range n).sum (fun i => a i) := by sorry
|
algebra
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.