theorem_name
stringlengths 10
17
| natural_language
stringlengths 48
1.25k
| answer
sequencelengths 1
3
β | source
stringclasses 1
value | tag
stringclasses 4
values | formal_statement
stringlengths 93
3.05k
|
---|---|---|---|---|---|
hackmath_1 | How many ways can a teacher select a group of 6 students to sit in the front row if the class has 13 students? | [
"1716"
] | https://www.hackmath.net/en/word-math-problems/combinatorics | hackmath | import Mathlib
abbrev hackmath_1_solution : β := sorry
theorem hackmath_1 (sols : Finset (Fin 13 β Fin 2))
(h_sols : β f, f β sols β ((List.ofFn f).count 0 = 6)) :
sols.card = hackmath_1_solution := by sorry |
hackmath_2 | There are 8 athletes participating in a sprint competition. The referee needs to select 3 athletes and assign them specific rankings (first place, second place, and third place). How many different arrangements are possible? | [
"336"
] | https://www.hackmath.net/en/word-math-problems/combinatorics | hackmath | import Mathlib
abbrev hackmath_2_solution : β := sorry
theorem hackmath_2 (sols : Finset (Fin 8 β Fin 4))
(h_sols : β f, f β sols β
((List.ofFn f).count 0 = 1) β§ ((List.ofFn f).count 1 = 1) β§ ((List.ofFn f).count 2 = 1)) :
sols.card = hackmath_2_solution := by sorry |
hackmath_3 | How many four-digit numbers can be formed from the numbers 3 5 8 9 if they are not allowed to be repeated? | [
"24"
] | https://www.hackmath.net/en/word-math-problems/combinatorics | hackmath | import Mathlib
abbrev hackmath_3_solution : β := sorry
theorem hackmath_3 (sol : Finset β)
(h_sol : β s β sol, 1000 β€ s β§ s β€ 9999 β§ (Nat.digits 10 s).toFinset = {3, 5, 8, 9}) :
sol.card = hackmath_3_solution := by sorry |
hackmath_4 | How many people must be in a group for at least two of them to be born in the same month? | [
"13"
] | https://www.hackmath.net/en/word-math-problems/combinatorics | hackmath | import Mathlib
abbrev hackmath_4_solution : β := sorry
theorem hackmath_4 : IsLeast {n | β f : Fin n β Fin 12, β a b, f a = f b} hackmath_4_solution := by sorry |
hackmath_5 | There are 10 red marbles, 6 green marbles, and 4 blue marbles in a box. What is the probability of picking the next red marble? | [
"1 / 2"
] | https://www.hackmath.net/en/word-math-problems/combinatorics | hackmath | import Mathlib
open MeasureTheory ProbabilityTheory ENNReal
noncomputable abbrev hackmath_5_solution : ENNReal := sorry
theorem hackmath_5 : uniformOn (Ξ© := (Fin 20)) β€ {i | i.1 < 10} = hackmath_5_solution := by sorry |
hackmath_6 | Two coins are tossed simultaneously. What is the probability of getting (i) At least one head? (ii) At most one tail? (iii) A head and a tail? | [
"3 / 4",
"3 / 4",
"1 / 2"
] | https://www.hackmath.net/en/word-math-problems/combinatorics | hackmath | import Mathlib
noncomputable abbrev hackmath_6_1_solution : ENNReal := sorry
noncomputable abbrev hackmath_6_2_solution : ENNReal := sorry
noncomputable abbrev hackmath_6_3_solution : ENNReal := sorry
theorem hackmath_6 : PMF.binomial (1/2 : _) ENNReal.half_le_self 2 1 +
PMF.binomial (1/2 : _) ENNReal.half_le_self 2 2 = hackmath_6_1_solution β§
PMF.binomial (1/2 : _) ENNReal.half_le_self 2 0 +
PMF.binomial (1/2 : _) ENNReal.half_le_self 2 1 = hackmath_6_2_solution β§
PMF.binomial (1/2 : _) ENNReal.half_le_self 2 1 = hackmath_6_3_solution := by sorry |
hackmath_7 | The group of 10 girls should be divided into two groups with at least four girls in each group. How many ways can this be done? | [
"462"
] | https://www.hackmath.net/en/word-math-problems/combinatorics | hackmath | import Mathlib
abbrev hackmath_7_solution : β := sorry
theorem hackmath_7 (sols : Finset (Finpartition (@Finset.univ (Fin 10))))
(h_sols : β f, f β sols β (f.parts.card = 2) β§ (β i, i β f.parts β i.card β₯ 4)) :
sols.card = hackmath_7_solution := by sorry |
hackmath_8 | A ferry with a capacity of 10 people takes a group of 13 men and 7 women across a river. Find the number of ways in which the qroup may be taken across the if all women go on the first group. | [
"286"
] | https://www.hackmath.net/en/word-math-problems/combinatorics | hackmath | import Mathlib
abbrev hackmath_8_solution : β := sorry
theorem hackmath_8 (sols : Finset ((Fin 13 β Fin 2) Γ (Fin 7 β Fin 2)))
(h_women : β f β sols, β i, f.2 i = 0)
(h_sols : β f, f β sols β β k, ((List.ofFn f.1).count k + (List.ofFn f.2).count k = 10)) :
sols.card = hackmath_8_solution := by sorry |
hackmath_9 | The father has six sons and ten identical, indistinguishable balls. How many ways can he give the balls to his sons if everyone gets at least one? | [
"126"
] | https://www.hackmath.net/en/word-math-problems/combinatorics | hackmath | import Mathlib
abbrev hackmath_9_solution : β := sorry
theorem hackmath_9 (sols : Finset (Fin 6 β β))
(h_sols : β f, f β sols β ((β i, f i > 0) β§ (β i, f i = 10))) :
sols.card = hackmath_9_solution := by sorry |
hackmath_10 | How many different ways can three people divide seven pears and five apples? | [
"756"
] | https://www.hackmath.net/en/word-math-problems/combinatorics | hackmath | import Mathlib
abbrev hackmath_10_solution : β := sorry
theorem hackmath_10 (sols : Finset (Fin 3 β (β Γ β)))
(h_sols : β f, f β sols β (β i, (f i).1 = 7 β§ β i, (f i).2 = 5)) :
sols.card = hackmath_10_solution := by sorry |
brualdi_ch1_16 | Show that the result of replacing every integer a in a magic square of order n with $n^2 + 1 β a$ is a magic square of order n. | null | null | brualdi | import Mathlib
structure IsMagicSquare {n : β} (M : Matrix (Fin n) (Fin n) β) : Prop where
mem : β i j, M i j β Finset.Icc 1 (n * n)
pairwise : β i j i' j', i β i' β¨ j β j' β M i j β M i' j'
same_sum : β s, (β i, β j, M i j = s) β§ (β j, β i, M i j = s) β§ (β i, M i i.rev = s) β§ β i, M i i = s
abbrev replace {n : β}: Matrix (Fin n) (Fin n) β β Matrix (Fin n) (Fin n) β :=
fun A i j β¦ n^2 + 1 - A i j
theorem brualdi_ch1_16 {n : β} (M : Matrix (Fin n) (Fin n) β) (hM : IsMagicSquare M) :
IsMagicSquare (replace M) := by sorry |
brualdi_ch1_10 | Verify that there is no magic square of order 2. | null | null | brualdi | import Mathlib
structure IsMagicSquare {n : β} (M : Matrix (Fin n) (Fin n) β) : Prop where
mem : β i j, M i j β Finset.Icc 1 (n * n)
pairwise : β i j i' j', i β i' β¨ j β j' β M i j β M i' j'
same_sum : β s, (β i, β j, M i j = s) β§ (β j, β i, M i j = s) β§ (β i, M i i.rev = s) β§ β i, M i i = s
theorem brualdi_ch1_10 : Β¬β (M : Matrix (Fin 2) (Fin 2) β), IsMagicSquare M := by sorry |
brualdi_ch1_5 | Find the number of different perfect covers of a 3-by-4 chessboard by dominoes. | [
"9"
] | null | brualdi | import Mathlib
abbrev Board := Fin 3 Γ Fin 4
def formsDomino (i j : Board) : Bool :=
(i.1.val = j.1.val β§ (i.2.val + 1 = j.2.val β¨ j.2.val + 1 = i.2.val)) β¨
(i.2.val = j.2.val β§ (i.1.val + 1 = j.1.val β¨ j.1.val + 1 = i.1.val))
structure PerfectCover where
tiles : Fin 6 β (Board Γ Board)
domino : β i, formsDomino (tiles i).1 (tiles i).2
covers : β i : Board, β j, i = (tiles j).1 β¨ i = (tiles j).2
noncomputable instance : Fintype PerfectCover :=
Fintype.ofInjective PerfectCover.tiles <| by
rintro β¨tiles, _β© β¨tiles', _β© (rfl : tiles = tiles')
rfl
abbrev brualdi_ch1_5_solution : β := sorry
theorem brualdi_ch1_5 : Fintype.card PerfectCover = brualdi_ch1_5_solution := by sorry |
brualdi_ch2_6 | How many integers greater than 5400 have both of the following properties? (a) The digits are distinct. (b) The digits 2 and 7 do not occur. | [
"94830"
] | null | brualdi | import Mathlib
abbrev brualdi_ch2_6_solution : β := sorry
theorem brualdi_ch2_6 (s : Finset β)
(hs0 : β n β s, n > 5400)
(hs1 : β n β s, (Nat.digits 10 n).Nodup)
(hs2 : β n β s, 2 β (Nat.digits 10 n) β§ 7 β (Nat.digits 10 n)) :
s.card = brualdi_ch2_6_solution := by sorry |
brualdi_ch2_36 | Determine the total number of combinations (of any size) of a multiset of objects of $k$ different types with finite repetition numbers $n_{1}, n_{2}, \ldots, n_{k}$, respectively. | [
"fun n => (β i : Fin k, (n i + 1))"
] | null | brualdi | import Mathlib
abbrev brualdi_ch2_36_solution {k} : (Fin k β β) β β := sorry
theorem brualdi_ch2_36 {k : β} (n : Fin k β β)
(sols : Finset (Fin k β β))
(h_sols : β f, f β sols β (β i, f i β€ n i)) :
sols.card = brualdi_ch2_36_solution n := by sorry |
brualdi_ch2_11 | How many sets of three integers between 1 and 20 are possible if no two consecutive integers are to be in a set? | [
"816"
] | null | brualdi | import Mathlib
open Finset
abbrev brualdi_ch2_11_solution : β := sorry
theorem brualdi_ch2_11 :
((Icc (1 : β) 20).powersetCard 3 |>.filter (fun S => β a β S, a - 1 β S β§ a + 1 β S)).card =
brualdi_ch2_11_solution := by sorry |
brualdi_ch3_18 | Prove that of any five points chosen within a square of side length 2 , there are two whose distance apart is at most $\sqrt{2}$. | null | null | brualdi | import Mathlib
theorem brualdi_ch3_18
(points : Fin 5 β Set.Icc (0 : β) 2 Γ Set.Icc (0 : β) 2) :
β i j, i β j β§ Dist.dist (points i) (points j) β€ β2 := by sorry |
brualdi_ch3_4 | Show that if $n+1$ integers are chosen from the set ${1,2, \ldots, 2 n}$, then there are always two which differ by 1. | null | null | brualdi | import Mathlib
theorem brualdi_ch3_4 (n : β) (S : Finset β) (elem_range : β s β S, (1 β€ s β§ s β€ 2 * n))
(card : S.card = n + 1) : β s β S, β s' β S, s = s' + 1 := by sorry |
brualdi_ch3_27 | A collection of subsets of ${1,2, \ldots, n}$ has the property that each pair of subsets has at least one element in common. Prove that there are at most $2^{n-1}$ subsets in the collection. | null | null | brualdi | import Mathlib
theorem brualdi_ch3_27 (n : β) (hn : n β₯ 1)
(subsets : Set (Set (Set.Icc 1 n)))
(cond : β S β subsets, β T β subsets, (S β© T).Nonempty) :
β (m : β), m β€ 2 ^ (n - 1) β§ Nonempty (Fin m β subsets) := by sorry |
brualdi_ch4_35 | The complement $\bar{A}$ of an $r$-subset $A$ of $\{1,2, \ldots, n\}$ is the $(n-r)$-subset of $\{1,2, \ldots, n\}$, consisting of all those elements that do not belong to $A$. Let $M=\binom{n}{r}$, the number of $r$-subsets and, at the same time, the number of $(n-r)$ subsets of $\{1,2, \ldots, n\}$. Prove that, if $A_{1}, A_{2}, A_{3}, \ldots, A_{M}$ are the $r$-subsets in lexicographic order, then $\overline{A_{M}}, \ldots, \overline{A_{3}}, \overline{A_{2}}, \overline{A_{1}}$ are the $(n-r)$-subsets in lexicographic order. | null | null | brualdi | import Mathlib
open List Lex
theorem brualdi_ch4_35 (r n M : β) (hM : M = ((@Finset.univ (Fin n)).powersetCard r).card)
(A : Fin M β (Finset.powersetCard r (@Finset.univ (Fin M) _))) :
β i j, (List.Lex (fun x1 x2 : Fin M => x1 β€ x2)
(Finset.sort (Β· β€ Β·) (A i)) (Finset.sort (Β· β€ Β·) (A j))) β
(List.Lex (fun x1 x2 : Fin M => x1 β€ x2)
(Finset.sort (Β· β€ Β·) (A j)αΆ) (Finset.sort (Β· β€ Β·) (A i)αΆ)) := by sorry |
brualdi_ch4_59 | Let $n \geq 2$ be an integer. Prove that the total number of inversions of all $n$ ! permutations of $1,2, \ldots, n$ equals $\frac{1}{2} n!\binom{n}{2}=n!\frac{n(n-1)}{4}$ (Hint: Pair up the permutations so that the number of inversions in each pair is $\frac{n(n-1)}{2}$.) | null | null | brualdi | import Mathlib
def invNum {n : β} (Ο : Equiv.Perm (Fin n)) : β :=
β x β Equiv.Perm.finPairsLT n, if Ο x.fst β€ Ο x.snd then 0 else 1
theorem brualdi_ch4_59 (n : β) (hn : n β₯ 2) : β Ο : Equiv.Perm (Fin n), invNum Ο =
n.factorial * n * (n - 1) / 4 := by sorry |
brualdi_ch4_9 | Show that the largest number of inversions of a permutation of ${1, 2, ... , n}$ equals $\frac{n(n -1)}{2}$. | null | null | brualdi | import Mathlib
def invNum {n : β} (Ο : Equiv.Perm (Fin n)) : β :=
β x β Equiv.Perm.finPairsLT n, if Ο x.fst β€ Ο x.snd then 0 else 1
theorem brualdi_ch4_9 (n : β) :
IsGreatest {k | β Ο : Equiv.Perm (Fin n), k = invNum Ο} (n * (n - 1) / 2) := by sorry |
brualdi_ch5_51 | Let $R$ and $S$ be two partial orders on the same set $X$. Considering $R$ and $S$ as subsets of $X \times X$, we assume that $R \subseteq S$ but $R \neq S$. Show that there exists an ordered pair $(p, q)$, where $(p, q) \in S$ and $(p, q) \notin R$ such that $R^{\prime}=R \cup\{(p, q)\}$ is also a partial order on $X$. | null | null | brualdi | import Mathlib
theorem brualdi_ch5_51 {X : Type} [DecidableEq X] (R S : Rel X X) [IsPartialOrder X R]
[IsPartialOrder X S] (le : R < S) :
β (p q : X), S p q β§ Β¬ R p q β§
IsPartialOrder X (R β fun x y β¦ if x = p β§ y = q then true else false) := by sorry |
brualdi_ch5_9 | Evaluate the sum $\sum_{k=0}^{n}(-1)^{k}\binom{n}{k} 10^{k}$. | [
"fun n => (-9 : β€)^n"
] | null | brualdi | import Mathlib
abbrev brualdi_ch5_9_solution : β β β€ := sorry
theorem brualdi_ch5_9 (n : β) : β k β Finset.range (n + 1), (-1 : β€) ^ k * (n.choose k) * 10 ^ k =
brualdi_ch5_9_solution n := by sorry |
brualdi_ch5_26 | Let $n$ and $k$ be integers with $1 \leq k \leq n$. Prove that $\sum_{k=1}^{n}\binom{n}{k}\binom{n}{k-1}=\frac{1}{2}\binom{2 n+1}{n+1}-\binom{2 n}{n}$. | null | null | brualdi | import Mathlib
theorem brualdi_ch5_26 (n k : β) (h1 : 1 β€ k) (h2 : k β€ n) :
β k β Finset.Icc 1 n, Nat.choose n k * Nat.choose n (k - 1) =
(1 / 2 : β) * Nat.choose (2 * n + 1) (n + 1) - Nat.choose (2 * n) n := by sorry |
brualdi_ch6_11 | Determine the number of permutations of $\{1,2, \ldots, 8\}$ in which no even integer is in its natural position. | [
"24024"
] | null | brualdi | import Mathlib
abbrev brualdi_ch6_11_solution : β := sorry
theorem brualdi_ch6_11
(sols : Finset (Equiv.Perm (Finset.Icc 1 8)))
(h_sols : β Ο, Ο β sols β (β i, Even i.1 β Ο i β i)) :
sols.card = brualdi_ch6_11_solution := by sorry |
brualdi_ch6_21 | Prove that $D_{n}$ is an even number if and only if $n$ is an odd number. | null | null | brualdi | import Mathlib
theorem brualdi_ch6_21 (n : β) : Even (numDerangements n) β Odd n := by sorry |
brualdi_ch6_9 | Determine the number of integral solutions of the equation $x_{1}+x_{2}+x_{3}+x_{4}=20$ that satisfy $1 \leq x_{1} \leq 6,0 \leq x_{2} \leq 7,4 \leq x_{3} \leq 8,2 \leq x_{4} \leq 6$. | [
"96"
] | null | brualdi | import Mathlib
open Finset
abbrev brualdi_ch6_9_solution : β := sorry
theorem brualdi_ch6_9 : {x : Fin 4 β β | x 0 β Icc 1 6 β§ x 1 β Icc 0 7 β§
x 2 β Icc 4 8 β§ x 3 β Icc 2 6}.ncard = brualdi_ch6_9_solution := by sorry |
brualdi_ch7_15 | Determine the generating function for the sequence of cubes \[ 0, 1, 8, \ldots, n^{3}, \ldots \] | [
"PowerSeries.X * (PowerSeries.X ^ 2 + 4 * PowerSeries.X + 1) * PowerSeries.inv (1 - PowerSeries.X) ^ 4"
] | null | brualdi | import Mathlib
abbrev brualdi_ch7_15_solution : PowerSeries β := sorry
theorem brualdi_ch7_15 : PowerSeries.mk (fun (n : β) => (n : β) ^ 3) = brualdi_ch7_15_solution := by
sorry |
brualdi_ch7_7 | Let $m$ and $n$ be positive integers whose greatest common divisor is $d$. Prove that the greatest common divisor of the Fibonacci numbers $f_{m}$ and $f_{n}$ is the Fibonacci number $f_{d}$. | null | null | brualdi | import Mathlib
theorem brualdi_ch7_7 (m n d : β+) (hmd : d = Nat.gcd m n) :
Nat.gcd (Nat.fib m) (Nat.fib n) = Nat.fib d := by sorry |
brualdi_ch7_27 | Determine the number of n-digit numbers with all digits odd, such that 1 and 3 each occur a nonzero, even number of times. | [
"fun n => (5 ^ n - 4 ^ (n + 1) + 6 * 3 ^ n - 4 * 2 ^ n + 1) / 4 "
] | null | brualdi | import Mathlib
abbrev S (n : β) : Finset β :=
{m < 10^n | (Nat.digits 10 m).length = n β§
(β i : Fin (Nat.digits 10 m).length, Odd ((Nat.digits 10 m).get i)) β§
Even ((Nat.digits 10 m).count 1) β§ Even ((Nat.digits 10 m).count 3) β§
((Nat.digits 10 m).count 1) β 0 β§ ((Nat.digits 10 m).count 3) β 0}
abbrev brualdi_ch7_27_solution : β β β := sorry
theorem brualdi_ch7_27 (n : β) : (S n).card = brualdi_ch7_27_solution n := by sorry |
brualdi_ch8_6 | Let the sequence $h_{0}, h_{1}, \ldots, h_{n}, \ldots$ be defined by $h_{n}=2 n^{2}-n+3,(n \geq 0)$. Find a formula for $\sum_{k=0}^{n} h_{k}$. | [
"fun n => ((n + 1) * (4 * n ^ 2 - n + 18) / 6)"
] | null | brualdi | import Mathlib
abbrev brualdi_ch8_6_solution : β β β := sorry
theorem brualdi_ch8_6 (n : β) (h : β β β) (h' : β i, h i = 2 * i ^ 2 - i + 3) :
β i β Finset.range (n + 1), h i = brualdi_ch8_6_solution n := by sorry |
brualdi_ch8_30 | Prove that the partition function satisfies $p_{n} > p_{n-1}$ when $2 β€ n$. | null | null | brualdi | import Mathlib
theorem brualdi_ch8_30 (n : β) (hn : 2 β€ n) :
Fintype.card (Nat.Partition (n - 1)) < Fintype.card (Nat.Partition n) := by sorry |
brualdi_ch8_9 | Prove that the following formula holds for the $k$ th-order differences of a sequence $h_{0}, h_{1}, \ldots, h_{n}, \ldots$ : \Delta^{k} h_{n}=\sum_{j=0}^{k}(-1)^{k-j}\binom{k}{j} h_{n+j} | null | null | brualdi | import Mathlib
theorem brualdi_ch8_9 (h : β β β€) (k n : β): (fwdDiff 1)^[k] h n = β j β Finset.range (k + 1),
(-1 : β€) ^ (k - j) * Nat.choose k j * h (n + j) := by sorry |
brualdi_ch9_13 | Let $A$ be a matrix with $n$ columns, with integer entries taken from the set $S=\{1,2, \ldots, k\}$. Assume that each integer $i$ in $S$ occurs exactly $n r_{i}$ times in $A$, where $r_{i}$ is an integer. Prove that it is possible to permute the entries in each row of $A$ to obtain a matrix $B$ in which each integer $i$ in $S$ appears $r_{i}$ times in each column. | null | null | brualdi | import Mathlib
theorem brualdi_ch9_13 (n m : β) (k : β+) (A : Matrix (Fin m) (Fin n) β)
(hA : β i j, A i j β Finset.Icc 1 k.1) :
β (rΟ : Fin m β Equiv.Perm (Fin n)), β j : Fin n, β i β Set.Icc 1 k.1,
(β x : Fin m, if A x ((rΟ x).symm j) = x then 1 else 0) * n =
(β x : Fin m, β y : Fin n, if A x y = i then 1 else 0) := by sorry |
brualdi_ch9_8 | Let $\mathcal{A}=\left(A_{1}, A_{2}, A_{3}, A_{4}, A_{5}, A_{6}\right)$, where \[ \begin{aligned} & A_{1}=\{1,2\}, A_{2}=\{2,3\}, A_{3}=\{3,4\} \\ & A_{4}=\{4,5\}, A_{5}=\{5,6\}, A_{6}=\{6,1\} \end{aligned} \] Determine the number of different SDRs that $\mathcal{A}$ has. | [
"2"
] | null | brualdi | import Mathlib
variable {Ξ± : Type*}
structure SDR {n : β} (A : Fin n β Finset Ξ±) where
toFun : Fin n β Ξ±
mem_Ai : β i, toFun i β A i
pairwise : β i j, i β j β toFun i β toFun j
instance {n : β} (A : Fin n β Finset Ξ±) : CoeFun (SDR A) (fun _ => Fin n β Ξ±) where
coe s := s.toFun
noncomputable instance {n : β} (A : Fin n β Finset Ξ±) : Fintype (SDR A) := by
classical
let Y := Finset.biUnion (@Finset.univ (Fin n) _) A
if h : Nonempty (SDR A) then
exact Fintype.ofSurjective (Ξ± := (Fin n β Y))
(fun f β¦ if h1 : (β(g : SDR A), β i, f i = g i) then β¨fun i => f i,
fun i β¦ by have β¨g, hgβ© := h1; simp [hg, g.mem_Ai],
fun i j hij β¦ by have β¨g, hgβ© := h1; simp [hg, g.pairwise i j hij]β©
else Classical.choice (Ξ± := (SDR A)) h) <| fun g β¦
β¨fun i => β¨g i, by simp [Y]; use i; simp [g.mem_Ai]β©, by
simp; suffices β (g' : SDR A), β (i : Fin n), g.toFun i = g'.toFun i by simp [this]
use g; simpβ©
else exact fintypeOfNotInfinite (fun h1 β¦ by aesop)
abbrev A : Fin 6 β Finset β := fun i β¦ match i with
| 1 => {1, 2}
| 2 => {2, 3}
| 3 => {3, 4}
| 4 => {4, 5}
| 5 => {5, 6}
| 6 => {6, 1}
abbrev brualdi_ch9_8_solution : β := sorry
theorem brualdi_ch9_8 : Fintype.card (SDR A) = brualdi_ch9_8_solution := by sorry |
brualdi_ch9_11 | Let $n>1$, and let $\mathcal{A}=\left(A_{1}, A_{2}, \ldots, A_{n}\right)$ be the family of subsets of $\{1,2, \ldots, n\}$, where \[ A_{i}=\{1,2, \ldots, n\}-\{i\}, \quad(i=1,2, \ldots, n) \] Prove that $\mathcal{A}$ has an SDR and that the number of SDRs is the $n$th derangement number $D_{n}$. | null | null | brualdi | import Mathlib
variable {Ξ± : Type*}
structure SDR {n : β} (A : Fin n β Finset Ξ±) where
toFun : Fin n β Ξ±
mem_Ai : β i, toFun i β A i
pairwise : β i j, i β j β toFun i β toFun j
instance {n : β} (A : Fin n β Finset Ξ±) : CoeFun (SDR A) (fun _ => Fin n β Ξ±) where
coe s := s.toFun
noncomputable instance {n : β} (A : Fin n β Finset Ξ±) : Fintype (SDR A) := by
classical
let Y := Finset.biUnion (@Finset.univ (Fin n) _) A
if h : Nonempty (SDR A) then
exact Fintype.ofSurjective (Ξ± := (Fin n β Y))
(fun f β¦ if h1 : (β(g : SDR A), β i, f i = g i) then β¨fun i => f i,
fun i β¦ by have β¨g, hgβ© := h1; simp [hg, g.mem_Ai],
fun i j hij β¦ by have β¨g, hgβ© := h1; simp [hg, g.pairwise i j hij]β©
else Classical.choice (Ξ± := (SDR A)) h) <| fun g β¦
β¨fun i => β¨g i, by simp [Y]; use i; simp [g.mem_Ai]β©, by
simp; suffices β (g' : SDR A), β (i : Fin n), g.toFun i = g'.toFun i by simp [this]
use g; simpβ©
else exact fintypeOfNotInfinite (fun h1 β¦ by aesop)
theorem brualdi_ch9_11 (n : β) (hn : n > 1) (A : Fin n β Finset β)
(hA : β i, A i = Finset.Icc 1 n \ {i.1 + 1}) :
Nonempty (SDR A) β§ Fintype.card (SDR A) = numDerangements n := by sorry |
brualdi_ch10_31 | Prove that $B = {0,3,4,9,11}$ is a difference set in $Z_{21}$. | null | null | brualdi | import Mathlib
def isDifferenceSet (n : β) (B : Finset (ZMod n)) : Prop :=
β k, β x : (ZMod n), x β 0 β β i β B, β j β B \ {i}, List.count x [i - j] = k
theorem brualdi_ch10_31 : isDifferenceSet 21 {0, 3, 4, 9, 11} := by sorry |
brualdi_ch10_34 | Let $t$ be a positive integer. Prove that, if there exists a Steiner triple system of index 1 having $v$ varieties, then there exists a Steiner triple system having $v^{t}$ varieties. | null | null | brualdi | import Mathlib
structure SteinerTripleSystemOfIndOne (t k n : β) where
carrier : Fin n
blocks : Finset (Finset (Fin n))
card_blocks : β b β blocks, b.card = k
block_inner : β s : (Finset (Fin n)), s.card = t β β! b β blocks, s β b
theorem brualdi_ch10_34 (t v : β) (ht : t > 1): Nonempty (SteinerTripleSystemOfIndOne 2 3 v) β
Nonempty (SteinerTripleSystemOfIndOne 2 3 (v ^ t)) := by sorry |
brualdi_ch10_60 | Prove that a symmetric, idempotent Latin square has odd order. | null | null | brualdi | import Mathlib
structure LatinSquare (n : β) where
carrier : Matrix (Fin n) (Fin n) (ZMod n)
pairwise_1 : β i j1 j2, j1 β j2 β carrier i j1 β carrier i j2
pairwise_2 : β j i1 i2, i1 β i2 β carrier i1 j β carrier i2 j
theorem brualdi_ch10_60 {n : β} (L : LatinSquare n) :
IsIdempotentElem L.1 β§ L.1.IsSymm β Odd n := by sorry |
brualdi_ch11_5 | Use the pigeonhole principle to prove that a graph of order n β₯ 2 always has two vertices of the same degree. | null | null | brualdi | import Mathlib
theorem brualdi_ch11_5 {V : Type*} (n : β) (h_n: n β₯ 2) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] :
β v1 v2, v1 β v2 β§ G.degree v1 = G.degree v2 := by sorry |
brualdi_ch11_59 | Prove that the removal of an edge from a tree leaves a forest of two trees. | null | null | brualdi | import Mathlib
open SimpleGraph
theorem brualdi_ch11_59 {V : Type*} [Fintype V] [DecidableEq V]
(T : SimpleGraph V) (hT : IsTree T) (e : Sym2 V) (he : e β T.edgeSet) :
β (T1 T2 : SimpleGraph V), IsTree T1 β§ IsTree T2 β§
T1.edgeSet βͺ T2.edgeSet = T.edgeSet \ {e} β§
Disjoint (T1.support) (T2.support) := by sorry |
brualdi_ch11_20 | Prove that a graph of order n with at least `(n-1)(n-2)/2 + 1` edges must be connected. | null | null | brualdi | import Mathlib
theorem brualdi_ch11_20 {V : Type*} [Fintype V] (n : β) (hn : n β₯ 1) (hV : Fintype.card V = n)
(G : SimpleGraph V) (h : (n - 1) * (n - 2) / 2 + 1 β€ (SimpleGraph.edgeSet G).ncard) :
G.Connected := by sorry |
brualdi_ch12_37 | Determine the domination number of the graph $Q_{3}$ of vertices and edges of a three-dimensional cube. | [
"1"
] | null | brualdi | import Mathlib
open SimpleGraph BigOperators Classical
variable (n : β) {V : Type*} (G : SimpleGraph V)
def SimpleGraph.IsDominatingSet (D : Set V) : Prop :=
β v : V, Β¬ (v β D) β β u β D, G.Adj u v
lemma IsDominatingSet.univ : G.IsDominatingSet Set.univ := by simp [IsDominatingSet]
noncomputable def SimpleGraph.eDominationNum : ββ := iInf (fun s β¦ if
(G.IsDominatingSet s) then s.card else β€ : (Finset V) β ββ)
noncomputable def SimpleGraph.dominationNum : β := G.eDominationNum.toNat
abbrev Q_3 := (pathGraph 2) β‘ (pathGraph 2) β‘ (pathGraph 2)
abbrev brualdi_ch12_37_solution : β := sorry
theorem brualdi_ch12_37 : Q_3.dominationNum = brualdi_ch12_37_solution:= by sorry |
brualdi_ch12_62 | Let $G$ be a graph. Prove that $G$ is 2-connected if and only if, for each vertex $x$ and each edge $\alpha$, there is a cycle that contains both the vertex $x$ and the edge $\alpha$. | null | null | brualdi | import Mathlib
structure TwoConnected {V : Type*} (G : SimpleGraph V) : Prop where
selfconnected : G.Connected
remains_connected : β x : V, ((β€ : SimpleGraph.Subgraph G).deleteVerts {x}).coe.Connected
theorem brualdi_ch12_62 {V : Type*} (G : SimpleGraph V) : TwoConnected G β β x : V, β e β G.edgeSet,
β G' : SimpleGraph.Subgraph G, x β G'.verts β§ e β G'.edgeSet β§ G'.coe.IsCycles := by sorry |
brualdi_ch12_34 | Prove that the complement of a disconnected graph is connected. | null | null | brualdi | import Mathlib
theorem brualdi_ch12_34 {V : Type*} (G : SimpleGraph V) (h : Β¬ G.Connected) :
GαΆ.Connected := by sorry |
brualdi_ch13_6 | Prove that a digraph is strongly connected if and only if there is a closed, directed walk that contains each vertex at least once. | null | null | brualdi | import Mathlib
universe u
inductive Digraph.Walk {V : Type u} (G : Digraph V) : V β V β Type u
| nil {u : V} (h : G.Adj u u) : Digraph.Walk G u u
| cons {u v w : V} (h : G.Adj u v) (p : Digraph.Walk G v w) : Digraph.Walk G u w
deriving DecidableEq
structure Digraph.StronglyConnected {V : Type u} (G : Digraph V) : Prop where
exists_walk β¦u v : Vβ¦ (neq : u β v) : Nonempty (Digraph.Walk G u v)
def Digraph.Walk.support {V : Type u} {G : Digraph V} {u v : V} : Digraph.Walk G u v β List V
| .nil h => [u]
| .cons _ p => u :: p.support
theorem brualdi_ch13_6 {V : Type u} (T : Digraph V) :
T.StronglyConnected β β (u : V) (p : T.Walk u u), β v : V, v β p.support := by sorry |
brualdi_ch13_10 | Prove that every tournament contains a vertex $u$ such that, for every other vertex $x$, there is a path from $u$ to $x$ of length at most 2. | null | null | brualdi | import Mathlib
universe u
structure IsTournament {V : Type u} (G : Digraph V) : Prop where
irrefl : β (u : V), Β¬ G.Adj u u
adj : β (u v : V), u β v β (G.Adj u v β Β¬ G.Adj v u)
inductive Digraph.Walk {V : Type u} (G : Digraph V) : V β V β Type u
| nil {u : V} (h : G.Adj u u) : Digraph.Walk G u u
| cons {u v w : V} (h : G.Adj u v) (p : Digraph.Walk G v w) : Digraph.Walk G u w
deriving DecidableEq
def Digraph.Walk.support {V : Type u} {G : Digraph V} {u v : V} : Digraph.Walk G u v β List V
| .nil h => [u]
| .cons _ p => u :: p.support
def Digraph.Walk.IsPath {V : Type u} {G : Digraph V} {u v : V} (p : Digraph.Walk G u v) : Prop :=
p.support.Nodup
def Digraph.Walk.length {V : Type u} {G : Digraph V} {u v : V} : Digraph.Walk G u v β β
| .nil h => 0
| .cons _ p => 1 + p.length
theorem brualdi_ch13_10 {V : Type u} (T : Digraph V) (hT : IsTournament T) :
β (u : V), β (x : V), β (p : T.Walk u x), p.IsPath β§ p.length β€ 2 := by sorry |
brualdi_ch13_9 | Prove that a tournament is strongly connected if and only if it has a directed Hamilton cycle. | null | null | brualdi | import Mathlib
universe u
structure IsTournament {V : Type u} (G : Digraph V) : Prop where
irrefl : β (u : V), Β¬ G.Adj u u
adj : β (u v : V), u β v β (G.Adj u v β Β¬ G.Adj v u)
inductive Digraph.Walk {V : Type u} (G : Digraph V) : V β V β Type u
| nil {u : V} (h : G.Adj u u) : Digraph.Walk G u u
| cons {u v w : V} (h : G.Adj u v) (p : Digraph.Walk G v w) : Digraph.Walk G u w
deriving DecidableEq
structure Digraph.StronglyConnected {V : Type u} (G : Digraph V) : Prop where
exists_walk β¦u v : Vβ¦ (neq : u β v) : Nonempty (Digraph.Walk G u v)
def Digraph.Walk.support {V : Type u} {G : Digraph V} {u v : V} : Digraph.Walk G u v β List V
| .nil h => [u]
| .cons _ p => u :: p.support
def Digraph.Walk.IsPath {V : Type u} {G : Digraph V} {u v : V} (p : Digraph.Walk G u v) : Prop :=
p.support.Nodup
structure Digraph.Walk.IsHamiltonianCycle
{V : Type u} {G : Digraph V} {u : V} (p : Digraph.Walk G u u) : Prop where
is_path : p.IsPath
visit_all (v : V) : v β p.support
theorem brualdi_ch13_9 {V : Type u} (T : Digraph V) (hT : IsTournament T) :
T.StronglyConnected β
β (u : V) (p : T.Walk u u), p.IsHamiltonianCycle := by sorry |
brualdi_ch14_45 | Let $n$ be an odd prime number. Prove that each of the permutations, $\rho_{n}, \rho_{n}^{2}, \ldots, \rho_{n}^{n}$ of $\{1,2, \ldots, n\}$ is an $n$-cycle. (Recall that $\rho_{n}$ is the permutation that sends 1 to 2,2 to $3, \ldots, n-1$ to $n$, and $n$ to 1.) | null | null | brualdi | import Mathlib
theorem brualdi_ch14_45 {n : β} (h : Odd n) (hp : Nat.Prime n) :
β i β Finset.Icc 1 n, ((finRotate n) ^ i).IsCycle := by sorry |
brualdi_ch14_26 | How many different necklaces are there that contain four red and three blue beads? | [
"15"
] | null | brualdi | import Mathlib
structure PreNecklaces where
c : Fin 7 β Fin 2
deriving Fintype
def myDihedralGroup (n : β) : Subgroup (Equiv.Perm (Fin n)) :=
Subgroup.closure {finRotate n, Fin.revPerm}
instance Necklaces.setoid : Setoid PreNecklaces where
r n1 n2 := β s β myDihedralGroup 7, n1.c = n2.c β s
iseqv :=
{ refl n := β¨1, one_mem _, by simpβ©
symm := by
rintro m n β¨p, hp, eqpβ©
refine β¨pβ»ΒΉ, inv_mem hp, eqp βΈ ?_β©
ext x
simp
trans := by
rintro a b c β¨p, hp, eqpβ© β¨q, hq, eqqβ©
refine β¨q * p, mul_mem hq hp, ?_β©
rw [eqp, eqq]
ext x
simp }
abbrev Necklaces := Quotient Necklaces.setoid
noncomputable instance : Fintype Necklaces := by
have := Quotient.finite (Necklaces.setoid)
exact Fintype.ofFinite Necklaces
abbrev brualdi_ch14_26_solution : β := sorry
theorem brualdi_ch14_26 : Fintype.card Necklaces = brualdi_ch14_26_solution := by sorry |
brualdi_ch14_33 | Prove that a permutation and its inverse have the same type. | null | null | brualdi | import Mathlib
theorem brualdi_ch14_33 {Ξ± : Type*} [Fintype Ξ±] [DecidableEq Ξ±] (Ο : Equiv.Perm Ξ±) :
Ο.cycleType = Οβ»ΒΉ.cycleType := by sorry |
apmo_1991_p2 | Suppose there are 997 points given in a plane. If every two points are joined by a line segment with its midpoint coloured in red, show that there are at least 1991 red points in the plane. | null | null | math_competitions | import Mathlib
noncomputable def red_points {k} (points : Fin k β β Γ β) : Finset (β Γ β) :=
((Finset.univ (Ξ± := Fin k Γ Fin k)).image (fun x => midpoint β (points x.1) (points x.2)))
theorem apmo_1991_p2 (points : Fin 997 β β Γ β) : (red_points points).card β₯ 1991 := by sorry |
apmo_2023_p1 | Let $n \geq 5$ be an integer. Consider $n$ squares with side lengths $1,2, \ldots, n$, respectively. The squares are arranged in the plane with their sides parallel to the $x$ and $y$ axes. Suppose that no two squares touch, except possibly at their vertices.\nShow that it is possible to arrange these squares in a way such that every square touches exactly two other squares. | null | null | math_competitions | import Mathlib
structure Square where
(pos : β Γ β)
(side_length : β)
def Square.vertices (s: Square) : List (β Γ β) :=
let x := s.pos.1; let y := s.pos.2; let n : β := s.side_length;
[(x, y), (x + n, y), (x, y + n), (x + n, y + n)]
def Square.contains (s : Square) (p : β Γ β) : Prop :=
let x := s.pos.1; let y := s.pos.2; let n : β := s.side_length;
x β€ p.1 β§ p.1 β€ x + n β§ y β€ p.2 β§ p.2 β€ y + n
def touches (s1: Square) (s2: Square): Prop :=
β v β s1.vertices, s2.contains v
def touches_interior_or_edge (s1: Square) (s2: Square): Prop :=
β v β s1.vertices, s2.contains v β§ v β s2.vertices
theorem apmo_2023_p1 (n : β) (h_n: n β₯ 5) :
β position: Fin n β β Γ β,
(β n1 n2 : Fin n, n1 β n2 β Β¬ touches_interior_or_edge β¨position n1, n1 + 1β© β¨position n2, n2 + 1β©)
β§ βm : Fin n, β l k, m β l β§ m β k β§ l β k
β§ touches β¨position m, m + 1β© β¨position l, l + 1β©
β§ touches β¨position m, m + 1β© β¨position k, k + 1β©
β§ (β j : Fin n, j β [m, l, k] β Β¬ touches β¨position m, m + 1β© β¨position j, j + 1β©) := by sorry |
balticway_2015_p7 | There are 100 members in a ladies' club. Each lady has had tea (in private) with exactly 56 of the other members of the club. The Board, consisting of the 50 most distinguished ladies, have all had tea with one another. Prove that the entire club may be split into two groups in such a way that, within each group, any lady has had tea with any other. | null | null | math_competitions | import Mathlib
open SimpleGraph Finset
abbrev Ladies := Fin 100
theorem balticway_2015_p7 (had_tea: SimpleGraph (Ladies)) [DecidableRel had_tea.Adj]
(h_had_tea_with_56: β l : Ladies, had_tea.degree l = 56)
(h_board: β board : Finset Ladies, board.card = 50 β§ (β l1 l2: board, had_tea.Adj l1 l2)) :
β group1 group2: Finset Ladies,
group1 βͺ group2 = Finset.univ
β§ Disjoint group1 group2
β§ (β l1 l2: group1, had_tea.Adj l1 l2)
β§ (β l1 l2: group2, had_tea.Adj l1 l2) := by sorry |
egmo_2022_p5 | For all positive integers $n, k$, let $f(n, 2k)$ be the number of ways an $n \times 2k$ board can be fully covered by $nk$ dominoes of size $2 \times 1$. (For example, $f(2,2)=2$ and $f(3,2)=3$.)\nFind all positive integers $n$ such that for every positive integer $k$, the number $f(n, 2k)$ is odd. | [
"{x | β m > 0, 2 ^ m - 1 = x}"
] | null | math_competitions | import Mathlib
def formsDomino (n k : β) (i j : Fin n Γ Fin (2 * k)) : Bool :=
(i.1.val = j.1.val β§ (i.2.val + 1 = j.2.val β¨ j.2.val + 1 = i.2.val)) β¨
(i.2.val = j.2.val β§ (i.1.val + 1 = j.1.val β¨ j.1.val + 1 = i.1.val))
structure PerfectCover (n k : β) where
d : Fin (n * k) β ((Fin n Γ Fin (2 * k)) Γ (Fin n Γ Fin (2 * k)))
domino : β i, formsDomino n k (d i).1 (d i).2
covers : β i : Fin n Γ Fin (2 * k), β j, i = (d j).1 β¨ i = (d j).2
noncomputable instance {n k} : Fintype (PerfectCover n k) :=
Fintype.ofInjective PerfectCover.d <| by
rintro β¨d, _β© β¨d', _β© (rfl : d = d')
rfl
abbrev egmo_2022_p5_solution : Set β := sorry
theorem egmo_2022_p5 : {n | n > 0 β§ β k > 0, Odd (Fintype.card (PerfectCover n k))} =
egmo_2022_p5_solution := by sorry |
imosl_2011_c6 | Let $n$ be a positive integer and let $W=\ldots x_{-1} x_{0} x_{1} x_{2} \ldots$ be an infinite periodic word consisting of the letters $a$ and $b$. Suppose that the minimal period $N$ of $W$ is greater than $2^{n}$. A finite nonempty word $U$ is said to appear in $W$ if there exist indices $k \leq \ell$ such that $U=x_{k} x_{k+1} \ldots x_{\ell}$. A finite word $U$ is called ubiquitous if the four words $U a, U b, a U$, and $b U$ all appear in $W$. Prove that there are at least $n$ ubiquitous finite nonempty words. | null | null | math_competitions | import Mathlib
def appears (W : β€ β Fin 2) (U : Ξ£ n, Fin n β Fin 2) : Prop :=
β k, β i : Fin U.1, U.2 i = W (k + i)
def ubiquitous (W : β€ β Fin 2) (U : Ξ£ n, Fin n β Fin 2) : Prop :=
appears W β¨U.1 + 1, Fin.snoc U.2 0β© β§
appears W β¨U.1 + 1, Fin.snoc U.2 1β© β§
appears W β¨U.1 + 1, Fin.cons 0 U.2β© β§
appears W β¨U.1 + 1, Fin.cons 1 U.2β©
theorem imosl_2011_c6 (W : β€ β Fin 2) (n : β+) (N : β) (hN : 2 ^ n.1 < N)
(hW : Function.Periodic W N) (hW' : β N' < N, Β¬ Function.Periodic W N') :
β (x : Fin n βͺ (Ξ£ k, Fin k β Fin 2)), (β i, (x i).1 β 0) β§ (β i, ubiquitous W (x i)) := by sorry |
imosl_2015_c6 | Let $S$ be a nonempty set of positive integers. We say that a positive integer $n$ is clean if it has a unique representation as a sum of an odd number of distinct elements from $S$. Prove that there exist infinitely many positive integers that are not clean. | null | null | math_competitions | import Mathlib
def clean (S : Set β+) (n : β) : Prop :=
β! (f : β ββ β),
(β i β f.support, f i = n) β§
(Odd f.support.card) β§
(β (i : β) (h : i β f.support), β¨f i, Nat.pos_of_ne_zero <| by aesopβ© β S)
theorem imosl_2015_c6 (S : Set β+) : β (N : β), β (m : β), N < m β§ Β¬ clean S m := by sorry |
imosl_2019_c2 | You are given a set of $n$ blocks, each weighing at least 1; their total weight is $2 n$. Prove that for every real number $r$ with $0 \leqslant r \leqslant 2 n-2$ you can choose a subset of the blocks whose total weight is at least $r$ but at most $r+2$. | null | null | math_competitions | import Mathlib
theorem imosl_2019_c2 (n : β) (blocks : Fin n β β) (h1 : β i, blocks i β₯ 1)
(h2 : β i, blocks i = 2 * n) :
β r : β, 0 β€ r β§ r β€ 2 * n - 2 β
β (s : Finset (Fin n)), (β i β s, blocks i) β₯ r β§ (β i β s, blocks i) β€ r + 2 := by sorry |
imosl_2021_c5 | Let $n$ and $k$ be two integers with $n > k \geqslant 1$. There are $2n+1$ students standing in a circle. Each student $S$ has $2k$ neighbours - namely, the $k$ students closest to $S$ on the right, and the $k$ students closest to $S$ on the left. Suppose that $n+1$ of the students are girls, and the other $n$ are boys. Prove that there is a girl with at least $k$ girls among her neighbours. | null | null | math_competitions | import Mathlib
def leftNeighbors {n : β+} (people : Fin (2*n+1) β ZMod 2) (k : β+) (i : Fin (2*n+1)) : Fin k β ZMod 2 :=
fun j β¦ people <| (finRotate (2*n+1))^[j.1 + 1] i
def rightNeighbors {n : β+} (people : Fin (2*n+1) β ZMod 2) (k : β+) (i : Fin (2*n+1)) : Fin k β ZMod 2 :=
fun j β¦ people <| (finRotate (2*n+1)).symm^[j.1 + 1] i
theorem imosl_2021_c5 (n k : β+) (h : k < n) (people : Fin (2*n+1) β ZMod 2)
(num_boys : (List.ofFn people).count 0 = n) (num_girls : (List.ofFn people).count 1 = n+1):
β (i : Fin (2*n+1)), people i = 1 β§ ((List.ofFn (leftNeighbors people k i)).count 1 +
(List.ofFn (rightNeighbors people k i)).count 1 >= k) := by sorry |
izho_2014_p3 | There are given 100 distinct positive integers. We call a pair of integers among them good if the ratio of its elements is either 2 or 3. What is the maximum number $g$ of good pairs that these 100 numbers can form? (A same number can be used in several pairs.) | [
"180"
] | null | math_competitions | import Mathlib
structure goodPairs (s : Fin 100 βͺ β+) where
(i j : Fin 100)
(ratio : s i = 2 * s j β¨ s i = 3 * s j)
deriving Fintype
abbrev izho_2014_p3_solution : β := sorry
theorem izho_2014_p3 :
IsGreatest (Set.range fun x => Fintype.card (goodPairs x)) izho_2014_p3_solution := by sorry |
izho_2019_p1 | Prove that there are at least 100! ways to partition the number 100! into summands from the set $\{1!, 2!, 3!, \ldots, 99!\}$. (Partitions differing in the order of summands are considered the same; any summand can be taken multiple times. We remind that $n!=1 \cdot 2 \cdot \ldots \cdot n$.) | null | null | math_competitions | import Mathlib
open Nat
theorem izho_2019_p1 : ((@Finset.univ 100!.Partition).filter
(fun p => β i β p.parts, β k β Finset.Icc 1 99, i = Nat.factorial k)).card β₯ 100! := by sorry |
bxmo_2017_p2 | Let $n \geqslant 2$ be an integer. Alice and Bob play a game concerning a country made of $n$ islands. Exactly two of those $n$ islands have a factory. Initially there is no bridge in the country. Alice and Bob take turns in the following way. In each turn, the player must build a bridge between two different islands $I_{1}$ and $I_{2}$ such that:\n\n- $I_{1}$ and $I_{2}$ are not already connected by a bridge;\n- at least one of the two islands $I_{1}$ and $I_{2}$ is connected by a series of bridges to an island with a factory (or has a factory itself). (Indeed, access to a factory is needed for the construction.)\n\nAs soon as a player builds a bridge that makes it possible to go from one factory to the other, this player loses the game. (Indeed, it triggers an industrial battle between both factories.) If Alice starts, then determine (for each $n \geqslant 2$) who has a winning strategy.\n\n(Note: It is allowed to construct a bridge passing above another bridge.) | [
"fun x => if x % 4 = 3 then 0 else 1"
] | null | math_competitions | import Mathlib
variable (m : β)
local notation3 (prettyPrint := false) "n" => (m + 2)
local notation3 (prettyPrint := false) "F1" => (0 : Fin n)
local notation3 (prettyPrint := false) "F2" => (1 : Fin n)
structure GameState where
islands: SimpleGraph (Fin n)
decidable: DecidableRel islands.Adj
instance (s : GameState m) : DecidableRel s.islands.Adj := by
exact s.decidable
def GameState.initial : GameState m := {
islands := β₯
decidable := SimpleGraph.Bot.adjDecidable (Fin n)
}
structure Bridge where
island1 : Fin n
island2 : Fin n
def reachableByFactory (s : GameState m) (b : Bridge m) : Prop :=
s.islands.Reachable b.island1 F1 β¨ s.islands.Reachable b.island1 F2
β¨ s.islands.Reachable b.island2 F1 β¨ s.islands.Reachable b.island2 F2
def isValidMove (s : GameState m) (b : Bridge m) : Prop :=
b.island1 β b.island2 β§ Β¬ s.islands.Adj b.island1 b.island2 β§ reachableByFactory m s b
def GameState.next (s : GameState m) (b : Bridge m) : GameState m := {
islands := s.islands β (SimpleGraph.fromEdgeSet {s(b.island1, b.island2)})
decidable := by
have newEdge: DecidableRel (SimpleGraph.fromEdgeSet {s(b.island1, b.island2)}).Adj := by
intro x y; unfold SimpleGraph.fromEdgeSet
simp only [Pi.inf_apply, Sym2.toRel_prop, Set.mem_singleton_iff, Sym2.eq, Sym2.rel_iff',
Prod.mk.injEq, Prod.swap_prod_mk, ne_eq, inf_Prop_eq]
infer_instance
exact SimpleGraph.Sup.adjDecidable (Fin n) s.islands (SimpleGraph.fromEdgeSet {s(b.island1, b.island2)})
}
def GameState.is_losing_state (s : GameState m) : Prop :=
s.islands.Reachable F1 F2
abbrev Strategy := GameState m β Bridge m
instance (s: GameState m) : Decidable (GameState.is_losing_state m s) := by
simp [GameState.is_losing_state]; infer_instance
instance (s: GameState m) (b : Bridge m) : Decidable (reachableByFactory m s b) := by
simp [reachableByFactory]; infer_instance
instance (s: GameState m) (b : Bridge m) : Decidable (isValidMove m s b) := by
simp [isValidMove]; infer_instance
structure MoveOutcome where
nextState : GameState m
hasLost : Bool
def executeStrategy (s : GameState m) (strategy: Strategy m): MoveOutcome m :=
let bridge := strategy s
if Β¬ isValidMove m s bridge
then { nextState := s, hasLost := true }
else
let nextState := s.next m bridge
{ nextState := nextState, hasLost := nextState.is_losing_state m }
partial def aliceWins (s : GameState m) (sA: Strategy m) (sB: Strategy m): Bool :=
let β¨stateAfterAlicesMove, aliceHasLostβ© := executeStrategy m s sA;
if aliceHasLost then False else
let β¨stateAfterBobsMove, bobHasLostβ© := executeStrategy m stateAfterAlicesMove sB;
if bobHasLost then True else
aliceWins stateAfterBobsMove sA sB
abbrev bxmo_2017_p2_solution : β β Fin 2 := sorry
theorem bxmo_2017_p2 : (bxmo_2017_p2_solution n = 0 β
β strategyA , β strategyB, aliceWins m (GameState.initial m) strategyA strategyB)
β§ (bxmo_2017_p2_solution n = 1 β
β strategyB, β strategyA, Β¬ aliceWins m (GameState.initial m) strategyA strategyB) := by sorry |
usamo_2000_p4 | Find the smallest positive integer $n$ such that if $n$ squares of a $1000 \times 1000$ chessboard are colored, then there will exist three colored squares whose centers form a right triangle with sides parallel to the edges of the board. | [
"1999"
] | null | math_competitions | import Mathlib
def colored_card : Finset β :=
(Finset.image (fun s => s.card)
(@Finset.univ (Finset (Fin 1000 Γ Fin 1000)) _ |>.filter
(fun s => β a β s, β b β s, β c β s, a β b β§ b β c β§ a β c β§ a.1 = b.1 β§ a.2 = c.2)))
abbrev usamo_2000_p4_solution : β+ := sorry
theorem usamo_2000_p4 : IsLeast colored_card usamo_2000_p4_solution.1 := by sorry |
imo_2009_p6 | Let $a_1,a_2,\ldots,a_n$ be distinct positive integers and let $M$ be a set of $n-1$ positive integers not containing $s=a_1+a_2+\ldots+a_n$. A grasshopper is to jump along the real axis, starting at the point $0$ and making $n$ jumps to the right with lengths $a_1,a_2,\ldots,a_n$ in some order. Prove that the order can be chosen in such a way that the grasshopper never lands on any point in $M$. | null | null | imo | import Mathlib
open BigOperators Finset
theorem imo_2009_p6 (n : β) (hn : n β₯ 1) (a : Fin n β β) (ha : Function.Injective a) (M : Finset β)
(ha' : β i, a i > 0) (hM : M.card = n - 1) (hM' : β m β M, m > 0) (haM : β n, (a n) β M) :
β (Ο : Equiv.Perm (Fin n)), β k, (β i β€ k, (a β Ο) i) β M := by sorry |
imo_2020_p3 | There are $4n$ pebbles of weights $1, 2, 3, \ldots, 4n$. Each pebble is colored in one of $n$ colors and there are four pebbles of each color. Show that we can arrange the pebbles into two piles so that the following two conditions are both satisfied: 1) The total weights of both piles are the same. 2) Each pile contains two pebbles of each color. | null | null | imo | import Mathlib
structure Pebble (n : β) where
weight : β
color : Fin n
deriving DecidableEq
theorem imo_2020_p3 (n : β) (PebbleSet : Finset (Pebble n)) (hP : PebbleSet.card = 4 * n)
(h_weight : β p β PebbleSet, p.weight β Finset.Icc 1 (4 * n))
(h_ne_weight : β p β PebbleSet, β q β PebbleSet, p β q β p.weight β q.weight)
(h_color : β i, (PebbleSet.filter (fun p => p.color = i)).card = 4) :
β (P1 P2 : Finset (Pebble n)), P1 βͺ P2 = PebbleSet β§ P1 β© P2 = β
β§
β p β P1, p.weight = β p β P2, p.weight β§ (β i, (P1.filter (fun p => p.color = i)).card = 2) β§
(β i, (P2.filter (fun p => p.color = i)).card = 2) := by sorry |
imo_2022_p6 | Let $n$ be a positive integer. A Nordic square is an $n \times n$ board containing all the integers from $1$ to $n^2$ so that each cell contains exactly one number. Two different cells are considered adjacent if they share an edge. Every cell that is adjacent only to cells containing larger numbers is called a valley. An uphill path is a sequence of one or more cells such that: (i) the first cell in the sequence is a valley, (ii) each subsequent cell in the sequence is adjacent to the previous cell, and (iii) the numbers written in the cells in the sequence are in increasing order. Find, as a function of $n$, the smallest possible total number of uphill paths in a Nordic square. | [
"fun n => 2 * n ^ 2 - 2 * n + 1"
] | null | imo | import Mathlib
open Function
set_option autoImplicit false
variable {n : β}
def Adjacent (x y : Fin n Γ Fin n) : Prop := x β y β¨ y β x
abbrev NordicSquare (n : β) := Fin n Γ Fin n β Fin (n ^ 2)
namespace NordicSquare
variable {sq : NordicSquare n}
def IsValley (sq : NordicSquare n) (x : Fin n Γ Fin n) : Prop :=
β β¦y : Fin n Γ Fin nβ¦, Adjacent x y β sq x β€ sq y
structure UphillPath (sq : NordicSquare n) extends
RelSeries fun x y β¦ Adjacent x y β§ sq x < sq y where
head : sq.IsValley toRelSeries.head
namespace UphillPath
lemma toRelSeries_injective : Injective (toRelSeries : sq.UphillPath β RelSeries _) :=
fun p q β¦ by cases p; congr!
instance [NeZero n] : Inhabited sq.UphillPath where
default.toRelSeries := .singleton _ <| sq.symm 0
default.head y _ := by simp
instance : CoeFun sq.UphillPath fun x β¦ Fin (x.length + 1) β Fin n Γ Fin n where coe f := f.1
instance : IsTrans (Fin n Γ Fin n) fun x y β¦ sq x < sq y where
trans _ _ _ := lt_trans
lemma strictMono (p : sq.UphillPath) : StrictMono fun x β¦ sq (p x) :=
fun _ _ β¦ (p.ofLE fun _ _ β¦ And.right).rel_of_lt
lemma length_lt (p : sq.UphillPath) : p.length < n ^ 2 := by
simpa using Fintype.card_le_of_injective _ p.strictMono.injective
instance : Finite sq.UphillPath :=
@Finite.of_injective _ {l : List (Fin n Γ Fin n) // l.length β€ n ^ 2}
(List.finite_length_le _ _) (fun p β¦ β¨p.toList, by simpa using p.length_ltβ©) fun p q hpq β¦
toRelSeries_injective <| RelSeries.toList_injective congr(($hpq).val)
noncomputable instance : Fintype sq.UphillPath := .ofFinite _
end NordicSquare.UphillPath
abbrev imo_2022_p6_solution : β β β := sorry
lemma imo_2022_p6 (n : β) (hn : n > 0) :
IsLeast {k | β (sq : NordicSquare n), k = Fintype.card sq.UphillPath}
(imo_2022_p6_solution n) := by
sorry |
imo_2024_p3 | Let $a_1, a_2, a_3, \dots$ be an infinite sequence of positive integers, and let $N$ be a positive integer. Suppose that, for each $n > N$, $a_n$ is equal to the number of times $a_{n-1}$ appears in the list $a_1, a_2, \dots, a_{n-1}$. Prove that at least one of the sequence $a_1, a_3, a_5, \dots$ and $a_2, a_4, a_6, \dots$ is eventually periodic. (An infinite sequence $b_1, b_2, b_3, \dots$ is eventually periodic if there exist positive integers $p$ and $M$ such that $b_{m+p} = b_m$ for all $m \ge M$.) | null | null | imo | import Mathlib
open scoped Finset
def Condition (a : β β β) (N : β) : Prop :=
(β i, 0 < a i) β§ β n, N < n β a n = #{i β Finset.range n | a i = a (n - 1)}
def EventuallyPeriodic (b : β β β) : Prop := β p M, 0 < p β§ β m, M β€ m β b (m + p) = b m
theorem imo_2024_p3 {a : β β β} {N : β} (h : Condition a N) :
EventuallyPeriodic (fun i β¦ a (2 * i)) β¨ EventuallyPeriodic (fun i β¦ a (2 * i + 1)) := by sorry |
imo_2000_p4 | A magician has one hundred cards numbered $1$ to $100$. He puts them into three boxes, a red one, a white one and a blue one, so that each box contains at least one card. A member of the audience selects two of the three boxes, chooses one card from each and announces the sum of the numbers on the chosen cards. Given this sum, the magician identifies the box from which no card has been chosen. How many ways are there to put all the cards into the boxes so that this trick always works? (Two ways are considered different if at least one card is put into a different box.) | [
"12"
] | null | imo | import Mathlib
abbrev Cards := Fin 100
abbrev Boxes := Fin 3
abbrev Allocation := { f : Cards β Boxes | Function.Surjective f }
abbrev Trick := β β Boxes
def trick_works (f : Allocation) (t : Trick) : Prop :=
β cβ cβ : Cards,
(f.1 cβ = 0 β f.1 cβ = 1 β t (cβ.1 + cβ.1) = 2) β§
(f.1 cβ = 0 β f.1 cβ = 2 β t (cβ.1 + cβ.1) = 1) β§
(f.1 cβ = 1 β f.1 cβ = 2 β t (cβ.1 + cβ.1) = 0)
abbrev imo_2000_p4_solution : β := sorry
theorem imo_2000_p4 (good_allocations : Finset Allocation)
(h : β f β good_allocations, β (t : Trick), trick_works f t) :
good_allocations.card = imo_2000_p4_solution := by sorry |
imo_2001_p3 | Twenty-one girls and twenty-one boys took part in a mathematical competition. It turned out that each contestant solved at most six problems, and for each pair of a girl and a boy, there was at least one problem that was solved by both the girl and the boy. Show that there is a problem that was solved by at least three girls and at least three boys. | null | null | imo | import Mathlib
def solved_by_at_least_three {n : β} (problem : β) (solved_problems: Fin n β Finset β) : Prop :=
β a b c, a β b β§ b β c β§ a β c β§ problem β solved_problems a β© solved_problems b β© solved_problems c
theorem imo_2001_p3 (solved_problems_girls: Fin 21 β Finset β)
(solved_problems_boys: Fin 21 β Finset β)
(h_max_6_girls: β girl: Fin 21, (solved_problems_girls girl).card β€ 6)
(h_max_6_boys: β boy: Fin 21, (solved_problems_boys boy).card β€ 6)
(h_pairs: β boy girl: Fin 21, solved_problems_boys boy β© solved_problems_girls girl β β
):
β problem: β, solved_by_at_least_three problem solved_problems_girls β§
solved_by_at_least_three problem solved_problems_boys := by sorry |
imo_2001_p4 | Let $n_1, n_2, \dots , n_m$ be integers where $m>1$ is odd. Let $x = (x_1, \dots , x_m)$ denote a permutation of the integers $1, 2, \cdots , m$. Let $f(x) = x_1n_1 + x_2n_2 + ... + x_mn_m$. Show that for some distinct permutations $a$, $b$ the difference $f(a) - f(b)$ is a multiple of $m!$. | null | null | imo | import Mathlib
open Nat
def f {m : β} (n : Finset.Icc 1 m β β€) (x : Equiv.Perm (Finset.Icc 1 m)) : β€ := β i, x i * n i
theorem imo_2001_p4 (m : β) (h_m_pos: m > 1) (h_m_odd: Odd m) (n : Finset.Icc 1 m β β€):
β a b : Equiv.Perm (Finset.Icc 1 m), a β b β§ β(m !) β£ (f n a - f n b) := by sorry |
imo_2002_p1 | $S$ is the set of all $(h,k)$ with $h,k$ non-negative integers such that $h + k < n$. Each element of $S$ is colored red or blue, so that if $(h,k)$ is red and $h' \le h,k' \le k$, then $(h',k')$ is also red. A type $1$ subset of $S$ has $n$ blue elements with different first member and a type $2$ subset of $S$ has $n$ blue elements with different second member. Show that there are the same number of type $1$ and type $2$ subsets. | null | null | imo | import Mathlib
open Finset
def S (n : β) : Finset (Fin n Γ Fin n) :=
{ (h, k) | h + k < n }
structure Coloring (n : β) where
is_red: S n β Bool
coloring_condition: β hk hk' : S n,
match hk.val, hk'.val with
| (h, k), (h', k') => is_red hk β§ h' β€ h β§ k' β€ k β is_red hk'
def is_type_1 {n : β} (c : Coloring n) (subset: Finset (S n)) : Bool :=
let blueElements := subset.filter (Ξ» x => Β¬ c.is_red x)
let firstMembersOfBlueElements : Finset (Fin n) := blueElements.image (Ξ» x : S n => x.val.1)
firstMembersOfBlueElements.card = n
def is_type_2 {n : β} (c : Coloring n) (subset: Finset (S n)) : Bool :=
let blueElements := subset.filter (Ξ» x => Β¬ c.is_red x)
let secondMembersOfBlueElements : Finset (Fin n) := blueElements.image (Ξ» x : S n => x.val.2)
secondMembersOfBlueElements.card = n
theorem imo_2002_p1 (n : β) (c : Coloring n):
#{ s | is_type_1 c s }.toFinset = #{ s | is_type_2 c s }.toFinset := by sorry |
imo_2003_p1 | $S$ is the set $\{1, 2, 3, \dots ,1000000\}$. Show that for any subset $A$ of $S$ with $101$ elements we can find $100$ distinct elements $x_i$ of $S$, such that the sets $\{a + x_i \mid a \in A\}$ are all pairwise disjoint. | null | null | imo | import Mathlib
def S := Finset.Icc 1 1000000
theorem imo_2003_p1 (A : Finset S) (hA: A.card = 101):
β x : Function.Embedding (Fin 100) S,
β i j, i β j β Disjoint { a.1 + (x i).1 | a β A } { a.1 + (x j).1 | a β A } := by sorry |
imo_2005_p6 | In a mathematical competition, in which 6 problems were posed to the participants, every two of these problems were solved by more than 2/5 of the contestants. Moreover, no contestant solved all the 6 problems. Show that there are at least 2 contestants who solved exactly 5 problems each. | null | null | imo | import Mathlib
theorem imo_2005_p6 {participants : Type} [Fintype participants] [DecidableEq participants]
(solved : Fin 6 β Finset participants)
(h : β i j, i β j β (solved i β© solved j).card > (2 * Fintype.card participants : β) / 5)
(h' : β i, (solved i).card < Fintype.card participants) :
β s : Finset participants, s.card β₯ 2 β§
(β i β s, β p : Finset (Fin 6), p.card = 5 β§ β j, j β p β i β solved j) := by sorry |
imo_2006_p2 | Let $P$ be a regular 2006-gon. A diagonal of $P$ is called good if its endpoints divide the boundary of $P$ into two parts, each composed of an odd number of sides of $P$. The sides of $P$ are also called good. Suppose $P$ has been dissected into triangles by 2003 diagonals, no two of which have a common point in the interior of $P$. Find the maximum number of isosceles triangles having two good sides that could appear in such a configuration. | [
"1003"
] | null | imo | import Mathlib
open scoped Classical Finset
instance {N : β} : CircularOrder (Fin N) := LinearOrder.toCircularOrder _
variable {Ξ± : Type*} [CircularOrder Ξ±] {a b c d : Ξ±}
def SBtwβ (a b c d : Ξ±) : Prop := sbtw a b c β§ sbtw c d a
lemma sbtwβ_swap : SBtwβ a b c d β SBtwβ c d a b := and_comm
variable {N : β}
abbrev Diagonal (N : β) := {e : Sym2 (Fin N) // Β¬ e.IsDiag}
namespace Diagonal
def Intersect (dβ dβ : Diagonal N) : Prop :=
Sym2.liftβ {
val a b c d := SBtwβ a c b d β¨ SBtwβ a d b c
property a b c d := by
simp only [eq_iff_iff]; constructor <;> rw [sbtwβ_swap, or_comm, sbtwβ_swap]
} dβ.1 dβ.1
def Good (d : Diagonal N) : Prop :=
Sym2.lift {
val a b := Odd (a.val + b.val : β)
property a b := by simp [add_comm]
} d.1
end Diagonal
structure TriangleDissection (N : β) where
diagonals : Fin (2 * N - 3) βͺ Diagonal N
pairwise_not_intersect_diagonals : Pairwise fun i j β¦ Β¬ (diagonals i).Intersect (diagonals j)
noncomputable def TriangleDissection.numOfIsoscelesTriangle (C : TriangleDissection N) : β := by
classical exact
#{(a, b, c) : Fin N Γ Fin N Γ Fin N |
β (hab : a < b) (hbc : b < c),
(β i, C.diagonals i = s(a, b)) β§
(β i, C.diagonals i = s(b, c)) β§
(β i, C.diagonals i = s(c, a)) β§
( Diagonal.Good β¨s(a, b), by simpa using hab.neβ© β§
Diagonal.Good β¨s(b, c), by simpa using hbc.neβ© β¨
Diagonal.Good β¨s(b, c), by simpa using hbc.neβ© β§
Diagonal.Good β¨s(c, a), by simpa using (hab.trans hbc).ne'β© β¨
Diagonal.Good β¨s(c, a), by simpa using (hab.trans hbc).ne'β© β§
Diagonal.Good β¨s(a, b), by simpa using hab.neβ©) β§
((b.val - a.val : β€) = c.val - b.val β¨
(c.val - b.val : β€) = N + a.val - c.val β¨
(N + a.val - c.val : β€) = b.val - a.val)}
abbrev imo_2006_p2_solution : β := sorry
theorem imo_2006_p2 :
IsGreatest {k | β c : TriangleDissection 2006, c.numOfIsoscelesTriangle = k}
imo_2006_p2_solution := by sorry |
imo_2007_p3 | In a mathematical competition some competitors are friends. Friendship is always mutual. Call a group of competitors a clique if each two of them are friends. (In particular, any group of fewer than two competitors is a clique.) The number of members of a clique is called its size. Given that, in this competition, the largest size of a clique is even, prove that the competitors can be arranged in two rooms such that the largest size of a clique contained in one room is the same as the largest size of a clique contained in the other room. | null | null | imo | import Mathlib
theorem imo_2007_p3 {player : Type} [Fintype player] (math_competiton : SimpleGraph player)
(h : Even math_competiton.cliqueNum) :
β a : SimpleGraph.Subgraph math_competiton, a.coe.cliqueNum = aαΆ.coe.cliqueNum := by sorry |
imo_2008_p5 | Let $n$ and $k$ be positive integers with $k \geq n$ and $k - n$ an even number. Let $2n$ lamps labelled $1$, $2$, ..., $2n$ be given, each of which can be either on or off. Initially all the lamps are off. We consider sequences of steps: at each step one of the lamps is switched (from on to off or from off to on). Let $N$ be the number of such sequences consisting of $k$ steps and resulting in the state where lamps $1$ through $n$ are all on, and lamps $n + 1$ through $2n$ are all off. Let $M$ be number of such sequences consisting of $k$ steps, resulting in the state where lamps $1$ through $n$ are all on, and lamps $n + 1$ through $2n$ are all off, but where none of the lamps $n + 1$ through $2n$ is ever switched on. Determine $\frac{N}{M}$. | [
"fun n k => 2 ^ (k.1 - n.1)"
] | null | imo | import Mathlib
def switch_lamp (n : β+) (switch_label : Fin (2 * n)) (lamps_state : List Bool) : List Bool :=
List.mapIdx (fun j (x : Bool) => if j = switch_label then Β¬x else x) lamps_state
def lamps_final_state (n : β+) (switch_list : List (Fin (2 * n))) : List Bool :=
match switch_list with
| [] => (List.ofFn (fun _ : Fin (2 * n) => false))
| h :: t => switch_lamp n h (lamps_final_state n t)
def final_goal (n : β+) := List.ofFn (fun (i : Fin (2 * n)) => if i < n then true else false)
def N (n k : β+) := @Finset.univ (Fin k β Fin (2 * n)) _ |>.filter
(fun f => lamps_final_state n (List.ofFn f) = final_goal n) |>.card
def M (n k : β+) := @Finset.univ (Fin k β Fin (2 * n)) _ |>.filter
(fun f => β (i : Fin k), f i < (n : Fin (2 * n))) |>.filter
(fun f => lamps_final_state n (List.ofFn f) = final_goal n) |>.card
abbrev imo_2008_p5_solution : β+ β β+ β β := sorry
theorem imo_2008_p5 (n k : β+) (hnk : k β₯ n) (hnk' : Even (k - n)) :
N n k / M n k = imo_2008_p5_solution n k := by sorry |
imo_2010_p5 | Each of the six boxes $B_1$, $B_2$, $B_3$, $B_4$, $B_5$, $B_6$ initially contains one coin. The following operations are allowed: Type 1) Choose a non-empty box $B_j$, $1\leq j \leq 5$, remove one coin from $B_j$ and add two coins to $B_{j+1}$; Type 2) Choose a non-empty box $B_k$, $1\leq k \leq 4$, remove one coin from $B_k$ and swap the contents (maybe empty) of the boxes $B_{k+1}$ and $B_{k+2}$. Determine if there exists a finite sequence of operations of the allowed types, such that the five boxes $B_1$, $B_2$, $B_3$, $B_4$, $B_5$ become empty, while box $B_6$ contains exactly $2010^{2010^{2010}}$ coins. | [
"true"
] | null | imo | import Mathlib
structure Boxes where
(B1 B2 B3 B4 B5 B6 : β)
def op11 : Boxes β Boxes
| β¨b1, b2, b3, b4, b5, b6β© => β¨b1 - 1, b2 + 2, b3, b4, b5, b6β©
def op12 : Boxes β Boxes
| β¨b1, b2, b3, b4, b5, b6β© => β¨b1, b2 - 1, b3 + 2, b4, b5, b6β©
def op13 : Boxes β Boxes
| β¨b1, b2, b3, b4, b5, b6β© => β¨b1, b2, b3 - 1, b4 + 2, b5, b6β©
def op14 : Boxes β Boxes
| β¨b1, b2, b3, b4, b5, b6β© => β¨b1, b2, b3, b4 - 1, b5 + 2, b6β©
def op15 : Boxes β Boxes
| β¨b1, b2, b3, b4, b5, b6β© => β¨b1, b2, b3, b4, b5 - 1, b6 + 2β©
def op21 : Boxes β Boxes
| β¨b1, b2, b3, b4, b5, b6β© => β¨b1 - 1, b3, b2, b4, b5, b6β©
def op22 : Boxes β Boxes
| β¨b1, b2, b3, b4, b5, b6β© => β¨b1, b2 - 4, b4, b3, b5, b6β©
def op23 : Boxes β Boxes
| β¨b1, b2, b3, b4, b5, b6β© => β¨b1, b2, b3 - 1, b5, b4, b6β©
def op24 : Boxes β Boxes
| β¨b1, b2, b3, b4, b5, b6β© => β¨b1, b2, b3, b4 - 1, b6, b5β©
inductive OP
| op11 | op12 | op13 | op14 | op15 | op21 | op22 | op23 | op24
def apply_op : OP β (Boxes β Boxes)
| OP.op11 => op11
| OP.op12 => op12
| OP.op13 => op13
| OP.op14 => op14
| OP.op15 => op15
| OP.op21 => op21
| OP.op22 => op22
| OP.op23 => op23
| OP.op24 => op24
def init : Boxes := β¨1, 1, 1, 1, 1, 1β©
abbrev imo_2010_p5_solution : Bool := sorry
theorem imo_2010_p5 : imo_2010_p5_solution = (β seq : List OP,
(seq.map apply_op).foldl (Β· β Β·) id init = β¨0, 0, 0, 0, 0, 2010 ^ (2010 ^ 2010)β©) := by sorry |
imo_2011_p2 | Let $\mathcal{S}$ be a finite set of at least two points in the plane. Assume that no three points of $\mathcal S$ are collinear. A windmill is a process that starts with a line $\ell$ going through a single point $P \in \mathcal S$. The line rotates clockwise about the pivot $P$ until the first time that the line meets some other point belonging to $\mathcal S$. This point, $Q$, takes over as the new pivot, and the line now rotates clockwise about $Q$, until it next meets a point of $\mathcal S$. This process continues indefinitely. Show that we can choose a point $P$ in $\mathcal S$ and a line $\ell$ going through $P$ such that the resulting windmill uses each point of $\mathcal S$ as a pivot infinitely many times. | null | null | imo | import Mathlib
open EuclideanGeometry Real Filter
namespace List
variable {Ξ± Ξ² : Type*}
@[mk_iff]
inductive Triplewise (p : Ξ± β Ξ± β Ξ± β Prop) : List Ξ± β Prop
| nil : [].Triplewise p
| cons {a : Ξ±} {l : List Ξ±} : l.Pairwise (p a) β l.Triplewise p β (a :: l).Triplewise p
end List
instance : Fact (Module.finrank β (EuclideanSpace β (Fin 2)) = 2) := β¨by simpβ©
variable {n} [Fintype n] [DecidableEq n]
noncomputable instance : Module.Oriented β (EuclideanSpace β n) n where
positiveOrientation := Basis.orientation (Pi.basisFun β n)
structure IsWindmillProcess (S : Set (EuclideanSpace β (Fin 2)))
(f : β β EuclideanSpace β (Fin 2)) where
forall_mem n : f n β S
oangle_le_oangle n x : x β S β
toIocMod two_pi_pos 0 (oangle (f n) (f (n + 1)) (f (n + 2))).toReal
β€ toIocMod two_pi_pos 0 (oangle (f n) (f (n + 1)) x).toReal
theorem imo_2011_p2 (l : List (EuclideanSpace β (Fin 2)))
(hl : l.Triplewise (Β¬ Collinear β {Β·, Β·, Β·})) :
β f : β β EuclideanSpace β (Fin 2),
IsWindmillProcess {x | x β l} f β§ β x β l, βαΆ n in atTop, f n = x := by sorry |
imo_2011_p4 | Let $n > 0$ be an integer. We are given a balance and $n$ weights of weight $2^0,2^1, \cdots ,2^{n-1}$. We are to place each of the $n$ weights on the balance, one after another, in such a way that the right pan is never heavier than the left pan. At each step we choose one of the weights that has not yet been placed on the balance, and place it on either the left pan or the right pan, until all of the weights have been placed. Determine the number of ways in which this can be done. | [
"fun n => Nat.doubleFactorial (2 * n - 1)"
] | null | imo | import Mathlib
def weight_of_left_pan {n : β} (Ο : Equiv.Perm (Fin n)) (place_left : Fin n β Bool) (step : β) : β :=
β j with place_left j = true β§ Ο j β€ step, 2 ^ j.1
def weight_of_right_pan {n : β} (Ο : Equiv.Perm (Fin n)) (place_left : Fin n β Bool) (step : β) : β :=
β j with place_left j = false β§ Ο j β€ step, 2 ^ j.1
def is_valid_placement {n : β} (Ο : Equiv.Perm (Fin n)) (place_left : Fin n β Bool) : Prop :=
β step : Fin n, weight_of_right_pan Ο place_left step β€ weight_of_left_pan Ο place_left step
instance {n : β} (Ο : Equiv.Perm (Fin n)) (place_left : Fin n β Bool) :
Decidable (is_valid_placement Ο place_left) := by
simp [is_valid_placement]; infer_instance
abbrev all_placements (n : β) :=
Finset.product (@Finset.univ (Equiv.Perm (Fin n)) _) (@Finset.univ (Fin n β Bool) _)
abbrev valid_placements (n : β) :=
all_placements n |>.filter (fun (Ο, f) => is_valid_placement Ο f)
abbrev imo_2011_p4_solution : β β β := sorry
theorem imo_2011_p4 (n : β) (hn : n > 0) :
(valid_placements n).card = imo_2011_p4_solution n := by sorry |
imo_2012_p3 | The liarβs guessing game is a game played between two players A and B. The rules of the game depend on two positive integers $k$ and $n$ which are known to both players. At the start of the game the player A chooses integers $x$ and $N$ with $1 \le x \le N$. Player A keeps $x$ secret, and truthfully tells $N$ to the player B. The player B now tries to obtain information about $x$ by asking player A questions as follows: each question consists of B specifying an arbitrary set $S$ of positive integers (possibly one specified in some previous question), and asking A whether $x$ belongs to $S$. Player B may ask as many questions as he wishes. After each question, player A must immediately answer it with yes or no, but is allowed to lie as many times as she wants; the only restriction is that, among any $k+1$ consecutive answers, at least one answer must be truthful. After B has asked as many questions as he wants, he must specify a set $X$ of at most $n$ positive integers. If $x \in X$, then B wins; otherwise, he loses. Prove that: (a) If $n \ge 2^k$ then B has a winning strategy. (b) There exists a positive integer $k_0$ such that for every $k \ge k_0$ there exists an integer $n \ge 1.99^k$ for which B cannot guarantee a victory. | null | null | imo | import Mathlib
open scoped Finset
set_option autoImplicit false
structure AliceStrategy where
N : β
x : Fin N
nextAnswer : List (Set (Fin N) Γ Bool) β Set (Fin N) β Bool
structure BobStrategy where
nextQuestion N : List (Set (Fin N) Γ Bool) β Set (Fin N)
guess N : List (Set (Fin N) Γ Bool) β Finset (Fin N)
variable {k n : β}
def history (A : AliceStrategy) (B : BobStrategy) : β β List (Set (Fin A.N) Γ Bool)
| 0 => []
| t + 1 =>
(B.nextQuestion A.N (history A B t),
A.nextAnswer (history A B t) (B.nextQuestion A.N (history A B t)))
:: history A B t
def AliceStrategy.IsValid (A : AliceStrategy) (B : BobStrategy) (k : β) : Prop :=
β tβ : β, β t β Finset.Ico tβ (tβ + k),
A.nextAnswer (history A B t) (B.nextQuestion A.N (history A B t))
= (A.x β B.nextQuestion A.N (history A B t))
def BobStrategy.IsValid (A : AliceStrategy) (B : BobStrategy) (n t : β) : Prop :=
#(B.guess A.N (history A B t)) β€ n
def BobStrategy.IsWinning (B : BobStrategy) (k n : β) : Prop :=
β (A : AliceStrategy), A.IsValid B k β β t, B.IsValid A n t β§ A.x β B.guess A.N (history A B t)
theorem imo_2012_p3 :
(β k n, 2 ^ k β€ n β β B : BobStrategy, B.IsWinning k n) β§
β kβ,
β k β₯ kβ,
β n : β, n β₯ (1.99 : β) ^ k β§
β B : BobStrategy, Β¬ B.IsWinning k n := by sorry |
imo_2013_p2 | A configuration of $4027$ points in the plane is called Colombian if it consists of $2013$ red points and $2014$ blue points, and no three of the points of the configuration are collinear. By drawing some lines, the plane is divided into several regions. An arrangement of lines is good for a Colombian configuration if the following two conditions are satisfied: (1) no line passes through any point of the configuration; (2)no region contains points of both colours. Find the least value of $k$ such that for any Colombian configuration of $4027$ points, there is a good arrangement of $k$ lines. | [
"2013"
] | null | imo | import Mathlib
structure Colombian_config : Type where
(R B : Finset (β Γ β))
(hR : R.card = 2013)
(hB : B.card = 2014)
(hC : R β© B = β
)
(h_no_collinear : β p β R βͺ B, β q β R βͺ B, β r β R βͺ B, p β q β p β r β q β r β
Β¬ β t : β, t β 0 β§ t * (q.1 - p.1) = (r.1 - p.1) β§ t * (q.2 - p.2) = (r.2 - p.2))
def Good_arrange (C : Colombian_config) (L : Finset (β Γ β Γ β)) : Prop :=
(β l β L, l.1 β 0 β¨ l.2.1 β 0) β§
(β p β C.R βͺ C.B, β l β L, l.1 * p.1 + l.2.1 * p.2 + l.2.2 β 0) β§
Β¬ (β q β C.R, β p β C.B, β l β L,
Real.sign (l.1 * p.1 + l.2.1 * p.2 + l.2.2) = Real.sign (l.1 * q.1 + l.2.1 * q.2 + l.2.2))
abbrev imo_2013_p2_solution : β := sorry
theorem imo_2013_p2 : IsLeast
{k | β C : Colombian_config, β L : Finset (β Γ β Γ β), L.card = k β§ Good_arrange C L}
imo_2013_p2_solution := by sorry |
imo_2013_p6 | Let $n \ge 3$ be an integer, and consider a circle with $n + 1$ equally spaced points marked on it. Consider all labellings of these points with the numbers $0, 1, ... , n$ such that each label is used exactly once; two such labellings are considered to be the same if one can be obtained from the other by a rotation of the circle. A labelling is called beautiful if, for any four labels $a < b < c < d$ with $a + d = b + c$, the chord joining the points labelled $a$ and $d$ does not intersect the chord joining the points labelled $b$ and $c$. Let $M$ be the number of beautiful labelings, and let N be the number of ordered pairs $(x, y)$ of positive integers such that $x + y \le n$ and $\gcd(x, y) = 1$. Prove that\[ M = N + 1.\] | null | null | imo | import Mathlib
open Equiv Fintype Finset
def IsBeautiful {n} (e : Perm (Fin (n + 1))) : Prop :=
β β¦a bβ¦, a < b β β β¦cβ¦, b < c β β β¦dβ¦, c < d β a.val + d.val = b.val + c.val β
e a < e b β§ e b < e d β§ e a < e c β§ e c < e d β¨
e d < e b β§ e b < e a β§ e d < e c β§ e c < e a β¨
e b < e a β§ e a < e c β§ e b < e d β§ e d < e c β¨
e c < e a β§ e a < e b β§ e c < e d β§ e d < e b β¨
e a < e b β§ e a < e c β§ e d < e b β§ e d < e c β¨
e b < e a β§ e c < e a β§ e b < e d β§ e c < e d
instance {n} : DecidablePred (IsBeautiful (n := n)) := by unfold IsBeautiful; infer_instance
def M (n : β) : β := #{e : Perm (Fin (n + 1)) | IsBeautiful e} / (n + 1)
def N (n : β) : β := #{xy β .Icc 1 n ΓΛ’ .Icc 1 n | xy.1 + xy.2 β€ n β§ xy.1.gcd xy.2 = 1}
theorem imo_2013_p6 (n : β) (hn : n β₯ 3) : M n = N n + 1 := by sorry |
imo_2014_p2 | Let $n\ge2$ be an integer. Consider an $n\times n$ chessboard consisting of $n^2$ unit squares. A configuration of $n$ rooks on this board is $\textit{peaceful}$ if every row and every column contains exactly one rook. Find the greatest positive integer $k$ such that, for each peaceful configuration of $n$ rooks, there is a $k\times k$ square which does not contain a rook on any of its $k^2$ squares. | [
"fun n => ββnββ - 1"
] | null | imo | import Mathlib
structure peaceful_rooks (n : β) : Type where
carrier : Matrix (Fin n) (Fin n) Bool
is_peaceful_row : β i, List.count true (List.ofFn (fun j => carrier i j)) = 1
is_peaceful_col : β j, List.count true (List.ofFn (fun i => carrier i j)) = 1
deriving Fintype
noncomputable abbrev imo_2014_p2_solution : β β β := sorry
theorem imo_2014_p2 (n : β) (hn : n β₯ 2) :
IsGreatest {(k : β) | (k > 0) β§ β r : peaceful_rooks n, β i j : Fin n,
i.val + k - 1 < n β§ i.val + k - 1 < n β§
β m n, m.val < k β§ n.val < k β§ r.carrier (i + m) (j + n) = false}
(imo_2014_p2_solution n) := by sorry |
imo_2014_p6 | A set of lines in the plane is in $\textit{general position}$ if no two are parallel and no three pass through the same point. A set of lines in general position cuts the plane into regions, some of which have finite area; we call these its $\textit{finite regions}$. Prove that for all sufficiently large $n$, in any set of $n$ lines in general position it is possible to colour at least $\sqrt{n}$ of the lines blue in such a way that none of its finite regions has a completely blue boundary. | null | null | imo | import Mathlib
def General_position (L : Finset (β Γ β Γ β)) : Prop :=
(β l β L, l.1 β 0 β¨ l.2.1 β 0) β§
(β l1 β L, β l2 β L, l1 β l2 β l1.1 * l2.2.1 β l1.2.1 * l2.1) β§
(β l1 β L, β l2 β L, β l3 β L, l1 β l2 β l1 β l3 β l2 β l3 β
(Β¬ β (p : β Γ β), l1.1 * p.1 + l1.2.1 * p.2 + l1.2.2 = 0 β§
l2.1 * p.1 + l2.2.1 * p.2 + l2.2.2 = 0 β§ l3.1 * p.1 + l3.2.1 * p.2 + l3.2.2 = 0))
def finite_regions (S : Set (β Γ β)) (L : Finset (β Γ β Γ β)) : Prop :=
S β β
β§ (β a b : β, β p β S, |p.1| β€ a β§ |p.2| β€ b) β§ (β p β S, β q β S, p β q β β l β L,
Real.sign (l.1 * p.1 + l.2.1 * p.2 + l.2.2) = Real.sign (l.1 * q.1 + l.2.1 * q.2 + l.2.2))
theorem imo_2014_p6 : βαΆ n in Filter.atTop,
β (L : Finset (β Γ β Γ β)), General_position L β§ L.card = n β
β B β€ L, B.card β₯ Nat.sqrt n β§ β S β€ B, β (R : Set (β Γ β)), Β¬finite_regions R S := by sorry |
imo_2015_p1 | We say that a finite set $\mathcal{S}$ in the plane is balanced if, for any two different points $A$, $B$ in $\mathcal{S}$, there is a point $C$ in $\mathcal{S}$ such that $AC=BC$. We say that $\mathcal{S}$ is centre-free if for any three points $A$, $B$, $C$ in $\mathcal{S}$, there is no point $P$ in $\mathcal{S}$ such that $PA=PB=PC$. (1) Show that for all integers $n\geq 3$, there exists a balanced set consisting of $n$ points. (1) Determine all integers $n\geq 3$ for which there exists a balanced centre-free set consisting of $n$ points. | [
"{n | n β₯ 3 β§ Odd n}"
] | null | imo | import Mathlib
def balanced (S : Set (β Γ β)) : Prop :=
β A β S, β B β S, A β B β (β C β S, dist A C = dist B C)
def centre_free (S : Set (β Γ β)) : Prop :=
β A β S, β B β S, β C β S, A β B β B β C β A β C β
Β¬ (β P β S, dist A P = dist B P β§ dist B P = dist C P)
abbrev imo_2015_p1_solution : Set β := sorry
theorem imo_2015_p1 : (β n β₯ 3, β (S : Finset (β Γ β)), balanced S β§ S.card = n) β§
{n | n β₯ 3 β§ (β (S : Finset (β Γ β)), balanced S β§ centre_free S β§ S.card = n)} =
imo_2015_p1_solution := by sorry |
imo_2015_p6 | The sequence $a_1,a_2,\dots$ of integers satisfies the conditions: (i) $1\le a_j\le2015$ for all $j\ge1$, (ii) $k+a_k\neq \ell+a_\ell$ for all $1\le k<\ell$. Prove that there exist two positive integers $b$ and $N$ for which\[\left\vert\sum_{j=m+1}^n(a_j-b)\right\vert\le1007^2\]for all integers $m$ and $n$ such that $n>m\ge N$. | null | null | imo | import Mathlib
theorem imo_2015_p6 (a : β+ β β€) (ha1 : β j : β+, 1 β€ a j β§ a j β€ 2015)
(ha2 : β k l, k < l β k + a k β l + a l) :
β b N : β+, β m n, n > m β§ m β₯ N β |(β j β Finset.Icc (m + 1) n, (a j - b))| β€ 1007^2 := by sorry |
imo_2016_p2 | Find all integers $n$ for which each cell of $n \times n$ table can be filled with one of the letters $I,M$ and $O$ in such a way that: in each row and each column, one third of the entries are $I$, one third are $M$ and one third are $O$; and in any diagonal, if the number of entries on the diagonal is a multiple of three, then one third of the entries are $I$, one third are $M$ and one third are $O$. Note. The rows and columns of an $n \times n$ table are each labelled $1$ to $n$ in a natural order. Thus each cell corresponds to a pair of positive integer $(i,j)$ with $1 \le i,j \le n$. For $n>1$, the table has $4n-2$ diagonals of two types. A diagonal of first type consists all cells $(i,j)$ for which $i+j$ is a constant, and the diagonal of this second type consists all cells $(i,j)$ for which $i-j$ is constant. | [
"{n | 9 β£ n}"
] | null | imo | import Mathlib
open Finset
inductive Letters
| I | M | O
deriving BEq, DecidableEq
def diagonal_I_set (n k : β) : Finset (Fin n Γ Fin n) :=
(@Finset.univ (Fin n Γ Fin n) _ |>.filter (fun (i, j) => i.1 + j.1 = k))
def diagonal_I (n k : β) (A : Matrix (Fin n) (Fin n) Letters) : Prop :=
3 β£ #(diagonal_I_set n k) β
#(diagonal_I_set n k) = 3 * #{x β diagonal_I_set n k | A x.1 x.2 = Letters.I} β§
#(diagonal_I_set n k) = 3 * #{x β diagonal_I_set n k | A x.1 x.2 = Letters.M} β§
#(diagonal_I_set n k) = 3 * #{x β diagonal_I_set n k | A x.1 x.2 = Letters.O}
def diagonal_II_set (n : β) (k : β€) : Finset (Fin n Γ Fin n) :=
(@Finset.univ (Fin n Γ Fin n) _ |>.filter (fun (i, j) => (i.1 : β€) - (j.1 : β€) = k))
def diagonal_II (n : β) (k : β€) (A : Matrix (Fin n) (Fin n) Letters) : Prop :=
3 β£ #(diagonal_II_set n k) β
#(diagonal_II_set n k) = 3 * #{x β diagonal_II_set n k | A x.1 x.2 = Letters.I} β§
#(diagonal_II_set n k) = 3 * #{x β diagonal_II_set n k | A x.1 x.2 = Letters.M} β§
#(diagonal_II_set n k) = 3 * #{x β diagonal_II_set n k | A x.1 x.2 = Letters.O}
def exists_valid_table (n : β) : Prop :=
β (A : Matrix (Fin n) (Fin n) Letters),
(β i : Fin n,
n = 3 * #{j | A i j = Letters.I} β§ n = 3 * #{j | A i j = Letters.M} β§
n = 3 * #{j | A i j = Letters.O}) β§
(β j : Fin n,
n = 3 * #{i | A i j = Letters.I} β§ n = 3 * #{i | A i j = Letters.M} β§
n = 3 * #{i | A i j = Letters.O}) β§
(β k β Finset.range (2 * n - 1), diagonal_I n k A) β§
β k β Finset.Icc (-(n : β€) + 1) (n - 1), diagonal_II n k A
abbrev imo_2016_p2_solution : Set β := sorry
theorem imo_2016_p2 : {n | exists_valid_table n} = imo_2016_p2_solution := by sorry |
imo_2016_p6 | There are $n\ge 2$ line segments in the plane such that every two segments cross and no three segments meet at a point. Geoff has to choose an endpoint of each segment and place a frog on it facing the other endpoint. Then he will clap his hands $n-1$ times. Every time he claps, each frog will immediately jump forward to the next intersection point on its segment. Frogs never change the direction of their jumps. Geoff wishes to place the frogs in such a way that no two of them will ever occupy the same intersection point at the same time. (a) Prove that Geoff can always fulfill his wish if $n$ is odd. (b) Prove that Geoff can never fulfill his wish if $n$ is even. | null | null | imo | import Mathlib
open Function
structure FrogSystem (N : β) where
otherSegment (s : Fin N) : Fin (N - 1) β {s' : Fin N // s β s'}
point : {p : Sym2 (Fin N) // Β¬ p.IsDiag} β EuclideanSpace β (Fin 2)
mem_collinear {s tβ tβ tβ} : tβ < tβ β tβ < tβ β Sbtw β
(point β¨s(s, otherSegment s tβ), by simpa using (otherSegment s tβ).2β©)
(point β¨s(s, otherSegment s tβ), by simpa using (otherSegment s tβ).2β©)
(point β¨s(s, otherSegment s tβ), by simpa using (otherSegment s tβ).2β©)
def FrogSystem.GeoffsWish {N : β} (F : FrogSystem N) : Prop :=
β t, Injective fun s β¦ s(s, F.otherSegment s t)
theorem imo_2016_p6 :
(β n β₯ 2, Odd n β β F : FrogSystem n, F.GeoffsWish) β§
β n β₯ 2, Even n β β F : FrogSystem n, Β¬ F.GeoffsWish := by sorry |
imo_2017_p3 | A hunter and an invisible rabbit play a game in the Euclidean plane. The rabbit's starting point, $A_0$, and the hunter's starting point, $B_0$, are the same. After $n-1$ rounds of the game, the rabbit is at point $A_{n-1}$ and the hunter is at point $B_{n-1}$. In the nth round of the game, three things occur in order. (i) The rabbit moves invisibly to a point $A_n$ such that the distance between $A_{n-1}$ and $A_n$ is exactly 1. (ii) A tracking device reports a point $P_n$ to the hunter. The only guarantee provided by the tracking device is that the distance between $P_n$ and $A_n$ is at most 1. (iii) The hunter moves visibly to a point $B_n$ such that the distance between $B_{n-1}$ and $B_n$ is exactly 1. Is it always possible, no matter how the rabbit moves, and no matter what points are reported by the tracking device, for the hunter to choose her moves so that after $10^9$ rounds she can ensure that the distance between her and the rabbit is at most 100? | [
"false"
] | null | imo | import Mathlib
abbrev imo_2017_p3_solution : Bool := sorry
theorem imo_2017_p3 (start : β Γ β) : imo_2017_p3_solution =
β (A : β β (Fin 2 β β)), A 0 = ![start.1, start.2] β β n, dist (A n) (A (n + 1)) = 1 β
(β (P : β β (Fin 2 β β)), β n > 0, dist (P n) (A n) β€ 1) β
(β (B : β β (Fin 2 β β)), B 0 = ![start.1, start.2] β§ β n, dist (B n) (B (n + 1)) = 1 β§
dist (A (10 ^ 9)) (B (10 ^9)) β€ 100) := by sorry |
imo_2017_p5 | An integer $N \ge 2$ is given. A collection of $N(N + 1)$ soccer players, no two of whom are of the same height, stand in a row. Sir Alex wants to remove $N(N - 1)$ players from this row leaving a new row of $2N$ players in which the following $N$ conditions hold: ($1$) no one stands between the two tallest players, ($2$) no one stands between the third and fourth tallest players, $\cdots$ ($N$) no one stands between the two shortest players. Show that this is always possible. | null | null | imo | import Mathlib
open Equiv Finset
theorem imo_2017_p5 (N : β) (h_N : N β₯ 2) (height : Perm (Fin (N * (N + 1)))) :
β kept : Fin (2 * N) βͺo Fin (N * (N + 1)),
β i j, Even #{l | height (kept l) < height (kept i)} β
(β k, height (kept i) < height (kept k) β height (kept j) β€ height (kept k)) β
(β k, kept i < kept k β kept j β€ kept k) β¨ (β k, kept j < kept k β kept i β€ kept k) := by sorry |
imo_2018_p3 | An anti-Pascal triangle is an equilateral triangular array of numbers such that, except for the numbers in the bottom row, each number is the absolute value of the difference of the two numbers immediately below it. For example, the following is an anti-Pascal triangle with four rows which contains every integer from $1$ to $10$ \[4\]\[2\quad 6\]\[5\quad 7 \quad 1\] \[8\quad 3 \quad 10 \quad 9\] Does there exist an anti-Pascal triangle with $2018$ rows which contains every integer from $1$ to $1 + 2 + 3 + \dots + 2018$? | [
"false"
] | null | imo | import Mathlib
def IsAntiPascal (L : List (List β)) : Prop :=
L β [] β§ L[0]!.length = L.length β§ (β i, i < L.length - 1 β (L[i]!.length = L[i+1]!.length + 1 β§
β j, j < (L[i+1]!).length β ((L[i+1]!)[j]! = (((L[i]!)[j]! : β€) - (L[i]!)[j+1]!).natAbs)))
abbrev imo_2018_p3_solution : Bool := sorry
theorem imo_2018_p3 : imo_2018_p3_solution = β l, IsAntiPascal l β§
List.range' 1 (β i β Finset.Icc 1 2018, i) = List.insertionSort (Β· β€ Β·) (List.flatten l) := by
sorry |
imo_2018_p4 | A site is any point $(x, y)$ in the plane such that $x$ and $y$ are both positive integers less than or equal to 20. Initially, each of the 400 sites is unoccupied. Amy and Ben take turns placing stones with Amy going first. On her turn, Amy places a new red stone on an unoccupied site such that the distance between any two sites occupied by red stones is not equal to $\sqrt{5}$. On his turn, Ben places a new blue stone on any unoccupied site. (A site occupied by a blue stone is allowed to be at any distance from any other occupied site.) They stop as soon as a player cannot place a stone. Find the greatest $K$ such that Amy can ensure that she places at least $K$ red stones, no matter how Ben places his blue stones. | [
"100"
] | null | imo | import Mathlib
abbrev Site := Fin 20 Γ Fin 20
def Site.asPoint (s : Site) : β Γ β := (s.1.1 + 1, s.2.1 + 1)
inductive State
| red
| blue
| unoccupied
abbrev Game := Site β State
def initialGame : Game := fun _ => State.unoccupied
def valid_Amy_move (x : Site) (g : Game) : Prop :=
g x = State.unoccupied β§
β y, g y = State.red β dist x.asPoint y.asPoint β β5
def valid_Ben_move (x : Site) (g : Game) : Prop :=
g x = State.unoccupied
def AmyStrategy := Ξ (g : Game), Option ((x : Site) Γ' valid_Amy_move x g)
def Game.updateAccordingToAmyStrategy (g : Game) (s : AmyStrategy) : Option Game :=
(s g) >>= fun p => .some <| Function.update g p.1 .red
def BenStrategy := Ξ (g : Game), Option ((x : Site) Γ' valid_Ben_move x g)
def Game.updateAccordingToBenStrategy (g : Game) (s : BenStrategy) : Option Game :=
(s g) >>= fun p => .some <| Function.update g p.1 .blue
def updateOneTurn (a : AmyStrategy) (b : BenStrategy) (g : Game) : Option Game :=
g.updateAccordingToAmyStrategy a >>= fun g' => g'.updateAccordingToBenStrategy b
def updateGame (a : AmyStrategy) (b : BenStrategy) (g : Game) : β β Option Game
| 0 => .some g
| (n + 1) => updateOneTurn a b g >>= (updateGame a b Β· n)
def CanPlaceKRedStones (a : AmyStrategy) (b : BenStrategy) : β β Prop
| 0 => True
| n+1 =>
β (h : updateGame a b initialGame n |>.isSome),
a ((updateGame a b initialGame n).get h) |>.isSome
abbrev imo_2018_p4_solution : β := sorry
theorem imo_2018_p4 :
(β a : AmyStrategy, β b : BenStrategy, CanPlaceKRedStones a b imo_2018_p4_solution) β§
(β a : AmyStrategy, β b : BenStrategy, Β¬ CanPlaceKRedStones a b (imo_2018_p4_solution + 1)) := by
sorry |
imo_2019_p3 | A social network has $2019$ users, some pairs of whom are friends. Whenever user $A$ is friends with user $B$, user $B$ is also friends with user $A$. Events of the following kind may happen repeatedly, one at a time: Three users $A$, $B$, and $C$ such that $A$ is friends with both $B$ and $C$, but $B$ and $C$ are not friends, change their friendship statuses such that $B$ and $C$ are now friends, but $A$ is no longer friends with $B$, and no longer friends with $C$. All other friendship statuses are unchanged. Initially, $1010$ users have $1009$ friends each, and $1009$ users have $1010$ friends each. Prove that there exists a sequence of such events after which each user is friends with at most one other user. | null | null | imo | import Mathlib
noncomputable instance (users : SimpleGraph (Fin 2019)) (a : Fin 2019) : Fintype (users.neighborSet a) :=
Fintype.ofFinite β(users.neighborSet a)
def IsTriple (l : List (Fin 2019)) (G : SimpleGraph (Fin 2019)) : Prop :=
l.length = 3 β§ G.Adj l[0]! l[1]! β§ G.Adj l[0]! l[2]! β§ Β¬ G.Adj l[1]! l[2]! β§ l[1]! β l[2]!
@[simp]
lemma triple.hab' (l : List (Fin 2019)) (users : SimpleGraph (Fin 2019)) (h : IsTriple l users) :
l[1]! = l[2]! β False := by
constructor
Β· exact (h.2.2.2.2 Β·)
Β· tauto
attribute [local aesop safe] SimpleGraph.Adj.symm IsTriple
def update (l : List (Fin 2019)) (users : SimpleGraph (Fin 2019)) (h : IsTriple l users) :
SimpleGraph (Fin 2019) where
Adj x y :=
if x = l[0]! then
if y = l[1]! then False
else if y = l[2]! then False
else users.Adj l[0]! y
else if x = l[1]! then
if y = l[0]! then False
else if y = l[2]! then True
else users.Adj l[1]! y
else if x = l[2]! then
if y = l[0]! then False
else if y = l[1]! then True
else users.Adj l[2]! y
else users.Adj x y
symm := by
simp only [if_false_left, if_true_left]
intro x y
simp only
split_ifs <;> aesop
loopless := by
intro x
simp only [if_false_left, if_true_left, SimpleGraph.irrefl, if_false_right]
split_ifs with h1 h2
Β· aesop
Β· subst h2
simp_all only [not_false_eq_true, SimpleGraph.irrefl, imp_false, Decidable.not_not, true_and]
apply Aesop.BuiltinRules.not_intro
intro a_1
apply h.2.2.2.2; simp [a_1]
Β· aesop
structure ExpectSeq where
l : List (SimpleGraph (Fin 2019) Γ List (Fin 2019))
h_length : l.length > 0
h_card : β li β l, li.2.length = 3
h_triple : β li β l, IsTriple li.2 li.1
h_update : β i : Fin l.length, (finRotate _ i).1 β 0 β
update l[i].2 l[i].1 (h_triple l[i] (by simp)) = l[finRotate _ i].1
def final_state (seq : ExpectSeq) : SimpleGraph (Fin 2019) :=
update seq.l[((finRotate seq.l.length).symm β¨0, by simp [seq.h_length]β© )]!.2
seq.l[((finRotate seq.l.length).symm β¨0, by simp [seq.h_length]β©)]!.1
(seq.h_triple seq.l[((finRotate seq.l.length).symm β¨0, by simp [seq.h_length]β©)]! (by simp))
theorem imo_2019_p3 (users : SimpleGraph (Fin 2019))
(cond : β (A B : Finset (Fin 2019)), A.card = 1010 β§ B.card = 1009 β§
(β a β A, (users.neighborFinset a).card = 1009) β§
(β b β B, (users.neighborFinset b).card = 1010)) :
β seq : ExpectSeq, β i, ((final_state seq).neighborFinset i).card β€ 1 := by sorry |
imo_2019_p5 | The Bank of Bath issues coins with an $H$ on one side and a $T$ on the other. Harry has $n$ of these coins arranged in a line from left to right. He repeatedly performs the following operation: If there are exactly $k > 0$ coins showing $H$, then he turns over the $k^{th}$ coin from the left; otherwise, all coins show $T$ and he stops. For example, if $n = 3$ the process starting with the configuration $THT$ would be $THT \rightarrow HHT \rightarrow HTT \rightarrow TTT$, which stops after three operations. (a) Show that, for each initial configuration, Harry stops after a finite number of operations. (b) For each initial configuration $C$, let $L(C)$ be the number of operations before Harry stops. For example, $L(THT) = 3$ and $L(TTT) = 0$. Determine the average value of $L(C)$ over all $2^n$ possible initial configurations $C$. | [
"fun n => n * (n + 1) / 4"
] | null | imo | import Mathlib
abbrev Coin := Fin 2
abbrev Coin.H : Coin := 0
abbrev Coin.T : Coin := 1
abbrev CoinConfig (n : β) := Fin n β Coin
def CoinConfig.countH {n : β} (c : CoinConfig n) : β := (List.ofFn c).count .H
def CoinConfig.flip {n : β} (c : CoinConfig n) (k : β) : CoinConfig n :=
fun i => if i.val + 1 = k then
match c i with
| .H => .T
| .T => .H
else c i
def CoinConfig.update {n : β} (c : CoinConfig n) : Option (CoinConfig n) :=
if c.countH = 0 then none else .some <| c.flip c.countH
def CoinConfig.updateMultipleTimes {n : β} (c : CoinConfig n) : β β Option (CoinConfig n)
| 0 => if c.countH = 0 then none else .some c
| k+1 => c.updateMultipleTimes k >>= update
abbrev imo_2019_p5_2_solution : β β β := sorry
theorem imo_2019_p5_1 {n : β} (hn : n > 0) : β (c : CoinConfig n), β N : β, c.updateMultipleTimes N = .none := by sorry
theorem imo_2019_p5_2 {n : β} (hn : n > 0) : imo_2019_p5_2_solution n =
β c : CoinConfig n, (Nat.find (imo_2019_p5_1 hn c) : β) / (Fintype.card (CoinConfig n)) := by sorry |
imo_2020_p4 | There is an integer $n > 1$. There are $n^2$ stations on a slope of a mountain, all at different altitudes. Each of two cable car companies, $A$ and $B$, operates $k$ cable cars; each cable car provides a transfer from one of the stations to a higher one (with no intermediate stops). The $k$ cable cars of $A$ have $k$ different starting points and $k$ different finishing points, and a cable car that starts higher also finishes higher. The same conditions hold for $B$. We say that two stations are linked by a company if one can start from the lower station and reach the higher one by using one or more cars of that company (no other movements between stations are allowed). Determine the smallest positive integer k for which one can guarantee that there are two stations that are linked by both companies. | [
"fun n => n ^ 2 - n + 1"
] | null | imo | import Mathlib
def Iscompanies (n k : β) (car_set : Finset (Fin n Γ Fin n)) : Prop :=
car_set.card = k β§
(β (a b : Fin n), (a, b) β car_set β a < b)β§
(β a β car_set, β b β car_set, a β b β a.1 β b.1 β§ a.2 β b.2)
def Islinked {n : β} (a b : Fin n) (car_set : Finset (Fin n Γ Fin n)) : Prop :=
β s : List (Fin n Γ Fin n), s.Nodup β§ (β i β s, (i β car_set β§
(List.foldl (fun x y => if x.2 = y.1 then (x.1, y.2) else x) (a, a) s = (a, b))))
def Condition (n k : β) : Prop :=
β (companyA companyB : Finset (Fin n Γ Fin n)), Iscompanies n k companyA β§ Iscompanies n k companyB β§
(β (a b : Fin n), a β b β§ Islinked a b companyA β§ Islinked a b companyB)
abbrev imo_2020_p4_solution : β β β := sorry
theorem imo_2020_p4 (n : β) (hn : n > 1) : IsLeast {k | Condition n k} (imo_2020_p4_solution n) := by sorry |
imo_2021_p5 | Two squirrels, Bushy and Jumpy, have collected 2021 walnuts for the winter. Jumpy numbers the walnuts from 1 through 2021, and digs 2021 little holes in a circular pattern in the ground around their favourite tree. The next morning Jumpy notices that Bushy had placed one walnut into each hole, but had paid no attention to the numbering. Unhappy, Jumpy decides to reorder the walnuts by performing a sequence of 2021 moves. In the $k$-th move, Jumpy swaps the positions of the two walnuts adjacent to walnut $k$. Prove that there exists a value of $k$ such that, on the $k$-th move, Jumpy swaps some walnuts $a$ and $b$ such that $a < k < b$. | null | null | imo | import Mathlib
def move (k : Fin 2021) (order : Fin 2021 β Fin 2021) : Fin 2021 β Fin 2021 :=
order.trans (Equiv.swap (order (finRotate _ (order.symm k))) (order ((finRotate _).symm (order.symm k))))
def performMoves (originalOrder : Fin 2021 β Fin 2021) : (Fin 2021) β (Fin 2021 β Fin 2021)
| 0 => originalOrder
| β¨n + 1, ltβ© => move n (performMoves originalOrder β¨n, lt_trans (by omega) ltβ©)
theorem imo_2021_p5 (originalOrder : Fin 2021 β Fin 2021) :
β k, min (finRotate _ ((performMoves originalOrder k).symm k) : β)
((finRotate _).symm ((performMoves originalOrder k).symm k) : β) < (k : β) β§
(k : β) < max (finRotate _ ((performMoves originalOrder k).symm k) : β)
((finRotate _).symm ((performMoves originalOrder k).symm k) : β) := by sorry |
imo_2022_p1 | The Bank of Oslo issues two types of coin: aluminium (denoted A) and bronze (denoted B). Marianne has $n$ aluminium coins and $n$ bronze coins, arranged in a row in some arbitrary initial order. A chain is any subsequence of consecutive coins of the same type. Given a fixed positive integer $k\le 2n$, Marianne repeatedly performs the following operation: she identifies the longest chain containing the $k^{th}$ coin from the left, and moves all coins in that chain to the left end of the row. For example, if $n = 4$ and $k = 4$, the process starting from the ordering AABBBABA would be $AABBBABA \rightarrow BBBAAABA \rightarrow AAABBBBA \rightarrow BBBBAAAA \rightarrow BBBBAAAA \rightarrow \ldots$. Find all pairs $(n, k)$ with $1 \le k \le 2n$ such that for every initial ordering, at some moment during the process, the leftmost $n$ coins will all be of the same type. | [
"fun n => {p | p.1 = n β§ n β€ p.2 β§ p.2 β€ β(3 * n : β) / 2ββ}"
] | null | imo | import Mathlib
abbrev sortedList (n : β) := (List.range (2 * n))|>.map
(fun i β¦ if i < n then 0 else 1)
def checkList (k : β) : List β β β Γ β := fun L β¦ Id.run do
let mut i0 := k - 1
let mut i1 := k - 1
for i in [k : L.length] do
if L[i]! = L[k-1]! then
i1 := i1 + 1
else break
for j in [1 : k] do
if L[k-1-j]! = L[k-1]! then
i0 := i0 - 1
else break
return (i0, i1)
abbrev action (k : β) : List β β List β := fun L β¦
(List.range ((checkList k L).2 - (checkList k L).1 + 1)).map (fun _ β¦ L[k-1]!) ++
(List.range (checkList k L).1).map (fun i β¦ L[i]!) ++
(List.range (L.length - (checkList k L).2 - 1)).map (fun i β¦ L[i + (checkList k L).2 + 1]!)
abbrev pown (k m : β) : List β β List β := fun L β¦ Id.run do
let mut L' := L
for _ in [0 : m] do
L' := action k L'
return L'
abbrev checkLeft (n : β) : List β β Bool := fun L β¦ Id.run do
for i in [0 : n] do
if L[i]! β L[0]! then
return false
else continue
return true
def initial (n : β) : Finset (List β) := (List.replicate n 0 ++ List.replicate n 1).permutations.toFinset
abbrev imo_2022_p1_solution : β β Set (β Γ β) := sorry
theorem imo_2022_p1 (n : β) (hn : n > 0) :
{(n', k) | n = n' β§ k β₯ 1 β§ k β€ 2 * n β§ (β I β initial n, β m : β, checkLeft n' (pown k m I))} =
imo_2022_p1_solution n := by sorry |
imo_2023_p5 | Let $n$ be a positive integer. A Japanese triangle consists of $1 + 2 + \dots + n$ circles arranged in an equilateral triangular shape such that for each $i = 1$, $2$, $\dots$, $n$, the $i^{th}$ row contains exactly $i$ circles, exactly one of which is coloured red. A ninja path in a Japanese triangle is a sequence of $n$ circles obtained by starting in the top row, then repeatedly going from a circle to one of the two circles immediately below it and finishing in the bottom row. In terms of $n$, find the greatest $k$ such that in each Japanese triangle there is a ninja path containing at least $k$ red circles. | [
"fun n => βReal.log nββ + 1"
] | null | imo | import Mathlib
structure Index (n : β+) where
row : β
col : β
le_row : 1 β€ row
row_le : row β€ n
le_col : 1 β€ col
col_le : col β€ row
def Index.atBottomLeft {n : β+} (p q : Index n) : Prop :=
q.row + 1 = p.row β§ q.col = p.col
def Index.atBottomRight {n : β+} (p q : Index n) : Prop :=
q.row + 1 = p.row β§ q.col + 1 = p.col
@[simps]
def triangleGraph (n : β+) : Digraph (Index n) where
Adj p q :=
p.atBottomLeft q β¨ p.atBottomRight q β¨
q.atBottomLeft p β¨ q.atBottomRight p
abbrev JapaneseTriangle (n : β+) := β (i : Fin n), Fin (i + 1)
structure NinjaPath {n : β+} (jt : JapaneseTriangle n) where
path : RelSeries (triangleGraph n |>.Adj)
length : path.length = n.natPred
@[simp]
lemma NinjaPath.path_length_succ {n : β+} {jt : JapaneseTriangle n} (p : NinjaPath jt) :
p.path.length + 1 = n := by
simp [p.length]
def NinjaPath.countRed {n : β+} {jt : JapaneseTriangle n} (p : NinjaPath jt) : β :=
β (i : Fin (p.path.length + 1)),
if (jt (Fin.cast (by simp) i) : β) = (p.path i).col
then 1
else 0
noncomputable abbrev imo_2023_p5_solution : β+ β β := sorry
theorem imo_2023_p5 (n : β+) :
IsGreatest {k | β (jt : JapaneseTriangle n), β (p : NinjaPath jt), k β€ p.countRed}
(imo_2023_p5_solution n) := by sorry |
imo_2024_p5 | Turbo the snail plays a game on a board with 2024 rows and 2023 columns. There are hidden monsters in 2022 of the cells. Initially, Turbo does not know where any of the monsters are, but he knows that there is exactly one monster in each row except the first row and the last row, and that each column contains at most one monster. Turbo makes a series of attempts to go from the first row to the last row. On each attempt, he chooses to start on any cell in the first row, then repeatedly moves to an adjacent cell sharing a common side. (He is allowed to return to a previously visited cell.) If he reaches a cell with a monster, his attempt ends and he is transported back to the first row to start a new attempt. The monsters do not move, and Turbo remembers whether or not each cell he has visited contains a monster. If he reaches any cell in the last row, his attempt ends and the game is over. Determine the minimum value of $n$ for which Turbo has a strategy that guarantees reaching the last row on the $n^{th}$ attempt or earlier, regardless of the locations of the monsters. | [
"3"
] | null | imo | import Mathlib
namespace Imo_2024_p5
abbrev Cell (N : β) : Type := Fin (N + 2) Γ Fin (N + 1)
abbrev InteriorRow (N : β) : Type := (Set.Icc 1 β¨N, by omegaβ© : Set (Fin (N + 2)))
abbrev MonsterData (N : β) : Type := InteriorRow N βͺ Fin (N + 1)
def MonsterData.monsterCells {N} (m : MonsterData N) :
Set (Cell N) :=
Set.range (fun x : InteriorRow N β¦ ((x : Fin (N + 2)), m x))
def Adjacent {N} (x y : Cell N) : Prop :=
Nat.dist x.1 y.1 + Nat.dist x.2 y.2 = 1
structure Path (N : β) where
cells : List (Cell N)
nonempty : cells β []
head_first_row : (cells.head nonempty).1 = 0
last_last_row : (cells.getLast nonempty).1 = N + 1
valid_move_seq : cells.Chain' Adjacent
noncomputable def Path.firstMonster {N} (p : Path N) (m : MonsterData N) : Option (Cell N) :=
letI := Classical.propDecidable
p.cells.find? (fun x β¦ (x β m.monsterCells : Bool))
abbrev Strategy (N : β) : Type := β¦k : ββ¦ β (Fin k β Option (Cell N)) β Path N
noncomputable def Strategy.play {N} (s : Strategy N) (m : MonsterData N) :
(k : β) β Fin k β Option (Cell N)
| 0 => Fin.elim0
| k + 1 => Fin.snoc (s.play m k) ((s (s.play m k)).firstMonster m)
def Strategy.WinsIn {N} (s : Strategy N) (m : MonsterData N) (k : β) : Prop :=
none β Set.range (s.play m k)
def Strategy.ForcesWinIn {N} (s : Strategy N) (k : β) : Prop :=
β m, s.WinsIn m k
abbrev imo_2024_p5_solution : β := sorry
theorem imo_2024_p5 : IsLeast {k | β s : Strategy 2022, s.ForcesWinIn k} imo_2024_p5_solution := by
sorry |
CombiBench
CombiBench is the first benchmark focused on combinatorial problems, based on the formal language LEAN4. CombiBench is a manually produced benchmark, including 100 combinatorial mathematics problems of varying difficulty and knowledge levels. It aims to provide a benchmark for evaluating the combinatorial mathematics capabilities of automated theorem proving systems to advance the field. For problems that require providing a solution first and then proving its correctness, we have referred to the style of PutnamBench.
We are hosting a leaderboard and will readily receive evaluation results which are accompanied by a preprint or publication. Please reach out privately at [email protected]
with any requests for additions to the leaderboard.
Statistics
We collected all combinatorics problems from the official IMO problems since 2000, except for one problem that relies on a figure. And We selected problems through random sampling from 14 chapters in the book, choosing 3 problems from each chapter, ensuring that the 42 problems are evenly distributed across all 14 chapters. We randomly selected 10 simple combinatorics problems at the middle school level from a mathematics problem collection website hackmath. Then, we randomly collected 12 problems from other mathematics competitions.
Source | Count |
---|---|
Easy | 10 |
Brualdi's book | 42 |
IMO | 36 |
APMO | 2 |
Balticway | 1 |
EGMO | 1 |
IMO-Shortlist | 4 |
IZHO | 2 |
BXMO | 1 |
USAMO | 1 |
Note : The complete proofs of Problem 3 and Problem 5 from 2024 have already been formalized in mathlib4/Archive. Therefore, we directly refer to the statements of these problems, along with the necessary definitions used in the statements. We are very grateful to Joseph Myers, the author of these two problems. We also appreciate his suggestions on the formalization of our problems.
Evaluation
Our evaluation code is released at https://github.com/MoonshotAI/CombiBench
π Contributing
Contributions are welcome! If anyone notices any mistakes, please raise an issue on the repository and we will address it.
π License
This project is licensed under the MIT License. See the LICENSE file for full details.
- Downloads last month
- 6