Problem ID,Problem,Lean Statement,Category,Level,Difficulty,Source,Formalization compfiles-Imo1963P6,"Five students A, B, C, D, E were placed 1 to 5 in a contest with no ties. One prediction was that the result would be the order A, B, C, D, E. But no student finished in the position predicted, and no two students predicted to finish consecutively did so. For example, the outcome for C and D was not 1, 2 (respectively), or 2, 3, or 3, 4, or 4, 5. Another prediction was the order D, A, E, C, B. Exactly two students finished in the places predicted, and two disjoint pairs of students predicted to finish consecutively did so. Determine the outcome.","import Mathlib /-! # International Mathematical Olympiad 1963, Problem 6 Five students A, B, C, D, E were placed 1 to 5 in a contest with no ties. One prediction was that the result would be the order A, B, C, D, E. But no student finished in the position predicted, and no two students predicted to finish consecutively did so. For example, the outcome for C and D was not 1, 2 (respectively), or 2, 3, or 3, 4, or 4, 5. Another prediction was the order D, A, E, C, B. Exactly two students finished in the places predicted, and two disjoint pairs of students predicted to finish consecutively did so. Determine the outcome. -/ namespace Imo1963P6 /-! We identify the students with `Fin 5`, in the order A, B, C, D, E, and the places of the contest with `Fin 5`, place `i` meaning `(i + 1)`-th place. Since there were no ties, the outcome of the contest is described by a permutation `π : Equiv.Perm (Fin 5)`, where `π s` is the place of student `s`. -/ /-- The second prediction ""D, A, E, C, B"", given as the function sending each student to the place in which it was predicted to finish. -/ def secondPrediction : Fin 5 → Fin 5 := ![1, 4, 3, 0, 2] abbrev answer : Equiv.Perm (Fin 5) where toFun := ![2, 4, 3, 1, 0] invFun := ![4, 3, 0, 2, 1] left_inv := by intro x; fin_cases x <;> decide right_inv := by intro x; fin_cases x <;> decide theorem imo1963_p6 (π : Equiv.Perm (Fin 5)) -- No student finished in the position predicted by the first prediction -- ""A, B, C, D, E"". (h1 : ∀ s : Fin 5, π s ≠ s) -- No two students predicted to finish consecutively did so; for example, -- the outcome for C and D was not 1, 2 (respectively), or 2, 3, or 3, 4, -- or 4, 5. (h2 : ∀ i : Fin 4, (π i.succ : ℕ) ≠ (π i.castSucc : ℕ) + 1) -- Exactly two students finished in the places predicted by the second -- prediction. (h3 : (Finset.univ.filter (fun s => π s = secondPrediction s)).card = 2) -- Two disjoint pairs of students predicted to finish consecutively did -- so. The consecutive pairs of the second prediction ""D, A, E, C, B"" are -- {D, A}, {A, E}, {E, C} and {C, B}; the disjoint pairs among them are -- {D, A} & {E, C}, {D, A} & {C, B}, and {A, E} & {C, B}. (h4 : ((π 0 : ℕ) = (π 3 : ℕ) + 1 ∧ (π 2 : ℕ) = (π 4 : ℕ) + 1) ∨ ((π 0 : ℕ) = (π 3 : ℕ) + 1 ∧ (π 1 : ℕ) = (π 2 : ℕ) + 1) ∨ ((π 4 : ℕ) = (π 0 : ℕ) + 1 ∧ (π 1 : ℕ) = (π 2 : ℕ) + 1)) : π = answer := by sorry end Imo1963P6 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1963, Problem 6", compfiles-Imo1964P4,"Seventeen people correspond by mail with one another -- each one with all the rest. In their letters only three different topics are discussed. Each pair of correspondents deals with only one of the topics. Prove that there are at least three people who write to each other about the same topic.","import Mathlib /-! # International Mathematical Olympiad 1964, Problem 4 Seventeen people correspond by mail with one another -- each one with all the rest. In their letters only three different topics are discussed. Each pair of correspondents deals with only one of the topics. Prove that there are at least three people who write to each other about the same topic. -/ namespace Imo1964P4 theorem imo1964_p4 (Person Topic : Type) [Fintype Person] [DecidableEq Person] [Fintype Topic] [DecidableEq Topic] (card_person : Fintype.card Person = 17) (card_topic : Fintype.card Topic = 3) (discusses : Person → Person → Topic) (discussion_sym : ∀ p1 p2 : Person, discusses p1 p2 = discusses p2 p1) : ∃ t : Topic, ∃ s : Finset Person, 2 < s.card ∧ ∀ p1 ∈ s, ∀ p2 ∈ s, p1 ≠ p2 → discusses p1 p2 = t := by sorry end Imo1964P4 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1964, Problem 4", compfiles-Imo1966P1,"In a mathematical contest, three problems, A, B, C were posed. Among the participants there were 25 students who solved at least one problem each. Of all the contestants who did not solve problem A, the number who solved B was twice the number who solved C. The number of students who solved only problem A was one more than the number of students who solved A and at least one other problem. Of all students who solved just one problem, half did not solve problem A. How many students solved only problem B?","import Mathlib /-! # International Mathematical Olympiad 1966, Problem 1. In a mathematical contest, three problems, A, B, C were posed. Among the participants there were 25 students who solved at least one problem each. Of all the contestants who did not solve problem A, the number who solved B was twice the number who solved C. The number of students who solved only problem A was one more than the number of students who solved A and at least one other problem. Of all students who solved just one problem, half did not solve problem A. How many students solved only problem B? -/ namespace Imo1966P1 variable {U : Type*} [DecidableEq U] abbrev solution : ℕ := 6 theorem imo1966_p1 (A B C : Finset U) (h1 : (A ∪ B ∪ C).card = 25) (h2 : (B \ A).card = 2 * (C \ A).card) (h3 : ((A \ B) \ C).card = 1 + (A ∩ (B ∪ C)).card) (h4 : ((A \ B) \ C).card = ((B \ A) \ C).card + ((C \ A) \ B).card) : ((B \ A) \ C).card = solution := by sorry end Imo1966P1 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1966, Problem 1.", compfiles-Imo1970P6,"In a plane there are 100 points, no three of which are collinear. Consider all possible triangles having these points as vertices. Prove that no more that 70% of these triangles are acute.","import Mathlib /-! # International Mathematical Olympiad 1970, Problem 6 In a plane there are 100 points, no three of which are collinear. Consider all possible triangles having these points as vertices. Prove that no more that 70% of these triangles are acute. -/ namespace Imo1970P6 open scoped EuclideanGeometry Real RealInnerProductSpace open EuclideanGeometry Finset abbrev Pt := EuclideanSpace ℝ (Fin 2) theorem imo1970_p6 (P : Fin 100 → Pt) (hP : ∀ a b c : Fin 100, List.Nodup [a, b, c] → ¬ Collinear ℝ {P a, P b, P c}) : let cardAll := Nat.card { s : Finset (Fin 100) | s.card = 3 } let cardAcute := Nat.card { s : Finset (Fin 100) | s.card = 3 ∧ ∃ a b c : Fin 100, s = {a, b, c} ∧ ∃ t : Affine.Triangle ℝ Pt, ![P a, P b, P c] = t.points ∧ t.AcuteAngled } (cardAcute : ℚ) / cardAll ≤ 7 / 10 := by sorry end Imo1970P6 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1970, Problem 6", compfiles-Imo1971P5,"Prove that for every natural number m there exists a nonempty finite set S of points in the plane with the following property: For every point s in S, there are exactly m points which are at a unit distance from s.","import Mathlib /-! # International Mathematical Olympiad 1971, Problem 5 Prove that for every natural number m there exists a nonempty finite set S of points in the plane with the following property: For every point s in S, there are exactly m points which are at a unit distance from s. -/ namespace Imo1971P5 open scoped EuclideanGeometry abbrev Pt := EuclideanSpace ℝ (Fin 2) theorem imo1971_p5 (m : ℕ) : ∃ S : Set Pt, S.Nonempty ∧ S.Finite ∧ ∀ s ∈ S, {t ∈ S | dist s t = 1}.encard = m := by sorry end Imo1971P5 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1971, Problem 5", compfiles-Imo1972P1,"Prove that from a set of ten distinct two-digit numbers (in decimal), it is possible to select two disjoint subsets whose members have the same sum.","import Mathlib /-! # International Mathematical Olympiad 1972, Problem 1 Prove that from a set of ten distinct two-digit numbers (in decimal), it is possible to select two disjoint subsets whose members have the same sum. -/ namespace Imo1972P1 theorem imo1972_p1 (S : Finset ℕ) (Scard : S.card = 10) (Sdigits : ∀ n ∈ S, (Nat.digits 10 n).length = 2) : ∃ S1 S2 : Finset ℕ, S1 ⊆ S ∧ S2 ⊆ S ∧ Disjoint S1 S2 ∧ ∑ n ∈ S1, n = ∑ n ∈ S2, n := by sorry end Imo1972P1 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1972, Problem 1", compfiles-Imo1974P1,"Three players $A, B$ and $C$ play the following game: * On each of three cards an integer is written. * These three numbers $p, q, r$ satisfy $0 < p < q < r$. * The three cards are shuffled and one is dealt to each player. * Each then receives the number of counters indicated by the card he holds. * Then the cards are shuffled again; the counters remain with the players. This process (shuffling, dealing, giving out counters) takes place for at least two rounds. After the last round, $A$ has 20 counters in all, $B$ has 10 and $C$ has 9. At the last round $B$ received $r$ counters. Who received $q$ counters on the first round?","import Mathlib /-! # International Mathematical Olympiad 1974, Problem 1 Three players $A, B$ and $C$ play the following game: * On each of three cards an integer is written. * These three numbers $p, q, r$ satisfy $0 < p < q < r$. * The three cards are shuffled and one is dealt to each player. * Each then receives the number of counters indicated by the card he holds. * Then the cards are shuffled again; the counters remain with the players. This process (shuffling, dealing, giving out counters) takes place for at least two rounds. After the last round, $A$ has 20 counters in all, $B$ has 10 and $C$ has 9. At the last round $B$ received $r$ counters. Who received $q$ counters on the first round? -/ namespace Imo1974P1 abbrev Player := Fin 3 abbrev solution : Player := 2 -- player C theorem imo1974_p1 (p q r : ℕ) (hpqr : 0 < p ∧ p < q ∧ q < r) (n : ℕ) (hn : 1 < n) (game : ℕ → (Player ≃ Fin 3)) (hA : ∑ k ∈ Finset.range n, ![p,q,r] (game k 0) = 20) (hB : ∑ k ∈ Finset.range n, ![p,q,r] (game k 1) = 10) (hC : ∑ k ∈ Finset.range n, ![p,q,r] (game k 2) = 9) (hl : ![p,q,r] (game (n-1) 1) = r) : game 0 solution = 1 := by sorry end Imo1974P1 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1974, Problem 1", compfiles-Imo1974P4,"Consider decompositions of an 8 × 8 chessboard into p non-overlapping rectangles, subject to the following conditions: (i) Each rectangle has as many white squares as black squares. (ii) If aᵢ is the number of white squares in the i-th rectangle, then a₁ < a₂ < ... < aₚ. Find the maximum value of p for which such a decomposition is possible. For this value of p, determine all possible sequences a₁, a₂, ..., aₚ.","import Mathlib /-! # International Mathematical Olympiad 1974, Problem 4 Consider decompositions of an 8 × 8 chessboard into p non-overlapping rectangles, subject to the following conditions: (i) Each rectangle has as many white squares as black squares. (ii) If aᵢ is the number of white squares in the i-th rectangle, then a₁ < a₂ < ... < aₚ. Find the maximum value of p for which such a decomposition is possible. For this value of p, determine all possible sequences a₁, a₂, ..., aₚ. -/ namespace Imo1974P4 /-- A rectangle on the chessboard, given by the coordinates `(r, c)` of its top-left unit square, its height `h` (number of rows) and its width `w` (number of columns). -/ structure Rect where r : ℕ c : ℕ h : ℕ w : ℕ deriving DecidableEq /-- The unit squares making up a rectangle. -/ def Rect.cells (R : Rect) : Finset (ℕ × ℕ) := Finset.Icc (R.r, R.c) (R.r + (R.h - 1), R.c + (R.w - 1)) /-- The white squares of the chessboard are those whose coordinates have even sum. -/ def isWhite (x : ℕ × ℕ) : Prop := (x.1 + x.2) % 2 = 0 instance : DecidablePred isWhite := fun x ↦ inferInstanceAs (Decidable ((x.1 + x.2) % 2 = 0)) /-- The number of white squares of a rectangle. -/ def Rect.whiteCount (R : Rect) : ℕ := (R.cells.filter isWhite).card /-- The number of black squares of a rectangle. -/ def Rect.blackCount (R : Rect) : ℕ := (R.cells.filter fun x ↦ ¬ isWhite x).card /-- The 8 × 8 chessboard. -/ def board : Finset (ℕ × ℕ) := Finset.Icc (0, 0) (7, 7) /-- A valid decomposition of the chessboard: a finite set of nonempty rectangles contained in the board, pairwise disjoint, covering the whole board, each having as many white squares as black squares (condition (i)), and such that no two rectangles have the same number of white squares (condition (ii)). -/ def ValidDecomp (T : Finset Rect) : Prop := (∀ R ∈ T, 1 ≤ R.h ∧ 1 ≤ R.w ∧ R.r + R.h ≤ 8 ∧ R.c + R.w ≤ 8) ∧ (∀ R₁ ∈ T, ∀ R₂ ∈ T, R₁ ≠ R₂ → R₁.cells ∩ R₂.cells = ∅) ∧ T.biUnion Rect.cells = board ∧ (∀ R ∈ T, R.whiteCount = R.blackCount) ∧ (T.image Rect.whiteCount).card = T.card instance (T : Finset Rect) : Decidable (ValidDecomp T) := by unfold ValidDecomp infer_instance abbrev solutions : Finset (Finset ℕ) := {{1, 2, 3, 4, 5, 7, 10}, {1, 2, 3, 4, 5, 8, 9}, {1, 2, 3, 4, 6, 7, 9}, {1, 2, 3, 5, 6, 7, 8}} /-- The maximum possible number of white squares. -/ abbrev maxCount : ℕ := 7 theorem imo1974_p4 : (∀ T : Finset Rect, ValidDecomp T → T.card ≤ maxCount ∧ (T.card = maxCount → T.image Rect.whiteCount ∈ solutions)) ∧ ∀ s ∈ solutions, ∃ T : Finset Rect, ValidDecomp T ∧ T.card = maxCount ∧ T.image Rect.whiteCount = s := by sorry end Imo1974P4 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1974, Problem 4", compfiles-Imo1975P5,"Determine, with proof, whether or not one can find $1975$ points on the circumference of a circle with unit radius such that the distance between any two of them is a rational number.","import Mathlib /-! # International Mathematical Olympiad 1975, Problem 5 Determine, with proof, whether or not one can find $1975$ points on the circumference of a circle with unit radius such that the distance between any two of them is a rational number. -/ namespace Imo1975P5 abbrev constructible : Bool := true theorem imo1975_p5 : constructible ↔ ∃ p : Finset Circle, p.card = 1975 ∧ (SetLike.coe p).Pairwise (fun a b => ¬ Irrational (dist a b)) := by sorry end Imo1975P5 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1975, Problem 5", compfiles-Imo1976P5,"n is a positive integer and m = 2n. aᵢⱼ = 0, 1 or -1 for 1 ≤ i ≤ n, 1 ≤ j ≤ m. The m unknowns x₁, x₂, ... , xₘ satisfy the n equations: aᵢ₁x₁ + aᵢ₂x₂ + ... + aᵢₘxₘ = 0, for i = 1, 2, ... , n. Prove that the system has a solution in integers of absolute value at most m, not all zero.","import Mathlib /-! # International Mathematical Olympiad 1976, Problem 5 n is a positive integer and m = 2n. aᵢⱼ = 0, 1 or -1 for 1 ≤ i ≤ n, 1 ≤ j ≤ m. The m unknowns x₁, x₂, ... , xₘ satisfy the n equations: aᵢ₁x₁ + aᵢ₂x₂ + ... + aᵢₘxₘ = 0, for i = 1, 2, ... , n. Prove that the system has a solution in integers of absolute value at most m, not all zero. -/ namespace Imo1976P5 theorem imo1976_p5 (n : ℕ) (hn : 0 < n) (a : Fin n → Fin (2 * n) → ℤ) (ha : ∀ i j, a i j = 0 ∨ a i j = 1 ∨ a i j = -1) : ∃ x : Fin (2 * n) → ℤ, (∀ j, |x j| ≤ 2 * (n : ℤ)) ∧ (∃ j, x j ≠ 0) ∧ ∀ i, ∑ j, a i j * x j = 0 := by sorry end Imo1976P5 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1976, Problem 5", compfiles-Imo1977P2,"In a finite sequence of real numbers the sum of any seven successive terms is negative and the sum of any eleven successive terms is positive. Determine the maximum number of terms in the sequence.","import Mathlib /-! # International Mathematical Olympiad 1977, Problem 2 In a finite sequence of real numbers the sum of any seven successive terms is negative and the sum of any eleven successive terms is positive. Determine the maximum number of terms in the sequence. -/ namespace Imo1977P2 def sum_successive_terms {α : Type} [AddCommMonoid α] {n : ℕ} (s : Fin n → α) (start : Fin n) (count : ℕ) [NeZero count] (h : start+count-1 < n) : α := ∑ i ∈ Finset.Icc start ⟨start+count-1, h⟩, s i abbrev max_num_terms : ℕ := 16 theorem imo1977_p2 : Maximal (λn ↦ ∃ s : Fin n → ℝ, ∀ i0, (∀ h7, sum_successive_terms s i0 7 h7 < 0) ∧ (∀ h11, 0 < sum_successive_terms s i0 11 h11)) max_num_terms := by sorry end Imo1977P2 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1977, Problem 2", compfiles-Imo1978P6,"An international society has its members from six different countries. The list of members has 1978 names, numbered $1, 2, \ldots, 1978$. Prove that there is at least one member whose number is the sum of the numbers of two (not necessarily distinct) members from his own country.","import Mathlib /-! # International Mathematical Olympiad 1978, Problem 6 An international society has its members from six different countries. The list of members has 1978 names, numbered $1, 2, \ldots, 1978$. Prove that there is at least one member whose number is the sum of the numbers of two (not necessarily distinct) members from his own country. -/ namespace Imo1978P6 theorem imo1978_p6 (C : Finset.Icc 1 1978 → Fin 6) : ∃ j i k, C i = C j ∧ C j = C k ∧ i.val + k.val = j.val := by sorry end Imo1978P6 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1978, Problem 6", compfiles-Imo1979P2,"A prism with pentagons $A_1A_2A_3A_4A_5$ and $B_1B_2B_3B_4B_5$ as the top and bottom faces is given. Each side of the two pentagons and each of the 25 segments $A_iB_j$ is colored red or green. Every triangle whose vertices are vertices of the prism and whose sides have all been colored has two sides of a different color. Prove that all 10 sides of the top and bottom faces have the same color.","import Mathlib /-! # International Mathematical Olympiad 1979, Problem 2 A prism with pentagons $A_1A_2A_3A_4A_5$ and $B_1B_2B_3B_4B_5$ as the top and bottom faces is given. Each side of the two pentagons and each of the 25 segments $A_iB_j$ is colored red or green. Every triangle whose vertices are vertices of the prism and whose sides have all been colored has two sides of a different color. Prove that all 10 sides of the top and bottom faces have the same color. -/ namespace Imo1979P2 theorem imo1979_p2 (a b : Fin 5 → Bool) (c : Fin 5 → Fin 5 → Bool) (ha : ∀ i j : Fin 5, ¬ (a i = c i j ∧ c i j = c (i + 1) j)) (hb : ∀ i j : Fin 5, ¬ (b j = c i j ∧ c i j = c i (j + 1))) : ∃ col : Bool, (∀ i : Fin 5, a i = col) ∧ (∀ i : Fin 5, b i = col) := by sorry end Imo1979P2 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1979, Problem 2", compfiles-Imo1979P6,"Let $A$ and $E$ be opposite vertices of an octagon. A frog starts at vertex $A.$ From any vertex except $E$ it jumps to one of the two adjacent vertices. When it reaches $E$ it stops. Let $a_n$ be the number of distinct paths of exactly $n$ jumps ending at $E$. Prove that: \[a_{2n-1}=0, \quad a_{2n}={(2+\sqrt2)^{n-1} - (2-\sqrt2)^{n-1} \over\sqrt2}.\]","import Mathlib /-! # International Mathematical Olympiad 1979, Problem 6 Let $A$ and $E$ be opposite vertices of an octagon. A frog starts at vertex $A.$ From any vertex except $E$ it jumps to one of the two adjacent vertices. When it reaches $E$ it stops. Let $a_n$ be the number of distinct paths of exactly $n$ jumps ending at $E$. Prove that: \[a_{2n-1}=0, \quad a_{2n}={(2+\sqrt2)^{n-1} - (2-\sqrt2)^{n-1} \over\sqrt2}.\] -/ namespace Imo1979P6 open SimpleGraph abbrev Octagon := cycleGraph 8 abbrev A : Fin 8 := 0 abbrev E : Fin 8 := 4 def isTerminalWalk {V : Type} {G : SimpleGraph V} {u v : V} (w : G.Walk u v) := v ∉ w.support.dropLast noncomputable def a (n : ℕ) := Set.ncard {w : Octagon.Walk A E | isTerminalWalk w ∧ w.length = n} theorem imo1979_p6 (n : ℕ) (npos : 0 < n) : a (2*n-1) = 0 ∧ a (2*n) = ((2+√2)^(n-1) - (2-√2)^(n-1)) / √2 := by sorry end Imo1979P6 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1979, Problem 6", compfiles-Imo1981P2,"Let $1 \le r \le n$ and consider all subsets of $r$ elements of the set $\{ 1, 2, \ldots , n \}$. Each of these subsets has a smallest member. Let $F(n,r)$ denote the arithmetic mean of these smallest numbers; prove that \[ F(n,r) = \frac{n+1}{r+1}. \]","import Mathlib namespace Imo1981P2 /-! # International Mathematical Olympiad 1981, Problem 2 Let $1 \le r \le n$ and consider all subsets of $r$ elements of the set $\{ 1, 2, \ldots , n \}$. Each of these subsets has a smallest member. Let $F(n,r)$ denote the arithmetic mean of these smallest numbers; prove that \[ F(n,r) = \frac{n+1}{r+1}. \] -/ open Finset variable (n r : ℕ) def arith_mean (ms : Multiset ℕ) : ℚ := ms.sum / ms.card def F : ℚ := arith_mean <| ((Icc 1 n).powersetCard r).val.map (fun s => s.min.getD 0) theorem imo1981_p2 (rpos : 1 ≤ r) (hrn : r ≤ n) : F n r = (n+1)/(r+1) := by sorry end Imo1981P2 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1981, Problem 2", compfiles-Imo1983P5,"Is it possible to choose $1983$ distinct positive integers, all less than or equal to $10^5$, no three of which are consecutive terms of an arithmetic progression? Justify your answer.","import Mathlib /-! # International Mathematical Olympiad 1983, Problem 5 Is it possible to choose $1983$ distinct positive integers, all less than or equal to $10^5$, no three of which are consecutive terms of an arithmetic progression? Justify your answer. -/ namespace Imo1983P5 theorem imo1983_p5 : ∃ S : Finset ℕ+, S.card = 1983 ∧ (∀ x ∈ S, x ≤ 10^5) ∧ ∀ x ∈ S, ∀ y ∈ S, ∀ z ∈ S, x < y ∧ y < z → x + z ≠ 2 * y := by sorry end Imo1983P5 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1983, Problem 5", compfiles-Imo1984P3,"In the plane two different points O and A are given. For each point X of the plane, other than O, denote by a(X) the measure of the angle between OA and OX in radians, counterclockwise from OA (0 ≤ a(X) < 2π). Let C(X) be the circle with center O and radius of length OX + a(X)/OX. Each point of the plane is colored by one of a finite number of colors. Prove that there exists a point Y for which a(Y) > 0 such that its color appears on the circumference of the circle C(Y).","import Mathlib /-! # International Mathematical Olympiad 1984, Problem 3 In the plane two different points O and A are given. For each point X of the plane, other than O, denote by a(X) the measure of the angle between OA and OX in radians, counterclockwise from OA (0 ≤ a(X) < 2π). Let C(X) be the circle with center O and radius of length OX + a(X)/OX. Each point of the plane is colored by one of a finite number of colors. Prove that there exists a point Y for which a(Y) > 0 such that its color appears on the circumference of the circle C(Y). -/ namespace Imo1984P3 /-- The angle `a(X)` from the problem statement: the measure in radians, counterclockwise from `OA`, of the angle between `OA` and `OX`, taking values in `[0, 2 * π)`. (The problem only uses this for `X ≠ O`; we define it for all `X`.) -/ noncomputable def aang (O A X : ℂ) : ℝ := if 0 ≤ Complex.arg ((X - O) / (A - O)) then Complex.arg ((X - O) / (A - O)) else Complex.arg ((X - O) / (A - O)) + 2 * Real.pi theorem imo1984_p3 {ι : Type*} [Fintype ι] (O A : ℂ) (hOA : O ≠ A) (color : ℂ → ι) : ∃ Y : ℂ, Y ≠ O ∧ 0 < aang O A Y ∧ ∃ Z : ℂ, ‖Z - O‖ = ‖Y - O‖ + aang O A Y / ‖Y - O‖ ∧ color Z = color Y := by sorry end Imo1984P3 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1984, Problem 3", compfiles-Imo1985P2,"Fix a natural number $n ≥ 3$ and define $N=\{1, 2, 3, \dots, n-1\}$. Fix another natural number $j ∈ N$ coprime to $n$. Each number in $N$ is now colored with one of two colors, say red or black, so that: 1. $i$ and $n-i$ always receive the same color, and 2. $i$ and $|j-i|$ receive the same color for all $i ∈ N, i ≠ j$. Prove that all numbers in $N$ must receive the same color.","import Mathlib /-! # International Mathematical Olympiad 1985, Problem 2 Fix a natural number $n ≥ 3$ and define $N=\{1, 2, 3, \dots, n-1\}$. Fix another natural number $j ∈ N$ coprime to $n$. Each number in $N$ is now colored with one of two colors, say red or black, so that: 1. $i$ and $n-i$ always receive the same color, and 2. $i$ and $|j-i|$ receive the same color for all $i ∈ N, i ≠ j$. Prove that all numbers in $N$ must receive the same color. -/ namespace Imo1985P2 /-- The conditions on the problem's coloring `C`. Although its domain is all of `ℕ`, we only care about its values in `Set.Ico 1 n`. -/ def Condition (n j : ℕ) (C : ℕ → Fin 2) : Prop := (∀ i ∈ Set.Ico 1 n, C i = C (n - i)) ∧ ∀ i ∈ Set.Ico 1 n, i ≠ j → C i = C (j - i : ℤ).natAbs theorem imo1985_p2 {n j : ℕ} (hn : 3 ≤ n) (hj : j ∈ Set.Ico 1 n) (cpj : Nat.Coprime n j) {C : ℕ → Fin 2} (hC : Condition n j C) {i : ℕ} (hi : i ∈ Set.Ico 1 n) : C i = C j := by sorry end Imo1985P2 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1985, Problem 2", compfiles-Imo1986P3,"To each vertex of a regular pentagon, an integer is assigned, in such a way that the sum of all five numbers is positive. If three consecutive vertices are assigned the numbers $x, y, z$ respectively and $y < 0$, then the following operation is allowed: $x, y, z$ are replaced by $x+y, -y, z+y$ respectively. Such an operation is performed repeatedly as long as at least one of the five numbers is negative. Determine whether this procedure necessarily comes to an end after a finite number of steps.","import Mathlib /-! # International Mathematical Olympiad 1986, Problem 3 To each vertex of a regular pentagon, an integer is assigned, in such a way that the sum of all five numbers is positive. If three consecutive vertices are assigned the numbers $x, y, z$ respectively and $y < 0$, then the following operation is allowed: $x, y, z$ are replaced by $x+y, -y, z+y$ respectively. Such an operation is performed repeatedly as long as at least one of the five numbers is negative. Determine whether this procedure necessarily comes to an end after a finite number of steps. -/ namespace Imo1986P3 open BigOperators /-- State of the pentagon: an integer assigned to each vertex. -/ def State := Fin 5 → ℤ /-- The sum of all integers on the pentagon. -/ def State.sum (s : State) : ℤ := ∑ i : Fin 5, s i /-- The operation performed at vertex `i` when `s i < 0`. -/ def move (s : State) (i : Fin 5) : State := fun j => if j == i - 1 then s (i - 1) + s i else if j == i then -s i else if j == i + 1 then s (i + 1) + s i else s j /-- The transition relation `Step next current` asserts that `next` is obtained from `current` by applying the move operation at some vertex `i` where `s i < 0`. The order of arguments `(next current)` is chosen to match the convention of `Acc`. -/ def Step (next current : State) : Prop := ∃ i : Fin 5, current i < 0 ∧ next = move current i abbrev terminates : Bool := true theorem imo1986_p3 (s₀ : State) (h_sum : 0 < s₀.sum) : if terminates then Acc Step s₀ else ¬ Acc Step s₀ := by sorry end Imo1986P3 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1986, Problem 3", compfiles-Imo1986P6,"Given a finite set of points in the plane, each with integer coordinates, is it always possible to color the points red or white so that for any straight line L parallel to one of the coordinate axes the difference (in absolute value) between the numbers of white and red points on L is not greater than 1?","import Mathlib /-! # International Mathematical Olympiad 1986, Problem 6 Given a finite set of points in the plane, each with integer coordinates, is it always possible to color the points red or white so that for any straight line L parallel to one of the coordinate axes the difference (in absolute value) between the numbers of white and red points on L is not greater than 1? -/ namespace Imo1986P6 open Finset abbrev does_exist : Bool := true /-- **IMO 1986, Problem 6.** Given a finite set `S` of points in the plane with integer coordinates, the points can be colored red or white so that on every line parallel to one of the coordinate axes the numbers of white and red points differ by at most one. We encode the coloring by a sign function `ε : ℤ × ℤ → ℤ` with values in `{1, -1}` (`1` = white, `-1` = red); the sum of `ε` over the points of `S` on a line is then exactly the difference between the numbers of white and red points on that line. -/ theorem imo1986_p6 (S : Finset (ℤ × ℤ)) : if does_exist then ∃ ε : ℤ × ℤ → ℤ, (∀ p ∈ S, ε p = 1 ∨ ε p = -1) ∧ (∀ x : ℤ, |∑ p ∈ S.filter (fun p => p.1 = x), ε p| ≤ 1) ∧ (∀ y : ℤ, |∑ p ∈ S.filter (fun p => p.2 = y), ε p| ≤ 1) else ¬ ∃ ε : ℤ × ℤ → ℤ, (∀ p ∈ S, ε p = 1 ∨ ε p = -1) ∧ (∀ x : ℤ, |∑ p ∈ S.filter (fun p => p.1 = x), ε p| ≤ 1) ∧ (∀ y : ℤ, |∑ p ∈ S.filter (fun p => p.2 = y), ε p| ≤ 1) := by sorry end Imo1986P6 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1986, Problem 6", compfiles-Imo1987P1,"Let $p_{n, k}$ be the number of permutations of a set of cardinality `n ≥ 1` that fix exactly `k` elements. Prove that $∑_{k=0}^n k p_{n,k}=n!$.","import Mathlib /-! # International Mathematical Olympiad 1987, Problem 1 Let $p_{n, k}$ be the number of permutations of a set of cardinality `n ≥ 1` that fix exactly `k` elements. Prove that $∑_{k=0}^n k p_{n,k}=n!$. -/ namespace Imo1987P1 /-- Given `α : Type*` and `k : ℕ`, `fiber α k` is the set of permutations of `α` with exactly `k` fixed points. -/ def fiber (α : Type*) [Fintype α] [DecidableEq α] (k : ℕ) : Set (Equiv.Perm α) := {σ : Equiv.Perm α | Fintype.card (Function.fixedPoints σ) = k} instance {k : ℕ} (α : Type*) [Fintype α] [DecidableEq α] : Fintype (fiber α k) := by unfold fiber; infer_instance /-- `p α k` is the number of permutations of `α` with exactly `k` fixed points. -/ def p (α : Type*) [Fintype α] [DecidableEq α] (k : ℕ) : ℕ := Fintype.card (fiber α k) open scoped Nat theorem imo1987_p1 {n : ℕ} (hn : 1 ≤ n) : ∑ k ∈ Finset.range (n + 1), k * p (Fin n) k = n ! := by sorry end Imo1987P1 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1987, Problem 1", compfiles-Imo1988P2,"Let n be a positive integer and let A₁, A₂, ..., A₂ₙ₊₁ be subsets of a set B. Suppose that (i) each Aᵢ has exactly 2n elements, (ii) each intersection Aᵢ ∩ Aⱼ (i ≠ j) contains exactly one element, and (iii) every element of B belongs to at least two of the Aᵢ. For which values of n can one assign to every element of B one of the numbers 0 and 1 in such a way that each Aᵢ has exactly n elements assigned 0?","import Mathlib /-! # International Mathematical Olympiad 1988, Problem 2 Let n be a positive integer and let A₁, A₂, ..., A₂ₙ₊₁ be subsets of a set B. Suppose that (i) each Aᵢ has exactly 2n elements, (ii) each intersection Aᵢ ∩ Aⱼ (i ≠ j) contains exactly one element, and (iii) every element of B belongs to at least two of the Aᵢ. For which values of n can one assign to every element of B one of the numbers 0 and 1 in such a way that each Aᵢ has exactly n elements assigned 0? -/ namespace Imo1988P2 abbrev SolutionSet : Set ℕ := {n | 0 < n ∧ Even n} theorem imo1988_p2 (n : ℕ) : n ∈ SolutionSet ↔ (0 < n ∧ ∀ (B : Type) [DecidableEq B] (A : Fin (2 * n + 1) → Finset B), (∀ i, (A i).card = 2 * n) → (∀ i j, i ≠ j → (A i ∩ A j).card = 1) → (∀ b : B, 2 ≤ (Finset.univ.filter (fun i ↦ b ∈ A i)).card) → ∃ f : B → Fin 2, ∀ i, ((A i).filter (fun b ↦ f b = 0)).card = n) := by sorry end Imo1988P2 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1988, Problem 2", compfiles-Imo1989P1,"Prove that the integers from 1 to 1989 can be partitioned in 117 sets of 17 elements each, all with the same sum of elements.","import Mathlib /-! # International Mathematical Olympiad 1989, Problem 1 Prove that the integers from 1 to 1989 can be partitioned in 117 sets of 17 elements each, all with the same sum of elements. -/ namespace Imo1989P1 abbrev S := Finset.Icc 1 1989 theorem imo1989_p1 : ∃ (P : Finpartition S), P.parts.card = 117 ∧ (∀ p ∈ P.parts, p.card = 17) ∧ (∀ p ∈ P.parts, ∀ q ∈ P.parts, p.sum id = q.sum id) := by sorry end Imo1989P1 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1989, Problem 1", compfiles-Imo1989P3,"Let $n$ and $k$ be positive integers and let $S$ be a set of $n$ points in the plane such that (i) no three points of $S$ are collinear, and (ii) for each point $P$ of $S$ there are at least $k$ points of $S$ equidistant from $P$. Prove that $k < \frac{1}{2} + \sqrt{2n}$.","import Mathlib /-! # International Mathematical Olympiad 1989, Problem 3 Let $n$ and $k$ be positive integers and let $S$ be a set of $n$ points in the plane such that (i) no three points of $S$ are collinear, and (ii) for each point $P$ of $S$ there are at least $k$ points of $S$ equidistant from $P$. Prove that $k < \frac{1}{2} + \sqrt{2n}$. -/ namespace Imo1989P3 abbrev Pt := EuclideanSpace ℝ (Fin 2) theorem imo1989_p3 (n k : ℕ) (hn : 0 < n) (hk : 0 < k) (S : Finset Pt) (hcard : S.card = n) (hcol : ∀ p₁ ∈ S, ∀ p₂ ∈ S, ∀ p₃ ∈ S, p₁ ≠ p₂ → p₁ ≠ p₃ → p₂ ≠ p₃ → ¬ Collinear ℝ {p₁, p₂, p₃}) (hequi : ∀ P ∈ S, ∃ (r : ℝ) (T : Finset Pt), T ⊆ S ∧ k ≤ T.card ∧ ∀ Q ∈ T, dist P Q = r) : (k : ℝ) < 1 / 2 + Real.sqrt (2 * n) := by sorry end Imo1989P3 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1989, Problem 3", compfiles-Imo1990P2,"Take n ≥ 3 and consider a set E of 2n - 1 distinct points on a circle. Suppose that exactly k of these points are to be colored black. Such a coloring is said to be ""good"" if there is at least one pair of black points such that the interior of one of the arcs between them contains exactly n points from E. Find the smallest value of k so that every such coloring of k points of E is good.","import Mathlib /-! # International Mathematical Olympiad 1990, Problem 2 Take n ≥ 3 and consider a set E of 2n - 1 distinct points on a circle. Suppose that exactly k of these points are to be colored black. Such a coloring is said to be ""good"" if there is at least one pair of black points such that the interior of one of the arcs between them contains exactly n points from E. Find the smallest value of k so that every such coloring of k points of E is good. -/ namespace Imo1990P2 abbrev solution (n : ℕ) : ℕ := if n % 3 = 2 then n - 1 else n /-- Label the points by `ZMod (2 * n - 1)`. A set `B` of black points is *good* if it contains two points `x` and `y` with `y - x = n + 1` or `x - y = n + 1`, which is exactly the condition that one of the two arcs between them contains `n` points of `E` in its interior. -/ def IsGood (n : ℕ) (B : Finset (ZMod (2 * n - 1))) : Prop := ∃ x ∈ B, ∃ y ∈ B, y - x = ((n + 1 : ℕ) : ZMod (2 * n - 1)) ∨ x - y = ((n + 1 : ℕ) : ZMod (2 * n - 1)) theorem imo1990_p2 (n : ℕ) (hn : 3 ≤ n) : IsLeast {k : ℕ | ∀ B : Finset (ZMod (2 * n - 1)), B.card = k → IsGood n B} (solution n) := by sorry end Imo1990P2 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1990, Problem 2", compfiles-Imo1990P5,"Given an initial integer n₀ > 1, two players A and B choose integers n₁, n₂, n₃, ... alternately according to the following rules: Knowing n₂ₖ, A chooses any integer n₂ₖ₊₁ such that n₂ₖ ≤ n₂ₖ₊₁ ≤ n₂ₖ². Knowing n₂ₖ₊₁, B chooses any integer n₂ₖ₊₂ such that n₂ₖ₊₁/n₂ₖ₊₂ = p^r for some prime p and integer r ≥ 1. Player A wins the game by choosing the number 1990; player B wins by choosing the number 1. For which n₀ does (a) A have a winning strategy? (b) B have a winning strategy? (c) neither player have a winning strategy? ## Formalization notes The proof follows a solution sketch after kalva.","import Mathlib /-! # International Mathematical Olympiad 1990, Problem 5 Given an initial integer n₀ > 1, two players A and B choose integers n₁, n₂, n₃, ... alternately according to the following rules: Knowing n₂ₖ, A chooses any integer n₂ₖ₊₁ such that n₂ₖ ≤ n₂ₖ₊₁ ≤ n₂ₖ². Knowing n₂ₖ₊₁, B chooses any integer n₂ₖ₊₂ such that n₂ₖ₊₁/n₂ₖ₊₂ = p^r for some prime p and integer r ≥ 1. Player A wins the game by choosing the number 1990; player B wins by choosing the number 1. For which n₀ does (a) A have a winning strategy? (b) B have a winning strategy? (c) neither player have a winning strategy? ## Formalization notes The proof follows a solution sketch after kalva. -/ namespace Imo1990P5 /-- A legal move of player A: from the number `n` just chosen by B (or the initial number `n₀`), A may choose any `m` with `n ≤ m ≤ n ^ 2` (A wins by choosing 1990). -/ @[reducible] def AMove (n m : ℕ) : Prop := n ≤ m ∧ m ≤ n ^ 2 /-- A legal move of player B: from the number `m` just chosen by A, B may choose any `m'` such that `m / m'` is a prime power `p ^ r` with `r ≥ 1` (B wins by choosing 1). -/ @[reducible] def BMove (m m' : ℕ) : Prop := ∃ p r : ℕ, p.Prime ∧ 0 < r ∧ m = m' * p ^ r /-- `AWins n`: it is A's turn and the current number is `n` (the initial position has `n = n₀`), and A has a winning strategy. A either wins immediately by choosing 1990 (a legal move from `n`), or chooses a legal move `m` from which B cannot win (B wins by choosing 1) and such that every legal answer of B is again a winning position for A. -/ inductive AWins : ℕ → Prop | win (n : ℕ) (h : AMove n 1990) : AWins n | move (n m : ℕ) (h₁ : AMove n m) (h₂ : ¬ BMove m 1) (h₃ : ∀ m', BMove m m' → AWins m') : AWins n /-- `BWins m`: it is B's turn and the current number is `m`, and B has a winning strategy. B either wins immediately by choosing 1, or chooses a legal move `m' ≠ 1` from which A cannot win (A wins by choosing 1990) and such that every legal answer of A is again a winning position for B. -/ inductive BWins : ℕ → Prop | one (m : ℕ) (h : BMove m 1) : BWins m | move (m m' : ℕ) (h : BMove m m') (h₁ : m' ≠ 1) (h₂ : ∀ m'', AMove m' m'' → m'' ≠ 1990) (h₃ : ∀ m'', AMove m' m'' → BWins m'') : BWins m /-- `BWinsStart n`: B has a winning strategy from the initial position with `n₀ = n` (it is A's turn): whatever legal first move `m` A makes, it is not 1990 and B wins from `m`. -/ def BWinsStart (n : ℕ) : Prop := ∀ m, AMove n m → m ≠ 1990 ∧ BWins m abbrev aWinsSet : Set ℕ := {n | 8 ≤ n} abbrev bWinsSet : Finset ℕ := {2, 3, 4, 5} abbrev drawSet : Finset ℕ := {6, 7} theorem imo1990_p5 (n : ℕ) (hn : 2 ≤ n) : (AWins n ↔ n ∈ aWinsSet) ∧ (BWinsStart n ↔ n ∈ bWinsSet) ∧ ((¬ AWins n ∧ ¬ BWinsStart n) ↔ n ∈ drawSet) := by sorry end Imo1990P5 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1990, Problem 5", compfiles-Imo1991P3,"Let S = {1, 2, ..., 280}. Find the smallest natural number n such that every n-element subset of S contains five numbers which are pairwise relatively prime.","import Mathlib /-! # International Mathematical Olympiad 1991, Problem 3 Let S = {1, 2, ..., 280}. Find the smallest natural number n such that every n-element subset of S contains five numbers which are pairwise relatively prime. -/ namespace Imo1991P3 abbrev solution : ℕ := 217 theorem imo1991_p3 : IsLeast {n : ℕ | ∀ T ⊆ Finset.Icc 1 280, T.card = n → ∃ U ⊆ T, U.card = 5 ∧ (U : Set ℕ).Pairwise Nat.Coprime} solution := by sorry end Imo1991P3 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1991, Problem 3", compfiles-Imo1991P4,"Suppose G is a connected graph with k edges. Prove that it is possible to label the edges 1, 2, ... , k in such a way that at each vertex which belongs to two or more edges, the greatest common divisor of the integers labeling those edges is equal to 1.","import Mathlib /-! # International Mathematical Olympiad 1991, Problem 4 Suppose G is a connected graph with k edges. Prove that it is possible to label the edges 1, 2, ... , k in such a way that at each vertex which belongs to two or more edges, the greatest common divisor of the integers labeling those edges is equal to 1. -/ namespace Imo1991P4 open SimpleGraph Finset variable {V : Type*} [Fintype V] [DecidableEq V] {G : SimpleGraph V} [DecidableRel G.Adj] theorem imo1991_p4 {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] (hG : G.Connected) : ∃ Φ : G.edgeSet → ℕ, (∀ e : G.edgeSet, 1 ≤ Φ e ∧ Φ e ≤ Fintype.card G.edgeSet) ∧ (Function.Injective Φ) ∧ (∀ v : V, 2 ≤ G.degree v → ((G.incidenceFinset v).attach.gcd fun ⟨x, h⟩ => Φ ⟨x, mem_edgeFinset.mp <| incidenceFinset_subset G v h⟩) = 1) := by sorry end Imo1991P4 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1991, Problem 4", compfiles-Imo1992P3,"Consider 9 points in space, no 4 coplanar. Each pair of points is joined by a line segment which is colored either blue or red or left uncolored. Find the smallest value of n such that whenever exactly n edges are colored, the set of colored edges necessarily contains a triangle all of whose edges have the same color.","import Mathlib /-! # International Mathematical Olympiad 1992, Problem 3 Consider 9 points in space, no 4 coplanar. Each pair of points is joined by a line segment which is colored either blue or red or left uncolored. Find the smallest value of n such that whenever exactly n edges are colored, the set of colored edges necessarily contains a triangle all of whose edges have the same color. -/ namespace Imo1992P3 /-- An edge coloring of the complete graph on 9 vertices by two colors (encoded as `Fin 2`), where some edges may be left uncolored (`none`). The vertices are indexed by `Fin 9` and the edges by unordered pairs `Sym2 (Fin 9)`; the geometric hypotheses of the problem (9 points in space, no 4 of them coplanar) only serve to guarantee that every pair of points determines an edge, so the problem is purely combinatorial. -/ structure EdgeColoring where /-- the color assigned to the edge joining two vertices -/ color : Sym2 (Fin 9) → Option (Fin 2) /-- there is no edge from a vertex to itself -/ diag : ∀ i : Fin 9, color s(i, i) = none /-- The colored edges of an edge coloring, represented as the set of edges that received a color. (Diagonal ""edges"" `s(i, i)` are never colored, so this is exactly the set of colored segments joining two distinct points.) -/ def EdgeColoring.coloredEdges (c : EdgeColoring) : Finset (Sym2 (Fin 9)) := Finset.filter (fun e => (c.color e).isSome) Finset.univ /-- The uncolored edges of an edge coloring, represented as the set of non-diagonal edges that were left uncolored. -/ def EdgeColoring.uncoloredEdges (c : EdgeColoring) : Finset (Sym2 (Fin 9)) := Finset.filter (fun e => c.color e = none ∧ ¬ e.IsDiag) Finset.univ /-- A coloring has a monochromatic triangle if there are three distinct vertices whose three connecting edges all have the same color. -/ def EdgeColoring.HasMonoTriangle (c : EdgeColoring) : Prop := ∃ i j k : Fin 9, i ≠ j ∧ j ≠ k ∧ k ≠ i ∧ ∃ b : Fin 2, c.color s(i, j) = some b ∧ c.color s(j, k) = some b ∧ c.color s(k, i) = some b abbrev answer : ℕ := 33 theorem imo1992_p3 : IsLeast {n : ℕ | ∀ c : EdgeColoring, c.coloredEdges.card = n → c.HasMonoTriangle} answer := by sorry end Imo1992P3 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1992, Problem 3", compfiles-Imo1992P5,"Let S be a finite set of points in three-dimensional space. Let Sx,Sy and Sz be the sets consisting of the orthogonal projections of the points of S onto the yz-plane, zx-plane and xy-plane, respectively. Prove that |S|²≤|Sx|·|Sy|·|Sz|. where |A| denotes the number of elements in the finite set |A|. (Note: The orthogonal projection of a point onto a plane is the foot of the perpendicular from the point to the plane.)","import Mathlib /-! # International Mathematical Olympiad 1992, Problem 5 Let S be a finite set of points in three-dimensional space. Let Sx,Sy and Sz be the sets consisting of the orthogonal projections of the points of S onto the yz-plane, zx-plane and xy-plane, respectively. Prove that |S|²≤|Sx|·|Sy|·|Sz|. where |A| denotes the number of elements in the finite set |A|. (Note: The orthogonal projection of a point onto a plane is the foot of the perpendicular from the point to the plane.) -/ namespace Imo1992P5 theorem imo1992_p5 (S: Finset (ℝ × ℝ × ℝ)) : S.card^2 ≤ (Finset.image (fun p => ((0: ℝ) , p.2.1, p.2.2)) S).card * (Finset.image (fun p => (p.1, ((0: ℝ) , p.2.2))) S).card * (Finset.image (fun p => (p.1, p.2.1, (0: ℝ) )) S).card := by sorry end Imo1992P5 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1992, Problem 5", compfiles-Imo1993P3,"On an infinite chessboard a game is played as follows. At the start n² pieces are arranged in an n × n block of adjoining squares, one piece on each square. A move in the game is a jump in a horizontal or vertical direction over an adjacent occupied square to an unoccupied square immediately beyond. The piece which has been jumped over is removed. Find those values of n for which the game can end with only one piece remaining on the board.","import Mathlib /-! # International Mathematical Olympiad 1993, Problem 3 On an infinite chessboard a game is played as follows. At the start n² pieces are arranged in an n × n block of adjoining squares, one piece on each square. A move in the game is a jump in a horizontal or vertical direction over an adjacent occupied square to an unoccupied square immediately beyond. The piece which has been jumped over is removed. Find those values of n for which the game can end with only one piece remaining on the board. -/ namespace Imo1993P3 open Finset /-- The four unit directions in which a jump is allowed. -/ abbrev dirs : Finset (ℤ × ℤ) := {(1, 0), (-1, 0), (0, 1), (0, -1)} /-- The initial position: an n × n block of occupied squares. -/ noncomputable def initPos (n : ℕ) : Finset (ℤ × ℤ) := Ico 0 (n : ℤ) ×ˢ Ico 0 (n : ℤ) lemma mem_initPos {n : ℕ} {c : ℤ × ℤ} : c ∈ initPos n ↔ 0 ≤ c.1 ∧ c.1 < (n : ℤ) ∧ 0 ≤ c.2 ∧ c.2 < (n : ℤ) := by simp [initPos, Finset.mem_product, Finset.mem_Ico] lia /-- A single move: the piece at `c` jumps over the adjacent piece at `c + d` onto the empty square `c + d + d`; the jumped-over piece is removed. -/ def IsMove (s s' : Finset (ℤ × ℤ)) : Prop := ∃ c : ℤ × ℤ, ∃ d : dirs, c ∈ s ∧ c + d ∈ s ∧ c + d + d ∉ s ∧ s' = insert (c + d + d) ((s.erase c).erase (c + d)) /-- The game is solvable for `n` if the n × n block can be reduced to a single piece, i.e. a one-piece position is reachable from the initial position by a sequence of moves. -/ def Solvable (n : ℕ) : Prop := ∃ c : ℤ × ℤ, Relation.ReflTransGen IsMove (initPos n) {c} abbrev SolutionSet : Set ℕ := {n | 0 < n ∧ ¬ 3 ∣ n} -- snip begin /-! ## The parity invariant (impossibility for `3 ∣ n`) -/ /-- Weight functions on the exponents: cells with `(i + j) % 3 = r` get weight `1` for the two classes in question and `0` for the remaining one. -/ def g1 (k : ℤ) : ZMod 2 := if k % 3 = 2 then 0 else 1 def g2 (k : ℤ) : ZMod 2 := if k % 3 = 0 then 0 else 1 /-- The total weight of a position. -/ def Wt (g : ℤ → ZMod 2) (s : Finset (ℤ × ℤ)) : ZMod 2 := ∑ c ∈ s, g (c.1 + c.2) lemma g1_sum3 (t : ℤ) : g1 t + g1 (t + 1) + g1 (t + 2) = 0 := by have e1 : (t + 1) % 3 = (t % 3 + 1) % 3 := by lia have e2 : (t + 2) % 3 = (t % 3 + 2) % 3 := by lia have h : t % 3 = 0 ∨ t % 3 = 1 ∨ t % 3 = 2 := by lia rcases h with h | h | h <;> simp only [g1, h, e1, e2] <;> norm_num <;> decide lemma g2_sum3 (t : ℤ) : g2 t + g2 (t + 1) + g2 (t + 2) = 0 := by have e1 : (t + 1) % 3 = (t % 3 + 1) % 3 := by lia have e2 : (t + 2) % 3 = (t % 3 + 2) % 3 := by lia have h : t % 3 = 0 ∨ t % 3 = 1 ∨ t % 3 = 2 := by lia rcases h with h | h | h <;> simp only [g2, h, e1, e2] <;> norm_num <;> decide /-- A move changes the weight by `g x + g (x+δ) + g (x+2δ) = 0`. -/ lemma Wt_move {g : ℤ → ZMod 2} (hg : ∀ t : ℤ, g t + g (t + 1) + g (t + 2) = 0) {s s' : Finset (ℤ × ℤ)} (h : IsMove s s') : Wt g s' = Wt g s := by obtain ⟨⟨c1, c2⟩, ⟨⟨d1, d2⟩, hd⟩, hc, hcd, hn, rfl⟩ := h simp only [Prod.mk_add_mk] at hc hcd hn ⊢ have hδ : d1 + d2 = 1 ∨ d1 + d2 = -1 := by simp only [dirs, Finset.mem_insert, Finset.mem_singleton, Prod.mk.injEq] at hd rcases hd with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ <;> norm_num have hne1 : ((c1 + d1, c2 + d2) : ℤ × ℤ) ≠ ((c1, c2) : ℤ × ℤ) := by intro h injection h with h1 h2 lia have hm2 : ((c1 + d1, c2 + d2) : ℤ × ℤ) ∈ s.erase ((c1, c2) : ℤ × ℤ) := Finset.mem_erase.mpr ⟨hne1, hcd⟩ have hnm : ((c1 + d1 + d1, c2 + d2 + d2) : ℤ × ℤ) ∉ (s.erase ((c1, c2) : ℤ × ℤ)).erase ((c1 + d1, c2 + d2) : ℤ × ℤ) := fun hh => hn (Finset.mem_of_mem_erase (Finset.mem_of_mem_erase hh)) have e1 := Finset.sum_erase_add _ (fun c : ℤ × ℤ => g (c.1 + c.2)) hc have e2 := Finset.sum_erase_add _ (fun c : ℤ × ℤ => g (c.1 + c.2)) hm2 simp only [Wt] rw [Finset.sum_insert hnm, ← e1, ← e2, add_comm, add_assoc _ (g _), add_left_cancel_iff] rw [← sub_eq_iff_eq_add', ← sub_eq_zero, CharTwo.sub_eq_add, CharTwo.sub_eq_add] rw [add_add_add_comm c1, show c1 + d1 + d1 + (c2 + d2 + d2) = (c1 + c2) + 2 * (d1 + d2) by ring] rcases hδ with h | h · rw [h, mul_one] linear_combination hg (c1 + c2) · have hgg := hg ((c1 + c2) - 2) rw [Int.sub_add_cancel] at hgg rw [h, mul_neg_one, Int.add_neg_eq_sub, show (c1 + c2) + -1 = (c1 + c2) - 2 + 1 by ring] linear_combination hgg lemma Wt_reachable {g : ℤ → ZMod 2} (hg : ∀ t : ℤ, g t + g (t + 1) + g (t + 2) = 0) {s t : Finset (ℤ × ℤ)} (h : Relation.ReflTransGen IsMove s t) : Wt g s = Wt g t := by induction h with | refl => rfl | tail _ hm ih => exact ih.trans (Wt_move hg hm).symm /-- The sum of a period-3 weight with zero triple-sum over `3m` consecutive integers is zero. -/ lemma gsum_interval {g : ℤ → ZMod 2} (hg : ∀ t : ℤ, g t + g (t + 1) + g (t + 2) = 0) (a : ℤ) (m : ℕ) : ∑ k ∈ Finset.Ico a (a + 3 * (m : ℤ)), g k = 0 := by induction m with | zero => simp | succ m ih => have hcast : (3 : ℤ) * ((m + 1 : ℕ) : ℤ) = 3 * (m : ℤ) + 3 := by push_cast; ring have hsplit : Finset.Ico a (a + 3 * (m : ℤ) + 3) = Finset.Ico a (a + 3 * (m : ℤ)) ∪ Finset.Ico (a + 3 * (m : ℤ)) (a + 3 * (m : ℤ) + 3) := (Finset.Ico_union_Ico_eq_Ico (show a ≤ a + 3 * (m : ℤ) by have := Int.natCast_nonneg m; lia) (show a + 3 * (m : ℤ) ≤ a + 3 * (m : ℤ) + 3 by lia)).symm rw [hcast, ← add_assoc, hsplit, Finset.sum_union ?hdisj, ih, zero_add] · have hset : Finset.Ico (a + 3 * (m : ℤ)) (a + 3 * (m : ℤ) + 3) = {a + 3 * (m : ℤ), a + 3 * (m : ℤ) + 1, a + 3 * (m : ℤ) + 2} := by ext x simp only [Finset.mem_Ico, Finset.mem_insert, Finset.mem_singleton] lia rw [hset, Finset.sum_insert (by simp only [Finset.mem_insert, Finset.mem_singleton]; lia), Finset.sum_insert (by simp only [Finset.mem_singleton]; lia), Finset.sum_singleton, ← add_assoc] exact hg _ · exact Finset.Ico_disjoint_Ico_consecutive _ _ _ /-- The weight of the initial `3m × 3m` block is zero. -/ lemma Wt_init {g : ℤ → ZMod 2} (hg : ∀ t : ℤ, g t + g (t + 1) + g (t + 2) = 0) (m : ℕ) : Wt g (initPos (3 * m)) = 0 := by have hN : ((3 * m : ℕ) : ℤ) = 3 * (m : ℤ) := by push_cast; ring simp only [Wt, initPos, hN] rw [Finset.sum_product] apply Finset.sum_eq_zero intro i _ show ∑ j ∈ Finset.Ico 0 (3 * (m : ℤ)), g (i + j) = 0 rw [Finset.sum_Ico_add, show (0 : ℤ) + i = i by ring, show 3 * (m : ℤ) + i = i + 3 * (m : ℤ) by ring] exact gsum_interval hg i m /-- If `3 ∣ n` the game cannot end with one piece: the two weights of the initial block are `(0, 0)`, but the weights of a single piece are never `(0, 0)`. -/ lemma not_solvable_of_three_dvd {n : ℕ} (h3 : 3 ∣ n) : ¬ Solvable n := by obtain ⟨m, rfl⟩ := h3 rintro ⟨c, hc⟩ have h1 := Wt_reachable g1_sum3 hc have h2 := Wt_reachable g2_sum3 hc rw [Wt_init g1_sum3 m] at h1 rw [Wt_init g2_sum3 m] at h2 simp only [Wt, Finset.sum_singleton] at h1 h2 have hx : (c.1 + c.2) % 3 = 2 := by simp only [g1] at h1 split_ifs at h1 with hh · exact hh · exact absurd h1.symm (by decide) simp only [g2, hx] at h2 norm_num at h2 /-! ## The purge lemma (three pieces in a line can be removed using a catalyst) -/ /-- Arithmetic facts about two perpendicular unit directions. -/ lemma unit_facts {u w : ℤ × ℤ} (hu : u ∈ dirs) (hw : w ∈ dirs) (hperp : u.1 * w.1 + u.2 * w.2 = 0) : (u.1 ≠ 0 ∨ u.2 ≠ 0) ∧ (w.1 ≠ 0 ∨ w.2 ≠ 0) ∧ ¬ (u.1 = w.1 ∧ u.2 = w.2) ∧ ¬ (u.1 = -w.1 ∧ u.2 = -w.2) ∧ ¬ (u.1 + u.1 = w.1 ∧ u.2 + u.2 = w.2) ∧ ¬ (u.1 + u.1 = -w.1 ∧ u.2 + u.2 = -w.2) := by simp only [dirs, Finset.mem_insert, Finset.mem_singleton] at hu hw rcases hu with rfl | rfl | rfl | rfl <;> rcases hw with rfl | rfl | rfl | rfl <;> simp at hperp ⊢ /-- The key purge: three consecutive pieces `p, p + u, p + u + u` in a line can be removed from the board (everything else unchanged) using a catalyst piece at `p + w` provided the square `p - w` is empty. The sequence is: `p + w` jumps over `p` to `p - w`; `p + u + u` jumps over `p + u` to `p`; `p - w` jumps over `p` to `p + w`. -/ lemma purge {s : Finset (ℤ × ℤ)} {p u w : ℤ × ℤ} (hu : u ∈ dirs) (hw : w ∈ dirs) (hperp : u.1 * w.1 + u.2 * w.2 = 0) (hp : p ∈ s) (hpu : p + u ∈ s) (hp2 : p + u + u ∈ s) (hpw : p + w ∈ s) (hnw : p - w ∉ s) : Relation.ReflTransGen IsMove s (s \ {p, p + u, p + u + u}) := by obtain ⟨f1, f2, f3, f4, f5, f6⟩ := unit_facts hu hw hperp obtain ⟨px, py⟩ := p obtain ⟨ne_pw_p, ne_p_mw, ne_p_pw, ne_u_p, ne_u_pw, ne_uu_p, ne_uu_pw, ne_uu_mw, ne_mw_u, ne_mw_uu, ne_pw_u, ne_pw_uu, ne_pw_mw⟩ : ((px, py) + w ≠ (px, py)) ∧ ((px, py) ≠ (px, py) - w) ∧ ((px, py) ≠ (px, py) + w) ∧ ((px, py) + u ≠ (px, py)) ∧ ((px, py) + u ≠ (px, py) + w) ∧ ((px, py) + u + u ≠ (px, py)) ∧ ((px, py) + u + u ≠ (px, py) + w) ∧ ((px, py) + u + u ≠ (px, py) - w) ∧ ((px, py) - w ≠ (px, py) + u) ∧ ((px, py) - w ≠ (px, py) + u + u) ∧ ((px, py) + w ≠ (px, py) + u) ∧ ((px, py) + w ≠ (px, py) + u + u) ∧ ((px, py) + w ≠ (px, py) - w) := by refine ⟨?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ <;> simp only [ne_eq, Prod.ext_iff, Prod.fst_add, Prod.snd_add, Prod.fst_sub, Prod.snd_sub] <;> lia have m1 : IsMove s (insert ((px, py) - w) ((s.erase ((px, py) + w)).erase (px, py))) := by refine ⟨(px, py) + w, ⟨-w, ?_⟩, hpw, ?_, ?_, ?_⟩ · simp only [dirs, Finset.mem_insert, Finset.mem_singleton] at hw ⊢ rcases hw with rfl | rfl | rfl | rfl <;> simp · show (px, py) + w + -w ∈ s rw [show (px, py) + w + -w = (px, py) by abel] exact hp · show (px, py) + w + -w + -w ∉ s rw [show (px, py) + w + -w + -w = (px, py) - w by abel] exact hnw · show insert ((px, py) - w) ((s.erase ((px, py) + w)).erase (px, py)) = insert ((px, py) + w + -w + -w) ((s.erase ((px, py) + w)).erase ((px, py) + w + -w)) rw [show (px, py) + w + -w + -w = (px, py) - w by abel, show (px, py) + w + -w = (px, py) by abel] have m2 : IsMove (insert ((px, py) - w) ((s.erase ((px, py) + w)).erase (px, py))) (insert (px, py) (((insert ((px, py) - w) ((s.erase ((px, py) + w)).erase (px, py))).erase ((px, py) + u + u)).erase ((px, py) + u))) := by refine ⟨(px, py) + u + u, ⟨-u, ?_⟩, ?_, ?_, ?_, ?_⟩ · simp only [dirs, Finset.mem_insert, Finset.mem_singleton] at hu ⊢ rcases hu with rfl | rfl | rfl | rfl <;> simp · rw [Finset.mem_insert] right rw [Finset.mem_erase, Finset.mem_erase] exact ⟨ne_uu_p, ne_uu_pw, hp2⟩ · show (px, py) + u + u + -u ∈ insert ((px, py) - w) ((s.erase ((px, py) + w)).erase (px, py)) rw [show (px, py) + u + u + -u = (px, py) + u by abel, Finset.mem_insert] right rw [Finset.mem_erase, Finset.mem_erase] exact ⟨ne_u_p, ne_u_pw, hpu⟩ · show (px, py) + u + u + -u + -u ∉ insert ((px, py) - w) ((s.erase ((px, py) + w)).erase (px, py)) rw [show (px, py) + u + u + -u + -u = (px, py) by abel, Finset.mem_insert] intro hh rcases hh with h | h · exact ne_p_mw h · rw [Finset.mem_erase] at h exact h.1 rfl · show insert (px, py) (((insert ((px, py) - w) ((s.erase ((px, py) + w)).erase (px, py))).erase ((px, py) + u + u)).erase ((px, py) + u)) = insert ((px, py) + u + u + -u + -u) (((insert ((px, py) - w) ((s.erase ((px, py) + w)).erase (px, py))).erase ((px, py) + u + u)).erase ((px, py) + u + u + -u)) rw [show (px, py) + u + u + -u + -u = (px, py) by abel, show (px, py) + u + u + -u = (px, py) + u by abel] have m3 : IsMove (insert (px, py) (((insert ((px, py) - w) ((s.erase ((px, py) + w)).erase (px, py))).erase ((px, py) + u + u)).erase ((px, py) + u))) (insert ((px, py) + w) (((insert (px, py) (((insert ((px, py) - w) ((s.erase ((px, py) + w)).erase (px, py))).erase ((px, py) + u + u)).erase ((px, py) + u))).erase ((px, py) - w)).erase (px, py))) := by refine ⟨(px, py) - w, ⟨w, hw⟩, ?_, ?_, ?_, ?_⟩ · rw [Finset.mem_insert] right rw [Finset.mem_erase, Finset.mem_erase] exact ⟨ne_mw_u, ne_mw_uu, by rw [Finset.mem_insert]; left; rfl⟩ · show (px, py) - w + w ∈ insert (px, py) (((insert ((px, py) - w) ((s.erase ((px, py) + w)).erase (px, py))).erase ((px, py) + u + u)).erase ((px, py) + u)) rw [show (px, py) - w + w = (px, py) by abel, Finset.mem_insert] left rfl · show (px, py) - w + w + w ∉ insert (px, py) (((insert ((px, py) - w) ((s.erase ((px, py) + w)).erase (px, py))).erase ((px, py) + u + u)).erase ((px, py) + u)) rw [show (px, py) - w + w + w = (px, py) + w by abel, Finset.mem_insert] intro hh rcases hh with h | h · exact ne_pw_p h rw [Finset.mem_erase, Finset.mem_erase, Finset.mem_insert] at h rcases h with ⟨-, ⟨-, h | h⟩⟩ · exact ne_pw_mw h rw [Finset.mem_erase, Finset.mem_erase] at h exact h.2.1 rfl · show insert ((px, py) + w) (((insert (px, py) (((insert ((px, py) - w) ((s.erase ((px, py) + w)).erase (px, py))).erase ((px, py) + u + u)).erase ((px, py) + u))).erase ((px, py) - w)).erase (px, py)) = insert ((px, py) - w + w + w) (((insert (px, py) (((insert ((px, py) - w) ((s.erase ((px, py) + w)).erase (px, py))).erase ((px, py) + u + u)).erase ((px, py) + u))).erase ((px, py) - w)).erase ((px, py) - w + w)) rw [show (px, py) - w + w + w = (px, py) + w by abel, show (px, py) - w + w = (px, py) by abel] have h123 : Relation.ReflTransGen IsMove s (insert ((px, py) + w) (((insert (px, py) (((insert ((px, py) - w) ((s.erase ((px, py) + w)).erase (px, py))).erase ((px, py) + u + u)).erase ((px, py) + u))).erase ((px, py) - w)).erase (px, py))) := Relation.ReflTransGen.head m1 (Relation.ReflTransGen.head m2 (Relation.ReflTransGen.head m3 Relation.ReflTransGen.refl)) have final : insert ((px, py) + w) (((insert (px, py) (((insert ((px, py) - w) ((s.erase ((px, py) + w)).erase (px, py))).erase ((px, py) + u + u)).erase ((px, py) + u))).erase ((px, py) - w)).erase (px, py)) = s \ {(px, py), (px, py) + u, (px, py) + u + u} := by have ec : ∀ (t : Finset (ℤ × ℤ)) (a b : ℤ × ℤ), (t.erase a).erase b = (t.erase b).erase a := fun _ _ _ => erase_right_comm have hn1 : (px, py) ∉ (((insert ((px, py) - w) ((s.erase ((px, py) + w)).erase (px, py))).erase ((px, py) + u + u)).erase ((px, py) + u)).erase ((px, py) - w) := by intro h rw [Finset.mem_erase] at h obtain ⟨-, h⟩ := h rw [Finset.mem_erase, Finset.mem_erase, Finset.mem_insert] at h obtain ⟨-, ⟨-, h | h⟩⟩ := h · exact ne_p_mw h rw [Finset.mem_erase, Finset.mem_erase] at h exact h.1 rfl have hn2 : (px, py) - w ∉ (((s.erase ((px, py) + w)).erase (px, py)).erase ((px, py) + u + u)).erase ((px, py) + u) := by intro h rw [Finset.mem_erase, Finset.mem_erase, Finset.mem_erase, Finset.mem_erase] at h exact hnw h.2.2.2.2 rw [Finset.erase_insert_of_ne ne_p_mw, Finset.erase_insert hn1, Finset.erase_insert_of_ne ne_mw_uu, Finset.erase_insert_of_ne ne_mw_u, Finset.erase_insert hn2, ec _ ((px, py) + u + u) ((px, py) + u), ec _ (px, py) ((px, py) + u), ec _ ((px, py) + w) ((px, py) + u), ec _ ((px, py) + w) (px, py), ec _ ((px, py) + w) ((px, py) + u + u), ec _ ((px, py) + u) (px, py), Finset.insert_erase (Finset.mem_erase.mpr ⟨ne_pw_uu, Finset.mem_erase.mpr ⟨ne_pw_u, Finset.mem_erase.mpr ⟨ne_pw_p, hpw⟩⟩⟩)] ext x simp only [Finset.mem_erase, Finset.mem_sdiff, Finset.mem_insert, Finset.mem_singleton] constructor · rintro ⟨h1, h2, h3, h4⟩ exact ⟨h4, fun h => h.elim (fun hh => h3 hh) (fun h => h.elim (fun hh => h2 hh) (fun hh => h1 hh))⟩ · rintro ⟨h1, h2⟩ exact ⟨fun hh => h2 (Or.inr (Or.inr hh)), fun hh => h2 (Or.inr (Or.inl hh)), fun hh => h2 (Or.inl hh), h1⟩ rw [final] at h123 exact h123 /-! ## The sweep: reducing an (n+3) × (n+3) block to an n × n block -/ /-- After clearing `k` columns of the top strip: the board below row `n` plus columns `k, k+1, ...` of the whole square. -/ noncomputable def stateA (n k : ℕ) : Finset (ℤ × ℤ) := (initPos (n + 3)).filter (fun c => c.2 < (n : ℤ) ∨ (k : ℤ) ≤ c.1) /-- After clearing `k` rows of the right strip. -/ noncomputable def stateB (n k : ℕ) : Finset (ℤ × ℤ) := (initPos (n + 3)).filter (fun c => (c.1 < (n : ℤ) ∧ c.2 < (n : ℤ)) ∨ ((n : ℤ) ≤ c.1 ∧ c.2 ≤ (n : ℤ) + 2 - (k : ℤ))) /-- After clearing the bottom of column `n + 2` as well. -/ noncomputable def stateC (n : ℕ) : Finset (ℤ × ℤ) := (initPos (n + 3)).filter (fun c => (c.1 < (n : ℤ) ∧ c.2 < (n : ℤ)) ∨ ((n : ℤ) ≤ c.1 ∧ c.1 ≤ (n : ℤ) + 1 ∧ c.2 ≤ 2)) /-- After clearing the bottom of columns `n + 1, n + 2`. -/ noncomputable def stateD (n : ℕ) : Finset (ℤ × ℤ) := (initPos (n + 3)).filter (fun c => (c.1 < (n : ℤ) ∧ c.2 < (n : ℤ)) ∨ (c.1 = (n : ℤ) ∧ c.2 ≤ 2)) /-- One step of phase 1: purge the vertical triple in column `k` of the top strip, using the piece at `(k+1, n)` as catalyst. -/ lemma phase1_step (n k : ℕ) (hk : k < n) : Relation.ReflTransGen IsMove (stateA n k) (stateA n (k + 1)) := by have h := purge (s := stateA n k) (p := ((k : ℤ), (n : ℤ))) (u := ((0 : ℤ), (1 : ℤ))) (w := ((1 : ℤ), (0 : ℤ))) (by decide) (by decide) (by decide) (by simp only [stateA, mem_initPos, Finset.mem_filter]; lia) (by simp only [stateA, mem_initPos, Finset.mem_filter, Prod.mk_add_mk]; lia) (by simp only [stateA, mem_initPos, Finset.mem_filter, Prod.mk_add_mk]; lia) (by simp only [stateA, mem_initPos, Finset.mem_filter, Prod.mk_add_mk]; lia) (by simp only [stateA, mem_initPos, Finset.mem_filter, Prod.fst_sub, Prod.snd_sub]; lia) rw [show stateA n (k + 1) = stateA n k \ {((k : ℤ), (n : ℤ)), ((k : ℤ), (n : ℤ)) + ((0 : ℤ), (1 : ℤ)), ((k : ℤ), (n : ℤ)) + ((0 : ℤ), (1 : ℤ)) + ((0 : ℤ), (1 : ℤ))} by ext ⟨a, b⟩ simp only [stateA, mem_initPos, Finset.mem_filter, Finset.mem_sdiff, Finset.mem_insert, Finset.mem_singleton, Prod.ext_iff, Prod.mk_add_mk] omega] exact h /-- Phase 1: clear the top strip, one column at a time. -/ lemma phase1 (n : ℕ) (k : ℕ) (hk : k ≤ n) : Relation.ReflTransGen IsMove (initPos (n + 3)) (stateA n k) := by induction k with | zero => rw [show stateA n 0 = initPos (n + 3) by ext ⟨a, b⟩ simp only [stateA, mem_initPos, Finset.mem_filter] lia] | succ k ih => exact (ih (Nat.le_of_succ_le hk)).trans (phase1_step n k hk) /-- One step of phase 2a: purge the horizontal triple in row `n + 2 - k` of the right strip, using the piece at `(n, n + 1 - k)` as catalyst. -/ lemma phase2a_step (n k : ℕ) (hk : k < n) : Relation.ReflTransGen IsMove (stateB n k) (stateB n (k + 1)) := by have h := purge (s := stateB n k) (p := ((n : ℤ), (n : ℤ) + 2 - (k : ℤ))) (u := ((1 : ℤ), (0 : ℤ))) (w := ((0 : ℤ), (-1 : ℤ))) (by decide) (by decide) (by decide) (by simp only [stateB, mem_initPos, Finset.mem_filter]; lia) (by simp only [stateB, mem_initPos, Finset.mem_filter, Prod.mk_add_mk]; lia) (by simp only [stateB, mem_initPos, Finset.mem_filter, Prod.mk_add_mk]; lia) (by simp only [stateB, mem_initPos, Finset.mem_filter, Prod.mk_add_mk]; lia) (by simp only [stateB, mem_initPos, Finset.mem_filter, Prod.fst_sub, Prod.snd_sub]; lia) rw [show stateB n (k + 1) = stateB n k \ {((n : ℤ), (n : ℤ) + 2 - (k : ℤ)), ((n : ℤ), (n : ℤ) + 2 - (k : ℤ)) + ((1 : ℤ), (0 : ℤ)), ((n : ℤ), (n : ℤ) + 2 - (k : ℤ)) + ((1 : ℤ), (0 : ℤ)) + ((1 : ℤ), (0 : ℤ))} by ext ⟨a, b⟩ simp only [stateB, mem_initPos, Finset.mem_filter, Finset.mem_sdiff, Finset.mem_insert, Finset.mem_singleton, Prod.ext_iff, Prod.mk_add_mk] lia] exact h /-- Phase 2a: clear the right strip rows from top to bottom, down to row 3. -/ lemma phase2a (n : ℕ) (k : ℕ) (hk : k ≤ n) : Relation.ReflTransGen IsMove (initPos (n + 3)) (stateB n k) := by induction k with | zero => rw [show stateB n 0 = stateA n n by ext ⟨a, b⟩ simp only [stateA, stateB, mem_initPos, Finset.mem_filter] lia] exact phase1 n n le_rfl | succ k ih => exact (ih (Nat.le_of_succ_le hk)).trans (phase2a_step n k hk) /-- Phase 2b: clear the remaining 3 × 3 corner, finishing with a purge whose catalyst lies inside the target n × n block. -/ lemma phase2b (n : ℕ) (hn : 1 ≤ n) : Relation.ReflTransGen IsMove (stateB n n) (initPos n) := by have h1 := purge (s := stateB n n) (p := (((n : ℤ) + 2), (0 : ℤ))) (u := ((0 : ℤ), (1 : ℤ))) (w := ((-1 : ℤ), (0 : ℤ))) (by decide) (by decide) (by decide) (by simp only [stateB, mem_initPos, Finset.mem_filter]; lia) (by simp only [stateB, mem_initPos, Finset.mem_filter, Prod.mk_add_mk]; lia) (by simp only [stateB, mem_initPos, Finset.mem_filter, Prod.mk_add_mk]; lia) (by simp only [stateB, mem_initPos, Finset.mem_filter, Prod.mk_add_mk]; lia) (by simp only [stateB, mem_initPos, Finset.mem_filter, Prod.fst_sub, Prod.snd_sub]; lia) rw [show stateB n n \ {((n : ℤ) + 2, (0 : ℤ)), ((n : ℤ) + 2, (0 : ℤ)) + ((0 : ℤ), (1 : ℤ)), ((n : ℤ) + 2, (0 : ℤ)) + ((0 : ℤ), (1 : ℤ)) + ((0 : ℤ), (1 : ℤ))} = stateC n by ext ⟨a, b⟩ simp only [stateB, stateC, mem_initPos, Finset.mem_filter, Finset.mem_sdiff, Finset.mem_insert, Finset.mem_singleton, Prod.ext_iff, Prod.mk_add_mk] omega] at h1 have h2 := purge (s := stateC n) (p := (((n : ℤ) + 1), (0 : ℤ))) (u := ((0 : ℤ), (1 : ℤ))) (w := ((-1 : ℤ), (0 : ℤ))) (by decide) (by decide) (by decide) (by simp only [stateC, mem_initPos, Finset.mem_filter]; lia) (by simp only [stateC, mem_initPos, Finset.mem_filter, Prod.mk_add_mk]; lia) (by simp only [stateC, mem_initPos, Finset.mem_filter, Prod.mk_add_mk]; lia) (by simp only [stateC, mem_initPos, Finset.mem_filter, Prod.mk_add_mk]; lia) (by simp only [stateC, mem_initPos, Finset.mem_filter, Prod.fst_sub, Prod.snd_sub]; lia) rw [show stateC n \ {((n : ℤ) + 1, (0 : ℤ)), ((n : ℤ) + 1, (0 : ℤ)) + ((0 : ℤ), (1 : ℤ)), ((n : ℤ) + 1, (0 : ℤ)) + ((0 : ℤ), (1 : ℤ)) + ((0 : ℤ), (1 : ℤ))} = stateD n by ext ⟨a, b⟩ simp only [stateC, stateD, mem_initPos, Finset.mem_filter, Finset.mem_sdiff, Finset.mem_insert, Finset.mem_singleton, Prod.ext_iff, Prod.mk_add_mk] omega] at h2 have h3 := purge (s := stateD n) (p := ((n : ℤ), (0 : ℤ))) (u := ((0 : ℤ), (1 : ℤ))) (w := ((-1 : ℤ), (0 : ℤ))) (by decide) (by decide) (by decide) (by simp only [stateD, mem_initPos, Finset.mem_filter, true_and]; lia) (by simp only [stateD, mem_initPos, Finset.mem_filter, Prod.mk_add_mk]; lia) (by simp only [stateD, mem_initPos, Finset.mem_filter, Prod.mk_add_mk]; lia) (by simp only [stateD, mem_initPos, Finset.mem_filter, Prod.mk_add_mk]; lia) (by simp only [stateD, mem_initPos, Finset.mem_filter, Prod.fst_sub, Prod.snd_sub]; lia) rw [show stateD n \ {((n : ℤ), (0 : ℤ)), ((n : ℤ), (0 : ℤ)) + ((0 : ℤ), (1 : ℤ)), ((n : ℤ), (0 : ℤ)) + ((0 : ℤ), (1 : ℤ)) + ((0 : ℤ), (1 : ℤ))} = initPos n by ext ⟨a, b⟩ simp only [stateD, mem_initPos, Finset.mem_filter, Finset.mem_sdiff, Finset.mem_insert, Finset.mem_singleton, Prod.ext_iff, Prod.mk_add_mk] omega] at h3 exact h1.trans (h2.trans h3) /-- Reduction: if the game is solvable for `n ≥ 1`, it is solvable for `n + 3`. -/ lemma reduction (n : ℕ) (hn : 1 ≤ n) (h : Solvable n) : Solvable (n + 3) := by obtain ⟨c, hc⟩ := h exact ⟨c, (phase2a n n le_rfl).trans ((phase2b n hn).trans hc)⟩ /-- The 1 × 1 board is trivially solved. -/ lemma solvable_one : Solvable 1 := by refine ⟨((0 : ℤ), (0 : ℤ)), ?_⟩ rw [show initPos 1 = {((0 : ℤ), (0 : ℤ))} by ext ⟨a, b⟩ simp only [mem_initPos, Finset.mem_singleton, Prod.ext_iff] lia] /-- The 2 × 2 board is solved in three moves. -/ lemma solvable_two : Solvable 2 := by refine ⟨((2 : ℤ), (2 : ℤ)), ?_⟩ have m1 : IsMove (initPos 2) (insert ((2 : ℤ), (0 : ℤ)) (((initPos 2).erase ((0 : ℤ), (0 : ℤ))).erase ((1 : ℤ), (0 : ℤ)))) := by refine ⟨((0 : ℤ), (0 : ℤ)), ⟨((1 : ℤ), (0 : ℤ)), by decide⟩, ?_, ?_, ?_, ?_⟩ · simp only [mem_initPos]; lia · simp only [mem_initPos, Prod.mk_add_mk]; lia · simp only [mem_initPos, Prod.mk_add_mk]; lia · ext ⟨a, b⟩ simp only [mem_initPos, Finset.mem_insert, Finset.mem_erase, ne_eq, Prod.ext_iff, Prod.mk_add_mk] lia have m2 : IsMove (insert ((2 : ℤ), (0 : ℤ)) (((initPos 2).erase ((0 : ℤ), (0 : ℤ))).erase ((1 : ℤ), (0 : ℤ)))) (insert ((2 : ℤ), (1 : ℤ)) (((insert ((2 : ℤ), (0 : ℤ)) (((initPos 2).erase ((0 : ℤ), (0 : ℤ))).erase ((1 : ℤ), (0 : ℤ)))).erase ((0 : ℤ), (1 : ℤ))).erase ((1 : ℤ), (1 : ℤ)))) := by refine ⟨((0 : ℤ), (1 : ℤ)), ⟨((1 : ℤ), (0 : ℤ)), by decide⟩, ?_, ?_, ?_, ?_⟩ · simp only [mem_initPos, Finset.mem_insert, Finset.mem_erase, ne_eq, Prod.ext_iff]; lia · simp only [mem_initPos, Finset.mem_insert, Finset.mem_erase, ne_eq, Prod.ext_iff, Prod.mk_add_mk]; lia · simp only [mem_initPos, Finset.mem_insert, Finset.mem_erase, ne_eq, Prod.ext_iff, Prod.mk_add_mk]; lia · ext ⟨a, b⟩ simp only [mem_initPos, Finset.mem_insert, Finset.mem_erase, ne_eq, Prod.ext_iff, Prod.mk_add_mk] lia have m3 : IsMove (insert ((2 : ℤ), (1 : ℤ)) (((insert ((2 : ℤ), (0 : ℤ)) (((initPos 2).erase ((0 : ℤ), (0 : ℤ))).erase ((1 : ℤ), (0 : ℤ)))).erase ((0 : ℤ), (1 : ℤ))).erase ((1 : ℤ), (1 : ℤ)))) {((2 : ℤ), (2 : ℤ))} := by refine ⟨((2 : ℤ), (0 : ℤ)), ⟨((0 : ℤ), (1 : ℤ)), by decide⟩, ?_, ?_, ?_, ?_⟩ · simp only [mem_initPos, Finset.mem_insert, Finset.mem_erase, ne_eq, Prod.ext_iff, true_and, and_true, true_or]; lia · simp only [mem_initPos, Finset.mem_insert, Finset.mem_erase, ne_eq, Prod.ext_iff, Prod.mk_add_mk]; lia · simp only [mem_initPos, Finset.mem_insert, Finset.mem_erase, ne_eq, Prod.ext_iff, Prod.mk_add_mk]; lia · ext ⟨a, b⟩ simp only [mem_initPos, Finset.mem_insert, Finset.mem_erase, ne_eq, Prod.ext_iff, Prod.mk_add_mk, Finset.mem_singleton] lia exact Relation.ReflTransGen.head m1 (Relation.ReflTransGen.head m2 (Relation.ReflTransGen.head m3 Relation.ReflTransGen.refl)) lemma solvable_three_mul_add_one (m : ℕ) : Solvable (3 * m + 1) := by induction m with | zero => exact solvable_one | succ m ih => have h := reduction (3 * m + 1) (by lia) ih rw [show 3 * m + 1 + 3 = 3 * (m + 1) + 1 by ring] at h exact h lemma solvable_three_mul_add_two (m : ℕ) : Solvable (3 * m + 2) := by induction m with | zero => exact solvable_two | succ m ih => have h := reduction (3 * m + 2) (by lia) ih rw [show 3 * m + 2 + 3 = 3 * (m + 1) + 2 by ring] at h exact h lemma solvable_of_pos_not_three_dvd (n : ℕ) (_h0 : 0 < n) (h3 : ¬ 3 ∣ n) : Solvable n := by have hmod : n % 3 = 1 ∨ n % 3 = 2 := by lia rcases hmod with h | h · have e : n = 3 * (n / 3) + 1 := by lia rw [e] exact solvable_three_mul_add_one (n / 3) · have e : n = 3 * (n / 3) + 2 := by lia rw [e] exact solvable_three_mul_add_two (n / 3) -- snip end theorem imo1993_p3 (n : ℕ) : Solvable n ↔ n ∈ SolutionSet := by sorry end Imo1993P3 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1993, Problem 3", compfiles-Imo1994P1,"Let `m` and `n` be two positive integers. Let `a₁, a₂, ..., aₘ` be `m` different numbers from the set `{1, 2, ..., n}` such that for any two indices `i` and `j` with `1 ≤ i ≤ j ≤ m` and `aᵢ + aⱼ ≤ n`, there exists an index `k` such that `aᵢ + aⱼ = aₖ`. Show that `(a₁+a₂+...+aₘ)/m ≥ (n+1)/2`","import Mathlib /-! # International Mathmatical Olympiad 1994, Problem 1 Let `m` and `n` be two positive integers. Let `a₁, a₂, ..., aₘ` be `m` different numbers from the set `{1, 2, ..., n}` such that for any two indices `i` and `j` with `1 ≤ i ≤ j ≤ m` and `aᵢ + aⱼ ≤ n`, there exists an index `k` such that `aᵢ + aⱼ = aₖ`. Show that `(a₁+a₂+...+aₘ)/m ≥ (n+1)/2` -/ open Finset namespace Imo1994P1 theorem imo1994_p1 (n : ℕ) (m : ℕ) (A : Finset ℕ) (hm : A.card = m + 1) (hrange : ∀ a ∈ A, 0 < a ∧ a ≤ n) (hadd : ∀ a ∈ A, ∀ b ∈ A, a + b ≤ n → a + b ∈ A) : (m + 1) * (n + 1) ≤ 2 * ∑ x ∈ A, x := by sorry end Imo1994P1 ",Combinatorics,1. Named contest,,"Compfiles: International Mathmatical Olympiad 1994, Problem 1", compfiles-Imo1995P6,"Let p be an odd prime number. How many p-element subsets A of {1, 2, ..., 2p} are there, the sum of whose elements is divisible by p?","import Mathlib /-! # International Mathematical Olympiad 1995, Problem 6 Let p be an odd prime number. How many p-element subsets A of {1, 2, ..., 2p} are there, the sum of whose elements is divisible by p? -/ namespace Imo1995P6 abbrev solution (p : ℕ) : ℕ := 2 + (Nat.choose (2 * p) p - 2) / p theorem imo1995_p6 (p : ℕ) (hp : p.Prime) (hodd : Odd p) : (((Finset.Icc 1 (2 * p)).powersetCard p).filter (fun A ↦ p ∣ ∑ x ∈ A, x)).card = solution p := by sorry end Imo1995P6 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1995, Problem 6", compfiles-Imo1997P4,"An $n \times n$ matrix whose entries come from the set $S = \{1, 2, \ldots, 2n - 1\}$ is called a *silver matrix* if, for each $i = 1, \ldots, n$, the $i$-th row and the $i$-th column together contain all elements of $S$. Show that: (a) there is no silver matrix for $n = 1997$; (b) silver matrices exist for infinitely many values of $n$.","import Mathlib /-! # International Mathematical Olympiad 1997, Problem 4 An $n \times n$ matrix whose entries come from the set $S = \{1, 2, \ldots, 2n - 1\}$ is called a *silver matrix* if, for each $i = 1, \ldots, n$, the $i$-th row and the $i$-th column together contain all elements of $S$. Show that: (a) there is no silver matrix for $n = 1997$; (b) silver matrices exist for infinitely many values of $n$. -/ namespace Imo1997P4 /-- An `n × n` matrix `M` is a *silver matrix* if its entries come from `S = {1, …, 2n - 1}` and, for each `i`, the `i`-th row and the `i`-th column together contain all of `S`. -/ def SilverMatrix (n : ℕ) (M : Fin n → Fin n → ℕ) : Prop := (∀ i j, M i j ∈ Finset.Icc 1 (2 * n - 1)) ∧ (∀ i, (Finset.univ.image (fun j ↦ M i j) ∪ Finset.univ.image (fun j ↦ M j i)) = Finset.Icc 1 (2 * n - 1)) theorem imo1997_p4 : (¬ ∃ M : Fin 1997 → Fin 1997 → ℕ, SilverMatrix 1997 M) ∧ {n : ℕ | ∃ M : Fin n → Fin n → ℕ, SilverMatrix n M}.Infinite := by sorry end Imo1997P4 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1997, Problem 4", compfiles-Imo1997P6,"For each positive integer n, let f(n) denote the number of ways of representing n as a sum of powers of 2 with non-negative integer exponents. Representations which differ only in the ordering of their summands are considered to be the same. For example, f(4) = 4, because 4 can be represented as 4, 2 + 2, 2 + 1 + 1 or 1 + 1 + 1 + 1. Prove that for any integer n ≥ 3, 2^(n²/4) < f(2^n) < 2^(n²/2).","import Mathlib /-! # International Mathematical Olympiad 1997, Problem 6 For each positive integer n, let f(n) denote the number of ways of representing n as a sum of powers of 2 with non-negative integer exponents. Representations which differ only in the ordering of their summands are considered to be the same. For example, f(4) = 4, because 4 can be represented as 4, 2 + 2, 2 + 1 + 1 or 1 + 1 + 1 + 1. Prove that for any integer n ≥ 3, 2^(n²/4) < f(2^n) < 2^(n²/2). -/ namespace Imo1997P6 /-- `f n` is the number of ways of representing `n` as a sum of powers of two with non-negative integer exponents, where representations that differ only in the order of their summands are considered the same. Rather than defining `f` as a cardinality, we define it directly through its classical recurrence: a representation of an odd number `2m + 1` must use a `1`, hence `f (2m + 1) = f (2m)`; a representation of `2m + 2` either uses a `1` (and deleting it gives a representation of `2m + 1`) or does not (and halving every summand gives a representation of `m + 1`), hence `f (2m + 2) = f (2m + 1) + f (m + 1)`. -/ def f : ℕ → ℕ | 0 => 1 | n + 1 => f n + if (n + 1) % 2 = 0 then f ((n + 1) / 2) else 0 termination_by n => n decreasing_by all_goals lia theorem imo1997_p6 (n : ℕ) (hn : 3 ≤ n) : (2 : ℝ) ^ ((n : ℝ) ^ 2 / 4) < (f (2 ^ n) : ℝ) ∧ (f (2 ^ n) : ℝ) < (2 : ℝ) ^ ((n : ℝ) ^ 2 / 2) := by sorry ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1997, Problem 6", compfiles-Imo1998P2,"In a competition, there are `a` contestants and `b` judges, where `b ≥ 3` is an odd integer. Each judge rates each contestant as either ""pass"" or ""fail"". Suppose `k` is a number such that, for any two judges, their ratings coincide for at most `k` contestants. Prove that `k / a ≥ (b - 1) / (2b)`.","import Mathlib /-! # International Mathematical Olympiad 1998, Problem 2 In a competition, there are `a` contestants and `b` judges, where `b ≥ 3` is an odd integer. Each judge rates each contestant as either ""pass"" or ""fail"". Suppose `k` is a number such that, for any two judges, their ratings coincide for at most `k` contestants. Prove that `k / a ≥ (b - 1) / (2b)`. -/ open scoped Classical variable {C J : Type*} (r : C → J → Prop) namespace Imo1998P2 noncomputable section /-- An ordered pair of judges. -/ abbrev JudgePair (J : Type*) := J × J /-- The first judge from an ordered pair of judges. -/ abbrev JudgePair.judge₁ : JudgePair J → J := Prod.fst /-- The second judge from an ordered pair of judges. -/ abbrev JudgePair.judge₂ : JudgePair J → J := Prod.snd /-- The proposition that the judges in an ordered pair are distinct. -/ abbrev JudgePair.Distinct (p : JudgePair J) := p.judge₁ ≠ p.judge₂ /-- The proposition that the judges in an ordered pair agree about a contestant's rating. -/ abbrev JudgePair.Agree (p : JudgePair J) (c : C) := r c p.judge₁ ↔ r c p.judge₂ /-- The set of contestants on which two judges agree. -/ def agreedContestants [Fintype C] (p : JudgePair J) : Finset C := Finset.univ.filter fun c => p.Agree r c end theorem imo1998_p2 [Fintype J] [Fintype C] (a b k : ℕ) (hC : Fintype.card C = a) (hJ : Fintype.card J = b) (ha : 0 < a) (hb : Odd b) (hk : ∀ p : JudgePair J, p.Distinct → (agreedContestants r p).card ≤ k) : (b - 1 : ℚ) / (2 * b) ≤ k / a := by sorry end Imo1998P2 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1998, Problem 2", compfiles-Imo1999P3,"Consider an `n × n` square board, where `n` is a fixed even positive integer. The board is divided into `n^2` unit squares. We say that two different squares on the board are adjacent if they have a common side. `N` unit squares on the board are marked in such a way that every square (marked or unmarked) on the board is adjacent to at least one marked square. Determine the smallest possible value of `N`.","import Mathlib /-! # International Mathematical Olympiad 1999, Problem 3 Consider an `n × n` square board, where `n` is a fixed even positive integer. The board is divided into `n^2` unit squares. We say that two different squares on the board are adjacent if they have a common side. `N` unit squares on the board are marked in such a way that every square (marked or unmarked) on the board is adjacent to at least one marked square. Determine the smallest possible value of `N`. -/ namespace Imo1999P3 -- 1. Basic Definitions (Visible in Problem Statement) abbrev Square (n : ℕ) := Fin n × Fin n /-- Definition of adjacency: Two squares are adjacent if they share a common side. -/ def Adjacent {n : ℕ} (p1 p2 : Square n) : Prop := let (r1, c1) := p1; let (r2, c2) := p2 ((r1 : ℤ) - r2).natAbs + ((c1 : ℤ) - c2).natAbs = 1 /-- A set s is a valid marking if every square in the grid is adjacent to some square in s. -/ def IsValidMarking {n : ℕ} (s : Finset (Square n)) : Prop := ∀ p : Square n, ∃ m ∈ s, Adjacent p m abbrev solution_value (n : ℕ) : ℕ := n * (n + 2) / 4 theorem imo1999_p3 (n : ℕ) (h_pos : 0 < n) (h_even : Even n) : IsLeast {k : ℕ | ∃ s : Finset (Square n), IsValidMarking s ∧ s.card = k} (solution_value n) := by sorry end Imo1999P3 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 1999, Problem 3", compfiles-Imo2000P3,"Let n ≥ 2 be a positive integer and λ a positive real number. Initially there are n fleas on a horizontal line, not all at the same point. We define a move as choosing two fleas at some points A and B, with A to the left of B, and letting the flea from A jump over the flea from B to the point C so that BC/AB = λ. Determine all values of λ such that, for any point M on the line and for any initial position of the n fleas, there exists a sequence of moves that will take them all to the right of M.","import Mathlib /-! # International Mathematical Olympiad 2000, Problem 3 Let n ≥ 2 be a positive integer and λ a positive real number. Initially there are n fleas on a horizontal line, not all at the same point. We define a move as choosing two fleas at some points A and B, with A to the left of B, and letting the flea from A jump over the flea from B to the point C so that BC/AB = λ. Determine all values of λ such that, for any point M on the line and for any initial position of the n fleas, there exists a sequence of moves that will take them all to the right of M. -/ namespace Imo2000P3 open Finset /-- A single move with jump ratio `lam`: flea `i`, sitting at some point `A = x i`, jumps over flea `j` at `B = x j` (with `A` to the left of `B`) and lands at the point `C = B + lam * (B - A)`, so that `BC / AB = lam`. All other fleas stay put. -/ def Move (lam : ℝ) {n : ℕ} (x y : Fin n → ℝ) : Prop := ∃ i j, x i < x j ∧ y = Function.update x i (x j + lam * (x j - x i)) /-- `Reachable lam x y` means that configuration `y` can be reached from configuration `x` by a finite sequence of moves with jump ratio `lam`. -/ def Reachable (lam : ℝ) {n : ℕ} (x y : Fin n → ℝ) : Prop := Relation.ReflTransGen (Move lam) x y /-- The property of `lam` in the problem: starting from any initial configuration in which the fleas are not all at the same point, for every point `M` on the line there is a finite sequence of moves taking all the fleas strictly to the right of `M`. -/ def AllRightOf {n : ℕ} (lam : ℝ) : Prop := ∀ x : Fin n → ℝ, (∃ i j, x i ≠ x j) → ∀ M : ℝ, ∃ y : Fin n → ℝ, Reachable lam x y ∧ ∀ i, M < y i abbrev solution_set (n : ℕ) : Set ℝ := Set.Ici (1 / ((n : ℝ) - 1)) theorem imo2000_p3 (n : ℕ) (hn : 2 ≤ n) (lam : ℝ) : lam ∈ solution_set n ↔ (0 < lam ∧ AllRightOf (n := n) lam) := by sorry end Imo2000P3 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 2000, Problem 3", compfiles-Imo2014P5,"For every positive integer n, the Bank of Cape Town issues coins of denomination 1/n. Given a finite collection of such coins (of not necessarily different denominations) with total value at most 99 + 1/2, prove that it is possible to split this collection into 100 or fewer groups, such that each group has total value at most 1.","import Mathlib /-! # International Mathematical Olympiad 2014, Problem 5 For every positive integer n, the Bank of Cape Town issues coins of denomination 1/n. Given a finite collection of such coins (of not necessarily different denominations) with total value at most 99 + 1/2, prove that it is possible to split this collection into 100 or fewer groups, such that each group has total value at most 1. -/ namespace Imo2014P5 theorem imo2014_p5 (c : Multiset ℕ) (hpos : ∀ n ∈ c, 0 < n) (hval : value c ≤ 99 + 1 / 2) : ∃ gs : Multiset (Multiset ℕ), gs.sum = c ∧ gs.card ≤ 100 ∧ ∀ g ∈ gs, value g ≤ 1 := by sorry end Imo2014P5 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 2014, Problem 5", compfiles-Imo2020P6,"Consider an integer n > 1, and a set S of n points in the plane such that the distance between any two points in S is at least 1. Prove that there is a line l separating S such that the distance from any point of S to l is at least Ω(n ^ (-1/3)). (A line l separates a set of points S if some segment jointing two points in S croses l.)","import Mathlib /-! # International Mathematical Olympiad 2020, Problem 6 Consider an integer n > 1, and a set S of n points in the plane such that the distance between any two points in S is at least 1. Prove that there is a line l separating S such that the distance from any point of S to l is at least Ω(n ^ (-1/3)). (A line l separates a set of points S if some segment jointing two points in S croses l.) -/ namespace Imo2020P6 open Finset Module open scoped RealInnerProductSpace variable {V P : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] variable [NormedAddTorsor V P] (dim : Nat) [Fact (finrank ℝ V = dim + 1)] variable [Fact (Module.finrank ℝ V = 2)] theorem imo2020_p6 : ∃ c : ℝ, 0 < c ∧ ∀ {n : ℕ}, 1 < n → ∀ {S : Finset P}, #S = n → ((S : Set P).Pairwise fun x y ↦ 1 ≤ dist x y) → ∃ l : AffineSubspace ℝ P, finrank ℝ l.direction = 1 ∧ (∃ p₁ ∈ S, ∃ p₂ ∈ S, l.SOppSide p₁ p₂) ∧ ∀ p ∈ S, c * (n : ℝ) ^ (-1 / 3 : ℝ) ≤ Metric.infDist p l := by sorry end Imo2020P6 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 2020, Problem 6", compfiles-Imo2025P6,"Consider a 2025 × 2025 grid of unit squares. Matilda wishes to place on the grid some rectangular tiles, possibly of different sizes, such that each side of every tile lies on a grid line and every unit square is covered by at most one tile. Determine the minimum number of tiles Matilda needs to place so that each row and each column of the grid has exactly one unit square that is not covered by any tile.","import Mathlib open Finset Function /-! # International Mathematical Olympiad 2025, Problem 6 Consider a 2025 × 2025 grid of unit squares. Matilda wishes to place on the grid some rectangular tiles, possibly of different sizes, such that each side of every tile lies on a grid line and every unit square is covered by at most one tile. Determine the minimum number of tiles Matilda needs to place so that each row and each column of the grid has exactly one unit square that is not covered by any tile. -/ namespace Imo2025P6 variable {n : ℕ} abbrev Point (n : ℕ) := Fin n × Fin n variable {all_black : Finset (Point n)} section ProblemSetup variable [NeZero n] abbrev px (p : Point n) : ℕ := p.1.val abbrev py (p : Point n) : ℕ := p.2.val structure Matilda (n : ℕ) [NeZero n] (all_black : Finset (Point n)) where x_min : ℕ x_max : ℕ y_min : ℕ y_max : ℕ h_x_le : x_min ≤ x_max h_y_le : y_min ≤ y_max h_x_bound : x_max < n h_y_bound : y_max < n h_disjoint : ∀ p ∈ all_black, ¬(x_min ≤ px p ∧ px p ≤ x_max ∧ y_min ≤ py p ∧ py p ≤ y_max) @[simp] def Matilda.mem (m : Matilda n all_black) (p : Point n) : Prop := m.x_min ≤ px p ∧ px p ≤ m.x_max ∧ m.y_min ≤ py p ∧ py p ≤ m.y_max def IsValidConfiguration (n : ℕ) [NeZero n] (all_black : Finset (Point n)) (partition : Finset (Matilda n all_black)) : Prop := all_black.card = n ∧ (∀ p ∈ all_black, ∀ q ∈ all_black, px p = px q → p = q) ∧ (∀ p ∈ all_black, ∀ q ∈ all_black, py p = py q → p = q) ∧ (∀ p : Point n, p ∉ all_black → ∃! m ∈ partition, m.mem p) def IsMinMatildaCount (n : ℕ) [NeZero n] (m : ℕ) : Prop := (∀ (all_black : Finset (Point n)) (partition : Finset (Matilda n all_black)), IsValidConfiguration n all_black partition → m ≤ partition.card) ∧ (∃ (all_black : Finset (Point n)) (partition : Finset (Matilda n all_black)), IsValidConfiguration n all_black partition ∧ partition.card = m) end ProblemSetup abbrev solution_value : ℕ := 2112 theorem imo2025_p6 : IsMinMatildaCount 2025 solution_value := by sorry end Imo2025P6 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 2025, Problem 6", compfiles-Imo2026P3,"Let n be a positive integer. Liu Bang and Xiang Yu have a stick of length 1 and want to divide it between themselves. Liu marks at most n points on the stick, and then Xiang marks at most n points on the stick. The marked points are distinct. Then, the stick is cut at all marked points, creating a number of pieces. Afterwards, they take turns claiming any unclaimed piece of the stick, with Liu going first. Each player's goal is to maximise the total length of their own pieces. For each n, determine the largest value c such that Liu may guarantee a total length of at least c, regardless of Xiang's play.","import Mathlib /-! # International Mathematical Olympiad 2026, Problem 3 Let n be a positive integer. Liu Bang and Xiang Yu have a stick of length 1 and want to divide it between themselves. Liu marks at most n points on the stick, and then Xiang marks at most n points on the stick. The marked points are distinct. Then, the stick is cut at all marked points, creating a number of pieces. Afterwards, they take turns claiming any unclaimed piece of the stick, with Liu going first. Each player's goal is to maximise the total length of their own pieces. For each n, determine the largest value c such that Liu may guarantee a total length of at least c, regardless of Xiang's play. -/ namespace Imo2026P3 noncomputable section open scoped BigOperators /-- The multiset of piece lengths obtained by cutting `[0,1]` at the points of a finite set `S ⊆ (0,1)`. We sort `S` ascending, prepend `0` and append `1`, and take consecutive differences. The result is a list of `|S| + 1` positive reals summing to `1` (when `S ⊆ (0,1)`). -/ def pieceLengths (S : Finset ℝ) : List ℝ := let l : List ℝ := (0 : ℝ) :: (S.sort (· ≤ ·)) ++ [1] List.zipWith (fun a b => b - a) l l.tail /-- The sum of the entries of a list `L` at the (0-indexed) even positions, after sorting `L` in non-increasing order. These are the entries in the `1`st, `3`rd, `5`th, … positions of the sorted (decreasing) list, i.e. the pieces claimed by the first mover under the greedy claiming rule. -/ def firstPlayerShare (L : List ℝ) : ℝ := let sorted := L.mergeSort (· ≥ ·) ((sorted.zipIdx.filter (fun p => p.2 % 2 = 0)).map (fun p => p.1)).sum /-- `L(A,B)`: Liu Bang's total length, given Liu Bang's marks `A` and Xiang Yu's marks `B`. -/ def L (A B : Finset ℝ) : ℝ := firstPlayerShare (pieceLengths (A ∪ B)) /-- The set of admissible markings for a player: a finite subset of `(0,1)` of size at most `n`. We encode it as a `Finset ℝ` subject to the side conditions. -/ def AdmissibleMark (n : ℕ) (X : Finset ℝ) : Prop := (↑X ⊆ Set.Ioo (0 : ℝ) 1) ∧ X.card ≤ n /-- The value Liu Bang can guarantee. `V n` is the supremum over Liu Bang's admissible markings `A` of the infimum, over Xiang Yu's admissible markings `B` disjoint from `A`, of `L A B`. -/ def V (n : ℕ) : ℝ := ⨆ A : {A : Finset ℝ // AdmissibleMark n A}, ⨅ B : {B : Finset ℝ // AdmissibleMark n B ∧ Disjoint A.1 B}, L A.1 B.1 abbrev answer (n : ℕ) : ℝ := (2 : ℝ) ^ n / ((2 : ℝ) ^ (n + 1) - 1) end theorem imo2026_p3 (n : ℕ) (hn : 0 < n) : V n = answer n := by sorry end Imo2026P3 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 2026, Problem 3", compfiles-Imo2026P4,"Shan-Yu and Mulan are playing a game. Let θ be an angle with 0° < θ < 180° known to both players. Initially, Shan-Yu makes a paper triangle T with measurements of his choice. Then, they repeatedly perform the following steps: * If T has at least one angle measuring exactly θ, then the game stops and Mulan wins. * Otherwise, Mulan chooses a point P on the perimeter of T, different from its three vertices. She then makes a straight cut from P to the opposite vertex of T, splitting it into two triangles. * Shan-Yu discards one of the two triangles. The remaining triangle becomes the new T. For which real values of θ can Mulan guarantee her victory in finitely many steps, no matter how Shan-Yu plays? Statement formalization adapted from AxiomMath/IMO2026; proof adapted from Humanfia's Kimi-K3 solutions (https://github.com/humanfia/imo2026).","import Mathlib /-! # International Mathematical Olympiad 2026, Problem 4 Shan-Yu and Mulan are playing a game. Let θ be an angle with 0° < θ < 180° known to both players. Initially, Shan-Yu makes a paper triangle T with measurements of his choice. Then, they repeatedly perform the following steps: * If T has at least one angle measuring exactly θ, then the game stops and Mulan wins. * Otherwise, Mulan chooses a point P on the perimeter of T, different from its three vertices. She then makes a straight cut from P to the opposite vertex of T, splitting it into two triangles. * Shan-Yu discards one of the two triangles. The remaining triangle becomes the new T. For which real values of θ can Mulan guarantee her victory in finitely many steps, no matter how Shan-Yu plays? Statement formalization adapted from AxiomMath/IMO2026; proof adapted from Humanfia's Kimi-K3 solutions (https://github.com/humanfia/imo2026). -/ namespace Imo2026P4 /-- A triangle, viewed as the multiset of its three interior angles (in degrees): positive reals summing to `180`. -/ def IsTriangle (s : Multiset ℝ) : Prop := s.card = 3 ∧ (∀ x ∈ s, 0 < x) ∧ s.sum = 180 /-- A triangle `s` has an interior angle equal to `θ`. -/ def HasAngle (θ : ℝ) (s : Multiset ℝ) : Prop := θ ∈ s /-- One admissible cut of the triangle `s`, producing children `L` and `R`. We pick an apex angle `α` and the two base angles `β, γ` (so `s = {α, β, γ}`), and a cut parameter `x` in the open interval `(γ, 180 - β)`. The resulting two triangles have angle multisets `L = {β, x, 180 - β - x}` and `R = {γ, 180 - x, x - γ}`. Ranging over all `α, β, γ` with `s = {α, β, γ}` captures all three apex choices and both assignments of the two base angles. -/ def IsCut (s L R : Multiset ℝ) : Prop := ∃ α β γ x : ℝ, s = {α, β, γ} ∧ γ < x ∧ x < 180 - β ∧ L = {β, x, 180 - β - x} ∧ R = {γ, 180 - x, x - γ} /-- The set of triangles from which Mulan can force, in finitely many steps, a triangle with an interior angle equal to `θ`, no matter how Shan-Yu discards. This is the least predicate closed under: * (`win`) if the current triangle already has an angle equal to `θ`, Mulan has won; * (`move`) if Mulan can make a cut producing children `L` and `R` from *both* of which she wins (so whichever one Shan-Yu keeps, she still wins), then she wins from the current triangle. Membership means Mulan wins in finitely many steps. -/ inductive MulanWins (θ : ℝ) : Multiset ℝ → Prop | win {s : Multiset ℝ} (h : HasAngle θ s) : MulanWins θ s | move {s L R : Multiset ℝ} (hcut : IsCut s L R) (hL : MulanWins θ L) (hR : MulanWins θ R) : MulanWins θ s /-- Mulan can guarantee victory for the value `θ`: from every valid starting triangle she wins in finitely many steps regardless of Shan-Yu's play. -/ def MulanCanGuarantee (θ : ℝ) : Prop := ∀ s : Multiset ℝ, IsTriangle s → MulanWins θ s abbrev answer : Set ℝ := {θ : ℝ | ∃ n : ℕ, 2 ≤ n ∧ θ = 180 / n} theorem imo2026_p4 (θ : ℝ) (hθ0 : 0 < θ) (hθ180 : θ < 180) : MulanCanGuarantee θ ↔ θ ∈ answer := by sorry end Imo2026P4 ",Combinatorics,1. Named contest,,"Compfiles: International Mathematical Olympiad 2026, Problem 4", compfiles-IntegersInACircle,,"import Mathlib /-! There are 101 positive integers arranged in a circle. Suppose that the integers sum to 300. Prove that there exists a contiguous subarray that sums to 200. https://mathstodon.xyz/@alexdbolton/110292738044661739 https://math.stackexchange.com/questions/282589/101-positive-integers-placed-on-a-circle -/ namespace IntegersInACircle theorem integers_in_a_circle (a : ZMod 101 → ℤ) (ha : ∀ i, 1 ≤ a i) (ha_sum : ∑ i : ZMod 101, a i = 300) : ∃ j : ZMod 101, ∃ n : ℕ, ∑ i ∈ Finset.range n, a (j + i) = 200 := by sorry end IntegersInACircle ",Combinatorics,1. Named contest,,Compfiles: IntegersInACircle, compfiles-KolmogorovStreams,,"import Mathlib /-! Puzzle referenced from this tweet: https://twitter.com/sigfpe/status/1474173467016589323 From the book _Out of their Minds: The Lives and Discoveries of 15 Great Computer Scientists_ by Dennis Shasha and Cathy Lazere. Problem: Suppose each (finite) word is either ""decent"" or ""indecent"". Given an infinite sequence of characters, can you always break it into finite words so that all of them except perhaps the first one belong to the same class? -/ namespace KolmogorovStreams open scoped Stream' variable {α : Type} def break_into_words : (Stream' ℕ) → -- word lengths (Stream' α) → -- original sequence (Stream' (List α)) -- sequence of words := Function.curry (Stream'.corec (fun ⟨lengths, a'⟩ ↦ a'.take lengths.head) (fun ⟨lengths, a'⟩ ↦ ⟨lengths.tail, a'.drop lengths.head⟩)) def all_same_class (is_decent : List α → Prop) (b : Stream' (List α)) : Prop := b.All is_decent ∨ b.All (fun w ↦ ¬is_decent w) theorem kolmogorov_streams (is_decent : List α → Prop) (a : Stream' α) : (∃ (lengths : Stream' ℕ), (lengths.All (0 < ·) ∧ all_same_class is_decent (break_into_words lengths a).tail)) := by sorry end KolmogorovStreams ",Combinatorics,1. Named contest,,Compfiles: KolmogorovStreams, compfiles-UK2024R1P1,"An unreliable typist can guarantee that when they try to type a word with different letters, every letter of the word will appear exactly once in what they type, and each letter will occur at most one letter late (though it may occur more than one letter early). Thus, when trying to type MATHS, the typist may type MATHS, MTAHS or TMASH, but not ATMSH. Determine, with proof, the number of possible spellings of OLYMPIADS that might be typed.","import Mathlib /-! # British Mathematical Olympiad 2024, Round 1, Problem 1 An unreliable typist can guarantee that when they try to type a word with different letters, every letter of the word will appear exactly once in what they type, and each letter will occur at most one letter late (though it may occur more than one letter early). Thus, when trying to type MATHS, the typist may type MATHS, MTAHS or TMASH, but not ATMSH. Determine, with proof, the number of possible spellings of OLYMPIADS that might be typed. -/ namespace UK2024R1P1 abbrev solution_value : ℕ := 256 /- Since OLYMPIADS has no duplicate letters, then the set of spellings is just a subset of the permutations of 9 elements. -/ theorem uk2024_r1_p1 : {f : Equiv.Perm (Fin 9) | ∀ k, (f k : ℕ) ≤ k + 1}.ncard = solution_value := by sorry end UK2024R1P1 ",Combinatorics,1. Named contest,,"Compfiles: British Mathematical Olympiad 2024, Round 1, Problem 1", compfiles-Usa1974P4,"A, B, C play a series of games. Each game is between two players. The next game is between the winner and the person who was not playing. The series continues until one player has won two games. He wins the series. A is the weakest player, C the strongest. Each player has a fixed probability of winning against a given opponent. A chooses who plays the first game. Show that he should choose to play himself against B.","import Mathlib /-! # USA Mathematical Olympiad 1974, Problem 4 A, B, C play a series of games. Each game is between two players. The next game is between the winner and the person who was not playing. The series continues until one player has won two games. He wins the series. A is the weakest player, C the strongest. Each player has a fixed probability of winning against a given opponent. A chooses who plays the first game. Show that he should choose to play himself against B. -/ namespace Usa1974P4 /-- The three players of the series. -/ inductive Player | A | B | C deriving DecidableEq /-- The player who sits out a game between `x` and `y`. Only meaningful for `x ≠ y`; returns `A` on the diagonal. -/ def third : Player → Player → Player | .A, .B => .C | .B, .A => .C | .A, .C => .B | .C, .A => .B | .B, .C => .A | .C, .B => .A | _, _ => .A /-- The probability that player `A` wins the series, where * `win x y` is the probability that `x` beats `y` in a single game, * the next game is played between `w` (the winner of the previous game) and `i` (the player who sat out the previous game); the loser of a game sits out the next one, * `hist` is the list of winners of the games played so far, and * `n` is a fuel bounding the number of games still to be played. The series ends as soon as some player has won two games in total, so it lasts at most four games: if no one has won twice after three games then the three winners so far are three distinct players, and the fourth game is played between two of them, so its winner reaches two wins. -/ def probWinA (win : Player → Player → ℝ) : ℕ → Player → Player → List Player → ℝ | 0, _, _, _ => 0 | n + 1, w, i, hist => win w i * (if w ∈ hist then (if w = .A then 1 else 0) else probWinA win n w (third w i) (w :: hist)) + win i w * (if i ∈ hist then (if i = .A then 1 else 0) else probWinA win n i (third w i) (i :: hist)) /-- The probability that A wins the series when the first game is A against B. -/ def probFirstAB (win : Player → Player → ℝ) : ℝ := probWinA win 4 .A .B [] /-- The probability that A wins the series when the first game is A against C. -/ def probFirstAC (win : Player → Player → ℝ) : ℝ := probWinA win 4 .A .C [] /-- The probability that A wins the series when the first game is B against C. -/ def probFirstBC (win : Player → Player → ℝ) : ℝ := probWinA win 4 .B .C [] theorem usa1974_p4 (win : Player → Player → ℝ) (hwin : ∀ x y : Player, x ≠ y → 0 < win x y ∧ win x y + win y x = 1) -- ""A is the weakest player, C the strongest""; the proof only uses that A is -- more likely to beat B than to beat C. (hweak : win Player.A Player.C < win Player.A Player.B) : probFirstBC win < probFirstAB win ∧ probFirstAC win < probFirstAB win := by sorry end Usa1974P4 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1974, Problem 4", compfiles-Usa1975P5,"A pack of n cards, including three aces, is well shuffled. Cards are turned over in turn. Show that the expected number of cards that must be turned over to reach the second ace is (n+1)/2. ## Formalization notes We model the well-shuffled pack by the set of positions occupied by the three aces, which is uniformly distributed over the 3-element subsets of `{1, ..., n}`. The number of cards that must be turned over to reach the second ace is then the middle (second-smallest) of the three ace positions, and the expected number of cards is the average of this quantity over all 3-element subsets.","import Mathlib /-! # USA Mathematical Olympiad 1975, Problem 5 A pack of n cards, including three aces, is well shuffled. Cards are turned over in turn. Show that the expected number of cards that must be turned over to reach the second ace is (n+1)/2. ## Formalization notes We model the well-shuffled pack by the set of positions occupied by the three aces, which is uniformly distributed over the 3-element subsets of `{1, ..., n}`. The number of cards that must be turned over to reach the second ace is then the middle (second-smallest) of the three ace positions, and the expected number of cards is the average of this quantity over all 3-element subsets. -/ namespace Usa1975P5 open Finset /-- The sample space: the 3-element subsets of the positions `{1, ..., n}`; each such subset records the positions of the three aces in the pack. -/ def aceSets (n : ℕ) : Finset (Finset ℕ) := (Icc 1 n).powersetCard 3 /-- Reflection of the pack about its middle: the card in position `x` of a pack of `n` cards moves to position `n + 1 - x`. -/ def reflect (n x : ℕ) : ℕ := n + 1 - x /-- The minimum of a set of naturals, defaulting to `0` for the empty set. -/ def minD (S : Finset ℕ) : ℕ := (S.min).untopD 0 /-- The maximum of a set of naturals, defaulting to `0` for the empty set. -/ def maxD (S : Finset ℕ) : ℕ := (S.max).unbotD 0 /-- The middle element of a 3-element set of natural numbers, computed as the sum minus the minimum minus the maximum. When `S` is the set of ace positions, this is the number of cards turned over to reach the second ace. -/ def mid (S : Finset ℕ) : ℤ := (∑ x ∈ S, (x : ℤ)) - (minD S : ℤ) - (maxD S : ℤ) /-- The expected number of cards that must be turned over to reach the second ace. -/ abbrev expected (n : ℕ) : ℚ := (n + 1) / 2 theorem usa1975_p5 (n : ℕ) (hn : 3 ≤ n) : (∑ S ∈ aceSets n, (mid S : ℚ)) / n.choose 3 = expected n := by sorry end Usa1975P5 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1975, Problem 5", compfiles-Usa1978P5,"There are 9 delegates at a conference, each speaking at most three languages. Given any three delegates, at least 2 speak a common language. Show that there are three delegates with a common language.","import Mathlib /-! # USA Mathematical Olympiad 1978, Problem 5 There are 9 delegates at a conference, each speaking at most three languages. Given any three delegates, at least 2 speak a common language. Show that there are three delegates with a common language. -/ namespace Usa1978P5 /-- Delegate `a` and delegate `b` speak a common language. -/ abbrev Share {L : Type*} (speaks : Fin 9 → Finset L) (a b : Fin 9) : Prop := ∃ l : L, l ∈ speaks a ∧ l ∈ speaks b theorem usa1978_p5 {L : Type*} (speaks : Fin 9 → Finset L) (hthree : ∀ d : Fin 9, (speaks d).card ≤ 3) (hpair : ∀ a b c : Fin 9, a ≠ b → a ≠ c → b ≠ c → Share speaks a b ∨ Share speaks b c ∨ Share speaks a c) : ∃ a b c : Fin 9, a ≠ b ∧ a ≠ c ∧ b ≠ c ∧ ∃ l : L, l ∈ speaks a ∧ l ∈ speaks b ∧ l ∈ speaks c := by sorry end Usa1978P5 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1978, Problem 5", compfiles-Usa1979P5,"X has n members. Given n+1 subsets of X, each with 3 members, show that we can always find two which have just one member in common.","import Mathlib /-! # USA Mathematical Olympiad 1979, Problem 5 X has n members. Given n+1 subsets of X, each with 3 members, show that we can always find two which have just one member in common. -/ namespace Usa1979P5 open Finset theorem usa1979_p5 {α : Type*} [DecidableEq α] (n : ℕ) (X : Finset α) (hX : X.card = n) (S : Finset (Finset α)) (hS : S.card = n + 1) (hsub : ∀ s ∈ S, s ⊆ X) (hcard : ∀ s ∈ S, s.card = 3) : ∃ s ∈ S, ∃ t ∈ S, s ≠ t ∧ (s ∩ t).card = 1 := by sorry end Usa1979P5 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1979, Problem 5", compfiles-Usa1981P2,"What is the largest number of towns that can meet the following criteria? Each pair is directly linked by just one of air, bus or train. At least one pair is linked by air, at least one pair by bus and at least one pair by train. No town has an air link, a bus link and a train link. No three towns, A, B, C are such that the links between AB, AC and BC are all air, all bus or all train.","import Mathlib /-! # USA Mathematical Olympiad 1981, Problem 2 What is the largest number of towns that can meet the following criteria? Each pair is directly linked by just one of air, bus or train. At least one pair is linked by air, at least one pair by bus and at least one pair by train. No town has an air link, a bus link and a train link. No three towns, A, B, C are such that the links between AB, AC and BC are all air, all bus or all train. -/ namespace Usa1981P2 /-- The three possible link types between two towns. -/ inductive Link | air | bus | train deriving DecidableEq instance : Fintype Link where elems := ⟨↑[Link.air, Link.bus, Link.train], by decide⟩ complete := fun x => by cases x <;> decide /-- The set of link types that town `v` has to other towns. -/ abbrev colorsAt {n : ℕ} (f : Fin n → Fin n → Link) (v : Fin n) : Finset Link := (Finset.univ.filter (· ≠ v)).image (f v ·) /-- A link assignment on `n` towns satisfying all the criteria of the problem: it is symmetric, all three link types are used, no town has all three link types, and no three towns are pairwise linked by the same type. -/ abbrev Valid {n : ℕ} (f : Fin n → Fin n → Link) : Prop := (∀ i j, f i j = f j i) ∧ (∃ i j, i ≠ j ∧ f i j = .air) ∧ (∃ i j, i ≠ j ∧ f i j = .bus) ∧ (∃ i j, i ≠ j ∧ f i j = .train) ∧ (∀ v, (colorsAt f v).card ≤ 2) ∧ (∀ a b c, a ≠ b → b ≠ c → a ≠ c → ¬ (f a b = f a c ∧ f a b = f b c)) abbrev answer : ℕ := 4 theorem usa1981_p2 : IsGreatest {n : ℕ | ∃ f : Fin n → Fin n → Link, Valid f} answer := by sorry end Usa1981P2 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1981, Problem 2", compfiles-Usa1982P1,"A graph has 1982 points. Given any four points, there is at least one joined to the other three. What is the smallest number of points which are joined to 1981 points?","import Mathlib /-! # USA Mathematical Olympiad 1982, Problem 1 A graph has 1982 points. Given any four points, there is at least one joined to the other three. What is the smallest number of points which are joined to 1981 points? -/ namespace Usa1982P1 open Classical /-- The hypothesis of the problem: among any four vertices of the graph, some vertex is adjacent to the other three. -/ def FourPointProperty (G : SimpleGraph (Fin 1982)) : Prop := ∀ s : Finset (Fin 1982), s.card = 4 → ∃ v ∈ s, ∀ w ∈ s, w ≠ v → G.Adj v w /-- A vertex is *universal* if it is joined to all 1981 other vertices. -/ def IsUniversal (G : SimpleGraph (Fin 1982)) (v : Fin 1982) : Prop := ∀ w, w ≠ v → G.Adj v w abbrev solution : ℕ := 1979 theorem usa1982_p1 : IsLeast {n : ℕ | ∃ G : SimpleGraph (Fin 1982), FourPointProperty G ∧ n = (Finset.univ.filter (IsUniversal G)).card} solution := by sorry end Usa1982P1 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1982, Problem 1", compfiles-Usa1983P3,"S₁, S₂, ..., Sₙ are subsets of the real line. Each Sᵢ is the union of two closed intervals. Any three Sᵢ have a point in common. Show that there is a point which belongs to at least half the Sᵢ.","import Mathlib /-! # USA Mathematical Olympiad 1983, Problem 3 S₁, S₂, ..., Sₙ are subsets of the real line. Each Sᵢ is the union of two closed intervals. Any three Sᵢ have a point in common. Show that there is a point which belongs to at least half the Sᵢ. -/ namespace Usa1983P3 theorem usa1983_p3 {n : ℕ} (hn : 0 < n) (S : Fin n → Set ℝ) (hS : ∀ i, ∃ a b c d : ℝ, a ≤ b ∧ b ≤ c ∧ c ≤ d ∧ S i = Set.Icc a b ∪ Set.Icc c d) (h3 : ∀ i j k : Fin n, (S i ∩ S j ∩ S k).Nonempty) : ∃ x : ℝ, n ≤ 2 * {i : Fin n | x ∈ S i}.ncard := by sorry end Usa1983P3 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1983, Problem 3", compfiles-Usa1984P4,"A maths exam has two papers, each with at least one question and 28 questions in total. Each pupil attempted 7 questions. Each pair of questions was attempted by just two pupils. Show that one pupil attempted either nil or at least 4 questions in the first paper.","import Mathlib /-! # USA Mathematical Olympiad 1984, Problem 4 A maths exam has two papers, each with at least one question and 28 questions in total. Each pupil attempted 7 questions. Each pair of questions was attempted by just two pupils. Show that one pupil attempted either nil or at least 4 questions in the first paper. -/ namespace Usa1984P4 theorem usa1984_p4 {Pupil : Type} [Fintype Pupil] (attempt : Pupil → Finset (Fin 28)) (hattempt : ∀ p, (attempt p).card = 7) (hpair : ∀ q1 q2 : Fin 28, q1 ≠ q2 → (Finset.univ.filter fun p ↦ q1 ∈ attempt p ∧ q2 ∈ attempt p).card = 2) (paper1 : Finset (Fin 28)) (hpaper1 : paper1.Nonempty) (_hpaper2 : (Finset.univ \ paper1).Nonempty) : ∃ p, (attempt p ∩ paper1).card = 0 ∨ 4 ≤ (attempt p ∩ paper1).card := by sorry end Usa1984P4 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1984, Problem 4", compfiles-Usa1985P4,"A graph has n > 2 points. Show that we can find two points A and B such that at least ⌊n/2⌋ - 1 of the remaining points are joined to either both or neither of A and B.","import Mathlib /-! # USA Mathematical Olympiad 1985, Problem 4 A graph has n > 2 points. Show that we can find two points A and B such that at least ⌊n/2⌋ - 1 of the remaining points are joined to either both or neither of A and B. -/ namespace Usa1985P4 open Finset theorem usa1985_p4 (n : ℕ) (hn : 2 < n) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] : ∃ A B : Fin n, A ≠ B ∧ n / 2 - 1 ≤ (Finset.univ.filter fun X => X ≠ A ∧ X ≠ B ∧ (G.Adj X A ↔ G.Adj X B)).card := by sorry end Usa1985P4 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1985, Problem 4", compfiles-Usa1985P5,"0 < a₁ ≤ a₂ ≤ a₃ ≤ ⋯ is an unbounded sequence of integers. Let bₙ = m if aₘ is the first member of the sequence to equal or exceed n. Given that a₁₉ = 85, what is the maximum possible value of a₁ + a₂ + ⋯ + a₁₉ + b₁ + b₂ + ⋯ + b₈₅?","import Mathlib /-! # USA Mathematical Olympiad 1985, Problem 5 0 < a₁ ≤ a₂ ≤ a₃ ≤ ⋯ is an unbounded sequence of integers. Let bₙ = m if aₘ is the first member of the sequence to equal or exceed n. Given that a₁₉ = 85, what is the maximum possible value of a₁ + a₂ + ⋯ + a₁₉ + b₁ + b₂ + ⋯ + b₈₅? -/ namespace Usa1985P5 /-- The first index `i` (0-based) such that `n ≤ a i`. This exists because `a` is unbounded. The problem's `bₙ` is `c a hu n + 1` (the 1-based index). -/ noncomputable abbrev c (a : ℕ → ℕ) (hu : ∀ n, ∃ i, n ≤ a i) (n : ℕ) : ℕ := Nat.find (hu n) abbrev solution : ℕ := 1700 theorem usa1985_p5 : IsGreatest { s : ℕ | ∃ (a : ℕ → ℕ) (_ : Monotone a) (_ : 0 < a 0) (hu : ∀ n, ∃ i, n ≤ a i), a 18 = 85 ∧ s = ∑ i ∈ Finset.range 19, a i + ∑ j ∈ Finset.range 85, (c a hu (j + 1) + 1) } solution := by sorry end Usa1985P5 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1985, Problem 5", compfiles-Usa1986P2,"Five professors attended a lecture. Each fell asleep just twice. For each pair there was a moment when both were asleep. Show that there was a moment when three of them were asleep.","import Mathlib /-! # USA Mathematical Olympiad 1986, Problem 2 Five professors attended a lecture. Each fell asleep just twice. For each pair there was a moment when both were asleep. Show that there was a moment when three of them were asleep. -/ namespace Usa1986P2 /-- Each professor `p : Fin 5` takes two naps, and nap `k : Fin 2` of professor `p` is the closed interval `[s p k, e p k]`. Professor `p` is asleep at time `t` if `t` belongs to one of these two nap intervals. -/ def Asleep (s e : Fin 5 → Fin 2 → ℝ) (p : Fin 5) (t : ℝ) : Prop := ∃ k : Fin 2, s p k ≤ t ∧ t ≤ e p k theorem usa1986_p2 (s e : Fin 5 → Fin 2 → ℝ) (hsleep : ∀ p q : Fin 5, p ≠ q → ∃ t, Asleep s e p t ∧ Asleep s e q t) : ∃ t : ℝ, ∃ p q r : Fin 5, p ≠ q ∧ p ≠ r ∧ q ≠ r ∧ Asleep s e p t ∧ Asleep s e q t ∧ Asleep s e r t := by sorry end Usa1986P2 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1986, Problem 2", compfiles-Usa1986P5,"A partition of n is an increasing sequence of integers with sum n. For example, the partitions of 5 are: 1, 1, 1, 1, 1; 1, 1, 1, 2; 1, 1, 3; 1, 4; 5; 1, 2, 2; and 2, 3. If p is a partition, f(p) = the number of 1s in p, and g(p) = the number of distinct integers in the partition. Show that ∑ f(p) = ∑ g(p), where the sum is taken over all partitions of n.","import Mathlib /-! # USA Mathematical Olympiad 1986, Problem 5 A partition of n is an increasing sequence of integers with sum n. For example, the partitions of 5 are: 1, 1, 1, 1, 1; 1, 1, 1, 2; 1, 1, 3; 1, 4; 5; 1, 2, 2; and 2, 3. If p is a partition, f(p) = the number of 1s in p, and g(p) = the number of distinct integers in the partition. Show that ∑ f(p) = ∑ g(p), where the sum is taken over all partitions of n. -/ namespace Usa1986P5 theorem usa1986_p5 (n : ℕ) : ∑ p : Nat.Partition n, p.parts.count 1 = ∑ p : Nat.Partition n, p.parts.toFinset.card := by sorry end Usa1986P5 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1986, Problem 5", compfiles-Usa1988P3,"Let X be the set {1, 2, ... , 20} and let P be the set of all 9-element subsets of X. Show that for any map f : P → X we can find a 10-element subset Y of X, such that f(Y - {k}) ≠ k for any k in Y.","import Mathlib /-! # USA Mathematical Olympiad 1988, Problem 3 Let X be the set {1, 2, ... , 20} and let P be the set of all 9-element subsets of X. Show that for any map f : P → X we can find a 10-element subset Y of X, such that f(Y - {k}) ≠ k for any k in Y. -/ namespace Usa1988P3 open Finset theorem usa1988_p3 (f : Finset ℕ → ℕ) : ∃ Y : Finset ℕ, Y ⊆ Finset.Icc 1 20 ∧ Y.card = 10 ∧ ∀ k ∈ Y, f (Y.erase k) ≠ k := by sorry end Usa1988P3 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1988, Problem 3", compfiles-Usa1989P2,"The 20 members of a local tennis club have scheduled exactly 14 two-person games among themselves, with each member playing in at least one game. Prove that within this schedule can be found a set of six games with 12 distinct players.","import Mathlib /-! # USA Mathematical Olympiad 1989, Problem 2 The 20 members of a local tennis club have scheduled exactly 14 two-person games among themselves, with each member playing in at least one game. Prove that within this schedule can be found a set of six games with 12 distinct players. -/ namespace Usa1989P2 open Finset theorem usa1989_p2 (G : SimpleGraph (Fin 20)) [DecidableRel G.Adj] (hcard : #G.edgeFinset = 14) (hdeg : ∀ v : Fin 20, 1 ≤ G.degree v) : ∃ s : Finset (Sym2 (Fin 20)), s ⊆ G.edgeFinset ∧ #s = 6 ∧ #(s.biUnion Sym2.toFinset) = 12 := by sorry end Usa1989P2 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1989, Problem 2", compfiles-Usa1990P1,"A license plate has six digits from 0 to 9 and may have leading zeros. If two plates must always differ in at least two places, what is the largest number of plates that is possible?","import Mathlib /-! # USA Mathematical Olympiad 1990, Problem 1 A license plate has six digits from 0 to 9 and may have leading zeros. If two plates must always differ in at least two places, what is the largest number of plates that is possible? -/ namespace Usa1990P1 /-- A license plate: six digits, each from 0 to 9 (leading zeros allowed). We model digits as elements of `ZMod 10` so that digit sums modulo ten are available for the checksum argument. -/ abbrev Plate := Fin 6 → ZMod 10 /-- A collection of plates is valid if any two distinct plates in it differ in at least two places. -/ def IsValid (S : Finset Plate) : Prop := ∀ p ∈ S, ∀ q ∈ S, p ≠ q → 2 ≤ hammingDist p q abbrev answer : ℕ := 10 ^ 5 theorem usa1990_p1 : IsGreatest {k : ℕ | ∃ S : Finset Plate, S.card = k ∧ IsValid S} answer := by sorry end Usa1990P1 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1990, Problem 1", compfiles-Usa1990P4,"How many positive integers can be written in base n so that (1) the integer has no two digits the same, and (2) each digit after the first differs by one from an earlier digit? For example, in base 3, the possible numbers are 1, 2, 10, 12, 21, 102, 120, 210.","import Mathlib /-! # USA Mathematical Olympiad 1990, Problem 4 How many positive integers can be written in base n so that (1) the integer has no two digits the same, and (2) each digit after the first differs by one from an earlier digit? For example, in base 3, the possible numbers are 1, 2, 10, 12, 21, 102, 120, 210. -/ namespace Usa1990P4 /-- Condition (2) of the problem, phrased for the list of base-`n` digits of a number as produced by `Nat.digits` (least significant digit first, so the ""first"" digit of the number is the last entry of the list): every digit except the most significant one differs by one from some more significant digit. -/ def DiffByOne (l : List ℕ) : Prop := ∀ i, ∀ (_ : i + 1 < l.length), ∃ j, i < j ∧ j < l.length ∧ ∀ (_ : j < l.length), (l[i] + 1 = l[j] ∨ l[j] + 1 = l[i]) abbrev answer (n : ℕ) : ℕ := 2 ^ (n + 1) - 2 * n - 2 theorem usa1990_p4 (n : ℕ) (hn : 2 ≤ n) : Set.ncard {m : ℕ | 0 < m ∧ (Nat.digits n m).Nodup ∧ DiffByOne (Nat.digits n m)} = answer n := by sorry end Usa1990P4 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1990, Problem 4", compfiles-Usa1992P3,"A set of 11 distinct positive integers has the property that we can find a subset with sum n for any n between 1 and 1500 inclusive. What is the smallest possible value for the second largest element?","import Mathlib /-! # USA Mathematical Olympiad 1992, Problem 3 A set of 11 distinct positive integers has the property that we can find a subset with sum n for any n between 1 and 1500 inclusive. What is the smallest possible value for the second largest element? -/ namespace Usa1992P3 /-- Formalization of ""a set of 11 distinct positive integers such that every integer between 1 and 1500 is the sum of a subset"", with the elements listed in increasing order as `a 0 < a 1 < … < a 10`. -/ def Good (a : ℕ → ℕ) : Prop := (∀ i : ℕ, i < 11 → 0 < a i) ∧ (∀ i : ℕ, i < 10 → a i < a (i + 1)) ∧ ∀ n : ℕ, 1 ≤ n → n ≤ 1500 → ∃ t : Finset ℕ, t ⊆ Finset.range 11 ∧ ∑ i ∈ t, a i = n /-- The answer to the problem. -/ abbrev answer : ℕ := 248 theorem usa1992_p3 : IsLeast {x : ℕ | ∃ a : ℕ → ℕ, Good a ∧ x = a 9} answer := by sorry end Usa1992P3 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1992, Problem 3", compfiles-Usa1994P2,"The sequence a₁, a₂, ... , a₉₉ has a₁ = a₃ = a₅ = ... = a₉₇ = 1, a₂ = a₄ = a₆ = ... = a₉₈ = 2, and a₉₉ = 3. We interpret subscripts greater than 99 by subtracting 99, so that a₁₀₀ means a₁ etc. An allowed move is to change the value of any one of the aₙ to another member of {1, 2, 3} different from its two neighbors, aₙ₋₁ and aₙ₊₁. Is there a sequence of allowed moves which results in aₘ = aₘ₊₂ = ... = aₘ₊₉₆ = 1, aₘ₊₁ = aₘ₊₃ = ... = aₘ₊₉₅ = 2, aₘ₊₉₇ = 3, aₘ₊₉₈ = 2 for some m? [So if m = 1, we have just interchanged the values of a₉₈ and a₉₉.] The answer is ""no"": the cyclic-weight sum below is an invariant of allowed moves, it equals 3 for the initial configuration and -3 for every target configuration.","import Mathlib /-! # USA Mathematical Olympiad 1994, Problem 2 The sequence a₁, a₂, ... , a₉₉ has a₁ = a₃ = a₅ = ... = a₉₇ = 1, a₂ = a₄ = a₆ = ... = a₉₈ = 2, and a₉₉ = 3. We interpret subscripts greater than 99 by subtracting 99, so that a₁₀₀ means a₁ etc. An allowed move is to change the value of any one of the aₙ to another member of {1, 2, 3} different from its two neighbors, aₙ₋₁ and aₙ₊₁. Is there a sequence of allowed moves which results in aₘ = aₘ₊₂ = ... = aₘ₊₉₆ = 1, aₘ₊₁ = aₘ₊₃ = ... = aₘ₊₉₅ = 2, aₘ₊₉₇ = 3, aₘ₊₉₈ = 2 for some m? [So if m = 1, we have just interchanged the values of a₉₈ and a₉₉.] The answer is ""no"": the cyclic-weight sum below is an invariant of allowed moves, it equals 3 for the initial configuration and -3 for every target configuration. -/ namespace Usa1994P2 /-- The three values that may appear in the sequence. We identify the values 1, 2, 3 of the problem statement with 0, 1, 2 in `ZMod 3`; the cyclic successor map `x ↦ x + 1` then sends 1 → 2 → 3 → 1. -/ abbrev Val := ZMod 3 /-- A configuration of the sequence, indexed by `ZMod 99` (indices are interpreted modulo 99, as in the problem statement). Index `i` corresponds to the problem's aᵢ₊₁. -/ abbrev Config := ZMod 99 → Val /-- The initial configuration: 1, 2, 1, 2, ..., 1, 2, 3. -/ def initial : Config := fun i ↦ if i.val = 98 then 2 else if i.val % 2 = 0 then 0 else 1 /-- The alternating pattern underlying the target configurations: `targetPat k` is the value at offset `k` (with `0 ≤ k ≤ 98`) from the base index, namely 1 at even offsets `≤ 96`, 2 at odd offsets `≤ 95`, 3 at offset 97 and 2 at offset 98. -/ def targetPat (k : ℕ) : Val := if k = 97 then 2 else if k = 98 then 1 else if k % 2 = 0 then 0 else 1 /-- The target configuration with base index `m`: the value at index `i` depends only on the offset `i - m`, exactly as in the problem statement where index `m + k` carries the `k`-th value of the pattern. -/ def target (m : ZMod 99) : Config := fun i ↦ targetPat (i - m).val /-- An allowed move: change the value at some index `n` to another value `v` that differs from both neighbors. -/ def Move (a b : Config) : Prop := ∃ n v, v ≠ a n ∧ v ≠ a (n - 1) ∧ v ≠ a (n + 1) ∧ b = Function.update a n v /-- The answer to the question ""is there a sequence of allowed moves to a target configuration?"" is no. -/ abbrev does_exist : Bool := false theorem usa1994_p2 : if does_exist then ∃ m : ZMod 99, Relation.ReflTransGen Move initial (target m) else ¬ ∃ m : ZMod 99, Relation.ReflTransGen Move initial (target m) := by sorry end Usa1994P2 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1994, Problem 2", compfiles-Usa1994P5,"Let |U|, σ(U) and π(U) denote the number of elements, the sum, and the product, respectively, of a finite set U of positive integers. (If U is the empty set, |U| = 0, σ(U) = 0, π(U) = 1.) Let S be a finite set of positive integers. As usual, we define (n k) = n! / (k! (n-k)!) for 0 ≤ k ≤ n and (n k) = 0 otherwise. Prove that ∑_{U ⊆ S} (-1)^{|U|} (m - σ(U) choose |S|) = π(S) for all integers m ≥ σ(S).","import Mathlib /-! # USA Mathematical Olympiad 1994, Problem 5 Let |U|, σ(U) and π(U) denote the number of elements, the sum, and the product, respectively, of a finite set U of positive integers. (If U is the empty set, |U| = 0, σ(U) = 0, π(U) = 1.) Let S be a finite set of positive integers. As usual, we define (n k) = n! / (k! (n-k)!) for 0 ≤ k ≤ n and (n k) = 0 otherwise. Prove that ∑_{U ⊆ S} (-1)^{|U|} (m - σ(U) choose |S|) = π(S) for all integers m ≥ σ(S). -/ namespace Usa1994P5 theorem usa1994_p5 (S : Finset ℕ) (_hS : ∀ s ∈ S, 0 < s) (m : ℕ) (hm : ∑ s ∈ S, s ≤ m) : ∑ U ∈ S.powerset, (-1 : ℤ) ^ U.card * ((m - ∑ s ∈ U, s).choose S.card : ℤ) = ∏ s ∈ S, s := by sorry end Usa1994P5 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1994, Problem 5", compfiles-Usa1995P5,"A graph with n points and k edges has no triangles. Show that it has a point P such that there are at most k(1 - 4k/n²) edges between points not joined to P (by an edge).","import Mathlib /-! # USA Mathematical Olympiad 1995, Problem 5 A graph with n points and k edges has no triangles. Show that it has a point P such that there are at most k(1 - 4k/n²) edges between points not joined to P (by an edge). -/ namespace Usa1995P5 open Finset SimpleGraph variable {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] theorem usa1995_p5 {n : ℕ} [NeZero n] (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] (hG : G.CliqueFree 3) : ∃ P : Fin n, (#(G.edgeFinset.filter fun e => ∀ v ∈ e, ¬G.Adj P v) : ℝ) ≤ (#G.edgeFinset : ℝ) * (1 - 4 * #G.edgeFinset / n ^ 2) := by sorry end Usa1995P5 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1995, Problem 5", compfiles-Usa1996P2,"Let S be a set of n positive integers. Let P be the set of all integers which are the sum of one or more distinct elements of S. Show that we can find n subsets of P whose union is P such that if a, b belong to the same subset, then a ≤ 2b.","import Mathlib /-! # USA Mathematical Olympiad 1996, Problem 2 Let S be a set of n positive integers. Let P be the set of all integers which are the sum of one or more distinct elements of S. Show that we can find n subsets of P whose union is P such that if a, b belong to the same subset, then a ≤ 2b. -/ namespace Usa1996P2 /-- The set of all sums of one or more distinct elements of `S`. -/ def SubsetSums (S : Finset ℕ) : Set ℕ := {x | ∃ A : Finset ℕ, A ⊆ S ∧ A.Nonempty ∧ x = A.sum id} theorem usa1996_p2 (S : Finset ℕ) (hS : ∀ s ∈ S, 0 < s) : ∃ T : Fin S.card → Set ℕ, (∀ i, T i ⊆ SubsetSums S) ∧ (⋃ i, T i = SubsetSums S) ∧ ∀ i, ∀ a ∈ T i, ∀ b ∈ T i, a ≤ 2 * b := by sorry end Usa1996P2 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1996, Problem 2", compfiles-Usa1996P4,"An n-term sequence (x₁, x₂, …, xₙ) in which each term is either 0 or 1 is called a binary sequence of length n. Let aₙ be the number of binary sequences of length n containing no three consecutive terms equal to 0, 1, 0 in that order. Let bₙ be the number of binary sequences of length n that contain no four consecutive terms equal to 0, 0, 1, 1 or 1, 1, 0, 0 in that order. Prove that bₙ₊₁ = 2aₙ for all positive integers n.","import Mathlib /-! # USA Mathematical Olympiad 1996, Problem 4 An n-term sequence (x₁, x₂, …, xₙ) in which each term is either 0 or 1 is called a binary sequence of length n. Let aₙ be the number of binary sequences of length n containing no three consecutive terms equal to 0, 1, 0 in that order. Let bₙ be the number of binary sequences of length n that contain no four consecutive terms equal to 0, 0, 1, 1 or 1, 1, 0, 0 in that order. Prove that bₙ₊₁ = 2aₙ for all positive integers n. -/ namespace Usa1996P4 /-- The `i`-th term of a binary sequence `x : Fin n → Bool`, or `false` if `i` is out of range. -/ def sget {n : ℕ} (x : Fin n → Bool) (i : ℕ) : Bool := if h : i < n then x ⟨i, h⟩ else false /-- A binary sequence of length `n` (encoded as `x : Fin n → Bool`, with `false` standing for `0` and `true` for `1`) is `A`-good if it contains no three consecutive terms equal to `0, 1, 0` in that order. -/ abbrev GoodA {n : ℕ} (x : Fin n → Bool) : Prop := ∀ i : Fin n, (i : ℕ) + 2 < n → ¬(sget x (i : ℕ) = false ∧ sget x ((i : ℕ) + 1) = true ∧ sget x ((i : ℕ) + 2) = false) /-- A binary sequence of length `n` is `B`-good if it contains no four consecutive terms equal to `0, 0, 1, 1` or `1, 1, 0, 0` in that order. -/ abbrev GoodB {n : ℕ} (y : Fin n → Bool) : Prop := ∀ i : Fin n, (i : ℕ) + 3 < n → ¬((sget y (i : ℕ) = false ∧ sget y ((i : ℕ) + 1) = false ∧ sget y ((i : ℕ) + 2) = true ∧ sget y ((i : ℕ) + 3) = true) ∨ (sget y (i : ℕ) = true ∧ sget y ((i : ℕ) + 1) = true ∧ sget y ((i : ℕ) + 2) = false ∧ sget y ((i : ℕ) + 3) = false)) theorem usa1996_p4 (n : ℕ) : Fintype.card {y : Fin (n + 1) → Bool // GoodB y} = 2 * Fintype.card {x : Fin n → Bool // GoodA x} := by sorry end Usa1996P4 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1996, Problem 4", compfiles-Usa1996P6,"Determine, with proof, whether there is a subset X of the integers with the following property: for any integer n there is exactly one pair (a, b) of elements of X satisfying a + 2b = n.","import Mathlib /-! # USA Mathematical Olympiad 1996, Problem 6 Determine, with proof, whether there is a subset X of the integers with the following property: for any integer n there is exactly one pair (a, b) of elements of X satisfying a + 2b = n. -/ namespace Usa1996P6 def UniqueRepresentationSet (X : Set ℤ) : Prop := ∀ n : ℤ, ∃! p : ℤ × ℤ, p.1 ∈ X ∧ p.2 ∈ X ∧ p.1 + 2 * p.2 = n abbrev does_exist : Bool := true theorem usa1996_p6 : does_exist ↔ ∃ X : Set ℤ, UniqueRepresentationSet X := by sorry end Usa1996P6 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1996, Problem 6", compfiles-Usa1998P4,"A computer screen shows a 98 × 98 chessboard, colored in the usual way. One can select with a mouse any rectangle with sides on the lines of the chessboard and click the mouse button: as a result, the colors in the selected rectangle switch (black becomes white, white becomes black). Find, with proof, the minimum number of mouse clicks needed to make the chessboard all one color.","import Mathlib /-! # USA Mathematical Olympiad 1998, Problem 4 A computer screen shows a 98 × 98 chessboard, colored in the usual way. One can select with a mouse any rectangle with sides on the lines of the chessboard and click the mouse button: as a result, the colors in the selected rectangle switch (black becomes white, white becomes black). Find, with proof, the minimum number of mouse clicks needed to make the chessboard all one color. -/ namespace Usa1998P4 def chessboard : Type := Fin 98 × Fin 98 def coloring := chessboard → ZMod 2 def all_same_color (f : coloring) : Prop := ∃ c : ZMod 2, ∀ s : chessboard, f s = c structure Rectangle where x : ℕ y : ℕ width : ℕ height : ℕ def recolor_rect (f : coloring) (r : Rectangle) : coloring := fun ⟨x, y⟩ ↦ if r.x ≤ x.val ∧ r.y ≤ y.val ∧ x.val < r.x + r.width ∧ y.val < r.y + r.height then f ⟨x, y⟩ + 1 else f ⟨x, y⟩ def start_coloring : coloring := fun ⟨x, y⟩ ↦ x.val + y.val def possible_num_clicks : Set ℕ := { n : ℕ | ∃ rs : List Rectangle, (all_same_color (rs.foldl recolor_rect start_coloring) ∧ rs.length = n) } abbrev min_clicks : ℕ := 98 theorem usa1998_p4 : IsLeast possible_num_clicks min_clicks := by sorry end Usa1998P4 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 1998, Problem 4", compfiles-Usa1999P1,,"import Mathlib /-! USA Mathematical Olympiad 1999, Problem 1 Some checkers placed on an n × n checkerboard satisfy the following conditions: a. every square that does not contain a checker shares a side with one that does; b. given any pair of squares that contain checkers, there is a sequence of squares containing checkers, starting and ending with the given squares, such that every two consecutive squares of the sequence share a side. Prove that at least (n²-2)/3 checkers have been placed on the board. -/ namespace Usa1999P1 def checkerboard (n : ℕ) := Fin n × Fin n def adjacent {n : ℕ} : checkerboard n → checkerboard n → Prop | ⟨a1, a2⟩, ⟨b1, b2⟩ => (a1.val = b1.val ∧ a2.val = b2.val + 1) ∨ (a1.val = b1.val ∧ a2.val + 1 = b2.val) ∨ (a2.val = b2.val ∧ a1.val = b1.val + 1) ∨ (a2.val = b2.val ∧ a1.val + 1 = b1.val ) theorem usa1999_p1 (n : ℕ) (c : Finset (checkerboard n)) (ha : ∀ x : checkerboard n, x ∈ c ∨ (∃ y ∈ c, adjacent x y)) (hb : ∀ x ∈ c, ∀ y ∈ c, ∃ p : List (checkerboard n), (∀ z, z ∈ p → z ∈ c) ∧ List.IsChain adjacent p ∧ List.head? p = x ∧ List.getLast? p = y) : n^2 ≤ c.card * 3 + 2 := by sorry end Usa1999P1 ",Combinatorics,1. Named contest,,Compfiles: Usa1999P1, compfiles-Usa2000P3,"A player starts with A blue cards, B red cards and C white cards. He scores points as he plays each card. If he plays a blue card, his score is the number of white cards remaining in his hand. If he plays a red card it is three times the number of blue cards remaining in his hand. If he plays a white card, it is twice the number of red cards remaining in his hand. What is the lowest possible score as a function of A, B and C and how many different ways can it be achieved?","import Mathlib /-! # USA Mathematical Olympiad 2000, Problem 3 A player starts with A blue cards, B red cards and C white cards. He scores points as he plays each card. If he plays a blue card, his score is the number of white cards remaining in his hand. If he plays a red card it is three times the number of blue cards remaining in his hand. If he plays a white card, it is twice the number of red cards remaining in his hand. What is the lowest possible score as a function of A, B and C and how many different ways can it be achieved? -/ namespace Usa2000P3 /-- The three colors of cards. -/ inductive Card where | blue | red | white deriving BEq, DecidableEq instance : LawfulBEq Card where eq_of_beq := fun {a b} => by cases a <;> cases b <;> intro h <;> first | rfl | (exact absurd h (by decide)) rfl := fun {a} => by cases a <;> rfl /-- The score accumulated when playing the sequence of cards `l`, listed in the order they are played. When a blue card is played, the score gained is the number of white cards remaining; for a red card it is three times the number of blue cards remaining; for a white card it is twice the number of red cards remaining. -/ def score : List Card → ℕ | [] => 0 | .blue :: t => t.count .white + score t | .red :: t => 3 * t.count .blue + score t | .white :: t => 2 * t.count .red + score t /-- The canonical play: all blue cards, then all red cards, then all white cards. Every play with the same card counts is a permutation of this one. -/ def canonicalPlay (A B C : ℕ) : List Card := List.replicate A .blue ++ (List.replicate B .red ++ List.replicate C .white) /-- The finite set of all plays with `A` blue, `B` red and `C` white cards. -/ def plays (A B C : ℕ) : Finset (List Card) := (canonicalPlay A B C).permutations.toFinset abbrev lowestScore (A B C : ℕ) : ℕ := min (min (A * C) (3 * A * B)) (2 * B * C) /-- The number of different ways the lowest score can be achieved. -/ abbrev fewestWays (A B C : ℕ) : ℕ := if A = 0 ∧ B = 0 ∧ C = 0 then 1 else if C = 3 * B ∧ A = 2 * B then A + B + C else if C = 3 * B ∧ A < 2 * B then A + 1 else if 3 * A = 2 * C ∧ 2 * B < A then B + 1 else if A = 2 * B ∧ C < 3 * B then C + 1 else 1 theorem usa2000_p3 (A B C : ℕ) : IsLeast {s : ℕ | ∃ l ∈ plays A B C, score l = s} (lowestScore A B C) ∧ ((plays A B C).filter (fun l ↦ score l = lowestScore A B C)).card = fewestWays A B C := by sorry end Usa2000P3 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2000, Problem 3", compfiles-Usa2001P1,"Each of eight boxes contains six balls. Each ball has been colored with one of n colors, such that no two balls in the same box are the same color, and no two colors occur together in more than one box. Determine, with justification, the smallest integer n for which this is possible.","import Mathlib /-! # USA Mathematical Olympiad 2001, Problem 1 Each of eight boxes contains six balls. Each ball has been colored with one of n colors, such that no two balls in the same box are the same color, and no two colors occur together in more than one box. Determine, with justification, the smallest integer n for which this is possible. -/ namespace Usa2001P1 def possible_num_colors : Set ℕ := { n : ℕ | ∃ f : Fin 8 → Finset (Fin n), (∀ i, (f i).card = 6) ∧ (∀ x y : Fin n, ∀ i j : Fin 8, i ≠ j → x ∈ f i → y ∈ f i → x ≠ y → (¬ (x ∈ f j ∧ y ∈ f j))) } abbrev min_colors : ℕ := 23 theorem usa2001_p1 : IsLeast possible_num_colors min_colors := by sorry end Usa2001P1 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2001, Problem 1", compfiles-Usa2002P1,"Let S be a set with 2002 elements, and let N be an integer with 0 ≤ N ≤ 2^2002. Prove that it is possible to color every subset of S either blue or red so that the following conditions hold: a) the union of any two red subsets is red; b) the union of any two blue subsets is blue; c) there are exactly N red subsets.","import Mathlib /-! # USA Mathematical Olympiad 2002, Problem 1 Let S be a set with 2002 elements, and let N be an integer with 0 ≤ N ≤ 2^2002. Prove that it is possible to color every subset of S either blue or red so that the following conditions hold: a) the union of any two red subsets is red; b) the union of any two blue subsets is blue; c) there are exactly N red subsets. -/ namespace Usa2002P1 inductive Color : Type where | red : Color | blue : Color deriving DecidableEq instance : Fintype Color where elems := ⟨↑[Color.red, Color.blue], by decide⟩ complete := fun x => by cases x <;> decide theorem usa2002_p1 {α : Type} [DecidableEq α] [Fintype α] (hs : Fintype.card α = 2002) (N : ℕ) (hN : N ≤ 2 ^ 2002) : ∃ f : Finset α → Color, ((∀ s1 s2 : Finset α, f s1 = f s2 → f (s1 ∪ s2) = f s1) ∧ (Fintype.card { a : Finset α // f a = Color.red } = N)) := by sorry end Usa2002P1 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2002, Problem 1", compfiles-Usa2002P6,"I have an n×n sheet of stamps, from which I've been asked to tear out blocks of three adjacent stamps in a single row or column. (I can only tear along the perforations separating adjacent stamps, and each block must come out of the sheet in one piece.) Let b(n) be the smallest number of blocks I can tear out and make it impossible to tear out any more blocks. Prove that there are real constants c and d such that (1/7)n² - cn ≤ b(n) ≤ (1/5)n² - dn for all n > 0.","import Mathlib /-! # USA Mathematical Olympiad 2002, Problem 6 I have an n×n sheet of stamps, from which I've been asked to tear out blocks of three adjacent stamps in a single row or column. (I can only tear along the perforations separating adjacent stamps, and each block must come out of the sheet in one piece.) Let b(n) be the smallest number of blocks I can tear out and make it impossible to tear out any more blocks. Prove that there are real constants c and d such that (1/7)n² - cn ≤ b(n) ≤ (1/5)n² - dn for all n > 0. -/ namespace Usa2002P6 /-- A horizontal block: three adjacent stamps in a single row. -/ def hblock (i j : ℕ) : Finset (ℕ × ℕ) := {(i, j), (i, j + 1), (i, j + 2)} /-- A vertical block: three adjacent stamps in a single column. -/ def vblock (i j : ℕ) : Finset (ℕ × ℕ) := {(i, j), (i + 1, j), (i + 2, j)} /-- A block that can be torn out of the n×n sheet. -/ def IsBlock (n : ℕ) (s : Finset (ℕ × ℕ)) : Prop := (∃ i j, i < n ∧ j + 2 < n ∧ s = hblock i j) ∨ (∃ i j, i + 2 < n ∧ j < n ∧ s = vblock i j) /-- A tearing-out of pairwise disjoint blocks from the n×n sheet which makes it impossible to tear out any more blocks. -/ def IsMaximalTearing (n : ℕ) (T : Finset (Finset (ℕ × ℕ))) : Prop := (∀ s ∈ T, IsBlock n s) ∧ (∀ s ∈ T, ∀ t ∈ T, s ≠ t → Disjoint s t) ∧ (∀ s, IsBlock n s → ∃ t ∈ T, ¬ Disjoint s t) /-- A wasteful maximal tearing: fill the sheet with vertical blocks, column by column, and fill the leftover bottom rows with horizontal blocks. Used to show that a maximal tearing always exists (and for the upper bound at small `n`). -/ def trivialTearing (n : ℕ) : Finset (Finset (ℕ × ℕ)) := (Finset.range (n / 3) ×ˢ Finset.range n).image (fun p => vblock (3 * p.1) p.2) ∪ (Finset.range (n % 3) ×ˢ Finset.range (n / 3)).image (fun p => hblock (3 * (n / 3) + p.1) (3 * p.2)) /-- The phase of row `i` in the efficient tearing pattern: in row `i`, the torn blocks start at columns congruent to `phase i` modulo 5. -/ def phase (i : ℕ) : ℕ := i % 5 /-- The blocks torn out of row `i` in the efficient tearing pattern. -/ def patRowTearing (n i : ℕ) : Finset (Finset (ℕ × ℕ)) := ((Finset.range (n / 5 + 1)).filter fun k => phase i + 5 * k + 2 < n).image (fun k => hblock i (phase i + 5 * k)) ∪ (if 3 ≤ phase i then {hblock i 0} else ∅) ∪ (if 3 ≤ (n + 2 - phase i) % 5 then {hblock i (n - 3)} else ∅) /-- The efficient maximal tearing, with asymptotic density n²/5. -/ def patTearing (n : ℕ) : Finset (Finset (ℕ × ℕ)) := (Finset.range n).biUnion fun i => patRowTearing n i /-- `cov n i j` means that cell `(i, j)` is torn out by the efficient pattern. -/ def cov (n i j : ℕ) : Prop := (3 ≤ phase i ∧ j ≤ 2) ∨ (phase i ≤ j ∧ (j - phase i) % 5 ≤ 2 ∧ j - (j - phase i) % 5 + 2 < n) ∨ (3 ≤ (n + 2 - phase i) % 5 ∧ n - 3 ≤ j) /-- `b n`: the smallest number of blocks one can tear out of an n×n sheet of stamps (tearing out whole blocks of three adjacent stamps in a single row or column) making it impossible to tear out any more blocks. -/ noncomputable def b (n : ℕ) : ℕ := open Classical in Nat.find (exists_maximalTearing n) /-- **USAMO 2002, Problem 6.** There are real constants `c` and `d` such that `(1/7)n² - cn ≤ b(n) ≤ (1/5)n² - dn` for all `n > 0`. Here we take `c = 2/7` and `d = -3`. -/ theorem usa2002_p6 : ∃ c d : ℝ, ∀ n : ℕ, 0 < n → (n : ℝ) ^ 2 / 7 - c * n ≤ (b n : ℝ) ∧ (b n : ℝ) ≤ (n : ℝ) ^ 2 / 5 - d * n := by sorry end Usa2002P6 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2002, Problem 6", compfiles-Usa2003P3,"Let n be a positive integer. For every sequence of integers A = (a₀, a₁, a₂, . . . , aₙ) satisfying 0 ≤ aᵢ ≤ i, for i = 0, . . . , n, we define another sequence t(A) = (t(a₀), t(a₁), t(a₂), . . . , t(aₙ)) by setting t(aᵢ) to be the number of terms in the sequence A that precede the term aᵢ and are different from aᵢ. Show that, starting from any sequence A as above, fewer than n applications of the transformation t lead to a sequence B such that t(B) = B.","import Mathlib /-! # USA Mathematical Olympiad 2003, Problem 3 Let n be a positive integer. For every sequence of integers A = (a₀, a₁, a₂, . . . , aₙ) satisfying 0 ≤ aᵢ ≤ i, for i = 0, . . . , n, we define another sequence t(A) = (t(a₀), t(a₁), t(a₂), . . . , t(aₙ)) by setting t(aᵢ) to be the number of terms in the sequence A that precede the term aᵢ and are different from aᵢ. Show that, starting from any sequence A as above, fewer than n applications of the transformation t lead to a sequence B such that t(B) = B. -/ namespace Usa2003P3 /-- The transformation `t`: `t a i` is the number of terms of `a` that precede the `i`-th term and are different from it. We model the sequence `A = (a₀, a₁, …, aₙ)` as a function `ℕ → ℕ` where only the values at `0, 1, …, n` are constrained. The problem prescribes integer values, but the constraint `0 ≤ aᵢ` allows us to work with natural numbers throughout. -/ def t (a : ℕ → ℕ) : ℕ → ℕ := fun i => ((Finset.range i).filter (fun j => a j ≠ a i)).card /-- ## USA Mathematical Olympiad 2003, Problem 3 -/ theorem usa2003_p3 (n : ℕ) (hn : 0 < n) (a : ℕ → ℕ) (ha : ∀ i ≤ n, a i ≤ i) : ∃ k, k < n ∧ ∀ i ≤ n, t^[k] a i = t^[k+1] a i := by sorry end Usa2003P3 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2003, Problem 3", compfiles-Usa2003P6,"At the vertices of a regular hexagon are written six nonnegative integers whose sum is 2003^2003. Bert is allowed to make moves of the following form: he may pick a vertex and replace the number written there by the absolute value of the difference between the numbers written at the two neighboring vertices. Prove that Bert can make a sequence of moves, after which the number 0 appears at all six vertices.","import Mathlib /-! # USA Mathematical Olympiad 2003, Problem 6 At the vertices of a regular hexagon are written six nonnegative integers whose sum is 2003^2003. Bert is allowed to make moves of the following form: he may pick a vertex and replace the number written there by the absolute value of the difference between the numbers written at the two neighboring vertices. Prove that Bert can make a sequence of moves, after which the number 0 appears at all six vertices. -/ namespace Usa2003P6 theorem usa2003_p6 (f : ZMod 6 → ℕ) (hsum : ∑ i, f i = 2003 ^ 2003) : ∃ l : List (ZMod 6), l.foldl (fun g j => Function.update g j (Nat.dist (g (j - 1)) (g (j + 1)))) f = 0 := by sorry end Usa2003P6 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2003, Problem 6", compfiles-Usa2004P4,"Alice and Bob play a game on a 6 by 6 grid. On his turn, a player chooses a rational number not yet appearing in the grid and writes it in an empty square of the grid. Alice goes first and then the players alternate. When all squares have numbers written in them, in each row, the square with the greatest number in that row is colored black. Alice wins if he can then draw a line from the top of the grid to the bottom of the grid that stays in black squares, and Bob wins if he can't. (If two squares share a vertex, Alice can draw a line from one to the other that stays in those two squares.) Find, with proof, a winning strategy for one of the players.","import Mathlib /-! # USA Mathematical Olympiad 2004, Problem 4 Alice and Bob play a game on a 6 by 6 grid. On his turn, a player chooses a rational number not yet appearing in the grid and writes it in an empty square of the grid. Alice goes first and then the players alternate. When all squares have numbers written in them, in each row, the square with the greatest number in that row is colored black. Alice wins if he can then draw a line from the top of the grid to the bottom of the grid that stays in black squares, and Bob wins if he can't. (If two squares share a vertex, Alice can draw a line from one to the other that stays in those two squares.) Find, with proof, a winning strategy for one of the players. -/ namespace Usa2004P4 /-! ### The board, the pairing of cells, and the endgame -/ /-- A cell of the 6×6 grid: `(row, column)`, both in `Fin 6`. Row `0` is the top row of the grid and row `5` the bottom row. -/ abbrev Cell : Type := Fin 6 × Fin 6 /-- Two cells are adjacent if their squares share a vertex (Chebyshev distance at most 1). -/ def Adj (x y : Cell) : Prop := Nat.dist x.1.1 y.1.1 ≤ 1 ∧ Nat.dist x.2.1 y.2.1 ≤ 1 /-- A cell is black if it contains the greatest number in its row. -/ def IsBlack (f : Cell → ℚ) (c : Cell) : Prop := ∀ d : Cell, d.1 = c.1 → f d ≤ f c /-- Alice wins a finished board: there is a chain of black cells, consecutive cells sharing a vertex, from the top row to the bottom row. -/ def AliceWins (f : Cell → ℚ) : Prop := ∃ c d : Cell, c.1.1 = 0 ∧ d.1.1 = 5 ∧ IsBlack f c ∧ IsBlack f d ∧ Relation.ReflTransGen (fun x y => Adj x y ∧ IsBlack f x ∧ IsBlack f y) c d /-- A play of the game: the sequence of 36 moves, each a cell together with the rational number written in it. Alice makes the moves `0, 2, ..., 34` and Bob the moves `1, 3, ..., 35`. The legality conditions are that all cells played are distinct (a player must write in an empty square) and that all numbers played are distinct (a player must choose a rational not yet appearing in the grid). -/ structure Play where moves : Fin 36 → Cell × ℚ cell_inj : Function.Injective fun i => (moves i).1 val_inj : Function.Injective fun i => (moves i).2 /-- The board after the first `n` moves of a play. -/ noncomputable def prefBoard (p : Play) (n : ℕ) : Cell → Option ℚ := fun c => if h : ∃ i : Fin 36, (i : ℕ) < n ∧ (p.moves i).1 = c then some (p.moves h.choose).2 else none /-- The final board of a play: after 36 moves every cell is filled (see `prefBoard_finalBoard`), and this is the number written in each cell. -/ noncomputable def finalBoard (p : Play) : Cell → ℚ := fun c => (prefBoard p 36 c).getD 0 /-- A play follows Bob's strategy `σ` if each of Bob's moves (the odd-numbered moves) is the move prescribed by `σ` on the current board. -/ def FollowsStrategy (σ : (Cell → Option ℚ) → Cell × ℚ) (p : Play) : Prop := ∀ k : Fin 36, Odd (k : ℕ) → p.moves k = σ (prefBoard p k) /-- **USAMO 2004, Problem 4.** Bob (the second player) has a winning strategy: whenever the play follows Bob's strategy `σ` of answering a move in the first two rows by a suitable number in the paired cell (and playing anywhere in rows 3 to 6 otherwise), the final board has no black path from the top row to the bottom row, so Alice cannot win. -/ theorem usa2004_p4 : ∃ σ : (Cell → Option ℚ) → Cell × ℚ, ∀ p : Play, FollowsStrategy σ p → ¬ AliceWins (finalBoard p) := by sorry end Usa2004P4 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2004, Problem 4", compfiles-Usa2005P4,"Legs L₁, L₂, L₃, L₄ of a square table each have length n, where n is a positive integer. For how many ordered 4-tuples (k₁, k₂, k₃, k₄) of nonnegative integers can we cut a piece of length kᵢ from the end of leg Lᵢ (i = 1, 2, 3, 4) and still have a stable table? (The table is stable if it can be placed so that all four of the leg ends touch the floor. Note that a cut leg of length 0 is permitted.)","import Mathlib /-! # USA Mathematical Olympiad 2005, Problem 4 Legs L₁, L₂, L₃, L₄ of a square table each have length n, where n is a positive integer. For how many ordered 4-tuples (k₁, k₂, k₃, k₄) of nonnegative integers can we cut a piece of length kᵢ from the end of leg Lᵢ (i = 1, 2, 3, 4) and still have a stable table? (The table is stable if it can be placed so that all four of the leg ends touch the floor. Note that a cut leg of length 0 is permitted.) -/ namespace Usa2005P4 abbrev solution (n : ℕ) : ℕ := (n + 1) * (2 * n ^ 2 + 4 * n + 3) / 3 theorem usa2005_p4 (n : ℕ) : {k : ℕ × ℕ × ℕ × ℕ | k.1 ≤ n ∧ k.2.1 ≤ n ∧ k.2.2.1 ≤ n ∧ k.2.2.2 ≤ n ∧ k.1 + k.2.2.1 = k.2.1 + k.2.2.2}.ncard = solution n := by sorry end Usa2005P4 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2005, Problem 4", compfiles-Usa2005P6,"For a positive integer m, let s(m) denote the sum of the decimal digits of m. A set S of positive integers is k-stable if s(∑_{x∈X} x) = k for any nonempty subset X ⊆ S. For each integer n ≥ 2 let f(n) be the minimal k for which there exists a k-stable set with n integers. Prove that there are constants 0 < C₁ < C₂ with C₁ log₁₀ n ≤ f(n) ≤ C₂ log₁₀ n.","import Mathlib /-! # USA Mathematical Olympiad 2005, Problem 6 For a positive integer m, let s(m) denote the sum of the decimal digits of m. A set S of positive integers is k-stable if s(∑_{x∈X} x) = k for any nonempty subset X ⊆ S. For each integer n ≥ 2 let f(n) be the minimal k for which there exists a k-stable set with n integers. Prove that there are constants 0 < C₁ < C₂ with C₁ log₁₀ n ≤ f(n) ≤ C₂ log₁₀ n. -/ namespace Usa2005P6 /-- The sum of the decimal digits of `m`. -/ def s (m : ℕ) : ℕ := (Nat.digits 10 m).sum /-- A set `S` of positive integers is `k`-stable if the sum of the elements of any nonempty subset `X ⊆ S` has digit sum equal to `k`. -/ def IsStable (k : ℕ) (S : Finset ℕ) : Prop := (∀ x ∈ S, 0 < x) ∧ ∀ X ∈ S.powerset, X.Nonempty → s (∑ x ∈ X, x) = k /-- `f n` is the minimal `k` for which there exists a `k`-stable set with `n` integers. (That the defining set is nonempty is proved in `stable_exists`. -/ noncomputable def f (n : ℕ) : ℕ := sInf {k | ∃ S : Finset ℕ, IsStable k S ∧ S.card = n} theorem usa2005_p6 : ∃ C₁ C₂ : ℝ, 0 < C₁ ∧ C₁ < C₂ ∧ ∀ n : ℕ, 2 ≤ n → C₁ * Real.logb 10 n ≤ (f n : ℝ) ∧ (f n : ℝ) ≤ C₂ * Real.logb 10 n := by sorry ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2005, Problem 6", compfiles-Usa2006P2,"For a given positive integer k find, in terms of k, the minimum value of N for which there is a set of 2k + 1 distinct positive integers that has sum greater than N but every subset of size k has sum at most N / 2.","import Mathlib /-! # USA Mathematical Olympiad 2006, Problem 2 For a given positive integer k find, in terms of k, the minimum value of N for which there is a set of 2k + 1 distinct positive integers that has sum greater than N but every subset of size k has sum at most N / 2. -/ namespace Usa2006P2 abbrev solution : ℕ → ℕ := fun k ↦ 2 * k ^ 3 + 3 * k ^ 2 + 3 * k -- We formalise ""every subset of size k has sum at most N / 2"" as -- `2 * ∑ x ∈ t, x ≤ N`, which is equivalent for natural numbers. theorem usa2006_p2 (k : ℕ) (hk : 0 < k) : IsLeast {N : ℕ | ∃ s : Finset ℕ, s.card = 2 * k + 1 ∧ (∀ x ∈ s, 0 < x) ∧ N < ∑ x ∈ s, x ∧ ∀ t ⊆ s, t.card = k → 2 * ∑ x ∈ t, x ≤ N} (solution k) := by sorry end Usa2006P2 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2006, Problem 2", compfiles-Usa2006P5,"A mathematical frog jumps along the number line. The frog starts at 1, and jumps according to the following rule: if the frog is at integer n, then it can jump either to n + 1 or to n + 2 ^ (mₙ + 1), where 2 ^ mₙ is the largest power of 2 that is a factor of n. Show that if k ≥ 2 is a positive integer and i is a nonnegative integer, then the minimum number of jumps needed to reach 2 ^ i * k is greater than the minimum number of jumps needed to reach 2 ^ i.","import Mathlib /-! # USA Mathematical Olympiad 2006, Problem 5 A mathematical frog jumps along the number line. The frog starts at 1, and jumps according to the following rule: if the frog is at integer n, then it can jump either to n + 1 or to n + 2 ^ (mₙ + 1), where 2 ^ mₙ is the largest power of 2 that is a factor of n. Show that if k ≥ 2 is a positive integer and i is a nonnegative integer, then the minimum number of jumps needed to reach 2 ^ i * k is greater than the minimum number of jumps needed to reach 2 ^ i. -/ namespace Usa2006P5 /-- The exponent of the largest power of `2` dividing the integer `x` (the 2-adic valuation of `x`). -/ noncomputable def nu (x : ℤ) : ℕ := x.natAbs.factorization 2 /-- `ValidPath x ss` holds when the list `ss` of jump lengths can legally be performed by the frog starting at position `x`: each jump has length `1` or length `2 ^ (ν₂ n + 1)`, where `n` is the position the frog jumps from. -/ def ValidPath : ℤ → List ℕ → Prop | _, [] => True | x, s :: ss => (s = 1 ∨ s = 2 ^ (nu x + 1)) ∧ ValidPath (x + (s : ℤ)) ss /-- The frog can reach position `m` in exactly `j` jumps starting from `1`. -/ def Reachable (m : ℤ) (j : ℕ) : Prop := ∃ ss : List ℕ, ValidPath 1 ss ∧ (1 : ℤ) + (ss.sum : ℤ) = m ∧ ss.length = j /-- The minimum number of jumps the frog needs to reach position `m`. -/ noncomputable def minJumps (m : ℤ) : ℕ := sInf { j | Reachable m j } theorem usa2006_p5 (k : ℕ) (hk : 2 ≤ k) (i : ℕ) : minJumps ((2 : ℤ) ^ i * (k : ℤ)) > minJumps ((2 : ℤ) ^ i) := by sorry ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2006, Problem 5", compfiles-Usa2007P3,"Let S be a set containing n² + n − 1 elements. Suppose that the n-element subsets of S are partitioned into two classes. Prove that there are at least n pairwise disjoint sets in the same class.","import Mathlib /-! # USA Mathematical Olympiad 2007, Problem 3 Let S be a set containing n² + n − 1 elements. Suppose that the n-element subsets of S are partitioned into two classes. Prove that there are at least n pairwise disjoint sets in the same class. -/ namespace Usa2007P3 theorem usa2007_p3 (n : ℕ) (hn : 0 < n) {α : Type*} [DecidableEq α] (S : Finset α) (hS : S.card = n ^ 2 + n - 1) (col : Finset α → Bool) : ∃ F : Finset (Finset α), n ≤ F.card ∧ (∀ A ∈ F, A ⊆ S ∧ A.card = n) ∧ (F : Set (Finset α)).PairwiseDisjoint id ∧ ∃ b : Bool, ∀ A ∈ F, col A = b := by sorry end Usa2007P3 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2007, Problem 3", compfiles-Usa2008P3,"Let n be a positive integer. Denote by Sₙ the set of points (x, y) with integer coordinates such that |x| + |y + 1/2| < n. A path is a sequence of distinct points (x₁, y₁), (x₂, y₂), ..., (x_ℓ, y_ℓ) in Sₙ such that, for i = 2, ..., ℓ, the distance between (xᵢ, yᵢ) and (xᵢ₋₁, yᵢ₋₁) is 1. Prove that the points in Sₙ cannot be partitioned into fewer than n paths.","import Mathlib /-! # USA Mathematical Olympiad 2008, Problem 3 Let n be a positive integer. Denote by Sₙ the set of points (x, y) with integer coordinates such that |x| + |y + 1/2| < n. A path is a sequence of distinct points (x₁, y₁), (x₂, y₂), ..., (x_ℓ, y_ℓ) in Sₙ such that, for i = 2, ..., ℓ, the distance between (xᵢ, yᵢ) and (xᵢ₋₁, yᵢ₋₁) is 1. Prove that the points in Sₙ cannot be partitioned into fewer than n paths. -/ namespace Usa2008P3 /-- The half-width of the row of `S n` at height `y`: the row consists of the points `(x, y)` with `|x| ≤ rowK n y`. -/ def rowK (n : ℕ) (y : ℤ) : ℤ := if 0 ≤ y then (n : ℤ) - 1 - y else (n : ℤ) + y /-- The set `Sₙ` of the problem, namely the integer points `(x, y)` with `|x| + |y + 1/2| < n`. Multiplying by two, this is `2|x| + |2y + 1| < 2n`, and we build the set row by row. -/ noncomputable def S (n : ℕ) : Finset (ℤ × ℤ) := (Finset.Icc (-(n : ℤ)) ((n : ℤ) - 1)).biUnion fun y ↦ (Finset.Icc (-(rowK n y)) (rowK n y)) ×ˢ {y} /-- Two lattice points are adjacent when their (Manhattan) distance is 1. -/ def Adj (p q : ℤ × ℤ) : Prop := |p.1 - q.1| + |p.2 - q.2| = 1 /-- USAMO 2008, Problem 3: any partition of `Sₙ` into paths uses at least `n` paths. We model a partition as a list of lists of points: each list is a path (its points are distinct, lie in `S n`, and consecutive points are adjacent), the lists are pairwise disjoint, and together they cover `S n`. -/ theorem usa2008_p3 (n : ℕ) (_hn : 0 < n) (paths : List (List (ℤ × ℤ))) (hmem : ∀ P ∈ paths, ∀ p ∈ P, p ∈ S n) (hnodup : ∀ P ∈ paths, P.Nodup) (hchain : ∀ P ∈ paths, P.IsChain Adj) (hdisj : paths.Pairwise List.Disjoint) (hcover : ∀ p ∈ S n, ∃ P ∈ paths, p ∈ P) : n ≤ paths.length := by sorry end Usa2008P3 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2008, Problem 3", compfiles-Usa2008P5,"Three nonnegative real numbers r₁, r₂, r₃ are written on a blackboard. These numbers have the property that there exist integers a₁, a₂, a₃, not all zero, satisfying a₁r₁ + a₂r₂ + a₃r₃ = 0. We are permitted to perform the following operation: find two numbers x, y on the blackboard with x ≤ y, then erase y and write y − x in its place. Prove that after a finite number of such operations, we can end up with at least one 0 on the blackboard.","import Mathlib /-! # USA Mathematical Olympiad 2008, Problem 5 Three nonnegative real numbers r₁, r₂, r₃ are written on a blackboard. These numbers have the property that there exist integers a₁, a₂, a₃, not all zero, satisfying a₁r₁ + a₂r₂ + a₃r₃ = 0. We are permitted to perform the following operation: find two numbers x, y on the blackboard with x ≤ y, then erase y and write y − x in its place. Prove that after a finite number of such operations, we can end up with at least one 0 on the blackboard. -/ namespace Usa2008P5 /-- One legal operation of the game: choose two distinct positions `i` and `j` with `r j ≤ r i`, erase the number `r i` and write `r i - r j` in its place. -/ abbrev Step (r r' : Fin 3 → ℝ) : Prop := ∃ i j : Fin 3, i ≠ j ∧ r j ≤ r i ∧ r' = Function.update r i (r i - r j) theorem usa2008_p5 (r : Fin 3 → ℝ) (hr : ∀ i, 0 ≤ r i) (a : Fin 3 → ℤ) (ha : a ≠ 0) (hsum : ∑ i, (a i : ℝ) * r i = 0) : ∃ r' : Fin 3 → ℝ, Relation.ReflTransGen Step r r' ∧ ∃ i, r' i = 0 := by sorry end Usa2008P5 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2008, Problem 5", compfiles-Usa2008P6,"At a certain mathematical conference, every pair of mathematicians are either friends or strangers. At mealtime, every participant eats in one of two large dining rooms. Each mathematician insists upon eating in a room which contains an even number of his or her friends. Prove that the number of ways that the mathematicians may be split between the two rooms is a power of two (i.e., is of the form 2^k for some positive integer k).","import Mathlib /-! # USA Mathematical Olympiad 2008, Problem 6 At a certain mathematical conference, every pair of mathematicians are either friends or strangers. At mealtime, every participant eats in one of two large dining rooms. Each mathematician insists upon eating in a room which contains an even number of his or her friends. Prove that the number of ways that the mathematicians may be split between the two rooms is a power of two (i.e., is of the form 2^k for some positive integer k). -/ namespace Usa2008P6 theorem usa2008_p6 (n : ℕ) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] : ∃ k : ℕ, Fintype.card {x : Fin n → ZMod 2 // ∀ v : Fin n, Even ((G.neighborFinset v).filter fun u => x u = x v).card} = 2 ^ k := by sorry end Usa2008P6 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2008, Problem 6", compfiles-Usa2009P2,"Let n be a positive integer. Determine the size of the largest subset of {−n, −n+1, ..., n−1, n} which does not contain three elements a, b, c (not necessarily distinct) satisfying a + b + c = 0.","import Mathlib /-! # USA Mathematical Olympiad 2009, Problem 2 Let n be a positive integer. Determine the size of the largest subset of {−n, −n+1, ..., n−1, n} which does not contain three elements a, b, c (not necessarily distinct) satisfying a + b + c = 0. -/ namespace Usa2009P2 /-- A set of integers is called *good* if it does not contain three elements `a`, `b`, `c` (not necessarily distinct) satisfying `a + b + c = 0`. -/ abbrev IsGood (A : Finset ℤ) : Prop := ∀ a ∈ A, ∀ b ∈ A, ∀ c ∈ A, a + b + c ≠ 0 abbrev answer (n : ℕ) : ℕ := if Even n then n else n + 1 theorem usa2009_p2 (n : ℕ) (hn : 0 < n) : IsGreatest {k : ℕ | ∃ A : Finset ℤ, A ⊆ Finset.Icc (-(n : ℤ)) (n : ℤ) ∧ IsGood A ∧ A.card = k} (answer n) := by sorry end Usa2009P2 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2009, Problem 2", compfiles-Usa2010P2,"There are $n$ students standing in a circle, one behind the other. The students have heights $h_1 < h_2 < \dots < h_n$. If a student with height $h_k$ is standing directly behind a student with height $h_{k-2}$ or less, the two students are permitted to switch places. Prove that it is not possible to make more than $\binom{n}{3}$ such switches before reaching a position in which no further switches are possible.","import Mathlib /-! # USA Mathematical Olympiad 2010, Problem 2 There are $n$ students standing in a circle, one behind the other. The students have heights $h_1 < h_2 < \dots < h_n$. If a student with height $h_k$ is standing directly behind a student with height $h_{k-2}$ or less, the two students are permitted to switch places. Prove that it is not possible to make more than $\binom{n}{3}$ such switches before reaching a position in which no further switches are possible. -/ namespace Usa2010P2 /-- **USAMO 2010 Problem 2.** There are `n` students standing in a circle, one behind the other, with heights `h₁ < h₂ < ⋯ < hₙ`. If a student with height `hₖ` is standing directly behind a student with height `hₖ₋₂` or less, the two students are permitted to switch places. Then it is not possible to make more than `C(n, 3)` such switches. We model the circle by positions in `ZMod n` (position `p + 1` is directly behind position `p`), the students by their height ranks in `Fin n`, and a sequence of switches by the list of positions at which they occur; `Legal` asserts that every switch is permitted. -/ theorem usa2010_p2 {n : ℕ} (e : Fin n ≃ ZMod n) (ps : List (ZMod n)) (h : Legal e ps) : ps.length ≤ n.choose 3 := by sorry end Usa2010P2 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2010, Problem 2", compfiles-Usa2010P6,"There are 68 ordered pairs (not necessarily distinct) of nonzero integers on a blackboard. It's known that for no integer k does both (k, k) and (−k, −k) appear. A student erases some of the 136 integers such that no two erased integers have sum zero, and scores one point for each ordered pair with at least one erased integer. What is the maximum possible score the student can guarantee?","import Mathlib /-! # USA Mathematical Olympiad 2010, Problem 6 There are 68 ordered pairs (not necessarily distinct) of nonzero integers on a blackboard. It's known that for no integer k does both (k, k) and (−k, −k) appear. A student erases some of the 136 integers such that no two erased integers have sum zero, and scores one point for each ordered pair with at least one erased integer. What is the maximum possible score the student can guarantee? -/ namespace Usa2010P6 /-- A choice of integers to erase is valid if no two erased integers sum to zero. (If a value `x` is erased at some position, erasing every occurrence of `x` is never worse, so the optimal strategies correspond exactly to sets of values `T` with `x ∈ T → -x ∉ T`.) -/ def ValidErase (T : Finset ℤ) : Prop := ∀ x ∈ T, -x ∉ T /-- The score obtained by erasing the set `T` from the board `L`: one point for each ordered pair with at least one erased entry. -/ def score (L : List (ℤ × ℤ)) (T : Finset ℤ) : ℕ := (L.filter (fun p => decide (p.1 ∈ T ∨ p.2 ∈ T))).length /-- A valid board: 68 ordered pairs of nonzero integers such that for no `k` do both `(k, k)` and `(-k, -k)` appear. -/ structure ValidBoard (L : List (ℤ × ℤ)) : Prop where length_eq : L.length = 68 nonzero : ∀ p ∈ L, p.1 ≠ 0 ∧ p.2 ≠ 0 no_both_loops : ∀ k : ℤ, (k, k) ∈ L → (-k, -k) ∉ L /-- The maximum score the student can guarantee. -/ abbrev N : ℕ := 43 theorem usa2010_p6 : IsGreatest {m : ℕ | ∀ L : List (ℤ × ℤ), ValidBoard L → ∃ T : Finset ℤ, ValidErase T ∧ m ≤ score L T} N := by sorry end Usa2010P6 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2010, Problem 6", compfiles-Usa2011P2,"An integer is assigned to each vertex of a regular pentagon so that the sum of the five integers is 2011. A turn of a solitaire game consists of subtracting an integer m (not necessarily positive) from each of the integers at two neighboring vertices and adding 2m to the opposite vertex, which is not adjacent to either of the first two vertices. (The amount m and the vertices chosen can vary from turn to turn.) The game is won at a certain vertex if, after some number of turns, that vertex has the number 2011 and the other four vertices have the number 0. Prove that for any choice of the initial integers, there is exactly one vertex at which the game can be won.","import Mathlib /-! # USA Mathematical Olympiad 2011, Problem 2 An integer is assigned to each vertex of a regular pentagon so that the sum of the five integers is 2011. A turn of a solitaire game consists of subtracting an integer m (not necessarily positive) from each of the integers at two neighboring vertices and adding 2m to the opposite vertex, which is not adjacent to either of the first two vertices. (The amount m and the vertices chosen can vary from turn to turn.) The game is won at a certain vertex if, after some number of turns, that vertex has the number 2011 and the other four vertices have the number 0. Prove that for any choice of the initial integers, there is exactly one vertex at which the game can be won. -/ namespace Usa2011P2 /-- A configuration of the game: an integer at each vertex of the pentagon. The vertices are indexed by `ZMod 5`, so that the neighbors of vertex `i` are `i - 1` and `i + 1`. -/ abbrev Config := ZMod 5 → ℤ /-- Reachability of configurations. A turn at the edge `i, i + 1` with amount `m` subtracts `m` from the values at the vertices `i` and `i + 1` and adds `2 * m` to the value at the opposite vertex `i + 3` (the unique vertex adjacent to neither of them). The effects of successive turns add up, so a sequence of turns is described by integers `x j`, the sum of the amounts of the turns whose opposite vertex is `j`. Such a turn has edge `j + 2, j + 3`, hence vertex `i` gains `2 * x i` in total and loses `x (i + 2) + x (i + 3)`. Conversely any choice of `x` is realized by doing one turn per edge. -/ def Reachable (a b : Config) : Prop := ∃ x : ZMod 5 → ℤ, ∀ i, b i = a i + 2 * x i - x (i + 2) - x (i + 3) /-- The game is won at vertex `v` from the configuration `a` if the configuration with value 2011 at `v` and 0 at the other four vertices is reachable from `a`. -/ def WinAt (a : Config) (v : ZMod 5) : Prop := Reachable a (Pi.single v 2011) /-- The invariant of the game: the weighted sum of the values, where the value at vertex `i` has weight `i`. A turn changes it by a multiple of 5. -/ def invariant (a : Config) : ZMod 5 := ∑ i, i * (a i : ZMod 5) theorem usa2011_p2 (a : Config) (hsum : ∑ i, a i = 2011) : ∃! v, WinAt a v := by sorry end Usa2011P2 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2011, Problem 2", compfiles-Usa2012P1,"Find all integers n ≥ 3 such that among any n positive real numbers a₁, a₂, ..., aₙ with max(a₁, a₂, ..., aₙ) ≤ n · min(a₁, a₂, ..., aₙ), there exist three that are the side lengths of an acute triangle.","import Mathlib /-! # USA Mathematical Olympiad 2012, Problem 1 Find all integers n ≥ 3 such that among any n positive real numbers a₁, a₂, ..., aₙ with max(a₁, a₂, ..., aₙ) ≤ n · min(a₁, a₂, ..., aₙ), there exist three that are the side lengths of an acute triangle. -/ namespace Usa2012P1 /-- Three real numbers are the side lengths of an acute triangle iff the strict triangle inequalities hold and the sum of the squares of any two of them is strictly greater than the square of the third one. -/ def IsAcuteTriple (x y z : ℝ) : Prop := x + y > z ∧ y + z > x ∧ z + x > y ∧ x ^ 2 + y ^ 2 > z ^ 2 ∧ y ^ 2 + z ^ 2 > x ^ 2 ∧ z ^ 2 + x ^ 2 > y ^ 2 /-- The property of `n` that the problem asks to characterize: among any `n` positive real numbers whose maximum is at most `n` times their minimum (here expressed as `a i ≤ n * a j` for all indices `i j`), some three are the side lengths of an acute triangle. -/ def IsGood (n : ℕ) : Prop := ∀ a : Fin n → ℝ, (∀ i, 0 < a i) → (∀ i j, a i ≤ (n : ℝ) * a j) → ∃ i j k, i ≠ j ∧ j ≠ k ∧ k ≠ i ∧ IsAcuteTriple (a i) (a j) (a k) abbrev solution_set : Set ℕ := {n | 13 ≤ n} theorem usa2012_p1 (n : ℕ) : 3 ≤ n ∧ IsGood n ↔ n ∈ solution_set := by sorry end Usa2012P1 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2012, Problem 1", compfiles-Usa2012P2,"A circle is divided into 432 congruent arcs by 432 points. The points are colored in four colors such that some 108 points are colored Red, some 108 points are colored Green, some 108 points are colored Blue, and the remaining 108 points are colored Yellow. Prove that one can choose three points of each color in such a way that the four triangles formed by the chosen points of the same color are congruent. ## Formalization notes We identify the 432 points with `ZMod 432`; a rotation of the circle is then addition of a constant. The coloring is a map `color : ZMod 432 → Fin 4`, where `0, 1, 2, 3` stand for red, green, blue and yellow. We prove the stronger statement that the four triangles can be chosen to be rotations of one another: there is a red triangle `U` and rotations `t₁, t₂, t₃` such that `U + t₁`, `U + t₂`, `U + t₃` are green, blue and yellow triangles. Since the pairwise arc distances of the vertices are preserved by rotations, the four triangles are congruent (equal chord lengths, hence SSS).","import Mathlib /-! # USA Mathematical Olympiad 2012, Problem 2 A circle is divided into 432 congruent arcs by 432 points. The points are colored in four colors such that some 108 points are colored Red, some 108 points are colored Green, some 108 points are colored Blue, and the remaining 108 points are colored Yellow. Prove that one can choose three points of each color in such a way that the four triangles formed by the chosen points of the same color are congruent. ## Formalization notes We identify the 432 points with `ZMod 432`; a rotation of the circle is then addition of a constant. The coloring is a map `color : ZMod 432 → Fin 4`, where `0, 1, 2, 3` stand for red, green, blue and yellow. We prove the stronger statement that the four triangles can be chosen to be rotations of one another: there is a red triangle `U` and rotations `t₁, t₂, t₃` such that `U + t₁`, `U + t₂`, `U + t₃` are green, blue and yellow triangles. Since the pairwise arc distances of the vertices are preserved by rotations, the four triangles are congruent (equal chord lengths, hence SSS). -/ namespace Usa2012P2 /-- The arc distance between two of the 432 points: the number of unit arcs in the shorter of the two arcs joining them. The chord through `x` and `y` has length `2R sin(π·d/432)` with `d = arcDist x y`, which is strictly increasing in `d ∈ [0, 216]`; hence two inscribed triangles with equal pairwise arc distances have equal side lengths and are congruent. -/ def arcDist (x y : ZMod 432) : ℕ := min (x - y).val (y - x).val theorem usa2012_p2 (color : ZMod 432 → Fin 4) (hcolor : ∀ i, (Finset.univ.filter fun x => color x = i).card = 108) : ∃ (U : Finset (ZMod 432)) (t₁ t₂ t₃ : ZMod 432), U.card = 3 ∧ (∀ x ∈ U, color x = 0) ∧ (∀ x ∈ U, color (x + t₁) = 1) ∧ (∀ x ∈ U, color (x + t₂) = 2) ∧ (∀ x ∈ U, color (x + t₃) = 3) ∧ (∀ x ∈ U, ∀ y ∈ U, arcDist x y = arcDist (x + t₁) (y + t₁)) ∧ (∀ x ∈ U, ∀ y ∈ U, arcDist x y = arcDist (x + t₂) (y + t₂)) ∧ (∀ x ∈ U, ∀ y ∈ U, arcDist x y = arcDist (x + t₃) (y + t₃)) := by sorry end Usa2012P2 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2012, Problem 2", compfiles-Usa2013P2,"For a positive integer $n \ge 3$ plot $n$ equally spaced points around a circle. Label one of them $A$, and place a marker at $A$. One may move the marker forward in a clockwise direction to either the next point or the point after that. Hence there are a total of $2n$ distinct moves available; two from each point. Let $a_n$ count the number of ways to advance around the circle exactly twice, beginning and ending at $A$, without repeating a move. Prove that $a_{n-1} + a_n = 2^n$ for all $n \ge 4$.","import Mathlib /-! # USA Mathematical Olympiad 2013, Problem 2 For a positive integer $n \ge 3$ plot $n$ equally spaced points around a circle. Label one of them $A$, and place a marker at $A$. One may move the marker forward in a clockwise direction to either the next point or the point after that. Hence there are a total of $2n$ distinct moves available; two from each point. Let $a_n$ count the number of ways to advance around the circle exactly twice, beginning and ending at $A$, without repeating a move. Prove that $a_{n-1} + a_n = 2^n$ for all $n \ge 4$. -/ namespace Usa2013P2 /-! ## Setting up the count We unroll the two trips around the circle into the integer interval `{0, 1, …, 2n}`: a path becomes a walk from `0` to `2n` in steps of size `1` or `2`, and a *move* is a pair (starting point mod `n`, step length). Recording, for each `i ∈ {0, …, 2n}`, whether the walk visits `i` yields a `2 × (n+1)` zero-one matrix ``` [ p₀ p₁ … p_{n-1} p_n ] [ p_n p_{n+1} … p_{2n-1} p_{2n} ] ``` with `p₀ = p_{2n} = 1`. The conditions of the problem translate as follows: * steps have size at most `2` iff no two horizontally adjacent entries are both `0`; * no repeated move of length `2` iff no column is `(0,0)` (points `i` and `i+n` are both skipped exactly when the same length-2 move is used twice); * no repeated move of length `1` iff no two adjacent columns are both `(1,1)` (points `i, i+1, i+n, i+n+1` are all visited exactly when the same length-1 move is used twice). Conversely every such matrix determines a unique valid path, so `a_n` counts these matrices. Each column is one of `u = (1,0)`, `v = (0,1)`, `w = (1,1)` (encoded as `0, 1, 2 : Fin 3`), and the conditions say exactly that adjacent columns are distinct, the first column is `u` or `w`, the last column is `v` or `w`, and the first column is `w` iff the last one is. Sequences starting with `u` must end in `v`, and sequences starting with `w` must end in `w`, giving `a_n = x_n + y_n` below. We then follow the first solution in Evan Chen's *USAMO 2013 Solution Notes*: by symmetry (`Fin 3` column relabeling) and the ""delete the last column"" bijection one gets `x_{n+1} = x_n + y_n`, `y_{n+1} = 2 * x_n` and `2 * x_n + y_n = 2^n`, hence `a_{n+1} + a_n = 2 ^ (n+1)`. -/ /-- A sequence of `n+1` columns, each column one of the three symbols of `Fin 3` (`0 = u`, `1 = v`, `2 = w`). -/ abbrev ColSeq (n : ℕ) := Fin (n + 1) → Fin 3 /-- Adjacent columns are distinct. -/ abbrev AdjDistinct {n : ℕ} (c : ColSeq n) : Prop := ∀ i : Fin n, c i.castSucc ≠ c i.succ /-- The number of column sequences of length `n+1` with distinct adjacent columns starting with `s` and ending with `t`. -/ noncomputable def countCol (n : ℕ) (s t : Fin 3) : ℕ := Nat.card {c : ColSeq n // AdjDistinct c ∧ c 0 = s ∧ c (Fin.last n) = t} /-- The number of ways to advance around the circle exactly twice without repeating a move: sequences starting with `u = 0` end in `v = 1`, and sequences starting with `w = 2` end in `w = 2`. -/ noncomputable def a (n : ℕ) : ℕ := countCol n 0 1 + countCol n 2 2 theorem usa2013_p2 (n : ℕ) (hn : 4 ≤ n) : a (n - 1) + a n = 2 ^ n := by sorry end Usa2013P2 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2013, Problem 2", compfiles-Usa2013P3,"Let n be a positive integer. There are n(n+1)/2 tokens, each with a black side and a white side, arranged into an equilateral triangle, with the biggest row containing n tokens. Initially, each token has the white side up. An operation is to choose a line parallel to the sides of the triangle, and flip all the tokens on that line. A configuration is called admissible if it can be obtained from the initial configuration by performing a finite number of operations. For each admissible configuration C, let f(C) denote the smallest number of operations required to obtain C from the initial configuration. Find the maximum value of f(C), where C varies over all admissible configurations.","import Mathlib /-! # USA Mathematical Olympiad 2013, Problem 3 Let n be a positive integer. There are n(n+1)/2 tokens, each with a black side and a white side, arranged into an equilateral triangle, with the biggest row containing n tokens. Initially, each token has the white side up. An operation is to choose a line parallel to the sides of the triangle, and flip all the tokens on that line. A configuration is called admissible if it can be obtained from the initial configuration by performing a finite number of operations. For each admissible configuration C, let f(C) denote the smallest number of operations required to obtain C from the initial configuration. Find the maximum value of f(C), where C varies over all admissible configurations. -/ namespace Usa2013P3 /-! ### Basic definitions -/ /-- The tokens are indexed by pairs `(a, b)` of natural numbers with `a + b < n`. One should think of barycentric coordinates `(a, b, c)` with `a + b + c = n - 1`, so that `c = n - 1 - a - b` is determined. -/ def Token (n : ℕ) := { p : ℕ × ℕ // p.1 + p.2 < n } lemma lt_left {n a b : ℕ} (h : a + b < n) : a < n := by lia lemma lt_right {n a b : ℕ} (h : a + b < n) : b < n := by lia lemma lt_third {n a b : ℕ} (h : a + b < n) : n - 1 - a - b < n := by lia /-- A choice of lines to flip: for each of the three directions and each `i < n`, whether the `i`-th line in that direction is flipped. The three lines through the token `(a, b, c)` are the `a`-th, `b`-th and `c`-th lines of the three directions respectively. -/ @[ext] structure Moves (n : ℕ) where x : Fin n → Bool y : Fin n → Bool z : Fin n → Bool /-- The configuration reached from the initial (all-white) configuration by performing the moves `v`: token `(a, b)` ends up black iff an odd number of the three lines through it were flipped. -/ def applyMoves {n : ℕ} (v : Moves n) (t : Token n) : Bool := v.x ⟨t.1.1, lt_left t.2⟩ ^^ v.y ⟨t.1.2, lt_right t.2⟩ ^^ v.z ⟨n - 1 - t.1.1 - t.1.2, lt_third t.2⟩ /-- A configuration is admissible if it can be obtained from the initial configuration by a finite number of operations. Since the operations commute and are involutions, every sequence of operations is described by a `Moves`. -/ def Admissible {n : ℕ} (C : Token n → Bool) : Prop := ∃ v : Moves n, applyMoves v = C /-- The number of operations in a `Moves`: the total number of flipped lines. -/ def weight {n : ℕ} (v : Moves n) : ℕ := (Finset.univ.filter fun i => v.x i = true).card + (Finset.univ.filter fun i => v.y i = true).card + (Finset.univ.filter fun i => v.z i = true).card /-- `f C` is the smallest number of operations required to obtain `C`. -/ noncomputable def f {n : ℕ} (C : Token n → Bool) : ℕ := sInf {m : ℕ | ∃ v : Moves n, applyMoves v = C ∧ weight v = m} abbrev answer (n : ℕ) : ℕ := 6 * (n / 4) + n % 4 theorem usa2013_p3 (n : ℕ) (hn : 0 < n) : IsGreatest {m : ℕ | ∃ C : Token n → Bool, Admissible C ∧ f C = m} (answer n) := by sorry end Usa2013P3 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2013, Problem 3", compfiles-Usa2014P4,"Let k be a positive integer. Two players A and B play a game on an infinite grid of regular hexagons. Initially all the grid cells are empty. Then the players alternately take turns with A moving first. In her move, A may choose two adjacent hexagons in the grid which are empty and place a counter in both of them. In his move, B may choose any counter on the board and remove it. If at any time there are k consecutive grid cells in a line all of which contain a counter, A wins. Find the minimum value of k for which A cannot win in a finite number of moves, or prove that no such minimum value exists.","import Mathlib /-! # USA Mathematical Olympiad 2014, Problem 4 Let k be a positive integer. Two players A and B play a game on an infinite grid of regular hexagons. Initially all the grid cells are empty. Then the players alternately take turns with A moving first. In her move, A may choose two adjacent hexagons in the grid which are empty and place a counter in both of them. In his move, B may choose any counter on the board and remove it. If at any time there are k consecutive grid cells in a line all of which contain a counter, A wins. Find the minimum value of k for which A cannot win in a finite number of moves, or prove that no such minimum value exists. -/ namespace Usa2014P4 /-- A cell of the hexagonal grid, given in axial coordinates. -/ abbrev Cell := ℤ × ℤ /-- The six unit steps between adjacent cells of the grid. -/ def offsets : Finset Cell := {(1, 0), (-1, 0), (0, 1), (0, -1), (1, -1), (-1, 1)} /-- Two cells are adjacent when their difference is one of the six unit steps. -/ def Adj (c d : Cell) : Prop := (d.1 - c.1, d.2 - c.2) ∈ offsets instance (c d : Cell) : Decidable (Adj c d) := by unfold Adj infer_instance /-- The three (undirected) line directions of the grid. -/ def Dirs : Finset Cell := {(1, 0), (0, 1), (1, -1)} /-- The cell reached from `p` by making `i` steps in direction `d`. -/ def step (p : Cell) (d : Cell) (i : ℕ) : Cell := (p.1 + (i : ℤ) * d.1, p.2 + (i : ℤ) * d.2) /-- `A` has won on the board `s`: some line of `k` consecutive cells all carry a counter. -/ def Winning (k : ℕ) (s : Finset Cell) : Prop := ∃ d ∈ Dirs, ∃ p : Cell, ∀ i : ℕ, i < k → step p d i ∈ s /-- A move of player `A`: place counters on two empty adjacent cells. -/ def AMove (s s' : Finset Cell) : Prop := ∃ c₁ c₂ : Cell, c₁ ≠ c₂ ∧ Adj c₁ c₂ ∧ c₁ ∉ s ∧ c₂ ∉ s ∧ s' = insert c₁ (insert c₂ s) /-- A move of player `B`: remove one counter from the board. -/ def BMove (s t : Finset Cell) : Prop := ∃ c ∈ s, t = s.erase c /-- `AForce k s` means that from the board `s`, with `A` to move, `A` can force a win in finitely many moves regardless of how `B` plays. Since the witness is an inductive tree covering all of `B`'s responses, every play following the strategy ends in a win after finitely many moves. -/ inductive AForce (k : ℕ) : Finset Cell → Prop | of_win {s s'} : AMove s s' → Winning k s' → AForce k s | of_step {s s'} : AMove s s' → (∀ t, BMove s' t → AForce k t) → AForce k s /-- `A` can win the game with parameter `k` in finitely many moves. -/ def ACanWin (k : ℕ) : Prop := AForce k ∅ abbrev solution : ℕ := 6 theorem usa2014_p4 : IsLeast {k : ℕ | 0 < k ∧ ¬ ACanWin k} solution := by sorry end Usa2014P4 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2014, Problem 4", compfiles-Usa2015P3,"Let S = {1, 2, ..., n}, where n ≥ 1. Each of the 2ⁿ subsets of S is to be colored red or blue. (The subset itself is assigned a color and not its individual elements.) For any set T ⊆ S, we then write f(T) for the number of subsets of T that are blue. Determine the number of colorings that satisfy the following condition: for any subsets T₁ and T₂ of S, f(T₁) f(T₂) = f(T₁ ∪ T₂) f(T₁ ∩ T₂).","import Mathlib /-! # USA Mathematical Olympiad 2015, Problem 3 Let S = {1, 2, ..., n}, where n ≥ 1. Each of the 2ⁿ subsets of S is to be colored red or blue. (The subset itself is assigned a color and not its individual elements.) For any set T ⊆ S, we then write f(T) for the number of subsets of T that are blue. Determine the number of colorings that satisfy the following condition: for any subsets T₁ and T₂ of S, f(T₁) f(T₂) = f(T₁ ∪ T₂) f(T₁ ∩ T₂). -/ namespace Usa2015P3 /-- A coloring of the subsets of `Fin n`; `true` means blue, `false` means red. -/ abbrev Coloring (n : ℕ) : Type := Finset (Fin n) → Bool /-- `blueCard c T` is the number of subsets of `T` that are colored blue by `c`; this is the function `f` of the problem statement. -/ def blueCard {n : ℕ} (c : Coloring n) (T : Finset (Fin n)) : ℕ := (T.powerset.filter fun W => c W = true).card /-- A coloring is *valid* if it satisfies the multiplicative condition of the problem. -/ def IsValid {n : ℕ} (c : Coloring n) : Prop := ∀ T₁ T₂ : Finset (Fin n), blueCard c T₁ * blueCard c T₂ = blueCard c (T₁ ∪ T₂) * blueCard c (T₁ ∩ T₂) /-- The colorings that the problem asks to count. -/ def ValidColorings (n : ℕ) : Type := {c : Coloring n // IsValid c} instance (n : ℕ) : DecidablePred (@IsValid n) := fun _ => Fintype.decidableForallFintype instance (n : ℕ) : Fintype (ValidColorings n) := Subtype.fintype _ abbrev NumberOfColorings (n : ℕ) : ℕ := 3 ^ n + 1 theorem usa2015_p3 (n : ℕ) : Fintype.card (ValidColorings n) = NumberOfColorings n := by sorry end Usa2015P3 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2015, Problem 3", compfiles-Usa2015P6,"Fix $0 < \lambda < 1$, and let $A$ be a multiset of positive integers. Let $A_n = \{a \in A : a \le n\}$. Assume that for every $n \in \mathbb{N}$, the multiset $A_n$ contains at most $n\lambda$ numbers. Show that there are infinitely many $n \in \mathbb{N}$ for which the sum of the elements in $A_n$ is at most $\frac{n(n+1)}{2}\lambda$.","import Mathlib /-! # USA Mathematical Olympiad 2015, Problem 6 Fix $0 < \lambda < 1$, and let $A$ be a multiset of positive integers. Let $A_n = \{a \in A : a \le n\}$. Assume that for every $n \in \mathbb{N}$, the multiset $A_n$ contains at most $n\lambda$ numbers. Show that there are infinitely many $n \in \mathbb{N}$ for which the sum of the elements in $A_n$ is at most $\frac{n(n+1)}{2}\lambda$. -/ namespace Usa2015P6 theorem usa2015_p6 {lam : ℝ} (hlam : 0 < lam ∧ lam < 1) (A : ℕ → ℕ) (hA : ∀ n : ℕ, ∑ m ∈ Finset.Icc 1 n, (A m : ℝ) ≤ lam * n) : Set.Infinite {n : ℕ | ∑ m ∈ Finset.Icc 1 n, m * (A m : ℝ) ≤ lam * n * (n + 1) / 2} := by sorry end Usa2015P6 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2015, Problem 6", compfiles-Usa2016P1,"Let X₁, X₂, …, X₁₀₀ be a sequence of mutually distinct nonempty subsets of a set S. Any two sets Xᵢ and Xᵢ₊₁ are disjoint and their union is not the whole set S, that is, Xᵢ ∩ Xᵢ₊₁ = ∅ and Xᵢ ∪ Xᵢ₊₁ ≠ S, for all i ∈ {1, …, 99}. Find the smallest possible number of elements in S.","import Mathlib /-! # USA Mathematical Olympiad 2016, Problem 1 Let X₁, X₂, …, X₁₀₀ be a sequence of mutually distinct nonempty subsets of a set S. Any two sets Xᵢ and Xᵢ₊₁ are disjoint and their union is not the whole set S, that is, Xᵢ ∩ Xᵢ₊₁ = ∅ and Xᵢ ∪ Xᵢ₊₁ ≠ S, for all i ∈ {1, …, 99}. Find the smallest possible number of elements in S. -/ namespace Usa2016P1 open Finset /-- `HasChain n` means that an `n`-element set (which we may take to be `Fin n`) admits a sequence of 100 mutually distinct nonempty subsets in which any two consecutive sets are disjoint and do not cover the whole set. -/ def HasChain (n : ℕ) : Prop := ∃ X : Fin 100 → Finset (Fin n), (∀ i, (X i).Nonempty) ∧ (∀ i j, X i = X j → i = j) ∧ ∀ i : Fin 99, Disjoint (X i.castSucc) (X i.succ) ∧ X i.castSucc ∪ X i.succ ≠ univ abbrev solution_value : ℕ := 8 theorem usa2016_p1 : IsLeast {n | HasChain n} solution_value := by sorry end Usa2016P1 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2016, Problem 1", compfiles-Usa2016P6,"Integers n and k are given, with n ≥ k ≥ 2. You play the following game against an evil wizard. The wizard has 2n cards; for each i = 1, ..., n, there are two cards labeled i. Initially, the wizard places all cards face down in a row, in unknown order. You may repeatedly make moves of the following form: you point to any k of the cards. The wizard then turns those cards face up. If any two of the cards match, the game is over and you win. Otherwise, you must look away, while the wizard arbitrarily permutes the k chosen cards and then turns them back face-down. Then, it is your turn again. We say this game is winnable if there exist some positive integer m and some strategy that is guaranteed to win in at most m moves, no matter how the wizard responds. For which values of n and k is the game winnable?","import Mathlib /-! # USA Mathematical Olympiad 2016, Problem 6 Integers n and k are given, with n ≥ k ≥ 2. You play the following game against an evil wizard. The wizard has 2n cards; for each i = 1, ..., n, there are two cards labeled i. Initially, the wizard places all cards face down in a row, in unknown order. You may repeatedly make moves of the following form: you point to any k of the cards. The wizard then turns those cards face up. If any two of the cards match, the game is over and you win. Otherwise, you must look away, while the wizard arbitrarily permutes the k chosen cards and then turns them back face-down. Then, it is your turn again. We say this game is winnable if there exist some positive integer m and some strategy that is guaranteed to win in at most m moves, no matter how the wizard responds. For which values of n and k is the game winnable? -/ namespace Usa2016P6 open Finset /-! ## The game model -/ /-- An arrangement of the `2n` cards: the label shown at each position. -/ abbrev Arrangement (n : ℕ) := Fin (2 * n) → Fin n /-- An arrangement is valid when each of the `n` labels appears exactly twice. -/ def Arrangement.Valid {n : ℕ} (a : Arrangement n) : Prop := ∀ ℓ : Fin n, (univ.filter fun i ↦ a i = ℓ).card = 2 /-- An observation made by the player: the set of queried positions, together with the labels that were revealed (`none` outside the queried set). -/ abbrev Observation (n : ℕ) := Finset (Fin (2 * n)) × (Fin (2 * n) → Option (Fin n)) /-- A player strategy: from the list of past observations, choose the next set of positions to query. -/ abbrev Strategy (n : ℕ) := List (Observation n) → Finset (Fin (2 * n)) /-- A strategy is valid for the parameter `k` if it always queries exactly `k` cards. -/ def Strategy.Valid {n : ℕ} (σ : Strategy n) (k : ℕ) : Prop := ∀ h, (σ h).card = k /-- The revealed labels, hidden (`none`) outside the queried set. -/ def reveal {n : ℕ} (a : Arrangement n) (Q : Finset (Fin (2 * n))) : Fin (2 * n) → Option (Fin n) := fun i ↦ if i ∈ Q then some (a i) else none /-- A wizard: an initial arrangement of the cards, and a way to permute the queried cards after each unsuccessful query. -/ structure Wizard (n : ℕ) where init : Arrangement n perm : List (Observation n) → Finset (Fin (2 * n)) → Equiv.Perm (Fin (2 * n)) /-- A wizard plays legitimately if the initial arrangement has two cards of each label and each permutation only moves the currently queried cards. -/ def Wizard.Valid {n : ℕ} (W : Wizard n) : Prop := W.init.Valid ∧ ∀ h Q i, i ∉ Q → W.perm h Q i = i /-- The state of play: the current arrangement, the past observations, and whether the player has already won. -/ structure PlayState (n : ℕ) where arr : Arrangement n hist : List (Observation n) won : Bool /-- One round of the game. -/ def step {n : ℕ} (σ : Strategy n) (W : Wizard n) (s : PlayState n) : PlayState n := if s.won then s else let Q := σ s.hist if (Q.image s.arr).card = Q.card then { arr := s.arr ∘ W.perm s.hist Q , hist := s.hist ++ [(Q, reveal s.arr Q)] , won := false } else { s with won := true } /-- The state after `m` rounds of play. -/ def play {n : ℕ} (σ : Strategy n) (W : Wizard n) : ℕ → PlayState n | 0 => { arr := W.init, hist := [], won := false } | m + 1 => step σ W (play σ W m) /-- The game is winnable if some valid strategy guarantees a win within `m` moves against every legitimate wizard. -/ def Winnable (n k : ℕ) : Prop := ∃ m ≥ 1, ∃ σ : Strategy n, σ.Valid k ∧ ∀ W : Wizard n, W.Valid → (play σ W m).won abbrev answer : ℕ → ℕ → Prop := fun n k ↦ k < n theorem usa2016_p6 (n k : ℕ) (hk : 2 ≤ k) (hkn : k ≤ n) : Winnable n k ↔ answer n k := by sorry end Usa2016P6 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2016, Problem 6", compfiles-Usa2017P4,"Let P₁, P₂, ..., P_{2n} be 2n distinct points on the unit circle x² + y² = 1, other than (1, 0). Each point is colored either red or blue, with exactly n red points and n blue points. Let R₁, R₂, ..., Rₙ be any ordering of the red points. Let B₁ be the nearest blue point to R₁ traveling counterclockwise around the circle starting from R₁. Then let B₂ be the nearest of the remaining blue points to R₂ traveling counterclockwise around the circle from R₂, and so on, until we have labeled all of the blue points B₁, ..., Bₙ. Show that the number of counterclockwise arcs of the form Rᵢ → Bᵢ that contain the point (1, 0) is independent of the way we chose the ordering R₁, ..., Rₙ of the red points.","import Mathlib /-! # USA Mathematical Olympiad 2017, Problem 4 Let P₁, P₂, ..., P_{2n} be 2n distinct points on the unit circle x² + y² = 1, other than (1, 0). Each point is colored either red or blue, with exactly n red points and n blue points. Let R₁, R₂, ..., Rₙ be any ordering of the red points. Let B₁ be the nearest blue point to R₁ traveling counterclockwise around the circle starting from R₁. Then let B₂ be the nearest of the remaining blue points to R₂ traveling counterclockwise around the circle from R₂, and so on, until we have labeled all of the blue points B₁, ..., Bₙ. Show that the number of counterclockwise arcs of the form Rᵢ → Bᵢ that contain the point (1, 0) is independent of the way we chose the ordering R₁, ..., Rₙ of the red points. -/ namespace Usa2017P4 /-! ## Combinatorial setup We cut the circle at (1, 0) and record the 2n points in counterclockwise order, starting right after (1, 0), as the elements of `Fin (2 * n)`. The coloring is given by `c : Fin (2 * n) → Bool` with `true` for red and `false` for blue. Traveling counterclockwise from a point `r` one meets the positions `r + 1, r + 2, ...` cyclically; the counterclockwise arc from `r` to `b` contains (1, 0) exactly when `b.val < r.val`. The greedy labeling process is modeled by `wraps`, which counts the arcs through (1, 0) produced when the red points are processed in a given order. -/ section Geometry variable {m : ℕ} /-- Shift `p` forward (counterclockwise) by `d` positions, cyclically. -/ def shift (p : Fin m) (d : ℕ) : Fin m := ⟨(p.val + d) % m, Nat.mod_lt _ (Nat.lt_of_le_of_lt (Nat.zero_le _) p.isLt)⟩ /-- The cyclic (counterclockwise) distance from `a` to `b`; it is `0` iff `a = b`. -/ def cdist (a b : Fin m) : ℕ := (b.val + m - a.val) % m /-- `wrap r b` is `1` when the counterclockwise arc from `r` to `b` passes through the cut point (1, 0), and `0` otherwise. -/ def wrap (r b : Fin m) : ℕ := if b.val < r.val then 1 else 0 end Geometry section Process variable {m : ℕ} (c : Fin m → Bool) /-- The set of blue points that have not been used yet. -/ def avail (used : Finset (Fin m)) : Finset (Fin m) := Finset.univ.filter (fun b => c b = false ∧ b ∉ used) /-- The nearest available blue point to `r`, going counterclockwise from `r` (if one exists; otherwise, arbitrarily, `r` itself). -/ noncomputable def nb (used : Finset (Fin m)) (r : Fin m) : Fin m := if h : (avail c used).Nonempty then Classical.choose (Finset.exists_min_image (avail c used) (cdist r) h) else r /-- The total number of arcs through (1, 0) produced when the red points listed in `l` are processed in order, starting from the set `used` of already-taken blue points. -/ noncomputable def wraps : List (Fin m) → Finset (Fin m) → ℕ | [], _ => 0 | (r :: rs), used => wrap r (nb c used r) + wraps rs (insert (nb c used r) used) end Process /-- **USAMO 2017 Problem 4.** With the notation introduced above (points recorded in counterclockwise order starting from (1, 0), `true` = red), the number of counterclockwise arcs `Rᵢ → Bᵢ` containing (1, 0) does not depend on the ordering `R₁, ..., Rₙ` of the red points. -/ theorem usa2017_p4 (n : ℕ) (_hn : 0 < n) (c : Fin (2 * n) → Bool) (hred : (Finset.univ.filter (fun i => c i = true)).card = n) (l₁ l₂ : List (Fin (2 * n))) (hnod₁ : l₁.Nodup) (hlen₁ : l₁.length = n) (hred₁ : ∀ r ∈ l₁, c r = true) (hnod₂ : l₂.Nodup) (hlen₂ : l₂.length = n) (hred₂ : ∀ r ∈ l₂, c r = true) : wraps c l₁ ∅ = wraps c l₂ ∅ := by sorry end Usa2017P4 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2017, Problem 4", compfiles-Usa2017P5,"Determine the set of positive real numbers c such that there exists a labeling of the lattice points in ℤ² with positive integers for which: 1. only finitely many distinct labels occur, and 2. for each label i, the distance between any two points labeled i is at least cⁱ.","import Mathlib /-! # USA Mathematical Olympiad 2017, Problem 5 Determine the set of positive real numbers c such that there exists a labeling of the lattice points in ℤ² with positive integers for which: 1. only finitely many distinct labels occur, and 2. for each label i, the distance between any two points labeled i is at least cⁱ. -/ namespace Usa2017P5 abbrev solution_set : Set ℝ := Set.Ioo 0 (Real.sqrt 2) noncomputable def dist : ℤ × ℤ → ℤ × ℤ → ℝ | ⟨x1, y1⟩, ⟨x2, y2⟩ => Real.sqrt ((x2 - x1)^2 + (y2 - y1)^2) theorem usa2017_p5 (c : ℝ) : c ∈ solution_set ↔ (0 < c ∧ ∃ l : ℤ × ℤ → ℕ, (Set.range l).Finite ∧ (∀ p, 0 < l p) ∧ ∀ {p1 p2}, p1 ≠ p2 → (l p1 = l p2) → c ^ (l p1) ≤ dist p1 p2) := by sorry end Usa2017P5 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2017, Problem 5", compfiles-Usa2018P4,"Let p be a prime, and let a₁, ..., aₚ be integers. Show that there exists an integer k such that the numbers a₁ + k, a₂ + 2k, ..., aₚ + pk produce at least ½p distinct remainders upon division by p.","import Mathlib /-! # USA Mathematical Olympiad 2018, Problem 4 Let p be a prime, and let a₁, ..., aₚ be integers. Show that there exists an integer k such that the numbers a₁ + k, a₂ + 2k, ..., aₚ + pk produce at least ½p distinct remainders upon division by p. -/ namespace Usa2018P4 open Finset /-- We index by `Fin p` instead of `{1, ..., p}` (the map `i ↦ i mod p` is a bijection `{1, ..., p} ≃ Fin p` sending `p ↦ 0`, and `p * k ≡ 0 (mod p)`, so the families of remainders coincide), we work directly with remainders in `ZMod p`, and the conclusion `p ≤ 2 * N` is the integral form of ""`N ≥ p / 2` distinct remainders"". -/ theorem usa2018_p4 (p : ℕ) (hp : p.Prime) (a : Fin p → ℤ) : ∃ k : ℤ, p ≤ 2 * (Finset.univ.image fun i : Fin p ↦ (a i : ZMod p) + ((i : ℕ) : ZMod p) * (k : ZMod p)).card := by sorry end Usa2018P4 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2018, Problem 4", compfiles-Usa2019P4,"Let n be a nonnegative integer. Determine the number of ways to choose sets Sᵢⱼ ⊆ {1, 2, ..., 2n}, for all 0 ≤ i ≤ n and 0 ≤ j ≤ n (not necessarily distinct), such that • |Sᵢⱼ| = i + j, and • Sᵢⱼ ⊆ Sₖₗ if 0 ≤ i ≤ k ≤ n and 0 ≤ j ≤ l ≤ n.","import Mathlib open scoped Nat /-! # USA Mathematical Olympiad 2019, Problem 4 Let n be a nonnegative integer. Determine the number of ways to choose sets Sᵢⱼ ⊆ {1, 2, ..., 2n}, for all 0 ≤ i ≤ n and 0 ≤ j ≤ n (not necessarily distinct), such that • |Sᵢⱼ| = i + j, and • Sᵢⱼ ⊆ Sₖₗ if 0 ≤ i ≤ k ≤ n and 0 ≤ j ≤ l ≤ n. -/ namespace Usa2019P4 abbrev answer (n : ℕ) : ℕ := (2 * n)! * 2 ^ (n ^ 2) theorem usa2019_p4 (n : ℕ) : Nat.card {S : Fin (n + 1) → Fin (n + 1) → Finset (Fin (2 * n)) // (∀ i j, (S i j).card = i.val + j.val) ∧ (∀ i k j l, i ≤ k → j ≤ l → S i j ⊆ S k l)} = answer n := by sorry end Usa2019P4 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2019, Problem 4", compfiles-Usa2020P4,"Suppose that (a₁, b₁), (a₂, b₂), ..., (a₁₀₀, b₁₀₀) are distinct ordered pairs of nonnegative integers. Let N denote the number of pairs of integers (i, j) satisfying 1 ≤ i < j ≤ 100 and |aᵢbⱼ − aⱼbᵢ| = 1. Determine the largest possible value of N over all possible choices of the 100 ordered pairs.","import Mathlib /-! # USA Mathematical Olympiad 2020, Problem 4 Suppose that (a₁, b₁), (a₂, b₂), ..., (a₁₀₀, b₁₀₀) are distinct ordered pairs of nonnegative integers. Let N denote the number of pairs of integers (i, j) satisfying 1 ≤ i < j ≤ 100 and |aᵢbⱼ − aⱼbᵢ| = 1. Determine the largest possible value of N over all possible choices of the 100 ordered pairs. -/ namespace Usa2020P4 /-- The determinant `aᵢ bⱼ − aⱼ bᵢ` of two ordered pairs of nonnegative integers, viewed as an integer. -/ def det (P Q : ℕ × ℕ) : ℤ := (P.1 : ℤ) * (Q.2 : ℤ) - (Q.1 : ℤ) * (P.2 : ℤ) abbrev answer : ℕ := 197 /-- USA Mathematical Olympiad 2020, Problem 4 -/ theorem usa2020_p4 : IsGreatest {N : ℕ | ∃ v : Fin 100 → ℕ × ℕ, Function.Injective v ∧ N = (Finset.univ.filter fun p : Fin 100 × Fin 100 => p.1 < p.2 ∧ |det (v p.1) (v p.2)| = 1).card} answer := by sorry end Usa2020P4 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2020, Problem 4", compfiles-Usa2020P5,"A finite set S of points in the coordinate plane is called overdetermined if |S| ≥ 2 and there exists a nonzero polynomial P(t), with real coefficients and of degree at most |S| − 2, satisfying P(x) = y for every point (x, y) ∈ S. For each integer n ≥ 2, find the largest integer k (in terms of n) such that there exists a set of n distinct points that is not overdetermined, but has k overdetermined subsets.","import Mathlib /-! # USA Mathematical Olympiad 2020, Problem 5 A finite set S of points in the coordinate plane is called overdetermined if |S| ≥ 2 and there exists a nonzero polynomial P(t), with real coefficients and of degree at most |S| − 2, satisfying P(x) = y for every point (x, y) ∈ S. For each integer n ≥ 2, find the largest integer k (in terms of n) such that there exists a set of n distinct points that is not overdetermined, but has k overdetermined subsets. -/ open Classical Polynomial namespace Usa2020P5 /-- A finite set of points in the coordinate plane is *overdetermined* if it has at least two elements and some nonzero real polynomial of degree at most `|S| - 2` passes through every point of `S`. -/ def Overdetermined (S : Finset (ℝ × ℝ)) : Prop := 2 ≤ S.card ∧ ∃ P : ℝ[X], P ≠ 0 ∧ P.natDegree ≤ S.card - 2 ∧ ∀ p ∈ S, P.eval p.1 = p.2 abbrev solution (n : ℕ) : ℕ := 2 ^ (n - 1) - n theorem usa2020_p5 (n : ℕ) (hn : 2 ≤ n) : IsGreatest {k : ℕ | ∃ S : Finset (ℝ × ℝ), S.card = n ∧ ¬ Overdetermined S ∧ (S.powerset.filter Overdetermined).card = k} (solution n) := by sorry end Usa2020P5 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2020, Problem 5", compfiles-Usa2022P1,"Let a and b be positive integers. The cells of an (a+b+1) × (a+b+1) grid are colored amber and bronze such that there are at least a² + ab - b amber cells and at least b² + ab - a bronze cells. Prove that it is possible to choose a amber cells and b bronze cells such that no two of the a + b chosen cells lie in the same row or column.","import Mathlib /-! # USA Mathematical Olympiad 2022, Problem 1 Let a and b be positive integers. The cells of an (a+b+1) × (a+b+1) grid are colored amber and bronze such that there are at least a² + ab - b amber cells and at least b² + ab - a bronze cells. Prove that it is possible to choose a amber cells and b bronze cells such that no two of the a + b chosen cells lie in the same row or column. -/ namespace Usa2022P1 theorem usa2022_p1 (a b : ℕ) (ha : 0 < a) (hb : 0 < b) (color : Fin (a + b + 1) × Fin (a + b + 1) → Fin 2) (c0 : a ^ 2 + a * b - b ≤ Fintype.card {s // color s = 0}) (c1 : b ^ 2 + a * b - a ≤ Fintype.card {s // color s = 1}) : ∃ A B : Finset (Fin (a + b + 1) × Fin (a + b + 1)), A.card = a ∧ B.card = b ∧ (∀ x ∈ A, color x = 0) ∧ (∀ y ∈ B, color y = 1) ∧ ∀ x ∈ A ∪ B, ∀ y ∈ A ∪ B, x ≠ y → x.fst ≠ y.fst ∧ x.snd ≠ y.snd := by sorry end Usa2022P1 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2022, Problem 1", compfiles-Usa2022P5,"A function f : ℝ → ℝ is essentially increasing if f(s) ≤ f(t) holds whenever s ≤ t are real numbers such that f(s) ≠ 0 and f(t) ≠ 0. Find the smallest integer k such that for any 2022 real numbers x₁, x₂, ..., x₂₀₂₂, there exist k essentially increasing functions f₁, f₂, ..., fₖ such that f₁(n) + f₂(n) + ⋯ + fₖ(n) = xₙ for every n = 1, 2, ..., 2022.","import Mathlib /-! # USA Mathematical Olympiad 2022, Problem 5 A function f : ℝ → ℝ is essentially increasing if f(s) ≤ f(t) holds whenever s ≤ t are real numbers such that f(s) ≠ 0 and f(t) ≠ 0. Find the smallest integer k such that for any 2022 real numbers x₁, x₂, ..., x₂₀₂₂, there exist k essentially increasing functions f₁, f₂, ..., fₖ such that f₁(n) + f₂(n) + ⋯ + fₖ(n) = xₙ for every n = 1, 2, ..., 2022. -/ namespace Usa2022P5 /-- A function `f : ℝ → ℝ` is *essentially increasing* if `f s ≤ f t` whenever `s ≤ t` are real numbers such that `f s ≠ 0` and `f t ≠ 0`. -/ def EssentiallyIncreasing (f : ℝ → ℝ) : Prop := ∀ s t : ℝ, s ≤ t → f s ≠ 0 → f t ≠ 0 → f s ≤ f t /-- The property of the natural number `k` occurring in the problem: every `2022`-tuple `(x₁, …, x₂₀₂₂)` of real numbers is the pointwise sum of `k` essentially increasing functions at the points `1, …, 2022`. -/ def Good (k : ℕ) : Prop := ∀ x : Fin 2022 → ℝ, ∃ f : Fin k → ℝ → ℝ, (∀ i, EssentiallyIncreasing (f i)) ∧ ∀ n : Fin 2022, ∑ i, f i (n.val + 1) = x n abbrev solution : ℕ := 11 theorem usa2022_p5 : IsLeast {k | Good k} solution := by sorry end Usa2022P5 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2022, Problem 5", compfiles-Usa2023P5,"Let n be an integer greater than 2. We will be arranging the numbers 1, 2, ... n² into an n × n grid. Such an arrangement is called *row-valid* if the numbers in each row can be permuted to make an arithmetic progression. Similarly, such an arrangement is called *column-valid* if the numbers in each column can be permuted to make an arithmetic progression. Determine the values of n for which it possible to transform any row-valid arrangement into a column-valid arrangement by permuting the numbers in each row.","import Mathlib /-! # USA Mathematical Olympiad 2023, Problem 5 Let n be an integer greater than 2. We will be arranging the numbers 1, 2, ... n² into an n × n grid. Such an arrangement is called *row-valid* if the numbers in each row can be permuted to make an arithmetic progression. Similarly, such an arrangement is called *column-valid* if the numbers in each column can be permuted to make an arithmetic progression. Determine the values of n for which it possible to transform any row-valid arrangement into a column-valid arrangement by permuting the numbers in each row. -/ namespace Usa2023P5 def PermutedArithSeq {n : ℕ} (hn : 0 < n) (a : Fin n ↪ Fin (n ^ 2)) : Prop := ∃ p : Fin n → Fin n, p.Bijective ∧ ∃ k : ℕ, ∀ m : Fin n, (a (p m)).val = a (p ⟨0, hn⟩) + m.val * k def row_valid {n : ℕ} (hn : 0 < n) (a : Fin n → Fin n → Fin (n ^ 2)) (ha : a.Injective2) : Prop := ∀ r : Fin n, PermutedArithSeq hn ⟨(a r ·), Function.Injective2.right ha r⟩ def col_valid {n : ℕ} (hn : 0 < n) (a : Fin n → Fin n → Fin (n ^ 2)) (ha : a.Injective2) : Prop := ∀ c : Fin n, PermutedArithSeq hn ⟨(a · c), Function.Injective2.left ha c⟩ theorem injective_of_permuted_rows {α β γ : Type} {f : α → β → γ} (hf : f.Injective2) {p : α → β → β} (hp : ∀ a, (p a).Injective) : Function.Injective2 (fun r c ↦ f r (p r c)) := by intro a1 a2 b1 b2 hab obtain ⟨ha1, hp1⟩ := hf hab rw [ha1] at * rw [hp a2 hp1] simp only [and_self] abbrev solution_set : Set ℕ := { n | n.Prime } theorem usa2023_p5 (n : ℕ) (hn : 2 < n) : n ∈ solution_set ↔ (∀ a : (Fin n → Fin n → Fin (n^2)), (ha : a.Injective2) → row_valid (Nat.zero_lt_of_lt hn) a ha → ∃ p : Fin n → Fin n → Fin n, ∃ hp : (∀ r, (p r).Injective), col_valid (Nat.zero_lt_of_lt hn) (fun r c ↦ a r (p r c)) (injective_of_permuted_rows ha hp)) := by sorry end Usa2023P5 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2023, Problem 5", compfiles-Usa2024P2,"Let S₁, S₂, ..., S₁₀₀ be finite sets of integers whose intersection is not empty. For each non-empty T ⊆ {S₁, S₂, ..., S₁₀₀}, the size of the intersection of the sets in T is a multiple of the number of sets in T. What is the least possible number of elements that are in at least 50 sets?","import Mathlib /-! # USA Mathematical Olympiad 2024, Problem 2 Let S₁, S₂, ..., S₁₀₀ be finite sets of integers whose intersection is not empty. For each non-empty T ⊆ {S₁, S₂, ..., S₁₀₀}, the size of the intersection of the sets in T is a multiple of the number of sets in T. What is the least possible number of elements that are in at least 50 sets? -/ namespace Usa2024P2 abbrev solution : ℕ := 50 * Nat.choose 100 50 structure Good (S : Fin 100 → Set ℤ) : Prop where finite : ∀ i, (S i).Finite nonempty_inter : ⋂ i, S i ≠ ∅ card : ∀ T : Finset (Fin 100), T.Nonempty → ∃ k : ℕ, (⋂ i ∈ T, S i).ncard = k * T.card -- z is in at least k of the sets S. abbrev InAtLeastKSubsets (S : Fin 100 → Set ℤ) (k : ℕ) (z : ℤ) : Prop := k ≤ {i : Fin 100 | z ∈ S i }.ncard theorem usa2024_p2 : IsLeast { k | ∃ S, Good S ∧ k = {z : ℤ | InAtLeastKSubsets S 50 z }.ncard } solution := by sorry end Usa2024P2 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2024, Problem 2", compfiles-Usa2024P4,"Let m and n be positive integers. A circular necklace contains mn beads, each either red or blue. It turned out that no matter how the necklace was cut into m blocks of n consecutive beads, each block had a distinct number of red beads. Determine, with proof, all possible values of the ordered pair (m, n).","import Mathlib /-! # USA Mathematical Olympiad 2024, Problem 4 Let m and n be positive integers. A circular necklace contains mn beads, each either red or blue. It turned out that no matter how the necklace was cut into m blocks of n consecutive beads, each block had a distinct number of red beads. Determine, with proof, all possible values of the ordered pair (m, n). -/ namespace Usa2024P4 /-- A circular necklace with `m * n` beads, each red (`true`) or blue (`false`). The beads are indexed by their position on the circle, i.e. by `ZMod (m * n)`. -/ abbrev Necklace (m n : ℕ) := ZMod (m * n) → Bool /-- The number of red beads in the block of `n` consecutive beads starting at position `s + i * n` (positions are taken modulo `m * n`). -/ def blockCount {m n : ℕ} (c : Necklace m n) (s : ZMod (m * n)) (i : ℕ) : ℕ := ∑ j ∈ Finset.range n, if c (s + ((i * n + j : ℕ) : ZMod (m * n))) then 1 else 0 /-- The property from the problem statement: no matter how the necklace is cut into `m` blocks of `n` consecutive beads (the cut is determined by the starting position `s` of the first block), the numbers of red beads in the `m` blocks are pairwise distinct. -/ def AllCutsDistinct {m n : ℕ} (c : Necklace m n) : Prop := ∀ s : ZMod (m * n), Function.Injective (fun i : Fin m ↦ blockCount c s i.val) /-- The answer: the required necklaces exist exactly for the pairs `(m, n)` with `m ≤ n + 1`. -/ abbrev solution : ℕ → ℕ → Prop := fun m n ↦ m ≤ n + 1 theorem usa2024_p4 (m n : ℕ) (hm : 0 < m) (hn : 0 < n) : (∃ c : Necklace m n, AllCutsDistinct c) ↔ solution m n := by sorry end Usa2024P4 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2024, Problem 4", compfiles-Usa2024P6,"Let n > 2 be an integer and let ℓ ∈ {1, 2, ..., n}. A collection A₁, ..., Aₖ of (not necessarily distinct) subsets of {1, 2, ..., n} is called ℓ-large if |Aᵢ| ≥ ℓ for all 1 ≤ i ≤ k. Find, in terms of n and ℓ, the largest real number c such that the inequality ∑ᵢ ∑ⱼ xᵢ xⱼ |Aᵢ ∩ Aⱼ|²/(|Aᵢ|·|Aⱼ|) ≥ c (∑ᵢ xᵢ)² holds for all positive integers k, all nonnegative real numbers x₁, ..., xₖ, and all ℓ-large collections A₁, ..., Aₖ of subsets of {1, ..., n}.","import Mathlib /-! # USA Mathematical Olympiad 2024, Problem 6 Let n > 2 be an integer and let ℓ ∈ {1, 2, ..., n}. A collection A₁, ..., Aₖ of (not necessarily distinct) subsets of {1, 2, ..., n} is called ℓ-large if |Aᵢ| ≥ ℓ for all 1 ≤ i ≤ k. Find, in terms of n and ℓ, the largest real number c such that the inequality ∑ᵢ ∑ⱼ xᵢ xⱼ |Aᵢ ∩ Aⱼ|²/(|Aᵢ|·|Aⱼ|) ≥ c (∑ᵢ xᵢ)² holds for all positive integers k, all nonnegative real numbers x₁, ..., xₖ, and all ℓ-large collections A₁, ..., Aₖ of subsets of {1, ..., n}. -/ namespace Usa2024P6 /-- The answer: `c = (n + ℓ² - 2ℓ)/(n(n-1))`. -/ noncomputable abbrev solution : ℕ → ℕ → ℝ := fun n ℓ => ((n : ℝ) + (ℓ : ℝ) ^ 2 - 2 * (ℓ : ℝ)) / ((n : ℝ) * ((n : ℝ) - 1)) /-- `Works n ℓ c` says that the inequality of the problem holds with constant `c`: for every positive integer `k`, all nonnegative weights `x₁, ..., xₖ` and every ℓ-large collection `A₁, ..., Aₖ` of subsets of `{1, ..., n}`. -/ noncomputable def Works (n ℓ : ℕ) (c : ℝ) : Prop := ∀ (k : ℕ), 0 < k → ∀ (x : Fin k → ℝ), (∀ i, 0 ≤ x i) → ∀ (A : Fin k → Finset (Fin n)), (∀ i, ℓ ≤ (A i).card) → c * (∑ i, x i) ^ 2 ≤ ∑ i, ∑ j, x i * x j * (((A i ∩ A j).card : ℝ) ^ 2 / ((A i).card : ℝ) / ((A j).card : ℝ)) theorem usa2024_p6 (n ℓ : ℕ) (hn : 2 < n) (hℓ : 1 ≤ ℓ ∧ ℓ ≤ n) : IsGreatest {c : ℝ | Works n ℓ c} (solution n ℓ) := by sorry end Usa2024P6 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2024, Problem 6", compfiles-Usa2026P2,"Annie is playing a game where she starts with a row of positive integers, written on a blackboard, each of which is a power of 2. On each turn, she can erase two adjacent numbers and replace them with a power of 2 that is greater than either of the erased numbers. This shortens the row of numbers, and she continues to take turns until only one number remains. Annie wins the game if the final remaining number is less than 4 times the sum of the original numbers. Is it always possible for Annie to win, regardless of the starting row of numbers?","import Mathlib /-! # USA Mathematical Olympiad 2026, Problem 2 Annie is playing a game where she starts with a row of positive integers, written on a blackboard, each of which is a power of 2. On each turn, she can erase two adjacent numbers and replace them with a power of 2 that is greater than either of the erased numbers. This shortens the row of numbers, and she continues to take turns until only one number remains. Annie wins the game if the final remaining number is less than 4 times the sum of the original numbers. Is it always possible for Annie to win, regardless of the starting row of numbers? -/ namespace Usa2026P2 /-- A positive integer which is a power of two (in particular `1 = 2 ^ 0` counts). -/ def IsPow2 (x : ℕ) : Prop := ∃ k, x = 2 ^ k /-- One legal turn of the game: the two adjacent entries `x` and `y` are erased and replaced by a power of two `z` which is strictly larger than both of them. -/ inductive Move : List ℕ → List ℕ → Prop | mk (l r : List ℕ) (x y z : ℕ) (hz : IsPow2 z) (hx : x < z) (hy : y < z) : Move (l ++ x :: y :: r) (l ++ z :: r) /-- The answer is **yes**: from any starting row of powers of two, Annie can always reach a single number which is less than four times the sum of the starting row. -/ theorem usa2026_p2 (a : List ℕ) (ha : a ≠ []) (hp : ∀ x ∈ a, IsPow2 x) : ∃ m, Relation.ReflTransGen Move a [m] ∧ m < 4 * a.sum := by sorry end Usa2026P2 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2026, Problem 2", compfiles-Usa2026P4,"A positive integer n is called solitary if, for any non-negative integers a and b such that a + b = n, either a or b contains the digit ""1"". Determine, with proof, the number of solitary integers less than 10^2026.","import Mathlib /-! # USA Mathematical Olympiad 2026, Problem 4 A positive integer n is called solitary if, for any non-negative integers a and b such that a + b = n, either a or b contains the digit ""1"". Determine, with proof, the number of solitary integers less than 10^2026. -/ namespace Usa2026P4 open Classical abbrev solution : ℕ := 2^2026 - 1 def has_digit_one (n : ℕ) : Prop := 1 ∈ Nat.digits 10 n def is_solitary (n : ℕ) : Prop := 0 < n ∧ ∀ a b : ℕ, a + b = n → has_digit_one a ∨ has_digit_one b theorem usa2026_p4 : (Finset.filter is_solitary (Finset.Ico 1 (10^2026))).card = solution := by sorry end Usa2026P4 ",Combinatorics,1. Named contest,,"Compfiles: USA Mathematical Olympiad 2026, Problem 4", flc-205507,"Let $\mathbb{Z}/n\mathbb{Z}$ denote the set of integers considered modulo $n$ (hence $\mathbb{Z}/n\mathbb{Z}$ has $n$ elements). Find all positive integers $n$ for which there exists a bijective function $g: \mathbb{Z}/n\mathbb{Z} \to \mathbb{Z}/n\mathbb{Z}$, such that the 101 functions \[g(x), \quad g(x) + x, \quad g(x) + 2x, \quad \dots, \quad g(x) + 100x\] are all bijections on $\mathbb{Z}/n\mathbb{Z}$. [i]Ashwin Sah and Yang Liu[/i] Prove that the answer is \text{All positive integers } n \text{ relatively prime to } 101!.","import Mathlib theorem find_n : {n : ℕ | n > 0 ∧ ∃ g : ZMod n → ZMod n, Function.Bijective g ∧ ∀ i ∈ Finset.range 101, Function.Bijective (fun x => g x + (i * x))} = {n | Nat.Coprime n (Nat.factorial 101)} := by sorry ",Combinatorics,1. Named contest,7.0,FineLeanCorpus/Omni-MATH (usa_team_selection_test_for_imo), flc-120736,"Show that the Lebesgue measure of the set \( A \) of real numbers \( r \) such that there exists a constant \( C \) and a sequence \( \frac{p_n}{q_n} \) of rational numbers (where \( p_n \) and \( q_n \) are integers) with \( q_n \rightarrow \infty \) and \( \left\vert r - \frac{p_n}{q_n} \right\vert < \frac{C}{q_n^3} \) is zero. Prove that the answer is 0.","import Mathlib open Real Filter Function open scoped Topology theorem TQF_465281 : (MeasureTheory.volume {r : ℝ | ∃ C : ℝ, ∃ p q : ℕ → ℤ, Tendsto q atTop atTop ∧ ∀ n, |r - (p n / q n)| < C / q n ^ 3}).toReal = 0 := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/DeepMath-103k, flc-123981,"Determine whether every measurable subset of \( \mathbb{R} \) with non-zero Lebesgue measure contains arbitrarily long arithmetic progressions. A subset \( E \) of \( \mathbb{R} \) is said to contain arbitrarily long arithmetic progressions if, for every natural number \( n \), there exist \( a, d \in \mathbb{R} \), with \( d \neq 0 \), such that \( a + kd \in E \) for all natural numbers \( k \leq n \). Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem determine : ∀ (E : Set ℝ), (MeasureTheory.volume E ≠ 0) → (∀ n : ℕ, ∃ a d : ℝ, d ≠ 0 ∧ ∀ k ∈ Icc 1 n, a + (k * d) ∈ E) := sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/DeepMath-103k, flc-128549,"Prove that the smallest positive number \( c \) such that for any integer \( n \geqslant 4 \) and any set \( A \subseteq \{1, 2, \ldots, n\} \), if \( |A| > c n \), then there exists a function \( f: A \rightarrow \{1, -1\} \) such that \( \left|\sum_{a \in A} f(a) \cdot a\right| \leq 1 \) is \( c = \frac{2}{3} \).","import Mathlib open Real open scoped BigOperators theorem min_c (c : ℝ) : IsLeast {x | 0 < x ∧ ∀ n ≥ 4, ∀ A ⊆ Finset.Icc 1 n, A.card > x * n → ∃ f : A → ℤ, (∀ a, f a = 1 ∨ f a = -1) ∧ |∑ a, f a * a| ≤ 1} (2 / 3) := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/DeepScaleR, flc-165530,"Let $x_1, x_2, \ldots, x_n$ be real numbers satisfying $x_1^2 + x_2^2 + \ldots + x_n^2 = 1$. Prove that for every integer $k \ge 2$, there exist integers $a_1, a_2, \ldots, a_n$, not all zero, such that $|a_i| \le k-1$ for all $i$, and $|a_1x_1 + a_2x_2 + \ldots + a_nx_n| \le \frac{(k-1)\sqrt{n}}{k^n - 1}$. [asy] [i](IMO Problem 3)[/i]","import Mathlib open Real theorem x (n : ℕ) (hn : 0 < n) (x : Fin n → ℝ) (h : ∑ i : Fin n, (x i)^2 = 1) : ∀ k ≥ 2, ∃ a : Fin n → ℤ, (∀ i : Fin n, |a i| ≤ k - 1) ∧ (∃ i : Fin n, a i ≠ 0) ∧ |∑ i : Fin n, a i * x i| ≤ ((k - 1) * sqrt n) / (k^n - 1) := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-200328,"Let $\zeta(s)$ denote the Riemann zeta function, defined for $\text{Re}(s) > 1$ by the series $\zeta(s) = \sum_{n=1}^\infty \frac{1}{n^s}$ and analytically continued to the complex plane minus $s = 1$. The non-trivial zeros of $\zeta(s)$ are the zeros that lie in the critical strip $0 < \text{Re}(s) < 1$. Prove that the Riemann zeta function $\zeta(s)$ has infinitely many non-trivial zeros in the critical strip $0 < \text{Re}(s) < 1$.","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem riemann_zeta_nontrivial_zeros : Set.Infinite {s | (s : ℂ).re ∈ Set.Ioo 0 1 ∧ riemannZeta s = 0} := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/DeepTheorem, flc-201745,"Let $A \\subseteq \\mathbb{N}$ be a recursively enumerable set. Prove that there exists a multivariate polynomial $p(x_1, x_2, \\ldots, x_n)$ with integer coefficients and integer variables such that \\[ A = \\{ k \\in \\mathbb{N} : \\exists x_1, x_2, \\ldots, x_n \\in \\mathbb{Z}, \\ p(k, x_1, x_2, \\ldots, x_n) = 0 \\}. \\] This result establishes that recursively enumerable sets can be characterized as the natural number solutions of Diophantine equations.","import Mathlib open Finset theorem recursively_enumerable (A : Set ℕ) : ∃ n : ℕ, ∃ p : MvPolynomial (Fin n) ℤ, A = {k | ∃ x : Fin n → ℤ, MvPolynomial.eval (fun i => x i) p = 0} := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/DeepTheorem, flc-212220,"Let $e$ and $\pi$ denote the base of the natural logarithm and the ratio of a circle's circumference to its diameter, respectively. Prove whether the statement '$e + \pi \in \mathbb{Q}$' is true or false, noting that this statement belongs to the complexity class $\Pi^0_2$. Discuss the implications of its decidability within the ZFC axioms and explore whether there is evidence to suggest that it could be independent of ZFC.","import Mathlib open Real theorem epi : ¬ ∃ q : ℚ, exp 1 + π = q := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/DeepTheorem, flc-213844,"Let $F(x)$ denote Fermat's Last Theorem statement for a given $x$, where $F(x)$ asserts that there are no three positive integers $a, b, c$ satisfying $a^n + b^n = c^n$ for integer $n > 2$. Using constructive mathematics, prove that $$ orall x eg F(x)$$ holds true, demonstrating the negation of the existence of solutions ($ eg ( ext{Exist } x, F(x))$) within the constructive framework.","import Mathlib open Real open scoped BigOperators theorem constructively : ∀ x : ℕ, ¬ ∃ a b c : ℕ, 0 < a ∧ 0 < b ∧ 0 < c ∧ a ^ x + b ^ x = c ^ x ∧ x > 2 := sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/DeepTheorem, flc-256638,"Prove that the set of all positive integers $N$ for which there exists a strictly increasing sequence of positive integers $s_0 < s_1 < s_2 < \cdots$ such that the sequence $s_1 - s_0$, $s_2 - s_1$, $s_3 - s_2$, $\ldots$ is periodic and $s_{s_n} - s_{s_{n - 1}} \leq N < s_{1 + s_n} - s_{s_{n - 1}}$ for all positive integers $n$ is the set of all positive integers.","import Mathlib theorem prove (N : ℕ) : (∃ s : ℕ → ℕ, StrictMono s ∧ (∀ i, 0 < s i) ∧ ∃ k, Function.Periodic (fun i => s (i + 1) - s i) k ∧ ∀ n, 0 < n → s (s n) - s (s (n - 1)) ≤ N ∧ N < s (1 + s n) - s (s (n - 1))) ↔ 0 < N := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-265675,"Prove that the only positive integer \(n \geq 2\) for which there exist \(n\) subsets \(A_1, A_2, \ldots, A_n\) of \(\{1, 2, \ldots, n\}\) satisfying the conditions (1) \(i \notin A_i\) for all \(1 \leq i \leq n\), (2) \(i \in A_j\) if and only if \(j \notin A_i\), and (3) \(|A_i \cap A_j| = 1\) for all \(i \neq j\) is \(n = 7\).","import Mathlib theorem nposge2 {n : ℕ} (hn : 2 ≤ n) : ∃ A : Finset.Icc 1 n → Set (Finset.Icc 1 n), (∀ i, i ∉ A i) ∧ (∀ i j, i ≠ j → (i ∈ A j ↔ j ∉ A i)) ∧ (∀ i j, i ≠ j → (A i ∩ A j).encard = 1) ↔ n = 7 := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-290730,"Prove that if in an election with a total of \(2015\) voters, \(60\%\) of the votes go to Toner Drum and the rest go to Celery Hilton, and \(N\) is the number of subsets of these \(2015\) voters where more people in the subset voted for Toner Drum than for Celery Hilton, then the remainder when \(N\) is divided by \(2017\) is \(1009\).","import Mathlib theorem prove (N : ℕ) (hN : N = {s : Finset ℕ | s.card > 0 ∧ (s.filter (fun x => x < 60 * 2015 / 100)).card > (s.filter (fun x => x ≥ 60 * 2015 / 100)).card}.ncard) : N % 2017 = 1009 := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-295676,"Prove that if there are 167 sets \(A_1, A_2, \ldots, A_{167}\) such that \(\sum_{i = 1}^{167}|A_i| = 2004\) and \(|A_j| = |A_i|\cdot|A_i\cap A_j|\) for all \(i, j\in\{1, 2, \ldots, 167\}\) with \(i\neq j\), then \(|\cup_{i = 1}^{167}A_i| = 1838\).","import Mathlib theorem prove (A : Finset.Icc 1 167 → Set ℝ) (h₀ : ∑ i, (A i).ncard = 2004) (h₁ : ∀ i j, i ≠ j → (A i).ncard * (A i ∩ A j).ncard = (A j).ncard) : ((⋃ i, A i).ncard = 1838) := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-297092,"Prove that there exists an uncountable family \(S = \{A_r \mid r \in \mathbb{R}\} \subset \mathcal{P}(\mathbb{N})\) such that for all distinct \(A, B \in S\), the intersection \(A \cap B\) is finite.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem exist_uncountable : ∃ S : Set (Set ℕ), S.Nonempty ∧ ¬ Countable S ∧ ∀ A ∈ S, ∀ B ∈ S, A ≠ B → Set.Finite (A ∩ B) := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-308015,"Prove that there exist $2000$ non - zero real numbers (not necessarily distinct) such that for any group of $1000$ of these numbers chosen as the roots of a monic polynomial of degree $1000$, the coefficients of the resulting polynomial (excluding the leading coefficient of $x^{1000}$) are a permutation of the $1000$ remaining numbers.","import Mathlib theorem algebra_483797 : ∃ (s : Finset ℝ), s.card = 2000 ∧ (∀ r ∈ s, r ≠ 0) ∧ ∀ t ⊆ s, t.card = 1000 → ∃ p : Polynomial ℝ, p.Monic ∧ p.degree = 1000 ∧ (∀ r ∈ t, p.eval r = 0) ∧ (∀ x ∈ s \ t, ∃! n : ℕ, p.coeff n = x) := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-308782,"Prove that the largest positive integer \(n\) such that the set \(\{1,2,\cdots,n\}\) can be partitioned into two sets \(A\) and \(B\) with the property that the sum of any two distinct elements from the same set is not a perfect square is \(n = 16759\).","import Mathlib theorem max_n : IsGreatest {n : ℕ | n > 0 ∧ ∃ A B : Finset ℕ, A ∪ B = Finset.Icc 1 n ∧ A ∩ B = ∅ ∧ ∀ m ∈ A, ∀ n ∈ A, m ≠ n → ¬ ∃ k : ℕ, k^2 = m + n ∧ ∀ m ∈ B, ∀ n ∈ B, m ≠ n → ¬ ∃ k : ℕ, k^2 = m + n} 16759 := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-309263,"Prove that except for a finite number of positive integers, for every other positive integer \( n \), there exist positive integers \( a_1, a_2, \cdots, a_{2004} \) such that \( n = a_1 + a_2 + \cdots + a_{2004} \), \( 1 \leq a_1 < a_2 < \cdots < a_{2004} \), and for \( 1 \leq i \leq 2003 \), \( a_i \mid a_{i+1} \).","import Mathlib theorem prove (S : Set ℕ) (hS : S = {n | ∃ a : Fin 2004 → ℕ, (∀ i j, i < j → a i < a j) ∧ (∀ i, a i > 0) ∧ n = ∑ i, a i ∧ ∀ i, a i ∣ a (i + 1)}) : {n | ¬(n ∈ S)}.Finite := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-310270,"(a) Prove that for given constants \(a, b\) with \(1 < a < 2 < b\), there does not exist a partition of the set of positive integers into two subsets \(A_0\) and \(A_1\) such that for any \(j \in \{0,1\}\) and any \(m, n \in A_j\), either \(\frac{n}{m} < a\) or \(\frac{n}{m} > b\). (b) Prove that the pairs of real numbers \((a, b)\) with \(1 < a < 2 < b\) for which there exists a partition of the set of positive integers into three subsets \(A_0, A_1, A_2\) such that for any \(j \in \{0,1,2\}\) and any \(m, n \in A_j\), either \(\frac{n}{m} < a\) or \(\frac{n}{m} > b\) are exactly those that satisfy \(\sqrt{2} < a < 2 < b \leq a^2\).","import Mathlib open Real Set open scoped BigOperators theorem a : ∀ a b : ℝ, (1 < a ∧ a < 2 ∧ 2 < b) → ¬ ∃ A0 A1 : Set ℕ, (∀ x ∈ A0, ∀ y ∈ A0, x ≠ 0 → y ≠ 0 → (x / y < a ∨ x / y > b)) ∧ (∀ x ∈ A1, ∀ y ∈ A1, x ≠ 0 → y ≠ 0 → (x / y < a ∨ x / y > b)) ∧ A0 ∪ A1 = {x | 0 < x} ∧ A0 ∩ A1 = ∅ := sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-310282,"(a) Prove that for given constants \(a, b\) with \(1 < a < 2 < b\), there does not exist a partition of the set of positive integers into two subsets \(A_0\) and \(A_1\) such that for any \(j \in \{0,1\}\) and any \(m, n \in A_j\), either \(\frac{n}{m} < a\) or \(\frac{n}{m} > b\). (b) Prove that for constants \(a,b\) with \(1 < a < b\), there exists a partition of the set of positive integers into \(k=\lceil \log_a b \rceil + 1\) subsets \(A_0, A_1,\cdots,A_{k - 1}\) such that for any \(j \in \{0,1,\cdots,k - 1\}\) and any \(m, n \in A_j\), either \(\frac{n}{m} < a\) or \(\frac{n}{m} > b\), and \(k\) is the minimum number of subsets for which such a partition exists.","import Mathlib open Finset theorem a : ∀ a b : ℝ, 1 < a ∧ a < 2 ∧ 2 < b → ¬∃ A0 A1 : Set ℕ, (∀ m ∈ A0, ∀ n ∈ A0, n / m < a ∨ n / m > b) ∧ (∀ m ∈ A1, ∀ n ∈ A1, n / m < a ∨ n / m > b) ∧ A0 ∪ A1 = {x | 0 < x} := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-324026,"Prove that there exists a collection $S$ of 34 pairwise distinct 2 - element subsets of a 17 - element set $T$ such that: 1. Every element of $T$ is contained in exactly four of the sets in $S$. 2. Every 5 - element subset of $T$ contains at least one of the sets in $S$.","import Mathlib theorem exist (T : Finset ℕ) (hT : T.card = 17) : ∃ S : Finset (Finset ℕ), S.card = 34 ∧ (∀ s ∈ S, s.card = 2) ∧ (∀ x ∈ T, {s | s ∈ S ∧ x ∈ s}.encard = 4) ∧ (∀ V ⊆ T, V.card = 5 → ∃ s ∈ S, s ⊆ V) := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-325389,"Prove that the maximum possible value of \(n\) for which there exist sets \(A_1, A_2, \dots, A_n \subseteq \{1, 2, \dots, 2016\}\) such that each set \(A_i\) has exactly \(4\) elements (\(\lvert A_i \rvert = 4\) for all \(1 \le i \le n\)) and the intersection of any two distinct sets \(A_i\) and \(A_j\) has an even number of elements (\(\lvert A_i \cap A_j \rvert\) is even for all \(1 \le i < j \le n\)) is \(\binom{1008}{2}\).","import Mathlib open Finset theorem max_n : IsGreatest {n | ∃ A : Fin n → Set ℕ, (∀ i, A i ⊆ Icc 1 2016) ∧ (∀ i, (A i).ncard = 4) ∧ (∀ i j, i ≠ j → Even ((A i ∩ A j).ncard))} (Nat.choose 1008 2) := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-331109,"Prove that there exists a set $A$ of 2010 positive integers such that for any nonempty subset $B$ of $A$, the sum of all elements in $B$ is a perfect power greater than 1.","import Mathlib theorem prove : ∃ A : Finset ℕ, A.card = 2010 ∧ (∀ x ∈ A, x > 0) ∧ ∀ B ⊆ A, B ≠ ∅ → ∃ k : ℕ, k > 1 ∧ ∃ m : ℕ, m^k = ∑ b ∈ B, b := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-338176,"1. **First part**: - The first part of the user's problem is already a formal math - proof problem. So, we keep it as it is: - Prove that in a complete graph \(G\) of order \(17\) where each edge of \(G\) is colored either red, blue, or green, there exists a set of three vertices in \(G\) such that the edges connecting these vertices are all of the same color. 2. **Second part**: - The final conclusion for the second part from the assistant's answer is that the statement is not always true for a complete graph of order \(16\). - We rewrite the second part of the problem as a formal proof statement: - Prove that there exists a complete graph \(G\) of order \(16\) with each edge colored either red, blue, or green such that there is no set of three vertices in \(G\) for which the edges connecting these vertices are all of the same color. So, the overall formal proof statements are: - Prove that in a complete graph \(G\) of order \(17\) where each edge of \(G\) is colored either red, blue, or green, there exists a set of three vertices in \(G\) such that the edges connecting these vertices are all of the same color. - Prove that there exists a complete graph \(G\) of order \(16\) with each edge colored either red, blue, or green such that there is no set of three vertices in \(G\) for which the edges connecting these vertices are all of the same color.","import Mathlib open Finset theorem prove_17 (G : Finset (Fin 17)) (hG : G.card = 17) (f : Fin 17 → Fin 17 → Fin 3) : ∃ a b c, a ≠ b ∧ a ≠ c ∧ b ≠ c ∧ f a b = f a c ∧ f a c = f b c := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-338894,"1. **a. Prove that the only finite robust set is the empty set $\{\emptyset\}$.** 2. **b1. Prove that the set of integers $\mathbb{Z}$, the set of rational numbers $\mathbb{Q}$, and the set of real numbers $\mathbb{R}$ are robust sets.** 3. **b2. Prove that there are infinitely many distinct robust sets.** 4. **c1. Prove that the union of two robust sets is not necessarily a robust set.** 5. **c2. Prove that the intersection of two robust sets is necessarily a robust set.** 6. **d1. Prove that all pairs of integers $(a, b)$ such that if a robust set contains $a$ and $b$, it must contain all integers are the pairs where $\gcd(a, b) = 1$ and $\text{sgn}(a) = -\text{sgn}(b)$.** 7. **d2. Prove that all pairs of real numbers $(a, b)$ such that if a robust set contains $a$ and $b$, it is dense in the interval $(0, 1)$ are the pairs where $a$ and $b$ have opposite signs and do not have a common ""factor"".** 8. **e1. Prove that there is no finite set of real numbers $S$ such that if a robust set contains $S$, it must contain all real numbers.** 9. **e2. Prove that there is a countably infinite set of real numbers $S$ such that if a robust set contains $S$, it must contain all real numbers.** 10. **e3. Prove that there exists a set $S$ of density $0$ such that if a robust set contains $S$, it must contain all real numbers.** 11. **f1. Prove that there exists a robust set with density $d$, for some $0 < d < 1$.** 12. **f2. Determine whether there exists a density $d$ between $0$ and $1$ such that no robust set has density $d$.** 13. **f3. Prove that $\sup d(S)$ over all robust sets $S$ with density $d(S) < 1$ is $1$.** 14. **g. Prove or disprove that every robust set is the set of all linear combinations of some numbers.**","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem ProveFiniteRobustSetIsEmpty : {S : Set ℝ | S.Finite ∧ (∀ T : Set ℝ, T ⊆ S → T = ∅)} = {∅} := sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-338910,"Prove that if $N$ is the number of $2015$-tuples $(S_1, S_2, \dots, S_{2015})$ of subsets of $\{1, 2, \dots, 2015\}$ such that the number of permutations $\sigma$ of $\{1, 2, \dots, 2015\}$ satisfying $\sigma(i) \in S_i$ for all $1 \le i \le 2015$ is odd, and $k_2$ and $k_3$ are the largest integers such that $2^{k_2} \mid N$ and $3^{k_3} \mid N$ respectively, then $k_2 + k_3 = 2030612$.","import Mathlib theorem prove (N : ℕ) (hN : N = {f : Fin 2015 → Finset (Fin 2015) | Odd (Nat.card {g : Equiv.Perm (Fin 2015) | ∀ i, g i ∈ f i})}.ncard) (k2 k3 : ℕ) (hk2 : 2 ^ k2 ∣ N) (hk3 : 3 ^ k3 ∣ N) : k2 + k3 = 2030612 := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-345021,"Prove that in the Golden Game, where two players start with two piles of tokens containing \(m > 0\) and \(n > 0\) tokens respectively and take turns to choose a positive integer \(k\) and remove \(k\) tokens from one pile or \(k\) tokens from both piles, and the player who takes the last token wins, Johann Carl Friedrich, who starts the game, has a winning strategy if and only if the initial number of tokens in the two piles \((m,n)\) is not of the form \(((n - 1)F_{2k+1}+F_{2k + 2}[n\phi],(n - 1)F_{2k+2}+F_{2k+3}[n\phi])\) for \(n\geq1\) and \(k\geq0\), where \(F_i\) is the \(i\) - th Fibonacci number, \(\phi=\frac{1+\sqrt{5}}{2}\), and \([x]\) is the floor function.","import Mathlib open Real theorem golden_game (m n : ℕ) (hm : 0 < m) (hn : 0 < n) (h : ∃ k : ℕ, ∃ φ : ℝ, φ = (1 + sqrt 5) / 2 ∧ m = (n - 1) * Nat.fib (2 * k + 1) + Nat.fib (2 * k + 2) * ⌊n * φ⌋ ∧ n = (n - 1) * Nat.fib (2 * k + 2) + Nat.fib (2 * k + 3) * ⌊n * φ⌋) : False := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-346414,"1. Prove that if \(f: \mathbb{N} \to \mathbb{N}\) is a permutation of the set \(\mathbb{N}\) of all positive integers, then there exists an arithmetic progression of positive integers \(a, a + d, a+2d\) with \(d>0\) such that \(f(a)0\) such that \(f(a) 0) (h : ∃ p : Equiv.Perm ℕ, ∀ n, f n = p n) : ∃ a d, d > 0 ∧ f a < f (a + d) ∧ f (a + d) < f (a + 2 * d) := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-366251,"Prove that the Ramsey number \(R(3,3,3) = 17\), i.e., show that for any coloring of the edges of a complete graph on 17 vertices with three colors, there exists a monochromatic triangle, and that 17 is the smallest number of vertices for which this property holds.","import Mathlib open Finset theorem R : IsLeast {n | ∀ f : Fin n → Fin n → Fin 3, ∃ a b c : Fin n, a ≠ b ∧ a ≠ c ∧ b ≠ c ∧ f a b = f a c ∧ f a b = f b c} 17 := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-369107,"Prove that there exists an infinite sequence \(a_0, a_1, a_2, \ldots\) of non - negative integers such that: (i) Every non - negative integer appears in the sequence exactly once. (ii) The sequence \(b_n=a_n + n\), for \(n\geq0\), consists of all prime numbers, each appearing exactly once.","import Mathlib theorem exist_seq_a : ∃ a : ℕ → ℕ, (∀ m n, m ≠ n → a m ≠ a n) ∧ (∀ k, ∃! n, a n = k) ∧ (∀ n, Prime (a n + n)) ∧ (∀ p, Prime p → ∃! n, a n + n = p) := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-372720,"Prove that the number of pairs $(f, C)$, where $f$ is a bijective function from $\{1, 2, 3, \ldots, 2020\}$ to $\{1, 2, 3, \ldots, 2020\}$, and $C$ is a coloring of $\{1, 2, 3, \ldots, 2020\}$ using the colors red, yellow, green, and blue such that for all $1 \leq k \leq 2020$, the colors of $k$ and $f(k)$ are distinct, is $\frac{2020! (3^{2023} + 32715957)}{64}$.","import Mathlib theorem number_of_pairs : {(f, C) : (Fin 2020 → Fin 2020) × (Fin 2020 → Fin 4) | (∀ i j, f i = f j → i = j) ∧ (∀ i, C i ≠ C (f i))}.ncard = Nat.factorial 2020 * (3^2023 + 32715957) / 64 := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-374247,"Let $\{a_n\}$ be a sequence defined by $a_1 = a_2 = 97$, and for $n \geq 2$, $a_{n+1} = a_n a_{n-1} + \sqrt{(a_n^2 - 1)(a_{n-1}^2 - 1)}$. Prove that for any $n \in \mathbb{N}^*$, the number $2 + \sqrt{2 + 2a_n}$ can be written in the form $\left( 2 \cos \left( \frac{f_n z}{4} \right) \right)^2$, where $\{f_n\}_{n \geq 1}$ is the sequence defined by $f_1 = f_2 = 1$ and $f_{n+2} = f_n + f_{n+1}$ for all $n \geq 1$, and $z = -i \ln \left( 97 + 56 \sqrt{3} \right)$.","import Mathlib open Real theorem qwen {a : ℕ → ℝ} (ha1 : a 1 = 97) (ha2 : a 2 = 97) (han : ∀ n ≥ 2, a (n + 1) = a n * a (n - 1) + sqrt ((a n ^ 2 - 1) * (a (n - 1) ^ 2 - 1))) : ∀ n > 0, ∃ f : ℕ → ℝ, f 1 = 1 ∧ f 2 = 1 ∧ ∀ n ≥ 1, f (n + 2) = f n + f (n + 1) ∧ 2 + sqrt (2 + 2 * a n) = (2 * cos ((f n * (-I * log (97 + 56 * sqrt 3))) / 4)) ^ 2 := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-374920,"1. The user's problem already starts with the phrase ""Prove that"", so it is a formal math - proof problem. 2. The final formal math proof statement is: Prove that the field $\mathbb{C}$ has infinitely many field automorphisms and show that the cardinality of the set of these automorphisms is \(2^{2^{\aleph_{0}}}\).","import Mathlib open Fintype Set Real Ideal Polynomial open scoped BigOperators theorem card_field_automorphisms : Infinite {f : ℂ ≃* ℂ | ∃ φ : ℂ → ℂ, ∀ x, f x = φ x} ∧ {f : ℂ ≃* ℂ | ∃ φ : ℂ → ℂ, ∀ x, f x = φ x}.ncard = 2^(2^(Nat.card ℕ)) := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-375004,"1. **First part**: - The user's problem already contains a proof - related question. So, we keep it as it is: Prove that for a sequence $\{a_n\}$ defined by $a_1 = 1$, $a_2$ being a positive integer greater than $1$, and for $n\geq2$, $a_{n + 1}$ is the smallest positive integer that has not yet appeared in the sequence and is not coprime with $a_n$, every positive integer appears in this sequence. 2. **Second part**: - The final conclusion from the assistant's answer about the case $a_2 = 4$ and the general behavior for large $k$ is that for large enough $k$, the sequence is the same regardless of the value of $a_2$. - We rewrite it as a formal proof statement: Let $\{a_n\}$ be a sequence defined by $a_1 = 1$, and for $n\geq2$, $a_{n + 1}$ is the smallest positive integer that has not yet appeared in the sequence and is not coprime with $a_n$. Prove that there exists a positive integer $K$ such that for all $k\geq K$, the sequence $\{a_n\}$ is independent of the choice of $a_2$ (where $a_2>1$).","import Mathlib theorem prove_sequence {a : ℕ → ℕ} (ha1 : a 1 = 1) (han : ∀ n ≥ 2, ∃ m, IsLeast {x | 0 < x ∧ ¬∃ k, a k = x} m ∧ ¬Nat.Coprime m (a n)) (hk : ∃ k, ∀ n ≥ k, a n > 0) : ∃ K, ∀ k ≥ K, ∀ a' : ℕ → ℕ, a' 1 = 1 ∧ (∀ n ≥ 2, ∃ m, IsLeast {x | 0 < x ∧ ¬∃ k, a' k = x} m ∧ ¬Nat.Coprime m (a' n)) ∧ (∀ n ≥ k, a n = a' n) := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-375554,"Prove that the maximum value of \(t\) such that for any positive integer \(a\), the set \(S=\{a + 1,a + 2,\ldots,a + t\}\) is good (where a non - empty set \(S\) of positive integers is defined as good if there exists a coloring of all positive integers using \(2008\) colors such that no number in \(S\) is the sum of two distinct positive integers (not necessarily from \(S\)) of the same color) is \(t = 4014\).","import Mathlib def isGood (S : Finset ℕ) := ∃ f : ℕ → Fin 2008, ∀ x ∈ S, ¬∃ y z, y ≠ z ∧ f y = f z ∧ x = y + z theorem maxT : IsGreatest {t | ∀ a > 0, isGood (Finset.Icc (a + 1) (a + t))} 4014 := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-384908,"Let $S = \{1, 2, 3, \ldots, 2016\}$, and let $\mathbb{F}$ be a set of subsets of $S$ such that: 1. Each subset $X \in \mathbb{F}$ has exactly three elements. 2. For any two distinct subsets $X, Y \in \mathbb{F}$, the intersection $|X \cap Y| < 1$. Let $T$ denote the maximum possible size of $\mathbb{F}$. Prove that $\left\lfloor \frac{3T}{2015} \right\rfloor = 1007$.","import Mathlib def S : Finset ℕ := Finset.Icc 1 2016 theorem max_subset_size (T : ℕ) (hT : T = sSup {k | ∃ F : Finset (Finset ℕ), F.card = k ∧ (∀ X ∈ F, X ⊆ S ∧ X.card = 3) ∧ (∀ X ∈ F, ∀ Y ∈ F, X ≠ Y → (X ∩ Y).card < 1)}) : ⌊(3 * T / 2015 : ℝ)⌋ = 1007 := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-417495,"Prove that the set of all pairs $\{a, b\}$ of positive integers with the property that, for any coloring of the positive integers using two colors $A$ and $B$, there always exist two positive integers of color $A$ whose difference is $a$ or two positive integers of color $B$ whose difference is $b$, is $\{(a, b) \mid \nu_2(a) \neq \nu_2(b)\}$.","import Mathlib open Finset theorem prove (a b : ℕ) : (∀ f : ℕ → Fin 2, ∃ m n : ℕ, m > 0 ∧ n > 0 ∧ f m = 0 ∧ f n = 0 ∧ |(m : ℤ) - n| = a ∨ ∃ p q : ℕ, p > 0 ∧ q > 0 ∧ f p = 1 ∧ f q = 1 ∧ |(p : ℤ) - q| = b) ↔ ¬(Nat.factorization a 2 = Nat.factorization b 2) := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-424441,Prove that the number of functions \(f \colon \mathbb{N} \to \mathbb{N}\) that satisfy the functional inequality \(f(f(f(n))) < f(f(n+1))\) for all \(n \in \mathbb{N}\) is \(\mathfrak{c}\).,"import Mathlib open Set Real Function open scoped BigOperators theorem prove : {f : ℕ → ℕ | ∀ n, f (f (f n)) < f (f (n + 1))}.ncard = c := sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-441766,"Prove that the value of the series \(\sum_{n = 0}^{\infty}\frac{f(2n + 1)}{(2n+1)^2}\), where \(f(n)\) denotes the number of ways the integer \(n\) can be decomposed into distinct factors with the order of factors not mattering, is \(\frac{1}{2}\cosh\frac{\pi}{2}\).","import Mathlib open Real Set open scoped BigOperators theorem sum_f (f : ℕ → ℝ) (h₀ : ∀ n, f n = {s : Finset ℕ | s.card > 0 ∧ ∏ i ∈ s, i = n}.ncard) : ∑' n, f (2 * n + 1) / (2 * n + 1)^2 = (cosh (π / 2)) / 2 := sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-443662,"Prove that if $\omega$ is a nonreal $47$th root of unity, $\mathcal{S}$ is the set of all polynomials of degree at most $46$ with coefficients in $\{0, 1\}$, and $N$ is the number of polynomials $Q \in \mathcal{S}$ such that $\sum_{j = 0}^{46} \frac{Q(\omega^{2j}) - Q(\omega^{j})}{\omega^{4j} + \omega^{3j} + \omega^{2j} + \omega^j + 1} = 47$, and the prime factorization of $N$ is $p_1^{\alpha_1}p_2^{\alpha_2} \dots p_s^{\alpha_s}$ where $p_1, \ldots, p_s$ are distinct primes and $\alpha_1, \alpha_2, \ldots, \alpha_s$ are positive integers, then $\sum_{j = 1}^s p_j\alpha_j = 107$.","import Mathlib open Real Complex Polynomial theorem prove (ω : ℂ) (hω : ω ^ 47 = 1 ∧ ω ≠ 1) (S : Set (Polynomial ℂ)) (hS : ∀ Q ∈ S, Q.degree ≤ 46 ∧ ∀ n ∈ Finset.range 47, Q.coeff n = 0 ∨ Q.coeff n = 1) (N : ℕ) (hN : N = {Q ∈ S | ∑ j ∈ Finset.range 47, (Q.eval (ω ^ (2 * j)) - Q.eval (ω ^ j)) / (ω ^ (4 * j) + ω ^ (3 * j) + ω ^ (2 * j) + ω ^ j + 1) = 47}.ncard) : ∃ p : Finset ℕ, p.card > 0 ∧ N.primeFactors ⊆ p ∧ ∑ j ∈ p, j * N.factorization j = 107 := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/AoPs, flc-460928,"Prove that for the polynomial \(x^{9999}+a_{9998} x^{9998}+\cdots+a_{1} x+a_{0}\) with roots \(\zeta^{m}+\omega^{n}\) where \(\zeta = e^{2\pi i/99}\), \(\omega=e^{2\pi i/101}\), and \(0\leq m < 99\), \(0\leq n < 101\), the sum \(a_{9799}+a_{9800}+\cdots+a_{9998}\) is equal to \(14849-\frac{9999}{200}\binom{200}{99}\).","import Mathlib open Finset Real Polynomial theorem sumOfCoeffs {P : Polynomial ℂ} (hP : P.degree = 9999) (hroots : ∀ θ : ℂ, θ = exp (2 * π * I / 99) ^ m + exp (2 * π * I / 101) ^ n → P.eval θ = 0) : ∑ i ∈ range 200, P.coeff (i + 9799) = 14849 - 9999 / 200 * Nat.choose 200 99 := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/DeepScaleR, flc-471406,"Let $A \subseteq \mathbb{N}$ be a subset of natural numbers with positive upper density, i.e., $$ \limsup_{n \to \infty} \frac{|A \cap [1, n]|}{n} > 0. $$ Prove that $A$ contains arithmetic progressions of arbitrary length.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove (A : Set ℕ) (hA : ∀ N, ∃ n, n > N ∧ (A ∩ Icc 1 n).ncard / n > 0) : ∀ k, ∃ a d, a ∈ A ∧ d ≠ 0 ∧ ∀ i ∈ range k, a + d * i ∈ A := sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/DeepTheorem, flc-482190,"Let $X$ be a set of real numbers. Prove that there does not exist a set $X$ such that $|X| > ext{aleph}_0$ (the cardinality of the natural numbers) and $|X| < 2^{ ext{aleph}_0}$ (the cardinality of the real numbers). Formally, for any set $X$ of real numbers, prove that either $|X| = ext{aleph}_0$ or $|X| = 2^{ ext{aleph}_0}$.","import Mathlib theorem SetReal : ¬∃ X : Set ℝ, X.ncard > (Set.Ici 1).ncard ∧ X.ncard < (2 ^ (Set.Ici 1).ncard) := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/DeepTheorem, flc-493802,"Prove that there exists a subset \( X \) of \(\{1, 2, 3, \ldots , 2^{1996} -1\}\) with at most 2012 elements such that \(1 \in X\), \(2^{1996} - 1 \in X\), and every element of \( X \) except 1 is the sum of two distinct elements of \( X \) or twice an element of \( X \).","import Mathlib theorem prove : ∃ (X : Finset ℕ), X ⊆ Finset.Icc 1 (2 ^ 1996 - 1) ∧ X.card ≤ 2012 ∧ 1 ∈ X ∧ 2 ^ 1996 - 1 ∈ X ∧ ∀ x ∈ X.erase 1, ∃ a b, a ≠ b ∧ a ∈ X ∧ b ∈ X ∧ x = a + b ∨ x = 2 * a := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/NuminaMath-TIR, flc-496192,"Prove that the maximum number \(n\) of a family of sets \(\{A_{1}, A_{2}, \ldots, A_{n}\}\) satisfying the conditions that each set \(A_{i}\) contains exactly 30 elements, for any \(1 \leq i < j \leq n\), the intersection \(A_{i} \cap A_{j}\) contains exactly 1 element, and the intersection \(A_{1} \cap A_{2} \cap \ldots \cap A_{n} = \varnothing\) is 871.","import Mathlib theorem max_number (n : ℕ) (hn : n ≥ 871) (A : Fin n → Set ℝ) (hA : ∀ i j, i ≠ j → (A i ∩ A j).encard = 1) (hA' : ∀ i, (A i).encard = 30) (hA'' : ⋂ i, A i = ∅) : n = 871 := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/NuminaMath-TIR, flc-508166,"Prove that it is not possible to find 1111 distinct subsets of the set \( X = \{1, 2, \ldots, 100\} \) such that \( |A \cap B| \) is a perfect square for all subsets \( A,B \) (where \( A \) and \( B \) can be the same subset).","import Mathlib open Finset theorem no_1111 : ¬∃ S : Finset (Finset ℕ), S.card = 1111 ∧ (∀ T ∈ S, T ⊆ Icc 1 100) ∧ (∀ A ∈ S, ∀ B ∈ S, IsSquare ((A ∩ B).card)) := by sorry ",Combinatorics,2. Difficulty 8-10,9.0,FineLeanCorpus/NuminaMath-TIR, flc-725,"Prove that \[ \lim_{n\to \infty}n^2\left(\frac{16^n}{\pi \binom{2n}{n}^2} - \frac{32n^2+8n+1}{32n}\right)=-\frac{1}{128}. \]","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (f : ℕ → ℝ) (h₀ : ∀ n, f n = n ^ 2 * ((16 ^ n / (Real.pi * Nat.choose (2 * n) n ^ 2)) - (32 * n ^ 2 + 8 * n + 1) / (32 * n))) : Tendsto f atTop (𝓝 (-1 / 128)) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-1044,"Let $X$ be a compact metric space, and let $f: X \to X$ be a continuous map. For a given integer $k > 0$, prove that there exists a point $x \in X$ and a strictly increasing sequence of integers $(n_{i})_{i \in \mathbb{N}}$ such that for every $1 \leq j \leq k$: \[ \lim_{i \to \infty} f^{j n_{i}}(x) = x \]","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (X : Type*) [MetricSpace X] [CompactSpace X] (f : X → X) (hf : Continuous f) (k : ℕ) (hk : 0 < k) : ∃ x, ∃ (n : ℕ → ℕ), StrictMono n ∧ ∀ j ∈ Icc 1 k, Tendsto (λ i => f^[j * n i] x) atTop (𝓝 x) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-4106,"Prove that if Alex moves from the origin \(O\) of a hexagonal lattice to one of the six adjacent vertices every second, and after \(2018\) moves, Alex is at vertex \(X\), and \(p\) is the probability that the shortest path from \(O\) to \(X\) (where a valid move is from a vertex to an adjacent vertex) has length \(2018\), and \(p\) can be expressed as \(\frac{a^m - b}{c^n}\), where \(a\), \(b\), and \(c\) are positive integers less than \(10\), \(a\) and \(c\) are not perfect squares, and \(m\) and \(n\) are positive integers less than \(10000\), then \(a + b + c + m + n = 4044\).","import Mathlib open Real open scoped BigOperators theorem hexagonal_lattice {p : ℝ} (hp : p = (Nat.choose 2018 6 * 5^2012) / (Nat.choose 2018 10 * 3^2012)) : ∃ a b c m n : ℕ, a < 10 ∧ b < 10 ∧ c < 10 ∧ m < 10000 ∧ n < 10000 ∧ ¬(∃ k : ℕ, k^2 = a) ∧ ¬(∃ l : ℕ, l^2 = c) ∧ p = (a^m - b) / (c^n) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-5098,Prove that \(\lim_{x\to+\infty}\dfrac{\#\{p: p \text{ is a prime such that } x\leq p\leq 2x\}}{\#\{p: p \text{ is a prime such that } p\leq x\}}=1\) where \(\#\) denotes the cardinality of the set under consideration.,"import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove : Tendsto (λ x => {p : ℕ | p.Prime ∧ x ≤ p ∧ p ≤ 2 * x}.ncard / {p : ℕ | p.Prime ∧ p ≤ x}.ncard) atTop (𝓝 1) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-5424,"Let $M$ be a set of real $n \times n$ matrices satisfying the following conditions: 1. $I_{n} \in M$, where $I_n$ is the $n \times n$ identity matrix. 2. If $A, B \in M$, then either $AB \in M$ or $-AB \in M$, but not both. 3. If $A, B \in M$, then either $AB = BA$ or $AB = -BA$. 4. If $A \in M$ and $A \ne I_n$, there exists at least one $B \in M$ such that $AB = -BA$. Prove that \( |M| \leq n^2 \).","import Mathlib theorem MatrixSet {n : ℕ} (hn : 0 < n) (M : Set (Matrix (Fin n) (Fin n) ℝ)) (h1 : 1 ∈ M) (h2 : ∀ A ∈ M, ∀ B ∈ M, (A * B ∈ M ∨ -A * B ∈ M) ∧ ¬(A * B ∈ M ∧ -A * B ∈ M)) (h3 : ∀ A ∈ M, ∀ B ∈ M, A * B = B * A ∨ A * B = -B * A) (h4 : ∀ A ∈ M, A ≠ 1 → ∃ B ∈ M, A * B = -B * A) : M.ncard ≤ n ^ 2 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-5430,"Prove that there exists a positive real number $c$ such that for any set of $n$ distinct positive integers, there exist three integers within this set whose least common multiple (LCM) is at least $c \cdot n^{2.99}$.","import Mathlib theorem prove : ∃ c : ℝ, c > 0 ∧ ∀ s : Finset ℕ, (∀ x ∈ s, x > 0) → ∃ x ∈ s, ∃ y ∈ s, ∃ z ∈ s, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ Nat.lcm (Nat.lcm x y) z ≥ c * s.card ^ (2.99 : ℝ) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-5888,"Prove that for \(n \ge 2\), \[ \sum_{r=0}^{n} \binom{n}{r}\frac{r^r (n-r)^{n-r}}{n^n}\leq \frac{5}{2\sqrt{2}}\sqrt{n}. \]","import Mathlib open Real theorem prove_473868 (n : ℕ) (hn : n ≥ 2) : ∑ r in Finset.Icc 0 n, Nat.choose n r * (r ^ r * (n - r) ^ (n - r)) / n ^ n ≤ 5 / (2 * sqrt 2) * sqrt n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-5902,Prove that \(\sum_{n=0}^\infty \frac{\binom{2n}{n}}{4^n(n+1)^3} = 8 + \ln^2 4 - 4 \ln 4 - \frac{\pi^2}{3}\).,"import Mathlib open Real theorem sum' : ∑' n : ℕ, Nat.choose (2 * n) n / (4 ^ n * (n + 1) ^ 3 : ℝ) = 8 + log 4 ^ 2 - 4 * log 4 - π ^ 2 / 3 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-6048,"Prove the following identity for all non - negative integers \(n\): \[ \sum_{k = 0}^n \binom{n}{k} (k + 1)^{k - 1} (n - k + 1)^{n - k} = (n + 2)^n. \]","import Mathlib open Finset theorem sum_k : ∀ n : ℕ, ∑ k ∈ range (n + 1), Nat.choose n k * (k + 1) ^ (k - 1) * (n - k + 1) ^ (n - k) = (n + 2) ^ n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-8395,"For every positive integer \(n\), prove that $$\sum_{k=1}^n(-1)^k{n\choose k}(k+1)^{k-1}k^{n-k}=(-1)^n.$$","import Mathlib open Finset Real Nat theorem sum_k : ∀ n > 0, ∑ k ∈ Icc 1 n, (-1 : ℝ)^k * Nat.choose n k * (k + 1)^(k - 1) * k^(n - k) = (-1)^n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-9098,"Prove that if \(m\) and \(n\) are positive relatively - prime integers such that \(\frac{m}{n}=\sum_{(a,b,c,d) \in S} \left(\frac{1}{2^a}\right)\left(\frac{1}{3^b}\right)\left(\frac{1}{4^c}\right)\left(\frac{1}{5^d}\right)\), where \(S\) is the set of all ordered quadruples of positive integers \((a, b, c, d)\) that can represent the side lengths of a convex quadrilateral, then \(m + n=2197001\).","import Mathlib open Real open scoped BigOperators theorem prove {m n : ℕ} (hm : 0 < m) (hn : 0 < n) (hmn : Nat.Coprime m n) (h : m / n = ∑' s : Fin 4 → ℕ, if (∀ i, 0 < s i) ∧ s 0 + s 1 > s 2 ∧ s 1 + s 2 > s 3 ∧ s 2 + s 3 > s 0 ∧ s 3 + s 0 > s 1 then (1 / (2 ^ s 0)) * (1 / (3 ^ s 1)) * (1 / (4 ^ s 2)) * (1 / (5 ^ s 3)) else 0) : m + n = 2197001 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-11995,"Prove or disprove: There do not exist natural numbers $x, y, z, n$ with $n > 2$ such that $\binom{x}{n} + \binom{y}{n} = \binom{z}{n}$.","import Mathlib theorem Nat.choose_eq_not : ¬∃ x y z n : ℕ, n > 2 ∧ Nat.choose x n + Nat.choose y n = Nat.choose z n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-15006,"Prove that there exists a nonnegative integer \(a\) such that the equation \[ \left\lfloor\frac{m}{1}\right\rfloor + \left\lfloor\frac{m}{2}\right\rfloor + \left\lfloor\frac{m}{3}\right\rfloor + \cdots + \left\lfloor\frac{m}{m}\right\rfloor = n^2 + a \] has at least one million distinct solutions \((m, n)\), where \(m\) and \(n\) are positive integers.","import Mathlib theorem algebra_447335 : ∃ a : ℕ, {p : ℕ × ℕ | p.1 > 0 ∧ p.2 > 0 ∧ ∑ i in Finset.Icc 1 p.1, ⌊(p.1 / i : ℝ)⌋ = p.2 ^ 2 + a}.ncard ≥ 1000000 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-17843,"Prove that there exists a set \(S\) such that for any function \(f\colon S^2 \to \mathbb{N}\), there exist two infinite subsets \(A, B \subseteq S\) for which the set \(\{f(a, b) \colon a \in A, b \in B\}\) is bounded.","import Mathlib theorem exists_set : ∃ S : Type, ∀ f : S → S → ℕ, ∃ A B : Set S, Infinite A ∧ Infinite B ∧ Bornology.IsBounded {x | ∃ a ∈ A, ∃ b ∈ B, f a b = x} := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-18363,"1. Prove that \(k_0 = 1\) and \(k_n = \frac{-\sum_{0 \leq i < n} \binom{n+1}{i} k_i}{n+1}\) for \(n \geq 1\), given the function \(\frac{z}{e^z - 1}=\frac{k_0}{0!}+\frac{k_1}{1!}z+\frac{k_2}{2!}z^2+\cdots\) where \(k_n\) are the coefficients of the series expansion. 2. Prove that \(\frac{\sum_{0 \leq i < n} \binom{n+1}{i} x^{n+1 - i} k_i}{n+1}=\sum_{j = 1}^{x - 1} j^n\) for all positive integers \(x\) and \(n\), given the function \(\frac{z}{e^z - 1}=\frac{k_0}{0!}+\frac{k_1}{1!}z+\frac{k_2}{2!}z^2+\cdots\) where \(k_n\) are the coefficients of the series expansion. 3. Prove that \(k_{2n+1}=0\) for all \(n\in\mathbb{N}_0\), given the function \(\frac{z}{e^z - 1}=\frac{k_0}{0!}+\frac{k_1}{1!}z+\frac{k_2}{2!}z^2+\cdots\) where \(k_n\) are the coefficients of the series expansion. 4. Prove that \(B_{2n}^{-1}\) is an integer for \(n\) a prime of the form \(3k + 1\), given that the Bernoulli numbers \(B_n\) are defined such that \(B_n=k_n\) and the function \(\frac{z}{e^z - 1}=\frac{k_0}{0!}+\frac{k_1}{1!}z+\frac{k_2}{2!}z^2+\cdots\) where \(k_n\) are the coefficients of the series expansion. 5. Prove that \(\zeta(2n)=\frac{2^{2n-1}|B_{2n}|\pi^{2n}}{(2n)!}\) for all \(n\in\mathbb{N}_0\), where the Riemann zeta function \(\zeta(r)=\sum_{n = 1}^{\infty}\frac{1}{n^r}\) for real numbers \(r>1\) and the Bernoulli numbers \(B_n\) are defined such that \(B_n = k_n\) and the function \(\frac{z}{e^z - 1}=\frac{k_0}{0!}+\frac{k_1}{1!}z+\frac{k_2}{2!}z^2+\cdots\) where \(k_n\) are the coefficients of the series expansion.","import Mathlib open Real theorem prove_k0 (k : ℕ → ℝ) : k 0 = 1 ∧ ∀ n ≥ 1, k n = (-∑ i in Finset.Ico 0 n, Nat.choose (n + 1) i * k i) / (n + 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-19408,"Prove that if $f: \mathbb{N} \to \mathbb{N}$ is an injective function such that for any finite set $S$ of positive integers with $\sum\limits_{s\in S}\frac{1}{s}$ being an integer, the sum $\sum\limits_{s\in S}\frac{1}{f\left( s\right) }$ is also an integer, then $f(n) = n$ for all $n \in \mathbb{N}$.","import Mathlib theorem proveFunction (f : ℕ → ℕ) (h₀ : Function.Injective f) (h₁ : ∀ S : Finset ℕ, (∀ s ∈ S, 0 < s) ∧ ∃ m : ℤ, ∑ s ∈ S, (1 / s : ℚ) = m → ∃ n : ℤ, ∑ s ∈ S, (1 / f s : ℚ) = n) : ∀ n : ℕ, f n = n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-20002,"Prove the following identity, originally established by C.W. Borchardt in 1855: \[\det_{_{1\leq i,j \leq n}}\left(\frac{1}{(x_i+y_j)^2}\right)=\det_{_{1\leq i,j \leq n}}\left(\frac{1}{x_i+y_j}\right)\text{perm}_{_{1\leq i,j \leq n}}\left(\left(\frac{1}{x_i+y_j}\right)\right)\] where $\text{perm}(A)$ is the permanent of a matrix $A$ defined as: \[\text{perm}(A)=\sum_{\sigma\in S_n}\prod_{i=1}^{n}a_{i,\sigma(i)}\] and the sum is over all permutations $\sigma$ in the symmetric group $S_n$, which consists of all permutations of the numbers $1,2,\cdots, n$.","import Mathlib open Finset Matrix theorem borchardt {n : ℕ} (hn : 0 < n) (x y : Fin n → ℝ) (hx : ∀ i, x i ≠ -y i) : Matrix.det (fun i j => 1 / (x i + y j) ^ 2) = Matrix.det (fun i j => 1 / (x i + y j)) * ∑ σ : Equiv.Perm (Fin n), ∏ i : Fin n, 1 / (x i + y (σ i)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-20015,"Let $A = \{ x \in \mathbb{R} : \lim_{n\to\infty} \{ 2^n x\} = 0 \}$, where $\{x\}$ denotes the fractional part of $x$, defined as $\{x\} = x - \lfloor x \rfloor$ with $\lfloor x \rfloor$ being the greatest integer less than or equal to $x$. Prove that the Lebesgue measure $m(A) = 0$ and that the set $A$ is countable.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem countable_and_measurable (A : Set ℝ) (hA : A = {x | Tendsto (λ n => (2 ^ n * x) % 1) atTop (𝓝 0)}) : MeasureTheory.volume A = 0 ∧ Countable A := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-21752,"Prove that there does not exist a bijective function \(f\colon \mathbb{R}\to\mathbb{R}\) such that for all \(x \in \mathbb{R}\), the inequality \(f(x) \cdot f([x]) \leq f(\{x\}) \cdot f(1 - \{x\})\) holds.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem no_bijective_f : ¬ ∃ f : ℝ → ℝ, Function.Bijective f ∧ ∀ x, f x * f (⌊x⌋) ≤ f (x % 1) * f (1 - x % 1) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-23914,"Prove that for a sufficiently large integer \(n > R_{1391}\), in any coloring of the subsets of the set \(\{1, 2, \ldots, n\}\) with \(1391\) colors, there exist two non - empty disjoint subsets \(A\) and \(B\) such that \(A\), \(B\), and \(A \cup B\) are all of the same color.","import Mathlib theorem P (R : ℕ) (hR : R = 1391) (n : ℕ) (hn : n > R) : ∀ f : Finset (Finset.Icc 1 n) → Fin 1391, ∃ A B : Finset (Finset.Icc 1 n), A ≠ ∅ ∧ B ≠ ∅ ∧ A ∩ B = ∅ ∧ f A = f B ∧ f B = f (A ∪ B) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-24292,"Prove that the cardinality of the set of all dense subsets of $\mathbb{R}$, where a dense subset $S \subseteq \mathbb{R}$ is defined as a subset whose closure equals $\mathbb{R}$ (i.e., $\bar{S} = \mathbb{R}$), is $2^{\mathfrak{c}}$, where $\mathfrak{c}$ is the cardinality of the continuum.","import Mathlib open Set Real theorem card_dense : {S : Set ℝ | closure S = ⊤}.encard = 2 ^ c := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-28771,"Prove that there exists a constant $c > 1$ such that for any positive integers $n$ and $k$ with $n > c^k$, the number of distinct prime factors of $\binom{n}{k}$ is at least $k$.","import Mathlib theorem exists_c : ∃ c : ℝ, 1 < c ∧ ∀ n k : ℕ, 0 < k → n > c ^ k → (Nat.primeFactors (n.choose k)).card ≥ k := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-29334,"Prove that there are no non - negative integers \(m\) and \(n\) that satisfy the equation \(107^{56}(m^2 - 1)+2m + 3=\binom{113^{114}}{n}\), where \(\binom{n}{r}=\frac{n!}{r!(n - r)!}\) for non - negative integers \(r\leq n\) and \(\binom{n}{r}=0\) if \(r > n\).","import Mathlib theorem unncop : ¬∃ (m n : ℕ), Nat.choose (113^114) n = 107^56 * ((m:ℤ)^2 - 1) + (2:ℤ)*m + (3:ℤ) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-33295,"Prove that when \(n = 4\) and \(p = 2^{2^n}+1 = 65537\), the remainder when \(\sum_{k = 1}^{2^{16}}\binom{2k}{k}(3\cdot2^{14}+1)^k(k - 1)^{2^{16}-1}\) is divided by \(p\) is \(28673\).","import Mathlib theorem prove (n : ℕ) (hn : n = 4) : (∑ k in Finset.Icc 1 (2^16), Nat.choose (2 * k) k * (3 * 2^14 + 1)^k * (k - 1)^(2^16 - 1)) % (2^(2^n) + 1) = 28673 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-38710,"For a finite set $X$ of positive integers, define \[ S(X) = \sum_{x \in X} x \quad \text{and} \quad P(X) = \prod_{x \in X} x. \] Let $A$ and $B$ be two finite sets of positive integers such that $\left\lvert A \right\rvert = \left\lvert B \right\rvert$, $P(A) = P(B)$, and $S(A) \neq S(B)$. Suppose for any $n \in A \cup B$ and any prime $p$ dividing $n$, we have $p^{36} \mid n$ and $p^{37} \nmid n$. Prove that \[ \left\lvert S(A) - S(B) \right\rvert > 1.9 \cdot 10^{6}. \]","import Mathlib theorem Qwen (A B : Finset ℕ) (hA : ∀ x ∈ A, x > 0) (hB : ∀ x ∈ B, x > 0) (hAB : A.card = B.card) (hAB' : ∏ x ∈ A, x = ∏ x ∈ B, x) (hAB'' : ∑ x ∈ A, x ≠ ∑ x ∈ B, x) (hAB''' : ∀ n ∈ A ∪ B, ∀ p, Nat.Prime p → p ∣ n → p^36 ∣ n ∧ ¬p^37 ∣ n) : |(∑ x ∈ A, x : ℝ) - (∑ x ∈ B, x)| > 1.9 * 10^6 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-41233,"Prove that the expression \[ \frac{\sum_{k_{1} + k_{2} + k_{3} = n - 1} \frac{(2n + 1)!}{(2k_{1} + 1)!(2k_{2} + 1)!(2k_{3} + 1)!}}{3} \] is a natural number, and that \[ \frac{\sum_{k_{1} + k_{2} + k_{3} = n - 1} \frac{(2n + 1)!}{(2k_{1} + 1)!(2k_{2} + 1)!(2k_{3} + 1)!}}{3^p} \] is not a natural number if \(p > 1\).","import Mathlib open Finset Real Nat theorem prove {n : ℕ} : ∃ m : ℕ, (∑ k₁ ∈ Icc 0 (n - 1), ∑ k₂ ∈ Icc 0 (n - 1), ∑ k₃ ∈ Icc 0 (n - 1), if k₁ + k₂ + k₃ = n - 1 then (Nat.factorial (2 * n + 1)) / ((Nat.factorial (2 * k₁ + 1)) * (Nat.factorial (2 * k₂ + 1)) * (Nat.factorial (2 * k₃ + 1))) else 0) / 3 = m ∧ ∀ p > 1, ¬∃ m : ℕ, (∑ k₁ ∈ Icc 0 (n - 1), ∑ k₂ ∈ Icc 0 (n - 1), ∑ k₃ ∈ Icc 0 (n - 1), if k₁ + k₂ + k₃ = n - 1 then (Nat.factorial (2 * n + 1)) / ((Nat.factorial (2 * k₁ + 1)) * (Nat.factorial (2 * k₂ + 1)) * (Nat.factorial (2 * k₃ + 1))) else 0) / 3 ^ p = m := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-41293,"Let $I$ be a nonempty open interval. Let $A$ and $B$ be disjoint subsets of $I$ such that $A \cup B = I$, and both $A$ and $B$ have positive Lebesgue measure. Let $0 < p < 1$ (with $p \neq \frac{1}{2}$) be a given real number. Prove that there exist $x \in A$ and $y \in B$ such that $px + (1-p)y \in A$ and $(1-p)x + py \in B$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem proveMeasureTheory {I : Set ℝ} (hI : ∃ a b, I = Set.Ioo a b) (A B : Set ℝ) (hA : A ⊆ I) (hB : B ⊆ I) (hAB : Disjoint A B) (hABC : A ∪ B = I) (hA' : 0 < (MeasureTheory.volume A).toReal) (hB' : 0 < (MeasureTheory.volume B).toReal) (p : ℝ) (hp : 0 < p ∧ p < 1) (hp2 : p ≠ 1 / 2) : ∃ x ∈ A, ∃ y ∈ B, p * x + (1 - p) * y ∈ A ∧ (1 - p) * x + p * y ∈ B := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-44542,"Given a polynomial \(f(x)\) with rational coefficients and degree \(d \ge 2\), and defining a sequence of sets \(f^0(\mathbb{Q}), f^1(\mathbb{Q}), \ldots\) where \(f^0(\mathbb{Q}) = \mathbb{Q}\) and \(f^{n+1}(\mathbb{Q}) = f(f^n(\mathbb{Q}))\) for \(n \ge 0\), and \(f^{\omega}(\mathbb{Q}) = \bigcap_{n=0}^{\infty} f^n(\mathbb{Q})\). Prove that \(f^{\omega}(\mathbb{Q})\) is a finite set.","import Mathlib open Finset theorem Polynomial.eval_sequence {P : Polynomial ℚ} (hP : P.degree ≥ 2) (f : ℕ → Set ℚ) (hf0 : f 0 = ⊤) (hfn : ∀ n, f (n + 1) = P.eval '' f n) : Set.Finite (⋂ n, f n) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-49289,"Prove that the number of [i]good[/i] functions \(f: \mathbb{Z} \rightarrow \{1, 2, \ldots, n\}\) (where for any integer \(k\) with \(1 \le k \le n - 1\), there exists an integer \(j(k)\) such that for every integer \(m\), \(f(m + j(k)) \equiv f(m + k) - f(m) \pmod{n + 1}\)) is \(n \cdot \phi(n)\), where \(\phi\) is Euler's totient function and \(n \ge 2\) is an integer.","import Mathlib open Finset theorem number_of_good_fns {n : ℕ} (hn : 2 ≤ n) : {f : ℤ → Icc 1 n | ∀ k ∈ Icc 1 (n - 1), ∃ j : ℤ, ∀ m : ℤ, f (m + j) ≡ f (m + k) - f m [ZMOD n + 1]}.ncard = n * (n.totient : ℕ) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-52741,"For any vectors $\textbf{a} = (a_1, a_2, \ldots, a_n)$ and $\textbf{b} = (b_1, b_2, \ldots, b_n)$ such that $\textbf{a} \succ \textbf{b}$, and any real numbers $p_1, p_2, \ldots, p_n$, prove that the inequality \[ \sum_{\sigma \in S_n} \left( \sum_{i=1}^{n} p_{\sigma(i)} a_i \right)^2 \geq \sum_{\sigma \in S_n} \left( \sum_{i=1}^{n} p_{\sigma(i)} b_i \right)^2 \] holds. Also, prove that equality occurs if and only if all the $p_i$ are equal or $\textbf{a}$ is a permutation of $\textbf{b}$.","import Mathlib open Finset Real theorem inequalities {n : ℕ} (hn : 0 < n) (a b : Fin n → ℝ) (ha : ∀ i, a i > b i) (p : Fin n → ℝ) : (∑ σ : Equiv.Perm (Fin n), (∑ i, p (σ i) * a i) ^ 2) ≥ (∑ σ : Equiv.Perm (Fin n), (∑ i, p (σ i) * b i) ^ 2) ∧ (∑ σ : Equiv.Perm (Fin n), (∑ i, p (σ i) * a i) ^ 2 = ∑ σ : Equiv.Perm (Fin n), (∑ i, p (σ i) * b i) ^ 2 ↔ (∀ i j, p i = p j) ∨ (∃ σ : Equiv.Perm (Fin n), ∀ i, a i = b (σ i))) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-56269,"Prove that the set of all real numbers \(a\) such that for every sequence \(a_1, a_2, a_3, \ldots\) of pairwise distinct positive integers with \(a_n \leq an\) for every positive integer \(n\), there exist infinitely many terms in the sequence such that the sum of their digits in base \(4038\) is not divisible by \(2019\) is the set \(\{a \in \mathbb{R} \mid 1 \leq a < 2019\}\).","import Mathlib open Real theorem prove (a : ℝ) : (∀ a' : ℕ → ℕ, (∀ i j, i ≠ j → a' i ≠ a' j) ∧ (∀ n, 0 < a' n) ∧ (∀ n, a' n ≤ a * n) → {n | ¬(2019 ∣ (Nat.digits 4038 (a' n)).sum)}.Infinite) ↔ 1 ≤ a ∧ a < 2019 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-56384,"Prove that the set of all real numbers \(a\) such that for every sequence \(a_1, a_2, a_3, \ldots\) of pairwise distinct positive integers with \(a_n \leq an\) for every positive integer \(n\), there exist infinitely many terms in the sequence such that the sum of their digits in base \(4038\) is not divisible by \(2019\) is the set \(\{a \in \mathbb{R} \mid a \geq 2019\}\).","import Mathlib open Real theorem prove (a : ℝ) : (∀ a' : ℕ → ℕ, (∀ i j, i ≠ j → a' i ≠ a' j) ∧ (∀ n, 0 < a' n) ∧ (∀ n, a' n ≤ a * n) → {k | ¬(2019 ∣ (Nat.digits 4038 (a' k)).sum)}.Infinite) ↔ 2019 ≤ a := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-57147,"Given an integer \(n \geq 4\), let \(S = \{1, 2, \ldots, n\}\). Consider two subsets \(A\) and \(B\) of \(S\) such that for every pair \((a, b)\) with \(a \in A\) and \(b \in B\), the expression \(ab + 1\) is a perfect square. Prove that \[ \min \{|A|, |B|\} \leq \lceil \log_{\frac{3 + \sqrt{5}}{2}} \left( \frac{n - 1}{2} \right) \rceil. \]","import Mathlib open Finset Real theorem logint (n : ℕ) (hn : 4 ≤ n) (A B : Finset ℕ) (hA : A ⊆ Icc 1 n) (hB : B ⊆ Icc 1 n) (hAB : ∀ x ∈ A, ∀ y ∈ B, ∃ m, m^2 = x * y + 1) : min (A.card) (B.card) ≤ ⌈logb ((3 + sqrt 5) / 2) ((n - 1) / 2)⌉ := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-58402,"Prove that there exist two infinite subsets \(A\) and \(B\) of \(\mathbb{N}\) such that for every \(b \in B\), there is no prime number that divides two distinct elements of the set \(A + b\).","import Mathlib theorem algebra_584017 : ∃ A B : Set ℕ, Infinite A ∧ Infinite B ∧ ∀ b ∈ B, ∀ p, Nat.Prime p → ¬(∃ x ∈ A, ∃ y ∈ A, x ≠ y ∧ p ∣ (x + b) ∧ p ∣ (y + b)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-58789,"Let \(p\) be a prime number greater than 5. Define \(f(p)\) as the number of infinite sequences \(a_1, a_2, a_3, \ldots\) such that \(a_n \in \{1, 2, \ldots, p - 1\}\) and \(a_n a_{n+2} \equiv 1 + a_{n+1} \pmod{p}\) for all \(n \geq 1\). Prove that \(f(p) \equiv 0 \text{ or } 2 \pmod{5}\).","import Mathlib theorem f (p : ℕ) (hp : Nat.Prime p) (h : 5 < p) : {a : ℕ → ℕ | (∀ n, a n ∈ Finset.Icc 1 (p - 1)) ∧ (∀ n, a n * a (n + 2) ≡ 1 + a (n + 1) [MOD p])}.ncard ≡ 0 [ZMOD 5] ∨ {a : ℕ → ℕ | (∀ n, a n ∈ Finset.Icc 1 (p - 1)) ∧ (∀ n, a n * a (n + 2) ≡ 1 + a (n + 1) [MOD p])}.ncard ≡ 2 [ZMOD 5] := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-59816,"Prove that \[\sum_{k=0}^\infty \binom{3k}{k}\frac{9k^2-3k-1}{(3k-1)(3k-2)}\left(\frac{2}{27}\right)^k = \frac{1}{4}.\]","import Mathlib open Real open scoped BigOperators theorem sum_series : ∑' k : ℕ, Nat.choose (3 * k) k * (9 * k ^ 2 - 3 * k - 1) / ((3 * k - 1) * (3 * k - 2)) * (2 / 27) ^ k = 1 / 4 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-60023,"Let $x_1, x_2, \ldots, x_n$ be real numbers. For any subset $I \subset \{1, 2, \ldots, n\}$, define $s(I) = \sum_{i \in I} x_i$. Assume that the function $I \mapsto s(I)$ takes on at least $1.8^n$ distinct values as $I$ ranges over all $2^n$ subsets of $\{1, 2, \ldots, n\}$. Prove that the number of subsets $I \subset \{1, 2, \ldots, n\}$ for which $s(I) = 2019$ does not exceed $1.7^n$.","import Mathlib theorem qwen (n : ℕ) (x : Fin n → ℝ) (h : Set.ncard {y | ∃ I : Finset (Fin n), y = ∑ i ∈ I, x i} ≥ 18 ^ n / 10) : {I : Finset (Fin n) | ∑ i ∈ I, x i = 2019}.ncard ≤ 17 ^ n / 10 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-60467,"Let $a$ be a positive integer. A positive integer $b$ is defined to be [i]$a$-good[/i] if $\binom{an}{b} - 1$ is divisible by $an + 1$ for all positive integers $n$ such that $an \geq b$. Suppose $b$ is a positive integer that is $a$-good, but $b+2$ is not $a$-good. Prove that $b+1$ is a prime number.","import Mathlib theorem qwen (a : ℕ) (ha : 0 < a) (b : ℕ) (hb : ∀ n, 0 < n → a * n ≥ b → (Nat.choose (a * n) b - 1) % (a * n + 1) = 0) (h : ¬∃ m, 0 < m ∧ a * m ≥ b + 2 ∧ (Nat.choose (a * m) (b + 2) - 1) % (a * m + 1) = 0) : Nat.Prime (b + 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-61372,"Prove that there exists a sequence $A_1, A_2, \ldots$ of subsets of $\mathbb{N}$ such that: 1. For all $i \neq j$, $A_i \not\subseteq A_j$. 2. If $S \subseteq \mathbb{N}$ has a non - empty intersection with each $A_i$, then there exists an element $x \in S$ such that $S' := S \setminus \{x\}$ also has a non - empty intersection with each set $A_i$. Alternatively, prove that there exists an infinite antichain $\mathcal{A}$ of $2^{\mathbb{N}}$ such that there does not exist a minimal subset of $\mathbb{N}$ having a non - empty intersection with every member of $\mathcal{A}$.","import Mathlib open Set Real open scoped BigOperators theorem exist_A : ∃ (A : ℕ → Set ℕ), (∀ i j, i ≠ j → ¬(A i ⊆ A j)) ∧ (∀ S : Set ℕ, (∀ i, S ∩ A i ≠ ∅) → ∃ x ∈ S, ∀ i, (S \ {x}) ∩ A i ≠ ∅) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-63768,"Prove that the remainder when the number \(N\) of sextuples of integers \((x, y, z, a, b, c)\) such that \(1 \leq x, y, z \leq 191\) and \(1 \leq a, b, c \leq 190\) for which the expression \(x^a y^b z^c - 1\) is divisible by \(191\) is divided by \(1000\) is \(617\).","import Mathlib theorem count : {(x, y, z, a, b, c) : ℕ × ℕ × ℕ × ℕ × ℕ × ℕ | (1 ≤ x ∧ x ≤ 191 ∧ 1 ≤ a ∧ a ≤ 190) ∧ (1 ≤ y ∧ y ≤ 191 ∧ 1 ≤ b ∧ b ≤ 190) ∧ (1 ≤ z ∧ z ≤ 191 ∧ 1 ≤ c ∧ c ≤ 190) ∧ 191 ∣ x ^ a * y ^ b * z ^ c - 1}.ncard % 1000 = 617 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-65123,"Let $p$ be a prime number, and let $s$ be the number of bijections $f: \{1,2,\cdots,2p\} \to \{1,2,\cdots,2p\}$ such that $f^p$ is the identity function, where $f^p = f(f(f(\cdots(f(p))\cdots)))$ ($p$ times). Prove that $s$ is not a divisor of $2p$.","import Mathlib open Finset theorem number_of_bijections_not_dividing_2p (p : ℕ) [inst : Fact (Nat.Prime p)] : ¬((Nat.card {f : Equiv.Perm (Fin (2 * p)) | f^[p] = id}) ∣ 2 * p) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-67100,"Prove that the least possible value of a positive integer \(N\) for which there exist two distinct sets of 2019 numbers each chosen from the numbers \(1, 2, 3, \ldots, N\) such that the sum of the numbers in each set is equal to \(N\) is \(N = 6115551\).","import Mathlib theorem solution : IsLeast {N | N > 0 ∧ ∃ s1 s2 : Finset ℕ, s1 ⊆ Finset.Icc 1 N ∧ s2 ⊆ Finset.Icc 1 N ∧ s1 ≠ s2 ∧ s1.card = 2019 ∧ s2.card = 2019 ∧ ∑ i ∈ s1, i = N ∧ ∑ i ∈ s2, i = N} 6115551 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-69305,"Prove that there exists a Lebesgue - measurable set \(E \subseteq \mathbb{R}\) with \(\mu(E)=0\) such that \(\mu(E\cdot E)>0\), where \(E\cdot E = \{x\cdot y:x,y\in E\}\) and \(\mu\) denotes the Lebesgue measure.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove_98744 : ∃ (E : Set ℝ), (MeasureTheory.volume E).toReal = 0 ∧ (MeasureTheory.volume {x | ∃ a b, x = a * b ∧ a ∈ E ∧ b ∈ E}).toReal > 0 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-70278,"For a given positive integer \(k\), a positive integer \(n\) is called [i]good[/i] if at least \(0.99n\) of the binomial coefficients \(\binom{n}{0}, \binom{n}{1}, \binom{n}{2}, \ldots, \binom{n}{n}\) are divisible by \(k\). Prove that there exists a positive integer \(N\) such that among the integers \(1, 2, \ldots, N\), at least \(0.99N\) of them are good.","import Mathlib open Finset Real Nat theorem prove_good (k : ℕ) (hk : 0 < k) : ∃ N : ℕ, 0 < N ∧ {n | n ∈ Icc 1 N ∧ {i | i ∈ range (n + 1) ∧ k ∣ Nat.choose n i}.ncard ≥ 99 * n / 100}.ncard ≥ 99 * N / 100 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-71381,"Let \(n\) be a positive integer, and let \(U\) be a Lebesgue - measurable subset of \(\mathbb{R}^n\) with positive Lebesgue measure. Suppose that \(U\) satisfies the following conditions: 1. \(x + y \in U\) for all \(x, y \in U\). 2. \(-x \in U\) for all \(x \in U\). Prove that \(U = \mathbb{R}^n\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem algebra_467053 {n : ℕ} (hn : 0 < n) (U : Set (EuclideanSpace ℝ (Fin n))) (hU : 0 < MeasureTheory.volume U) (hU1 : ∀ x ∈ U, ∀ y ∈ U, x + y ∈ U) (hU2 : ∀ x ∈ U, -x ∈ U) : U = ⊤ := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-74022,"Let \(p\) be a prime number, and let \(s\) be the number of bijections \(f: \{1,2,\cdots,2p\} \to \{1,2,\cdots,2p\}\) such that \(f^p\) is the identity function, where \(f^p = f(f(f(\cdots(f(p))\cdots)))\) (\(p\) times). Prove that \(2p \nmid s\).","import Mathlib open Finset theorem number_of_bijective_power_eq_one {p : ℕ} [inst : Fact (Nat.Prime p)] : ¬ (∃ s : ℕ, s = {f : Equiv.Perm (Fin (2 * p)) | f^[p] = id}.ncard ∧ 2 * p ∣ s) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-76191,"Prove that for some natural number \(n\), there exist \(n^9\) natural numbers less than \(n^{10}\) such that no three of these numbers form an arithmetic progression.","import Mathlib theorem prove : ∃ n : ℕ, ∃ s : Finset ℕ, s.card = n ^ 9 ∧ ∀ x ∈ s, x < n ^ 10 ∧ ∀ x ∈ s, ∀ y ∈ s, ∀ z ∈ s, x ≠ y ∧ y ≠ z ∧ z ≠ x → ¬(∃ d, y = x + d ∧ z = y + d) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-89663,"Let $A = \{a_1, a_2, \ldots, a_n\}$ and $B = \{b_1, b_2, \ldots, b_m\}$ be two distinct sets of positive integers. Define $A^* = \{a_i + a_j \mid 1 \leq i < j \leq n\}$ and $B^* = \{b_i + b_j \mid 1 \leq i < j \leq m\}$, where an element is included in $A^*$ or $B^*$ multiple times if it can be expressed as the sum of two distinct elements in more than one way. Prove that if $A^* = B^*$, then $|A| = |B| = 2^k$ for some integer $k$.","import Mathlib def Astar (A : Finset ℕ) := {x | ∃ i ∈ A, ∃ j ∈ A, x = i + j ∧ i ≠ j} def Bstar (B : Finset ℕ) := {x | ∃ i ∈ B, ∃ j ∈ B, x = i + j ∧ i ≠ j} theorem starEq {A B : Finset ℕ} (hA : ∀ a ∈ A, a > 0) (hB : ∀ b ∈ B, b > 0) (hAB : A ≠ B) (hstar : Astar A = Bstar B) : ∃ k, A.card = 2 ^ k ∧ B.card = 2 ^ k := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-95031,"Prove that if $A$ is the set of natural numbers $n$ such that $n$ is a divisor of $2^n + 1$, then $\lim_{N \to +\infty} \frac{|A \cap [1, N]|}{N} = 0$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove (A : Set ℕ) (hA : A = {n | n ∣ (2 ^ n + 1)}) : Tendsto (λ N => (Set.ncard {x | x ∈ A ∧ x ≤ N}) / N) atTop (𝓝 0) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-95554,"Prove that the smallest integer \(n \geq m\) (where \(m \geq 2\) is an integer) such that for any partition of the set \(\{m, m + 1, m + 2, \ldots, n\}\) into two subsets, at least one of the subsets contains three numbers \(a, b, c\) (not necessarily distinct) satisfying \(a^b = c\) is \(n = m^{m^{m+2}} - 1\).","import Mathlib theorem prove (m : ℕ) (hm : 2 ≤ m) : IsLeast {n | m ≤ n ∧ ∀ s1 s2 : Finset ℕ, s1 ∪ s2 = Finset.Icc m n ∧ s1 ∩ s2 = ∅ → ∃ a ∈ s1, ∃ b ∈ s1, ∃ c ∈ s1, a ^ b = c ∨ ∃ a ∈ s2, ∃ b ∈ s2, ∃ c ∈ s2, a ^ b = c} (m ^ (m ^ (m + 2)) - 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-121013,"Let $p = 2^{16} + 1$ be a prime number. A sequence of $2^{16}$ positive integers \( \{a_n\} \) is called *monotonically bounded* if \( 1 \leq a_i \leq i \) for all \( 1 \leq i \leq 2^{16} \). A term \( a_k \) in the sequence, where \( 2 \leq k \leq 2^{16} - 1 \), is defined as a *mountain* if \( a_k \) is greater than both \( a_{k-1} \) and \( a_{k+1} \). Determine the remainder when the total number of mountain terms over all such sequences is divided by \( p \). Prove that the answer is 49153.","import Mathlib open Finset theorem mountainTerms {p : ℕ} (hp : Nat.Prime p) (hp1 : p = 2^16 + 1) (a : ℕ → ℕ) (ha : ∀ i ∈ Icc 1 (2^16), 1 ≤ a i ∧ a i ≤ i) : (∑ i ∈ Icc 2 (2^16 - 1), if a i > a (i - 1) ∧ a i > a (i + 1) then 1 else 0) % p = 49153 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-121053,"Determine the value of \( f(k) = \lim_{n \rightarrow \infty} \frac{|S_n(k)|}{\pi(n)} \), where \( S_n(k) = \{1 \leq m \leq n : m \text{ has } k \text{ ones in its binary representation and } m \text{ is prime}\} \) and \( \pi(x) \) is the prime counting function. Prove that the answer is 0.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem f (k : ℕ) : Tendsto (λ n => {m | m ∈ Icc 1 n ∧ (Nat.digits 2 m).sum = k ∧ Nat.Prime m}.ncard / (Nat.primesBelow n).card) atTop (𝓝 0) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-121201,"Determine whether the Mandelbrot set is countable or has the cardinality \(2^{\aleph_0}\). Prove that the answer is 2^{\aleph_0}.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem cardMandelbrot : Set.Infinite (MandelbrotSet : Set ℂ) ∧ ¬∃ f : ℕ → ℂ, ∀ n, f n ∈ MandelbrotSet := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-122920,"Let $(n_k)$ be an increasing sequence of positive integers. Define $E$ as the set of all $x$ such that the sequence $\sin(n_k x)$ converges. Prove that the Lebesgue measure of $E$, $\mu(E)$, is zero. Prove that the answer is 0.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem μ {n : ℕ → ℤ} (hn : StrictMono n) (hpos : ∀ k, 0 < n k) : (MeasureTheory.volume {x | ∃ L, Tendsto (λ k => Real.sin (n k * x)) atTop (𝓝 L)}).toReal = 0 := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-123100,"Consider the Fibonacci sequence $F_n = 1, 1, 2, 3, 5, \ldots$ (starting with $n=1$) and the Catalan sequence $C_n = \frac{1}{n+1}\binom{2n}{n}$. Define $B_z$ as the number of integers $n \leq z$ for which $\gcd(F_n, C_n) = 1$. Does the ratio $\frac{B_z}{z}$ converge as $z$ approaches infinity? If so, to what value does it converge? Prove that the answer is 1.","import Mathlib open Real Filter Function open scoped Topology theorem Tendsto (B : ℕ → ℕ) (hB : ∀ z, B z = {n | n ≤ z ∧ Nat.gcd (Nat.fib n) (Nat.choose (2 * n) n / (n + 1)) = 1}.ncard) : Tendsto (λ z => (B z : ℝ) / z) atTop (𝓝 1) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-123537,"Suppose we have the set $[0,1]$ equipped with the Lebesgue measure. A measurable function $f$ is said to be non-decreasing on a full-measure set if there exists a set $E$ with $\mu(E)=1$ such that for all $y,z\in E$, if $z\leq y$, then $f(z)\leq f(y)$. If $f$ is not non-decreasing on a full-measure set, does there exist an $x\in[0,1]$, a subset $A\subseteq [0,x]$, and a subset $B\subseteq[x,1]$, both $A$ and $B$ with positive Lebesgue measure, such that $f(z)>f(y)$ for every $z\in A$ and $y \in B$? Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem yes (f : ℝ → ℝ) (h : ¬ ∃ E : Set ℝ, E ⊆ Set.Icc 0 1 ∧ MeasureTheory.volume E = 1 ∧ ∀ y ∈ E, ∀ z ∈ E, z ≤ y → f z ≤ f y) : ∃ x ∈ Set.Icc 0 1, ∃ A B : Set ℝ, A ⊆ Set.Icc 0 x ∧ B ⊆ Set.Icc x 1 ∧ MeasureTheory.volume A > 0 ∧ MeasureTheory.volume B > 0 ∧ ∀ y ∈ A, ∀ z ∈ B, z > y → f z > f y := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-123601,"Determine the cardinality of the Mandelbrot set $M$. Is it countable or does it have the same cardinality as the power set of the natural numbers, $2^{\aleph_0}$? Prove that the answer is 2^{\aleph_0}.","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem cardM : ¬ Countable (M : Set ℂ) ∧ (M : Set ℂ).encard = 2 ^ (Nat.card ℕ) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-123792,"Determine the 2-dimensional Lebesgue measure of the set \( \Gamma^2 := \{ (\{at\},\{bt\}) \mid t \in \mathbb{R} \} \subset \mathbb{R}^2 \), where \( \{x\} \) denotes the fractional part of \( x \), and \( a, b \) are two irrational numbers such that \( \frac{a}{b} \) is also irrational. Prove that the answer is 0.","import Mathlib open Real Set open scoped BigOperators theorem MeasureTheory (a b : ℝ) (ha : Irrational a) (hb : Irrational b) (h : ¬∃ q : ℚ, a/b = q) : (MeasureTheory.volume {(x, y) : ℝ × ℝ | ∃ t : ℝ, x = (t * a) % 1 ∧ y = (t * b) % 1}).toReal = 0 := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-123991,"Is there a collection of subsets of the natural numbers, \( \omega \), that has the doughnut property but does not have the Ramsey property? Prove that the answer is Yes.","import Mathlib def doughnut_property (s : Set ℕ) := ∀ n, n ∈ s → ∃ m, m ∈ s ∧ m > n ∧ ¬∃ k, k ∈ s ∧ k < m def ramsey_property (s : Set ℕ) := ∀ n, n ∈ s → ∃ m, m ∈ s ∧ m > n ∧ ∃ k, k ∈ s ∧ k < m theorem is_doughnut_not_ramsey : ∃ ω : Set (Set ℕ), (∀ s ∈ ω, doughnut_property s) ∧ ¬(∀ s ∈ ω, ramsey_property s) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-124025,"Determine the cardinality of the set $A$, where $A$ consists of all sequences $a = (a_n)_{n \ge 1}$ of natural numbers satisfying the following conditions for all $n \ge 1$: (a) $a_n < a_{n+1}$ (strictly increasing), and (b) the limit $\lim_{n\to \infty} \frac{\#\{j \mid a_j \le n\}}{n}$ exists. Prove that the answer is 2^{\aleph_0}.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem determine_A : Set.ncard {a : ℕ → ℕ | StrictMonoOn a (Set.Ici 1) ∧ ∃ L, Tendsto (λ n => {j | a j ≤ n}.ncard / n) atTop (𝓝 L)} = 2 ^ (Nat.card ℕ) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-124683,"Prove that the largest possible value of the number \(N\) of elements of a set \(S\) of complex numbers, where if \(u, v \in S\) then \(u v \in S\) and \(u^{2}+v^{2} \in S\) and \(N\) is the number of elements of \(S\) with absolute value at most 1 and \(N\) is finite, is 13.","import Mathlib theorem ComplexSet (S : Finset ℂ) (hS : ∀ u ∈ S, ∀ v ∈ S, u * v ∈ S) (hS' : ∀ u ∈ S, ∀ v ∈ S, u ^ 2 + v ^ 2 ∈ S) : {x | x ∈ S ∧ ‖x‖ ≤ 1}.encard ≤ 13 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-124684,"Prove that the remainder when the number of ordered pairs of perfectutations \((f, g)\) of the set \(S = \{1,2, \ldots, 2012\}\) such that \(f(g(i))=g(f(i))\) for all \(i \in S\) and \(f \neq g\) is divided by \(2011\) is \(2\).","import Mathlib theorem number_of_pairs : {(f, g) : Equiv.Perm (Fin 2012) × Equiv.Perm (Fin 2012) | (∀ i, f (g i) = g (f i)) ∧ f ≠ g}.ncard % 2011 = 2 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-124792,"Prove that the maximum number of distinct \(n\) - tuples with integer entries such that any two of them form an exquisite pair (where a pair of \(n\) - tuples \((a_{1},\ldots,a_{n})\) and \((b_{1},\ldots,b_{n})\) with integer entries is called an exquisite pair if \(\left|a_{1}b_{1}+\cdots + a_{n}b_{n}\right|\leq1\)) is \(n^{2}+n + 1\).","import Mathlib open Finset theorem max_excellent_pairs {n : ℕ} : IsGreatest {k | ∃ s : Finset (Fin n → ℤ), s.card = k ∧ ∀ a ∈ s, ∀ b ∈ s, a ≠ b → |(∑ i : Fin n, a i * b i)| ≤ 1} (n ^ 2 + n + 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-125930,"Prove that the maximum value of \(n\) for distinct non - empty subsets \(A_1,A_2,\ldots,A_n\) of \(M=\{1,2,\ldots,20\}\) such that \(|A_i\cap A_j|\leq2\) for \(i\neq j\) is \(1350\).","import Mathlib open Finset theorem max_value : IsGreatest {n | ∃ s : Finset (Finset ℕ), s.card = n ∧ (∀ i ∈ s, i ≠ ∅ ∧ i ⊆ Icc 1 20) ∧ ∀ i ∈ s, ∀ j ∈ s, i ≠ j → (i ∩ j).card ≤ 2} 1350 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-128957,"Prove that the largest number of subsets in a family \(\mathcal{F}\) of subsets of \(\{1,2,\ldots, 2017\}\) such that if \(S_1\) and \(S_2\) are two elements of \(\mathcal{F}\) with \(S_1\subsetneq S_2\), then \(|S_2\setminus S_1|\) is odd, is \(2 \binom{2017}{1008}\).","import Mathlib open Finset theorem max {F : Finset (Finset ℕ)} (hF : ∀ S ∈ F, S ⊆ Icc 1 2017) (hF' : ∀ S1 ∈ F, ∀ S2 ∈ F, S1 ⊂ S2 → Odd (S2.card - S1.card)) : F.card ≤ 2 * Nat.choose 2017 1008 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-132215,"Let $n$ be a composite modulus, and let $C$ be a ciphertext in the group $\text{mod } n$. Under the Strong RSA Assumption, prove that it is computationally infeasible for an adversary to find any plaintext $M \neq 1$ and an odd public exponent $e \neq 1$ such that $C = M^e \mod n$, even if the adversary is allowed to freely choose $e \neq 1$. This assumption forms the security basis for various cryptographic primitives, including signature schemes and zero-knowledge protocols.","import Mathlib theorem strong_rsa_assumption (n : ℕ) (hn : ¬Prime n) (C : ZMod n) : ∀ M : ZMod n, M ≠ 1 → ∀ e : ℕ, Odd e → e ≠ 1 → ¬∃ P : ZMod n, P ^ e = C := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-132804,"Let $q \neq 1$ be a positive integer and $b > 1$ be a real number such that $\log_b(q)$ is irrational. Prove that the sequence of fractional parts $\{ n \log_b(q) \}$ (where $n \in \mathbb{N}$) is dense in $[0,1)$.","import Mathlib open Real theorem number_theory_342657 {q : ℕ} (hq : q > 0 ∧ q ≠ 1) (b : ℝ) (hb : b > 1) (h : Irrational (logb b q)) : Dense {x | ∃ n : ℕ, x = (n * logb b q) % 1} := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-133000,"Let $C$ be the category of sets and bijections, and let $Card$ be a skeleton of $C$ with an inclusion functor $i: Card o C$. Define the product of cardinalities as the composite functor $Card imes Card o C imes C o C o Card$, where the first map is induced by $i$, the second is the cartesian product functor in $C$, and the third is a quasi-inverse of $i$. Prove that the product of cardinalities is associative, meaning for any cardinalities $a, b, c ext{ in } Card$, we have $a imes (b imes c) = (a imes b) imes c$ in $Card$.","import Mathlib open Set theorem card_assoc {A B C : Type*} [Fintype A] [Fintype B] [Fintype C] : Fintype.card A * Fintype.card (B × C) = Fintype.card (A × B) * Fintype.card C := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-133084,"Let $S = \{n^2 : n \in \mathbb{N}\}$ denote the set of perfect squares. Prove that any subset $A \subseteq S$ with positive density contains a solution to the equation: \[ \frac{1}{4}(x_1 + x_2 + x_3 + x_4) = x_5, \] where $x_1, x_2, x_3, x_4, x_5 \in A$.","import Mathlib theorem Prove (S : Set ℕ) (hS : S = {n | ∃ m, n = m ^ 2}) : ∀ A ⊆ S, A.ncard > 0 → ∃ x : Fin 5 → ℕ, (∀ i, x i ∈ A) ∧ (1 / 4 : ℚ) * (x 0 + x 1 + x 2 + x 3) = x 4 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-133282,"Let $A$ be a non-empty set, and let $\phi: A \to \mathcal{P}(A) \setminus \{\emptyset\}$ be a function such that $\phi(a)$ is non-empty for all $a \in A$. Define $T$ as the set of all finite functions $s: n \to A$ (where $n \in \mathbb{N}$) satisfying the conditions: 1. $s(0) = \bar{a}$ for some fixed $\bar{a} \in A$. 2. For all $i+1 < n$, $s(i+1) \in \phi(s(i))$. Define a relation $R \subseteq T \times T$ by \[ R = \{(s, t) \in T^2 \mid s \subsetneq t \}, \] where $t$ is a proper end-extension of $s$. Prove that if the axiom of Dependent Choice (DC) holds, then there exists an infinite sequence $(a_k)_{k \in \mathbb{N}}$ such that for all $k \in \mathbb{N}$, $a_{k+1} \in \phi(a_k)$.","import Mathlib open Finset Real theorem dependent_choice {α : Type*} [Nonempty α] (φ : α → Set α) (hφ : ∀ x, φ x ≠ ∅) : ∃ (f : ℕ → α), ∀ k, f (k + 1) ∈ φ (f k) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-133294,"Let $SU(2)$ be the symmetry group of the two-sphere, and let $-H$ denote the scalar Laplacian on the two-sphere. The state Hilbert space is spanned by spherical representations of $SU(2)$ with integer spins $j \in \{0, 1, 2, \dots\}$. The grand canonical partition function $Z$ with inverse temperature $\beta > 0$ and chemical potential $\mu$ is given by: \[ Z(\beta, \mu) = \sum_{j=0}^{\infty} \frac{\sinh((2j+1)\mu)}{\sinh(\mu)} e^{-\beta j(j+1)} = \frac{e^{\frac{\beta}{4}}}{2\sinh(\mu)} \theta_1(\mu, \beta), \] where $\theta_1(\mu, \beta)$ is a series that encodes the contributions from the energy eigenstates and the symmetry group representations. Prove that $Z(\beta, \mu)$ satisfies this expression.","import Mathlib open Real Set open scoped BigOperators theorem grand_canonical_partition_function {β : ℝ} (hβ : β > 0) (μ : ℝ) (θ₁ : ℝ → ℝ → ℝ) : ∑' j : ℕ, sinh ((2 * j + 1) * μ) / sinh μ * exp (-β * j * (j + 1)) = exp (β / 4) / (2 * sinh μ) * θ₁ μ β := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-136055,"Let $p(n)$ denote the partition function, which counts the number of ways a positive integer $n$ can be expressed as a sum of positive integers, disregarding order. Prove that for all $n \\geq 1$, the following inequality holds: \\[ p(n) < \frac{\pi}{\sqrt{6n}} e^{\alpha \sqrt{n}},\\] where $\alpha = \pi\sqrt{\frac{2}{3}}$.","import Mathlib open Real theorem inequalities {p : ℕ → ℕ} (hp : ∀ n, p n = {s : Finset ℕ | s.sum id = n}.ncard) : ∀ n ≥ 1, p n < Real.pi / Real.sqrt (6 * n) * Real.exp (Real.pi * Real.sqrt (2 / 3) * Real.sqrt n) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-136097,"Let $P$ be the set of primes of the form $4t + 3$, where $t$ is an integer, and let $S$ be the set of integers having no prime factors from $P$. Prove that the asymptotic density of $S$ in the set of positive integers is zero. Formally, $$ ext{density}(S) = ext{lim}_{n o ext{∞}} rac{|S ext{ ∩ } ext{ extbf{[}1,n ext{]}}|}{n} = 0.$$","import Mathlib open Real Filter Function open scoped Topology theorem density_of_S (P : Set ℕ) (hP : P = {p | ∃ t, p.Prime ∧ p = 4 * t + 3}) (S : Set ℕ) (hS : S = {x | ¬∃ p ∈ P, p ∣ x}) : Tendsto (λ n => (Set.ncard {x ∈ S | x ≤ n}) / n) atTop (𝓝 0) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-136287,"Let $q_1, q_2, q_3 \\in \\\mathbb{Q}$, not all zero, and let $\\beta > 0$ with $\\beta \\\neq 1$. Prove that the equation $$ q_1 + q_2 x^\\beta + q_3 (1 + x^{\\beta^2})^{1/\\beta} = 0 $$ has at most countably many real solutions.","import Mathlib theorem countable_solutions (q1 q2 q3 : ℚ) (hq : ¬(q1 = 0 ∧ q2 = 0 ∧ q3 = 0)) (β : ℝ) (hβ : β > 0 ∧ β ≠ 1) : Set.Countable {x : ℝ | q1 + q2 * x ^ β + q3 * (1 + x ^ (β ^ 2)) ^ ((1 : ℝ) / β) = 0} := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-137344,Prove that the set of all integers \(k\) for which there exists infinitely many positive integers \(n\) not satisfying \(n + k\mid\binom{2n}{n}\) is the set of all integers \(k\) such that \(k\neq1\).,"import Mathlib theorem prove (k : ℤ) : {n : ℕ | 0 < n ∧ ¬(n + k) ∣ Nat.choose (2 * n) n}.Infinite ↔ k ≠ 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-137350,"Prove that the set of all positive real numbers \(t\) for which there exists an infinite set \(X\) of real numbers such that the inequality \(\max\{|x-(a - d)|,|y - a|,|z-(a + d)|\}>td\) holds for all (not necessarily distinct) \(x,y,z\in X\), all real numbers \(a\) and all positive real numbers \(d\) is the set \(\left\{t\in\mathbb{R}^+\mid t<\frac{1}{2}\right\}\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove : {t : ℝ | 0 < t ∧ ∃ X : Set ℝ, Infinite X ∧ ∀ x ∈ X, ∀ y ∈ X, ∀ z ∈ X, ∀ a : ℝ, ∀ d : ℝ, 0 < d → max (max (|x - (a - d)|) (|y - a|)) (|z - (a + d)|) > t * d} = {t : ℝ | 0 < t ∧ t < 1 / 2} := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-137435,"Prove that the remainder when \(\sum_{f \in \mathcal{F}}\left|T_{f}\right|\) is divided by the prime 2017 is 255, where \(S = \{1,2,\ldots,2021\}\), \(\mathcal{F}\) is the set of functions \(f: S \rightarrow S\), \(T_{f}=\left\{f^{2021}(s): s \in S\right\}\), and \(f^{2021}(s)\) denotes \(f(f(\cdots(f(s)) \cdots))\) with 2021 copies of \(f\).","import Mathlib theorem prove : (∑ f : Finset.Icc 1 2021 → Finset.Icc 1 2021, Set.ncard {x | ∃ s : Finset.Icc 1 2021, x = f^[2021] s}) % 2017 = 255 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-140525,"Let $\alpha: \mathbb{N} \to \mathbb{Q}$ be a bijection between the natural numbers $\mathbb{N}$ and the rational numbers $\mathbb{Q}$. For each $x \in \mathbb{R}$, define a sequence $a(x) = \{a(x)_i\}_{i \in \mathbb{N}}$ such that $$a(x)_i = \begin{cases} 0 & \text{if } \alpha(i) < x, \\ 1 & \text{if } \alpha(i) \geq x. \end{cases}$$ Prove that the set of sequences $\{a(x) : x \in \mathbb{R}\}$ is linearly independent.","import Mathlib open Finset Real theorem linearIndependent (α : ℕ → ℚ) (hα : Function.Bijective α) (a : ℝ → ℕ → ℤ) (ha : ∀ x, ∀ i, a x i = if α i < x then 0 else 1) : ∀ c : ℕ → ℝ, (∀ x, ∑' i : ℕ, c i * a x i = 0) ↔ ∀ i, c i = 0 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-141379,"Let $S \\subseteq \\mathbb{R}$ be a set such that for every $t \\in \\mathbb{R}$, there exists a sequence $(t_n)_{n \\in \\mathbb{N}}$ with $t_n \\to t$ and $S + t_n \\subseteq S$ for all $n$. Suppose $S$ has positive Lebesgue measure, i.e., $\\lambda(S) > 0$. Prove that $\\lambda(S \\cap [0,1]) = 1$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove_lebesgue_measure (S : Set ℝ) (hS : ∀ t : ℝ, ∃ (f : ℕ → ℝ), Tendsto f atTop (𝓝 t) ∧ ∀ n : ℕ, S ⊆ {x | x + (f n) ∈ S}) (hS' : MeasureTheory.volume S > 0) : MeasureTheory.volume (S ∩ Set.Icc 0 1) = 1 := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-142917,"Let $A = \{A_1, A_2, \ldots, A_m\}$ be a family of subsets of $\{1, 2, \ldots, n\}$ that satisfies the following conditions: 1. $|A_i| \leq \frac{n}{2}$ for all $i = 1, 2, \ldots, m$. 2. $A_i \cap A_j \neq \emptyset$ for all $1 \leq i, j \leq m$. 3. $A_i$ is not a subset of $A_j$ for all $1 \leq i, j \leq m$. Prove that: \[ \sum_{i=1}^m \frac{1}{{n-1 \choose |A_i| - 1}} \leq 1. \]","import Mathlib open Finset Real Nat theorem sumOfReciprocal {n : ℕ} (hn : 0 < n) (m : ℕ) (A : Fin m → Set ℕ) (hA : ∀ i, A i ⊆ Icc 1 n) (hA1 : ∀ i, (A i).ncard ≤ n / 2) (hA2 : ∀ i j, A i ∩ A j ≠ ∅) (hA3 : ∀ i j, ¬(A i ⊆ A j)) : ∑ i, 1 / (n - 1).choose ((A i).ncard - 1) ≤ 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-143374,"Prove that for any set of complex numbers $z_1, z_2, \ldots, z_n$, there exists a subset $J$ of the set $\{1, 2, \ldots, n\}$ such that \(\left| \sum_{k \in J} z_k \right| \geq \frac{1}{4 \sqrt{2}} \sum_{k=1}^{n} |z_k|\).","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem normed_sum_of_subset (n : ℕ) (z : ℕ → ℂ) (h : 0 < n) : ∃ j : Finset (Icc 1 n), ‖∑ k ∈ j, z k‖ ≥ (1 / (4 * Real.sqrt 2)) * (∑ k ∈ Icc 1 n, ‖z k‖) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-145736,Prove that the generating function $\sum_{k = 0}^{\infty}\binom{3k}{k}x^{k}$ is equal to $\frac{2\cos\left(\frac{1}{6}\arccos\left(1-\frac{27x}{2}\right)\right)}{\sqrt{4 - 27x}}$.,"import Mathlib open Real Set open scoped BigOperators theorem prove (f : ℝ → ℝ) (h₀ : ∀ x, f x = ∑' k : ℕ, Nat.choose (3 * k) k * x ^ k) : ∀ x, f x = (2 * cos ((arccos (1 - 27 * x / 2)) / 6)) / sqrt (4 - 27 * x) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-148071,"Let $x_1, x_2, \ldots, x_n$ be non - negative real numbers such that $\sum_{i = 1}^n x_i = 1$. Prove that there exist integers $a_1, a_2, \ldots, a_n$ chosen from the set $\{0, 1, 2, 3, 4\}$, where the sequence $(a_1, a_2, \ldots, a_n)$ is not identical to $(2, 2, \ldots, 2)$, such that the following inequality holds: \[ 2 \leq \sum_{i=1}^n a_i x_i \leq 2 + \frac{2}{3^n - 1}. \]","import Mathlib open Real theorem inequalities (n : ℕ) (hn : 0 < n) (x : Fin n → ℝ) (hx : ∀ i, 0 ≤ x i) (hxs : ∑ i, x i = 1) : ∃ a : Fin n → ℕ, (∀ i, a i ∈ Finset.Icc 0 4) ∧ (∃ i, a i ≠ 2) ∧ 2 ≤ ∑ i, a i * x i ∧ ∑ i, a i * x i ≤ 2 + 2 / (3 ^ n - 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-148304,"Prove that the cardinality of the set of automorphisms of the complex field \( \mathbb{C} \) is \( 2^c \), where \( c \) is the cardinality of the continuum.","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem card_automorphisms : Set.ncard (Set.univ : Set (ℂ ≃* ℂ)) = 2 ^ c := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-150995,"1. **Part (a):** - Prove that there does not exist an infinite subset \(S\) of the natural numbers \(\mathbb{N}\), such that \(S\neq\mathbb{N}\), and for each natural number \(n\not\in S\), exactly \(n\) members of \(S\) are coprime with \(n\). 2. **Part (b):** - Prove that there does not exist an infinite subset \(S\) of the natural numbers \(\mathbb{N}\), such that for each natural number \(n\in S\), exactly \(n\) members of \(S\) are coprime with \(n\).","import Mathlib theorem a' : ¬∃ S : Set ℕ, Infinite S ∧ S ≠ ⊤ ∧ ∀ n : ℕ, n ∉ S → {x | x ∈ S ∧ Nat.Coprime x n}.encard = n := by sorry theorem b' : ¬∃ S : Set ℕ, Infinite S ∧ ∀ n : ℕ, n ∈ S → {x | x ∈ S ∧ Nat.Coprime x n}.encard = n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-160815,"Given $n$ points in a plane, prove that there are at least $\lfloor \sqrt{\frac{n}{2}} \rfloor$ distinct distances between any two of these points.","import Mathlib open Real Set open scoped BigOperators theorem dists (n : ℕ) (f : Fin n → EuclideanSpace ℝ (Fin 2)) : {d | ∃ i j, d = dist (f i) (f j)}.ncard ≥ ⌊Real.sqrt (n / 2)⌋ := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-161790,"Let $p$ be a prime number and $d \in \{0, 1, \ldots, p\}$. Prove that \[ \sum_{k=0}^{p-1} \binom{2k}{k+d} \equiv r \pmod{p}, \] where $r \equiv p - d \pmod{3}$ and $r \in \{-1, 0, 1\}$.","import Mathlib open Finset theorem Nat.choose_sum (p : ℕ) (hp : Nat.Prime p) (d : ℕ) (hd : d ∈ Icc 0 p) : (∑ k ∈ range p, Nat.choose (2 * k) (k + d)) ≡ if p - d ≡ 0 [ZMOD 3] then 0 else (if p - d ≡ 1 [ZMOD 3] then 1 else -1) [ZMOD p] := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-161795,"For a set $S$ in $\mathbb{R}^3$ where the mutual distance between any pair of points in $S$ is rational, prove or disprove that $S$ is countable.","import Mathlib theorem TopologyFilters.RatDists (S : Set (EuclideanSpace ℝ (Fin 3))) (h : ∀ P ∈ S, ∀ Q ∈ S, P ≠ Q → ∃ q : ℚ, dist P Q = q) : Countable S := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-162376,Prove that the equation ${n \choose k} = m^l$ has no integral solutions for $l \ge 2$ and $4 \le k \le n-4$.,"import Mathlib theorem Nat.choose_eq_m_p : ¬∃ (n k m l : ℕ), l ≥ 2 ∧ 4 ≤ k ∧ k ≤ n - 4 ∧ Nat.choose n k = m ^ l := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-168143,"For $\varepsilon > 0$ and $k > 0$, let $A(k, \varepsilon)$ denote the set of $x \in \mathbb{R}$ such that $\left|x - \frac{p}{q}\right| \geq \frac{1}{k|q|^{2+\varepsilon}}$ for all integers $p$ and $q$ with $q \neq 0$. Prove that the Lebesgue measure of $\mathbb{R} \setminus \bigcup_{k=1}^\infty A(k, \varepsilon)$ is zero.","import Mathlib open Real Set open scoped BigOperators theorem proveMeasure (ε : ℝ) (hε : ε > 0) : (MeasureTheory.volume {x : ℝ | ¬∃ k : ℕ, 0 < k ∧ ∀ p q : ℤ, q ≠ 0 → |x - p / q| ≥ 1 / (k * abs q ^ (2 + ε))}).toReal = 0 := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-169708,"For each subset $C$ of $\mathbb{N}$, define $C \oplus C = \{x + y \mid x, y \in C, x \neq y\}$. Prove that there exists a unique partition of $\mathbb{N}$ into sets $A$ and $B$ such that neither $A \oplus A$ nor $B \oplus B$ contains any prime numbers.","import Mathlib def f (C : Set ℕ) := {x | ∃ m ∈ C, ∃ n ∈ C, x = m + n ∧ m ≠ n} theorem exist! : ∃! A : Set ℕ, ∃! B : Set ℕ, (A ∪ B = ℕ) ∧ (A ∩ B = ∅) ∧ ∀ x ∈ f A, ¬Nat.Prime x ∧ ∀ x ∈ f B, ¬Nat.Prime x := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-169964,"Let $S = \{0, 1, 2, \ldots, n-1\}$. For every $0 \le j < n$, denote by $f_n(j)$ the number of subsets $D$ of $S$ such that the sum of the elements of $D$ is congruent to $j$ modulo $n$, i.e., $f_n(j) = \#\left\{D \subset S \mid \sum_{x \in D} x \equiv j \pmod{n}\right\}$. Prove or disprove that $f_n(j) \le f_n(0)$ for all $n \ge 1$ and all $0 \le j < n$.","import Mathlib open Finset theorem f (n : ℕ) (hn : 1 ≤ n) (j : ℕ) (hj : j < n) : {D : Finset ℕ | D ⊆ Icc 0 (n - 1) ∧ ∑ x ∈ D, x ≡ j [MOD n]}.ncard ≤ {D : Finset ℕ | D ⊆ Icc 0 (n - 1) ∧ ∑ x ∈ D, x ≡ 0 [MOD n]}.ncard := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-173891,"Let $f: \mathbb{R} \to \mathbb{R}$ be a function satisfying the following condition: If $\sum a_n$ is a convergent series, then $\sum f(a_n)$ is also convergent. Prove that there exists a $k \in \mathbb{R}$ and a neighborhood of zero such that for all $x$ in this neighborhood, $f(x) = kx$.","import Mathlib theorem Topology.filter (f : ℝ → ℝ) (h : ∀ a : ℕ → ℝ, (∃ L, ∑' n : ℕ, a n = L) → ∃ L, ∑' n : ℕ, f (a n) = L) : ∃ (k : ℝ), ∃ (U : Set ℝ), IsOpen U ∧ 0 ∈ U ∧ ∀ x ∈ U, f x = k * x := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-174499,Let $p > 5$ be a prime number. Prove that $(-1)^{(p-1)/2} \binom{p-1}{(p-1)/2} \equiv 4^{p-1} \pmod{p^3}$.,"import Mathlib theorem Nat.choose_p (p : ℕ) (hp : Nat.Prime p) (h : 5 < p) : (-1 : ℤ) ^ ((p - 1) / 2) * Nat.choose (p - 1) ((p - 1) / 2) ≡ 4 ^ (p - 1) [ZMOD p ^ 3] := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-177812,"Let $p \geq 3$ be a prime number and $k$ an even integer such that $1 < k < p-1$. Prove that: \[ p^{k+1} \mid \sum_{i=1}^{p-1} \binom{p}{i}^k \]","import Mathlib theorem qwen (p k : ℕ) [inst : Fact (Nat.Prime p)] (h₀ : 3 ≤ p) (h₁ : Even k) (h₂ : 1 < k ∧ k < p - 1) : p^(k + 1) ∣ ∑ i ∈ Finset.Icc 1 (p - 1), (Nat.choose p i)^k := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-177831,Show that the equation $\binom{n}{k} = m^l$ has no solutions in natural numbers where $k \geq 4$ and $k \leq n-4$.,"import Mathlib theorem Nat.choose_eq_power (n k m l : ℕ) : k ≥ 4 ∧ k ≤ n - 4 → ¬(Nat.choose n k = m ^ l) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-181054,"Let $f(n,2)$ denote the maximum positive integer $f$ such that there exists an $f$-element set $A \subset \mathbb{R}^n$ where the points in $A$ determine at most two distinct distances. Prove that \[ \frac{n(n+1)}{2} \leq f(n,2) \leq \frac{(n+1)(n+2)}{2}. \]","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem f (n : ℕ) : n * (n + 1) / 2 ≤ sSup {f | ∃ A : Set (EuclideanSpace ℝ (Fin n)), A.ncard = f ∧ Set.ncard {d | ∃ x ∈ A, ∃ y ∈ A, d = dist x y} ≤ 2} ∧ sSup {f | ∃ A : Set (EuclideanSpace ℝ (Fin n)), A.ncard = f ∧ Set.ncard {d | ∃ x ∈ A, ∃ y ∈ A, d = dist x y} ≤ 2} ≤ ((n + 1) * (n + 2)) / 2 := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-183873,"Prove that there exists an infinite family of subsets $\{M_{\alpha} \mid \alpha \in \mathcal{A}\}$ of the set of integers $\mathbb{Z}$ such that for every finite subset $\mathcal{B} \subset \mathcal{A}$, the union $\bigcup_{\alpha \in \mathcal{B}} M_{\alpha} \neq \mathbb{Z}$, but for every infinite subset $\mathcal{B} \subset \mathcal{A}$, the union $\bigcup_{\alpha \in \mathcal{B}} M_{\alpha} = \mathbb{Z}$.","import Mathlib theorem exists_infinite_family_of_subsets : ∃ (α : Type*) (_ : Infinite α) (M : α → Set ℤ), (∀ B : Finset α, ⋃ i ∈ B, M i ≠ ⊤) ∧ (∀ B : Set α, Infinite B → ⋃ i ∈ B, M i = ⊤) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-186599,"Prove that $\lim\limits_{M \to \infty} p_M = \frac{32}{55}$, where a positive integer $N$ is defined as \emph{piquant} if there exists a positive integer $m$ such that, if $n_i$ represents the number of digits in $m^i$ (in base $10$), then $n_1 + n_2 + \cdots + n_{10} = N$, and $p_M$ denotes the fraction of the first $M$ positive integers that are piquant.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (p : ℕ → ℝ) (h₀ : ∀ M, p M = {x | x ≤ M ∧ ∃ m : ℕ, 0 < m ∧ ∑ i ∈ range 10, (Nat.digits 10 (m ^ (i + 1))).length = x}.ncard / M) : Tendsto p atTop (𝓝 (32 / 55)) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-188160,"Prove that there exist constants $c$ and $\alpha > \frac{1}{2}$ such that for any positive integer $n$, there is a subset $A$ of $\{1,2,\ldots,n\}$ with cardinality $|A| \ge c \cdot n^\alpha$, and for any $x,y \in A$ with $x \neq y$, the difference $x-y$ is not a perfect square. Since the user's problem is already a formal math proof problem, we return it as-is.","import Mathlib theorem algebra_485963 : ∃ c : ℝ, ∃ α : ℝ, α > 1 / 2 ∧ ∀ n : ℕ, 0 < n → ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 n ∧ A.card ≥ c * n ^ α ∧ ∀ x ∈ A, ∀ y ∈ A, x ≠ y → ¬ ∃ m : ℕ, m^2 = x - y := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-188168,"Prove that there exist constants $c = 0.00001$ and $\alpha = \log_{25}(10) > \frac{1}{2}$ such that for any positive integer $n$, there is a subset $A$ of $\{1,2,\ldots,n\}$ with cardinality $|A| \ge c \cdot n^\alpha$, and for any $x,y \in A$ with $x \neq y$, the difference $x - y$ is not a perfect square.","import Mathlib open Real Set open scoped BigOperators theorem prove : ∃ c : ℝ, c = 0.00001 ∧ ∃ α : ℝ, α = logb 25 10 ∧ α > 1 / 2 ∧ ∀ n : ℕ, 0 < n → ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 n ∧ A.card ≥ c * n ^ α ∧ ∀ x ∈ A, ∀ y ∈ A, x ≠ y → ¬ ∃ m : ℕ, m^2 = x - y := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-188170,"Prove that there exist constants $c = \frac{1}{\sqrt{13}}$ and $\alpha = \frac{1 + \log_{13} 3}{2}$ such that for any positive integer $n$, there is a subset $A$ of $\{1,2,\ldots,n\}$ with cardinality $|A| \ge c \cdot n^\alpha$, and for any $x,y \in A$ with $x \neq y$, the difference $x-y$ is not a perfect square.","import Mathlib open Real theorem prove : ∃ c α : ℝ, c = 1 / sqrt 13 ∧ α = (1 + logb 13 3) / 2 ∧ ∀ n > 0, ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 n ∧ A.card ≥ c * n ^ α ∧ ∀ x ∈ A, ∀ y ∈ A, x ≠ y → ¬ ∃ m : ℕ, m^2 = x - y := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-189437,"Prove that if \(p\) is a prime number greater than \(3\), then \((-1)^{\frac{p - 1}{2}}\binom{p - 1}{\frac{p - 1}{2}} \equiv 4^{p - 1} \pmod{p^3}\).","import Mathlib theorem Nat.choose_p (p : ℕ) [hp : Fact (Nat.Prime p)] (h : 3 < p) : (-1) ^ ((p - 1) / 2) * Nat.choose (p - 1) ((p - 1) / 2) ≡ 4^(p - 1) [ZMOD p^3] := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-196696,"Prove that for a given integer \(k \geq 2\), the smallest positive integer \(n\) such that among any \(n\) points in the plane, there exist \(k\) points for which all pairwise distances are either all less than or equal to \(2\), or all strictly greater than \(1\), is \(n = k^2 - 2k + 2\).","import Mathlib open Real open scoped BigOperators theorem prove (k : ℕ) (hk : 2 ≤ k) : IsLeast {n | 0 < n ∧ ∀ s : Finset (EuclideanSpace ℝ (Fin 2)), s.card = n → ∃ t ⊆ s, t.card = k ∧ (∀ x ∈ t, ∀ y ∈ t, x ≠ y → dist x y ≤ 2) ∨ (∀ x ∈ t, ∀ y ∈ t, x ≠ y → dist x y > 1)} (k^2 - 2 * k + 2) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-197894,"Prove that the largest integer $k'$ such that it is possible to partition the set $\{1,2,\cdots,p - 1\}$ into two subsets $X$ and $Y$ with the property that for any integer $k$ where $0 \le k \le k'$, $$\sum_{a \in X}a^k \equiv \sum_{b \in Y}b^k \pmod p$$ is $k'=\frac{p - 3}{2}$, where $p$ is an odd prime.","import Mathlib theorem prove_k' (p : ℕ) (hp : Odd p ∧ Nat.Prime p) : IsGreatest {k | ∃ X Y : Finset ℕ, X ∪ Y = Finset.Icc 1 (p - 1) ∧ X ∩ Y = ∅ ∧ (∀ k ∈ Finset.Icc 0 k', ∑ a ∈ X, a ^ k ≡ ∑ b ∈ Y, b ^ k [MOD p])} ((p - 3) / 2) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-197912,"Prove that the natural numbers $n$ for which $n$ divides $\binom{2n}{n} - 2$ are of the form $n = p^k$, where $p > 3$ is a prime and $k \in \{1, 2, 3\}$.","import Mathlib theorem Nat.divisorsOfNat (n : ℕ) : n ∣ Nat.choose (2 * n) n - 2 ↔ ∃ p k, Nat.Prime p ∧ p > 3 ∧ n = p ^ k ∧ k ∈ Finset.Icc 1 3 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-198360,"Let \( \{f_n\}_{n \in \mathbb{N}} \) be a sequence of functions defined on a compact metric space \( K \) such that: 1. \( \{f_n\} \) is uniformly bounded, i.e., \( \sup_{n \in \mathbb{N}} \sup_{x \in K} |f_n(x)| < \infty \). 2. \( \{f_n\} \) is equicontinuous, i.e., for every \( \epsilon > 0 \), there exists \( \delta > 0 \) such that for all \( x, y \in K \) with \( d(x, y) < \delta \), we have \( |f_n(x) - f_n(y)| < \epsilon \) for all \( n \in \mathbb{N} \). Prove that the closure of \( \{f_n\} \) in the space of continuous functions \( C(K) \) (with the topology of uniform convergence) is compact.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem closure_of_f (K : Type*) [MetricSpace K] [CompactSpace K] {f : ℕ → (K → ℝ)} (hf : ∀ n, Continuous (f n)) (hfb : ∃ B, ∀ n, ∀ x, |f n x| ≤ B) (heq : ∀ ε > 0, ∃ δ > 0, ∀ x y, dist x y < δ → ∀ n, |f n x - f n y| < ε) : IsCompact (closure {f n | n}) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-199181,"Let $a(n)$ denote the number of seating arrangements of $n$ people around a circular table such that no person is seated in their initial position or adjacent to their initial position. For $n \\geq 7$, prove that $a(n)$ satisfies the following recurrence relation: $$ a(n) = (-1)^n[4n + F(n)] + \\frac{n}{(n-1)}\\cdot[(n+1)a(n-1) + 2(-1)^nF(n-1)] $$ $$ - \\frac{2n}{(n-2)}\\cdot[(n-3)a(n-2) + (-1)^nF(n-2)] + \\frac{n}{(n-3)}[(n-5)a(n-3) + 2(-1)^{n-1}F(n-3)] $$ $$ + \\frac{n}{(n-4)}[a(n-4) + (-1)^{n-1}F(n-4)], $$ where $F(n)$ is the $n$-th Fibonacci number. For small values of $n$, the values of $a(n)$ can be computed directly, with $a(4) = 1$ and $a(n) = 0$ for $n \\leq 3$.","import Mathlib open Finset Real Nat theorem algebra_467222 {a : ℕ → ℤ} (ha1 : a 4 = 1) (ha2 : ∀ n ≤ 3, a n = 0) (h : ∀ n ≥ 7, a n = (-1) ^ n * (4 * n + fib n) + ((n + 1) * a (n - 1) + 2 * (-1) ^ n * fib (n - 1)) - 2 * n / (n - 2) * ((n - 3) * a (n - 2) + (-1) ^ n * fib (n - 2)) + n / (n - 3) * ((n - 5) * a (n - 3) + 2 * (-1) ^ (n - 1) * fib (n - 3)) + n / (n - 4) * (a (n - 4) + (-1) ^ (n - 1) * fib (n - 4))) : True := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-199519,"Let $q = e^{2 ext{π}iz}$, where $z$ is a complex number with $ ext{Im}(z) > 0$. Define the Dedekind eta function as $$ extstyleegin{aligned} ext{ extbackslash}eta(z) = q^{1/24} ext{ extbackslash}prod_{n=1}^{ ext{ extbackslash}infty} (1 - q^n). ext{ extbackslash}end{aligned}$$ Prove that $$ extstyleegin{aligned} ext{ extbackslash}prod_{n=1}^{ ext{ extbackslash}infty} ext{ extbackslash}frac{(1 - q^n)^{16}(1 - q^{4n})^8}{(1 - q^{2n})^{24}} = 1. ext{ extbackslash}end{aligned}$$","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem dedekind_eta {z : ℂ} (hz : z.im > 0) : ∏' n : ℕ, ((1 - exp (2 * π * I * z) ^ n) ^ 16 * (1 - exp (2 * π * I * z) ^ (4 * n)) ^ 8 / (1 - exp (2 * π * I * z) ^ (2 * n)) ^ 24) = 1 := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-199947,"Let \( \{(x_k, a_k)\}_{k \in \mathbb{N}} \) be a sequence of points in \( \mathbb{C} \) with distinct \( x_k \in \mathbb{C} \). Prove that there exists an entire function \( f(z) \), holomorphic on the entire complex plane, such that \( f(x_k) = a_k \) for all \( k \in \mathbb{N} \).","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem ComplexSeq (x : ℕ → ℂ) (a : ℕ → ℂ) (hx : ∀ i j, i ≠ j → x i ≠ x j) : ∃ f : ℂ → ℂ, Differentiable ℂ f ∧ ∀ k, f (x k) = a k := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-200382,"Let $A$ and $B$ be objects in a category. Define $\textsf{Indis}(A, B)$ as the indistinguishability operator such that $\textsf{Indis}(A, B)$ holds if $A$ and $B$ are indistinguishable. Prove that $\textsf{Indis}(A, B)$ is logically equivalent to weak univalence, which states: $$\textsf{Indis}(A, B) \text{ if and only if } A = B.$$","import Mathlib open Fintype Set Real Ideal Polynomial open scoped BigOperators theorem indistinguishable {α : Type*} (A B : α) : (¬(∃ f : α → α, f A ≠ f B)) ↔ A = B := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-200882,"Let $E(x)$ and $1/\sqrt{x}$ be functions defined on $[0,1]$, and let their Fourier-Legendre series expansions be given by: \[ E(x) \stackrel{L^2(0,1)}{=} \sum_{n \geq 0} \frac{4}{(1-2n)(2n+1)(2n+3)}P_n(2x-1), \] \[ \frac{1}{\sqrt{x}} \stackrel{L^2(0,1)}{=} \sum_{n \geq 0} 2(-1)^n P_n(2x-1), \] where $P_n(\cdot)$ denotes the Legendre polynomial of degree $n$. Prove that the following summation identity holds: \[ \sum_{n=0}^{\infty}\frac{{2n \choose n}^2}{2^{4n+1}} \frac{(2n+1)(4n+3)}{(2n-1)^2(2n+3)} = \frac{4}{3}. \]","import Mathlib open Real Set open scoped BigOperators theorem sum_identity : ∑' n : ℕ, Nat.choose (2 * n) n ^ 2 / 2^(4 * n + 1) * (2 * n + 1) * (4 * n + 3) / ((2 * n - 1)^2 * (2 * n + 3)) = 4 / 3 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-201421,"Let $S_n = 2 \sum_{k=n}^\infty \left(\frac{n-1}{n}\right)^{k-1} \binom{k+1}{2}$ for $n \in \mathbb{N}$. Prove that for large $n$, the series $S_n$ admits the asymptotic expansion: \[ S_n \sim \frac{1}{e}\left(5 n^3 - \frac{n^2}{2} - \frac{n}{24} + \frac{1}{16} + \frac{95}{1152 n} + \frac{917}{11520 n^2} + O\left(\frac{1}{n^3}\right)\right), \] where $e$ is the base of the natural logarithm.","import Mathlib open Real theorem asymptotics {S : ℕ → ℝ} (hS : ∀ n, S n = 2 * ∑' k : ℕ, if k ≥ n then ((n - 1) / n : ℝ) ^ (k - 1) * Nat.choose (k + 1) 2 else 0) : ∀ ε > 0, ∃ N, ∀ n, N ≤ n → |S n - exp (-1) * (5 * n ^ 3 - n ^ 2 / 2 - n / 24 + 1 / 16 + 95 / (1152 * n) + 917 / (11520 * n ^ 2))| < ε := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-201594,"Let $\vartheta_{a,b}(z, \tau)$ be a theta function defined as $\vartheta_{a,b}(z, \tau) = \sum_{n \in \mathbb{Z}} e^{i\pi \tau (n+a)^2 + 2\pi i (n+a)(z+b)}$, where $a, b, z \in \mathbb{C}$ and $\tau$ is a complex number with $\text{Im}(\tau) > 0$. Prove that the zeros of $\vartheta_{a,b}(z, \tau)$ are given by: \[ z = (k - \tfrac{1}{2} - a)\tau + \tfrac{1}{2} - b - n, \] where $k, n \in \mathbb{Z}$.","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem theta (θ : ℂ → ℂ → ℂ → ℂ → ℂ) (hθ : θ = λ a b z τ => ∑' n : ℤ, exp (I * π * τ * (n + a)^2 + 2 * π * I * (n + a) * (z + b))) (a b z τ : ℂ) (hτ : τ.im > 0) : θ a b z τ = 0 ↔ ∃ k n : ℤ, z = (k - 1 / 2 - a) * τ + 1 / 2 - b - n := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-202755,"Let $H_n = \sum_{j=1}^n \frac{1}{j}$ denote the $n$th harmonic number, and let $C(z)$ be the generating function of the Catalan numbers. Then, for $n \geq 1$, prove that the following identity holds: $$ \sum_{m=1}^n \binom{2m}{m}(H_{2m} - 2H_m) \cdot \binom{2(n-m)}{n-m}\frac{1}{2(n-m)-1} = \frac{1}{n}\left[4^n - 3\binom{2n-1}{n}\right]. $$","import Mathlib open Finset Real Nat theorem identity {H : ℕ → ℝ} (hH : ∀ n, H n = ∑ j ∈ Icc 1 n, 1 / j) : ∀ n ≥ 1, ∑ m ∈ Icc 1 n, Nat.choose (2 * m) m * (H (2 * m) - 2 * H m) * Nat.choose (2 * (n - m)) (n - m) * 1 / (2 * (n - m) - 1) = (4 ^ n - 3 * Nat.choose (2 * n - 1) n) / n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-203173,"Let $(X, d)$ be a metric space, and let $T: X o X$ be a mapping. Suppose there exists a function $f: X imes X o [0,1)$ satisfying the following conditions: 1. $f(x, y) \\geq 0$ for all $x, y \\in X$, 2. $f(x, y) < 1$ for all $x \\neq y$, and 3. $f(x, y)$ is continuous in both arguments. Additionally, assume that there exists an integer $n \\geq 1$ such that for all $x, y, z \\in X$, the inequality \[d(Tx, Ty) \\leq f(x, y) \big[d(x, T^n z) + d(y, T^n z)\big]\] holds. Prove that $T$ has a unique fixed point in $X$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MetricMap (X : Type*) [MetricSpace X] (T : X → X) (f : X → X → ℝ) (hf : ∀ x y, f x y ∈ Set.Ico 0 1) (h1 : ∀ x y, x ≠ y → f x y < 1) (h2 : Continuous f) (h3 : ∃ n ≥ 1, ∀ x y z, dist (T x) (T y) ≤ f x y * (dist x (T^[n] z) + dist y (T^[n] z))) : ∃! x, T x = x := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-203308,"Let $t_n$ denote the Thue–Morse sequence defined by the recurrence relations $t_0 = 0$, $t_{2n} = t_n$, and $t_{2n+1} = 1 - t_n$. Prove that $t_n$ can be expressed as: $$t_n \\equiv \\#\{k \\mid 1 \\le k \\le n \\\ \text{and}\\\ \binom{n}{k}\\\ \text{is odd}\} \\pmod{3}.$$","import Mathlib open Finset theorem thue_morse {t : ℕ → ℕ} (ht0 : t 0 = 0) (h2n : ∀ n, t (2 * n) = t n) (h2n1 : ∀ n, t (2 * n + 1) = 1 - t n) : ∀ n, t n ≡ {k | 1 ≤ k ∧ k ≤ n ∧ Odd (Nat.choose n k)}.ncard [MOD 3] := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-204351,Let \( \mathbb{R} \) be the set of all Dedekind cuts of the rational numbers in constructive mathematics. Prove that \( \mathbb{R} \setminus \{x \in \mathbb{R} : x < 0 \lor x \geq 0\} = \emptyset. \),"import Mathlib open Real theorem R : {x : ℝ | ¬(x < 0 ∨ x ≥ 0)} = ∅ := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-204711,"Let $f: \mathbb{Z}^+ \to \mathbb{Z}^+$ be an injective function such that for any finite set $S \subseteq \mathbb{Z}^+$, if $\sum_{s \in S} \frac{1}{s}$ is an integer, then $\sum_{s \in S} \frac{1}{f(s)}$ is also an integer. Prove that $f(n) = n$ for all $n \in \mathbb{Z}^+$.","import Mathlib theorem qwen {f : ℕ+ → ℕ+} (hf : Function.Injective f) (h : ∀ S : Finset ℕ+, (∃ k : ℤ, ∑ s ∈ S, (1 / s : ℝ) = k) → ∃ m : ℤ, ∑ s ∈ S, (1 / f s : ℝ) = m) : ∀ n : ℕ+, f n = n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-205187,"Let $m$ be an integer greater than 1 and coprime with 10. Prove that there exists a positive integer $N$ such that among $m, m^2, \dots, m^N$, at least $0.99N$ numbers contain all the digits $0, 1, \dots, 9$ in their decimal representations.","import Mathlib theorem qwen (m : ℕ) (hm : 1 < m) (hcoprime : Nat.Coprime m 10) : ∃ N : ℕ, 0 < N ∧ {k | k ∈ Finset.Icc 1 N ∧ ∀ i ∈ Finset.range 10, (Nat.digits 10 (m ^ k)).contains i}.ncard ≥ 99 * N / 100 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205258,"Let $n$ be a positive integer, and let $S = \{1, 2, \cdots, n\}$. Prove that there exists a positive real number $C$ such that for any subset $A \subseteq S$, if $|A| \geq \frac{Cn}{\ln n}$, then there exist elements $a < b \leq c < d$ in $A$ satisfying $ad = bc$.","import Mathlib open Real Set open scoped BigOperators theorem prove (n : ℕ) (hn : 0 < n) : ∃ C : ℝ, 0 < C ∧ ∀ A ⊆ Finset.Icc 1 n, A.card ≥ C * n / log n → ∃ a ∈ A, ∃ b ∈ A, ∃ c ∈ A, ∃ d ∈ A, a < b ∧ b ≤ c ∧ c < d ∧ a * d = b * c := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205330,"For a natural number $n$, let $$C_n = \frac{1}{n+1} \binom{2n}{n} = \frac{(2n)!}{n! (n+1)!}$$ be the Catalan number. Prove that for any natural number $m$, the following holds: $$\sum_{\substack{i+j+k=m \\ i,j,k\in\mathbb{N}}} C_{i+j} C_{j+k} C_{k+i} = \frac{3}{2m+3} C_{2m+1}.$$","import Mathlib open Nat theorem cayley_mozart {C : ℕ → ℚ} (hC : ∀ n, C n = (Nat.choose (2 * n) n) / ((Nat.factorial n) * (Nat.factorial (n + 1)))) (m : ℕ) : ∑' i : ℕ, ∑' j : ℕ, ∑' k : ℕ, (if (i + j + k = m) then C (i + j) * C (j + k) * C (k + i) else 0) = 3 / (2 * m + 3) * C (2 * m + 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205368,"Let real numbers \( x_1, x_2, \cdots, x_n \) satisfy \( x_1^2 + x_2^2 + \cdots + x_n^2 = 1 \), and let \( k \geq 2 \) be an integer. Prove that there exist integers \( a_1, a_2, \cdots, a_n \), not all zero, such that each has an absolute value not exceeding \( k-1 \), and \[ \left|a_1x_1 + a_2x_2 + \cdots + a_nx_n\right| \leq \frac{(k-1)\sqrt{n}}{k^n - 1}. \] ``` ```latex 28th IMO (1987) Second Day","import Mathlib theorem Tn (n : ℕ) (hn : 0 < n) (x : Fin n → ℝ) (h : ∑ i : Fin n, (x i)^2 = 1) (k : ℕ) (hk : 2 ≤ k) : ∃ a : Fin n → ℤ, (∀ i : Fin n, |a i| ≤ k - 1) ∧ (∃ i : Fin n, a i ≠ 0) ∧ |∑ i : Fin n, a i * x i| ≤ ((k - 1) * Real.sqrt n) / (k^n - 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205377,"Let $p$ be an odd prime, and let $A(n)$ denote the number of subsets of $\{1, 2, \cdots, n\}$ whose sum of elements is a multiple of $p$. Prove that if $p^2 \nmid 2^{p-1} - 1$, then for any integer $k$, there exist infinitely many positive integers $m$ such that $A(m) \equiv k \pmod{p}$. (The sum of elements of the empty set is defined to be 0.)","import Mathlib open Finset theorem qwen {p : ℕ} (hp : Odd p ∧ Nat.Prime p) (A : ℕ → ℕ) (hA : ∀ n, A n = {s : Finset ℕ | s ⊆ Icc 1 n ∧ ∑ x ∈ s, x ≡ 0 [MOD p]}.ncard) (h : ¬p ^ 2 ∣ 2 ^ (p - 1) - 1) : ∀ k, {m | 0 < m ∧ A m ≡ k [MOD p]}.Infinite := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205445,"Let $n$ be a positive integer, and let $a_{ijk} \in \{-1, 1\}$ for $1 \leq i, j, k \leq n$. Prove that there exist $x_1, \cdots, x_n, y_1, \cdots, y_n, z_1, \cdots, z_n \in \{-1, 1\}$ such that \[ \left|\sum_{i=1}^{n} \sum_{j=1}^{n} \sum_{k=1}^{n} a_{ijk} x_i y_j z_k\right| > \frac{n^2}{3}. \]","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (a : Fin n → Fin n → Fin n → ℤ) (ha : ∀ i j k, a i j k = -1 ∨ a i j k = 1) : ∃ x y z : Fin n → ℤ, (∀ i, x i = -1 ∨ x i = 1) ∧ (∀ i, y i = -1 ∨ y i = 1) ∧ (∀ i, z i = -1 ∨ z i = 1) ∧ |∑ i, ∑ j, ∑ k, a i j k * x i * y j * z k| > n ^ 2 / 3 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205449,"For a finite real set \( X \), let \( n(X) \) denote the number of elements in the set \[ \{(x_1, x_2, x_3, x_4) \mid x_1 + x_2 = x_3 + x_4, x_i \in X (i = 1, 2, 3, 4)\}. \] Prove that for finite real sets \( A, B, C, D \), the number of elements in the set \[ M = \{(a, b, c, d) \mid a + b = c + d, a \in A, b \in B, c \in C, d \in D\} \] does not exceed \( \sqrt[4]{n(A)n(B)n(C)n(D)} \).","import Mathlib open Real Set open scoped BigOperators theorem fin : ∀ A B C D : Finset ℝ, {(a, b, c, d) : ℝ × ℝ × ℝ × ℝ | a ∈ A ∧ b ∈ B ∧ c ∈ C ∧ d ∈ D ∧ a + b = c + d}.ncard ≤ ((A.card * B.card * C.card * D.card) : ℝ) ^ ((1 : ℝ) / 4) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205461,"Let $X \subset \mathbb{R}$ be a set with positive (Lebesgue) measure. Show that we can find an arithmetic progression of 2022 terms in $X$, i.e., there exits $x_1, \cdots, x_{2022} \in X$ so that the $x_{i+1} - x_i$'s are all equal and positive, $i = 1, \cdots, 2021$. ","import Mathlib theorem MeasureTheory.volume (X : Set ℝ) (hX : 0 < (MeasureTheory.volume X).toReal) : ∃ a d : ℝ, a ∈ X ∧ d > 0 ∧ ∀ i ∈ Finset.range 2021, a + d * (i + 1) ∈ X := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205925,"Call a set of positive integers good if there is a partition of it into two sets $S$ and $T$, such that there do not exist three elements $a, b, c \in S$ such that $a^{b}=c$ and such that there do not exist three elements $a, b, c \in T$ such that $a^{b}=c$ ( $a$ and $b$ need not be distinct). Find the smallest positive integer $n$ such that the set $\{2,3,4, \ldots, n\}$ is not good. Prove that the answer is 65536.","import Mathlib def isGood (s : Finset ℕ) := ∃ t u : Finset ℕ, s = t ∪ u ∧ t ∩ u = ∅ ∧ ∀ a ∈ t, ∀ b ∈ t, ∀ c ∈ t, a ^ b ≠ c ∧ ∀ a ∈ u, ∀ b ∈ u, ∀ c ∈ u, a ^ b ≠ c theorem solution : IsLeast {n | ¬isGood (Finset.Icc 2 n)} 65536 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Omni-MATH (HMMT_11), flc-208780,"Let $a_1, a_2, \cdots, a_{2022}$ be distinct primes greater than 2022, and let $A_1, A_2, \cdots, A_{2022}$ be sets of numbers such that for each $1 \leq i \leq 2022$, $A_i \subseteq \{1, 2, \cdots, a_i - 1\}$. Prove that there exists a positive integer $m \leq (2|A_1| + 1)(2|A_2| + 1) \cdots (2|A_{2022}| + 1)$ such that for any $1 \leq i \leq 2022$ and any $a \in A_i$, $m \not\equiv a \pmod{a_i}$.","import Mathlib theorem Qwen {a : Fin 2022 → ℕ} (ha : ∀ i j, a i = a j → i = j) (ha1 : ∀ i, Nat.Prime (a i)) (ha2 : ∀ i, a i > 2022) (A : Fin 2022 → Set ℕ) (hA : ∀ i, A i ⊆ Finset.Icc 1 (a i - 1)) : ∃ m : ℕ, 0 < m ∧ m ≤ ∏ i, (2 * (A i).ncard + 1) ∧ ∀ i, ∀ a' ∈ A i, ¬(m ≡ a' [ZMOD a i]) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-212409,"For a prime number \( p \), a subset \( S \) of \( \mathbb{F}_p \) is called a ""sum-free multiplicative subgroup"" if: (1) There exists a non-zero residue \( \alpha \) modulo \( p \) such that \( S = \{1, \alpha, \alpha^2, \cdots\} \) (all taken modulo \( p \)); (2) There do not exist \( a, b, c \in S \) such that \( a + b \equiv c \ (\text{mod } p) \). Prove that for every positive integer \( N \), there exists a prime \( p \) and a sum-free multiplicative subgroup \( S \) of \( \mathbb{F}_p \) such that \( |S| \geq N \).","import Mathlib open Fintype Set Real Ideal Polynomial open scoped BigOperators theorem prove (N : ℕ) : ∃ p : ℕ, Nat.Prime p ∧ ∃ S : Finset (ZMod p), (∃ α : ZMod p, α ≠ 0 ∧ S = {x | ∃ k : ℕ, x = α ^ k}) ∧ (∀ a ∈ S, ∀ b ∈ S, ∀ c ∈ S, a + b ≠ c) ∧ S.card ≥ N := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-214808,"\section*{2024 China National Team Selection Test II} Day 2 Color each positive integer with one of the four colors $c_1, c_2, c_3, c_4$. (1) Prove that there exists a positive integer $n$ and $i, j \in \{1, 2, 3, 4\}$ such that among all the positive divisors of $n$, the number of divisors colored $c_i$ is at least 3 more than those colored $c_j$; (2) Prove that for any positive integer $A$, there exists a positive integer $n$ and $i, j \in \{1, 2, 3, 4\}$ such that among all the positive divisors of $n$, the number of divisors colored $c_i$ is at least $A$ more than those colored $c_j$.","import Mathlib theorem color_divisors (f : ℕ → Fin 4) : (∃ n > 0, ∃ i j : Fin 4, {x | x ∣ n ∧ f x = i}.ncard ≥ {x | x ∣ n ∧ f x = j}.ncard + 3) ∧ (∀ A > 0, ∃ n > 0, ∃ i j : Fin 4, {x | x ∣ n ∧ f x = i}.ncard ≥ {x | x ∣ n ∧ f x = j}.ncard + A) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-215172,"Let $k$ be a positive integer. For a positive integer $n$, if the number of terms among $C_n^0, C_n^1, \cdots, C_n^n$ that are divisible by $k$ is at least $0.99n$, then $n$ is called ""good"". Prove that there exists a positive integer $N$ such that the number of good numbers among $1, 2, \cdots, N$ is at least $0.99N$.","import Mathlib open Finset theorem proveGood (k : ℕ) (hk : 0 < k) : ∃ N : ℕ, 0 < N ∧ {n | n ∈ Icc 1 N ∧ {i | i ∈ Icc 0 n ∧ k ∣ Nat.choose n i}.ncard ≥ 99 * n / 100}.ncard ≥ 99 * N / 100 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-218803,"Prove that there exists a function $f: P(\mathbb{N}) \to \mathbb{N}$ such that for every subset $A$ of $\mathbb{N}$, the set $\{x \in \mathbb{N} \mid x \notin A \text{ and } f(A \cup \{x\}) \neq x\}$ is finite, i.e., $f$ is $A$-predicting.","import Mathlib open Set theorem exists_predictive_f : ∃ f : Set ℕ → ℕ, ∀ A : Set ℕ, {x | x ∉ A ∧ f (A ∪ {x}) ≠ x}.Finite := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-220437,"Prove that the exponential generating function $\sum_{n = 0}^{\infty} \frac{a_n}{n!} x^n$, where for $n \geq 0$, $a_n$ denotes the cardinality of the set $\{ f : X_n \to X_n \mid f \circ f = f \}$ and $X_n = \{ 1, 2, \cdots, n \}$, is $\exp(x e^x)$.","import Mathlib open Finset Real Nat theorem expGeneratingFunction (a : ℕ → ℕ) (ha : ∀ n, a n = {f : Fin n → Fin n | ∀ i, f (f i) = f i}.ncard) : ∀ x, ∑' n, a n / (Nat.factorial n) * x ^ n = Real.exp (x * Real.exp x) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-220445,"Prove that the set of all positive real numbers $r < 1$ for which there exists a set $\mathcal{S}$ such that 1. For any real number $t$, exactly one of $t$, $t + r$, and $t + 1$ belongs to $\mathcal{S}$. 2. For any real number $t$, exactly one of $t$, $t - r$, and $t - 1$ belongs to $\mathcal{S}$. is the set \(\{r \in \mathbb{R} \mid 0 < r < 1 \text{ and } (r \text{ is rational with } 3 \mid p + q \text{ in lowest terms } r = \frac{p}{q}) \text{ or } r \text{ is irrational}\}\).","import Mathlib open Set Real theorem prove : {r : ℝ | 0 < r ∧ r < 1 ∧ ∃ S : Set ℝ, (∀ t : ℝ, (t ∈ S ∨ t + r ∈ S ∨ t + 1 ∈ S) ∧ ¬(t ∈ S ∧ t + r ∈ S) ∧ ¬(t ∈ S ∧ t + 1 ∈ S)) ∧ (∀ t : ℝ, (t ∈ S ∨ t - r ∈ S ∨ t - 1 ∈ S) ∧ ¬(t ∈ S ∧ t - r ∈ S) ∧ ¬(t ∈ S ∧ t - 1 ∈ S))} = {r : ℝ | 0 < r ∧ r < 1 ∧ (∃ p q : ℤ, p.gcd q = 1 ∧ r = p / q ∧ 3 ∣ p + q) ∨ Irrational r} := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-220980,"Let $a_1 < a_2 < \ldots < a_t$ be $t$ given positive integers such that no three of them form an arithmetic progression. For $k = t, t+1, \ldots$, define $a_{k+1}$ to be the smallest positive integer greater than $a_k$ such that no three of $a_1, a_2, \ldots, a_{k+1}$ form an arithmetic progression. For any $x \in \mathbb{R}^+$, define $A(x)$ to be the number of terms in the sequence $\{a_i\}_{i \ge 1}$ that are at most $x$. Prove that there exist constants $c > 1$ and $K > 0$ such that $A(x) \ge c\sqrt{x}$ for all $x > K$.","import Mathlib open Real theorem A (a : ℕ → ℤ) (ha : StrictMono a) (hpos : ∀ n, 0 < a n) (hnor : ∀ m n p, m ≠ n ∧ m ≠ p ∧ n ≠ p → ¬(∃ d, a m + d = a n ∧ a n + d = a p)) : ∃ c K, 1 < c ∧ K > 0 ∧ ∀ x > K, {n | 1 ≤ n ∧ a n ≤ x}.ncard ≥ c * sqrt x := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-228720,"Prove that the set of all positive integers \(n \geq 2\) such that for all integers \(i, j\) where \(0 \leq i, j \leq n\), the sum \(i + j\) and the sum of binomial coefficients \(\binom{n}{i} + \binom{n}{j}\) have the same parity is given by \(n = 2^{s + 1}-2\), where \(s\) is the sum of the digits of \(n\) in base \(2\).","import Mathlib theorem prove (n : ℕ) (hn : 2 ≤ n) : (∀ i j, 0 ≤ i ∧ i ≤ n → 0 ≤ j ∧ j ≤ n → Even (i + j) ↔ Even (Nat.choose n i + Nat.choose n j)) ↔ ∃ s, n = 2^(s + 1) - 2 ∧ s = (Nat.digits 2 n).sum := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-230401,"1. Prove that there exists a Lebesgue - measurable set \(E\subset\mathbb{R}\) and a point \(x\in\mathbb{R}\) such that \(D_{E}(x)=\frac{1}{3}\), where \(D_{E}(x)=\lim_{h \to 0}\frac{1}{2h}m(E\cap[x - h,x + h])\). 2. Prove that there exists a Lebesgue - measurable set \(E\subset\mathbb{R}\) and a point \(x\in\mathbb{R}\) such that \(D_{E}(x)\) does not exist, where \(D_{E}(x)=\lim_{h \to 0}\frac{1}{2h}m(E\cap[x - h,x + h])\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem D : (∃ E : Set ℝ, ∃ x : ℝ, Tendsto (λ h => (MeasureTheory.volume (E ∩ Set.Icc (x - h) (x + h))).toReal / (2 * h)) (𝓝[≠] 0) (𝓝 (1 / 3))) ∧ (∃ E : Set ℝ, ∃ x : ℝ, ¬ ∃ L : ℝ, Tendsto (λ h => (MeasureTheory.volume (E ∩ Set.Icc (x - h) (x + h))).toReal / (2 * h)) (𝓝[≠] 0) (𝓝 L)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-231478,"Let $p$ be an odd prime number, and let $S_p$ be the set of positive integers $n$ such that $n! \equiv -1 \pmod{p}$. Let $N = |S_p|$. Prove that there exists a positive constant $C$ such that $\frac{N}{p^{2/3}} < C$.","import Mathlib theorem S : (Nat.Prime p) ∧ Odd p → ∃ C : ℝ, 0 < C ∧ {n : ℕ | n > 0 ∧ Nat.factorial n ≡ -1 [ZMOD p]}.ncard / (p ^ ((2 : ℝ) / 3)) < C := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-233142,"Prove that given \(n\) points in a plane, there are at least \(\lfloor \sqrt{\frac{n}{2}} \rfloor\) distinct distances between any two of these points.","import Mathlib open Real Set open scoped BigOperators theorem dist (n : ℕ) (f : Fin n → (EuclideanSpace ℝ (Fin 2))) : {d | ∃ i j, d = dist (f i) (f j)}.ncard ≥ ⌊Real.sqrt (n / 2)⌋ := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-235458,"Let $A$ be a closed subset of $\mathbb{R}^{n}$, and let $B$ be the set of all points $b \in \mathbb{R}^{n}$ for which there exists exactly one point $a_0 \in A$ such that $|a_0 - b| = \inf_{a \in A} |a - b|$. Prove that the closure of $B$ is $\mathbb{R}^{n}$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem closure_B {n : ℕ} (hn : 0 < n) (A : Set (EuclideanSpace ℝ (Fin n))) (hA : IsClosed A) : closure {b : EuclideanSpace ℝ (Fin n) | ∃! a : EuclideanSpace ℝ (Fin n), a ∈ A ∧ ‖a - b‖ = sInf {x | ∃ a' : EuclideanSpace ℝ (Fin n), a' ∈ A ∧ x = ‖a' - b‖}} = ⊤ := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-235931,"Let $|U|, \sigma(U)$, and $\pi(U)$ denote the number of elements, the sum of elements, and the product of elements of a finite set $U$, respectively (if $U = \emptyset$, then $|U| = 0$, $\sigma(U) = 0$, $\pi(U) = 1$). Let $S$ be a finite set of positive integers. Prove that for any integer $m \geq \sigma(S)$, \begin{equation} \sum_{U \subseteq S} (-1)^{|U|} \binom{m - \sigma(U)}{|S|} = \pi(S). \end{equation}","import Mathlib theorem Finset.sumOf (S : Finset ℕ) (hS : ∀ x ∈ S, x > 0) (m : ℕ) (hm : m ≥ ∑ x ∈ S, x) : ∑ U ∈ S.powerset, (-1 : ℤ)^U.card * Nat.choose (m - ∑ x ∈ U, x) S.card = ∏ x ∈ S, x := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-236012,"Prove that if $A$ is a set of natural numbers such that for any $x, y \in A$, the expression $xy + 1$ is a perfect square, then the maximum cardinality of $A$ is $5$.","import Mathlib theorem ProveSetMax(A : Finset ℕ) (hA : ∀ x ∈ A, ∀ y ∈ A, IsSquare (x * y + 1)) : A.card ≤ 5 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-237329,"Let $n$ be an integer greater than $1$, and let $S$ be the set of all $n$-element subsets of the set $\{1,2,\ldots,2n\}$. Prove that the value of \[ \max_{A\in S}\left (\min_{x,y\in A, x \neq y} [x,y]\right ) \] where $[x,y]$ denotes the least common multiple of the integers $x$ and $y$, is: - \(3(n + 1)\) if $n$ is odd, - \(3(n + 2)\) if $n \geq 6$ is even, - \(12\) if $n = 2$, - \(24\) if $n = 4$.","import Mathlib open Finset theorem max_lcm (n : ℕ) (hn : n > 1) : IsGreatest {x | ∃ A : Finset ℕ, A ⊆ Icc 1 (2 * n) ∧ A.card = n ∧ x = sInf {y | ∃ a ∈ A, ∃ b ∈ A, a ≠ b ∧ y = Nat.lcm a b}} (if Odd n then 3 * (n + 1) else if Even n ∧ n ≥ 6 then 3 * (n + 2) else if n = 2 then 12 else if n = 4 then 24 else 0) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-237735,"Prove that there do not exist sequences $\{x_n\}$ and $\{y_n\}$ such that: 1. For all positive integers $n$, $x_n$ and $y_n$ are positive integers. 2. For all positive integers $n, m$, \( |n - m| \le 100|x_n - x_m| + 100|y_n - y_m| + 100\). 3. For all positive integers $a, b$, there exists a positive integer $n$ such that \( |a - x_n|+|b - y_n| \le 100\).","import Mathlib theorem no_seq : ¬∃ x y : ℕ → ℤ, (∀ n > 0, 0 < x n ∧ 0 < y n) ∧ (∀ n m : ℕ, n > 0 → m > 0 → |(n : ℤ) - m| ≤ 100 * |x n - x m| + 100 * |y n - y m| + 100) ∧ (∀ a b : ℕ, 0 < a → 0 < b → ∃ n : ℕ, 0 < n ∧ |(a : ℤ) - x n| + |(b : ℤ) - y n| ≤ 100) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-237736,"Prove that there do not exist sequences $\{x_n\}$ and $\{y_n\}$ of positive integers such that: 1. For all positive integers $n$, $x_n$ and $y_n$ are positive integers. 2. For all positive integers $n, m$, \( |n - m| \le 100|x_n - x_m| + 100|y_n - y_m| + 100 \). 3. For all positive integers $a, b$, there exists a positive integer $n$ such that \( |a - x_n| + |b - y_n| \le 100 \).","import Mathlib theorem no_seq : ¬∃ (x y : ℕ → ℤ), (∀ n > 0, 0 < x n ∧ 0 < y n) ∧ (∀ n m : ℕ, n ≥ 1 → m ≥ 1 → |(n : ℤ) - m| ≤ 100 * |(x n : ℤ) - (x m : ℤ)| + 100 * |(y n : ℤ) - (y m : ℤ)| + 100) ∧ (∀ a b : ℕ, 0 < a → ∃ n, 0 < n ∧ |(a : ℤ) - x n| + |(b : ℤ) - y n| ≤ 100) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-238758,"Let $a_1 \geq a_2 \geq a_3$ be positive integers, and let $N(a_1, a_2, a_3)$ denote the number of solutions $(x_1, x_2, x_3)$ in positive integers to the equation \[ \frac{a_1}{x_1} + \frac{a_2}{x_2} + \frac{a_3}{x_3} = 1. \] Prove that \[ N(a_1, a_2, a_3) \leq 6a_1a_2(3 + \ln(2a_1)). \]","import Mathlib open Real theorem N (a : Fin 3 → ℕ) (ha : ∀ i j, i < j → a i ≥ a j) (hpos : ∀ i, 0 < a i) : {(x : Fin 3 → ℕ) | (∀ i, 0 < x i) ∧ ∑ i, a i / x i = 1}.ncard ≤ 6 * a 0 * a 1 * (3 + log (2 * a 0)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-244184,"**Prove that** for the set \( M = \{1, 2, \ldots, 99\} \), the number \( N \) of bijective functions \( f: M \to M \) satisfying: 1. \( f(x) \neq x \) for all \( x \in M \) (no fixed points), 2. \( f^3(x) = x \) for all \( x \in M \) (every element has order 3 under \( f \)), is divisible by \( 2^6 = 64 \), but no higher power of 2 divides \( N \). *In other words, show that the largest power of 2 dividing \( N \) is 64.*","import Mathlib open Finset theorem solution (m : ℕ) (hm : m = 99) : 64 ∣ {f : Fin m → Fin m | Function.Bijective f ∧ ∀ i, f i ≠ i ∧ f^[3] i = i}.ncard ∧ ¬∃ k > 64, k ∣ {f : Fin m → Fin m | Function.Bijective f ∧ ∀ i, f i ≠ i ∧ f^[3] i = i}.ncard := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/OnlineMathContest, flc-245013,"Prove that it is impossible to find a continuous function $f: \mathbb{R} \times \mathbb{R} \to \mathbb{R}$ such that for every continuous function $g: \mathbb{R} \to \mathbb{R}$, there exists a $t \in \mathbb{R}$ for which $g(x) = f(t, x)$ for all $x \in \mathbb{R}$. What changes if $\mathbb{R}$ is replaced with the interval $[0,1]$?","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem unimpossible : ¬ ∃ f : ℝ → ℝ → ℝ, Continuous f ∧ ∀ g : ℝ → ℝ, Continuous g → ∃ t : ℝ, ∀ x : ℝ, g x = f t x := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-247498,"Prove that the number of integers \(n \geq 2\) such that whenever \(z_1, z_2, \ldots, z_n\) are complex numbers with \(|z_1| = |z_2| = \ldots = |z_n| = 1\) and \(z_1 + z_2 + \ldots + z_n = 0\), the numbers \(z_1, z_2, \ldots, z_n\) are equally spaced on the unit circle in the complex plane, is equal to \(2\).","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem number_theory_8793 : {n : ℕ | n ≥ 2 ∧ ∀ z : ℕ → ℂ, (∀ i ∈ Icc 1 n, ‖z i‖ = 1) ∧ (∑ i ∈ Icc 1 n, z i) = 0 → ∃ θ : ℝ, ∀ i ∈ Icc 1 n, z i = exp (I * θ * 2 * π * (i - 1) / n)}.ncard = 2 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-249554,"Prove that if $C$ is a non - empty, countable, closed subset of $\mathbb{R}$ such that every point in $C$ is an accumulation point, and for every $x \in C$ and every $\epsilon > 0$, there exists an open interval $I \subset D(x, \epsilon)$ such that $I \cap C = \emptyset$, then the cardinality of $C$ is $c$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove_countable_set (C : Set ℝ) (hC : C.Nonempty ∧ Countable C ∧ IsClosed C) (hC1 : ∀ x ∈ C, ClusterPt x (𝓟 C)) (hC2 : ∀ x ∈ C, ∀ ε > 0, ∃ I : Set ℝ, I ⊂ Set.Ioo (x - ε) (x + ε) ∧ I ∩ C = ∅) : C.ncard = c := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-251886,"Prove that there exists a divisor - friendly bijection $F: \mathbb{N} \to \mathbb{N}$, where a bijection $F$ is called divisor - friendly if $d(F(mn)) = d(F(m)) d(F(n))$ for all $m, n \in \mathbb{N}$, and $d(n)$ denotes the number of positive divisors of a positive integer $n$.","import Mathlib theorem proveDivisorFriendlyBijection: ∃ (F : ℕ → ℕ), Function.Bijective F ∧ ∀ m n, 0 < m → 0 < n → (Nat.divisors (F (m * n))).card = (Nat.divisors (F m)).card * (Nat.divisors (F n)).card := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-252268,Prove that \(\sum_{i = 0}^{116}(-1)^i\binom{200}{i}\binom{699 - 6i}{199}=-719144418459525946920640022640085828710617581640032743659581867700021494408623056810233805599773222695375284728276204344891353722577591881702023839953902006588152566551423671945176\).,"import Mathlib open Finset theorem sum : ∑ i ∈ range 117, (-1 : ℤ)^i * Nat.choose 200 i * Nat.choose (699 - 6 * i) 199 = -719144418459525946920640022640085828710617581640032743659581867700021494408623056810233805599773222695375284728276204344891353722577591881702023839953902006588152566551423671945176 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-253450,"Let $S$ be the set of all sequences of length $2018$ whose terms are elements of the set $\{1, 2, 3, 4, 5, 6, 10\}$ and whose sum is $3860$. Prove that the cardinality of $S$ is at most \[2^{3860} \cdot \left(\frac{2018}{2048}\right)^{2018}.\]","import Mathlib open Finset theorem number_theory_8970 : {s : Fin 2018 → ℕ | (∀ i, s i ∈ ({1, 2, 3, 4, 5, 6, 10} : Set ℕ)) ∧ (∑ i, s i) = 3860}.ncard ≤ 2^3860 * ((2018 : ℝ)/2048)^2018 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-254509,"Prove that if $S$ is the set of all sequences of length $2018$ whose terms are elements of the set $\{1, 2, 3, 4, 5, 6, 10\}$ and whose sum is $3860$, then the cardinality of $S$ is at most \(2^{3860} \cdot \left(\frac{2018}{2048}\right)^{2018}\).","import Mathlib open Finset theorem prove (S : Set (Fin 2018 → ℕ)) (hS : ∀ s ∈ S, ∀ i, s i = 1 ∨ s i = 2 ∨ s i = 3 ∨ s i = 4 ∨ s i = 5 ∨ s i = 6 ∨ s i = 10) (hS' : ∀ s ∈ S, ∑ i, s i = 3860) : S.ncard ≤ 2 ^ 3860 * ((2018 / 2048 : ℝ)) ^ 2018 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-257992,"Let $|U|$, $\sigma(U)$, and $\pi(U)$ denote the number of elements, the sum of the elements, and the product of the elements of a set $U$, respectively. Additionally, define $|\emptyset| = 0$, $\sigma(\emptyset) = 0$, and $\pi(\emptyset) = 1$. Given a finite set $S$ of positive integers, prove that for all $m \geq \sigma(S)$, the following identity holds: \[ \sum_{U \subseteq S} (-1)^{|U|} \binom{m - \sigma(U)}{|S|} = \pi(S). \]","import Mathlib open Finset theorem Finset.sum' {S : Finset ℕ} (hS : ∀ x ∈ S, x > 0) : ∀ m ≥ ∑ x ∈ S, x, ∑ U ∈ S.powerset, (-1 : ℤ) ^ U.card * Nat.choose (m - ∑ x ∈ U, x) (S.card) = ∏ x ∈ S, x := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-258107,"Let \(n \geq 3\) be an integer, and let \(\mathcal{S} \subset \{1, 2, \ldots, n^3\}\) be a set with \(3n^2\) elements. Prove that there exist nine distinct numbers \(a_1, a_2, \ldots, a_9 \in \mathcal{S}\) such that the following system of equations has a solution in nonzero integers: \[ \begin{cases} a_1x + a_2y + a_3z = 0 \\ a_4x + a_5y + a_6z = 0 \\ a_7x + a_8y + a_9z = 0 \end{cases} \]","import Mathlib theorem qwen (n : ℕ) (hn : 3 ≤ n) (S : Finset ℕ) (hS : S ⊆ Finset.Icc 1 (n ^ 3)) (hS1 : S.card = 3 * n ^ 2) : ∃ x y z : ℤ, x ≠ 0 ∧ y ≠ 0 ∧ z ≠ 0 ∧ ∃ a : Fin 9 → ℕ, (∀ i j, i ≠ j → a i ≠ a j) ∧ (∀ i, a i ∈ S) ∧ a 0 * x + a 1 * y + a 2 * z = 0 ∧ a 3 * x + a 4 * y + a 5 * z = 0 ∧ a 6 * x + a 7 * y + a 8 * z = 0 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-262045,Let \(p = 4k + 1\) be a prime number. Prove that \( (-1)^k \binom{4k}{k} \equiv 3 \cdot 2^{4k} - 2 \pmod{p^2}\).,"import Mathlib theorem Nat.chooseEq (p k : ℕ) [Fact p.Prime] (hp : p = 4 * k + 1) : (-1 : ℤ) ^ k * Nat.choose (4 * k) k ≡ 3 * 2 ^ (4 * k) - 2 [ZMOD p ^ 2] := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-263884,"Prove that the smallest positive integer \(n\) such that for any triples \((a, b, c)\) and \((x, y, z)\) of nonnegative integers satisfying \(a + b + c = 2020\) and \(x + y + z = n\), the value of \(f(x, y, z)=(x!)^x (y!)^y (z!)^z\) is divisible by \(f(a, b, c)=(a!)^a (b!)^b (c!)^c\) is \(n = 6052\).","import Mathlib open Finset theorem algebra_396863 {n : ℕ} (hn : n > 0) : IsLeast {n' | 0 < n' ∧ ∀ a b c x y z : ℕ, a + b + c = 2020 ∧ x + y + z = n' → (Nat.factorial x)^x * (Nat.factorial y)^y * (Nat.factorial z)^z ≡ 0 [MOD (Nat.factorial a)^a * (Nat.factorial b)^b * (Nat.factorial c)^c]} 6052 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-265410,"Prove that there does not exist a continuous function \(f: \mathbb{R} \times \mathbb{R} \to \mathbb{R}\) with the property that for any continuous function \(g: \mathbb{R} \to \mathbb{R}\), there exists a real number \(t\) such that \(g(x) = f(t, x)\) for all \(x \in \mathbb{R}\). Also, prove that there does not exist a continuous function \(f: \mathbb{R} \times [0,1] \to [0,1]\) such that for any continuous function \(g: [0,1] \to [0,1]\), there exists a real number \(t\) such that \(g(x) = f(t, x)\) for all \(x \in [0,1]\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem cannot.exist : ¬ ∃ (f : ℝ × ℝ → ℝ) (hf : Continuous f), ∀ (g : ℝ → ℝ) (hg : Continuous g), ∃ t : ℝ, ∀ x : ℝ, g x = f (t, x) ∧ ¬ ∃ (f : ℝ × Set.Icc 0 1 → Set.Icc 0 1) (hf : Continuous f), ∀ (g : Set.Icc 0 1 → Set.Icc 0 1) (hg : Continuous g), ∃ t : ℝ, ∀ x : Set.Icc 0 1, g x = f (t, x) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-266456,"Let $f(0, 0) = 5^{2003}$, and $f(0, n) = 0$ for every integer $n \neq 0$. For every natural number $m > 0$ and for every integer $n$, the function $f$ is defined recursively by \[ f(m, n) = f(m-1, n) - 2 \cdot \left\lfloor \frac{f(m-1, n)}{2} \right\rfloor + \left\lfloor \frac{f(m-1, n-1)}{2} \right\rfloor + \left\lfloor \frac{f(m-1, n+1)}{2} \right\rfloor. \] Prove that there exists a positive integer $M$ such that $f(M, n) = 1$ for all integers $n$ satisfying $|n| \leq \frac{5^{2003}-1}{2}$, and $f(M, n) = 0$ for all integers $n$ satisfying $|n| > \frac{5^{2003}-1}{2}$.","import Mathlib theorem algebra_584564 (f : ℕ → ℤ → ℤ) (h₀ : f 0 0 = 5^2003) (h₁ : ∀ n ≠ 0, f 0 n = 0) (h₂ : ∀ m > 0, ∀ n, f m n = f (m - 1) n - 2 * ⌊(f (m - 1) n / 2 : ℝ)⌋ + ⌊(f (m - 1) (n - 1) / 2 : ℝ)⌋ + ⌊(f (m - 1) (n + 1) / 2 : ℝ)⌋) : ∃ M > 0, ∀ n, |n| ≤ (5^2003 - 1) / 2 → f M n = 1 ∧ |n| > (5^2003 - 1) / 2 → f M n = 0 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-267439,"Prove that the set of all integers \(n \geq 2019\) such that for all \(0 < k < n\), \(k \in \mathbb{Z}\), the inequality \(\frac{a_{n + k}}{a_n}<\frac{a_n}{a_{n - k}}\) holds is the set of all odd integers \(n \geq 2019\), where \(a_n\) denotes the number of good subsets of the set \(\{1,2,\ldots,n\}\) and a set of positive integers is defined as good if the greatest common divisor of all elements in the set is \(1\).","import Mathlib open Finset theorem number_theory_447683 {a : ℕ → ℕ} (ha : ∀ n, a n = {s : Finset ℕ | s ⊆ Icc 1 n ∧ s.gcd id = 1}.ncard): {n : ℕ | 2019 ≤ n ∧ ∀ k ∈ Ioo 0 n, (a (n + k)) / (a n : ℚ) < (a n : ℚ) / (a (n - k))} = {n : ℕ | Odd n ∧ 2019 ≤ n} := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-269529,"Let $n = 2k - 1$ where $k \geq 6$ is an integer. Let $T$ be the set of all $n$-tuples $(x_1, x_2, \ldots, x_n)$ where $x_i \in \{0,1\}$ for all $i \in \{1,2, \ldots, n\}$. For $x = (x_1, x_2, \ldots, x_n) \in T$ and $y = (y_1, y_2, \ldots, y_n) \in T$, let $d(x,y)$ denote the number of integers $j$ with $1 \leq j \leq n$ such that $x_j \neq y_j$, with the special case that $d(x,x) = 0$. Suppose there exists a subset $S$ of $T$ with $2^k$ elements such that for any element $x \in T$, there is a unique element $y \in S$ with $d(x, y) \leq 3$. Prove that $n = 23$.","import Mathlib open Finset theorem qwen {n : ℕ} (hn : ∃ k ≥ 6, n = 2 * k - 1) (T : Set (Fin n → Fin 2)) (hT : ∀ x ∈ T, ∀ i : Fin n, (x i : ℕ) = 0 ∨ (x i : ℕ) = 1) (d : (Fin n → Fin 2) → (Fin n → Fin 2) → ℕ) (hd : ∀ x y : Fin n → Fin 2, d x y = {j : Fin n | (x j : ℕ) ≠ (y j : ℕ)}.ncard) (h : ∃ S : Finset (Fin n → Fin 2), S.card = 2 ^ k ∧ ∀ x : Fin n → Fin 2, (∃! y ∈ S, d x y ≤ 3)) : n = 23 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-274106,"Prove that there exist infinitely many *beautiful* sets $L(x, 23)$, where an integer $x$ is defined as *nice* if it can be expressed as the sum of five nonzero squares, and a set $L(x, n) = \{x + 1, x + 2, \ldots, x + n\}$ is termed *beautiful* if every element $x + i$ is nice for all $1 \le i \le n$.","import Mathlib def isNice (x : ℤ) := ∃ a b c d e : ℤ, a ≠ 0 ∧ b ≠ 0 ∧ c ≠ 0 ∧ d ≠ 0 ∧ e ≠ 0 ∧ x = a^2 + b^2 + c^2 + d^2 + e^2 def L (x : ℤ) (n : ℕ) := Finset.Icc (x + 1) (x + n) def isBeautiful (x : ℤ) (n : ℕ) := ∀ i ∈ L x n, isNice i theorem prove_infinite : ∀ N : ℕ, ∃ x : ℤ, x > N ∧ isBeautiful x 23 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-274555,"Prove that the quadratic generating function \(P(x) = \sum_{n = 0}^{\infty}\binom{3n}{n}x^{2n}\) has the closed - form \(\frac{C_1(12x\sqrt{3} + 4\sqrt{-4 + 27x^2})^{1/3}}{\sqrt{-4 + 27x^2}} + \frac{C_2}{\sqrt{27x^2 - 4}(12x\sqrt{3} + 4\sqrt{-4 + 27x^2})^{1/3}}\), where \(C_1\) and \(C_2\) are constants of integration.","import Mathlib open Real theorem quadraticGeneratingFunction (x : ℝ) : ∑' n : ℕ, Nat.choose (3 * n) n * x ^ (2 * n) = C1 * (12 * x * sqrt 3 + 4 * sqrt (-4 + 27 * x ^ 2)) ^ ((1 : ℝ) / 3) / sqrt (-4 + 27 * x ^ 2) + C2 / (sqrt (27 * x ^ 2 - 4) * (12 * x * sqrt 3 + 4 * sqrt (-4 + 27 * x ^ 2)) ^ ((1 : ℝ) / 3)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-279691,Let $p$ be an odd prime number. Prove that the number of positive integers $n$ for which $p \mid n! + 1$ is less than or equal to $4p^{\frac{2}{3}}$.,"import Mathlib theorem Qwen (p : ℕ) (hp : Odd p ∧ Nat.Prime p) : Set.ncard {n | 0 < n ∧ p ∣ Nat.factorial n + 1} ≤ 4 * p ^ (2 / 3) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-286494,"Let $S = \{1, 2, 3, \ldots, 2017\}$. For every subset $A$ of $S$, define a real number $f(A) \geq 0$ such that the following conditions hold: 1. For any $A, B \subset S$, $f(A \cup B) + f(A \cap B) \leq f(A) + f(B)$. 2. For any $A \subset B \subset S$, $f(A) \leq f(B)$. 3. For any $k, j \in S$, $f(\{1, 2, \ldots, k+1\}) \geq f(\{1, 2, \ldots, k\} \cup \{j\})$. 4. For the empty set $\varnothing$, $f(\varnothing) = 0$. Prove that for any three - element subset $T$ of $S$, the inequality $f(T) \leq \frac{27}{19} f(\{1, 2, 3\})$ holds.","import Mathlib open Finset Real theorem algebra_486516 {f : Finset ℕ → ℝ} (h₀ : ∀ A B : Finset ℕ, A ⊆ Icc 1 2017 → B ⊆ Icc 1 2017 → f (A ∪ B) + f (A ∩ B) ≤ f A + f B) (h₁ : ∀ A B : Finset ℕ, A ⊆ Icc 1 2017 → B ⊆ Icc 1 2017 → A ⊆ B → f A ≤ f B) (h₂ : ∀ k j : ℕ, k ∈ Icc 1 2017 → j ∈ Icc 1 2017 → f (Icc 1 (k + 1)) ≥ f (Icc 1 k ∪ {j})) (h₃ : f ∅ = 0) : ∀ T : Finset ℕ, T ⊆ Icc 1 2017 ∧ T.card = 3 → f T ≤ (27 / 19) * f {1, 2, 3} := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-286585,"1. **Part (a)**: - The original problem already asks for a proof. So, the formal proof statement is: - Given a set \(S\) of 101 distinct positive integers, prove that there exist 11 distinct numbers \(a_1, a_2, \ldots, a_{11}\) in \(S\) such that either \(a_1\mid a_2\mid\ldots\mid a_{11}\), or no \(a_i\) divides any other \(a_j\) for \(i\neq j\). 2. **Part (b)**: - The final conclusion from the assistant's answer is that there does not necessarily exist at least two distinct, but not necessarily disjoint, sets of 11 such numbers in \(S\) that satisfy either of the two conditions. - The formal proof statement is: - Given a set \(S\) of 101 distinct positive integers, prove that there does not necessarily exist at least two distinct (not - necessarily disjoint) sets of 11 distinct numbers \(a_1, a_2, \ldots, a_{11}\) in \(S\) such that for each set, either \(a_1\mid a_2\mid\ldots\mid a_{11}\), or no \(a_i\) divides any other \(a_j\) for \(i\neq j\).","import Mathlib theorem part_a (S : Finset ℕ) (hS : S.card = 101) (hS1 : ∀ x ∈ S, x > 0) : ∃ a : Finset ℕ, a ⊆ S ∧ a.card = 11 ∧ (∀ i ∈ a, ∀ j ∈ a, i ≠ j → ¬(i ∣ j)) ∨ (∀ i ∈ a, ∀ j ∈ a, i ≠ j → i ∣ j) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-286661,"Prove that if $n$ is a positive integer, $S_n = \{1, 2, \ldots, n\}$, for a permutation $\sigma$ of $S_n$ and an integer $a \in S_n$, $d(a)$ is the least positive integer $d$ such that \(\underbrace{\sigma(\sigma(\ldots \sigma(a) \ldots))}_{d \text{ applications of } \sigma} = a\) (or \(-1\) if no such integer exists), and there exists a permutation $\sigma$ of $S_n$ satisfying the equations \(\begin{aligned} d(1) + d(2) + \ldots + d(n) &= 2017, \\ \frac{1}{d(1)} + \frac{1}{d(2)} + \ldots + \frac{1}{d(n)} &= 2, \end{aligned}\) then \(n = 53\).","import Mathlib theorem prove {n : ℕ} (hn : n > 0) (σ : Equiv.Perm (Fin n)) (d : Fin n → ℕ) (h₀ : ∀ i, d i = sInf {j | 0 < j ∧ σ^[j] i = i}) (h₁ : ∑ i, d i = 2017) (h₂ : ∑ i, (1 / d i : ℚ) = 2) : n = 53 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-286732,"Let the vertices of a convex \(1991\) -gon be labeled with the integers from \(1\) to \(1991\). Each side and diagonal of the \(1991\) -gon is colored either red or blue. Prove that, for any renumeration of the vertices, there exist integers \(k\) and \(l\) such that the segment connecting the vertices numbered \(k\) and \(l\) before the renumeration has the same color as the segment connecting the vertices numbered \(k\) and \(l\) after the renumeration.","import Mathlib theorem convex_1991 (f : Fin 1991 → Fin 1991) (h : ∀ i j, f i = f j → i = j) (color : Fin 1991 → Fin 1991 → Fin 2) : ∃ k l, k ≠ l ∧ color (f k) (f l) = color k l := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-286973,"试确定具有下述性质的最大正数 $M>1$ :在区间 $[1, M]$ 中任意取 10 个不同的实数,均可从中选取三个数,从小到大记为 $a 0 ∧ ∀ N : ℕ, N > 0 → ∃ s : Finset ℕ, s ⊆ Finset.Icc 1 (2 * N) ∧ s.card = N ∧ ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ Nat.gcd x y > c * N := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-288033,"The user's problem is already a formal math proof problem. So, the final proof statement is: For a positive integer \(a \geq 2\), let \(N_a\) denote the number of positive integers \(k\) such that the sum of the squares of the digits of \(k\) in base \(a\) representation equals \(k\). a.) Prove that \(N_a\) is odd. b.) Prove that for every positive integer \(M\), there exists a positive integer \(a \geq 2\) such that \(N_a \geq M\).","import Mathlib open Finset theorem number_theory_731824 {N : ℕ → ℕ} (hN : ∀ a, N a = {k | 0 < k ∧ ∑ i ∈ range (Nat.digits a k).length, (Nat.digits a k)[i]!^2 = k}.ncard) : (∀ a ≥ 2, Odd (N a)) ∧ (∀ M > 0, ∃ a ≥ 2, N a ≥ M) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-288055,"Prove that for a positive even integer \(N = 2k\) (\(k\in\mathbb{Z}^+\)), the number of ways \(a_{2k}\) to fill an \(N\times N\) (i.e., \(2k\times 2k\)) matrix with entries of \(1\) or \(-1\) such that the sum of the elements in each row and each column is \(0\) satisfies the recurrence relation \(a_{2k} = 2 \binom{2k-2}{2}^2 a_{2k-2}\).","import Mathlib open Finset Matrix theorem prove {k : ℕ} (hk : 0 < k) : {a : Matrix (Fin (2 * k)) (Fin (2 * k)) ℤ | (∀ i j, a i j = 1 ∨ a i j = -1) ∧ (∀ i, ∑ j : Fin (2 * k), a i j = 0) ∧ (∀ j, ∑ i : Fin (2 * k), a i j = 0)}.ncard = 2 * Nat.choose (2 * k - 2) 2 ^ 2 * {a : Matrix (Fin (2 * k - 2)) (Fin (2 * k - 2)) ℤ | (∀ i j, a i j = 1 ∨ a i j = -1) ∧ (∀ i, ∑ j : Fin (2 * k - 2), a i j = 0) ∧ (∀ j, ∑ i : Fin (2 * k - 2), a i j = 0)}.ncard := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-288121,"If a set contains an even number of elements, it is called an even set. Let \( M = \{1, 2, \cdots, 2011\} \). If there exist \( k \) even subsets of \( M \), denoted as \( A_1, A_2, \cdots, A_k \), such that for any \( 1 \leq i < j \leq k \), \( A_i \cap A_j \) is not an even set, find the maximum value of \( k \).","import Mathlib def isEven (s : Finset ℕ) := Even s.card theorem maxk : IsGreatest {k | ∃ A : Fin k → Finset ℕ, (∀ i j, i ≠ j → ¬isEven (A i ∩ A j)) ∧ (∀ i, isEven (A i)) ∧ (∀ i, A i ⊆ Finset.Icc 1 2011)} 906 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/BlueMO, flc-288229,"Prove that the minimum possible average of all $\binom{2017}{2}$ labels in a complete graph $K_{2017}$, where each edge is labeled with one of the numbers $1$, $2$, or $3$ and the sum of the labels of the edges of any triangle in the graph is at least $5$, is $2$.","import Mathlib open Finset Real theorem min_avg (K : Fin 2017 → Fin 2017 → ℕ) (hK : ∀ i j, K i j = 1 ∨ K i j = 2 ∨ K i j = 3) (hK' : ∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → K i j + K i k + K j k ≥ 5) : IsLeast {x | ∃ K : Fin 2017 → Fin 2017 → ℕ, (∀ i j, K i j = 1 ∨ K i j = 2 ∨ K i j = 3) ∧ (∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → K i j + K i k + K j k ≥ 5) ∧ x = (∑ i, ∑ j, if i < j then K i j else 0) / (Nat.choose 2017 2)} 2 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-288278,"Let \( \textbf{Z}_n \) be the set \( \{0, 1, \ldots, n - 1\} \) with addition mod \( n \). Consider subsets \( S_n \) of \( \textbf{Z}_n \) such that \((S_n + k) \cap S_n\) is nonempty for every \( k \) in \( \textbf{Z}_n \). Let \( f(n) \) denote the minimal number of elements in such a subset. Determine \( \lim_{n \to \infty} {\ln f(n) \over \ln n} \). Prove that the answer is \dfrac{1}{2}.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (f : ℕ → ℕ) (h₀ : ∀ n, f n = sInf {x | ∃ S : Finset (ZMod n), S.card = x ∧ (∀ k : ZMod n, ∃ m ∈ S, m + k ∈ S)}) : Tendsto (λ n => Real.log (f n) / Real.log n) atTop (𝓝 (1 / 2)) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-288279,"Prove that the minimum possible average of the labels of all \(\binom{2017}{2}\) edges in the complete graph \(K_{2017}\), where each edge is labeled with one of the numbers \(1\), \(2\), or \(3\) and the sum of the labels of the edges of any triangle in the graph is at least \(5\), is \(2 - \frac{1}{2017}\).","import Mathlib open Finset Real theorem min_triangle : IsLeast {x : ℝ | ∃ L : (Fin 2017 → Fin 2017 → ℕ), (∀ i j, i < j → (L i j = 1 ∨ L i j = 2 ∨ L i j = 3)) ∧ (∀ i j k, i < j ∧ i < k ∧ j ≠ k → L i j + L i k + L j k ≥ 5) ∧ x = ((∑ i, ∑ j, if i < j then L i j else 0) / (Nat.choose 2017 2)) } (2 - 1 / 2017) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-288520,"1. **First part**: - The original problem is already a formal math - proof problem. So, we keep it as it is: - Prove that given \(2019\) distinct integers, each of which has no odd prime divisor less than \(37\), there exist two of these integers such that their sum has no odd prime divisor less than \(37\). 2. **Second part**: - The final conclusion from the assistant's answer for the second part is that the result does not hold if the prime number is changed from \(37\) to \(38\). - We rewrite the second part of the problem as a formal proof statement: - Prove that there exists a set of \(2019\) distinct integers, each of which has no odd prime divisor less than \(38\), such that for any two of these integers, their sum has an odd prime divisor less than \(38\). So, the overall formal proof statements are: - Prove that given \(2019\) distinct integers, each of which has no odd prime divisor less than \(37\), there exist two of these integers such that their sum has no odd prime divisor less than \(37\). - Prove that there exists a set of \(2019\) distinct integers, each of which has no odd prime divisor less than \(38\), such that for any two of these integers, their sum has an odd prime divisor less than \(38\).","import Mathlib theorem formal_math_1 (S : Finset ℕ) (hS : S.card = 2019) (hS1 : ∀ n ∈ S, ∀ p, Odd p → p.Prime ∧ p ∣ n → p ≥ 37) : ∃ m ∈ S, ∃ n ∈ S, m ≠ n ∧ ∀ p, Odd p → p.Prime ∧ p ∣ m + n → p ≥ 37 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-288583,"Let $\triangle ABC$ be a given triangle with side lengths $a$, $b$, and $c$. Consider any coloring of the points in the plane with two colors, red and green. Prove that there exist either two red points at a distance of $1$ unit from each other, or three green points that form a triangle congruent to $\triangle ABC$.","import Mathlib open Real open scoped BigOperators theorem color_points (A B C : EuclideanSpace ℝ (Fin 2)) (a b c : ℝ) (ha : a = dist B C) (hb : b = dist A C) (hc : c = dist A B) (f : EuclideanSpace ℝ (Fin 2) → Fin 2) : (∃ x y, x ≠ y ∧ f x = 0 ∧ f y = 0 ∧ dist x y = 1) ∨ (∃ x y z, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ f x = 1 ∧ f y = 1 ∧ f z = 1 ∧ (dist x y = a ∧ dist y z = b ∧ dist z x = c)) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-288817,"Prove that the number of interesting colorings of a \(4\times4\times4\) cube composed of \(64\) unit cubes, where the faces of \(16\) unit cubes are colored red and there is exactly one red unit cube in every \(1\times1\times4\) rectangular box composed of \(4\) unit cubes, is \(576\).","import Mathlib theorem colorings : Set.ncard {f : Fin 4 → Fin 4 → Fin 4 → Bool | ∀ i j k, f i j k = True → (∀ i j, ∃! k, f i j k) ∧ (∀ i k, ∃! j, f i j k) ∧ (∀ j k, ∃! i, f i j k)} = 576 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-288994,"Prove that in a game where David selects a subset \(Q\) of the set \(\{1, 2, \ldots, 2018\}\), and Linus then chooses a natural number \(a_1\) and computes the sequence \(a_2, a_3, \ldots, a_{2018}\) such that each \(a_{n + 1}\) is the product of the positive divisors of \(a_n\), and \(P\) is the set of integers \(k \in \{1, 2, \ldots, 2018\}\) for which \(a_k\) is a perfect square, with Linus winning if \(P = Q\) and David winning otherwise, Linus can always win the game.","import Mathlib open Finset theorem ProveLinsusWin (Q : Finset ℕ) (hQ : Q ⊆ Icc 1 2018) : ∃ a : ℕ → ℕ, (∀ n, a (n + 1) = ∏ d ∈ Nat.divisors (a n), d) ∧ {k | 1 ≤ k ∧ k ≤ 2018 ∧ IsSquare (a k)} = Q := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-289303,"Prove that if $S_1, S_2, \ldots$ is an infinite sequence of subsets of $\mathbb{N}$ (the set of positive integers) such that for any $i \neq j$, $S_i \not\subset \mathbb{N}S_j$, where $\mathbb{N}S$ denotes the set of integers that are multiples of some element of $S$, then for any finite subset $T \subset \mathbb{N}$, there exist infinitely many indices $i$ and elements $p_i \in S_i$ such that $p_i$ has a divisor not in $T$.","import Mathlib theorem prove_infinite_sequence_of_subsets (S : ℕ → Set ℕ) (hS : ∀ i, S i ⊆ {n | n > 0}) (hS' : ∀ i j, i ≠ j → ¬(S i ⊆ {n | ∃ m ∈ S j, n % m = 0})) : ∀ T : Finset ℕ, ∃ p : ℕ → ℕ, (∀ i, p i ∈ S i) ∧ {i | ∃ d, d ∣ p i ∧ d ∉ T}.Infinite := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-289562,"Compute the number of sequences of integers $(a_1,\ldots,a_{200})$ such that the following conditions hold. [list] [*] $0\leq a_1 0, ∀ i, ∃ j, 203 ∣ a i + a j - N} = 20503 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DAPO-Math-17k, flc-289666,"A set \( S \) is called ""lonely"" if for any not all equal \( x, y, z \in S \), it holds that \( \frac{x + y + z}{3} \notin S \). Prove that there exists a constant \( c > 0 \) such that for any positive integer \( N \), there exists a lonely set \( A \subseteq \{1, 2, \dots, N\} \) satisfying \( |A| \geq N \cdot e^{-c\sqrt{\ln N}} \).","import Mathlib open Finset Real theorem exists_c : ∃ c > 0, ∀ N : ℕ, 0 < N → ∃ A : Finset ℕ, (∀ x ∈ A, ∀ y ∈ A, ∀ z ∈ A, (x ≠ y ∨ y ≠ z ∨ x ≠ z) → ¬(x + y + z) / 3 ∈ A) ∧ A ⊆ Icc 1 N ∧ A.card ≥ N * exp (-c * sqrt (log N)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-289880,"Prove that it is possible to color all grid points in the plane either white or red such that no rectangle, with vertices on grid points of the same color and sides parallel to the grid lines, has an area from the set $\{1, 2, 4, 8, \cdots, 2^n, \cdots\}$.","import Mathlib open Finset theorem color_points : ∃ f : ℤ → ℤ → Fin 2, ∀ x y, f x y = 0 ∨ f x y = 1 ∧ ∀ x1 x2 y1 y2, x1 < x2 → y1 < y2 → (f x1 y1 = 0 ∧ f x2 y1 = 0 ∧ f x1 y2 = 0 ∧ f x2 y2 = 0) ∨ (f x1 y1 = 1 ∧ f x2 y1 = 1 ∧ f x1 y2 = 1 ∧ f x2 y2 = 1) → ¬∃ n, (x2 - x1) * (y2 - y1) = 2 ^ n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-290271,"Let integers \( m \geq n \geq 2022 \), and \( a_1, a_2, \cdots, a_n, b_1, b_2, \cdots, b_n \) be real numbers. Prove that the number of pairs \((i, j)\) (where \( 1 \leq i, j \leq n \)) satisfying \( |a_i + b_j - ij| \leq m \) does not exceed \( 3n\sqrt{m \ln n} \).","import Mathlib open Real theorem number_of_pairs {m n : ℕ} (hm : m ≥ n) (hn : n ≥ 2022) (a b : Fin n → ℝ) : Set.ncard {p : Fin n × Fin n | |a p.1 + b p.2 - (p.1 + 1) * (p.2 + 1)| ≤ m} ≤ 3 * n * sqrt (m * log n) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-290333,"A set of positive integers \( C \) is called a ""good set"" if, for any integer \( k \), there exist \( a, b \in C \) with \( a \neq b \) such that the numbers \( a+k \) and \( b+k \) are not coprime. Prove: If the sum of the elements of a ""good set"" \( C \) is 2003, then there exists an element \( c \in C \) such that the set \( C \setminus \{c\} \) is still a ""good set.""","import Mathlib theorem Prove (C : Finset ℕ) (hC : ∀ x ∈ C, x > 0) (hC1 : ∀ k : ℕ, ∃ a b : ℕ, a ∈ C ∧ b ∈ C ∧ a ≠ b ∧ ¬Nat.Coprime (a + k) (b + k)) (hC2 : ∑ x ∈ C, x = 2003) : ∃ c : ℕ, c ∈ C ∧ (∀ k : ℕ, ∃ a b : ℕ, a ∈ C \ {c} ∧ b ∈ C \ {c} ∧ a ≠ b ∧ ¬Nat.Coprime (a + k) (b + k)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/BlueMO, flc-290475,"Prove that the minimum number of triples \((i, j, k)\), where \(1 \leq i < j < k \leq n\), such that either \(a_i < a_j < a_k\) or \(a_i > a_j > a_k\) holds, over all permutations \(a_1, a_2, \dots, a_n\) of the set \(\{1, 2, \dots, n\}\), is \(\frac{(n - 4)(n - 5)(2n - 9)}{12}\).","import Mathlib open Finset theorem count_min (n : ℕ) (hn : n ≥ 4): IsLeast {m | ∃ a : Equiv.Perm (Fin n), m = Set.ncard {(i, j, k) : Fin n × Fin n × Fin n | i < j ∧ j < k ∧ (a i < a j ∧ a j < a k ∨ a i > a j ∧ a j > a k)}} ((n - 4) * (n - 5) * (2 * n - 9) / 12):= by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-290713,"1. **Part (a)** - The final conclusion for part (a) is that when \(k = 41\), no such \(n\) exist. - The formal math proof statement is: Prove that in a group of \(n>20\) people where some pairs of people know each other (and the relationship is symmetric), if for any \(20\) - person subset removed from the group, the number of pairs of people that know each other is at most \(\frac{n - 41}{n}\) times the number of such pairs in the original group, then there are no positive - integer values of \(n\) for which such a group can exist. 2. **Part (b)** - The final conclusion for part (b) is that when \(k = 39\), all \(n\geq381\) work. - The formal math proof statement is: Prove that in a group of \(n>20\) people where some pairs of people know each other (and the relationship is symmetric), if for any \(20\) - person subset removed from the group, the number of pairs of people that know each other is at most \(\frac{n - 39}{n}\) times the number of such pairs in the original group, then all positive integers \(n\geq381\) allow for the existence of such a group.","import Mathlib open Finset Real theorem part_a {n : ℕ} (hn : n > 20) : (∀ s : Finset ℕ, s ⊆ Icc 1 n ∧ s.card = 20 → {p | ∃ x ∈ s, ∃ y ∈ s, p = (x, y) ∧ x ≠ y}.ncard ≤ ((n - 41) / n) * {p | ∃ x ∈ Icc 1 n, ∃ y ∈ Icc 1 n, p = (x, y) ∧ x ≠ y}.ncard) ↔ False := by sorry theorem part_b {n : ℕ} (hn : n ≥ 381) : (∀ s : Finset ℕ, s ⊆ Icc 1 n ∧ s.card = 20 → {p | ∃ x ∈ s, ∃ y ∈ s, p = (x, y) ∧ x ≠ y}.ncard ≤ ((n - 39) / n) * {p | ∃ x ∈ Icc 1 n, ∃ y ∈ Icc 1 n, p = (x, y) ∧ x ≠ y}.ncard) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-290771,"For a positive integer \(m\), let \(s(m)\) denote the sum of the digits of \(m\). For \(n \geq 2\), let \(f(n)\) be the smallest integer \(k\) such that there exists a set \(S\) of \(n\) positive integers for which \(s\left(\sum_{x \in X} x\right) = k\) for any nonempty subset \(X \subset S\). Prove that there exist constants \(0 < C_1 < C_2\) such that \[C_1 \log_{10} n \leq f(n) \leq C_2 \log_{10} n.\]","import Mathlib open Real theorem logb10 (n : ℕ) : ∃ C1 C2 : ℝ, 0 < C1 ∧ C1 < C2 ∧ C1 * logb 10 n ≤ sInf {k | ∃ S : Finset ℕ, S.card = n ∧ (∀ x ∈ S, x > 0) ∧ ∀ X ⊆ S, X ≠ ∅ → (Nat.digits 10 (∑ x ∈ X, x)).sum = k} ∧ sInf {k | ∃ S : Finset ℕ, S.card = n ∧ (∀ x ∈ S, x > 0) ∧ ∀ X ⊆ S, X ≠ ∅ → (Nat.digits 10 (∑ x ∈ X, x)).sum = k} ≤ C2 * logb 10 n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-291170,"A non-empty set of integers $A$ is called *elegant* if for every $a \in A$ and every integer $k$ with $1 \leq k \leq 2023$, the set \[ \left\{b \in A : \left\lfloor \frac{b}{3^k} \right\rfloor = \left\lfloor \frac{a}{3^k} \right\rfloor \right\} \] has exactly $2^k$ elements. Prove that if a set of integers $S$ has a non-empty intersection with every elegant set, then $S$ contains an elegant set.","import Mathlib def isElegant (A : Finset ℤ) : Prop := A.Nonempty ∧ ∀ a ∈ A, ∀ k ∈ Finset.Icc 1 2023, {b | b ∈ A ∧ ⌊(b / 3 ^ k : ℝ)⌋ = ⌊(a / 3 ^ k : ℝ)⌋}.encard = 2 ^ k theorem proveElegant {S : Finset ℤ} (hS : ∀ A, isElegant A → S ∩ A ≠ ∅) : ∃ A, isElegant A ∧ A ⊆ S := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-292193,"Let \( k \geq 2 \) be an integer, and \( n \) be a positive integer. Define \( A_{n} = \{1, 2, \dots, n\} \), \( B_{n} = \left\{a_{1}a_{2} \cdots a_{k} \mid a_{i} \in A_{n}, i = 1, 2, \dots, k\right\} \). Prove that there exists a positive real number \( c \) such that for any integer \( n \geq 2 \), the inequality \( |B_{n}| < c \cdot n^{k} \cdot (\ln n)^{t} \) holds, where \( t = \frac{(k-1)(1 + \ln \ln k - \ln (k-1))}{\ln k} - 1 \).","import Mathlib open Finset Real theorem B (k : ℕ) (hk : 2 ≤ k) : ∃ c > 0, ∀ n ≥ 2, Set.ncard {x | ∃ a : Fin k → ℕ, (∀ i, a i ∈ Icc 1 n) ∧ x = ∏ i, a i} < c * n ^ k * (Real.log n) ^ ((k - 1) * (1 + Real.log (Real.log k) - Real.log (k - 1)) / Real.log k - 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-293088,"**Problem Statement:** Consider a grid with $2022$ rows and $712$ columns, where each cell contains a non-negative integer $a_{i,j} \leq 76$. The entries satisfy the following conditions: 1. **Horizontal Condition:** For every $1 \leq i \leq 2022$ and $1 \leq j \leq 707$, the sum \[ a_{i,j} + 2a_{i,j+1} + 3a_{i,j+2} + 4a_{i,j+3} + 5a_{i,j+4} + 6a_{i,j+5} \] is divisible by $7$. 2. **Vertical Condition:** For every $1 \leq i \leq 2013$ and $1 \leq j \leq 712$, the sum \[ a_{i,j} + 2a_{i+1,j} + 3a_{i+2,j} + \cdots + 10a_{i+9,j} \] is divisible by $11$. 3. **Diagonal Condition (Down-Right):** For every $1 \leq i \leq 2017$ and $1 \leq j \leq 707$, the sum \[ a_{i,j} + 2a_{i+1,j+1} + 3a_{i+2,j+2} + \cdots + 6a_{i+5,j+5} \] is divisible by $7$. 4. **Diagonal Condition (Down-Left):** For every $1 \leq i \leq 2013$ and $10 \leq j \leq 712$, the sum \[ a_{i,j} + 2a_{i+1,j-1} + 3a_{i+2,j-2} + \cdots + 10a_{i+9,j-9} \] is divisible by $11$. Let $S$ denote the set of all valid configurations of the grid satisfying these conditions. Define: - $x$ as the number of configurations in $S$ where $a_{1,1} = a_{680,680}$, - $y$ as the number of configurations in $S$ where $a_{1,1} \neq a_{1003,79}$. **Show that $x \neq y$ and determine the number of positive divisors of $|x - y|$.** *Answer:* $\boxed{6}$","import Mathlib open Finset theorem Problem_658698 {a : ℕ → ℕ → ℕ} (ha : ∀ i j, a i j ≤ 76) (h1 : ∀ i j, 1 ≤ i ∧ i ≤ 2022 → 1 ≤ j ∧ j ≤ 707 → 7 ∣ a i j + 2 * a i (j + 1) + 3 * a i (j + 2) + 4 * a i (j + 3) + 5 * a i (j + 4) + 6 * a i (j + 5)) (h2 : ∀ i j, 1 ≤ i ∧ i ≤ 2013 → 1 ≤ j ∧ j ≤ 712 → 11 ∣ ∑ k ∈ range 10, (k + 1) * a (i + k) j) (h3 : ∀ i j, 1 ≤ i ∧ i ≤ 2017 → 1 ≤ j ∧ j ≤ 707 → 7 ∣ ∑ k ∈ range 6, (k + 1) * a (i + k) (j + k)) (h4 : ∀ i j, 1 ≤ i ∧ i ≤ 2013 → 10 ≤ j ∧ j ≤ 712 → 11 ∣ ∑ k ∈ range 10, (k + 1) * a (i + k) (j - k)) : let x := {p : (ℕ → ℕ → ℕ) | p 1 1 = p 680 680}.ncard let y := {p : (ℕ → ℕ → ℕ) | p 1 1 ≠ p 1003 79}.ncard x ≠ y ∧ (x - y).divisors.card = 6 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/OnlineMathContest, flc-293279,"a) Prove that for every function $f: \mathbb{Q} \times \mathbb{Q} \to \mathbb{R}$, there exists a function $g: \mathbb{Q} \to \mathbb{R}$ such that $f(x, y) \leq g(x) + g(y)$ for all $x, y \in \mathbb{Q}$. b) Prove that the function $f: \mathbb{R} \times \mathbb{R} \to \mathbb{R}$ defined as follows: Let there be a bijection $\varphi: \mathbb{R} \to \{ \{a_n\}_{n = 1}^{\infty} \}$, and for $y \in \mathbb{N}$, $f(x, y)=a_y$ where $\{a_n\}_{n = 1}^{\infty}=\varphi(x)$, and for $y\notin\mathbb{N}$, $f(x,y)$ is any real - number, has the property that there does not exist any function $g: \mathbb{R} \to \mathbb{R}$ such that $f(x, y) \leq g(x) + g(y)$ for all $x, y \in \mathbb{R}$.","import Mathlib theorem prove1 (f : ℚ → ℚ → ℝ) : ∃ g : ℚ → ℝ, ∀ x y, f x y ≤ g x + g y := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-293369,"Let $T$ be a finite set of positive integers, satisfying the following conditions: 1. For any two elements of $T$, their greatest common divisor and their least common multiple are also elements of $T$. 2. For any element $x$ of $T$, there exists an element $x'$ of $T$ such that $x$ and $x'$ are relatively prime, and their least common multiple is the largest number in $T$. For each such set $T$, denote by $s(T)$ its number of elements. It is known that $s(T) < 1990$; find the largest value $s(T)$ may take. prove that answer is 1024","import Mathlib theorem s : IsGreatest {n | ∃ T : Finset ℕ, T.card = n ∧ (∀ x ∈ T, x > 0) ∧ (∀ x ∈ T, ∀ y ∈ T, Nat.gcd x y ∈ T ∧ Nat.lcm x y ∈ T) ∧ (∀ x ∈ T, ∃ x' ∈ T, Nat.Coprime x x' ∧ Nat.lcm x x' = sSup T)} 1024 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DAPO-Math-17k, flc-294117,"Prove that the least number of colours required to colour each of the $n^2$ unit squares in the $xy$-plane, where each square is centered at a point $(i, j)$ with integer coordinates such that $1 \leq i \leq n$ and $1 \leq j \leq n$, and for any $1 \leq i < j \leq n$ and $1 \leq k < l \leq n$, the three squares centered at $(i, k)$, $(j, k)$, and $(j, l)$ have distinct colours, is $2n - 1$.","import Mathlib open Finset theorem prove (n : ℕ) (hn : 0 < n) : IsLeast {k | ∃ f : (Fin n × Fin n) → Fin k, (∀ i j k l : Fin n, (1 ≤ i.1 + 1 ∧ i.1 + 1 ≤ n ∧ 1 ≤ j.1 + 1 ∧ j.1 + 1 ≤ n ∧ 1 ≤ k.1 + 1 ∧ k.1 + 1 ≤ n ∧ 1 ≤ l.1 + 1 ∧ l.1 + 1 ≤ n ∧ i.1 < j.1 ∧ k.1 < l.1) → f ((i, k) : Fin n × Fin n) ≠ f ((j, k) : Fin n × Fin n) ∧ f ((j, k) : Fin n × Fin n) ≠ f ((j, l) : Fin n × Fin n) ∧ f ((j, l) : Fin n × Fin n) ≠ f ((i, k) : Fin n × Fin n))} (2 * n - 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-294910,"**Problem Statement:** A **dazzling triple** is defined as a triple of positive integers \((a, b, c)\) satisfying the following conditions: 1. \(ab\) divides \(c(a^c + b)\), 2. \(a\) does not divide \(c^{10}\), 3. \(a, b, c\) are all positive integers not exceeding \(1000\). Let \(c_{\mathrm{max}}\) denote the maximum possible value of \(c\) in any dazzling triple \((a, b, c)\). **Show that** \(c_{\mathrm{max}} = 768\), and determine the sum of all possible products \(abc\) among all dazzling triples \((a, b, c)\) with \(c = c_{\mathrm{max}}\). **Expected Answer:** The sum is \(119808\). *(Note: The problem combines proof-based reasoning with computational verification, guiding the solver to first establish the maximal \(c\) and then compute the corresponding sum.)*","import Mathlib open Finset theorem max_c : IsGreatest {c : ℕ | ∃ a b : ℕ, a > 0 ∧ b > 0 ∧ c > 0 ∧ a * b ∣ c * (a ^ c + b) ∧ ¬a ∣ c ^ 10 ∧ a ≤ 1000 ∧ b ≤ 1000 ∧ c ≤ 1000} 768 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/OnlineMathContest, flc-295040,"Prove that the maximal constant $C_n$ such that for any partition of the set $\{1, 2, \ldots, 2n\}$ into two $n$-element subsets $A$ and $B$, there exist labellings $a_1, a_2, \ldots, a_n$ of $A$ and $b_1, b_2, \ldots, b_n$ of $B$ satisfying $$ (a_1 - b_1)^2 + (a_2 - b_2)^2 + \ldots + (a_n - b_n)^2 \ge C_n $$ is given by $$ C_n = \begin{cases} \frac{13n^3 - 4n}{12}, & \text{if $n$ is even} \\ \frac{13n^3 - n}{12}, & \text{if $n$ is odd} \end{cases} $$","import Mathlib open Finset Real theorem Prove (n : ℕ) : IsGreatest {C | ∀ A B : Finset ℕ, A ⊆ Icc 1 (2 * n) ∧ B ⊆ Icc 1 (2 * n) ∧ A ∩ B = ∅ ∧ A.card = n ∧ B.card = n → ∃ a b : Fin n → ℕ, (∀ i, a i ∈ A) ∧ (∀ i, b i ∈ B) ∧ (∑ i, (a i - b i) ^ 2) ≥ C} ((if Even n then (13 * n ^ 3 - 4 * n) else (13 * n ^ 3 - n)) / 12) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-295041,"一项考试的可能得分为 $0,1,2, \cdots, 150$ ,有 100 名考生 $P_{1}, P_{2}, \cdots, P_{100}$ 考完后依顺时针围成一圈交流成绩,记 $P_{i}$ 的得分为 $a_{i}$ 。每个考生 $P_{i}$ 比较自己与相邻两人 $P_{i-1}, P_{i+1}$ (下标按模 100 理解) 的得分,定义 $P_{i}$ 的激励值 $f_{i}$ 为: $f_{i}=\begin{cases}a_{i}(a_{i-1}+a_{i+1}-a_{i}),&a_{i}<\min\{a_{i-1},&a_{i+1}\},\\a_{i}(\max\{a_{i-1},a_{i},a_{i+1}\}-a_{i}),&a_{i}\geq\min\{a_{i-1},&a_{i+1}\}.\end{cases}$ 记 $S=f_{1}+f_{2}+\cdots+f_{100}$. (1) 求 $S$ 的最大值; (2) 求使得 $f_{1}, f_{2}, \cdots, f_{100}$ 两两不等的 $S$ 的最大值。请给出这两个最大值的和。 prove that answer is 1147349","import Mathlib open Finset Real theorem max_s : IsGreatest {x | ∃ a : Fin 100 → ℕ, (∀ i, a i ∈ Icc 0 150) ∧ x = ∑ i, if a i < min (a (i - 1)) (a (i + 1)) then a i * (a (i - 1) + a (i + 1) - a i) else a i * (max (a (i - 1)) (max (a i) (a (i + 1))) - a i)} 1147349 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DAPO-Math-17k, flc-295333,"On the $xOy$ plane, there are 2002 points forming a point set $S$. It is known that the line segment connecting any two points in $S$ is not parallel to the coordinate axes. For any two points $P$ and $Q$ in $S$, consider a rectangle $M_{PQ}$ whose diagonal is $PQ$ and whose sides are parallel to the coordinate axes. Let $W_{PQ}$ denote the number of points in $S$ that lie strictly inside the rectangle $M_{PQ}$ (excluding $P$ and $Q$). Determine the maximum value of $N$ such that the following proposition is true: ""No matter how the points in $S$ are distributed on the coordinate plane, there exists at least one pair of points $P$ and $Q$ in $S$ such that $W_{PQ} \geq N$.""","import Mathlib open Real Set open scoped BigOperators theorem max_n : IsGreatest {n : ℕ | ∃ S : Finset (ℝ × ℝ), S.card = 2002 ∧ ∀ P ∈ S, ∀ Q ∈ S, ¬(P.1 = Q.1 ∨ P.2 = Q.2) → ∃ R : Finset (ℝ × ℝ), R ⊆ S ∧ R.card ≥ n ∧ (∀ x y : ℝ, (x, y) ∈ R → x > P.1 ∧ x < Q.1 ∧ y > P.2 ∧ y < Q.2)} 1985 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/BlueMO, flc-295442,"Let $S = \{a_1, a_2, \cdots, a_n\}$ be a set consisting of positive integers, and define \begin{equation} T = \left\{ \sum_{i=1}^{n} a_i^{e_i} \mid e_1, e_2, \cdots, e_n \geq 0 \right\}. \end{equation} Prove that there exists a positive integer $N$ (depending only on $n$) such that $T$ does not contain an arithmetic progression of length $N$.","import Mathlib open Finset theorem Finset.T {n : ℕ} (hn : 0 < n) (a : Fin n → ℕ) (ha : ∀ i, 0 < a i) : ∃ N, 0 < N ∧ ∀ T : Set ℕ, T = {x | ∃ e : Fin n → ℕ, x = ∑ i, (a i) ^ (e i)} → ¬∃ d, ∀ i ∈ Icc 1 N, ∃ j, j ∈ T ∧ j = i * d := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-295453,"Let \( A \subset \mathbb{N}^* \) be an infinite set, where each number \( a \) in \( A \) is the product of at most 1990 prime numbers. Prove: There must exist an infinite subset \( B \) of \( A \), such that the greatest common divisor (gcd) of any two distinct numbers in \( B \) is the same.","import Mathlib theorem InfiniteA (A : Set ℕ) (hA : ∀ a ∈ A, ∃ s : Finset ℕ, s.card ≤ 1990 ∧ (∀ p ∈ s, Nat.Prime p) ∧ a = ∏ p ∈ s, p) : ∃ B ⊆ A, Infinite B ∧ ∃ k, ∀ x ∈ B, ∀ y ∈ B, x ≠ y → Nat.gcd x y = k := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/BlueMO, flc-295897,"**Prove that** the maximum number of distinct cells that can be selected from a $9 \times 9$ grid—where the cell in the $i$-th row and $j$-th column contains the integer $i \times j$—such that the sum of the selected entries is a perfect cube, is **76**. *Alternatively, phrased as an optimization problem:* **Determine** the largest positive integer $n$ for which there exists a selection of $n$ distinct cells from a $9 \times 9$ multiplication table (with entry $(i,j)$ equal to $i \cdot j$) whose sum is a perfect cube. **Prove** that this maximum value is $76$.","import Mathlib open Finset theorem max_n : IsGreatest {n | ∃ s : Finset (Fin 9 × Fin 9), s.card = n ∧ ∃ k : ℕ, ∑ i ∈ s, (i.1 + 1) * (i.2 + 1) = k^3} 76 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/OnlineMathContest, flc-295929,"设 (a_1,b_1),(a_2,b_2),\cdots,(a_{100},b_{100}) 是不同的非负整数对. 用 N 表示满足 1\leq i 0 ∧ q > 0 ∧ r > 0) (h : ∀ N : ℕ, ∃ n : ℕ, n > N ∧ ⌊p * n⌋ + ⌊q * n⌋ + ⌊r * n⌋ = n) : ∃ q1 q2 q3 : ℚ, p = q1 ∧ q = q2 ∧ r = q3 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-296412,"Let $n > 2018$ be an integer. Suppose there are subsets $A_1, A_2, \ldots, A_n$ of the set $\{1, 2, \ldots, n\}$ such that: 1. \(|A_k| = 2018\) for all \(k \in \{1, 2, \ldots, n\}\), 2. \(|A_i \cap A_j|\) is divisible by 3 for all \(0 < i < j < n + 1\). Prove that \(n\) is an even integer.","import Mathlib theorem EvenN (n : ℕ) (hn : n > 2018) (A : Finset.Icc 1 n → Finset ℕ) (hA : ∀ k, A k ⊆ Finset.Icc 1 n) (hA' : ∀ k, (A k).card = 2018) (hA'' : ∀ i j, i ≠ j → 3 ∣ (A i ∩ A j).card) : Even n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-296794,"(a) Prove that if there are three groups of mathematicians \(A\), \(B\), and \(C\) such that meetings are organized with each meeting involving exactly three mathematicians (one from each group) and every pair of mathematicians from different groups participates in exactly one meeting together, then \(|A| = |B| = |C|\). (b) Prove that if \(|A|=|B| = |C|=3\), then it is possible to organize meetings such that each meeting involves exactly three mathematicians (one from each group) and every pair of mathematicians from different groups participates in exactly one meeting together. (c) Prove that if \(|A| = |B| = |C|=n\) (where \(n\) is a positive integer), then it is possible to organize meetings such that each meeting involves exactly three mathematicians (one from each group) and every pair of mathematicians from different groups participates in exactly one meeting together.","import Mathlib theorem group_size {A B C : Finset ℕ} (hA : A.card > 0) (hB : B.card > 0) (hC : C.card > 0) (h1 : ∀ x ∈ A, ∀ y ∈ B, ∃! z ∈ C, x ≠ y ∧ y ≠ z ∧ z ≠ x) (h2 : ∀ x ∈ A, ∀ y ∈ C, ∃! z ∈ B, x ≠ y ∧ y ≠ z ∧ z ≠ x) (h3 : ∀ x ∈ B, ∀ y ∈ C, ∃! z ∈ A, x ≠ y ∧ y ≠ z ∧ z ≠ x) : A.card = B.card ∧ B.card = C.card := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-296842,"Determine the largest positive integer $n$ for which there exist pairwise different sets $\mathbb{S}_1 , \ldots, \mathbb{S}_n$ with the following properties: 1. $|\mathbb{S}_i \cup \mathbb{S}_j| \leq 2004$ for any two indices $1 \leq i, j \leq n$. 2. $\mathbb{S}_i \cup \mathbb{S}_j \cup \mathbb{S}_k = \{ 1, 2, \ldots, 2008 \}$ for any $1 \leq i < j < k \leq n$. prove that answer is 32","import Mathlib theorem max_n : IsGreatest {n | ∃ S : Finset (Finset ℕ), S.card = n ∧ ∀ x ∈ S, x ≠ ∅ ∧ (∀ i ∈ S, ∀ j ∈ S, i ≠ j → (i ∪ j).card ≤ 2004) ∧ (∀ i ∈ S, ∀ j ∈ S, ∀ k ∈ S, i ≠ j ∧ i ≠ k ∧ j ≠ k → (i ∪ j ∪ k) = Finset.Icc 1 2008)} 32 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DAPO-Math-17k, flc-297295,"Determine the cardinality of the set $X$, where $X$ is the set of all relations $R$ over $\mathbb{N}$ such that the transitive closure $R^{*}$ equals $\mathbb{N} \times \mathbb{N}$. What is the cardinality of $X$? Prove that the answer is 2^{\aleph_0}.","import Mathlib open Set Real open scoped BigOperators theorem card {X : Set (Set (ℕ × ℕ))} (hX : ∀ R ∈ X, closure R = (univ : Set (ℕ × ℕ))) : X.encard = 2 ^ ω := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-297893,"Prove that the number of sets of non - negative integer solutions \((x_{1}, y_{1}, z_{1}), (x_{2}, y_{2}, z_{2}), (x_{3}, y_{3}, z_{3})\) that satisfy the following system of inequalities and equations: \[ \begin{cases} x_{1} + x_{2} + x_{3} \leq 11 \\ y_{1} + y_{2} + y_{3} \leq 13 \\ z_{1} + z_{2} + z_{3} \leq 15 \\ x_{1} + y_{1} + z_{1} = 8 \\ x_{2} + y_{2} + z_{2} = 8 \\ x_{3} + y_{3} + z_{3} = 8 \end{cases} \] is \(63497\).","import Mathlib theorem count : {(x₁, x₂, x₃, y₁, y₂, y₃, z₁, z₂, z₃) : ℤ × ℤ × ℤ × ℤ × ℤ × ℤ × ℤ × ℤ × ℤ | 0 ≤ x₁ ∧ 0 ≤ x₂ ∧ 0 ≤ x₃ ∧ 0 ≤ y₁ ∧ 0 ≤ y₂ ∧ 0 ≤ y₃ ∧ 0 ≤ z₁ ∧ 0 ≤ z₂ ∧ 0 ≤ z₃ ∧ x₁ + x₂ + x₃ ≤ 11 ∧ y₁ + y₂ + y₃ ≤ 13 ∧ z₁ + z₂ + z₃ ≤ 15 ∧ x₁ + y₁ + z₁ = 8 ∧ x₂ + y₂ + z₂ = 8 ∧ x₃ + y₃ + z₃ = 8}.ncard = 63497 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-298952,"Prove that if each of the natural numbers is colored with one of \(k\) colors, then there exist four distinct numbers \(a, b, c, d\) such that \(a, b, c, d\) are all of the same color, \(ad = bc\), \(\frac{b}{a} = 2^x\), and \(\frac{c}{a} = 3^y\), where \(x\) and \(y\) are non - negative integers.","import Mathlib theorem Finset.card_eq_k (k : ℕ) (f : ℕ → Fin k) : ∃ a b c d x y : ℕ, a ≠ b ∧ a ≠ c ∧ a ≠ d ∧ b ≠ c ∧ b ≠ d ∧ c ≠ d ∧ f a = f b ∧ f a = f c ∧ f a = f d ∧ f b = f c ∧ f b = f d ∧ f c = f d ∧ a * d = b * c ∧ (b / a : ℚ) = 2 ^ x ∧ (c / a : ℚ) = 3 ^ y := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-299077,"Prove that for any positive integer $n$ and any set $S$ of $2n - 1$ distinct irrational numbers, there exists a subset $\{x_1, x_2, \ldots, x_n\}$ of $S$ such that for any non - negative rational numbers $a_i$ with $\sum_{i = 1}^{n}a_i>0$, the sum $\sum_{i = 1}^{n}a_ix_i$ is irrational.","import Mathlib theorem IrrationalSum (n : ℕ) (hn : 0 < n) (S : Finset ℝ) (hS : S.card = 2 * n - 1) (hS1 : ∀ x ∈ S, Irrational x) : ∃ T ⊆ S, T.card = n ∧ ∀ a : Fin n → ℚ, (∀ i, 0 ≤ a i) ∧ ∑ i, a i > 0 → Irrational (∑ i, a i * (T.sort LE.le)[i]!) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-299531,"Prove that the minimum possible number of distinct pictures across a set of 55 cards, where each card contains 8 distinct pictures and any two cards share exactly one picture, is \(36\).","import Mathlib theorem min_pictures (S : Finset (Finset ℕ)) (hS : S.card = 55) (hS1 : ∀ x ∈ S, x.card = 8) (hS2 : ∀ x ∈ S, ∀ y ∈ S, x ≠ y → (x ∩ y).card = 1) : IsLeast {x | ∃ S : Finset (Finset ℕ), S.card = 55 ∧ (∀ x ∈ S, x.card = 8) ∧ (∀ x ∈ S, ∀ y ∈ S, x ≠ y → (x ∩ y).card = 1) ∧ x = {z | ∃ x ∈ S, z ∈ x}.ncard} 36 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-299654,"Let $\begin{array}{cccc}a_{1,1}& a_{1,2}& a_{1,3}& \dots \\ a_{2,1}& a_{2,2}& a_{2,3}& \dots \\ a_{3,1}& a_{3,2}& a_{3,3}& \dots \\ \vdots & \vdots & \vdots & \ddots \end{array}$ be a doubly infinite array of positive integers, where each positive integer appears exactly eight times in the array. Prove that there exists a pair of positive integers $(k,l)$ such that $a_{k,l} > k \cdot l$.","import Mathlib theorem double_infiniteArray (a : ℕ → ℕ → ℕ) (ha : ∀ i j, 0 < a i j) (hij : ∀ n, ∃ k l, a k l = n ∧ k > 0 ∧ l > 0) (h : ∀ n, {p : ℕ × ℕ | p.1 > 0 ∧ p.2 > 0 ∧ a p.1 p.2 = n}.encard = 8) : ∃ k l, 0 < k ∧ 0 < l ∧ a k l > k * l := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-299861,"(a) Prove that every [i]admissible[/i] set in $\mathbb{Z}^2$ contains a [i]null[/i] set. (b) Prove that the set \(A\) obtained by taking the set \(A' := \{(i, j, k) \in \mathbb{Z}^3 : i, j, k \in \{0, 1, 2\}\}\) and removing the points \((0,0,0)\), \((2,2,2)\), \((2,1,0)\), \((2,0,1)\), \((1,2,1)\), \((1,0,2)\), \((0,1,2)\) is an [i]admissible[/i] set in $\mathbb{Z}^3$ that does not contain any [i]null[/i] subset.","import Mathlib open Finset theorem prove_a : ∀ S : Set (ℤ × ℤ), (∀ x y : ℤ, (x, y) ∈ S → x ≥ 0 ∧ y ≥ 0) → ∃ T ⊆ S, (∀ x y : ℤ, (x, y) ∈ T → x = 0 ∨ y = 0) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-299905,"For $n \in \mathbb{N}$, let $P(n)$ denote the product of the digits in $n$ and $S(n)$ denote the sum of the digits in $n$. Consider the set \(A=\{n \in \mathbb{N}: P(n)\) is non-zero, square-free, and \(S(n)\) is a proper divisor of \(P(n)\}\). Find the maximum possible number of digits of the numbers in \(A\). prove that answer is 92","import Mathlib open Nat def P : ℕ → ℕ | n => (Nat.digits 10 n).prod def S : ℕ → ℕ | n => (Nat.digits 10 n).sum theorem maxDigits {A : Set ℕ} (hA : ∀ n ∈ A, P n ≠ 0 ∧ Squarefree n ∧ S n ∣ P n ∧ ¬(S n = P n)) : IsGreatest {k | ∃ n ∈ A, k = (Nat.digits 10 n).length} 92 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DAPO-Math-17k, flc-300502,"For an integer $n \geq 2$, let $S_1, S_2, \cdots, S_{2^n}$ be $2^n$ subsets of the set $A = \{1,2,3,\cdots,2^{n+1}\}$, satisfying: there do not exist indices $a < b$ and elements $x,y,z \in A$ (with $x < y < z$) such that $y,z \in S_a$ and $x,z \in S_b$. Prove that at least one of the subsets $S_1, S_2, \cdots, S_{2^n}$ contains no more than $4n$ elements.","import Mathlib theorem prove (n : ℕ) (hn : 2 ≤ n) (S : Finset.Icc 1 (2 ^ n) → Set ℕ) (hS : ∀ a b : Finset.Icc 1 (2 ^ n), a < b → ¬∃ x y z : ℕ, x ∈ Finset.Icc 1 (2 ^ (n + 1)) ∧ y ∈ Finset.Icc 1 (2 ^ (n + 1)) ∧ z ∈ Finset.Icc 1 (2 ^ (n + 1)) ∧ x < y ∧ y < z ∧ y ∈ S a ∧ z ∈ S a ∧ x ∈ S b ∧ z ∈ S b) : ∃ i : Finset.Icc 1 (2 ^ n), S i ⊆ Finset.Icc 1 (2 ^ (n + 1)) ∧ (S i).ncard ≤ 4 * n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-300675,"Prove that for an infinite sequence \(a_1, a_2, \dots\) of positive integers such that \(a_1 = 1\) and for all positive integers \(k\) and \(n\), \(a_n \mid a_k + a_{k+1} + \dots + a_{k+n-1}\), the maximum possible value of \(a_{2m}\) for a given positive integer \(m\) is \(2^m - 1\).","import Mathlib theorem Prove( a : ℕ → ℕ ) (h1: ∀ k, 0 < a k ) (h2: a 1 = 1 ) (h3: ∀ k n, a n ∣ ∑ i ∈ Finset.range n, a (k + i)) : (∀ m, 0 < m → a (2*m) ≤ 2^m - 1 ) ∧ (∃ a' : ℕ → ℕ, (∀ k, 0 < a' k ) ∧ a' 1 = 1 ∧ ∀ k n, a' n ∣ ∑ i ∈ Finset.range n, a' (k + i) ∧ a' (2*m) = 2^m - 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-301160,"Consider a \(16\times16\) matrix filled with entries of \(1\) or \(-1\). If the sum of the entries in any two different rows is at most \(0\), prove that the maximum number of entries that are \(+1\) is \(160\).","import Mathlib open Matrix Finset theorem max {A : Matrix (Fin 16) (Fin 16) ℤ} (hA : ∀ i j, A i j = 1 ∨ A i j = -1) (hA' : ∀ i j, i ≠ j → ∑ k : Fin 16, A i k + ∑ l : Fin 16, A j l ≤ 0) : IsGreatest {x | ∃ s : Finset (Fin 16 × Fin 16), (∀ i j, (i, j) ∈ s → A i j = 1) ∧ x = s.card} 160 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-302017,"Consider a collection of 12 sets, each containing 8 elements. Every pair of sets shares 6 elements, any collection of 3 sets shares 4 elements, and no collection of 4 sets shares any elements. Determine the total number of distinct elements in this collection. Prove that the answer is 580.","import Mathlib theorem total_distinct (S : Finset (Finset ℝ)) (hS : S.card = 12) (hS1 : ∀ T ∈ S, T.card = 8) (hS2 : ∀ T ∈ S, ∀ U ∈ S, T ≠ U → (T ∩ U).card = 6) (hS3 : ∀ T ∈ S, ∀ U ∈ S, ∀ V ∈ S, T ≠ U ∧ T ≠ V ∧ U ≠ V → (T ∩ U ∩ V).card = 4) (hS4 : ∀ T ∈ S, ∀ U ∈ S, ∀ V ∈ S, ∀ W ∈ S, T ≠ U ∧ T ≠ V ∧ T ≠ W ∧ U ≠ V ∧ U ≠ W ∧ V ≠ W → (T ∩ U ∩ V ∩ W).card = 0) : (S.card * 8 - 6 * (S.card * (S.card - 1)) / 2 + 4 * (S.card * (S.card - 1) * (S.card - 2)) / 6) = 580 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-302109,"Prove that if $n$ is a positive integer and $\mathcal{C}$ is a collection of subsets of $\{1, 2, \ldots, 2^n\}$ such that every $(2^n - 1)$ - element subset of $\{1, 2, \ldots, 2^n\}$ is a member of $\mathcal{C}$ and every non - empty member $C$ of $\mathcal{C}$ contains an element $c$ such that $C \setminus \{c\}$ is again a member of $\mathcal{C}$, then the smallest size of $\mathcal{C}$ is $n \cdot 2^n + 1$.","import Mathlib theorem Prove (n : ℕ) (hn : 0 < n) (C : Finset (Finset (Fin (2 ^ n)))) (hC : ∀ S ⊆ Finset.Icc 1 (2 ^ n), S.card = 2 ^ n - 1 → S ∈ C) (hC' : ∀ C' ∈ C, C'.Nonempty → ∃ c ∈ C', C' \ {c} ∈ C) : IsLeast {x | ∃ C : Finset (Finset (Fin (2 ^ n))), C.card = x ∧ (∀ S ⊆ Finset.Icc 1 (2 ^ n), S.card = 2 ^ n - 1 → S ∈ C) ∧ (∀ C' ∈ C, C'.Nonempty → ∃ c ∈ C', C' \ {c} ∈ C)} (n * 2 ^ n + 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-302325,"Is it possible to color the natural numbers using 2009 colors such that each color appears infinitely often, and there is no triple of numbers, each colored differently, where the product of two equals the third? Prove that the answer is Yes.","import Mathlib theorem color_nat : ∃ f : ℕ → Fin 2009, (∀ c, Set.Infinite {n | f n = c}) ∧ (∀ m n p, m ≠ n ∧ m ≠ p ∧ n ≠ p → f m ≠ f n ∧ f m ≠ f p ∧ f n ≠ f p → ¬(m * n = p)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-302718,Let \(n\) points (\(n \geq 4\)) be given such that the distance between any two points is an integer. Prove that the minimum proportion of distances that are multiples of 3 is \(\frac{1}{6}\).,"import Mathlib open Real open scoped BigOperators theorem dist_points (n : ℕ) (hn : n ≥ 4) (a : Fin n → EuclideanSpace ℝ (Fin 2)) (ha : ∀ i j, ∃ k : ℤ, dist (a i) (a j) = k) : IsLeast {x | ∃ s : Finset (Fin n × Fin n), x = (s.card / (n * (n - 1))) ∧ (∀ i ∈ s, 3 ∣ dist (a i.1) (a i.2))} (1 / 6) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-303794,"For a positive integer $n$, an $n$-branch $B$ is an ordered tuple $(S_1, S_2, \dots, S_m)$ of nonempty sets (where $m$ is any positive integer) satisfying $S_1 \subset S_2 \subset \dots \subset S_m \subseteq \{1,2,\dots,n\}$. An integer $x$ is said to appear in $B$ if it is an element of the last set $S_m$. Define an $n$-plant to be an (unordered) set of $n$-branches $\{ B_1, B_2, \dots, B_k\}$, and call it perfect if each of $1$, $2$, \dots, $n$ appears in exactly one of its branches. Let $T_n$ be the number of distinct perfect $n$-plants (where $T_0=1$), and suppose that for some positive real number $x$ we have the convergence \[ \ln \left( \sum_{n \ge 0} T_n \cdot \frac{\left( \ln x \right)^n}{n!} \right) = \frac{6}{29}. \] If $x = \frac{m}{n}$ for relatively prime positive integers $m$ and $n$, compute $m+n$. prove that answer is 76","import Mathlib open Real Filter Function open scoped BigOperators Topology theorem log_convergence {T : ℕ → ℕ} (hT : ∀ n, T n > 0) (hT0 : T 0 = 1) (x : ℝ) (hx : x > 0) (h : log (∑' n, T n * (log x)^n / Nat.factorial n) = 6 / 29) : ∃ m n : ℕ, m > 0 ∧ n > 0 ∧ m.Coprime n ∧ x = m / n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DAPO-Math-17k, flc-303896,"Let \(S\) be a set with \(2002\) elements, and let \(N\) be an integer such that \(0 \leq N \leq 2^{2002}\). Prove that it is possible to color every subset of \(S\) either black or white so that the following conditions are satisfied: (a) The union of any two white subsets is white. (b) The union of any two black subsets is black. (c) There are exactly \(N\) white subsets.","import Mathlib open Finset theorem prove_coloring {S : Type*} [Fintype S] (hS : Fintype.card S = 2002) (N : ℕ) (hN : N ∈ Icc 0 (2^2002)) : ∃ f : Set S → Fin 2, (∀ s1 s2 : Set S, f s1 = 1 → f s2 = 1 → f (s1 ∪ s2) = 1) ∧ (∀ s1 s2 : Set S, f s1 = 0 → f s2 = 0 → f (s1 ∪ s2) = 0) ∧ {x | f x = 1}.encard = N := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-303965,"Given positive integers \(n_1 < n_2 < \ldots < n_{2000} < 10^{100}\), prove that it is possible to select from the set \(\{n_1, n_2, \ldots, n_{2000}\}\) two nonempty, disjoint subsets \(A\) and \(B\) such that \(A\) and \(B\) have the same number of elements, the same sum, and the same sum of squares.","import Mathlib theorem qwen (n : Fin 2000 → ℕ) (hn : StrictMono n) (hpos : ∀ i, 0 < n i) (hbound : ∀ i, n i < 10 ^ 100) : ∃ A B : Finset (Fin 2000), A ≠ ∅ ∧ B ≠ ∅ ∧ A ∩ B = ∅ ∧ A.card = B.card ∧ ∑ i ∈ A, n i = ∑ i ∈ B, n i ∧ ∑ i ∈ A, (n i) ^ 2 = ∑ i ∈ B, (n i) ^ 2 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-303989,"Prove that the only infinite sequence \(a_1, a_2, \ldots\) of positive integers that satisfies the following conditions: 1. The sequence is strictly increasing, i.e., \(a_1 < a_2 < a_3 < \cdots\). 2. There are no positive integers \(i\), \(j\), and \(k\) (not necessarily distinct) such that \(a_i + a_j = a_k\). 3. There are infinitely many indices \(k\) for which \(a_k = 2k - 1\). is the sequence \(a_i = 2i - 1\) for all integers \(i\).","import Mathlib theorem prove (a : ℕ → ℕ) (ha : ∀ n, 0 < a n) (hinc : StrictMono a) (hnij : ¬∃ i j k, 0 < i ∧ 0 < j ∧ 0 < k ∧ a i + a j = a k) (h2k : ∀ n, ∃ m, a m = 2 * m - 1 ∧ m > n) : ∀ n, a n = 2 * n - 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-304002,"Prove that the only infinite sequence \(a_1, a_2, \ldots\) of positive integers that satisfies the following conditions: 1. The sequence is strictly increasing, i.e., \(a_1 < a_2 < a_3 < \cdots\). 2. There are no positive integers \(i\), \(j\), and \(k\) (not necessarily distinct) such that \(a_i + a_j = a_k\). 3. There are infinitely many indices \(k\) for which \(a_k = 2k - 1\). is the sequence \(a_i = 2i - 1\) for all positive integers \(i\).","import Mathlib theorem prove (a : ℕ → ℤ) (ha : ∀ n, 0 < a n) (hinc : StrictMono a) (hnij : ¬∃ i j k, 0 < i ∧ 0 < j ∧ 0 < k ∧ a i + a j = a k) (hodd : {n | a n = 2 * n - 1}.Infinite) : ∀ n, a n = 2 * n - 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-304258,"Determine the number of distinct countable subsets that can be formed from the set of real numbers \( \mathbb{R} \). Prove that the answer is 2^{\aleph_0}.","import Mathlib open Set Real theorem number_of_countable_set : {S : Set ℝ | Countable S}.ncard = 2 ^ (Nat.card ℕ) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-304332,"In the Oldenburger-Kolakoski sequence, does the number of 1s equal the number of 2s infinitely many times? The Oldenburger-Kolakoski sequence, $OK$, is the unique sequence of $1$s and $2$s that starts with $1$ and is its own runlength sequence: $$OK = (1,2,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,2,1,2,1,1,\ldots).$$ For $n \geq 1$, let $a(n)$ be the number of indices $h \leq n$ such that $OK(h) =1$, and let $b(n)$ be the number of $h \leq n$ such that $OK(h) = 2.$ Determine if $a(n) = b(n)$ for infinitely many $n$. For example, the first ten runs are $1,22,11,2,1,22,1,22,11,2$, and the lengths of these runs are $1,2,2,1,1,2,1,2,2,1$. In the OEIS, the sequence is A000002. Prove that the answer is Yes.","import Mathlib def OK : ℕ → ℕ | 0 => 1 | 1 => 2 | n + 2 => if Even n then 1 else 2 theorem A000002 : ∀ N, ∃ n, n > N ∧ {h | h ≤ n ∧ OK h = 1}.encard = {h | h ≤ n ∧ OK h = 2}.encard := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-304676,"Prove that there exists a set of $2002$ distinct positive integers such that the sum of any subset of these integers is never a perfect square, cube, or any higher power.","import Mathlib theorem exist_set : ∃ s : Finset ℕ, s.card = 2002 ∧ (∀ i ∈ s, i > 0) ∧ (∀ t ⊆ s, ¬ IsSquare (∑ i ∈ t, i)) ∧ (∀ t ⊆ s, ¬ ∃ n, n^3 = ∑ i ∈ t, i) ∧ ∀ k ≥ 4, ∀ t ⊆ s, ¬ ∃ n, n^k = ∑ i ∈ t, i := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-306255,"Let $X = \{1, 2, \ldots, 2^{1996} - 1\}$. Prove that there exists a subset $A \subseteq X$ such that: 1. $1 \in A$ and $2^{1996} - 1 \in A$; 2. Every element of $A$ except $1$ is the sum of two (possibly equal) elements from $A$; 3. The maximum number of elements in $A$ is $2010$.","import Mathlib open Finset theorem prove : ∃ A : Finset ℕ, A ⊆ Icc 1 (2^1996 - 1) ∧ 1 ∈ A ∧ (2^1996 - 1) ∈ A ∧ ∀ x ∈ A \ {1}, ∃ a b, a ∈ A ∧ b ∈ A ∧ x = a + b ∧ A.card ≤ 2010 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-306333,"Prove that a pair $(a, b)$ of positive integers has the property that, for any coloring of the positive integers using two colors A and B, there always exist two positive integers of color A whose difference is $a$ or two positive integers of color B whose difference is $b$ if and only if the largest power of 2 dividing $a$ is different from the largest power of 2 dividing $b$.","import Mathlib theorem Prove (a b : ℕ) (_ : 0 < a) (hb : 0 < b) : (∀ f : ℕ → Fin 2, ∃ i j, i ≠ j ∧ f i = 0 ∧ f j = 0 ∧ |(i : ℤ) - j| = a ∨ ∃ i j, i ≠ j ∧ f i = 1 ∧ f j = 1 ∧ |(i : ℤ) - j| = b) ↔ Nat.factorization a 2 ≠ Nat.factorization b 2 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-306846,"Find the smallest number $n$ such that any set of $n$ points in a Cartesian plane, all of them with integer coordinates, contains two points such that the square of their mutual distance is a multiple of $2016$. prove that answer is 14113","import Mathlib theorem determine : IsLeast { n | ∀ s : Finset (ℤ × ℤ), s.card = n → ∃ p ∈ s, ∃ q ∈ s, p ≠ q ∧ 2016 ∣ ((p.1 - q.1)^2 + (p.2 - q.2)^2) } 14113 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DAPO-Math-17k, flc-307124,"Prove that the largest possible number of subsets of \(\{1, 2, \ldots, 2n\}\), each containing exactly \(n\) elements, such that the intersection of any three distinct subsets has at most one element, is \(8\).","import Mathlib theorem max_num_of_subsets (n : ℕ) : IsGreatest {k | ∃ s : Finset (Finset ℕ), s.card = k ∧ (∀ t ∈ s, t ⊆ Finset.Icc 1 (2 * n)) ∧ (∀ t ∈ s, t.card = n) ∧ (∀ x ∈ s, ∀ y ∈ s, ∀ z ∈ s, x ≠ y ∧ y ≠ z ∧ z ≠ x → (x ∩ y ∩ z).card ≤ 1)} 8 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-307457,Prove that there exists an infinite sequence of positive integers $\{a_n\}_{n = 1}^{\infty}$ that contains every positive integer exactly once and is such that the number $a_n + a_{n+1}$ is a perfect square for every $n$.,"import Mathlib theorem exists_sequence : ∃ a : ℕ → ℤ, (∀ n, 0 < a n) ∧ (∀ m, 0 < m → ∃! n, a n = m) ∧ ∀ n, IsSquare (a n + a (n + 1)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-308362,"For each positive integer $n$, let $f(n)$ be the number of ways to make $n!$ cents using an unordered collection of coins, each worth $k!$ cents for some $1\leq k\leq n$. Prove that for some constant $C$, independent of $n$, \begin{equation} n^{\frac{n^2}{2}-Cn}e^{-\frac{n^2}{4}}\leq f(n)\leq n^{\frac{n^2}{2}+Cn}e^{-\frac{n^2}{4}}. \end{equation} ```","import Mathlib open Real theorem exp (n : ℕ) (hn : n > 0) : ∃ C : ℝ, ∀ n : ℕ, n > 0 → n ^ ((n ^ 2 / 2 - C * n)) * exp (-n ^ 2 / 4) ≤ {s : Finset ℕ | s.card > 0 ∧ ∑ k ∈ s, Nat.factorial k = Nat.factorial n}.ncard ∧ {s : Finset ℕ | s.card > 0 ∧ ∑ k ∈ s, Nat.factorial k = Nat.factorial n}.ncard ≤ n ^ ((n ^ 2 / 2 + C * n)) * exp (-n ^ 2 / 4) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-308379,"\section*{5th Metropolises Mathematical Olympiad, 2020} Day 2 Let $n \geq 2$ be an integer. A mint needs to produce a set of coins with $n$ denominations, where each denomination is a positive integer and there is an unlimited supply of coins for each denomination. A set of denominations $\{a_{1}, a_{2}, \cdots, a_{n}\}$ is called ""lucky"" if the sum $a_{1} + a_{2} + \cdots + a_{n}$ can be obtained in exactly one way, i.e., by using exactly one coin of each denomination. Prove that: (1) There exists a lucky set of denominations $a_{1}, a_{2}, \cdots, a_{n}$ such that $a_{1} + a_{2} + \cdots + a_{n} < n \cdot 2^{n}$; (2) For any lucky set of denominations $a_{1}, a_{2}, \cdots, a_{n}$, the sum satisfies $a_{1} + a_{2} + \cdots + a_{n} > n \cdot 2^{n-1}$.","import Mathlib open Finset theorem lucky (n : ℕ) (hn : 2 ≤ n) : (∃ a : Fin n → ℕ, (∀ i, 0 < a i) ∧ (∑ i, a i) < n * 2 ^ n ∧ (∀ s : Finset (Fin n), ∑ i ∈ s, a i = ∑ i, a i → s = ⊤)) ∧ (∀ a : Fin n → ℕ, (∀ i, 0 < a i) ∧ (∑ i, a i) > n * 2 ^ (n - 1) ∧ (∀ s : Finset (Fin n), ∑ i ∈ s, a i = ∑ i, a i → s = ⊤)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-308902,"Let integer $n \geq 2$, and let $S$ be a subset of the set of integer pairs $(a, b)$ satisfying $1 \leq a < b \leq 2^n$. Prove that if $|S| > n \cdot 2^{n+1}$, then there exist four integers $a < b < c < d$ such that $(a, c), (b, d), (a, d)$ are all in $S$.","import Mathlib theorem qwen (n : ℕ) (hn : 2 ≤ n) (S : Set (ℤ × ℤ)) (hS : ∀ a ∈ S, 1 ≤ a.1 ∧ a.1 < a.2 ∧ a.2 ≤ 2 ^ n) (hS1 : S.ncard > n * 2 ^ (n + 1)) : ∃ a b c d : ℤ, a < b ∧ b < c ∧ c < d ∧ (a, c) ∈ S ∧ (b, d) ∈ S ∧ (a, d) ∈ S := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-309440,"Determine whether there exists an uncountable set \( S \) of subsets of the natural numbers such that for any two distinct subsets \( A, B \in S \), either \( A \subset B \) or \( B \subset A \). Prove that the answer is Yes.","import Mathlib theorem exist : ∃ S : Set (Set ℕ), ¬ Countable S ∧ ∀ A ∈ S, ∀ B ∈ S, A ≠ B → (A ⊆ B ∨ B ⊆ A) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-309590,"\section*{2004 China National Team Selection Test} \subsubsection{First Day} For an integer $n \geq 2$, the largest element in the set $\{p^\alpha \mid p \text{ is a prime}, \alpha \text{ is a positive integer}, p^\alpha \mid n\}$ is called the largest prime power divisor of $n$. Let $n_1, n_2, \cdots, n_{10000}$ be 10000 distinct positive integers such that the largest prime power divisors of $n_1, n_2, \cdots, n_{10000}$ are all the same. Prove that there exist integers $a_1, a_2, \cdots, a_{10000}$ such that the 10000 arithmetic progressions $a_i, a_i + n_i, a_i + 2n_i, \cdots$ ($1 \leq i \leq 10000$) are pairwise disjoint.","import Mathlib theorem test (n : Fin 10000 → ℕ) (hn : ∀ i j, n i = n j → i = j) (hnp : ∀ i, n i > 0) (h : ∃ k, ∀ i, IsGreatest {x | ∃ p α, Nat.Prime p ∧ α > 0 ∧ x = p ^ α ∧ x ∣ n i} k) : ∃ a : Fin 10000 → ℤ, ∀ i j, i ≠ j → Disjoint {x | ∃ m, x = a i + m * n i} {x | ∃ p, x = a j + p * n j} := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-309675,"Let \(n_1 < n_2 < \ldots < n_{2000} < 10^{100}\). Prove that there exist two nonempty disjoint subsets \(A\) and \(B\) of \(\{n_1, n_2, \ldots, n_{2000}\}\) such that \(|A| = |B|\), \(\sum_{x \in A} x=\sum_{x \in B} x\), and \(\sum_{x \in A} x^2=\sum_{x \in B} x^2\).","import Mathlib theorem qwen (n : Fin 2000 → ℕ) (hn : ∀ i j, i < j → n i < n j) (h : ∀ i, n i < 10 ^ 100) : ∃ A B : Finset (Fin 2000), A ≠ ∅ ∧ B ≠ ∅ ∧ A ∩ B = ∅ ∧ A.card = B.card ∧ ∑ i ∈ A, n i = ∑ i ∈ B, n i ∧ ∑ i ∈ A, (n i)^2 = ∑ i ∈ B, (n i)^2 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-310085,"Prove that the largest integer $k$ such that the polynomial $P_{2014}(x)$ in the infinite sequence of polynomials $P_0(x), P_1(x), P_2(x), \ldots, P_n(x), \ldots$ defined by \(P_0(x) = x\) and \(P_n(x) = P_{n - 1}(x - 1) \cdot P_{n - 1}(x + 1)\) for \(n \ge 1\) is divisible by \(x^k\) is \(\binom{2014}{1007}\).","import Mathlib open Finset theorem prove_part2 : IsGreatest {k | ∀ P : ℕ → Polynomial ℝ, (P 0 = Polynomial.X ∧ ∀ n ≥ 1, P n = (P (n - 1)).comp (Polynomial.X - 1) * (P (n - 1)).comp (Polynomial.X + 1)) → Polynomial.X ^ k ∣ P 2014} (Nat.choose 2014 1007) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-310549,"Let \(m\) and \(n\) be positive integers of distinct parities such that \(m < n < 5m\). Prove that there exists a partition of the set \(\{1, 2, 3, \ldots, 4mn\}\) into two - element subsets such that the sum of the numbers in each subset is a perfect square.","import Mathlib theorem qwen (m n : ℕ) (hm : 0 < m) (hn : 0 < n) (hmn : m ≠ n ∧ m % 2 ≠ n % 2) (hmn1 : m < n ∧ n < 5 * m) : ∃ s1 s2 : Finset ℕ, s1 ∪ s2 = Finset.Icc 1 (4 * m * n) ∧ s1 ∩ s2 = ∅ ∧ IsSquare (∑ x ∈ s1, x) ∧ IsSquare (∑ x ∈ s2, x) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-310653,"Prove that every positive integer appears in the infinite sequence of positive integers \(a_1, a_2, a_3, \ldots\) defined by \(a_1 = 1\), and for each \(n \geq 2\), \(a_n\) is the smallest positive integer, distinct from \(a_1, a_2, \ldots, a_{n - 1}\), such that the expression \(\sqrt{a_n + \sqrt{a_{n - 1} + \ldots + \sqrt{a_2 + \sqrt{a_1}}}}\) is an integer.","import Mathlib open Real theorem prove (a : ℕ → ℕ) (h₀ : a 1 = 1) (h₁ : ∀ n ≥ 2, ∃ m, IsLeast {x | 0 < x ∧ ¬∃ i < n, a i = x} m ∧ ∃ k : ℤ, sqrt (a n + sqrt (a (n - 1) + sqrt (a (n - 2) + sqrt (a (n - 3))))) = k) : ∀ n, 0 < n → ∃ m, a m = n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-310659,"Prove that there exists a bijection $f: \mathbb{N}^{+} \rightarrow \mathbb{N}^{+}$ and a positive integer $k$ along with a coloring of each positive integer with one of $k$ colors such that for any distinct $x, y \in \mathbb{N}^{+}$, the sums $f(x) + y$ and $f(y) + x$ are not the same color.","import Mathlib theorem exist_bijective_f_and_k_and_coloring : ∃ (f : ℕ+ → ℕ+) (k : ℕ) (h : 0 < k) (col : ℕ+ → Fin k), Function.Bijective f ∧ ∀ x y : ℕ+, x ≠ y → col (f x + y) ≠ col (f y + x) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-310711,"Prove that in a game where $S$ is a set of prime numbers chosen by Maria the Oracle, Dragos, the early ruler of Moldavia, constructs an infinite sequence of distinct positive integers $x_1, x_2, \ldots$, Maria then selects a positive integer $M$ and a prime number $p \in S$, and Dragos subsequently chooses a positive integer $N$, with Dragos winning if and only if for all integers $n \ge N$, the number $x_n$ is divisible by $p^M$ and Maria winning otherwise, Dragos has a winning strategy whether $S$ is finite or infinite.","import Mathlib open Finset theorem Prove (S : Set ℕ) (hS : ∀ n ∈ S, Nat.Prime n) : ∃ f : ℕ → ℕ, (∀ i j, i ≠ j → f i ≠ f j) ∧ (∀ i, 0 < f i) ∧ (∀ M p, 0 < M → Nat.Prime p → p ∈ S → (∃ N, ∀ n ≥ N, p ^ M ∣ f n)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-310874,"Prove that for any integer \( n > 16 \), there exists a set \( S \) of \( n \) positive integers with the following property: if a subset \( A \) of \( S \) satisfies that for any \( a, a' \in A \) with \( a \neq a' \), \( a + a' \notin S \), then \( |A| \leq 4\sqrt{n} \).","import Mathlib theorem prove (n : ℕ) (hn : n > 16) : ∃ S : Finset ℕ, S.card = n ∧ (∀ x ∈ S, x > 0) ∧ (∀ A : Finset ℕ, A ⊆ S → (∀ a ∈ A, ∀ a' ∈ A, a ≠ a' → a + a' ∉ S) → A.card ≤ 4 * Real.sqrt n) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-311050,"Prove that if $a_1, a_2, \ldots, a_n$ are $n$ distinct integers such that $|A| = \frac{(n - 1)n}{2}$, where $A=\{a_i + a_j\mid 1\leq i < j\leq n\}$, then the minimum value of $\max |a_i - a_j|$ for $1\leq i < j\leq n$ is the $(n - 1)$-th Fibonacci number $F_{n - 1}$.","import Mathlib theorem fib (n : ℕ) : IsLeast {x | ∃ a : Finset ℤ, a.card = n ∧ (∀ i ∈ a, ∀ j ∈ a, i ≠ j → |i - j| ≤ x) ∧ Set.ncard {x | ∃ i ∈ a, ∃ j ∈ a, i ≠ j ∧ x = i + j} = ((n - 1) * n) / 2} (Nat.fib (n - 1)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-312153,"Given \(1390\) points placed near a line such that the perpendicular distance from each point to the line is less than \(1\text{cm}\), and the distance between any two points is greater than \(2\text{cm}\). Prove that there exists at least one pair of points such that the distance between them is at least \(10\) meters.","import Mathlib theorem prove (S : Finset (ℝ × ℝ)) (hS : S.card = 1390) (hS1 : ∀ x ∈ S, |x.2| < 1) (hS2 : ∀ x ∈ S, ∀ y ∈ S, x ≠ y → |x.1 - y.1| > 2) : ∃ x ∈ S, ∃ y ∈ S, x ≠ y ∧ |x.1 - y.1| ≥ 10 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-312243,"Find the value of the limit: \[ \lim_{n\to\infty} \frac{a_n}{b_n} \] where \( a_n = \sum_{m=1}^{\lfloor n/2 \rfloor} \frac {n!}{2^m(n-2m)!} \) is the number of elements of order 2 in the symmetric group \( S_n \), and \( b_n = \sum_{m=1}^{\lfloor n/4 \rfloor} \frac {n!}{2^{2m}(n-4m)!} \) is the number of elements of order 2 in the alternating group \( A_n \). Prove that the answer is 2.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (a b : ℕ → ℝ) (ha : ∀ n, a n = ∑ m ∈ Icc 1 ⌊(n / 2 : ℝ)⌋₊, Nat.factorial n / (2 ^ m * Nat.factorial (n - 2 * m))) (hb : ∀ n, b n = ∑ m ∈ Icc 1 ⌊(n / 4 : ℝ)⌋₊, Nat.factorial n / (2 ^ (2 * m) * Nat.factorial (n - 4 * m))) : Tendsto (λ n => a n / b n) atTop (𝓝 2) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-312405,"Prove that the maximum number of progressive triplets in a sequence \((a_1, a_2, \ldots, a_{2013})\) of positive integers, where a triplet \((i, j, k)\) with \(1 \le i < j < k \le 2013\) is called progressive if \(a_k - a_j = a_j - a_i = 1\), is \(99999971\).","import Mathlib def isProgressive (a : ℕ → ℤ) (i j k : ℕ) := i < j ∧ j < k ∧ a k - a j = 1 ∧ a j - a i = 1 theorem maxProgressive : IsGreatest {n | ∃ a : ℕ → ℤ, (∀ i ∈ Finset.Icc 1 2013, a i > 0) ∧ n = {p | ∃ i j k, p = (i, j, k) ∧ isProgressive a i j k}.ncard} 99999971 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-312629,"Prove that if the complex power sum of a set $\{a_1, a_2, a_3, \ldots, a_n\}$ of real - numbers with $a_1 < a_2 < a_3 < \cdots < a_n$ is defined as $a_1i + a_2i^2 + a_3i^3 + \cdots + a_ni^n$ (where $i^2=-1$), and $S_n$ denotes the sum of the complex power sums of all non - empty subsets of $\{1, 2, \ldots, n\}$, given that $S_8=-176 - 64i$ and $S_9 = p+qi$ with $p,q\in\mathbb{Z}$, then $|p|+|q| = 368$.","import Mathlib open Finset Complex Polynomial theorem prove {n : ℕ} (hn : n > 0) (S : ℕ → ℂ) (hS : ∀ k, S k = ∑ s ∈ (Icc 1 k).powerset \ {∅}, (∑ i ∈ s, (i : ℝ) * I ^ i)) : S 8 = -176 - 64 * I ∧ ∃ p q : ℤ, S 9 = p + q * I ∧ |p| + |q| = 368 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-312946,The probability that a set of three distinct vertices chosen at random from among the vertices of a regular n-gon determine an obtuse triangle is $\frac{93}{125}$ . Find the sum of all possible values of $n$ . prove that answer is 503,"import Mathlib open Real open scoped BigOperators theorem sumOfAllN : ∑ᶠ n ∈ {n | 3 < n ∧ (n - 2) * (n - 3) / (n * (n - 1)) = 93 / 125}, n = 503 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DAPO-Math-17k, flc-313572,"Determine a lower bound for the cardinality of the set \( A \), where \( A = \{ R \subset \mathbb{N} \times \mathbb{N} : R \text{ is transitive} \} \). Prove that the answer is 2^{\aleph_0}.","import Mathlib open Finset theorem lower_bound : {R : Set (ℕ × ℕ) | ∃ s : Set ℕ, R = {(x, y) | ∃ n ∈ s, x = n ∧ y = n}}.ncard ≥ 2 ^ (Nat.card ℕ) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-313736,"Prove that the smallest positive integer \(s\) for which there exists an \(m \times n\) rectangular array of positive integers such that (1) each row contains \(n\) distinct consecutive integers in some order, (2) each column contains \(m\) distinct consecutive integers in some order, and (3) each entry in the array is less than or equal to \(s\), is \(s = \max(m, n)\).","import Mathlib open Finset theorem max_s {m n : ℕ} (hm : 0 < m) (hn : 0 < n) : IsLeast {x | ∃ a : Fin m → Fin n → ℕ, (∀ i j, 0 < a i j) ∧ (∀ i, ∃! p : Equiv.Perm (Fin n), ∀ j, a i j = p j + 1) ∧ (∀ j, ∃! q : Equiv.Perm (Fin m), ∀ i, a i j = q i + 1) ∧ (∀ i j, a i j ≤ x)} (max m n) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-313751,Prove that the set \(S=\left\{ x\in \mathbb{R} : \lim_{n\to \infty}\sin (n!\pi x)=0 \right\}\) is uncountable and Lebesgue measurable with measure \(0\).,"import Mathlib open Real Filter Function open scoped Topology theorem uncountable_and_measurable {S : Set ℝ} (hS : S = {x | Tendsto (λ n => sin (Nat.factorial n * π * x)) atTop (𝓝 0)}) : ¬ Set.Countable S ∧ (MeasureTheory.volume S).toReal = 0 := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-313813,"Prove that if $K$ and $N > K$ are fixed positive integers, and $n$ is a positive integer and $a_1, a_2, \ldots, a_n$ are distinct integers such that for any integers $m_1, m_2, \ldots, m_n$, not all equal to $0$, with $|m_i| \le K$ for each $i$, the sum $\sum_{i = 1}^{n} m_ia_i$ is not divisible by $N$, then the largest possible value of $n$ is $\lfloor \log_{K + 1}(N) \rfloor$.","import Mathlib theorem prove (K N : ℕ) (hK : 0 < K) (hN : N > K) : IsGreatest {n | ∃ a : Fin n → ℤ, (∀ i j, i ≠ j → a i ≠ a j) ∧ (∀ m : Fin n → ℤ, (∃ i, m i ≠ 0) ∧ (∀ i, |m i| ≤ K) → ¬(∑ i : Fin n, m i * a i ≡ 0 [ZMOD N]))} (Nat.floor (Real.logb (K + 1) N)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-313815,"For a positive integer $k$, let $n_k$ be the smallest positive integer satisfying the following condition: there exists a finite set of integers $A$ such that (1) For any $a \in A$, there exist $x, y \in A$ such that $n_k \mid a - x - y$; (2) There is no non-empty subset $B$ of $A$ such that $|B| \leq k$ and $n_k \mid \sum\limits_{b \in B} b$. Prove that for any integer $k \geq 3$, the inequality $n_k < \left(\frac{13}{8}\right)^{k+2}$ holds.","import Mathlib open Finset Real theorem n (k : ℕ) (hk : 0 < k) : IsLeast {n | 0 < n ∧ ∃ A : Finset ℤ, (∀ a ∈ A, ∃ x ∈ A, ∃ y ∈ A, n ∣ a - x - y) ∧ ¬∃ B : Finset ℤ, B ⊆ A ∧ B.Nonempty ∧ B.card ≤ k ∧ n ∣ ∑ b ∈ B, b} ((13 / 8) ^ (k + 2)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-314342,"已知集合 $S=\{1,2,3, \cdots, N\}$ 的四个500元子集 $A_{1}, A_{2}$, $A_{3}, A_{4}$ 满足:对任意 $x, y \in S$ ,均存在某个 $i \in\{1,2,3,4\}$ ,使得 $x, y \in A_{i}$ 。求正整数 $N$ 的最大可能值。 prove that answer is 833","import Mathlib theorem max_n : IsGreatest {n : ℕ | ∃ S : Finset ℕ, S.card = n ∧ ∃ A : Fin 4 → Finset ℕ, (∀ x ∈ S, ∀ y ∈ S, ∃ i, x ∈ A i ∧ y ∈ A i) ∧ (∀ i, (A i).card = 500)} 833 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DAPO-Math-17k, flc-315013,"Given any integer \(0 < n \leq 2^{1000000}\), prove that there exists a set \(S\) of at most \(1085128\) positive integers such that \(S\) includes \(1\) and \(n\), and every element of \(S\) except \(1\) is the sum of two (possibly equal) smaller elements of \(S\).","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n ∧ n ≤ 2^1000000) : ∃ S : Finset ℕ, S.card ≤ 1085128 ∧ (∀ x ∈ S, x > 0) ∧ 1 ∈ S ∧ n ∈ S ∧ ∀ x ∈ S \ {1}, ∃ y z, x = y + z ∧ y ∈ S ∧ z ∈ S := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-315052,"Prove that if the set of all positive integers $\mathbb{N}$ is decomposed into $r$ disjoint subsets $A_1, A_2, \ldots, A_r$ such that $A_1 \cup A_2 \cup \cdots \cup A_r = \mathbb{N}$, then there exists at least one subset $A_i$ for which there is a positive integer $m$ such that for any positive integer $k$, one can find a sequence of numbers $a_1, a_2, \ldots, a_k$ in $A_i$ with $0 < a_{j+1} - a_j \le m$ for all $1 \le j \le k-1$.","import Mathlib theorem prove (r : ℕ) (A : Fin r → Set ℕ) (h₀ : ∀ i j, i ≠ j → Disjoint (A i) (A j)) (h₁ : ∃ B : Set ℕ, B = ⋃ i, A i ∧ B = {x | 0 < x}) : ∃ i, ∃ m : ℕ, 0 < m ∧ ∀ k : ℕ, 0 < k → ∃ a : ℕ → ℕ, (∀ j ∈ Finset.Icc 1 (k - 1), a (j + 1) - a j ≤ m) ∧ (∀ j ∈ Finset.Icc 1 (k - 1), a j ∈ A i) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-315253,"Prove that for a sequence of integers \(a_1, a_2, a_3, \ldots\) defined by \(a_1 = 1\) and for \(n \geq 1\), \(a_{n + 1}\) being the smallest integer greater than \(a_n\) such that \(a_i + a_j \neq 3a_k\) for any \(i, j, k \in \{1, 2, 3, \ldots, n+1\}\), not necessarily distinct, the value of \(a_{1998}\) is \(4494\).","import Mathlib theorem prove (a : ℕ+ → ℤ) (h0 : a 1 = 1) (ha : ∀ n, IsLeast {p | p > a n ∧ ∀ i ∈ Set.Icc 1 (n + 1), ∀ j ∈ Set.Icc 1 (n + 1), ∀ k ∈ Set.Icc 1 (n + 1), a i + a j ≠ 3 * a k} (a (n + 1))) : a 1998 = 4494 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-315363,"Prove that there exists an enumeration of the rational numbers $\{r_1, r_2, \ldots\}$ and a continuous real - valued function $f$ such that $f(r_n)=r_{n + 1}$ for all $n\in\mathbb{N}$.","import Mathlib theorem exist_f : ∃ (r : ℕ → ℚ) (f : ℝ → ℝ), Continuous f ∧ ∀ n : ℕ, f (r n) = r (n + 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-315493,"Let $n$ be an integer greater than two, and let $A_1, A_2, \ldots, A_{2n}$ be pairwise distinct subsets of $\{1, 2, \ldots, n\}$, where $A_{2n+1} = A_1$ and $|X|$ denotes the number of elements in the set $X$. Prove that the maximum value of the sum \(\sum_{i=1}^{2n} \frac{|A_i \cap A_{i+1}|}{|A_i| \cdot |A_{i+1}|}\) is \(n\).","import Mathlib open Finset Real theorem max_value (n : ℕ) (hn : n > 2) (A : ℕ → Set ℕ) (hA : ∀ i ∈ Icc 1 (2 * n), ∀ j ∈ Icc 1 (2 * n), A i = A j → i = j) (hA' : A (2 * n + 1) = A 1) (hA'' : ∀ i ∈ Icc 1 (2 * n), A i ⊆ Finset.Icc 1 n) : IsGreatest {∑ i ∈ Icc 1 (2 * n), (A i ∩ A (i + 1)).ncard / (A i).ncard / (A (i + 1)).ncard} n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-315796,"1. **Problem 9.100**: - Prove that the number of sets $\{a, b, c, d\} \subset \{1, 2, \ldots, 2^m\}$ such that $a + b = c + d$ and $\{a, b\} \neq \{c, d\}$ is $0$. 2. **Problem 9.102**: - Prove that the number of ways to tile a $2\times12$ chessboard, where the numbers $1, 2, \ldots, 12$ and $13, 14, \ldots, 24$ are written in each unit - square in order from left - to - right in the top and bottom row respectively, using an ample supply of $1\times2$ and $1\times3$ card boards is $927$. 3. **Problem 9.105**: - Prove that for a prime $p$ with $p\geq5$, $\binom{2p}{p} \equiv 2 \pmod{p^3}$.","import Mathlib theorem problem9100 (m : ℕ) : Set.ncard {s : Finset ℕ | s ⊆ Finset.Icc 1 (2 ^ m) ∧ s.card = 4 ∧ ∃ a ∈ s, ∃ b ∈ s, ∃ c ∈ s, ∃ d ∈ s, a + b = c + d ∧ (s \ {a, b}) ≠ (s \ {c, d})} = 0 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-316536,"Prove that for any finite set $A$ of positive integers, there exists a subset $B \subseteq A$ such that: 1. For any distinct $b_1, b_2 \in B$, neither $b_1$ and $b_2$ nor $b_1 + 1$ and $b_2 + 1$ are multiples of each other. 2. For every $a \in A$, there exists a $b \in B$ such that either $a$ divides $b$ or $b + 1$ divides $a + 1$.","import Mathlib theorem prove (A : Finset ℕ) (hA : ∀ x ∈ A, x > 0) : ∃ B ⊆ A, (∀ b1 ∈ B, ∀ b2 ∈ B, b1 ≠ b2 → ¬(b1 ∣ b2) ∧ ¬(b1 + 1 ∣ b2 + 1)) ∧ (∀ a ∈ A, ∃ b ∈ B, a ∣ b ∨ (b + 1) ∣ (a + 1)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-316708,"Let \(M = \{1, 2, \dots, 2n\}\) be a set of integers, and suppose \(M\) is partitioned into \(k\) non - intersecting subsets \(M_1, M_2, \dots, M_k\), where \(n \ge k^3 + k\). Prove that there exist \(k + 1\) even numbers \(2j_1, 2j_2, \dots, 2j_{k+1}\) in \(M\) that are all contained in the same subset \(M_i\) for some \(1 \le i \le k\), and such that the numbers \(2j_1 - 1, 2j_2 - 1, \dots, 2j_{k+1} - 1\) are also all contained in the same subset \(M_j\) for some \(1 \le j \le k\).","import Mathlib theorem Qwen {n : ℕ} (hn : n ≥ k ^ 3 + k) (M : Finset ℕ) (hM : M = Finset.Icc 1 (2 * n)) (k : ℕ) (hk : 0 < k) (Mk : Fin k → Finset ℕ) (hMk : ∀ i j, i ≠ j → Disjoint (Mk i) (Mk j)) (hMk' : ∀ i, Mk i ⊆ M) : ∃ s : Finset ℕ, s.card = k + 1 ∧ (∀ x ∈ s, Even x) ∧ (∃ i, ∀ x ∈ s, x ∈ Mk i) ∧ (∃ j, ∀ x ∈ s, x - 1 ∈ Mk j) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-318461,"Prove that for any positive real number $\varepsilon$, for all but finitely many positive integers $v$, any simple graph on $v$ vertices with at least $(1+\varepsilon)v$ edges contains at least two distinct simple cycles of equal lengths.","import Mathlib theorem prove (ε : ℝ) (hε : ε > 0) : {v : ℕ | v > 0 ∧ ¬∃ s : Finset (Fin v × Fin v), s.card ≥ (1 + ε) * v ∧ ∀ x ∈ s, x.1 ≠ x.2}.Finite := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-319879,"a) Prove that $\left|X_{t}\right| \sim t^{n}$ as $t \to +\infty$, where for a fixed positive integer $n \geq 1$ and $t \in (0, +\infty)$, the set $X_{t}$ is defined as $$ X_{t} = \left\{ (a_{1}, \ldots, a_{n}) \in (\mathbb{N} \cup \{0\})^{n} \mid \sum_{k=1}^{n} \frac{a_{k}}{k} < t \right\}. $$ b) Prove that $\left|X_{t}\right| \sim t^{n}$ as $t \to +\infty$ to compare $\left|X_{t}\right|$ with $t^{n}$, where for a fixed positive integer $n \geq 1$ and $t \in (0, +\infty)$, the set $X_{t}$ is defined as $$ X_{t} = \left\{ (a_{1}, \ldots, a_{n}) \in (\mathbb{N} \cup \{0\})^{n} \mid \sum_{k=1}^{n} \frac{a_{k}}{k} < t \right\}. $$","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove_size (n : ℕ) (hn : 1 ≤ n) (X : ℝ → Set (Fin n → ℕ)) (hX : ∀ t > 0, X t = {x | ∑ k : Fin n, x k / (k.1 + 1) < t}) : ∀ ε > 0, ∃ N, ∀ t > N, |(X t).ncard - t ^ n| < ε := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-319915,"Evaluate the limit: \[ \lim_{x\rightarrow +\infty} (xD)^m\sum_{k=1}^\infty (-1)^k \frac{x^k}{k^{k}} \] where \(m\) is a positive integer, \(D=\frac{d}{dx}\), and \(\begin{Bmatrix} m\\r \end{Bmatrix}\) are Stirling numbers of the second kind. Prove that the answer is 0.","import Mathlib open Real Filter Function open scoped Topology theorem Tendsto {m : ℕ} (hm : m > 0) : Tendsto (λ x => (x * D) ^ m * ∑' k : ℕ, (-1 : ℝ) ^ (k + 1) * x ^ (k + 1) / (k + 1) ^ (k + 1)) atTop (𝓝 0) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-320469,"Prove that \(\sum_{(a,b,c)\in\mathbb{N}^3} \frac{ab + bc+ca}{(a + b + c)!}=\frac{5e}{8}\).","import Mathlib open Real open scoped BigOperators theorem prove : ∑' a : ℕ, ∑' b : ℕ, ∑' c : ℕ, (a * b + b * c + c * a) / Nat.factorial (a + b + c) = 5 * exp 1 / 8 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-320538,"a) Prove that there exist infinitely many functions \(f: \mathbb{N} \rightarrow \mathbb{N}\) such that for any \(y \in \mathbb{N}\), the equation \(f(x) = y\) has exactly 3 solutions. b) Prove that you have determined all monotonous functions \(f: \mathbb{N} \rightarrow \mathbb{N}\) such that for any \(y \in \mathbb{N}\), the equation \(f(x) = y\) has exactly 3 solutions. c) Prove that there do not exist monotonous functions \(f: \mathbb{Q} \rightarrow \mathbb{Q}\) such that for any \(y \in \mathbb{Q}\), the equation \(f(x) = y\) has exactly 3 solutions.","import Mathlib open Finset theorem a : {f : ℕ → ℕ | ∀ y, {x | f x = y}.encard = 3}.Infinite := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-321504,"Let $\{a_1, a_2, \ldots, a_n\}$ and $\{b_1, b_2, \ldots, b_n\}$ be two distinct sets of natural numbers such that the sets of sums $\{a_i + a_j : 1 \leq i < j \leq n\}$ and $\{b_i + b_j : 1 \leq i < j \leq n\}$ are identical. Prove that $n$ must be a power of $2$.","import Mathlib theorem algebra_576807 {n : ℕ} (hn : 0 < n) (a b : Finset ℕ) (ha : a.card = n) (hb : b.card = n) (hab : a ≠ b) (h : {x | ∃ i ∈ a, ∃ j ∈ a, i ≠ j ∧ x = i + j} = {x | ∃ i ∈ b, ∃ j ∈ b, i ≠ j ∧ x = i + j}) : ∃ k, n = 2 ^ k := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-322032,"Prove that given a group of \(17\) people, where each pair of individuals exchanges letters on exactly one of three distinct topics, there exists a subset of at least \(3\) people such that every pair within this subset exchanges letters on the same topic.","import Mathlib theorem letter_exchange (a : Fin 17 → Fin 17 → Fin 3) (h : ∀ i j, a i j = a j i) : ∃ s : Finset (Fin 17), s.card ≥ 3 ∧ ∃ t : Fin 3, ∀ i ∈ s, ∀ j ∈ s, i ≠ j → a i j = t := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-322221,"Let $m, n$ be two positive integers such that $m \ge n \ge 2022$. Consider $2n$ real numbers $a_1, a_2, \ldots, a_n$ and $b_1, b_2, \ldots, b_n$. Prove that the number of ordered pairs $(i, j)$, where $1 \le i, j \le n$, satisfying the inequality \[ |a_i + b_j - ij| \le m, \] does not exceed $3n\sqrt{m \log n}$.","import Mathlib open Real Set open scoped BigOperators theorem prove (m n : ℕ) (hm : 0 < m) (hn : 0 < n) (hmn : m ≥ n ∧ n ≥ 2022) (a b : Finset.Icc 1 n → ℝ) : {p : Finset.Icc 1 n × Finset.Icc 1 n | |a p.1 + b p.2 - p.1 * p.2| ≤ m}.ncard ≤ 3 * n * sqrt (m * log n) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-322452,"Given a permutation $a_1, a_2, \ldots, a_{2014}$ of the numbers $1, 2, 3, \ldots, 2014$, determine the greatest number of perfect squares that can exist in the set $\{ a_1^2 + a_2, a_2^2 + a_3, a_3^2 + a_4, \ldots, a_{2013}^2 + a_{2014}, a_{2014}^2 + a_1 \}$. prove that answer is 1006","import Mathlib theorem max_perfect_squares (a : Fin 2014 → ℕ) (ha : ∃ p : Equiv.Perm (Fin 2014), ∀ i, a i = p i + 1) : IsGreatest {k | ∃ s : Finset (Fin 2014), s.card = k ∧ ∀ i ∈ s, ∃ m, m^2 = a i ^ 2 + a ((i + 1) % 2014)} 1006 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DAPO-Math-17k, flc-322732,"For a natural number \(n \geq 2\), consider the sequences defined by: \[ a_n = 1 - \binom{n}{3} + \binom{n}{6} - \cdots, \] \[ b_n = -\binom{n}{1} + \binom{n}{4} - \binom{n}{7} + \cdots, \] \[ c_n = \binom{n}{2} - \binom{n}{5} + \binom{n}{8} - \cdots. \] Prove that: \[ a_n^2 + b_n^2 + c_n^2 - a_n b_n - b_n c_n - c_n a_n = 3^{n-1}. \]","import Mathlib open Finset Real Nat theorem algebra_454590 {n : ℕ} (hn : 2 ≤ n) : (∑ i ∈ range (n + 1), (-1 : ℝ)^i * Nat.choose n (3 * i)) ^ 2 + (∑ i ∈ range (n + 1), (-1 : ℝ)^i * Nat.choose n (3 * i + 1)) ^ 2 + (∑ i ∈ range (n + 1), (-1 : ℝ)^i * Nat.choose n (3 * i + 2)) ^ 2 - (∑ i ∈ range (n + 1), (-1 : ℝ)^i * Nat.choose n (3 * i)) * (∑ i ∈ range (n + 1), (-1 : ℝ)^i * Nat.choose n (3 * i + 1)) - (∑ i ∈ range (n + 1), (-1 : ℝ)^i * Nat.choose n (3 * i + 1)) * (∑ i ∈ range (n + 1), (-1 : ℝ)^i * Nat.choose n (3 * i + 2)) - (∑ i ∈ range (n + 1), (-1 : ℝ)^i * Nat.choose n (3 * i + 2)) * (∑ i ∈ range (n + 1), (-1 : ℝ)^i * Nat.choose n (3 * i)) = 3 ^ (n - 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-322840,"Prove that the set of natural numbers can be partitioned into two disjoint subsets (or colored with two colors) such that the following conditions are satisfied: 1) For any prime number \(p\) and any natural number \(n\), the numbers \(p^n\), \(p^{n + 1}\), and \(p^{n+2}\) are not all in the same subset (or of the same color). 2) There does not exist an infinite geometric sequence of natural numbers all of which are in the same subset (or of the same color).","import Mathlib theorem natural_partition : ∃ s1 s2 : Set ℕ, s1 ∪ s2 = ℕ ∧ s1 ∩ s2 = ∅ ∧ (∀ p n, Nat.Prime p → ¬(p ^ n ∈ s1 ∧ p ^ (n + 1) ∈ s1 ∧ p ^ (n + 2) ∈ s1)) ∧ (∀ p n, Nat.Prime p → ¬(p ^ n ∈ s2 ∧ p ^ (n + 1) ∈ s2 ∧ p ^ (n + 2) ∈ s2)) ∧ ¬∃ a r : ℕ, ∀ n, a * r ^ n ∈ s1 ∧ ¬∃ a r : ℕ, ∀ n, a * r ^ n ∈ s2 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-322979,"Let \(m, n\) be two positive integers such that \(m \ge n \ge 2022\). Consider \(2n\) real numbers \(a_1, a_2, \ldots, a_n\) and \(b_1, b_2, \ldots, b_n\). Prove that the number of ordered pairs \((i, j)\), where \(1 \le i, j \le n\), satisfying the inequality \[ |a_i + b_j - ij| \le m, \] does not exceed \(3n\sqrt{m \ln n}\).","import Mathlib open Real Set open scoped BigOperators theorem sample_size {m n : ℕ} (hm : 2022 ≤ n) (hn : n ≤ m) (a b : Fin n → ℝ) : {(i, j) : Fin n × Fin n | |a i + b j - i * j| ≤ m}.ncard ≤ 3 * n * sqrt (m * log n) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-323218,"Prove that for an infinite, strictly increasing sequence $\{a_n\}$ of positive integers that satisfies the condition $a_{a_n} \le a_n + a_{n + 3}$ for all $n \ge 1$, there exist infinitely many triples $(k, l, m)$ of positive integers such that $k < l < m$ and $a_k + a_m = 2a_l$.","import Mathlib theorem prove_infinite_triples (a : ℕ → ℕ) (ha : StrictMono a) (hpos : ∀ n, 0 < a n) (h : ∀ n, a (a n) ≤ a n + a (n + 3)) : ∀ N, ∃ k l m, k > N ∧ l > N ∧ m > N ∧ k < l ∧ l < m ∧ a k + a m = 2 * a l := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-324062,"Prove that the greatest positive integer \(t\) such that for a given positive integer \(k>1\) and for all positive integers \(a\), the set \(S = \{a + 1,a + 2,\ldots,a + t\}\) is good (where a set \(S\) is good if it is possible to color the set of positive integers using \(k\) colors such that no integer in \(S\) can be expressed as the sum of two positive integers of the same color) is \(t = 2k+1\).","import Mathlib theorem ProveGood (k : ℕ) (hk : 1 < k) : IsGreatest {t | 0 < t ∧ ∀ a : ℕ, 0 < a → ∃ f : ℕ → Fin k, (∀ i ∈ Finset.Icc 1 t, ¬∃ j l : ℕ, 0 < j ∧ 0 < l ∧ j ≠ l ∧ f j = f l ∧ (a + i) = j + l)} (2 * k + 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-324226,"(a) Prove that $M(n) \leq \left\lfloor \frac{2^{n+1}}{n}\right\rfloor+1$, where $S$ is the set of $n$-tuples $\left( x_{1}, x_{2}, \ldots, x_{n}\right)$ such that $x_{i} \in \{ 0, 1 \}$ for all $i \in \{1, 2, \ldots, n\}$ with $n \geq 3$, and $M(n)$ is the smallest integer with the property that any subset of $S$ with at least $M(n)$ elements contains at least three $n$-tuples \[\left( x_{1}, \ldots, x_{n}\right), \, \left( y_{1}, \ldots, y_{n}\right), \, \left( z_{1}, \ldots, z_{n}\right) \] such that \[\sum_{i=1}^{n}\left( x_{i}-y_{i}\right)^{2}= \sum_{i=1}^{n}\left( y_{i}-z_{i}\right)^{2}= \sum_{i=1}^{n}\left( z_{i}-x_{i}\right)^{2}. \] (b) Prove that $M(3) = 5$ and $M(4) = 9$, where $M(n)$ is defined as above.","import Mathlib open Finset theorem M {n : ℕ} (hn : n ≥ 3) : IsLeast {k | ∀ S : Finset (Fin n → ℕ), (∀ x ∈ S, ∀ i, x i = 0 ∨ x i = 1) ∧ S.card ≥ k → ∃ x ∈ S, ∃ y ∈ S, ∃ z ∈ S, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ ∑ i, (x i - y i)^2 = ∑ i, (y i - z i)^2 ∧ ∑ i, (y i - z i)^2 = ∑ i, (z i - x i)^2} (Nat.floor (2^(n + 1) / n) + 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-324797,"The user's problem is already a formal math proof problem. So the final proof statement is: Prove that \( \sum_{n=1}^\infty \frac{n^2}{2^n \cdot \binom{2n}{n}} = \frac{8}{343} \left(16 + \frac{37}{\sqrt{7}} \cot^{-1} \sqrt{7} \right) \)","import Mathlib open Real theorem sum_infinite (a : ℕ → ℝ) (ha : ∀ n, a n = n ^ 2 / (2 ^ n * Nat.choose (2 * n) n)) : ∑' n, a n = 8 / 343 * (16 + 37 / sqrt 7 * cot⁻¹ (sqrt 7)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-324866,"Let $X$ be an infinite set and ${\cal P}(X)$ its powerset. A subset ${\cal F} \subseteq {\cal P}(X)$ is said to have the splitting property (SP) if there exists $A \in {\cal P}(X)$ such that for all $F \in {\cal F}$, we have $F \cap A \neq \emptyset \neq F \cap (X \setminus A)$. Let $\text{SP}(X)$ denote the collection of all subsets of ${\cal P}(X)$ with the splitting property, ordered by $\subseteq$. If ${\cal F} \in \text{SP}(X)$, does there exist ${\cal M} \in \text{SP}(X)$ such that ${\cal M}$ is maximal in $(\text{SP}(X), \subseteq)$ and ${\cal F} \subseteq {\cal M}$? Prove that the answer is Yes.","import Mathlib open Set Real open scoped BigOperators theorem SP {X : Type*} [Infinite X] : ∀ F : Set (Set X), (∃ A : Set X, ∀ G ∈ F, G ∩ A ≠ ∅ ∧ G ∩ (Set.univ \ A) ≠ ∅) → ∃ M : Set (Set X), (∃ A : Set X, ∀ G ∈ M, G ∩ A ≠ ∅ ∧ G ∩ (Set.univ \ A) ≠ ∅) ∧ IsGreatest {x | ∃ A : Set X, ∀ G ∈ x, G ∩ A ≠ ∅ ∧ G ∩ (Set.univ \ A) ≠ ∅} M ∧ F ⊆ M := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-325398,"Prove that the number of ways to fill a \(7 \times 14\) grid with the letters \(S, I, M, O\) such that each \(2 \times 2\) block within the grid contains exactly one of each letter is \(4! \cdot (2^{12} + 2^5 - 1)\).","import Mathlib open Finset theorem number_of_ways : {a : Fin 7 → Fin 14 → Fin 4 | (∀ i j, a i j = 0 ∨ a i j = 1 ∨ a i j = 2 ∨ a i j = 3) ∧ (∀ i j, i + 1 < 7 → j + 1 < 14 → {k | ∃ x y, k = a x y ∧ (x = i ∨ x = i + 1) ∧ (y = j ∨ y = j + 1)}.encard = 4)}.ncard = Nat.factorial 4 * (2 ^ 12 + 2 ^ 5 - 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-325449,"Prove that the maximum possible value of \(n\) for which there exist sets \(A_1, A_2, \dots, A_n \subseteq \{1, 2, \dots, 2016\}\) such that \(\lvert A_i \rvert = 4\) for all \(1 \le i \le n\) and \(\lvert A_i \cap A_j \rvert\) is even for all \(1 \le i < j \le n\) is \(\binom{1008}{2}\).","import Mathlib theorem max_n : IsGreatest {n | ∃ A : Finset (Finset ℕ), A.card = n ∧ (∀ x ∈ A, x ⊆ Finset.Icc 1 2016 ∧ x.card = 4) ∧ (∀ x ∈ A, ∀ y ∈ A, x ≠ y → Even (x ∩ y).card)} (Nat.choose 1008 2) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-325725,"Call a pair of integers $(a,b)$ primitive if there exists a positive integer $\ell$ such that $(a+bi)^\ell$ is real. Find the smallest positive integer $n$ such that less than $1\%$ of the pairs $(a, b)$ with $0 \le a, b \le n$ are primitive. prove that answer is 299","import Mathlib def isPrimitive (a b : ℕ) := ∃ ℓ > 0, ∃ r : ℝ, (a + Complex.I * b) ^ ℓ = r theorem solution : IsLeast {n | 0 < n ∧ {p : ℕ × ℕ | p.1 ∈ Finset.Icc 0 n ∧ p.2 ∈ Finset.Icc 0 n ∧ isPrimitive p.1 p.2}.ncard / ((n + 1) * (n + 1)) < 1 / 100} 299 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DAPO-Math-17k, flc-325898,"Let \(m, n, p\) be positive integers with \(m \geq n\), and let \(H_m = 1 + \frac{1}{2} + \frac{1}{3} + \cdots + \frac{1}{m}\) denote the \(m\) - th Harmonic Number, with \(H_0 := 0\). Prove that for the values of \(m, p, n\) for which the denominators do not vanish, the following identities hold: \[ \begin{aligned} \sum_{k=0}^{n}(-1)^{k - 1}\frac{\binom{n}{k}\binom{p}{m - k}(H_p + H_m - H_{m - k})}{(m + n - k)\binom{p + n}{m + n - k}} &= \frac{1}{nm\binom{p + n}{n}}\\ \sum_{k=0}^{n}(-1)^{k - 1}\frac{\binom{n}{k}\binom{p + n - k}{m - k}(H_{p + n - k} + H_m - H_{m - k})}{(m + n - k)\binom{p + n - k}{m + n - k}} &= \frac{1}{nm\binom{p + n}{n}} \end{aligned} \]","import Mathlib open Finset Real Nat theorem algebra_496984 {m n p : ℕ} (hm : 0 < m) (hn : 0 < n) (hp : 0 < p) (hmn : m ≥ n) (H : ℕ → ℝ) (hH : ∀ m, H m = ∑ i ∈ Icc 1 m, (1 / i)) : (∑ k ∈ Icc 0 n, (-1) ^ (k - 1) * Nat.choose n k * Nat.choose p (m - k) * (H p + H m - H (m - k)) / ((m + n - k) * Nat.choose (p + n) (m + n - k))) = 1 / (n * m * Nat.choose (p + n) n) ∧ (∑ k ∈ Icc 0 n, (-1) ^ (k - 1) * Nat.choose n k * Nat.choose (p + n - k) (m - k) * (H (p + n - k) + H m - H (m - k)) / ((m + n - k) * Nat.choose (p + n - k) (m + n - k))) = 1 / (n * m * Nat.choose (p + n) n) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-326029,"Let \(n\) be a natural number. Consider a partition of the set \(\mathbb{N}\setminus\{1\}\) into \(n\) non - empty subsets \(A_1, A_2, \ldots, A_n\) such that: 1. \(\mathbb{N}\setminus\{1\}=\bigcup_{i = 1}^{n}A_i\) and \(A_i\cap A_j=\varnothing\) for \(i\neq j\). 2. For any \(A_i\) and any two different commensurable numbers \(a,b\in A_i\), \(\gcd(a,b)\in A_i\). Prove that one of these \(n\) subsets must contain all prime numbers, with at most \((n - 1)\) exceptions.","import Mathlib theorem PrimeUnion {n : ℕ} (hn : 0 < n) (A : Fin n → Set ℕ) (hA : ∀ i j, i ≠ j → Disjoint (A i) (A j)) (hA' : ∀ i, ∀ a ∈ A i, ∀ b ∈ A i, a ≠ b → Nat.gcd a b ∈ A i) (hA'' : ∀ i, A i ≠ ∅) (hA''' : ⋃ i, A i = {x | x > 1}) : ∃ i, ∀ p, Nat.Prime p → p ∈ A i ∧ {p | ¬(p ∈ A i)}.encard ≤ n - 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-326513,"Prove that in a gathering of \(n = 2015\) individuals where among any \(5\) participants, the total number of handshakes does not exceed \(6\), the maximum possible number of handshakes is \(1007 \cdot 1008\).","import Mathlib theorem max_handshakes (n : ℕ) (hn : n = 2015) (h : ∀ s : Finset ℕ, s ⊆ Finset.range n ∧ s.card = 5 → ∑ i ∈ s, ∑ j ∈ s, (if i < j then 1 else 0) ≤ 6) : IsGreatest {x | ∃ s : Finset ℕ, s ⊆ Finset.range n ∧ x = ∑ i ∈ s, ∑ j ∈ s, (if i < j then 1 else 0)} (1007 * 1008) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-326523,"Prove that the only positive integer \(c\) for which there exists a sequence of positive integers \(\{a_n\}\) defined by \(a_1 = 1\) and \[a_n = \min \{ a \in \mathbb{Z}^+ \mid a > a_{n - 1} \text{ and } \gcd(a, a_i) \leq c \text{ for all } i < n \} \quad \forall \quad n > 1,\] such that there are infinitely many positive integers \(k\) for which \(k \mid a_k\) is \(c = 1\).","import Mathlib theorem only_c1 : ∀ c : ℕ, c > 0 → (∃ a : ℕ → ℕ, (∀ n ≥ 1, 0 < a n) ∧ a 1 = 1 ∧ (∀ n ≥ 2, IsLeast {m | 0 < m ∧ m > a (n - 1) ∧ ∀ i < n, Nat.gcd m (a i) ≤ c} (a n)) ∧ {k | 0 < k ∧ (k ∣ a k)}.Infinite) ↔ c = 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-326790,"Prove that it is possible to color each positive integer with one of three colors such that the following conditions are satisfied: $i)$ For each $n \in \mathbb{N}_{0}$, all positive integers $x$ such that $2^n \le x < 2^{n+1}$ have the same color. $ii)$ There are no positive integers $x, y, z$ of the same color (except for the case $x = y = z = 2$) such that $x + y = z^2$.","import Mathlib theorem possible_coloring : ∃ f : ℕ → Fin 3, (∀ n, ∀ x, 2 ^ n ≤ x ∧ x < 2 ^ (n + 1) → f n = f x) ∧ ¬∃ x y z, 0 < x ∧ 0 < y ∧ 0 < z ∧ f x = f y ∧ f y = f z ∧ x ≠ 2 ∧ y ≠ 2 ∧ z ≠ 2 ∧ x + y = z ^ 2 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-326900,"There is a table with $n$ rows and $18$ columns. Each cell contains either a $0$ or a $1$. The table satisfies the following properties: 1. Every two rows are different. 2. Each row contains exactly $6$ cells that contain $1$. 3. For every three rows, there exists a column such that the intersection of the column with the three rows (the three cells) all contain $0$. What is the greatest possible value of $n$? prove that answer is 12376","import Mathlib theorem n : IsGreatest {n | ∃ a : Fin n → Fin 18 → ℕ, (∀ i j, i ≠ j → a i ≠ a j) ∧ (∀ i, {k | a i k = 1}.encard = 6) ∧ (∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → ∃ m, a i m = 0 ∧ a j m = 0 ∧ a k m = 0)} 12376 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DAPO-Math-17k, flc-327074,"Prove that if $p$ is a prime number and $A$ is a set of positive integers such that the set of prime divisors of the elements in $A$ consists of exactly $p - 1$ distinct primes and for any nonempty subset of $A$, the product of its elements is not a perfect $p$-th power, then the largest possible number of elements in $A$ is $(p - 1)\cdot(p - 1)$.","import Mathlib theorem Theorem_448239 (p : ℕ) (hp : Nat.Prime p) (A : Finset ℕ) (hA : ∀ x ∈ A, x > 0) (hA' : {x | ∃ y ∈ A, Nat.Prime y ∧ y ∣ x}.encard = p - 1) (hA'' : ∀ B ⊆ A, B ≠ ∅ → ¬∃ z, z^p = ∏ b ∈ B, b) : A.card ≤ (p - 1) * (p - 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-327104,"Prove that if $p$ is a prime number and $A$ is a set of positive integers such that the set of prime divisors of the elements in $A$ consists of exactly $p - 1$ distinct primes and for any nonempty subset of $A$, the product of its elements is not a perfect $p$-th power, then the largest possible number of elements in $A$ is $(p - 1)(p - 1)$.","import Mathlib theorem PAP (p : ℕ) (hp : Nat.Prime p) (A : Finset ℕ) (hA : ∀ x ∈ A, x > 0) (hA1 : (A.image (fun x => Nat.primeFactors x)).card = p - 1) (hA2 : ∀ S ⊆ A, S ≠ ∅ → ¬∃ z, z^p = ∏ x ∈ S, x) : A.card ≤ (p - 1) * (p - 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-327117,"Prove that the largest possible number of elements in a set \(A\) of positive integers, where the set of prime divisors of the elements in \(A\) consists of exactly \(p - 1\) distinct primes (\(p\) being a prime number) and for any non - empty subset of \(A\) the product of its elements is not a perfect \(p\) - th power, is \((p - 1)^2\).","import Mathlib theorem max_set_size {p : ℕ} (hp : Nat.Prime p) : IsGreatest {n | ∃ A : Finset ℕ, A.card = n ∧ (∀ x ∈ A, x > 0) ∧ {x | x.Prime ∧ x ∣ ∏ y ∈ A, y}.encard = p - 1 ∧ ∀ B ⊆ A, B ≠ ∅ → ¬∃ z, z^p = ∏ b ∈ B, b} ((p - 1)^2) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-327568,"Prove that if $k$ is a fixed positive integer and $a_n$ is the number of functions $f$ from the power set of $\{1, 2, \ldots, n\}$ to $\{1, 2, \ldots, k\}$ such that for all subsets $A, B$ of $\{1, 2, \ldots, n\}$, the condition $f(A \cap B) = \min(f(A), f(B))$ holds, then $\lim_{n \to \infty} \sqrt[n]{a_n}=k$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (k : ℕ) (hk : 0 < k) (a : ℕ → ℕ) (ha : ∀ n, a n = {f : Finset (Finset.Icc 1 n) → Finset.Icc 1 k | (∀ A B, f (A ∩ B) = min (f A) (f B))}.ncard) : Tendsto (λ n => (a n : ℝ) ^ ((1 : ℝ) / n)) atTop (𝓝 k) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-327853,"Prove that for an odd prime number \(p = 2017\), when considering the expression \(\pm 1 \pm 2 \pm 3 \dots \pm (p - 1)\) where each \(\pm\) can be either \(+\) or \(-\), and \(N\) is the number of ways to choose the signs such that the value of the expression is divisible by \(p\), the remainder when \(N\) is divided by \(503\) is \(52\).","import Mathlib open Finset theorem prove (p : ℕ) (hp : Odd p ∧ Nat.Prime p) (h : p = 2017) : {s : Finset.Icc 1 (p - 1) → ℤ | (∀ i, s i = 1 ∨ s i = -1) ∧ (∑ i, s i * i) % p = 0}.ncard % 503 = 52 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-327971,"Prove that for a sequence $\{a_i\}$ where $a_0$ is a positive integer and at each time step $i$, $a_i$ can be transformed according to the rules $\begin{cases}a_i\mapsto\frac{1}{a_{i - 1}}\\a_i\mapsto2a_{i - 1}+1\end{cases}$ with the condition that it is forbidden to apply the first rule in two consecutive turns and if $a_i>8763$, only the first rule can be applied, the set $\{i\in\mathbb{N}\mid a_i\in\mathbb{N}\}$ is infinite if and only if $a_0$ is a positive even integer less than or equal to $17526$.","import Mathlib theorem prove (a : ℕ → ℝ) (ha0 : ∃ n : ℕ, a 0 = n ∧ n > 0) (h : ∀ i, a (i + 1) = if a i > 8763 then 1 / a i else 2 * a i + 1) (h' : ¬∃ i, a (i + 1) = 1 / a i ∧ a (i + 2) = 1 / a (i + 1)) : {i | ∃ m : ℕ, a i = m}.Infinite ↔ Even (a 0) ∧ a 0 ≤ 17526 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-328577,"Determine the cardinality of the set of increasing functions from \( \mathbb{Z} \) to \( \mathbb{Z} \). Prove that the answer is 2^{\aleph_0}.","import Mathlib open Set Real open scoped BigOperators theorem card_increasing_fuctions : {f : ℤ → ℤ | StrictMono f}.ncard = 2 ^ (Nat.card ℕ) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-328684,"1. **First problem**: - The user's problem is already a formal math proof problem. So, the final proof statement is: Given \(a, b \in \mathbb{N}\) with \(a > b\) and both \(a + 1\) and \(b\) are perfect square numbers. Prove that \(ab + 1\) is not a perfect square number. 2. **Second problem**: - The user's problem is already a formal math proof problem. So, the final proof statement is: Given \(a_1, a_2, \ldots, a_{2^{2016}} \in \{1, 2, \ldots, 2016\}\) such that \(a_1 a_2 \cdots a_n + 1\) is a perfect square number for all \(n \in \{1, 2, \ldots, 2^{2016}\}\). Prove that there is at least one number in the sequence \(a_1, a_2, \ldots, a_{2^{2016}}\) that is equal to 1.","import Mathlib theorem problem1 {a b : ℕ} (ha : a > b) (h1 : ∃ m, a + 1 = m^2) (h2 : ∃ n, b = n^2) : ¬ ∃ p, p^2 = a * b + 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-328814,"Prove that for all positive integers \(m, r, k\), the following identity holds: \[\sum_{n = 0}^{\infty} \frac{\binom{n}{k}}{(n-k+1)(n+m+1)\binom{n+m}{r}} = \frac{1}{k(m+k-r)\binom{m}{r-k}}.\]","import Mathlib open Finset Real Nat theorem prove (m r k : ℕ) (hm : 0 < m) (hr : 0 < r) (hk : 0 < k) : ∑' n : ℕ, Nat.choose n k / ((n - k + 1) * (n + m + 1) * Nat.choose (n + m) r) = 1 / (k * (m + k - r) * Nat.choose m (r - k)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-329137,"Is it consistent within ZF set theory for there to exist a set $X$ with more than one element such that every injective map $f: X \to X$ has a fixed point? Prove that the answer is Yes.","import Mathlib theorem ZF_set_theory : ∃ (X : Type*) (_ : Fintype X), Fintype.card X > 1 ∧ ∀ (f : X → X) (_ : Function.Injective f), ∃ (x : X), f x = x := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-329286,"Compute the number of triples $(f,g,h)$ of permutations on $\{1,2,3,4,5\}$ such that \begin{align*} & f(g(h(x))) = h(g(f(x))) = g(x) \\ & g(h(f(x))) = f(h(g(x))) = h(x), \text{ and } \\ & h(f(g(x))) = g(f(h(x))) = f(x), \\ \end{align*} for all $x\in \{1,2,3,4,5\}$. prove that answer is 146","import Mathlib theorem number_of_triple : {(f, g, h) : Equiv.Perm (Fin 5) × Equiv.Perm (Fin 5) × Equiv.Perm (Fin 5) | ∀ i, f (g (h i)) = h (g (f i)) ∧ h (g (f i)) = g i ∧ ∀ i, g (h (f i)) = f (h (g i)) ∧ f (h (g i)) = h i ∧ ∀ i, h (f (g i)) = g (f (h i)) ∧ g (f (h i)) = f i}.ncard = 146 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DAPO-Math-17k, flc-329360,Prove that it is possible to partition the set of positive integers $\mathbb{Z}_{>0}$ into two disjoint subsets $A$ and $B$ such that neither $A$ nor $B$ contains an infinite arithmetic progression with a nonzero common difference.,"import Mathlib theorem possible_partition : ∃ A B : Set ℕ, A ∪ B = Set.Ici 1 ∧ A ∩ B = ∅ ∧ (∀ a ∈ A, ∀ d ≠ 0, {x | ∃ n, x = a + d * n} ∩ A = ∅) ∧ (∀ b ∈ B, ∀ d ≠ 0, {x | ∃ n, x = b + d * n} ∩ B = ∅) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-329895,"Prove that the maximum possible number of elements in a set $\mathcal{A}$ of functions from $\{1,2,\ldots,2023\}$ to $\{1,2,\ldots,2023\}$ that satisfy the following conditions: 1. For any function $f \in \mathcal{A}$ and any two integers $x, y$ ($1 \leq x < y \leq 2023$), it holds that $f(x) \geq f(y)$. 2. For any functions $f, g \in \mathcal{A}$ and any integer $x$ ($1 \leq x \leq 2023$), it holds that $f(g(x)) = g(f(g(x)))$. is $\binom{2022}{1011}$.","import Mathlib open Finset theorem max_num : IsGreatest {n | ∃ A : Finset (Fin 2023 → Fin 2023), A.card = n ∧ (∀ f ∈ A, ∀ x y : Fin 2023, x ≠ y → x < y → f x ≥ f y) ∧ (∀ f ∈ A, ∀ g ∈ A, ∀ x : Fin 2023, f (g x) = g (f (g x)))} (Nat.choose 2022 1011) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-330010,"Prove that the number of ways \(g(n)\) to tile the border of a triangular grid composed of hexagons, where the length of each side of the triangle is \(n\), using only \(1 \times 1\) and \(1 \times 2\) hexagon tiles is given by the following formula: \[ g(n) = \begin{cases} 27 & \text{if } n = 3 \\ F_{3n-4} + 2F_{3n-5} + 3F_{3n-6} + 3F_{n-4} \cdot F_{2n-5} + F_{n-4}^3 & \text{if } n \geq 4 \end{cases} \] where \(F_k\) represents the \(k\) - th Fibonacci number.","import Mathlib open Finset theorem g {g : ℕ → ℕ} (hg : ∀ n, g n = if n = 3 then 27 else (Nat.fib (3 * n - 4) + 2 * Nat.fib (3 * n - 5) + 3 * Nat.fib (3 * n - 6) + 3 * Nat.fib (n - 4) * Nat.fib (2 * n - 5) + Nat.fib (n - 4) ^ 3)) : True := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-330075,"Let integer $n \geq 2$, $x_{1}, x_{2}, \cdots, x_{n} > 0$, and define $k = \frac{\left(\sum_{i=1}^{n} x_{i}\right)^{n-1}}{n^{n-2} \sum_{i=1}^{n} \frac{1}{x_{i}}}$. Prove that: $$ \frac{\left(\sum_{i=1}^{n} x_{i}\right)^{n} \left(\sum_{i=1}^{n} \frac{1}{x_{i}}\right)}{n^{n+1}} \cdot \sqrt{\frac{\mathrm{C}_{n}^{2}}{\sum_{1 \leq i < j \leq n} \frac{1}{x_{i} x_{j}}}} \cdot \sum_{i=1}^{n} \frac{1}{k + (n-1) x_{i}^{n}} \geq 1. $$","import Mathlib open Real theorem qwen {n : ℕ} (hn : 2 ≤ n) (x : Fin n → ℝ) (hx : ∀ i, 0 < x i) (k : ℝ) (hk : k = (∑ i, x i) ^ (n - 1) / (n ^ (n - 2) * ∑ i, 1 / x i)) : ((∑ i, x i) ^ n * (∑ i, 1 / x i)) / (n ^ (n + 1)) * sqrt ((Nat.choose n 2) / ∑ i, ∑ j, if i < j then 1 / (x i * x j) else 0) * ∑ i, 1 / (k + (n - 1) * (x i) ^ n) ≥ 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-330477,"Prove that if we have a sequence \(a_0, a_1, \ldots, a_9\) of distinct positive integers such that \(a_0 = 1\), \(a_i < 512\) for all \(i\), and for every \(1 \le k \le 9\), there exists \(0 \le m \le k - 1\) such that \((a_k - 2a_m)(a_k - 2a_m - 1)=0\), and \(N\) is the number of such sequences, then the remainder when \(N\) is divided by \(1000\) is \(288\).","import Mathlib theorem prove (a : Fin 10 → ℕ) (ha : ∀ i, a i > 0) (hdist : ∀ i j, a i = a j → i = j) (h0 : a 0 = 1) (h512 : ∀ i, a i < 512) (hk : ∀ k, ∃ m, m ≤ k - 1 ∧ (a k - 2 * a m) * (a k - 2 * a m - 1) = 0) : {a' : Fin 10 → ℕ | (∀ i, a' i > 0) ∧ (∀ i j, a' i = a' j → i = j) ∧ a' 0 = 1 ∧ (∀ i, a' i < 512) ∧ (∀ k, ∃ m, m ≤ k - 1 ∧ (a' k - 2 * a' m) * (a' k - 2 * a' m - 1) = 0)}.ncard % 1000 = 288 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-330919,"Prove that there exists an infinite sequence of positive integers \(a_1, a_2, a_3, \ldots\) such that: 1. Each positive integer occurs exactly once in the sequence. 2. Each positive integer occurs exactly once in the sequence of absolute differences \(|a_1 - a_2|, |a_2 - a_3|, \ldots\).","import Mathlib theorem existence : ∃ (a : ℕ → ℤ), (∀ i, 0 < a i) ∧ (∀ n, 0 < n → (∃! i, a i = n)) ∧ (∀ n, 0 < n → (∃! i, |a i - a (i + 1)| = n)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-331246,"Consider a sequence \(a_1, a_2, \ldots\) consisting of \(1\)'s and \(0\)'s, which satisfies the condition for all \(k > 2016\): \[ a_k = 0 \quad \Longleftrightarrow \quad a_{k-1} + a_{k-2} + \cdots + a_{k-2016} > 23. \] Prove that there exist positive integers \(N\) and \(T = 2017\) such that \(a_k = a_{k+T}\) for all \(k > N\).","import Mathlib theorem qwen (a : ℕ → Fin 2) (h : ∀ k, 2016 < k → a k = 0 ↔ ∑ i ∈ Finset.range 2016, a (k - i - 1) > 23) : ∃ N T, 0 < N ∧ T = 2017 ∧ ∀ k, N < k → a k = a (k + T) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-331360,"Determine the number of sequences of 2022 natural numbers \( n_1, n_2, n_3, \ldots, n_{2022} \) such that: - \( n_{i+1} \geq n_i \) for all \( i \), - there is at least one number \( i \) such that \( n_i = 2022 \), - for every pair \( (i, j) \), the sum \( n_1 + n_2 + \ldots + n_{2022} - n_i - n_j \) is divisible by both \( n_i \) and \( n_j \). Prove that the answer is 1.","import Mathlib theorem determine : Set.ncard {n : Fin 2022 → ℕ | (∀ i j, i < j → n i ≤ n j) ∧ ∃ i, n i = 2022 ∧ ∀ i j, i ≠ j → (Finset.sum (Finset.univ \ {i, j}) fun k => n k) % n i = 0 ∧ (Finset.sum (Finset.univ \ {i, j}) fun k => n k) % n j = 0} = 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-331407,"Determine the limit \( \lim_{n \to + \infty} \frac{f(n)}{n!} \), where \( f(n) \) is the number of permutations \( \sigma \) of \( \{1, 2, \ldots, n\} \) such that \( \sigma(i) \neq i \) for all \( i = 1, 2, \ldots, n \) and there are no \( 1 \leq i < j \leq n \) such that \( \sigma(i) = j \) and \( \sigma(j) = i \). Prove that the answer is e^{-3/2}.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (f : ℕ → ℝ) (h₀ : ∀ n, f n = {σ : Equiv.Perm (Fin n) | (∀ i, σ i ≠ i) ∧ ¬∃ i j, i ≠ j ∧ σ i = j ∧ σ j = i}.ncard / Nat.factorial n) : Tendsto f atTop (𝓝 (Real.exp (-3/2))) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-331523,"Prove that \(\sum_{n \ge 0} p(n)x^n = \sum_{k \ge 0} x^k \prod_{i=1}^{k} \frac{1}{1 - x^i}\), where \(p(n)\) denotes the number of partitions of \(n\) and \((k)! \) is interpreted as the \(q\) - binomial coefficient with \((k)=1 + x + x^2+\ldots + x^{k - 1}\).","import Mathlib open Real open scoped BigOperators theorem prove {p : ℕ → ℕ} (hp : ∀ n, p n = {s : Finset ℕ | s.sum id = n}.ncard) : ∀ x, ∑' n, p n * x ^ n = ∑' k, x ^ k * ∏ i ∈ Finset.Icc 1 k, 1 / (1 - x ^ i) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-331630,"We will say that a list of positive integers is *admissible* if all its numbers are less than or equal to $100$ and their sum is greater than $1810$. Find the smallest positive integer $d$ such that from each admissible list, some numbers can be crossed out such that the sum of the numbers left uncrossed is greater than or equal to $1810-d$ and less than or equal to $1810+d$. prove that answer is 10","import Mathlib def isAdmissible (a : Finset ℕ) := ∀ n ∈ a, n ≤ 100 ∧ ∑ n ∈ a, n > 1810 theorem solution : IsLeast {d | 0 < d ∧ ∀ a : Finset ℕ, isAdmissible a → ∃ b : Finset ℕ, b ⊆ a ∧ ∑ n ∈ b, n ≥ 1810 - d ∧ ∑ n ∈ b, n ≤ 1810 + d} 10 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DAPO-Math-17k, flc-331706,"Let $n$ be a positive integer. Let $f(n)$ be the probability that, if divisors $a, b, c$ of $n$ are selected uniformly at random with replacement, then \( \gcd(a, \text{lcm}(b, c)) = \text{lcm}(a, \gcd(b, c)) \). Let $s(n)$ be the sum of the distinct prime divisors of $n$. If \( f(n) < \frac{1}{2018} \), compute the smallest possible value of $s(n)$. prove that answer is 58","import Mathlib open Finset Real theorem min {f : ℕ → ℝ} (hf : ∀ n, f n = (∑ a ∈ n.divisors, ∑ b ∈ n.divisors, ∑ c ∈ n.divisors, if Nat.gcd a (Nat.lcm b c) = Nat.lcm a (Nat.gcd b c) then 1 else 0) / (n.divisors.card ^ 3)) : IsLeast {x | ∃ n, x = ∑ p ∈ n.primeFactors, p ∧ f n < 1 / 2018} 58 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DAPO-Math-17k, flc-331795,"Prove that the maximum possible value of the number \(m_{A}\) of three - element subsequences \((a_{i}, a_{j}, a_{k})\) of a sequence \(A=(a_{1},a_{2},\ldots,a_{2006})\) of positive integers, where \(1\leq i < j < k\leq2006\), \(a_{j}=a_{i} + 1\), and \(a_{k}=a_{j}+1\), is \(298970748\).","import Mathlib open Finset theorem prove : IsGreatest {x | ∃ A : ℕ → ℕ, (∀ i ∈ Icc 1 2006, A i > 0) ∧ x = {p : (Icc 1 2006 × Icc 1 2006 × Icc 1 2006) | ∃ i j k, p = (i, j, k) ∧ i < j ∧ j < k ∧ A j = A i + 1 ∧ A k = A j + 1}.ncard} 298970748 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-332427,"Determine all real numbers \( C \) such that for any integer \( n \geq 2 \), there exists a ""naughty set"" in an \( n \times n \) grid containing at most \( Cn^2 \) small squares. Prove that the answer is \dfrac{1}{2}.","import Mathlib open Finset Real theorem determine_C (C : ℝ) : (∀ n ≥ 2, ∃ s : Finset (Fin n × Fin n), s.card ≤ C * n ^ 2 ∧ ∀ x ∈ s, x.1 ≠ x.2) ↔ C = 1 / 2 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-332549,"Determine the number of positive integers, each with exactly \(2^{2005}\) digits, where each digit is either 7 or 8, such that among any two chosen integers, at most half of their corresponding digits are the same. Prove that the answer is 2^{2006}.","import Mathlib theorem solution : Set.ncard {n : ℕ | n > 0 ∧ (Nat.digits 10 n).length = 2^2005 ∧ ∀ d ∈ (Nat.digits 10 n), d = 7 ∨ d = 8 ∧ ∀ m, m ≠ n → {i | i ∈ Finset.range (2^2005) ∧ (Nat.digits 10 n)[i]! = (Nat.digits 10 m)[i]!}.ncard ≤ (2^2005 / 2)} = 2^2006 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-332582,"In a school with $n$ students, each student has exactly 2023 friends. Additionally, any two students who are not friends have exactly 2022 mutual friends. Determine all possible values of $n$. Prove that the answer is 2024.","import Mathlib theorem n : {n | ∃ f : Fin n → Fin n → Bool, (∀ i j, f i j = f j i) ∧ (∀ i, {j | f i j}.encard = 2023) ∧ (∀ i j, ¬f i j → {k | f k i ∧ f k j}.encard = 2022)} = {2024} := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-332806,"Determine the number of ordered nine-tuples \( (a_1, a_2, \ldots, a_9) \) of positive integers such that for any distinct indices \( 1 \leq i < j < k \leq 9 \), there exists an index \( l \) (different from \( i, j, k \) and \( 1 \leq l \leq 9 \)) such that \( a_i + a_j + a_k + a_l = 100 \). Prove that the answer is 3457.","import Mathlib theorem solution : {(a : Fin 9 → ℕ) | (∀ i, 0 < a i) ∧ (∀ i j k : Fin 9, i ≠ j ∧ i ≠ k ∧ j ≠ k → ∃ l : Fin 9, l ≠ i ∧ l ≠ j ∧ l ≠ k ∧ a i + a j + a k + a l = 100)}.ncard = 3457 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-333406,"1. **Case 1: When \(1\leq k\)** - Prove that the number of positive integers \(n < 3^8\) such that the number of positive integers \(k\) (\(1 \leq k \leq \frac{n}{3}\)) for which the expression \(\frac{n!}{(n - 3k)!\cdot k!\cdot3^{k + 1}}\) is not an integer is exactly 216 is \(0\). 2. **Case 2: When \(0\leq k\)** - Prove that the number of positive integers \(n < 3^8\) such that the number of non - negative integers \(k\) (\(0 \leq k \leq \frac{n}{3}\)) for which the expression \(\frac{n!}{(n - 3k)!\cdot k!\cdot3^{k + 1}}\) is not an integer is exactly 216 is \(420\).","import Mathlib open Finset theorem case1 (f : ℕ → ℕ) (h₀ : ∀ n, f n = {k | 1 ≤ k ∧ k ≤ n / 3 ∧ ¬∃ m : ℤ, Nat.factorial n / ((Nat.factorial (n - 3 * k)) * (Nat.factorial k) * (3 ^ (k + 1))) = m}.ncard) : {n | 0 < n ∧ n < 3 ^ 8 ∧ f n = 216}.encard = 0 := by sorry theorem case2 (f : ℕ → ℕ) (h₀ : ∀ n, f n = {k | 0 ≤ k ∧ k ≤ n / 3 ∧ ¬∃ m : ℤ, Nat.factorial n / ((Nat.factorial (n - 3 * k)) * (Nat.factorial k) * (3 ^ (k + 1))) = m}.ncard) : {n | 0 < n ∧ n < 3 ^ 8 ∧ f n = 216}.encard = 420 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-333837,"Let $p \geq 5$ be a prime number, and let $r$ be the number of ways to place $p$ identical checkers on a $p \times p$ checkerboard such that not all checkers are in the same row (though they may be in the same column). Prove that \( p^5 \mid r \).","import Mathlib theorem qwen (p : ℕ) (hp : Nat.Prime p) (h : 5 ≤ p) : p ^ 5 ∣ {s : Finset (Fin p × Fin p) | s.card = p ∧ ¬(∃ r : Fin p, ∀ c : Fin p, (r, c) ∈ s)}.ncard := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-334007,"Prove that the number of distinct elements in the set \(S = \{a_0, a_1, \ldots, a_{2009}\}\), where \(g: \mathbb{Z} \to \{0,1\}\) is defined by \(g(n) = 0\) if \(n < 0\) and \(g(n) = 1\) otherwise, \(f: \mathbb{Z} \to \mathbb{Z}\) is defined by \(f(n) = n - 1024g(n - 1024)\) for all \(n \in \mathbb{Z}\), \(a_0 = 1\), and \(a_{n + 1} = 2f(a_n) + \ell\) with \(\ell = 0\) if \(\prod_{i = 0}^n{\left(2f(a_n) + 1 - a_i\right)} = 0\) and \(\ell = 1\) otherwise, is \(2048\).","import Mathlib open Finset theorem prove {g : ℤ → ℕ} (hg : ∀ n, g n = if n < 0 then 0 else 1) (f : ℤ → ℤ) (hf : ∀ n, f n = n - 1024 * g (n - 1024)) (a : ℕ → ℤ) (ha0 : a 0 = 1) (han : ∀ n, a (n + 1) = 2 * f (a n) + if (∏ i ∈ Icc 0 n, (2 * f (a n) + 1 - a i)) = 0 then 0 else 1) : Set.ncard {x | ∃ n, x = a n ∧ n ∈ Icc 0 2009} = 2048 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-334250,"Prove that the greatest positive integer $r$ such that, for any coloring of the positive integers using $r$ colors, there always exist two integers $x$ and $y$ of the same color with $\alpha \leq \frac{x}{y} \leq \beta$ (where $\alpha, \beta$ are real numbers such that $1 < \alpha < \beta$) is $r = \lfloor \log_\alpha \beta \rfloor + 1$.","import Mathlib open Real theorem prove {α β : ℝ} (hα : 1 < α) (hβ : α < β) : IsGreatest {r | ∀ f : ℕ → Fin r, ∃ x y, x ≠ y ∧ f x = f y ∧ α ≤ (x / y : ℝ) ∧ (x / y : ℝ) ≤ β} (Nat.floor (logb α β) + 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-334586,"Prove that \(\lim_{n\to\infty}\frac{1}{n}\sqrt[2^{n}]{n^{C_{n}^{0}}(n+1)^{C_{n}^{1}}\ldots (n+n)^{C_{n}^{n}}}=\sqrt{e}\), where \(C_n^k = \binom{n}{k}\) is the binomial coefficient.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (C : ℕ → ℝ) (hC : ∀ n, C n = ∏ i ∈ range (n + 1), (n + i) ^ Nat.choose n i) : Tendsto (λ n => (1 / n) * (C n) ^ ((1 : ℝ) / 2 ^ n)) atTop (𝓝 (Real.sqrt (Real.exp 1))) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-334617,"Prove that if $A$ is an infinite subset of the natural numbers $\mathbb{N}$ and $f(x)$ is defined as the number of distinct solutions to the equation $a_1 + a_2 + \cdots + a_p = x$ such that $a_i \in A$ for all $i = 1, 2, \dots, p$, where $p$ is a given and fixed prime number, then $f(x)$ cannot be constant (even eventually) for all $x \in \mathbb{N}$.","import Mathlib theorem algebra_439303 {A : Set ℕ} (hA : Infinite A) {p : ℕ} (hp : Nat.Prime p) (f : ℕ → ℕ) (hf : ∀ x, f x = {s : Finset.Icc 1 p → ℕ | (∀ i, s i ∈ A) ∧ ∑ i, s i = x}.ncard) : ¬∃ c, ∀ x, f x = c := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-336023,"Prove that the probabilities \(q(1)\) and \(q(0)\) that exactly \(m = 1\) and \(m = 0\) applicants, respectively, appear on all \(k = 4\) independently and randomly created top - ten lists from a pool of \(N = 70\) applicants are given by: \[ q(1) = \left[ {70 \choose 10} \right]^{-3} \sum_{j=1}^{10} j {70-j \choose 9} \sum_{i=j}^{10} {i \choose j} {70-i \choose 10-j} {10 \choose i} {60 \choose 10-i} \] \[ q(0) = \left[ {70 \choose 10} \right]^{-3} \sum_{j=0}^{10} {70-j \choose 10} \sum_{i=j}^{10} {i \choose j} {70-i \choose 10-j} {10 \choose i} {60 \choose 10-i} \]","import Mathlib open Finset Real Nat theorem proveQ1 (q1 : ℝ) (hq1 : q1 = ((Nat.choose 70 10)^(-3 : ℤ)) * ∑ j ∈ Icc 1 10, j * (Nat.choose (70 - j) 9) * ∑ i ∈ Icc j 10, (Nat.choose i j) * (Nat.choose (70 - i) (10 - j)) * (Nat.choose 10 i) * (Nat.choose 60 (10 - i))) : True := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-336122,"Prove that in a graph \(G\) with \(451\) vertices labeled \(v_1, v_2, v_3, \ldots, v_{451}\), where every pair of distinct vertices has exactly one common neighbor, the difference \(n\) between the maximum degree \(\Delta\) and the minimum degree \(\delta\) of the graph \(G\) is \(448\).","import Mathlib open Finset theorem prove (G : Fin 451 → Fin 451 → Bool) (hG : ∀ i j, i ≠ j → ∃! k, G i k ∧ G j k) : IsGreatest {x | ∃ i, x = {j | G i j}.ncard} 449 ∧ IsLeast {x | ∃ i, x = {j | G i j}.ncard} 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-337236,"Let $n$ be an odd integer greater than $11$, and let $k \in \mathbb{N}$ with $k \geq 6$ such that $n = 2k - 1$. Define the function $d(x, y) = \left| \{ i \in \{1, 2, \dots, n\} \mid x_i \neq y_i \} \right|$ for the set $T = \{ (x_1, x_2, \dots, x_n) \mid x_i \in \{0, 1\}, i = 1, 2, \dots, n \}$ and for any $x = (x_1, x_2, \dots, x_n), y = (y_1, y_2, \dots, y_n) \in T$. Prove that if $T$ has a subset $S$ satisfying the following conditions: 1. $|S| = 2^k$ 2. For each $x \in T$, there exists exactly one $y \in S$ such that $d(x, y) \leq 3$. then $n = 23$.","import Mathlib open Finset theorem qwen {n : ℕ} (hn : Odd n ∧ n > 11) (k : ℕ) (hk : k ≥ 6) (h : n = 2 * k - 1) (T : Set (Fin n → Fin 2)) (hT : T = {x | ∀ i, x i = 0 ∨ x i = 1}) (S : Set (Fin n → Fin 2)) (hS : S ⊆ T) (hS1 : S.encard = 2 ^ k) (hS2 : ∀ x ∈ T, ∃! y ∈ S, {i | x i ≠ y i}.ncard ≤ 3) : n = 23 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-337352,"Prove that the only set $A$ containing nine positive integers such that for any integer $n \leq 500$, there exists a subset $B$ of $A$ for which the sum of the elements in $B$ equals $n$ is \(A = \{1, 2, 4, 8, 16, 32, 64, 128, 256\}\).","import Mathlib theorem A : ∃! A : Finset ℕ, A.card = 9 ∧ (∀ n ∈ Finset.Icc 1 500, ∃ B ⊆ A, ∑ b ∈ B, b = n) ↔ A = {1, 2, 4, 8, 16, 32, 64, 128, 256} := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-337381,"Prove that if $S$ is a subset of $\{0,1,2,\ldots,98\}$ containing exactly $m \geq 3$ distinct elements such that for any $x, y \in S$, there exists a $z \in S$ with $x + y \equiv 2z \pmod{99}$, then the possible values of $m$ are \(m = 3, 9, 11, 33, 99\).","import Mathlib theorem prove (S : Finset ℕ) (hS : S ⊆ Finset.Icc 0 98) (m : ℕ) (hm : m ≥ 3) (hS1 : S.card = m) (hS2 : ∀ x ∈ S, ∀ y ∈ S, ∃ z ∈ S, (x + y) ≡ 2 * z [MOD 99]) : m = 3 ∨ m = 9 ∨ m = 11 ∨ m = 33 ∨ m = 99 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-337450,"Prove that the least possible number of marked squares in a $2013 \times 2013$ grid, where in every $19 \times 19$ sub - square there are at least 21 marked squares, is \(21 \times 105^2 + 4 \times 105 + 20\).","import Mathlib open Finset theorem prove : IsLeast {n | ∃ marked : Fin 2013 → Fin 2013 → Bool, (∀ i j, marked i j) ∧ n = {p | ∃ i j, p = (i, j) ∧ marked i j}.ncard ∧ ∀ i j, i < 2013 - 18 → j < 2013 - 18 → {p | ∃ k l, p = (k, l) ∧ marked k l ∧ k ≥ i ∧ l ≥ j ∧ k ≤ i + 18 ∧ l ≤ j + 18}.ncard ≥ 21} (21 * 105 ^ 2 + 4 * 105 + 20) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-338137,"Prove that for \(n > 1\), \[ \sum_{k=1}^{n-1} p(k) < \frac{1}{n+1} \binom{2n}{n}, \] where \(p(n)\) denotes the number of integer partitions of \(n\).","import Mathlib open Finset Real Nat theorem Prove {p : ℕ → ℕ} (hp : ∀ n, p n = {s : Finset ℕ | s.card > 0 ∧ ∑ i ∈ s, i = n}.ncard) : ∀ n > 1, ∑ k ∈ Icc 1 (n - 1), p k < (1 / (n + 1)) * Nat.choose (2 * n) n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-338343,"Prove that the number of ways to fill a \(2014\times2014\) grid, where each unit - square is filled with one of the letters \(A\), \(B\), \(C\), \(D\) such that every \(2\times2\) subsquare contains exactly one of each letter, is \(24\times2^{4024}\).","import Mathlib open Finset theorem prove : {f : Fin 2014 → Fin 2014 → ℕ | (∀ i j, f i j = 0 ∨ f i j = 1 ∨ f i j = 2 ∨ f i j = 3) ∧ (∀ i j, i + 1 < 2014 → j + 1 < 2014 → (f i j ≠ f (i + 1) j ∧ f i j ≠ f i (j + 1) ∧ f i j ≠ f (i + 1) (j + 1)))}.ncard = 24 * 2 ^ 4024 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-338626,"Prove that there exists a permutation \(a_0, a_1, a_2, \dots\) of the non - negative integers such that for each \(i\), \(a_{i + 1}\) can be obtained from \(a_i\) by one of the operations \(a_{i+1}=a_i + 3\), \(a_{i+1}=a_i - 3\), \(a_{i+1}=a_i\times3\), or \(a_{i+1}=a_i/3\), and also prove that there does not exist a permutation \(a_0, a_1, a_2, \dots\) of the non - negative integers such that for each \(i\), \(a_{i + 1}\) can be obtained from \(a_i\) by one of the operations \(a_{i+1}=a_i + 2\), \(a_{i+1}=a_i - 2\), \(a_{i+1}=a_i\times2\), or \(a_{i+1}=a_i/2\). Note: The assistant's answer only shows the construction for the case of 3. To fully address the user's question, the non - existence part for the case of 2 should also be included in the proof statement. If we assume the user only wants the part related to the 3 that the assistant constructed, the statement would be: Prove that there exists a permutation \(a_0, a_1, a_2, \dots\) of the non - negative integers such that for each \(i\), \(a_{i + 1}\) can be obtained from \(a_i\) by one of the operations \(a_{i+1}=a_i + 3\), \(a_{i+1}=a_i - 3\), \(a_{i+1}=a_i\times3\), or \(a_{i+1}=a_i/3\).","import Mathlib open Finset theorem exists_perm_a : ∃ a : ℕ → ℕ, (∀ i, a (i + 1) = a i + 3 ∨ a (i + 1) = a i - 3 ∨ a (i + 1) = 3 * a i ∨ a (i + 1) = a i / 3) ∧ ¬∃ b : ℕ → ℕ, (∀ i, b (i + 1) = b i + 2 ∨ b (i + 1) = b i - 2 ∨ b (i + 1) = 2 * b i ∨ b (i + 1) = b i / 2) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-338637,"Let $P(x) = 1 + 2x + 3x^2 + \cdots + (p-1)x^{p-2}$, where $p$ is a prime number. Let $\{a_0, a_1, \ldots, a_{p-1}\}$ and $\{b_0, b_1, \ldots, b_{p-1}\}$ be permutations of the set $\{0, 1, 2, \ldots, p-1\}$. Prove that the set $\{a_0P(b_0), a_1P(b_1), \ldots, a_{p-1}P(b_{p-1})\}$ contains at least two elements whose difference is divisible by $p$.","import Mathlib theorem qwen {p : ℕ} (hp : Nat.Prime p) (P : ℕ → ℕ) (hP : P = fun x => ∑ i ∈ Finset.range (p - 1), (i + 1) * x ^ i) : ∃ a b : Fin p → ℕ, (∀ i j, a i = a j → i = j) ∧ (∀ i j, b i = b j → i = j) ∧ (∀ i, a i ∈ Finset.range p) ∧ (∀ i, b i ∈ Finset.range p) ∧ ∃ i j, i ≠ j ∧ p ∣ a i * P (b i) - a j * P (b j) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-338729,"Prove that there exists a permutation \(a_0, a_1, a_2, \dots\) of the non - negative integers such that for each \(i\), \(a_{i + 1}\) satisfies \(a_{i+1}=a_i + 2\), \(a_{i+1}=a_i - 2\), \(a_{i+1}=a_i\times 2\), or \(a_{i+1}=a_i/2\). Also, determine whether there exists a permutation \(b_0, b_1, b_2, \dots\) of the non - negative integers such that for each \(i\), \(b_{i + 1}\) satisfies \(b_{i+1}=b_i + 3\), \(b_{i+1}=b_i - 3\), \(b_{i+1}=b_i\times 3\), or \(b_{i+1}=b_i/3\).","import Mathlib open Finset theorem a : ∃ p : Equiv.Perm ℕ, ∀ i, p (i + 1) = p i + 2 ∨ p (i + 1) = p i - 2 ∨ p (i + 1) = 2 * p i ∨ p (i + 1) = p i / 2 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-338902,"Prove that for an odd positive integer \(k\), there exists a permutation \(a_0, a_1, a_2, \dots\) of the non - negative integers such that for each non - negative integer \(i\), \(a_{i + 1}\) satisfies one of the following relations: \(a_{i+1}=a_i + k\), \(a_{i+1}=a_i - k\), \(a_{i+1}=a_i\times k\), or \(a_{i+1}=a_i/k\).","import Mathlib theorem OddK (k : ℕ) (hk : Odd k) : ∃ a : ℕ → ℕ, (∀ i, a (i + 1) = a i + k ∨ a (i + 1) = a i - k ∨ a (i + 1) = a i * k ∨ a (i + 1) = a i / k) ∧ (∃ p : Equiv.Perm ℕ, ∀ n, a n = p n) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-339103,"Prove that if $S$ is a set of positive integers, each having exactly $100$ digits in their base $10$ representation, where an element of $S$ is defined as an atom if it is not divisible by the sum of any two (not necessarily distinct) elements of $S$, and $S$ contains at most $10$ atoms, then the maximum number of elements that $S$ can have is $\binom{19}{10} - 1$.","import Mathlib open Finset theorem Prove(S : Finset ℕ) (hSpos : ∀ x ∈ S, x > 0) (hSdigits : ∀ x ∈ S, (Nat.digits 10 x).length = 100) (hSatom : {x | ¬∃ a b, a ∈ S ∧ b ∈ S ∧ a + b ∣ x}.encard ≤ 10) : S.card ≤ Nat.choose 19 10 - 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-339239,"Prove that the Ramsey number \(R(6,6)\), defined as the smallest integer \(n\) such that any graph of order \(n\) will contain either a clique of 6 vertices or an independent set of 6 vertices, satisfies \(R(6,6) \in [102, 165]\).","import Mathlib open Finset theorem R : 102 ≤ sInf {n | ∀ G : SimpleGraph (Fin n), ∃ S : Finset (Fin n), S.card = 6 ∧ (∀ x ∈ S, ∀ y ∈ S, x ≠ y → G.Adj x y) ∨ ∃ T : Finset (Fin n), T.card = 6 ∧ (∀ x ∈ T, ∀ y ∈ T, x ≠ y → ¬G.Adj x y)} ∧ sInf {n | ∀ G : SimpleGraph (Fin n), ∃ S : Finset (Fin n), S.card = 6 ∧ (∀ x ∈ S, ∀ y ∈ S, x ≠ y → G.Adj x y) ∨ ∃ T : Finset (Fin n), T.card = 6 ∧ (∀ x ∈ T, ∀ y ∈ T, x ≠ y → ¬G.Adj x y)} ≤ 165 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-339478,"Let $(a_n)$ be a sequence of positive integers such that the first $k$ members $a_1, a_2, \ldots, a_k$ are distinct positive integers, and for each $n > k$, the number $a_n$ is the smallest positive integer that cannot be represented as a sum of several (possibly one) of the numbers $a_1, a_2, \ldots, a_{n - 1}$. Prove that \(a_{n+1} = 2a_n\) for all sufficiently large \(n\).","import Mathlib theorem Qwen {a : ℕ → ℕ} (ha : ∀ n, 0 < a n) (hdist : ∃ k, ∀ i j, i ≠ j ∧ i ≤ k → a i ≠ a j) (hsum : ∀ n > k, IsLeast {x | 0 < x ∧ ¬∃ s : Finset ℕ, x = ∑ i ∈ s, a i ∧ s ⊆ Finset.Icc 1 (n - 1)} (a n)) : ∃ N, ∀ n, N ≤ n → a (n + 1) = 2 * a n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-339602,"Prove that the natural numbers \(n \geq 3\) for which there exists a permutation \((a_1, a_2, \ldots, a_n)\) of the set \(\{1, 2, \ldots, n\}\) such that for any three natural numbers \(i < j < k\), the condition \(n \nmid a_i + a_k - 2a_j\) holds are all \(n = 2^k\) for some integer \(k\).","import Mathlib theorem prove {n : ℕ} (hn : n ≥ 3) : ∃ p : Equiv.Perm (Fin n), ∀ i j k : Fin n, i < j ∧ j < k → ¬(n ∣ p i + p k - 2 * p j) ↔ ∃ k, n = 2 ^ k := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-339752,"Prove that the minimum possible value of \(n\) such that there exists an extraordinary subset of \(S=\{1, 2, 3, \ldots, n\}\) with \(2016\) elements, but no subset of \(S\) with \(2017\) elements is extraordinary, is \(2^{1008}\), where an extraordinary subset \(A = \{a_1, a_2, \ldots, a_k\}\) of \(S\) with \(a_1 < a_2 < \ldots < a_k\) satisfies the conditions: 1. \(\gcd(a_i, a_{i + 1})\mid a_{i+2}\) for all \(i\in\{1, 2, \ldots, k - 2\}\). 2. \(a_i\mid\text{lcm}(a_{i+1}, a_{i+2})\) for all \(i\in\{1, 2, \ldots, k - 2\}\).","import Mathlib def is_extraordinary (s : Finset ℕ) (t : Finset ℕ) := t ⊆ s ∧ ∃ k : ℕ, t.card = k ∧ (∀ i ∈ Finset.range (k - 2), Nat.gcd (t.sort LE.le)[i]! (t.sort LE.le)[i + 1]! ∣ (t.sort LE.le)[i + 2]!) ∧ (∀ i ∈ Finset.range (k - 2), (t.sort LE.le)[i]! ∣ Nat.lcm ((t.sort LE.le)[i + 1]!) ((t.sort LE.le)[i + 2]!)) theorem min_n : IsLeast {n | ∃ s : Finset ℕ, s ⊆ Finset.Icc 1 n ∧ ∃ t : Finset ℕ, is_extraordinary s t ∧ t.card = 2016 ∧ ¬∃ u : Finset ℕ, is_extraordinary s u ∧ u.card = 2017} (2 ^ 1008) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-340440,"Let $n$ be a positive integer. Consider a collection of $2n$-element subsets $S_1, S_2, \ldots, S_k$ of the set $\{1, 2, 3, \ldots, 4n-1, 4n\}$ such that for all $1 \leq i < j \leq k$, the intersection $S_i \cap S_j$ contains at most $n$ elements. Prove that \[ k \leq 6^{(n+1)/2}. \]","import Mathlib theorem Qwen (n : ℕ) (hn : 0 < n) (S : Finset (Finset ℕ)) (hS : ∀ s ∈ S, s ⊆ Finset.Icc 1 (4 * n) ∧ s.card = 2 * n) (hS' : ∀ s ∈ S, ∀ t ∈ S, s ≠ t → s ∩ t ⊆ Finset.Icc 1 (4 * n) ∧ (s ∩ t).card ≤ n) : S.card ≤ 6 ^ ((n + 1) / 2) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-340722,"Prove that the maximum value of $\sum_{A \in D} (-1)^{|A|}$, where $D$ is a family of subsets of $\{1, 2, \cdots, n\}$ such that for any $A \in D$ and any $B \subset A$, it follows that $B \in D$, is $\binom{n - 1}{2k}$, where $k = \lfloor n/4 \rfloor$.","import Mathlib open Finset theorem max_value {n : ℕ} (hn : 0 < n) : IsGreatest {x | ∃ D : Finset (Finset (Icc 1 n)), x = ∑ A ∈ D, (-1 : ℤ)^A.card ∧ ∀ A ∈ D, ∀ B ⊆ A, B ∈ D} (Nat.choose (n - 1) (Nat.floor (n / 4) * 2)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-341457,"Prove that for some natural number $n$, there exists a set of at least $\frac{n}{e^{c\sqrt{\ln n}}}$ natural numbers less than $n^{10}$ such that no three of these numbers form an arithmetic progression, where $c$ is an absolute constant.","import Mathlib open Real theorem prove (c : ℝ) (hc : |c| > 0) : ∃ n : ℕ, ∃ s : Finset ℕ, s.card ≥ n / exp (c * sqrt (log n)) ∧ ∀ m ∈ s, m < n ^ 10 ∧ ¬∃ a b c, a ≠ b ∧ a ≠ c ∧ b ≠ c ∧ a ∈ s ∧ b ∈ s ∧ c ∈ s ∧ ∃ d, b = a + d ∧ c = b + d := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-341850,"Prove that if at a social gathering, each attendee shakes hands with exactly \(50\) other attendees, for every pair of attendees who shake hands, there is exactly \(10\) other attendees who shake hands with both of them, and for every pair of attendees who do not shake hands, there are exactly \(16\) other attendees who shake hands with both of them, then the total number of attendees at the gathering is \(41\).","import Mathlib theorem prove (n : ℕ) (hn : n > 0) (a : Fin n → Fin n → Bool) (ha : ∀ i j, a i j ↔ a j i) (h1 : ∀ i, {j | a i j}.encard = 50) (h2 : ∀ i j, a i j → {k | a k i ∧ a k j}.encard = 10) (h3 : ∀ i j, ¬a i j → {k | a k i ∧ a k j}.encard = 16) : n = 41 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-341924,"Prove that there exists a binary relation $\triangleleft$ on the set of complex numbers $\mathbb{C}$ such that for all $a, b, c, d, m \in \mathbb{C}$, the following properties hold: 1. If $a \neq b$, then either $a \triangleleft b$ or $b \triangleleft a$; if $a = b$, then neither $a \triangleleft b$ nor $b \triangleleft a$. 2. If $a \triangleleft b$, then $a + m \triangleleft b + m$. 3. If $a \triangleleft b$ and $c \triangleleft d$, then $a + c \triangleleft b + d$. 4. If $a \triangleleft b$ and $b \triangleleft c$, then $a \triangleleft c$.","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem prove : ∃ triangle_left : ℂ → ℂ → Prop, (∀ a b : ℂ, a ≠ b → (triangle_left a b ∨ triangle_left b a)) ∧ (∀ a b : ℂ, a = b → ¬(triangle_left a b) ∧ ¬(triangle_left b a)) ∧ (∀ a b m : ℂ, triangle_left a b → triangle_left (a + m) (b + m)) ∧ (∀ a b c d : ℂ, triangle_left a b ∧ triangle_left c d → triangle_left (a + c) (b + d)) ∧ (∀ a b c : ℂ, triangle_left a b ∧ triangle_left b c → triangle_left a c) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-342133,"Prove that the greatest integer \(k \leq 2023\) such that for any subset \(A\) of \(\{1, 2, \dots, 2023\}\) with \(|A| = k\), there exists a subset \(B\) of \(\{1, 2, \dots, 2023\} \setminus A\) such that the sum of the elements in \(A\) equals the sum of the elements in \(B\) is \(k = \left\lfloor \dfrac{(2\times2023 + 1)-\sqrt{2023^2+(2023 + 1)^2}}{2} \right\rfloor\).","import Mathlib open Real theorem maxk : IsGreatest {k : ℕ | k ≤ 2023 ∧ ∀ A : Finset ℕ, A ⊆ Finset.Icc 1 2023 ∧ A.card = k → ∃ B : Finset ℕ, B ⊆ Finset.Icc 1 2023 \ A ∧ ∑ x ∈ A, x = ∑ x ∈ B, x} ((Nat.floor ((2 * 2023 + 1 - sqrt (2023 ^ 2 + (2023 + 1) ^ 2)) / 2))) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-342179,"Prove that all integers \(n \ge 2\) are the values for which the set of positive integers \(\mathbb{N}^*\) can be partitioned into \(n\) non - empty subsets \(A_1, A_2, \dots, A_n\) (i.e., \(A_i \neq \emptyset\) for all \(i = 1, 2, \dots, n\), \(A_i \cap A_j = \emptyset\) for all \(1 \le i < j \le n\), and \(\bigcup_{i = 1}^{n} A_i=\mathbb{N}^*\)) such that for the function \(f(A)=\{abc - b - c + 2\mid a,b,c\in A\}\), we have \(f(A_i)\subseteq A_i\) for all \(1 \le i \le n\).","import Mathlib open Finset theorem prove (n : ℕ) (hn : 2 ≤ n) : ∃ A : Fin n → Set ℕ, (∀ i j, i ≠ j → Disjoint (A i) (A j)) ∧ (∀ i, A i ≠ ∅) ∧ (∀ i, ∀ x ∈ A i, x > 0) ∧ (∀ i, {y | ∃ a b c, y = a * b * c - b - c + 2 ∧ a ∈ A i ∧ b ∈ A i ∧ c ∈ A i} ⊆ A i) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-342217,"Prove that the minimum positive integer \(n\) such that the set \(\{1, 2, 3, \ldots, 2017\}\) can be partitioned into \(n\) Akash subsets, where an Akash set is defined as a set of integers that does not contain two integers such that one divides the other, is \(n = 1712\).","import Mathlib def is_Akash (s : Finset ℕ) := ∀ m ∈ s, ∀ n ∈ s, m ≠ n → ¬(m ∣ n) theorem min_n : IsLeast {n | ∃ k : Fin n → Finset ℕ, (∀ i j, i ≠ j → Disjoint (k i) (k j)) ∧ (∀ i, is_Akash (k i)) ∧ (∀ x, x ∈ Finset.Icc 1 2017 → ∃ i, x ∈ k i)} 1712 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-342281,"a) Prove that the minimum value of \(k\) such that there is a \(k\) - balanced labeling for the given \(5\times5\) symmetric grid is \(k = 5\). b) Prove that the least value of \(k\) such that there is always a \(k\) - balanced labeling for any symmetric coloring of a \(2017\times2017\) grid is \(k=2033136\).","import Mathlib open Finset theorem a {n : ℕ} (hn : n = 5) : IsLeast {k | ∃ f : Fin n → Fin n → ℕ, (∀ i j, f i j = f j i) ∧ (∀ i j, f i j > 0) ∧ (∑ i, ∑ j, f i j) = k * n} 5 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-342737,"a) Prove that the matrix \(A = \begin{pmatrix} -0.08710621126 + 0.6554545537i & 0.3979459910 + 0.5770502608i \\ 1 & -0.4128937887 + 0.2105708500i \end{pmatrix}\) is an element of the set \(M = \left\{ \begin{pmatrix} a & b \\ c & d \end{pmatrix} \in\mathcal{M}_2(\mathbb{C})\ |\ ab = cd \right\}\) such that \(A^{2017} \in M\), \(A^{2019} \in M\), and \(A^{2018} \notin M\). b) Prove that if \(A \in M = \left\{ \begin{pmatrix} a & b \\ c & d \end{pmatrix} \in\mathcal{M}_2(\mathbb{C})\ |\ ab = cd \right\}\) and there exists an integer \(k \geq 1\) such that \(A^k \in M\), \(A^{k + 1} \in M\), and \(A^{k + 2} \in M\), then \(A^n \in M\) for any integer \(n \geq 1\).","import Mathlib open Matrix Complex Filter Function Metric Finset open scoped BigOperators Topology theorem A : (∃ A : Matrix (Fin 2) (Fin 2) ℂ, A 0 0 = -0.08710621126 + 0.6554545537 * I ∧ A 0 1 = 0.3979459910 + 0.5770502608 * I ∧ A 1 0 = 1 ∧ A 1 1 = -0.4128937887 + 0.2105708500 * I ∧ A ^ 2017 ∈ {A | ∃ a b c d : ℂ, A = !![a, b; c, d] ∧ a * b = c * d} ∧ A ^ 2019 ∈ {A | ∃ a b c d : ℂ, A = !![a, b; c, d] ∧ a * b = c * d} ∧ ¬A ^ 2018 ∈ {A | ∃ a b c d : ℂ, A = !![a, b; c, d] ∧ a * b = c * d}) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-342846,"1. First, extract the final conclusions from the assistant's answer: - The statement “if \(S' \neq \emptyset\), then \(S\) is uncountable” is not true. - If \(f\) is continuous at a countable, dense set \(S\) in some interval, then \(f\) is continuous at uncountably many points. 2. Then, rewrite the user's problem into formal math - proof statements: - **Statement 1**: Prove that the following statement is false: Let \(f\) be a function defined on \(\mathbb{R}\), and let \(S=\{x\in\mathbb{R}:f\text{ is continuous at }x\}\). If \(S'\neq\emptyset\), then \(S\) is uncountable. - **Statement 2**: Prove that if \(f\) is a function defined on \(\mathbb{R}\), \(S\) is a countable, dense set in some interval \(I\subseteq\mathbb{R}\), and \(S\subseteq\{x\in\mathbb{R}:f\text{ is continuous at }x\}\), then the set \(\{x\in\mathbb{R}:f\text{ is continuous at }x\}\) is uncountable. So, the formal math proof statements are: - Prove that the statement “Let \(f:\mathbb{R}\to\mathbb{R}\) and \(S = \{x\in\mathbb{R}:f\text{ is continuous at }x\}\). If \(S'\neq\emptyset\), then \(|S|>\aleph_0\)” is false. - Prove that if \(f:\mathbb{R}\to\mathbb{R}\), \(I\) is an interval in \(\mathbb{R}\), \(S\) is a countable, dense subset of \(I\), and \(S\subseteq\{x\in\mathbb{R}:f\text{ is continuous at }x\}\), then \(|\{x\in\mathbb{R}:f\text{ is continuous at }x\}|>\aleph_0\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem statement1 : ¬ (∀ f : ℝ → ℝ, ∀ S : Set ℝ, (S = {x | ContinuousAt f x}) → (Set.Nonempty S' → ¬ Countable S)) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-343007,"Prove that the values of \(n\) for which Arnaldo has a strategy that guarantees his victory in the following game, regardless of Bernaldo's actions, are given by the set \(\{2^a b : a, b \in \mathbb{Z}_{\ge 0}, \text{ b is odd and } b \mid k - 1\}\). The game is defined as follows: Let \(k\) and \(n\) be fixed positive integers. Consider a circular table with pins numbered \(1, 2, \dots, n\) placed consecutively, where pin \(1\) is golden and the rest are white. Arnaldo and Bernaldo play a game where a ring is initially placed on one of the pins. Bernaldo chooses the starting pin, and the game proceeds with the ring changing positions according to the following rules: 1. **Initial Step:** Arnaldo chooses a positive integer \(d\), and Bernaldo moves the ring \(d\) positions clockwise or counterclockwise (considering positions modulo \(n\)). 2. **Subsequent Steps:** At each step, Arnaldo can choose one of the following rules: - **Rule 1:** Arnaldo chooses a positive integer \(d\), and Bernaldo moves the ring \(d\) positions clockwise or counterclockwise. - **Rule 2:** Arnaldo chooses a direction (clockwise or counterclockwise), and Bernaldo moves the ring in the chosen direction by either \(d\) or \(kd\) positions, where \(d\) is the size of the last displacement performed. Arnaldo wins if, after a finite number of steps, the ring is moved to the golden pin.","import Mathlib open Finset theorem prove_arnaldo_win {k n : ℕ} (hk : 0 < k) (hn : 0 < n) : ∃ a b : ℕ, Odd b ∧ b ∣ k - 1 ∧ n = 2 ^ a * b := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-343472,"Prove that for each positive integer \(n\), if \(f(n)\) denotes the number of derangements \(\delta\) of the set \(\{1, 2, \ldots, n\}\) such that \(\delta(i) \neq i\) for all \(i = 1, 2, \ldots, n\) and there are no \(1 \leq i < j \leq n\) such that \(\delta(i) = j\) and \(\delta(j) = i\), then \(\lim_{n \to +\infty} \frac{f(n)}{n!}=e^{-\frac{3}{2}}\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (f : ℕ → ℝ) (h₀ : ∀ n, f n = {δ : Equiv.Perm (Fin n) | ∀ i, δ i ≠ i ∧ ¬∃ i j, i < j ∧ δ i = j ∧ δ j = i}.ncard) : Tendsto (λ n => f n / Nat.factorial n) atTop (𝓝 (Real.exp (-3/2))) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-344688,"Prove that if the points in the plane are colored using 100 distinct colors, then there exist three points of the same color that form the vertices of a triangle with area \(1\).","import Mathlib open Finset Real theorem prove (f : (EuclideanSpace ℝ (Fin 2)) → Fin 100) : ∃ a b c, a ≠ b ∧ b ≠ c ∧ a ≠ c ∧ f a = f b ∧ f b = f c ∧ (MeasureTheory.volume (convexHull ℝ {a, b, c})).toReal = 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-344722,"Prove that the largest positive integer \(n\) such that \(2^n\) divides the number \(S\) of bijective functions \(f:\{0,1,\dots,288\}\rightarrow\{0,1,\dots,288\}\) with the property that \(f((m + n)\pmod{17})\) is divisible by \(17\) if and only if \(f(m)+f(n)\) is divisible by \(17\) is \(n = 270\).","import Mathlib open Finset theorem number_theory_475679 : IsGreatest {n : ℕ | 0 < n ∧ 2 ^ n ∣ {f : Fin 289 → Fin 289 | Function.Bijective f ∧ ∀ m n, 17 ∣ f ((m + n) % 17) ↔ 17 ∣ f m + f n}.ncard} 270 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-345349,"Let $A_1, A_2, \dots, A_m$ be subsets of $\{1, 2, \dots, n\}$, and let $s$ be a positive integer. Suppose that for every $i$, the size of $A_i$, denoted by $|A_i|$, is not divisible by $s$, but the size of the pairwise intersection $|A_i \cap A_j|$ is divisible by $s$ for all $i \neq j$. Prove that \(m \leq 2n\) when \(s = 6\) and that for every positive integer \(s\), there exists a constant \(c_s\) such that \(m \leq c_s n\).","import Mathlib theorem SetTheory (n : ℕ) (hn : 0 < n) (s : ℕ) (hs : 0 < s) (A : Finset (Finset ℕ)) (hA : ∀ x ∈ A, x ⊆ Finset.Icc 1 n) (hA1 : ∀ x ∈ A, ¬(s ∣ x.card)) (hA2 : ∀ x ∈ A, ∀ y ∈ A, x ≠ y → s ∣ (x ∩ y).card) : (s = 6 → A.card ≤ 2 * n) ∧ (∀ s > 0, ∃ c, A.card ≤ c * n) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-345351,"Let $A_1, A_2, \dots, A_m$ be subsets of $\{1, 2, \dots, n\}$, and let $s$ be a positive integer. Suppose that for every $i$, the size of $A_i$, denoted by $|A_i|$, is not divisible by $s$, but the size of the pairwise intersection $|A_i \cap A_j|$ is divisible by $s$ for all $i \neq j$. Prove that: 1. If $s = 6$, then \(m \leq 2n\). 2. For every positive integer $s$, there exists a constant $c_s$ such that \(m \leq c_s n\).","import Mathlib theorem Qwen (m n s : ℕ) (A : Fin m → Set ℕ) (hA : ∀ i, A i ⊆ Finset.Icc 1 n) (hs : s > 0) (hA' : ∀ i, ¬(s ∣ (A i).ncard)) (hA'' : ∀ i j, i ≠ j → s ∣ (A i ∩ A j).ncard) : (s = 6 → m ≤ 2 * n) ∧ (∀ s > 0, ∃ c, m ≤ c * n) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-345608,"Prove that in a tournament where each of \(n\) teams competes against every other team exactly once with no draws, a tournament configuration exists such that for any two teams, there exists a third team that has defeated both of them if and only if \(n\) is odd and \(n \geq 7\).","import Mathlib open Finset theorem prove_tournament_configuration {n : ℕ} (hn : n > 0) : (∃ t : Fin n → Fin n → Bool, ∀ i j, i ≠ j → t i j = ¬t j i ∧ (∀ i j, i ≠ j → ∃ k, k ≠ i ∧ k ≠ j ∧ t i k ∧ t j k)) ↔ Odd n ∧ n ≥ 7 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-345627,Prove that there exists a set of \(1000000\) positive integers such that the sum of any non - empty subset of these integers is never a perfect square.,"import Mathlib theorem prove : ∃ S : Finset ℕ, S.card = 1000000 ∧ (∀ x ∈ S, x > 0) ∧ ∀ T ⊆ S, T.Nonempty → ¬ IsSquare (∑ x ∈ T, x) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-347178,"1. Prove that the special linear group \(SL(2, \mathbb{Z})\) is generated by the matrices \(\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}\) and \(\begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}\). 2. Prove that the special linear group \(SL(n, \mathbb{Z})\) is a finitely generated group. 3. Prove the following statements about the connectivity of topological groups: - Prove that \(GL(n, \mathbb{R})\) is not a connected topological group. - Prove that \(GL(n, \mathbb{C})\) is a connected topological group. - Prove that \(U(n)\), the group of unitary matrices, is a connected topological group. - Prove that \(SL(n, \mathbb{R})\) is a connected topological group. 4. Prove the following statements about the number of elements in groups over a finite field \(K\): - Prove that \(|GL(n, K)|=(|K|^n - 1)(|K|^n - |K|)(|K|^n - |K|^2) \cdots (|K|^n - |K|^{n - 1})\). - Prove that \(|SL(n, K)|=\frac{|GL(n, K)|}{|K| - 1}\). - Prove that \(|PGL(n, K)|=\frac{|GL(n, K)|}{|K| - 1}\). - Prove that \(|PSL(n, K)|=\frac{|SL(n, K)|}{\gcd(n, |K| - 1)}\).","import Mathlib open Fintype Set Real Ideal Polynomial open scoped BigOperators theorem prove_special_linear_group_2 : closure {A : Matrix (Fin 2) (Fin 2) ℤ | A.det = 1} = closure {A : Matrix (Fin 2) (Fin 2) ℤ | A = !![0, 1; 1, 0] ∨ A = !![0, -1; 1, 0]} := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-347827,"1. **For part (a)**: - Prove that in a school with \(2008\) students, where each student is a member of certain committees with each committee having at most \(1004\) members and every pair of students is a member of at least one common committee, the smallest possible number of committees is \(6\). 2. **For part (b)**: - Prove that in a school with \(2008\) students, where each student is a member of certain committees with each committee having at most \(1004\) members, every pair of students is a member of at least one common committee, and the union of any two committees consists of at most \(1800\) students, the smallest possible number of committees is \(6\).","import Mathlib theorem a {n : ℕ} (hn : n = 2008) (k : ℕ) (hk : k ≥ 6) (h : ∃ s : Finset (Finset ℕ), s.card = k ∧ (∀ t ∈ s, t.card ≤ 1004) ∧ (∀ x ∈ Finset.Icc 1 n, ∀ y ∈ Finset.Icc 1 n, x ≠ y → ∃ z ∈ s, z.card > 0 ∧ x ∈ z ∧ y ∈ z)) : k = 6 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-348374,"Prove that for positive integers $n$ and $k$ with $k \leq 2n - 1$, in a table - tennis tournament with $2n$ players and $k$ rounds (where each round consists of $n$ matches and players can face each other multiple times across different rounds), the greatest positive integer $m = f(n,k)$ such that there always exists a set of $m$ players where no two players in this set have played against each other is the largest integer $r$ such that $r - 1 < \frac{2n}{k + 1} \leq r$.","import Mathlib open Finset theorem f (n k : ℕ) (hn : 0 < n) (hk : 0 < k) (hkn : k ≤ 2 * n - 1) (a : Fin (2 * n) → Fin (2 * n) → Bool) (ha : ∀ i j, a i j ↔ a j i) : IsGreatest {x | ∃ s : Finset (Fin (2 * n)), s.card = x ∧ ∀ i ∈ s, ∀ j ∈ s, i ≠ j → ¬a i j} (Nat.ceil ((2 * n) / (k + 1))) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-348537,"Prove that for a strictly increasing sequence \(a_1 < a_2 < \cdots\) of positive integers such that each term \(a_k\) is divisible by either 1005 or 1006, but no term is divisible by 97, the least possible value of the maximal difference between consecutive terms, \(a_{i + 1}-a_i\), is \(2010\).","import Mathlib theorem g : IsLeast {x | ∃ a : ℕ → ℤ, StrictMono a ∧ (∀ k, 0 < a k) ∧ (∀ k ≥ 1, 1005 ∣ a k ∨ 1006 ∣ a k) ∧ (∀ k ≥ 1, ¬97 ∣ a k) ∧ x = sSup {(a (k + 1) - a k) | (a : ℕ → ℤ) (h₀ : ∀ i, 0 < a i) (h₁ : StrictMono a) (h₂ : ∀ k ≥ 1, 1005 ∣ a k ∨ 1006 ∣ a k) (h₃ : ∀ k ≥ 1, ¬97 ∣ a k) } } 2010 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-349446,"Let $A = \{\pm a_1, \pm a_2, \ldots, \pm a_{10}\}$ where $a_i \in \mathbb{Z}$ for $i = 1, 2, \ldots, 10$. For any natural number $m < 1024$, prove that there exists a non - empty subset $S$ of $A$ such that if $a \in S$, then $-a \not\in S$, and the sum of all elements of $S$ is divisible by $m$.","import Mathlib theorem Qwen (a : Fin 10 → ℤ) (A : Finset ℤ) (hA : A = {x | ∃ i, x = a i ∨ x = -a i}) : ∀ m < 1024, ∃ S ⊆ A, S ≠ ∅ ∧ (∀ x ∈ S, -x ∉ S) ∧ m ∣ ∑ x ∈ S, x := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-350033,"Prove that the number of distinct ways to fill a \(2 \times 2 \times 8\) box with \(16\) \(1 \times 1 \times 2\) blocks, considering that rotations and reflections of the \(2 \times 2 \times 8\) box are counted as distinct configurations, satisfies the relation \(a_{2n - 1}=15a_{2n - 3}-15a_{2n - 5}+a_{2n - 7}\) and \(c_n = b_n^2\), where \(a_{2n-1} = c_n\), \(b_1 = 1\), \(b_2 = 3\), and \(b_n = 4b_{n - 1}-b_{n - 2}\).","import Mathlib theorem prove (a b c : ℕ → ℤ) (ha : ∀ n, a (2 * n - 1) = 15 * a (2 * n - 3) - 15 * a (2 * n - 5) + a (2 * n - 7)) (hb1 : b 1 = 1) (hb2 : b 2 = 3) (hbn : ∀ n, b (n + 2) = 4 * b (n + 1) - b n) : ∀ n, a (2 * n - 1) = (b n)^2 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-351913,"Prove that for any non - negative integer \(n\), the expressions \(\frac{\sum_{k = 1}^{\infty} \frac{k^n}{k!}}{e}\) and \(e\sum_{k = 1}^{\infty} (-1)^k \frac{k^n}{k!}\) are integers.","import Mathlib open Real open scoped BigOperators theorem prove (n : ℕ) : ∃ m : ℤ, (∑' k : ℕ, if k > 0 then k^n / Nat.factorial k else 0) / exp 1 = m ∧ ∃ p : ℤ, exp 1 * ∑' k : ℕ, (-1 : ℝ)^k * k^n / Nat.factorial k = p := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-352403,"Prove that the only sequences \(a_1, a_2, \ldots, a_n\) of positive integers that satisfy the following conditions: 1. \(a_1 < a_2 < \ldots < a_n < 2n + 1\), 2. There do not exist indices \(i, j, k\) such that \(a_i + a_j = a_k\), 3. There do not exist indices \(i, j\) such that \(a_i + a_j = 2n + 1\) are the sequences \(\{1, 3, 5, \ldots, 2n - 1\}\) and \(\{n + 1, n + 2, \ldots, 2n\}\).","import Mathlib theorem prove (n : ℕ) (a : Fin n → ℕ) (ha : StrictMono a) (hpos : ∀ i, a i > 0) (hbound : ∀ i, a i < 2 * n + 1) (hnij : ¬∃ i j k, a i + a j = a k) (hnij' : ¬∃ i j, a i + a j = 2 * n + 1) : (∀ i, a i = 2 * i + 1) ∨ (∀ i, a i = n + 1 + i) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-354562,"1. Prove that the series $\sum_{k=1}^{\infty} \frac{1}{n^{(m^k)}}$ is irrational, where $m, n$ are integers greater than 1. 2. Prove that the sequence $f_n = \lfloor2^n\sqrt{2008}\rfloor + \lfloor2^n\sqrt{2009}\rfloor$ for positive integers $n$ contains infinitely many odd numbers and infinitely many even numbers. 3. Prove that it is possible to select $2^k$ distinct numbers from the set $\{0, 1, \ldots, 3^k - 1\}$ such that no three of the selected numbers form an arithmetic progression.","import Mathlib open Real theorem prove_irrational (m n : ℕ) (hm : 1 < m) (hn : 1 < n) : Irrational (∑' k : ℕ, 1 / n ^ (m ^ k)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-355474,"a) Prove that for any complete directed graph \(G\) with \(100\) vertices such that for any two vertices \(x,y\), there exists a directed path from \(x\) to \(y\), there exists a positive integer \(m\) such that for any two vertices \(x,y\), there is a directed path of length \(m\) from \(x\) to \(y\) (vertices can be repeated in the path). b) Prove that the minimum value of \(m(G)\) (where \(m(G)\) is the smallest possible positive integer \(m\) such that for any two vertices \(x,y\) in a complete directed graph \(G\) with \(100\) vertices and a directed path from any vertex \(x\) to any vertex \(y\), there is a directed path of length \(m\) from \(x\) to \(y\)) over all such possible graphs \(G\) is \(3\).","import Mathlib open Finset theorem prove_1 {G : Fin 100 → Fin 100 → Bool} (hG : ∀ x y, G x y) : ∃ m > 0, ∀ x y, ∃ p : List (Fin 100), p.length = m ∧ p[0]! = x ∧ p.getLast! = y := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-355664,"Prove that the remainder when $v_3(N)$ is divided by $2011$, where $N$ is the number of polynomials $P(x_1, x_2, \dots, x_{2016})$ of degree at most $2015$ with coefficients in the set $\{0, 1, 2\}$ such that $P(a_1, a_2, \dots, a_{2016}) \equiv 1 \pmod{3}$ for all $(a_1, a_2, \dots, a_{2016}) \in \{0, 1\}^{2016}$ and $v_3(N)$ denotes the largest integer $k$ such that $3^k \mid N$, is $\binom{4031}{2016} - 2^{2016} + 1 \pmod{2011}$.","import Mathlib open Finset theorem prove {N : ℕ} (hN : N = {P : MvPolynomial (Fin 2016) ℤ | P.totalDegree ≤ 2015 ∧ ∀ i, MvPolynomial.coeff i P ∈ Icc 0 2 ∧ ∀ a : Fin 2016 → ℤ, (∀ i, a i = 0 ∨ a i = 1) → MvPolynomial.eval a P ≡ 1 [ZMOD 3]}.ncard) : Nat.factorization N 3 % 2011 = Nat.choose 4031 2016 - 2^2016 + 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-356503,"Prove that the number of permutations \(a_1, a_2, a_3, \ldots, a_{2016}\) of the integers \(1, 2, 3, \ldots, 2016\) such that \(|a_i - i| = 3k\) for a fixed integer \(k\) and for all \(i = 1, 2, 3, \ldots, 2016\) is given by \[ |A_k| = \begin{cases} 1 & \text{if } 6k \text{ divides } 2016, \\ 0 & \text{otherwise}. \end{cases} \]","import Mathlib theorem CountPermutations (k : ℤ) : Set.ncard {a : Fin 2016 → ℤ | ∃ p : Equiv.Perm (Fin 2016), ∀ i, a i = p i + 1 ∧ |a i - (i + 1)| = 3 * k} = if 6 * k ∣ 2016 then 1 else 0 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-357314,"(a) Prove that if in the country of Heptanomisma, there are four distinct coins and three distinct banknotes with unique natural - number denominations, where the denomination of the smallest banknote exceeds the sum of the denominations of the four coins, and a tourist has one coin of each denomination and one banknote of each denomination, and the denomination of each banknote is less than \(49\), then the tourist can purchase a book that can be paid for in more than one way using a subset of the tourist's coins and banknotes. (b) Show that if in the country of Heptanomisma, there are four distinct coins and three distinct banknotes with unique natural - number denominations, where the denomination of the smallest banknote exceeds the sum of the denominations of the four coins, and a tourist has one coin of each denomination and one banknote of each denomination, and the denomination of the largest banknote is \(49\), then the tourist may be unable to purchase a book that can be paid for in more than one way using a subset of the tourist's coins and banknotes.","import Mathlib theorem A (C B : Finset ℕ) (hC : C.card = 4) (hB : B.card = 3) (hsum : ∑ i ∈ C, i < sInf {x | ∃ b ∈ B, x = b}) (hdb : ∀ b ∈ B, b < 49) : ∃ x, x > 0 ∧ ∃ s1 s2 : Finset ℕ, s1 ⊆ C ∪ B ∧ s2 ⊆ C ∪ B ∧ x = ∑ i ∈ s1, i ∧ x = ∑ i ∈ s2, i := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-358216,"Prove that the maximum integer \(n\) such that there exist \(n\) distinct subsets of the set \(S=\{1, 2, \ldots, 2017\}\) with the property that the union of any two of these subsets is not equal to \(S\) is \(2^{2016}\).","import Mathlib def S : Finset ℕ := Finset.Icc 1 2017 theorem max_n (n : ℕ) : (∃ s : Finset (Finset ℕ), s.card = n ∧ ∀ t ∈ s, t ⊆ S ∧ ¬∃ u ∈ s, u ≠ t ∧ t ∪ u = S) ↔ n ≤ 2^2016 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-358255,"Prove that the pairs $(k, m)$ for which Bob can guarantee a win in a game where Alice and Bob play on a $1 \times m$ board using $2012$ cards numbered from $1$ to $2012$, with Alice selecting a card at each step and Bob placing it on an empty square of the board, and Bob winning if the numbers on the cards on the board are in increasing order after $k$ steps where $1 \le k \le 2012$, are the pairs $(k, m)$ such that for $k \le 10$, $m \ge 2^k - 1$, or for $k > 10$, $m \ge 2012$.","import Mathlib theorem Prove : {(k, m) : ℕ × ℕ | 1 ≤ k ∧ k ≤ 2012 ∧ m ≥ 2 ^ k - 1} ∪ {(k, m) : ℕ × ℕ | 1 ≤ k ∧ k ≤ 2012 ∧ m ≥ 2012} = {(k, m) : ℕ × ℕ | 1 ≤ k ∧ k ≤ 2012 ∧ (m ≥ 2 ^ k - 1 ∨ m ≥ 2012)} := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-358394,"Prove that the largest integer \(k\) such that \(3^k\) divides the number of ways \(P\) to color a \(2 \times 2018\) grid of squares, where each square is colored either black or white and in any \(2 \times 2\) block at least one of the four squares is white, is \(k = 1009\).","import Mathlib open Finset theorem max_k : IsGreatest {k | 3 ^ k ∣ {p : Fin 2 → Fin 2018 → Bool | (∀ i j, p i j = True ∨ p i j = False) ∧ (∀ i j, i + 1 < 2018 → j + 1 < 2018 → p i j ∨ p (i + 1) j ∨ p i (j + 1) ∨ p (i + 1) (j + 1))}.ncard} 1009 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-358825,"Prove that the number of colorings of the integers $\{1, 2, \ldots, 2020\}$ in blue and red such that there do not exist two distinct integers in $\{1, 2, \ldots, 2020\}$ of the same color whose sum is a power of 2 is $2^{11}$.","import Mathlib theorem colorings : {(blue : Finset ℕ) | ∃ red : Finset ℕ, blue ∪ red = Finset.Icc 1 2020 ∧ blue ∩ red = ∅ ∧ ∀ x ∈ blue, ∀ y ∈ blue, x ≠ y → ¬∃ k : ℕ, x + y = 2 ^ k ∧ ∀ x ∈ red, ∀ y ∈ red, x ≠ y → ¬∃ k : ℕ, x + y = 2 ^ k}.ncard = 2 ^ 11 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-359166,"Prove that the maximum positive integer \(n\) such that there exists a permutation \(a_1, a_2, \ldots, a_{17}\) of the integers \(1, 2, \ldots, 17\) satisfying \((a_1 - a_2)(a_2 - a_3) \cdots (a_{16} - a_{17})(a_{17} - a_1) = n^{17}\) is \(n = 6\).","import Mathlib theorem max_n : IsGreatest {n > 0 | ∃ a : Fin 17 → ℤ, (∀ i j, a i = a j → i = j) ∧ (∀ i, a i ∈ Finset.Icc 1 17) ∧ ∏ i, a i - a ((i + 1) % 17) = n ^ 17} 6 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-359689,"For a \(2019\times2019\) square board, each cell is filled with either \(1\) or \(-1\). Prove that there exists a positive integer \(k = 1010\) such that one can select \(k\) rows and \(k\) columns so that the sum of the \(k^2\) numbers at the intersections of these selected rows and columns has an absolute value greater than \(1000\).","import Mathlib open Finset theorem prove_1010 (a : Fin 2019 → Fin 2019 → ℤ) (ha : ∀ i j, a i j = 1 ∨ a i j = -1) : ∃ k : ℕ, 0 < k ∧ k = 1010 ∧ ∃ s₁ s₂ : Finset (Fin 2019), s₁.card = k ∧ s₂.card = k ∧ |∑ i ∈ s₁, ∑ j ∈ s₂, a i j| > 1000 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-360330,"Prove that there exists an infinite sequence of positive integers, $\{a_n\}_{n=1}^{\infty}$, such that every positive integer appears exactly once in the sequence, and for every positive integer $n$, the sum of the first $n$ terms, $S_n = a_1 + a_2 + \ldots + a_n$, is divisible by $n$.","import Mathlib theorem Prove : ∃ a : ℕ → ℤ, (∀ n ≥ 1, a n > 0) ∧ (∀ k > 0, ∃! n ≥ 1, a n = k) ∧ (∀ n > 0, (∑ i ∈ Finset.Icc 1 n, a i) % n = 0) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-361191,"Show that it is possible to color the set of integers \(M = \{1, 2, 3, \ldots, 1987\}\) using four colors such that no arithmetic progression with \(10\) terms has all its members the same color.","import Mathlib theorem colorM : ∃ f : ℕ → Fin 4, ∀ a d : ℕ, a ∈ Finset.Icc 1 1987 ∧ d ≠ 0 → ¬(∃ c : Fin 4, ∀ i ∈ Finset.range 10, f (a + d * i) = c) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-361788,"Prove that if every positive integer has been assigned one of the colors red or blue arbitrarily, then there exists an infinite sequence of positive integers \(a_1 < a_2 < a_3 < \cdots < a_n < \cdots\) such that the sequence \(a_1, \frac{a_1 + a_2}{2}, a_2, \frac{a_2 + a_3}{2}, a_3, \frac{a_3 + a_4}{2}, \cdots\) has the same color.","import Mathlib theorem prove (f : ℕ → Fin 2) : ∃ g : ℕ → ℕ, StrictMono g ∧ ∀ n, f (g n) = f (g (n + 1)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-363668,"1. **First part**: - Prove that the minimum value of \(n\) such that for any selection of \(n\) integers, there exist three integers \(n_1\), \(n_2\), \(n_3\) and coefficients \(\lambda_i\in\{4,7\}\) for \(i = 1,2,3\) satisfying \(9\mid(\lambda_1 n_1+\lambda_2 n_2+\lambda_3 n_3)\) is \(n = 7\). 2. **Second part**: - Prove that the minimum value of \(n\) such that for any selection of \(n\) integers, there exist nine integers \(n_1,n_2,\ldots,n_9\) and coefficients \(\lambda_i\in\{4,7\}\) for \(i = 1,2,\ldots,9\) satisfying \(9\mid(\lambda_1 n_1+\lambda_2 n_2+\cdots+\lambda_9 n_9)\) is \(n = 16\).","import Mathlib theorem first_part (n : ℕ) : IsLeast {x | ∀ s : Finset ℤ, s.card = x → ∃ n1 ∈ s, ∃ n2 ∈ s, ∃ n3 ∈ s, ∃ lambda : Fin 3 → ℤ, (lambda 0 = 4 ∨ lambda 0 = 7) ∧ (lambda 1 = 4 ∨ lambda 1 = 7) ∧ (lambda 2 = 4 ∨ lambda 2 = 7) ∧ 9 ∣ (lambda 0 * n1 + lambda 1 * n2 + lambda 2 * n3)} n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-364108,"(a) Given a plane where each point is colored either red or blue and there does not exist an equilateral triangle with all vertices of the same color, prove that there exist three points \(A\), \(B\), and \(C\) of the same color such that \(B\) is the midpoint of \(AC\). (b) Given a plane where each point is colored either red or blue, prove that there exists an equilateral triangle with all vertices of the same color.","import Mathlib open Real Complex Polynomial LinearMap FiniteDimensional Module Module.End open scoped BigOperators theorem color_plane (f : ℂ → Fin 2) (h₀ : ∀ z, f z = 0 ∨ f z = 1) (h₁ : ¬∃ A B C : ℂ, A ≠ B ∧ A ≠ C ∧ B ≠ C ∧ f A = f B ∧ f B = f C ∧ dist A B = dist B C ∧ dist B C = dist A C) : ∃ A B C : ℂ, A ≠ B ∧ A ≠ C ∧ B ≠ C ∧ f A = f B ∧ f B = f C ∧ B = (A + C) / 2 := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-365461,"Prove that the set of all positive integers \(n \geq 2\) such that for all integers \(i, j\) where \(0 \leq i, j \leq n\), the sum \(i + j\) and the sum of binomial coefficients \(\binom{n}{i} + \binom{n}{j}\) have the same parity is given by \(n = 2^{t+1} - 2\), where \(t \in \mathbb{Z}^+\).","import Mathlib theorem prove (n : ℕ) : (∀ i j, i ≤ n → j ≤ n → (i + j) % 2 = (Nat.choose n i + Nat.choose n j) % 2) ↔ ∃ t, n = 2 ^ (t + 1) - 2 ∧ t > 0 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-366857,"Prove that the maximum number of perfect squares that can be contained in the set $\{ a_1^2 + a_2, a_2^2 + a_3, a_3^2 + a_4, \ldots, a_{2013}^2 + a_{2014}, a_{2014}^2 + a_1 \}$, where $a_1, a_2, \ldots, a_{2014}$ is a permutation of the integers $1, 2, 3, \ldots, 2014$, is $1006$.","import Mathlib theorem prove : IsGreatest {k | ∃ a : Fin 2014 → ℕ, (∀ i j, a i = a j → i = j) ∧ (∀ i, a i ∈ Finset.Icc 1 2014) ∧ k = {i | ∃ m, m^2 = a i ^ 2 + a ((i + 1) % 2014)}.ncard} 1006 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-367580,"Prove that it is possible to arrange the numbers \(1, 2, 3, \ldots, 2015\) in a sequence such that the arithmetic mean of any two numbers in the sequence does not lie between them.","import Mathlib theorem number_theory_8974 : ∃ seq : Fin 2015 → ℕ, (∀ i j : Fin 2015, i < j → seq i ≠ seq j) ∧ (∀ i j : Fin 2015, i + 1 ≤ j → (seq i + seq j) / (2:ℝ) ∉ Set.Ioo (seq i : ℝ) (seq j : ℝ)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-367694,"Prove that the maximum value of the integer $k$ such that there exist $k$ distinct nonempty subsets of the set $S = \{1, 2, 3, \ldots, 100\}$ with the property that for any two of these $k$ subsets, if their intersection is nonempty, then the minimal element of their intersection is not equal to the maximal element of either subset, is $2^{100 - 1}-1$.","import Mathlib open Finset theorem max_k (S : Finset ℕ) (hS : S = Icc 1 100) : IsGreatest {x | ∃ k : Finset (Finset ℕ), k.card = x ∧ (∀ T ∈ k, T ⊆ S ∧ T ≠ ∅) ∧ (∀ T ∈ k, ∀ U ∈ k, T ≠ U → (T ∩ U).Nonempty → (T ∩ U).min ≠ T.max ∧ (T ∩ U).min ≠ U.max)} (2^99 - 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-367891,"Prove that for integers \(0 \le m, n \le 64\), where \(\alpha(m, n)\) denotes the number of nonnegative integers \(k\) for which both \(\left\lfloor m/2^k \right\rfloor\) and \(\left\lfloor n/2^k \right\rfloor\) are odd, and a \(65 \times 65\) matrix \(M\) whose \((i, j)\) - th entry (for \(1 \le i, j \le 65\)) is given by \((-1)^{\alpha(i - 1, j - 1)}\), the remainder when the determinant of \(M\) is divided by \(1000\) is \(208\).","import Mathlib open Matrix Finset theorem prove_determinant {α : ℤ → ℤ → ℕ} (hα : ∀ m n, α m n = {k | 0 ≤ k ∧ Odd (⌊m / 2 ^ k⌋) ∧ Odd (⌊n / 2 ^ k⌋)}.ncard) (M : Matrix (Fin 65) (Fin 65) ℤ) (hM : ∀ i j, M i j = (-1) ^ α (i - 1) (j - 1)) : M.det % 1000 = 208 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-368774,"1. **Part (a)**: Prove that if \((n,k)\) is a lovely couple (where a lovely couple \((n,k)\) with \(k > 1\) is defined as an \(n\times n\) table consisting of ones and zeros such that in every row, there are exactly \(k\) ones and for each pair of rows, there is exactly one column such that both intersections of that column with the mentioned rows contain a one) and \(d\neq1\) is a divisor of \(n\), then the only possible remainders that \(d\) can give when divided by \(6\) are \(1\) and \(3\). 2. **Part (b)**: Prove that for any prime \(p\), the pair \((p^2 + p + 1,p + 1)\) is a lovely couple, and thus there exist infinitely many lovely couples.","import Mathlib open Finset theorem a {n k d : ℕ} (hn : n > 0) (hk : k > 1) (h : ∃ f : Fin n → Fin n → Bool, (∀ i j, f i j = 0 ∨ f i j = 1) ∧ (∀ i, {j | f i j}.encard = k) ∧ (∀ i j, ∃! k, f i k ∧ f j k)) : d ∣ n → d ≠ 1 → (d % 6 = 1 ∨ d % 6 = 3) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-368813,"Let $a_1, a_2, \dots, a_{2016}$ and $b_1, b_2, \dots, b_{2016}$ be permutations of the set $\left\{1, \frac{1}{2}, \frac{1}{3}, \dots, \frac{1}{2016}\right\}$ such that the sequence $a_1 + b_1, a_2 + b_2, \dots, a_{2016} + b_{2016}$ is non - increasing. Prove that for all $k = 1, 2, \dots, 2016$, the inequality $a_k + b_k \geq \frac{4}{k + 2017}$ holds.","import Mathlib theorem Qwen (a b : Fin 2016 → ℝ) (ha : ∃ p : Equiv.Perm (Fin 2016), ∀ i, a i = 1 / (p i + 1)) (hb : ∃ q : Equiv.Perm (Fin 2016), ∀ i, b i = 1 / (q i + 1)) (hinc : ∀ i j, i < j → a i + b i ≥ a j + b j) : ∀ k, a k + b k ≥ 4 / (k + 2017) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-369259,"Prove that there is no bijective function $F: \mathbb{N} \rightarrow S$, where $S$ is the set of all bijective functions $\varphi: \mathbb{N} \rightarrow \mathbb{N}$.","import Mathlib open Function theorem no_bijective : ¬ ∃ f : ℕ → (ℕ → ℕ), ∀ i j : ℕ, i ≠ j → f i ≠ f j ∧ (∀ g : ℕ → ℕ, Function.Bijective g → ∃! i' : ℕ, f i' = g i) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-369369,"a) Prove that the number of pentagons that can be formed by choosing five of the \(2n\) vertices of a \(2n\) - vertex equilateral polygon inscribed in its circumcircle \((O)\) such that the circumcenter \(O\) lies strictly inside the pentagon (i.e., \(O\) does not lie on any of the edges of the pentagon) is \(\binom{2n}{5} - \frac{n(n-1)(n-2)(n-3)}{12}\). b) Prove that the number of pentagons that can be formed by choosing five of the \(2n\) vertices of a \(2n\) - vertex equilateral polygon inscribed in its circumcircle \((O)\) such that the circumcenter \(O\) lies inside the pentagon formed by the intersections of the diagonals of the original pentagon is \(\frac{n(n-1)(n-2)(n-3)(n-4)}{120}\).","import Mathlib open Real open scoped BigOperators theorem pentagonal {n : ℕ} (hn : n > 0) : {s : Finset (Fin (2 * n)) | s.card = 5 ∧ ¬∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ x + y = 2 * n}.ncard = Nat.choose (2 * n) 5 - n * (n - 1) * (n - 2) * (n - 3) / 12 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-369560,"Prove that if Alex starts at the origin \(O\) of a hexagonal lattice and moves to one of the six adjacent vertices every second, and after \(2018\) moves is at vertex \(X\), and the probability \(p\) that the shortest path from \(O\) to \(X\) (where a valid move is from a vertex to an adjacent vertex) has length \(2018\) is expressed as \(\frac{a^m - b}{c^n}\), with \(a\), \(b\), and \(c\) being positive integers less than \(10\), \(a\) and \(c\) not being perfect squares, and \(m\) and \(n\) being positive integers less than \(10000\), then \(a + b + c + m + n = 4044\).","import Mathlib theorem prove_a (a b c m n : ℕ) (ha : 0 < a ∧ a < 10) (hb : 0 < b ∧ b < 10) (hc : 0 < c ∧ c < 10) (h : ¬ ∃ m' : ℕ, m'^2 = a) (h' : ¬ ∃ c' : ℕ, c'^2 = c) (hm : 0 < m ∧ m < 10000) (hn : 0 < n ∧ n < 10000) (p : ℚ) (hp : p = (a ^ m - b) / (c ^ n)) : a + b + c + m + n = 4044 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-369741,"Let $x_1, x_2, \ldots, x_{2018}$ be positive real numbers such that $\sum_{i = 1}^{2018}x_i = 1$. Define the set \[ F = \{S \subset \{1,2,3,\ldots,2018\} : |S| = 100 \text{ and } \sum_{i \in S} x_i \geq \frac{1}{2}\}. \] Prove that the maximum possible value of $|F|$ is $\binom{2017}{99}$.","import Mathlib open Finset Real Nat theorem max_value : IsGreatest {k | ∃ x : ℕ → ℝ, (∀ i ∈ Icc 1 2018, 0 < x i) ∧ (∑ i ∈ Icc 1 2018, x i) = 1 ∧ k = {S : Finset ℕ | S ⊆ Icc 1 2018 ∧ S.card = 100 ∧ ∑ i ∈ S, x i ≥ 1 / 2}.ncard} (Nat.choose 2017 99) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-370740,"Prove that for a positive integer $n$, if an $n$-steak is defined as a set $S$ of integers such that for every integer $k$ with $0 \le k \le n$, there exist distinct elements $a_1, a_2, \ldots, a_m$ in $S$ whose sum equals $2^k$, then there exists a positive real number $C = \log \sqrt{2}$ such that for every $n$-steak $S$ with $n > 1$, the cardinality of $S$ is at least $\frac{Cn}{\log n}$.","import Mathlib open Real Set open scoped BigOperators theorem prove_n_steak (n : ℕ) (hn : 1 < n) : ∃ C > 0, C = log (sqrt 2) ∧ ∀ S : Finset ℕ, (∀ k ∈ Icc 0 n, ∃ m : Finset ℕ, m ⊆ S ∧ ∑ i ∈ m, i = 2 ^ k) → S.card ≥ C * n / log n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-371113,"Prove that for a positive integer \(n \geq 3\), Lizzie can always win the game where Alex chooses \(n\) positive integers (not necessarily distinct) and writes them on a blackboard, and Lizzie is allowed to pick some of the numbers (but not all of them) and replace them each by their average, repeating the process as many times as she wants, if and only if \(n\) is composite.","import Mathlib open Finset Real theorem prove_lizzie_win (n : ℕ) (hn : 3 ≤ n) : ¬(∃ s : Finset ℕ, s.card = n ∧ ∀ i ∈ s, 0 < i ∧ ∃ t : Finset ℕ, t ⊆ s ∧ t.card > 0 ∧ (∑ i ∈ t, i) / t.card = (s.sum id) / n) ↔ ¬Nat.Prime n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-371268,"Prove that the maximum possible size of a set \(S\) of positive integers less than \(p = 2^{16}+1\) (where \(p\) is a prime number) such that for any two distinct elements \(a,b\in S\), the congruence \(a^{2}\not\equiv b\pmod{p}\) holds is \(43691\).","import Mathlib theorem max_size {p : ℕ} (hp : Nat.Prime p) (hp_value : p = 2 ^ 16 + 1) : IsGreatest {x | ∃ S : Finset ℕ, S.card = x ∧ (∀ y ∈ S, 0 < y ∧ y < p) ∧ (∀ a ∈ S, ∀ b ∈ S, a ≠ b → ¬(a^2 ≡ b [MOD p]))} 43691 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-371273,"1. **Part (a)**: - The final conclusion for part (a) is that there are not infinitely many good numbers. - The formal math proof statement is: ""Prove that the set of natural numbers \(n\) such that there exist \(2n\) fractions with numerators and denominators pairwise - distinct and belonging to the set \(\{1,2,\ldots,4n\}\), where the product of any \(n\) of these fractions is an integer and the product of any \(n + 1\) of these fractions is not an integer, is finite."" 2. **Part (b)**: - The final conclusion for part (b) is that there are infinitely many bad numbers. - The formal math proof statement is: ""Prove that the set of natural numbers \(n\) that do not satisfy the condition of having \(2n\) fractions with numerators and denominators pairwise - distinct and belonging to the set \(\{1,2,\ldots,4n\}\), where the product of any \(n\) of these fractions is an integer and the product of any \(n + 1\) of these fractions is not an integer, is infinite.""","import Mathlib open Finset theorem part_a : {n : ℕ | ∃ s : Finset (ℕ × ℕ), s.card = 2 * n ∧ (∀ x ∈ s, ∀ y ∈ s, x ≠ y → x.1 ≠ y.1 ∧ x.2 ≠ y.2) ∧ (∀ x ∈ s, x.1 ∈ Icc 1 (4 * n)) ∧ (∀ x ∈ s, x.2 ∈ Icc 1 (4 * n)) ∧ (∀ t ⊆ s, t.card = n → ∃ k : ℤ, ∏ x ∈ t, x.1 / x.2 = k) ∧ (∀ t ⊆ s, t.card = n + 1 → ¬∃ k : ℤ, ∏ x ∈ t, x.1 / x.2 = k)}.Finite := by sorry theorem part_b : {n : ℕ | ¬∃ s : Finset (ℕ × ℕ), s.card = 2 * n ∧ (∀ x ∈ s, ∀ y ∈ s, x ≠ y → x.1 ≠ y.1 ∧ x.2 ≠ y.2) ∧ (∀ x ∈ s, x.1 ∈ Icc 1 (4 * n)) ∧ (∀ x ∈ s, x.2 ∈ Icc 1 (4 * n)) ∧ (∀ t ⊆ s, t.card = n → ∃ k : ℤ, ∏ x ∈ t, x.1 / x.2 = k) ∧ (∀ t ⊆ s, t.card = n + 1 → ¬∃ k : ℤ, ∏ x ∈ t, x.1 / x.2 = k)}.Infinite := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-372333,"In a tournament with \(n\) players, it is given that for any group of \(m\) players, there exists a player who beats all of them. Prove that \(n \ge 2^{m+1} - 1\).","import Mathlib theorem in_tournament {n m : ℕ} (hn : n > 0) (hm : m > 0) (h : ∀ s : Finset ℕ, s ⊆ Finset.Icc 1 n ∧ s.card = m → ∃ x ∈ s, ∀ y ∈ s, x ≠ y → x > y) : n ≥ 2 ^ (m + 1) - 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-373016,"Prove that for an integer \(n \geq 3\) and an \(n\times n\) matrix \(M_n\) over \(\mathbb{Z}\) where \((M_n)_{i,j} = 1\) if \(i - j \equiv 1 \text{ or } -1 \pmod{n}\) and \((M_n)_{i,j} = 0\) otherwise, and a fixed positive integer \(m\): - If \(2k < n\), then \(\text{tr}(M_n^{2k}) = 2n \binom{2k - 1}{k}\). - If \(2k+1 < n\), then \(\text{tr}(M_n^{2k + 1}) = 0\). - If \(n\) is odd, then \(\text{tr}(M_n^{n}) = 2n\). - If \(n\) is even, then \(\text{tr}(M_n^{n}) = 2n \left( \binom{n - 1}{n/2}+1 \right)\).","import Mathlib open Matrix Finset theorem prove {n : ℕ} (hn : 3 ≤ n) (M : Matrix (Fin n) (Fin n) ℤ) (hM : ∀ i j, M i j = if (i.1 - j.1) ≡ 1 [ZMOD n] ∨ (i.1 - j.1) ≡ -1 [ZMOD n] then 1 else 0) (k : ℕ) (hk : 0 < k) : (2 * k < n → (M ^ (2 * k)).trace = 2 * n * Nat.choose (2 * k - 1) k) ∧ (2 * k + 1 < n → (M ^ (2 * k + 1)).trace = 0) ∧ (Odd n → (M ^ n).trace = 2 * n) ∧ (Even n → (M ^ n).trace = 2 * n * (Nat.choose (n - 1) (n / 2) + 1)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-373490,"1. **First part**: - The user's problem already starts with the phrase ""Prove that"", so the first part of the formal proof statement remains as: - Prove that it is impossible to find a continuous function \(f: \mathbb{R} \times \mathbb{R} \to \mathbb{R}\) such that for every continuous function \(g: \mathbb{R} \to \mathbb{R}\), there exists a \(t \in \mathbb{R}\) for which \(g(x) = f(t, x)\) for all \(x \in \mathbb{R}\). 2. **Second part**: - The user asks about what changes when \(\mathbb{R}\) is replaced with \([0,1]\). The conclusion from the assistant's answer is that the same non - existence result holds. So the second part of the formal proof statement is: - Prove that it is impossible to find a continuous function \(f: [0,1] \times [0,1] \to \mathbb{R}\) such that for every continuous function \(g: [0,1] \to \mathbb{R}\), there exists a \(t \in [0,1]\) for which \(g(x) = f(t, x)\) for all \(x \in [0,1]\). So the full formal math proof statement is: Prove that it is impossible to find a continuous function \(f: \mathbb{R} \times \mathbb{R} \to \mathbb{R}\) such that for every continuous function \(g: \mathbb{R} \to \mathbb{R}\), there exists a \(t \in \mathbb{R}\) for which \(g(x) = f(t, x)\) for all \(x \in \mathbb{R}\). Also, prove that it is impossible to find a continuous function \(f: [0,1] \times [0,1] \to \mathbb{R}\) such that for every continuous function \(g: [0,1] \to \mathbb{R}\), there exists a \(t \in [0,1]\) for which \(g(x) = f(t, x)\) for all \(x \in [0,1]\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem part_1 : ¬ ∃ f : ℝ → ℝ → ℝ, Continuous f ∧ ∀ g : ℝ → ℝ, Continuous g → ∃ t : ℝ, ∀ x : ℝ, (g x = f t x) := sorry theorem part_2 : ¬ ∃ f : (Set.Icc 0 1) → (Set.Icc 0 1) → ℝ, Continuous f ∧ ∀ g : Set.Icc 0 1 → ℝ, Continuous g → ∃ t : Set.Icc 0 1, (∀ x : Set.Icc 0 1, g x = f t x) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-373494,"Prove that the only pairs of integers \((i, j)\) such that for every positive integer \(n\), there exists a positive integer \(m\) which consists only of the digits \(i\) and \(j\) and satisfies \(n \mid m\) are \((0,1), (0,2), \ldots, (0,9)\).","import Mathlib theorem prove (i j : ℕ) : (∀ n > 0, ∃ m > 0, ∀ d ∈ Nat.digits 10 m, d = i ∨ d = j ∧ n ∣ m) ↔ (i = 0 ∧ j = 1) ∨ (i = 0 ∧ j = 2) ∨ (i = 0 ∧ j = 3) ∨ (i = 0 ∧ j = 4) ∨ (i = 0 ∧ j = 5) ∨ (i = 0 ∧ j = 6) ∨ (i = 0 ∧ j = 7) ∨ (i = 0 ∧ j = 8) ∨ (i = 0 ∧ j = 9) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-373832,Prove that \(\sum_{n = 1}^{\infty} {3n \choose n} \left(\frac{1}{8}\right)^n=\frac{4\sqrt{10}}{5} \sin\frac{\pi + \arccos\frac{3\sqrt{6}}{8}}{3}\).,"import Mathlib open Real Set open scoped BigOperators theorem prove : ∑' n : ℕ, Nat.choose (3 * (n + 1)) (n + 1) * (1 / 8) ^ (n + 1) = 4 * sqrt 10 / 5 * sin ((π + arccos (3 * sqrt 6 / 8)) / 3) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-373958,"a) Prove that $\sum_{n=1}^{\infty}\frac{\phi(n)}{2^n-1} = 2$, where $\phi(n)$ denotes Euler's totient function. b) Prove the combinatorial identity $\sum_k {m\choose k}{{n+k}\choose m}=\sum_k {m\choose k} {n\choose k} 2^k$ for all non - negative integers $m$ and $n$. c) Prove that using the algebraic identity $(1 - x)^{-\frac{1}{2}}(1 - x)^{-\frac{1}{2}}=(1 - x)^{-1}$, a corresponding combinatorial identity holds (the specific identity is not given in the problem, so this is the best we can do for now). d) Prove that the sum $\sum (2^{a_1}-1)\ldots (2^{a_k}-1)$, where the sum is taken over all $2^{n - 1}$ possible choices of $(a_1,a_2,\ldots,a_k)$ such that $a_1+a_2+\ldots +a_k=n$, is equal to the corresponding Fibonacci - related function (the specific function is not given in the problem, so this is the best we can do for now).","import Mathlib open Finset Real Nat theorem sum_totient : ∑' n : ℕ, (Nat.totient n) / (2 ^ n - 1) = 2 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-374487,"1. Prove that for each $s, t \in \mathbb{R}$, \[ \sup_{x \in \mathbb{R}} |\cos(tx) - \cos(sx)| \geq 1. \] 2. Prove that the family $\mathcal{F} = \{\cos(ax) : a \in \mathbb{R}\}$ is an uncountable family of functions such that $\|u - v\|_{\infty} \geq 1$ for any $u, v \in \mathcal{F}$ with $u \neq v$. 3. Prove that the space $C(\mathbb{R}) \cap L^\infty(\mathbb{R})$ is not separable.","import Mathlib open Real Set open scoped BigOperators theorem prove_1 : ∀ (s t : ℝ), sSup {abs (cos (t * x) - cos (s * x)) | x : ℝ} ≥ 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-375002,"Prove that, for any integer \(n \geq 3\), the following inequalities hold: \[2^{n^2/4} < f(2^n) < 2^{n^2/2},\] where for each positive integer \(n\), \(f(n)\) denotes the number of ways of representing \(n\) as a sum of powers of 2 with nonnegative integer exponents, and representations that differ only in the ordering of their summands are considered the same.","import Mathlib open Real open scoped BigOperators theorem inequalities (f : ℕ → ℕ) (h₀ : ∀ n, f n = {s : Finset ℕ | ∑ i ∈ s, 2^i = n}.ncard) : ∀ n ≥ 3, 2^(n^2 / 4) < f (2^n) ∧ f (2^n) < 2^(n^2 / 2) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-375181,"Prove that the smallest positive integer \(k\) such that in any set of \(k\) vertices of a regular 2007 - gon, there are four vertices that form a quadrilateral with three edges of the 2007 - gon is \(k = 1505\).","import Mathlib open Real open scoped BigOperators theorem prove : IsLeast {k : ℕ | 0 < k ∧ ∀ s : Finset (Fin 2007), s.card = k → ∃ x ∈ s, ∃ y ∈ s, ∃ z ∈ s, ∃ w ∈ s, x ≠ y ∧ x ≠ z ∧ x ≠ w ∧ y ≠ z ∧ y ≠ w ∧ z ≠ w ∧ (x + 1) % 2007 = y ∧ (y + 1) % 2007 = z ∧ (z + 1) % 2007 = w} 1505 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-375183,"Prove that the smallest positive integer \(k\) such that in any set of \(k\) vertices of a regular 2007 - gon, there are four vertices that form a quadrilateral with three edges of the 2007 - gon is \(k = 1506\).","import Mathlib theorem prove (k : ℕ) : IsLeast {x | 0 < x ∧ ∀ s : Finset (Fin 2007), s.card = x → ∃ a ∈ s, ∃ b ∈ s, ∃ c ∈ s, ∃ d ∈ s, a ≠ b ∧ a ≠ c ∧ a ≠ d ∧ b ≠ c ∧ b ≠ d ∧ c ≠ d ∧ (a + 1) % 2007 = b ∧ (b + 1) % 2007 = c ∧ (c + 1) % 2007 = d} k := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-375723,"Prove that if each positive integer is colored either red or green such that the sum of any three not necessarily distinct red numbers is a red number, the sum of any three not necessarily distinct green numbers is a green number, and there exist both red and green numbers, then the only possible colorings of the positive integers are that all odd numbers are red and all even numbers are green, or all odd numbers are green and all even numbers are red.","import Mathlib theorem colorings (red green : Set ℕ) (h₀ : ∀ n, n > 0 → n ∈ red ∨ n ∈ green) (h₁ : ∀ r s t, r ∈ red → s ∈ red → t ∈ red → r + s + t ∈ red) (h₂ : ∀ g s t, g ∈ green → s ∈ green → t ∈ green → g + s + t ∈ green) (h₃ : ∃ n, n > 0 ∧ n ∈ red) (h₄ : ∃ n, n > 0 ∧ n ∈ green) : (∀ n, n > 0 → Odd n → n ∈ red) ∧ (∀ n, n > 0 → Even n → n ∈ green) ∨ (∀ n, n > 0 → Odd n → n ∈ green) ∧ (∀ n, n > 0 → Even n → n ∈ red) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-375815,"Prove that if $(a_n)_{n=1}^{\infty}$ is a sequence of integers such that $a_{n} < a_{n+1}$ for all $n \geq 1$ and for all quadruples $(i, j, k, l)$ of indices satisfying $1 \leq i < j \leq k < l$ and $i + l = j + k$, the inequality $a_{i} + a_{l} > a_{j} + a_{k}$ holds, then the least possible value of $a_{2008}$ is $2^{2007}$.","import Mathlib theorem a : IsLeast {x | ∃ a : ℕ → ℤ, (∀ n ≥ 1, a n < a (n + 1)) ∧ (∀ i j k l, 1 ≤ i → i < j → j ≤ k → k < l → i + l = j + k → a i + a l > a j + a k) ∧ x = a 2008} (2 ^ 2007) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-375929,"Prove that for a sequence \((a_k)_{k = 1}^{\infty}\) where \(0 < a_k < 1\) for \(k = 1, 2, \ldots\), a necessary and sufficient condition for the existence, for every \(0 < x < 1\), of a permutation \(\pi_x\) of the positive integers such that \(x = \sum_{k=1}^{\infty} \frac{a_{\pi_x(k)}}{2^k}\) is \(\inf a_k = 0\) and \(\sup a_k = 1\).","import Mathlib open scoped BigOperators theorem prove (a : ℕ → ℝ) (ha : ∀ k, 0 < a k ∧ a k < 1) : (∀ x, 0 < x → x < 1 → ∃ p : Equiv.Perm ℕ, x = ∑' k, a (p k) / 2 ^ k) ↔ sInf {a k | k} = 0 ∧ sSup {a k | k} = 1 := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-376283,"Prove that for any natural number \(n\), there exists a polynomial \(f(x) \in \mathbb{Z}[x]\) of degree \(n\) such that \(f(0), f(1), \ldots, f(n)\) are distinct powers of 2, where \(f(x) = \sum_{k=0}^n \left(\frac{(-1)^{n-k} 2^{\pi(k)}}{k!(n - k)!} \prod_{\substack{i=0 \\ i \neq k}}^n (x - i)\right)\) and \(\pi: \{0,1,\ldots,n\} \to \{0,1,\ldots,n\}\) is a bijection.","import Mathlib open Finset Polynomial theorem prove (n : ℕ) : ∃ f : ℤ[X], f.degree = n ∧ ∀ i ∈ Icc 0 n, ∃! j : ℕ, f.eval (i : ℤ) = 2 ^ j := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-376345,"1. **First part**: - The user's problem already asks for a proof. So, the formal math proof statement is: ""Prove that in the plane $\mathbb{R}^2$ where points with integer coordinates are colored using one of 6 distinct colors, there exists a parallelogram whose vertices are all of the same color."" 2. **Second part**: - The user's problem is a question about the existence of a regular pentagon with vertices of the same - color. The final conclusion from the assistant's answer is that it is necessary that there exists a regular pentagon such that all its vertices are of the same color when all points in the plane are colored using a finite number of colors. - The formal math proof statement is: ""Prove that if all points in the plane $\mathbb{R}^2$ are colored using a finite number of colors, then there exists a regular pentagon such that all its vertices are of the same color.""","import Mathlib theorem color_plane (f : ℤ × ℤ → Fin 6) : ∃ x y : ℤ, f (x, y) = f (-x, y) ∧ f (x, y) = f (x, -y) ∧ f (x, y) = f (-x, -y) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-376573,"Prove that for \(n \geq 2\), given \(2^n\) subsets \(S_1, S_2, \ldots, S_{2^n}\) of \(A = \{1, 2, 3, \ldots, 2^{n + 1}\}\) such that there do not exist indices \(a\) and \(b\) with \(a < b\) and elements \(x, y, z \in A\) satisfying \(x < y < z\), \(y, z \in S_a\), and \(x, z \in S_b\), at least one of the sets \(S_1, S_2, \ldots, S_{2^n}\) contains no more than \(4n\) elements.","import Mathlib open Finset theorem prove (n : ℕ) (hn : 2 ≤ n) (A : Finset ℕ) (hA : A = Icc 1 (2^(n + 1))) (S : ℕ → Finset ℕ) (hS : ∀ i ∈ Icc 1 (2^n), S i ⊆ A) (hS' : ∀ a ∈ Icc 1 (2^n), ∀ b ∈ Icc 1 (2^n), ¬(a < b ∧ ∃ x y z : ℕ, x ∈ A ∧ y ∈ A ∧ z ∈ A ∧ x < y ∧ y < z ∧ y ∈ S a ∧ z ∈ S a ∧ x ∈ S b ∧ z ∈ S b)) : ∃ i ∈ Icc 1 (2^n), (S i).card ≤ 4 * n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-376677,"Prove that the number of subsets \(A\) of the set \(T=\{1,2,\ldots,2005\}\) such that the sum of the elements of \(A\) is divisible by \(|A|\) is equal to the number of subsets of \(\{1,2,\ldots,2005\}\) with sum divisible by \(2005\).","import Mathlib theorem prove : {A : Finset ℕ | A ⊆ Finset.Icc 1 2005 ∧ ∑ x ∈ A, x ≡ 0 [ZMOD A.card]}.ncard = {A : Finset ℕ | A ⊆ Finset.Icc 1 2005 ∧ ∑ x ∈ A, x ≡ 0 [ZMOD 2005]}.ncard := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-377582,"Let \(M = \{1, 2, 3, \ldots, 10000\}\). Prove that there exist \(16\) subsets of \(M\) such that for every \(a \in M\), there are exactly \(8\) of these subsets whose intersection is precisely \(\{a\}\).","import Mathlib open Finset theorem prove (M : Finset ℕ) (hM : M = Icc 1 10000) : ∃ s : Fin 16 → Finset ℕ, (∀ i, s i ⊆ M) ∧ (∀ a ∈ M, {i | s i ∩ {a} = {a}}.encard = 8) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-377619,"Prove that for any function $f: \mathbb{R} \to \mathbb{R}$, the set of all ""absolute local maximum points"" (where an ""absolute local maximum point"" $x_0$ of a function $f$ is defined as a point for which there exists $\delta > 0$ such that for every $x$ satisfying $0 < |x - x_0| < \delta$, we have $f(x) < f(x_0)$) is countable.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem countable {f : ℝ → ℝ} : Set.Countable {x | ∃ δ > 0, ∀ y, |y - x| ∈ Set.Ioo 0 δ → f y < f x} := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-378107,"Prove that if \(a_1, a_2, \ldots, a_n, \ldots\) is a permutation of all positive integers, then there exist infinitely many positive integers \(i\) such that \(\gcd(a_i, a_{i + 1}) \leq \frac{3}{4} i\).","import Mathlib theorem prove (a : ℕ → ℕ) (ha : ∀ n, ∃! i, a i = n) : ∀ N, ∃ i, i > N ∧ Nat.gcd (a i) (a (i + 1)) ≤ (3 / 4 : ℝ) * i := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-378410,"Prove that the minimal value of \(k\) such that in any \(k\) - element subset of \(M=\{1,2,\ldots,2008\}\), there exist four distinct numbers \(a_1,a_2,a_3,a_4\) satisfying \(a_i\mid a_j\) for all \(1\leq i < j\leq4\) is \(1758\).","import Mathlib def M : Finset ℕ := Finset.Icc 1 2008 theorem prove : IsLeast {k | ∀ S : Finset ℕ, S ⊆ M ∧ S.card = k → ∃ a b c d : ℕ, a ∈ S ∧ b ∈ S ∧ c ∈ S ∧ d ∈ S ∧ a ≠ b ∧ a ≠ c ∧ a ≠ d ∧ b ≠ c ∧ b ≠ d ∧ c ≠ d ∧ a ∣ b ∧ a ∣ c ∧ a ∣ d ∧ b ∣ c ∧ b ∣ d ∧ c ∣ d} 1758 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-379355,"Prove that there does not exist a constant \(c\) such that for all positive integers \(n\), there is a set \(A\) of size \(n\) for which \(|f(A)| \leq cn\), where \(f(A) = \{x^2 + xy + y^2 : x, y \in A\}\) and \(A\) is a set of integers.","import Mathlib open Finset theorem no_const_f_a (f_a : Set ℤ → Set ℤ) (h_f_a : ∀ A, f_a A = {x | ∃ m ∈ A, ∃ n ∈ A, x = m ^ 2 + m * n + n ^ 2}) : ¬∃ c : ℝ, ∀ n > 0, ∃ A : Set ℤ, A.ncard = n ∧ (f_a A).ncard ≤ c * n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-379834,"Prove that \[ \prod_{n=1}^{\infty} \frac{1}{1-x^n} = 1 + \sum_{m=1}^{\infty} \frac{x^{m^2}}{(1-x)^2(1-x^2)^2 \cdots (1-x^m)^2}. \]","import Mathlib open Real theorem prove (x : ℝ) (hx : x ≠ 0) : ∏' n : ℕ, 1 / (1 - x ^ (n + 1)) = 1 + ∑' m : ℕ, x ^ ((m + 1) ^ 2) / (∏ i ∈ Finset.Icc 1 (m + 1), (1 - x ^ i) ^ 2) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-380176,"Prove that the minimum value of \(n\) such that for any subset \(X \subset \{A \subset \{1, 2, \ldots, 9\} \mid |A| = 5\}\) with \(|X| = n\), there exist two sets \(A, B \in X\) for which \(|A \cap B| = 4\) is \(n = 26\).","import Mathlib open Finset theorem min_n: IsLeast {n : ℕ | ∀ X : Finset (Finset (Icc 1 9)), X.card = n ∧ (∀ A ∈ X, A.card = 5) → ∃ A ∈ X, ∃ B ∈ X, A ≠ B ∧ (A ∩ B).card = 4} 26 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-380326,"Prove that the number of distinct ways to arrange the numbers \(1, 2, 3, \ldots, 10\) on a \(4\times4\) chessboard such that for any number placed on the board, the greatest common divisor (GCD) of that number and each of its adjacent numbers (up, down, left, and right; adjacent positions that do not exist, e.g., up for a number in the top row, are ignored) is \(1\) is \(4821590113978\).","import Mathlib theorem num_ways : Set.ncard {a : Fin 4 → Fin 4 → ℕ | (∀ i j, a i j ∈ Finset.Icc 1 10) ∧ (∀ i j, ∀ k l, (i = k ∧ j + 1 = l) ∨ (i = k ∧ j - 1 = l) ∨ (i + 1 = k ∧ j = l) ∨ (i - 1 = k ∧ j = l) → Nat.gcd (a i j) (a k l) = 1)} = 4821590113978 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-382185,"(a) Prove that there exists a continuous function \(f: \mathbb{R} \to \mathbb{R}\) such that \(f(0) \notin \mathbb{Z}\) and for any nonzero rational number \(q = \frac{a}{b} \neq 0\) in reduced form, \(f(q)\) is a multiple of \(\frac{1}{b}\). (b) For any nonzero rational number \(q = \frac{a}{b} \neq 0\) in reduced form, let \(S_q\) be a doubly - infinite set of reals with gaps at most \(\frac{1}{b}\). Prove that there exists a continuous function \(f: \mathbb{R} \to \mathbb{R}\) such that for any nonzero rational number \(q \neq 0\), \(f(q)\) lies in \(S_q\). (c) Let \(\{q_1, q_2, \ldots\}\) be a countable sequence of distinct numbers in \([0,1]\), and let \(\{\epsilon_1, \epsilon_2, \ldots\} > 0\) be a sequence of positive numbers tending to \(0\). For each positive integer \(n\), let \(S_n\) be a doubly - infinite set of reals with gaps at most \(\epsilon_n\). Prove that there exists a continuous function \(f: [0,1] \to \mathbb{R}\) such that \(f(q_n) \in S_n\) for any positive integer \(n\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove_a : ∃ f : ℝ → ℝ, Continuous f ∧ ¬∃ n : ℤ, f 0 = n ∧ ∀ q : ℚ, q ≠ 0 → f q % (1 / q.den) = 0 := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-383751,"A) Prove that for any natural number \(n\), there exist \(n\) distinct natural numbers such that the sum of any subset of these numbers is not a perfect power. B) Prove that for any natural number \(n\), there exist \(n\) distinct natural numbers such that the sum of each subset of these numbers is a perfect power.","import Mathlib theorem A (n : ℕ) : ∃ s : Finset ℕ, s.card = n ∧ ∀ t ⊆ s, ¬∃ k : ℕ, ∃ m : ℕ, m > 0 ∧ ∑ i ∈ t, i = m ^ k := by sorry theorem B (n : ℕ) : ∃ s : Finset ℕ, s.card = n ∧ ∀ t ⊆ s, ∃ k : ℕ, ∃ m : ℕ, m > 0 ∧ ∑ i ∈ t, i = m ^ k := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-384628,"Prove that the remainder when the number of functions \(f: \{1, 2, \dots, 101\} \rightarrow \{1, 2, \dots, 101\}\) such that \(f^{101}(1) = 2\) is divided by \(103\) is \(9\).","import Mathlib theorem number_of_f : {f : Fin 101 → Fin 101 | f^[101] 0 = 1 ∧ ∀ i, f i ∈ Finset.Icc 0 100}.ncard % 103 = 9 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-385378,"Prove that for the increasing sequence of positive integers $\{u_n\}_{n = 1}^{\infty}$ defined by the recurrence relation $u_{n}=(n - 1)(u_{n-1}+u_{n-2})$ for all $n\geq3$, with initial conditions $u_1 = 0$ and $u_2 = 1$, the value of $u_{2016}$ is $\left\lfloor \frac{2017!}{e} + \frac{1}{2} \right\rfloor$.","import Mathlib open Nat theorem qwen (u : ℕ → ℤ) (h₀ : u 1 = 0) (h₁ : u 2 = 1) (h₂ : ∀ n ≥ 3, u n = (n - 1) * (u (n - 1) + u (n - 2))) : u 2016 = ⌊(2017 ! / Real.exp 1 : ℝ) + 1 / 2⌋ := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-385951,"Let $D = \{0, 1, 2, \ldots, 9\}$ be the set of decimal digits, and let $R \subset D \times D$ be a set of ordered pairs of digits. An infinite sequence $(a_1, a_2, a_3, \ldots)$ of digits is said to be compatible with $R$ if $(a_j, a_{j + 1}) \in R$ for all positive integers $j$. Prove that the smallest positive integer $K$ such that if an arbitrary set $R \subset D \times D$ is compatible with at least $K$ distinct digit sequences, then $R$ is compatible with infinitely many digit sequences, is $K = 513$.","import Mathlib open Finset theorem minK : IsLeast {K : ℕ | ∀ R : Set (ℕ × ℕ), (∀ r ∈ R, r.1 < 10 ∧ r.2 < 10) → {s : ℕ → ℕ | (∀ j, s j < 10) ∧ ∀ j, (s j, s (j + 1)) ∈ R}.ncard ≥ K} 513 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-387294,"Prove that the smallest value of \(n\) for which it is impossible to color the integers \(1,2,\ldots,n\) with two colors (blue and red) such that the equation \(8(x + y)=z\) has no monochromatic solutions (i.e., \(x\), \(y\), and \(z\) are not all the same color) is \(n = 2056\).","import Mathlib theorem algebra374940 : IsLeast {n | ¬∃ blue red : Finset ℕ, blue ∪ red = Finset.Icc 1 n ∧ blue ∩ red = ∅ ∧ ∀ x ∈ blue, ∀ y ∈ blue, z ∈ blue → 8 * (x + y) ≠ z ∧ ∀ x ∈ red, ∀ y ∈ red, z ∈ red → 8 * (x + y) ≠ z} 2056 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-387304,"1. **First part (already a proof problem)**: Prove that if \(n = 2017\), there exists a coloring of the integers \(1,2,\ldots,n\) with two colors (blue and red) such that the equation \(8(x + y)=z\) does not have monochromatic solutions (i.e., \(x\), \(y\), and \(z\) are not all the same color). 2. **Second part (rewrite as a proof problem)**: Prove that the smallest value of \(n\) for which it is impossible to color the integers \(1,2,\ldots,n\) with two colors (blue and red) such that the equation \(8(x + y)=z\) does not have monochromatic solutions is \(n = 255\).","import Mathlib open Finset theorem first_part {n : ℕ} (hn : n = 2017) : ∃ f : ℕ → Fin 2, ∀ x ∈ Icc 1 n, ∀ y ∈ Icc 1 n, ∀ z ∈ Icc 1 n, ¬(f x = f y ∧ f y = f z ∧ 8 * (x + y) = z) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-387451,"For a set $A$ of positive integers, the natural or asymptotic density of $A$ is defined as $$d(A) = \lim_{n \to \infty} \frac{|A \cap \{1, 2, \ldots, n\}|}{n}.$$ Consider the unique set of positive integers $S$ with the property that $1 \in S$ and for any $x \in S$, $2x \not\in S$. This set begins $\{1, 3, 4, 5, 7, 9, 11, 12, 13, \ldots\}$. Prove that for any set $A$ with $d(A) > d(S)$, there are infinitely many integers $x \in A$ such that $2x \in A$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem unique_S : ∃! S : Set ℕ, (∀ x ∈ S, 0 < x) ∧ 1 ∈ S ∧ ∀ x ∈ S, ¬(2 * x ∈ S) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-387738,"Prove that it is possible to partition the set of integers \(\{1, 2, 3, \ldots, 2017\}\) into three non - empty subsets \(A\), \(B\), and \(C\) such that for any \(a \in A\), \(b \in B\), and \(c \in C\), the expressions \(ab + c\) and \(ac + b\) are not perfect squares.","import Mathlib theorem algebra_458769 : ∃ A B C : Finset ℕ, A ∪ B ∪ C = Finset.Icc 1 2017 ∧ A ≠ ∅ ∧ B ≠ ∅ ∧ C ≠ ∅ ∧ A ∩ B = ∅ ∧ A ∩ C = ∅ ∧ B ∩ C = ∅ ∧ ∀ a ∈ A, ∀ b ∈ B, ∀ c ∈ C, ¬(IsSquare (a * b + c)) ∧ ¬(IsSquare (a * c + b)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-388011,"Prove that in a tower with infinitely many floors numbered \(1, 2, 3, \dots\), where for every positive integer \(N\), there are a red magic portal connecting floor \(N\) to floor \(2N + 1\) and a blue magic portal connecting floor \(N\) to floor \(3N + 1\) (and the portals are bidirectional), the maximum number of wizards that can coexist in the tower without any two being able to reach each other's floors is \(1\).","import Mathlib theorem max_wizards : IsGreatest {k | ∃ s : Finset ℕ, s.card = k ∧ (∀ N ∈ s, N > 0) ∧ (∀ N ∈ s, ¬∃ M ∈ s, M ≠ N ∧ M > 0 ∧ N ≤ 2 * M + 1 ∨ N ≤ 3 * M + 1)} 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-388024,"Prove that the maximum positive integer \(k\) for which there exist \(k\) positive integers, each not exceeding \(2017\), such that no number among them is a power of any of the other \(k - 1\) numbers, is \(1972\).","import Mathlib theorem maxk (k : ℕ) : (∃ s : Finset ℕ, s.card = k ∧ ∀ i ∈ s, i ≤ 2017 ∧ ∀ i ∈ s, ∀ j ∈ s, i ≠ j → ¬(∃ m : ℕ, m > 0 ∧ i = j ^ m)) ↔ k ≤ 1972 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-388026,"Prove that the maximum positive integer \(k\) for which there exist \(k\) positive integers, each not exceeding \(2017\), such that no number among them is a power of any of the other \(k - 1\) numbers, is \(1974\).","import Mathlib theorem max_k (k : ℕ) : (∃ s : Finset ℕ, s.card = k ∧ ∀ i ∈ s, i ≤ 2017 ∧ ∀ i ∈ s, ∀ j ∈ s, j ≠ i → ¬∃ m, i = j ^ m) ↔ k ≤ 1974 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-388630,"Prove that the terms of the sequence \(a_n=\sum_{k = 1}^{\infty}\frac{k^n}{\binom{2k}{k}}\) are nearly equal to the corresponding terms of sequence A136127 if \(a_n\sim \frac{3p_n}{2}\), where \(a_n = p_n+q_n\frac{\pi}{\sqrt{3}}\) and \(p_n,q_n\) are rational numbers.","import Mathlib open Real theorem Prove {a : ℕ → ℝ} (ha : ∀ n, a n = ∑' k : ℕ, k ^ n / Nat.choose (2 * k) k) (p q : ℕ → ℚ) (h : ∀ n, a n = p n + q n * π / sqrt 3) : ∃ C, ∀ n, |a n - (3 * p n / 2)| < C := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-388765,"Let \(m, n\) be integers such that \(m \geq n > 1\). Consider \(n\) distinct integers \(a_1, a_2, \dots, a_n\) where each \(a_i \leq m\) and \(\gcd(a_1, a_2, \dots, a_n) = 1\). Prove that for any real number \(x\), there exists an index \(i\) such that \(||a_i x|| \geq \frac{2}{m(m+1)} ||x||\), where \(||x||\) denotes the distance from \(x\) to the nearest integer.","import Mathlib theorem qwen (m n : ℕ) (hn : 1 < n) (hm : n ≤ m) (a : Fin n → ℤ) (ha : ∀ i j, a i = a j → i = j) (hij : ∀ i, a i ≤ m) (hgcd : ∃ x, ∀ i, Int.gcd (a i) x = 1) : ∀ x : ℝ, ∃ i, ‖a i * x‖ ≥ 2 / (m * (m + 1)) * ‖x‖ := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-388850,"Let \(S\) be a set of \(2000\) positive integers, each not exceeding \(10^{100}\). Prove that there exist two nonempty, disjoint subsets \(A\) and \(B\) of \(S\), each of the same size, such that the sum of the elements and the sum of the squares of the elements in \(A\) are equal to those in \(B\), i.e., \(\sum_{a \in A} a = \sum_{b \in B} b\) and \(\sum_{a \in A} a^2 = \sum_{b \in B} b^2\).","import Mathlib theorem Finset.card_eq {n : ℕ} (hn : n = 2000) : ∀ S : Finset ℕ, S.card = n ∧ (∀ x ∈ S, x > 0 ∧ x ≤ 10 ^ 100) → ∃ A B : Finset ℕ, A ⊆ S ∧ B ⊆ S ∧ A ≠ ∅ ∧ B ≠ ∅ ∧ Disjoint A B ∧ A.card = B.card ∧ ∑ x ∈ A, x = ∑ x ∈ B, x ∧ ∑ x ∈ A, x ^ 2 = ∑ x ∈ B, x ^ 2 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-389615,"Prove that the maximum possible size of a family $\mathcal{F}$ of subsets of the set $\{1,2,\ldots, 2017\}$ such that for any two subsets $S_1, S_2 \in \mathcal{F}$ with $S_1 \subsetneq S_2$, the difference $|S_2 \setminus S_1|$ is an odd number, is $2 \binom{2017}{1008}$.","import Mathlib open Finset theorem maxfamily : IsGreatest {n | ∃ F : Finset (Finset (Fin 2017)), F.card = n ∧ (∀ S ∈ F, ∀ T ∈ F, S ⊂ T → Odd ((T \ S).card))} (2 * Nat.choose 2017 1008) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-389617,"Prove that if there exist unique integers \(m_1, m_2, \ldots, m_{100}\) such that \(0 \leq m_1 < m_2 < \cdots < m_{100}\) and \(2018 = \binom{m_1}{1} + \binom{m_2}{2} + \cdots + \binom{m_{100}}{100}\), then \(m_1 + m_2 + \cdots + m_{100}=5021\).","import Mathlib theorem sum_mins (m : Fin 100 → ℕ) (h₀ : ∀ i j, i < j → m i < m j) (h₁ : ∑ i, Nat.choose (m i) (i + 1) = 2018) : ∑ i, m i = 5021 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-389639,"The user's problem is not a proof problem. The final conclusion we can infer from the context (though the answer seems to have some in - depth and perhaps incorrect brute - force approach) is about finding the value of \(m_1 + m_2+\cdots + m_{100}\). We can rewrite the problem as the following formal math proof statement: Prove that if there exist unique integers \(m_1, m_2, \ldots, m_{100}\) such that \(0 \leq m_1 < m_2 < \cdots < m_{100}\) and \(2018=\binom{m_1}{1}+\binom{m_2}{2}+\cdots+\binom{m_{100}}{100}\), then the value of \(m_1 + m_2+\cdots + m_{100}\) is [the correct value which should be re - calculated as the given answer's approach is very convoluted and might be wrong]. In a more ideal situation, if we assume the correct calculation gives the sum \(S\), the statement would be: Prove that if there exist unique integers \(m_1, m_2, \ldots, m_{100}\) such that \(0 \leq m_1 < m_2 < \cdots < m_{100}\) and \(2018=\binom{m_1}{1}+\binom{m_2}{2}+\cdots+\binom{m_{100}}{100}\), then \(m_1 + m_2+\cdots + m_{100}=S\).","import Mathlib theorem sum_of_m : ∃! m : Fin 100 → ℕ, (∀ i j, i < j → m i < m j) ∧ (∑ i, Nat.choose (m i) (i + 1)) = 2018 → ∑ i, m i = 509 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-389894,"Prove that the maximum value of \(k\) such that for the set \(S=\{1,2,3,\ldots,2018\}\), after randomly erasing any \(k\) elements from \(S\), it is still possible to select four numbers from the remaining elements whose sum equals \(2018\), is \(k = 502\).","import Mathlib theorem max_k (S : Finset ℕ) (hS : S = Finset.Icc 1 2018) : IsGreatest {k | ∀ T ⊆ S, T.card = k → ∃ U ⊆ S \ T, U.card = 4 ∧ ∑ x ∈ U, x = 2018} 502 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-391258,"1. Prove that Floyd the flea, who on the first day can jump to any positive integer and from then on jumps to another number that is not more than twice his previous day's position, can make infinitely many jumps in such a way that he never arrives at any number with the same sum of decimal digits as at a previous place. 2. Prove that the flea cannot jump in such a way that he never arrives at any number with the same sum of binary digits as at a previous place, given that on the first day he can jump to any positive integer and from then on jumps to another number that is not more than twice his previous day's position.","import Mathlib open Finset theorem floyd_flea : (∀ n : ℕ, ∃ m > n, ¬∃ k, (Nat.digits 10 k).sum = (Nat.digits 10 m).sum) ∧ ¬∃ f : ℕ → ℕ, (∀ n, f n > 0) ∧ (∀ n, f (n + 1) ≤ 2 * f n) ∧ (∀ n, ∀ m, m ≠ n → (Nat.digits 2 m).sum ≠ (Nat.digits 2 (f n)).sum) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-391329,Prove that the value of the sum $\sum^{50}_{k=1}\frac{\binom{50+k}{k}\cdot (2k-1)}{\binom{50}{k}\cdot (50+k)}$ is \(100891344545564193334812497255\).,"import Mathlib open Finset Real Nat theorem sum_value : ∑ k ∈ Icc 1 50, (Nat.choose (50 + k) k * (2 * k - 1)) / (Nat.choose 50 k * (50 + k)) = 100891344545564193334812497255 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-391522,"Prove that the only ordered pair of positive integers $(a, b)$ such that there exist positive integers $r, s,$ and $t$ for which the equality \(\binom{\binom{n}{a}}{b} = r \binom{n+s}{t}\) holds for all sufficiently large positive integers $n$ is \((a, b) = (2, 2)\).","import Mathlib theorem prove_473180 (a b : ℕ) (ha : 0 < a) (hb : 0 < b) (h : ∃ r s t : ℕ, 0 < r ∧ 0 < s ∧ 0 < t ∧ ∀ n ≥ t, Nat.choose (Nat.choose n a) b = r * Nat.choose (n + s) t) : (a, b) = (2, 2) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-391525,"Prove that the only ordered pair of positive integers $(a, b)$ for which there exist positive integers $r, s,$ and $t$ such that the equality \(\binom{\binom{n}{a}}{b} = r \binom{n+s}{t}\) holds for all sufficiently large positive integers $n$ is \((a, b) = (2, 2)\).","import Mathlib theorem prove : {(a, b) : ℕ × ℕ | a > 0 ∧ b > 0 ∧ ∃ r s t : ℕ, r > 0 ∧ s > 0 ∧ t > 0 ∧ ∀ n ≥ s, Nat.choose (Nat.choose n a) b = r * Nat.choose (n + s) t} = {(2, 2)} := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-391539,"Prove that if $S_1, S_2, \dots, S_{2^n - 1}$ are the non - empty subsets of $\{1, 2, \dots, n\}$ in some order, and $M$ is the $(2^n - 1) \times (2^n - 1)$ matrix defined by \[ m_{ij} = \left\{ \begin{array}{cl} 0 & \text{if $S_i \cap S_j = \emptyset$}, \\ 1 & \text{otherwise}, \end{array} \right. \] then $\det(M)=-1$.","import Mathlib open Finset Real Matrix theorem proveMatrix {n : ℕ} (hn : 0 < n) (S : Finset.Icc 1 (2 ^ n - 1) → Finset ℕ) (hS : ∀ i j, S i = S j → i = j) (hS1 : ∀ i, ∃ x ∈ S i, x ∈ Icc 1 n) (M : Matrix (Finset.Icc 1 (2 ^ n - 1)) (Finset.Icc 1 (2 ^ n - 1)) ℝ) (hM : ∀ i j, M i j = if (S i ∩ S j = ∅) then 0 else 1) : M.det = -1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-392246,"Prove that for any $2n - 1$ irrational numbers $x_1, x_2, \ldots, x_{2n - 1}$, there exists a subset $I \subseteq \{1, 2, \ldots, 2n - 1\}$ such that $|I| = n$ and for all non - empty subsets $J \subseteq I$, the sum $\sum_{j \in J} x_j$ is irrational.","import Mathlib theorem prove (n : ℕ) (hn : 0 < n) (x : Finset.Icc 1 (2 * n - 1) → ℝ) (hx : ∀ i, Irrational (x i)) : ∃ I : Finset (Finset.Icc 1 (2 * n - 1)), I.card = n ∧ ∀ J ⊆ I, J ≠ ∅ → Irrational (∑ j ∈ J, x j) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-394323,"Prove that in a group of \(17\) mathematicians, where every pair of mathematicians communicates in one of \(3\) official languages, there exists a trio of mathematicians who communicate pairwise in the same language.","import Mathlib theorem prove_trio (G : Finset (Fin 17)) (hG : G.card = 17) (f : Fin 17 → Fin 17 → Fin 3) : ∃ x ∈ G, ∃ y ∈ G, ∃ z ∈ G, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ f x y = f y z ∧ f y z = f x z := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-394417,"Prove that if $\mathbb{N}$ denotes the set of all positive integers, a subset $A$ of $\mathbb{N}$ is sum - free if for any $x, y \in A$ (not necessarily distinct), $x + y\notin A$, and $f: \mathbb{N} \to \mathbb{N}$ is a surjective function such that for every sum - free subset $A$ of $\mathbb{N}$, the image $\{f(a):a\in A\}$ is also sum - free, then $f(n)=n$ for all $n\in\mathbb{N}$.","import Mathlib open Finset theorem prove {f : ℕ → ℕ} (hf : Function.Surjective f) (hsumfree : ∀ A : Set ℕ, (∀ x ∈ A, ∀ y ∈ A, x + y ∉ A) → (∀ x ∈ A, ∀ y ∈ A, f x + f y ∉ A)) : ∀ n, f n = n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-394418,"Prove that the only surjective functions $f: \mathbb{N} \to \mathbb{N}$ such that, for every sum - free subset $A$ of $\mathbb{N}$, the image $\{f(a) : a \in A\}$ is also sum - free, are given by $f(n)=n$ for all $n\in\mathbb{N}$.","import Mathlib theorem Prove (f : ℕ → ℕ) (hf : Function.Surjective f) (h : ∀ A : Set ℕ, (∀ x ∈ A, ¬∃ y ∈ A, y = x + x) → ∀ x ∈ f '' A, ¬∃ y ∈ f '' A, y = x + x) : ∀ n, f n = n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-394419,"Prove that if $\mathbb{N}$ denotes the set of all positive integers, a subset $A$ of $\mathbb{N}$ is sum - free if for any $x, y \in A$ (not necessarily distinct), $x + y otin A$, and $f: \mathbb{N} \to \mathbb{N}$ is a surjective function such that for every sum - free subset $A$ of $\mathbb{N}$, the image $\{f(a): a \in A\}$ is also sum - free, then $f(n)=n$ for all $n\in\mathbb{N}$.","import Mathlib def isSumFree (A : Set ℕ) : Prop := ∀ x ∈ A, ∀ y ∈ A, x + y ∉ A theorem proveFunction (f : ℕ → ℕ) (h₀ : Function.Surjective f) (h₁ : ∀ A, isSumFree A → isSumFree {x | ∃ a ∈ A, f a = x}) : ∀ n, f n = n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-394423,"Prove that if $\mathbb{N}$ is the set of all positive integers, a subset $A$ of $\mathbb{N}$ is sum - free if for any $x,y\in A$ (not necessarily distinct), $x + y\notin A$, and $f:\mathbb{N}\to\mathbb{N}$ is a surjective function such that for every sum - free subset $A$ of $\mathbb{N}$, the image $\{f(a):a\in A\}$ is also sum - free, then \(f(k)=k\) for all \(k\in\mathbb{N}\).","import Mathlib theorem proveFunction (f : ℕ → ℕ) (hf : Function.Surjective f) (hsumfree : ∀ A : Set ℕ, (∀ x ∈ A, ∀ y ∈ A, x + y ∉ A) → (∀ x ∈ A, ∀ y ∈ A, f x + f y ∉ f '' A)) : ∀ k, f k = k := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-394431,"Prove that if $\mathbb{N}$ denotes the set of all positive integers, a subset $A$ of $\mathbb{N}$ is sum - free if for any $x, y \in A$ (not necessarily distinct), $x + y otin A$, and $f: \mathbb{N} \to \mathbb{N}$ is a surjective function such that for every sum - free subset $A$ of $\mathbb{N}$, the image $\{f(a):a \in A\}$ is also sum - free, then $f(x)=x$ for all $x\in\mathbb{N}$.","import Mathlib theorem qwen {f : ℕ → ℕ} (hf : Function.Surjective f) (hsumfree : ∀ A : Set ℕ, (∀ x ∈ A, ∀ y ∈ A, x + y ∉ A) → (∀ x ∈ A, ∀ y ∈ A, f x + f y ∉ f '' A)) : ∀ x, f x = x := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-394850,"Prove that the number of non - empty subsets $S \subseteq [p] \times [p]$ such that $p \mid \sum_{(x, y) \in S} x$ and $p \mid \sum_{(x, y) \in S} y$ is given by \(f(p) = \begin{cases} 3 & \text{if } p = 2 \\ 2^p \left(1 + \frac{2^{p(p - 1)} - 1}{p^2}\right) - 1 & \text{if } p > 2 \end{cases}\), where $[p]=\{1,2,\ldots,p\}$ and $p$ is a prime number.","import Mathlib open Finset theorem number_theory_984 (p : ℕ) (hp : Nat.Prime p) : {S : Finset (Fin p × Fin p) | S.Nonempty ∧ p ∣ ∑ x ∈ S, x.1 ∧ p ∣ ∑ y ∈ S, y.2}.ncard = if p = 2 then 3 else 2 ^ p * ((2 ^ (p * (p - 1)) - 1) / (p ^ 2 : ℚ)) - 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-395473,"Let $S$ be a set of $2020$ integers. Prove that there exist two nonempty subsets $X, Y \subset S$ such that both $|X|$ and $|Y|$ are multiples of $673$ and $$\sum_{x,x' \in X, x < x'} xx' + \sum_{y,y' \in Y, y < y'} yy' \equiv \sum_{x \in X, y \in Y} xy \quad (\text{mod } 673)$$","import Mathlib theorem algebra_491870 (S : Finset ℤ) (hS : S.card = 2020) : ∃ X Y : Finset ℤ, X ⊆ S ∧ Y ⊆ S ∧ X ≠ ∅ ∧ Y ≠ ∅ ∧ 673 ∣ X.card ∧ 673 ∣ Y.card ∧ (∑ x ∈ X, ∑ x' ∈ X, if x < x' then x * x' else 0) + (∑ y ∈ Y, ∑ y' ∈ Y, if y < y' then y * y' else 0) ≡ ∑ x ∈ X, ∑ y ∈ Y, x * y [ZMOD 673] := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-395533,"Let \(x_1, x_2, \ldots, x_n\) be natural numbers such that all \(2^n\) partial sums of these numbers are distinct. Prove that: \[ \sum_{i = 1}^{n} x_i^2 \geq \frac{4^n - 1}{3}. \]","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (x : Fin n → ℕ) (h : ∀ s : Finset (Fin n), ∃! t : ℕ, ∑ i ∈ s, x i = t) : ∑ i : Fin n, (x i)^2 ≥ (4^n - 1)/3 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-395616,"Prove that the maximum possible value of the positive integer \(n\) such that for any permutation \(a_1, a_2, \dots, a_{17}\) of the integers \(1, 2, \dots, 17\), the product \((a_1 - a_2)(a_2 - a_3) \dots (a_{17} - a_1) = 2^n\) is \(n = 38\).","import Mathlib open Finset theorem max_n : IsGreatest {n > 0 | ∀ a : Equiv.Perm (Fin 17), (∏ i : Fin 17, ((a i + 1) - (a ((i + 1) % 17) + 1))) = 2 ^ n} 38 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-395967,"Prove that there exists a set of \(2020\) distinct positive integers such that for any subset of \(101\) of these integers, the product of the elements in the subset is divisible by the sum of the elements in the subset.","import Mathlib theorem solution : ∃ (S : Finset ℕ) (_ : S.card = 2020) (_ : ∀ x ∈ S, x > 0), ∀ T ⊆ S, T.card = 101 → (∑ t ∈ T, t) ∣ ∏ t ∈ T, t := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-396494,"Prove that in the game where $p$ is a prime number, Troy writes a positive integer $X$ on the board and gives a sequence $(a_n)_{n\in\mathbb{N}}$ of positive integers to Abed, and Abed makes moves by replacing the number $Y$ on the board with either $Y + a_n$ or $Y \cdot a_n$ at the $n$-th move, and wins if at some point the number on the board is a multiple of $p$, Troy can win regardless of Abed's moves when $a) p = 10^9 + 7$; $b) p = 10^9 + 9$.","import Mathlib open Finset theorem ProveTroyWin (p : ℕ) (hp : Nat.Prime p) : (∀ X > 0, ∀ a : ℕ → ℕ, (∀ n, a n > 0) → ∃ n, p ∣ X + a n ∨ p ∣ X * a n) ↔ p = 10 ^ 9 + 7 ∨ p = 10 ^ 9 + 9 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-396996,"Prove that it is possible to find $2^{2021}$ distinct pairs of positive integers $(a_i, b_i)$ such that: $$ \sum_{i=1}^{2^{2021}} \frac{1}{a_i b_i} = 1 $$ and $$ \left( \sum_{i=1}^{2^{2021}} a_i \right) + \left( \sum_{i=1}^{2^{2021}} b_i \right) = 3^{2022} $$ Note: Pairs $(a, b)$ and $(c, d)$ are considered distinct if $a \neq c$ or $b \neq d$.","import Mathlib theorem exists_pairs : ∃ (S : Finset (ℕ × ℕ)), S.card = 2 ^ 2021 ∧ (∀ s ∈ S, s.1 > 0 ∧ s.2 > 0) ∧ ((∑ s ∈ S, (1 / ((s.1 * s.2) : ℚ))) = 1 ∧ (∑ s ∈ S, s.1) + (∑ s ∈ S, s.2) = 3 ^ 2022) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-396998,"Prove that it is possible to find \(2^{2021}\) distinct pairs of positive integers \((a_i, b_i)\) such that: \[ \frac{1}{a_1b_1} + \frac{1}{a_2b_2} + \ldots + \frac{1}{a_{2^{2021}}b_{2^{2021}}} = 1 \] and \[ a_1 + a_2 + \ldots + a_{2^{2021}} + b_1 + b_2 + \ldots + b_{2^{2021}} = 3^{2022} \] Note: Pairs \((a, b)\) and \((c, d)\) are considered distinct if \(a \neq c\) or \(b \neq d\).","import Mathlib theorem possible_pairs : ∃ s : Finset (Fin 2 → ℕ), s.card = 2^2021 ∧ (∀ p ∈ s, (∀ i, p i > 0)) ∧ (∑ p ∈ s, (1 / ((p 0) * (p 1) : ℚ))) = 1 ∧ (∑ p ∈ s, p 0 + ∑ p ∈ s, p 1) = 3 ^ 2022 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-397465,"Given \(4n\) points in a plane such that any three points form a triangle, prove that there exists a point \(P\) (which may or may not be one of the \(4n\) points) in the plane such that \(P\) lies inside or on the boundary of at least \(2n^3\) triangles formed by the \(4n\) points.","import Mathlib open Real open scoped BigOperators theorem qwen {n : ℕ} (hn : 0 < n) (a : Fin (4 * n) → EuclideanSpace ℝ (Fin 2)) (h : ∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → ¬Collinear ℝ {a i, a j, a k}) : ∃ P : EuclideanSpace ℝ (Fin 2), {T | ∃ i j k, T = convexHull ℝ {a i, a j, a k} ∧ P ∈ T}.ncard ≥ 2 * n ^ 3 := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-397484,"Prove that the number of integers \(N\) in the range \(1\leq N\leq 6^{2021}\) for which Derek wins the game, where Derek and Kevin alternately remove a power - of - 6 number of coins from a stack of \(N\) coins and Derek starts the game, is \(\frac{6^{2022}+1}{7}\).","import Mathlib theorem prove_derek_wins : Set.ncard {N : ℕ | 1 ≤ N ∧ N ≤ 6^2021 ∧ ∃ k, (N - 6^k) % 7 = 0} = (6^2022 + 1)/7 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-397670,"Prove that among the \(10!\) functions \(g\) whose domain and range are the set \(S=\{1, 2, 3,\ldots, 10\}\), the number of functions such that \(g^{g(n)}(n) = n\) for all \(n\in S\) is \(46\).","import Mathlib open Finset theorem number_theory_8233 : { g : Equiv.Perm (Fin 10) | ∀ n : Fin 10, g^[g n] n = n }.ncard = 46 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-398146,Prove that there exists a countably infinite set $S$ and an uncountable collection $\mathcal{C}$ of non - empty subsets of $S$ such that the intersection of any two distinct subsets in $\mathcal{C}$ is finite.,"import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem prove_332387 : ∃ (α : Type), Countable α ∧ Infinite α ∧ (∃ (C : Set (Set α)), ¬ Countable C ∧ ∀ x ∈ C, x ≠ ∅ ∧ ∀ x ∈ C, ∀ y ∈ C, x ≠ y → (x ∩ y).Finite) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-398396,"Prove that the number of possible seating arrangements for 26 individuals named Ayako, Billy, Carlos, Dahlia, Ehuang, Frank, Gerald, Harrison, Isabella, Jackson, Kai, Louis, Matthew, Nicholas, Otto, Percy, Quincy, Rajesh, Sarah, Teo, Ursula, Vincent, Wexley, X AE A - 12, Yohannes, and Zephyr, who initially sat in a row of 26 chairs in that order and then re - seated themselves after a break such that no two individuals who were originally adjacent sat next to each other again, is \(54406969991009281966468810\).","import Mathlib theorem number_of_seating: Set.ncard {f : Fin 26 → Fin 26 | f.Injective ∧ ∀ i j, i + 1 = j ∨ j + 1 = i → (f i).val ≠ (f j).val} = 54406969991009281966468810 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-398573,"**Problem 1:** 1. Prove that if $0 < a < 1$, then $\lim_{n \to \infty} x_n = 1$, where the sequence $(x_n)$ is defined as $x_1 = a$ and $x_{n+1} = \begin{cases} 2x_n - x_n^2 & \text{if } 0 < x_n < 1 \\ \frac{(n+1)^4}{2^n \sqrt{x_n + 3}} & \text{if } x_n > 1 \end{cases}$. 2. Prove that if $a > 0$, then the sequence $(x_n)$ (defined as $x_1 = a$ and $x_{n+1} = \begin{cases} 2x_n - x_n^2 & \text{if } 0 < x_n < 1 \\ \frac{(n+1)^4}{2^n \sqrt{x_n + 3}} & \text{if } x_n > 1 \end{cases}$) has a limit. **Problem 2:** Prove that for real numbers $a, b, c, d$ such that $0 < a \le b \le c \le d$ and $a + b + c + d = 8$, the inequality $\sqrt{2(a^2 + b^2)} + \sqrt{2(b^2 + c^2)} + \sqrt{2(c^2 + d^2)} + 2\sqrt{ad} \le 16$ holds. **Problem 3:** 1. Given a triangle $\triangle ABC$ with $BC$ fixed and point $A$ moving on the plane, where the altitudes $AD$, $BE$, and $CF$ of $\triangle ABC$ are concurrent at $H$, and $EF$ intersects $BC$ at $K$. Let $M$ be the second intersection of the circumcircle of $\triangle ADK$ and the line $KH$. Prove that the line $AM$ passes through the mid - point of $BC$. 2. Given a triangle $\triangle ABC$ with $BC$ fixed and point $A$ moving on the plane, where the altitudes $AD$, $BE$, and $CF$ of $\triangle ABC$ are concurrent at $H$, $EF$ intersects $BC$ at $K$, construct parallelogram $FECP$, and let $P$ be the intersection of $PC$ and $AK$. Prove that points $B$, $P$, $K$, and $Q$ lie on the same circle. **Problem 4:** Prove that it is possible to assign a positive integer to each vertex of a polygon $P$ such that in any set of 5 consecutive vertices, there are exactly 2 even numbers if and only if the number of vertices of $P$ is divisible by 5. **Problem 5:** 1. Prove that for a prime number $p = 3k + 2$ and integers $a, b \in \mathbb{Z}_+$, if $p \mid a^2 + ab + b^2$, then $p \mid a$ and $p \mid b$. 2. Prove that for positive integers $a, b, c$, if $N=\frac{a^2 + b^2 + c^2}{ab + bc + ca}$ is an integer, then $N$ is not divisible by 3.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem problem1 {a : ℝ} (ha : 0 < a ∧ a < 1) (x : ℕ → ℝ) (hx1 : x 1 = a) (hxn : ∀ n, x (n + 1) = if 0 < x n ∧ x n < 1 then 2 * x n - (x n)^2 else ((n + 1)^4) / (2^n * Real.sqrt (x n + 3))) : Tendsto x atTop (𝓝 1) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-399664,"Let $p$ be an odd prime. Define $A(n)$ as the number of subsets of $\{1,2,\ldots,n\}$ such that the sum of the elements of the subset is a multiple of $p$. Prove that if $2^{p - 1}-1$ is not a multiple of $p^2$, then for any integer $k$, there exist infinitely many positive integers $m$ such that $$\frac{A(m)-k}{p} \in \mathbb{Z}.$$","import Mathlib open Finset theorem qwen {p : ℕ} (hp : Odd p ∧ Nat.Prime p) (A : ℕ → ℕ) (hA : ∀ n, A n = {s : Finset ℕ | s ⊆ Icc 1 n ∧ ∑ i ∈ s, i ≡ 0 [MOD p]}.ncard) (h : ¬(p ^ 2 ∣ 2 ^ (p - 1) - 1)) : ∀ k, {m | 0 < m ∧ p ∣ A m - k}.Infinite := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-400175,"Prove that \(\displaystyle\sum_{n=1}^{\infty}\frac{4^n}{\binom{2n}{n}(4n^2 - 1)}=\mathcal{G}+\frac{1}{2}\), where \(\mathcal{G}\) is the Catalan's constant.","import Mathlib open Real open scoped BigOperators theorem sum_series : ∑' n : ℕ, (4^(n+1))/(Nat.choose (2*(n+1)) (n+1)*(4*(n+1)^2 - 1)) = 1 / 2 + G := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-400234,"Given a meeting with $n$ people, where for every subset of 6 people, there exist at least two individuals who know each other. Prove that: - When \(n = 512\), there exists a subset of 6 people where all members know each other. - When \(n = 252\), there exists a subset of 6 people where all members know each other. - When \(n = 102\), there exists a subset of 6 people where all members know each other. - Also, prove that the Ramsey number \(R(6,6,2)\leq 222\).","import Mathlib open Finset theorem meeting_knows {n : ℕ} (hn : n ≥ 3) (a : Fin n → Fin n → Bool) (ha : ∀ s : Finset (Fin n), s.card = 6 → ∃ i ∈ s, ∃ j ∈ s, i ≠ j ∧ a i j) : (n = 512 → ∃ t : Finset (Fin n), t.card = 6 ∧ ∀ i ∈ t, ∀ j ∈ t, i ≠ j → a i j) ∧ (n = 252 → ∃ t : Finset (Fin n), t.card = 6 ∧ ∀ i ∈ t, ∀ j ∈ t, i ≠ j → a i j) ∧ (n = 102 → ∃ t : Finset (Fin n), t.card = 6 ∧ ∀ i ∈ t, ∀ j ∈ t, i ≠ j → a i j) ∧ (n = 222 → ∃ t : Finset (Fin n), t.card = 6 ∧ ∀ i ∈ t, ∀ j ∈ t, i ≠ j → a i j) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-400956,"Let $r \geq 2$ be a fixed positive integer, and let $\mathcal{F}$ be an infinite family of sets, each of size $r$, such that no two sets in $\mathcal{F}$ are disjoint. Prove that there exists a set $\{a_1, a_2, \ldots, a_{r - 1}\}$ that intersects every set in $\mathcal{F}$.","import Mathlib theorem Qwen (r : ℕ) (hr : 2 ≤ r) (F : Set (Finset ℕ)) (hF : Infinite F) (hF1 : ∀ s ∈ F, s.card = r) (hF2 : ∀ s ∈ F, ∀ t ∈ F, s ≠ t → ¬s ∩ t = ∅) : ∃ A : Finset ℕ, A.card = r - 1 ∧ ∀ s ∈ F, A ∩ s ≠ ∅ := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-401029,"Prove that the number of ways a magician can distribute 100 uniquely - numbered letters from \(1\) to \(100\) into three distinct non - empty boxes (a red box, a white box, and a blue box) such that, when a spectator selects two of the three boxes, removes one letter from each, and announces the sum of the numbers on the two letters, the magician can always correctly identify the box from which no letter was taken, is \(6 \times 3^{100} - 18 \times 2^{100} + 18\).","import Mathlib theorem prove : {(r, w, b) : Finset ℕ × Finset ℕ × Finset ℕ | r ∪ w ∪ b = Finset.Icc 1 100 ∧ r ∩ w = ∅ ∧ r ∩ b = ∅ ∧ w ∩ b = ∅ ∧ r ≠ ∅ ∧ w ≠ ∅ ∧ b ≠ ∅ ∧ ∀ x ∈ r, ∀ y ∈ w, x ≠ y → x + y ∈ b ∧ ∀ x ∈ r, ∀ y ∈ b, x ≠ y → x + y ∈ w ∧ ∀ x ∈ w, ∀ y ∈ b, x ≠ y → x + y ∈ r}.ncard = 6 * 3^100 - 18 * 2^100 + 18 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-401359,"Let $S$ be a subset of the set of all positive integers that satisfies the following conditions: 1. $S$ contains all perfect squares. 2. There do not exist distinct positive integers $x$ and $y$ such that $S$ contains exactly two of the three numbers $x$, $y$, and $x^2 + y^2$. Prove that $S$ is the set of all positive integers.","import Mathlib theorem q (S : Set ℕ) (hS : ∀ x ∈ S, x > 0) (hS1 : ∀ n, ∃ m ∈ S, m = n ^ 2) (hS2 : ¬∃ x y, x ≠ y ∧ x > 0 ∧ y > 0 ∧ {k | k ∈ S ∧ k = x ∨ k = y ∨ k = x ^ 2 + y ^ 2}.encard = 2) : S = {x | x > 0} := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-401404,"Prove that the generating function for the number of permutations of the first \(n\) integers that have exactly \(k\) runs is \(f(x,y) = \frac{1}{1+y} \left[-1 - xy + \sqrt{\frac{1-y}{1+y}} \cdot \frac{y + \cosh(x\sqrt{1-y^2}) - \sqrt{1-y^2}\sinh(x\sqrt{1-y^2})}{\sqrt{1-y^2}\cosh(x\sqrt{1-y^2}) - \sinh(x\sqrt{1-y^2})}\right]\), where a run in a permutation is defined as a distinct monotone (either increasing or decreasing) subsequence within the permutation.","import Mathlib open Finset Real theorem proveGeneratingFunction {n : ℕ} (hn : 0 < n) (k : ℕ) : ∃ f : ℝ → ℝ → ℝ, ∀ x y, f x y = (-1 - x * y + sqrt ((1 - y) / (1 + y)) * (y + cosh (x * sqrt (1 - y ^ 2)) - sqrt (1 - y ^ 2) * sinh (x * sqrt (1 - y ^ 2))) / (sqrt (1 - y ^ 2) * cosh (x * sqrt (1 - y ^ 2)) - sinh (x * sqrt (1 - y ^ 2)))) / (1 + y) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-401510,"### Problem A Prove that for a positive odd integer \(n\), the number of sequences \(a_0, a_1, \ldots, a_{n - 1}\) where \(a_i\in\{1,2,\ldots,n\}\) for each \(i\) and \(a_i - a_{i - 1}\not\equiv i\pmod{n}\) with \(a_n=a_0\) is \((n - 1)^n-(n - 1)\), and for a positive even integer \(n\), the number of such sequences is \((n - 1)^n - 1\). ### Problem B Prove that for a prime number \(n\), the number of sequences \(a_0, a_1, \ldots, a_{n - 1}\) where \(a_i\in\{1,2,\ldots,n\}\) for each \(i\) and \(a_i - a_{i - 1}\not\equiv i,2i\pmod{n}\) with \(a_n=a_0\) is \((n - 1)((n - 2)^{n - 1}-1)\).","import Mathlib open Finset theorem problemA {n : ℕ} (hn : Odd n) : {a : ℕ → ℕ | (∀ i ∈ Icc 0 (n - 1), a i ∈ Icc 1 n) ∧ (∀ i ∈ Icc 1 (n - 1), ¬(a i - a (i - 1) ≡ i [MOD n])) ∧ a n = a 0}.ncard = (n - 1)^n - (n - 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-402647,"Prove that the set of positive integers can be partitioned into two disjoint subsets \(A\) and \(B\) such that \(1\in A\), no two distinct members of \(A\) have a sum of the form \(2^k + 2\) for any integer \(k\geq0\), no two distinct members of \(B\) have a sum of the form \(2^k + 2\) for any integer \(k\geq0\), and this partitioning is unique. Also, prove that \(1987\in B\), \(1988\in A\), and \(1989\in B\).","import Mathlib theorem Prove_456723 (S : Set ℕ) (hS : S = {x | x > 0}) : ∃! A : Set ℕ, ∃! B : Set ℕ, A ∪ B = S ∧ A ∩ B = ∅ ∧ 1 ∈ A ∧ ∀ m ∈ A, ∀ n ∈ A, m ≠ n → ¬∃ k ≥ 0, m + n = 2 ^ k + 2 ∧ ∀ m ∈ B, ∀ n ∈ B, m ≠ n → ¬∃ k ≥ 0, m + n = 2 ^ k + 2 ∧ 1987 ∈ B ∧ 1988 ∈ A ∧ 1989 ∈ B := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-402789,"Prove that on a planet with \(3\times2005!\) aliens and \(2005\) languages, where each pair of aliens communicates with each other in exactly one language, there exist three aliens who communicate with each other in the same language.","import Mathlib theorem prove(aliens : Finset ℕ) (h : aliens.card = 3 * Nat.factorial 2005) (languages : Finset ℕ) (hl : languages.card = 2005) (comm : ℕ → ℕ → ℕ) (hcomm : ∀ a ∈ aliens, ∀ b ∈ aliens, a ≠ b → ∃! l ∈ languages, comm a b = l) : ∃ s : Finset ℕ, s ⊆ aliens ∧ s.card = 3 ∧ ∃ l ∈ languages, ∀ a ∈ s, ∀ b ∈ s, a ≠ b → comm a b = l := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-403758,"a) Prove that if the set of positive integers $\mathbb{Z}^+$ is partitioned into a finite number of subsets, each containing infinitely many elements, then there exists a subset in the partition such that every positive integer has at least one multiple within this subset. b) Prove that if the set of positive integers $\mathbb{Z}^+$ is partitioned into an infinite number of subsets, each containing infinitely many elements, then it is possible to construct a partition where no subset in the partition contains at least one multiple of every positive integer.","import Mathlib theorem a (n : ℕ) (hn : 0 < n) (s : Fin n → Set ℕ) (h₀ : ∀ i, s i ⊆ {x | 0 < x}) (h₁ : ∀ i, Infinite (s i)) : ∃ i, ∀ m, 0 < m → ∃ k ∈ s i, m ∣ k := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-405743,"Prove that the limit \(\lim_{k\to \infty}\sum_{2^{x}< 3^{y}}\frac{\binom{x+k}{y}}{2^{k}3^{y}}\) exists and is finite, and show that its value is approximately \(7.2\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (f : ℕ → ℝ) (h₀ : ∀ k, f k = ∑' x : ℕ, ∑' y : ℕ, if (2^x < 3^y) then Nat.choose (x + k) y / (2^k * 3^y) else 0) : ∃ L, Tendsto f atTop (𝓝 L) ∧ L ∈ Set.Icc 6.9 7.3 := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-406080,"Prove that there exists an uncountable family of subsets of $\mathbb{N}$ such that for any two distinct subsets $E_{\alpha}$ and $E_{\beta}$, the intersection $E_{\alpha} \cap E_{\beta}$ is finite.","import Mathlib theorem exist_families : ∃ families : Set (Set ℕ), (∀ s t, s ∈ families → t ∈ families → s ≠ t → (s ∩ t).Finite) ∧ ¬families.Countable := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-407535,"Given two disjoint sets $A$ and $B$ such that their union is the set of all positive integers $\mathbb{N}$, prove that for every positive integer $n$, there exist distinct integers $a$ and $b$, both greater than $n$, such that either $\{a, b, a + b\} \subseteq A$ or $\{a, b, a + b\} \subseteq B$.","import Mathlib theorem DisjointUnion {A B : Set ℕ} (hA : ∀ x ∈ A, x > 0) (hB : ∀ x ∈ B, x > 0) (hAB : A ∩ B = ∅) (hAB' : A ∪ B = {x | x > 0}) : ∀ n > 0, ∃ a b : ℕ, a > n ∧ b > n ∧ a ≠ b ∧ (a ∈ A ∧ b ∈ A ∧ a + b ∈ A ∨ a ∈ B ∧ b ∈ B ∧ a + b ∈ B) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-407536,"Prove that given two disjoint sets \(A\) and \(B\) such that \(A\cup B=\mathbb{N}\), for every positive integer \(n\), there exist distinct integers \(a\) and \(b\), both greater than \(n\), such that either \(\{a, b, a + b\} \subseteq A\) or \(\{a, b, a + b\} \subseteq B\).","import Mathlib theorem Set.NatUnion {A B : Set ℕ} (hAB : A ∩ B = ∅) (hAUB : A ∪ B = ℕ) : ∀ n > 0, ∃ a b : ℕ, a > n ∧ b > n ∧ (a ≠ b) ∧ (({a, b, a + b} ⊆ A) ∨ ({a, b, a + b} ⊆ B)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-408140,"Prove that the number of harmonic boards on a \(2008\times2008\) chessboard, where each unit - square is colored uniquely and filled with one of the letters \(C\), \(G\), \(M\), or \(O\) and a board is defined as harmonic if every \(2\times2\) subsquare contains all four different letters, is \(3 \cdot 2^{2010}-24\).","import Mathlib theorem prove_harmonic_boards : {b : Fin 2008 → Fin 2008 → ℕ | ∀ i j, b i j ∈ Finset.Icc 1 4 ∧ (∀ k l, k < 2008 → l < 2008 → (k + 1) < 2008 → (l + 1) < 2008 → (Set.ncard {x | ∃ i j, x = b i j ∧ k ≤ i ∧ i < (k + 1) ∧ l ≤ j ∧ j < (l + 1)} = 4))}.ncard = 3 * 2 ^ 2010 - 24 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-408142,"Prove that the number of harmonic boards on a \(2008\times2008\) chessboard, where each unit - square is colored uniquely with one of the letters \(C\), \(G\), \(M\), or \(O\) and a board is harmonic if every \(2\times2\) subsquare contains all four different letters, is \(3 \cdot 2^{4016} - 24 \cdot 2^{2007}\).","import Mathlib open Finset theorem number_of_harmonic_boards : {b : Fin 2008 → Fin 2008 → ℕ | (∀ i j, b i j = 0 ∨ b i j = 1 ∨ b i j = 2 ∨ b i j = 3) ∧ (∀ i j, i + 1 < 2008 → j + 1 < 2008 → (b i j ≠ b (i + 1) j ∧ b i j ≠ b i (j + 1) ∧ b i j ≠ b (i + 1) (j + 1)))}.ncard = 3 * 2 ^ 4016 - 24 * 2 ^ 2007 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-411236,"Prove that the girth (the length of the shortest cycle) of the graph $O_k$, whose vertices are the $k$-element subsets of the set $\{1, 2, \ldots, 2k+1\}$ and where two vertices are connected by an edge if and only if the corresponding subsets are disjoint, is $6$ for $k \geq 3$.","import Mathlib open Finset theorem girth {k : ℕ} (hk : k ≥ 3) : IsLeast {x | ∃ c : Finset (Finset (Icc 1 (2 * k + 1))), x = c.card ∧ (∀ s ∈ c, s.card = k) ∧ (∀ s ∈ c, ∀ t ∈ c, s ≠ t → Disjoint s t)} 6 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-412334,"Prove that for a prime \(p > 3\), the last three digits of the sum \(\sum_{i = 1}^{p} \binom{i \cdot p}{p} \cdot \binom{(p - i + 1) \cdot p}{p}\) in the base - \(p\) numeral system are \(\frac{p(p + 1)(p + 2)}{6} \pmod{p^3}\).","import Mathlib theorem PrimeSum (p : ℕ) (hp : Nat.Prime p) (h : 3 < p) : (∑ i ∈ Finset.Icc 1 p, Nat.choose (i * p) p * Nat.choose ((p - i + 1) * p) p) % (p ^ 3) = p * (p + 1) * (p + 2) / 6 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-412636,Prove that the sum \(S\) of the products of the non - zero digits of each integer from \(1\) to \(10^{2009}\) is equal to \(46^{2009}\).,"import Mathlib open Finset def S : ℕ := ∑ n ∈ Icc 1 (10^2009), ((Nat.digits 10 n).filter (fun d => d ≠ 0)).prod theorem S_sum : S = 46^2009 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-413898,"Prove that if $\mathbb{X}$ denotes the set of all bijective functions from the set $S = \{1, 2, \ldots, n\}$ to itself, and for each $f \in \mathbb{X}$, the function $T_f : S \to \{0, 1\}$ is defined as \[ T_f(j) = \begin{cases} 1 & \text{if } f^{(12)}(j) = j, \\ 0 & \text{otherwise}, \end{cases} \] where $f^{(k)}(x) = f(f^{(k - 1)}(x))$ for all $k \geq 2$, then $\sum_{f \in \mathbb{X}} \sum_{j = 1}^n T_f(j)=6 \cdot n!$.","import Mathlib open Finset theorem prove {n : ℕ} (hn : 0 < n) : ∑ f ∈ {g : Equiv.Perm (Fin n) | Function.Bijective g}, ∑ j : Fin n, (if f^[12] j = j then 1 else 0) = 6 * Nat.factorial n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-417024,"Prove that there exists a positive real number $C$ such that for any integer $n \ge 2$ and any subset $X$ of the set $\{1, 2, \ldots, n\}$ with $|X| \ge 2$, there exist $x, y, z, w \in X$ (not necessarily distinct) satisfying \[0 < |xy - zw| < C \alpha^{-4},\] where $\alpha = \frac{|X|}{n}$.","import Mathlib open Finset Real theorem prove : ∃ C : ℝ, C > 0 ∧ ∀ n ≥ 2, ∀ X : Finset ℕ, X ⊆ Icc 1 n ∧ X.card ≥ 2 → ∃ x ∈ X, ∃ y ∈ X, ∃ z ∈ X, ∃ w ∈ X, 0 < |(x * y : ℝ) - z * w| ∧ |(x * y : ℝ) - z * w| < C * (X.card / n) ^ (-4 : ℤ) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-417226,"Prove that for a positive integer \(n\), the greatest possible integer \(m\) such that a table with \(m\) rows and \(n\) columns can be filled with real numbers satisfying that for any two distinct rows \(\left[ {{a_1},{a_2},\ldots,{a_n}}\right]\) and \(\left[ {{b_1},{b_2},\ldots,{b_n}} \right]\), the condition \(\max\left( {\left| {{a_1} - {b_1}} \right|,\left| {{a_2} - {b_2}} \right|,\ldots,\left| {{a_n} - {b_n}} \right|} \right) = 1\) holds is \(m = 2^n\).","import Mathlib open Finset Real Matrix theorem Matrix.maxRows (n : ℕ) (hn : 0 < n) : IsGreatest {m | ∃ A : Matrix (Fin m) (Fin n) ℝ, ∀ r s : Fin m, r ≠ s → sSup {abs (A r j - A s j) | j : Fin n} = 1} (2 ^ n) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-417494,"Prove that a pair $\{a, b\}$ of positive integers has the property that, for any coloring of the positive integers using two colors $A$ and $B$, there always exist two positive integers of color $A$ whose difference is $a$ or two positive integers of color $B$ whose difference is $b$ if and only if $\nu_2(a) \neq \nu_2(b)$.","import Mathlib theorem Prove (a b : ℕ) (_ : 0 < a) (hb : 0 < b) : (∀ f : ℕ → Fin 2, ∃ i j, i ≠ j ∧ f i = 0 ∧ f j = 0 ∧ |(i : ℤ) - j| = a ∨ ∃ i j, i ≠ j ∧ f i = 1 ∧ f j = 1 ∧ |(i : ℤ) - j| = b) ↔ Nat.factorization a 2 ≠ Nat.factorization b 2 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-418101,"Prove that the greatest $n \in \mathbb{N}$ for which there exist $n$ sets $A_1, A_2, \ldots, A_n$ such that $|A_i| = 5$ for $i = 1, \ldots, n$, $|A_i \cap A_j| = 1$ for all $i \neq j$, and $|A_1 \cup A_2 \cup \cdots \cup A_n| = n$ is $n = 21$.","import Mathlib open Finset theorem isGood (n : ℕ) : (∃ A : Fin n → Set ℕ, (∀ i j, i ≠ j → (A i ∩ A j).ncard = 1) ∧ (∀ i, (A i).ncard = 5) ∧ ((⋃ i, A i).ncard = n)) ↔ n ≤ 21 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-418416,"The user's problem is already a formal math proof problem. So the final proof statement is: Consider a \(2010^2\times2010^2\) chessboard where each square contains a positive integer. The difference between the numbers in any two adjacent squares (sharing an edge) is at most \(2010\). Prove that at least \(1006\) squares contain the same number.","import Mathlib theorem algebraic_chocolate_979189 (a : Fin (2010 ^ 2) → Fin (2010 ^ 2) → ℕ) (h₀ : ∀ i j, a i j > 0) (h₁ : ∀ i j, i + 1 < 2010 ^ 2 → |(a i j : ℤ) - (a (i + 1) j)| ≤ 2010) (h₂ : ∀ i j, j + 1 < 2010 ^ 2 → |(a i j : ℤ) - (a i (j + 1))| ≤ 2010) : ∃ n, {p : Fin (2010 ^ 2) × Fin (2010 ^ 2) | a p.1 p.2 = n}.ncard ≥ 1006 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-419946,Prove that the maximum possible value of the cardinality of a subset \(E\) of the divisors of \(1800^{1800}\) such that no element of \(E\) divides another is \(2701 \cdot 1801 \cdot 1801\).,"import Mathlib theorem cardMax : IsGreatest {n : ℕ | ∃ E : Finset ℕ, E ⊆ (Nat.divisors (1800 ^ 1800)) ∧ (∀ x ∈ E, ∀ y ∈ E, x ≠ y → ¬(x ∣ y)) ∧ E.card = n} (2701 * 1801 * 1801) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-419951,"Prove that the maximum possible value of the cardinality of a subset \(E\) of the divisors of \(1800^{1800}\) such that no element of \(E\) divides another is the number of solutions to \(a + b + c = 6300\) with \(0 \leq a \leq 5400\), \(0 \leq b, c \leq 3600\).","import Mathlib theorem max_capacity : IsGreatest {x | ∃ E : Finset ℕ, E ⊆ Nat.divisors (1800^1800) ∧ E.card = x ∧ ∀ m ∈ E, ∀ n ∈ E, m ≠ n → ¬(m ∣ n)} (Nat.card {p : Fin 3 → ℕ | p 0 + p 1 + p 2 = 6300 ∧ p 0 ≤ 5400 ∧ p 1 ≤ 3600 ∧ p 2 ≤ 3600}) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-420201,"Prove that the head of the Mint can release 12 coin denominations, each a natural number of rubles, such that any amount from \(1\) to \(6543\) rubles can be paid using no more than \(8\) coins, with the possibility of using multiple coins of the same denomination.","import Mathlib theorem prove (d : Fin 12 → ℕ) : (∀ i, d i > 0) ∧ (∀ n ∈ Finset.Icc 1 6543, ∃ k : Fin 12 → ℕ, (∀ i, k i ≤ 8) ∧ n = ∑ i, k i * d i) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-422375,"Let $A_1, A_2, \ldots$ be a sequence of sets such that for any positive integer $i$, there are only finitely many values of $j$ for which $A_j \subseteq A_i$. Prove that there exists a sequence of positive integers $a_1, a_2, \ldots$ such that for any pair of indices $(i, j)$, $a_i \mid a_j$ if and only if $A_i \subseteq A_j$.","import Mathlib theorem FinsetSeq {A : ℕ → Set ℕ} (hA : ∀ i > 0, {j | A j ⊆ A i}.Finite) : ∃ a : ℕ → ℕ, (∀ i j, 0 < a i ∧ 0 < a j) ∧ (∀ i j, a i ∣ a j ↔ A i ⊆ A j) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-422394,"Prove that if $M$ is the set of all integers from $1$ to $2013$, and each subset of $M$ is assigned one of $k$ available colors under the condition that if the union of two distinct subsets $A$ and $B$ is $M$, then $A$ and $B$ must be assigned different colors, then the least possible value of $k$ is $2014$.","import Mathlib open Finset theorem prove (M : Finset ℕ) (hM : M = Icc 1 2013) : IsLeast {k | ∃ f : Finset ℕ → Fin k, ∀ A B : Finset ℕ, A ⊆ M ∧ B ⊆ M ∧ A ≠ B ∧ A ∪ B = M → f A ≠ f B} 2014 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-422395,"Prove that the least possible value of \(k\) such that each subset of the set \(M=\{1,2,\ldots,2013\}\) can be assigned one of \(k\) available colors with the condition that if the union of two distinct subsets \(A\) and \(B\) is \(M\), then \(A\) and \(B\) must be assigned different colors, is \(2014\).","import Mathlib open Finset theorem number_of_colors : IsLeast {k | ∃ f : Finset (Fin 2013) → Fin k, ∀ s t : Finset (Fin 2013), s ≠ t ∧ f s = f t ∧ s ∪ t = univ → False} 2014 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-422397,"Prove that the least possible value of \(k\) such that when each subset of the set \(M=\{1,2,\cdots,2013\}\) is assigned one of \(k\) available colors under the condition that if the union of two distinct subsets \(A\) and \(B\) is \(M\), then \(A\) and \(B\) must be assigned different colors, is \(2014\).","import Mathlib open Finset theorem prove : IsLeast {k | ∃ f : Finset (Fin 2013) → Fin k, ∀ A B : Finset (Fin 2013), A ≠ B ∧ f A = f B → A ∪ B ≠ ⊤} 2014 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-423378,"Let \(S = \{1, 2, \ldots, 2008\}\). Prove that there exists a function \(f: S \to \{\text{red, white, blue, green}\}\) such that there does not exist a \(10\) - term arithmetic progression \(a_1, a_2, \ldots, a_{10}\) in \(S\) satisfying \(f(a_1) = f(a_2) = \cdots = f(a_{10})\).","import Mathlib def S : Finset ℕ := Finset.Icc 1 2008 theorem prove : ∃ f : ℕ → Fin 4, ¬∃ a : ℕ → ℕ, (∀ i ∈ Finset.range 10, a i ∈ S) ∧ (∃ d, ∀ i ∈ Finset.range 9, a (i + 1) = a i + d) ∧ (∀ i ∈ Finset.range 10, f (a i) = f (a 0)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-424567,"Prove that the number of functions $f: \mathbb{N} \rightarrow \mathbb{N}$ that satisfy the following conditions for all $n \in \mathbb{N}$: 1. \(f(1) = 5\) 2. \(f(f(n)) = 4n + 9\) 3. \(f(2^n) = 2^{n+1} + 3\) is equal to \(\mathfrak{c}\).","import Mathlib open Set Function theorem number_of_solution (s : Set (ℕ → ℕ)) (hs : s = {f | f 1 = 5 ∧ ∀ n, f (f n) = 4 * n + 9 ∧ ∀ n, f (2 ^ n) = 2 ^ (n + 1) + 3}) : s.ncard = c := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-424694,"(a) Prove that for an integer $k > 1$ and $n = 2k$, every subset $S$ of $\{1, 2, \ldots, n\}$ with $|S| > \frac{3n}{4}$ is balanced, where a subset $S$ is defined as balanced if for every $a \in S$, there exists some $b \in S$ with $b \neq a$ such that $\frac{a + b}{2} \in S$. (b) Prove or disprove: There exists an integer $n = 2k$ with $k > 1$ such that every subset $S$ of $\{1, 2, \ldots, n\}$ with $|S| > \frac{2n}{3}$ is balanced, where a subset $S$ is defined as balanced if for every $a \in S$, there exists some $b \in S$ with $b \neq a$ such that $\frac{a + b}{2} \in S$.","import Mathlib open Finset theorem prove_a {k : ℕ} (hk : 1 < k) (n : ℕ) (hn : n = 2 * k) (S : Finset ℕ) (hS : S ⊆ Icc 1 n) (hS1 : S.card > 3 * n / 4) : ∀ x ∈ S, ∃ y ∈ S, y ≠ x ∧ (x + y) / 2 ∈ S := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-424852,"Prove that if $N \geq 9$ is an integer and $a_1, a_2, \ldots, a_N$ are $N$ distinct real numbers written on a blackboard, where each $a_i$ is nonnegative and less than $1$, and for every set of $8$ distinct numbers on the board, there exists a ninth number, distinct from the eight, such that the sum of these nine numbers is an integer, then the only possible value of $N$ is $9$.","import Mathlib theorem Prove_467390 (N : ℕ) (hN : N ≥ 9) (a : Finset ℝ) (ha : ∀ x ∈ a, 0 ≤ x ∧ x < 1) (h : ∀ s ⊆ a, s.card = 8 → ∃ x ∈ a, x ∉ s ∧ ∃ n : ℤ, ∑ i ∈ s ∪ {x}, i = n) : N = 9 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-426448,"1. First, identify the final conclusion from the assistant's answer: - The final conclusion is that the number of people \(n\) in the group can be expressed as \(n = k^2+1\) where \(k\) is a natural number, and \(n = 50\) is possible. 2. Then, rewrite the user's problem into a formal math - proof statement: - Prove that if \(n\) is a natural number such that \(n\geq3\), and there is a group of \(n\) people where every two individuals either know each other or have exactly one common friend, and no individual in the group knows everyone else, then \(n\) can be expressed as \(n = k^2 + 1\) for some natural number \(k\), and show that \(n = 50\) is a valid value for \(n\) under these conditions. So the formal math proof statement is: Prove that if \(n\in\mathbb{N}\) with \(n\geq3\), and in a group of \(n\) people, every two individuals either know each other or have exactly one common friend, and no individual knows everyone else, then \(n = k^2 + 1\) for some \(k\in\mathbb{N}\), and \(n = 50\) satisfies these conditions.","import Mathlib theorem prove (n : ℕ) (hn : n ≥ 3) (a : Fin n → Fin n → Prop) (ha : ∀ i j, a i j ∨ ∃! x, a i x ∧ a j x) (h : ¬∃ i, ∀ j, a i j) : ∃ k, n = k ^ 2 + 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-426968,"Prove that the number of positive integers \(1\leq k\leq 2016\) for which, given a sequence \(\{a_n\}_{n\geq 0}\) defined by \(a_0 = 1\) and for all positive integers \(n\), \(a_n\) is the smallest positive integer greater than \(a_{n - 1}\) such that \(a_n\equiv ka_{n - 1}\pmod{2017}\), we have \(a_{2016}=1+\binom{2017}{2}\) is \(63\).","import Mathlib theorem prove : Set.ncard {k : ℕ | 1 ≤ k ∧ k ≤ 2016 ∧ ∃ a : ℕ → ℕ, a 0 = 1 ∧ ∀ n > 0, IsLeast {x | 0 < x ∧ x > a (n - 1) ∧ x ≡ k * a (n - 1) [MOD 2017]} (a n) ∧ a 2016 = 1 + Nat.choose 2017 2} = 63 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-428190,"Prove that the maximum value of \(k\) for which there exist \(k\) distinct subsets \(A_1, A_2, \dots, A_k\) of the set \(S=\{1, 2, 3, 4, 5, 6\}\) such that for any \(1 \le i < j \le k\), the intersection \(|A_i \cap A_j| \ge 2\) is \(22\).","import Mathlib open Finset theorem max_k (S : Finset ℕ) (hS : S = {1, 2, 3, 4, 5, 6}) : IsGreatest {k | ∃ A : Finset (Finset ℕ), A.card = k ∧ (∀ x ∈ A, x ⊆ S) ∧ (∀ i ∈ A, ∀ j ∈ A, i ≠ j → (i ∩ j).card ≥ 2)} 22 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-428935,"For every integer \(k \geq 3\), prove that there exist two distinct sets \(\{a_1, \ldots, a_s\}\) and \(\{b_1, \ldots, b_s\} \subset \mathbb{Z}\) such that for all \(j = 1, \ldots, k\), $$\sum_{i=1}^{s} a_i^j = \sum_{i=1}^{s} b_i^j,$$ but $$\sum_{i=1}^{s} a_i^{k+1} \neq \sum_{i=1}^{s} b_i^{k+1},$$ and that this can be achieved with \(s\) bounded by a quadratic function of \(k\) (specifically, \(s = \frac{k(k + 1)}{2} + 1\)).","import Mathlib theorem for_kge3 (k : ℕ) (hk : 3 ≤ k) : ∃ s : ℕ, s = k * (k + 1) / 2 + 1 ∧ ∃ a b : Fin s → ℤ, (∀ i j, i ≠ j → a i ≠ a j ∧ b i ≠ b j) ∧ (∀ j ∈ Finset.Icc 1 k, ∑ i : Fin s, (a i)^j = ∑ i : Fin s, (b i)^j) ∧ (∑ i : Fin s, (a i)^(k + 1)) ≠ (∑ i : Fin s, (b i)^(k + 1)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-429148,Prove that it is possible to color every lattice point (a point in the plane with integer coordinates) either red or blue such that every lattice line (a line in the plane that contains at least two lattice points) contains exactly \(2017\) red lattice points.,"import Mathlib theorem prove : ∃ f : ℤ × ℤ → Fin 2, ∀ p q : ℤ × ℤ, p ≠ q → {r | r ∈ line[ℤ, p, q] ∧ f r = 0}.encard = 2017 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-429403,"Prove that for any infinite sequence \(a_0, a_1, \dots, a_n, \dots\) consisting of \(1\) and \(-1\), there exist positive integers \(n\) and \(k\) such that \[ \left\lvert \sum_{i=0}^{n} \prod_{j=0}^{k} a_{i+j} \right\rvert = 2017. \]","import Mathlib open Finset theorem prove (a : ℕ → ℤ) (ha : ∀ n, a n = 1 ∨ a n = -1) : ∃ n k, 0 < n ∧ 0 < k ∧ |∑ i ∈ range (n + 1), (∏ j ∈ range (k + 1), a (i + j))| = 2017 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-429454,"Let every point in space be colored with exactly one of the colors Red, Green, or Blue. Define the sets \(R\), \(G\), and \(B\) to consist of the lengths of segments in space whose endpoints are both red, both green, and both blue, respectively. Prove that at least one of these sets contains all positive reals.","import Mathlib open Real Set open scoped BigOperators theorem segment_length (f : EuclideanSpace ℝ (Fin 3) → Fin 3) (R G B : Set ℝ) (hR : R = {x | ∃ p q : EuclideanSpace ℝ (Fin 3), p ≠ q ∧ f p = 0 ∧ f q = 0 ∧ x = dist p q}) (hG : G = {x | ∃ p q : EuclideanSpace ℝ (Fin 3), p ≠ q ∧ f p = 1 ∧ f q = 1 ∧ x = dist p q}) (hB : B = {x | ∃ p q : EuclideanSpace ℝ (Fin 3), p ≠ q ∧ f p = 2 ∧ f q = 2 ∧ x = dist p q}) : ∀ x > 0, x ∈ R ∨ x ∈ G ∨ x ∈ B := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-432045,"1. **First part**: - The original problem already asks for a proof. So, the formal proof statement is: - Let \(f: X \to Y\) be a continuous surjective map such that for every closed subset \(A \subseteq X\), the image \(f(A)\) is closed in \(Y\). Prove that if \(Y\) and all the fibers \(f^{-1}(y)\), for \(y \in Y\), are compact, then \(X\) is compact. 2. **Second part**: - The original problem already asks for a proof. So, the formal proof statement is: - Let \(f: X \to Y\) be a continuous surjective map such that for every closed subset \(A \subseteq X\), the image \(f(A)\) is closed in \(Y\). Prove that if \(Y\) is Hausdorff and \(X\) is compact, then \(Y\) and all the fibers \(f^{-1}(y)\), for \(y \in Y\), are compact.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem T2 [TopologicalSpace X] [TopologicalSpace Y] (f : X → Y) (hf : Continuous f) (hsurj : Function.Surjective f) (himage : ∀ A : Set X, IsClosed A → IsClosed (f '' A)) (hY : CompactSpace Y) (hfibers : ∀ y : Y, IsCompact (f ⁻¹' {y})) : CompactSpace X := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-432821,"Show that it is possible to construct a round - robin tournament with more than \(1000\) participants such that for any subset of \(1000\) participants, there exists at least one participant outside this subset who beats all \(1000\) participants.","import Mathlib open Finset theorem round_robin_tournament {n : ℕ} (hn : n > 1000) : ∃ f : Fin n → Fin n, (∀ s : Finset (Fin n), s.card = 1000 → ∃ x : Fin n, x ∉ s ∧ ∀ y ∈ s, f x > f y) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-432894,"Prove that for a given set $S$ of positive integers, at least one of the following assertions is true: 1. There exist distinct finite subsets $F$ and $G$ of $S$ such that $\sum_{x \in F} \frac{1}{x} = \sum_{x \in G} \frac{1}{x}$. 2. There exists a positive rational number $r < 1$ such that $\sum_{x \in F} \frac{1}{x} \neq r$ for all finite subsets $F$ of $S$.","import Mathlib theorem Prove (S : Finset ℕ) (hS : ∀ x ∈ S, x > 0) : ∃ T : Finset ℕ, T ⊆ S ∧ (∃ U : Finset ℕ, U ⊆ S ∧ U ≠ T ∧ ∑ x ∈ T, (1 / x : ℚ) = ∑ x ∈ U, (1 / x : ℚ)) ∨ ∃ r : ℚ, 0 < r ∧ r < 1 ∧ ∀ T : Finset ℕ, T ⊆ S → ∑ x ∈ T, (1 / x : ℚ) ≠ r := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-432895,"Given a set $S$ of positive integers, prove that at least one of the following assertions is true: 1. There exist distinct finite subsets $F$ and $G$ of $S$ such that $\sum_{x \in F} \frac{1}{x} = \sum_{x \in G} \frac{1}{x}$. 2. There exists a positive rational number $r < 1$ such that $\sum_{x \in F} \frac{1}{x} \neq r$ for all finite subsets $F$ of $S$.","import Mathlib theorem prove (S : Finset ℕ) (hS : ∀ x ∈ S, x > 0) : ∃ (T : Finset ℕ), T ⊆ S ∧ (∃ U : Finset ℕ, U ⊆ S ∧ U ≠ T ∧ ∑ x ∈ T, (1 / x : ℚ) = ∑ x ∈ U, (1 / x : ℚ)) ∨ (∃ r : ℚ, 0 < r ∧ r < 1 ∧ ∀ T : Finset ℕ, T ⊆ S → ∑ x ∈ T, (1 / x : ℚ) ≠ r) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-432900,"Prove that for any set $S$ of positive integers, at least one of the following assertions is true: 1. There exist distinct finite subsets $F$ and $G$ of $S$ such that $\sum_{x \in F} \frac{1}{x} = \sum_{x \in G} \frac{1}{x}$. 2. There exists a positive rational number $r < 1$ such that $\sum_{x \in F} \frac{1}{x} \neq r$ for all finite subsets $F$ of $S$.","import Mathlib theorem algebra_473366 (S : Finset ℕ) (hS : ∀ x ∈ S, x > 0) : ∃ (T : Finset ℕ), T ⊆ S ∧ (∃ (U : Finset ℕ), U ⊆ S ∧ U ≠ T ∧ ∑ x ∈ T, (1 / x : ℚ) = ∑ x ∈ U, (1 / x : ℚ)) ∨ (∃ r : ℚ, 0 < r ∧ r < 1 ∧ ∀ T : Finset ℕ, T ⊆ S → ∑ x ∈ T, (1 / x : ℚ) ≠ r):= by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-433060,"1. Prove that the maximal size of a reduced subset \(B\) of the set \(A=\{n\in\mathbb{Z}\mid 0 < n < 2013\}\), where a subset \(B\subseteq A\) is called reduced if for any two numbers \(x,y\in B\), the product \(x\cdot y\notin B\), is \(1968\). 2. Prove that the number of reduced subsets of the set \(A = \{n\in\mathbb{Z}\mid 0 < n < 2013\}\) that have the maximal size is \(1\).","import Mathlib def isReduced (B : Set ℤ) := ∀ x ∈ B, ∀ y ∈ B, x * y ∉ B theorem prove : IsGreatest {x | ∃ B : Set ℤ, B ⊆ {n | 0 < n ∧ n < 2013} ∧ B.ncard = x ∧ isReduced B} 1968 ∧ {B : Set ℤ | B ⊆ {n | 0 < n ∧ n < 2013} ∧ B.ncard = 1968 ∧ isReduced B}.encard = 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-434300,"Prove that there exists an infinite sequence of positive integers \(a_1, a_2, \dots\) such that: 1. Every positive integer appears in the sequence exactly once. 2. For every positive integer \(n\), the product \(a_1 a_2 \dots a_n\) of the first \(n\) terms of the sequence is an \(n\) - th power.","import Mathlib theorem exist_sequence : ∃ a : ℕ → ℕ, (∀ n > 0, ∃! k, a k = n) ∧ (∀ n > 0, ∃ m, ∏ i ∈ Finset.Icc 1 n, a i = m ^ n) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-434906,"Prove that the maximum number of colors that can be used to color each integer in the set $\{1, 2, 3, \ldots, 2020\}$ such that for all positive integers $a$ and $b$ where $a + b \leq 2020$, the numbers $a$, $b$, and $a + b$ are not colored with three different colors, is $\boxed{11}$.","import Mathlib theorem max_colors : IsGreatest {n | ∃ f : ℕ → Fin n, ∀ a b, a > 0 → b > 0 → a + b ≤ 2020 → ¬(∃ x y z, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ f a = x ∧ f b = y ∧ f (a + b) = z)} 11 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-434912,"Prove that when for each integer in the set $\{1, 2, 3, \ldots, 2020\}$, a coloring is applied such that for all positive integers $a$ and $b$ where $a + b \leq 2020$, the numbers $a$, $b$, and $a + b$ are not colored with three different colors, the maximum number of colors that can be used is $\lfloor\log_2 2020\rfloor + 1 = 11$.","import Mathlib open Finset theorem colorings : IsGreatest {k | ∃ f : ℕ → Fin k, ∀ a ∈ Icc 1 2020, ∀ b ∈ Icc 1 2020, a + b ≤ 2020 → ¬(∃ x y z, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ f a = x ∧ f b = y ∧ f (a + b) = z)} 11 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-434915,"Prove that the maximum number of colors that can be used when, for each integer in the set $\{1, 2, 3, \ldots, 2020\}$, a coloring is applied such that for all positive integers $a$ and $b$ where $a + b \leq 2020$, the numbers $a$, $b$, and $a + b$ are not colored with three different colors, is $11$.","import Mathlib theorem max_colors : IsGreatest {n | ∃ f : ℕ → Fin n, ∀ a b, a ≤ 2020 → b ≤ 2020 → a + b ≤ 2020 → ¬(∃ x y z, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ f a = x ∧ f b = y ∧ f (a + b) = z)} 11 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-435277,"Prove that for any set of $2018$ rectangles with integer side lengths not exceeding $134$, where no two rectangles in the set are congruent, there exist $31$ rectangles $A_1, A_2, \ldots, A_{31}$ such that $A_1 \subseteq A_2 \subseteq \cdots \subseteq A_{31}$, where $A \subseteq B$ means rectangle $A$ can be placed inside rectangle $B$ without rotation.","import Mathlib theorem prove (S : Finset (ℕ × ℕ)) (hS : S.card = 2018) (hS1 : ∀ x ∈ S, x.1 ≤ 134 ∧ x.2 ≤ 134) (hS2 : ∀ x ∈ S, ∀ y ∈ S, x ≠ y → ¬(∃ a b, a > 0 ∧ b > 0 ∧ x = (a, b) ∧ y = (b, a))) : ∃ T : Finset (ℕ × ℕ), T ⊆ S ∧ T.card = 31 ∧ ∀ x ∈ T, ∀ y ∈ T, x ≤ y := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-435479,"Prove that the number of roots in the interval $[1, 2]$ for the equation $f^{(2021)}(x) = 0$, where $f(x) = -x^2 + 2$ and $f^{(2021)}$ denotes the 2021 - fold composition of $f$ with itself, is $\frac{2^{2021} - 2}{3}$.","import Mathlib open Real theorem prove {f : ℝ → ℝ} (hf : f = fun x => -x ^ 2 + 2) : {x | x ∈ Set.Icc 1 2 ∧ f^[2021] x = 0}.ncard = (2 ^ 2021 - 2) / 3 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-435926,"Prove that the maximum possible size of the family $F$ of subsets from the set $\{1, 2, \ldots, 2020\}$ that Hobbes can select in a game where Calvin and Hobbes take turns selecting a number from $\{1, 2, \ldots, 2020\}$ (Calvin starts, no number is chosen more than once, and each player ends up with $1010$ numbers, and Calvin wins if the set of his chosen numbers includes all elements of at least one subset in $F$) to guarantee a winning strategy is $2^{2020} - 3^{1010}$.","import Mathlib theorem prove : IsGreatest {n | ∃ F : Finset (Finset ℕ), F.card = n ∧ (∀ T ∈ F, T ⊆ Finset.Icc 1 2020) ∧ (∀ S ⊆ Finset.Icc 1 2020, S.card = 1010 → ∃ T ∈ F, T ⊆ S)} (2^2020 - 3^1010) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-435927,"Prove that the maximum possible size of the family $F$ of subsets from the set $\{1, 2, \ldots, 2020\}$ that Hobbes can select in a game where Calvin and Hobbes take turns selecting non - repeating numbers from $\{1, 2, \ldots, 2020\}$ (Calvin starts, and each player selects 1010 numbers in total), and Calvin wins if the set of numbers he has chosen includes all elements of at least one subset in $F$, is \(4^{1010}-3^{1010}\).","import Mathlib theorem maxFamily : IsGreatest {n | ∃ F : Finset (Finset ℕ), F.card = n ∧ (∀ S ∈ F, S ⊆ Finset.Icc 1 2020) ∧ (∀ T ⊆ Finset.Icc 1 2020, T.card = 1010 → ∃ U ∈ F, U ⊆ T)} (4^1010 - 3^1010) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-435929,"Prove that the maximum possible size of the family $F$ of subsets from the set $\{1, 2, \ldots, 2020\}$ that Hobbes can select in a game where Calvin and Hobbes take turns selecting a number from $\{1, 2, \ldots, 2020\}$ (Calvin starts, no number is chosen more than once, and each player ends up choosing $1010$ numbers, with Calvin winning if his set of chosen numbers includes all elements of at least one subset in $F$) to guarantee a winning strategy is $2^{2020} - 3^{1010}$.","import Mathlib open Finset theorem max_families : IsGreatest {x | ∃ F : Finset (Finset ℕ), F.card = x ∧ ∀ S ∈ F, S ⊆ Icc 1 2020 ∧ (∀ T ⊆ Icc 1 2020, T.card = 1010 → ∃ U ∈ F, U ⊆ T)} (2^2020 - 3^1010) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-435933,"Prove that in a strategic game where initially Hobbes selects a family $F$ of subsets from the set $\{1, 2, \ldots, 2n\}$, and then Calvin and Hobbes take turns selecting a number from $\{1, 2, \ldots, 2n\}$ without repetition (Calvin makes the first move), with the game ending when all numbers are selected and each player has chosen $n$ numbers, and Calvin wins if the set of numbers he has chosen includes all elements of at least one subset in $F$, the maximum possible size of the family $F$ that Hobbes can select to guarantee a winning strategy is $4^n - 3^n$.","import Mathlib open Finset theorem StrategicGame {n : ℕ} (hn : 0 < n) : IsGreatest {k | ∃ F : Finset (Finset ℕ), F.card = k ∧ (∀ f ∈ F, f ⊆ Icc 1 (2 * n)) ∧ (∀ C : Finset ℕ, C ⊆ Icc 1 (2 * n) ∧ C.card = n → ∃ f ∈ F, ∀ x ∈ C, x ∈ f)} (4 ^ n - 3 ^ n) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-435938,"Prove that the maximum possible size of the family $F$ of subsets from the set $\{1, 2, \ldots, 2020\}$ that Hobbes can select in a game where Calvin and Hobbes take turns selecting a number from $\{1, 2, \ldots, 2020\}$ (Calvin makes the first move, no number is chosen more than once, and each player ends up choosing $1010$ numbers, with Calvin winning if the set of numbers he has chosen includes all elements of at least one subset in $F$) to guarantee a winning strategy is $2^{2020} - 3^{1010}$.","import Mathlib open Finset theorem maxF : IsGreatest {k | ∃ F : Finset (Finset ℕ), F.card = k ∧ (∀ s ∈ F, s ⊆ Icc 1 2020) ∧ (∀ c : Finset ℕ, c ⊆ Icc 1 2020 ∧ c.card = 1010 → ∃ s ∈ F, s ⊆ c)} (2^2020 - 3^1010) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-436179,"Prove that for a sequence of \(2019\) real numbers \(a_1, a_2, \ldots, a_{2019}\), where \(m\) is the average of these numbers and \(T\) is the number of triples \((i, j, k)\) with \(1 \le i < j < k \le 2019\) such that \(a_i + a_j + a_k \ge 3m\), the minimum possible value of \(T\) is \(1009 \cdot 1008 \cdot 1007\).","import Mathlib open Finset Real theorem min_t : IsLeast {T : ℕ | ∃ a : Fin 2019 → ℝ, T = {(i, j, k) : Fin 2019 × Fin 2019 × Fin 2019 | i < j ∧ j < k ∧ 3 * (∑ x : Fin 2019, a x) / 2019 ≤ a i + a j + a k}.ncard} (1009 * 1008 * 1007) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-436204,"The user's problem is already a formal math proof problem. So the final proof statement is: Let $a_1$ be any positive integer. For all $i \geq 1$, define $a_{i+1}$ as follows: write $5^{2020} \times a_i$ in base $10$, replace each digit with its remainder when divided by $2$, read off the result in binary, and call that $a_{i+1}$. Prove that there exists a sufficiently large integer $N$ such that $a_N = a_{N+2^{2020}}$.","import Mathlib theorem problem_234687 (a : ℕ → ℕ) (ha1 : 0 < a 1) (h : ∀ i ≥ 1, a (i + 1) = Nat.ofDigits 2 ((Nat.digits 10 (5 ^ 2020 * a i)).map fun d => d % 2)) : ∃ N, a N = a (N + 2 ^ 2020) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-437923,"Let there be \(n = 2021\) individuals at a conference. Suppose one individual does not have any friends at the conference, and another individual has exactly one friend. Also, assume that among any \(4\) individuals chosen, at least \(2\) are friends, where friendship is a mutual relationship. Prove that there are \(2018\) individuals at the conference who are all friends with each other.","import Mathlib theorem friendships (n : ℕ) (hn : n = 2021) (a : Fin n → Fin n → Prop) (ha : ∀ i j, a i j ↔ a j i) (h1 : ∃ i, ¬∃ j, a i j) (h2 : ∃ i, ∃! j, a i j) (h3 : ∀ s : Finset (Fin n), s.card = 4 → ∃ i ∈ s, ∃ j ∈ s, a i j ∧ a j i) : ∃ t : Finset (Fin n), t.card = 2018 ∧ ∀ i ∈ t, ∀ j ∈ t, a i j := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-438447,"Prove that the maximum possible value of \(n\) for a sequence of numbers consisting of \(+1\) and \(-1\) of length \(n\), where the sum of every \(10\) consecutive numbers in the sequence is \(0\) and the sum of every \(12\) consecutive numbers in the sequence is not zero, is \(15\).","import Mathlib theorem max_n (n : ℕ) (hn : n > 0) (a : ℕ → ℤ) (ha : ∀ i ∈ Finset.range n, a i = 1 ∨ a i = -1) (hsum : ∀ i ∈ Finset.range (n - 9), ∑ j ∈ Finset.range 10, a (i + j) = 0) (hsum' : ∀ i ∈ Finset.range (n - 11), ∑ j ∈ Finset.range 12, a (i + j) ≠ 0) : n ≤ 15 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-438849,"Prove that for any $m, n \in \mathbb{N}^{+}$ with $m \neq n$, the maximum possible number of terms in a sequence of integers such that the sum of any $m$ consecutive terms is positive and the sum of any $n$ consecutive terms is negative is \(m + n-\gcd(m,n)-1\).","import Mathlib theorem Prove (m n : ℕ) (hm : 0 < m) (hn : 0 < n) (hmn : m ≠ n) : IsGreatest {k | ∃ a : ℕ → ℤ, (∀ i, ∑ j ∈ Finset.range m, a (i + j) > 0) ∧ (∀ i, ∑ j ∈ Finset.range n, a (i + j) < 0)} (m + n - Nat.gcd m n - 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-439072,"Prove that the number of permutations $(a_1, a_2, \dots, a_{2013})$ of the set $\{1, 2, \dots, 2013\}$ such that there are exactly two indices $i \in \{1, 2, \dots, 2012\}$ for which $a_i < a_{i+1}$ is \(3^{2013} - 2014 \cdot 2^{2013} + \frac{2013 \cdot 2014}{2}\).","import Mathlib theorem number_of_correct_permutations : Nat.card {p : Equiv.Perm (Fin 2013) | {i | p i < p (i + 1)}.encard = 2} = 3^2013 - 2014 * 2^2013 + (2013 * 2014) / 2 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-439313,"a) Prove that if \(n\) (\(n \geq 2\)) is an integer and we have \(n\) distinct sets of points on a line such that for every integer \(k\) (\(1 \leq k \leq n\)), the union of any \(k\) of these sets contains exactly \(k + 1\) points, then there exists a point that belongs to every set. b) Prove that if we have an infinite collection of distinct sets of points such that for every positive integer \(k\), the union of any \(k\) of these sets contains exactly \(k + 1\) points, then there exists a point that belongs to every set.","import Mathlib open Finset Real theorem a {n : ℕ} (hn : 2 ≤ n) (f : Fin n → Set ℝ) (h₀ : ∀ i j, f i = f j → i = j) (h₁ : ∀ k, 1 ≤ k → k ≤ n → ∀ s : Finset (Fin n), s.card = k → (⋃ i ∈ s, f i).ncard = k + 1) : ∃ x, ∀ i, x ∈ f i := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-439413,"Prove that for any infinite sequence of positive integers \(a_1, a_2, \dots\) defined as a \(good\) sequence, where \(a_1\) is a perfect square and for any integer \(n \ge 2\), \(a_n\) is the smallest positive integer such that the expression \(na_1+(n - 1)a_2+\cdots+2a_{n - 1}+a_n\) is a perfect square, there exists a positive integer \(k\) such that \(a_n = a_k\) for all integers \(n \ge k\).","import Mathlib theorem proveGoodSeq (a : ℕ → ℕ) (h₀ : ∀ n, 0 < a n) (h₁ : ∃ m, a 1 = m ^ 2) (h₂ : ∀ n ≥ 2, IsLeast {x | 0 < x ∧ ∃ p, p ^ 2 = ∑ i ∈ Finset.range n, (i + 1) * a (n - i)} (a n)) : ∃ k, 0 < k ∧ ∀ n ≥ k, a n = a k := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-439438,"(i) Prove that there exists an arithmetic progression of positive integers \(a, a + d, a+2d\), where \(d>0\), such that \(f(a)0\), such that \(f(a) 0 ∧ f a < f (a + d) ∧ f (a + d) < f (a + 2 * d) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-439519,"Let $Z \subset \mathbb{C}$ be a set of $n$ complex numbers, where $n \geqslant 2$. Prove that for any positive integer $m$ satisfying $m \leqslant n/2$, there exists a subset $U$ of $Z$ with $m$ elements such that \[ \Bigg|\sum_{z \in U} z\Bigg| \leqslant \Bigg|\sum_{z \in Z \setminus U} z\Bigg|, \] and there are at least \(\frac{1}{2} \binom{2m}{m}\) such subsets \(U\) that satisfy the desired condition.","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem prove_favorable (n : ℕ) (hn : n ≥ 2) (Z : Finset ℂ) (hZ : Z.card = n) : ∀ m > 0, m ≤ n / 2 → ∃ U ⊆ Z, U.card = m ∧ ‖∑ z ∈ U, z‖ ≤ ‖∑ z ∈ Z \ U, z‖ ∧ {U' : Finset ℂ | U' ⊆ Z ∧ U'.card = m ∧ ‖∑ z ∈ U', z‖ ≤ ‖∑ z ∈ Z \ U', z‖}.ncard ≥ (Nat.choose (2 * m) m) / 2 := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-439570,"Let $S = \{1, 2, \cdots, 4044\}$ be a set of the first $4044$ positive integers, where $2022$ integers are colored black and $2022$ are colored white. For an integer $1 \leq i \leq 4044$, the [i]weight[/i] of $i$ is defined as the total number of white integers less than $i$ plus the total number of black integers greater than $i$. Prove that the set of all possible integers $k$ such that there exists a coloring of the set $S$ with exactly $k$ integers having a weight of $m$, for each positive integer $m$, is given by \(0 \leq k \leq 4043\).","import Mathlib open Finset theorem weight (S : Finset ℕ) (hS : S = Icc 1 4044) (black : Finset ℕ) (white : Finset ℕ) (hblack : black ⊆ S) (hwhite : white ⊆ S) (hblackcard : black.card = 2022) (hwhitecard : white.card = 2022) : {k | ∃ m > 0, {x | x ∈ S ∧ (Nat.card {y | y < x ∧ y ∈ white}) + (Nat.card {y | y > x ∧ y ∈ black}) = m}.encard = k} = {k | 0 ≤ k ∧ k ≤ 4043} := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-439983,"Prove that for all non - negative integers \(n\), \[2^{2^n(n - 2)+n + 2} \leq (2^n)! \leq 2^{2^n(n - 1)+1}.\]","import Mathlib open Nat theorem number_theory_8789 (n : ℕ) : 2^(2^n*(n - 2)+n+2) ≤ factorial (2^n) ∧ factorial (2^n) ≤ 2^(2^n*(n - 1)+1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-441753,"Prove that the maximum number of elements in a set \(S\) of positive integers such that for any \(x, y \in S\) with \(x < y\), the inequality \(xy < 111y - 148x\) holds is \(11\).","import Mathlib theorem max_s : IsGreatest {n | ∃ S : Finset ℕ, S.card = n ∧ (∀ x ∈ S, x > 0) ∧ (∀ x ∈ S, ∀ y ∈ S, x < y → x * y < 111 * y - 148 * x)} 11 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-441987,"Let \(S = \{1, 2, \dots, 3000\}\). Prove that the maximum possible integer \(X\) such that for any bijective function \(f: S \to S\), there exists a bijective function \(g: S \to S\) satisfying the inequality \[ \sum_{k = 1}^{3000} \left( \max\{f(f(k)), f(g(k)), g(f(k)), g(g(k))\} - \min\{f(f(k)), f(g(k)), g(f(k)), g(g(k))\} \right) \geq X \] is \(X = 6\times1000^2\).","import Mathlib open Finset Real theorem max : IsGreatest {x : ℕ | ∀ f : Equiv.Perm (Fin 3000), ∃ g : Equiv.Perm (Fin 3000), ∑ k : Fin 3000, (max (max (f (f k)) (f (g k))) (max (g (f k)) (g (g k))) - min (min (f (f k)) (f (g k))) (min (g (f k)) (g (g k)))) ≥ x} (6 * 1000 ^ 2) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-441996,"Prove that the maximum possible integer $X$ such that for any bijective function $f: \{1, 2, \dots, 3000\} \to \{1, 2, \dots, 3000\}$, there exists a bijective function $g: \{1, 2, \dots, 3000\} \to \{1, 2, \dots, 3000\}$ satisfying the inequality $$\sum_{k=1}^{3000} \left( \max\{f(f(k)), f(g(k)), g(f(k)), g(g(k))\} - \min\{f(f(k)), f(g(k)), g(f(k)), g(g(k))\} \right) \geq X$$ is equal to \(6000000\).","import Mathlib open Finset theorem max: IsGreatest {x : ℤ | ∀ f : Equiv.Perm (Fin 3000), ∃ g : Equiv.Perm (Fin 3000), x ≤ ∑ k : Fin 3000, ((max (max (f (f k)) (f (g k))) (max (g (f k)) (g (g k)))) - (min (min (f (f k)) (f (g k))) (min (g (f k)) (g (g k))))) } 6000000 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-441999,"Prove that the remainder when the number of functions \(f: \mathbb{Z} \to \mathbb{Z}\) that satisfy the following conditions is divided by \(1000\) is \(770\): 1. \(f(x - 14f(x) + 1) = f(x)\) for all integers \(x\). 2. The smallest root of \(f\) is \(35\). 3. \(f(x) \leq 14\) for all \(x\).","import Mathlib theorem prove : {f : ℤ → ℤ | (∀ x, f (x - 14 * f x + 1) = f x) ∧ IsLeast {x | f x = 0} 35 ∧ ∀ x, f x ≤ 14}.ncard % 1000 = 770 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-442271,"Prove that for every positive integer \(M \geq 2\), the smallest real number \(C_M\) such that for any integers \(a_1, a_2, \ldots, a_{2023}\), there always exists some integer \(1 \leq k < M\) for which the inequality \(\left\{\frac{ka_1}{M}\right\} + \left\{\frac{ka_2}{M}\right\} + \cdots + \left\{\frac{ka_{2023}}{M}\right\} \leq C_M\) holds is \(C_M = 1011+\frac{1}{M}\), where \(\{x\}\) denotes the fractional part of \(x\), which is the unique number in the interval \([0, 1)\) such that \(x - \{x\}\) is an integer.","import Mathlib open Real theorem prove (M : ℕ) (hM : 2 ≤ M) : IsLeast {C | ∀ a : Fin 2023 → ℤ, ∃ k : ℕ, 1 ≤ k ∧ k < M ∧ ∑ i : Fin 2023, (k * a i / M : ℝ) % 1 ≤ C} (1011 + 1 / M) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-442281,"Prove that there exists an infinite set of integers \(m \geq 2\) such that for every natural number \(n\), there exists a natural number \(k > n\) for which the set \(\{ 1^{m}, 2^{m}, \dots, k^{m} \}\) can be partitioned into two subsets with equal sums.","import Mathlib theorem number_theory_384688 : ∃ S : Set ℕ, Infinite S ∧ (∀ m ∈ S, m ≥ 2) ∧ ∀ n : ℕ, ∃ k > n, ∃ T U : Finset ℕ, T ∪ U = Finset.Icc 1 k ∧ T ∩ U = ∅ ∧ ∑ i ∈ T, i^m = ∑ i ∈ U, i^m := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-443448,"Prove that for a set of 194 positive integers \(a_i\) (where some may be duplicated) such that for any positive integer \(m \leq 20400000\), there exists a subset of \(\{a_i\}\) whose elements sum to \(m\), the smallest possible value of \(\max_{1\leq i\leq 194} a_i\) is \(114514\).","import Mathlib theorem prove (a : Fin 194 → ℕ) (ha : ∀ i, a i > 0) (h : ∀ m ≤ 20400000, ∃ s : Finset (Fin 194), ∑ i ∈ s, a i = m) : IsLeast {x | ∃ a : Fin 194 → ℕ, (∀ i, a i > 0) ∧ (∀ m ≤ 20400000, ∃ s : Finset (Fin 194), ∑ i ∈ s, a i = m) ∧ x = sSup {a i | i}} 114514 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-444508,"Prove that for an odd prime number $p$, there exists a permutation $a_1, a_2, \ldots, a_p$ of the integers $1, 2, \ldots, p$ such that for all pairwise distinct indices $i, j, k$, the following condition holds: \[ (i - j)a_k+(j - k)a_i+(k - i)a_j\neq 0. \]","import Mathlib theorem OddPrime (p : ℕ) (hp : Nat.Prime p) (hodd : Odd p) : ∃ a : Fin p → ℕ, (∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → (i - j) * a k + (j - k) * a i + (k - i) * a j ≠ 0) ∧ (∃ σ : Equiv.Perm (Fin p), ∀ i, a i = σ i + 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-444510,"Prove that for an odd prime number \(p\), there exists a permutation \(a_1, a_2, \ldots, a_{p - 1}\) of the integers \(1, 2, \ldots, p - 1\) such that for all pairwise distinct indices \(i, j, k\) in the set \(\{1,2,\ldots,p - 1\}\), the following condition holds: \[ (i - j)a_k+(j - k)a_i+(k - i)a_j\not\equiv0\pmod{p}. \]","import Mathlib theorem OddPrime (p : ℕ) (hp : Odd p ∧ Nat.Prime p) : ∃ a : Finset.Icc 1 (p - 1) → Finset.Icc 1 (p - 1), (∀ i j, i ≠ j → ¬(a i = a j)) ∧ (∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → ¬((i - j) * a k + (j - k) * a i + (k - i) * a j ≡ 0 [MOD p])) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-444526,"Let $f(n)$ be a function that represents the maximum number of terms in a sum of the form $\sum_{i=1}^{n} \left\lfloor \frac{n}{i} \right\rfloor$ where each term is a positive integer and $n$ is a positive integer. Prove that $f(n) = \lfloor \log_2(n) \rfloor + 1$. Specifically, prove the following: 1. $f(n) \leq f(n+1)$ by demonstrating a reduction process from $f(n+1)$ to $f(n)$. 2. $f(n) + 1 \geq f(n+1)$ by adding a term $\left\lfloor \frac{n+1}{n+1} \right\rfloor$ to the sum in the $f(n)$ case. 3. Define an infinite sequence of numbers $b_1, b_2, \dots$ such that $f(b_{i+1}) = f(b_i) + 1$ and $f(b_i - 1) + 1 = f(b_i)$, and prove that $b_i = 2^i$. 4. Construct a specific example for $f(2^k - 1)$ and prove that $f(2^k - 1) = k$. 5. Prove that the set of values for which $f(a) = k$ is $2^{k - 1} \leq a \leq 2^k - 1$.","import Mathlib open Real theorem f (n : ℕ) : IsGreatest {k | ∃ s : Finset ℕ, s.card = k ∧ (∀ i ∈ s, i > 0) ∧ (∑ i ∈ s, ⌊(n / i : ℝ)⌋) = n} (Nat.floor (logb 2 n) + 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-444534,"i) Prove that if $N \geq 6486$ and for every $n \in \{1, 2, \ldots, N\}$, the entries of $A^n$ (where $A = [a_{i,j}] \in M_2(\mathbb{Z})$) have an absolute value bounded by $50$, then there exist positive integers $1 \leq p < q \leq 6486$ such that $A^p = A^q$. ii) Prove that the condition $N \geq 6486$ in part (i) cannot be improved without additional information or a different approach.","import Mathlib open Matrix Finset theorem MatrixBounded {N : ℕ} (hN : N ≥ 6486) (A : Matrix (Fin 2) (Fin 2) ℤ) (hA : ∀ n ∈ Icc 1 N, ∀ i j, |(A ^ n) i j| ≤ 50) : ∃ p q : ℕ, 1 ≤ p ∧ p < q ∧ q ≤ 6486 ∧ A ^ p = A ^ q := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/AoPs, flc-446071,"A dragon has 40 piles of gold coins, with each pile containing a different number of coins. After plundering a city, the number of coins in each pile is multiplied by either 2, 3, or 4. What is the minimum number of distinct piles of coins that could result? Prove that the answer is 14.","import Mathlib theorem min_number_of_piles (S : Finset ℕ) (hS : S.card = 40) (hS1 : ∀ n ∈ S, n > 0) : IsLeast {x | ∃ f : ℕ → ℕ, (∀ n ∈ S, f n = 2 * n ∨ f n = 3 * n ∨ f n = 4 * n) ∧ x = Set.ncard {y | ∃ n ∈ S, f n = y} } 14 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-446284,"A polynomial product of the form \[(1 - z)^{b_1} (1 - z^2)^{b_2} (1 - z^3)^{b_3} (1 - z^4)^{b_4} (1 - z^5)^{b_5} \dotsm (1 - z^{32})^{b_{32}},\]where the $b_k$ are positive integers, has the surprising property that if we multiply it out and discard all terms involving $z$ to a power larger than 32, what is left is just $1 - 2z.$ Determine $b_{32}.$ You can enter your answer using exponential notation. Prove that the answer is 2^{27} - 2^{11}.","import Mathlib open Polynomial theorem b_32 {b : ℕ → ℕ} {g : ℂ[X]} (hb : ∀ k, b k > 0) (g1 : g = ∏ k ∈ Finset.Icc 1 32, ((1 : ℂ[X]) - X ^ k) ^ (b k)) (g2 : g % X ^ 33 = C 1 - C 2 * X) : b 32 = 2 ^ 27 - 2 ^ 11 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-448959,"Determine whether there exists a bijection between the set $M$ of all subsets of $\mathbb{R}$ that are closed under ordinary addition and multiplication, and the set $N$ of all subsets of $\mathbb{R}$ that are either not closed under addition or multiplication (or both). Prove that the answer is Yes.","import Mathlib open Set Real theorem exists_bijection {M N : Set (Set ℝ)} (hM : M = {s | ∀ x ∈ s, ∀ y ∈ s, x + y ∈ s ∧ x * y ∈ s}) (hN : N = {s | ¬(∀ x ∈ s, ∀ y ∈ s, x + y ∈ s ∧ x * y ∈ s)}) : ∃ f g : M → N, Function.Bijective f ∧ Function.Bijective g := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-449160,"Consider the sequence of integers \( a_{1}, a_{2}, a_{3}, \ldots \) defined by \( a_{1} = 1 \) and for \( n \geq 1 \), \( a_{n+1} \) is the smallest integer greater than \( a_{n} \) such that \( a_{i} + a_{j} \neq 3a_{k} \) for any \( i, j, \) and \( k \) in \( \{1, 2, 3, \ldots, n+1\} \), not necessarily distinct. Determine \( a_{1998} \). Prove that the answer is 4494.","import Mathlib open Finset theorem algebra_490982 (a : ℕ → ℕ) (h₀ : a 1 = 1) (h₁ : ∀ n ≥ 1, IsLeast {x | x > a n ∧ ∀ i j k, (i ∈ Icc 1 (n + 1)) → (j ∈ Icc 1 (n + 1)) → (k ∈ Icc 1 (n + 1)) → a i + a j ≠ 3 * a k} (a (n + 1))) : a 1998 = 4494 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-449410,"In preparation for the World Cup, Coach F plans to evaluate seven players, labeled as \( A_{1}, A_{2}, \cdots, A_{7} \), over three training matches, each lasting 90 minutes. At any given time during a match, only one player is on the field. The total playing time for players \( A_{1}, A_{2}, A_{3}, A_{4} \) must be divisible by 7, and the total playing time for players \( A_{5}, A_{6}, A_{7} \) must be divisible by 13. With unlimited substitutions allowed, determine the number of different scenarios for the total playing time of each player. Prove that the answer is 208806.","import Mathlib theorem solution : {(a1, a2, a3, a4, a5, a6, a7) : ℕ × ℕ × ℕ × ℕ × ℕ × ℕ × ℕ | (a1 + a2 + a3 + a4) % 7 = 0 ∧ (a5 + a6 + a7) % 13 = 0 ∧ a1 + a2 + a3 + a4 + a5 + a6 + a7 = 90 * 3}.ncard = 208806 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-449844,"Let \( S \) be a set with \( |S| = 2019 \). Suppose \( A_1, A_2, \ldots, A_n \) are subsets of \( S \) such that the union of any three of them equals \( S \), but the union of any two of them does not equal \( S \). Determine the maximum possible value of \( n \). Prove that the answer is 64.","import Mathlib theorem max {n : ℕ} (hn : n > 0) : (∃ S : Finset ℝ, S.card = 2019 ∧ ∃ A : Fin n → Finset ℝ, (∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → (A i ∪ A j ∪ A k) = S) ∧ (∀ i j, i ≠ j → ¬(A i ∪ A j = S))) ↔ n ≤ 64 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-449896,"Let $N$ denote the number of ordered pairs of sets $(A, B)$ such that $A \cup B$ is a size-$999$ subset of $\{1,2,\dots,1997\}$ and $(A \cap B) \cap \{1,2\} = \{1\}$. If $m$ and $k$ are integers such that $3^m5^k$ divides $N$, find the largest possible value of $m+k$. \(\text{Proposed by Michael Tang}\) Prove that the answer is 1005.","import Mathlib theorem max_msk : IsGreatest {x | ∃ m k : ℕ, x = m + k ∧ 3 ^ m * 5 ^ k ∣ (Nat.card {(A, B) : Finset ℕ × Finset ℕ | A ⊆ Finset.Icc 1 1997 ∧ B ⊆ Finset.Icc 1 1997 ∧ (A ∪ B).card = 999 ∧ (A ∩ B) ∩ Finset.Icc 1 2 = {1}})} 1005 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-449955,"Let $A$ be the number of 2019-digit numbers composed of exactly two different digits. Determine the highest power of 3 that divides $A$. For example, the number $10\underbrace{1...1}_{2016}0$ is such a number. Prove that the answer is 5.","import Mathlib open Finset theorem max_power : IsGreatest {k | 3 ^ k ∣ {n : ℕ | (Nat.digits 10 n).length = 2019 ∧ (Nat.digits 10 n).toFinset.card = 2}.ncard} 5 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-451369,"Evaluate the infinite series \( S = \sum_{k=1}^\infty \frac{k^{k-1} e^{-k}}{k!} \) and determine its value. Prove that the answer is 1.","import Mathlib open Real theorem sum_infinite (S : ℝ) (hS : S = ∑' k : ℕ, if k ≥ 1 then (k ^ (k - 1) * exp (-k)) / Nat.factorial k else 0) : S = 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-453779,"Let \( S = \{ 1, 2, 3, \ldots, 2^n \} \) for some \( n \ge 2 \). Determine the maximum cardinality of a set \( S' \) consisting of \( 2^{n-1} \)-element subsets of \( S \) such that every pair of subsets in \( S' \) has exactly \( 2^{n-2} \) elements in common. Prove that the answer is 2^n - 1.","import Mathlib theorem max_sInf (n : ℕ) (hn : 2 ≤ n) (S : Finset ℕ) (hS : S = Finset.Icc 1 (2 ^ n)) : IsGreatest {x | ∃ T : Finset (Finset ℕ), T.card = x ∧ (∀ U ∈ T, U ⊆ S ∧ U.card = 2 ^ (n - 1)) ∧ (∀ U ∈ T, ∀ V ∈ T, U ≠ V → (U ∩ V).card = 2 ^ (n - 2))} (2 ^ n - 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-453969,"In a party, each person shakes hands with exactly 20 other people. For each pair of people who shake hands with each other, there is exactly 1 other person who shakes hands with both of them. For each pair of people who do not shake hands with each other, there are exactly 6 other people who shake hands with both of them. Determine the total number of people at the party. Prove that the answer is 81.","import Mathlib theorem party_shaking (n : ℕ) (hn : n > 1) (a : Fin n → Fin n → Bool) (ha : ∀ i j, a i j = a j i) (h1 : ∀ i j, a i j → {x | a x i ∧ a x j}.encard = 1) (h2 : ∀ i j, ¬ a i j → {x | a x i ∧ a x j}.encard = 6) (h3 : ∀ i, {j | a i j}.encard = 20): n = 81 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-457508,"Determine the order of magnitude of the number of involutions in the symmetric group $S_{256}$. Prove that the answer is 10^{259}.","import Mathlib open Fintype Set Real Ideal Polynomial open scoped BigOperators theorem card_involutions : {f : Equiv.Perm (Fin 256) | f = f⁻¹}.ncard = 10^259 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-459543,"Find the chromatic number of a graph with vertices representing the positive integers from 1 to 128, where two vertices are connected by an edge if their greatest common divisor is greater than 1. Prove that the answer is 64.","import Mathlib open Finset theorem chromatic_number : IsLeast {n | ∃ f : ℕ → Fin n, ∀ x ∈ Icc 1 128, ∀ y ∈ Icc 1 128, x ≠ y → (Nat.gcd x y > 1) → (f x ≠ f y)} 64 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepMath-103k, flc-460742,"Prove that the least positive integer \(m\) such that if a set \(F\) of mappings from a set \(S\) with \(|S| = 35\) to itself satisfies property \(P(2019)\), then it also satisfies property \(P(m)\) is \(m = 595\), where property \(P(k)\) is defined as: for any \(x,y\in S\), there exist \(f_1, \cdots, f_k \in F\) (not necessarily different), such that \(f_k(f_{k - 1}(\cdots (f_1(x))))=f_k(f_{k - 1}(\cdots (f_1(y))))\).","import Mathlib open Finset theorem prove {P : ℕ → Set (Fin 35 → Fin 35) → Prop} (hP : ∀ k, P k = fun F => ∀ x y, ∃ f : ℕ → (Fin 35 → Fin 35), (∀ i ∈ Icc 1 k, f i ∈ F) ∧ f k (f (k - 1) (f 1 x)) = f k (f (k - 1) (f 1 y))) : IsLeast {m | 0 < m ∧ ∀ F, P 2019 F → P m F} 595 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-460750,"Prove that the minimal possible value of \(n\) for real numbers \(a_i, b_i, c_i\) (\(i = 1,2,\cdots,n\)) in the interval \([0,1]\), where \(S=\{(i,j,k)|a_i + b_j + c_k<1\}\), \(T=\{(i,j,k)|a_i + b_j + c_k>2\}\), and \(|S|\geq2018\), \(|T|\geq2018\), is \(18\).","import Mathlib open Real Set open scoped BigOperators theorem sInf {n : ℕ} (hn : n ≥ 1) : (∃ a b c : Fin n → ℝ, (∀ i, a i ∈ Icc 0 1) ∧ (∀ i, b i ∈ Icc 0 1) ∧ (∀ i, c i ∈ Icc 0 1) ∧ {x | ∃ i j k, x = (i, j, k) ∧ a i + b j + c k < 1}.ncard ≥ 2018 ∧ {x | ∃ i j k, x = (i, j, k) ∧ a i + b j + c k > 2}.ncard ≥ 2018) ↔ n = 18 := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-460751,"Prove that the largest possible value of \(|S|\), where \(S\) is a non - empty subset of the set \(\{1,2,\cdots,108\}\) satisfying (1) for any two numbers \(a,b\in S\) (may not distinct), there exists \(c\in S\) such that \(\gcd(a,c)=\gcd(b,c) = 1\); and (2) for any two numbers \(a,b\in S\) (may not distinct), there exists \(c'\in S\), \(c'\neq a\), \(c'\neq b\) such that \(\gcd(a,c')>1\), \(\gcd(b,c')>1\), is \(79\).","import Mathlib open Finset theorem max_value_of_S {IsQualifying : Finset ℕ → Prop} (isQualifying_def : ∀ S, IsQualifying S ↔ (Nonempty S ∧ S ⊆ Icc 1 108) ∧ (∀ a ∈ S, ∀ b ∈ S, ∃ c ∈ S, Nat.gcd a c = 1 ∧ Nat.gcd b c = 1) ∧ (∀ a ∈ S, ∀ b ∈ S, ∃ c' ∈ S, c' ≠ a ∧ c' ≠ b ∧ Nat.gcd a c' > 1 ∧ Nat.gcd b c' > 1)) (s_max : Finset ℕ) (hs_max : IsGreatest {s : Finset ℕ | IsQualifying s} s_max) : s_max.card = 79 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-460757,"Prove that for a positive odd integer \(n\), the number of sequences \(a_0, a_1, \ldots, a_n\) where \(a_i \in \{1, 2, \ldots, n\}\) for all \(i\), \(a_n = a_0\), and \(a_i - a_{i-1} \not \equiv i \pmod{n}\) for all \(i = 1, 2, \ldots, n\), and when \(n\) is an odd prime, \(a_i - a_{i-1} \not \equiv i, 2i \pmod{n}\) for all \(i = 1, 2, \ldots, n\), is \((n - 1)(n - 2)^{n - 1}-\frac{2^{n - 1}-1}{n}-1\).","import Mathlib theorem prove {n : ℕ} (hn : Odd n) : Set.ncard {a : ℕ → ℕ | (∀ i ∈ Finset.Icc 0 n, a i ∈ Finset.Icc 1 n) ∧ a n = a 0 ∧ ∀ i ∈ Finset.Icc 1 n, ¬(a i - a (i - 1) ≡ i [MOD n]) ∧ (∃ p : ℕ, Odd p ∧ Nat.Prime p ∧ p = n → ∀ i ∈ Finset.Icc 1 n, ¬(a i - a (i - 1) ≡ i [MOD n]) ∧ ¬(a i - a (i - 1) ≡ 2 * i [MOD n]))} = (n - 1) * (n - 2) ^ (n - 1) - (2 ^ (n - 1) - 1) / n - 1 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-460773,"Prove that the maximum possible number of ordered pairs \((i, j) \in\{1,2, \ldots, 2015\}^{2}\) with \(ii \cdot j\), where \(\pi\) is a permutation of \(\{1,2, \ldots, 2015\}\), is \(\binom{2014}{2}\).","import Mathlib theorem max_p : IsGreatest {n | ∃ p : Equiv.Perm (Fin 2015), n = {(i, j) : Fin 2015 × Fin 2015 | i < j ∧ p i * p j > i * j}.ncard} (Nat.choose 2014 2) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-460834,"Prove that the maximum value of \(m\) for finite sets \(A_{1}, A_{2}, \ldots, A_{m}\) of size 2012 and finite sets \(B_{1}, B_{2}, \ldots, B_{m}\) of size 2013, where \(A_{i} \cap B_{j}=\emptyset\) if and only if \(i = j\), is \(\binom{4025}{2012}\).","import Mathlib open Finset theorem max_m {m : ℕ} (hm : m > 0) : (∃ A B : Fin m → Set ℕ, ∀ i j, A i ∩ B j = ∅ ↔ i = j ∧ ∀ i, (A i).encard = 2012 ∧ ∀ i, (B i).encard = 2013) ↔ m ≤ Nat.choose 4025 2012 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-460875,"Prove that the number of ways to place the numbers \(1,2,\ldots,2002\) at the vertices of a regular 2002 - gon such that no two adjacent numbers differ by more than 2 (where rotations and reflections are considered distinct) is 4004.","import Mathlib theorem number_of_ways : {f : Fin 2002 → ℕ | (∀ i j, i ≠ j → f i ≠ f j) ∧ (∀ i, f i ∈ Finset.Icc 1 2002) ∧ (∀ i, |(f i : ℤ) - f ((i + 1) % 2002)| ≤ 2)}.ncard = 4004 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-460935,"Prove that the number of sequences of integers \((a_{1}, \ldots, a_{200})\) satisfying \(0 \leq a_{1}2\), all permutations of \(\{1, 2,\ldots, n\}\) can be obtained by starting with the tuple \((1, 2, \ldots, n)\) on a blackboard and on each turn choosing two numbers from the tuple such that their sum is a perfect square and swapping them if and only if \(n\geq14\).","import Mathlib theorem prove (n : ℕ) (hn : n > 2) : ∀ p : Equiv.Perm (Finset.Icc 1 n), ∃ s : Finset (Finset.Icc 1 n × Finset.Icc 1 n), (∀ t ∈ s, ∃ m : ℕ, m^2 = t.1 + t.2 ∧ t.1 ≠ t.2) ∧ (∀ t ∈ s, p t.1 = t.2 ∨ p t.2 = t.1) ↔ n ≥ 14 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-461444,"Prove that \(\max_{f \in \mathcal{F}}| \textrm{Im}(f) | = n + 1\), where \(\mathcal{F}\) is the set of all functions \(f : \mathcal{P}(S) \longrightarrow \mathbb{R}\) such that for all \(X, Y \subseteq S\), \(f(X \cap Y) = \min (f(X), f(Y))\) and \(S\) is a finite set with \(|S|=n\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem max_fim (n : ℕ) (hn : 0 < n) : IsGreatest {x | ∃ f : Set (Fin n) → ℝ, (∀ X Y, f (X ∩ Y) = min (f X) (f Y)) ∧ x = Set.ncard (Set.range f)} (n + 1) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-463404,"Prove that the maximum positive integer \(r\) such that for any five 500 - element subsets of the set \(\{1,2,\cdots,1000\}\), there exist two subsets that have at least \(r\) common elements is \(r = 200\).","import Mathlib theorem max_r (r : ℕ) : (∀ s : Finset (Finset ℕ), s.card = 5 ∧ (∀ t ∈ s, t ⊆ Finset.Icc 1 1000 ∧ t.card = 500) → ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ x ∩ y ≠ ∅ ∧ (x ∩ y).card ≥ r) ↔ r = 200 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-463524,"Prove that the number of decreasing sequences \(a_1, a_2, \ldots, a_{2019}\) of positive integers such that \(a_1\leq 2019^2\) and \(a_n + n\) is even for each \(1\leq n\leq 2019\) is \(\binom{2037171}{2019}\).","import Mathlib open Finset theorem number_of_decreasing_seqences : {a : ℕ → ℕ | (∀ n ∈ Icc 1 2019, a n > 0) ∧ (∀ n ∈ Icc 1 2018, a n ≥ a (n + 1)) ∧ a 1 ≤ 2019 ^ 2 ∧ ∀ n ∈ Icc 1 2019, Even (a n + n)}.ncard = Nat.choose 2037171 2019 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-463663,"Prove that the maximum number of different sets consisting of three terms that form arithmetic progressions and can be chosen from a sequence of real numbers \( a_1, a_2, \ldots, a_{101} \) with \( a_1 < a_2 < a_3 < \cdots < a_{101} \) is \(2500\).","import Mathlib theorem max_set : IsGreatest {n | ∃ a : Fin 101 → ℝ, (∀ i j, i < j → a i < a j) ∧ n = {(i, j, k) : Fin 101 × Fin 101 × Fin 101 | ∃ d, a i + d = a j ∧ a j + d = a k}.ncard} 2500 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-466651,"Prove that the maximum cardinality of a set \(A\) of positive integers, where if \(n \in A\) then \(n \le 2018\) and if \(S \subset A\) with \(|S| = 3\) there exists \(m,n \in S\) such that \(|n - m| \ge \sqrt{n}+\sqrt{m}\), is \(44\).","import Mathlib theorem max_card (A : Finset ℕ) (hA : ∀ n ∈ A, n > 0) (hA' : ∀ n ∈ A, n ≤ 2018) (hA'' : ∀ S ⊆ A, S.card = 3 → ∃ m ∈ S, ∃ n ∈ S, |(n : ℝ) - m| ≥ Real.sqrt n + Real.sqrt m) : A.card ≤ 44 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-467453,"Prove that the maximum possible number of positive integers among 2018 integers labeled on points of a circle, where each integer is greater than the sum of the two integers that immediately precede it in a clockwise direction, is 1008.","import Mathlib theorem max_positive : IsGreatest {n | ∃ f : Fin 2018 → ℕ, (∀ i, f i > f (i - 1) + f (i - 2)) ∧ n = {i | f i > 0}.ncard} 1008 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepScaleR, flc-470930,"Let $\phi(a, b)$ be a binary predicate defined on a domain $A \times B$, and let $(a, b) \in R$ denote membership in a binary relation $R$. In a foundational framework where every predicate corresponds to a class (e.g., in set theories with proper classes), prove that the equivalence $\phi(a, b) \iff (a, b) \in R$ holds if and only if the class $R$ defined by the predicate $\phi$ is a set. Formally, prove that for all $(a, b) \in A \times B$, $\phi(a, b) \iff (a, b) \in R$ if and only if $R = \{(a, b) \mid \phi(a, b)\}$ is a set.","import Mathlib open Set Real open scoped BigOperators theorem φ {A B : Type*} [PartialOrder A] [PartialOrder B] (φ : A → B → Prop) (R : Set (A × B)) : (∀ a b, φ a b ↔ (a, b) ∈ R) ↔ ∃ S : Set (A × B), R = {x | x ∈ S ∧ φ x.1 x.2} ∧ ∀ x ∈ R, x ∈ S ∧ ∀ x ∈ S, φ x.1 x.2 → x ∈ R := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-471960,"Let \( \phi(n) \) be a formula in a first-order language with natural numbers as the domain. The axiom scheme of induction states that for any formula \( \phi(n) \): \[ (\phi(0) \land (\forall n)[\phi(n) \to \phi(n+1)]) \to (\forall n)\phi(n). \] Prove that this is equivalent to the derived inference rule: \[ \phi(0) \quad (\forall n)[\phi(n) \to \phi(n+1)] \quad \vdash (\forall n)\phi(n). \] Additionally, prove that this is distinct from the infinitary \( \omega \)-rule, which states: \[ \phi(0) \quad \phi(1) \quad \phi(2) \quad \cdots \quad \vdash (\forall n)\phi(n), \] where the hypotheses consist of infinitely many separate instances of \( \phi(n) \).","import Mathlib open Finset theorem NatInduction (φ : ℕ → Prop) : (∀ n, φ n → φ (n + 1)) ∧ φ 0 → ∀ n, φ n := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-471970,"Let $V \\subseteq [0,1]$ be a Vitali Set constructed by selecting exactly one representative from each equivalence class of the equivalence relation $x \\sim y \\iff x-y \\in \\\mathbb{Q}$. Prove that $V$ is not Lebesgue measurable.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem NonMeasurable (V : Set ℝ) (hV : V ⊆ Set.Icc 0 1) (hV' : ∀ x ∈ V, ∀ y ∈ V, x ≠ y → Irrational (x - y)) : ¬ ∃ m : ℝ, m = (MeasureTheory.volume V).toReal := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-472752,"Let $P$ be a partial order on an infinite set $X$. Assign two colors to pairs of elements $(x, y)$ where $x, y ext{ in } X$: one color for pairs $(x, y)$ that are related under $P$, and another color for pairs $(x, y)$ that are incomparable under $P$. By the infinite Ramsey theorem, prove that there exists an infinite subset $Y ext{ of } X$ such that all pairs $(x, y) ext{ in } Y$ are uniformly colored, and this subset $Y$ exhibits the property that either all pairs are related under $P$ or all pairs are incomparable under $P$.","import Mathlib open Finset theorem InfiniteRamsey {α : Type*} [PartialOrder α] (ha : Infinite α) : ∃ Y : Set α, Infinite Y ∧ (∀ x ∈ Y, ∀ y ∈ Y, x ≠ y → (x < y ∨ y < x)) ∨ (∀ x ∈ Y, ∀ y ∈ Y, x ≠ y → ¬(x < y ∨ y < x)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-472804,"Let $S = \{a_1, a_2, \ldots, a_n\}$ be a set of $n$ positive integers such that for any two distinct subsets $A, B \subseteq \{1, 2, \ldots, n\}$ of the same size, we have \( \sum_{i \in A} a_i \neq \sum_{i \in B} a_i \). Prove that the largest element $a_n$ in $S$ must satisfy the asymptotic growth condition: $$ a_n \gtrsim \frac{2^{n+1}\sqrt{2}}{n\sqrt{\pi n}}. $$","import Mathlib open Real theorem asymptotics (n : ℕ) (hn : 0 < n) (a : Fin n → ℕ) (ha : ∀ i j, a i = a j → i = j) (hpos : ∀ i, 0 < a i) (h : ∀ A B : Finset (Fin n), A ≠ B ∧ A.card = B.card → ∑ i ∈ A, a i ≠ ∑ i ∈ B, a i) : 2 ^ (n + 1) * sqrt 2 / (n * sqrt (Real.pi * n)) ≤ sSup {x | ∃ i, a i = x} := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-472822,"Let $\mu: \mathcal{P}(\mathbb{R}) \to \{0,1\}$ be a set function defined on the power set of $\mathbb{R}$ such that: 1. $\mu(\mathbb{R}) = 1$ and $\mu(\emptyset) = 0$. 2. For any subset $X \subseteq \mathbb{R}$, either $\mu(X) = 1$ or $\mu(\mathbb{R} \setminus X) = 1$, but not both. 3. If $A \subseteq B$ and $\mu(A) = 1$, then $\mu(B) = 1$. Prove that there exists a maximal set of 'big' sets $U \subseteq \mathcal{P}(\mathbb{R})$ such that for every $X \subseteq \mathbb{R}$, exactly one of $X$ or $\mathbb{R} \setminus X$ is in $U$. This construction is guaranteed by Zorn's lemma, but the resulting measure $\mu$ is not unique and depends on arbitrary choices made during the construction process.","import Mathlib open Set Real theorem zorn (μ : Set ℝ → Fin 2) (h₀ : μ ⊤ = 1) (h₁ : μ ∅ = 0) (h₂ : ∀ X, μ X = 1 ∨ μ (Set.univ \ X) = 1 ∧ ¬(μ X = 1 ∧ μ (Set.univ \ X) = 1)) (h₃ : ∀ A B, A ⊆ B → μ A = 1 → μ B = 1) : ∃ U : Set (Set ℝ), (∀ X, (X ∈ U ∨ (Set.univ \ X) ∈ U) ∧ ¬(X ∈ U ∧ (Set.univ \ X) ∈ U)) ∧ (∀ V, (∀ X, (X ∈ V ∨ (Set.univ \ X) ∈ V) ∧ ¬(X ∈ V ∧ (Set.univ \ X) ∈ V)) → (U ⊆ V ∨ V ⊆ U)) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-472884,"Let ${}_2F_1(\beta, \beta+1; m; z)$ denote the hypergeometric function. Prove that the coefficient of $z^u$ in the product ${}_2F_1(\beta, \beta+1; m; z) \times {}_2F_1(\beta, \beta+1; n; z)$ is given by: $$ \sum_{k=0}^{u} \frac{(m-1)! (\beta+k-1)! (\beta+k)!}{(\beta-1)! \beta! k! (m+k-1)!} \cdot \frac{(n-1)! (\beta+u-k-1)! (\beta+u-k)!}{(\beta-1)! \beta! (u-k)! (n+u-k-1)!}. $$ Furthermore, prove that this summation can be simplified using identities such as Vandermonde's or Dixon's identity.","import Mathlib open Finset Real Nat theorem hypergeometric_function {β m n u : ℕ} (hβ : β > 0) (hm : m > 0) (hn : n > 0) (hu : u > 0) : ∑ k ∈ Icc 0 u, (Nat.factorial (m - 1)) * (Nat.factorial (β + k - 1)) * (Nat.factorial (β + k)) / ((Nat.factorial (β - 1)) * (Nat.factorial β) * (Nat.factorial k) * (Nat.factorial (m + k - 1))) * ((Nat.factorial (n - 1)) * (Nat.factorial (β + u - k - 1)) * (Nat.factorial (β + u - k))) / ((Nat.factorial (β - 1)) * (Nat.factorial β) * (Nat.factorial (u - k)) * (Nat.factorial (n + u - k - 1))) = (Nat.choose (m + n - 1) u) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-473313,"Let $C(n)$ denote the commuting variety of $n \times n$ matrices over a finite field $\boldsymbol{\textbf{F}_q}$, defined as $$C(n) = \{(A, B) \in \text{End}(\boldsymbol{\textbf{F}_q}^n)^2 : [A, B] = 0\}.$$ Let $Gl(n, \boldsymbol{\textbf{F}_q})$ denote the general linear group of invertible $n \times n$ matrices over $\boldsymbol{\textbf{F}_q}$. Define the normalized count of commuting pairs as $$\frac{|C(n)|}{|Gl(n, \boldsymbol{\textbf{F}_q})|},$$ where $|C(n)|$ is the number of points in the commuting variety and $|Gl(n, \boldsymbol{\textbf{F}_q})|$ is the order of $Gl(n, \boldsymbol{\textbf{F}_q})$. Prove that the generating function for the normalized count is given by $$\sum_{n=0}^\infty \frac{|C(n)|}{|Gl(n, \boldsymbol{\textbf{F}_q})|} t^n = \prod_{k=1}^\infty \prod_{m=1}^\infty \left(1 - q^{2-m}t^k\right)^{-1}.$$","import Mathlib open Finset Real Matrix GCDMonoid open scoped BigOperators theorem generating_function (q : ℕ) (hq : Nat.Prime q) : ∑' n : ℕ, (Nat.card {p : Matrix (Fin n) (Fin n) (ZMod q) × Matrix (Fin n) (Fin n) (ZMod q) | p.1 * p.2 = p.2 * p.1}) / (Nat.card {A : Matrix (Fin n) (Fin n) (ZMod q) | Nonempty (Invertible A)}) * t ^ n = ∏' k : ℕ, ∏' m : ℕ, if k > 0 ∧ m > 0 then (1 - q ^ (2 - m) * t ^ k) else 1 := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-473777,"Let $n \in \mathbb{N}$ and $k = \left\lfloor \frac{n}{2\log_2(n)} \right\rfloor$. Prove that, for sufficiently large $n$, the following lower bound holds for the binomial coefficient $\binom{n}{k-1}$: $$\log_2 \binom{n}{k-1} \geq \left(\frac{n}{2\log_2(n)} - 2\right) \log_2\left(2\log_2(n)\right).$$","import Mathlib open Real theorem logb2_k (n : ℕ) (hn : n > 0) : ∃ N, ∀ n' : ℕ, n' > N → logb 2 (Nat.choose n' (Nat.floor (n' / (2 * logb 2 n')) - 1)) ≥ ((n' / (2 * logb 2 n') - 2) * logb 2 (2 * logb 2 n')) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-475417,"Let $a \\in (0, 1)$ and $H_n = \\sum_{k=1}^n \\frac{1}{k}$ denote the $n$-th harmonic number. For $n \\in \\mathbb{N}$, prove that the following inequality holds: $$ \\sum_{j=1}^{n+1} \\sum_{i x < j), a ^ (i + j) * Nat.choose (n + 1) i * Nat.choose (n + 1) j / Nat.choose (2 * n + 2) (i + j) * (1 + (j - i) / (2 * n + 2 - (i + j))) ≤ 1 / (2 * (1 - a)) + ((n + 1) / 2) * a * H (2 * n + 1) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-476199,"Let $V = \{-1, 1\}^n$, and define a vector $v = \langle v_1, \ldots, v_n \rangle \in V$ to be 'good' if \[ \left| \sum_{k=1}^n v_k a_k \right| < 1, \] where $a_1, \ldots, a_n$ are real numbers. Let $G = \{v \in V : v \text{ is good}\}$. Prove that the size of $G$ satisfies the inequality \[ |G| \leq \binom{n}{\lfloor n/2 \rfloor}, \] where $\binom{n}{\lfloor n/2 \rfloor}$ is the binomial coefficient representing the maximum size of an antichain in the poset $\langle \wp([n]), \subseteq \rangle$ (the power set of $[n]$, ordered by inclusion).","import Mathlib open Finset Real Nat theorem max_chains_size {n : ℕ} : ∀ G : Finset (Fin n → ℝ), (∀ g ∈ G, ∀ k : Fin n, (g k) = -1 ∨ (g k) = 1) ∧ (∀ g ∈ G, ∀ a : Fin n → ℝ, |∑ i : Fin n, (g i) * (a i)| < 1) → G.card ≤ Nat.choose n ((n + 1) / 2) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-476288,"Let \( x_n \) be the solutions of the transcendental equation \( \tan x = x \) in the interval \( \left(\pi n - \frac{\pi}{2}, \pi n + \frac{\pi}{2}\right) \), where \( n \) is an integer. For large \( n \), prove that the solutions \( x_n \) can be expressed asymptotically as: \[ x_n = \pi n + \frac{\pi}{2} - \left(\pi n + \frac{\pi}{2}\right)^{-1} - \frac{2}{3}\left(\pi n + \frac{\pi}{2}\right)^{-3} - \frac{13}{15}\left(\pi n + \frac{\pi}{2}\right)^{-5} - \frac{146}{105}\left(\pi n + \frac{\pi}{2}\right)^{-7} - \frac{781}{315}\left(\pi n + \frac{\pi}{2}\right)^{-9} - \frac{16328}{3465}\left(\pi n + \frac{\pi}{2}\right)^{-11} + \cdots \] where the coefficients are derived using the Lagrange inversion formula applied to the function \( f(z) = \frac{z(\cos z + z\sin z)}{\sin z} \), which is analytic at \( z = 0 \).","import Mathlib open Real Set open scoped BigOperators theorem solution (n : ℤ) : ∃ x, x ∈ Ioo (π * n - π / 2) (π * n + π / 2) ∧ tan x = x := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-476544,"Let $A$ be a mathematical proposition, and let ZFC denote the axiomatic system of Zermelo-Fraenkel set theory with the Axiom of Choice. Prove that if, under the assumption of $A$, a contradiction can be derived within ZFC (i.e., there exist statements $B$ such that both $B$ and $ eg B$ are provable), then ZFC implies $ eg A$. Formally: Prove that if $\text{ZFC} \cup \{A\} \vdash B \land \neg B$, then $\text{ZFC} \vdash \neg A$.","import Mathlib theorem zfc_incompatible (A : Prop) (hA : ∃ B, A → B ∧ ¬B) : ¬A := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-476557,"Let $s(x, y)$ be defined implicitly by the equation $s(x, y)^2 = -xy + (1 - x - y)s(x, y)$. Prove that $s(x, y)$ has the series expansion: \[ s(x, y) = \sum_{p, q \geq 1} \frac{1}{p+q-1} {p+q-1 \choose p} {p+q-1 \choose q} x^p y^q. \]","import Mathlib open Real open scoped BigOperators theorem seriesExpansion {s : ℝ → ℝ → ℝ} (h₀ : ∀ x y, (s x y)^2 = -x * y + (1 - x - y) * s x y) : ∃ f : ℕ → ℕ → ℝ, (∀ x y, s x y = ∑' p : ℕ, ∑' q : ℕ, if p ≥ 1 ∧ q ≥ 1 then (1 / (p + q - 1)) * Nat.choose (p + q - 1) p * Nat.choose (p + q - 1) q * x ^ p * y ^ q else 0) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-476912,Let $p: X \to Y$ be a continuous and closed surjective map between topological spaces. Assume that $X$ is a regular topological space and that $p^{-1}(y)$ is compact for every $y \in Y$. Prove that $Y$ is also a regular topological space.,"import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem regular_topology {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] (p : X → Y) (hp : Function.Surjective p) (hc : Continuous p) (h : IsClosedMap p) (hX : RegularSpace X) (hY : ∀ y, IsCompact (p ⁻¹' {y})) : RegularSpace Y := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-476958,"Let $V \subset [0,1]$ be a set of representatives of the equivalence classes under the equivalence relation $x \thicksim y \iff x - y \in \mathbb{Q}$. Prove that $V$, known as a Vitali set, is non-measurable with respect to the Lebesgue measure.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem non_measurable (V : Set ℝ) (hV : ∀ x ∈ V, ∀ y ∈ V, x ≠ y → ¬∃ q : ℚ, x - y = q) (hV' : V ⊆ Set.Icc 0 1) : ¬ ∃ m : ℝ, m = (MeasureTheory.volume V).toReal := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-477632,"Let $\mathfrak{p}, \mathfrak{n}, \mathfrak{m}$ be non-zero Dedekind finite cardinals. Assume the Axiom of Choice for Families (ACF). Prove that if $\mathfrak{p} \cdot \mathfrak{n} = \mathfrak{p} \cdot \mathfrak{m}$, then $\mathfrak{n} = \mathfrak{m}$.","import Mathlib theorem Fintype.card_eq_of_ne_zero (p n m : ℕ) [Fintype (Fin p)] [Fintype (Fin n)] [Fintype (Fin m)] (h₀ : p ≠ 0) (h₁ : n ≠ 0) (h₂ : m ≠ 0) (h₃ : Nat.card (Fin p × Fin n) = Nat.card (Fin p × Fin m)) : n = m := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-478357,"Let $X$ be a set and suppose there exists a function $f: X^2 o X$ such that for all $x eq X$, the function $f(x, ullet): X o X$ is injective. Prove that $X$ is well-ordered, i.e., there exists a total order on $X$ such that every non-empty subset of $X$ has a least element.","import Mathlib theorem WellOrdered {X : Type*} (f : X → X → X) (h : ∀ x, Function.Injective (fun y => f x y)) : ∃ linearOrder : LinearOrder X, ∀ s : Set X, s.Nonempty → ∃ x, x ∈ s ∧ IsLeast s x := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-478587,"Let $d$ be the number of sides on each die, $e$ the threshold for rerolling, $t$ the target number for a 'hit', $n$ the number of dice rolled, $h$ the number of 'hits', and $r$ the maximum number of rerolls allowed for a single die. Define the PMF for the number of hits $H$ as follows: $$P(H=h)=\frac{(t-1)^n(d-e+1)^h}{d^{n+h}}\sum_{j=0}^{\max(n,h)}\sum_{k=0}^{\left \lfloor \frac{h-j}{r}\right \rfloor}\sum_{l=0}^{k}\binom{n}{j}\binom{n+h-j-l-1}{h-j-l}\binom{k}{l}\cdot\left [ \frac{d(e-t)}{(t-1)(d-e+1)} \right ]^j\left [ \frac{d(d-t+1)}{(t-1)(d-e+1)} \right ]^l$$ where the iterators $j$, $k$, and $l$ represent: - $j$: The number of dice that explode on their first roll. - $k$: The number of dice that explode on their final reroll. - $l$: The number of dice that stop exploding on a success. The binomial coefficients $\binom{n}{j}$, $\binom{n+h-j-l-1}{h-j-l}$, and $\binom{k}{l}$ account for the different ways in which the dice can achieve the specified outcomes. The terms in brackets represent the probabilities of each outcome. Prove that this formula provides a formal mathematical representation of the PMF for this dice-rolling scenario.","import Mathlib open Finset Real Nat theorem pMF {d e t : ℕ} {n h r : ℕ} (hd : 0 < d) (he : 0 < e) (ht : 0 < t) (hn : 0 < n) (hh : 0 < h) (hr : 0 < r) : (t - 1)^n * (d - e + 1)^h / d^(n + h) = ∑ j ∈ Icc 0 (max n h), ∑ k ∈ Icc 0 ⌊(h - j : ℝ) / r⌋₊, ∑ l ∈ Icc 0 k, Nat.choose n j * Nat.choose (n + h - j - l - 1) (h - j - l) * Nat.choose k l * ((d * (e - t)) / ((t - 1) * (d - e + 1)))^j * ((d * (d - t + 1)) / ((t - 1) * (d - e + 1)))^l := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-478619,"Let $X$ be a set of 9 elements, and let $\binom{X}{3}$ and $\binom{X}{4}$ denote the families of all 3-element subsets and 4-element subsets of $X$, respectively. Define a 3-set $S \in \binom{X}{3}$ as 'hitting' a 4-set $T \in \binom{X}{4}$ if $S \cap T \neq \emptyset$. Prove that the minimum number of 3-sets required to hit all 4-sets in $\binom{X}{4}$ is $57$.","import Mathlib open Finset theorem min_number_of_3_sets (X : Finset ℝ) (hX : X.card = 9) (families_3 : Set (Finset ℝ)) (families_4 : Set (Finset ℝ)) (hfamilies_3 : families_3 = {S | S ⊆ X ∧ S.card = 3}) (hfamilies_4 : families_4 = {T | T ⊆ X ∧ T.card = 4}) : IsLeast {n | ∃ s : Finset (Finset ℝ), s.card = n ∧ ∀ T ∈ families_4, ∃ S ∈ s, S ∩ T ≠ ∅} 57 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-479084,"Let $(X, \tau)$ be a topological space. Prove that the space $X$ is core-compact if and only if for every open set $U \subseteq X$ and every point $x \in U$, there exists a compact subset $K \subseteq U$ such that $x \in \text{int}(K)$, where $\text{int}(K)$ denotes the interior of $K$.","import Mathlib open Filter Real Function open scoped Topology theorem is_core_compact {X : Type*} [TopologicalSpace X] : IsCoreCompact ↔ ∀ U : Set X, IsOpen U → ∀ x ∈ U, ∃ K : Set X, IsCompact K ∧ K ⊆ U ∧ x ∈ (interior K) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-481447,Let $\mathcal{F}$ denote the set of all functions $f: \mathbb{Z} \to \mathbb{Z}$ that satisfy a specific condition involving modular constraints determined iteratively via the Chinese Remainder Theorem. Prove that $\mathcal{F}$ is uncountable.,"import Mathlib open Finset theorem uncountable {F : Set (ℤ → ℤ)} (hF : ∀ f ∈ F, ∀ n, ∃ m, f n = m ∧ ∀ k, k ≠ n → f k ≡ 0 [ZMOD m]) : ¬ Countable F := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-482166,"Let $X$ be a $T_3$ (regular Hausdorff) topological space. Suppose $X$ is separable. Prove that $|X| \\leq 2^{2^{\aleph_0}}$, where $\aleph_0$ is the cardinality of the natural numbers.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem regular_housesdorff {X : Type*} [TopologicalSpace X] (hX : T3Space X) (hX1 : SeparableSpace X) : (univ : Set X).encard ≤ 2^(2^(Nat.card ℕ)) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-483189,"Let $R$ be a countable commutative ring. Prove that there exists a maximal ideal $I \subseteq R$. Additionally, prove that this theorem is provable in $ACA_0$, but not in $RCA_0$.","import Mathlib open Fintype Subgroup Set Polynomial Ideal open scoped BigOperators theorem maximalIdeal {R : Type*} [CommRing R] [Countable R] : ∃ I : Ideal R, I.IsMaximal := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-483647,"Let $b(n)$ denote the number of partitions of $2^n$ into powers of 2. Assuming $2^{n+1}$ is an integer, prove that the asymptotic behavior of $\ln b(n+1)$ as $n \to \infty$ is given by: \begin{align*} \ln b(n+1) &= \frac{1}{2\ln 2}\left(n\ln 2 - \ln n - \ln\ln 2\right)^2 \\ &\quad + \left(\frac{1}{2} + \frac{1}{\ln 2} + \frac{\ln\ln 2}{\ln 2}\right)n\ln 2 \\ &\quad - \left(1 + \frac{\ln\ln 2}{\ln 2}\right)(\ln n + \ln\ln 2) \\ &\quad + \psi\left(\frac{n\ln 2 - \ln\ln n - \ln\ln2}{\ln 2}\right) + o(1), \end{align*} where $\psi$ is a periodic function of period $1$, $o(1)$ represents a term that approaches zero as $n \to \infty$, and $\ln$ denotes the natural logarithm.","import Mathlib open Real Filter Function open scoped Topology theorem log_b (b : ℕ → ℕ) (h₀ : ∀ n, b n = {s : Finset ℕ | ∑ i ∈ s, (2 ^ i : ℝ) = 2 ^ n}.ncard) : ∃ ψ : ℝ → ℝ, (∀ x, ψ (x + 1) = ψ x) ∧ (∀ n, log (b (n + 1)) = ((1 / (2 * log 2)) * (n * log 2 - log n - log (log 2)) ^ 2 + ((1 / 2) + (1 / log 2) + (log (log 2) / log 2)) * n * log 2 - (1 + log (log 2) / log 2) * (log n + log (log 2)) + ψ ((n * log 2 - log (log n) - log (log 2)) / log 2))) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-483879,"Let $N$ represent the number of valid configurations for filling a $9 \times 9$ grid such that each column contains exactly $k$ zeroes ($1 \leq k \leq 8$) and each row satisfies specific conditions depending on whether it starts with a zero or a positive number. Define $N_0$ as the number of ways to fill a row starting with a zero, and $N_+$ as the number of ways to fill a row starting with a positive number. Prove that an upper bound for $N$ is given by: \[ N \leq \sum_{k=1}^8 \binom{9}{k} \frac{9!}{k!} N_0^k N_+^{9-k}, \] where \( N_0 = \sum_{m=0}^7 \binom{8}{m} \frac{9!}{(m+1)!} \) and \( N_+ = \sum_{m=1}^8 \binom{8}{m} \frac{8!}{m!} \).","import Mathlib open Finset theorem upper_bound {N : ℕ} (hN : N > 0) : N ≤ ∑ k ∈ Icc 1 8, Nat.choose 9 k * (Nat.factorial 9 / Nat.factorial k) * (∑ m ∈ Icc 0 7, Nat.choose 8 m * (Nat.factorial 9 / Nat.factorial (m + 1))) ^ k * (∑ m ∈ Icc 1 8, Nat.choose 8 m * (Nat.factorial 8 / Nat.factorial m)) ^ (9 - k) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-484473,"Let $f(n, k) = k + \ln \binom{n}{k}$, where $k < n$ and $n, k$ are positive integers. Define $\hat{k} = \frac{e}{e+1}(n+1)$ and $k_0 = \lfloor \hat{k} \rfloor$. Prove that, as $n \to \infty$, the expression $k + \ln \binom{n}{k}$ is asymptotically bounded above by: $$f(n, k_0) \sim 1.3133n.$$","import Mathlib open Real Filter Function open scoped Topology theorem asymptotics {f : ℕ → ℕ → ℝ} (hf : ∀ n k, f n k = k + log (Nat.choose n k)) (k0 : ℕ → ℕ) (hk0 : ∀ n, k0 n = ⌊(exp 1 / (exp 1 + 1)) * (n + 1)⌋) : ∀ ε > 0, ∃ N, ∀ n, N ≤ n → |f n (k0 n) - 1.3133 * n| < ε := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-484513,"Let $\phi$ be a formula in the language of fields. Prove that if $\phi$ holds in all finite fields of any characteristic, then $\phi$ also holds in a field of characteristic $0$.","import Mathlib theorem phi_holds (φ : ∀ F : Type, [Field F] → Prop) : (∀ F : Type, [Field F] → (Fintype F → φ F)) → ∀ F : Type, [Field F] → CharP F 0 → φ F := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-484642,"Let $X$ be a hereditarily Lindelöf locally compact Hausdorff space, and let $O \subseteq X$ be an open subset. Prove that $O$ is $\sigma$-compact, i.e., $O$ can be expressed as a countable union of compact subsets. Specifically, prove that there exists a countable collection of compact subsets $\{K_i\}_{i \in \mathbb{N}}$ such that: $$O = \bigcup_{i=1}^{\infty} K_i.$$","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem σ_compact (X : Type*) [TopologicalSpace X] (hX : T2Space X) (hX' : LocallyCompactSpace X) (hX'' : HereditarilyLindelofSpace X) (O : Set X) (hO : IsOpen O) : ∃ f : ℕ → Set X, (∀ n, IsCompact (f n)) ∧ O = ⋃ n, f n := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-485252,"Let $V$ denote the universe of all sets, and let $L$ be the language of set theory. Prove that a subset $S \neq \text{null}$ of $V$ is a definable set if and only if there exists a formula $\theta(x)$ in $L$ such that $S = \{x \text{ in } V \mid \theta(x)\}$.","import Mathlib open Set Real open scoped BigOperators theorem is_definable {α : Type*} (S : Set α) : S ≠ ∅ ∧ ∀ x ∈ S, ∃ y : α, x = y ↔ ∃ θ : α → Prop, S = {x | θ x} := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-486163,"Let $\alpha = e + \pi$, where $e$ and $\pi$ are the base of the natural logarithm and the ratio of a circle's circumference to its diameter, respectively. Prove that the statement '$\alpha$ is rational' is either provable or disprovable within the axioms of ZFC, assuming ZFC is consistent.","import Mathlib open Real theorem α : Irrational (exp 1 + π) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-486174,"Let $K_{n:r}$ be the Kneser graph, where the vertices are all subsets of size $r$ from a set of size $n$, and two vertices are adjacent if and only if the corresponding subsets are disjoint. Prove that the chromatic number of $K_{n:r}$ is given by $n - 2r + 2$.","import Mathlib open Finset theorem kenser_chromatic_number {n r : ℕ} (hn : 0 < n) (hr : 0 < r) (h : r ≤ n) : IsLeast {k | ∃ f : Finset (Finset ℕ), f.card = k ∧ (∀ s ∈ f, s ⊆ Icc 1 n ∧ s.card = r) ∧ (∀ s ∈ f, ∀ t ∈ f, s ≠ t → Disjoint s t)} (n - 2 * r + 2) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-486192,"Let $f: M o extbf{R}$ be a continuous function, where $M$ is a topological space. Suppose $f$ is an exhaustion function. Prove that $f$ is proper; that is, for any compact set $K extbf{R}$, the preimage $f^{-1}(K)$ is compact in $M$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem ContinuousFunction {M : Type*} [TopologicalSpace M] (f : M → ℝ) (hf : Continuous f) (hex : ∀ U : Set ℝ, IsOpen U → ∃ V : Set M, f '' V = U) : ∀ K : Set ℝ, IsCompact K → IsCompact (f ⁻¹' K) := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-486308,"Let $f: \text{Dom}(f) \to \text{Range}(f)$ be a primitive recursive function defined by an initial condition $a_0 = c$ and a recursive rule $a_{n+1} = g(a_n, n)$ for some primitive recursive function $g$. Prove that for any $n \in \text{Dom}(f)$ and $k \in \text{Range}(f)$, the value $f(n) = k$ can be expressed as a $\Pi^0_1$ formula: $$f(n) = k \text{ if and only if } \forall (a_0, a_1, \text{...}, a_n) \text{ satisfying } a_0 = c \text{ and } a_{i+1} = g(a_i, i) \text{ for } i < n, \text{ we have } a_n = k.$$","import Mathlib open Finset theorem isPrimitiveRecursive (f : ℕ → ℕ) (c : ℕ) (g : ℕ → ℕ → ℕ) (hf : ∀ n, f n = if n = 0 then c else g (f (n - 1)) (n - 1)) : ∀ n k, f n = k ↔ (∀ a : ℕ → ℕ, (a 0 = c ∧ ∀ i < n, a (i + 1) = g (a i) i) → a n = k) := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-486486,"Let $P$ be a proposition in a mathematical framework that accepts the abstraction of actual infinity. Prove that under the law of the excluded middle (LEM), it holds that $P \lor \neg P$, even if there does not exist a finite constructive proof of $P$ or $\neg P$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem LEM {P : Prop} : P ∨ ¬P := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-486491,"Let $V \subset \mathbb{R}$ be a Vitali set constructed as follows: Define an equivalence relation $x \sim y$ on $\mathbb{R}$ such that $x \sim y$ if and only if $x - y \in \mathbb{Q}$, the set of rational numbers. Using the Axiom of Choice, select exactly one representative from each equivalence class under this relation. The resulting set $V$ is called a Vitali set. Prove that $V$ is non-measurable with respect to the Lebesgue measure.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem NonMeasurableV (V : Set ℝ) (hV : ∀ x ∈ V, ∀ y ∈ V, x = y ↔ ∃ q : ℚ, x - y = q) : ¬ MeasurableSet V := sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/DeepTheorem, flc-489199,"Prove that the only integer \( k \geqslant 1 \) such that given \( k \) different colors, if each integer is colored in one of these \( k \) colors, then there must exist integers \( a_{1} < a_{2} < \cdots < a_{2023} \) of the same color such that the differences \( a_{2} - a_{1}, a_{3} - a_{2}, \ldots, a_{2023} - a_{2022} \) are all powers of 2 is \( k = 2 \).","import Mathlib theorem Prove (k : ℕ) (hk : 1 ≤ k) : (∀ f : ℕ → Fin k, ∃ a : Fin 2023 → ℕ, StrictMono a ∧ ∀ i j, i ≠ j → f (a i) = f (a j) ∧ ∀ i, ∃ m, a (i + 1) - a i = 2 ^ m) ↔ k = 2 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/NuminaMath-TIR, flc-489870,"Prove that the number of sequences of 100 natural numbers, where each sequence contains the number 3 at least once and any two adjacent numbers differ by no more than 1, is \(515377520732011329768810529537391871205404316419\).","import Mathlib theorem number_of_seven : Set.ncard {a : Fin 100 → ℕ | ∃ i, a i = 3 ∧ ∀ i j, i + 1 = j → |(a i : ℤ) - (a j : ℤ)| ≤ 1} = 515377520732011329768810529537391871205404316419 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/NuminaMath-TIR, flc-498042,"Prove that there exists an uncountable set \(\mathcal{F}\) of subsets of the positive integers \(\mathbb{Z}^+\) such that for any two distinct subsets \(A,B\in\mathcal{F}\), \(|A\cap B|\) is finite.","import Mathlib theorem exists_set : ∃ F : Set (Set ℕ+), ¬ F.Countable ∧ ∀ A ∈ F, ∀ B ∈ F, A ≠ B → (A ∩ B).Finite := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/NuminaMath-TIR, flc-506717,"Prove that for subsets \( A_{1}, A_{2}, \cdots, A_{2n+1} \) of a set \( B \) where \( n \in \mathbf{N}^{+} \), \( \left|A_{i}\right| = 2n \) for \( i = 1, 2, \cdots, 2n+1 \), \( \left|A_{i} \cap A_{j}\right| = 1 \) for \( 1 \leqslant i < j \leqslant 2n+1 \), and each element in \( B \) belongs to at least two of the \( A_{i} \), it is possible to label the elements of \( B \) with 0 or 1 such that each \( A_{i} \) contains exactly \( n \) elements labeled 0 if and only if \( n = 1 \) or \( n = 2 \).","import Mathlib open Finset Real theorem prove_0 (B : Type*) [Fintype B] {n : ℕ} (hn : 0 < n) (A : Fin (2 * n + 1) → Set B) (hA : ∀ i, Fintype (A i)) (hA1 : ∀ i, (A i).ncard = 2 * n) (hA2 : ∀ i j, i ≠ j → (A i ∩ A j).ncard = 1) (hA3 : ∀ b : B, ∃ i j, i ≠ j ∧ b ∈ A i ∧ b ∈ A j) : ∃ f : B → Fin 2, (∀ i, {x | f x = 0 ∧ x ∈ A i}.encard = n) ↔ n = 1 ∨ n = 2 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/NuminaMath-TIR, flc-506935,"Prove that the number of sequences of 100 natural numbers, in which the number 3 appears at least once and any two neighboring members differ by no more than 1, is \(515377520732011329768810529537391871205404316419\).","import Mathlib theorem prove : Set.ncard {a : Fin 100 → ℕ | ∃ i, a i = 3 ∧ ∀ i j, i + 1 = j → |(a i : ℤ) - (a j : ℤ)| ≤ 1} = 515377520732011329768810529537391871205404316419 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/NuminaMath-TIR, flc-507090,"Prove that for the sequence \( u_0, u_1, u_2, \ldots \) where \( u_0 = 0 \), \( u_1 = 1 \), and \( u_{n+1} \) is the smallest integer \( > u_n \) such that there is no arithmetic progression \( u_i, u_j, u_{n+1} \) with \( i < j < n+1 \), \( u_{100}=981 \).","import Mathlib theorem proveU (u : ℕ → ℕ) (h₀ : u 0 = 0) (h₁ : u 1 = 1) (h₂ : ∀ n, ∃ m, IsLeast {x | x > u n ∧ ¬∃ i j, i ≠ j ∧ i < j ∧ j < n + 1 ∧ x = u i + (j - i) * (u j - u i)} m) : u 100 = 981 := by sorry ",Combinatorics,2. Difficulty 8-10,8.0,FineLeanCorpus/NuminaMath-TIR, flc-63,"Prove that if $a$ and $b$ are natural numbers such that $b > a > 1$ and $a$ does not divide $b$, and $\{b_n\}_{n=1}^\infty$ is a sequence of natural numbers that satisfies $b_{n + 1} \geq 2b_n$ for all $n \in \mathbb{N}$, then there exists a sequence $\{a_n\}_{n=1}^\infty$ of natural numbers such that for all $n \in \mathbb{N}$, $a_{n + 1} - a_n \in \{a, b\}$, and for all $m, l \in \mathbb{N}$ (where $m$ may be equal to $l$), $a_m + a_l \not\in \{b_n\}_{n=1}^\infty$.","import Mathlib theorem prove (a b : ℕ) (ha : a > 1) (hb : b > a) (hdiv : ¬(a ∣ b)) (b_seq : ℕ → ℕ) (hb_seq : ∀ n, b_seq (n + 1) ≥ 2 * b_seq n) : ∃ a_seq : ℕ → ℕ, (∀ n, a_seq (n + 1) - a_seq n = a ∨ a_seq (n + 1) - a_seq n = b) ∧ (∀ m l, a_seq m + a_seq l ∉ Set.range b_seq) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-67,"Let $A$ be a set of positive integers satisfying the following conditions: 1. If $a \in A$, then all positive divisors of $a$ are also in $A$. 2. If $a, b \in A$ with $1 < a < b$, then $1 + ab \in A$. Prove that if $A$ contains at least three elements, then $A = \mathbb{Z}^+$.","import Mathlib theorem Qwen (A : Set ℕ) (hA : ∀ a ∈ A, 0 < a) (h1 : ∀ a ∈ A, ∀ d ∈ Nat.divisors a, d ∈ A) (h2 : ∀ a ∈ A, ∀ b ∈ A, 1 < a → a < b → 1 + a * b ∈ A) (h3 : ∃ x ∈ A, ∃ y ∈ A, ∃ z ∈ A, x ≠ y ∧ y ≠ z ∧ z ≠ x) : A = {x | 0 < x} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-184,"Let $S$ be a subset of the natural numbers $\mathbb{N}$ with the following properties: 1. Among any $2003$ consecutive natural numbers, there exists at least one number that is contained in $S$. 2. If $n \in S$ and $n > 1$, then $\left\lfloor \frac{n}{2} \right\rfloor \in S$ (where $\left\lfloor x \right\rfloor$ denotes the greatest integer less than or equal to $x$). Prove that $S = \mathbb{N}$.","import Mathlib theorem qwen {S : Set ℕ} (hS1 : ∀ n, ∃ m ∈ Finset.Icc n (n + 2002), m ∈ S) (hS2 : ∀ n ∈ S, n > 1 → ⌊(n / 2 : ℝ)⌋₊ ∈ S) : S = ⊤ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237,"Prove that there exist \(2^{2006}\) positive integers such that each positive integer has \(2^{2005}\) digits, each positive integer consists only of the digits 7 or 8, and for any two chosen integers, at most half of their corresponding digits are the same.","import Mathlib theorem prove : ∃ s : Finset ℕ, s.card = 2^2006 ∧ (∀ n ∈ s, (Nat.digits 10 n).length = 2^2005) ∧ (∀ n ∈ s, ∀ d ∈ (Nat.digits 10 n), d = 7 ∨ d = 8) ∧ (∀ m ∈ s, ∀ n ∈ s, m ≠ n → {i | i ∈ Finset.range (2^2005) ∧ (Nat.digits 10 m)[i]! = (Nat.digits 10 n)[i]!}.ncard ≤ (2^2005 / 2)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-337,"Let $A \subset \mathbb{R}^n$ be a set of $n$-tuples, where each $n$-tuple is of the form $(a_1, a_2, \dots, a_n)$ with $a_i \in \mathbb{R}$ for $i = 1, 2, \dots, n$. For any $\alpha = (a_1, a_2, \dots, a_n) \in A$ and $\beta = (b_1, b_2, \dots, b_n) \in A$, define the function $\gamma(\alpha, \beta) = (|a_1 - b_1|, |a_2 - b_2|, \dots, |a_n - b_n|)$. Let $D(A) = \{\gamma(\alpha, \beta) \mid \alpha, \beta \in A\}$. Prove that $|D(A)| \geq |A|$.","import Mathlib open Finset Real theorem γ {n : ℕ} (A : Set (Fin n → ℝ)) : Set.ncard {x | ∃ α β : Fin n → ℝ, α ∈ A ∧ β ∈ A ∧ x = fun i => |(α i) - (β i)|} ≥ Set.ncard A := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-584,Let $X$ be a compact metric space and $T: X \rightarrow X$ a continuous function. Prove that there exists a point $x_0 \in X$ and a strictly increasing sequence of natural numbers $n_k$ such that $\lim_{k \to \infty} T^{n_k}(x_0) = x_0$. This point $x_0$ is referred to as a returning point of $T$.,"import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem return_point {X : Type*} [MetricSpace X] [CompactSpace X] (f : X → X) (hf : Continuous f) : ∃ x₀ : X, ∃ n : ℕ → ℕ, StrictMono n ∧ Tendsto (λ k => f^[n k] x₀) atTop (𝓝 x₀) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-585,"Prove that there exists a bijective function \(f: \mathbb{N} \rightarrow \mathbb{N}\) such that for any \(n \in \mathbb{N}\), the following condition holds: \[ n^n \mid (f(1) + f(2) + f(3) + \ldots + f(n)) \]","import Mathlib theorem number_theory_8956 : ∃ f : ℕ → ℕ, Function.Bijective f ∧ ∀ n, n ^ n ∣ ∑ i ∈ Finset.Icc 1 n, f i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-589,"Let $X$ be a compact metric space and $T: X \rightarrow X$ a continuous function. Prove that there exists a point $x_0 \in X$ and a strictly increasing sequence of natural numbers $n_k$ such that $\lim_{k \to \infty} T^{n_k}(x_0) = x_0$, i.e., prove that the point $x_0$ is a returning point of $T$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem ContinuousReturningPoint {X : Type*} [MetricSpace X] [CompactSpace X] (f : X → X) (hf : Continuous f) : ∃ x₀ : X, ∃ n : ℕ → ℕ, StrictMono n ∧ Tendsto (λ k => f^[n k] x₀) atTop (𝓝 x₀) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-632,"Let $a_1, a_2, \ldots, a_n$ be positive real numbers, and let $S_k$ denote the sum of the products of $a_1, a_2, \ldots, a_n$ taken $k$ at a time. Prove that for $k = 1, 2, \ldots, n - 1$, \[ S_k S_{n-k} \geq {n \choose k}^2 a_1 a_2 \cdots a_n. \]","import Mathlib open Finset Real Nat theorem sumOfProduct (n : ℕ) (hn : 0 < n) (a : ℕ → ℝ) (ha : ∀ i ∈ Icc 1 n, 0 < a i) (S : ℕ → ℝ) (hS : ∀ k ∈ Icc 1 n, S k = ∑ s : Finset (Icc 1 n), if s.card = k then (∏ i ∈ s, a i) else 0) : ∀ k ∈ Icc 1 (n - 1), S k * S (n - k) ≥ Nat.choose n k ^ 2 * ∏ i ∈ Icc 1 n, a i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-791,"Prove that the maximum number of elements that a set $B$ can contain, where $B$ is a subset of $\{1, 2, \ldots, n\}$ such that for any distinct elements $a, b \in B$, the condition $(a - b) \nmid (a + b)$ holds, is $\left\lceil \frac{n}{3} \right\rceil$.","import Mathlib theorem max_set_size {n : ℕ} (hn : 0 < n) : IsGreatest {k | ∃ B : Finset ℕ, B ⊆ Finset.Icc 1 n ∧ B.card = k ∧ ∀ a ∈ B, ∀ b ∈ B, a ≠ b → ¬(a - b ∣ a + b)} (Nat.ceil (n / 3)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-1228,"Prove that for each $N \in \mathbb{N}$, there exist integers $n$ and $m$ such that $n \geqslant m \geqslant N$ and $\binom{n}{m}$ is squarefree, where a number is squarefree if its prime factorization contains no repeated prime factors.","import Mathlib theorem NatSquarefree {N : ℕ} : ∃ n m : ℕ, n ≥ m ∧ m ≥ N ∧ Squarefree (Nat.choose n m) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-1253,"Let $(X, d)$ be a metric space with the property that every uncountable subset $A$ of $X$ has an accumulation point in $X$. Prove that $(X, d)$ is separable.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MetricSpaceSeparable {X : Type*} [MetricSpace X] (h : ∀ A : Set X, ¬Set.Countable A → ∃ x ∈ A, ClusterPt x (𝓟 A)) : SeparableSpace X := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-1315,"Prove that given \(1{,}000{,}000\) points in three - dimensional space, the set of all pairwise distances between these points contains at least \(79\) distinct elements.","import Mathlib theorem dist_set (P : Finset (EuclideanSpace ℝ (Fin 3))) (hP : P.card = 1000000) : Set.ncard {d | ∃ p q : EuclideanSpace ℝ (Fin 3), p ∈ P ∧ q ∈ P ∧ d = dist p q} ≥ 79 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-1322,"Prove that if $S = \{1, 2, \ldots, 2004\}$, $d_1$ is the number of subsets of $S$ for which the sum of the elements is congruent to $7 \pmod{32}$, and $d_2$ is the number of subsets of $S$ for which the sum of the elements is congruent to $14 \pmod{16}$, then $\frac{d_1}{d_2} = 2^{1999}$.","import Mathlib def S : Finset ℕ := Finset.Icc 1 2004 theorem prove : ((S.powerset.filter (fun x => ∑ i ∈ x, i ≡ 7 [MOD 32])).card / (S.powerset.filter (fun x => ∑ i ∈ x, i ≡ 14 [MOD 16])).card = 2^1999) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-1323,"Let $S = \{1, 2, \ldots, 2004\}$. Denote $d_1$ as the number of subsets of $S$ for which the sum of the elements is congruent to $7 \pmod{32}$, and denote $d_2$ as the number of subsets of $S$ for which the sum of the elements is congruent to $14 \pmod{16}$. Prove that $\frac{d_1}{d_2} = \frac{1}{2}$.","import Mathlib def S : Finset ℕ := Finset.Icc 1 2004 theorem d1_d2 : {T | T ⊆ S ∧ ∑ x ∈ T, x ≡ 7 [MOD 32]}.ncard / {T | T ⊆ S ∧ ∑ x ∈ T, x ≡ 14 [MOD 16]}.ncard = 1 / 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-1465,"Let \(A = \{a_1, a_2, \ldots, a_n\}\) and \(B = \{b_1, b_2, \ldots, b_n\}\) be two distinct sets of integers. Given that the sets of sums \(a_i + a_j\) for \(i \neq j\) and \(b_i + b_j\) for \(i \neq j\) are identical, prove that \(n\) is a power of \(2\).","import Mathlib theorem Finset.card_eq_pow_of_two {n : ℕ} (hn : n ≠ 0) (A B : Finset ℤ) (hA : A.card = n) (hB : B.card = n) (hAB : A ≠ B) (hsum : ∀ x ∈ A, ∀ y ∈ A, x ≠ y → x + y ∈ B ∧ ∀ x ∈ B, ∀ y ∈ B, x ≠ y → x + y ∈ A) : ∃ k, n = 2 ^ k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-1481,"Prove that for every positive integer \(n\), where \(f(n)\) denotes the number of non - empty subsets \(\mathcal{N} \subseteq \{1, 2, \ldots, n\}\) such that \(\gcd(\mathcal{N}) = 1\), \(f(n)\) is a perfect square if and only if \(n = 1\).","import Mathlib open Finset theorem number_theory_8988 {f : ℕ → ℕ} (hf : ∀ n, f n = {s | s ⊆ Icc 1 n ∧ s ≠ ∅ ∧ Finset.gcd s id = 1}.ncard) : ∀ n > 0, IsSquare (f n) ↔ n = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-1702,"Prove that for any set of \(n \geq 3\) points in the plane, there exist three points among them that form an angle less than or equal to \(\frac{\pi}{n}\).","import Mathlib open Real Set open scoped BigOperators theorem angle_bound (n : ℕ) (hn : n ≥ 3) (s : Finset (EuclideanSpace ℝ (Fin 2))) : s.card = n → ∃ a ∈ s, ∃ b ∈ s, ∃ c ∈ s, a ≠ b ∧ a ≠ c ∧ b ≠ c ∧ arccos (inner (a - b) (c - a) / (dist a b * dist a c)) ≤ π / n := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-1861,"Prove that all solutions to the equation \( p_1^{e_1} p_2^{e_2} \cdots p_k^{e_k} = e_1^{p_1} e_2^{p_2} \cdots e_k^{p_k} \), where \(p_1, p_2, \ldots, p_k\) are distinct prime numbers, \(e_1, e_2, \ldots, e_k\) are prime numbers, and \(k\) is a positive integer, are given by \(e_i = p_{\sigma(i)}\) for some permutation \(\sigma\) of \(\{1, 2, \ldots, k\}\) with \(\sigma^2 = \textrm{id}\).","import Mathlib theorem prove (k : ℕ) (hk : 0 < k) (p e : Fin k → ℕ) (hp : ∀ i j, p i = p j → i = j) (hp1 : ∀ i, Nat.Prime (p i)) (he : ∀ i, Nat.Prime (e i)) : (∏ i, (p i) ^ (e i)) = (∏ i, (e i) ^ (p i)) ↔ ∃ σ : Equiv.Perm (Fin k), ∀ i, e i = p (σ i) ∧ σ (σ i) = i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-2061,Prove that the set of natural numbers $\mathbb{N}$ can be partitioned into two disjoint subsets $A$ and $B$ such that neither subset contains an infinite arithmetic sequence.,"import Mathlib theorem NatPartition : ∃ A B : Set ℕ, A ∪ B = ℕ ∧ A ∩ B = ∅ ∧ ¬∃ a d : ℕ, ∀ n : ℕ, a + d * n ∈ A ∧ ¬∃ a d : ℕ, ∀ n : ℕ, a + d * n ∈ B := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-2162,"Prove that the number of ordered pairs \((P(x), Q(x))\) of polynomials with integer coefficients such that \(P(x)^2 + Q(x)^2 = \left(x^{4096} - 1\right)^2\) is \(708588\).","import Mathlib theorem count : Set.ncard {(P, Q) : Polynomial ℤ × Polynomial ℤ | P ^ 2 + Q ^ 2 = (X ^ 4096 - 1) ^ 2} = 708588 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-2164,"Prove that the number of ordered pairs $(P(x), Q(x))$ of polynomials with integer coefficients such that \(P(x)^2 + Q(x)^2 = \left(x^{4096} - 1\right)^2\) is \(4 \cdot 3^{11}\).","import Mathlib theorem number_of_pairs : {(P, Q) : Polynomial ℤ × Polynomial ℤ | P ^ 2 + Q ^ 2 = (X ^ 4096 - 1) ^ 2}.ncard = 4 * 3 ^ 11 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-2165,"Prove that the number of ordered pairs $(P(x), Q(x))$ of polynomials with integer coefficients such that \(P(x)^2 + Q(x)^2 = \left(x^{4096} - 1\right)^2\) is \(4 \cdot 3^{11}=104976\).","import Mathlib theorem number_of_polynomial_pairs : {(P, Q) : Polynomial ℤ × Polynomial ℤ | P ^ 2 + Q ^ 2 = (X ^ 4096 - 1) ^ 2}.ncard = 104976 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-2415,Prove that there does not exist a continuous function \(f: \mathbb{R} \to \mathbb{R}\) such that \(f(x)\) is rational if and only if \(f(x + 1)\) is irrational.,"import Mathlib theorem noContinuousF : ¬∃ f : ℝ → ℝ, Continuous f ∧ (∀ x, ∃ q : ℚ, f x = q ↔ ¬∃ r : ℚ, f (x + 1) = r) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-2913,"Prove that for every positive integer \(n\), there exists a subset \(S\) of \(\{1, 2, \cdots, n^2\}\) containing exactly \(n\) elements, such that the difference between any two distinct elements of \(S\) is not a perfect square.","import Mathlib theorem jhw64958 (n : ℕ) (hn : 0 < n) : ∃ S : Finset ℕ, S ⊆ Finset.Icc 1 (n ^ 2) ∧ S.card = n ∧ ∀ x ∈ S, ∀ y ∈ S, x ≠ y → ¬ ∃ k : ℕ, IsSquare k ∧ k = x - y := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-2960,"Prove that in a plane where each point is colored with one of three colors (red, blue, or green), there exist three points of the same color that form an isosceles triangle.","import Mathlib theorem color_plane (f : ℝ × ℝ → Fin 3) : ∃ x y z, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ f x = f y ∧ f y = f z ∧ dist x y = dist y z ∨ dist y z = dist x z ∨ dist x y = dist x z := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-2970,"Prove that the values of \(n \ge 1\) for which there exists a number \(m\) that can be expressed in the form \(a_1 + a_2 + \ldots + a_n\) with \(a_k \in \{1, 2, \ldots, k\}\) in at least \((n - 1)!\) distinct ways are \(n = 1, 2, 3, 4\).","import Mathlib open Finset theorem Prove : { n : ℕ | n ≥ 1 ∧ ∃ m : ℕ, {s : Fin n → ℕ | (∀ i, s i ∈ Set.Icc 1 (i.1 + 1)) ∧ m = ∑ i, s i }.ncard ≥ (Nat.factorial (n - 1)) } = { 1, 2, 3, 4 } := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-3059,"Prove that it is possible to color each natural number using one of \(2009\) colors such that: 1. Infinitely many numbers are colored in each color. 2. There does not exist a triplet of numbers \((a, b, c)\), each colored in a different color, such that \(a = bc\).","import Mathlib theorem color_nat : ∃ f : ℕ → Fin 2009, (∀ i, {n | f n = i}.Infinite) ∧ ¬∃ a b c, f a ≠ f b ∧ f b ≠ f c ∧ f a ≠ f c ∧ a = b * c := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-3060,"Prove that it is possible to color each natural number using one of \(2009\) colors such that infinitely many numbers are colored in each color and there does not exist a triplet of numbers \((a, b, c)\), each colored in a different color, such that \(a = bc\).","import Mathlib theorem color_nat : ∃ f : ℕ → Fin 2009, (∀ i, Set.Infinite {n | f n = i}) ∧ ¬∃ a b c, a ≠ b ∧ a ≠ c ∧ b ≠ c ∧ f a ≠ f b ∧ f b ≠ f c ∧ f a ≠ f c ∧ a = b * c := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-3061,"Let $(a_i)_{i=1}^{2n}$ and $(b_i)_{i=1}^{2n}$ be two sequences of integers such that for each $1 \le i \le 2n$, $1 \le a_i, b_i \le n$. Prove that there exist two non-empty subsets $I, J \subseteq \{1, \ldots, 2n\}$ such that $\sum_{i \in I} a_i = \sum_{j \in J} b_j$.","import Mathlib theorem integer_sum (n : ℕ) (hn : 0 < n) (a b : Finset.Icc 1 (2 * n) → ℤ) (ha : ∀ i, 1 ≤ a i ∧ a i ≤ n) (hb : ∀ i, 1 ≤ b i ∧ b i ≤ n) : ∃ I J : Finset (Finset.Icc 1 (2 * n)), I ≠ ∅ ∧ J ≠ ∅ ∧ ∑ i ∈ I, a i = ∑ j ∈ J, b j := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-3210,"Prove that the number of permutations \(f\) of the set \(X = \{1, 2, 3, \ldots, 3n - 1, 3n\}\) such that \(\sum_{i = 1}^{3n}|i - 2f(i)|=\frac{15n^2 + n}{2}\) is \(n! \times (2n)!\).","import Mathlib theorem count_permutations (n : ℕ) : Set.ncard {f : Equiv.Perm (Finset.Icc 1 (3 * n)) | ∑ i : Finset.Icc 1 (3 * n), |(i : ℤ) - 2 * f i| = (15 * n ^ 2 + n) / 2} = Nat.factorial n * Nat.factorial (2 * n) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-3559,"Given \(111\) points in the complex plane such that the sum of their affixes is \(0\) and each affix has an absolute value of \(1\), prove that there exists a subset of \(55\) points such that the sum of their affixes is a complex number with an absolute value less than or equal to \(1\).","import Mathlib theorem ComplexSumOfAffixes (f : Fin 111 → ℂ) (h₀ : ∑ i : Fin 111, f i = 0) (h₁ : ∀ i : Fin 111, ‖f i‖ = 1) : ∃ s : Finset (Fin 111), s.card = 55 ∧ ‖∑ i ∈ s, f i‖ ≤ 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-3638,"Prove that there exist distinct subsets $(A_i)_{i = 1}^m$ of $\{1, 2, \ldots, n\}$ such that $\left| A_i \cap A_j \right|$ is odd for all $1 \leq i < j \leq m$ and $m>2n$.","import Mathlib theorem prove (n : ℕ) (hn : 0 < n) (m : ℕ) (hm : m > 2 * n) : ∃ A : Finset (Finset ℕ), A.card = m ∧ (∀ x ∈ A, x ⊆ Finset.Icc 1 n) ∧ (∀ i ∈ A, ∀ j ∈ A, i ≠ j → Odd ((i ∩ j).card)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-3843,"Prove the following identity using algebraic methods: \[\sum_{m=0}^{n}{\sum_{k}{{n \choose m}{n-m-2k \choose k}{n-m \choose k}{n \choose m+k}}} = \sum_{k=0}^{n}{{n \choose k}^3}\]","import Mathlib theorem algebraicSum (n : ℕ) : ∑ m in Finset.Icc 0 n, ∑ k in Finset.Icc 0 (n - m), Nat.choose n m * Nat.choose (n - m - 2 * k) k * Nat.choose (n - m) k * Nat.choose n (m + k) = ∑ k in Finset.Icc 0 n, (Nat.choose n k)^3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-3976,"Let $A$ be a finite set of positive integers. Prove that there exists a finite set of positive integers $B$, with $|B| \leq |A|$, such that any two distinct subsets of $B$ have different sums, and for every $a \in A$, there exists a subset of $B$ whose sum is equal to $a$.","import Mathlib theorem Finset_A (A : Finset ℕ) (hA : ∀ x ∈ A, x > 0) : ∃ B : Finset ℕ, (∀ x ∈ B, x > 0) ∧ B.card ≤ A.card ∧ (∀ s1 s2 : Finset ℕ, s1 ⊆ B ∧ s2 ⊆ B ∧ s1 ≠ s2 → s1.sum id ≠ s2.sum id) ∧ (∀ a ∈ A, ∃ t : Finset ℕ, t ⊆ B ∧ ∑ i ∈ t, i = a) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-4144,Prove that \( \sum_{n=0}^\infty \frac{\binom{2n}{n}}{4^n(n+1)^3} = 4 - 4\log(2) \).,"import Mathlib open Real theorem sum_infinite : ∑' n : ℕ, Nat.choose (2 * n) n / (4 ^ n * (n + 1) ^ 3 : ℝ) = 4 - 4 * log 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-4145,Prove that \(\sum_{n=0}^\infty \frac{\binom{2n}{n}}{4^n(n+1)^3} = 8 - 8\log(2) - \frac{\pi^2}{3} + 4\log^2(2)\).,"import Mathlib open Real theorem sum_series : ∑' n : ℕ, Nat.choose (2 * n) n / ((4 ^ n * (n + 1) ^ 3) : ℝ) = 8 - 8 * log 2 - (Real.pi ^ 2) / (3 : ℝ) + 4 * (log 2) ^ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-4276,"Prove that for natural numbers \(n\), \(\sum_{k\geq0} \binom{n+k}{2k} \binom{2k}{k} \frac{(-1)^k}{k+1} = 0\).","import Mathlib theorem sum (n : ℕ) : ∑' k : ℕ, Nat.choose (n + k) (2 * k) * Nat.choose (2 * k) k * (-1 : ℝ)^k / (k + 1) = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-4372,"Let $S$ be an infinite set of positive integers, and define the set $T$ as \(T = \{ x + y \mid x, y \in S, x \neq y \}\). Suppose that there are only finitely many primes $p$ such that: 1. \(p \equiv 1 \pmod{4}\) 2. There exists a positive integer \(s \in T\) such that \(p \mid s\). Prove that the set of primes that divide at least one term of $S$ is infinite.","import Mathlib theorem infinite_primes (S : Set ℕ) (hS : Infinite S) (hS1 : ∀ n ∈ S, n > 0) (T : Set ℕ) (hT : T = {x | ∃ m ∈ S, ∃ n ∈ S, x = m + n ∧ m ≠ n}) (hT1 : {p | p.Prime ∧ p ≡ 1 [MOD 4] ∧ ∃ s ∈ T, p ∣ s}.Finite) : {p | p.Prime ∧ ∃ n ∈ S, p ∣ n}.Infinite := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-4547,"Let \(k\) be a positive integer, \(p > 3\) a prime, and \(n\) an integer such that \(0 \le n \le p^{k - 1}\). Prove that \[ \binom{p^k}{pn} \equiv \binom{p^{k-1}}{n} \pmod{p^{2k+1}}. \]","import Mathlib theorem Nat.choose_p (k : ℕ) (hk : 0 < k) (p : ℕ) (hp : Nat.Prime p) (h : p > 3) (n : ℕ) (hn : 0 ≤ n ∧ n ≤ p ^ (k - 1)) : Nat.choose (p ^ k) (p * n) ≡ Nat.choose (p ^ (k - 1)) n [MOD p ^ (2 * k + 1)] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-4559,"Let \(n > 1\) be a positive integer, and let \(S\) be a collection of \(\frac{1}{2}\binom{2n}{n}\) distinct \(n\) - element subsets of the set \(\{1, 2, \dotsc, 2n\}\). Prove that there exist \(A, B \in S\) such that \(|A \cap B| \leq 1\).","import Mathlib theorem qwen (n : ℕ) (hn : 1 < n) (S : Finset (Finset ℕ)) (hS : ∀ T ∈ S, T ⊆ Finset.Icc 1 (2 * n) ∧ T.card = n) (hS1 : S.card = Nat.choose (2 * n) n / 2) : ∃ A ∈ S, ∃ B ∈ S, A ≠ B ∧ (A ∩ B).card ≤ 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-4632,"Let \(A=\{(x,y)\in \mathbb{N}^{2} \,:\, x+y \text{ is a perfect square}\}\) and let \(f(n)\) denote the cardinality of the set \(\{(x,y)\in A \,:\, x\leq n,\, y\leq n\}\). Prove that \[ \lim_{n\to\infty} \frac{f(n)}{n\sqrt{n}} = \frac{4(\sqrt{2} - 1)}{3}. \]","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (f : ℕ → ℕ) (h₀ : ∀ n, f n = {p : ℕ × ℕ | p.1 ≤ n ∧ p.2 ≤ n ∧ ∃ m, m^2 = p.1 + p.2}.ncard) : Tendsto (λ n => f n / (n * Real.sqrt n)) atTop (𝓝 (4 * (Real.sqrt 2 - 1) / 3)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-4891,"Prove that if $p = 2n - 1$ is a prime number and $a_1, a_2, \ldots, a_n$ are natural numbers, then there exist two distinct indices $i$ and $j$ such that $$\frac{a_i + a_j}{(a_i, a_j)} \geq 2n - 1,$$ where $(a_i, a_j)$ denotes the greatest common divisor of $a_i$ and $a_j$.","import Mathlib theorem Nat.gcd' {p n : ℕ} (hp : p.Prime) (hn : p = 2 * n - 1) (a : Fin n → ℕ) : ∃ i j, i ≠ j ∧ (a i + a j) / Nat.gcd (a i) (a j) ≥ 2 * n - 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-4892,"Let \(A_1, A_2, \dots, A_{2016}\) be sets such that: (a) Each set \(A_i\) contains exactly \(20\) elements. (b) Each intersection \(A_i \cap A_j\), for \(i \neq j\), contains exactly one element. Prove that there exists an element that belongs to all \(2016\) sets.","import Mathlib theorem Qwen (A : Fin 2016 → Set ℕ) (hA : ∀ i, A i ≠ ∅) (hA1 : ∀ i j, i ≠ j → (A i ∩ A j).encard = 1) (hA2 : ∀ i, (A i).encard = 20) : ∃ x, ∀ i, x ∈ A i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-5004,"Prove that there do not exist four sequences \(a_1, a_2, \ldots, a_{2021}\); \(b_1, b_2, \ldots, b_{2021}\); \(c_1, c_2, \ldots, c_{2021}\); and \(d_1, d_2, \ldots, d_{2021}\) formed by the numbers in the set \(\{1, 2, 3, \ldots, 2021\}\) such that the equation \(a_1b_1 + a_2b_2 + \cdots + a_{2021}b_{2021} = 2(c_1d_1 + c_2d_2 + \cdots + c_{2021}d_{2021})\) holds.","import Mathlib theorem prove : ¬∃(a b c d : Fin 2021 → ℕ), (∀ i, a i ∈ Finset.Icc 1 2021) ∧ (∀ i, b i ∈ Finset.Icc 1 2021) ∧ (∀ i, c i ∈ Finset.Icc 1 2021) ∧ (∀ i, d i ∈ Finset.Icc 1 2021) ∧ ∑ i, (a i * b i) = 2 * ∑ i, (c i * d i) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-5285,"Let \(a_1, a_2, \ldots, a_n\) and \(b_1, b_2, \ldots, b_n\) be sequences of (not necessarily distinct) positive integers. For every \(i > n\), define \(a_i\) as the smallest positive integer that is not among \(b_1, b_2, \ldots, b_{i - 1}\), and \(b_i\) as the smallest positive integer that is not among \(a_1, a_2, \ldots, a_{i - 1}\). Prove that there exists an integer \(N\) such that for every \(i > N\), either \(a_i = b_i\) or \(a_{i+1} = a_i\).","import Mathlib theorem sequnce {n : ℕ} (hn : 0 < n) (a b : ℕ → ℕ) (ha : ∀ i ∈ Finset.Icc 1 n, 0 < a i) (hb : ∀ i ∈ Finset.Icc 1 n, 0 < b i) (hinc : ∀ i > n, IsLeast {x | 0 < x ∧ ¬∃ j ∈ Finset.Icc 1 (i - 1), b j = x} (a i)) (hinc' : ∀ i > n, IsLeast {x | 0 < x ∧ ¬∃ j ∈ Finset.Icc 1 (i - 1), a j = x} (b i)) : ∃ N, ∀ i > N, a i = b i ∨ a (i + 1) = a i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-5307,"Let $\mathbb{S}$ be the set of all functions $f: \mathbb{Z} \rightarrow \mathbb{R}$. Consider the function $g: \mathbb{S} \rightarrow \mathbb{S}$ defined by $g(f(x)) = f(x + 1) - f(x)$. A function $f \in \mathbb{S}$ is called good if there exists a natural number $n$ such that $g^n(f(x)) = 0$. Prove that if $s, t \in \mathbb{S}$ are good functions and $s \neq t$, then $s(m) - t(m) = 0$ for only finitely many $m \in \mathbb{Z}$.","import Mathlib open Finset Real theorem prove (g : (ℤ → ℝ) → (ℤ → ℝ)) (h₀ : ∀ f, g f = fun x => f (x + 1) - f x) (Good : (ℤ → ℝ) → Prop) (hGood : ∀ f, Good f ↔ ∃ n, g^[n] f = 0) : ∀ s t, Good s ∧ Good t → s ≠ t → {m | s m - t m = 0}.Finite := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-5476,"Prove that if $q: \mathbb{N} \to \mathbb{Q}$ is a bijection, denoted by $m \mapsto q_m$, then the set $$ C = \bigcap_{n \geq 1} \bigcup_{m \geq 1} \left(q_m-\frac{1}{mn}, q_m+\frac{1}{mn}\right)$$ is equal to $\mathbb{R}$.","import Mathlib open Real theorem prove (q : ℕ → ℚ) (hq : Function.Bijective q) : ⋂ n ≥ 1, ⋃ m ≥ 1, {x | q m - 1 / (m * n) < x ∧ x < q m + 1 / (m * n)} = ℝ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-5717,"Let \(A\) be a subset of the set \(\{1, 2, \ldots, 2006\}\) consisting of \(1004\) elements. - Prove that there exist three distinct numbers \(a, b, c \in A\) such that \(\gcd(a, b)\) divides \(c\). - Prove that there exist three distinct numbers \(a, b, c \in A\) such that \(\gcd(a, b)\) does not divide \(c\).","import Mathlib theorem A (A : Finset ℕ) (hA : A ⊆ Finset.Icc 1 2006) (hA1 : A.card = 1004) : (∃ a ∈ A, ∃ b ∈ A, ∃ c ∈ A, a ≠ b ∧ a ≠ c ∧ b ≠ c ∧ Nat.gcd a b ∣ c) ∧ (∃ a ∈ A, ∃ b ∈ A, ∃ c ∈ A, a ≠ b ∧ a ≠ c ∧ b ≠ c ∧ ¬Nat.gcd a b ∣ c) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-6292,"Prove that for any coloring of the positive integers using four distinct colors (blue, red, purple, yellow), there exist four distinct positive integers \(a, b, c, d\) such that \(a, b, c, d\) are all assigned the same color and \(ab = cd\).","import Mathlib theorem color_fing (f : ℕ → Fin 4) : ∃ a b c d : ℕ, a > 0 ∧ b > 0 ∧ c > 0 ∧ d > 0 ∧ a ≠ b ∧ a ≠ c ∧ a ≠ d ∧ b ≠ c ∧ b ≠ d ∧ c ≠ d ∧ f a = f b ∧ f a = f c ∧ f a = f d ∧ a * b = c * d := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-6358,"Prove that for any prime \(p > 3\), \(\binom{2p - 1}{p - 1} \equiv 1 \pmod{p^3}\).","import Mathlib theorem Nat.choose_p (p : ℕ) [inst : Fact (Nat.Prime p)] (hp : 3 < p) : Nat.choose (2 * p - 1) (p - 1) ≡ 1 [MOD p ^ 3] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-6374,"Prove that for the sequence \((a_{n})_{n\geqslant 1}\) defined as \(a_{n}=\sqrt{A_{n+2}^{1}\sqrt[3]{A_{n+3}^{2}\sqrt[4]{A_{n+4}^{3}\sqrt[5]{A_{n+5}^{4}}}}}\), where \(A_{m}^{k} = \binom{m}{k} \cdot k!\), and for all \(n \geq 1\), we have \(a_{n} < \frac{119}{120} \cdot n + \frac{7}{3}\).","import Mathlib open Real theorem prove (A : ℕ → ℕ → ℝ) (hA : ∀ m k, A m k = Nat.choose m k * k.factorial) (a : ℕ → ℝ) (ha : ∀ n, a n = sqrt (A (n + 2) 1 * (A (n + 3) 2) ^ ((1 : ℝ) / 3) * (A (n + 4) 3) ^ ((1 : ℝ) / 4) * (A (n + 5) 4) ^ ((1 : ℝ) / 5))) : ∀ n ≥ 1, a n < (119 / 120) * n + 7 / 3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-6752,"Prove that given a spherical surface with radius \(4\), when points on this surface are colored using \(4\) different colors, there exist at least two points of the same color such that the Euclidean distance between them is either \(4\sqrt{3}\) or \(2\sqrt{6}\).","import Mathlib theorem prove (S : Set (EuclideanSpace ℝ (Fin 3))) (hS : S = {P | P ∈ (Metric.sphere 0 4)}) : ∀ f : S → Fin 4, ∃ x y, x ≠ y ∧ f x = f y ∧ dist x y = 4 * Real.sqrt 3 ∨ dist x y = 2 * Real.sqrt 6 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-6958,"Let \(p \geq 2\) and \(n \geq 1\) be two natural numbers. Prove that there exists a set \(A\) containing \(n\) natural numbers such that for any non - empty subset \(B \subseteq A\), the sum of the elements of \(B\) is not a \(p\) - power of a natural number.","import Mathlib theorem Nat.card_eq_p_power (p n : ℕ) [inst : Fact (2 ≤ p)] (hn : 1 ≤ n) : ∃ A : Finset ℕ, A.card = n ∧ ∀ B ⊆ A, B ≠ ∅ → ¬∃ m, m^p = ∑ i ∈ B, i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-7116,"Prove that the set $S = \{\langle 10^{n - 1}a \rangle \mid n \in \mathbb{N}\}$ is dense in the interval $[0,1]$, where $\langle x \rangle = x - \lfloor x \rfloor$ denotes the fractional part of $x$ and $a = 0.123456789101112131415161718\ldots$ is the concatenation of the positive integers in decimal form.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem DenseSet : closure {x : ℝ | ∃ n : ℕ, x = (10^(n-1) * a) % 1} = Set.Icc 0 1 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-7223,"Prove that if $F$ is the set of all entire functions $f: \mathbb{C} \rightarrow \mathbb{C}$ such that $|f'(z)| \le |f(z)|$ for all $z \in \mathbb{C}$, then $F$ is an infinite set.","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem prove_infinite_set : Infinite {f : ℂ → ℂ | Differentiable ℂ f ∧ ∀ z : ℂ, ‖deriv f z‖ ≤ ‖f z‖} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-7234,"Prove that the number of $(p - 1)$-tuples $(x_1, x_2, \ldots, x_{p - 1})$ such that $x_1 + 2x_2 + \cdots + (p - 1)x_{p - 1} \equiv 0 \pmod{p}$ and $1 \leq x_i \leq n$ for all $i = 1, 2, \ldots, p - 1$, where $p$ is an odd prime number and $n$ is a positive integer, is given by \[ \begin{cases} \dfrac{n^{p - 1} + p - 1}{p} & \text{if } p \nmid n \\ \dfrac{n^{p - 1}}{p} & \text{if } p \mid n \end{cases} \]","import Mathlib theorem number_of_tuples {p n : ℕ} (hp : Odd p ∧ Nat.Prime p) (hn : 0 < n) : Set.ncard {x : Fin (p - 1) → ℕ | (∑ i : Fin (p - 1), (i + 1) * x i) ≡ 0 [MOD p] ∧ ∀ i : Fin (p - 1), 1 ≤ x i ∧ x i ≤ n} = if p ∣ n then n^(p - 1) / p else (n^(p - 1) + p - 1) / p := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-7568,Prove that $\sum_{n=1}^{\infty}{\frac{1}{\binom{2n}{n} \times n^2}} = \frac{\pi^2}{18}$.,"import Mathlib open Real theorem sum_infinite : ∑' n : ℕ, (1 / (Nat.choose (2 * n) n) / n ^ 2 : ℝ) = Real.pi ^ 2 / 18 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-7792,"Prove that if $a_{0} = 1$ and for $n \geq 1$, $a_{n}$ denotes the number of permutations $f: \{1, 2, \ldots, n\} \to \{1, 2, \ldots, n\}$ such that $f(f(i)) = i$ for all $i \in \{1, 2, \ldots, n\}$, then the exponential generating function for the sequence $(a_{n})_{n=0}^{\infty}$ is \(f(x) = \exp\left(\frac{x^2}{2} + x\right)\).","import Mathlib open Finset Real theorem exp_gen (a : ℕ → ℕ) (h₀ : a 0 = 1) (h₁ : ∀ n ≥ 1, a n = {f : Equiv.Perm (Fin n) | ∀ i, f (f i) = i}.ncard) : ∑' n, a n * x ^ n / (Nat.factorial n) = Real.exp ((x ^ 2) / 2 + x) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-7794,"Prove that if $a_{0} = 1$ and for $n \geq 1$, $a_{n}$ denotes the number of permutations $f: \{1, 2, \ldots, n\} \to \{1, 2, \ldots, n\}$ such that $f(f(i)) = i$ for all $i \in \{1, 2, \ldots, n\}$, then the exponential generating function for the sequence $(a_{n})_{n=0}^{\infty}$, defined as $A(x) = \sum_{n=0}^{\infty} \frac{a_{n}}{n!} x^n$, is given by \(A(x) = \frac{1}{1 - x - \frac{x^2}{2}}\).","import Mathlib open Finset Real Nat theorem exp_giving (a : ℕ → ℕ) (h₀ : a 0 = 1) (h₁ : ∀ n ≥ 1, a n = {f : Equiv.Perm (Fin n) | ∀ i, f (f i) = i}.ncard) : ∑' n, a n / n.factorial * x ^ n = 1 / (1 - x - x ^ 2 / 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-7832,"Prove that the greatest possible value of \(n\), where \(n\) is the number of distinct integers written on a blackboard such that for any two integers chosen from these \(n\) integers, their sum or their difference (or both) is a positive integral power of 2, is \(5\).","import Mathlib theorem S : IsGreatest {n | ∃ s : Finset ℤ, s.card = n ∧ ∀ x ∈ s, ∀ y ∈ s, x ≠ y → (∃ k : ℕ, 0 < k ∧ x + y = 2 ^ k ∨ x - y = 2 ^ k)} 5 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-7970,Prove that it is possible to color the points of $\mathbb{Q} \times \mathbb{Q}$ in two colors such that any two points at a distance of $1$ from each other have different colors.,"import Mathlib theorem Topology_428736 : ∃ f : (ℚ × ℚ) → Fin 2, ∀ x y, (x.1 - y.1)^2 + (x.2 - y.2)^2 = 1 → f x ≠ f y := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-7990,"a) Prove that for every bijection $f: \mathbb{N} \to \mathbb{N}$, the series \[ \sum_{n=1}^\infty \frac{1}{n f(n)} \] is convergent. b) Prove that there exists a bijection $f: \mathbb{N} \to \mathbb{N}$ such that the series \[ \sum_{n=1}^\infty \frac{1}{n + f(n)} \] is convergent.","import Mathlib open Real Filter Function open scoped BigOperators Topology theorem A : (∀ f : ℕ → ℕ, Function.Bijective f → Summable (λ n => 1 / (n * f n))) ∧ ∃ f : ℕ → ℕ, Function.Bijective f ∧ Summable (λ n => 1 / (n + f n)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-7992,"a) Prove or disprove that for every bijection $f: \mathbb{N} \to \mathbb{N}$, the series $\sum_{n=1}^\infty \frac{1}{n f(n)}$ is convergent. b) Prove that there exists a bijection $f: \mathbb{N} \to \mathbb{N}$ such that the series $\sum_{n=1}^\infty \frac{1}{n + f(n)}$ is convergent.","import Mathlib open Real Filter Function open scoped BigOperators Topology theorem a : (∀ f : ℕ → ℕ, Bijective f → Summable (λ n => 1 / (n * f n))) ∧ ∃ f : ℕ → ℕ, Bijective f ∧ Summable (λ n => 1 / (n + f n)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-8130,"Prove that if $A$ is the space of all sequences $x = (x_{n})$ where $x_{n} \in [0,1]$ for all $n \in \mathbb{N}$, equipped with the metric $d(x, y) = \sum_{k=1}^{\infty} 2^{-k} |x_{k} - y_{k}|$, then $A$ is sequentially compact.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem seq_compact (A : Set (ℕ → ℝ)) (hA : ∀ x ∈ A, ∀ n, x n ∈ Set.Icc 0 1) (d : (ℕ → ℝ) → (ℕ → ℝ) → ℝ) (hd : d = λ x y => ∑' k : ℕ, 2 ^ (-k : ℤ) * |(x k) - (y k)|) : IsSeqCompact A := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-8165,"Let $X$ be a normal topological space, $A$ be a closed subspace of $X$, and $U$ be an open subset of $X$ such that $A\subseteq U$. Prove that there exists a continuous function \(f : X \to \mathbb{R}\) such that \(f|_A \equiv 1\) and \(\text{supp}(f) \subseteq U\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem NormalTopologicalSpace {X : Type*} [TopologicalSpace X] (hX : NormalSpace X) (A U : Set X) (hA : IsClosed A) (hU : IsOpen U) (hA' : A ⊆ U) : ∃ f : X → ℝ, Continuous f ∧ ∀ x ∈ A, f x = 1 ∧ ∀ x, f x ≠ 0 → x ∈ U := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-8435,"Let $S$ be a set of $k < 2^{n - 1}$ distinct subsets of $\{1, 2, \ldots, n\}$ such that the intersection of any two subsets in $S$ is non - empty. Prove that there exists a subset $T$ of $\{1, 2, \ldots, n\}$, not in $S$, such that $T$ has a non - empty intersection with every subset in $S$.","import Mathlib theorem Qwen {n : ℕ} (hn : 0 < n) (S : Finset (Finset ℕ)) (hS : ∀ x ∈ S, x ⊆ Finset.Icc 1 n) (hS1 : ∀ x ∈ S, ∀ y ∈ S, x ≠ y → x ∩ y ≠ ∅) (hS2 : S.card < 2 ^ (n - 1)) : ∃ T : Finset ℕ, T ⊆ Finset.Icc 1 n ∧ ¬(∃ s ∈ S, T = s) ∧ ∀ s ∈ S, T ∩ s ≠ ∅ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-8492,"Given that each point in a plane is painted one of three colors, prove that there exists an equilateral triangle such that all its vertices are of the same color.","import Mathlib theorem color_points (f : ℝ × ℝ → Fin 3) : ∃ A B C : ℝ × ℝ, A ≠ B ∧ B ≠ C ∧ C ≠ A ∧ f A = f B ∧ f B = f C ∧ ∃ r > 0, dist A B = r ∧ dist B C = r ∧ dist A C = r := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-8734,"Let $n$ be a positive integer, and let $\{A, B, C\}$ be a partition of the set $\{1, 2, 3, \ldots, 3n\}$ such that $|A| = |B| = |C| = n$. Prove that there exist $x \in A$, $y \in B$, and $z \in C$ such that one of $x$, $y$, $z$ is the sum of the other two.","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (A B C : Finset ℕ) (h₀ : A ∪ B ∪ C = Finset.Icc 1 (3 * n)) (h₁ : A ∩ B = ∅) (h₂ : A ∩ C = ∅) (h₃ : B ∩ C = ∅) (h₄ : A.card = n) (h₅ : B.card = n) (h₆ : C.card = n) : ∃ x ∈ A, ∃ y ∈ B, ∃ z ∈ C, x = y + z ∨ y = x + z ∨ z = x + y := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-8856,"Let $N$ be a positive integer and consider a sequence of $N$ positive integers, $\left(a_1, a_2, \ldots, a_N\right)$, which contains exactly $n$ distinct integers. Prove that if $N \geq 2^n$, then there exists a nonempty consecutive block of integers within this sequence whose product is a perfect square, where a nonempty consecutive block in a sequence $\left(a_1, a_2, \ldots, a_r\right)$ is defined as a subsequence of the form $\left(a_k, a_{k + 1}, \ldots, a_l\right)$ for some integers $k$ and $l$ satisfying $1 \leq k \leq l \leq r$.","import Mathlib theorem Qwen (N : ℕ) (a : Fin N → ℕ) (ha : ∀ i, 0 < a i) (hdist : Set.ncard {x | ∃ i, a i = x} = n) (hn : n > 0) : N ≥ 2 ^ n → ∃ k l, k ≤ l ∧ ∃ m, m ^ 2 = ∏ i ∈ Finset.Icc k l, a i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-8891,"Let $A$ be a non - empty set of positive integers. Suppose there exist positive integers $b_1, b_2, \ldots, b_n$ and $c_1, c_2, \ldots, c_n$ such that: 1. For each $i$, the set $b_iA + c_i=\{b_ia + c_i\mid a\in A\}$ is a subset of $A$. 2. The sets $b_iA + c_i$ and $b_jA + c_j$ are disjoint for all $i\neq j$. Prove that $\sum_{i = 1}^n \frac{1}{b_i} \leq 1$.","import Mathlib theorem sum_of_binv (A : Finset ℕ) (hA : A.Nonempty ∧ ∀ a ∈ A, a > 0) (b c : Finset.Icc 1 n → ℕ) (hb : ∀ i, b i > 0) (hc : ∀ i, c i > 0) (h1 : ∀ i, {x | ∃ a ∈ A, x = b i * a + c i} ⊆ A) (h2 : ∀ i j, i ≠ j → Disjoint {x | ∃ a ∈ A, x = b i * a + c i} {x | ∃ a ∈ A, x = b j * a + c j}) : ∑ i, (1 : ℚ)/(b i) ≤ 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-9014,"Prove that for prime numbers $p_1, p_2, \ldots, p_r$ and positive integers $a_1, a_2, \ldots, a_r$, the number of pairs of integers $(x, y)$ such that $\gcd(x, y) = 1$ and $x^3 + y^3 = \prod_{i=1}^r p_i^{a_i}$ is at most $2^{r + 1}$.","import Mathlib theorem prove (r : ℕ) (hr : 0 < r) (p : Fin r → ℕ) (hp : ∀ i, Nat.Prime (p i)) (a : Fin r → ℕ) (ha : ∀ i, 0 < a i) : {(x, y) : ℤ × ℤ | x.gcd y = 1 ∧ x ^ 3 + y ^ 3 = ∏ i, (p i) ^ (a i)}.ncard ≤ 2 ^ (r + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-9148,"Prove that if $m \geq 5$ is an odd integer, $D(m)$ denotes the number of quadruples $(a_1, a_2, a_3, a_4)$ of distinct integers such that $1 \leq a_i \leq m$ for all $i$ and $m$ divides $a_1 + a_2 + a_3 + a_4$, and there exists a polynomial $q(x)=c_3x^3 + c_2x^2 + c_1x + c_0$ with $D(m)=q(m)$ for all odd integers $m \geq 5$, then the value of $c_1$ is $11$.","import Mathlib theorem PolynomialQ1 (c : ℕ → ℝ) (h : ∀ m : ℕ, Odd m → m ≥ 5 → {p : Fin 4 → ℕ | (∀ i j, p i = p j → i = j) ∧ (∀ i, 1 ≤ p i ∧ p i ≤ m) ∧ m ∣ p 0 + p 1 + p 2 + p 3}.ncard = c 3 * m ^ 3 + c 2 * m ^ 2 + c 1 * m + c 0) : c 1 = 11 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-9179,"Show that there exists a set $A$ of positive integers with the following property: for any infinite set $S$ of primes, there exist two positive integers $m \in A$ and $n \notin A$, each of which is a product of $k$ distinct elements of $S$ for some $k \geq 2$.","import Mathlib theorem exists_set : ∃ A : Set ℕ, (∀ x ∈ A, x > 0) ∧ ∀ S : Set ℕ, Infinite S → (∀ s ∈ S, Nat.Prime s) → ∃ m n : ℕ, m ∈ A ∧ n ∉ A ∧ ∃ k ≥ 2, ∃ a : Fin k → ℕ, a.Injective ∧ (∀ i, a i ∈ S) ∧ m = ∏ i, a i ∧ ∃ k ≥ 2, ∃ b : Fin k → ℕ, b.Injective ∧ (∀ i, b i ∈ S) ∧ n = ∏ i, b i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-9253,"Prove that for an infinite sequence of positive integers $(x_n)_{n\ge0}$, where statement $A$ is ""There exists an infinite subsequence of $(x_n)$ such that no two terms $y < y'$ satisfy $y \mid y'$"" and statement $B$ is ""There exists an infinite subsequence of $(x_n)$ such that for any two terms $y < y'$, it holds that $y \mid y'$"", the statement $C = A \cup B$ is always true.","import Mathlib open Finset theorem prove_infinite_sequence (x : ℕ → ℕ) (hx : ∀ n, 0 < x n) (A B : Prop) (hA : A = ∃ f : ℕ → ℕ, ∀ m n, f m = f n → m = n ∧ ∀ m n, m < n → ¬(x (f m) ∣ x (f n))) (hB : B = ∃ f : ℕ → ℕ, ∀ m n, f m = f n → m = n ∧ ∀ m n, m < n → x (f m) ∣ x (f n)) : A ∨ B := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-9278,"Prove that for positive integers \(m \geq 2\) and \(n \geq 3\), the maximum possible number of elements in a subset \(A\) of the set \(S=\left\{(a,b)\mid a\in\{1,2,\cdots,m\},b\in\{1,2,\cdots,n\}\right\}\) such that there do not exist positive integers \(x_1,x_2,y_1,y_2,y_3\) with \(x_1 < x_2\) and \(y_1 < y_2 < y_3\) for which \((x_1,y_1),(x_1,y_2),(x_1,y_3),(x_2,y_2)\in A\) is \(2m + n - 2\).","import Mathlib theorem prove (m n : ℕ) (hm : 2 ≤ m) (hn : 3 ≤ n) : IsGreatest {k | ∃ A : Finset (ℕ × ℕ), A.card = k ∧ (∀ a ∈ A, a.1 ∈ Finset.Icc 1 m ∧ a.2 ∈ Finset.Icc 1 n) ∧ ¬∃ x1 x2 y1 y2 y3 : ℕ, 0 < x1 ∧ x1 < x2 ∧ 0 < y1 ∧ y1 < y2 ∧ y2 < y3 ∧ (x1, y1) ∈ A ∧ (x1, y2) ∈ A ∧ (x1, y3) ∈ A ∧ (x2, y2) ∈ A} (2 * m + n - 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-9353,"Let $E$ be the set of all $C^1$ functions $f$ on $[0,1]$ such that $f(0) = f(1) = 0$ and $\int_{0}^{1} {f'(x)}^2 \, dx = 1$. Define $F$ as the subset of $E$ consisting of functions $f \in C^2$ for which $\int_{0}^{1} {f(x)}^2 \, dx = M$, where $M = \sup \left\{ \int_{0}^{1} {f(x)}^2 \, dx : f \in E \right\}$. Prove that the set $F$ is non - empty and its cardinality is at most 2.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem SetNonempty {E : Set (ℝ → ℝ)} (hE : E = {f | ContDiffOn ℝ 1 f (Set.Icc 0 1) ∧ f 0 = 0 ∧ f 1 = 0 ∧ ∫ x in (0)..1, (deriv f x)^2 = 1}) : ∃ F ⊆ E, (∀ f ∈ F, ContDiffOn ℝ 2 f (Set.Icc 0 1)) ∧ (∀ f ∈ F, ∫ x in (0)..1, (f x)^2 = sSup {∫ x in (0)..1, (f x)^2 | f ∈ E}) ∧ F.Nonempty ∧ F.ncard ≤ 2 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-9447,"Given a set $M$ of 1985 distinct positive integers, where each integer in $M$ has no prime divisor greater than 23, prove that $M$ contains a subset of four elements whose product is the fourth power of an integer.","import Mathlib theorem qwen (M : Finset ℕ) (hM : M.card = 1985) (hM1 : ∀ m ∈ M, 0 < m) (hM2 : ∀ m ∈ M, ∀ p, Nat.Prime p → p ∣ m → p ≤ 23) : ∃ S ⊆ M, S.card = 4 ∧ ∃ k, S.prod id = k ^ 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-9511,"Given a natural number $n \geq 3$, prove that there exists a set $A_n$ with the following properties: 1) $A_n$ consists of $n$ distinct natural numbers. 2) For any $a \in A_n$, the remainder of the product of all elements of $A_n \setminus \{a\}$ divided by $a$ is $1$.","import Mathlib theorem Nat.card_eq_sum (n : ℕ) (hn : 3 ≤ n) : ∃ A : Finset ℕ, A.card = n ∧ (∀ a ∈ A, (∏ x ∈ (A \ {a}), x) % a = 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-9532,"Let $E_k$, for $k=1,2,3,\dots$, be a sequence of measurable subsets of $\mathbb{R}$ such that $m(E_k) > \frac{1}{2}$ for all $k$, and $m(E_k \cap E_\ell) \leq \frac{1}{4}$ for all $k \neq \ell$. Prove the following: a) $m\left(\bigcup_{k \geq 1} E_k\right) \geq 1$. b) $m\left(\bigcup_{k \geq 1} E_k\right) > 1$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem M (E : ℕ → Set ℝ) (h₁ : ∀ k, (MeasureTheory.volume (E k)).toReal > 1 / 2) (h₂ : ∀ k l, k ≠ l → (MeasureTheory.volume (E k ∩ E l)).toReal ≤ 1 / 4) : (MeasureTheory.volume (⋃ k, E k)).toReal ≥ 1 ∧ (MeasureTheory.volume (⋃ k, E k)).toReal > 1 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-9566,"Let $a_1 < a_2 < \cdots < a_n$ be positive integers. Consider a periodic coloring of $\mathbb{Z}$ with period $t$ such that for each $x \in \mathbb{Z}$, exactly one of the integers $x + a_1, x + a_2, \dots, x + a_n$ is colored. Prove that $n \mid t$.","import Mathlib theorem periodic_coloring (n : ℕ) (hn : 0 < n) (a : Fin n → ℤ) (ha : ∀ i j, i < j → a i < a j) (hpos : ∀ i, 0 < a i) (t : ℕ) (ht : 0 < t) (f : ℤ → ℤ) (hf : Function.Periodic f t) (h : ∀ x, {y | ∃ i, y = x + a i ∧ f y ≠ 0}.encard = 1) : n ∣ t := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-9668,"Consider the system of linear equations given by \[ \begin{matrix} a_{11}x_{1} + \ldots + a_{1q}x_{q} = 0, \\ a_{21}x_{1} + \ldots + a_{2q}x_{q} = 0, \\ \ldots, \\ a_{p1}x_{1} + \ldots + a_{pq}x_{q} = 0, \end{matrix} \] where $q = 2p$ and each coefficient $a_{ij}$ is an element of the set $\{-1, 0, 1\}$. Prove that there exists a solution $(x_{1}, \ldots, x_{q})$ for the system with the following properties: a) All $x_{j}$, for $j = 1, \ldots, q$, are integers; b) There exists at least one $j$ such that $x_{j} \neq 0$; c) $|x_{j}| \leq q$ for any $j = 1, \ldots, q$.","import Mathlib theorem linear_eq (p : ℕ) (hp : p > 0) (q : ℕ) (hq : q = 2 * p) (a : Matrix (Fin p) (Fin q) ℤ) (ha : ∀ i j, a i j = -1 ∨ a i j = 0 ∨ a i j = 1) : ∃ x : Fin q → ℤ, (∀ i, ∑ j : Fin q, a i j * x j = 0) ∧ (∃ i, x i ≠ 0) ∧ (∀ i, |x i| ≤ q) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-9796,"Let $p \geq 5$ be a prime number. Prove that for any partition of the set $\{1, 2, \ldots, p-1\}$ into three subsets, there exist numbers $x, y, z$ such that each belongs to a distinct subset and $x + y \equiv z \pmod{p}$.","import Mathlib theorem qwen (p : ℕ) (hp : Nat.Prime p) (h : 5 ≤ p) : ∀ s1 s2 s3 : Finset ℕ, s1 ∪ s2 ∪ s3 = Finset.Icc 1 (p - 1) ∧ s1 ∩ s2 = ∅ ∧ s2 ∩ s3 = ∅ ∧ s3 ∩ s1 = ∅ → ∃ x ∈ s1, ∃ y ∈ s2, ∃ z ∈ s3, x + y ≡ z [MOD p] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-9800,"Let $(X,d)$ be a compact metric space, and let $f: X \rightarrow X$ be a function such that for all $x, y \in X$, the inequality $d(f(x), f(y)) \leq d(x, y)$ holds, with equality if and only if $x = y$. Prove that the function $f$ has a unique fixed point.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MetricCompactSpace {X : Type*} [MetricSpace X] [CompactSpace X] (f : X → X) (h : ∀ x y, dist (f x) (f y) ≤ dist x y) (h' : ∀ x y, dist (f x) (f y) = dist x y ↔ x = y) : ∃! x, f x = x := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-10095,"Prove Lucas' Theorem: If $m = a_0 + a_1 p + \cdots + a_t p^t$ and $n = b_0 + b_1 p + \cdots + b_t p^t$ where $0 \leq a_i < p$ and $0 \leq b_i < p$ for all $i$, then \[ \binom{m}{n} \equiv \prod_{i=0}^{t} \binom{a_i}{b_i} \pmod{p} \] where $p$ is a prime number, and $\binom{a}{b} = 0$ if $b > a$.","import Mathlib open Finset theorem lucas {p : ℕ} (hp : Nat.Prime p) (t : ℕ) (a b : ℕ → ℕ) (ha : ∀ i ∈ Icc 0 t, a i < p) (hb : ∀ i ∈ Icc 0 t, b i < p) (m n : ℕ) (hm : m = ∑ i ∈ Icc 0 t, a i * p ^ i) (hn : n = ∑ i ∈ Icc 0 t, b i * p ^ i) : Nat.choose m n ≡ ∏ i ∈ Icc 0 t, Nat.choose (a i) (b i) [MOD p] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-10158,"Prove the existence of measurable functions $f, g: \mathbb{R} \rightarrow \mathbb{R}$ such that the composition $f \circ g$ is not measurable.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem exist_not_measurable_comp : ∃ (f g : ℝ → ℝ), Measurable f ∧ Measurable g ∧ ¬Measurable (f ∘ g) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-10194,"\textbf{1.} Does there exist a one-to-one function $f: \mathbb{R} \to \mathbb{R}$ such that for all $x \in \mathbb{R}$, the following inequality holds: $f(x^2) - f^2(x) \geq \frac{1}{4}$? \textbf{2.} Let $f: [0,1] \to \mathbb{R}$ be a continuous function that is differentiable on $(0,1)$. Suppose there exists a number $a \in (0,1]$ such that $\int_0^a f(x) \, dx = 0$. Prove that: \[ \left| \int_0^1 f(x) \, dx \right| \leq \frac{1 - a}{2} \sup \left\{ \left| f'(x) \right| : x \in (0,1) \right\}. \] \textbf{3.} In how many ways can the numbers from the set $\{1, 2, \ldots, 12\}$ be combined such that their product is a perfect cube? \textbf{4.} Let $A$ be an $n \times n$ matrix with real entries, and suppose there exists a number $a \in [-2, 2]$ such that $A^2 - aA + I_n = 0_n$. Prove that for every positive integer $m$, there exists a unique number $a_m \in [-2, 2]$ such that: \[ A^{2m} - a_m A^m + I_n = 0_n. \]","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem answer : ¬ ∃ f : ℝ → ℝ, Function.Injective f ∧ ∀ x, f (x ^ 2) - (f x) ^ 2 ≥ 1 / 4 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-10214,"Every integer is colored either black or white. Prove that for at least one of the colors, it is possible to represent every even integer in the form $a + b - c - d$, where $a, b, c, d$ are integers of that color.","import Mathlib theorem color_favor (f : ℤ → Fin 2) : (∀ n, Even n → ∃ a b c d, f a = 0 ∧ f b = 0 ∧ f c = 0 ∧ f d = 0 ∧ n = a + b - c - d) ∨ (∀ n, Even n → ∃ a b c d, f a = 1 ∧ f b = 1 ∧ f c = 1 ∧ f d = 1 ∧ n = a + b - c - d) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-10400,"Let $a_1, a_2, \ldots, a_{2n+1}$ be a sequence of $2n+1$ integers. Define property $P$ as follows: for any subset of $2n$ numbers from $a_1, a_2, \ldots, a_{2n+1}$, there exists a partition of these $2n$ numbers into two groups of $n$ numbers each such that the sum of the elements in each group is equal. Prove that $a_1, a_2, \ldots, a_{2n+1}$ are all equal if and only if the sequence $a_1, a_2, \ldots, a_{2n+1}$ satisfies property $P$.","import Mathlib open Finset theorem propertyP (n : ℕ) (a : Fin (2 * n + 1) → ℤ) : (∀ s : Finset (Fin (2 * n + 1)), s.card = 2 * n → ∃ t u : Finset (Fin (2 * n + 1)), t ⊆ s ∧ u ⊆ s ∧ t.card = n ∧ u.card = n ∧ ∑ i ∈ t, a i = ∑ i ∈ u, a i) ↔ ∃ x, ∀ i : Fin (2 * n + 1), a i = x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-10452,"Given a set $S \subseteq \mathbb{Z}$ that satisfies the following conditions: 1. There exist $a, b \in S$ such that $\gcd(a, b) = \gcd(a - 2, b - 2) = 1$. 2. For any $x, y \in S$, it holds that $x^2 - y \in S$ (where $x$ and $y$ can be equal). Prove that $S = \mathbb{Z}$.","import Mathlib theorem algebra_486597 {S : Set ℤ} (h1 : ∃ a b : S, Int.gcd a b = 1 ∧ Int.gcd (a - 2) (b - 2) = 1) (h2 : ∀ x ∈ S, ∀ y ∈ S, x ^ 2 - y ∈ S) : S = ⊤ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-10459,"Let $S$ be a set containing $2002$ elements, and let $N$ be an integer such that $0 \leq N \leq 2^{2002}$. Prove that it is possible to color each subset of $S$ either black or white in such a way that the following conditions are satisfied: (a) The union of any two white subsets is white. (b) The union of any two black subsets is black. (c) There are exactly $N$ white subsets.","import Mathlib theorem Finset_blackwhite {α : Type*} [Fintype α] (hα : Fintype.card α = 2002) (N : ℕ) (hN : 0 ≤ N ∧ N ≤ 2 ^ 2002) : ∃ f : Set α → Fin 2, (∀ A B, f A = 1 → f B = 1 → f (A ∪ B) = 1) ∧ (∀ A B, f A = 0 → f B = 0 → f (A ∪ B) = 0) ∧ {x | f x = 1}.encard = N := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-10521,"Prove that for any integer $n \ge 2$, there exists a set $A_n$ of $n$ distinct positive integers such that for any two distinct elements $i, j \in A_n$, the condition $|i - j|$ divides $i^2 + j^2$ holds.","import Mathlib theorem prove (n : ℕ) (hn : 2 ≤ n) : ∃ A : Finset ℕ, A.card = n ∧ (∀ i ∈ A, 0 < i) ∧ (∀ i ∈ A, ∀ j ∈ A, i ≠ j → |(i : ℤ) - j| ∣ i^2 + j^2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-10699,"Prove that there exists an infinite set of natural numbers $n$ such that all binomial coefficients $\binom{n}{0}, \binom{n}{1}, \binom{n}{2}, \ldots, \binom{n}{n}$ are odd.","import Mathlib theorem InfiniteSet : ∃ S : Set ℕ, Infinite S ∧ ∀ n ∈ S, ∀ i ∈ Finset.range (n + 1), Odd (Nat.choose n i) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-10719,"Let $z_1, z_2, \ldots, z_n$ be complex numbers. Prove that there exists a subset $J$ of the set $\{1, 2, \ldots, n\}$ such that: \[ \left| \sum_{k \in J} z_k \right| \geq \frac{1}{4 \sqrt{2}} \sum_{k=1}^{n} |z_k| \]","import Mathlib open Finset Complex Polynomial theorem summing (n : ℕ) (hn : 0 < n) (f : Fin n → ℂ) : ∃ J : Finset (Fin n), ‖∑ k ∈ J, f k‖ ≥ (1 / (4 * Real.sqrt 2)) * ∑ k : Fin n, ‖f k‖ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-10781,"Let $M$ be a finite set and $\Omega$ a collection of subsets of $M$ satisfying the following conditions: (i) For all $A, B \in \Omega$, if $|A \cap B| \geq 2$, then $A = B$. (ii) There exist $A, B, C \in \Omega$, pairwise distinct, such that $|A \cap B \cap C| = 1$. (iii) For every $A \in \Omega$ and every $a \in M \setminus A$, there is a unique $B \in \Omega$ such that $a \in B$ and $A \cap B = \emptyset$. Prove that there exist integers $p$ and $s$ such that: (a) For every $a \in M$, the number of sets in $\Omega$ that contain $a$ is $p$. (b) For every $A \in \Omega$, $|A| = s$. (c) $p \leq s + 1$.","import Mathlib theorem Qwen (M : Type*) [Finite M] (Ω : Set (Set M)) (h₁ : ∀ A B : Set M, A ∈ Ω → B ∈ Ω → (A ∩ B).ncard ≥ 2 → A = B) (h₂ : ∃ A B C : Set M, A ∈ Ω ∧ B ∈ Ω ∧ C ∈ Ω ∧ A ≠ B ∧ B ≠ C ∧ C ≠ A ∧ (A ∩ B ∩ C).ncard = 1) (h₃ : ∀ A : Set M, A ∈ Ω → ∀ a : M, a ∉ A → ∃! B : Set M, B ∈ Ω ∧ a ∈ B ∧ A ∩ B = ∅) : ∃ p s : ℕ, (∀ a : M, {x | x ∈ Ω ∧ a ∈ x}.encard = p) ∧ (∀ A : Set M, A ∈ Ω → A.ncard = s) ∧ p ≤ s + 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-10986,"Prove that if each point in $\mathbb{R}^2$ is colored with one of three colors (red, blue, or green), then there exists at least one color such that for every distance $d \geq 0$, there are two points of that color whose distance apart is exactly $d$.","import Mathlib theorem color_points (f : ℝ × ℝ → Fin 3) : ∃ c, ∀ d ≥ 0, ∃ p q, p ≠ q ∧ f p = c ∧ f q = c ∧ dist p q = d := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-11275,"Let a function \( f \) be defined on the positive integers and taking positive integer values as follows: \( \begin{cases} f(1) = 1, & f(3) = 3 \\ f(2n) = f(n) \\ f(4n + 1) = 2f(2n + 1) - f(n) \\ f(4n + 3) = 3f(2n + 1) - 2f(n) \end{cases} \) for all positive integers \( n \). Prove that the number of positive integers \( n\leq1988 \) for which \( f(n) = n \) is \( 31 \).","import Mathlib theorem f (f : ℕ → ℕ) (h₀ : f 1 = 1) (h₁ : f 3 = 3) (h₂ : ∀ n > 0, f (2 * n) = f n) (h₃ : ∀ n > 0, f (4 * n + 1) = 2 * f (2 * n + 1) - f n) (h₄ : ∀ n > 0, f (4 * n + 3) = 3 * f (2 * n + 1) - 2 * f n) : Set.ncard {n | n ≤ 1988 ∧ f n = n} = 31 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-11277,"Prove that the number of positive integers \(n\leq 1988\) for which the function \(f\) defined by \[ \begin{matrix} f(1) = 1, & f(3) = 3 \\ f(2 \cdot n) = f(n) \\ f(4 \cdot n + 1) = 2 \cdot f(2 \cdot n + 1) - f(n) \\ f(4 \cdot n + 3) = 3 \cdot f(2 \cdot n + 1) - 2 \cdot f(n), \end{matrix} \] satisfies \(f(n)=n\) is \(92\).","import Mathlib theorem prove (f : ℕ → ℕ) (h₀ : f 1 = 1) (h₁ : f 3 = 3) (h₂ : ∀ n, f (2 * n) = f n) (h₃ : ∀ n, f (4 * n + 1) = 2 * f (2 * n + 1) - f n) (h₄ : ∀ n, f (4 * n + 3) = 3 * f (2 * n + 1) - 2 * f n) : Set.ncard {n | n ≤ 1988 ∧ f n = n} = 92 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-11467,"Let $c_1, c_2, \ldots, c_n \in \mathbb{R}$ for $n \geq 2$ such that \[ 0 \leq \sum_{i=1}^n c_i \leq n. \] Prove that there exist integers $k_1, k_2, \ldots, k_n$ satisfying \[ \sum_{i=1}^n k_i = 0 \] and \[ 1 - n \leq c_i + n \cdot k_i \leq n \] for every $i = 1, 2, \ldots, n.$","import Mathlib theorem sumOfC (n : ℕ) (hn : n ≥ 2) (c : Fin n → ℝ) (hsum : 0 ≤ ∑ i : Fin n, c i ∧ ∑ i : Fin n, c i ≤ n) : ∃ k : Fin n → ℤ, (∑ i : Fin n, k i = 0) ∧ (∀ i : Fin n, 1 - n ≤ c i + n * k i ∧ c i + n * k i ≤ n) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-11567,"Prove that for any integer \(n \ge 2\), there exists a set \(S\) with \(n\) elements such that for any two distinct elements \(a, b \in S\), the product \(a \cdot b\) is divisible by \((a - b)^2\).","import Mathlib theorem prove : ∀ n ≥ 2, ∃ S : Finset ℤ, S.card = n ∧ ∀ a ∈ S, ∀ b ∈ S, a ≠ b → (a * b) % (a - b)^2 = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-11987,"Prove that the maximum value of \(n\) for which there exist subsets \(X\) and \(Y\) of the set \(A=\{3,4,5,\ldots,n\}\) such that \(X\cup Y = A\), \(X\cap Y=\emptyset\), for any \(x_i,x_j\in X\) (where \(x_i\) and \(x_j\) may be the same), \(x_i\cdot x_j\notin X\), and for any \(y_i,y_j\in Y\) (where \(y_i\) and \(y_j\) may be the same), \(y_i\cdot y_j\notin Y\) is \(n = 80\).","import Mathlib open Finset theorem max_n : IsGreatest { n | ∃ X Y : Set ℕ, X ⊆ Icc 3 n ∧ Y ⊆ Icc 3 n ∧ X ∪ Y = Icc 3 n ∧ X ∩ Y = ∅ ∧ ∀ x ∈ X, ∀ y ∈ X, x * y ∉ X ∧ ∀ x ∈ Y, ∀ y ∈ Y, x * y ∉ Y } 80 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-12139,"1. **Analysis of the user's problem**: - The user's problem already contains a formal math - proof part in part (b). The part (a) is an example - finding problem, and part (b) is a proof problem. 2. **Final proof statement**: - Prove that every finite powerful set \(S\) (where a set \(S\) of positive real numbers is defined as powerful if for any two distinct elements \(a,b\in S\), at least one of \(a^{b}\) or \(b^{a}\) is also an element of \(S\)) contains at most four elements.","import Mathlib open Real theorem analysis_of_powerful_set {S : Finset ℝ} (hS : ∀ x ∈ S, x > 0) (hS' : ∀ a ∈ S, ∀ b ∈ S, a ≠ b → ∃ x ∈ S, x = a ^ b ∨ x = b ^ a) : S.card ≤ 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-12164,"Prove that the number $N_{10}$ of ordered 10 - tuples of positive integers $(a_1, a_2, \ldots, a_{10})$ such that \(\frac{1}{a_1}+\frac{1}{a_2}+\cdots+\frac{1}{a_{10}} = 1\) is odd.","import Mathlib theorem Counting_282385 : Odd (Set.encard {a : Fin 10 → ℕ | ∑ i, (1 : ℚ)/(a i) = 1 ∧ ∀ i, a i > 0}) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-12280,"The user's problem is already stated as a formal math proof problem. So the final proof statements are: a) Prove that there are infinitely many [i]non - charrua[/i] pairs. b) Prove that there are infinitely many positive integers \(n\) such that the pair \((2, n)\) is [i]charrua[/i].","import Mathlib open Nat def is_charrua (p : ℕ × ℕ) := p.1 ∣ p.2 ∧ ¬(∃ k, p.1 = 2 * k + 1 ∧ p.2 = 2 * k + 2) theorem prove_infinite : {p | ¬is_charrua p}.Infinite ∧ {n | 0 < n ∧ is_charrua (2, n)}.Infinite := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-12846,"Prove that the number of positive integers \(n\) for which there exists a sequence \((x_1, x_2, \ldots, x_{2012}) \in \mathbb{N}^{2012}\) such that \(x_1 < x_2 < \ldots < x_{2012}\) and \(\frac{1}{x_1} + \frac{2}{x_2} + \frac{3}{x_3} + \ldots + \frac{2012}{x_{2012}} = n\) is \(2012\).","import Mathlib theorem number_theory_7942 : Set.ncard {n : ℕ | ∃ x : Fin 2012 → ℕ, StrictMono x ∧ (∀ i, 0 < x i) ∧ ∑ i : Fin 2012, (i + 1 : ℚ) / x i = n} = 2012 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-13003,"Prove that the remainder when the number \(N\) of ordered triples \((a, b, c)\) of integers such that \(1 \le a, b \le p(p - 1)\) and \(a^b - b^a = p \cdot c\) (where \(p = 2017\) is a prime number) is divided by \(1000000\) is given by \(N \bmod 1000000\).","import Mathlib theorem proof (p : ℕ) (hp : Nat.Prime p) (h : p = 2017) : {(a, b, c) : ℕ × ℕ × ℕ | 1 ≤ a ∧ 1 ≤ b ∧ a ≤ p * (p - 1) ∧ b ≤ p * (p - 1) ∧ a ^ b - b ^ a = p * c}.ncard % 1000000 = 123456 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-13491,"Let \(k\) be a positive integer. For each nonnegative integer \(n\), define \(f(n)\) as the number of solutions \((x_1, \ldots, x_k) \in \mathbb{Z}^k\) to the inequality \(|x_1| + \cdots + |x_k| \leq n\). Prove that for every \(n \geq 1\), the inequality \(f(n-1)f(n+1) \leq f(n)^2\) holds.","import Mathlib open Finset theorem number_of_solutions (k : ℕ) (hk : 0 < k) (f : ℕ → ℕ) (hf : ∀ n, f n = {x : Fin k → ℤ | ∑ i, |x i| ≤ n}.ncard) : ∀ n ≥ 1, f (n - 1) * f (n + 1) ≤ (f n)^2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-14055,"Given \(m = 42\), let \(S = \{1, 2, \ldots, 51m\}\). Let \(A\) be a subset of \(S\) such that \(|A| = 50m\). Prove that there exist subsets \(X, Y \subset S\) satisfying the following conditions: 1. \(X \cap Y = Y \cap A = A \cap X = \emptyset\). 2. \(\sum_{x \in X} x = \sum_{y \in Y} y\). 3. \(\sum_{x \in X} x^2 = \sum_{y \in Y} y^2\).","import Mathlib theorem qwen (m : ℕ) (hm : m = 42) (S : Finset ℕ) (hS : S = Finset.Icc 1 (51 * m)) (A : Finset ℕ) (hA : A ⊆ S) (hA' : A.card = 50 * m) : ∃ X Y : Finset ℕ, X ⊆ S ∧ Y ⊆ S ∧ X ∩ Y = ∅ ∧ Y ∩ A = ∅ ∧ A ∩ X = ∅ ∧ ∑ x ∈ X, x = ∑ y ∈ Y, y ∧ ∑ x ∈ X, x ^ 2 = ∑ y ∈ Y, y ^ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-14523,"Prove that for every positive integer \(n \geq 3\), there exist two sets \(A = \{ x_1, x_2, \ldots, x_n \}\) and \(B = \{ y_1, y_2, \ldots, y_n \}\) such that \(A \cap B = \varnothing\), \(\sum_{i=1}^{n} x_i = \sum_{i=1}^{n} y_i\), and \(\sum_{i=1}^{n} x_i^2 = \sum_{i=1}^{n} y_i^2\).","import Mathlib open Finset Real theorem prove (n : ℕ) (hn : 3 ≤ n) : ∃ A B : Finset ℝ, A.card = n ∧ B.card = n ∧ A ∩ B = ∅ ∧ ∑ i ∈ A, i = ∑ i ∈ B, i ∧ ∑ i ∈ A, (i ^ 2) = ∑ i ∈ B, (i ^ 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-14541,"Let \(n > 1\) be a positive integer. Each cell of an \(n \times n\) table contains an integer. Suppose the following conditions are satisfied: 1. Each number in the table is congruent to \(1\) modulo \(n\). 2. The sum of the numbers in any row, as well as the sum of the numbers in any column, is congruent to \(n\) modulo \(n^2\). Let \(R_i\) be the product of the numbers in the \(i^{\text{th}}\) row, and \(C_j\) be the product of the numbers in the \(j^{\text{th}}\) column. Prove that \(\sum_{i = 1}^{n}R_i \equiv \sum_{j = 1}^{n}C_j \pmod{n^4}\).","import Mathlib open Finset theorem MatrixProduct {n : ℕ} (hn : 1 < n) (a : Matrix (Fin n) (Fin n) ℤ) (h1 : ∀ i j, a i j ≡ 1 [ZMOD n]) (h2 : ∀ i, ∑ j : Fin n, a i j ≡ n [ZMOD n ^ 2]) (h3 : ∀ j, ∑ i : Fin n, a i j ≡ n [ZMOD n ^ 2]) : (∑ i : Fin n, (∏ j : Fin n, a i j)) ≡ (∑ j : Fin n, (∏ i : Fin n, a i j)) [ZMOD n ^ 4] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-14907,"Let $p = 2n - 1$ be a prime number. Prove that for any natural numbers $a_1, a_2, \ldots, a_n$, there exist two distinct indices $i$ and $j$ such that $$\frac{a_i + a_j}{(a_i, a_j)} \geq 2n - 1,$$ where $(a_i, a_j)$ denotes the greatest common divisor of $a_i$ and $a_j$.","import Mathlib theorem qwen (n : ℕ) (p : ℕ) (hp : p.Prime) (hpn : p = 2 * n - 1) : ∀ a : Fin n → ℕ, ∃ i j, i ≠ j ∧ (a i + a j) / Nat.gcd (a i) (a j) ≥ p := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-15115,"Let \(p\) be a prime number, and let \(a_1, a_2, \dots, a_{2p - 1}\) be elements of \(\mathbb{Z}/p\mathbb{Z}\). Prove that for any \(b \in \mathbb{Z}/p\mathbb{Z}\), if \(N\) is the number of subsets \(I\) of \(\{1, 2, \dots, 2p - 1\}\) with \(p\) elements such that \(\sum_{i \in I} a_i = b\) in \(\mathbb{Z}/p\mathbb{Z}\), then \(N \equiv 0 \text{ or } 1 \pmod{p}\).","import Mathlib theorem ZMod_p (p : ℕ) (hp : Nat.Prime p) (a : Fin (2 * p - 1) → ZMod p) (b : ZMod p) : {I : Finset (Fin (2 * p - 1)) | I.card = p ∧ ∑ i ∈ I, a i = b}.ncard ≡ 0 [MOD p] ∨ {I : Finset (Fin (2 * p - 1)) | I.card = p ∧ ∑ i ∈ I, a i = b}.ncard ≡ 1 [MOD p] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-15412,"Prove that there does not exist a bijective function \(f: \{0,1,2,\ldots,p^{2}-1\} \to \{0,1,2,\ldots,p^{2}-1\}\) such that there exists an \(i \in \mathbb{Z}_{p^2}\) for which \(if(i) \equiv p \pmod{p^2}\).","import Mathlib open Finset theorem no_bijective_f : ¬ ∃ f : Equiv.Perm (Fin (p ^ 2)), ∃ i : Fin (p ^ 2), i * f i ≡ p [MOD p ^ 2] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-15566,"Prove that the set of all positive integers \(k\) such that for every subset \(A_i\) of \(A=\{1, 2, \ldots, 36\}\) with \(k\) elements, there exist three elements in \(A_i\) that are pairwise relatively prime is \(k \in \{25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36\}\).","import Mathlib theorem prove (k : ℕ) : (∀ A : Finset ℕ, A ⊆ Finset.Icc 1 36 ∧ A.card = k → ∃ x ∈ A, ∃ y ∈ A, ∃ z ∈ A, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ Nat.Coprime x y ∧ Nat.Coprime y z ∧ Nat.Coprime z x) ↔ k = 25 ∨ k = 26 ∨ k = 27 ∨ k = 28 ∨ k = 29 ∨ k = 30 ∨ k = 31 ∨ k = 32 ∨ k = 33 ∨ k = 34 ∨ k = 35 ∨ k = 36 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-16298,Prove that the maximum number of vectors that can originate from a single point in the Euclidean space $\mathbb{R}^n$ such that the angle between any two vectors is obtuse is $n + 1$.,"import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem max_vectors (n : ℕ) : IsGreatest {k | ∃ s : Finset (EuclideanSpace ℝ (Fin n)), s.card = k ∧ ∀ u ∈ s, ∀ v ∈ s, u ≠ v → Matrix.dotProduct u v < 0} (n + 1) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-17478,"Let \(a, b,\) and \(n\) be positive integers with \(a > b\) such that the following conditions are satisfied: i. \(a^{2021} \mid n\), ii. \(b^{2021} \mid n\), iii. \(2022 \mid a - b\). Prove that there exists a subset \(T\) of the set of positive divisors of \(n\) such that the sum of the elements of \(T\) is divisible by \(2022\) but not by \(2022^2\). Since the user's problem is already a formal math proof problem, we return it as-is.","import Mathlib theorem algebra_485369 (a b n : ℕ) (_ : 0 < a) (hb : 0 < b) (hn : 0 < n) (h : a > b) (h1 : a^2021 ∣ n) (h2 : b^2021 ∣ n) (h3 : 2022 ∣ a - b) : ∃ T : Finset ℕ, (∀ t ∈ T, t ∣ n) ∧ (∑ t ∈ T, t) % 2022 = 0 ∧ ¬(∑ t ∈ T, t) % 2022^2 = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-17580,"Prove that the maximum positive integer \(m\) such that the binomial coefficient \(\binom{x_n}{m}=\frac{x_n(x_n - 1)(x_n - 2)\cdots(x_n - m + 1)}{m!}\) is never a multiple of \(7\) for any positive integer \(n\), where the sequence \(\{x_n\}\) is defined by \(x_1 = 2022\) and \(x_{n + 1}=7x_n+5\) for all positive integers \(n\), is \(m = 404\).","import Mathlib open Finset theorem max_m (x : ℕ → ℕ) (hx1 : x 1 = 2022) (hxn : ∀ n > 0, x (n + 1) = 7 * x n + 5) : IsGreatest {m | 0 < m ∧ ∀ n > 0, ¬(7 ∣ Nat.choose (x n) m)} 404 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-17677,"Let $n > 1$ be a positive integer. Prove that the number of distinct residues modulo $n^2$ of the elements of the set $\{ x^n + y^n : x, y \in \mathbb{N} \}$ is at most $\frac{n(n+1)}{2}$.","import Mathlib theorem number_theory_98064 (n : ℕ) (hn : 1 < n) : Set.ncard {k | ∃ x y, k = x ^ n + y ^ n ∧ k < n ^ 2} ≤ n * (n + 1) / 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-18105,"Prove that the smallest positive integer \(n\) such that for any subset \(S\) of the set \(X=\{1, 2, \ldots, 2001\}\) with \(|S| = n\), there exists either an element in \(S\) that is a power of 2 or two distinct elements in \(S\) whose sum is a power of 2 is \(n = 1992\).","import Mathlib def X : Finset ℕ := Finset.Icc 1 2001 theorem prove {n : ℕ} (hn : n > 0) : (∀ S : Finset ℕ, S ⊆ X ∧ S.card = n → ∃ x ∈ S, ∃ k : ℕ, x = 2 ^ k ∨ ∃ x ∈ S, ∃ y ∈ S, x ≠ y ∧ ∃ k : ℕ, x + y = 2 ^ k) ↔ n = 1992 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-18148,"Prove that for each positive integer \(n \geq 2\), where \(A_n = \{ x \in \mathbb{N}^* \mid 1 \leq x \leq (n - 1) \text{ and } n \nmid \binom{n}{x} \}\) and \(f(n)=\text{card}(A_n)\), the number of elements in \(A_n\) is given by \(f(n)=n - 1-\phi(n)\), where \(\phi(n)\) is the Euler's totient function.","import Mathlib open Finset theorem card {A : ℕ → Set ℕ} (hA : ∀ n ≥ 2, A n = {x | 1 ≤ x ∧ x ≤ n - 1 ∧ ¬n ∣ Nat.choose n x}) : ∀ n ≥ 2, (Nat.card (A n)) = n - 1 - n.totient := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-18257,"Let \(M\) be a finite set with \(m\) elements, and let \(M_1, M_2, \ldots, M_{1986}\) be \(1986\) subsets of \(M\), each containing more than \(\frac{m}{2}\) elements. Prove that it is possible to select no more than ten elements from \(M\) such that each of the sets \(M_i\) (\(i = 1, 2, \ldots, 1986\)) contains at least one of the selected elements.","import Mathlib theorem Finset.proven (M : Finset ℕ) (hM : M.card > 0) (Ms : Finset.Icc 1 1986 → Finset ℕ) (hMs : ∀ i, Ms i ⊆ M) (hMs1 : ∀ i, (Ms i).card > (M.card / 2 : ℝ)) : ∃ S : Finset ℕ, S ⊆ M ∧ S.card ≤ 10 ∧ ∀ i, ∃ x ∈ S, x ∈ Ms i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-18761,"Prove that \[ \lim_{n \to \infty} \frac{L_n}{\log n} = \frac{1}{\pi} \] where \[ L_n = 1 + \left(\frac{1}{2}\right)^2 + \left(\frac{1}{2} \cdot \frac{3}{4}\right)^2 + \cdots + \left(\frac{1}{2} \cdot \frac{3}{4} \cdots \frac{2n-1}{2n}\right)^2 \] It is known that the terms $\frac{1}{2}, \frac{1}{2} \cdot \frac{3}{4}, \ldots$ are the coefficients of the binomial series for $\frac{1}{\sqrt{1-x}}$. Any assistance would be greatly appreciated.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (L : ℕ → ℝ) (hL : ∀ n, L n = ∑ i ∈ range n, ((∏ j ∈ range i, (2 * j + 1) / (2 * (j + 1))) ^ 2)) : Tendsto (λ n => L n / Real.log n) atTop (𝓝 (1 / Real.pi)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-18843,"Let $a$ be an irrational number. Define the set $A = \{a2^n - [a2^n] \mid n \in \mathbb{N}\}$. Is the set $A$ dense in the interval $[0,1]$? Prove or disprove.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem closure_of_A (a : ℝ) (ha : Irrational a) : closure {x | ∃ n : ℕ, x = a * 2 ^ n - ⌊a * 2 ^ n⌋ ∧ x ∈ Set.Icc 0 1} = Set.Icc 0 1 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-19319,"Prove that for an odd prime number \(p\), the values of \(n\) that satisfy the equation \(n + p^{2021} = p^k\) (\(k\) is a positive integer) and make the binomial coefficient \(\binom{2n}{n}\) a multiple of \(p^{2022}\) are of the form \(n = p^k - p^{2021}\) for \(k \geq 4043\).","import Mathlib theorem Nat.choose.mod {p : ℕ} (hp : Odd p ∧ Nat.Prime p) (k : ℕ) (hk : k > 0) (n : ℕ) (h : n + p^2021 = p^k) : p^2022 ∣ Nat.choose (2 * n) n ↔ ∃ m, n = p^m - p^2021 ∧ m ≥ 4043 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-19320,"Prove that if $p$ is a prime number and a subset $S$ of $\{1,2,\cdots,p - 1\}$ is called good if for every $x, y \in S$ (not necessarily distinct), the product $xy \pmod{p}$ is also in $S$, then the number of good subsets of $\{1,2,\cdots,p - 1\}$ is $\tau(p - 1)+1$, where $\tau(n)$ denotes the number of positive divisors of $n$.","import Mathlib theorem prove {p : ℕ} (hp : Nat.Prime p) : Set.ncard {S : Finset ℕ | S ⊆ Finset.Icc 1 (p - 1) ∧ ∀ x ∈ S, ∀ y ∈ S, (x * y) % p ∈ S} = (p - 1).divisors.card + 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-19322,"Prove that the set of all integers \(n \geq 3\) such that for any two positive integers \(m < n - 1\) and \(r < n - 1\), there exist \(m\) distinct elements from the set \(\{1, 2, \ldots, n - 1\}\) whose sum is congruent to \(r\) modulo \(n\) is the set of all odd numbers \(n \geq 5\).","import Mathlib theorem SetOdd (n : ℕ) (hn : 3 ≤ n) : (∀ m r : ℕ, 0 < m → 0 < r → m < n - 1 → r < n - 1 → ∃ s : Finset ℕ, s ⊆ Finset.Icc 1 (n - 1) ∧ s.card = m ∧ ∑ i ∈ s, i ≡ r [ZMOD n]) ↔ Odd n ∧ 5 ≤ n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-19325,"Prove that the smallest positive integer \(n\) such that for any set \(A\) of \(n\) positive integers, there exists a subset \(S \subseteq A\) with exactly 15 elements, where the sum of the elements in \(S\) is a multiple of 15, is \(29\).","import Mathlib theorem algebra_476304 (n : ℕ) : IsLeast {x | 0 < x ∧ ∀ A : Finset ℕ, A.card = x ∧ (∀ a ∈ A, 0 < a) → ∃ S ⊆ A, S.card = 15 ∧ 15 ∣ ∑ s ∈ S, s} n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-19346,"Let \(a, b,\) and \(n\) be positive integers with \(a > b\) such that \(a^{2021} \mid n\), \(b^{2021} \mid n\), and \(2022 \mid a - b\). Prove that there exists a subset \(T\) of the set of positive divisors of \(n\) such that the sum of the elements of \(T\) is divisible by \(2022\) but not by \(2022^2\).","import Mathlib theorem qwen (a b n : ℕ) (_ : 0 < a) (h₀ : 0 < b) (h₁ : 0 < n) (h₂ : a > b) (h₃ : a^2021 ∣ n) (h₄ : b^2021 ∣ n) (h₅ : 2022 ∣ a - b) : ∃ T : Finset ℕ, (∀ t ∈ T, t ∣ n) ∧ (∑ t ∈ T, t) % 2022 = 0 ∧ ¬(∑ t ∈ T, t) % 2022^2 = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-19369,"Let \(a, b,\) and \(n\) be positive integers with \(a > b\) such that the following conditions are satisfied: i. \(a^{2021} \mid n\), ii. \(b^{2021} \mid n\), iii. \(2022 \mid a - b\). Prove that there exists a subset \(T\) of the set of positive divisors of \(n\) such that the sum of the elements of \(T\) is equal to \(2022\).","import Mathlib theorem qwen (a b n : ℕ) (_ : 0 < a) (hb : 0 < b) (hn : 0 < n) (h : a > b) (h1 : a^2021 ∣ n) (h2 : b^2021 ∣ n) (h3 : 2022 ∣ a - b) : ∃ T : Finset ℕ, (∀ t ∈ T, t ∣ n) ∧ ∑ t ∈ T, t = 2022 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-19371,"Let $a, b,$ and $n$ be positive integers with $a > b$ such that the following conditions are satisfied: i. $a^{2021} \mid n$, ii. $b^{2021} \mid n$, iii. $2022 \mid a - b$. Prove that there exists a subset $T$ of the set of positive divisors of $n$ such that if $S$ is the sum of the elements of $T$, then \(2022 \mid S\) but \(2022^2 \nmid S\).","import Mathlib theorem qwen (a b n : ℕ) (_ : 0 < a) (hb : 0 < b) (hn : 0 < n) (h1 : a > b) (h2 : a ^ 2021 ∣ n) (h3 : b ^ 2021 ∣ n) (h4 : 2022 ∣ a - b) : ∃ T : Finset ℕ, (∀ t ∈ T, t ∣ n) ∧ (∑ t ∈ T, t) % 2022 = 0 ∧ ¬(∑ t ∈ T, t) % 2022 ^ 2 = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-19455,"Prove that for a given positive integer \(r\), there exists an \(r\) - colouring of the natural numbers such that there is no monochromatic solution to the equation \(x + y = 3z\).","import Mathlib theorem for_given_r (r : ℕ) (hr : r > 0) : ∃ f : ℕ → Fin r, ¬∃ x y z, f x = f y ∧ f y = f z ∧ x + y = 3 * z := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-19941,"Let \(a_1, a_2, \ldots, a_n\) be a sequence of positive integers, and let \(k\) be the total number of distinct prime factors of the product \(a_1 a_2 \cdots a_n\). Prove that if \(n \ge 2^k\), there exists a consecutive subsequence \(a_i, a_{i + 1}, \ldots, a_j\) such that the product \(a_i a_{i + 1} \cdots a_j\) is a perfect square.","import Mathlib theorem Qwen (n : ℕ) (hn : 0 < n) (a : Fin n → ℕ) (ha : ∀ i, 0 < a i) (k : ℕ) (hk : k = (Nat.primeFactors (∏ i, a i)).card) (h : n ≥ 2 ^ k) : ∃ i j, i ≤ j ∧ IsSquare (∏ x ∈ Finset.Icc i j, a x) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-20091,"Let $S$ be a set containing $2p - 1$ distinct positive integers, where $p$ is a prime number. Define $N$ as the number of subsets $A$ of $S$ that satisfy the following conditions: i) \(|A| = p\); ii) The sum of all elements in $A$ is not divisible by $p$. Prove that \(N\equiv 0\pmod{p}\).","import Mathlib theorem Qwen (p : ℕ) (hp : Nat.Prime p) (S : Finset ℕ) (hS : S.card = 2 * p - 1) (hS1 : ∀ x ∈ S, x > 0) : {A | A ⊆ S ∧ A.card = p ∧ ¬p ∣ ∑ x ∈ A, x}.ncard ≡ 0 [MOD p] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-20422,"Let $p$ and $n$ be positive integers with $p \geq 2$, and let $a$ be a real number such that $1 \leq a < a + n \leq p$. Prove that the set \[ \mathcal{S} = \left\{ \left\lfloor \log_{2} x \right\rfloor + \left\lfloor \log_{3} x \right\rfloor + \cdots + \left\lfloor \log_{p} x \right\rfloor \mid x \in \mathbb{R}, a \leq x \leq a + n \right\} \] has exactly $n + 1$ elements.","import Mathlib open Real Set open scoped BigOperators theorem sample_size (p : ℕ) (n : ℕ) (hn : 0 < n) (hp : 2 ≤ p) (a : ℝ) (ha : 1 ≤ a ∧ a < a + n ∧ a + n ≤ p) : {k : ℤ | ∃ x : ℝ, a ≤ x ∧ x ≤ a + n ∧ k = ∑ i ∈ Finset.Icc 2 p, ⌊logb i x⌋}.ncard = n + 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-20514,"Let $A$ be a subset of the set $X$ of all $2^n$ points in $n$-dimensional space, where each point has coordinates $(a_1, a_2, \ldots, a_n)$ with $a_i \in \{+1, -1\}$. Suppose that $|A| > \frac{2^{n+1}}{n}$. Prove that there exist three distinct points in $A$ that are the vertices of an equilateral triangle.","import Mathlib open Finset Real theorem EquilateralTriangle (n : ℕ) (hn : 0 < n) (A : Finset (EuclideanSpace ℝ (Fin n))) (hA : ∀ P ∈ A, ∀ i : Fin n, P i = 1 ∨ P i = -1) (hA' : A.card > 2 ^ (n + 1) / n) : ∃ P ∈ A, ∃ Q ∈ A, ∃ R ∈ A, P ≠ Q ∧ P ≠ R ∧ Q ≠ R ∧ dist P Q = dist P R ∧ dist Q R = dist P Q := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-20551,"Prove that if there are 23 individuals with integral weights \(a_1, a_2, \ldots, a_{23}\), and for any choice of one individual as the referee, the remaining 22 individuals can be divided into two teams of 11 players each such that the total weight of each team is equal, then \(a_1 = a_2=\cdots=a_{23}\).","import Mathlib theorem prove_weight (a : Fin 23 → ℤ) (h : ∀ r, ∃ s t : Finset (Fin 23), s ≠ t ∧ s ∪ t = Finset.univ \ {r} ∧ s.card = 11 ∧ t.card = 11 ∧ ∑ i ∈ s, a i = ∑ i ∈ t, a i) : ∀ i j, a i = a j := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-20583,"Let there be 23 individuals, each with an integral weight denoted by \(a_1, a_2, \ldots, a_{23}\). These individuals decide to form two teams of 11 players each, with one individual acting as the referee. Given that, regardless of who is chosen as the referee, the remaining 22 individuals can always be divided into two teams such that the total weight of each team is equal. Prove that \(a_1 = a_2 = \ldots = a_{23}\).","import Mathlib theorem weight_weight (a : Fin 23 → ℤ) (h : ∀ r, ∃ s1 s2 : Finset (Fin 23), s1 ≠ s2 ∧ s1 ∪ s2 = Finset.univ \ {r} ∧ s1.card = 11 ∧ s2.card = 11 ∧ ∑ i ∈ s1, a i = ∑ i ∈ s2, a i) : ∃ x, ∀ i, a i = x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-20664,"Prove that if $m$ is a non - negative integer, $k$ and $q$ are positive integers with $k > q$, and $\left\{a_i\right\}_{i = 0}^m$ is a sequence of nonzero real numbers such that \[ \lim_{x \to \infty} \frac{\ln \binom{kx}{qx}}{a_m x^m+\cdots + a_1 x + a_0}=1, \] then the ordered pair $\left(m,a_m\right)$ is $\left(1,k\log k - q\log q-(k - q)\log(k - q)\right)$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove (m : ℕ) (k q : ℕ) (hk : 0 < k) (hq : 0 < q) (hkm : k > q) (a : ℕ → ℝ) (ha : ∀ i ∈ Icc 0 m, a i ≠ 0) (h : Tendsto (λ x => (Real.log (Nat.choose (k * x) (q * x))) / (∑ i ∈ Icc 0 m, a i * x ^ i)) atTop (𝓝 1)) : m = 1 ∧ a m = k * Real.log k - q * Real.log q - (k - q) * Real.log (k - q) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-20813,"Prove that the number of ways to choose $\pm$ signs such that the expression $\pm 1 \pm 2 \pm \ldots \pm n = 0$ holds true, where $n$ is a positive integer, is given by \(f(n)=\frac{1}{2\pi} \int_0^{2\pi} \prod_{k=1}^n 2 \cos(kx) \, \text{d}x\).","import Mathlib open Real Set open scoped BigOperators theorem number_of_ways : ∀ n > 0, (Nat.card {s : Fin n → ℤ | (∀ i, s i = 1 ∨ s i = -1) ∧ (∑ i, s i * (i + 1)) = 0}) = (∫ x in (0)..(2 * π), ∏ k : Fin n, 2 * cos ((k + 1) * x)) / (2 * π) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-20814,"Define a sequence of integers $\{a_n\}$ by $a_0 = 1$ and $a_n = \sum_{k=0}^{n-1} \binom{n}{k} a_k$ for $n \geq 1$. Let $m$ be a positive integer, and $q$ and $r$ non - negative integers. Prove that: \[a_{2^m q + r} \equiv a_{2^{m-1} q + r} \pmod{2^m}.\]","import Mathlib open Finset theorem qwen {a : ℕ → ℤ} (ha0 : a 0 = 1) (han : ∀ n ≥ 1, a n = ∑ k ∈ range n, Nat.choose n k * a k) : ∀ m > 0, ∀ q r : ℕ, a (2 ^ m * q + r) ≡ a (2 ^ (m - 1) * q + r) [ZMOD 2 ^ m] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-21456,"Prove that given \(mn + 1\) positive integers \(a_1, a_2, \ldots, a_{mn+1}\), either there exists a subset of \(m + 1\) integers such that no two integers in this subset satisfy \(a_i \mid a_j\), or there exists a subset of \(n + 1\) integers such that \(a_{i1} < a_{i2} < \ldots < a_{in+1}\) and \(a_{i1} \mid a_{i2}, a_{i2} \mid a_{i3}, \ldots, a_{in} \mid a_{in+1}\).","import Mathlib theorem prove (m n : ℕ) (hm : 0 < m) (hn : 0 < n) (a : Fin (m * n + 1) → ℤ) (ha : ∀ i, 0 < a i) : (∃ s : Finset (Fin (m * n + 1)), s.card = m + 1 ∧ ∀ i ∈ s, ∀ j ∈ s, i ≠ j → ¬(a i ∣ a j)) ∨ (∃ t : Finset (Fin (m * n + 1)), t.card = n + 1 ∧ ∀ i ∈ t, ∀ j ∈ t, i ≠ j → a i < a j ∧ ∀ i ∈ t, ∀ j ∈ t, i ≠ j → a i ∣ a j) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-21547,"Prove that for positive integers $m$ and $n$, every subset $S$ of $\{1, 2, \ldots, 2^m n\}$ with $(2^m - 1)n + 1$ elements contains $m + 1$ numbers $a_0, a_1, \ldots, a_m$ such that $a_i \mid a_{i+1}$ for $i = 0, \ldots, m - 1$.","import Mathlib theorem Qwen (m n : ℕ) (hm : 0 < m) (hn : 0 < n) (S : Finset ℕ) (hS : S ⊆ Finset.Icc 1 (2 ^ m * n)) (hS1 : S.card = (2 ^ m - 1) * n + 1) : ∃ a : Fin (m + 1) → ℕ, (∀ i, a i ∈ S) ∧ (∀ i, a i ∣ a (i + 1)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-21854,"Prove that for any set \(A\) of \(3n + 1\) positive integers, it is possible to select a subset \(B\) of \(A\) containing \(n + 1\) elements such that the sum of any two distinct elements of \(B\) is not an element of \(B\).","import Mathlib theorem npos (n : ℕ) (A : Finset ℕ) (hA : A.card = 3 * n + 1) (hA1 : ∀ a ∈ A, a > 0) : ∃ B ⊆ A, B.card = n + 1 ∧ ∀ b ∈ B, ∀ c ∈ B, b ≠ c → ¬(∃ x ∈ B, x = b + c) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-21868,"Prove that the smallest positive integer \(n\) such that any set of \(n\) points in the Cartesian plane, all with integer coordinates, contains at least two points for which the square of the distance between them is a multiple of \(2016\) is \(n = 14113\).","import Mathlib theorem n : IsLeast {n | ∀ s : Finset (ℤ × ℤ), s.card = n → ∃ p ∈ s, ∃ q ∈ s, p ≠ q ∧ 2016 ∣ (p.1 - q.1)^2 + (p.2 - q.2)^2} 14113 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-21950,"Let \(t \leq n\) be nonnegative integers. Prove that \(\sum _{k}\left( -1\right) ^{k}\left( \begin{matrix} n-k\\ k\end{matrix} \right) \left( \begin{matrix} n-2k\\ t-k\end{matrix} \right)=1\), where \(0\leq k\leq \min \left\{ t,n-t\right\}\). A combinatorial proof is preferred.","import Mathlib open Finset theorem Nat.choose_eq_one (n : ℕ) (t : ℕ) (ht : t ≤ n) : ∑ k ∈ Icc 0 (min t (n - t)), (-1 : ℝ)^k * Nat.choose (n - k) k * Nat.choose (n - 2 * k) (t - k) = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-22035,"a. Prove that if $\frac{2017^k}{2} < n < 2017^k$ for some positive integer $k$, then $2017$ divides $\binom{2n}{n}$. b. Prove that the only positive integer $h > 1$ such that there exist positive integers $N$ and $T$ for which the sequence $(\binom{2n}{n})_{n > N}$ is periodic modulo $h$ with period $T$ is $h = 2$.","import Mathlib theorem a {k : ℕ} (hk : 0 < k) (n : ℕ) (hn : 2017 ^ k / 2 < n ∧ n < 2017 ^ k) : 2017 ∣ Nat.choose (2 * n) n := by sorry theorem b {h : ℕ} (hh : 1 < h) : (∃ N T : ℕ, 0 < N ∧ 0 < T ∧ ∀ n : ℕ, n > N → Nat.choose (2 * n) n ≡ Nat.choose (2 * (n + T)) (n + T) [MOD h]) ↔ h = 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-22060,"a. Prove that if $\frac{2017^k}{2} < n < 2017^k$ for some positive integer $k$, then $2017$ divides $\binom{2n}{n}$. b. Prove that the only positive integers $h > 1$ such that there exist positive integers $N$ and $T$ for which the sequence $(x_n)_{n > N}$ with $x_n=\binom{2n}{n}$ is periodic modulo $h$ with period $T$ are $h = 2$.","import Mathlib theorem proveA (k : ℕ) (hk : 0 < k) (n : ℕ) (hn : 2017 ^ k / 2 < n ∧ n < 2017 ^ k) : 2017 ∣ Nat.choose (2 * n) n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-22138,"Let $n$ be a positive integer, and let $x_1, x_2, \ldots, x_n$ be a sequence of $n$ real numbers. A sequence $a_1, a_2, \ldots, a_n$ is defined to be unimodular if each $a_i$ is $\pm 1$. Prove that \[ \sum_{\text{all unimodular sequences } a_1, a_2, \ldots, a_n} a_1 a_2 \ldots a_n (a_1x_1 + a_2x_2 + \cdots + a_nx_n)^n = 2^{n} n! \, x_1 x_2 \ldots x_n. \]","import Mathlib open Finset Real Nat theorem sum_unimodular {n : ℕ} (hn : 0 < n) (x : Fin n → ℝ) (unimodal : (Fin n → ℝ) → Prop) (hunimodal : ∀ a, unimodal a ↔ ∀ i, a i = 1 ∨ a i = -1) : ∑ᶠ a ∈ {a | unimodal a}, (∏ i, a i) * (∑ i, a i * x i) ^ n = 2 ^ n * n.factorial * ∏ i, x i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-22273,"Prove that in a mathematical competition where $n$ students solve $6$ problems, each of which has three possible answers, and for any two students, the number of problems for which they have the same answers is either $0$ or $2$, the maximum possible value of $n$ is \(18\).","import Mathlib theorem max_n (n : ℕ) (hn : n > 0) (a : Fin n → Fin 6 → Fin 3) (h : ∀ i j, i ≠ j → {k | a i k = a j k}.encard = 0 ∨ {k | a i k = a j k}.encard = 2) : n ≤ 18 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-22304,"Let $\{a_i\}_{i \geq 1}$ be a sequence of positive integers. Prove that for any positive integer $n$, there exist infinitely many positive integers $k$ such that there is no pair $(m, t)$ of positive integers with $m > n$ satisfying the equation: $$kn + a_n = tm(m+1) + a_m.$$","import Mathlib theorem q (a : ℕ → ℕ) (ha : ∀ i, 0 < a i) (n : ℕ) (hn : 0 < n) : ∀ N, ∃ k, k > N ∧ ¬∃ m t : ℕ, 0 < m ∧ 0 < t ∧ m > n ∧ k * n + a n = t * m * (m + 1) + a m := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-22353,"Let $(a_n)$ be a sequence of positive integers such that the first $k$ members $a_1, a_2, \ldots, a_k$ are distinct positive integers, and for each $n > k$, the number $a_n$ is the smallest positive integer that cannot be represented as a sum of several (possibly one) of the numbers $a_1, a_2, \ldots, a_{n - 1}$. Prove that $a_n = 2a_{n - 1}$ for all sufficiently large $n$.","import Mathlib theorem qwen {a : ℕ → ℕ} (ha : ∀ n, 0 < a n) (hdist : ∃ k, ∀ i ∈ Finset.Icc 1 k, a i > 0 ∧ ∀ j ∈ Finset.Icc 1 k, a i ≠ a j) (hnor : ∀ n > k, IsLeast {x | 0 < x ∧ ¬∃ s : Finset ℕ, x = ∑ i ∈ s, a i ∧ s ⊆ Finset.Icc 1 (n - 1)} (a n)) : ∃ N, ∀ n, N ≤ n → a n = 2 * a (n - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-22360,"Prove that all natural numbers \(n\) satisfy the condition that there exists a finite set \(S\) of natural numbers with \(|S| = n\) such that for every \(a \in S\), \(a\) divides the sum of the remaining elements of \(S\).","import Mathlib theorem number_theory_96019 (n : ℕ) : ∃ S : Finset ℕ, S.card = n ∧ ∀ a ∈ S, a ∣ ∑ x ∈ S \ {a}, x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-22383,"Prove that the maximum possible number of elements in a finite set $S$ of real numbers with the property that for any three distinct elements $x, y, z \in S$, at least one of the sums $x + y$, $x + z$, or $y + z$ is also an element of $S$ is $7$.","import Mathlib open Finset Real theorem max_num_elements {S : Finset ℝ} (hS : ∀ x ∈ S, ∀ y ∈ S, ∀ z ∈ S, x ≠ y ∧ y ≠ z ∧ z ≠ x → ∃ w ∈ S, w = x + y ∨ w = x + z ∨ w = y + z) : S.card ≤ 7 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-22416,"Prove that if each integer is colored with one of three distinct colors, then there exist two distinct integers of the same color whose difference is a perfect square.","import Mathlib theorem color_integers (f : ℤ → Fin 3) : ∃ x y, x ≠ y ∧ f x = f y ∧ ∃ n, n^2 = x - y := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-22701,"Let \(n\) be a positive integer. Prove that if \(2^{2n - 1}+1\) odd numbers are selected from the interval \((2^{2n},2^{3n})\), then there exist two of the selected numbers such that neither divides the square of the other.","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (s : Finset ℕ) (h₀ : s.card = 2 ^ (2 * n - 1) + 1) (h₁ : ∀ x ∈ s, Odd x) (h₂ : ∀ x ∈ s, 2 ^ (2 * n) < x ∧ x < 2 ^ (3 * n)) : ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ ¬(x ∣ y ^ 2) ∧ ¬(y ∣ x ^ 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-22874,"Let \(n\) be a positive integer. Prove that if \(2^{2n-1} + 1\) odd numbers are selected from the interval \((2^{2n}, 2^{3n})\), then there exist two of the selected numbers \(a\) and \(b\) such that \(a ot\mid b^2\) and \(b ot\mid a^2\).","import Mathlib theorem Qwen (n : ℕ) (hn : n > 0) (s : Finset ℕ) (h₀ : s.card = 2^(2*n - 1) + 1) (h₁ : ∀ x ∈ s, Odd x) (h₂ : ∀ x ∈ s, 2^(2*n) < x ∧ x < 2^(3*n)) : ∃ a ∈ s, ∃ b ∈ s, a ≠ b ∧ ¬(a ∣ b^2) ∧ ¬(b ∣ a^2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-23125,"Prove that for every bijection $f: \mathbb{Z} \to \mathbb{Z}$, there exist two bijections $g, h: \mathbb{Z} \to \mathbb{Z}$ such that $f = g + h$.","import Mathlib theorem Prove: ∀ f : (ℤ → ℤ) , Function.Bijective f -> ∃ (g h : ℤ → ℤ), Function.Bijective g ∧ Function.Bijective h ∧ f = g + h := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-23752,"Prove that there do not exist two disjoint subsets $A, B \subset \{1, 2, 3, \dots\}$ such that $A \cup B = \{1, 2, 3, \dots\}$, and the following conditions hold: 1. For all $a_1, a_2 \in A$ with $a_1 \neq a_2$, $a_1 + a_2 \in B$. 2. For all $b_1, b_2 \in B$ with $b_1 \neq b_2$, $b_1 b_2 \in A$.","import Mathlib theorem noDisjointUnionAB : ¬∃ A B : Set ℕ+, Disjoint A B ∧ A ∪ B = ⊤ ∧ (∀ a ∈ A, ∀ b ∈ A, a ≠ b → (a + b) ∈ B) ∧ (∀ b ∈ B, ∀ c ∈ B, b ≠ c → (b * c) ∈ A) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-23827,"(a) Prove that there exists a set \(S = \{1, 2, \ldots, 4n, 4n+2, 4n+4, \ldots, 8n\}\) of \(6n\) pairwise distinct positive integers such that the least common multiple of any two elements of \(S\) is no larger than \(32n^2\). (b) Prove that every set \(T\) of \(6n\) pairwise distinct positive integers contains two elements the least common multiple of which is larger than \(9n^2\).","import Mathlib theorem a (n : ℕ) : ∃ S : Finset ℕ, S ⊆ Finset.Icc 1 (8 * n) ∧ S.card = 6 * n ∧ ∀ x ∈ S, ∀ y ∈ S, x ≠ y → Nat.lcm x y ≤ 32 * n ^ 2 := by sorry theorem b (n : ℕ) (T : Finset ℕ) (hT : T ⊆ Finset.Icc 1 (8 * n)) (hT1 : T.card = 6 * n) : ∃ x ∈ T, ∃ y ∈ T, x ≠ y ∧ Nat.lcm x y > 9 * n ^ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-23836,"(a) Prove that there exists a set \(S\) of \(6n\) pairwise distinct positive integers such that for any two elements \(a,b\in S\), \(\text{lcm}(a,b)\leq 32n^2\). (b) Prove that for every set \(T\) of \(6n\) pairwise distinct positive integers, there exist two elements \(a,b\in T\) such that \(\text{lcm}(a,b)> 9n^2\).","import Mathlib theorem a (n : ℕ) : ∃ S : Finset ℕ, S.card = 6 * n ∧ (∀ x ∈ S, x > 0) ∧ (∀ a ∈ S, ∀ b ∈ S, a ≠ b → Nat.lcm a b ≤ 32 * n ^ 2) := by sorry theorem b (n : ℕ) (T : Finset ℕ) (hT : T.card = 6 * n) (hT1 : ∀ x ∈ T, x > 0) : ∃ a ∈ T, ∃ b ∈ T, a ≠ b ∧ Nat.lcm a b > 9 * n ^ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-23888,"(a) Prove that there exists a set \(S\) of \(6n\) pairwise distinct positive integers such that the least common multiple of any two elements of \(S\) is no larger than \(32n^2\). (b) Prove that every set \(T\) of \(6n\) pairwise distinct positive integers contains two elements the least common multiple of which is larger than \(9n^2\).","import Mathlib theorem a (n : ℕ) : ∃ S : Finset ℕ, S.card = 6 * n ∧ (∀ x ∈ S, x > 0) ∧ (∀ x ∈ S, ∀ y ∈ S, x ≠ y → Nat.lcm x y ≤ 32 * n ^ 2) := by sorry theorem b (n : ℕ) (T : Finset ℕ) (hT : T.card = 6 * n ∧ (∀ x ∈ T, x > 0)) : ∃ x ∈ T, ∃ y ∈ T, x ≠ y ∧ Nat.lcm x y > 9 * n ^ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-24038,"Let $f: \mathbb{R} \rightarrow [0, +\infty[$ be a function such that the set $\{f(x_1) + f(x_2) + \cdots + f(x_n) \mid x_1, x_2, \ldots, x_n \in \mathbb{R}, n \in \mathbb{N}\}$ is bounded. Prove that there exists a countable set $N \subset \mathbb{R}$ such that $N$ is countable and $f(x) = 0$ for all $x \notin N$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem countable_set (f : ℝ → ℝ) (h₀ : ∀ x, f x ≥ 0) (h₁ : ∃ B, ∀ n : ℕ, ∀ x : Fin n → ℝ, (∑ i : Fin n, f (x i)) ≤ B) : ∃ N : Set ℝ, Countable N ∧ ∀ x, x ∉ N → f x = 0 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-24214,"Prove that the cardinality of the set of all dense subsets of $\mathbb{R}$, where a dense subset $S \subseteq \mathbb{R}$ is defined as a subset whose closure equals $\mathbb{R}$ (i.e., $\bar{S} = \mathbb{R}$), is $card(\mathcal{P}(\mathbb{R}))$.","import Mathlib open Set Real theorem card_dense : {S : Set ℝ | closure S = univ}.ncard = 2 ^ (univ : Set ℝ).ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-24254,"Prove that there does not exist a finite set \(M\) of nonzero real numbers such that for any natural number \(n\), there is a polynomial of degree at least \(n\) with coefficients in \(M\), all of whose roots are real and belong to \(M\).","import Mathlib theorem Proven : ¬∃ M : Set ℝ, M.Finite ∧ (∀ m ∈ M, m ≠ 0) ∧ ∀ n : ℕ, ∃ P : Polynomial ℝ, P.degree ≥ n ∧ ∀ c ∈ P.coeffs, c ∈ M ∧ ∀ r ∈ P.roots, ∃ t : ℝ, r = t ∧ t ∈ M := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-24811,"Prove that the largest integer \(n\) for which there exist \(n\) real numbers \(x_1, x_2, \ldots, x_n\) such that the inequality \(|x_i - x_j| > \frac{1}{100}(1 + x_i x_j)\) holds for all distinct indices \(i\) and \(j\) is \(n = 315\).","import Mathlib open Real Set open scoped BigOperators theorem max_n : IsGreatest { n | ∃ x : Fin n → ℝ, ∀ i j, i ≠ j → |x i - x j| > (1 / 100) * (1 + x i * x j) } 315 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-24989,"Let $S$ be a set with $n$ elements, and let $*$ be a binary operation on $S$ satisfying the following properties for all $x, y \in S$: 1. $x * y \in S$, 2. $x * y = y * x$, 3. $x * x = x$, 4. If $x \neq y$, then $x * y \neq x$. Prove that there exists a subset $X \subseteq S$ such that: (i) $|X| \ge \frac{\sqrt{n}}{2}$, (ii) For all $x, y \in X$ with $x \neq y$, $x * y \notin X$.","import Mathlib theorem algebraic_750603 {S : Type*} [Mul S] [Fintype S] (hS : ∀ x y : S, x * y ∈ Set.univ) (hS' : ∀ x y : S, x * y = y * x) (hS'' : ∀ x : S, x * x = x) (hS''' : ∀ x y : S, x ≠ y → x * y ≠ x) : ∃ X : Set S, X.ncard ≥ Real.sqrt (Nat.card S) / 2 ∧ (∀ x ∈ X, ∀ y ∈ X, x ≠ y → ¬(x * y ∈ X)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-25090,"Prove that for a nonnegative integer \(n\), where the function \(P_n(x)\) is defined as \(P_n(x)=\frac{1}{n!}e^x\left(\frac{d}{dx}\right)^n(x^ne^{-x})\), the integral \(\int_0^{\infty}P_m(x)P_n(x)e^{-x}\,dx\) equals \(\delta_{m,n}\), where \(\delta_{m,n}=\begin{cases}1 & \text{if } m = n\\0 & \text{if } m\neq n\end{cases}\). Alternatively, prove the combinatorial identity \(\sum_{j = 0}^m\sum_{k = 0}^n(-1)^{j + k}\binom{m}{j}\binom{n}{k}\binom{j + k}{j}=\delta_{m,n}\). Alternatively, prove the matrix identity \(\begin{bmatrix}1&&&&\\1&-1&&&\\1&-2&1&&\\1&-3&3&-1&\\\vdots&&&&\ddots\end{bmatrix}\begin{bmatrix}1&1&1&1&\cdots\\1&2&3&4&\cdots\\1&3&6&10&\cdots\\1&4&10&20&\cdots\\ \vdots&\vdots&\vdots&\vdots&\ddots\end{bmatrix}\begin{bmatrix}1&1&1&1&\cdots\\&-1&-2&-3&\\&&1&3&\\&&&-1&\\&&&&\ddots\end{bmatrix}=I\), where \(I\) is the identity matrix. These are three equivalent formulations of the same problem.","import Mathlib open Real theorem Matrix_Identity (m n : ℕ) : (∑ j in Finset.Icc 0 m, ∑ k in Finset.Icc 0 n, (-1 : ℝ)^(j + k) * Nat.choose m j * Nat.choose n k * Nat.choose (j + k) j) = if m = n then 1 else 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-25196,"Prove that for the function \(p(x,t)=\frac{1}{1 - t(1-\sqrt{1 - 4x})}\cdot\frac{1}{\sqrt{1 - 4x}}=\sum_{k,j}p_{k,j}x^kt^j\), the coefficients \(p_{k,j}\) are given by \(p_{k,j}=2^{j - 3}\binom{2k+2 - j}{k}\).","import Mathlib open Real theorem p (x t : ℝ) (ht : t ∈ Set.Ioo (-1) 0) : ∑' k : ℕ, ∑' j : ℕ, (2 ^ (j - 3) * Nat.choose (2 * k + 2 - j) k) * x ^ k * t ^ j = 1 / (1 - t * (1 - sqrt (1 - 4 * x))) / sqrt (1 - 4 * x) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-25260,"Prove that if $S$ is a subset of $\{1,2,\ldots,2013\}$ containing 75 elements, such that for any $x, y \in S$, there exists an element $z \in S$ satisfying $z \equiv xy + x + y \pmod{2013}$, and for all $x \in S$, $x + 1$ is relatively prime to 2013, then the minimum element in $S$ is 15.","import Mathlib theorem min_s (S : Finset ℕ) (hS : S ⊆ Finset.Icc 1 2013) (hS1 : S.card = 75) (hS2 : ∀ x ∈ S, ∀ y ∈ S, ∃ z ∈ S, z ≡ x * y + x + y [MOD 2013]) (hS3 : ∀ x ∈ S, Nat.Coprime (x + 1) 2013) : IsLeast S 15 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-25373,"Prove that for all integers \(n, k, m > 1\), at least one of the binomial coefficients \(\binom{n}{k}\), \(\binom{n + 1}{k}\), \(\cdots\), \(\binom{n + k}{k}\) is not divisible by \(m\).","import Mathlib theorem prove (n k m : ℕ) (hn : 1 < n) (hk : 1 < k) (hm : 1 < m) : ∃ i ∈ Finset.Icc n (n + k), ¬(m ∣ Nat.choose i k) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-25433,"Prove that for every function $f: \mathbb{Q} \to \mathbb{Q}$, there exist injective functions $g, h: \mathbb{Q} \to \mathbb{Q}$ such that $f(x) = g(x) + h(x)$ for all $x \in \mathbb{Q}$.","import Mathlib theorem algebra.immutable (f : ℚ → ℚ) : ∃ g h : ℚ → ℚ, Function.Injective g ∧ Function.Injective h ∧ ∀ x, f x = g x + h x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-26228,"Let $S$ be a finite set of positive integers with the property that for every positive integer $k$, there exist $a, b \in S$ such that $\gcd(a+k, b+k) > 1$. Given that the sum of the elements of $S$ is $2003$, prove that it is possible to remove one element from $S$ such that the resulting set still satisfies the property that for every positive integer $k$, there exist $a, b$ in the resulting set such that $\gcd(a + k, b + k) > 1$.","import Mathlib theorem Qwen (S : Finset ℕ) (hS : ∀ x ∈ S, x > 0) (hS' : ∀ k > 0, ∃ a ∈ S, ∃ b ∈ S, Nat.gcd (a + k) (b + k) > 1) (hS'' : ∑ x ∈ S, x = 2003) : ∃ x ∈ S, ∃ S' : Finset ℕ, S' = S \ {x} ∧ (∀ k > 0, ∃ a ∈ S', ∃ b ∈ S', Nat.gcd (a + k) (b + k) > 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-26264,"Prove that for an even positive integer $n$, it is possible to place all numbers from $1$ to $n^2$ into the squares of an $n \times n$ chessboard, with each number appearing exactly once, such that if $S_1$ denotes the sum of the numbers placed on the black squares and $S_2$ denotes the sum of the numbers placed on the white squares, then $\frac{S_1}{S_2} = \frac{39}{64}$ if and only if $n = 103k$ for any positive integer $k$.","import Mathlib open Finset theorem prove (n : ℕ) (hn : Even n) : (∃ S1 S2 : ℕ, S1 + S2 = ∑ i ∈ Icc 1 (n ^ 2), i ∧ S1 * 64 = S2 * 39) ↔ ∃ k : ℕ, 0 < k ∧ n = 103 * k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-26268,"Prove that there exist $504$ subsets $(X_i)_{i = 1,2,\ldots,504}$ of the set $X=\{1,2,\ldots,2014\}$ such that for each $i$, $|X_i| = 6$, and for all $i\neq j$, $|X_i\cap X_j|\leq 1$.","import Mathlib theorem prove : ∃ s : Finset (Finset ℕ), s.card = 504 ∧ (∀ t ∈ s, t ⊆ Finset.Icc 1 2014 ∧ t.card = 6) ∧ (∀ t ∈ s, ∀ u ∈ s, t ≠ u → (t ∩ u).card ≤ 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-26336,"Let \(n\) be a positive integer, and let \(a_1, a_2, \dots, a_n\) be real numbers such that \(0 < a_i < 1\) for all \(1 \leq i \leq n\). For any subset \(S\) of \(\{1, 2, \dots, n\}\), define \[ f(S) = \prod_{i \in S} a_i \cdot \prod_{j \not\in S} (1 - a_j). \] Prove that if \(\sum_{|S| \text{ odd}} f(S) = \frac{1}{2}\), where the sum is taken over all subsets \(S\) of \(\{1, 2, \dots, n\}\) with an odd number of elements, then there exists an index \(k\) such that \(a_k = \frac{1}{2}\).","import Mathlib open Finset Real theorem qwen (n : ℕ) (hn : 0 < n) (a : Fin n → ℝ) (ha : ∀ i : Fin n, 0 < a i ∧ a i < 1) (f : Finset (Fin n) → ℝ) (hf : ∀ S : Finset (Fin n), f S = ∏ i ∈ S, a i * ∏ j ∈ (Finset.univ \ S), (1 - a j)) (hsum : ∑ᶠ S ∈ {S | Odd (S.card)}, f S = 1 / 2) : ∃ k : Fin n, a k = 1 / 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-26949,"Prove that the number of harmonic sets (a set of natural numbers that does not contain three numbers \(a\), \(b\), and \(c\) such that \(\gcd(a,b)=\gcd(b,c)=\gcd(c,a) = 1\)) that are subsets of \(\{1, 2, 3, \ldots, 15, 16\}\) is \(3820\).","import Mathlib def is_harmonic (s : Finset ℕ) := ¬∃ a ∈ s, ∃ b ∈ s, ∃ c ∈ s, a ≠ b ∧ b ≠ c ∧ c ≠ a ∧ Nat.gcd a b = 1 ∧ Nat.gcd b c = 1 ∧ Nat.gcd c a = 1 theorem count_harmonic : Set.ncard {s | s ⊆ Finset.Icc 1 16 ∧ is_harmonic s} = 3820 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-27311,"Prove that the maximum number \(n\) of pairwise - distinct non - empty subsets \(A_1,A_2,\ldots,A_n\) of the set \(H=\{1,2,3,\ldots,25\}\) such that for any \(1\leq i < j\leq n\), the intersection \(|A_i\cap A_j|\leq 2\) is \(\binom{25}{1}+\binom{25}{2}+\binom{25}{3}\).","import Mathlib open Finset theorem max_capacity_of_subset : IsGreatest {n | ∃(S : Finset (Finset ℕ)), S.card = n ∧ (∀ A ∈ S, A ⊆ Icc 1 25 ∧ A.Nonempty) ∧ ∀A ∈ S, ∀B ∈ S, A ≠ B → (A ∩ B).card ≤ 2 } (Nat.choose 25 1 + Nat.choose 25 2 + Nat.choose 25 3) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-27963,"Let $n$ be a positive integer and $F$ a finite set of integers satisfying the following conditions: 1. For every $x \in F$, there exist $y, z \in F$ such that $x = y + z$. 2. All sums of less than $n$ elements from $F$ are non - zero. Prove that $|F| \geq 2n + 2$.","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (F : Finset ℤ) (h1 : ∀ x ∈ F, ∃ y z : ℤ, y ∈ F ∧ z ∈ F ∧ x = y + z) (h2 : ∀ s : Finset ℤ, s ⊆ F ∧ s.card < n → ∑ x ∈ s, x ≠ 0) : F.card ≥ 2 * n + 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-28033,"Prove by combinatorial reasoning that for all $n > 1$, $n \in \mathbb{N}$, \[ \prod_{i=1}^{n} \binom{n}{i} \leq \left( \frac{2^n - 2}{n - 1} \right)^{n-1}. \]","import Mathlib open Finset Real Nat theorem prod_le_power (n : ℕ) (hn : 1 < n) : ∏ i ∈ Icc 1 n, Nat.choose n i ≤ ((2 ^ n - 2) / (n - 1)) ^ (n - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-28079,"Prove that if $p$ and $q$ are relatively prime positive integers and a subset $S$ of $\{0, 1, 2, \ldots\}$ is called ideal if $0 \in S$ and for each element $n \in S$, the integers $n + p$ and $n + q$ also belong to $S$, then the number of ideal subsets of $\{0, 1, 2, \ldots\}$ is $\frac{1}{p+q}\binom{p+q}{q}$.","import Mathlib theorem IdealSet (p q : ℕ) (hp : 0 < p) (hq : 0 < q) (hrel : Nat.Coprime p q) : Set.ncard {S : Set ℕ | 0 ∈ S ∧ ∀ n ∈ S, n + p ∈ S ∧ n + q ∈ S} = (Nat.choose (p + q) q) / (p + q) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-28149,"Let \(r_1, r_2, r_3\) be three nonnegative real numbers written on a blackboard, with the property that there exist integers \(a_1, a_2, a_3\), not all zero, such that \(a_1r_1 + a_2r_2 + a_3r_3 = 0\). We are allowed to perform the following operation: select two numbers \(x, y\) on the blackboard with \(x \le y\), then replace \(y\) with \(y - x\). Prove that after a finite number of such operations, it is possible to end up with at least one \(0\) on the blackboard.","import Mathlib theorem prove (r : Fin 3 → ℝ) (hr : ∀ i, 0 ≤ r i) (h : ∃ a : Fin 3 → ℤ, ¬(∀ i, a i = 0) ∧ a 0 * r 0 + a 1 * r 1 + a 2 * r 2 = 0) : ∃ n : ℕ, ∃ x : Fin 3 → ℝ, (∀ i, 0 ≤ x i) ∧ (∃ i, x i = 0) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-28173,"Let $p$ and $q$ be relatively prime positive integers. A subset $S$ of $\{0, 1, 2, \ldots\}$ is called [b]ideal[/b] if $0 \in S$ and for each element $n \in S$, the integers $n + p$ and $n + q$ also belong to $S$. Prove that the number of ideal subsets of $\{0, 1, 2, \ldots\}$ is $\frac{1}{p+q}\binom{p+q}{p}$.","import Mathlib def IsIdeal (p q : ℕ) (S : Set ℕ) : Prop := 0 ∈ S ∧ ∀ n ∈ S, (n + p) ∈ S ∧ (n + q) ∈ S theorem IdealSet {p q : ℕ} (hp : 0 < p) (hq : 0 < q) (hrel : Nat.Coprime p q) : Set.ncard {S | IsIdeal p q S} = (Nat.choose (p + q) p) / (p + q) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-28425,"Prove that if $E_1$ and $E_2$ are measurable subsets of $\mathbb{R}^1$ with $|E_1| > 0$ and $|E_2| > 0$, then the set $\{ x \in \mathbb{R}^1 : x = x_1 - x_2, x_1 \in E_1, x_2 \in E_2\}$ contains an open interval of positive length.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove_measurable_set (E1 E2 : Set ℝ) (hE1 : MeasureTheory.volume E1 > 0) (hE2 : MeasureTheory.volume E2 > 0) : ∃ x y, x < y ∧ ∀ t ∈ Set.Ioo x y, ∃ a b, a ∈ E1 ∧ b ∈ E2 ∧ t = a - b := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-28620,"a) Prove that the set of all functions from $\mathbb{N}$ to $\mathbb{N}$ is uncountable. b) Prove or disprove: If $f: \mathbb{R} \to \mathbb{R}$ is differentiable and $c \in \mathbb{R}$, then there exist $a, b \in \mathbb{R}$ with $a < c < b$ such that $f'(c) = \frac{f(b) - f(a)}{b - a}$. c) Prove or disprove: The series $\sum_{n=1}^{\infty} \frac{(-1)^n}{\sqrt[n]{n}}$ converges. d) Prove or disprove: No at most countable subset of $\mathbb{R}$, other than the empty set, is open with respect to the standard metric. e) Prove or disprove: If $(f_n)$ is a sequence of differentiable functions $f_n: [-1,1] \to \mathbb{R}$ and $f_n$ converges uniformly to $f: [-1,1] \to \mathbb{R}$, then $f$ is differentiable. f) Prove or disprove: If $f: \mathbb{R} \to \mathbb{R}$ is differentiable and $f'$ is continuous at all $x \neq 0$, then $f'$ is continuous at $0$. g) Prove or disprove: If $f$ is a bounded real - valued function on $[a,b]$ such that $f^2$ is Riemann integrable, then $f$ is Riemann integrable. h) Prove or disprove: If $f$ and $g$ are twice differentiable on $(a,b)$ and $f'' = g''$ on $(a,b)$, then there exists a constant $c$ such that $f(x) = g(x) + c$ for all $x \in (a,b)$. i) Prove or disprove: If $(x_n)$ is a sequence of real numbers that converges to $x \in \mathbb{R}$, then the set $\{x\} \cup \{x_n : n \in \mathbb{N}\}$ is compact. j) Prove or disprove: If the power series $\sum_{n=0}^{\infty} a_n x^n$ has a finite radius of convergence $R > 0$, and $f(x) = \sum_{n=0}^{\infty} a_n x^n$ converges for $x = -R$ and $x = R$, then $f(x)$ is Riemann integrable on $[-R, R]$.","import Mathlib open Set Real theorem prove_a : ¬ Countable (Set.univ : Set (ℕ → ℕ)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-28655,"1) Prove that for all real numbers \(x_1, x_2, \ldots, x_n\), the following inequality holds: \[ \sum_{i=1}^n \sum_{j=1}^n ij \cos{(x_i - x_j)} \geq 0. \] 2) Prove that in a triangle \(ABC\) with circum - circle \(K\), if \(k_1, k_2, k_3\) are circles that are internally tangent to \(K\) at points \(A_1, B_1, C_1\) and to the sides \(BC, CA, AB\) at points \(A_2, B_2, C_2\) respectively, such that \(A\) and \(A_1\) are in different half - planes with respect to \(BC\), \(B\) and \(B_1\) are in different half - planes with respect to \(CA\), and \(C\) and \(C_1\) are in different half - planes with respect to \(AB\), and the lines \(A_1A_2, B_1B_2, C_1C_2\) intersect \(K\) again at points \(A', B', C'\), then the angles of triangle \(A'B'C'\) can be determined in terms of the angles of triangle \(ABC\). 3) Prove that in a country with 2 airlines, if 6 cities are connected in pairs by round - trip flights operated by exactly one of the two airlines, then there exist 4 cities \(A, B, C, D\) such that each of the routes \(A \leftrightarrow B\), \(B \leftrightarrow C\), \(C \leftrightarrow D\), and \(D \leftrightarrow A\) is operated by the same airline. 4) Prove that for an integer \(n\geq2\), the sets \(A\) of \(n\) integers such that the sum of the elements of any non - empty subset of \(A\) is not divisible by \(n + 1\) are those sets \(A=\{a_1,a_2,\ldots,a_n\}\) where \(a_i\equiv k\pmod{n + 1}\) for some fixed \(k\in\{1,2,\ldots,n\}\).","import Mathlib open Real Set open scoped BigOperators theorem sum_of_products (n : ℕ) (hn : 0 < n) (x : Fin n → ℝ) : ∑ i : Fin n, ∑ j : Fin n, (i+1) * (j+1) * cos (x i - x j) ≥ 0 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-28768,"Let \(A_1, A_2, \ldots, A_n\) be \(n\) nonempty subsets of the set \(\{1, 2, \ldots, n - 1\}\). Prove that \[ \sum_{1 \leq i < j \leq n} \frac{|A_i \cap A_j|}{|A_i| \cdot |A_j|} \geq 1. \]","import Mathlib theorem Finset.sum' {n : ℕ} (hn : 0 < n) (A : Fin n → Set ℕ) (hA : ∀ i, A i ⊆ Finset.Icc 1 (n - 1)) (hA' : ∀ i, A i ≠ ∅) : ∑ i, ∑ j, (if i < j then (A i ∩ A j).ncard / ((A i).ncard * (A j).ncard) else 0) ≥ 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-28799,"1. Prove that \( \lim_{n \to +\infty} \frac{1^1 + 2^2 + \cdots + n^n}{n^n} = 1 \). 2. Let \( f: \mathbb{N} \to \mathbb{N} \) be a bijective function. Prove that the series \( \sum_{n=1}^{+\infty} \frac{f(n)}{n^2} \) diverges positively. 3. Prove that \( \lim_{n \to +\infty} n! \det{\begin{pmatrix} 1 & 1 & \cdots & 1 \\ 1 & \frac{3}{2} & \cdots & 1 \\ \vdots & \vdots & \ddots & \vdots \\ 1 & 1 & \cdots & \frac{n+1}{n} \end{pmatrix}} \) and \( \lim_{n \to +\infty} (n - 2)! \det{\begin{pmatrix} 2 & 1 & \cdots & 1 \\ 1 & \frac{3}{2} & \cdots & 1 \\ \vdots & \vdots & \ddots & \vdots \\ 1 & 1 & \cdots & \frac{n+1}{n} \end{pmatrix}} \) (no final conclusion was given for these two limits in the assistant's answer, so we keep the original problem of finding the limits). 4. Let \( A = \{a_1, a_2, \ldots, a_n\} \) be a permutation of the set \( \{1, 2, 3, \ldots, n\} \). A descent in \( A \) is any index \( i \in \{1, 2, \ldots, n - 1\} \) for which \( a_i > a_{i+1} \). Prove that the number of sets \( A \) that have exactly one descent is [no final conclusion was given in the assistant's answer, so we keep the original problem of finding the number]. 5. Let \( n, a \) be positive integers. If \( n \) divides \( (a - 1)^{2009} \), prove that \( n \) also divides \( \frac{a^n - 1}{a - 1} \).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (f : ℕ → ℝ) (h₀ : ∀ n, f n = (∑ i in range n, (i + 1) ^ (i + 1)) / (n ^ n)) : Tendsto f atTop (𝓝 1) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-28804,"Let $A = \{A_1, \dots, A_m\}$ be a family of distinct subsets of $\{1, 2, \dots, n\}$, each with at most $\frac{n}{2}$ elements. Assume that for any $i \neq j$, $A_i \not\subset A_j$ and $A_i \cap A_j \neq \emptyset$. Prove that: \[ \sum_{i=1}^m \frac{1}{\binom{n-1}{|A_i|-1}} \leq 1 \]","import Mathlib open Finset Real Nat theorem sum_of_reciproals {n : ℕ} (hn : 0 < n) (A : Finset (Finset ℕ)) (hA : ∀ s ∈ A, s ⊆ Icc 1 n ∧ s.card ≤ n / 2) (hA' : ∀ i ∈ A, ∀ j ∈ A, i ≠ j → ¬(i ⊆ j) ∧ i ∩ j ≠ ∅) : ∑ s ∈ A, (1 / Nat.choose (n - 1) (s.card - 1)) ≤ 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-28934,"Let \(n \geq 3\) be an integer, and let \(x_0, x_1, \ldots, x_{n+1}\) be nonnegative real numbers such that \(x_0 = x_1 = 0\) and \(x_n = x_{n+1} = 1\). Prove that there exists an index \(j \in \{1, 2, \ldots, n\}\) for which \(|x_{j+1} + x_{j-1} - 2x_j| \geq \frac{4}{n^2}\).","import Mathlib theorem nge3 : ∀ (n : ℕ), n ≥ 3 → ∀ (x : ℕ → ℝ), (∀ i ∈ Finset.range (n + 1), 0 ≤ x i) ∧ x 0 = 0 ∧ x 1 = 0 ∧ x n = 1 ∧ x (n + 1) = 1 → ∃ j ∈ Finset.Icc 1 n, |x (j + 1) + x (j - 1) - 2 * x j| ≥ 4 / n ^ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-28999,Prove that the number of times the digit \(7\) appears in the decimal representation of the number \(4444^{4444}\) is \(1605\).,"import Mathlib theorem count_seven : {i | i ∈ Finset.range (Nat.digits 10 (4444 ^ 4444)).length ∧ (Nat.digits 10 (4444 ^ 4444))[i]! = 7}.ncard = 1605 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-29008,"Prove that there exist two disjoint, uncountable subsets of the irrationals such that each is dense in the reals and their union is the set of all irrationals.","import Mathlib theorem algebra_476901 : ∃ S T : Set ℝ, Disjoint S T ∧ ¬ Countable S ∧ ¬ Countable T ∧ Dense S ∧ Dense T ∧ (S ∪ T) = {x | Irrational x} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-29090,"Prove that if $X$ is an infinite compact metric space, then there exists a subset $D \subseteq X$ which is both dense and countable.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem InfiniteCompactMetricSpace {X : Type*} [MetricSpace X] [CompactSpace X] (hX : Infinite X) : ∃ D : Set X, Dense D ∧ Countable D := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-29129,"Prove that for $n$ distinct subsets $A_1, A_2, \ldots, A_n$ of the set $\{1, 2, \ldots, n\}$, there exists an element $x \in \{1, 2, \ldots, n\}$ such that the sets $A_1 \setminus \{x\}, A_2 \setminus \{x\}, \ldots, A_n \setminus \{x\}$ are also distinct.","import Mathlib theorem Prove (n : ℕ) (hn : 0 < n) (A : Fin n → Set ℕ) (hA : ∀ i j, A i = A j → i = j) (hA' : ∀ i, A i ⊆ Finset.Icc 1 n) : ∃ x ∈ Finset.Icc 1 n, ∀ i j, i ≠ j → (A i \ {x}) ≠ (A j \ {x}) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-29177,"Prove that for any natural number \(n \in \mathbb{N}\), the set \(\{1, 2, 3, \ldots, 2^{n+1}\}\) can be partitioned into two disjoint subsets \(A\) and \(B\) such that for all \(k\) where \(0 \le k \le n\), the following equality holds: \(\sum_{x \in A} x^k = \sum_{y \in B} y^k\).","import Mathlib theorem NatSet {n : ℕ} : ∃ A B : Finset ℕ, A ∪ B = Finset.Icc 1 (2 ^ (n + 1)) ∧ A ∩ B = ∅ ∧ ∀ k ∈ Finset.range (n + 1), ∑ x ∈ A, x ^ k = ∑ y ∈ B, y ^ k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-29967,"Prove that if $A_1, A_2, \ldots, A_{n+2}$ are non - empty subsets of $\{1, 2, \ldots, n\}$, then there exist non - empty, disjoint subsets $I, J \subset \{1, 2, \ldots, n+2\}$ such that \[ \bigcup_{k \in I} A_k = \bigcup_{k \in J} A_k \quad \text{and} \quad \bigcap_{k \in I} A_k = \bigcap_{k \in J} A_k. \]","import Mathlib theorem prove (n : ℕ) (hn : 0 < n) (A : Fin (n + 2) → Set ℕ) (hA : ∀ i, A i ≠ ∅ ∧ A i ⊆ Finset.Icc 1 n) : ∃ I J : Finset (Fin (n + 2)), I ≠ ∅ ∧ J ≠ ∅ ∧ I ∩ J = ∅ ∧ ⋃ k ∈ I, A k = ⋃ k ∈ J, A k ∧ ⋂ k ∈ I, A k = ⋂ k ∈ J, A k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-30083,"Prove that if a list of $\binom{m}{3}$ real numbers $a_{ijk}$ $(1 \le i < j < k \le m)$ is area - definite for $\mathbb{R}^2$, where a list is area definite for $\mathbb{R}^n$ if the inequality $\sum_{1 \le i < j < k \le m} a_{ijk} \cdot \text{Area}(\triangle A_iA_jA_k) \ge 0$ holds for every set of $m$ points $A_1, \dots, A_m$ in $\mathbb{R}^n$, then it is also area definite for $\mathbb{R}^3$.","import Mathlib open Real theorem prove_area_definite (m : ℕ) (hm : 0 < m) (a : Fin m → Fin m → Fin m → ℝ) (h : ∀ A : Fin m → EuclideanSpace ℝ (Fin 2), ∑ i : Fin m, ∑ j : Fin m, ∑ k : Fin m, (if (i < j ∧ j < k) then a i j k * (MeasureTheory.volume (convexHull ℝ {A i, A j, A k})).toReal else 0) ≥ 0) : ∀ A : Fin m → EuclideanSpace ℝ (Fin 3), ∑ i : Fin m, ∑ j : Fin m, ∑ k : Fin m, (if (i < j ∧ j < k) then a i j k * (MeasureTheory.volume (convexHull ℝ {A i, A j, A k})).toReal else 0) ≥ 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-30689,"Prove that if \(a\) is a positive integer and \(S(a)=\sum_{n = 1}^{\infty}\frac{\frac{1}{1}+\frac{1}{2}+\cdots+\frac{1}{n}}{\binom{n + a}{a}}\), and \(S(100)=\frac{p}{q}\) for relatively prime positive integers \(p\) and \(q\), then \(p + q=9901\).","import Mathlib open Finset Real theorem prove (a : ℕ) (ha : 0 < a) (S : ℕ → ℝ) (hS : ∀ x, S x = ∑' n : ℕ, (∑ i in Icc 1 n, (1 / i)) / Nat.choose (n + x) x) (p q : ℕ) (hp : p > 0) (hq : q > 0) (hrel : Nat.Coprime p q) (hS100 : S 100 = p / q) : p + q = 9901 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-32454,"Prove that for every integer \(n \ge 2\), there exist infinitely many positive integers \(m\) such that the set of \(n^2\) consecutive integers \(\{m+1, m+2, \ldots, m+n^2\}\) contains exactly \(n + 1\) Jane's integers, where a positive integer \(t\) is defined as a Jane's integer if it can be expressed as \(t = x^3 + y^2\) for some positive integers \(x\) and \(y\).","import Mathlib open Finset theorem prove (n : ℕ) (hn : 2 ≤ n) : ∀ N, ∃ m : ℕ, m > N ∧ {k | ∃ x y : ℕ, x > 0 ∧ y > 0 ∧ k = x ^ 3 + y ^ 2 ∧ m + 1 ≤ k ∧ k ≤ m + n ^ 2}.ncard = n + 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-33862,"Prove that for every \(n \geq 2\) in \(\mathbb{N}\), there exist \(n\) distinct sets of 3 elements such that the sum of the elements and the sum of their squares are constant. For example, for \(n = 2\), the sets \((6, 13, 8)\) and \((12, 10, 5)\) satisfy the conditions since \(6 + 13 + 8 = 12 + 10 + 5\) and \(6^2 + 13^2 + 8^2 = 12^2 + 10^2 + 5^2\).","import Mathlib theorem prove (n : ℕ) (hn : n ≥ 2) : ∃ s : Finset (Finset ℕ), s.card = n ∧ (∀ t ∈ s, t.card = 3) ∧ ∃ c1 c2 : ℤ, ∀ t ∈ s, ∑ i ∈ t, i = c1 ∧ ∑ i ∈ t, i^2 = c2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-35870,Let \(p = 65537\) be a prime number. Define \(A = p^{p - 1}-1\) and \(B=\frac{p^p - p^2 + p - 1}{(p - 1)^2}\). Prove that \(\binom{A}{B}\equiv \boxed{1} \mod p\).,"import Mathlib theorem Nat.choose_A_B {p : ℕ} (hp : Nat.Prime p) (hp1 : p = 65537) (A B : ℕ) (hA : A = p^(p - 1) - 1) (hB : B = (p^p - p^2 + p - 1)/(p - 1)^2) : Nat.choose A B ≡ 1 [MOD p] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-36211,"Let \(k\) be a positive integer such that \(k \equiv 1 \pmod{4}\) and \(k\) is not a perfect square. Define \(a = \frac{1 + \sqrt{k}}{2}\). Prove that the set \(\{\left \lfloor a^2 n \right \rfloor - \left \lfloor a \left \lfloor an \right \rfloor \right \rfloor : n \in \mathbb{N}_{>0}\}\) is equal to the set \(\{1, 2, \ldots, \left \lfloor a \right \rfloor\}\).","import Mathlib theorem qwen (k : ℕ) (hk : 0 < k) (hhk : k ≡ 1 [MOD 4]) (hknpsq : ¬ ∃ m, m^2 = k) : {x | ∃ n : ℕ, 0 < n ∧ x = ⌊((1 + Real.sqrt k) / 2)^2 * n⌋ - ⌊(1 + Real.sqrt k) / 2 * ⌊(1 + Real.sqrt k) / 2 * n⌋⌋} = Finset.Icc 1 ⌊(1 + Real.sqrt k) / 2⌋ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-36226,"Prove that for every positive integer \(n\), there exists a square permutation of the set \(\{0, 1, \ldots, n\}\), where a square permutation \(a_0, a_1, \ldots, a_n\) of the set \(\{0, 1, \ldots, n\}\) is defined such that \(k + a_k\) is a perfect square for each \(k = 0, 1, \ldots, n\).","import Mathlib open Finset theorem sqrt_perm (n : ℕ) (hn : 0 < n) : ∃ p : Equiv.Perm (Fin (n + 1)), (∀ k : Fin (n + 1), IsSquare (k + p k)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-37916,"Prove that for any integer \(n > 16\), there exists a set \(S\) containing \(n\) positive integers such that if a subset \(A\) of \(S\) satisfies the condition that for any \(a, a' \in A\) with \(a \neq a'\), \(a + a' \notin S\), then \(|A|\leq 4\sqrt{n}\).","import Mathlib theorem prove (n : ℕ) (hn : n > 16) : ∃ S : Finset ℕ, S.card = n ∧ (∀ s ∈ S, s > 0) ∧ (∀ A : Finset ℕ, A ⊆ S → (∀ a ∈ A, ∀ a' ∈ A, a ≠ a' → ¬(a + a' ∈ S)) → A.card ≤ 4 * Real.sqrt n) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-38026,"Prove that for any positive integers \(n\) and \(k\), there exist positive integers \(a > b > c > d > e > k\) such that \[n = \binom{a}{3} - \binom{b}{3} - \binom{c}{3} + \binom{d}{3} + \binom{e}{3}.\]","import Mathlib theorem prove (n k : ℕ) (hn : 0 < n) (hk : 0 < k) : ∃ a b c d e : ℕ, 0 < a ∧ 0 < b ∧ 0 < c ∧ 0 < d ∧ 0 < e ∧ a > b ∧ b > c ∧ c > d ∧ d > e ∧ e > k ∧ n = Nat.choose a 3 - Nat.choose b 3 - Nat.choose c 3 + Nat.choose d 3 + Nat.choose e 3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-38663,"1) Prove that for all real numbers \(x_1, x_2, \ldots, x_n\), the following inequality holds: \[ \sum_{i=1}^n \sum_{j=1}^n ij \cos{(x_i - x_j)} \geq 0. \] 2) Prove that in a triangle \(ABC\) with circum - circle \(K\), if \(k_1, k_2, k_3\) are circles that are internally tangent to \(K\) at points \(A_1, B_1, C_1\) and to the sides \(BC, CA, AB\) at points \(A_2, B_2, C_2\) respectively, such that \(A\) and \(A_1\) are in different half - planes with respect to \(BC\), \(B\) and \(B_1\) are in different half - planes with respect to \(CA\), and \(C\) and \(C_1\) are in different half - planes with respect to \(AB\), and the lines \(A_1A_2, B_1B_2, C_1C_2\) intersect \(K\) again at points \(A', B', C'\), then the angles of triangle \(A'B'C'\) can be determined in terms of the angles of triangle \(ABC\). 3) In a country with 2 airlines, 6 cities are connected in pairs by round - trip flights operated by exactly one of the two airlines. Prove that there exist 4 cities \(A, B, C, D\) such that each of the routes \(A \leftrightarrow B\), \(B \leftrightarrow C\), \(C \leftrightarrow D\), and \(D \leftrightarrow A\) is operated by the same airline. 4) Prove that for an integer \(n\geq2\), the sets \(A\) of \(n\) integers such that the sum of the elements of any non - empty subset of \(A\) is not divisible by \(n + 1\) can be found.","import Mathlib open Real Set open scoped BigOperators theorem inequalities (n : ℕ) (hn : 0 < n) (x : Fin n → ℝ) : ∑ i : Fin n, ∑ j : Fin n, (i+1)*(j+1)*cos (x i - x j) ≥ 0 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-38683,"1) Prove that for all real numbers \(x_1, x_2, \ldots, x_n\), the following inequality holds: \[ \sum_{i=1}^n \sum_{j=1}^n ij \cos{(x_i - x_j)} \geq 0. \] 2) Prove that in a triangle \(ABC\) with circum - circle \(K\), if \(k_1, k_2, k_3\) are circles that are internally tangent to \(K\) at points \(A_1, B_1, C_1\) and to the sides \(BC, CA, AB\) at points \(A_2, B_2, C_2\) respectively, such that \(A\) and \(A_1\) are in different half - planes with respect to \(BC\), \(B\) and \(B_1\) are in different half - planes with respect to \(CA\), and \(C\) and \(C_1\) are in different half - planes with respect to \(AB\), and the lines \(A_1A_2, B_1B_2, C_1C_2\) intersect \(K\) again at points \(A', B', C'\), then the angles of triangle \(A'B'C'\) are related to the angles of triangle \(ABC\) as follows: Let \(\angle A = \alpha\), \(\angle B=\beta\), \(\angle C = \gamma\), then \(\angle A'= 90^{\circ}-\frac{\alpha}{2}\), \(\angle B'=90^{\circ}-\frac{\beta}{2}\), \(\angle C'=90^{\circ}-\frac{\gamma}{2}\). 3) Prove that in a country with 2 airlines where 6 cities are connected in pairs by round - trip flights operated by exactly one of the two airlines, there exist 4 cities \(A, B, C, D\) such that each of the routes \(A \leftrightarrow B\), \(B \leftrightarrow C\), \(C \leftrightarrow D\), and \(D \leftrightarrow A\) is operated by the same airline. 4) Prove that for an integer \(n\geq2\), the sets \(A\) of \(n\) integers such that the sum of the elements of any non - empty subset of \(A\) is not divisible by \(n + 1\) are the sets \(A=\{a,a + 1,\cdots,a+(n - 1)\}\) where \(a\in\mathbb{Z}\) and the remainders of the elements of \(A\) modulo \(n + 1\) are distinct non - zero elements of \(\mathbb{Z}_{n + 1}\).","import Mathlib open Real Set open scoped BigOperators theorem inequalities (n : ℕ) (hn : 0 < n) (x : Fin n → ℝ) : ∑ i : Fin n, ∑ j : Fin n, (i+1)*(j+1)*cos (x i - x j) ≥ 0 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-38825,"Prove that if $X = \{1, 2, \ldots, n\}$ and $A_1, A_2, \ldots, A_k \subseteq X$ are subsets such that $|A_i| = 4$ for all $i = 1, 2, \ldots, k$ and $|A_i \cap A_j| \leq 2$ for all $i \neq j$, then the maximum value of $k$ is $\frac{\binom{n}{3}}{4}$.","import Mathlib theorem Finset.maxK {n : ℕ} (hn : 0 < n) (k : ℕ) (hk : 0 < k) (A : Fin k → Set ℕ) (hA : ∀ i, A i ⊆ Finset.Icc 1 n) (hA' : ∀ i j, i ≠ j → (A i ∩ A j).encard ≤ 2) (hA'' : ∀ i, (A i).encard = 4) : k ≤ Nat.choose n 3 / 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-39131,"Prove that if every point in the plane is colored with one of three distinct colors, then there necessarily exists a pair of points of the same color such that the distance between them is exactly \(1\).","import Mathlib theorem color_points (f : ℝ × ℝ → Fin 3) : ∃ x y, f x = f y ∧ dist x y = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-39174,"Prove that if every point in the plane is colored with one of three distinct colors, then for all positive real numbers \(d\), there necessarily exist a pair of points of the same color such that the distance between them is exactly \(d\).","import Mathlib theorem color_plane (f : (EuclideanSpace ℝ (Fin 2)) → Fin 3) : ∀ d > 0, ∃ p q, f p = f q ∧ dist p q = d := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-39416,"Let \(m_1, m_2, \ldots, m_{2013} > 1\) be 2013 pairwise relatively prime positive integers, and let \(A_1, A_2, \ldots, A_{2013}\) be 2013 (possibly empty) sets such that \(A_i \subseteq \{1, 2, \ldots, m_i - 1\}\) for \(i = 1, 2, \ldots, 2013\). Prove that there exists a positive integer \(N\) such that \[ N \le \left( 2\left\lvert A_1 \right\rvert + 1 \right)\left( 2\left\lvert A_2 \right\rvert + 1 \right)\cdots\left( 2\left\lvert A_{2013} \right\rvert + 1 \right) \] and for each \(i = 1, 2, \ldots, 2013\), there does not exist \(a \in A_i\) such that \(m_i\) divides \(N - a\).","import Mathlib theorem qwen (m : Fin 2013 → ℕ) (hm : ∀ i j, i ≠ j → Nat.Coprime (m i) (m j)) (hpos : ∀ i, 1 < m i) (A : Fin 2013 → Set ℕ) (hA : ∀ i, A i ⊆ Finset.Icc 1 (m i - 1)) : ∃ N : ℕ, 0 < N ∧ (∀ i, ¬∃ a ∈ A i, m i ∣ N - a) ∧ N ≤ ∏ i, (2 * (A i).ncard + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-39578,"Let \(m_1, m_2, \ldots, m_{2013} > 1\) be 2013 pairwise relatively prime positive integers, and let \(A_1, A_2, \ldots, A_{2013}\) be 2013 (possibly empty) sets such that \(A_i \subseteq \{1, 2, \ldots, m_i - 1\}\) for \(i = 1, 2, \ldots, 2013\). Prove that there exists a positive integer \(N\) such that \[ N \le \prod_{i = 1}^{2013} \left( 2\left\lvert A_i \right\rvert + 1 \right) \] and for each \(i = 1, 2, \ldots, 2013\), there does not exist \(a \in A_i\) such that \(m_i\) divides \(N - a\).","import Mathlib theorem number_theory_84649 {m : Fin 2013 → ℕ} (hm : ∀ i j, i ≠ j → Nat.Coprime (m i) (m j)) (hpi : ∀ i, 1 < m i) (A : Fin 2013 → Finset ℕ) (hA : ∀ i, A i ⊆ Finset.Icc 1 (m i - 1)) : ∃ N : ℕ, 0 < N ∧ N ≤ ∏ i : Fin 2013, (2 * (A i).card + 1) ∧ ∀ i : Fin 2013, ¬∃ a ∈ A i, m i ∣ N - a := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-39586,"Prove that if $E$ is the set of continuous functions $\varphi: [0,1] \to \mathbb{R}$, and $F$ is a subset of $E$ defined by the conditions: 1. $u(0) = u(1) = 0$, 2. $\int_0^1 u = 0$, 3. $\int_0^1 u = 1$, 4. $u$ is differentiable, 5. $u$ is strictly increasing, then the only function $\varphi \in E$ such that for all $u \in F$, $\int_0^1 u\varphi = 0$ is $\varphi \equiv 0$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove (φ : ℝ → ℝ) (hφ : ContinuousOn φ (Set.Icc 0 1)) (F : Set (ℝ → ℝ)) (hF : ∀ u ∈ F, DifferentiableOn ℝ u (Set.Icc 0 1)) (hF1 : ∀ u ∈ F, StrictMonoOn u (Set.Icc 0 1)) (hF2 : ∀ u ∈ F, u 0 = 0) (hF3 : ∀ u ∈ F, u 1 = 0) (hF4 : ∀ u ∈ F, ∫ x in (0)..1, u x = 0) (hF5 : ∀ u ∈ F, ∫ x in (0)..1, u x = 1) : (∀ u ∈ F, ∫ x in (0)..1, u x * φ x = 0) ↔ φ = 0 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-39827,"Let $X$ be a set of $10000$ integers, none of which are divisible by $47$. Prove that there exists a subset $Y$ of $X$ containing $2008$ elements such that for any $a, b, c, d, e \in Y$, the expression $a - b + c - d + e$ is not divisible by $47$.","import Mathlib theorem prove (X : Finset ℤ) (hX : X.card = 10000) (hX1 : ∀ x ∈ X, ¬(47 ∣ x)) : ∃ Y ⊆ X, Y.card = 2008 ∧ ∀ a ∈ Y, ∀ b ∈ Y, ∀ c ∈ Y, ∀ d ∈ Y, ∀ e ∈ Y, ¬(47 ∣ a - b + c - d + e) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-39969,"Let $p$ be a prime number and $G$ a commutative group with $2p$ elements. Let $a$ be an element of $G$ of order 2. a) Prove that there exists a subset $H \subset G$ with $p$ elements such that the product of the elements of $H$ is the identity element $e$ and $xy^{-1} \neq a$ for any $x, y \in H$. b) Prove that there are exactly $2^{p - 1}$ subsets $H \subset G$ that satisfy the conditions in part (a).","import Mathlib theorem PGroup {p : ℕ} (hp : Nat.Prime p) (G : Type*) [CommGroup G] [Fintype G] (hG : Fintype.card G = 2 * p) (a : G) (ha : orderOf a = 2) : (∃ H : Finset G, H.card = p ∧ ∏ x ∈ H, x = 1 ∧ ∀ x ∈ H, ∀ y ∈ H, x * y⁻¹ ≠ a) ∧ {H : Finset G | H.card = p ∧ ∏ x ∈ H, x = 1 ∧ ∀ x ∈ H, ∀ y ∈ H, x * y⁻¹ ≠ a}.encard = 2 ^ (p - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-40049,"Prove that for all \(n \in \mathbb{N}\), \((n+2)^{n} = \sum_{k=0}^{n} \binom{n}{k} (k+1)^{k} (n-k+1)^{n-k-1}\) using a combinatorial proof.","import Mathlib open Finset Real Nat theorem p : ∀ n : ℕ, (n + 2)^n = ∑ k ∈ Icc 0 n, Nat.choose n k * (k + 1)^k * (n - k + 1)^(n - k - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-40406,"Prove that if $X$ is a set of 10,000 integers, none of which is divisible by 47, then there exists a subset $Y$ of $X$ with 2007 elements such that for any $a, b, c, d, e \in Y$, the expression \(a - b + c - d + e\) is not divisible by 47.","import Mathlib theorem prove (X : Finset ℤ) (hX : X.card = 10000) (hX' : ∀ x ∈ X, ¬ 47 ∣ x) : ∃ Y ⊆ X, Y.card = 2007 ∧ ∀ a ∈ Y, ∀ b ∈ Y, ∀ c ∈ Y, ∀ d ∈ Y, ∀ e ∈ Y, ¬ 47 ∣ a - b + c - d + e := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-40407,"Let $X$ be a set of 10,000 integers, none of which is divisible by 47. Prove that there exists a subset $Y$ of $X$ with 2007 elements such that for any $a, b, c, d, e \in Y$, the expression $a - b + c - d + e$ is not divisible by 47.","import Mathlib theorem algebra_582231 (X : Finset ℤ) (hX : X.card = 10000) (hX' : ∀ x ∈ X, ¬47 ∣ x) : ∃ Y ⊆ X, Y.card = 2007 ∧ ∀ a ∈ Y, ∀ b ∈ Y, ∀ c ∈ Y, ∀ d ∈ Y, ∀ e ∈ Y, ¬47 ∣ a - b + c - d + e := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-40642,"1. Prove that if $A$ is a Lebesgue measurable subset of $\mathbb{R}$ with $m(A)>0$, then there exist distinct points $a, b \in A$ such that $|a - b| \in \mathbb{Q}$. 2. Prove that if $A$ and $B$ are Lebesgue measurable subsets of $\mathbb{R}$ with $m(A)>0$ and $m(B)>0$, then there exist distinct points $a \in A$ and $b \in B$ such that $|a - b| \in \mathbb{Q}$.","import Mathlib theorem MeasureTheory1 (A : Set ℝ) (hA : MeasurableSet A) (hA' : 0 < (MeasureTheory.volume A)) : ∃ a ∈ A, ∃ b ∈ A, a ≠ b ∧ ∃ q : ℚ, |a - b| = q := by sorry theorem MeasureTheory2 (A B : Set ℝ) (hA : MeasurableSet A) (hB : MeasurableSet B) (hA' : 0 < (MeasureTheory.volume A)) (hB' : 0 < (MeasureTheory.volume B)) : ∃ a ∈ A, ∃ b ∈ B, a ≠ b ∧ ∃ q : ℚ, |a - b| = q := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-40663,"Prove that the set of all sequences composed of the numbers \(1, 2, 3\) can be partitioned into \(3\) groups such that any two sequences within the same group coincide in infinitely many positions.","import Mathlib open Finset theorem prove : ∃ s1 s2 s3 : Set (ℕ → ℕ), s1 ∪ s2 ∪ s3 = {f | ∀ n, f n = 1 ∨ f n = 2 ∨ f n = 3} ∧ s1 ∩ s2 = ∅ ∧ s2 ∩ s3 = ∅ ∧ s3 ∩ s1 = ∅ ∧ (∀ f ∈ s1, ∀ g ∈ s1, f ≠ g → {n | f n = g n}.Infinite) ∧ (∀ f ∈ s2, ∀ g ∈ s2, f ≠ g → {n | f n = g n}.Infinite) ∧ (∀ f ∈ s3, ∀ g ∈ s3, f ≠ g → {n | f n = g n}.Infinite) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-40974,Let $(a_n)_{n \geq 1}$ be a sequence of positive terms such that $a_n \to 0$. Consider a sequence $(a_n')$ where each $a_n'$ is either $a_n$ or $0$. Prove that the set of all possible sums $\sum_{n=1}^{\infty} a_n'$ is uncountable.,"import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem uncountable {a : ℕ → ℝ} (ha : ∀ n, 0 < a n) (h : Tendsto a atTop (𝓝 0)) (a' : ℕ → ℝ) (ha' : ∀ n, a' n = a n ∨ a' n = 0) : ¬ Set.Countable {∑' n, a' n} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-41237,"Let \(k\) be a natural number. Suppose every natural number is colored in one of \(k\) colors. Prove that there exist four distinct natural numbers \(a, b, c, d\), all colored in the same color, such that \(ad = bc\), \(\frac{b}{a}\) is a power of 2, and \(\frac{c}{a}\) is a power of 3.","import Mathlib theorem colorful (k : ℕ) (f : ℕ → Fin k) : ∃ a b c d : ℕ, a ≠ b ∧ a ≠ c ∧ a ≠ d ∧ b ≠ c ∧ b ≠ d ∧ c ≠ d ∧ f a = f b ∧ f b = f c ∧ f c = f d ∧ a * d = b * c ∧ ∃ m n : ℕ, m > 0 ∧ n > 0 ∧ (b / a : ℚ) = 2 ^ m ∧ (c / a : ℚ) = 3 ^ n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-41413,"Let $A$ and $B$ be disjoint sets such that $A \cup B = \mathbb{N}$. Prove that for every natural number $n$, there exist distinct $a, b > n$ such that $\{a, b, a + b\}$ is a subset of either $A$ or $B$.","import Mathlib theorem NatSet {A B : Set ℕ} (hAB : A ∩ B = ∅) (hAUB : A ∪ B = ℕ) (n : ℕ) : ∃ a b : ℕ, a > n ∧ b > n ∧ a ≠ b ∧ (a ∈ A ∧ b ∈ A ∧ a + b ∈ A) ∨ (a ∈ B ∧ b ∈ B ∧ a + b ∈ B) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-41446,"Prove that it is possible to partition the set of all sequences composed of the numbers \(1, 2, 3\) into \(3\) groups such that any two sequences within the same group coincide in infinitely many positions.","import Mathlib theorem prove : ∃ s1 s2 s3 : Set (ℕ → ℕ), s1 ∪ s2 ∪ s3 = {f | ∀ n, f n = 1 ∨ f n = 2 ∨ f n = 3} ∧ s1 ∩ s2 = ∅ ∧ s2 ∩ s3 = ∅ ∧ s3 ∩ s1 = ∅ ∧ (∀ f ∈ s1, ∀ g ∈ s1, {n | f n = g n}.Infinite) ∧ (∀ f ∈ s2, ∀ g ∈ s2, {n | f n = g n}.Infinite) ∧ (∀ f ∈ s3, ∀ g ∈ s3, {n | f n = g n}.Infinite) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-41569,"Let \(X = \{1, 2, 3, \ldots, 1996\}\) and \(f: X \to X\) be a function such that \(f(f(f(f(f(x))))) = x\) for all \(x \in X\). Prove that there exists an \(x_0 \in X\) such that \(f(x_0) = x_0\).","import Mathlib def X : Finset ℕ := Finset.Icc 1 1996 theorem Functionnal (f : X → X) (h : ∀ x, f (f (f (f (f x)))) = x) : ∃ x, f x = x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-41788,"Prove that if $(X, \tau)$ is a compact Hausdorff space and $\{U_n\}_{n = 1}^{\infty}$ is a countable collection of open sets that are dense in $X$, then $\bigcap_{n = 1}^{\infty} U_n \neq \emptyset$.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem proveCompactHausdorff (X : Type*) [TopologicalSpace X] (h : CompactSpace X) (h' : T2Space X) (U : ℕ → Set X) (hU : ∀ n, IsOpen (U n)) (hU' : ∀ n, Dense (U n)) : ∃ x, ∀ n, x ∈ U n := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-42093,"Let \(a_1, a_2, \ldots, a_n\) be positive real numbers such that \(a_1 + a_2 + \cdots + a_n = n\). If \(\{a_{i_1}, a_{i_2}, \ldots, a_{i_n}\}\) is a permutation of the set \(\{a_1, a_2, \ldots, a_n\}\), and \(k_i = \frac{(n - a_i)^3}{(n - 1)^2}\) for \(i = 1, 2, \ldots, n\), prove that \[ \frac{a_{i_1}^3}{a_1^3 + k_1} + \frac{a_{i_2}^3}{a_2^3 + k_2} + \cdots + \frac{a_{i_n}^3}{a_n^3 + k_n} \geq 1. \]","import Mathlib theorem Qwen (n : ℕ) (hn : 0 < n) (a : Fin n → ℝ) (ha : ∀ i, 0 < a i) (hsum : ∑ i, a i = n) (k : Fin n → ℝ) (hk : ∀ i, k i = ((n - a i)^3 / (n - 1)^2)) : 1 ≤ ∑ i, (a i)^3 / (a i^3 + k i) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-42261,"Prove that there exists an infinite collection of subsets $\{S_i\}_{i=1}^{\infty}$ such that for any two distinct sets $S_i$ and $S_j$, the intersection $S_i \cap S_j \neq \emptyset$, and for any three distinct sets $S_i, S_j, S_k$, the intersection $S_i \cap S_j \cap S_k = \emptyset$.","import Mathlib theorem InfiniteCollection : ∃ S : ℕ → Set ℝ, (∀ i j, i ≠ j → S i ∩ S j ≠ ∅) ∧ (∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → S i ∩ S j ∩ S k = ∅) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-42348,"Prove that for a given positive integer $k$, the positive integer $N = k + k! \cdot k^{k - 1}$ satisfies the condition that for any integer $n \geq N$, the binomial coefficient $\binom{n}{k}$ has at least $k$ distinct prime divisors.","import Mathlib theorem prove (k : ℕ) (hk : 0 < k) : ∀ n ≥ k + Nat.factorial k * k^(k - 1), k ≤ (Nat.primeFactors (Nat.choose n k)).card := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-42500,Prove that the function \(f: \mathbb{Z} \rightarrow \mathbb{Z}\) defined by \(f(m + f(f(n))) = -f(f(m + 1)) - n\) is bijective.,"import Mathlib theorem Function_Bijective (f : ℤ → ℤ) (h : ∀ m n, f (m + f (f n)) = -f (f (m + 1)) - n) : Function.Bijective f := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-42650,"a) Prove the existence of two infinite sets \(A\) and \(B\), not necessarily disjoint, of non - negative integers such that each non - negative integer \(n\) can be uniquely represented in the form \(n=a + b\) with \(a\in A\) and \(b\in B\). b) Prove that for each pair \((A,B)\) of infinite sets of non - negative integers such that each non - negative integer \(n\) can be uniquely represented in the form \(n = a + b\) with \(a\in A\) and \(b\in B\), either \(A\) or \(B\) contains only multiples of some integer \(k>1\).","import Mathlib theorem a : ∃ A B : Set ℕ, Infinite A ∧ Infinite B ∧ ∀ n : ℕ, ∃! a ∈ A, ∃! b ∈ B, n = a + b := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-42714,"Let $(X, d)$ be a metric space. Prove that if for every $\varepsilon > 0$, any subset $S \subseteq X$ where $d(x, y) \geq \varepsilon$ for all distinct $x, y \in S$ is countable, then $X$ is separable. Alternatively, prove the contrapositive: If $X$ is a non - separable metric space, then there exists an uncountable subset $S \subseteq X$ such that $d(x, y) \geq \varepsilon$ for some $\varepsilon > 0$ and for all distinct $x, y \in S$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MetricSeparableSpace {X : Type*} [MetricSpace X] (h : ∀ ε > 0, ∀ S : Set X, (∀ x ∈ S, ∀ y ∈ S, x ≠ y → dist x y ≥ ε) → Countable S) : SeparableSpace X := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-42764,"Let $X$ be a topological space such that for any decreasing sequence of open sets in $X$, $U_1 \supset U_2 \supset U_3 \supset \dots$, the intersection of their closures is non - empty, i.e., $\bigcap_{n = 1}^{\infty} \overline{U_n} \neq \emptyset$. Prove that every continuous function $f: X \to \mathbb{R}$ is bounded.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem ContinuousFunctionOn (X : Type*) [TopologicalSpace X] (h : ∀ (U : ℕ → Set X), (∀ n m, n < m → U n ⊆ U m) ∧ (∀ n, IsOpen (U n)) → ∃ x, x ∈ ⋂ n, closure (U n)) : ∀ f : X → ℝ, Continuous f → Bornology.IsBounded (Set.range f) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-42778,"Let \(n\) be a positive integer, and let \(A_1, A_2, \ldots, A_{n+1}\) be nonempty subsets of the set \(\{1, 2, \ldots, n\}\). Prove that there exist nonempty and disjoint index sets \(I_1 = \{i_1, i_2, \ldots, i_k\}\) and \(I_2 = \{j_1, j_2, \ldots, j_h\}\) such that \(A_{i_1} \cup A_{i_2} \cup \cdots \cup A_{i_k} = A_{j_1} \cup A_{j_2} \cup \cdots \cup A_{j_h}\).","import Mathlib theorem FinsetUnion (n : ℕ) (hn : 0 < n) (A : Fin (n + 1) → Set ℕ) (hA : ∀ i, A i ⊆ Finset.Icc 1 n ∧ A i ≠ ∅) : ∃ k h : ℕ, 0 < k ∧ 0 < h ∧ ∃ I₁ I₂ : Finset (Fin (n + 1)), I₁.card = k ∧ I₂.card = h ∧ I₁ ∩ I₂ = ∅ ∧ ⋃ i ∈ I₁, A i = ⋃ j ∈ I₂, A j := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-43722,"Prove that every one-to-one function $f: \mathbb{Z} \rightarrow \mathbb{Z}$ can be expressed as the sum of two one-to-one functions $g, h: \mathbb{Z} \rightarrow \mathbb{Z}$.","import Mathlib theorem algebra_458471 {f : ℤ → ℤ} (hf : Function.Injective f) : ∃ g h : ℤ → ℤ, Function.Injective g ∧ Function.Injective h ∧ ∀ x, f x = g x + h x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-43861,"Prove that in any set of \(17\) distinct natural numbers, one can either find a subset of five numbers such that for any two numbers in this subset, the smaller number divides the greater, or a subset of five numbers such that no number in this subset divides any other number in the subset.","import Mathlib theorem prove (s : Finset ℕ) (h₀ : s.card = 17) : ∃ t ⊆ s, t.card = 5 ∧ (∀ x ∈ t, ∀ y ∈ t, x ≠ y → min x y ∣ max x y) ∨ ∃ t ⊆ s, t.card = 5 ∧ ¬∃ x ∈ t, ∃ y ∈ t, x ≠ y ∧ x ∣ y := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-43913,Prove that $\sum_{n = 0}^{\infty} \frac{2^{-n}}{\binom{2n}{n}}=\frac{8\sqrt{7}\tan^{-1}(\frac{1}{\sqrt{7}})}{49}+\frac{8}{7}$.,"import Mathlib open Real theorem sum' : ∑' n : ℕ, (2 : ℝ)^(-n : ℤ) / Nat.choose (2 * n) n = 8 * sqrt 7 * arctan (1 / sqrt 7) / 49 + 8 / 7 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-44073,"Prove that the number of pairs $(\alpha, \beta)$ of real numbers such that for the sequences $(a_{n})$ and $(b_{n})$ defined by $a_{1} = \alpha$, $b_{1} = \beta$, and the recurrence relations $a_{n+1} = \alpha a_{n} - \beta b_{n}$, $b_{n+1} = \beta a_{n} + \alpha b_{n}$ for all $n > 0$, and $a_{1997} = b_{1}$ and $b_{1997} = a_{1}$, is equal to \(1999\).","import Mathlib theorem number_of_pairs : {(α, β) : ℝ × ℝ | ∃(a b: ℕ → ℝ), (a 1 = α ∧ b 1 = β) ∧ (∀ n>0, a (n+1) = α * a n - β * b n ∧ b (n+1) = β * a n + α * b n) ∧ (a 1997 = b 1 ∧ b 1997 = a 1)}.ncard= 1999 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-44140,"Prove that for vectors $v_1, v_2, \ldots, v_n$ in the plane, there exists a subset $\{i_1, i_2, \ldots, i_k\} \subseteq \{1, 2, \ldots, n\}$ such that $\frac{1}{4} \sum_{i=1}^{n} |v_i| \le \left| \sum_{j=1}^{k} v_{i_j} \right|$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove (n : ℕ) (f : Fin n → EuclideanSpace ℝ (Fin 2)) : ∃ k : ℕ, ∃ s : Finset (Fin n), s.card = k ∧ (∑ i : Fin n, ‖f i‖) / 4 ≤ ‖∑ j ∈ s, f j‖ := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-45309,"Prove that for any positive integer \(k\), it is possible to select \(2^k\) numbers from the set \(S=\{0,1,2,\ldots,3^k - 1\}\), called ""red numbers"", such that the average of any two distinct red numbers is never a red number.","import Mathlib theorem red_set (k : ℕ) (hk : 0 < k) : ∃ s : Finset ℕ, s ⊆ Finset.Icc 0 (3 ^ k - 1) ∧ s.card = 2 ^ k ∧ ∀ m ∈ s, ∀ n ∈ s, m ≠ n → ¬∃ p ∈ s, (m + n) / 2 = p := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-45430,"Prove that if $S$ is a set of $2 \times 2$ integer matrices whose entries $a_{ij}$ are all squares of integers and satisfy $a_{ij} \le 200$, and $|S|>50387 = 15^4 - 15^2 - 15 + 2$, then $S$ contains two elements that commute.","import Mathlib theorem prove_comm (S : Finset (Matrix (Fin 2) (Fin 2) ℤ)) (hS : ∀ A ∈ S, ∀ i j, ∃ m, A i j = m ^ 2 ∧ A i j ≤ 200) (hS1 : S.card > 50387) : ∃ A ∈ S, ∃ B ∈ S, A ≠ B ∧ A * B = B * A := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-45524,"Prove that for every $n \in \mathbb{N}$, there exists a set $S$ of $n$ positive integers such that for any two distinct $a, b \in S$, $a - b$ divides both $a$ and $b$, but does not divide any other element of $S$.","import Mathlib theorem prove (n : ℕ) : ∃ (S : Finset ℕ), S.card = n ∧ (∀ s ∈ S, s > 0) ∧ ∀ a ∈ S, ∀ b ∈ S, a ≠ b → (a - b) ∣ a ∧ (a - b) ∣ b ∧ ∀ s ∈ S, s ≠ a → s ≠ b → ¬(a - b) ∣ s := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-45907,"Prove that there exist four disjoint subsets \(A_1, A_2, A_3, A_4\) of the set of natural numbers \(\mathbb{N}\) such that for any \(x, y, z \in \mathbb{N}\) satisfying the equation \(x + 2y = 5z\), the elements \(x, y, z\) do not all belong to the same subset.","import Mathlib theorem number_theory_886279 : ∃ A1 A2 A3 A4 : Set ℕ, A1 ∩ A2 = ∅ ∧ A1 ∩ A3 = ∅ ∧ A1 ∩ A4 = ∅ ∧ A2 ∩ A3 = ∅ ∧ A2 ∩ A4 = ∅ ∧ A3 ∩ A4 = ∅ ∧ ∀ x y z : ℕ, x + 2 * y = 5 * z → ¬(x ∈ A1 ∧ y ∈ A1 ∧ z ∈ A1) ∧ ¬(x ∈ A2 ∧ y ∈ A2 ∧ z ∈ A2) ∧ ¬(x ∈ A3 ∧ y ∈ A3 ∧ z ∈ A3) ∧ ¬(x ∈ A4 ∧ y ∈ A4 ∧ z ∈ A4) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-46932,"Prove that there exists an infinite set \(M\) of positive integers such that for all \(a, b \in M\) (where \(a\) and \(b\) can be the same), the sum \(a + b\) is a Good Number, where a positive integer \(n\) is defined as a Good Number if \(\sigma(n)<2n\) and \(\sigma(n)\) is the sum of all divisors of \(n\).","import Mathlib open Finset def isGood (n : ℕ) := ∑ d ∈ n.divisors, d < 2 * n theorem prove : ∃ M : Set ℕ, Infinite M ∧ (∀ m ∈ M, 0 < m) ∧ (∀ a ∈ M, ∀ b ∈ M, isGood (a + b)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-47005,"Prove that the only positive - integer triples \((a,b,c)\) such that \(abc\) divides \((ab + 1)(bc + 1)(ca + 1)\) are the permutations of the triple \((2,3,7)\).","import Mathlib theorem Prove (a b c : ℤ) (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) (h : a * b * c ∣ (a * b + 1) * (b * c + 1) * (c * a + 1)) : (a = 2 ∧ b = 3 ∧ c = 7) ∨ (a = 2 ∧ b = 7 ∧ c = 3) ∨ (a = 3 ∧ b = 2 ∧ c = 7) ∨ (a = 3 ∧ b = 7 ∧ c = 2) ∨ (a = 7 ∧ b = 2 ∧ c = 3) ∨ (a = 7 ∧ b = 3 ∧ c = 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-47715,"Prove that the maximum integer \(n\) such that there exist subsets \(A_1, A_2, \ldots, A_n\) of the set \(S=\{1,2,\ldots,25\}\) where each subset \(A_i\) has exactly \(5\) elements and any two distinct subsets \(A_i\) and \(A_j\) intersect in at most \(3\) elements is \(n = 100\).","import Mathlib open Finset theorem max_n : IsGreatest {n | ∃ A : Fin n → Set ℕ, (∀ i j, i ≠ j → (A i ∩ A j).encard ≤ 3) ∧ (∀ i, (A i).encard = 5) ∧ (∀ i, A i ⊆ Icc 1 25)} 100 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-47723,"Prove that if $S$ is a set of positive integers, each of which has no prime factor greater than $20$, and the greatest common factor (GCF) of any two distinct elements of $S$ is an integer greater than $1$ and is not divisible by the square of any prime number, then the greatest possible number of elements in $S$ is $136$.","import Mathlib theorem SetOfIntegers {S : Finset ℕ} (hS : ∀ n ∈ S, ∀ p, Nat.Prime p → p ∣ n → p ≤ 20) (hS' : ∀ m ∈ S, ∀ n ∈ S, m ≠ n → ∃ k, Nat.gcd m n = k ∧ k > 1 ∧ ¬∃ p, Nat.Prime p ∧ p^2 ∣ k) : S.card ≤ 136 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-48146,"Prove that for a set of \(999\) points in the Euclidean plane, there are at least \(23\) distinct distances between any two of these points.","import Mathlib open Real Set open scoped BigOperators theorem dist_set (s : Finset (EuclideanSpace ℝ (Fin 2))) (h₀ : s.card = 999) : {d | ∃ p q : EuclideanSpace ℝ (Fin 2), p ∈ s ∧ q ∈ s ∧ d = dist p q}.ncard ≥ 23 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-48167,"Prove that if $21$ elements are chosen arbitrarily from the sequence $(1, 2, \ldots, 2046)$, there will exist a triple $(a, b, c)$, which is a subset of the set of these $21$ elements, such that $bc < 2a^2 < 4bc$.","import Mathlib theorem prove (s : Finset ℕ) (h₀ : s ⊆ Finset.Icc 1 2046) (h₁ : s.card = 21) : ∃ a ∈ s, ∃ b ∈ s, ∃ c ∈ s, a ≠ b ∧ b ≠ c ∧ c ≠ a ∧ b * c < 2 * a ^ 2 ∧ 2 * a ^ 2 < 4 * b * c := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-48307,"Prove that if $1 < m < n$ and $\gcd(m, n) = 1$, then the number of $m$-element subsets of the set $A = \{1, 2, \ldots, n\}$ whose sum is divisible by $n$ is $\frac{1}{n} \binom{n}{m}$.","import Mathlib theorem Nat.choose_m_element_set (n m : ℕ) (hmn : 1 < m ∧ m < n) (hgcd : Nat.gcd m n = 1) : Set.ncard {s : Finset ℕ | s ⊆ Finset.Icc 1 n ∧ s.card = m ∧ ∑ x ∈ s, x ≡ 0 [ZMOD n]} = Nat.choose n m / n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-48442,"Prove that the maximum size of a sum - free subset of the set $\{ 1, 2, \ldots, 2n - 1 \}$ is $n$.","import Mathlib theorem Finset.sum_free (n : ℕ) : IsGreatest {k | ∃ s : Finset ℕ, s ⊆ Finset.Icc 1 (2 * n - 1) ∧ s.card = k ∧ ∀ x ∈ s, ∀ y ∈ s, x ≠ y → x + y ∉ s} n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-48652,"Prove that there exist sets $X$ and $Y$ such that $|X \cap Y| = 0$, $X \cup Y = \mathbb{R}$, and $Y = \{ x + y \mid x, y \in X \}$.","import Mathlib theorem algebra_487359 : ∃ (X Y : Set ℝ), (X ∩ Y).ncard = 0 ∧ X ∪ Y = Set.univ ∧ Y = {x | ∃ a b, x = a + b ∧ a ∈ X ∧ b ∈ X} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-48909,"1) Prove that if $A = \{1, 2, 3, \ldots, n^2\}$ is a set and $F$ is a family of subsets of $A$ such that each subset $f_i \in F$ has exactly $n$ elements and any two distinct subsets $f_i, f_j \in F$ have at most one element in common, then the maximum size of $F$ is $n^2 + n$. 2) Prove that for $n = 3$, the family \(F = \{\{1, 2, 3\}, \{4, 5, 6\}, \{7, 8, 9\}, \{1, 4, 7\}, \{2, 5, 8\}, \{3, 6, 9\}, \{1, 5, 9\}, \{2, 6, 7\}, \{3, 4, 8\}, \{1, 6, 8\}, \{2, 4, 9\}, \{3, 5, 7\}\}\) is an example of a family of subsets of \(A=\{1,2,\ldots,9\}\) with \(|F| = 12\) where each subset in \(F\) has exactly 3 elements and any two distinct subsets in \(F\) have at most one element in common.","import Mathlib theorem prove1 (n : ℕ) (hn : 0 < n) (A : Finset ℕ) (hA : A = Finset.Icc 1 (n ^ 2)) (F : Finset (Finset ℕ)) (hF : ∀ f ∈ F, f ⊆ A ∧ f.card = n) (hF' : ∀ i ∈ F, ∀ j ∈ F, i ≠ j → (i ∩ j).card ≤ 1) : F.card ≤ n ^ 2 + n := by sorry theorem prove2 (A : Finset ℕ) (hA : A = Finset.Icc 1 9) (F : Finset (Finset ℕ)) (hF : F = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {1, 4, 7}, {2, 5, 8}, {3, 6, 9}, {1, 5, 9}, {2, 6, 7}, {3, 4, 8}, {1, 6, 8}, {2, 4, 9}, {3, 5, 7} }) : F.card = 12 ∧ ∀ f ∈ F, f ⊆ A ∧ f.card = 3 ∧ (∀ i ∈ F, ∀ j ∈ F, i ≠ j → (i ∩ j).card ≤ 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-50102,"Prove that there exists a closed set \(E \subseteq \mathbb{R}\) such that the set \(E + \mathbb{N} = \{x + n : x \in E, n \in \mathbb{N}\}\) is not closed in the standard topology of the real line.","import Mathlib theorem TopologyClosedSet : ∃ (E : Set ℝ), IsClosed E ∧ ¬IsClosed {x | ∃ y ∈ E, ∃ n : ℕ, x = y + n} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-50131,"Let \(n\) be a positive natural number. Prove that if every point in the plane is colored with one of \(n\) colors, then there exists an equilateral triangle whose vertices are all of the same color.","import Mathlib open Finset Real theorem equilateral (n : ℕ) (hn : n > 0) (f : ℝ × ℝ → Fin n) : ∃ (A B C : ℝ × ℝ), A ≠ B ∧ A ≠ C ∧ B ≠ C ∧ f A = f B ∧ f B = f C ∧ dist A B = dist B C ∧ dist B C = dist A C := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-51003,"Prove that for a set $S$ in $\mathbb{R}^3$ where the mutual distance between any pair of points in $S$ is rational, $S$ is countable.","import Mathlib theorem RealCountable (S : Set (EuclideanSpace ℝ (Fin 3))) (hS : ∀ p ∈ S, ∀ q ∈ S, p ≠ q → ∃ r : ℚ, dist p q = r) : Countable S := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-51853,"Let \(f: \mathbb{R}^2 \to \mathbb{R}\) be a function satisfying the following conditions: 1. For any fixed \(x_0 \in \mathbb{R}\), the function \(f(x_0, y)\) is measurable with respect to \(y\). 2. For any fixed \(y_0 \in \mathbb{R}\), the function \(f(x, y_0)\) is continuous with respect to \(x\). Prove that \(f(x, y)\) is measurable on \(\mathbb{R}^2\).","import Mathlib theorem Measureable (f : ℝ → ℝ → ℝ) (h₁ : ∀ x₀, Measurable (fun y => f x₀ y)) (h₂ : ∀ y₀, Continuous (fun x => f x y₀)) : Measurable f := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-52276,"Let \(n\) be an odd positive integer with \(n > 1\). Let \(x_1, \ldots, x_n\) and \(y_1, \ldots, y_n\) be \(2n\) nonnegative real numbers such that \(x_1 + \cdots + x_n = y_1 + \cdots + y_n\). Prove that there exists a proper, nonempty subset \(J \subset \{1, \ldots, n\}\) such that: \[ \frac{n-1}{n+1} \sum_{i \in J} x_i \le \sum_{i \in J} y_i \le \frac{n+1}{n-1} \sum_{i \in J} x_i. \]","import Mathlib theorem QWen (n : ℕ) (hn : Odd n ∧ n > 1) (x y : Finset.Icc 1 n → ℝ) (hx : ∑ i, x i = ∑ i, y i) (hy : ∀ i, 0 ≤ x i ∧ 0 ≤ y i) : ∃ J : Finset (Finset.Icc 1 n), J ≠ ⊤ ∧ J ≠ ⊥ ∧ (n - 1) / (n + 1) * ∑ i ∈ J, x i ≤ ∑ i ∈ J, y i ∧ ∑ i ∈ J, y i ≤ (n + 1) / (n - 1) * ∑ i ∈ J, x i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-53324,"Prove that the number of polynomials \(P(x)=ax^2 + bx\), where \(a,b\) are integers with \(0\leq a,b < 2010^{18}\) and for every integer \(n\) with \(0\leq n < 2010^{18}\) there exists a polynomial \(Q(x)=cx^2+dx\in S\) such that \(Q(P(n))\equiv n\pmod{2010^{18}}\), is \(2^5 \cdot 3 \cdot 11 \cdot 2010^{26}\).","import Mathlib open Finset theorem count : {P : Polynomial ℤ | ∃ a b : ℕ, a < 2010 ^ 18 ∧ b < 2010 ^ 18 ∧ P = a * X ^ 2 + b * X ∧ ∀ n : ℕ, n < 2010 ^ 18 → ∃ Q : Polynomial ℤ, (∃ c d : ℕ, c < 2010 ^ 18 ∧ d < 2010 ^ 18 ∧ Q = c * X ^ 2 + d * X) ∧ (Q.comp P).eval (n:ℤ) ≡ n [ZMOD 2010 ^ 18]}.ncard = 2 ^ 5 * 3 * 11 * 2010 ^ 26 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-53581,"Let $X$ be a set with $|X| = 2007$. Given an integer $m$, consider $m$ subsets $X_1, X_2, \ldots, X_m$ of $X$ that satisfy the following conditions: 1. For every $x \in X$, $x$ is an element of at most $5$ subsets $X_i$. 2. For every $x, y, z \in X$, at least two of the elements $x, y, z$ are in the same subset $X_i$. Prove that there exists an index $i \in \{1, 2, \ldots, m\}$ such that $|X_i| \geq 202$.","import Mathlib theorem Qwen (X : Finset ℕ) (hX : X.card = 2007) (m : ℕ) (hm : 0 < m) (Xs : Fin m → Finset ℕ) (hXs : ∀ i, Xs i ⊆ X) (hXs1 : ∀ x ∈ X, {i | x ∈ Xs i}.encard ≤ 5) (hXs2 : ∀ x y z, x ∈ X → y ∈ X → z ∈ X → ∃ i, x ∈ Xs i ∧ y ∈ Xs i ∨ y ∈ Xs i ∧ z ∈ Xs i ∨ x ∈ Xs i ∧ z ∈ Xs i) : ∃ i, (Xs i).card ≥ 202 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-54283,"Prove that the only positive integer $n$ for which there exist sets $A_1, A_2, \ldots, A_n$ satisfying the following conditions: 1. For every $i \neq j$, $|A_i \cap A_j| = 1$. 2. For every $i$, $|A_i| = 5$. 3. $|\bigcup_{i=1}^{n} A_i| = n$. is $n = 21$.","import Mathlib theorem prove (n : ℕ) : n > 0 ∧ ∃ A : Fin n → Set ℤ, (∀ i j, i ≠ j → (A i ∩ A j).ncard = 1) ∧ (∀ i, (A i).ncard = 5) ∧ ((⋃ i, A i).ncard = n) ↔ n = 21 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-54589,"Prove that for a given finite set of positive integers $\mathcal{A}$, there exists a finite set of positive integers $\mathcal{B}$ such that $\mathcal{A} \subset \mathcal{B}$ and \[ \prod_{x \in \mathcal{B}} x = \sum_{x \in \mathcal{B}} x^2. \]","import Mathlib theorem proveFinset (A : Finset ℕ) (hA : ∀ x ∈ A, x > 0) : ∃ B : Finset ℕ, (∀ x ∈ B, x > 0) ∧ A ⊆ B ∧ (∏ x ∈ B, x) = (∑ x ∈ B, x ^ 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-56032,"Prove that if $f : \mathbb{R}^2 \to \mathbb{R}^2$ is a surjective function with the property that if the points $A$, $B$, and $C$ are collinear, then so are $f(A)$, $f(B)$, and $f(C)$, then $f$ is bijective.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem bijective {f : (EuclideanSpace ℝ (Fin 2)) → (EuclideanSpace ℝ (Fin 2))} (h₀ : Function.Surjective f) (h₁ : ∀ A B C : EuclideanSpace ℝ (Fin 2), Collinear ℝ {A, B, C} → Collinear ℝ {f A, f B, f C}) : Function.Bijective f := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-56365,"Prove that in a complete graph \(K_{2017}\) where each edge is labeled with one of the numbers \(1\), \(2\), or \(3\) and the sum of the labels of the edges of any triangle in the graph is at least \(5\), the minimum possible average of all \(\binom{2017}{2}\) labels is \(\frac{4033}{2017}\).","import Mathlib open Finset Real theorem prove (K : Fin 2017 → Fin 2017 → ℕ) (hK : ∀ i j, K i j = 1 ∨ K i j = 2 ∨ K i j = 3) (hK' : ∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → K i j + K i k + K j k ≥ 5) : IsLeast {x | ∃ K : Fin 2017 → Fin 2017 → ℕ, (∀ i j, K i j = 1 ∨ K i j = 2 ∨ K i j = 3) ∧ (∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → K i j + K i k + K j k ≥ 5) ∧ x = (∑ i, ∑ j, if i < j then K i j else 0) / (Nat.choose 2017 2)} (4033 / 2017) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-57304,"Prove that if \(p > 5\) is a prime number, then \((-1)^{(p - 1)/2} \binom{p - 1}{(p - 1)/2} \equiv 4^{p - 1} \pmod{p^3}\).","import Mathlib theorem Nat.choose_p (p : ℕ) (hp : Nat.Prime p) (h : p > 5) : (-1) ^ ((p - 1) / 2) * Nat.choose (p - 1) ((p - 1) / 2) ≡ 4 ^ (p - 1) [ZMOD p ^ 3] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-57764,"Let \(n\) be a positive integer, and let \(P_n = \{2^n, 2^{n - 1}\cdot3, 2^{n - 2}\cdot3^2, \dots, 3^n\}\). For each subset \(X\) of \(P_n\), denote by \(S_X\) the sum of all elements of \(X\), with the convention that \(S_{\emptyset}=0\) where \(\emptyset\) is the empty set. Prove that for any real number \(y\) such that \(0\leq y\leq 3^{n + 1}-2^{n + 1}\), there exists a subset \(Y\) of \(P_n\) such that \(0\leq y - S_Y<2^n\).","import Mathlib open Finset Real theorem prove (n : ℕ) (hn : 0 < n) (P : ℕ → Set ℕ) (hP : ∀ k, P k = {x | ∃ i ∈ range (k + 1), x = 2 ^ (k - i) * 3 ^ i}) : ∀ y ∈ Icc 0 (3 ^ (n + 1) - 2 ^ (n + 1)), ∃ Y, 0 ≤ y - (∑ x ∈ Y, x) ∧ y - (∑ x ∈ Y, x) < 2 ^ n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-57789,"Prove that the number of sequences of real numbers \(a_1, a_2, a_3, \dots, a_{16}\) that satisfy the condition \[ a_1^n + a_2^{2n} + \dots + a_{16}^{16n} = \begin{cases} 10^{n+1} + 10^n + 1 & \text{if } n \text{ is even} \\ 10^n - 1 & \text{if } n \text{ is odd} \end{cases} \] is equal to \(1091328\).","import Mathlib theorem prove : Set.ncard {a : Fin 16 → ℝ | ∀ n : ℕ, (∑ i : Fin 16, (a i) ^ ((i.1 + 1) * n)) = if Even n then 10^(n + 1) + 10^n + 1 else 10^n - 1} = 1091328 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-57900,"Prove that given a set $S$ with $n \geq 5$ elements, and $n + 1$ distinct triplets (subsets of $S$ each containing exactly three elements), there exist at least two of these triplets that intersect in exactly one element.","import Mathlib theorem prove_schramm (n : ℕ) (hn : n ≥ 5) (s : Finset ℤ) (h₀ : s.card = n) (t : Finset (Finset ℤ)) (ht : t.card = n + 1) (h₁ : ∀ x ∈ t, x ⊆ s ∧ x.card = 3) : ∃ x ∈ t, ∃ y ∈ t, x ≠ y ∧ (x ∩ y).card = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-57965,"Given an integer \(n \geq 4\), let \(S = \{1, 2, \ldots, n\}\). Consider two subsets \(A\) and \(B\) of \(S\) such that for every pair \((a, b)\) with \(a \in A\) and \(b \in B\), the expression \(ab + 1\) is a perfect square. Prove that \[ \min \{|A|, |B|\} \leq \log_2 n. \]","import Mathlib open Finset theorem log_2 (n : ℕ) (hn : 4 ≤ n) (A B : Finset ℕ) (hA : A ⊆ Icc 1 n) (hB : B ⊆ Icc 1 n) (hAB : ∀ x ∈ A, ∀ y ∈ B, IsSquare (x * y + 1)) : min (A.card) (B.card) ≤ Real.logb 2 n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-57996,"Prove that if $p \geq 5$ is a prime, then $\binom{2p}{p} \equiv 2 \pmod{p^3}$ and for any integers $a$ and $b$ such that $0 \leq b \leq a$, $\binom{pa}{pb} \equiv \binom{a}{b} \pmod{p^3}$.","import Mathlib theorem Nat.choose_pmod {p : ℕ} (hp : Nat.Prime p) (h : 5 ≤ p) : Nat.choose (2 * p) p ≡ 2 [MOD p ^ 3] ∧ ∀ a b, 0 ≤ b → b ≤ a → Nat.choose (p * a) (p * b) ≡ Nat.choose a b [MOD p ^ 3] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-57999,Let $p$ be an odd prime number such that $p \equiv 2 \pmod{3}$. Define a permutation $\pi$ of the residue classes modulo $p$ by $\pi(x) \equiv x^3 \pmod{p}$. Prove that $\pi$ is an even permutation if and only if $p \equiv 3 \pmod{4}$.,"import Mathlib open Finset theorem IsEven (p : ℕ) (hp : Odd p ∧ Nat.Prime p) (h : p ≡ 2 [MOD 3]) : Even (fun x => x ^ 3 % p) ↔ p ≡ 3 [MOD 4] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-58054,"Let $X$ be a set of $2020$ distinct real numbers. Prove that there exist real numbers $a, b \in \mathbb{R}$ and a subset $A \subset X$ such that $$\sum_{x \in A} (x - a)^2 + \sum_{x \in X \setminus A} (x - b)^2 \leq \frac{1009}{1010} \sum_{x \in X} x^2.$$","import Mathlib theorem algebra_467398 (X : Finset ℝ) (hX : X.card = 2020) : ∃ a b : ℝ, ∃ A : Finset ℝ, A ⊆ X ∧ ∑ x ∈ A, (x - a)^2 + ∑ x ∈ X \ A, (x - b)^2 ≤ (1009 / 1010) * ∑ x ∈ X, x^2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-58136,"Let \(A\) and \(B\) be sets of positive integers such that \(|A| \geq 2\) and \(|B| \geq 2\). Let \(S\) be a set containing \(|A| + |B| - 1\) numbers of the form \(ab\) where \(a \in A\) and \(b \in B\). Prove that there exist pairwise distinct elements \(x, y, z \in S\) such that \(x\) is a divisor of \(yz\).","import Mathlib theorem qwen (A B : Finset ℕ) (hA : ∀ a ∈ A, a > 0) (hB : ∀ b ∈ B, b > 0) (hA' : A.card ≥ 2) (hB' : B.card ≥ 2) (S : Finset ℕ) (hS : S.card = A.card + B.card - 1) (hS' : ∀ s ∈ S, ∃ a ∈ A, ∃ b ∈ B, s = a * b) : ∃ x ∈ S, ∃ y ∈ S, ∃ z ∈ S, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ x ∣ y * z := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-58389,"Prove that for a prime number \(p\) and an integer \(k\) such that \(2 \le k \le p\), the sum of the products of each \(k\) - element subset of the set \(S=\{1,2,\ldots,p\}\) is divisible by \(p\) for all \(k\) except when \(k = p - 1\).","import Mathlib open Finset theorem PrimeSum (p : ℕ) (hp : Nat.Prime p) (k : ℕ) (hk : 2 ≤ k ∧ k ≤ p) : (∑ s ∈ (Icc 1 p).powerset.filter (fun x => x.card = k), ∏ i ∈ s, i) % p = 0 ↔ k ≠ p - 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-58814,"Prove that the remainder when the number of sextuples of integers \((x, y, z, a, b, c)\) such that \(1 \leq x, y, z \leq 191\) and \(1 \leq a, b, c \leq 190\) for which the expression \(x^a y^b z^c - 1\) is divisible by \(191\) is divided by \(1000\) is \(191\).","import Mathlib theorem count_sextuples : (Set.ncard {(x, y, z, a, b, c) : ℕ × ℕ × ℕ × ℕ × ℕ × ℕ | 1 ≤ x ∧ x ≤ 191 ∧ 1 ≤ y ∧ y ≤ 191 ∧ 1 ≤ z ∧ z ≤ 191 ∧ 1 ≤ a ∧ a ≤ 190 ∧ 1 ≤ b ∧ b ≤ 190 ∧ 1 ≤ c ∧ c ≤ 190 ∧ 191 ∣ x ^ a * y ^ b * z ^ c - 1}) % 1000 = 191 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-58820,"Prove that the remainder when the number \(N\) of sextuples of integers \((x, y, z, a, b, c)\) such that \(1 \leq x, y, z \leq 191\) and \(1 \leq a, b, c \leq 190\) for which the expression \(x^a y^b z^c - 1\) is divisible by \(191\) is divided by \(1000\) is \(241\).","import Mathlib theorem count_sextuples : ({ (x, y, z, a, b, c): ℕ × ℕ × ℕ × ℕ × ℕ × ℕ | 1 ≤ x ∧ x ≤ 191 ∧ 1 ≤ y ∧ y ≤ 191 ∧ 1 ≤ z ∧ z ≤ 191 ∧ 1 ≤ a ∧ a ≤ 190 ∧ 1 ≤ b ∧ b ≤ 190 ∧ 1 ≤ c ∧ c ≤ 190 ∧ 191 ∣ (x ^ a * y ^ b * z ^ c - 1)}.ncard % 1000 = 241) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-58975,"Prove that for every positive integer \(n\), the identity \(\sum_{i=0}^{n - 1}(-1)^{i}(n - i)^n\binom{n + 1}{i}=1\) holds.","import Mathlib open Finset Real Nat theorem prove (n : ℕ) (hn : 0 < n) : ∑ i ∈ range n, (-1 : ℝ)^i * (n - i)^n * Nat.choose (n + 1) i = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-59003,"Prove that for any finite set \(S\) consisting of special numbers (where a special number \(n\) is a positive - integer that is the product of two distinct prime numbers and \(n\equiv 2\pmod{3}\)), there exist two sets \(A\) and \(B\) such that: \begin{enumerate} \item \(A\cap B=\emptyset\) and \(A\cup B = S\), \item \(||A|-|B||\leq 1\), \item For every prime \(p\), the difference between the number of elements in \(A\) that are multiples of \(p\) and the number of elements in \(B\) that are multiples of \(p\) is less than or equal to \(1\). \end{enumerate}","import Mathlib open Finset theorem prove_special (S : Finset ℕ) (hS : ∀ n ∈ S, ∃ p q, p.Prime ∧ q.Prime ∧ p ≠ q ∧ n = p * q ∧ n ≡ 2 [MOD 3]) : ∃ A B : Finset ℕ, A ⊆ S ∧ B ⊆ S ∧ A ∩ B = ∅ ∧ A ∪ B = S ∧ |(A.card : ℤ) - B.card| ≤ 1 ∧ ∀ p, p.Prime → {x | x ∈ A ∧ p ∣ x}.ncard - {x | x ∈ B ∧ p ∣ x}.ncard ≤ 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-59182,"Prove that there exists a set $X$ of $1996$ positive integers such that: (i) the elements of $X$ are pairwise coprime; (ii) all elements of $X$ and all sums of two or more distinct elements of $X$ are composite numbers.","import Mathlib theorem Coprime : ∃ X : Finset ℕ, X.card = 1996 ∧ (∀ x ∈ X, x > 0) ∧ (∀ x ∈ X, ∀ y ∈ X, x ≠ y → Nat.Coprime x y) ∧ (∀ x ∈ X, ¬Nat.Prime x) ∧ (∀ s : Finset ℕ, s ⊆ X ∧ s.card ≥ 2 → ¬Nat.Prime (s.sum id)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-59369,"Prove that if \(b = 2521\) and a sequence is defined such that the first term is \(1\) and each subsequent term is the total number of digits in all the previous terms of the sequence when written in base \(b\), then the first positive power of \(b\) that does not appear in the sequence is \(b^{11}\).","import Mathlib open Finset theorem prove (b : ℕ) (hb : b = 2521) (a : ℕ → ℕ) (ha0 : a 0 = 1) (han : ∀ n, a (n + 1) = ∑ i ∈ Icc 0 n, (Nat.digits b (a i)).length) : IsLeast {x | 0 < x ∧ ¬∃ n, a n = b ^ x} (b ^ 11) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-59383,"Prove that if 100 nonzero real numbers are placed around a circle such that the product of every pair of adjacent numbers is equal to the square of some other number on the circle, then all the numbers on the circle are equal.","import Mathlib theorem algebra_568239 (a : Fin 100 → ℝ) (ha : ∀ i, a i ≠ 0) (h : ∀ i, ∃ j, a i * a ((i + 1) % 100) = a j ^ 2) : ∀ i, a i = a 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-59425,"a) Prove that there exists a subset \(A\) of the set \(M\) of all rational numbers in the interval \((0, 1)\) such that every element of \(M\) can be uniquely represented as the sum of a finite number of distinct elements of \(A\). b) Let \(X\) be a finite set of positive integers. Prove that for any subset \(A\) of \(X\), there exists a subset \(B = B^n\) of \(X\) with the property that for every element \(e\) of \(X\), \(e\) divides an odd number of elements of \(B\) if and only if \(e\) is an element of \(A\).","import Mathlib open Finset theorem a : ∃ A : Set ℚ, (∀ x ∈ A, 0 < x ∧ x < 1) ∧ (∀ x : ℚ, 0 < x ∧ x < 1 → ∃! s : Finset ℚ, x = ∑ i ∈ s, i ∧ ∀ i ∈ s, i ∈ A) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-59512,"Prove that there are infinitely many positive integers $n$ such that there exist $n$ good numbers, where a set of distinct positive integers $a_1, a_2, \ldots, a_n$ is defined as ""good"" if $\sum_{i=1}^{n} a_i = \sum_{1 \le i < j \le n} \gcd(a_i, a_j)$.","import Mathlib def isGood (s : Finset ℕ) : Prop := s.card > 0 ∧ ∑ x ∈ s, x = ∑ x ∈ s, ∑ y ∈ s, if x < y then Nat.gcd x y else 0 theorem prove_infinite : ∀ N : ℕ, ∃ n : ℕ, n > N ∧ ∃ s : Finset ℕ, s.card = n ∧ isGood s := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-59513,"Prove that there are infinitely many positive integers \(n\) such that there exist \(n\) distinct positive integers \(a_1, a_2, \ldots, a_n\) satisfying \(\sum_{i = 1}^{n} a_i=\sum_{1\leq i < j\leq n}\gcd(a_i, a_j)\).","import Mathlib theorem prove_infinite : ∀ N : ℕ, ∃ n : ℕ, n > N ∧ ∃ a : Finset.Icc 1 n → ℕ, (∀ i j, a i = a j → i = j) ∧ (∀ i, 0 < a i) ∧ (∑ i, a i) = (∑ i, ∑ j, if i < j then Nat.gcd (a i) (a j) else 0) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-59721,"Prove that if $A_1, A_2, \ldots, A_n$ are subsets of $\{1, 2, \ldots, n\}$ such that no two subsets are contained within each other, then $\sum_{k=1}^n \frac{1}{{n \choose |A_k|}} \leq 1$.","import Mathlib open Finset Real Nat theorem prove (n : ℕ) (hn : 0 < n) (A : ℕ → Set ℕ) (hA : ∀ i ∈ Icc 1 n, A i ⊆ Icc 1 n) (hA' : ∀ i j, i ≠ j → ¬(A i ⊆ A j)) : ∑ k ∈ Icc 1 n, (1 / Nat.choose n (A k).ncard) ≤ 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-59757,"Prove that the number of dense subsets \(S\) of \(\{1, 2, \ldots, 49\}\), where a dense subset is defined as a subset with \(|S| > 40\) and containing no six - consecutive integers, is \(5\).","import Mathlib theorem prove : Set.ncard {S : Finset ℕ | S ⊆ Finset.Icc 1 49 ∧ S.card > 40 ∧ ¬∃ k, ∀ i ∈ Finset.range 6, (k + i) ∈ S} = 5 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-60112,"Prove that the total number of distinct AoPS avatars, where each avatar is a $3 \times 3 \times 3$ cube with each cell colored using one of $10$ distinct colors and each avatar can use only $3$ of these colors, and considering that each face of the cube can be rotated and reflected and accounting for the symmetries of the cube, is given by \( \binom{10}{3} \left( \frac{3^9 + 2 \cdot 3^3 + 3^5 + 4 \cdot 3^6}{8} \right)^6 \).","import Mathlib theorem total_ao_p : (Nat.choose 10 3) * ((3^9 + 2 * 3^3 + 3^5 + 4 * 3^6) / 8)^6 = 33550335 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-60153,"Let \(n_1 < n_2 < \cdots < n_{2000} < 10^{100}\) be positive integers. Prove that there exist two non - empty disjoint subsets \(A\) and \(B\) of \(\{n_1, n_2, \ldots, n_{2000}\}\) such that \(|A| = |B|\), \(\sum_{x \in A} x = \sum_{x \in B} x\), and \(\sum_{x \in A} x^2 = \sum_{x \in B} x^2\).","import Mathlib theorem n (n : Fin 2000 → ℕ) (hn : ∀ i j, i < j → n i < n j) (hpos : ∀ i, 0 < n i ∧ n i < 10 ^ 100) : ∃ A B : Finset (Fin 2000), A ≠ ∅ ∧ B ≠ ∅ ∧ A ∩ B = ∅ ∧ A.card = B.card ∧ ∑ x ∈ A, n x = ∑ x ∈ B, n x ∧ ∑ x ∈ A, (n x) ^ 2 = ∑ x ∈ B, (n x) ^ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-60157,"Prove that if $S = (a_1, a_2, \ldots, a_{2n+1})$ is a collection of $2n+1$ positive integers, each less than or equal to $2^n$, such that the product of any $n$ numbers in $S$ divides the product of the remaining $n+1$ numbers, then there exist indices $i$ and $j$ with $i < j$ such that $a_i = a_j$.","import Mathlib theorem prove {n : ℕ} (hn : 0 < n) (a : Fin (2 * n + 1) → ℕ) (ha : ∀ i, 0 < a i ∧ a i ≤ 2 ^ n) (h : ∀ s : Finset (Fin (2 * n + 1)), s.card = n → ∏ i ∈ s, a i ∣ ∏ i ∈ (Finset.univ \ s), a i) : ∃ i j, i < j ∧ a i = a j := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-60281,"Let two sequences of positive real numbers \(a_1, a_2, \ldots, a_{2n+1}\) and \(b_1, b_2, \ldots, b_{2n+1}\) be given. Define \[ s = a_1 + a_2 + \cdots + a_{2n+1} \quad \text{and} \quad t = b_1 + b_2 + \cdots + b_{2n+1}. \] Prove that there exist \(n + 1\) indices \(i_1, i_2, \ldots, i_{n+1} \in \{1, 2, \ldots, 2n+1\}\) such that \[ a_{i_1} + a_{i_2} + \cdots + a_{i_{n+1}} \geq \frac{s}{2} \quad \text{and} \quad b_{i_1} + b_{i_2} + \cdots + b_{i_{n+1}} \geq \frac{t}{2}. \]","import Mathlib open Finset Real theorem algebra_486708 {n : ℕ} (hn : 0 < n) (a b : ℕ → ℝ) (ha : ∀ i ∈ Icc 1 (2 * n + 1), 0 < a i) (hb : ∀ i ∈ Icc 1 (2 * n + 1), 0 < b i) (s t : ℝ) (hs : s = ∑ i ∈ Icc 1 (2 * n + 1), a i) (ht : t = ∑ i ∈ Icc 1 (2 * n + 1), b i) : ∃ i : Finset ℕ, i ⊆ Icc 1 (2 * n + 1) ∧ i.card = n + 1 ∧ (∑ j ∈ i, a j ≥ s / 2) ∧ (∑ j ∈ i, b j ≥ t / 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-60464,"Let $a$ be a positive integer. A positive integer $b$ is defined to be [i]$a$-good[/i] if $\binom{an}{b} - 1$ is divisible by $an + 1$ for all positive integers $n$ such that $an \geq b$. Prove that if $b$ is a positive integer that is $a$-good, but $b+2$ is not $a$-good, then $b + 1$ is a prime number.","import Mathlib def is_a_good (a : ℕ) (b : ℕ) := ∀ n > 0, a * n ≥ b → (Nat.choose (a * n) b - 1) % (a * n + 1) = 0 theorem a_prime {a b : ℕ} (_ : 0 < a) (hb : 0 < b) (h : is_a_good a b) (h' : ¬is_a_good a (b + 2)) : Nat.Prime (b + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-60555,"Prove that for any positive integer \(n\), the following identity holds: \(\sum_{k=1}^{n - 1}\frac{1}{\sin^4\frac{k\pi}{2n}}=\frac{4(4n^2 - 1)(n^2 - 1)}{45}\)","import Mathlib open Real Set open scoped BigOperators theorem sum_sen : ∀ n > 0, ∑ k : Finset.Icc (1 : ℕ) (n-1), (1 / sin (k * π/(2*n))^4 : ℝ) = 4*(4*n^2 - 1)*(n^2 - 1)/45 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-60719,"Prove that if $\mathcal{S}$ denotes the set of all $n$-tuples of positive integers, and $\mathcal{A} \subseteq \mathcal{S}$ is an infinite subset, then there exist two distinct elements $(a_1, a_2, \dots, a_n), (b_1, b_2, \dots, b_n) \in \mathcal{A}$ such that $a_i \le b_i$ for all $1 \le i \le n$.","import Mathlib open Finset theorem Prove {n : ℕ} (hn : 0 < n) (A : Set (Fin n → ℕ)) (hA : ∀ x ∈ A, ∀ i, 0 < x i) (hA' : Infinite A) : ∃ a ∈ A, ∃ b ∈ A, a ≠ b ∧ ∀ i, a i ≤ b i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-60722,"Let \(a_1, a_2, a_3, \ldots\) be an infinite sequence of positive integers such that the number of divisors of each \(a_i\) is less than a fixed integer \(k\). Prove that there exists an infinite subsequence \(a_{n_1}, a_{n_2}, a_{n_3}, \ldots\) of the given sequence such that for all \(i, j\), the greatest common divisor \(\gcd(a_{n_i}, a_{n_j}) = 1\).","import Mathlib theorem qwen (a : ℕ → ℕ) (ha : ∀ n, 0 < a n) (hdiv : ∀ n, (Nat.divisors (a n)).card < k) : ∃ f : ℕ → ℕ, (∀ i, f i > 0) ∧ (∀ i j, Nat.gcd (a (f i)) (a (f j)) = 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-61107,"Prove that the maximum number of elements \(k\) of a 'free - of - sums' subset of the set \(E=\{1,2,3,\ldots,2n + 1\}\) (where a 'free - of - sums' subset does not contain any triplet of numbers \(x\), \(y\), and \(z\) such that \(x + y = z\)) is \(n + 1\).","import Mathlib def is_free_of_sums (s : Finset ℕ) := ∀ x ∈ s, ∀ y ∈ s, ∀ z ∈ s, x ≠ y ∧ y ≠ z ∧ z ≠ x → x + y ≠ z theorem max_k (n : ℕ) : IsGreatest {k | ∃ s : Finset ℕ, s ⊆ Finset.Icc 1 (2 * n + 1) ∧ s.card = k ∧ is_free_of_sums s} (n + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-61121,"Prove that if $x$ is irrational, then there exist infinitely many positive integers $n$ such that $(-1)^{\lfloor x \rfloor} + (-1)^{\lfloor 2x \rfloor} + \cdots + (-1)^{\lfloor nx \rfloor} = 0$.","import Mathlib theorem number_theory_758343 (x : ℝ) (hx : Irrational x) : ∀ N : ℕ, ∃ n : ℕ, n > N ∧ ∑ i ∈ Finset.Icc 1 n, (-1 : ℝ) ^ ⌊i * x⌋ = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-61144,"Let $\mathbb{N}$ be partitioned into two disjoint sets $A$ and $B$ such that $\mathbb{N} = A \cup B$ and $A \cap B = \emptyset$. Prove that for any positive real number $c$, there exist monotone increasing sequences $\{a_n\}$ and $\{b_n\}$ with $a_n \in A$ and $b_n \in B$ such that $\lim_{n \to \infty} \frac{a_n}{b_n} = c$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem partitioned_set (A B : Set ℕ) (h₀ : A ∪ B = ℕ) (h₁ : A ∩ B = ∅) : ∀ c > 0, ∃ a b : ℕ → ℕ, Monotone a ∧ Monotone b ∧ (∀ n, a n ∈ A) ∧ (∀ n, b n ∈ B) ∧ Tendsto (λ n => (a n : ℝ) / b n) atTop (𝓝 c) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-61173,"Let \(S = \{0, 1, 2, \ldots, 1994\}\). Given \(a, b \in S\) such that \(\gcd(a, b) = 1\), prove that there exists a sequence \(s_1, s_2, \ldots, s_{1995}\) such that \(s_{i + 1}-s_i\equiv\pm a\text{ or }\pm b\pmod{1995}\) for \(i = 1, 2, \ldots, 1994\).","import Mathlib theorem qwen (S : Finset ℕ) (hS : S = Finset.Icc 0 1994) (a b : ℕ) (ha : a ∈ S) (hb : b ∈ S) (hab : Nat.gcd a b = 1) : ∃ s : ℕ → ℕ, ∀ i ∈ Finset.Icc 1 1994, (s (i + 1) - s i) ≡ a [ZMOD 1995] ∨ (s (i + 1) - s i) ≡ -a [ZMOD 1995] ∨ (s (i + 1) - s i) ≡ b [ZMOD 1995] ∨ (s (i + 1) - s i) ≡ -b [ZMOD 1995] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-61300,"In a mathematical competition, \(21\) girls and \(21\) boys participated. It is known that each contestant solved at most \(6\) problems, and for every pair of a girl and a boy, there was at least one problem that was solved by both the girl and the boy. Prove that there exists a problem that was solved by at least three girls and at least three boys.","import Mathlib theorem math_competition (g b : Fin 21 → Finset ℕ) (h₀ : ∀ i, g i ⊆ Finset.Icc 1 6) (h₁ : ∀ i, b i ⊆ Finset.Icc 1 6) (h₂ : ∀ i j, ∃ x, x ∈ g i ∧ x ∈ b j) : ∃ p, p ∈ Finset.Icc 1 6 ∧ {i | p ∈ g i}.ncard ≥ 3 ∧ {j | p ∈ b j}.ncard ≥ 3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-61330,Prove that \(\sum_{r = 0}^{n}\frac{{}_nC{}_r}{\sum_{s = 0}^{r}\frac{{}_rC{}_s}{\sum_{t = 0}^{s} {}_sC{}_t \left(\frac{\sqrt{5}-1}{2}\right)^t}}=\left(\frac{1 + \sqrt{5}}{2}\right)^n\).,"import Mathlib open Finset Real Nat theorem sum_r : ∑ r ∈ Icc 0 n, (Nat.choose n r) / (∑ s ∈ Icc 0 r, (Nat.choose r s) / (∑ t ∈ Icc 0 s, (Nat.choose s t) * ((Real.sqrt 5 - 1) / 2)^t)) = ((1 + Real.sqrt 5) / 2)^n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-61364,"Prove that there exists a subset \(A\) of the set \(\{1, 2, \ldots, 2^{1996}-1\}\) such that: a) \(1\) and \(2^{1996}-1\) belong to \(A\); b) Every element of \(A\) except \(1\) is the sum of two (not necessarily distinct) elements of \(A\); c) The number of elements of \(A\) is at most \(2010\).","import Mathlib theorem exists_subset : ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 (2 ^ 1996 - 1) ∧ 1 ∈ A ∧ (2 ^ 1996 - 1) ∈ A ∧ ∀ n ∈ A \ {1}, ∃ m ∈ A, ∃ p ∈ A, n = m + p ∧ A.card ≤ 2010 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-61649,"Let \(P\) be a prime number, and let \(x_1=(a_1,b_1),x_2=(a_2,b_2),\ldots,x_{3P}=(a_{3P},b_{3P})\) be a set of \(3P\) points in the plane such that \(\sum_{i = 1}^{3P}a_i\equiv0\pmod{P}\) and \(\sum_{i = 1}^{3P}b_i\equiv0\pmod{P}\). Prove that there exists a subset \(S\subseteq\{1,2,\ldots,3P\}\) with \(|S| = P\) such that \(\sum_{i\in S}a_i\equiv0\pmod{P}\) and \(\sum_{i\in S}b_i\equiv0\pmod{P}\).","import Mathlib theorem Finset.sum_points (P : ℕ) (hP : Nat.Prime P) (x : Fin (3 * P) → (ℤ × ℤ)) (hsum_a : ∑ i : Fin (3 * P), (x i).1 ≡ 0 [ZMOD P]) (hsum_b : ∑ i : Fin (3 * P), (x i).2 ≡ 0 [ZMOD P]) : ∃ S : Finset (Fin (3 * P)), S.card = P ∧ ∑ i ∈ S, (x i).1 ≡ 0 [ZMOD P] ∧ ∑ i ∈ S, (x i).2 ≡ 0 [ZMOD P] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-61912,"Prove that if a sequence of complex numbers \(z_0, z_1, z_2, \ldots\) is defined by the recurrence relation \(z_{n + 1}=\frac{i z_n}{\overline{z_n}}\), where \(\overline{z_n}\) denotes the complex conjugate of \(z_n\) and \(i^2=-1\), and \(|z_0| = 1\) and \(z_{2005}=1\), then the number of possible values for \(z_0\) is \(2^{2005}\).","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem number_theory_9368 : Set.ncard {z0 : ℂ | ∃ z : ℕ → ℂ, (∀ n, z (n + 1) = I * z n / starRingEnd ℂ (z n)) ∧ ‖z0‖ = 1 ∧ z 2005 = 1} = 2 ^ 2005 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-62419,"Let $X$ be a finite set, and let $A_1, A_2, \ldots, A_{51}$ be $51$ subsets of $X$ such that each subset $A_i$ contains more than $\frac{|X|}{3}$ elements. Prove that there exists a subset $B \subseteq X$ with $|B| \leq 8$ such that $B$ has at least one element in common with each of the subsets $A_1, A_2, \ldots, A_{51}$.","import Mathlib theorem Finset.X (X : Type*) [Finite X] (A : Fin 51 → Set X) (hA : ∀ i, (A i).ncard > (Nat.card X) / 3) : ∃ B : Set X, B.ncard ≤ 8 ∧ ∀ i, B ∩ A i ≠ ∅ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-62514,"1. Prove that the only functions $f: \mathbb{N} \to \mathbb{N}$ such that $f(m^2 + n^2) = f^2(m) + f^2(n)$ for all $(m, n) \in \mathbb{N} \times \mathbb{N}$, where $\mathbb{N} = \{0, 1, 2, \ldots\}$, are the functions that satisfy the given functional - equation. 2. Prove that there exists a set $T$ of $2n - 5$ points such that any triangle determined by vertices in a set $S$ of $n \geq 3$ points in the plane contains at least one point from $T$. 3. Given an acute triangle $ABC$ with $M$ as the mid - point of side $AB$ and $D$ the foot of the perpendicular from $C$ to $AB$, and a line through $M$ intersecting lines $CA$ and $CB$ at points $K$ and $L$ respectively such that $CK = CL$, and $O$ as the circum - center of triangle $CKL$, prove that $OD = OM$. 4. Let $p > 5$ be a prime and $n$ an even integer. - Prove that if $L_n \equiv 2 \pmod{p}$, then $L_n \equiv 2 \pmod{p^2}$. - Prove that if $L_n \equiv - 2 \pmod{p}$, then $L_n \equiv - 2 \pmod{p^2}$.","import Mathlib theorem prove1 (f : ℕ → ℕ) : (∀ m n, f (m ^ 2 + n ^ 2) = f m ^ 2 + f n ^ 2) ↔ ∀ m, f m = m := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-62573,"Let $f: \mathbb{Z} \to \{0,1\}$ be a function and $n \in \mathbb{N}$ with $n \geq 1$. Suppose that the number of distinct words of the form $f(x)f(x+1)\ldots f(x+n-1)$, for $x \in \mathbb{Z}$, is at most $n$. Prove that there exists a non - zero integer $T$ such that $f(x+T) = f(x)$ for all $x \in \mathbb{Z}$.","import Mathlib theorem word_length (n : ℕ) (hn : 1 ≤ n) (f : ℤ → Fin 2) (h : Set.ncard {w : List (Fin 2) | ∃ x : ℤ, w = List.map (fun i => f (x + i)) (List.range n)} ≤ n) : ∃ T : ℤ, T ≠ 0 ∧ ∀ x : ℤ, f (x + T) = f x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-62696,"a) Prove that \(\sum_{k = 1}^{n}\frac{(-1)^{k - 1}}{2k-1}\binom{n}{k}\binom{n + k-1}{k - 1}=1\). b) Prove that \(\sum_{k = 1}^{n}\frac{(-1)^{k - 1}}{2k-1}\binom{n}{k}k^{k}=\frac{2^{n}(n!)^{2}}{(2n)!}\).","import Mathlib open Finset Real Nat theorem sum_bottles (n : ℕ) : ∑ k ∈ Icc 1 n, (-1 : ℝ) ^ (k - 1) / (2 * k - 1) * Nat.choose n k * Nat.choose (n + k - 1) (k - 1) = 1 ∧ ∑ k ∈ Icc 1 n, (-1 : ℝ) ^ (k - 1) / (2 * k - 1) * Nat.choose n k * k ^ k = 2 ^ n * (Nat.factorial n) ^ 2 / (Nat.factorial (2 * n)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-62818,"Prove that if there are $167$ sets $A_{1}, A_{2}, \ldots, A_{167}$ such that $\sum_{i=1}^{167} |A_{i}| = 2004$ and $|A_{j}| = |A_{i}| \cdot |A_{i} \cap A_{j}|$ for all $i \neq j$, then $|\bigcup_{i=1}^{167} A_{i}| = 1838$.","import Mathlib theorem prove (A : Fin 167 → Set ℤ) (h₀ : ∑ i, (A i).ncard = 2004) (h₁ : ∀ i j, i ≠ j → (A j).ncard = (A i).ncard * ((A i) ∩ (A j)).ncard) : (∀ i, (A i).ncard > 0) → (⋃ i, A i).ncard = 1838 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-62823,"Prove that for given complex numbers \(z_{1},\dots,z_{n}\in\mathbb{C}\), there exists a subset \(B \subseteq \{1,\dots,n\}\) such that \[ \left|\sum_{k\in B}z_{k}\right| \ge \frac{1}{\pi}\sum_{k=1}^{n}\left|z_{k}\right|. \]","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem z (n : ℕ) (f : Fin n → ℂ) : ∃ B : Finset (Fin n), ‖∑ i ∈ B, f i‖ ≥ (1 / Real.pi) * ∑ i : Fin n, ‖f i‖ := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-62844,"Let \(A_1, A_2, \ldots, A_{35}\) be \(35\) sets, each containing \(27\) elements. It is given that for any three sets \(A_i, A_j, A_k\) (where \(1 \leq i < j < k \leq 35\)), there is exactly one element that is common to all three sets. Prove that there exists an element that is common to all \(35\) sets.","import Mathlib theorem commonElement (A : Fin 35 → Set ℤ) (hAcard : ∀ i : Fin 35, (A i).ncard = 27) (hAinter : ∀ i : Fin 35, ∀ j : Fin 35, ∀ k : Fin 35, i ≠ j ∧ i ≠ k ∧ j ≠ k → ∃! x : ℤ, x ∈ A i ∧ x ∈ A j ∧ x ∈ A k) : ∃ x : ℤ, ∀ i : Fin 35, x ∈ A i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-62849,"Let $f$ be an increasing function from the power set of a finite set $H$ to itself, such that for all $X, Y \subseteq H$ with $X \subseteq Y$, it holds that $f(X) \subseteq f(Y)$. Prove that there exists a subset $H_0 \subseteq H$ such that $f(H_0) = H_0$.","import Mathlib theorem Qwen {H : Type*} [Finite H] (f : Set H → Set H) (hinc : ∀ X Y : Set H, X ⊆ Y → f X ⊆ f Y) (hf : ∀ X : Set H, f X ⊆ X) : ∃ H0 : Set H, f H0 = H0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-62967,"Show that there exists a bijective function $f: \mathbb{N}_{0} \to \mathbb{N}_{0}$ such that for all $m, n \in \mathbb{N}_{0}$, the following equation holds: \[ f(3mn + m + n) = 4f(m)f(n) + f(m) + f(n). \]","import Mathlib theorem v : ∃ (f : ℕ → ℕ), Function.Bijective f ∧ ∀ m n, f (3*m*n+m+n) = 4*f m * f n + f m + f n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-63251,"Prove that in a plane where each point is colored with one of three colors (red, green, or blue), for any given distance \(d\), there always exist two points of the same color that are exactly \(d\) units apart.","import Mathlib theorem prove (f : ℝ × ℝ → Fin 3) (d : ℝ) : ∃ p q, p ≠ q ∧ f p = f q ∧ Real.sqrt ((p.1 - q.1)^2 + (p.2 - q.2)^2) = d := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-63608,"Given a collection of one hundred 10 - element sets such that any two sets have exactly one element in common, prove that \(a_1 \in \bigcap_{B \in U} B\), where \(U\) is the collection of these one hundred 10 - element sets and \(a_1\) is an element of one of the sets in \(U\).","import Mathlib theorem qwen (U : Finset (Finset ℕ)) (hU : U.card = 100) (hU' : ∀ s ∈ U, s.card = 10) (hU'' : ∀ s ∈ U, ∀ t ∈ U, s ≠ t → (s ∩ t).card = 1) (a : ℕ) (ha : ∃ s ∈ U, a ∈ s) : a ∈ ⋂ B ∈ U, B := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-63667,"Show that for any positive integer \(n \ge 3\) and any subset \(S\) of \(\{1, 2, \ldots, n\}\) with size \(|S| > \frac{n}{2} + 1\), there exist three distinct elements \(a, b, c \in S\) such that \((ab)^2 + (bc)^2 + (ca)^2\) is a perfect square.","import Mathlib theorem qwen (n : ℕ) (hn : 3 ≤ n) (S : Finset ℕ) (hS : S ⊆ Finset.Icc 1 n) (hS1 : S.card > n / 2 + 1) : ∃ a ∈ S, ∃ b ∈ S, ∃ c ∈ S, a ≠ b ∧ b ≠ c ∧ c ≠ a ∧ IsSquare ((a * b)^2 + (b * c)^2 + (c * a)^2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-63775,"Prove that for any infinite set \(S\) of positive integers, there exist two distinct elements \(a, b \in S\) such that the sum \(a + b\) has a prime divisor greater than \(10^{2020}\).","import Mathlib theorem Prove (S : Set ℕ) (hS : Infinite S) (hS1 : ∀ n ∈ S, n > 0) : ∃ a ∈ S, ∃ b ∈ S, a ≠ b ∧ ∃ p, Nat.Prime p ∧ p ∣ a + b ∧ p > 10 ^ 2020 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-63833,"Prove that for a given positive integer \(k\), there exists a positive integer \(N\) such that among the integers \(1, 2, \ldots, N\), at least \(0.99N\) of them are good, where a positive integer \(n\) is called good if at least \(0.99n\) of the binomial coefficients \(\binom{n}{0}, \binom{n}{1}, \binom{n}{2}, \ldots, \binom{n}{n}\) are divisible by \(k\).","import Mathlib open Finset theorem prove (k : ℕ) (hk : 0 < k) : ∃ N : ℕ, 0 < N ∧ {x | x ∈ Icc 1 N ∧ {i | i ≤ x ∧ k ∣ Nat.choose x i}.ncard ≥ 99 * x / 100}.ncard ≥ 99 * N / 100 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-63854,"Let $x_1, x_2, \ldots, x_n$ be real numbers, and let $[x]$ denote the fractional part of $x$. Prove that there exists a real number $y$ such that: \[ \sum_{i=1}^n [y - x_i] \leq \frac{n - 1}{2} \]","import Mathlib open Real theorem sum_of_fractional_parts (n : ℕ) (hn : 0 < n) (x : Fin n → ℝ) : ∃ y : ℝ, ∑ i : Fin n, (y - x i) % 1 ≤ (n - 1) / 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-64076,"Consider a $2000 \times 2000$ array where each cell contains either $1$ or $-1$. Given that the sum of all the numbers in the array is non - negative, prove that there exist $1000$ rows and $1000$ columns such that the sum of the numbers at their intersections is at least $1000$.","import Mathlib theorem maxSum (a : Fin 2000 → Fin 2000 → ℤ) (h₀ : ∀ i j, a i j = 1 ∨ a i j = -1) (h₁ : ∑ i, ∑ j, a i j ≥ 0) : ∃ r c : Finset (Fin 2000), r.card = 1000 ∧ c.card = 1000 ∧ ∑ i ∈ r, ∑ j ∈ c, a i j ≥ 1000 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-64172,"Let $A$ be a set of $N$ residues modulo $N^2$. Prove that there exists a set $B$ of $N$ residues modulo $N^2$ such that the set $A + B = \{a + b \mid a \in A, b \in B\}$ contains at least $\frac{N^2}{2}$ distinct residues modulo $N^2$.","import Mathlib theorem algebra_485695 (N : ℕ) (hN : 0 < N) (A : Finset (ZMod (N ^ 2))) : ∃ B : Finset (ZMod (N ^ 2)), B.card = N ∧ {x | ∃ a ∈ A, ∃ b ∈ B, x = a + b}.ncard ≥ N ^ 2 / 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-64677,"Prove that for any $\delta > 0$ and a fixed $n > 0$, the set $\{f(z) : 0 < |z| < \delta\}$ of the function $f(z) = z^n \sin\left(\frac{1}{z}\right)$ is $\mathbb{C}$.","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem prove (δ : ℝ) (hδ : δ > 0) (n : ℕ) (hn : n > 0) (f : ℂ → ℂ) (hf : f = λ z => z ^ n * sin (1 / z)) : {w | ∃ z, w = f z ∧ 0 < ‖z‖ ∧ ‖z‖ < δ} = ⊤ := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-64718,"Let $A$ be a subset of the set of positive integers that satisfies the following two properties: 1. If $a \in A$, then all divisors of $a$ are also in $A$. 2. If $a, b \in A$ with $1 < a < b$, then $1 + ab \in A$. Prove that if $A$ contains at least three positive integers, then $A$ contains all positive integers.","import Mathlib theorem qwen (A : Set ℕ) (hA : ∀ a ∈ A, 0 < a) (hA1 : ∀ a ∈ A, ∀ d ∈ Nat.divisors a, d ∈ A) (hA2 : ∀ a ∈ A, ∀ b ∈ A, 1 < a ∧ a < b → 1 + a * b ∈ A) (hA3 : ∃ x y z, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ x ∈ A ∧ y ∈ A ∧ z ∈ A) : ∀ n, 0 < n → n ∈ A := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-64720,"Prove that if \(A\) is a subset of the set of positive integers such that: 1. If \(a \in A\), then all divisors of \(a\) are also in \(A\). 2. If \(a, b \in A\) with \(1 < a < b\), then \(1 + ab \in A\). and \(A\) contains at least three positive integers, then \(A\) contains all positive integers.","import Mathlib theorem prove (A : Set ℕ) (hA : ∀ x ∈ A, 0 < x) (h1 : ∀ a ∈ A, ∀ d ∈ Nat.divisors a, d ∈ A) (h2 : ∀ a b : ℕ, a ∈ A → b ∈ A → 1 < a → a < b → (1 + a * b) ∈ A) (h3 : ∃ x y z : ℕ, x ∈ A ∧ y ∈ A ∧ z ∈ A ∧ 0 < x ∧ 0 < y ∧ 0 < z) : ∀ n : ℕ, 0 < n → n ∈ A := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-64929,"Prove that the only non - empty subsets $A$, $B$, $C$ of $\mathbb{N}$ that satisfy the following conditions: 1. $A \cap B = B \cap C = C \cap A = \emptyset$ 2. $A \cup B \cup C = \mathbb{N}$ 3. For all $a \in A$, $b \in B$, $c \in C$, the following conditions hold: $a + c \in A$, $b + c \in B$, and $a + b \in C$ are $A = \{x \mid x \equiv 1 \pmod{3}\}$, $B = \{x \mid x \equiv 2 \pmod{3}\}$, $C = \{x \mid x \equiv 0 \pmod{3}\}$ or $A = \{x \mid x \equiv 2 \pmod{3}\}$, $B = \{x \mid x \equiv 1 \pmod{3}\}$, $C = \{x \mid x \equiv 0 \pmod{3}\}$.","import Mathlib theorem prove (A B C : Set ℕ) (hA : A.Nonempty) (hB : B.Nonempty) (hC : C.Nonempty) (hAB : A ∩ B = ∅) (hBC : B ∩ C = ∅) (hCA : C ∩ A = ∅) (hABC : A ∪ B ∪ C = ℕ) (hA' : ∀ a ∈ A, ∀ b ∈ B, ∀ c ∈ C, a + c ∈ A) (hB' : ∀ a ∈ A, ∀ b ∈ B, ∀ c ∈ C, b + c ∈ B) (hC' : ∀ a ∈ A, ∀ b ∈ B, ∀ c ∈ C, a + b ∈ C) : (A = {x | x ≡ 1 [MOD 3]} ∧ B = {x | x ≡ 2 [MOD 3]} ∧ C = {x | x ≡ 0 [MOD 3]}) ∨ (A = {x | x ≡ 2 [MOD 3]} ∧ B = {x | x ≡ 1 [MOD 3]} ∧ C = {x | x ≡ 0 [MOD 3]}) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-65120,"Prove that if $G$ is a finite group and $I = \{g \in G : g^2 = e\} \setminus \{e\}$ is the subset of involutions in $G$ such that $\text{card}(I) \geq \frac{3}{4} \text{card}(G)$, then $G$ is an abelian group.","import Mathlib theorem algebra_471689 {G : Type*} [Group G] [Finite G] (hinv : Nat.card {g : G | g ^ 2 = 1 ∧ g ≠ 1} ≥ 3 * Nat.card G / 4) : ∀ x y : G, x * y = y * x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-65311,"Prove that for any $s, p \in \mathbb{N}^2$ such that $s \geq 2p^2$ and any set of distinct points $M_1, \dots, M_s \in \mathbb{Z}^2$, there exists a subset $I \subseteq \{1, 2, \dots, s\}$ containing at least $\frac{s}{p^2}$ integers such that for all $i \neq j \in I$, the inequality $\|M_i - M_j\| \geq p$ holds, where $\| (x, y) \| = \max(|x|, |y|)$.","import Mathlib open Finset Real Int Nat theorem prove (s p : ℕ) (h₀ : s ≥ 2 * p ^ 2) (M : Fin s → ℤ × ℤ) (h₁ : ∀ i j, M i = M j → i = j) : ∃ I : Finset (Fin s), I.card ≥ s / p ^ 2 ∧ ∀ i ∈ I, ∀ j ∈ I, i ≠ j → ‖M i - M j‖ ≥ p := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-65453,"Let \(p_1, p_2, \dots, p_r\) be distinct prime numbers, and let \(n_1, n_2, \dots, n_r\) be arbitrary natural numbers. Prove that the number of pairs of integers \((x, y)\) satisfying the equation \[ x^3 + y^3 = p_1^{n_1} p_2^{n_2} \cdots p_r^{n_r} \] does not exceed \(2^{r+1}\).","import Mathlib theorem Qwen (r : ℕ) (hr : 0 < r) (p : Fin r → ℕ) (hp : ∀ i j, p i = p j → i = j) (hp1 : ∀ i, Nat.Prime (p i)) (n : Fin r → ℕ) : Set.ncard {xy : ℤ × ℤ | xy.1 ^ 3 + xy.2 ^ 3 = ∏ i : Fin r, (p i) ^ (n i)} ≤ 2 ^ (r + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-65534,"1. **Part (a)**: - Prove that for any positive integer \(n\), there exist \(n\) lattice points \((x_1,y_1),(x_2,y_2),\cdots,(x_n,y_n)\) in the plane such that for any non - empty subset \(\{(x_{i_1},y_{i_1}),(x_{i_2},y_{i_2}),\cdots,(x_{i_m},y_{i_m})\}\) of these points (\(1\leq m\leq n\)), the center of gravity \(\left(\frac{1}{m}\sum_{j = 1}^{m}x_{i_j},\frac{1}{m}\sum_{j = 1}^{m}y_{i_j}\right)\) has integer coordinates. 2. **Part (b)**: - Prove that it is not possible to find an infinite set of lattice points in the plane such that the center of gravity of any finite subset of these points is a lattice point.","import Mathlib open Real open scoped BigOperators theorem part_a (n : ℕ) (hn : 0 < n) : ∃ x y : Fin n → ℤ, ∀ s : Finset (Fin n), s ≠ ∅ → ∃ c : ℤ × ℤ, (∑ i ∈ s, x i) / s.card = c.1 ∧ (∑ i ∈ s, y i) / s.card = c.2 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-65538,"Prove that the remainder when the number of minimally - intersecting ordered triples of sets $(A,B,C)$ (where $|A \cap B| = |B \cap C| = |C \cap A| = 1$, $A \cap B \cap C = \emptyset$, and $A,B,C\subseteq\{1,2,3,4,5,6,7\}$) is divided by $1000$ is $760$.","import Mathlib theorem count_minimally_intersecting_triples : {(A, B, C) : Finset ℕ × Finset ℕ × Finset ℕ | A ⊆ {1, 2, 3, 4, 5, 6, 7} ∧ B ⊆ {1, 2, 3, 4, 5, 6, 7} ∧ C ⊆ {1, 2, 3, 4, 5, 6, 7} ∧ A ∩ B = {1} ∧ B ∩ C = {1} ∧ C ∩ A = {1} ∧ A ∩ B ∩ C = ∅}.ncard % 1000 = 760 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-65540,"Prove that the remainder when the number of minimally - intersecting ordered triples of sets $(A,B,C)$ (where $|A \cap B| = |B \cap C| = |C \cap A| = 1$, $A \cap B \cap C = \emptyset$, and each set is a subset of $\{1,2,3,4,5,6,7\}$) is divided by $1000$ is $760$.","import Mathlib theorem count_triples : {(A, B, C) : Finset ℕ × Finset ℕ × Finset ℕ | A ⊆ {1, 2, 3, 4, 5, 6, 7} ∧ B ⊆ {1, 2, 3, 4, 5, 6, 7} ∧ C ⊆ {1, 2, 3, 4, 5, 6, 7} ∧ A ∩ B = {1} ∧ B ∩ C = {1} ∧ C ∩ A = {1} ∧ A ∩ B ∩ C = ∅}.ncard % 1000 = 760 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-65541,"Prove that the remainder when the number \(N\) of minimally - intersecting ordered triples \((A,B,C)\) of sets, where each set is a subset of \(\{1,2,3,4,5,6,7\}\) and a minimally - intersecting triple satisfies \(|A \cap B| = |B \cap C| = |C \cap A| = 1\) and \(A \cap B \cap C=\emptyset\), is divided by \(1000\) is \(760\).","import Mathlib theorem count_minimally_intersecting_triples : {(A, B, C) : Finset ℕ × Finset ℕ × Finset ℕ | A ⊆ Finset.Icc 1 7 ∧ B ⊆ Finset.Icc 1 7 ∧ C ⊆ Finset.Icc 1 7 ∧ (A ∩ B).card = 1 ∧ (B ∩ C).card = 1 ∧ (C ∩ A).card = 1 ∧ (A ∩ B ∩ C) = ∅}.ncard % 1000 = 760 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-65543,"Prove that the remainder when the number of minimally - intersecting ordered triples of sets, where each set is a subset of \(\{1,2,3,4,5,6,7\}\) and a minimally - intersecting ordered triple \((A,B,C)\) satisfies \(|A\cap B| = |B\cap C| = |C\cap A| = 1\) and \(A\cap B\cap C=\emptyset\), is divided by \(1000\) is \(760\).","import Mathlib theorem count_minimally_intersecting_triples : Set.ncard {t : Fin 3 → Set ℕ | t 0 ⊆ Finset.Icc 1 7 ∧ t 1 ⊆ Finset.Icc 1 7 ∧ t 2 ⊆ Finset.Icc 1 7 ∧ (t 0 ∩ t 1).encard = 1 ∧ (t 1 ∩ t 2).encard = 1 ∧ (t 2 ∩ t 0).encard = 1 ∧ t 0 ∩ t 1 ∩ t 2 = ∅} % 1000 = 760 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-65545,"Prove that if $N$ is the number of minimally - intersecting ordered triples of sets $(A,B,C)$ where each set is a subset of $\{1,2,3,4,5,6,7\}$ and a minimally - intersecting triple satisfies $|A \cap B| = |B \cap C| = |C \cap A| = 1$ and $A \cap B \cap C=\emptyset$, then the remainder when $N$ is divided by $1000$ is $760$.","import Mathlib theorem count_minimally_intersecting_triples : {(A, B, C) : Set ℕ × Set ℕ × Set ℕ | A ⊆ Finset.Icc 1 7 ∧ B ⊆ Finset.Icc 1 7 ∧ C ⊆ Finset.Icc 1 7 ∧ Set.ncard (A ∩ B) = 1 ∧ Set.ncard (B ∩ C) = 1 ∧ Set.ncard (C ∩ A) = 1 ∧ A ∩ B ∩ C = ∅}.ncard % 1000 = 760 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-65633,"Prove that for any set \(S\) of \(2n - 1\) integers, there exists a subset \(T\subseteq S\) with \(|T|=n\) such that \(\sum_{t\in T}t\equiv0\pmod{n}\).","import Mathlib theorem Finset.sumEqZero {n : ℕ} (hn : 0 < n) (S : Finset ℤ) (hS : S.card = 2 * n - 1) : ∃ T ⊆ S, T.card = n ∧ ∑ t ∈ T, t ≡ 0 [ZMOD n] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-66029,"Let $n$ be a positive integer. Prove that it is possible to select at least $2^{n-1} + n$ numbers from the set $\{1, 2, 3, \ldots, 2^n\}$ such that for any two distinct chosen numbers $x$ and $y$, the sum $x + y$ is not a divisor of the product $x \cdot y$.","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) : ∃ s : Finset ℕ, s ⊆ Finset.Icc 1 (2 ^ n) ∧ s.card ≥ 2 ^ (n - 1) + n ∧ ∀ x ∈ s, ∀ y ∈ s, x ≠ y → ¬(x + y ∣ x * y) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-66817,"Prove that the number of ordered pairs of positive integers \((x_0, x_1)\) for a sequence \(x_n\) defined by the recurrence relation \(x_n=\frac{1 + x_{n - 1}}{x_{n - 2}}\) for \(n\geq2\) such that \(x_{2018}=\frac{1}{1000}\) is \(128\).","import Mathlib open Finset theorem number_of_pairs : {(x0, x1) : ℕ × ℕ | x0 > 0 ∧ x1 > 0 ∧ ∃ x : ℕ → ℚ, (∀ n ≥ 2, x n = (1 + x (n - 1)) / x (n - 2)) ∧ x 2018 = 1 / 1000}.ncard = 128 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-66923,"Prove that if $A = \bigcap_{n \geq 1} V_n$, where for each $n \geq 1$, $V_n$ is an open dense subset of $\mathbb{R}$, then statements $(a)$ and $(d)$ are true, where $(a)$ states that $A$ is a non - empty set and $(d)$ states that $A$ is dense in $\mathbb{R}$.","import Mathlib open Set Real theorem A (V : ℕ → Set ℝ) (hV : ∀ n, IsOpen (V n) ∧ Dense (V n)) (A : Set ℝ) (hA : A = ⋂ n, V n) : A ≠ ∅ ∧ Dense A := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-66945,"Let $n$ be a positive integer. Prove that the following identity holds: $$\sum_{k=0}^n \frac{(-1)^k \left( \frac{n}{2} - k \right)^n}{k!(n-k)!} = 1$$","import Mathlib open Finset Real Nat theorem sumIdentity (n : ℕ) (hn : 0 < n) : ∑ k ∈ range (n + 1), (-1 : ℝ)^k * (n / 2 - k)^n / (Nat.factorial k * Nat.factorial (n - k)) = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-67267,"Prove that for a graph \(G\) with metric dimension \(\text{dim}(G)=x\), edge metric dimension \(\text{edim}(G)=y\), and number of vertices \(|V(G)| = n\), the triples \((x, y, n)\) that satisfy \(1 < x \le y \le 2^x + x - 2 \le n - 2\) are precisely those for which \(2 \le x \le y \le 2^x + x - 2\) and \(n \ge 2^x + x\).","import Mathlib open Real Set open scoped BigOperators theorem graph_dimensions (x y n : ℕ) : (1 < x ∧ x ≤ y ∧ y ≤ 2 ^ x + x - 2 ∧ 2 ^ x + x - 2 ≤ n - 2) ↔ (2 ≤ x ∧ x ≤ y ∧ y ≤ 2 ^ x + x - 2 ∧ n ≥ 2 ^ x + x) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-67319,"Prove that the maximum number of [i]spanning[/i] integers that a function $f: \mathbb{Z} \rightarrow \mathbb{Z}$ can have is $\boxed{1}$, where an integer $a$ is defined as [i]spanning[/i] if for every integer $b \neq a$, there exists a positive integer $k$ such that $f^k(a) = b$.","import Mathlib def is_spanning (f : ℤ → ℤ) (x : ℤ) := ∀ y ≠ x, ∃ k > 0, f^[k] x = y theorem max_spanning (f : ℤ → ℤ) : Set.ncard {x | is_spanning f x} ≤ 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-67322,"Prove that the maximum number of [i]spanning[/i] integers of a function \(f: \mathbb{Z} \rightarrow \mathbb{Z}\), where an integer \(a\) is defined as [i]spanning[/i] if for every integer \(b \neq a\), there exists a positive integer \(k\) such that \(f^k(a) = b\), is \(1\).","import Mathlib theorem max_spanning (f : ℤ → ℤ) : Set.ncard {x | ∀ y ≠ x, ∃ k > 0, f^[k] x = y} ≤ 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-67763,"For \(r > 0\), let \(B_r\) denote the set of points in \(\mathbb{R}^3\) that are at a distance of at most \(r\) length units from the origin. Let \(P_r\) be the subset of \(B_r\) consisting of points with integer coordinates. Prove that the equation \[xy^3z + 2x^3z^3 - 3x^5y = 0\] has an odd number of solutions \((x, y, z)\) in \(P_r\).","import Mathlib open Real Set open scoped BigOperators theorem OddSolutions {r : ℝ} (hr : r > 0) : Odd {(x, y, z) : ℤ × ℤ × ℤ | (x^2 + y^2 + z^2) ≤ r^2 ∧ x * y^3 * z + 2 * x^3 * z^3 - 3 * x^5 * y = 0}.ncard := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-67907,"Prove that if $a_1, a_2, \ldots, a_{99}$ and $b_1, b_2, \ldots, b_{99}$ are sequences of nonnegative real numbers such that $\sum_{i=1}^{99} a_i = 1$ and $\sum_{i=1}^{99} b_i = 1$, then it is always possible to select a subset $S$ of $\{1, 2, \ldots, 99\}$ with $|S| = 50$ such that $\sum_{s \in S} a_s \geq \frac{1}{2}$ and $\sum_{s \in S} b_s \geq \frac{1}{2}$.","import Mathlib theorem prove (a b : Fin 99 → ℝ) (ha : ∑ i : Fin 99, a i = 1) (hb : ∑ i : Fin 99, b i = 1) (hpos : ∀ i : Fin 99, a i ≥ 0 ∧ b i ≥ 0) : ∃ S : Finset (Fin 99), S.card = 50 ∧ ∑ s ∈ S, a s ≥ 1 / 2 ∧ ∑ s ∈ S, b s ≥ 1 / 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-67986,"Let \(A, B, C\) be three disjoint subsets of \(S = \{1, 2, 3, \ldots, 3n\}\) such that \(|A| = |B| = |C| = n\). Prove that there exist \(a \in A\), \(b \in B\), and \(c \in C\) such that one of these numbers is the sum of the other two.","import Mathlib theorem Finset.sum' (n : ℕ) (hn : 0 < n) (A B C : Finset ℕ) (hA : A ⊆ Finset.Icc 1 (3 * n)) (hB : B ⊆ Finset.Icc 1 (3 * n)) (hC : C ⊆ Finset.Icc 1 (3 * n)) (hAB : A ∩ B = ∅) (hAC : A ∩ C = ∅) (hBC : B ∩ C = ∅) (hA' : A.card = n) (hB' : B.card = n) (hC' : C.card = n) : ∃ a ∈ A, ∃ b ∈ B, ∃ c ∈ C, a + b = c ∨ a + c = b ∨ b + c = a := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-68026,"Prove that the maximal possible number of matrices in the set $\mathcal{M} \subset M_3(\mathbb{Z}_2)$ such that for every $A, B \in \mathcal{M}$ with $A \ne B$, the determinant $\det(A + B) \ne 0$, is \(8\).","import Mathlib open Matrix Finset theorem max_set : IsGreatest {n | ∃ M : Finset (Matrix (Fin 3) (Fin 3) (ZMod 2)), M.card = n ∧ ∀ A ∈ M, ∀ B ∈ M, A ≠ B → (A + B).det ≠ 0} 8 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-68154,Prove that \(\lim_{n\to\infty}\sqrt[n]{\binom{n}{1}\binom{n}{2}\cdots\binom{n}{n}} = \infty\).,"import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (f : ℕ → ℝ) (h₀ : ∀ n, f n = (∏ i ∈ Icc 1 n, Nat.choose n i) ^ ((1 : ℝ)/n)) : Tendsto f atTop atTop := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-68728,"Prove that the only *beautiful* function \(f: \mathbb{N} \rightarrow \mathbb{N}\), where a function \(f\) is *beautiful* if for all distinct positive integers \(x\) and \(y\) the following conditions hold: \[S(\gcd(f(x), f(y))) = S(\gcd(x, y))\] \[S(\text{lcm}(f(x), f(y))) = S(\text{lcm}(x, y))\] and \(S(x)\) denotes the sum of the digits of the positive integer \(x\), is the function \(f(x)=x\).","import Mathlib def isBeautiful (f : ℕ → ℕ) : Prop := ∀ x y, x > 0 → y > 0 → x ≠ y → (Nat.digits 10 (Nat.gcd (f x) (f y))).sum = (Nat.digits 10 (Nat.gcd x y)).sum ∧ (Nat.digits 10 (Nat.lcm (f x) (f y))).sum = (Nat.digits 10 (Nat.lcm x y)).sum theorem proveIsBeautiful : ∃! f : ℕ → ℕ, isBeautiful f ∧ ∀ x, f x = x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-68748,"Define a sequence \((n_k)_{k\ge 0}\) by \(n_0 = n_1 = 1\), and \(n_{2k} = n_k + n_{k - 1}\) and \(n_{2k+1} = n_k\) for \(k \ge 1\). Let \(q_k=\frac{n_k}{n_{k - 1}}\) for each \(k \ge 1\). Prove that every positive rational number appears exactly once in the sequence \((q_k)_{k\ge 1}\).","import Mathlib open Finset theorem q (n : ℕ → ℚ) (h₀ : n 0 = 1 ∧ n 1 = 1) (h₁ : ∀ k ≥ 1, n (2 * k) = n k + n (k - 1)) (h₂ : ∀ k ≥ 1, n (2 * k + 1) = n k) (h₃ : ∀ k ≥ 1, n k / n (k - 1) > 0) : ∀ q' : ℚ, q' > 0 → ∃! k ≥ 1, n k / n (k - 1) = q' := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-69114,"Let $X$ be a set with $46$ elements, and let $A_1, A_2, \ldots, A_m$ be subsets of $X$ such that: (i) \(|A_i| = 3\) for \(i = 1, 2, \ldots, m\) (ii) \(|A_i \cap A_j| \leq 1\) for any two distinct indices \(i, j\). Prove that there exists a subset \(Y\subseteq X\) with \(|Y|\geq 10\) such that \(A_i ot\subseteq Y\) for all \(i = 1,2,\ldots,m\).","import Mathlib theorem Qwen (X : Finset ℕ) (hX : X.card = 46) (A : Finset (Finset ℕ)) (hA : ∀ s ∈ A, s ⊆ X) (hA1 : ∀ s ∈ A, s.card = 3) (hA2 : ∀ s ∈ A, ∀ t ∈ A, s ≠ t → (s ∩ t).card ≤ 1) : ∃ Y : Finset ℕ, Y ⊆ X ∧ Y.card ≥ 10 ∧ ∀ s ∈ A, ¬(s ⊆ Y) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-69844,"Prove that for all \(n \in \mathbb{N}\) with \(n \geq 3\), there exist two sets of two - by - two distinct natural numbers \(\{a_1, a_2, \ldots, a_n\}\) and \(\{b_1, b_2, \ldots, b_n\}\) such that: \[ a_1 + a_2 + \cdots + a_n = b_1 + b_2 + \cdots + b_n \] and \[ a_1^2 + a_2^2 + \cdots + a_n^2 = b_1^2 + b_2^2 + \cdots + b_n^2. \]","import Mathlib theorem prove (n : ℕ) (hn : 3 ≤ n) : ∃ a b : Finset ℕ, a.card = n ∧ b.card = n ∧ (∀ i ∈ a, i > 0) ∧ (∀ i ∈ b, i > 0) ∧ (∑ i ∈ a, i) = (∑ i ∈ b, i) ∧ (∑ i ∈ a, i^2) = (∑ i ∈ b, i^2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-70403,"Prove that the number of distinct values of \(t\) for which \(f^{(2014)}(t) = 1\), where \(f(x)=2x^2 - 1\), is \(2^{2013}\).","import Mathlib open Finset Real Nat theorem algebra_476218 {f : ℝ → ℝ} (hf : f = fun x => 2 * x ^ 2 - 1) : {t : ℝ | iteratedDeriv 2014 f t = 1}.ncard = 2 ^ 2013 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-70608,"Prove that the only function \(F: X \to X\), where \(X = \{ S \mid S \subset \{1,2,3,4,5,6\} \}\), such that for any \(A, B \in X\), the condition \(F(F(A) \cap B) = A \cup F(B)\) holds is \(F(A) = A^c\), where \(A^c\) denotes the complement of \(A\) in \(\{1,2,3,4,5,6\}\).","import Mathlib open Finset theorem Function_compl : ∀ (F : Finset (Finset.Icc 1 6) → Finset (Finset.Icc 1 6)), (∀ A B, F (F A ∩ B) = A ∪ F B) ↔ ∀ A, F A = ((Finset.univ \ A) : Finset (Finset.Icc 1 6)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-71195,"Let $k > 1$ be a fixed odd integer. For non - negative integers $n$, define the function $f_n$ as follows: $$f_n = \sum_{\substack{0 \leq i \leq n \\ k \mid n - 2i}} \binom{n}{i}.$$ Prove that the sequence $\{f_n\}$ satisfies the recurrence relation: $$f_n^2 = \sum_{i=0}^{n} \binom{n}{i} f_i f_{n - i}.$$","import Mathlib theorem Finset.sum_eq_sum' {k : ℕ} (hk : Odd k ∧ k > 1) (f : ℕ → ℤ) (h₀ : ∀ n, f n = ∑ i ∈ Finset.Icc 0 n, if k ∣ n - 2 * i then Nat.choose n i else 0) : ∀ n, (f n)^2 = ∑ i ∈ Finset.range (n + 1), Nat.choose n i * f i * f (n - i) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-71663,"Let \(P_1, P_2, \ldots, P_r\) be prime numbers, and let \(k, c_1, c_2, \ldots, c_r\) be natural numbers. Prove that there exist infinitely many natural numbers \(n\) such that \(\frac{C(n, k)}{P_i^{c_i}}\) is an integer but \(\frac{C(n, k)}{P_i^{c_i+1}}\) is not an integer for each \(i = 1, 2, \ldots, r\).","import Mathlib theorem Qwen (r : ℕ) (hr : 0 < r) (P : Fin r → ℕ) (hP : ∀ i, Nat.Prime (P i)) (k : ℕ) (c : Fin r → ℕ) : ∀ N, ∃ n, n > N ∧ ∀ i, ∃ m : ℤ, m * P i ^ (c i) = Nat.choose n k ∧ ¬∃ m : ℤ, m * P i ^ (c i + 1) = Nat.choose n k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-71873,"Prove that if $S = \{1, 2, \ldots, n\}$ and $T$ is a set of ordered pairs of elements from $S$ such that, for any $i, j \in S$, there are exactly $m$ values of $k$ for which both $(i, k) \in T$ and $(k, j) \in T$, then the only possible pair $(n, m)$ is $(n, 0)$.","import Mathlib theorem prove (n m : ℕ) (hn : 0 < n) (hm : 0 ≤ m) (T : Finset (Fin n × Fin n)) (hT : ∀ i j : Fin n, {k : Fin n | (i, k) ∈ T ∧ (k, j) ∈ T}.encard = m) : (n, m) = (n, 0) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-72173,"Prove that for any compact subset $K$ of $\mathbb{R}^n$, the set of points $x \in \mathbb{R}^n \setminus K$ such that the closest point to $x$ in $K$ is unique has positive measure.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MeasureTheory.volume (n : ℕ) (hn : 0 < n) (K : Set (EuclideanSpace ℝ (Fin n))) (hK : IsCompact K) : (MeasureTheory.volume {x : EuclideanSpace ℝ (Fin n) | x ∉ K ∧ ∃! y ∈ K, dist x y = sInf {dist x z | z ∈ K}}).toReal > 0 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-72232,"Prove that for every natural number \(n \geq 3\), there exist two disjoint sets of integers \(A = \{x_1, x_2, \ldots, x_n\}\) and \(B = \{y_1, y_2, \ldots, y_n\}\) such that: 1. \(\sum_{i=1}^{n} x_i = \sum_{i=1}^{n} y_i\) 2. \(\sum_{i=1}^{n} x_i^2 = \sum_{i=1}^{n} y_i^2\)","import Mathlib theorem prove (n : ℕ) (hn : 3 ≤ n) : ∃ A B : Finset ℤ, A.card = n ∧ B.card = n ∧ A ∩ B = ∅ ∧ (∑ i ∈ A, i) = (∑ i ∈ B, i) ∧ (∑ i ∈ A, i ^ 2) = (∑ i ∈ B, i ^ 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-72332,"Prove that the set of all positive integers \(n\) for which there exist infinitely many integers \(k\) such that the binomial coefficients \(\binom{k}{0}, \binom{k}{1}, \binom{k}{2}, \ldots, \binom{k}{k}\) are all coprime to \(n\) is precisely the set of all positive integers \(n\) that are powers of a prime.","import Mathlib theorem prove (n : ℕ) : n > 0 ∧ {k | ∀ i ∈ Finset.Icc 0 k, Nat.Coprime (Nat.choose k i) n}.Infinite ↔ ∃ p m, Nat.Prime p ∧ n = p ^ m := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-72644,"Prove that the largest possible value of \(n\) such that every ten - element subset of the set \(\{4, 5, 6, \ldots, n\}\) of consecutive positive integers has the triangle property (i.e., contains three distinct elements that can serve as the lengths of the sides of a triangle with a positive area) is \(n = 253\).","import Mathlib def isGood (n : ℕ) : Prop := ∀ s : Finset ℕ, s ⊆ Finset.Icc 4 n ∧ s.card = 10 → ∃ x ∈ s, ∃ y ∈ s, ∃ z ∈ s, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ (x + y > z) ∧ (y + z > x) ∧ (z + x > y) theorem maxGood : IsGreatest {n | isGood n} 253 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-72898,"Prove that for a prime number \(p \geq 5\), the expression \(C_{p^2}^{p} - p\) is divisible by \(p^5\), i.e., \(\left(C_{p^2}^{p} - p\right) \vdots p^5\).","import Mathlib theorem Nat.choose_p5 (p : ℕ) (hp : Nat.Prime p) (h : 5 ≤ p) : p ^ 5 ∣ Nat.choose (p ^ 2) p - p := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-73734,"Prove that if \(A\) is a subset of the set of positive integers such that: 1. If \(a \in A\), then all divisors of \(a\) are also in \(A\). 2. If \(a, b \in A\) with \(1 < a < b\), then \(1 + ab \in A\). 3. \(A\) contains at least three positive integers. Then \(A\) contains all positive integers.","import Mathlib theorem prove (A : Set ℕ) (hA : ∀ a ∈ A, 0 < a) (hA1 : ∀ a ∈ A, ∀ d ∈ Nat.divisors a, d ∈ A) (hA2 : ∀ a ∈ A, ∀ b ∈ A, 1 < a ∧ a < b → 1 + a * b ∈ A) (hA3 : A.ncard ≥ 3) : ∀ n, 0 < n → n ∈ A := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-73919,"1. **For the set \(S = \mathbb{N}\)**: - Prove that there does not exist a Spanish Couple \((f,g)\) on the set \(S=\mathbb{N}\), where a Spanish Couple \((f,g)\) on a set \(S\subseteq\mathbb{R}\) is defined as a pair of functions \(f,g:S\to S\) such that \(f\) and \(g\) are strictly increasing (i.e., \(f(x) 0) ∧ (∀ x ∈ B, x > 0) ∧ A.card = 2 ^ k ∧ B.card = 2 ^ k ∧ {x | ∃ a b, a ∈ A ∧ b ∈ A ∧ a ≠ b ∧ x = a + b} = {x | ∃ a b, a ∈ B ∧ b ∈ B ∧ a ≠ b ∧ x = a + b} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-75498,"Let $S$ be a finite set. Prove that there exists a function $f : S^2 \to S$ satisfying the following conditions for all $a, b, c, d \in S$: 1. $f(a, b) = f(b, a)$, 2. $f(a, f(a, b)) = b$, 3. $f(f(a, b), f(c, d)) = f(f(a, c), f(b, d))$.","import Mathlib theorem FiniteSet {α : Type*} [Fintype α] : ∃ f : α → α → α, ∀ a b c d : α, f a b = f b a ∧ f a (f a b) = b ∧ f (f a b) (f c d) = f (f a c) (f b d) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-75735,"Prove that if $f: \mathbb{N}_0 \to \mathbb{N}_0$ is a bijection, then there exist non - negative integers $a < b < c$ such that $f(a) + f(c) = 2f(b)$.","import Mathlib theorem Function_Bijective (f : ℕ → ℕ) (hf : Function.Bijective f) : ∃ a b c : ℕ, a < b ∧ b < c ∧ f a + f c = 2 * f b := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-76235,"Prove that for the generating function \(F(x)=\frac{1}{1 - x}\cdot\frac{1}{1 - x^2}\cdot\frac{1}{1 - x^5}=\sum_{n = 0}^{\infty}a_nx^n\), the coefficient \(a_n\) of \(x^n\) in the series expansion of \(F(x)\) is given by \(a_n=\frac{n^2}{20}+\frac{2n}{5}+\frac{27}{40}+\frac{\cos(\pi n)}{8}+\frac{2\sqrt{5}}{25}\cos\left[\frac{2\pi}{5}(n - 1)\right]+\frac{2\sqrt{5}}{25}\cos\left[\frac{\pi}{5}(4n + 1)\right]\).","import Mathlib open Real Set open scoped BigOperators theorem F (a : ℕ → ℝ) (hF : ∀ x, 1 / (1 - x) * 1 / (1 - x ^ 2) * 1 / (1 - x ^ 5) = ∑' n, a n * x ^ n) : ∀ n, a n = n ^ 2 / 20 + 2 * n / 5 + 27 / 40 + cos (π * n) / 8 + 2 * sqrt 5 / 25 * cos ((2 * π / 5) * (n - 1)) + 2 * sqrt 5 / 25 * cos ((π / 5) * (4 * n + 1)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-77251,"Let $S$ be a set with $n$ elements, and let $A_1, A_2, \ldots, A_n$ be subsets of $S$. Assume that for every pair of elements of $S$, there is exactly one $i$ such that $A_i$ contains this pair, and $|A_i| > 1$ for all $i$. Prove that for every $i, j$ (with $i \neq j$), the sets $A_i$ and $A_j$ have exactly one element in common, i.e., \(|A_i \cap A_j| = 1\).","import Mathlib theorem SetInter {n : ℕ} {S : Type*} [Fintype S] (hS : Fintype.card S = n) {A : Fin n → Set S} (hA : ∀ x y : S, ∃! i : Fin n, x ∈ A i ∧ y ∈ A i) (hA' : ∀ i : Fin n, Set.ncard (A i) > 1) : ∀ i j : Fin n, i ≠ j → Set.ncard (A i ∩ A j) = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-77274,"Prove that the sum of the three least values of \(c\) for which there exist positive integers \(a\) and \(b\) with \(a < b < c\) such that the minimum number of stamps in a collection of postage stamps in denominations \(a\), \(b\), and \(c\) cents (where the collection contains at least one stamp of each denomination and can form every whole - number of cents up to \(1000\) cents) is \(97\) is equal to \(188\).","import Mathlib theorem prove : (Nat.nth {c : ℕ | ∃ a b : ℕ, 0 < a ∧ 0 < b ∧ a < b ∧ b < c ∧ ∀ x ∈ Finset.Icc 1 1000, ∃ m n p : ℕ, m > 0 ∧ n > 0 ∧ p > 0 ∧ x = a * m + b * n + c * p} 0) + (Nat.nth {c : ℕ | ∃ a b : ℕ, 0 < a ∧ 0 < b ∧ a < b ∧ b < c ∧ ∀ x ∈ Finset.Icc 1 1000, ∃ m n p : ℕ, m > 0 ∧ n > 0 ∧ p > 0 ∧ x = a * m + b * n + c * p} 1) + (Nat.nth {c : ℕ | ∃ a b : ℕ, 0 < a ∧ 0 < b ∧ a < b ∧ b < c ∧ ∀ x ∈ Finset.Icc 1 1000, ∃ m n p : ℕ, m > 0 ∧ n > 0 ∧ p > 0 ∧ x = a * m + b * n + c * p} 2) = 188 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-77276,"Prove that if $p$ is an odd prime, then the positive integer $n$ such that $n + p^{2021}$ is a power of $p$ and $p^{2022} \mid \binom{2n}{n}$ is given by \(n = p^{a} - p^{2021}\), where \(a \geq 4043\).","import Mathlib theorem prove (p : ℕ) (hp : Odd p ∧ Nat.Prime p) : ∃ n, n > 0 ∧ (∃ k, n + p^2021 = p^k) ∧ p^2022 ∣ Nat.choose (2 * n) n ↔ ∃ a, n = p^a - p^2021 ∧ a ≥ 4043 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-77284,"Prove that for an odd prime number \(p\), the number of non - empty subsets of the set \(\{1, 2, 3, \ldots, p - 2, p - 1\}\) that have the sum of their elements divisible by \(p\) is \(\frac{2^{p-1}-1}{p}+1\).","import Mathlib theorem prove (p : ℕ) (hp : Odd p ∧ Nat.Prime p) : Set.ncard {s : Finset ℕ | s ⊆ Finset.Icc 1 (p - 1) ∧ s ≠ ∅ ∧ p ∣ ∑ x ∈ s, x} = (2^(p - 1) - 1)/p + 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-77436,"Prove that there exist 12 natural - number denominations \(d_1,d_2,\cdots,d_{12}\) such that for any integer \(n\) in the range \(1\leq n\leq6543\), there exist non - negative integers \(a_1,a_2,\cdots,a_{12}\) with \(0\leq a_i\leq8\) for \(i = 1,2,\cdots,12\) satisfying \(\sum_{i = 1}^{12}a_id_i=n\).","import Mathlib theorem prove : ∃ d : Fin 12 → ℕ, ∀ n ∈ Finset.Icc 1 6543, ∃ a : Fin 12 → ℕ, (∀ i, a i ≤ 8) ∧ (∑ i, a i * (d i : ℤ)) = n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-77924,"Prove that if there are \(2019\) distinct points in a plane and the distances between pairs of them attain \(k\) different values, then \(k\geq44\).","import Mathlib theorem prove (S : Finset (EuclideanSpace ℝ (Fin 2))) (hS : S.card = 2019) (k : ℕ) (hk : k = {x | ∃ p q : EuclideanSpace ℝ (Fin 2), p ∈ S ∧ q ∈ S ∧ p ≠ q ∧ x = dist p q}.ncard) : k ≥ 44 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-78290,"Prove that for any odd prime \( p \) and a set \( M \) consisting of \(\frac{p^{2}+1}{2}\) perfect squares, it is possible to select \( p \) elements from the set \( M \) such that their arithmetic mean is an integer.","import Mathlib theorem prove (p : ℕ) (hp : Odd p ∧ Nat.Prime p) (M : Finset ℕ) (hM : M.card = (p ^ 2 + 1) / 2) (hM1 : ∀ m ∈ M, ∃ k, m = k ^ 2) : ∃ S ⊆ M, S.card = p ∧ ∃ j, (S.sum id) / p = j := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-80389,"Prove that the maximum number of elements of a simple subset (a set that does not contain elements \(x, y, z\) such that \(x + y = z\)) of the set \(\{1,2,\cdots,2n + 1\}\) is \(n + 1\).","import Mathlib open Finset theorem Prove (n : ℕ) : IsGreatest {k | ∃ s : Finset ℕ, s ⊆ Icc 1 (2 * n + 1) ∧ s.card = k ∧ ∀ x ∈ s, ∀ y ∈ s, ∀ z ∈ s, x + y ≠ z} (n + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-82093,"Prove that the minimum number \(n\) of non - negative real numbers \(m_1,m_2,\ldots,m_n\) such that for all distinct \(i,j,k\in\{1,2,\ldots,n\}\), \(m_i + m_j + m_k<0.05\times\left(\sum_{l = 1}^{n}m_l-(m_i + m_j + m_k)\right)\) is \(n = 64\).","import Mathlib open Real Set open scoped BigOperators theorem n : IsLeast {n | ∃ m : Fin n → ℝ, (∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → m i + m j + m k < 0.05 * (∑ l : Fin n, m l - (m i + m j + m k))) ∧ (∀ i, 0 ≤ m i)} 64 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-83195,"Prove that the minimum number of non - negative real numbers \(m_1,m_2,\cdots,m_n\) such that for any distinct \(i,j,k\in\{1,2,\cdots,n\}\), \(m_i + m_j + m_k<\frac{1}{21}\sum_{l = 1}^{n}m_l\) is \(n = 64\).","import Mathlib open Real Set open scoped BigOperators theorem n_min : IsLeast {n | ∃ m : Fin n → ℝ, (∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → m i + m j + m k < 1/21 * ∑ l, m l) ∧ (∀ i, 0 ≤ m i)} 64 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-83396,"Let \(A=(a_{ij})\) be a \(2000\times2000\) matrix where \(a_{ij}\in\{1, - 1\}\) for \(i = 1,\cdots,2000\) and \(j = 1,\cdots,2000\), and \(\sum_{i = 1}^{2000}\sum_{j = 1}^{2000}a_{ij}\geq0\). Prove that there exist subsets \(I,J\subseteq\{1,\cdots,2000\}\) with \(|I| = |J|=1000\) such that \(\sum_{i\in I}\sum_{j\in J}a_{ij}\geq1000\).","import Mathlib open Finset Matrix theorem MatrixSum (a : Matrix (Fin 2000) (Fin 2000) ℤ) (ha : ∀ i j, a i j = 1 ∨ a i j = -1) (hsum : ∑ i, ∑ j, a i j ≥ 0) : ∃ I J : Finset (Fin 2000), I.card = 1000 ∧ J.card = 1000 ∧ ∑ i ∈ I, ∑ j ∈ J, a i j ≥ 1000 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-84737,"Show that for a finite set \(A\) of real numbers, where \(S_{+}=\{x + y\mid x,y\in A\}\) and \(S_{-}=\{x - y\mid x,y\in A\}\), the inequality \(|A|\cdot|S_{-}|\leq|S_{+}|^2\) holds.","import Mathlib open Finset Real theorem inequalities (A : Finset ℝ) : A.card * {x | ∃ a b, x = a - b ∧ a ∈ A ∧ b ∈ A}.ncard ≤ {x | ∃ a b, x = a + b ∧ a ∈ A ∧ b ∈ A}.ncard ^ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-86179,"Prove that there exists a set \( S \) of 2012 positive integers such that for any \( a,b\in S \), \( \operatorname{GCD}(a, b)>1 \) and for any \( a,b,c\in S \), \( \operatorname{GCD}(a, b, c) = 1 \).","import Mathlib theorem S : ∃ (s : Finset ℕ), s.card = 2012 ∧ (∀ x ∈ s, x > 0) ∧ (∀ a ∈ s, ∀ b ∈ s, Nat.gcd a b > 1) ∧ (∀ a ∈ s, ∀ b ∈ s, ∀ c ∈ s, Nat.gcd (Nat.gcd a b) c = 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-86997,Prove that the minimum integer \( s \) such that \( s\left[\left(\binom{2010}{0}-\binom{2010}{-1}\right)^{2}+\left(\binom{2010}{1}-\binom{2010}{0}\right)^{2}+\left(\binom{2010}{2}-\binom{2010}{1}\right)^{2}+\cdots+\left(\binom{2010}{1005}-\binom{2010}{1004}\right)^{2}\right] \geq \binom{4020}{2010} \) is \( s = 2011 \).,"import Mathlib theorem prove : IsLeast {s : ℕ | s * ∑ i ∈ Finset.range 1006, (Nat.choose 2010 i - Nat.choose 2010 (i - 1))^2 ≥ Nat.choose 4020 2010} 2011 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-88731,"Let $n \geq 3$ be an odd integer. Given numbers $a_i, b_i \in [0, 1]$ for $1 \leq i \leq n$, prove that there exist indices $i, j$ such that $$0 \leq a_i b_j - a_j b_i \leq \frac{2}{n - 1}.$$","import Mathlib open Finset Real theorem Odd_n (n : ℕ) (hn : Odd n ∧ n ≥ 3) (a b : ℕ → ℝ) (ha : ∀ i ∈ Icc 1 n, a i ∈ Set.Icc 0 1) (hb : ∀ i ∈ Icc 1 n, b i ∈ Set.Icc 0 1) : ∃ i j : Icc 1 n, 0 ≤ a i * b j - a j * b i ∧ a i * b j - a j * b i ≤ 2 / (n - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-88785,"Let every integer be colored with one of four colors: red, blue, green, or yellow. Given two odd integers $x$ and $y$ such that $|x| \neq |y|$, prove that there exist two integers of the same color whose difference is one of the values $x$, $y$, $x+y$, or $x-y$.","import Mathlib theorem color_integers (f : ℤ → Fin 4) (x y : ℤ) (hx : Odd x) (hy : Odd y) (hxy : abs x ≠ abs y) : ∃ u v, f u = f v ∧ u - v = x ∨ u - v = y ∨ u - v = x + y ∨ u - v = x - y := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-88985,"Prove that if every integer is colored with one of four colors (red, blue, green, or yellow), and given two odd integers $x$ and $y$ such that $|x| \neq |y|$, then there exist two integers of the same color whose difference is one of the values $x$, $y$, $x + y$, or $x - y$.","import Mathlib theorem prove (f : ℤ → Fin 4) (x y : ℤ) (hx : Odd x) (hy : Odd y) (hxy : abs x ≠ abs y) : ∃ a b, a ≠ b ∧ f a = f b ∧ a - b = x ∨ a - b = y ∨ a - b = x + y ∨ a - b = x - y := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-89059,"Prove that if $n \in \mathbb{N}$ is not a power of a prime number, then there exists a permutation $(i_1, i_2, \ldots, i_n)$ of the set $\{1, 2, \ldots, n\}$ such that: \[ \sum_{k=1}^{n} k \cos \left( \frac{2\pi i_k}{n} \right) = 0. \]","import Mathlib theorem Prove {n : ℕ} (hn : ¬∃ p k, p.Prime ∧ p ^ k = n) : ∃ f : Equiv.Perm (Fin n), ∑ k : Fin n, (k + 1) * Real.cos ((2 * Real.pi * f k) / n) = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-89235,"Given a natural number \(n \geq 3\), prove that there exists a set \(A_n\) consisting of \(n\) distinct natural numbers such that for any \(a \in A_n\), the remainder of the product of all elements of \(A_n \setminus \{a\}\) divided by \(a\) is \(1\).","import Mathlib theorem Nat.card_472089 (n : ℕ) (hn : 3 ≤ n) : ∃ A : Finset ℕ, A.card = n ∧ ∀ a ∈ A, (∏ x ∈ A \ {a}, x) % a = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-89417,"Consider the system of linear equations given by \[ \begin{matrix} a_{11}x_{1} + \ldots + a_{1q}x_{q} = 0, \\ a_{21}x_{1} + \ldots + a_{2q}x_{q} = 0, \\ \ldots, \\ a_{p1}x_{1} + \ldots + a_{pq}x_{q} = 0, \end{matrix} \] where \(q = 2p\) and each coefficient \(a_{ij}\) is an element of the set \(\{-1, 0, 1\}\). Prove that there exists a solution \((z_{1}, \ldots, z_{q})\) for the system with the following properties: a) All \(z_{j}\), for \(j = 1, \ldots, q\), are integers; b) There exists at least one \(j\) such that \(z_{j} \neq 0\); c) \(|z_{j}| \leq q\) for any \(j = 1, \ldots, q\).","import Mathlib theorem linear_system {p q : ℕ} (hp : p > 0) (hq : q > 0) (h : q = 2 * p) (a : Matrix (Fin p) (Fin q) ℤ) (ha : ∀ i j, a i j = -1 ∨ a i j = 0 ∨ a i j = 1) : ∃ x : Fin q → ℤ, (∀ j, x j ≠ 0) ∧ (∀ i, ∑ j : Fin q, a i j * x j = 0) ∧ (∀ j, |x j| ≤ q) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-89511,"Prove that for a finite set $S$ of points in three - dimensional space, and $S_{x}$, $S_{y}$, and $S_{z}$ being the sets consisting of the orthogonal projections of the points of $S$ onto the $yz$-plane, $zx$-plane, and $xy$-plane respectively, the following inequality holds: \[ \vert S\vert^{2} \leq \vert S_{x} \vert \cdot \vert S_{y} \vert \cdot \vert S_{z} \vert, \] where $\vert A \vert$ denotes the number of elements in the finite set $A$.","import Mathlib open Real Set open scoped BigOperators theorem inequality (S : Finset (EuclideanSpace ℝ (Fin 3))) : S.card^2 ≤ (Finset.image (λ p => (p 0, p 1)) S).card * (Finset.image (λ p => (p 1, p 2)) S).card * (Finset.image (λ p => (p 2, p 0)) S).card := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-89542,"Let $S$ be a finite set of points in three-dimensional space. Let $S_{x}$, $S_{y}$, and $S_{z}$ be the sets consisting of the orthogonal projections of the points of $S$ onto the $yz$-plane, $zx$-plane, and $xy$-plane, respectively. Prove that \[ \vert S\vert^{2} \leq \vert S_{x} \vert \cdot \vert S_{y} \vert \cdot \vert S_{z} \vert, \] where $\vert A \vert$ denotes the number of elements in the finite set $A$.","import Mathlib open Finset Real theorem Prove (S : Finset (EuclideanSpace ℝ (Fin 3))) : S.card^2 ≤ (S.image (fun p => (p 1, p 2))).card * (S.image (fun p => (p 0, p 2))).card * (S.image (fun p => (p 0, p 1))).card := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-89735,Prove that \(\sum_{k=1}^n \binom{k}{\left[\frac{k}{2}\right]} \binom{n - k}{\left[\frac{n - k}{2}\right]} = 2^{n+1} - \binom{n}{\left[\frac{n}{2}\right]} - \binom{n + 1}{\left[\frac{n + 1}{2}\right]}\).,"import Mathlib open Finset Real Nat theorem prove (n : ℕ) : ∑ k ∈ Icc 1 n, Nat.choose k (Nat.floor ((k / 2 : ℝ))) * Nat.choose (n - k) (Nat.floor ((n - k) / 2)) = 2^(n + 1) - Nat.choose n (Nat.floor ((n / 2 : ℝ))) - Nat.choose (n + 1) (Nat.floor ((n + 1) / 2)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-89763,Let \(a_1 < a_2 < \ldots < a_k\) be a set of \(k\) distinct positive integers such that all \(2^k\) subsets of this set have distinct sums. Prove that \(\sum_{i = 1}^{k} \frac{1}{a_i} < 2\).,"import Mathlib theorem Finset.sum' (k : ℕ) (a : Fin k → ℕ) (ha : StrictMono a) (hpos : ∀ i, 0 < a i) (hsum : ∀ s t : Finset (Fin k), s ≠ t → ∑ i ∈ s, a i ≠ ∑ i ∈ t, a i) : ∑ i, (1 : ℝ)/(a i) < 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-89864,"Prove that if $m$ and $n$ are positive integers and $S$ is a subset of $\{1, 2, 3, \ldots, 2^m n\}$ with $(2^m - 1)n + 1$ elements, then $S$ contains $m + 1$ distinct numbers $a_0, a_1, \ldots, a_m$ such that $a_{k - 1} \mid a_k$ for all $k = 1, 2, \ldots, m$.","import Mathlib theorem prove (m n : ℕ) (hm : 0 < m) (hn : 0 < n) (S : Finset ℕ) (hS : S ⊆ Finset.Icc 1 (2 ^ m * n)) (hS1 : S.card = (2 ^ m - 1) * n + 1) : ∃ T ⊆ S, T.card = m + 1 ∧ ∀ k ∈ Finset.range m, (T.sort LE.le)[k]! ∣ (T.sort LE.le)[k + 1]! := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-89877,"Prove that the greatest possible number of points in a finite set $S$ of points on a line, with the property that for any two points $P$ and $Q$ in $S$, there exists a point $R$ in $S$ such that $R$ is the midpoint of $PQ$, $Q$ is the midpoint of $PR$, or $P$ is the midpoint of $QR$, is $5$.","import Mathlib open Finset Real theorem max_points (S : Finset ℝ) (hS : ∀ P ∈ S, ∀ Q ∈ S, ∃ R ∈ S, R = (P + Q) / 2 ∨ Q = (P + R) / 2 ∨ P = (Q + R) / 2) : S.card ≤ 5 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-89883,"Prove that for every triple of functions $f, g, h: [0,1] \to \mathbb{R}$, there exist numbers $x, y, z \in [0,1]$ such that $|f(x) + g(y) + h(z) - xyz| \geq \frac{1}{3}$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem _95346 (f g h : Set.Icc (0 : ℝ) 1 → ℝ) : ∃ x y z : Set.Icc (0 : ℝ) 1, |f x + g y + h z - x * y * z| ≥ 1 / 3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-89886,"Let $A$ and $B$ be two infinite sets of nonnegative integers. Define two nonnegative integers $a$ and $b$ as [i]tuanis[/i] if the decimal representation of $a + b$ contains only the digits $0$ and $1$. Suppose $B$ is the set of all integers that are [i]tuanis[/i] to every element of $A$, and $A$ is the set of all integers that are [i]tuanis[/i] to every element of $B$. Prove that $A$ contains an infinite number of pairs $(x, y)$ such that $x - y = 1$.","import Mathlib open Finset theorem tue (A B : Set ℕ) (hA : Infinite A) (hB : Infinite B) (hBA : ∀ x ∈ B, ∀ y ∈ A, (Nat.digits 10 (x + y)).all (fun d => d = 0 ∨ d = 1)) (hAB : ∀ x ∈ A, ∀ y ∈ B, (Nat.digits 10 (x + y)).all (fun d => d = 0 ∨ d = 1)) : {p : ℕ × ℕ | p.1 ∈ A ∧ p.2 ∈ A ∧ p.1 - p.2 = 1}.Infinite := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-89976,"Let $A \subset \{x \mid 0 \le x < 1\}$ be a set with the following properties: 1. $A$ has at least 4 distinct elements. 2. For all pairwise distinct $a, b, c, d \in A$, the expression $ab + cd \in A$ holds. Prove that $A$ has infinitely many elements.","import Mathlib theorem SetInfinite (A : Set ℝ) (hA : A ⊆ {x | 0 ≤ x ∧ x < 1}) (hA1 : ∃ s : Finset ℝ, s.card ≥ 4 ∧ ∀ x ∈ s, x ∈ A) (hA2 : ∀ a ∈ A, ∀ b ∈ A, ∀ c ∈ A, ∀ d ∈ A, a ≠ b ∧ a ≠ c ∧ a ≠ d ∧ b ≠ c ∧ b ≠ d ∧ c ≠ d → a * b + c * d ∈ A) : Infinite A := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-90274,"Prove that the number of functions \(f(n)\), defined on the positive integers and taking positive integer values, that satisfy the conditions \(f(1) = 1\) and \(f(n) f(n + 2)=f^{2}(n + 1)+1997\) for all positive integers \(n\) is \(16\).","import Mathlib theorem Number_of_function_f : {f : ℕ+ → ℕ+ | f 1 = 1 ∧ ∀ n, f n * f (n + 2) = (f (n + 1)) ^ 2 + 1997}.ncard = 16 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-90339,"Prove that \(\lim_{n\rightarrow \infty}\frac{e^{\frac{n^{2}}{2}}}{C^{1}_{n}C^{2}_{n}\cdots C^{n}_{n}} = \infty\), where \(C^{k}_{n}=\binom{n}{k}\).","import Mathlib open Real Filter Function open scoped Topology theorem Tendsto (f : ℕ → ℝ) (h₀ : ∀ n, f n = exp (n ^ 2 / 2) / ∏ k ∈ Finset.Icc 1 n, Nat.choose n k) : Tendsto f atTop atTop := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-91374,"Prove that the only infinite sequence \( a_1, a_2, a_3, \ldots \) of positive integers such that \( a_{nm} = a_n a_m \) for all positive integers \( n, m \) and there are infinitely many positive integers \( n \) such that \( \{1, 2, \ldots, n\} = \{a_1, a_2, \ldots, a_n\} \) is the sequence \( a_n = n \) for all positive integers \( n \).","import Mathlib theorem prove (a : ℕ → ℕ) (ha : ∀ n, 0 < a n) (hmul : ∀ n m, a (n * m) = a n * a m) (hint : ∀ N, ∃ n, n > N ∧ Set.Icc 1 n = {x | ∃ k, a k = x}) : ∀ n, a n = n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-91422,"Prove that it is possible to color the natural numbers with 2009 colors such that each color appears an infinite number of times and there is no triple of numbers \(a,b,c\) with \(ab = c\) where \(a\), \(b\), and \(c\) are colored with three different colors.","import Mathlib theorem color_nat : ∃ f : ℕ → Fin 2009, (∀ i, Set.Infinite {x | f x = i}) ∧ ¬∃ a b c, a * b = c ∧ f a ≠ f b ∧ f b ≠ f c ∧ f a ≠ f c := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-91851,"Prove that for an integer \( n \geq 5 \), the smallest integer \( m \) such that there exist two sets of integers \( A \) and \( B \) with \( |A| = n \), \( |B| = m \), \( A \subseteq B \), and for any two different elements \( x \) and \( y \) in \( B \), \( x + y \in B \) if and only if \( x, y \in A \), is \( m = 9 \).","import Mathlib theorem prove (n : ℕ) (hn : 5 ≤ n) : IsLeast {m | ∃ A B : Finset ℤ, A.card = n ∧ B.card = m ∧ A ⊆ B ∧ (∀ x ∈ B, ∀ y ∈ B, x ≠ y → x + y ∈ B ↔ x ∈ A ∧ y ∈ A)} 9 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-92064,"Prove that if \(S\) is a set of integers (not necessarily positive) such that there exist \(a,b \in S\) with \(\gcd(a,b) = \gcd(a - 2,b - 2) = 1\) and if \(x,y\in S\) (possibly equal), then \(x^2 - y\in S\), then \(S=\mathbb{Z}\).","import Mathlib theorem algebra_537849 {S : Set ℤ} (hS : ∃ x y : ℤ, x ∈ S ∧ y ∈ S ∧ Int.gcd x y = 1 ∧ Int.gcd (x - 2) (y - 2) = 1) (hS' : ∀ x ∈ S, ∀ y ∈ S, x ^ 2 - y ∈ S) : S = ⊤ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-92391,"Prove that for all real numbers \(a\) with \(a \geq 1\), for every sequence \(\{a_1, a_2, \ldots\}\) of distinct positive integers such that \(a_n \leq an\) for all positive integers \(n\), there exist infinitely many terms \(a_n\) in the sequence such that the digit sums of \(a_n\) in base 4038 are not divisible by 2019.","import Mathlib theorem prove (a : ℝ) (ha : 1 ≤ a) (a_seq : ℕ → ℕ) (h_a_seq : ∀ n, a_seq n > 0 ∧ ∀ m, a_seq m = a_seq n → m = n) (h_a_seq' : ∀ n, a_seq n ≤ a * n) : {n | ¬(2019 ∣ (Nat.digits 4038 (a_seq n)).sum)}.Infinite := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-93842,"Show that for a prime \(p\) and integers \(a_1, \dots, a_p\), there exists an integer \(k\) such that the numbers \(a_1 + k, a_2 + 2k, \dots, a_p + pk\) produce at least \(\frac{1}{2} p\) distinct remainders upon division by \(p\).","import Mathlib theorem pmod (p : ℕ) (hp : Nat.Prime p) (a : Fin p → ℤ) : ∃ k : ℤ, {x | ∃ i : Fin p, x = (a i + (i.1 + 1) * k) % p}.ncard ≥ (p / 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-95141,"Prove that if $E \subset \mathbb{R}$ is a set with cardinality less than the continuum $c$, then there exists a real number $a$ such that the set $E + \{a\} = \{x + a : x \in E\}$ is a subset of the irrational numbers, i.e., $E + \{a\} \subset \mathbb{R} \setminus \mathbb{Q}$.","import Mathlib open Real Set open scoped BigOperators theorem card_lt continuum (E : Set ℝ) (hE : E.ncard < continuum) : ∃ a : ℝ, {x | ∃ y ∈ E, x = y + a} ⊆ {x | Irrational x} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-95601,"Prove that the largest integer \(n\) such that every 10 - element subset of the set \(\{4,5,6,\ldots,n\}\) possesses the triangle property (i.e., contains three distinct elements that can serve as the side lengths of a non - degenerate triangle) is \(n = 253\).","import Mathlib def isGood (S : Finset ℕ) := S.card = 3 ∧ ∃ x ∈ S, ∃ y ∈ S, ∃ z ∈ S, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ x + y > z ∧ y + z > x ∧ z + x > y theorem prove : IsGreatest {n | ∀ T ⊆ Finset.Icc 4 n, T.card = 10 → ∃ U ⊆ T, isGood U} 253 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-96605,"Determine if the following statement is true or false: For any positive integers $k, r, n$ with $0 < k, r < n$, the equality \[ \sum^n_{i=k} k^{n-i} \binom{n-k}{i-k}^2 k! (i-k)! = \sum^n_{i=r} r^{n-i} \binom{n-r}{i-r}^2 r! (i-r)! \] implies $k = r$. If false, provide a counterexample. Prove that the answer is True.","import Mathlib open Finset Real Nat theorem equalities_486811 {k r n : ℕ} (hk : 0 < k) (hr : 0 < r) (hn : 0 < n) (hkn : k < n) (hrr : r < n) (h : ∑ i ∈ Icc k n, k ^ (n - i) * (n.choose i) ^ 2 * k.factorial * (i - k).factorial = ∑ i ∈ Icc r n, r ^ (n - i) * (n.choose i) ^ 2 * r.factorial * (i - r).factorial) : k = r := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-98713,"Let $R$ be a finite commutative ring and consider the full matrix ring $M_n(R)$ for $n > 1$. For a matrix $A \in M_n(R)$, is it true that the cardinality of the left annihilator of $A$ in $M_n(R)$ equals the cardinality of the right annihilator of $A$? Prove that the answer is Yes.","import Mathlib open Fintype Set Real Ideal Polynomial open scoped BigOperators theorem MatrixRing {R : Type*} [CommRing R] [Fintype R] (n : ℕ) (hn : n > 1) (A : Matrix (Fin n) (Fin n) R) : {x | x * A = 0}.ncard = {y | A * y = 0}.ncard := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-99354,"Let $(X,d)$ be a compact metric space, and let $f: X \to X$ be an isometric embedding, meaning that for each $x, y \in X$, we have $d(f(x), f(y)) = d(x, y)$. Is $f$ automatically surjective? In other words, is it true that $\inf_{y \in X} d(x, f(y)) = 0$ for every $x \in X$? Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem IsMetricEmbedding {X : Type*} [MetricSpace X] (f : X → X) (hf : ∀ x y, dist (f x) (f y) = dist x y) (hCompact : CompactSpace X) : Function.Surjective f := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-100783,"How many functions \( f: \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\} \to \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\} \) are there such that the 30th composition of \( f \) is the identity function, and 30 is the smallest such number for \( f \) to become an identity? Prove that the answer is 120960.","import Mathlib open Finset theorem solution : {f : Equiv.Perm (Fin 10) | IsLeast {n | f^[n] = id} 30}.ncard = 120960 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-100939,"How many surjections \( g: \mathbb{N} \rightarrow \mathbb{N} \) commute with the function \( t: \mathbb{N} \rightarrow \mathbb{N} \) defined by \( t(n) = n+1 \)? Prove that the answer is 1.","import Mathlib open Set Function theorem number_theory_8248 : {g : ℕ → ℕ | g.Surjective ∧ ∀ n, g n + 1 = g (n + 1)}.ncard = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-102800,"If $(X, d)$ is a Lindelöf metric space, is the product space $X \times X$ also Lindelöf? Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prod_lindelof {X : Type*} [MetricSpace X] (hX : LindelofSpace X) : LindelofSpace (X × X) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-103308,"For any countably infinite set $M$, consider the following sets: - $X_{M} = \{A \subseteq M : |A| < \aleph_{0}\}$, the set of all finite subsets of $M$. - $Y_{M} = \{B \subseteq M : B = M \setminus A, A \in X_{M}\}$, the set of all countably infinite subsets of $M$ whose complement is finite. - $Z_{M} = \{C \subseteq M : |C| = |M \setminus C| = \aleph_{0}\}$, the set of all countably infinite subsets of $M$ whose complement is countably infinite. If $f$ is a function from $X_{M}$ to $Y_{M}$ defined by $f(T) = M \setminus T$, then $f$ is bijective, implying $|X_{M}| = |Y_{M}| = \aleph_{0}$. Since $X_{M} \cup Y_{M} \cup Z_{M} = P(M)$ and $X_{M} \cap Y_{M} \cap Z_{M} = \varnothing$, it follows that $|Z_{M}| > \aleph_{0}$. Based on this, can we conclude that the power set $P(M)$ of any countably infinite set $M$ is uncountable due to the existence of $Z_{M}$? Prove that the answer is Yes.","import Mathlib open Set Real open scoped BigOperators theorem uncountable_power_set {M : Type*} [Infinite M] [Countable M] : ¬ Countable (Set.univ : Set M) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-104551,"Let $E$ be a set with positive Lebesgue measure in $\Bbb R$. Determine whether there necessarily exists a point $x \in E$ such that $x$ can be expressed as the average of two distinct points $y$ and $z$ in $E$, i.e., $x = \frac{1}{2}(y + z)$. Provide a justification for your answer. Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MeasureTheory.volume (E : Set ℝ) (hE : 0 < (MeasureTheory.volume E).toReal) : ∃ x ∈ E, ∃ y z, x = (y + z) / 2 ∧ y ∈ E ∧ z ∈ E ∧ y ≠ z := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-104996,"Let $X$ be a metric space and $f:X \to X$ be a bijective map. If $f$ carries every connected set of $X$ to a connected set of $X$, does it follow that $f^{-1}$ also carries every connected set to a connected set? Provide a proof or a counterexample. Prove that the answer is Yes.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem Topology.MapsTo {X : Type*} [MetricSpace X] (f : X → X) (hf : Function.Bijective f) (h : ∀ s : Set X, IsConnected s → IsConnected (f '' s)) : ∀ s : Set X, IsConnected s → IsConnected (f ⁻¹' s) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-106828,"Let $N=\{1,\dots,n\}$ and $A,B$ be $n\times n$ skew symmetric matrices such that it is possible to permute some rows and some columns from $A$ to get $B$. In other words, for some permutations $g,h: N\rightarrow N$, $$A_{i,j}=B_{g(i),h(j)}$$ for all $1\leq i,j\leq n$. Must there exist a permutation $f:N\rightarrow N$ such that $$A_{i,j}=B_{f(i),f(j)}$$ for all $1\leq i,j\leq n?$ Prove that the answer is Yes.","import Mathlib open Finset Matrix theorem exists_perm_f {n : ℕ} (hn : 0 < n) (A B : Matrix (Fin n) (Fin n) ℝ) (hA : ∀ i j, A i j = -A j i) (hB : ∃ g h : Equiv.Perm (Fin n), ∀ i j, A i j = B (g i) (h j)) : ∃ f : Equiv.Perm (Fin n), ∀ i j, A i j = B (f i) (f j) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-107412,"Find the limit of the sequence defined by \(S_n= n\,p^n \sum_{k=n}^{+\infty} \frac{1}{k}\, \binom{k-1}{n-1} \, (1-p)^{k-n}\) where \(0 n * p ^ n * ∑' k : ℕ, if k ≥ n then (Nat.choose (k - 1) (n - 1)) * (1 - p) ^ (k - n) else 0) : Tendsto S atTop (𝓝 p) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-107488,"Determine the Lebesgue measure of the set $B = \{(x,y) \in [0,1] \times [0,1] : \forall n (\{x_n, y_n\} \subset \{1,5\}) \}$, where $x = 0.x_1x_2 \ldots$ and $y = 0.y_1y_2 \ldots$ are the decimal representations of $x$ and $y$, respectively. Prove that the answer is 0.","import Mathlib open Real theorem determineLebesgueMeasure (B : Set (ℝ × ℝ)) (hB : ∀ x y : ℝ, (x, y) ∈ B ↔ x ∈ Set.Icc 0 1 ∧ y ∈ Set.Icc 0 1 ∧ ∃ x' : ℕ → ℕ, ∃ y' : ℕ → ℕ, (∀ n : ℕ, x' n = 1 ∨ x' n = 5) ∧ (∀ n : ℕ, y' n = 1 ∨ y' n = 5) ∧ x = ∑' n : ℕ, x' n / 10 ^ (n + 1) ∧ y = ∑' n : ℕ, y' n / 10 ^ (n + 1)) : (MeasureTheory.volume B).toReal = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-108151,"Determine whether every perfectly normal space is completely regular. Provide a justification for your answer. Prove that the answer is Yes.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem is_completely_regular (X : Type*) [TopologicalSpace X] [PerfectlyNormalSpace X] : CompletelyRegularSpace X := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-110984,"Determine the cardinality of the set \( \{ f \in \mathbb{N}^{\mathbb{N}} \mid f \le h \} \), where \( h: \mathbb{N} \to \mathbb{N} \) is defined by \( h(n) = n + 1 \) and the partial order relation \( f \le g \) is defined as \( \forall n \in \mathbb{N}, f(n) \le g(n) \). Prove that the answer is 2^{\aleph_0}.","import Mathlib open Set open scoped BigOperators theorem card {h : ℕ → ℕ} (hh : ∀ n, h n = n + 1) : {f : ℕ → ℕ | (∀ m, f m ≤ h m)}.ncard = 2 ^ (Nat.card ℕ) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-111080,"Let \( S = \{ \tan(k) : k = 1, 2, \dots \} \). Find the set of limit points of \( S \) on the real line. Prove that the answer is \mathbb{R}.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Set_limit_points (S : Set ℝ) (hS : S = {x | ∃ k : ℕ, x = Real.tan k}) : closure S = ⊤ := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-111246,"Determine the number of distinct sequences of rational numbers that converge to 1. Prove that the answer is 2^{\aleph_0}.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem number_of_convergence_sequences : Set.ncard {s : ℕ → ℚ | Tendsto s atTop (𝓝 1)} = 2 ^ (Nat.card ℕ) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-111876,"Let \( \mathbb{N} \) be the set of all positive integers. A function \( f: \mathbb{N} \rightarrow \mathbb{N} \) satisfies \( f(m + n) = f(f(m) + n) \) for all \( m, n \in \mathbb{N} \), and \( f(6) = 2 \). Also, no two of the values \( f(6), f(9), f(12) \), and \( f(15) \) coincide. Determine the number of three-digit positive integers \( n \) such that \( f(n) = f(2005) \). Prove that the answer is 225.","import Mathlib theorem solution (f : ℕ → ℕ) (hpos : ∀ m n, f (m + n) = f (f m + n)) (hf6 : f 6 = 2) (hf9 : f 6 ≠ f 9) (hf12 : f 6 ≠ f 12) (hf15 : f 6 ≠ f 15) (hf9' : f 9 ≠ f 12) (hf9'' : f 9 ≠ f 15) (hf12' : f 12 ≠ f 15) : Set.ncard {n | n ∈ Finset.Icc 100 999 ∧ f n = f 2005} = 225 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-112726,"Let \( A \subseteq \mathbb{R}^n \) be such that for every continuous function \( f : A \to \mathbb{R} \), the image \( f(A) \) is closed in \( \mathbb{R} \). Is the set \( A \) closed in \( \mathbb{R}^n \)? Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem closure_A (n : ℕ) (A : Set (EuclideanSpace ℝ (Fin n))) (h : ∀ f : A → ℝ, Continuous f → IsClosed (Set.range f)) : IsClosed A := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-113767,"Let \( A \) be a subset of \( \mathbb{R} \) such that every point in \( A \) is isolated from the right, meaning that for every \( a \in A \), there exists \( \epsilon > 0 \) such that \( A \cap [a, a+\epsilon) = \{ a \} \). If \( \bar{A} \) denotes the closure of \( A \) in \( \mathbb{R} \), is it true that the Lebesgue measure \( |\bar{A}| \) of \( \bar{A} \) is always zero? Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem closure_of_A : ∀ (A : Set ℝ), (∀ a ∈ A, ∃ ε > 0, A ∩ Set.Ico a (a + ε) = {a}) → MeasureTheory.volume (closure A) = 0 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-116612,"Let $(M,d)$ be a compact metric space and $f: M \to M$ be a bijective function such that $d(f(x),f(y)) \leq d(x,y)$ for all $x, y \in M$. Is $f$ an isometry, i.e., does $d(f(x),f(y)) = d(x,y)$ for all $x, y \in M$? Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem IsOMETRY {α : Type*} [MetricSpace α] [CompactSpace α] (f : α → α) (h₀ : Function.Bijective f) (h₁ : ∀ x y, dist (f x) (f y) ≤ dist x y) : (∀ x y, dist (f x) (f y) = dist x y) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-118648,"Determine the cardinality of the set of functions $f: \mathbb{N} \to \mathbb{N}$ such that $f(n) \leq n+1$ for all $n \in \mathbb{N}$. What is the nature of $f$ in this context? Prove that the answer is 2^{\aleph_0}.","import Mathlib open Set theorem functions_card : {f : ℕ → ℕ | ∀ n, f n ≤ n + 1}.encard = 2 ^ (Nat.card ℕ) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-120617,"Determine whether the sequence \((\log(n!) \mod 1)_{n \in \mathbb{N}}\) is dense in the interval \([0,1]\). Prove that the answer is Yes.","import Mathlib open Real Set open scoped BigOperators theorem log_density : Dense {x | ∃ n, x = log (Nat.factorial n) % 1} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-120656,"Given a set \( S \) of size 100, find the maximum size of a collection \( G \) of subsets of \( S \), each of size 5, such that any two different subsets in \( G \) have different intersections of size 4. What is the maximum size of \( G \)? Prove that the answer is 2800.","import Mathlib theorem max_size_of_collection (S : Finset ℕ) (hS : S.card = 100) (G : Finset (Finset ℕ)) (hG : ∀ T ∈ G, T ⊆ S ∧ T.card = 5) (hG' : ∀ T ∈ G, ∀ U ∈ G, T ≠ U → (T ∩ U).card = 4) : G.card ≤ 2800 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-120700,"Evaluate the limit: \[ \lim_{m \rightarrow \infty} \frac{Q(m)}{\log(m)} \] where \( Q(m) = \bigl| \{ n : m\leq n \leq m + \log(m) \text{ and } n = p \cdot q\text{, where }p,q\text{ are prime} \} \bigr| \). Prove that the answer is 0.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (Q : ℕ → ℕ) (hQ : ∀ m, Q m = {n | m ≤ n ∧ n ≤ m + Real.log m ∧ ∃ p q, p.Prime ∧ q.Prime ∧ n = p * q}.ncard) : Tendsto (λ m => Q m / Real.log m) atTop (𝓝 0) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-120776,"Let $(X,d)$ be a compact metric space and $T:X \to X$ be a continuous function. If $T$ is one-to-one and $\inf_{n\in \mathbb N}d(T^n(x),T^n(y)) > 0$ for every distinct $x$ and $y$, does it imply that the image of $T$ is closed? Provide a justification for your answer. Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (X : Type*) [MetricSpace X] [CompactSpace X] (T : X → X) (hT : Continuous T) (hT1 : Function.Injective T) (hT2 : ∀ x y : X, x ≠ y → sInf {d | ∃ n : ℕ, d = dist (T^[n] x) (T^[n] y)} > 0) : IsClosed (Set.range T) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-120795,"Determine the cardinality of the set of injective functions from the set of natural numbers, \(\mathbb{N}\), to its power set, \(\mathcal{P} \mathbb{N}\). Prove that the answer is 2^{\aleph_0}.","import Mathlib open Set Real open scoped BigOperators theorem card_injective_fns : {f : ℕ → Set ℕ | Function.Injective f}.ncard = 2 ^ (Nat.card ℕ) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-120919,"Determine if the following statement is true or false: $$ \forall K>0 \; \exists \epsilon_0 (>0, \leq 1) \; \forall \epsilon (>0, \leq \epsilon_0) \; \forall p (p>0, \; p\leq \frac{1}{2}, \; \frac{\epsilon}{p} \geq 2, \; \frac{\epsilon}{p} \in \mathbb{Z} ) \; [(1-p)^{\frac{\epsilon}{p}} + \epsilon (1-p)^{\frac{\epsilon}{p} - 1} > 1 - K\epsilon \;]$$ Prove that the answer is True.","import Mathlib open Real theorem statement : ∀ K > 0, ∃ ε0 : ℝ, ε0 > 0 ∧ ε0 ≤ 1 ∧ ∀ ε : ℝ, ε > 0 ∧ ε ≤ ε0 → ∀ p : ℝ, p > 0 ∧ p ≤ 1 / 2 → ∃ m : ℤ, ε / p = m ∧ m ≥ 2 → ((1 - p) ^ (ε / p) + ε * (1 - p) ^ (ε / p - 1)) > 1 - K * ε := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-120960,"Let $X$ be a subset of $[0,1]$ with Lebesgue measure 1. For each $x \in X$, there is some $\epsilon_x > 0$. Define $I_x$ as the open interval $(x, x+\epsilon_x)$. Consider the union of all these intervals: $$U := \bigcup_{x\in X} I_x$$ Is the length of $U$ always at least 1? Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MeasureTheory.volume (X : Set ℝ) (hX : X ⊆ Set.Icc 0 1) (hX' : (MeasureTheory.volume X).toReal = 1) (ε : ℝ → ℝ) (hε : ∀ x ∈ X, ε x > 0) : (MeasureTheory.volume {y | ∃ x ∈ X, y ∈ Set.Ioo x (x + ε x)}).toReal ≥ 1 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-120969,"Determine whether a function in the class $C^{1}$ maps a set of Lebesgue measure zero into a set of Lebesgue measure zero. Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem C1 (f : ℝ → ℝ) (hf : ContDiff ℝ 1 f) (A : Set ℝ) (hA : MeasureTheory.volume A = 0) : MeasureTheory.volume (f '' A) = 0 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-120982,"For a given integer $k > 2$, determine if there exist two distinct subsets of a set of odd primes, each with the same number of elements, such that the sum of the $k$th powers of the elements in each subset is equal. Prove that the answer is Yes.","import Mathlib theorem for_given_k (k : ℕ) (hk : k > 2) : ∃ s1 s2 : Finset ℕ, (∀ x ∈ s1, Odd x ∧ Nat.Prime x) ∧ (∀ x ∈ s2, Odd x ∧ Nat.Prime x) ∧ s1 ≠ s2 ∧ s1.card = s2.card ∧ ∑ x ∈ s1, x ^ k = ∑ x ∈ s2, x ^ k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-121052,"Let $p$ be a prime number, $p \ge 5$, and $k$ be a digit in the $p$-adic representation of positive integers. Determine the maximal length of a non-constant arithmetic progression whose terms do not contain the digit $k$ in their $p$-adic representation. Prove that the answer is p-1.","import Mathlib open Finset theorem max_length {p : ℕ} (hp : Nat.Prime p) (hp1 : 5 ≤ p) (k : ℕ) (hk : k ∈ Icc 0 (p - 1)) : IsGreatest {n | ∃ a d : ℕ, a > 0 ∧ d ≠ 0 ∧ ∀ i ∈ range n, ¬(k ∈ Nat.digits p (a + d * i))} (p - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-122744,"Let \( f \) be a holomorphic function such that \( |f(z)| > 1 \) for \( |z| = 1 \). Evaluate the limit: \[ \lim_{n\to \infty}\left|\frac{\prod_{z^n=1}f(z)^n}{\prod_{z^n=-1}f(z)^n}\right|. \] Prove that the answer is 1.","import Mathlib open Complex Filter Function Metric Finset open scoped Topology theorem Tendsto (f : ℂ → ℂ) (hf : Differentiable ℂ f) (h : ∀ z, ‖z‖ = 1 → ‖f z‖ > 1) : Tendsto (λ n => ‖∏ᶠ z ∈ {z | z ^ n = 1}, (f z) ^ n / ∏ᶠ z ∈ {z | z ^ n = -1}, (f z) ^ n‖) atTop (𝓝 1) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-122748,"Is the sequence \((\{10^n\pi\})_{n=1}^\infty\) dense in the interval \([0,1]\)? Here, \(\{x\} = x \mod 1 = x - \lfloor x \rfloor\) represents the fractional part of \(x\). Prove that the answer is Yes.","import Mathlib open Real theorem DenseOn (f : ℕ → ℝ) (hf : ∀ n, f n = (10 ^ n * π) % 1) : closure {x | ∃ n, x = f n} = Set.Icc 0 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-122781,"For any given \( m \in [0,1] \), does there exist a dense subset \( A \subseteq [0,1] \) with Lebesgue measure \( m \)? Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MeasureTheory (m : ℝ) (hm : 0 ≤ m ∧ m ≤ 1) : ∃ A : Set ℝ, Dense A ∧ A ⊆ Set.Icc 0 1 ∧ (MeasureTheory.volume A).toReal = m := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-122902,"Let $A$ and $B$ be $n \times n$ skew-symmetric matrices. Suppose there exist permutations $g, h: \{1, \ldots, n\} \to \{1, \ldots, n\}$ such that $A_{i,j} = B_{g(i),h(j)}$ for all $1 \leq i, j \leq n$. Must there exist a permutation $f: \{1, \ldots, n\} \to \{1, \ldots, n\}$ such that $A_{i,j} = B_{f(i),f(j)}$ for all $1 \leq i, j \leq n$? Prove that the answer is Yes.","import Mathlib theorem Matrix_skew_symmetric {n : ℕ} (A B : Matrix (Fin n) (Fin n) ℝ) (hA : ∀ i j, A i j = -A j i) (hB : ∀ i j, B i j = -B j i) (g h : Equiv.Perm (Fin n)) (hg : ∀ i, g i ∈ Finset.univ) (hh : ∀ i, h i ∈ Finset.univ) (hgh : ∀ i j, A i j = B (g i) (h j)) : ∃ f : Equiv.Perm (Fin n), ∀ i j, A i j = B (f i) (f j) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-122915,"Determine whether the set \( \{ (2n+1) \theta \bmod 1: n \in \mathbb{N} \} \) is dense in the interval \([0,1]\), given that \( \theta \in \mathbb{R} \setminus \mathbb{Q} \). Prove that the answer is Yes.","import Mathlib theorem DenseSet (θ : ℝ) (hθ : Irrational θ) : closure {x | ∃ n : ℕ, x = (2 * n + 1) * θ % 1} = Set.Icc 0 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-122942,"Does a non-measurable set always contain a bounded non-measurable subset? Provide a justification for your answer. Prove that the answer is Yes.","import Mathlib theorem NonMeasurableSetContainsBoundedNonMeasurableSubset (S : Set ℝ) (hS : ¬ MeasurableSet S) : ∃ T ⊆ S, Bornology.IsBounded T ∧ ¬ MeasurableSet T := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-122956,"Given two positive-valued functions $f, g: [0,1]\to(0,1)$, a pair $(f,g)$ is defined as good if, for every real number $r$, the set $Z_r := \{x ~\big|~ {g(x) / f(x)} = r \}$ has a measure of zero in $\mathbb{R}$. For example, if $f(x)=1/2$ and $g(x)=(x+1)/2$, the pair $(f,g)$ is good. Conversely, if $f(x)=1/2$ and $g(x)=3/4$, the pair $(f,g)$ is not good. Given a pair $(f,g)$ and a constant $\epsilon>0$, does there always exist a function $h: [0,1]\to [0,\epsilon]$ such that the pair $(f, g+h)$ is good? In other words, is it always possible to make a pair ""good"" by a slight perturbation? Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem isGood (f g : ℝ → ℝ) (hf : ∀ x ∈ Set.Icc 0 1, f x > 0 ∧ f x < 1) (hg : ∀ x ∈ Set.Icc 0 1, g x > 0 ∧ g x < 1) (hfg : ∀ r : ℝ, (MeasureTheory.volume {x | g x / f x = r}).toReal = 0) : ∃ h : ℝ → ℝ, (∀ x ∈ Set.Icc 0 1, h x ∈ Set.Icc 0 ε) ∧ (∀ x ∈ Set.Icc 0 1, (MeasureTheory.volume {x | g x / (f x + h x) = r}).toReal = 0) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-122988,"Determine whether the 2nd Eisenstein Series, defined by \(E_{2}(\tau)=1-24\sum_{n=0}^{\infty} \frac{nq^{2n}}{1-q^{2n}}\), where \(q=e^{i\pi \tau}\) and \(\tau\) is in the upper-half plane, can output complex numbers. Prove that the answer is Yes.","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem eisenstein_series (τ : ℂ) (hτ : τ ∈ {z | z.re > 0 ∧ z.im > 0}) : ∃ w : ℂ, w = 1 - 24 * ∑' n : ℕ, (n * exp (I * Real.pi * τ) ^ (2 * n)) / (1 - exp (I * Real.pi * τ) ^ (2 * n)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-122996,"Suppose \((\Omega,\mathscr{F},\mu)\) is a measure space and \(f,g\) are \((\mathscr{F},\mathscr{B})\)-measurable functions where \(\mathscr{B}\) is the Borel algebra on \(\mathbb{R}\). If \(\mu(\{f0\), determine whether there exists a constant \(\xi \in \mathbb{R}\) such that the set \(\{f\leq \xi < g\}\) has nonzero measure. Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MeasureTheory.volume_measurable (Ω : Type*) [MeasureSpace Ω] (f g : Ω → ℝ) (hf : Measurable f) (hg : Measurable g) (hfg : ∃ A : Set Ω, A = {x | f x < g x} ∧ MeasureTheory.volume A > 0) : ∃ ξ : ℝ, MeasureTheory.volume {x | f x ≤ ξ ∧ ξ < g x} ≠ 0 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123005,"Let $I = A \times B$, where $A, B \subset \mathbb{R}$ are closed sets of positive Lebesgue measure, and let $E \subset \mathbb{R}^2$ be a set of zero Lebesgue measure. Is it true that $\overline{I \setminus E} = I$? Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem closure_lebesgueMeasure (A B : Set ℝ) (hA : IsClosed A) (hB : IsClosed B) (hA1 : 0 < (MeasureTheory.volume A).toReal) (hB1 : 0 < (MeasureTheory.volume B).toReal) (E : Set (ℝ × ℝ)) (hE : MeasureTheory.volume E = 0) : closure {x | ∃ a b, x = (a, b) ∧ a ∈ A ∧ b ∈ B ∧ ¬(x ∈ E)} = closure {x | ∃ a b, x = (a, b) ∧ a ∈ A ∧ b ∈ B} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123077,"Determine whether the limit \( \lim_{n\to\infty}\dfrac {C_n^{F_n}}{F_n^{C_n}} \) converges or diverges to infinity, where \( C_n=\dfrac {(2n)!}{n!(n+1)!} \) is the n-th Catalan number and \( F_n=2^{2^n}+1 \) is the n-th Fermat number. Prove that the answer is \infty.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem determine_catch (C F : ℕ → ℝ) (hC : ∀ n, C n = Nat.factorial (2 * n) / (Nat.factorial n * Nat.factorial (n + 1))) (hF : ∀ n, F n = 2 ^ (2 ^ n) + 1) : Tendsto (λ n => C n ^ (F n) / (F n) ^ (C n)) atTop atTop := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123105,"Let $E \subset \mathbb{R}^n$ be a set with positive Lebesgue measure. Determine whether there always exists a point $x \in E$ such that for any $r > 0$, the intersection $B(x,r) \cap E$ has positive Lebesgue measure in $\mathbb{R}^n$. Here, $B(x,r)$ denotes the ball of radius $r$ centered at $x$ in $\mathbb{R}^n$. Provide a justification for your answer. Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MeasureTheory (n : ℕ) (E : Set (EuclideanSpace ℝ (Fin n))) (hE : 0 < (MeasureTheory.volume E).toReal) : ∃ x ∈ E, ∀ r > 0, 0 < (MeasureTheory.volume {y | y ∈ E ∧ dist x y < r}).toReal := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123109,"Determine whether every uncountable subset of the real numbers has a super limit point. Provide a justification for your answer. Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem all_uncountable_set_HAS_super_limit_point (A : Set ℝ) (hA : ¬ Set.Countable A) : ∃ x ∈ closure A, ∀ ε > 0, ∃ y ∈ A, x < y ∧ y - x < ε := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123126,"Determine whether the infinity of the Mandelbrot fractal is countable or uncountable. Prove that the answer is uncountable.","import Mathlib open Real Set open scoped BigOperators theorem uncountable_infinite : Infinite {z : ℂ | z ∈ (Mandelbrot : Set ℂ)} ∧ ¬ Countable {z : ℂ | z ∈ (Mandelbrot : Set ℂ)} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123193,"Given an infinite set of positive integers, determine if it is always possible to find a subset of this set that contains infinitely many numbers such that any two numbers in this subset are either relatively prime or have a greatest common divisor greater than 1. Prove that the answer is Yes.","import Mathlib theorem InfiniteSetOfIntegers (S : Set ℕ) (hS : S.Infinite) (hS1 : ∀ n ∈ S, n > 0) : ∃ T ⊆ S, T.Infinite ∧ (∀ m ∈ T, ∀ n ∈ T, m ≠ n → Nat.Coprime m n ∨ Nat.gcd m n > 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123208,"Is the intersection of a countable collection of dense, open subsets of a complete metric space also dense in the space? Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem countable_inter {α : Type*} [MetricSpace α] [CompleteSpace α] (f : ℕ → Set α) (hf : ∀ n, IsOpen (f n)) (hf' : ∀ n, Dense (f n)) : Dense (⋂ n, f n) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123363,"In a complete metric space $E$ with the property that for any bounded sequence $x_n$ and for every $\epsilon > 0$, there exist indices $i \neq j$ such that $d(x_i, x_j) < \epsilon$, determine whether every bounded sequence in $E$ has a convergent subsequence. Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MetricSpace.E (E : Type*) [MetricSpace E] [CompleteSpace E] (h : ∀ (x : ℕ → E) (hx : Bornology.IsBounded (Set.range x)), ∀ ε > 0, ∃ i j, i ≠ j ∧ dist (x i) (x j) < ε) : ∀ (x : ℕ → E) (hx : Bornology.IsBounded (Set.range x)), ∃ (y : ℕ → E), (∀ n, ∃ m, y n = x m) ∧ ∃ L, Tendsto y atTop (𝓝 L) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123430,"In a Hilbert space, let $A_1, B_1, A_2, B_2$ be open sets satisfying the following conditions: 1. $A_1 \cap B_1 = A_2 \cap B_2 = \emptyset$. 2. $A_1 \cup B_1 = A_2 \cup B_2$. 3. $A_1$ and $A_2$ have the point $0$ in common. 4. $A_1$ and $A_2$ are both connected sets. Determine if $A_1 = A_2$. Prove that the answer is A_1 = A_2.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem A1_eq_A2 {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [MetricSpace (Set H)] (A1 A2 B1 B2 : Set H) (h₀ : IsOpen A1) (h₁ : IsOpen A2) (h₂ : IsOpen B1) (h₃ : IsOpen B2) (h₄ : A1 ∩ B1 = ∅) (h₅ : A2 ∩ B2 = ∅) (h₆ : A1 ∪ B1 = A2 ∪ B2) (h₇ : 0 ∈ A1) (h₈ : 0 ∈ A2) (h₉ : IsConnected A1) (h₁₀ : IsConnected A2) : A1 = A2 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123454,"Determine whether a non-Lebesgue-measurable set $A \subset \mathbb{R}$, such that for all real numbers $a < b$, $A \cap [a, b]$ is also non-Lebesgue-measurable, is necessarily dense in $\mathbb{R}$. Provide a justification for your answer. Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem DenseNonMeasurableSet (A : Set ℝ) (hA : ¬ MeasurableSet A) (hAB : ∀ a b : ℝ, a < b → ¬ MeasurableSet (A ∩ Set.Icc a b)) : Dense A := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123479,"Suppose $X$ is a metric space such that the image of every uniformly continuous function $f: X \to \mathbb{R}$ is closed. If $X$ is also complete, is $X$ necessarily compact? Answer yes or no and justify your answer. Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem IsCompactMetricSpace {X : Type*} [MetricSpace X] (h : ∀ f : X → ℝ, UniformContinuous f → IsClosed (Set.image f (Set.univ : Set X))) (hc :CompleteSpace X) : CompactSpace X := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123480,"Let $X$ be a metric space such that every continuous function $f: X \to \mathbb{R}$ is uniformly continuous. Determine whether it is true that for any metric space $Y$, every continuous function $f: X \to Y$ is also uniformly continuous. Prove that the answer is True.","import Mathlib theorem TopologyMetricSpaceUniformContinuous (X : Type*) [MetricSpace X] (h : ∀ f : X → ℝ, Continuous f → UniformContinuous f) (Y : Type*) [MetricSpace Y] (f : X → Y) (hf : Continuous f) : UniformContinuous f := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123547,"Let $(X_1,d_1)$ and $(X_2,d_2)$ be metric spaces. Suppose $f:X_1\to X_2$ satisfies the property that for all $E\subseteq X_1$, $f(E)$ is compact if and only if $E$ is compact. Determine whether $f$ must be continuous. Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem ContinuousMetricMap {X1 X2 : Type*} [MetricSpace X1] [MetricSpace X2] (f : X1 → X2) (h : ∀ E : Set X1, IsCompact (Set.image f E) ↔ IsCompact E) : Continuous f := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123559,"Determine whether every open subset of the complex plane \(\mathbb{C}\) can be decomposed into a countable union of disjoint, connected, and open sets. Specifically, can any open set \(A \subset \mathbb{C}\) be expressed as \(A = \bigcup_{i=1}^{\infty} U_{i}\), where the \(U_{i}\) are non-overlapping, connected, and open? Prove that the answer is Yes.","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem isDecomposable (A : Set ℂ) (hA : IsOpen A) : ∃ U : ℕ → Set ℂ, (∀ i j, i ≠ j → Disjoint (U i) (U j)) ∧ (∀ i, IsOpen (U i)) ∧ (∀ i, IsConnected (U i)) ∧ A = ⋃ i, U i := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123654,"Determine whether it is possible to construct an injection from the power set of the rational numbers to the power set of the natural numbers. Prove that the answer is Yes.","import Mathlib theorem InjectiveRatToNat : ∃ f : Set ℚ → Set ℕ, Function.Injective f := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123690,"Determine whether there exists a subset \( A \) of the real line \( \mathbb{R} \) such that the Lebesgue measure of \( A \setminus \text{int}(A) \) is positive. Prove that the answer is Yes.","import Mathlib theorem SetNonemptyMeasureTheory : ∃ A : Set ℝ, 0 < (MeasureTheory.volume (A \ interior A)).toReal := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123691,"Given a bijection \( f: \mathbb{Z} \to \mathbb{Z} \), determine whether there always exist two bijections \( g: \mathbb{Z} \to \mathbb{Z} \) and \( h: \mathbb{Z} \to \mathbb{Z} \) such that \( f(n) = g(n) + h(n) \) for all \( n \in \mathbb{Z} \). Prove that the answer is Yes.","import Mathlib theorem algebra_482761 (f : ℤ → ℤ) (hf : Function.Bijective f) : ∃ g h : ℤ → ℤ, Function.Bijective g ∧ Function.Bijective h ∧ ∀ n, f n = g n + h n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123705,"Is it possible to construct an uncountable set of subsets of the positive integers, \( T \), such that for any two subsets \( C, D \) in \( T \), either \( C \) is a subset of \( D \) or \( D \) is a subset of \( C \)? Provide a justification for your answer. Prove that the answer is Yes.","import Mathlib theorem IsCt : ∃ T : Set (Set ℕ+), ¬T.Countable ∧ ∀ C ∈ T, ∀ D ∈ T, C ⊆ D ∨ D ⊆ C := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123721,"For a given $x$ where $0 < x < 1$, consider the set $T_x$ of all different sums obtained by choosing paths in the described zigzag process. Is there an uncountable number of distinct elements in $T_x$? Prove that the answer is Yes.","import Mathlib open Real Set open scoped BigOperators theorem uncountable {x : ℝ} (hx : 0 < x ∧ x < 1) : ¬ Countable {y | ∃ p : ℕ → ℤ, (∀ i, p i = 0 ∨ p i = 1) ∧ y = ∑' i, p i * x ^ (i + 1)} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123783,"Determine the 2-dimensional Lebesgue measure of the set \( \Gamma^2 = \{ (\{at\},\{bt\}) : t \in \mathbb{R} \} \subset \mathbb{R}^2 \), where \( \{x\} \) denotes the fractional part of \( x \), and \( a \) and \( b \) are irrational numbers such that \( a/b \) is irrational. Prove that the answer is 0.","import Mathlib open Real Set open scoped BigOperators theorem determine_2d_lebesgue (a b : ℝ) (ha : Irrational a) (hb : Irrational b) (h : Irrational (a / b)) : (MeasureTheory.volume {x : ℝ × ℝ | ∃ t : ℝ, x = (Int.fract (a * t), Int.fract (b * t))}).toReal = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123823,"Determine whether the following inequality holds for all positive real numbers $x_1, x_2, \ldots, x_n$ such that $\sum_{i=1}^{n}{x_i} = n$: \[ \sum_{\text{sym}}{\prod_{i=1}^{n}{x_i^i}} \leqslant n! \] Here, the notation 'sym' is defined as follows: \[ \sum_{\text{sym}}{f(x_1,x_2,\ldots,x_n)} = \sum_{\sigma\in S_n}{f(x_{\sigma(1)},x_{\sigma(2)},\ldots,x_{\sigma(n)})} \] where $S_n$ is the permutation group of degree $n$. Provide a proof or counterexample. Prove that the answer is n!.","import Mathlib open Real open scoped BigOperators theorem inequalities (n : ℕ) (hn : 0 < n) (x : Fin n → ℝ) (hx : ∑ i : Fin n, x i = n) (hx' : ∀ i : Fin n, 0 < x i) : ∑ p : Equiv.Perm (Fin n), (∏ i : Fin n, (x (p i)) ^ (i.1 + 1)) ≤ Nat.factorial n := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123856,"For any positive integer $n$ and any $2n+1$ nonzero integers $a_{0}, a_{1}, \\ldots, a_{2n}$ such that $a_{0}+a_{1}+\\cdots+a_{2n} \\neq 0$, determine if there necessarily exists a permutation $i_{1}, i_{2}, \\ldots, i_{2n+1}$ of $0,1,2, \\ldots, 2n$ such that the polynomial $\\sum_{k=1}^{2n+1} a_{i_{k}} x^{k-1}$ has no integer roots. Prove that the answer is Yes.","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (a : Fin (2 * n + 1) → ℤ) (ha : ∀ i, a i ≠ 0) (hsum : ∑ i, a i ≠ 0) : ∃ i' : Equiv.Perm (Fin (2 * n + 1)), ¬∃ x : ℤ, ∑ k : Fin (2 * n + 1), a (i' k) * x ^ k.val = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123889,"Let \( a_1, a_2, \dots, a_{2015} \) be a sequence of positive integers in the range \([1,100]\). A nonempty contiguous subsequence of this sequence is called *good* if the product of the integers in it leaves a remainder of 1 when divided by 101. In other words, it is a pair of integers \((x, y)\) such that \(1 \le x \le y \le 2015\) and \(a_xa_{x+1}\dots a_{y-1}a_y \equiv 1 \pmod{101}\). Determine the minimum possible number of good subsequences across all possible sequences \((a_i)\). Prove that the answer is 19320.","import Mathlib def isGood (a : ℕ → ℕ) (x y : ℕ) := (∀ i ∈ Finset.Icc 1 2015, a i ∈ Finset.Icc 1 100) ∧ x ≤ y ∧ ∏ i ∈ Finset.Icc x y, a i ≡ 1 [MOD 101] theorem minGood : IsLeast {n | ∃ a : ℕ → ℕ, (∀ i ∈ Finset.Icc 1 2015, a i ∈ Finset.Icc 1 100) ∧ n = {(x, y) : ℕ × ℕ | isGood a x y}.ncard} 19320 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123911,"Determine whether there exist uncountable subsets of the real line that can be covered by arbitrarily small intervals, according to the definition of $S$-small sets. Prove that the answer is Yes.","import Mathlib open Real Set open scoped BigOperators theorem Ssmall : ∃ (A : Set ℝ), ¬ Countable A ∧ (∀ ε > 0, ∃ (x y : ℝ), x < y ∧ y - x = ε ∧ A ⊆ Icc x y) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123923,"Determine the number of distinct continuous functions that can be defined from a separable Hausdorff space \((X, \tau)\) to the interval \([0, 1]\). Prove that the answer is \mathfrak{c}.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem number_of_continuous_functions {X : Type*} [TopologicalSpace X] [SeparableSpace X] [T2Space X] : {f : X → ℝ | Continuous f ∧ ∀ x, f x ∈ Icc 0 1}.encard = c := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123931,"Determine whether there exists an uncountable set of subsets of the natural numbers such that for any two subsets \( A \) and \( B \) in the set, either \( A \) is a subset of \( B \) or \( B \) is a subset of \( A \). Prove that the answer is Yes.","import Mathlib theorem solution : ∃ S : Set (Set ℕ), ¬ Countable S ∧ (∀ A ∈ S, ∀ B ∈ S, A ⊆ B ∨ B ⊆ A) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123949,"Determine the maximum possible rank of a set such that the ranks of all its finite subsets are bounded by a given ordinal \( \beta \). Prove that the answer is \beta.","import Mathlib open Finset theorem maxRank {β : ℕ} (hβ : β > 0) : IsGreatest {x | ∃ s : Finset ℕ, s.card = x ∧ ∀ t ⊆ s, t.card ≤ β} β := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123972,"Determine whether it is possible to construct a subset $B$ of the real numbers such that for any real number $x$, either $x$ or $-x$ is in $B$, but not both; $B$ is closed under finite multiplication; and $B$ contains a non-zero number. Prove that the answer is Yes.","import Mathlib theorem IsCable : ∃ B : Set ℝ, (∀ x : ℝ, (x ∈ B ∨ -x ∈ B) ∧ ¬(x ∈ B ∧ -x ∈ B)) ∧ (∀ x y : ℝ, x ∈ B → y ∈ B → x * y ∈ B) ∧ ∃ x : ℝ, x ≠ 0 ∧ x ∈ B := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-123990,"Given a smooth surjective map from \(\mathbb{R}^n\) to \(\mathbb{R}^m\), determine if it is possible to construct a smooth injective map from \(\mathbb{R}^m\) to \(\mathbb{R}^n\). Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem isSmoothMap (n m : ℕ) (f : EuclideanSpace ℝ (Fin n) → EuclideanSpace ℝ (Fin m)) (h₀ : Function.Surjective f) (h₁ : ContDiff ℝ 1 f) : ∃ g : EuclideanSpace ℝ (Fin m) → EuclideanSpace ℝ (Fin n), Function.Injective g ∧ ContDiff ℝ 1 g := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-124009,"Determine whether the cardinality of the set of all real-valued functions is $2^{\mathfrak c}$, where $\mathfrak c$ is the cardinality of the real numbers. Prove that the answer is 2^{\mathfrak{c}}.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem card_set_of_all_functions : Set.ncard (Set.univ : Set (ℝ → ℝ)) = 2 ^ (Set.univ : Set ℝ).ncard := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-124016,"Determine whether there exists a pair of continuous surjective functions \( f_1 \) and \( f_2 \) from \( \mathbb{Q} \) to itself such that for every \( x, y \in \mathbb{Q} \), the intersection \( f_1^{-1}(x) \cap f_2^{-1}(y) \) is non-empty. Prove that the answer is Yes.","import Mathlib theorem ContinuousSurjectiveFunctions : ∃ (f1 f2 : ℚ → ℚ), Function.Surjective f1 ∧ Function.Surjective f2 ∧ Continuous f1 ∧ Continuous f2 ∧ ∀ x y, Set.Nonempty {z | f1 z = x ∧ f2 z = y} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-124038,"Determine the cardinality of the set of regressive functions from \( \omega \) to \( \omega \), where \( \omega \) is the set of natural numbers. Prove that the answer is 2^{\aleph_0}.","import Mathlib open Set def is_regressive (f : ℕ → ℕ) : Prop := ∀ n, f n < f (n + 1) theorem card_of_regressive : {f | is_regressive f}.ncard = 2 ^ (Nat.card ℕ) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-124630,"Prove that the size of the largest subset of \(\{ - n, - n + 1, \ldots , n - 1, n\}\) which does not contain three elements \(a, b, c\) (not necessarily distinct) satisfying \(a + b + c = 0\) is \(\left\lceil \frac{n}{2} \right\rceil\), where \(n\) is a positive integer.","import Mathlib theorem Finset.nat.card {n : ℕ} (hn : 0 < n) : IsGreatest {k | ∃ s : Finset ℤ, s ⊆ Finset.Icc (-n : ℤ) n ∧ s.card = k ∧ ¬∃ a ∈ s, ∃ b ∈ s, ∃ c ∈ s, a + b + c = 0} ⌈(n / 2 : ℝ)⌉₊ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepScaleR, flc-124724,"Prove that the number of ways to color the set of ordered pairs of integers red and blue such that for all \(a\) and \(b\), the points \((a, b),(-1 - b, a + 1)\), and \((1 - b, a - 1)\) are all the same color is 16.","import Mathlib theorem prove : Set.ncard {f : ℤ × ℤ → Fin 2 | ∀ a b, f (a, b) = f (-1 - b, a + 1) ∧ f (a, b) = f (1 - b, a - 1)} = 16 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepScaleR, flc-124739,"Prove that the number of triples \((f, g, h)\) of permutations on \(\{1,2,3,4,5\}\) such that \(f(g(h(x)))=h(g(f(x)))=g(x)\), \(g(h(f(x)))=f(h(g(x)))=h(x)\), and \(h(f(g(x)))=g(f(h(x)))=f(x)\) for all \(x \in\{1,2,3,4,5\}\) is \(146\).","import Mathlib theorem triple_permutations : {(f, g, h) : Equiv.Perm (Fin 5) × Equiv.Perm (Fin 5) × Equiv.Perm (Fin 5) | ∀ x : Fin 5, f (g (h x)) = h (g (f x)) ∧ h (g (f x)) = g x ∧ g (h (f x)) = f (h (g x)) ∧ f (h (g x)) = h x ∧ h (f (g x)) = g (f (h x)) ∧ g (f (h x)) = f x}.ncard = 146 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepScaleR, flc-125159,"Prove that for a given positive integer \(k\), the minimum value of \(N\) for which there exists a set of \(2k + 1\) distinct positive integers with a sum greater than \(N\) but every subset of size \(k\) having a sum at most \(\frac{N}{2}\) is \(2k^3 + 3k^2 + 3k\).","import Mathlib theorem prove (k : ℕ) (hk : 0 < k) : IsLeast {N | ∃ s : Finset ℕ, s.card = 2 * k + 1 ∧ (∀ i ∈ s, 0 < i) ∧ N < ∑ i ∈ s, i ∧ (∀ t ⊆ s, t.card = k → ∑ i ∈ t, i ≤ N / 2)} (2 * k ^ 3 + 3 * k ^ 2 + 3 * k) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepScaleR, flc-125209,"Prove that the number of \(p\) - element subsets \(A\) of \(\{1,2,\dots,2p\}\) such that the sum of the elements of \(A\) is divisible by \(p\) is \(2+\frac{1}{p}\left(\binom{2p}{p}-2\right)\), where \(p\) is an odd prime number.","import Mathlib theorem prove {p : ℕ} (hp : Odd p ∧ Nat.Prime p) : Set.ncard {A : Finset ℕ | A ⊆ Finset.Icc 1 (2 * p) ∧ A.card = p ∧ ∑ x ∈ A, x ≡ 0 [MOD p]} = 2 + ((Nat.choose (2 * p) p - 2) / p) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepScaleR, flc-125507,"Prove that the number of bijections \( f: A \rightarrow A \), where \( A = \{1, 2, \cdots, 2004\} \) and \( f^{[2004]}(x) = f(x) \) (with \( f^{[2004]}(x) \) denoting applying \( f \) 2004 times to \( x \)), is \(1 + 2004!\).","import Mathlib open Nat theorem number_of_bijections : {f : Fin 2004 → Fin 2004 | Function.Bijective f ∧ ∀ x, f^[2004] x = f x}.ncard = 1 + 2004! := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepScaleR, flc-126128,"Prove that the maximum value of \(k\) for a family \(\{B_1, B_2, \ldots, B_k\}\) of non - empty subsets of the set \(A=\{0, 1, 2, \ldots, 9\}\) such that \(B_i\cap B_j\) has at most two elements for \(i\neq j\) is \(175\).","import Mathlib open Finset theorem max_value : IsGreatest {k : ℕ | ∃(B : Fin k → Set ℕ), (∀ i j, i ≠ j → (B i ∩ B j).ncard ≤ 2) ∧ (∀ i, B i ≠ ∅) ∧ (∀ i, B i ⊆ Icc 0 9)} 175 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepScaleR, flc-126579,"Prove that the maximum value of \(k\) such that for a sequence \(\left\{a_{n}\right\}\) with period 7 and a sequence \(\left\{b_{n}\right\}\) with period 13, there exist \(k\) consecutive terms satisfying \(a_{1} = b_{1}, a_{2} = b_{2}, \cdots, a_{k} = b_{k}\) is 91.","import Mathlib theorem max_value : IsGreatest {k | ∃ (a b : ℕ → ℤ), Function.Periodic a 7 ∧ Function.Periodic b 13 ∧ ∀ i ∈ Finset.range k, a i = b i} 91 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepScaleR, flc-126650,"Prove that the maximum value of \(n\) for distinct non - empty subsets \(A_1,A_2,\cdots,A_n\) of \(M=\{1,2,\cdots,10\}\) such that \(A_i\cap A_j\) has at most two elements for \(i\neq j\) is \(175\).","import Mathlib def M : Finset ℕ := Finset.Icc 1 10 theorem max_n (n : ℕ) : (∃ s : Finset (Finset ℕ), s.card = n ∧ ∀ A ∈ s, A ⊆ M ∧ A.Nonempty ∧ ∀ i ∈ s, ∀ j ∈ s, i ≠ j → (i ∩ j).card ≤ 2) ↔ n ≤ 175 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepScaleR, flc-129049,"Prove that if there are eight different symbols designed on \(n\geq 2\) different T - shirts, each shirt contains at least one symbol, no two shirts contain all the same symbols, and for any \(k\) symbols (\(1\leq k\leq 7\)) the number of shirts containing at least one of the \(k\) symbols is even, then \(n = 255\).","import Mathlib theorem prove (n : ℕ) (hn : n ≥ 2) (a : Fin n → Finset (Fin 8)) (ha : ∀ i j, a i = a j → i = j) (hij : ∀ i, a i ≠ ∅) (hk : ∀ k : Finset (Fin 8), k.card ≤ 7 → Even {i | ∃ s ∈ a i, s ∈ k}.ncard) : n = 255 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepScaleR, flc-129265,"Prove that the largest possible size of a subset \(M\) of \(\{1, 2, \ldots, 2006\}\) such that for any three elements \(x, y, z\) of \(M\) with \(x < y < z\), \(x + y\) does not divide \(z\) is \(1004\).","import Mathlib theorem max_size: IsGreatest {k | ∃ M : Finset ℕ, M ⊆ Finset.Icc 1 2006 ∧ ∀ x ∈ M, ∀ y ∈ M,∀ z ∈ M, x < y → y < z → ¬(x + y ∣ z) } 1004 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepScaleR, flc-129279,"Prove that the maximum number of natural numbers \(x_1,x_2,\cdots,x_m\) such that no \(x_i - x_j\) (\(1\leq i < j\leq m\)) is divisible by \(11\) and the sum \(x_2x_3\cdots x_m + x_1x_3\cdots x_m+\cdots + x_1x_2\cdots x_{m - 1}\) is divisible by \(11\) is \(10\).","import Mathlib theorem max_m : IsGreatest {k | ∃ x : Fin k → ℕ, (∀ i j, i ≠ j → ¬(11 ∣ x i - x j)) ∧ (∑ i, ∏ j ∈ Finset.univ \ {i}, x j) ≡ 0 [ZMOD 11]} 10 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepScaleR, flc-129574,"Prove that the maximum value of \(n\) such that \(M = \{1, 2, \ldots, 10\}\), \(A_1, A_2, \ldots, A_n\) are distinct non - empty subsets of \(M\), and for \(i\neq j\), \(|A_i\cap A_j|\leq2\) is \(175\).","import Mathlib theorem max_n (M : Finset ℕ) (hM : M = Finset.Icc 1 10) (A : Finset (Finset ℕ)) (hA : ∀ s ∈ A, s ⊆ M ∧ s ≠ ∅) (hA' : ∀ i ∈ A, ∀ j ∈ A, i ≠ j → (i ∩ j).card ≤ 2) : A.card ≤ 175 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepScaleR, flc-130900,"Determine whether there exists a continuous function \( f: \mathbb{R}^2 \to \mathbb{R}^2 \) that is not one-to-one but still maps open sets to open sets. Prove that the answer is Yes.","import Mathlib theorem ContinuousMapF : ∃ f : ℝ × ℝ → ℝ × ℝ, Continuous f ∧ ¬(Function.Injective f) ∧ ∀ s : Set (ℝ × ℝ), IsOpen s → IsOpen (f '' s) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-130927,"Determine whether the set \( \left\{\frac{\varphi(n)}{n} : n \in \mathbb{N} \setminus \mathbb{P}^k \right\} \) is dense in the interval \((0,1)\), where \(\mathbb{P}^k\) denotes the set of powers of prime numbers. Prove that the answer is Yes.","import Mathlib open Real Filter Function open scoped Topology theorem DenseSet : closure {x : ℝ | ∃ n : ℕ, x = (Nat.totient n) / n ∧ ¬∃ p k, p.Prime ∧ n = p ^ k} = Set.Ioo 0 1 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-131050,"Prove that there exists a collection \(S\) of special triples (where a special triple \((a_1,a_2,a_3)\) satisfies \(a_1\geq0\), \(a_2\geq0\), \(a_3\geq0\) and \(a_1 + a_2+a_3 = 1\)) with \(|S|=n\) such that any special triple is bettered (a triple \((a_1,a_2,a_3)\) is better than \((b_1,b_2,b_3)\) when exactly two out of \(a_1 > b_1\), \(a_2 > b_2\), \(a_3 > b_3\) hold) by at least one element of \(S\) if and only if \(n\geq4\).","import Mathlib open Finset Real theorem Prove {n : ℕ} : ∃ S : Finset (Fin 3 → ℝ), S.card = n ∧ (∀ s ∈ S, ∀ i, 0 ≤ s i ∧ ∑ i, s i = 1) ∧ (∀ t : Fin 3 → ℝ, (∀ i, 0 ≤ t i ∧ ∑ i, t i = 1) → ∃ s ∈ S, (∃ i j, i ≠ j ∧ t i < s i ∧ t j < s j)) ↔ n ≥ 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepScaleR, flc-132280,"Let $X$ be a metric space and $Y$ a complete metric space. Let $H \subseteq X$ be a dense subset. For each $n \in \mathbb{N}$, let $f_n : X \to Y$ be a map. Suppose: (a) the family $\{f_n \mid n \in \mathbb{N}\}$ is equicontinuous, and (b) for each $x \in H$, $\lim_{n \to \infty} f_n(x)$ exists. Prove that for each $x \in X$, $\lim_{n \to \infty} f_n(x)$ exists.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (X : Type*) [MetricSpace X] (Y : Type*) [MetricSpace Y] [CompleteSpace Y] (H : Set X) (hH : Dense H) (f : ℕ → X → Y) (hf : Equicontinuous f) (hH' : ∀ x ∈ H, ∃ L, Tendsto (λ n => f n x) atTop (𝓝 L)) : ∀ x, ∃ L, Tendsto (λ n => f n x) atTop (𝓝 L) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-132486,"Let $X$ be a complete metric space, and let $\big\{U_n : n \in \mathbb{N}\big\}$ be a sequence of dense open subsets of $X$. Prove that $\bigcap_{n \in \mathbb{N}} U_n$ is dense in $X$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem complete_distance (X : Type*) [MetricSpace X] [CompleteSpace X] (U : ℕ → Set X) (hU : ∀ n, IsOpen (U n)) (hU' : ∀ n, Dense (U n)) : Dense (⋂ n, U n) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-132535,"Let $n \in \mathbb{N}$ and $q \in \mathbb{N}$ be positive integers. Define the summation involving Stirling numbers of the second kind as: $$S(n, q) = \sum_{k=0}^n {n \brace k} k {q \choose k} k!.$$ Prove that the closed form for $S(n, q)$ is given by: \[ S(n, q) = \begin{cases} q^{n+1} - q (q-1)^n, & q > n, \\ q^{n+1} - q (q-1)^n, & q \leq n. \end{cases} \]","import Mathlib open Finset theorem S {n q : ℕ} (hn : 0 < n) (hq : 0 < q) : ∑ k ∈ range (n + 1), Nat.choose n k * k * Nat.choose q k * Nat.factorial k = if q > n then q^(n + 1) - q * (q - 1)^n else q^(n + 1) - q * (q - 1)^n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-132543,"Let $Z$ be a non-empty set, and let $P: Z^* o extbf{Bool}$ be a predicate such that for every finite sequence $\boldsymbol{z} = \big\langle z_1, z_2, \dots, z_n \big\rangle$ in $Z$ satisfying $P(\boldsymbol{z})$, there exists an element $z \in Z$ such that $P\big\langle z_1, z_2, \dots, z_n, z \big\rangle$ holds. Prove that, by the Axiom of Dependent Choice ($\textsf{DC}$), there exists a function $f: \mathbb{N} \to Z$ such that for every $n \in \mathbb{N}$, the sequence $\big\langle f(1), f(2), \dots, f(n) \big\rangle$ satisfies $P$.","import Mathlib open scoped BigOperators theorem AxiomOfDependentChoice {Z : Type*} [Nonempty Z] (P : (List Z) → Prop) (hP : ∀ z, P z → ∃ w, P (z ++ [w])) : ∃ f : ℕ → Z, ∀ n, P (List.map f (List.range n)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-132681,"Let $X$ be a topological space and $eta X$ its Stone–Čech compactification. Prove that if $X$ is not normal, then $eta X$ is not metrizable.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem βX_not_metrizable {X : Type*} [TopologicalSpace X] (hX : ¬NormalSpace X) : ¬ MetrizableSpace (StoneCech X) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-132759,"Let $X$ be a set. Prove that there exists a linear order $<$ on $X$ such that for any $x, y \\in X$, either $x < y$, $x = y$, or $y < x$. This result relies on Zorn's Lemma, which guarantees the existence of a maximal element in the partially ordered set of linear orders on subsets of $X$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem linearOrder (X : Type*) : ∃ l : LinearOrder X, ∀ x y : X, x < y ∨ x = y ∨ y < x := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-132799,"Let $F$ be a countable field. Prove that the algebraic closure of $F$ is countable, assuming the axiom of choice.","import Mathlib theorem algebraic_closure_is_countable {F : Type*} [Field F] [Countable F] (hF : AxiomChoice) : Countable (AlgebraicClosure F) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-132936,"Let $A$ be a set of $n$ residues modulo $n^2$. Prove that there exists a set $B$ of $n$ residues modulo $n^2$ such that at least half of the residues modulo $n^2$ can be expressed as $a + b$, where $a \\in A$ and $b \\in B$.","import Mathlib theorem n_residue (n : ℕ) (hn : 0 < n) (A : Finset (ZMod (n ^ 2))) : ∃ B : Finset (ZMod (n ^ 2)), B.card = n ∧ {x | ∃ a ∈ A, ∃ b ∈ B, x = a + b}.ncard ≥ (n ^ 2 / 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-132980,"Let $A = [a_{ij}]$ be an $n \times n$ matrix with entries $a_{ij} \in \mathbb{R}$. Define the determinant of $A$ as $\det A = \sum_{\sigma \in S_n} (-1)^{\text{sgn}(\sigma)} a_{1\sigma(1)} a_{2\sigma(2)} \cdots a_{n\sigma(n)}$, where $S_n$ is the symmetric group of all permutations of $\{1, 2, \ldots, n\}$. Prove that $$ \prod_{j=1}^n \left( \sum_{i=1}^n |a_{ij}| \right) \geq \sum_{\sigma \in S_n} |a_{1\sigma(1)} a_{2\sigma(2)} \cdots a_{n\sigma(n)}|. $$ Here, the left-hand side represents the product of column sums of absolute values, and the right-hand side is the summation over all permutations of the absolute values of the determinant's terms.","import Mathlib open Matrix Finset theorem g : ∀ n > 0, ∀ A : Matrix (Fin n) (Fin n) ℝ, (∏ j : Fin n, ∑ i : Fin n, |A i j|) ≥ ∑ σ : Equiv.Perm (Fin n), |∏ i : Fin n, A i (σ i)| := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-133271,"Let $f: \\mathbb{R}^n \\to \\mathbb{R}^n$ be a $C^1$ (continuously differentiable) function, and let $A \\subset \\mathbb{R}^n$ be a set of measure zero. Prove that $f(A)$ is also a set of measure zero.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MeasureTheory.volume (f : EuclideanSpace ℝ (Fin n) → EuclideanSpace ℝ (Fin n)) (hf : ContDiff ℝ 1 f) (A : Set (EuclideanSpace ℝ (Fin n))) (hA : MeasureTheory.volume A = 0) : MeasureTheory.volume (f '' A) = 0 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-133454,"Let $f: \\mathbb{R} \\to \\mathbb{R}$ be a continuously differentiable function, and let $A \\subset \\mathbb{R}$ be a set of measure zero (null set). Prove that $f(A)$ is also a set of measure zero.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MeasureTheoryContinuousDifferentiable {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) (A : Set ℝ) (hA : MeasureTheory.volume A = 0) : MeasureTheory.volume (f '' A) = 0 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-133719,Let $X$ be a complete metric space and let $\\{O_n\\}_{n \\in \\\mathbb{N}}$ be a countable family of dense open subsets of $X$. Prove that $$\\bigcap_{n=1}^{\\infty} O_n$$ is dense in $X$.,"import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem DenseInter {X : Type*} [MetricSpace X] [CompleteSpace X] (O : ℕ → Set X) (hO : ∀ n, IsOpen (O n)) (hO' : ∀ n, Dense (O n)) : Dense (⋂ n, O n) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-133826,Let $X$ be a separable $T_3$ space. Prove that the cardinality of $X$ satisfies $|X| \leq 2^{2^{\aleph_0}} = 2^{\mathfrak{c}}$.,"import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem cardSeparableT3 (X : Type*) [TopologicalSpace X] (hX : SeparableSpace X) (hX' : T3Space X) : (univ : Set X).encard ≤ 2^(2^Nat.card ℕ) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-133939,"Let $\beth_0 = \aleph_0$ denote the cardinality of the set of natural numbers, and define $\beth_1 = 2^{\beth_0}$ as the cardinality of the continuum (the real numbers). For any ordinal $\alpha$, let $\beth_{\alpha+1} = 2^{\beth_{\alpha}}$ and for limit ordinals $\lambda$, let $\beth_{\lambda} = \sup_{\alpha < \lambda} \beth_\alpha$. Prove that $\beth_1 < \beth_2$, where $\beth_2$ is the cardinality of the power set of the real numbers.","import Mathlib open Set Real theorem beth : (2 ^ (Nat.card ℕ)) < (2 ^ (2 ^ (Nat.card ℕ))) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-134030,"Let $A: \text{Nat} \times \text{Nat} \to \text{Nat}$ be Ackermann's function defined recursively as follows: \[ A(x, y) = \begin{cases} y + 1 & \text{if } x = 0, \\ A(x-1, 1) & \text{if } x > 0 \text{ and } y = 0, \\ A(x-1, A(x, y-1)) & \text{if } x > 0 \text{ and } y > 0. \end{cases} \] Prove that $A(x, y)$ is a total function; that is, for all $x, y \in \text{Nat}$, $A(x, y)$ is well-defined and terminates.","import Mathlib open Finset theorem Ackermann (A : ℕ → ℕ → ℕ) (hA : ∀ x y, A x y = if x = 0 then y + 1 else (if y = 0 then A (x - 1) 1 else A (x - 1) (A x (y - 1)))) (x y : ℕ) : ∃ n, A x y = n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-134104,Let $X$ be a topological space. Suppose $X$ is regular and Lindelöf. Prove that $X$ is paracompact.,"import Mathlib theorem TopologyRegularLindelof (X : Type*) [TopologicalSpace X] (hregular : RegularSpace X) (hlindelof : LindelofSpace X) : ParacompactSpace X := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-134113,"Let $X$ and $Y$ be Hausdorff topological spaces, and let $f: X o Y$ be a continuous map. Suppose the following conditions hold: 1. $X$ is compact, 2. $f$ is a local homeomorphism, 3. $f$ is surjective. Prove that $f$ is a covering map.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem iscoveringmap {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] (hX : T2Space X) (hY : T2Space Y) (f : X → Y) (hf : Continuous f) (hXc : CompactSpace X) (hXl : IsLocalHomeomorph f) (hXs : Function.Surjective f) : IsCoveringMap f := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-134212,"Let $N, M, K$ be non-negative integers such that $K+N+M$ is even. Prove that the number of generalized Dyck paths of length $K$ starting at height $N$ and ending at height $M$, while never going below the x-axis, is given by: $$ \binom{K}{\frac{K-N+M}{2}} - \binom{K}{\frac{K+N+M}{2}+1}. $$","import Mathlib open Finset theorem dyck_path (N M K : ℕ) (hK : Even (K + N + M)) : {p : ℕ → ℕ | p 0 = N ∧ p K = M ∧ ∀ i ∈ Icc 1 K, p i ≥ 0}.ncard = Nat.choose K ((K - N + M) / 2) - Nat.choose K ((K + N + M) / 2 + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-134215,"Let $(M, \\prec)$ be a structure where \\prec is a binary relation on $M$ satisfying the following axioms: 1. Trichotomy: For all $x, y \\in M$, exactly one of the following holds: $x = y$, $x \\prec y$, or $y \\prec x$. 2. Transitivity: For all $x, y, z \\in M$, if $x \\prec y$ and $y \\prec z$, then $x \\prec z$. 3. Total injectivity of the successor function: There exists a function $S: M \\to M$ such that for all $x, y \\in M$, $S(x) = S(y)$ implies $x = y$, and for every $x \\in M$, there exists a unique $y \\in M$ such that $S(y) = x$. Prove that $(M, \\prec)$ is isomorphic to $(\\mathbb{Z}, <)$. That is, there exists a bijective function $f: \\mathbb{Z} \\to M$ such that for all $m, n \\in \\mathbb{Z}$, $m < n$ if and only if $f(m) \\prec f(n)$.","import Mathlib theorem Isomorphic (M : Type*) [PartialOrder M] (hM : ∀ x y : M, x = y ∨ x < y ∨ y < x) (hM' : ∀ x y z : M, x < y ∧ y < z → x < z) (hM'' : ∃ S : M → M, (∀ x y : M, S x = S y → x = y) ∧ (∀ x : M, ∃! y : M, S y = x)) : ∃ f : ℤ → M, Function.Bijective f ∧ ∀ m n : ℤ, m < n ↔ f m < f n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-134313,"Let $X$ be a normal topological space, and let $A, B \\subseteq X$ be two disjoint closed subsets. Prove that there exists a continuous function $f: X \\to [0,1]$ such that $f(a) = 0$ for all $a \\in A$ and $f(b) = 1$ for all $b \\in B$.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem normal_space {X : Type*} [TopologicalSpace X] (hX : NormalSpace X) (A B : Set X) (hA : IsClosed A) (hB : IsClosed B) (hAB : Disjoint A B) : ∃ f : X → ℝ, Continuous f ∧ ∀ x, f x ∈ Icc 0 1 ∧ (∀ x ∈ A, f x = 0) ∧ (∀ x ∈ B, f x = 1) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-134370,"Let $p$ be a prime number, and let $n, j, k$ be integers such that $1 \\leq j, k \\leq p-1$ and $n \\equiv k \\pmod{p-1}$. Prove that the following congruence holds: \\begin{align*} \\sum_{l \\geq 0} \\binom{n}{l(p-1)+j} \\equiv \\binom{k}{j} \\pmod{p}. \\end{align*}","import Mathlib theorem Nat.choose.sum (p : ℕ) (hp : Nat.Prime p) (n j k : ℕ) (hj : 1 ≤ j ∧ j ≤ p - 1) (hk : 1 ≤ k ∧ k ≤ p - 1) (hn : n ≡ k [MOD p - 1]) : (∑' l : ℕ, Nat.choose n (l * (p - 1) + j)) ≡ Nat.choose k j [ZMOD p] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-134486,"Let $A \subset \mathbb{R}$ be a measurable set with positive measure, and let $A^c$ denote its complement. Suppose both $A$ and $A^c$ have positive measure. Prove that there exists a translation $d \in \mathbb{R}$ such that $(A + d) \setminus A$ has positive measure.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MeasureTheory.volume (A : Set ℝ) (hA : 0 < (MeasureTheory.volume A).toReal) (hA' : 0 < (MeasureTheory.volume (Aᶜ)).toReal) : ∃ d, 0 < (MeasureTheory.volume (Aᶜ ∩ {x | x - d ∈ A})).toReal := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-134487,"Let $X$ be a compact topological space, $U \subset X$ an open subset, and $J$ a set of functions $f: X \to \mathbb{R}$ such that for each $x \in X \setminus U$, there exists $f_x \in J$ satisfying $f_x(x) > 1$. Prove that there exists a finite collection of functions $f_{x_1}, f_{x_2}, \ldots, f_{x_n} \in J$ such that for any $x \in X \setminus U$, we have $$\sum_{j=1}^n f_{x_j}(x) > 1.$$","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (X : Type*) [TopologicalSpace X] [CompactSpace X] (U : Set X) (hU : IsOpen U) (J : Set (X → ℝ)) (hJ : ∀ x ∈ Uᶜ, ∃ f ∈ J, f x > 1) : ∃ n : ℕ, ∃ f : Fin n → (X → ℝ), (∀ i, f i ∈ J) ∧ (∀ x ∈ Uᶜ, ∑ j : Fin n, (f j) x > 1) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-134505,Let $n$ be a non-negative integer. Prove that the summation $$\textbf{S}(n) = \sum_{k=0}^n (-1)^{n-k} 3^k \binom{3n-k}{2n} \binom{3n+1+k}{2k}$$ satisfies the identity $$\textbf{S}(n) = 27^n.$$,"import Mathlib open Finset theorem S (n : ℕ) : ∑ k ∈ range (n + 1), (-1 : ℤ) ^ (n - k) * 3 ^ k * Nat.choose (3 * n - k) (2 * n) * Nat.choose (3 * n + 1 + k) (2 * k) = 27 ^ n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-134603,"Let $N, m \\in \\\mathbb{N}$. In intuitionistic logic, prove that the following statement holds: $$\\forall N \\in \\\mathbb{N}, \\\exists m \\in \\\mathbb{N}, m > N.$$ This is a constructively valid interpretation equivalent to the classical negation of the statement: $$\\exists N \\in \\\mathbb{N}, \\\forall m \\in \\\mathbb{N}, N > m.$$","import Mathlib open Nat theorem constructively_valid : ∀ N : ℕ, ∃ m : ℕ, m > N := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-134724,"Let $S \\subseteq C[0,1]$ be a subset of the space of continuous functions on $[0,1]$ with the uniform norm. If $S$ is uncountable, prove that there exists a sequence $(x_n)_{n \\in \\\mathbb{N}}$ of distinct elements of $S$ such that $(x_n)$ converges to some $x \\in C[0,1]$ in the uniform norm.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem ContinuousUniformNorm (S : Set (ℝ → ℝ)) (hS : ∀ f ∈ S, ContinuousOn f (Set.Icc 0 1)) : ¬ Countable S → ∃ x : ℕ → (ℝ → ℝ), (∀ i j, i ≠ j → x i ≠ x j) ∧ (∃ y ∈ S, Tendsto x atTop (𝓝 y)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-134782,"Let $\mathbb{N}$ denote the set of natural numbers. Prove that the set of bijections from $\mathbb{N}$ to itself has cardinality $2^{\aleph_0}$, which is the same as the cardinality of the real numbers $\mathbb{R}$. Formally, prove that $$|\text{Bij}(\mathbb{N}, \mathbb{N})| = 2^{\aleph_0}.$$","import Mathlib open Set Real theorem card_bijective : {f : ℕ → ℕ | Function.Bijective f}.ncard = 2 ^ (Nat.card ℕ) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-134788,"Let $X$ be a compact topological space and $Y$ be a topological space. Let $f: X o Y$ be a closed map. Define the set-valued map $F: Y o 2^X$ by $F(y) = f^{-1}[\\{y\\}]$, where $2^X$ is the hyperspace of closed subsets of $X$ equipped with the Vietoris topology. Prove that $F$ is lower semi-continuous, i.e., for every open set $U \subseteq X$, the set $\\{y \in Y \mid F(y) \cap U \neq \emptyset\\}$ is open in $Y$.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem lower_semi_continuous {X Y : Type*} [TopologicalSpace X] [CompactSpace X] [TopologicalSpace Y] (f : X → Y) (hf : IsClosedMap f) (F : Y → Set X) (hF : ∀ y, F y = f ⁻¹' {y}) : ∀ U, IsOpen U → IsOpen {y | F y ∩ U ≠ ∅} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-134883,"Let $\mathbb{N}$ denote the natural numbers with the discrete topology, and let $\mathbb{N}^\omega$ denote the countable product of $\mathbb{N}$ endowed with the product topology. Prove that a subset $O \subseteq \mathbb{N}^\omega$ is open in the product topology if and only if for each $x = (x_n)_{n \in \omega} \in O$, there exists a finite initial segment $(x_1, x_2, \ldots, x_N)$ such that all sequences in $\mathbb{N}^\omega$ extending $(x_1, x_2, \ldots, x_N)$ are contained in $O$.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem isOpen (O : Set (ℕ → ℕ)) : IsOpen O ↔ ∀ x ∈ O, ∃ N : ℕ, ∃ y : ℕ → ℕ, (∀ i ∈ Finset.range N, y i = x i) ∧ (∀ z : ℕ → ℕ, (∀ i ∈ Finset.range N, z i = y i) → z ∈ O) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-134980,"Let $A' = \{ f \in C[0,1] : \|f\|_\infty \leq K, \operatorname{Lip}(f) \leq M \}$, where $\|f\|_\infty = \sup_{x \in [0,1]} |f(x)|$ is the sup norm and $\operatorname{Lip}(f) = \sup_{x, y \in [0,1], x \neq y} \frac{|f(x) - f(y)|}{|x - y|}$ is the Lipschitz constant. Prove that $A'$ is compact in the sup norm topology on $C[0,1]$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem CompactSupNorm (K M : ℝ) : IsCompact {f : ℝ → ℝ | ContinuousOn f (Set.Icc 0 1) ∧ (∀ x ∈ Set.Icc 0 1, |f x| ≤ K) ∧ (∀ x y : ℝ, x ∈ Set.Icc 0 1 → y ∈ Set.Icc 0 1 → x ≠ y → |f x - f y| / |x - y| ≤ M)} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-135000,"Let $U \subset \mathbb{R}^n$ be an open subset, and let $f: U \to \mathbb{R}^n$ be an injective, continuous map. Prove that $f(U)$ is an open subset of $\mathbb{R}^n$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (n : ℕ) (U : Set (EuclideanSpace ℝ (Fin n))) (f : U → EuclideanSpace ℝ (Fin n)) (hU : IsOpen U) (hf : Continuous f) (hinjective : Function.Injective f) : IsOpen (Set.range f) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-135233,Let $X$ be a locally compact topological space. Prove that $X$ cannot be expressed as a countable union of nowhere dense subsets of $X$.,"import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem cannotExpressUnionNowhereDense (X : Type*) [TopologicalSpace X] (hX : LocallyCompactSpace X) : ¬ ∃ U : Set (Set X), Countable U ∧ (∀ s ∈ U, IsNowhereDense s) ∧ (⋃ s ∈ U, s) = univ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-135415,"Let $(X, d)$ be a complete metric space. Suppose $\\{U_n\\}_{n=1}^\\infty$ is a countable collection of open and dense subsets of $X$. Prove that the intersection $\\bigcap_{n=1}^\\infty U_n$ is also dense in $X$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem complete_metric_space (X : Type*) [MetricSpace X] [CompleteSpace X] (U : ℕ → Set X) (hU : ∀ n, IsOpen (U n)) (hU' : ∀ n, Dense (U n)) : Dense (⋂ n, U n) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-135417,"Let $n, m \in \mathbb{N}$ with $m > n$. Prove that there exists a bijection $g: \mathbb{R}^n \to \mathbb{R}^m$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem exist_bijective (n m : ℕ) (hm : m > n) : ∃ g : (Fin n → ℝ) → (Fin m → ℝ), Function.Bijective g := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-135549,"Let $E$ be an infinite set, and let $S$ be a subset of $\mathcal{P}(E)$ (the power set of $E$) such that: 1. $S$ contains all singleton subsets of $E$, i.e., $\{ \{x\} \mid x \in E \} \subseteq S$. 2. $S$ is closed under finite union, i.e., if $A, B \in S$, then $A \cup B \in S$. 3. $S$ is closed under complement, i.e., if $A \in S$, then $E \setminus A \in S$. 4. $S \neq \mathcal{P}(E)$. Prove that $S$ is not closed under infinite intersection, i.e., there exist subsets $\{A_i\}_{i \in \mathbb{N}} \subseteq S$ such that $\bigcap_{i \in \mathbb{N}} A_i \not\in S$.","import Mathlib theorem qwen {E : Type*} [Infinite E] (S : Set (Set E)) (hS1 : ∀ x : E, {x} ∈ S) (hS2 : ∀ A ∈ S, ∀ B ∈ S, A ∪ B ∈ S) (hS3 : ∀ A ∈ S, Aᶜ ∈ S) (hS4 : S ≠ ⊤) : ¬(∀ A : ℕ → Set E, (∀ i, A i ∈ S) → ⋂ i, A i ∈ S) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-135605,"Let $f(u,z)$ be the bivariate generating function defined as $$f(u,z) = \\sum_{m \ge 0} m! \left( z + \frac{2u z^2}{1 - uz} \right)^m.$$ Prove that the generating function for the number of permutations $\\sigma$ of $[1..n]$ such that $|\\sigma_{i+1} - \\sigma_i| \\neq 1$ for $1 \\leq i < n$ is given by $$f(-1,z) = \\sum_{m \\ge 0} m! \left( z \\frac{1-z}{1+z} \right)^m.$$","import Mathlib open Finset Real Nat theorem bivariateGeneratingFunction {f : ℝ → ℝ → ℝ} (hf : ∀ u z, f u z = ∑' m : ℕ, (Nat.factorial m) * (z + 2 * u * z ^ 2 / (1 - u * z)) ^ m) : ∀ z, f (-1) z = ∑' m : ℕ, (Nat.factorial m) * (z * (1 - z) / (1 + z)) ^ m := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-135653,"Let $(X, d_X)$ and $(Y, d_Y)$ be metric spaces, and let $X_0 \\subseteq X$ be a dense subset of $X$. Suppose $f: X \\to Y$ is a continuous mapping that is isometric on $X_0$, i.e., for all $a, b \\in X_0$, $d_X(a, b) = d_Y(f(a), f(b))$. Prove that $f$ is isometric on $X$, meaning that for all $x_1, x_2 \\in X$, $d_X(x_1, x_2) = d_Y(f(x_1), f(x_2))$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem isContinuous (X : Type*) [MetricSpace X] (Y : Type*) [MetricSpace Y] (X0 : Set X) (hX0 : Dense X0) (f : X → Y) (hf : Continuous f) (hX : ∀ a ∈ X0, ∀ b ∈ X0, dist a b = dist (f a) (f b)) : ∀ x y : X, dist x y = dist (f x) (f y) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-135710,"Let $X$ be a compact, connected, and Hausdorff topological space (a continuum). Prove that it is impossible to partition $X$ into a countable collection of disjoint non-empty closed subsets.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem partitionImpossible (X : Type*) [TopologicalSpace X] [CompactSpace X] [ConnectedSpace X] [T2Space X] : ¬ ∃ (C : ℕ → Set X), (∀ i, IsClosed (C i)) ∧ (∀ i j, i ≠ j → C i ∩ C j = ∅) ∧ (∀ i, C i ≠ ∅) ∧ (∀ x, ∃! i, x ∈ C i) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-135740,Let $f: \\mathbb{R}^n \\to \\mathbb{R}^m$ be a continuous and injective function. Prove that $n = m$.,"import Mathlib theorem TopologyContinuousFunction {n m : ℕ} (hn : 0 < n) (hm : 0 < m) (f : EuclideanSpace ℝ (Fin n) → EuclideanSpace ℝ (Fin m)) (hf : Continuous f) (hinjective : Function.Injective f) : n = m := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-135861,"Let $(X, d)$ be a compact metric space, and let $f: X \to X$ be a function satisfying $$d(f(x), f(y)) < d(x, y)$$ for all $x, y \in X$ with $x \neq y$. Prove that $f$ admits a fixed point, i.e., there exists $x_0 \in X$ such that $f(x_0) = x_0$.","import Mathlib theorem TopologyCompactMetricSpace {X : Type*} [MetricSpace X] (hc : CompactSpace X) (f : X → X) (h : ∀ x y, x ≠ y → dist (f x) (f y) < dist x y) : ∃ x, f x = x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-135918,"Let $E \subseteq [0,1]$ be a closed subset. Prove that there exists a smooth function $f: \mathbb{R} \to \mathbb{R}$ such that $f^{-1}(0) = E$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem proveSmoothInverse (E : Set ℝ) (hE : IsClosed E) (hE' : E ⊆ Set.Icc 0 1) : ∃ f : ℝ → ℝ, ContDiff ℝ ⊤ f ∧ f ⁻¹' {0} = E := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-135927,"Let $X$ be a set and $f: X \to \mathcal{P}(X)$ be a function, where $\mathcal{P}(X)$ denotes the power set of $X$. Define the set $S = \{x \in X \mid x \notin f(x)\}$. Prove that $S \notin \text{Range}(f)$, i.e., $S$ is not in the image of $f$. Formally, $$\forall f: X \to \mathcal{P}(X), \exists S \subseteq X \text{ such that } S \notin \text{Range}(f).$$","import Mathlib open Set Real open scoped BigOperators theorem rangeOfFunction {α : Type*} (f : α → Set α) (S : Set α) (hS : S = {x | x ∉ f x}) : S ∉ range f := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-136382,"Determine whether the sequence of fractional parts \( \{\log_{10}(n!)\}_n \) is dense in the interval \([0,1]\). Prove that the answer is Yes.","import Mathlib open Real Filter Function open scoped Topology theorem DenseFractionalParts : closure {x | ∃ n, x = logb 10 (Nat.factorial n) % 1} = Set.Icc 0 1 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-136619,"Let $p$ be a prime number and $n$ a positive integer such that $p \mid n$. Consider the symmetric group $S_n$ acting by conjugation on the elements of order $p$ in $S_n$. Prove that the number of elements of order $p$ in $S_n$ is given by: $$ \text{Total elements of order } p = \sum_{k=1}^{\lfloor{n/p}\rfloor} \frac{n!}{(n-kp)! \cdot p^k \cdot k!}. $$ Here, $k$ represents the number of $p$-cycles in the cycle decomposition of a permutation, and $\lfloor{n/p}\rfloor$ is the largest integer less than or equal to $n/p$.","import Mathlib theorem total_powerset {p n : ℕ} (hp : Nat.Prime p) (hn : 0 < n) (hpn : p ∣ n) : {g : Equiv.Perm (Fin n) | orderOf g = p}.ncard = ∑ k ∈ Finset.Icc 1 ⌊(n / p : ℝ)⌋₊, n.factorial / ((n - k * p).factorial * p ^ k * k.factorial) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-136982,"Determine whether the closure of the set \( \left\{\frac{\tan(n)}{n} \mid n \in \mathbb{N} \right\} \) is equal to \( \mathbb{R} \). Prove that the answer is \mathbb{R}.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem closure_set : closure {x | ∃ n : ℕ, x = Real.tan n / n} = Set.univ := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-136983,"Determine the number of distinct roots of the equation \( f^{1992}(x) = x \), where \( f(x) = 4x(1-x) \) and \( f : [0, 1] \to [0, 1] \). Prove that the answer is 2^{1992}.","import Mathlib open Real Set open scoped BigOperators theorem number_of_roots {f : ℝ → ℝ} (hf : f = λ x => 4 * x * (1 - x)) : {x | f^[1992] x = x}.ncard = 2 ^ 1992 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-136984,"Determine whether the set \(X = \{f \in C^\infty[0,1] : f^{(n)}(0)=f^{(n)}(1)=0 \ \forall n\geq0\}\) is dense in \(L^2[0,1]\). Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem closure_dense : closure {f : ℝ → ℝ | ContDiffOn ℝ ⊤ f (Set.Icc 0 1) ∧ ∀ n ≥ 0, iteratedDeriv n f 0 = 0 ∧ iteratedDeriv n f 1 = 0} = ⊤ := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-137009,"Verify the identity: \[ \sum_{k=0}^n \binom{n}{k} \binom{(p-1)n}{k} \binom{pn+k}{k} = \binom{pn}{n}^2, \] for all natural numbers \( p \) such that \( p \ge 2 \). Prove that the answer is \binom{pn}{n}^2.","import Mathlib open Finset theorem nchoose (n : ℕ) (p : ℕ) (hp : 2 ≤ p) : ∑ k ∈ Icc 0 n, Nat.choose n k * Nat.choose ((p - 1) * n) k * Nat.choose (p * n + k) k = (Nat.choose (p * n) n) ^ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-137024,"Let \( m > 1 \), and \( n \), \( k \) be positive integers. Determine whether there exists a positive integer \( l > m-1 \) such that \( \binom{l}{m} \equiv k \pmod{2^n} \). Prove that the answer is Yes.","import Mathlib theorem qwen (m : ℕ) (n k : ℕ) (hm : 1 < m) (hn : 0 < n) (hk : 0 < k) : ∃ l : ℕ, 0 < l ∧ l > m - 1 ∧ Nat.choose l m ≡ k [MOD 2 ^ n] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-137117,"Determine whether for any fixed \(\delta > 0\), there exists \(M = M(\delta)\) such that \(\frac{C_{k,M}}{(4 -\delta)^k} \to \infty\) as \(k \to \infty\). Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem determine (δ : ℝ) (hδ : δ > 0) : ∃ M, Tendsto (λ k => (Nat.choose k M) / (4 - δ)^k) atTop atTop := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-137178,"Determine whether the following statement is true or false: Every locally compact separable Hausdorff space is $\sigma$-compact. Prove that the answer is True.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem sigma_compact (X : Type*) [TopologicalSpace X] (hX : LocallyCompactSpace X) (hX1 : SeparableSpace X) (hX2 : T2Space X) : SigmaCompactSpace X := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-137190,"Determine whether there exists a set \( E \) in \( \mathbb{R}^m \) for \( m \geq 2 \), with respect to the regular Euclidean topology, that satisfies the following conditions: 1. The interior of \( E \) is empty. 2. The Lebesgue measure of \( E \) is positive. 3. \( E \) is connected. Prove that the answer is Yes.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem existence : ∃ (m : ℕ) (hm : m ≥ 2), ∃ E : Set (EuclideanSpace ℝ (Fin m)), interior E = ∅ ∧ 0 < (MeasureTheory.volume E).toReal ∧ IsConnected E := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-137334,"Prove that for an integer \(n > 1\), the smallest positive number \(m\) such that for any set \(\{a,b\} \subset \{1,2,\cdots,2n - 1\}\), there exist non - negative integers \(x,y\) (not all zero) with \(2n\mid ax + by\) and \(x + y\leq m\) is \(n\).","import Mathlib theorem prove (n : ℕ) (hn : 1 < n) : IsLeast {m | 0 < m ∧ ∀ a ∈ Finset.Icc 1 (2 * n - 1), ∀ b ∈ Finset.Icc 1 (2 * n - 1), ∃ x y : ℕ, (x ≠ 0 ∨ y ≠ 0) ∧ 2 * n ∣ a * x + b * y ∧ x + y ≤ m} n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepScaleR, flc-137649,"Prove that for any integer \(n\geq 2\), the maximum number \(N(n)\) of triples \((a_i, b_i, c_i)\), \(i = 1,\ldots,N(n)\) consisting of non - negative integers \(a_i\), \(b_i\) and \(c_i\) such that \(a_i + b_i + c_i=n\) for all \(i = 1,\ldots,N(n)\) and if \(i\neq j\) then \(a_i\neq a_j\), \(b_i\neq b_j\) and \(c_i\neq c_j\) is given by \(N(n)=\left\lfloor\frac{2n}{3}\right\rfloor + 1\).","import Mathlib open Finset theorem max_triples {n : ℕ} (hn : 2 ≤ n) : IsGreatest {k | ∃ a b c : Fin k → ℕ, (∀ i, a i + b i + c i = n) ∧ (∀ i j, i ≠ j → a i ≠ a j ∧ b i ≠ b j ∧ c i ≠ c j)} (Nat.floor (2 * n / 3) + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepScaleR, flc-140397,"Let $a_n$ and $b_n$ be sequences defined recursively as follows: $$b_n = \\sum_{q=1}^n (-1)^{n-q} {n \\choose q} q^n a_q$$ and $$a_n = \\sum_{q=1}^n {n-1 \\choose q-1} n^{-q} b_q.$$ Prove that, for all $n \\geq 1$, the sequences satisfy the equality $$a_n = \\sum_{p=1}^n (-1)^p a_p \\times (-1)^p [[n=p]],$$ where $[[n=p]]$ is the Iverson bracket notation, which evaluates to $1$ if $n=p$ and $0$ otherwise.","import Mathlib open Finset Real Nat theorem g {a b : ℕ → ℝ} (ha : ∀ n ≥ 1, a n = ∑ q ∈ Icc 1 n, Nat.choose (n - 1) (q - 1) * (n : ℝ) ^ (-q : ℤ) * b q) (hb : ∀ n ≥ 1, b n = ∑ q ∈ Icc 1 n, (-1) ^ (n - q) * Nat.choose n q * q ^ n * a q) (n : ℕ) (hn : 1 ≤ n) : a n = (∑ p ∈ Icc 1 n, (-1 : ℝ) ^ p * a p * (if n = p then 1 else 0)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-140434,"Let $A_n = \{x \in [0, 1] : \text{the $n$-th digit of $x$ in base 10 is not 5}\}$. Define $A^\star = \bigcap_{n=1}^\infty A_n$. Prove that the Lebesgue measure of $A^\star$ is zero, i.e., $\mu(A^\star) = 0$.","import Mathlib open Set Real theorem starMeasure {A : ℕ → Set ℝ} (hA : ∀ n, A n = {x | x ∈ Icc 0 1 ∧ ¬(Nat.floor (10 ^ n * x) % 10 = 5)}) : MeasureTheory.volume (⋂ n, A n) = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-140825,"Let $o: \\mathbb{R} \\to \\mathbb{R}$ be a continuous function. Define $F(a, b) = \\min_{a \\leq x \\leq b} o(x)$ for $a, b \\in \\mathbb{R}$ with $a \\leq b$, and let $f(t) = F(g(t), h(t))$, where $g, h: \\mathbb{R} \\to \\mathbb{R}$ are measurable functions. Prove that $f(t)$ is a measurable function.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem ContinuousO (o : ℝ → ℝ) (hContinuousO : Continuous o) (F : ℝ → ℝ → ℝ) (hF : F = λ a b => sInf {o x | x ∈ Set.Icc a b}) (g h : ℝ → ℝ) (hg : Measurable g) (hh : Measurable h) : Measurable (λ t => F (g t) (h t)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-140979,Let $p > 3$ be a prime number. Prove that the central binomial coefficient satisfies the congruence $$\binom{2p-1}{p-1} \text{ mod } p^3 = 1.$$,"import Mathlib theorem Nat.choose_eq_one (p : ℕ) (hp : Nat.Prime p) (h : 3 < p) : Nat.choose (2 * p - 1) (p - 1) ≡ 1 [MOD p ^ 3] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-141243,Let $X$ be a Baire space and let $f: X \to \mathbb{R}$ be a function. Prove that the set of points in $X$ at which $f$ is continuous is dense in $X$.,"import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem ContinuousSet {X : Type*} [TopologicalSpace X] [BaireSpace X] (f : X → ℝ) : Dense {x | ContinuousAt f x} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-141340,Let $B = \{ x \in \mathbb{R}^n : \|x\| < 1\}$ denote the open unit ball in $\mathbb{R}^n$ for $n \geq 2$. Prove that there does not exist a continuous and injective function $f: B \to \mathbb{R}$.,"import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem no_continuous_function (n : ℕ) (hn : n ≥ 2) (B : Set (EuclideanSpace ℝ (Fin n))) (hB : B = {x | ‖x‖ < 1}) : ¬ ∃ f : B → ℝ, Continuous f ∧ Function.Injective f := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-141364,Let $n$ be a positive integer. Prove that there exists an injective function $f: \mathbb{R}^n \to \mathbb{R}$.,"import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove_injective (n : ℕ) (hn : 0 < n) : ∃ f : (Fin n → ℝ) → ℝ, Function.Injective f := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-141498,"Prove that the set of all contagious positive integers is \(\{13500, 13501, 13502, \ldots\}\).","import Mathlib def is_conjugate (n : ℕ) := n % 100 = 1 ∨ n % 100 = 2 ∨ n % 100 = 3 ∨ n % 100 = 4 ∨ n % 100 = 5 ∨ n % 100 = 6 ∨ n % 100 = 7 ∨ n % 100 = 8 ∨ n % 100 = 9 theorem prove : {n | 13500 ≤ n ∧ is_conjugate n} = {n | 13500 ≤ n ∧ n % 100 ∈ Finset.Icc 1 9} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepScaleR, flc-141675,"Prove that if every integer is colored either black or white, then for at least one of the colors, it is possible to represent every even integer in the form \(a + b - c - d\), where \(a, b, c, d\) are integers of that color.","import Mathlib theorem colorings (f : ℤ → Fin 2) : (∀ x, Even x → ∃ a b c d, x = a + b - c - d ∧ f a = 0 ∧ f b = 0 ∧ f c = 0 ∧ f d = 0) ∨ (∀ x, Even x → ∃ a b c d, x = a + b - c - d ∧ f a = 1 ∧ f b = 1 ∧ f c = 1 ∧ f d = 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-141684,"Let $\{a_{1}, a_{2}, \ldots, a_{n}\}$ and $\{b_{1}, b_{2}, \ldots, b_{k}\}$ be two sets of positive integers such that $\sum_{i = 1}^{n}a_{i}=\sum_{j = 1}^{k}b_{j}1\) such that \(\frac{1}{x_1}+\frac{1}{x_2}+\frac{1}{x_3}>1\), there exist indices \(i\) and \(j\) with \(1\leq i < j\leq 3\) such that the intersection \(S(x_i)\cap S(x_j)\) contains infinitely many elements, where \(S(x)=\{[kx]\mid k = 1,2,\ldots\}\) for each positive integer \(x\).","import Mathlib theorem prove (x : Fin 3 → ℝ) (hx : ∀ i, 1 < x i) (h : ∑ i, 1 / x i > 1) : ∃ i j, i ≠ j ∧ {n | ∃ k l, n = ⌊k * x i⌋ ∧ n = ⌊l * x j⌋}.Infinite := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-142954,"Prove that within the set \(S = \{2008, 2009, \ldots, 4200\}\), there exist \(125\) elements such that no three of these elements form an arithmetic progression.","import Mathlib theorem prove (S : Finset ℕ) (hS : S = Finset.Icc 2008 4200) : ∃ T ⊆ S, T.card = 125 ∧ ∀ x ∈ T, ∀ y ∈ T, ∀ z ∈ T, x ≠ y ∧ y ≠ z ∧ z ≠ x → ¬(∃ d, y = x + d ∧ z = y + d) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-143009,Prove that the number of functions \(f: \mathbb{N} \rightarrow \mathbb{N} \setminus \{1\}\) that satisfy the equation \( f(n + 1) + f(n + 3) = f(n + 5) \cdot f(n + 7) - 2001\) for all \(n \ge 0\) is \(256\).,"import Mathlib theorem number_of_f : Set.ncard {f : ℕ → ℕ | ∀ n, f (n + 1) + f (n + 3) = f (n + 5) * f (n + 7) - 2001 ∧ ∀ n, f n ≠ 1} = 256 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-143068,"Prove that there exists an uncountable family $S \subset \mathcal{P}(\mathbb{N})$ such that for all distinct $A, B \in S$, the intersection $A \cap B$ is finite.","import Mathlib open Set theorem exists_ung_countable_family : ∃ (S : Set (Set ℕ)), (∀ A ∈ S, ∀ B ∈ S, A ≠ B → (A ∩ B).Finite) ∧ ¬ Countable S := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-143643,"Prove that the largest integer \(n\) for which there exist \(n\) distinct integers, none of which are divisible by \(7\), \(11\), or \(13\), such that the sum of any two of these integers is divisible by at least one of \(7\), \(11\), or \(13\), is \(n = 8\).","import Mathlib theorem max_n : IsGreatest {n | ∃ s : Finset ℤ, s.card = n ∧ ∀ x ∈ s, ¬(7 ∣ x) ∧ ¬(11 ∣ x) ∧ ¬(13 ∣ x) ∧ (∀ x ∈ s, ∀ y ∈ s, x ≠ y → (7 ∣ x + y ∨ 11 ∣ x + y ∨ 13 ∣ x + y))} 8 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-144057,Prove that the number of ways to fill a \(1998 \times 1998\) matrix with entries \(1\) and \(-1\) such that the product of the entries in each row and each column equals \(-1\) is \(2^{1997^2}\).,"import Mathlib theorem Matrixfills : Set.ncard {A : Matrix (Fin 1998) (Fin 1998) ℤ | (∀ i j, A i j = 1 ∨ A i j = -1) ∧ (∀ i, ∏ j : Fin 1998, A i j = -1) ∧ (∀ j, ∏ i : Fin 1998, A i j = -1)} = 2^(1997^2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-144287,"Let $n \geq 1$ be an integer, and let $S$ be a set of integer pairs $(a, b)$ such that $1 \leq a < b \leq 2^n$. Prove that if $|S| \geq n \cdot 2^n$, then there exist four integers $a < b < c < d$ such that $S$ contains the pairs $(a, c)$, $(b, d)$, and $(a, d)$.","import Mathlib theorem Qwen (n : ℕ) (hn : 1 ≤ n) (S : Finset (ℕ × ℕ)) (hS : ∀ s ∈ S, 1 ≤ s.1 ∧ s.1 < s.2 ∧ s.2 ≤ 2 ^ n) (hS1 : S.card ≥ n * 2 ^ n) : ∃ a b c d : ℕ, a < b ∧ b < c ∧ c < d ∧ (a, c) ∈ S ∧ (b, d) ∈ S ∧ (a, d) ∈ S := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-144289,"Let $n \geq 1$ be an integer, and let $S$ be a set of integer pairs $(a, b)$ such that $1 \leq a < b \leq 2^n$. Suppose that $|S| \geq n \cdot 2^n$. Prove that there exist four integers $a < b < c < d$ such that $S$ contains the pairs $(a, c)$, $(b, d)$, and $(a, d)$.","import Mathlib theorem Qwen (n : ℕ) (hn : 1 ≤ n) (S : Finset (ℕ × ℕ)) (hS : ∀ x ∈ S, 1 ≤ x.1 ∧ x.1 < x.2 ∧ x.2 ≤ 2 ^ n) (hS1 : S.card ≥ n * 2 ^ n) : ∃ a b c d : ℕ, a < b ∧ b < c ∧ c < d ∧ (a, c) ∈ S ∧ (b, d) ∈ S ∧ (a, d) ∈ S := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-144293,"Prove that for any integer $n \geq 1$, if $S$ is a set of integer pairs $(a, b)$ such that $1 \leq a < b \leq 2^n$ and $|S| \geq n \cdot 2^n$, then there exist four integers $a < b < c < d$ such that $S$ contains the pairs $(a, c)$, $(b, d)$, and $(a, d)$.","import Mathlib theorem prove (n : ℕ) (hn : 1 ≤ n) (S : Finset (ℤ × ℤ)) (hS : ∀ x ∈ S, 1 ≤ x.1 ∧ x.1 < x.2 ∧ x.2 ≤ 2 ^ n) (hS' : S.card ≥ n * 2 ^ n) : ∃ a b c d : ℤ, a < b ∧ b < c ∧ c < d ∧ (a, c) ∈ S ∧ (b, d) ∈ S ∧ (a, d) ∈ S := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-144330,"Let $M \subseteq \mathbb{N}$ be a set such that for every $c \in \mathbb{N}$ with $c > 1$, there exists an $x \in M$ for which $c \nmid x$. Additionally, assume that for all $a, b \in M$, the sum $a + b \in M$. Prove that $\mathbb{N} \setminus M$ is finite.","import Mathlib theorem SetFinite (M : Set ℕ) (hM : ∀ c > 1, ∃ x ∈ M, ¬c ∣ x) (hM' : ∀ a b, a ∈ M → b ∈ M → a + b ∈ M) : {x | ¬(x ∈ M)}.Finite := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-144495,"Prove that in a plane colored with two colors, there exists a triangle such that its three vertices and its centroid are all colored in the same color.","import Mathlib open Finset Real theorem colorplane {f : ℝ × ℝ → Fin 2} (hf : ∀ x y, f (x, y) = 0 ∨ f (x, y) = 1) : ∃ x1 x2 x3 y1 y2 y3 : ℝ, f (x1, y1) = f (x2, y2) ∧ f (x2, y2) = f (x3, y3) ∧ f (x3, y3) = f ((x1 + x2 + x3) / 3, (y1 + y2 + y3) / 3) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-144715,"Prove that the smallest natural number \(n\) such that for any set of \(n\) integers, there exists a subset of \(18\) integers whose sum is divisible by \(18\), is \(n = 35\).","import Mathlib theorem algebra_486590 : IsLeast {n | ∀ s : Finset ℤ, s.card = n → ∃ t ⊆ s, t.card = 18 ∧ 18 ∣ ∑ x ∈ t, x} 35 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-144988,"Prove that there do not exist non - negative integers $(m, n)$ such that \(107^{56}(m^2 - 1)+2m + 3=\binom{113^{114}}{n}\).","import Mathlib theorem no_nonnegatived_m_and_n : ¬ ∃ m n : ℕ, Nat.choose (113 ^ 114) n = 107 ^ 56 * (m ^ 2 - 1) + 2 * m + 3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-145327,"Consider sets $A_1, A_2, \ldots, A_n$ where: (i) \(|A_i \cap A_j| = 1\) for each \(1 \leq i < j \leq n\), (ii) \(|A_i| \geq 4\) for each \(1 \leq i \leq n\). Let \(W = A_1 \cup A_2 \cup \cdots \cup A_n\). Prove that it is possible to assign each element in \(W\) one of two colors, \(X\) and \(Y\), such that for each \(1 \leq i \leq n\), the set \(A_i\) contains elements of both colors.","import Mathlib theorem color_assignments {n : ℕ} (hn : 0 < n) (A : Fin n → Set ℝ) (hA : ∀ i j, i ≠ j → (A i ∩ A j).encard = 1) (hA' : ∀ i, A i ≠ ∅ ∧ (A i).ncard ≥ 4) : ∃ X Y : Set ℝ, X ∪ Y = ⋃ i, A i ∧ (∀ i, X ∩ A i ≠ ∅) ∧ (∀ i, Y ∩ A i ≠ ∅) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-145532,"Show that in any subset of size \(2^{n + 1}\) of the set of natural numbers \(\mathbb{N}\), it is possible to find a subset of \(2^n\) elements such that the sum of these elements is divisible by \(2^n\).","import Mathlib theorem qwen (n : ℕ) (s : Finset ℕ) (h₀ : s.card = 2^(n + 1)) : ∃ t ⊆ s, t.card = 2^n ∧ ∑ x ∈ t, x ≡ 0 [ZMOD 2^n] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-145623,"For every set $X = \{x_1, x_2, \dots, x_n\}$ of $n$ real numbers, prove that there exists a non-empty subset $S$ of $X$ and an integer $m$ such that \[ \left| m + \sum_{s \in S} s \right| \le \frac{1}{n+1}. \]","import Mathlib theorem RealSet (n : ℕ) (hn : 0 < n) (X : Finset ℝ) (hX : X.card = n) : ∃ S ⊆ X, S ≠ ∅ ∧ ∃ m : ℤ, |m + ∑ s ∈ S, s| ≤ 1 / (n + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-145630,"Prove that for every set \(X = \{x_1, x_2, \dots, x_n\}\) of \(n\) real numbers, there exists a non - empty subset \(S\) of \(X\) and an integer \(m\) such that \(\left| m + \sum_{s \in S} s \right| \leq \frac{1}{n+1}\).","import Mathlib theorem RealSum (n : ℕ) (hn : 0 < n) (X : Finset ℝ) (hX : X.card = n) : ∃ S ⊆ X, S ≠ ∅ ∧ ∃ m : ℤ, |m + ∑ s ∈ S, s| ≤ 1 / (n + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-145645,Let $X$ be a compact metric space and $f: X \to X$ be a continuous function. Prove that there exists a subset $Y \subset X$ such that $f(Y) = Y$.,"import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem T2 (X : Type*) [MetricSpace X] [CompactSpace X] (f : X → X) (hf : Continuous f) : ∃ (Y : Set X), f '' Y = Y := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-145674,"Prove that if there are 23 individuals with distinct weights such that for any choice of one individual as the referee, the remaining 22 individuals can be divided into two teams of 11 with equal total weight, then all 23 individuals must have the same weight.","import Mathlib theorem weight_equal (w : Fin 23 → ℝ) (h : ∀ i j, w i = w j → i = j) (h' : ∀ i, ∃ s1 s2 : Finset (Fin 23), s1 ≠ s2 ∧ s1 ∪ s2 = Finset.univ \ {i} ∧ s1.card = 11 ∧ s2.card = 11 ∧ ∑ k ∈ s1, w k = ∑ k ∈ s2, w k) : ∃ x, ∀ i, w i = x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-146254,"Let \(x_1, x_2, \ldots, x_n\) be distinct natural numbers such that every subset of \(\{x_1, x_2, \ldots, x_n\}\) has a unique sum of its elements, resulting in \(2^n\) distinct sums. Prove that \[ x_1^2 + x_2^2 + \cdots + x_n^2 \geq \frac{4^n - 1}{3}. \]","import Mathlib theorem dist_sums (n : ℕ) (hn : 0 < n) (x : Fin n → ℕ) (hx : ∀ i j, x i = x j → i = j) (hxi : ∀ s : Finset (Fin n), ∃! t : ℕ, ∑ i ∈ s, x i = t) : ∑ i : Fin n, (x i)^2 ≥ (4^n - 1)/3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-146373,"Prove that every bijective function \(f: \mathbb{Z} \rightarrow \mathbb{Z}\) can be expressed as \(f = u + v\), where \(u, v: \mathbb{Z} \rightarrow \mathbb{Z}\) are also bijective functions.","import Mathlib theorem bijective_to_add (f : ℤ → ℤ) (hf : Function.Bijective f) : ∃ u v : ℤ → ℤ, Function.Bijective u ∧ Function.Bijective v ∧ ∀ n : ℤ, f n = u n + v n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-146394,"Prove that the maximum number of consecutive equal terms in the sequence $\{a_n\}_{n = 1}^{\infty}$ defined by $a_1 = 1$ and for $n \geq 2$, $a_n = a_{n - 1}+(a_{n - 1}\mod n)^2$, where $a\mod b$ denotes the remainder when $a$ is divided by $b$, is $3$.","import Mathlib open Finset theorem max_consec_eq (a : ℕ → ℕ) (h₀ : a 1 = 1) (h₁ : ∀ n ≥ 2, a n = a (n - 1) + ((a (n - 1)) % n) ^ 2) : IsGreatest {k | ∃ m, ∀ i ∈ Icc m (m + k - 1), a i = a m} 3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-146407,"Prove that if there are 23 individuals with distinct weights such that any one of them can be chosen as a referee and the remaining 22 can be divided into two teams of 11 players each with equal total weight, then all 23 individuals must have the same weight.","import Mathlib theorem weight_balanced (weights : Fin 23 → ℝ) (h : ∀ i j, weights i = weights j → i = j) (h' : ∀ k, ∃ s1 s2 : Finset (Fin 23), s1 ≠ s2 ∧ s1 ∪ s2 = Finset.univ \ {k} ∧ s1.card = 11 ∧ s2.card = 11 ∧ ∑ i ∈ s1, weights i = ∑ i ∈ s2, weights i) : ∃ x, ∀ i, weights i = x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-146535,"Prove that the solutions of the equation \(\cos a + \binom{n}{1} \cos(a + b) z + \binom{n}{2} \cos(a + 2b) z^2 + \ldots + \binom{n}{n} \cos(a + nb) z^n = 0\) in \(\mathbb{C}\) are given by \(z = \frac{r_k - 1}{e^{ib} - r_k e^{-ib}}\), where \(r_k = e^{i \left( \frac{\pi - 2a + 2\pi k}{n} \right)}\) and \(k = 0, 1, 2, \ldots, n - 1\).","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem prove (a b : ℝ) (n : ℕ) (r : ℕ → ℂ) (h₀ : ∀ k ∈ Icc 0 (n - 1), r k = exp (I * ((Real.pi - 2 * a + 2 * Real.pi * k) / n))) : {z : ℂ | ∑ i ∈ Icc 0 n, Nat.choose n i * cos (a + (i * b)) * z ^ i = 0} = {z | ∃ k ∈ Icc 0 (n - 1), z = (r k - 1) / (exp (I * b) - r k * exp (-I * b))} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-146599,"Prove that if \(S \subseteq \mathbb{R}^{n}\) is an uncountable set, then there exists a point \(x \in S\) such that \(x\) is a condensation point of \(S\). That is, every neighborhood of \(x\) contains uncountably many elements of \(S\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem uncountable (n : ℕ) (S : Set (EuclideanSpace ℝ (Fin n))) : ¬ Set.Countable S → ∃ x ∈ S, ∀ U : Set (EuclideanSpace ℝ (Fin n)), IsOpen U → x ∈ U → ¬ Set.Countable (S ∩ U) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-146871,"Let $f : \mathbb{N} \rightarrow \mathbb{N}$ be an arbitrary function, where $\mathbb{N}$ denotes the set of natural numbers. Prove that for any natural number $k$, there exist $f(k)$ consecutive natural numbers, none of which is a perfect power.","import Mathlib theorem f_225694 (f : ℕ → ℕ) : ∀ k, ∃ n, ∀ i ∈ Finset.range (f k), ¬∃ m p, n + i = m ^ p ∧ p > 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-146912,"Prove that the number of $n$-element subsets of the set $A = \{1, 2, \ldots, n^2\}$ such that the sum of the elements in any of these subsets is not divisible by $n + 1$ is $\phi(n + 1)$, where $\phi$ is the Euler's totient function.","import Mathlib theorem prove (n : ℕ) : Set.ncard {s : Finset ℕ | s ⊆ Finset.Icc 1 (n ^ 2) ∧ s.card = n ∧ ¬(n + 1) ∣ ∑ x ∈ s, x} = Nat.totient (n + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-147093,"Prove that the number of distinct positions for a \(3 \times 3 \times 3\) cube is \(\frac{8! \times 12! \times 3^8 \times 2^{12}}{12}\), for a \(4 \times 4 \times 4\) cube is \(\frac{8! \times 12! \times 24! \times 3^8 \times 2^{12}}{12}\), and for a \(5 \times 5 \times 5\) cube is \(\frac{8! \times 12! \times 24! \times 24! \times 3^8 \times 2^{12}}{12}\), considering the arrangement and orientation of the cube's corners and edges, and accounting for the parities involved in edge and corner orientations as well as permutation parities.","import Mathlib theorem number_ofpositions (n : ℕ) : n = if n = 3 then (Nat.factorial 8 * Nat.factorial 12 * 3^8 * 2^12) / 12 else if n = 4 then (Nat.factorial 8 * Nat.factorial 12 * Nat.factorial 24 * 3^8 * 2^12) / 12 else if n = 5 then (Nat.factorial 8 * Nat.factorial 12 * Nat.factorial 24 * Nat.factorial 24 * 3^8 * 2^12) / 12 else 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-147546,"Prove that if $A_1, A_2, \ldots, A_n$ are $n$ distinct points on the plane, where $n > 1$, and we consider all the segments $A_iA_j$ for $1 \leq i < j \leq n$ and color the midpoints of these segments, then the minimum number of distinct colored points (where coincident points are counted as a single point) is \(2n - 3\).","import Mathlib open Real open scoped BigOperators theorem prove {n : ℕ} (hn : n > 1) (A : Fin n → (EuclideanSpace ℝ (Fin 2))) (hA : ∀ i j, A i = A j → i = j) : Set.ncard {x | ∃ i j, i ≠ j ∧ x = midpoint ℝ (A i) (A j)} ≥ 2 * n - 3 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-148410,Prove that the cardinality of the set of real numbers $\mathbb{R}$ is equal to the cardinality of the set of all injections $f: \mathbb{N} \to \mathbb{N}$.,"import Mathlib theorem card_r : Set.ncard (Set.univ : Set ℝ) = Set.ncard {f : ℕ → ℕ | Function.Injective f} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-148479,"Let $X$ and $Y$ be two finite subsets of $[0,1)$ such that $0 \in X \cap Y$ and $x + y \neq 1$ for all $x \in X$ and $y \in Y$. Define the set \[ S = \{x + y - \lfloor x + y \rfloor : x \in X, y \in Y\}. \] Prove that $|S| \geq |X| + |Y| - 1$.","import Mathlib open Set Real theorem prove (X Y : Finset ℝ) (hX : ∀ x ∈ X, 0 ≤ x ∧ x < 1) (hY : ∀ y ∈ Y, 0 ≤ y ∧ y < 1) (hXY : 0 ∈ X ∩ Y) (hxy : ∀ x ∈ X, ∀ y ∈ Y, x + y ≠ 1) : {s | ∃ x ∈ X, ∃ y ∈ Y, s = x + y - ⌊x + y⌋}.ncard ≥ X.card + Y.card - 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-148628,"Prove that there exists a dense, uncountable set \(A\) of real numbers such that the difference between any two elements of \(A\) is an irrational number.","import Mathlib theorem algebra_481935 : ∃ A : Set ℝ, (Dense A) ∧ (¬ Countable A) ∧ ∀ a ∈ A, ∀ b ∈ A, a ≠ b → Irrational (a - b) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-148646,"Prove that the cardinality of the set of real numbers $\mathbb{R}$ is equal to the cardinality of the set of all injections $f: \mathbb{N} \to \mathbb{N}$, i.e., prove that \(|\{f: \mathbb{N} \to \mathbb{N} \mid f \text{ is injective}\}| = |\mathbb{R}|\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem card_set : Set.encard (Set.univ : Set ℝ) = Set.encard {f : ℕ → ℕ | Function.Injective f} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-148657,"Prove that the cardinality of the set of real numbers $\mathbb{R}$ is equal to the cardinality of the set of all injections $f: \mathbb{N} \to \mathbb{N}$, i.e., prove that \(|\mathbb{R}| = |\{f: \mathbb{N} \to \mathbb{N} \mid f \text{ is injective}\}|\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem card_R : Set.ncard (Set.univ : Set ℝ) = {f : ℕ → ℕ | Function.Injective f}.ncard := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-148860,"Prove that the maximum number of distinct positive integers such that no four of them have a sum divisible by $4$ is $6$, and that the maximum number of distinct positive integers such that no $n$ of them have a sum divisible by $n$ is $2n - 2$.","import Mathlib theorem S : IsGreatest {k | ∃ s : Finset ℕ, s.card = k ∧ ∀ m ∈ s, m > 0 ∧ ¬∃ x y z w : ℕ, x ∈ s ∧ y ∈ s ∧ z ∈ s ∧ w ∈ s ∧ x ≠ y ∧ x ≠ z ∧ x ≠ w ∧ y ≠ z ∧ y ≠ w ∧ z ≠ w ∧ 4 ∣ x + y + z + w} 6 := by sorry theorem T (n : ℕ) : IsGreatest {k | ∃ s : Finset ℕ, s.card = k ∧ ∀ m ∈ s, m > 0 ∧ ¬∃ t : Finset ℕ, t ⊆ s ∧ t.card = n ∧ ∑ i ∈ t, i ≡ 0 [ZMOD n]} (2 * n - 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-148998,"Prove that if every point in the plane is colored with one of five colors, then there exist two points of the same color such that the distance between them lies in the interval \([0.99, 1.01]\).","import Mathlib theorem Prove (f : ℝ × ℝ → Fin 5) : ∃ p q : ℝ × ℝ, p ≠ q ∧ f p = f q ∧ 0.99 ≤ Real.sqrt ((p.1 - q.1)^2 + (p.2 - q.2)^2) ∧ Real.sqrt ((p.1 - q.1)^2 + (p.2 - q.2)^2) ≤ 1.01 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-149351,"Prove that given the integers \(1, 2, 3, \ldots, 325\), each of which is colored either red or blue, there exist three numbers of the same color that form an arithmetic sequence.","import Mathlib theorem prove (red blue : Finset ℕ) (h₀ : red ∪ blue = Finset.Icc 1 325) (h₁ : red ∩ blue = ∅) : ∃ a d, a ∈ red ∧ (a + d) ∈ red ∧ (a + 2 * d) ∈ red ∨ ∃ a d, a ∈ blue ∧ (a + d) ∈ blue ∧ (a + 2 * d) ∈ blue := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-149548,"Let $s(x) = -x$. Consider a subset $A \subset \mathbb{C}$ that satisfies the following conditions: 1. $s(A) = A$. 2. If $A \subset F_1 \cup F_2$ where - $F_1$ and $F_2$ are two closed subsets of $\mathbb{C}$, - $F_1 \cap F_2 \cap A = \emptyset$, - $s(F_1) = F_1$ and $s(F_2) = F_2$, then $A \subset F_1$ or $A \subset F_2$. 3. $\left\{z^2 : z \in A\right\}$ is connected. Prove that there exists a connected subset $B \subset \mathbb{C}$ such that $A = B \cup s(B)$.","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem prove {s : ℂ → ℂ} (hs : s = λ x => -x) (A : Set ℂ) (hA : s '' A = A) (hA' : ∀ F1 F2 : Set ℂ, IsClosed F1 → IsClosed F2 → (F1 ∩ F2) ∩ A = ∅ → s '' F1 = F1 → s '' F2 = F2 → A ⊆ F1 ∨ A ⊆ F2) (hA'' : IsConnected {x | ∃ z ∈ A, x = z ^ 2}) : ∃ B : Set ℂ, IsConnected B ∧ A = B ∪ s '' B := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-150107,"Given $2n$ pairs of non-negative real numbers $(x_k, y_k)$, for $1 \leq k \leq 2n$, prove that there exists a subset $K \subseteq \{1, 2, \ldots, 2n\}$ with $|K| = n + 1$ such that $\sum_{k \in K} x_k \geq \frac{1}{2} \sum_{i = 1}^{2n} x_i$ and $\sum_{k \in K} y_k \geq \frac{1}{2} \sum_{i = 1}^{2n} y_i$.","import Mathlib theorem x (n : ℕ) (x y : Finset.Icc 1 (2 * n) → ℝ) (hx : ∀ i, x i ≥ 0) (hy : ∀ i, y i ≥ 0) : ∃ K : Finset (Finset.Icc 1 (2 * n)), K.card = n + 1 ∧ (∑ k ∈ K, x k ≥ 1 / 2 * ∑ i, x i) ∧ (∑ k ∈ K, y k ≥ 1 / 2 * ∑ i, y i) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-150543,"Prove that for a natural number \(n\), there exists a set \(S\) of \(n\) distinct complex numbers such that: 1. For all \(z\in S\), \(|z| = 1\). 2. \(\sum_{z\in S}z = 0\). 3. For all \(z,w\in S\), \(z + w\neq 0\) if and only if \(n\geq 3\) and \(n\neq 4\).","import Mathlib open Finset Complex Polynomial theorem sInf (n : ℕ) : ∃ S : Finset ℂ, S.card = n ∧ ∀ z ∈ S, ‖z‖ = 1 ∧ ∑ z ∈ S, z = 0 ∧ ∀ z ∈ S, ∀ w ∈ S, z + w ≠ 0 ↔ n ≥ 3 ∧ n ≠ 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-151029,"Let $A$ be a set of positive integers less than $N$ such that for any $a_1, a_2 \in A$ with $a_1 \neq a_2$, the sum $|a_1 + a_2|$ is not a square of an integer. Prove that the maximum number of elements in $A$ is at least $\left\lfloor \frac{11}{32}N \right\rfloor$.","import Mathlib theorem SetMax (N : ℕ) (hN : 0 < N) (A : Finset ℤ) (hA : ∀ x ∈ A, 0 < x ∧ x < N) (hA' : ∀ x ∈ A, ∀ y ∈ A, x ≠ y → ¬ ∃ z, z^2 = |x + y|) : A.card ≥ ⌊(11 / 32 : ℝ) * N⌋ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-151143,"Prove that the maximum possible number of elements in a subset $S \subset \{1, 2, \ldots, N\}$ (where $N$ is a positive integer) such that $S$ does not contain three distinct elements $a, b, c$ with $a$ dividing $b$ and $b$ dividing $c$ is $N - \lfloor \frac{N}{4} \rfloor$.","import Mathlib theorem Prove (N : ℕ) (hN : N > 0) : IsGreatest {k | ∃ S : Finset ℕ, S ⊆ Finset.Icc 1 N ∧ S.card = k ∧ ¬∃ a ∈ S, ∃ b ∈ S, ∃ c ∈ S, a ≠ b ∧ b ≠ c ∧ c ≠ a ∧ a ∣ b ∧ b ∣ c} (N - Nat.floor (N / 4)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-151186,"Let $p$ be a prime number, and let $a, k$ be positive integers such that $p^a < k < 2p^a$. Prove that there exists a positive integer $n$ such that \[n < p^{2a} \quad \text{and} \quad \binom{n}{k} \equiv n \equiv k \pmod{p^a}.\]","import Mathlib theorem algebra_480931 (p : ℕ) (hp : Nat.Prime p) (a k : ℕ) (_ : 0 < a) (hk : 0 < k) (hpk : p ^ a < k ∧ k < 2 * p ^ a) : ∃ n : ℕ, 0 < n ∧ n < p ^ (2 * a) ∧ Nat.choose n k ≡ n [ZMOD p ^ a] ∧ n ≡ k [ZMOD p ^ a] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-151758,Prove that a subset $S \subset \mathbb{N}$ is such that there exists a non - constant harmonic sequence $(a_n)_{n \ge 1}$ with $S=\{i \in \mathbb{N} : a_i \in \mathbb{Z} \}$ if and only if $S$ is a finite subset of $\mathbb{N}$.,"import Mathlib theorem ProveFinite (S : Set ℕ) : ∃ a : ℕ → ℝ, (∀ n, 0 < a n) ∧ (∃ c, ∀ n, a n = c / n) ∧ S = {i | ∃ j, a i = j} ↔ Finite S := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-151993,"Prove that in a plane where each point is colored either white or black, there exists an equilateral triangle with side length either \(1\) or \(\sqrt{3}\) such that all three vertices of the triangle are of the same color.","import Mathlib theorem Topology_276584 (f : ℝ × ℝ → Fin 2) : ∃ a b c : ℝ × ℝ, (dist a b = 1 ∧ dist b c = 1 ∧ dist a c = 1) ∨ (dist a b = Real.sqrt 3 ∧ dist b c = Real.sqrt 3 ∧ dist a c = Real.sqrt 3) ∧ f a = f b ∧ f b = f c := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-152126,"Let \(n \geq 3\) be a natural number. A set of real numbers \(\{x_1, x_2, \ldots, x_n\}\) is called **summable** if \(\sum_{i=1}^n \frac{1}{x_i} = 1\). Prove that: a) For every \(n \geq 3\), there exists a **summable** set consisting of \(n\) elements such that the largest element is greater than \(2^{2(n - 2)}\). b) For every \(n \geq 3\), there exists a **summable** set consisting of \(n\) elements such that the largest element is less than \(n^2\).","import Mathlib open Finset Real theorem sum_set {n : ℕ} (hn : 3 ≤ n) : ∃ s : Finset ℝ, s.card = n ∧ (∀ x ∈ s, 0 < x) ∧ (∑ i ∈ s, (1 / i) = 1) ∧ (s.max > 2 ^ (2 * (n - 2))) ∧ (s.max < n ^ 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-152321,"Let $S$ be a set with $n$ elements, and let $F$ be a family of subsets of $S$ containing exactly $2^{n - 1}$ elements. Given that for any three subsets $A, B, C \in F$, the intersection $A \cap B \cap C$ is non - empty. Prove that there exists a non - empty subset $W$ such that $W \subseteq X$ for all $X \in F$.","import Mathlib theorem Qwen {S : Type*} [Finite S] (n : ℕ) (hn : n = Nat.card S) (F : Set (Set S)) (hF : F.ncard = 2 ^ (n - 1)) (hF' : ∀ A ∈ F, ∀ B ∈ F, ∀ C ∈ F, A ∩ B ∩ C ≠ ∅) : ∃ W : Set S, W ≠ ∅ ∧ ∀ X ∈ F, W ⊆ X := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-152436,"Let \(n, k\) be two positive integers such that \(n > 2^k\) and let \(A = \{1, 2, \ldots, n\}\). Prove that there exists a subset \(S \subset A\) satisfying the following conditions: 1. \(|S| = k + 2\). 2. For each \(m\) such that \(1 \leq m \leq k + 2\), every subset of \(S\) with \(m\) elements has pairwise distinct sums of elements, i.e., if \(S_1, S_2 \subset S\) and \(|S_1| = |S_2| = m\) where \(1 \leq m \leq k + 2\), then \[ \sum_{x \in S_1} x \neq \sum_{x \in S_2} x. \]","import Mathlib theorem qwen (n k : ℕ) (hn : 0 < n) (hk : 0 < k) (h : n > 2 ^ k) (A : Finset ℕ) (hA : A = Finset.Icc 1 n) : ∃ S : Finset ℕ, S ⊆ A ∧ S.card = k + 2 ∧ ∀ m ∈ Finset.Icc 1 (k + 2), ∀ T : Finset ℕ, T ⊆ S ∧ T.card = m → ∀ U : Finset ℕ, U ⊆ S ∧ U.card = m → T ≠ U → ∑ x ∈ T, x ≠ ∑ x ∈ U, x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-152626,"Prove that for any prime \(p\), integer \(n\), and vectors \(x_1, x_2, \ldots, x_{(p - 1)n+1}\) in the vector space \(\mathbb{F}_p^n\), there exists a non - empty subset \(T\subseteq\{1,2,\ldots,(p - 1)n + 1\}\) such that \(\sum_{t\in T}x_t = 0\).","import Mathlib theorem FinsetSum {p n : ℕ} (hp : Nat.Prime p) (hn : 0 < n) (x : Fin ((p - 1) * n + 1) → (Fin n → ZMod p)) : ∃ T : Finset (Fin ((p - 1) * n + 1)), T ≠ ∅ ∧ ∑ t ∈ T, x t = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-152878,"Let \(m\) and \(n\) be two distinct positive integers. Prove that there exists a real number \(x\) such that \(\frac{1}{3} \leq \{xn\} \leq \frac{2}{3}\) and \(\frac{1}{3} \leq \{xm\} \leq \frac{2}{3}\). Here, for any real number \(y\), \(\{y\}\) denotes the fractional part of \(y\).","import Mathlib theorem RealExist (m n : ℕ) (hm : 0 < m) (hn : 0 < n) (hmn : m ≠ n) : ∃ x : ℝ, 1 / 3 ≤ (x * n) % 1 ∧ (x * n) % 1 ≤ 2 / 3 ∧ 1 / 3 ≤ (x * m) % 1 ∧ (x * m) % 1 ≤ 2 / 3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-154113,"Let \(x > 1\) be a non - integer real number, and define the sequence \(a_n=\lfloor x^{n + 1} floor-x\lfloor x^n floor\), where \(\lfloor\cdot floor\) denotes the integer part (or floor function). Prove that the sequence \(\{a_n\}\) is not periodic.","import Mathlib theorem RealNonInt (x : ℝ) (hx : x > 1) (hxi : ¬∃ n : ℤ, x = n) (a : ℕ → ℤ) (ha : ∀ n, a n = ⌊x ^ (n + 1)⌋ - x * ⌊x ^ n⌋) : ¬ ∃ c, Function.Periodic a c := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-154513,"Let \(S\) be a set of \(n^2 + 1\) closed intervals, where \(n\) is a positive integer. Prove that at least one of the following assertions holds: (i) There exists a subset \(S'\) of \(S\) consisting of \(n + 1\) intervals such that the intersection of the intervals in \(S'\) is non - empty. (ii) There exists a subset \(S''\) of \(S\) consisting of \(n + 1\) intervals such that any two of the intervals in \(S''\) are disjoint.","import Mathlib theorem n(n : ℕ)(hn : 0 < n)(S : Finset (Set ℝ))(hS : S.card = n ^ 2 + 1) (hS1 : ∀ s ∈ S, ∃ x y, x ≤ y ∧ s = Set.Icc x y) : (∃ T ⊆ S, T.card = n + 1 ∧ ∃ x, x ∈ ⋂ s ∈ T, s) ∨ (∃ T ⊆ S, T.card = n + 1 ∧ ∀ s ∈ T, ∀ t ∈ T, s ≠ t → Disjoint s t) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-155665,"Let \(p\) be an odd prime. Let \(a\) and \(b\) be integers such that none of \(a\), \(b\), or \(a + b\) are divisible by \(p\). An integer \(n\) is called good if it satisfies the following conditions: 1. \(1 \leq n \leq p - 1\) 2. \(an \bmod p \leq \frac{p - 1}{2}\) 3. \(bn \bmod p \leq \frac{p - 1}{2}\) Prove that there exist at least \(\frac{p - 1}{6}\) good integers.","import Mathlib theorem qwen (p a b : ℕ) (hp : Odd p ∧ Nat.Prime p) (hpa : ¬(p ∣ a)) (hpb : ¬(p ∣ b)) (hpa' : ¬(p ∣ a + b)) : Set.ncard {n | 1 ≤ n ∧ n ≤ p - 1 ∧ a * n % p ≤ (p - 1) / 2 ∧ b * n % p ≤ (p - 1) / 2} ≥ (p - 1) / 6 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-156179,"Prove that for any odd integer \(n \geqslant 7\), there exists a set of \(n\) coins with distinct integer weights \(w_1, w_2, \ldots, w_n\) such that for any \(1 \leq k \leq n\), when the coin with weight \(w_k\) is removed from the set, the remaining \(n - 1\) coins can be divided into two non - overlapping groups \(G_1\) and \(G_2\) such that \(\sum_{w_i\in G_1}w_i=\sum_{w_j\in G_2}w_j\).","import Mathlib theorem prove (n : ℕ) (hn : Odd n ∧ n ≥ 7) : ∃ w : Fin n → ℤ, (∀ i j, i ≠ j → w i ≠ w j) ∧ (∀ k, ∃ s1 s2 : Finset (Fin n), s1 ∪ s2 = Finset.univ \ {k} ∧ s1 ∩ s2 = ∅ ∧ ∑ i ∈ s1, w i = ∑ j ∈ s2, w j) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-156848,"Prove that for every measurable set \(M \subset [0,1]\), the set \(M_1 = \bigcup_{r \in [0,1]} \{m + r : m \in M\}\) is measurable.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove_measurable (M : Set ℝ) (hM : M ⊆ Set.Icc 0 1) (hM_measurable : MeasurableSet M) : MeasurableSet (⋃ r ∈ Set.Icc 0 1, {x | ∃ m ∈ M, x = m + r}) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-157366,"Prove that if $A_1, A_2, \ldots, A_n$ are sets such that $|A_i| = 5$ for all $i \in \{1, 2, \ldots, n\}$, and $|A_i \cap A_j| = 1$ for all $i, j \in \{1, 2, \ldots, n\}$ with $i \neq j$, and $M = \bigcup_{i=1}^n A_i$, then the only natural number $n$ for which these conditions hold is $n = 21$.","import Mathlib theorem prove (n : ℕ) (hn : n ≥ 1) (A : Fin n → Set ℕ) (hA : ∀ i, (A i).encard = 5) (hA' : ∀ i j, i ≠ j → ((A i) ∩ (A j)).encard = 1) (M : Set ℕ) (hM : M = ⋃ i, A i) : n = 21 ↔ (∀ i, (A i).encard = 5) ∧ (∀ i j, i ≠ j → ((A i) ∩ (A j)).encard = 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-157489,"Prove that the set of all positive integers \(m\) for which there exist positive integers \(a_1, a_2, \ldots, a_{1378}\) such that \(m = \sum_{k=1}^{1378} \frac{k}{a_k}\) is \(\{1, 2, 3, \ldots, 945753\}\), where \(945753=\frac{1378\times(1378 + 1)}{2}\).","import Mathlib theorem SetOfM : {m : ℕ | ∃ a : Fin 1378 → ℕ, (∀ i, 0 < a i) ∧ m = ∑ k : Fin 1378, (k + 1) / a k} = {x | 1 ≤ x ∧ x ≤ 945753} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-157793,"1. Prove that for a prime number \(p\) such that \(p \geq 5\), \(\binom{2p}{p} \equiv 2 \pmod{p^3}\). 2. Prove that for a prime number \(p\) such that \(p \geq 5\), \((-1)^{\frac{p - 1}{2}}\binom{p - 1}{\frac{p - 1}{2}} \equiv 4^{p - 1} \pmod{p^3}\).","import Mathlib theorem Nat.choose_cong {p : ℕ} (hp : Nat.Prime p) (h : 5 ≤ p) : Nat.choose (2 * p) p ≡ 2 [MOD p ^ 3] ∧ (-1 : ℤ) ^ ((p - 1) / 2) * Nat.choose (p - 1) ((p - 1) / 2) ≡ 4 ^ (p - 1) [ZMOD p ^ 3] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-158303,"Let $X_i = [a_i; b_i] \times [c_i; d_i]$, for $i = 1, \ldots, n$, be subsets of $\mathbb{R}^2$ such that for all $i \neq j$, at least one of the following conditions holds: i) $[a_i; b_i] \cap [a_j; b_j] \neq \emptyset$, ii) $[c_i; d_i] \cap [c_j; d_j] \neq \emptyset$. Prove that there exists a point $(x; y) \in \mathbb{R}^2$ such that for all $i$, either $x \in [a_i; b_i]$ or $y \in [c_i; d_i]$. Here, $[a; b] = \{x \in \mathbb{R} : a \leq x \leq b\}$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove {n : ℕ} (hn : 0 < n) (a b c d : Fin n → ℝ) (h₀ : ∀ i j, i ≠ j → (Set.Icc (a i) (b i) ∩ Set.Icc (a j) (b j)) ≠ ∅ ∨ (Set.Icc (c i) (d i) ∩ Set.Icc (c j) (d j)) ≠ ∅) : ∃ x y, ∀ i, (x ∈ Set.Icc (a i) (b i) ∨ y ∈ Set.Icc (c i) (d i)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-159169,"Prove that for an odd prime number \(p\) such that \(p \equiv 2 \pmod{3}\), a permutation \(\pi\) of the residue classes modulo \(p\) defined by \(\pi(x) \equiv x^3 \pmod{p}\) is an even permutation if and only if \(p \equiv 3 \pmod{4}\).","import Mathlib theorem OddPrime (p : ℕ) (hp : Odd p ∧ Nat.Prime p) (h : p ≡ 2 [MOD 3]) : Even (fun x => x ^ 3 % p) ↔ p ≡ 3 [MOD 4] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-159188,"Prove that for an odd prime number $p$ such that $p \equiv 2 \pmod{3}$, the permutation $\pi$ of the residue classes modulo $p$ defined by $\pi(x) \equiv x^3 \pmod{p}$ is an even permutation if and only if $p \equiv 3 \pmod{4}$.","import Mathlib theorem OddPrimeP (p : ℕ) (hp : Odd p ∧ Nat.Prime p) (h : p ≡ 2 [MOD 3]) : Even (fun x => x ^ 3 % p) ↔ p ≡ 3 [MOD 4] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-159270,"Let \(n\) be a fixed nonnegative integer. Given integers \(a_0, a_1, \ldots, a_n\) such that \(i - n \le a_i \le i\) for \(i = 0, 1, \ldots, n\), prove that there exists a nonempty subset \(I\) of \(\{0, 1, \ldots, n\}\) such that \(\sum_{i \in I} a_i = 0\).","import Mathlib theorem sum_a (n : ℕ) (a : ℕ → ℤ) (h₀ : ∀ i ∈ Finset.Icc 0 n, i - n ≤ a i ∧ a i ≤ i) : ∃ I : Finset ℕ, I ⊆ Finset.Icc 0 n ∧ I ≠ ∅ ∧ ∑ i ∈ I, a i = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-159386,"Prove that the last three digits of the number \(N\) of ordered integer quadruples \((a,b,c,d)\) such that \(0 \leq a, b, c, d \leq 99990\) and \(ad - bc \equiv 1 \pmod{99991}\) are \(280\).","import Mathlib theorem count_quadruples : Set.ncard {x : Fin 4 → ℕ | x 0 ≤ 99990 ∧ x 1 ≤ 99990 ∧ x 2 ≤ 99990 ∧ x 3 ≤ 99990 ∧ (x 0 * x 3 - x 1 * x 2) % 99991 = 1} % 1000 = 280 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-159704,"Let $f$ be a function from the set of pairs of nonnegative integers to the real numbers, satisfying the conditions: $f(0,0)=0,$ $f(2x,2y)=f(2x + 1,2y + 1)=f(x,y),$ and $f(2x + 1,2y)=f(2x,2y + 1)=f(x,y)+1$ for all nonnegative integers $x,y$. Prove that for any given nonnegative integers $a$, $b$, and $n$ such that $f(a,b)=n$, the number of nonnegative integer solutions $x$ to the equation $f(a,x)+f(b,x)=n$ is $2^n$.","import Mathlib theorem qwen (f : ℕ → ℕ → ℝ) (h₀ : f 0 0 = 0) (h₁ : ∀ x y, f (2 * x) (2 * y) = f x y) (h₂ : ∀ x y, f (2 * x + 1) (2 * y + 1) = f x y) (h₃ : ∀ x y, f (2 * x + 1) (2 * y) = f x y + 1) (h₄ : ∀ x y, f (2 * x) (2 * y + 1) = f x y + 1) (a b n : ℕ) (h₅ : f a b = n) : {x | f a x + f b x = n}.ncard = 2 ^ n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-159768,Let $p$ be a prime number such that $p \equiv 1 \pmod{4}$. Prove that $\binom{p - 1}{\frac{p - 1}{2}} \equiv 4^{p - 1} \pmod{p^2}$.,"import Mathlib theorem Nat.choose_p (p : ℕ) (hp : p.Prime) (h : p ≡ 1 [MOD 4]) : Nat.choose (p - 1) ((p - 1) / 2) ≡ 4^(p - 1) [ZMOD p^2] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-160163,"Prove that if $f: \mathbb{Z} \to \mathbb{Z}$ and $g: \mathbb{Z} \to \mathbb{Z}$ are functions such that for all integers $m$ and $n$, \( f(m) + f(n) = g(m^2 + n^2) \) and \( -2 \le f(n+2) - f(n) \le 2 \), then the greatest possible cardinality of the set \(f(\mathbb{Z})\) is \(3\).","import Mathlib theorem FunctionInt (f g : ℤ → ℤ) (hfg : ∀ m n, f m + f n = g (m ^ 2 + n ^ 2)) (hf : ∀ n, -2 ≤ f (n + 2) - f n ∧ f (n + 2) - f n ≤ 2) : Set.ncard {x | ∃ n, f n = x} ≤ 3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-160180,"Prove that the smallest integer \(n \geq 9\) such that for any set of \(n\) integers \(a_1, a_2, \ldots, a_n\), there exist 9 integers \(a_{i_1}, a_{i_2}, \ldots, a_{i_9}\) (where \(1 \leq i_1 < i_2 < \ldots < i_9 \leq n\)) and coefficients \(b_i \in \{4, 7\}\) for \(i = 1, 2, \ldots, 9\), such that the sum \(b_1a_{i_1} + b_2a_{i_2} + \ldots + b_9a_{i_9}\) is a multiple of 9, is \(n = 11\).","import Mathlib theorem min9 : IsLeast {n | 9 ≤ n ∧ ∀ a : Fin n → ℤ, ∃ (i : Fin 9 → Fin n) (_ : StrictMono i) (b : Fin 9 → ℕ), (∀ j, b j = 4 ∨ b j = 7) ∧ 9 ∣ ∑ j, b j * a (i j)} 11 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-160191,"The user's problem is already a formal math proof problem. So the final proof statement is: Let \(p\) be an odd prime number such that \(p \equiv 2 \pmod{3}\). Define a permutation \(\pi\) of the residue classes modulo \(p\) by \(\pi(x) \equiv x^3 \pmod{p}\). Prove that \(\pi\) is an even permutation if and only if \(p \equiv 3 \pmod{4}\).","import Mathlib theorem OddPrime (p : ℕ) (hp : Odd p ∧ Nat.Prime p) (h : p ≡ 2 [MOD 3]) : Even (fun x => x ^ 3 % p) ↔ p ≡ 3 [MOD 4] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-160248,"Let $p$ be a prime number, and let $M$ be a set of positive integers such that $|M| = p + 1$. Prove that there exist $a, b \in M$ with $a > b$ such that $$ \frac{a}{(a, b)} \geq p + 1, $$ where $(a, b)$ denotes the greatest common divisor of $a$ and $b$.","import Mathlib theorem qwen {p : ℕ} (hp : Nat.Prime p) (M : Finset ℕ) (hM : ∀ m ∈ M, m > 0) (hM1 : M.card = p + 1) : ∃ a ∈ M, ∃ b ∈ M, a > b ∧ a / Nat.gcd a b ≥ p + 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-160299,"Given a coloring of the integers using three colors: red, yellow, and green, show that there always exist integers $a$, $b$, and $c$ such that $a$, $b$, $c$, $a+b$, $a+c$, $b+c$, and $a+b+c$ are all the same color.","import Mathlib theorem threeColoring (f : ℤ → Fin 3) : ∃ a b c, f a = f b ∧ f b = f c ∧ f c = f (a + b) ∧ f (a + b) = f (a + c) ∧ f (a + c) = f (b + c) ∧ f (b + c) = f (a + b + c) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-160318,"Let $n$ be a positive integer. In a group of $2n + 1$ people, each pair is classified as either friends or strangers. For every subset $S$ of at most $n$ people, there is at least one person outside of $S$ who is friends with everyone in $S$. Prove that there is at least one person in the group who is friends with everyone else.","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (a : Fin (2 * n + 1) → Fin (2 * n + 1) → Bool) (h : ∀ S : Finset (Fin (2 * n + 1)), S.card ≤ n → ∃ x : Fin (2 * n + 1), x ∉ S ∧ ∀ y ∈ S, a x y = True) : ∃ x : Fin (2 * n + 1), ∀ y : Fin (2 * n + 1), a x y = True := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-160331,"A ""walking sequence"" is defined as a sequence of integers $(a_i)_{i=1}^{2016}$ such that $a_{i+1} = a_i \pm 1$ for every $i \in \{1, 2, \ldots, 2015\}$. Prove that there exists a sequence $(b_i)_{i=1}^{2016}$ such that for every walking sequence $(a_i)_{i=1}^{2016}$ where $1 \leq a_i \leq 1010$ for all $i$, there exists an index $j \in \{1, 2, \ldots, 2016\}$ for which $a_j = b_j$.","import Mathlib def is_walk_sequence (a : ℕ → ℤ) : Prop := ∀ i ∈ Finset.Icc 1 2015, a (i + 1) = a i + 1 ∨ a (i + 1) = a i - 1 theorem prove : ∃ b : ℕ → ℤ, (∀ a : ℕ → ℤ, is_walk_sequence a → (∀ i ∈ Finset.Icc 1 2016, 1 ≤ a i ∧ a i ≤ 1010) → ∃ j ∈ Finset.Icc 1 2016, a j = b j) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-160600,"Prove the following identities from Problem E1318 of The American Mathematical Monthly, Vol. 65, 1958, p. 366: 1. $\sum\limits_{k=0}^{n}{\frac{1}{k!}}=\frac{\left[ en! \right]}{n!}$ 2. $\sum\limits_{k=0}^{n}{{{\left( -1 \right)}^{k}}\binom{n}{k}\left[ ek! \right]}={{\left( -1 \right)}^{n}}n!+1$ 3. $\sum\limits_{k=1}^{n}{{{\left( -1 \right)}^{k}}\binom{n}{k}{{k}^{n}}{{\left( 1+\frac{1}{k} \right)}^{k}}}={{\left( -1 \right)}^{n}}\left[ en! \right]$","import Mathlib open Finset Real Nat theorem E1318 {n : ℕ} : ∑ k ∈ range (n + 1), (1 / (Nat.factorial k)) = ⌊Real.exp 1 * n.factorial⌋ / n.factorial ∧ ∑ k ∈ range (n + 1), (-1 : ℝ)^k * Nat.choose n k * ⌊Real.exp 1 * k.factorial⌋ = (-1 : ℝ)^n * n.factorial + 1 ∧ ∑ k ∈ Icc 1 n, (-1 : ℝ)^k * Nat.choose n k * k^n * (1 + 1 / k : ℝ)^k = (-1 : ℝ)^n * ⌊Real.exp 1 * n.factorial⌋ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-160685,"Let $(X,d)$ be a metric space where $d:X \times X \to \mathbb{R}_{\geq 0}$. Assume that $X$ is both connected and compact. Prove that there exists a constant $\alpha \in \mathbb{R}_{\geq 0}$ such that for any positive integer $n$ and any points $x_1, x_2, \ldots, x_n \in X$, there is a point $x \in X$ for which the average distance from $x$ to each of the points $x_1, x_2, \ldots, x_n$ is $\alpha$, i.e., $$\frac{d(x, x_1) + d(x, x_2) + \cdots + d(x, x_n)}{n} = \alpha.$$","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem ContinuousCompactSpace {X : Type*} [MetricSpace X] [ConnectedSpace X] [CompactSpace X] : ∃ α : ℝ, α ≥ 0 ∧ ∀ n > 0, ∀ x : Fin n → X, ∃ y : X, (∑ i : Fin n, dist y (x i)) / n = α := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-160811,Let $k! \big| \binom{2n}{n}$. Prove that $k < 5\sqrt[7]{n}$.,"import Mathlib theorem k_factorial_divisible_brownian (k : ℕ) (h : k > 0) (n : ℕ) (hn : n > 0) (h1 : Nat.factorial k ∣ Nat.choose (2 * n) n) : k < 5 * (n : ℝ) ^ ((1 : ℝ) / 7) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-160878,"For a positive integer $n$, consider distinct subsets $A_1, A_2, \ldots, A_n$ of the set $\{1, 2, \ldots, n+1\}$, where each subset $A_i$ has at most two elements. Prove that there exist distinct subsets $\mathcal{S}$ and $\mathcal{S}'$ of $\{1, 2, \ldots, n+1\}$ such that the equality $|A_k \cap \mathcal{S}| = |A_k \cap \mathcal{S}'|$ holds for all integers $1 \leq k \leq n$, where $|T|$ denotes the number of elements in a set $T$.","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (A : Fin n → Set ℕ) (hA : ∀ i j, A i = A j → i = j) (hA' : ∀ i, A i ⊆ Finset.Icc 1 (n + 1)) (hA'' : ∀ i, (A i).encard ≤ 2) : ∃ S S' : Set ℕ, S ⊆ Finset.Icc 1 (n + 1) ∧ S' ⊆ Finset.Icc 1 (n + 1) ∧ S ≠ S' ∧ ∀ k : Fin n, (A k ∩ S).ncard = (A k ∩ S').ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-160883,Let $X$ be a compact Hausdorff space and $f: X \to X$ be a continuous function. Prove that there exists a non-empty closed set $A \subset X$ such that $A = f(A)$.,"import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem I {X : Type*} [TopologicalSpace X] [CompactSpace X] [T2Space X] (f : X → X) (hf : Continuous f) : ∃ A : Set X, A ≠ ∅ ∧ IsClosed A ∧ A = f '' A := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-160992,"Let $N = \{0, 1, 2, 3, \ldots\}$ be the set of nonnegative integers. Consider a bijection $f: N \to N$. Prove that there exist nonnegative integers $a, b, c \in N$ such that: 1. $a < b < c$ 2. $f(a)$, $f(b)$, and $f(c)$ form an arithmetic progression, i.e., $f(b) = \frac{f(a) + f(c)}{2}$.","import Mathlib theorem Nat.exists_bij (f : ℕ → ℕ) (hf : Function.Bijective f) : ∃ a b c, a < b ∧ b < c ∧ (f b = (f a + f c) / 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161020,"Let $A$ be a set of positive integers that satisfies the following conditions: 1. If $a \in A$, then all positive divisors of $a$ are also in $A$. 2. If $a, b \in A$ with $1 < a < b$, then $1 + ab \in A$. Prove that if $A$ contains at least three elements, then $A$ is the set of all positive integers.","import Mathlib theorem qwen (A : Set ℕ) (hA : ∀ x ∈ A, 0 < x) (hA1 : ∀ x ∈ A, ∀ d ∈ Nat.divisors x, d ∈ A) (hA2 : ∀ x ∈ A, ∀ y ∈ A, 1 < x ∧ x < y → (1 + x * y) ∈ A) (hA3 : ∃ x ∈ A, ∃ y ∈ A, ∃ z ∈ A, x ≠ y ∧ y ≠ z ∧ z ≠ x) : A = {x | 0 < x} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161040,"Let $A$ be a finite set of positive integers. Prove that there exists a finite set $B$ such that: 1. All elements of $B$ are positive integers. 2. $A$ is a subset of $B$. 3. $\sum_{x \in B} x^2 = \prod_{x \in B} x$.","import Mathlib theorem Qwen (A : Finset ℕ) (hA : ∀ x ∈ A, x > 0) : ∃ B : Finset ℕ, (∀ x ∈ B, x > 0) ∧ A ⊆ B ∧ ∑ x ∈ B, x ^ 2 = ∏ x ∈ B, x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161048,"Let $(X, d)$ be a compact metric space, where $d$ is the distance function. Let $f: X \rightarrow X$ be a mapping such that $d(f(x), f(y)) < d(x, y)$ for any two distinct points $x, y \in X$. Prove that there exists an $x \in X$ such that $f(x) = x$.","import Mathlib theorem MetricCompactSpace {X : Type*} [MetricSpace X] [CompactSpace X] (f : X → X) (h : ∀ x y, x ≠ y → dist (f x) (f y) < dist x y) : ∃ x, f x = x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161078,"Let a (finite) system of residues and moduli $a_i \pmod{b_i}$, for $1 \leq i \leq k$, be defined as ""covering"" if every integer belongs to at least one of the residue classes, i.e., satisfies at least one of the congruences $x \equiv a_i \pmod{b_i}$. For example, the system \[ 0 \pmod{2}, 2 \pmod{3}, 1 \pmod{4}, 1 \pmod{6}, 3 \pmod{12} \] is a covering system. Prove that for any such covering system, there exists a non-empty subset $I \subseteq \{1,\ldots,k\}$ such that \[ \sum_{i \in I} \frac{1}{b_i} \in \mathbb{N} \] is an integer. For instance, in the given system, $1/2 + 1/3 + 1/6 = 1 \in \mathbb{N}$.","import Mathlib theorem coveringsystem {k : ℕ} (a b : Fin k → ℤ) (hb : ∀ i, 0 < b i) (h : ∀ x : ℤ, ∃ i : Fin k, x ≡ a i [ZMOD b i]) : ∃ I : Finset (Fin k), I ≠ ∅ ∧ ∃ n : ℕ, ∑ i ∈ I, (1 / b i : ℚ) = n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161099,"Let $\{t_n\}$ be a sequence of real numbers. Define the set $E = \{ x \in \mathbb{R} : \lim\limits_{n\to\infty} e^{i t_n x} \text{ exists} \}$. Given that the Lebesgue measure $m(E) > 0$, prove that the sequence $\{t_n\}$ is convergent.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem convergent_t (t : ℕ → ℝ) : (MeasureTheory.volume {x | ∃ y : ℝ, Tendsto (λ n => exp (I * t n * x)) atTop (𝓝 y)}).toReal > 0 → ∃ L : ℝ, Tendsto t atTop (𝓝 L) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161109,"Let $n$ be an integer such that $n \geq 2$. Prove that for every integer $k$ satisfying $2n-3 \leq k \leq \frac{n(n-1)}{2}$, there exist $n$ distinct real numbers $a_1, a_2, \ldots, a_n$ such that among the sums $a_i + a_j$ for $1 \leq i \leq j \leq n$, exactly $k$ distinct sums are obtained.","import Mathlib theorem nge2 (n : ℕ) (hn : 2 ≤ n) : ∀ k ∈ Finset.Icc (2 * n - 3) (n * (n - 1) / 2), ∃ a : Finset ℝ, a.card = n ∧ {x | ∃ i ∈ a, ∃ j ∈ a, x = i + j}.encard = k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161131,"Given a plane colored with three distinct colors, prove that there exist two points of the same color that are exactly 1 unit apart.","import Mathlib theorem Topology_247086 (f : ℝ × ℝ → Fin 3) : ∃ x y, f x = f y ∧ Real.sqrt ((x.1 - y.1)^2 + (x.2 - y.2)^2) = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161138,"Let $A$ and $B$ be disjoint sets such that $A \cup B = \mathbb{N}$ and $A \cap B = \varnothing$. Prove that for any $c > 0$, there exist increasing sequences $\{a_n\} \subset A$ and $\{b_n\} \subset B$ such that $\lim_{n \to \infty} \frac{a_n}{b_n} = c$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (c : ℝ) (hc : c > 0) (A B : Set ℕ) (h₀ : Disjoint A B) (h₁ : A ∪ B = ℕ) (h₂ : A ∩ B = ∅) : ∃ a b : ℕ → ℕ, StrictMono a ∧ StrictMono b ∧ Tendsto (λ n => (a n : ℝ) / b n) atTop (𝓝 c) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161170,"Let $A$ and $B$ be disjoint sets such that $A \cup B = \mathbb{N}$, where $\mathbb{N}$ denotes the set of natural numbers. Prove that for every natural number $n$, there exist distinct natural numbers $a, b > n$ such that either $\{a, b, a+b\} \subseteq A$ or $\{a, b, a+b\} \subseteq B$.","import Mathlib theorem DisjointSetUnion (A B : Set ℕ) (h₀ : A ∩ B = ∅) (h₁ : A ∪ B = ℕ) : ∀ n : ℕ, ∃ a b : ℕ, a > n ∧ b > n ∧ a ≠ b ∧ ((a ∈ A ∧ b ∈ A ∧ a + b ∈ A) ∨ (a ∈ B ∧ b ∈ B ∧ a + b ∈ B)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161313,"Let $X$ be a set with $n$ elements, and let $F$ be a family of subsets of $X$, each containing exactly three elements, such that any two subsets in $F$ have at most one element in common. Prove that there exists a subset $Y$ of $X$ with at least $\sqrt{2n}$ elements that does not contain any subset from $F$.","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (F : Finset (Finset (Fin n))) (hF : ∀ s ∈ F, s.card = 3) (hF' : ∀ s ∈ F, ∀ t ∈ F, s ≠ t → (s ∩ t).card ≤ 1) : ∃ Y : Finset (Fin n), Y.card ≥ Real.sqrt (2 * n) ∧ ∀ s ∈ F, ¬(s ⊆ Y) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161348,"Let $n > 1$ be an integer. A subset $S \subset \{0, 1, 2, \ldots, 4n-1\}$ is defined as [i]rare[/i] if, for any $k \in \{0, 1, \ldots, n-1\}$, the following conditions are simultaneously satisfied: 1. The set $S \cap \{4k-2, 4k-1, 4k, 4k+1, 4k+2\}$ contains at most two elements. 2. The set $S \cap \{4k+1, 4k+2, 4k+3\}$ contains at most one element. Prove that the set $\{0, 1, 2, \ldots, 4n-1\}$ has exactly $8 \cdot 7^{n-1}$ rare subsets.","import Mathlib def isRare (S : Finset ℕ) (n : ℕ) := S ⊆ Finset.Icc 0 (4 * n - 1) ∧ ∀ k ∈ Finset.Icc 0 (n - 1), (S ∩ {4 * k - 2, 4 * k - 1, 4 * k, 4 * k + 1, 4 * k + 2}).card ≤ 2 ∧ (S ∩ {4 * k + 1, 4 * k + 2, 4 * k + 3}).card ≤ 1 theorem countRares (n : ℕ) (hn : 1 < n) : Set.ncard {S | isRare S n} = 8 * 7 ^ (n - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161432,"Prove that for every fixed number $k \in \mathbb{N}$, there exists only a finite number of positive integers $n$ that can be expressed in the form $n = a_{1} + a_{2} + \cdots + a_{k}$, where $a_{i}$ are positive integers (not necessarily distinct) and $\frac{1}{a_{1}} + \frac{1}{a_{2}} + \cdots + \frac{1}{a_{k}} = 1$. Such numbers $n$ are referred to as ""fantastic numbers.""","import Mathlib theorem for_fixed_k (k : ℕ) : Set.Finite {n : ℕ | ∃ a : Fin k → ℕ, (∀ i, a i > 0) ∧ (∑ i, a i) = n ∧ (∑ i, (1 : ℚ)/(a i)) = 1} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161482,"Let $(X, p)$ be a compact metric space, and let $O_1, O_2, \ldots, O_N$ be open subsets that form an open cover of $X$. Prove that there exists a real number $R > 0$ such that for every point $x_0 \in X$, there is an integer $j \in \{1, 2, \ldots, N\}$ for which the open ball $B_R(x_0)$ is contained in the open set $O_j$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem T3 (X : Type*) [MetricSpace X] [CompactSpace X] (N : ℕ) (hN : 0 < N) (O : Fin N → Set X) (hO : ∀ i, IsOpen (O i)) (hOC : ∀ x, ∃ i, x ∈ O i) : ∃ R > 0, ∀ x0, ∃ j, {y | dist y x0 < R} ⊆ O j := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161579,"Let $A = \{a_1, a_2, \ldots, a_n\}$ and $B = \{b_1, b_2, \ldots, b_m\}$ be two finite collections of positive integers. Define the collections $A^* = \{a_i + a_j \mid 1 \le i < j \le n\}$ and $B^* = \{b_i + b_j \mid 1 \le i < j \le m\}$. Show that if $A^* = B^*$, then $|A| = |B|$ and $|A| = |B|$ must be a power of $2$.","import Mathlib def star (s : Finset ℕ) := {x | ∃ i ∈ s, ∃ j ∈ s, i ≠ j ∧ x = i + j} theorem Finset.star_eq {A B : Finset ℕ} (hA : ∀ a ∈ A, a > 0) (hB : ∀ b ∈ B, b > 0) (hAB : star A = star B) : A.card = B.card ∧ ∃ k, A.card = 2 ^ k ∧ B.card = 2 ^ k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161694,"Given $N$ points in the plane such that the total number of distinct pairwise distances among these points is at most $n$, prove that $N \leq (n + 1)^2$.","import Mathlib theorem dists_to_set {N : ℕ} (hN : N > 0) (a : Fin N → EuclideanSpace ℝ (Fin 2)) (h : Set.ncard {x | ∃ i j, i ≠ j ∧ x = dist (a i) (a j)} ≤ n) : N ≤ (n + 1)^2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161723,"Let $m$ and $n$ be positive integers. Prove that the set of all positive integers can be partitioned into three pairwise disjoint nonempty subsets $A_1$, $A_2$, and $A_3$ such that none of these subsets contains two numbers whose absolute difference is equal to $m$ or $n$.","import Mathlib theorem number_theory (m n : ℤ) (hm : 0 < m) (hn : 0 < n) : ∃ A B C : Set ℤ, A ∪ B ∪ C = {x | 0 < x} ∧ A ∩ B = ∅ ∧ A ∩ C = ∅ ∧ B ∩ C = ∅ ∧ A.Nonempty ∧ B.Nonempty ∧ C.Nonempty ∧ ∀ x ∈ A, ∀ y ∈ A, x ≠ y → |x - y| ≠ m ∧ |x - y| ≠ n ∧ ∀ x ∈ B, ∀ y ∈ B, x ≠ y → |x - y| ≠ m ∧ |x - y| ≠ n ∧ ∀ x ∈ C, ∀ y ∈ C, x ≠ y → |x - y| ≠ m ∧ |x - y| ≠ n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161817,"Let $X$ be a set of 10,000 integers, none of which is divisible by 47. Prove that there exists a subset $Y$ of $X$ with 2007 elements such that for any $a, b, c, d, e \in Y$, the expression $a - b + c - d + e$ is not divisible by 47. [i]Author: Gerhard Wöginger, Netherlands[/i]","import Mathlib theorem prove (X : Finset ℤ) (hX : X.card = 10000) (hX' : ∀ x ∈ X, ¬(47 ∣ x)) : ∃ Y ⊆ X, Y.card = 2007 ∧ ∀ a ∈ Y, ∀ b ∈ Y, ∀ c ∈ Y, ∀ d ∈ Y, ∀ e ∈ Y, ¬(47 ∣ a - b + c - d + e) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161842,"Let $X$ and $Y$ be compact topological spaces. For each continuous real-valued function $f$ on $X \times Y$ and each $\varepsilon > 0$, show that there exist continuous functions $f_1, \ldots, f_n$ on $X$ and continuous functions $g_1, \ldots, g_n$ on $Y$ such that $|f(x, y) - \sum_{i=1}^n f_i(x) g_i(y)| < \varepsilon$ for all $(x, y) \in X \times Y$.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem TopologyCompactSpace.X (X : Type*) [TopologicalSpace X] [CompactSpace X] (Y : Type*) [TopologicalSpace Y] [CompactSpace Y] (f : X → Y → ℝ) (hf : Continuous f) (ε : ℝ) (hε : ε > 0) : ∃ n : ℕ, ∃ f' : Fin n → X → ℝ, ∃ g' : Fin n → Y → ℝ, (∀ i, Continuous (f' i)) ∧ (∀ i, Continuous (g' i)) ∧ (∀ x y, |f x y - ∑ i : Fin n, f' i x * g' i y| < ε) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-161959,"Let $k$ be a natural number. Every natural number is colored in one of $k$ colors. Prove that there exist four distinct natural numbers $a, b, c, d$, all colored in the same color, such that $ad = bc$, $\frac{b}{a}$ is a power of 2, and $\frac{c}{a}$ is a power of 3.","import Mathlib theorem k_colored (k : ℕ) (f : ℕ → Fin k) : ∃ a b c d : ℕ, a ≠ b ∧ a ≠ c ∧ a ≠ d ∧ b ≠ c ∧ b ≠ d ∧ c ≠ d ∧ f a = f b ∧ f b = f c ∧ f c = f d ∧ a * d = b * c ∧ ∃ m n, b / a = 2 ^ m ∧ c / a = 3 ^ n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-162095,"How can one prove that in a compact Hausdorff space, every countable collection of open sets that are dense in the space has a non-empty intersection?","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem prove_nonempty (X : Type*) [TopologicalSpace X] [CompactSpace X] [T2Space X] (C : ℕ → Set X) (hC : ∀ i, IsOpen (C i)) (hC1 : ∀ i, Dense (C i)) : ∃ x, ∀ i, x ∈ C i := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-162236,"Let $C$ be a family of subsets of $\mathbb{N}$, possibly infinite, such that for every chain $C_{1} \subset C_{2} \subset \ldots$ of members of $C$, there exists a member of $C$ that contains all of them. Prove that there exists a member of $C$ that is not properly contained in any other member of $C$.","import Mathlib theorem Qwen (C : Set (Set ℕ)) (hC : ∀ s : ℕ → Set ℕ, (∀ i j, i < j → s i ⊂ s j) ∧ (∀ i, s i ∈ C) → ∃ t ∈ C, ∀ i, t ⊃ s i) : ∃ t ∈ C, ∀ u ∈ C, u ≠ t → ¬(t ⊂ u) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-162350,"Given 23 individuals with distinct weights, they wish to form two teams of 11 players each and select one referee, ensuring that the total weight of each team is equal. It is observed that any of the 23 individuals can be chosen as the referee, and the remaining 22 can be divided into two teams of 11 with equal total weight. Prove that all 23 individuals must have the same weight.","import Mathlib theorem weight_weight (a : Fin 23 → ℝ) (ha : ∀ i j, a i = a j → i = j) (h : ∀ r : Fin 23, ∃ s1 s2 : Finset (Fin 23), s1 ≠ s2 ∧ s1 ∪ s2 = Finset.univ \ {r} ∧ s1.card = 11 ∧ s2.card = 11 ∧ ∑ i ∈ s1, a i = ∑ i ∈ s2, a i) : ∃ w, ∀ i, a i = w := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-162943,"Let $X$ and $Y$ be two finite subsets of $[0,1)$ such that $0 \in X \cap Y$ and $x + y \neq 1$ for all $x \in X$ and $y \in Y$. Define the set \[ S = \{x + y - \lfloor x + y \rfloor : x \in X, y \in Y\}. \] Prove that $S$ contains at least $|X| + |Y| - 1$ elements.","import Mathlib open Set Real theorem finset_card (X Y : Finset ℝ) (hX : ∀ x ∈ X, 0 ≤ x ∧ x < 1) (hY : ∀ y ∈ Y, 0 ≤ y ∧ y < 1) (hXY : 0 ∈ X ∩ Y) (hxy : ∀ x ∈ X, ∀ y ∈ Y, x + y ≠ 1) (S : Finset ℝ) (hS : S = {z | ∃ x ∈ X, ∃ y ∈ Y, z = x + y - ⌊x + y⌋}) : S.card ≥ X.card + Y.card - 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-163063,"Let each integer be colored either red, blue, green, or white. Given two odd integers $x$ and $y$ such that $|x| \neq |y|$, prove that there exist two natural numbers of the same color whose difference is one of $x$, $y$, $x + y$, or $x - y$.","import Mathlib theorem color (f : ℤ → Fin 4) (x y : ℤ) (hx : Odd x) (hy : Odd y) (hxy : |x| ≠ |y|) : ∃ a b : ℕ, f a = f b ∧ a - b = x ∨ a - b = y ∨ a - b = x + y ∨ a - b = x - y := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-163067,"In the plane, every point is colored with one of five colors. Prove that there exist two points of the same color such that the distance between them lies in the interval $[0.99, 1.01]$.","import Mathlib open Real Set open scoped BigOperators theorem color_points (f : ℝ × ℝ → Fin 5) : ∃ x y : ℝ × ℝ, f x = f y ∧ 0.99 ≤ dist x y ∧ dist x y ≤ 1.01 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-163529,"Given complex numbers $z_{1},\dots,z_{n}\in\mathbb{C}$, prove that there exists a subset $B \subseteq \{1,\dots,n\}$ such that \[ \left|\sum_{k\in B}z_{k}\right| \ge \frac{1}{\pi}\sum_{k=1}^{n}\left|z_{k}\right|. \]","import Mathlib open Finset Real Complex Polynomial theorem z (n : ℕ) (f : Fin n → ℂ) : ∃ t : Finset (Fin n), ‖∑ k ∈ t, f k‖ ≥ (1 / Real.pi) * ∑ i : Fin n, ‖f i‖ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-163679,"Given a plane where each point is colored with one of three colors: red, green, or blue, prove that for any given distance $d$, there always exist two points of the same color that are exactly $d$ units apart.","import Mathlib open Real open scoped BigOperators theorem color_plane (f : (EuclideanSpace ℝ (Fin 2)) → Fin 3) (d : ℝ) : ∃ x y, x ≠ y ∧ f x = f y ∧ dist x y = d := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-163694,"For each positive real number $x$, define the set $S(x) = \{ \lfloor kx \rfloor \mid k = 1, 2, \ldots \}$. Let $x_1, x_2, x_3$ be three real numbers greater than $1$ such that $\frac{1}{x_1} + \frac{1}{x_2} + \frac{1}{x_3} > 1$. Prove that there exist indices $i$ and $j$, with $1 \leq i < j \leq 3$, such that the intersection $S(x_i) \cap S(x_j)$ contains infinitely many elements.","import Mathlib open Real Set open scoped BigOperators theorem tripleTS (x : Fin 3 → ℝ) (hx : ∀ i, 1 < x i) (hsum : ∑ i, (1 / x i) > 1) : ∃ i j, i ≠ j ∧ {n | ∃ k l, n = ⌊k * x i⌋ ∧ n = ⌊l * x j⌋}.Infinite := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-163791,"Let $n \geq 3$ be a positive integer and let $m \geq 2^{n-1} + 1$. Prove that for any family of $m$ distinct, nonempty subsets $(A_j)_{j \in \{1, 2, \ldots, m\}}$ of the set $\{1, 2, \ldots, n\}$, there exist indices $i, j, k$ such that $A_i \cup A_j = A_k$.","import Mathlib theorem qwen (n : ℕ) (hn : 3 ≤ n) (m : ℕ) (hm : 2 ^ (n - 1) + 1 ≤ m) (A : Fin m → Set ℕ) (hA : ∀ i j, i ≠ j → A i ≠ A j) (hA' : ∀ i, Nonempty (A i)) (hA'' : ∀ i, A i ⊆ Finset.Icc 1 n) : ∃ i j k, A i ∪ A j = A k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-163843,"Let $S$ be a nonempty finite set. Prove that there exists a function $f : S \times S \rightarrow S$ that satisfies the following conditions: (a) For all $a, b \in S$, $f(a, b) = f(b, a)$. (b) For all $a, b \in S$, $f(a, f(a, b)) = b$. (c) For all $a, b, c, d \in S$, $f(f(a, b), f(c, d)) = f(f(a, c), f(b, d))$.","import Mathlib theorem FiniteSet.Nonempty {α : Type*} [Nonempty α] [Finite α] : ∃ f : α → α → α, (∀ a b, f a b = f b a) ∧ (∀ a b, f a (f a b) = b) ∧ (∀ a b c d, f (f a b) (f c d) = f (f a c) (f b d)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-164016,"Let $G$ be a finite group, and let $I = \{g \in G : g^2 = e\} \setminus \{e\}$ be the subset of involutions in $G$. Prove that if the cardinality of $I$ satisfies $\text{card}(I) \geq \frac{3}{4} \text{card}(G)$, then $G$ is an abelian group.","import Mathlib theorem FiniteGroup {G : Type*} [Group G] [Fintype G] (I : Set G) (hI : I = {x | x ^ 2 = 1 ∧ x ≠ 1}) : I.ncard ≥ (3 / 4 : ℚ) * Fintype.card G → ∀ x y : G, x * y = y * x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-164197,"Let $\{a_n\}$ be a sequence of positive real numbers such that for any sequence $\{b_n\}$ of real numbers, if $\sum b_n \geq 0$ and $\sum (b_n)^2 < \infty$, then $\sum (a_n)(b_n) < \infty$. Prove that $\sum (a_n)^2 < \infty$.","import Mathlib theorem sum_of_positives (a : ℕ → ℝ) (ha : ∀ n, 0 < a n) (h : ∀ b : ℕ → ℝ, (∑' n, b n ≥ 0) ∧ (∃ L, ∑' n, (b n)^2 = L) → ∃ L, ∑' n, a n * b n = L) : ∃ L, ∑' n, (a n)^2 = L := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-164581,"Let the set of real numbers $\mathbb{R}$ be partitioned into two disjoint subsets $S_1$ and $S_2$. Prove that for any pair of positive integers $(m, n)$, there exist real numbers $x < y < z$ all belonging to the same subset (either $S_1$ or $S_2$) such that $m(z - y) = n(y - x)$.","import Mathlib theorem RealPartition {S1 S2 : Set ℝ} (hS : S1 ∪ S2 = ℝ ∧ S1 ∩ S2 = ∅) (m n : ℕ) (hm : 0 < m) (hn : 0 < n) : ∃ x y z : ℝ, x < y ∧ y < z ∧ (x ∈ S1 ∧ y ∈ S1 ∧ z ∈ S1) ∨ (x ∈ S2 ∧ y ∈ S2 ∧ z ∈ S2) ∧ m * (z - y) = n * (y - x) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-164625,Consider the set of positive integers colored using two distinct colors. Prove that there exists an infinite sequence of positive integers $k_1 < k_2 < \ldots < k_n < \ldots$ such that the terms of the sequence $2k_1 < k_1 + k_2 < 2k_2 < k_2 + k_3 < 2k_3 < \ldots$ are all of the same color.,"import Mathlib theorem color_posint (f : ℕ → Fin 2) : ∃ k : ℕ → ℕ, StrictMono k ∧ (∀ i, 0 < k i) ∧ (∃ c, ∀ i, f (2 * k i) = c ∧ f (k i + k (i + 1)) = c) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-165777,"Given positive integers $a_1, a_2, \ldots, a_{2n+1}$, let $S = \frac{1}{2} \sum_{i=1}^{2n+1} a_i$. A subset $U$ of $\{1, 2, \ldots, 2n+1\}$ is called [i]fantastic[/i] if $\sum_{i \in U} a_i \geq S$. Prove that there are at least $\binom{2n}{n}$ fantastic subsets of size $n+1$.","import Mathlib open Finset Real Nat theorem number_theory_725485 {n : ℕ} (hn : 0 < n) (a : Fin (2 * n + 1) → ℤ) (ha : ∀ i, 0 < a i) (S : ℝ) (hS : S = ∑ i, a i / 2) : {U : Finset (Fin (2 * n + 1)) | U.card = n + 1 ∧ ∑ i ∈ U, a i ≥ S}.ncard ≥ Nat.choose (2 * n) n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-165887,"For $n \geq 1$, prove that it is possible to select a subset of the integers $\{1, 2, \ldots, 2^n\}$ such that for each $p = 0, 1, \ldots, n - 1$, the sum of the $p$-th powers of the selected numbers is equal to the sum of the $p$-th powers of the remaining numbers.","import Mathlib theorem prove (n : ℕ) (hn : 1 ≤ n) : ∃ s : Finset ℕ, s ⊆ Finset.Icc 1 (2 ^ n) ∧ ∀ p ∈ Finset.range n, ∑ i ∈ s, i ^ p = ∑ i ∈ (Finset.Icc 1 (2 ^ n) \ s), i ^ p := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-165902,"Let $X$ be a metric space. Suppose that for every decreasing sequence $(F_n)_{n=1}^{\infty}$ of non-empty closed subsets $F_n \subset X$, one has $\cap_{n=1}^{\infty} F_n \neq \emptyset$. Prove that $X$ is compact.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MetricSpace.compact (X : Type*) [MetricSpace X] (h : ∀ (F : ℕ → Set X), (∀ n, IsClosed (F n)) ∧ (∀ n, F n ≠ ∅) → (∀ n, F n ⊆ F (n + 1)) → ∃ x, ∀ n, x ∈ F n) : CompactSpace X := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-166687,"Prove that \[\lim_{n \to \infty} e^{-\frac{n}{2}}\sqrt{n}\sqrt[n]{\binom{n}{0}\binom{n}{1}\cdots\binom{n}{n}} = \frac{1}{\sqrt{2\pi}}.\]","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (f : ℕ → ℝ) (h₀ : ∀ n, f n = Real.exp (-n / 2) * Real.sqrt n * (∏ i ∈ range (n + 1), Nat.choose n i) ^ ((1 : ℝ) / n)) : Tendsto f atTop (𝓝 (1 / Real.sqrt (2 * Real.pi))) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-166710,"Let $n$ be a positive integer. (a) Prove that there exists a set $S$ of $6n$ pairwise distinct positive integers such that the least common multiple of any two elements of $S$ is no larger than $32n^2$. (b) Prove that every set $T$ of $6n$ pairwise distinct positive integers contains two elements the least common multiple of which is larger than $9n^2$.","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) : (∃ S : Finset ℕ, S.card = 6 * n ∧ ∀ x ∈ S, 0 < x ∧ ∀ x ∈ S, ∀ y ∈ S, x ≠ y → Nat.lcm x y ≤ 32 * n ^ 2) ∧ (∀ T : Finset ℕ, T.card = 6 * n ∧ ∀ x ∈ T, 0 < x → ∃ x ∈ T, ∃ y ∈ T, x ≠ y ∧ Nat.lcm x y > 9 * n ^ 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-166802,"Given more than $1000000$ points in a three-dimensional space, prove that there are at least $79$ distinct distances between any pair of these points.","import Mathlib theorem dist (s : Finset (EuclideanSpace ℝ (Fin 3))) (h₀ : s.card > 1000000) : Set.ncard {d | ∃ p q : EuclideanSpace ℝ (Fin 3), p ∈ s ∧ q ∈ s ∧ d = dist p q} ≥ 79 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-166814,"Let $A$ be a set of positive integers satisfying the following conditions: 1. If $a \in A$, then all positive divisors of $a$ are also in $A$. 2. If $a, b \in A$ with $1 < a < b$, then $1 + ab \in A$. Prove that if $A$ contains at least three elements, then $A$ is the set of all positive integers.","import Mathlib theorem qwen (A : Set ℕ) (hA : ∀ x ∈ A, 0 < x) (hA1 : ∀ x ∈ A, ∀ y ∈ Nat.divisors x, y ∈ A) (hA2 : ∀ x ∈ A, ∀ y ∈ A, 1 < x → x < y → (1 + x * y) ∈ A) (hA3 : A.ncard ≥ 3) : A = {x | 0 < x} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-166816,"Let $A_1, A_2, \ldots, A_n$ be $n$ finite sets such that for every $i = 1, 2, \ldots, n$, the following condition holds: \[ \left|A_i \cap A_{i+1}\right| > \frac{n-2}{n-1} \left|A_{i+1}\right|, \] where indices are considered modulo $n$ (i.e., $A_{n+1} = A_1$). Prove that the intersection of all these sets is non-empty, i.e., \[ \left|\bigcap_{i=1}^{n} A_i\right| > 0. \]","import Mathlib open Finset Real theorem union_finite {α : Type} {n : ℕ} [NeZero n] {f : ℕ → Set α} (hf : ∀ i ∈ range n, Finite (f i)) (h : ∀ i ∈ range n, ((f i) ∩ (f ((i + 1) % n))).ncard > ((n - 2) / (n - 1)) * (f ((i + 1) % n)).ncard) : ((⋂ i ∈ range n, f i).ncard > 0) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-166893,"Prove or disprove: Given $\alpha$, an irrational real number, the set $\{ k\alpha - \lfloor k\alpha \rfloor : k \in \mathbb{N}\}$ is dense in the interval $[0,1]$. Are there multiple approaches to this problem?","import Mathlib theorem IrrationalReal (α : ℝ) (hα : Irrational α) : Dense {x | ∃ k : ℕ, x = k * α - ⌊k * α⌋ ∧ 0 ≤ x ∧ x ≤ 1} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-166901,"Let $x_1, x_2, \ldots, x_n$ be real numbers such that $x_1^2 + x_2^2 + \ldots + x_n^2 = 1$. Prove that for every integer $k \geq 2$, there exist integers $a_1, a_2, \ldots, a_n$, not all zero, such that $|a_i| \leq k-1$ for all $i$, and $|a_1x_1 + a_2x_2 + \ldots + a_nx_n| \leq \frac{(k-1)\sqrt{n}}{k^n - 1}$.","import Mathlib open Real Set open scoped BigOperators theorem x (n : ℕ) (hn : 0 < n) (x : Fin n → ℝ) (h : ∑ i : Fin n, (x i)^2 = 1) : ∀ k ≥ 2, ∃ a : Fin n → ℤ, (∀ i : Fin n, |a i| ≤ k - 1) ∧ (∃ i : Fin n, a i ≠ 0) ∧ |∑ i : Fin n, a i * x i| ≤ ((k - 1) * sqrt n) / (k^n - 1) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-167177,"Given $1{,}000{,}000$ points in three-dimensional space, prove that the set of all pairwise distances between these points contains at least $79$ distinct elements.","import Mathlib open Real open scoped BigOperators theorem dist_set (s : Finset (EuclideanSpace ℝ (Fin 3))) (h₀ : s.card = 1000000) : Set.ncard {d | ∃ p q : EuclideanSpace ℝ (Fin 3), p ∈ s ∧ q ∈ s ∧ d = dist p q} ≥ 79 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-167273,"Given $10^6$ points in three-dimensional space, prove that the set of pairwise distances between these points contains at least 79 distinct elements.","import Mathlib theorem dist_set (S : Finset (EuclideanSpace ℝ (Fin 3))) (hS : S.card = 10 ^ 6) : Set.ncard {x | ∃ P ∈ S, ∃ Q ∈ S, x = dist P Q} ≥ 79 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-167281,"Let $S$ be a set containing $2000$ natural numbers, each less than $10^{100}$. Prove that there exist two non-empty, distinct subsets $A$ and $B$ of $S$ such that $|A| = |B|$, $\sum_{x \in A} x = \sum_{y \in B} y$, and $\sum_{x \in A} x^2 = \sum_{y \in B} y^2$.","import Mathlib theorem Qwen (S : Finset ℕ) (hS : S.card = 2000) (hS1 : ∀ n ∈ S, n < 10 ^ 100) : ∃ A B : Finset ℕ, A ⊆ S ∧ B ⊆ S ∧ A ≠ B ∧ A.card > 0 ∧ B.card > 0 ∧ ∑ x ∈ A, x = ∑ y ∈ B, y ∧ ∑ x ∈ A, x ^ 2 = ∑ y ∈ B, y ^ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-167294,"Let $A$ be a subset of $\mathbb{R}$ such that: 1. $A \cap (0,1) \neq \emptyset$. 2. For any $(x, y) \in A^2$, both $y - x \in A$ and $xy \in A$. Prove that $A$ is dense in $\mathbb{R}$.","import Mathlib theorem DenseSet {A : Set ℝ} (hA1 : ∃ x ∈ A, 0 < x ∧ x < 1) (hA2 : ∀ x ∈ A, ∀ y ∈ A, y - x ∈ A ∧ x * y ∈ A) : closure A = ⊤ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-167311,"Let $x$ be an irrational number, and define the function $f(nx) = nx - [nx]$, where $n$ is a natural number. Prove that the set $\{f(nx) : n \in \mathbb{N}\}$ is dense in the interval $[0,1]$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem DenseSet (x : ℝ) (hx : Irrational x) (f : ℕ → ℝ) (hf : ∀ n, f n = n * x - ⌊n * x⌋) : closure {y | ∃ n, y = f n ∧ 0 ≤ y ∧ y ≤ 1} = Set.Icc 0 1 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-167401,"Show that the following series converges to the given expression: $ \sum_{k=1}^\infty \dfrac{1}{k \cdot \left(\dfrac{\pi}{2}\right)^{2k} \cdot \dbinom{2k}{k}} = \dfrac{2\sin^{-1}\left(\dfrac{1}{\pi}\right)}{\sqrt{\pi^2 - 1}} $","import Mathlib open Real Filter Function open scoped BigOperators Topology theorem sum_series : ∑' k : ℕ, (1 / ((k + 1) * (π/2)^(2*(k + 1)) * Nat.choose (2*(k + 1)) (k + 1))) = 2 * arcsin (1/π)/Real.sqrt (π^2 - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-167651,Let $X$ be an infinite compact metric space. Prove that there exists a subset $D \subseteq X$ which is both dense and countable.,"import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem InfiniteCompactMetricSpace (X : Type*) [MetricSpace X] [CompactSpace X] (hX : ¬ Finite X) : ∃ D : Set X, Dense D ∧ Countable D := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-167833,"Let $\mathcal{X}$ be a subset of the set $\{1, 2, \ldots, 2010\}$ that satisfies the following conditions: 1. $|\mathcal{X}| = 62$. 2. For every $x \in \mathcal{X}$, there exist $a, b \in \mathcal{X} \cup \{0, 2011\}$ (where $a$ and $b$ are distinct from $x$) such that $x = \frac{a + b}{2}$. Prove that there exist two elements $x, y \in \mathcal{X}$ such that $|x - y| \ge 11$ and $\frac{x + y}{2} \notin \mathcal{X}$.","import Mathlib theorem Qwen {X : Finset ℕ} (hX : X ⊆ Finset.Icc 1 2010) (hX1 : X.card = 62) (hX2 : ∀ x ∈ X, ∃ a b : ℕ, a ∈ X ∪ {0, 2011} ∧ b ∈ X ∪ {0, 2011} ∧ a ≠ x ∧ b ≠ x ∧ x = (a + b) / 2) : ∃ x ∈ X, ∃ y ∈ X, |(x : ℤ) - y| ≥ 11 ∧ ¬((x + y) / 2 ∈ X) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-167986,"Let $S$ be a set of integers that includes the numbers $0$ and $1996$. Suppose that for any non-zero polynomial with coefficients in $S$, any integer root of this polynomial also belongs to $S$. Prove that $-2$ is an element of $S$.","import Mathlib theorem Qwen (S : Set ℤ) (h0 : 0 ∈ S) (h1 : 1996 ∈ S) (hroots : ∀ P : Polynomial ℤ, P.degree > 0 → (∀ p ∈ P.coeffs, p ∈ S) → ∀ x : ℤ, P.eval x = 0 → x ∈ S) : -2 ∈ S := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-168044,"Given a multiplication table of size $n \times n$, where each cell at the $i$-th row and $j$-th column contains the product $ij$, derive a closed formula in terms of $n$ to count the number of distinct entries in the table, or prove that such a formula does not exist.","import Mathlib open Finset theorem noClosedFormula : ¬∃ f : ℕ → ℤ, ∀ n ≥ 1, (f n) = {x | ∃ i j, i ∈ Icc 1 n ∧ j ∈ Icc 1 n ∧ x = i * j}.ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-168048,"Let $\{a_0, a_1, \ldots\}$ and $\{b_0, b_1, \ldots\}$ be two infinite sequences of integers such that for all integers $n \geq 2$, \[ (a_n - a_{n-1})(a_n - a_{n-2}) + (b_n - b_{n-1})(b_n - b_{n-2}) = 0. \] Prove that there exists a positive integer $k$ such that \[ a_{k+2011} = a_{k+2011^{2011}}. \]","import Mathlib theorem qwen (a b : ℕ → ℤ) (h : ∀ n ≥ 2, (a n - a (n - 1)) * (a n - a (n - 2)) + (b n - b (n - 1)) * (b n - b (n - 2)) = 0) : ∃ k > 0, a (k + 2011) = a (k + 2011 ^ 2011) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-168101,"Let $B$ be a set of more than $\frac{2^{n+1}}{n}$ distinct points, where each point has coordinates of the form $(\pm 1, \pm 1, \cdots, \pm 1)$ in $n$-dimensional space with $n \ge 3$. Prove that there exist three distinct points in $B$ which are the vertices of an equilateral triangle.","import Mathlib open Real open scoped BigOperators theorem Equilateral (n : ℕ) (hn : n ≥ 3) (B : Finset (EuclideanSpace ℝ (Fin n))) (hB : B.card > 2^(n + 1) / n) (hB1 : ∀ P ∈ B, ∀ i, (P i = 1 ∨ P i = -1)) : ∃ A ∈ B, ∃ B' ∈ B, ∃ C ∈ B, A ≠ B' ∧ A ≠ C ∧ B' ≠ C ∧ dist A B' = dist A C ∧ dist A B' = dist B' C := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-168167,"Let $z_1, z_2, \ldots, z_n$ be complex numbers. Show that there exists a subset $S$ of $\{1, 2, \ldots, n\}$ such that $\left|\sum_{j \in S} z_j\right| \geq \frac{1}{\pi} \sum_{j=1}^{n} |z_j|$.","import Mathlib open Finset Real Complex Polynomial theorem z (n : ℕ) (f : Fin n → ℂ) : ∃ t : Finset (Fin n), ‖∑ j ∈ t, f j‖ ≥ (1 / Real.pi) * ∑ j : Fin n, ‖f j‖ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-168236,"Show that the set $\left\{\frac{\sqrt{n} - \lfloor \sqrt{n} \rfloor}{n} \mid n \in \mathbb{N}\right\}$ is dense in the interval $[0,1]$.","import Mathlib open Real Set open scoped BigOperators theorem dense : closure {x | ∃ n : ℕ, x = (sqrt n - ⌊sqrt n⌋)/n ∧ 0 ≤ x ∧ x < 1} = {x | 0 ≤ x ∧ x < 1} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-168508,"Given five real numbers $a_i$ for $1 \leq i \leq 5$, prove that there exist natural numbers $n_i$ for $1 \leq i \leq 5$ such that the following inequality holds: \[ \sum_{1 \leq i < j \leq 5} \left( (a_i - a_j) - (n_i - n_j) \right)^2 < 4 \]","import Mathlib theorem RealInequality (a : Fin 5 → ℝ) : ∃ n : Fin 5 → ℕ, ∑ i, ∑ j, (if (i < j) then ((a i - a j) - (n i - n j))^2 else 0) < 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-168545,"For any $a > 0$, define the set $\mathcal{S}(a) = \{\lfloor na \rfloor \mid n \in \mathbb{N}\}$. Prove that there do not exist three positive real numbers $a, b, c$ such that: \[ \mathcal{S}(a) \cap \mathcal{S}(b) = \mathcal{S}(b) \cap \mathcal{S}(c) = \mathcal{S}(c) \cap \mathcal{S}(a) = \emptyset \] and \[ \mathcal{S}(a) \cup \mathcal{S}(b) \cup \mathcal{S}(c) = \mathbb{N}. \]","import Mathlib open Real Set open scoped BigOperators theorem do_not_exist : ¬ ∃ a b c : ℝ, a > 0 ∧ b > 0 ∧ c > 0 ∧ {x | ∃ m : ℕ, x = ⌊m * a⌋} ∩ {x | ∃ n : ℕ, x = ⌊n * b⌋} = ∅ ∧ {x | ∃ n : ℕ, x = ⌊n * b⌋} ∩ {x | ∃ p : ℕ, x = ⌊p * c⌋} = ∅ ∧ {x | ∃ p : ℕ, x = ⌊p * c⌋} ∩ {x | ∃ q : ℕ, x = ⌊q * a⌋} = ∅ ∧ {x | ∃ m : ℕ, x = ⌊m * a⌋} ∪ {x | ∃ n : ℕ, x = ⌊n * b⌋} ∪ {x | ∃ p : ℕ, x = ⌊p * c⌋} = ℕ := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-168638,"Prove that for any set of $14$ distinct natural numbers, there exists an integer $k \in \{1,2,3,4,5,6,7\}$ such that one can find two disjoint $k$-element subsets $\{a_{1}, a_{2}, \ldots, a_{k}\}$ and $\{b_{1}, b_{2}, \ldots, b_{k}\}$ for which the sums $A = \frac{1}{a_{1}} + \frac{1}{a_{2}} + \cdots + \frac{1}{a_{k}}$ and $B = \frac{1}{b_{1}} + \frac{1}{b_{2}} + \cdots + \frac{1}{b_{k}}$ satisfy $|A - B| < 0.001$.","import Mathlib theorem dist_set (s : Finset ℕ) (h₀ : s.card = 14) : ∃ k ∈ Finset.Icc 1 7, ∃ a b : Finset ℕ, a ⊆ s ∧ b ⊆ s ∧ a ∩ b = ∅ ∧ a.card = k ∧ b.card = k ∧ |(∑ i ∈ a, (1 : ℚ)/i) - (∑ i ∈ b, (1 : ℚ)/i)| < 0.001 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-168647,"Let $n$ be a positive integer, $P$ be a set of $n$ primes, and $M$ be a set of at least $n+1$ natural numbers, each of which is divisible by no primes other than those belonging to $P$. Prove that there exists a nonempty subset of $M$ such that the product of its elements is a square integer.","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (P : Finset ℕ) (hP : P.card = n) (hP1 : ∀ p ∈ P, Nat.Prime p) (M : Finset ℕ) (hM : M.card ≥ n + 1) (hM1 : ∀ m ∈ M, ∀ p ∈ Nat.primeFactors m, p ∈ P) : ∃ S ⊆ M, S ≠ ∅ ∧ IsSquare (∏ s ∈ S, s) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-168680,"Let $u$ be an irrational real number. Define the set $S$ as the collection of all real numbers of the form $a + bu$, where $a$ and $b$ are integers. Prove that $S$ is dense in the set of real numbers.","import Mathlib theorem DenseSet (u : ℝ) (hu : Irrational u) : closure {x | ∃ a b : ℤ, x = a + b * u} = Set.univ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-168708,"Let $z_1, z_2, \ldots, z_n$ be complex numbers. Prove that there exists a subset $J \subset \{1, 2, \ldots, n\}$ such that: \[ \left|\sum_{j \in J} z_j\right| \geq \frac{1}{4\sqrt{2}} \left|\sum_{1 \leq i \leq n} z_i\right| \]","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem sum_of_subset (n : ℕ) (f : Fin n → ℂ) : ∃ J : Finset (Fin n), ‖∑ j ∈ J, f j‖ ≥ (1 / (4 * Real.sqrt 2)) * ‖∑ i : Fin n, f i‖ := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-168740,"Let $a < b < c$ be three positive integers. Prove that there exists a partition of the set of non-negative integers $\mathbb{N}$ into three disjoint subsets $(X, Y, Z)$ such that $a + X = b + Y = c + Z$ if and only if $a + c = 2b$. Here, $a + X$ denotes the set $\{a + x \mid x \in X\}$.","import Mathlib theorem prove (a b c : ℕ) (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) (hord : a < b ∧ b < c) : ∃ X Y Z : Set ℕ, X ∪ Y ∪ Z = ℕ ∧ X ∩ Y = ∅ ∧ X ∩ Z = ∅ ∧ Y ∩ Z = ∅ ∧ {x | ∃ y ∈ X, x = a + y} = {x | ∃ y ∈ Y, x = b + y} ∧ {x | ∃ y ∈ Y, x = b + y} = {x | ∃ y ∈ Z, x = c + y} ↔ a + c = 2 * b := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-168788,"Define the sequence $(a_n)$ by $a_0 = 0$ and $a_n = a_{n-1} + \frac{3^{r+1}-1}{2}$ if $n = 3^r(3k + 1)$, and $a_n = a_{n-1} + \frac{3^{r+1}+1}{2}$ if $n = 3^r(3k + 2)$, where $r, k \geq 0$. Prove that every integer appears exactly once in the sequence.","import Mathlib theorem a (a : ℕ → ℤ) (ha0 : a 0 = 0) (han : ∀ r k, a (3 ^ r * (3 * k + 1)) = a (3 ^ r * (3 * k + 1) - 1) + (3 ^ (r + 1) - 1) / 2) (han' : ∀ r k, a (3 ^ r * (3 * k + 2)) = a (3 ^ r * (3 * k + 2) - 1) + (3 ^ (r + 1) + 1) / 2) : ∀ x, ∃! n, a n = x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-168866,"Prove that the set of all points in the plane with both coordinates being rational numbers can be partitioned into two disjoint sets $A$ and $B$ such that any line parallel to the $x$-axis intersects $A$ in a finite number of points, and any line parallel to the $y$-axis intersects $B$ in a finite number of points.","import Mathlib open Real open scoped BigOperators theorem algebra_476098 : ∃ A B : Set (ℚ × ℚ), A ∪ B = ⊤ ∧ A ∩ B = ∅ ∧ (∀ y : ℚ, {x | (x, y) ∈ A}.Finite) ∧ (∀ x : ℚ, {y | (x, y) ∈ B}.Finite) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-168887,"Let $a, b, c$ be positive integers satisfying the conditions $b > 2a$ and $c > 2b$. Prove that there exists a real number $\lambda$ such that the fractional parts of $\lambda a$, $\lambda b$, and $\lambda c$ all lie in the interval $\left(\frac{1}{3}, \frac{2}{3}\right]$.","import Mathlib theorem qwen (a b c : ℕ) (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) (h1 : b > 2 * a) (h2 : c > 2 * b) : ∃ lambda : ℝ, (1 / 3 < (lambda * a) % 1 ∧ (lambda * a) % 1 ≤ 2 / 3) ∧ (1 / 3 < (lambda * b) % 1 ∧ (lambda * b) % 1 ≤ 2 / 3) ∧ (1 / 3 < (lambda * c) % 1 ∧ (lambda * c) % 1 ≤ 2 / 3) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-168974,"Prove that there exists at least one digit in the decimal representation of $ \sqrt[3]{3} $ that is not equal to $ 2 $ between the $ 1\,000\,000 $-th and the $ 3\,141\,592 $-th position after the decimal point.","import Mathlib theorem prove : ∃ n : ℕ, n ∈ Finset.Icc 1000000 3141592 ∧ (Nat.floor (10 ^ n * (3 : ℝ) ^ ((1 : ℝ) / 3))) % 10 ≠ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-169027,"An integer $x$ is defined as *nice* if it can be expressed as the sum of five nonzero squares. A set $L(x, n) = \{x + 1, x + 2, \ldots, x + n\}$ is termed *beautiful* if every element $x + i$ is nice for all $1 \le i \le n$. Prove that there exist infinitely many *beautiful* sets $L(x, 23)$.","import Mathlib def isNice (x : ℤ) := ∃ a b c d e : ℤ, x = a^2 + b^2 + c^2 + d^2 + e^2 ∧ a ≠ 0 ∧ b ≠ 0 ∧ c ≠ 0 ∧ d ≠ 0 ∧ e ≠ 0 def L (x : ℤ) (n : ℕ) := Finset.Icc (x + 1) (x + n) def isBeautiful (L : Finset ℤ) := ∀ x ∈ L, isNice x theorem proveInfiniteBeautiful : ∀ N : ℕ, ∃ x : ℤ, x > N ∧ isBeautiful (L x 23) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-169111,"Let $A$ be a measurable set with positive measure. Prove that the set $A - A = \{x - y : x, y \in A\}$ contains an open neighborhood of $0$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MeasureTheory.volume {A : Set ℝ} (hA : A ≠ ∅) (hMeasure : 0 < (MeasureTheory.volume A).toReal) : ∃ U : Set ℝ, IsOpen U ∧ U ⊆ {x | ∃ a b, x = a - b ∧ a ∈ A ∧ b ∈ A} ∧ 0 ∈ U := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-169169,"Let $A$ be an $m \times n$ matrix $(m \neq n)$ with entries from the set $\{0, 1\}$. Suppose that for any injective function $f: \{1, 2, \cdots, m\} \longrightarrow \{1, 2, \cdots, n\}$, there exists at least one index $1 \leq i \leq m$ such that the element $a_{i, f(i)} = 0$. Prove that there exist subsets $S \subseteq \{1, 2, \cdots, m\}$ and $T \subseteq \{1, 2, \cdots, n\}$ such that: 1. If $i \in S$ and $j \in T$, then the element $a_{i, j} = 0$. 2. The cardinality of $S$ plus the cardinality of $T$ is greater than $n$, i.e., $|S| + |T| > n$.","import Mathlib theorem MatrixBijOn (m n : ℕ) (hm : 0 < m) (hn : 0 < n) (hmn : m ≠ n) (a : Fin m → Fin n → ℕ) (ha : ∀ i j, a i j = 0 ∨ a i j = 1) (h : ∀ f : Fin m → Fin n, Function.Injective f → ∃ i, a i (f i) = 0) : ∃ S : Finset (Fin m), ∃ T : Finset (Fin n), (∀ i ∈ S, ∀ j ∈ T, a i j = 0) ∧ (S.card + T.card > n) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-169181,"For any integer $n \geq 2$, prove that there exists a set $A_n$ of $n$ distinct positive integers such that for any two distinct elements $i, j \in A_n$, the condition $|i - j|$ divides $i^2 + j^2$ holds.","import Mathlib theorem algebra_594137 (n : ℕ) (hn : 2 ≤ n) : ∃ A : Finset ℕ, A.card = n ∧ (∀ i ∈ A, 0 < i) ∧ (∀ i ∈ A, ∀ j ∈ A, i ≠ j → |(i : ℤ) - j| ∣ i ^ 2 + j ^ 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-169432,"Prove that if more than $2n$ integers are selected from the set $\{1, 2, \ldots, 3n\}$, there will exist two integers $a$ and $b$ such that one of the numbers $ab + 1$ or $4ab + 1$ is a perfect square.","import Mathlib theorem prove (n : ℕ) (hn : 0 < n) (s : Finset ℕ) (h₀ : s ⊆ Finset.Icc 1 (3 * n)) (h₁ : s.card > 2 * n) : ∃ a ∈ s, ∃ b ∈ s, IsSquare (a * b + 1) ∨ IsSquare (4 * a * b + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-169478,"Let $m, n \in \mathbb{N}$ with $m > n \ge 1$, and let $A_1, A_2, \ldots, A_m \in \mathcal{M}_n(\mathbb{C})$ be matrices such that the matrix $\sum_{i=1}^m A_i$ is non-singular. Prove that there exists a subset $S \subseteq \{1, 2, \ldots, m\}$ with at most $n$ elements such that $\sum_{i \in S} A_i$ is non-singular.","import Mathlib open Finset Complex Matrix theorem MatrixSum (m n : ℕ) (hn : 1 ≤ n) (hm : m > n) (A : Fin m → Matrix (Fin n) (Fin n) ℂ) (hA : Nonempty (Invertible (∑ i : Fin m, A i))) : ∃ S : Finset (Fin m), S.card ≤ n ∧ Nonempty (Invertible (∑ i ∈ S, A i)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-169483,"Let $a_1 = 1$, $a_{2k} = 1 + a_k$, and $a_{2k+1} = \frac{1}{a_{2k}}$. Prove that every positive rational number appears exactly once in the sequence $\{a_n\}$.","import Mathlib theorem qwen (a : ℕ → ℚ) (ha1 : a 1 = 1) (hak : ∀ k, a (2 * k) = 1 + a k ∧ a (2 * k + 1) = 1 / a (2 * k)) : ∀ q > 0, ∃! n, a n = q := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-169673,"Prove that for every natural number $n \leq 2^{1\,000\,000}$, there exists a finite sequence of natural numbers $x_0, x_1, \dots, x_k$ with $k \leq 1\,100\,000$, such that $x_0 = 1$, $x_k = n$, and for all $i = 1, 2, \dots, k$, there exist $r, s$ with $0 \leq r \leq s < i$ such that $x_i = x_r + x_s$.","import Mathlib theorem prove (n : ℕ) (hn : n ≤ 2^1000000) : ∃ k : ℕ, k ≤ 1100000 ∧ ∃ x : ℕ → ℕ, x 0 = 1 ∧ x k = n ∧ ∀ i ∈ Finset.Icc 1 k, ∃ r s : ℕ, 0 ≤ r ∧ r ≤ s ∧ s < i ∧ x i = x r + x s := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-169698,"Let $\mathbb{N} = \{0, 1, 2, \ldots\}$ denote the set of natural numbers including zero. Consider a bijective function $f: \mathbb{N} \to \mathbb{N}$. Prove that there exist $(a, b, c) \in \mathbb{N}^3$ such that $a < b < c$ and $f(a) + f(c) = 2f(b)$.","import Mathlib theorem NatFunction (f : ℕ → ℕ) (hf : Function.Bijective f) : ∃ a b c : ℕ, a < b ∧ b < c ∧ f a + f c = 2 * f b := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-169707,"Let $X$ be a separable metric space, and let $f: X \to \mathbb{R}$ be a function such that $\lim_{x \to a} f(x)$ exists for every $a \in X$. Prove that the set of points in $X$ at which $f$ is not continuous is countable.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem countable {X : Type*} [MetricSpace X] [SeparableSpace X] (f : X → ℝ) (hf : ∀ a, ∃ L, Tendsto (λ x => f x) (𝓝 a) (𝓝 L)) : Set.Countable {x | ¬ ContinuousAt f x} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-169835,"For every prime number $p$, consider the set $S_{p} = \{n \mid n \in \mathbb{N}, p \mid 2^{n} - n\}$. Prove that the cardinality of $S_{p}$ is infinite, i.e., $|S_{p}| = \infty$.","import Mathlib open Set Real open scoped BigOperators theorem S : ∀ (p : ℕ), Nat.Prime p → Infinite {n | p ∣ (2^n - n)} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-169864,"For each integer $n \geq 2$, prove that there exists a set $S$ of $n$ integers such that for all distinct $a, b \in S$, the product $ab$ is divisible by $(a - b)^2$.","import Mathlib theorem number_theory_468371 (n : ℕ) (hn : 2 ≤ n) : ∃ S : Finset ℤ, S.card = n ∧ ∀ a ∈ S, ∀ b ∈ S, a ≠ b → (a * b) % ((a - b) ^ 2) = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-169874,"Let $p$ be a prime number, and let $m, n, k$ be positive integers. Consider subsets $A_{1}, A_{2}, \ldots, A_{m}$ of the set $\{1, 2, \ldots, n\}$ such that: 1. $p^{k}$ does not divide $|A_{i}|$ for any $i \in \{1, 2, \ldots, m\}$. 2. $p^{k}$ divides $|A_{i} \cap A_{j}|$ for all $i \neq j$. Prove that $m \leq n$.","import Mathlib theorem qwen (p : ℕ) (hp : Nat.Prime p) (m n k : ℕ) (hm : 0 < m) (hn : 0 < n) (hk : 0 < k) (A : Fin m → Finset ℕ) (hA : ∀ i, A i ⊆ Finset.Icc 1 n) (hA1 : ∀ i, ¬p^k ∣ (A i).card) (hA2 : ∀ i j, i ≠ j → p^k ∣ (A i ∩ A j).card) : m ≤ n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-169875,"Let $S$ be a set of $43$ distinct positive integers, each not exceeding $100$. For each subset $X$ of $S$, let $t_X$ denote the product of the elements in $X$. Prove that there exist two disjoint subsets $A$ and $B$ of $S$ such that $t_A t_B^2$ is the cube of a positive integer.","import Mathlib theorem dist (s : Finset ℕ) (hs : s.card = 43) (hpos : ∀ x ∈ s, x > 0) (hbound : ∀ x ∈ s, x ≤ 100) (t : Finset ℕ → ℕ) (ht : ∀ x, t x = ∏ y ∈ x, y) : ∃ A B : Finset ℕ, A ⊆ s ∧ B ⊆ s ∧ A ∩ B = ∅ ∧ ∃ k : ℕ, 0 < k ∧ t A * t B ^ 2 = k ^ 3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-169892,"Prove that there does not exist a bijective function $f : \mathbb{N} \rightarrow \mathbb{N}_0$ such that $f(mn) = f(m) + f(n) + 3f(m)f(n)$ for all $m, n \in \mathbb{N}$. Here, $\mathbb{N}$ denotes the set of positive integers and $\mathbb{N}_0$ denotes the set of non-negative integers.","import Mathlib theorem no_bijective_f : ¬∃ f : ℕ+ → ℕ, Function.Bijective f ∧ ∀ m n, f (m * n) = f m + f n + 3 * f m * f n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-169905,"Prove that for every $n \in \mathbb{N}$, there exists a subset $S \subseteq \{ n^{2}+1, n^{2}+2, \ldots, (n+1)^{2}\}$ such that the product of the elements in $S$ is twice a perfect square, i.e., $\prod_{x \in S}x = 2m^{2}$ for some $m \in \mathbb{N}$.","import Mathlib theorem sample (n : ℕ) : ∃(R : Finset ℕ), R ⊆ Finset.Icc (n^2 + 1) ((n + 1)^2) ∧ ∃ m : ℕ, ∏ x ∈ R, x = 2 * m^2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-170057,"For each $n \in \mathbb{Z}_+$, prove that there exists a set $X = \{x_1, x_2, \ldots, x_n\} \subset \mathbb{R}$ such that for all triples $(x, y, z) \in X$ (where $x, y, z$ are pairwise distinct), the following condition holds: \[ |x - y| > \left(1 + \frac{1}{n^{1.6}}\right) |x - z| \quad \text{or} \quad |x - z| > \left(1 + \frac{1}{n^{1.6}}\right) |x - y|. \]","import Mathlib open Real Set open scoped BigOperators theorem for_n (n : ℕ) (hn : 0 < n) : ∃ X : Finset ℝ, X.card = n ∧ ∀ x ∈ X, ∀ y ∈ X, ∀ z ∈ X, x ≠ y ∧ y ≠ z ∧ z ≠ x → abs (x - y) > (1 + 1 / (n ^ (1.6 : ℝ))) * abs (x - z) ∨ abs (x - z) > (1 + 1 / (n ^ (1.6 : ℝ))) * abs (x - y) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-170593,"Let $T$ be a finite set of positive integers greater than 1. A subset $S$ of $T$ is called [i]good[/i] if for every $t \in T$ there exists some $s \in S$ such that $\gcd(s, t) > 1$. Prove that the number of good subsets of $T$ is odd.","import Mathlib theorem OddGood {T : Finset ℕ} (hT : ∀ t ∈ T, t > 1) : Odd {S : Finset ℕ | S ⊆ T ∧ (∀ t ∈ T, ∃ s ∈ S, Nat.gcd s t > 1)}.ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-170665,"Prove that for any positive integer $n$, \[ \sum_{i=1}^{n}(-1)^{n+i}\binom{n}{i}\binom{ni}{n}=n^n. \]","import Mathlib theorem algebra.BigOperators.Group.Finset (n : ℕ) (hn : 0 < n) : ∑ i ∈ Finset.Icc 1 n, (-1 : ℤ)^(n + i) * Nat.choose n i * Nat.choose (n * i) n = n^n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-170734,"Let $A$ be a finite set of positive integers such that $A$ contains at least $2$ elements. Given that for any $x, y \in A$ with $x \neq y$, the expression $\frac{x+y}{\gcd(x,y)}$ is also an element of $A$. Prove that $A$ has exactly $2$ elements.","import Mathlib theorem Qwen (A : Finset ℕ) (hA : ∀ x ∈ A, 0 < x) (hA1 : A.card ≥ 2) (hA2 : ∀ x ∈ A, ∀ y ∈ A, x ≠ y → (x + y) / Nat.gcd x y ∈ A) : A.card = 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-171577,"Let $A$ be a ring with the property that for all $x, y, z \in A^*$, the following equation holds: \[ x^2 + y^2 + z^2 = xy + yz + zx + xyz + 1 \] Show that $A$ is a field and determine the cardinality of $A$, denoted by $\text{card}(A)$.","import Mathlib theorem algebra {A : Type*} [Ring A] (hA : ∀ x y z : A, x ≠ 0 → y ≠ 0 → z ≠ 0 → x ^ 2 + y ^ 2 + z ^ 2 = x * y + y * z + z * x + x * y * z + 1) : IsField A ∧ (Nat.card A = 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-171668,"Let $M > 1$ be a natural number. Tom and Jerry play a game where Jerry wins if he can produce a function $f: \mathbb{N} \rightarrow \mathbb{N}$ satisfying the following conditions: 1. $f(M) \ne M$, 2. $f(k) < 2k$ for all $k \in \mathbb{N}$, 3. $f^{f(n)}(n) = n$ for all $n \in \mathbb{N}$, where for each $\ell > 0$, $f^{\ell}(n) = f(f^{\ell-1}(n))$ and $f^0(n) = n$. Tom wins otherwise. Prove that there are infinitely many values of $M$ for which Tom wins, and infinitely many values of $M$ for which Jerry wins.","import Mathlib open Finset theorem infinite_tom_infinite_jerry : {M : ℕ | 1 < M ∧ ¬∃ f : ℕ → ℕ, f M ≠ M ∧ (∀ k, f k < 2 * k) ∧ (∀ n, f^[f n] n = n)}.Infinite ∧ {M : ℕ | 1 < M ∧ ∃ f : ℕ → ℕ, f M ≠ M ∧ (∀ k, f k < 2 * k) ∧ (∀ n, f^[f n] n = n)}.Infinite := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-171775,A number $t > 1$ is defined as special if there exists a number $k > 0$ such that the distance between $k \cdot t^n$ and the nearest integer approaches $0$ as $n$ approaches infinity. Prove that the set of special numbers is infinite and at most countable.,"import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Infinite_special : Set.Infinite {t : ℝ | 1 < t ∧ ∃ k : ℕ, 0 < k ∧ Tendsto (λ n => |(k * t ^ n) - round ((k * t ^ n))|) atTop (𝓝 0)} ∧ Set.Countable {t : ℝ | 1 < t ∧ ∃ k : ℕ, 0 < k ∧ Tendsto (λ n => |(k * t ^ n) - round ((k * t ^ n))|) atTop (𝓝 0)} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-171842,"Let $\alpha \in (0,1)$. Prove that there exists $x \in (0,1)$ such that $\alpha^n < \{nx\}$ for all $n \in \mathbb{N}$.","import Mathlib theorem Qwen (α : ℝ) (hα : α ∈ Set.Ioo 0 1) : ∃ x : ℝ, x ∈ Set.Ioo 0 1 ∧ ∀ n : ℕ, α ^ n < n * x % 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-172551,"Let $M = \{1, 2, \ldots, n\}$, and each element of $M$ is colored either red, blue, or yellow. Define the sets: \[ A = \{(x, y, z) \in M \times M \times M \mid x + y + z \equiv 0 \pmod{n}, \text{ and } x, y, z \text{ are of the same color} \}, \] \[ B = \{(x, y, z) \in M \times M \times M \mid x + y + z \equiv 0 \pmod{n}, \text{ and } x, y, z \text{ are of pairwise distinct colors} \}. \] Prove that $2|A| \geq |B|$.","import Mathlib theorem algebraic_coloring {n : ℕ} (hn : 0 < n) (M : Finset ℕ) (hM : M = Finset.Icc 1 n) (red blue yellow : Finset ℕ) (hred : red ⊆ M) (hblue : blue ⊆ M) (hyellow : yellow ⊆ M) (hM1 : M = red ∪ blue ∪ yellow) : 2 * {(x, y, z) : ℕ × ℕ × ℕ | x ∈ M ∧ y ∈ M ∧ z ∈ M ∧ x + y + z ≡ 0 [MOD n] ∧ (x ∈ red ∧ y ∈ red ∧ z ∈ red) ∨ (x ∈ blue ∧ y ∈ blue ∧ z ∈ blue) ∨ (x ∈ yellow ∧ y ∈ yellow ∧ z ∈ yellow)}.ncard ≥ {(x, y, z) : ℕ × ℕ × ℕ | x ∈ M ∧ y ∈ M ∧ z ∈ M ∧ x + y + z ≡ 0 [MOD n] ∧ (x ∈ red ∧ y ∈ blue ∧ z ∈ yellow) ∨ (x ∈ blue ∧ y ∈ red ∧ z ∈ yellow) ∨ (x ∈ yellow ∧ y ∈ red ∧ z ∈ blue)}.ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-172632,"Prove that if $S \subseteq \mathbb{R}^{n}$ is an uncountable set, then there exists a point $x \in S$ such that $x$ is a condensation point of $S$. That is, every neighborhood of $x$ contains uncountably many elements of $S$. Consider the approach of using the separability of $\mathbb{R}^{n}$ or the property of $\sigma$-compactness in your proof.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem uncountable {n : ℕ} (hn : 0 < n) (S : Set (EuclideanSpace ℝ (Fin n))) (hS : ¬ Set.Countable S) : ∃ x ∈ S, ∀ U : Set (EuclideanSpace ℝ (Fin n)), IsOpen U ∧ x ∈ U → Set.Nonempty (S ∩ U) ∧ ¬ Set.Countable (S ∩ U) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-173260,"Let $p$ be a prime number such that $p \geq 5$. Prove the following: 1. $\binom{2p}{p} \equiv 2 \pmod{p^3}$ 2. $(-1)^{\frac{p-1}{2}}\binom{p-1}{\frac{p-1}{2}} \equiv 4^{p-1} \pmod{p^3}$","import Mathlib theorem Nat.choose_eq (p : ℕ) (hp : Nat.Prime p) (h : 5 ≤ p) : Nat.choose (2 * p) p ≡ 2 [MOD p ^ 3] ∧ (-1 : ℤ) ^ ((p - 1) / 2) * Nat.choose (p - 1) ((p - 1) / 2) ≡ 4 ^ (p - 1) [ZMOD p ^ 3] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-176672,"Let $A$ and $B$ be sets with $|A| = 2011^2$ and $|B| = 2010$, respectively. Prove that there exists a function $f: A \times A \to B$ such that $f(x, y) = f(y, x)$ for all $(x, y) \in A \times A$, and for every function $g: A \to B$, there exist distinct elements $a_1, a_2 \in A$ such that $g(a_1) = f(a_1, a_2) = g(a_2)$.","import Mathlib theorem algebra_436567 {A B : Type*} [Fintype A] [Fintype B] (hA : Fintype.card A = 2011 ^ 2) (hB : Fintype.card B = 2010) : ∃ f : A → A → B, (∀ x y, f x y = f y x) ∧ (∀ g : A → B, ∃ a1 a2, a1 ≠ a2 ∧ g a1 = f a1 a2 ∧ f a1 a2 = g a2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-176740,"Prove that for an odd integer $p$, the binomial coefficient $\left(\begin{array}{c}2p-1\\p-1\end{array}\right)$ is congruent to $1$ modulo $p^2$ if and only if $p$ is a prime number.","import Mathlib open Nat theorem OddP : ∀ p : ℕ, Odd p → (p ^ 2 ∣ Nat.choose (2 * p - 1) (p - 1) - 1) ↔ Nat.Prime p := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-176931,"Let $E$ be the set of numbers of the form $2^{a}3^{b}$, where $a$ and $b$ are non-negative integers. A positive integer $n$ is defined as [i]appalling[/i] if it can be expressed as the sum of elements from $E$ such that for any two terms in the sum, one term does not divide the other. a) Prove that every positive integer $n$ is [i]appalling[/i]. b) Prove that for any positive integer $k$, there exists a positive integer $n$ that can be written in $k$ distinct ways in the form described above.","import Mathlib open Finset def E : Set ℕ := {x | ∃ a b : ℕ, x = 2 ^ a * 3 ^ b} def is_appalling (n : ℕ) : Prop := ∃ s : Finset ℕ, (∀ m ∈ s, m ∈ E) ∧ n = ∑ m ∈ s, m ∧ ∀ m ∈ s, ∀ n ∈ s, m ≠ n → ¬(m ∣ n) theorem prove_a : ∀ n > 0, is_appalling n := by sorry theorem prove_b : ∀ k > 0, ∃ n > 0, {s : Finset ℕ | (∀ m ∈ s, m ∈ E) ∧ n = ∑ m ∈ s, m ∧ ∀ m ∈ s, ∀ n ∈ s, m ≠ n → ¬(m ∣ n)}.ncard = k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-177028,"Let $q$ be an irrational number. Prove that the set $\{m + nq \mid m, n \in \mathbb{Z}\}$ is dense in $\mathbb{R}$. Here, $\mathbb{Z}$ denotes the set of integers, and $\mathbb{R}$ denotes the set of real numbers.","import Mathlib theorem DenseSet (q : ℝ) (hq : Irrational q) : Dense {x | ∃ m n : ℤ, x = m + n * q} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-177783,"Let $p > 3$ be a prime number, and let $m = \left\lfloor \frac{2p}{3} \right\rfloor$ (where $\left\lfloor x \right\rfloor$ denotes the greatest integer less than or equal to $x$). Prove that the sum of binomial coefficients $C(p,1) + C(p,2) + \cdots + C(p,m)$ is divisible by $p^2$.","import Mathlib theorem PrimeSum {p : ℕ} (hp : Nat.Prime p) (hp1 : p > 3) (m : ℕ) (hm : m = ⌊(2 * p / 3 : ℝ)⌋) : p ^ 2 ∣ ∑ i ∈ Finset.Icc 1 m, Nat.choose p i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-178000,"Let $n$ be a positive integer. Prove that there exists a positive integer $N$ such that for any subset $A$ of $\{1, 2, \ldots, N\}$ with $|A| \geq \frac{N}{2}$, there is a positive integer $m$ with $m \leq N - n$ such that $|A \cap \{m + 1, m + 2, \ldots, m + k\}| \geq \frac{k}{2}$ for all $k \in \{1, 2, \ldots, n\}$.","import Mathlib theorem exist (n : ℕ) (_pos : n > 0) : ∃ N : ℕ, N > 0 ∧ ∀ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ A.card ≥ N / 2 → ∃ m : ℕ, m ≤ N - n ∧ ∀ k ∈ Finset.Icc 1 n, (A ∩ Finset.Icc (m + 1) (m + k)).card ≥ k / 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-178695,"Let $p > 2007$ be a prime number, and let $n$ be an integer such that $n > 2006p$. Prove that $\binom{n}{2006p} - \binom{k}{2006}$ is a multiple of $p$, where $k = \left\lfloor \frac{n}{p} \right\rfloor$ is the largest integer not greater than $\frac{n}{p}$.","import Mathlib theorem pNat.choose (p n : ℕ) (hp : Nat.Prime p) (hn : n > 2006 * p) (hpn : p > 2007) : p ∣ Nat.choose n (2006 * p) - Nat.choose ⌊(n / p : ℝ)⌋₊ 2006 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-178697,"Let $a_j$, $b_j$, $c_j$ be integers for $1 \le j \le N$. Assume that for each $j$, at least one of $a_j$, $b_j$, $c_j$ is odd. Prove that there exist integers $r, s, t$ such that $ra_j + sb_j + tc_j$ is odd for at least $\frac{4N}{7}$ values of $j$, where $1 \le j \le N$.","import Mathlib theorem OddSum (N : ℕ) (hN : 0 < N) (a b c : Fin N → ℤ) (hodd : ∀ i, Odd (a i) ∨ Odd (b i) ∨ Odd (c i)) : ∃ r s t, {i | Odd (r * a i + s * b i + t * c i)}.ncard ≥ (4 * N / 7 : ℝ) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-178711,"1) Prove that for all real numbers $x_1, x_2, \ldots, x_n$, the following inequality holds: \[ \sum_{i=1}^n \sum_{j=1}^n ij \cos{(x_i - x_j)} \geq 0. \] 2) Consider a triangle $ABC$ and its circumcircle $K$. Let $k_1, k_2, k_3$ be circles that are internally tangent to $K$ at points $A_1, B_1, C_1$ and to the sides $BC, CA, AB$ at points $A_2, B_2, C_2$, respectively, such that $A$ and $A_1$ are in different half-planes with respect to $BC$, $B$ and $B_1$ are in different half-planes with respect to $CA$, and $C$ and $C_1$ are in different half-planes with respect to $AB$. If the lines $A_1A_2, B_1B_2, C_1C_2$ intersect $K$ again at points $A', B', C'$, determine the angles of triangle $A'B'C'$ in terms of the angles of triangle $ABC$. 3) In a country with 2 airlines, 6 cities are connected in pairs by round-trip flights operated by exactly one of the two airlines. Prove that there exist 4 cities $A, B, C, D$ such that each of the routes $A \leftrightarrow B$, $B \leftrightarrow C$, $C \leftrightarrow D$, and $D \leftrightarrow A$ is operated by the same airline. 4) Let $n$ be an integer, $n \geq 2$. Find all sets $A$ of $n$ integers such that the sum of the elements of any non-empty subset of $A$ is not divisible by $n + 1$.","import Mathlib open Real Set open scoped BigOperators theorem inequalities (n : ℕ) (hn : 0 < n) (x : Fin n → ℝ) : ∑ i : Fin n, ∑ j : Fin n, (i+1)*(j+1) * cos (x i - x j) ≥ 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-178716,"Let $n > 1$ be an integer, and let $S \subset \{0, 1, 2, \ldots, n-1\}$ be a subset such that $|S| > \frac{3}{4} n$. Prove that there exist integers $a, b, c$ such that the remainders of the numbers $a, b, c, a+b, b+c, c+a, a+b+c$ when divided by $n$ all belong to $S$.","import Mathlib theorem qwen (n : ℕ) (hn : 1 < n) (S : Finset ℕ) (hS : S ⊆ Finset.Icc 0 (n - 1)) (hS1 : S.card > (3 / 4 : ℝ) * n) : ∃ a b c, (a % n) ∈ S ∧ (b % n) ∈ S ∧ (c % n) ∈ S ∧ ((a + b) % n) ∈ S ∧ ((b + c) % n) ∈ S ∧ ((c + a) % n) ∈ S ∧ ((a + b + c) % n) ∈ S := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-178823,"Given a graph \(G=(V, E)\) with \(|V| = 200\) vertices, where each vertex represents a deputy, and an edge \((u, v)\in E\) indicates that the deputies corresponding to vertices \(u\) and \(v\) have not fought each other. Suppose that for any two vertices \(u, v\in V\) such that \((u, v)\in E\), for all \(w\in V\setminus\{u, v\}\), either \((w, u)\in E\) and \((w, v)\in E\) or \((w, u) otin E\) and \((w, v) otin E\). Prove that there exists a subset \(S\subseteq V\) with \(|S| = 15\) such that either for all \(u, v\in S\), \((u, v)\in E\) or for all \(u, v\in S\), \((u, v) otin E\).","import Mathlib theorem graph_theory {V : Type*} [Fintype V] (hV : Fintype.card V = 200) (E : Set (V × V)) (hE : ∀ u v : V, (u, v) ∈ E → ∀ w : V, w ≠ u ∧ w ≠ v → ((w, u) ∈ E ∧ (w, v) ∈ E) ∨ ((w, u) ∉ E ∧ (w, v) ∉ E)) : ∃ S : Finset V, S.card = 15 ∧ (∀ u ∈ S, ∀ v ∈ S, (u, v) ∈ E) ∨ (∀ u ∈ S, ∀ v ∈ S, (u, v) ∉ E) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-178966,"Prove that the number of functions $f \colon \mathbb{Z} \to \{1,2,3,\ldots,228\}$ that satisfy the following conditions: 1. $f(0) = 1$, 2. $229 \mid f(a+b) - f(a)f(b)$ for all integers $a$ and $b$, 3. $f(c+16d) = f(c)$ for all integers $c$ and $d$ is equal to \(4\).","import Mathlib theorem number_of_f : {f : ℤ → ℕ | ∀ x, f x ∈ Finset.Icc 1 228 ∧ f 0 = 1 ∧ ∀ a b, 229 ∣ f (a + b) - f a * f b ∧ ∀ c d, f (c + 16 * d) = f c}.ncard = 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-179058,"Prove that if $A$, $B$, $C$, and $D$ are four sequences of integers satisfying $A \sim B$, $B \sim C$, and $C \sim D$, then $D \sim A$, where a function $f: \mathbb{Z}_{\ge 0} \times \mathbb{Z}_{\ge 0} \to \mathbb{Z}$ is called [i]great[/i] if for any nonnegative integers $m$ and $n$, \[ f(m + 1, n + 1) f(m, n) - f(m + 1, n) f(m, n + 1) = 1, \] and for two sequences of integers $A = (a_0, a_1, \dots)$ and $B = (b_0, b_1, \dots)$, we write $A \sim B$ if there exists a great function $f$ such that $f(n, 0) = a_n$ and $f(0, n) = b_n$ for every nonnegative integer $n$ (in particular, $a_0 = b_0$).","import Mathlib open Finset theorem prove_sequenceSimilarity {A B C D : ℕ → ℤ} (hAB : ∃ f : ℕ → ℕ → ℤ, (∀ m n, f (m + 1) (n + 1) * f m n - f (m + 1) n * f m (n + 1) = 1) ∧ ∀ n, f n 0 = A n ∧ f 0 n = B n) (hBC : ∃ f : ℕ → ℕ → ℤ, (∀ m n, f (m + 1) (n + 1) * f m n - f (m + 1) n * f m (n + 1) = 1) ∧ ∀ n, f n 0 = B n ∧ f 0 n = C n) (hCD : ∃ f : ℕ → ℕ → ℤ, (∀ m n, f (m + 1) (n + 1) * f m n - f (m + 1) n * f m (n + 1) = 1) ∧ ∀ n, f n 0 = C n ∧ f 0 n = D n) : ∃ f : ℕ → ℕ → ℤ, (∀ m n, f (m + 1) (n + 1) * f m n - f (m + 1) n * f m (n + 1) = 1) ∧ ∀ n, f n 0 = D n ∧ f 0 n = A n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-179060,"Let $f: \mathbb{Z}_{\ge 0} \times \mathbb{Z}_{\ge 0} \to \mathbb{Z}$ be a function. We say that $f$ is [i]great[/i] if for any nonnegative integers $m$ and $n$, \[ f(m + 1, n + 1) f(m, n) - f(m + 1, n) f(m, n + 1) = 1. \] Given two sequences of integers $A = (a_0, a_1, \dots)$ and $B = (b_0, b_1, \dots)$, we write $A \sim B$ if there exists a great function $f$ such that $f(n, 0) = a_n$ and $f(0, n) = b_n$ for every nonnegative integer $n$ (in particular, $a_0 = b_0$). Prove that if $A$, $B$, $C$, and $D$ are four sequences of integers satisfying $A \sim B$, $B \sim C$, and $C \sim D$, then $D \sim A$.","import Mathlib def isGreatest (f : ℕ → ℕ → ℤ) : Prop := ∀ m n, f (m + 1) (n + 1) * f m n - f (m + 1) n * f m (n + 1) = 1 def sim (A B : ℕ → ℤ) : Prop := ∃ f, isGreatest f ∧ ∀ n, f n 0 = A n ∧ f 0 n = B n theorem proveChaining (A B C D : ℕ → ℤ) (hAB : sim A B) (hBC : sim B C) (hCD : sim C D) : sim D A := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-179126,"Prove that the sum \(S\) of the series \(S = \frac{3}{2} + \sum_{k=0}^{\infty} (-1)^{k+1} \frac{1}{(k+2)4^{k+1}} \binom{2k+1}{k}\) is equal to \(\sqrt{2}\), i.e., prove that \[ \frac{3}{2} + \sum_{k=0}^{\infty} (-1)^{k+1} \frac{1}{(k+2)4^{k+1}} \binom{2k+1}{k} = \sqrt{2}. \]","import Mathlib open Real theorem sum_series : ∑' k : ℕ, (-(1 : ℝ))^(k + 1) * (1 / ((k + 2) * 4^(k + 1) * Nat.choose (2*k + 1) k)) = sqrt 2 - 3/2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-179139,"Let $k$ be a positive integer. Consider a set $S$ and some of its $2k$-element subsets are marked. Suppose that for any subset $T$ of $S$ with $|T| \leq (k+1)^2$, all the marked subsets contained in $T$ (if any) share a common element. Prove that all the marked subsets of $S$ have a common element.","import Mathlib theorem marked_subset_common_element {k : ℕ} (hk : 0 < k) (S : Finset ℕ) (marked : Finset (Finset ℕ)) (hmarked : ∀ T ∈ marked, T ⊆ S ∧ T.card = 2 * k) (h : ∀ T : Finset ℕ, T ⊆ S ∧ T.card ≤ (k + 1)^2 → ∃ x, ∀ U ∈ marked, U ⊆ T → x ∈ U) : ∃ x, ∀ T ∈ marked, x ∈ T := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-179302,"Given a set \(S\) of \(n\) points in the plane, prove that there exists a subset of at least \(\sqrt{n}\) points in \(S\) such that no three points in this subset are vertices of an equilateral triangle.","import Mathlib open Real Set open scoped BigOperators theorem point_set (n : ℕ) (f : Fin n → (EuclideanSpace ℝ (Fin 2))) : ∃ t : Finset (Fin n), t.card ≥ sqrt n ∧ ∀ i ∈ t, ∀ j ∈ t, ∀ k ∈ t, i ≠ j ∧ i ≠ k ∧ j ≠ k → ¬(dist (f i) (f j) = dist (f j) (f k) ∧ dist (f j) (f k) = dist (f i) (f j)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-179318,"Let $n \ge 0$ be an integer. A sequence of integers $a_0, a_1, a_2, \ldots$ is defined as follows: $a_0 = n$, and for $k \ge 1$, $a_k$ is the smallest integer greater than $a_{k - 1}$ such that $a_k + a_{k - 1}$ is a perfect square. Prove that there are exactly $\lfloor \sqrt{2n} \rfloor$ positive integers that cannot be expressed in the form $a_k - a_{\ell}$ with $k > \ell \ge 0$.","import Mathlib open Real theorem number_theory_96947 (n : ℕ) (a : ℕ → ℕ) (ha₀ : a 0 = n) (ha₁ : ∀ k ≥ 1, IsLeast {x | x > a (k - 1) ∧ ∃ m, m^2 = x + a (k - 1)} (a k)) : Set.ncard {m | 0 < m ∧ ¬∃ k l, k > l ∧ l ≥ 0 ∧ a k - a l = m} = ⌊Real.sqrt (2 * n)⌋ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-179519,"Let $n \ge 3$ be an integer, and let $a_1, a_2, \ldots, a_n$ be $n$ distinct positive real numbers. Prove that there are at most $n - 2$ different integer powers of three that can be written as the sum of three distinct elements from the set $\{a_1, a_2, \ldots, a_n\}$.","import Mathlib theorem number_theory_8479 : ∀ (n : ℕ), n ≥ 3 → ∀ (a : Fin n → ℝ), (∀ i j, a i = a j → i = j) ∧ (∀ i, 0 < a i) → Set.ncard {k : ℕ | ∃ s : Finset (Fin n), s.card = 3 ∧ ∑ i ∈ s, a i = 3 ^ k} ≤ n - 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-179531,"Let \(n \geq 2\) be an integer, and let \(X\) be a set with \(n\) elements. Consider subsets \(A_1, A_2, \ldots, A_{101}\) of \(X\) such that the union of any 50 of these subsets has more than \(\frac{50n}{51}\) elements. Prove that there exist three of these subsets, say \(A_i, A_j, A_k\), such that the intersection of any two of them is non-empty.","import Mathlib theorem algebra_463258 (n : ℕ) (hn : n ≥ 2) (X : Type*) [Fintype X] (hX : Fintype.card X = n) (A : Fin 101 → Set X) (hA : ∀ s : Finset (Fin 101), s.card = 50 → (⋃ i ∈ s, A i).ncard > 50 * n / 51) : ∃ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k ∧ A i ∩ A j ≠ ∅ ∧ A j ∩ A k ≠ ∅ ∧ A i ∩ A k ≠ ∅ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-179532,"Prove that for any configuration of \(2017\) distinct points in the plane, the minimum number of distinct mid - points of the segments joining each pair of these points is \(4031\).","import Mathlib open Real open scoped BigOperators theorem min_mid_points (S : Finset (ℝ × ℝ)) (hS : S.card = 2017) : {x | ∃ p q : ℝ × ℝ, p ∈ S ∧ q ∈ S ∧ x = ((p.1 + q.1)/2, (p.2 + q.2)/2)}.ncard ≥ 4031 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-179556,"Given that each of \(n = 2020\) scientists corresponds with all the others, and they correspond about only five topics, with any two scientists treating exactly one topic, prove that there are at least two different groups of three scientists who correspond with each other about the same topic.","import Mathlib theorem qwen (n : ℕ) (hn : n = 2020) (a : Fin n → Fin n → Fin 5) (ha : ∀ i j, a i j = a j i) : ∃ s1 s2 : Finset (Fin n), s1 ≠ s2 ∧ s1.card = 3 ∧ s2.card = 3 ∧ ∃ x, ∀ i ∈ s1, ∀ j ∈ s1, a i j = x ∧ ∃ y, ∀ i ∈ s2, ∀ j ∈ s2, a i j = y := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-179574,Prove that there exists a permutation $\sigma$ of the set of natural numbers $\mathbb{N}$ such that the series \(\sum_{n \in \mathbb{N}} \frac{1}{n + \sigma(n)}\) converges.,"import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem exist_bij : ∃ σ : ℕ → ℕ, Function.Bijective σ ∧ Summable (λ n => (1 / (n + σ n) : ℝ)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-180124,"1. Prove or disprove that the series $\sum\limits_{n = 1}^{\infty} \frac{1}{nf(n)}$ converges for any bijection $f: \mathbb{N} \to \mathbb{N}$. 2. Prove that there exists a bijection $f: \mathbb{N} \to \mathbb{N}$ such that the series $\sum\limits_{n = 1}^{\infty} \frac{1}{n + f(n)}$ converges.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Prove : (∀ f : ℕ → ℕ, Function.Bijective f → Summable (λ n => 1 / (n * f n))) ∧ ∃ f : ℕ → ℕ, Function.Bijective f ∧ Summable (λ n => 1 / (n + f n)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-180420,"Prove that the pairs of positive integers $(m, n)$ for which there exists a bijective function $f : \mathbb{Z}_m \times \mathbb{Z}_n \to \mathbb{Z}_m \times \mathbb{Z}_n$ such that the vectors $f(\mathbf{v}) + \mathbf{v}$, as $\mathbf{v}$ runs through all of $\mathbb{Z}_m \times \mathbb{Z}_n$, are pairwise distinct (where for any integers $a$ and $b$, the vectors $[a, b]$, $[a + m, b]$, and $[a, b + n]$ are treated as equal) are precisely those for which $m$ and $n$ have the same parity.","import Mathlib theorem prove : {(m, n) : ℕ × ℕ | m > 0 ∧ n > 0 ∧ ∃ f : (ZMod m) × (ZMod n) → (ZMod m) × (ZMod n), Function.Bijective f ∧ ∀ v w : (ZMod m) × (ZMod n), v ≠ w → f v + v ≠ f w + w} = {(m, n) : ℕ × ℕ | m > 0 ∧ n > 0 ∧ m % 2 = n % 2} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-180464,"Prove that there exists a set $S$ containing $5783$ distinct real numbers such that for every pair of elements $a, b \in S$ (not necessarily distinct), there exist distinct elements $c, d \in S$ satisfying the equation $a \cdot b = c + d$.","import Mathlib theorem algebra_436031 : ∃ S : Finset ℝ, S.card = 5783 ∧ ∀ a ∈ S, ∀ b ∈ S, ∃ c ∈ S, ∃ d ∈ S, c ≠ d ∧ a * b = c + d := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-180519,"Prove that if \(n \ge 2r\), then \(\frac{\displaystyle\sum_{k=0}^r \binom{n}{k} \binom{n-2k}{r-k}}{\displaystyle\sum_{k=r}^n \binom{n}{k} \binom{2k}{2r}\left(\frac{3}{4}\right)^{n-k}\left(\frac{1}{2}\right)^{2k-2r}} = 1\).","import Mathlib open Finset Real Nat theorem prove {n r : ℕ} (hr : 0 < r) (h : n ≥ 2 * r) : (∑ k ∈ Icc 0 r, Nat.choose n k * Nat.choose (n - 2 * k) (r - k)) / (∑ k ∈ Icc r n, Nat.choose n k * Nat.choose (2 * k) (2 * r) * (3 / 4 : ℝ) ^ (n - k) * (1 / 2 : ℝ) ^ (2 * k - 2 * r)) = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-180527,"Prove that for a $2019 \times 2019$ board filled with numbers $1$ or $-1$ in each cell, there exists a positive integer $k$ such that one can select $k$ rows and $k$ columns so that $\left| \sum_{i,j} a_{ij} ight| > 1000$, where $a_{ij}$ are the numbers in the cells at the intersection of the selected rows and columns.","import Mathlib theorem prove (a : Fin 2019 → Fin 2019 → ℤ) (ha : ∀ i j, a i j = 1 ∨ a i j = -1) : ∃ k > 0, ∃ r s : Finset (Fin 2019), r.card = k ∧ s.card = k ∧ |∑ i ∈ r, ∑ j ∈ s, a i j| > 1000 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-180807,"Prove that given several vectors in the plane, the sum of whose lengths is $1$, it is possible to divide these vectors into $3$ groups (which may be empty) such that the sum of the lengths of the sum of the vectors in each group is at least $\frac{3 \sqrt{3}}{2 \pi}$.","import Mathlib open Real Set open scoped BigOperators theorem prove {n : ℕ} (hn : n > 0) (v : Fin n → EuclideanSpace ℝ (Fin 2)) (hsum : ∑ i : Fin n, ‖v i‖ = 1) : ∃ s1 s2 s3 : Finset (Fin n), s1 ∪ s2 ∪ s3 = Finset.univ ∧ s1 ∩ s2 = ∅ ∧ s2 ∩ s3 = ∅ ∧ s3 ∩ s1 = ∅ ∧ 3 * sqrt 3 / (2 * π) ≤ ‖∑ i ∈ s1, v i‖ + ‖∑ i ∈ s2, v i‖ + ‖∑ i ∈ s3, v i‖ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-180826,Let $S$ be a set of 1980 points in the plane such that the distance between every pair of points is at least 1. Prove that there exists a subset $T$ of $S$ containing 220 points such that the distance between every pair of points in $T$ is at least $\sqrt{3}$.,"import Mathlib open Real Set open scoped BigOperators theorem points_in_plane (S : Finset (EuclideanSpace ℝ (Fin 2))) (hS : S.card = 1980) (hS' : ∀ x ∈ S, ∀ y ∈ S, dist x y ≥ 1) : ∃ T ⊆ S, T.card = 220 ∧ (∀ x ∈ T, ∀ y ∈ T, dist x y ≥ sqrt 3) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-180827,"Let $n > 1$, and let $A_1, A_2, \ldots, A_{n+1}$ be non - empty subsets of $X = \{1, 2, \ldots, n\}$. Prove that there exist non - empty disjoint subsets $I$ and $J$ of $\{1, 2, \ldots, n+1\}$ such that $\bigcup_{i \in I} A_i = \bigcup_{i \in J} A_i$.","import Mathlib theorem qwen (n : ℕ) (hn : 1 < n) (A : Fin (n + 1) → Set ℕ) (hA : ∀ i, A i ⊆ Finset.Icc 1 n) (hA' : ∀ i, A i ≠ ∅) : ∃ I J : Finset (Fin (n + 1)), I ≠ ∅ ∧ J ≠ ∅ ∧ I ∩ J = ∅ ∧ ⋃ i ∈ I, A i = ⋃ i ∈ J, A i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-180853,"Let \(x_1, x_2, \ldots, x_n\) be real numbers satisfying \(x_1^2 + x_2^2 + \cdots + x_n^2 = 1\). Prove that for every integer \(k \geq 2\), there exist integers \(a_1, a_2, \ldots, a_n\), not all zero, such that: 1. \(|a_i| \leq k - 1\) for all \(i\), and 2. \(\left|a_1 x_1 + a_2 x_2 + \cdots + a_n x_n\right| \leq \frac{(k - 1) \sqrt{n}}{k^n - 1}\).","import Mathlib theorem RealSum (n : ℕ) (hn : 0 < n) (x : Fin n → ℝ) (h : ∑ i : Fin n, (x i)^2 = 1) : ∀ k ≥ 2, ∃ a : Fin n → ℤ, (∀ i : Fin n, |a i| ≤ k - 1) ∧ (∃ i : Fin n, a i ≠ 0) ∧ |∑ i : Fin n, a i * x i| ≤ ((k - 1) * Real.sqrt n) / (k^n - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-181053,"Prove that the sequence $\{a_n\}_{n \geq 1}$ of $0$s and $1$s defined recursively by $a_1 = 0$, $a_2 = 1$, and the rules - $a_{4n} = 1 - a_{n+1}$ - $a_{4n+2} = a_{n+2}$ - $a_{2n+1} = a_n$ for $n \in \mathbb{N}$ is not periodic.","import Mathlib open Finset theorem no_periodic_sequence {a : ℕ → ℕ} (ha1 : a 1 = 0) (ha2 : a 2 = 1) (han : ∀ n ≥ 1, a (4 * n) = 1 - a (n + 1)) (han' : ∀ n ≥ 1, a (4 * n + 2) = a (n + 2)) (han'' : ∀ n ≥ 1, a (2 * n + 1) = a n) : ¬ ∃ c, Function.Periodic a c := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-181073,"Prove that the set $\{n \mod \pi : n \in \mathbb{N}\}$ is dense in the interval $(0, \pi)$. Specifically, show that for any $\varepsilon > 0$ and any $x \in (0, \pi)$, there exists a natural number $n$ such that $|n \mod \pi - x| < \varepsilon$.","import Mathlib open Real theorem DenseSet : ∀ ε > 0, ∀ x ∈ Set.Ioo 0 Real.pi, ∃ n : ℕ, |(n % π) - x| < ε := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-181093,"Prove that for \(n\) distinct points on a plane, where the mid - point of each line segment \(A_iA_j\) (\(i\neq j\)) is colored red, the minimum number of distinct red points is \(2n - 3\).","import Mathlib open Real Set open scoped BigOperators theorem prove (n : ℕ) (hn : 0 < n) (f : Fin n → (ℝ × ℝ)) (h₀ : ∀ i j, f i = f j → i = j) : {x | ∃ i j, x = ((f i + f j) / 2) ∧ i ≠ j}.ncard ≥ 2 * n - 3 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-181557,"Prove that for any natural numbers \(0 \leq i_1 < i_2 < \cdots < i_k\) and \(0 \leq j_1 < j_2 < \cdots < j_k\), the matrix \(A=(a_{rs})_{1\leq r,s\leq k}\) where \(a_{rs}=\binom{i_r + j_s}{i_r}=\frac{(i_r + j_s)!}{i_r! \, j_s!}\) is nonsingular.","import Mathlib open Matrix Finset theorem Matrix_nonsingular {k : ℕ} (hk : 0 < k) (i j : Fin k → ℕ) (hi : StrictMono i) (hj : StrictMono j) : Nonempty (Invertible (fun r s => Nat.choose (i r + j s) (i r))) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-181606,"Let \(n\) and \(k\) be relatively prime positive integers with \(k < n\). Consider the set \(M = \{1, 2, 3, \ldots, n - 1\}\). Suppose that for each \(i \in M\), \(i\) and \(n - i\) have the same color, and for each \(i\neq k\) in \(M\), \(i\) and \(|i - k|\) have the same color. Prove that all numbers in \(M\) must have the same color.","import Mathlib theorem color_set {n : ℕ} (hn : 0 < n) (k : ℕ) (hk : 0 < k) (hkn : k < n) (hrel : Nat.Coprime n k) (M : Finset ℕ) (hM : M = Finset.Icc 1 (n - 1)) (hcolor : ∀ i ∈ M, (i % n) = (n - i) % n) (hcolor' : ∀ i ∈ M, i ≠ k → (i % n) = |(i : ℤ) - k| % n) : ∀ i ∈ M, (i % n) = (k % n) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-181841,"1. **Proof part**: - Prove that given \(997\) points in a plane, if every pair of points is connected by a line - segment and the mid - point of each segment is colored red, then there are at least \(1991\) distinct red points in the plane. 2. **Construction part**: - Demonstrate that there exists a configuration of \(997\) points in the plane such that when every pair of points is connected by a line segment and the mid - point of each segment is colored red, there are exactly \(1991\) distinct red points.","import Mathlib open Finset Real Complex Polynomial theorem proof_part (P : Fin 997 → (EuclideanSpace ℝ (Fin 2))) : {x | ∃ i j, i ≠ j ∧ x = midpoint ℝ (P i) (P j)}.ncard ≥ 1991 := by sorry theorem construction_part : ∃ P : Fin 997 → (EuclideanSpace ℝ (Fin 2)), {x | ∃ i j, i ≠ j ∧ x = midpoint ℝ (P i) (P j)}.encard = 1991 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-181883,"Prove that if $f: \mathbb{Z} \to \mathbb{Z}$ is a surjective function, then there exist surjective functions $g, h: \mathbb{Z} \to \mathbb{Z}$ such that $f(x) = g(x)h(x)$ for all $x \in \mathbb{Z}$.","import Mathlib theorem prove_surjective (f : ℤ → ℤ) (hf : Function.Surjective f) : ∃ g h : ℤ → ℤ, Function.Surjective g ∧ Function.Surjective h ∧ ∀ x : ℤ, f x = g x * h x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-181953,"Prove that for any positive integer \(k\), it is possible to select \(2^k\) distinct numbers from the set \(\{0, 1, 2, \ldots, 3^k - 1\}\) such that no three of the selected numbers form an arithmetic progression.","import Mathlib theorem forany (k : ℕ) (hk : 0 < k) : ∃ s : Finset ℕ, s.card = 2 ^ k ∧ ∀ x ∈ s, x ∈ Finset.Icc 0 (3 ^ k - 1) ∧ ∀ x ∈ s, ∀ y ∈ s, ∀ z ∈ s, x ≠ y ∧ y ≠ z ∧ z ≠ x → ¬∃ d : ℤ, y = x + d ∧ z = y + d := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-182064,"Prove that the set of all \(x \in \mathbb{N}\) such that \(x \in A\) and \(x \in B\), where \(A = \{a \mid a \in \mathbb{N}, a = c^2 + d^2 \text{ for some } c, d \in \mathbb{N}\}\) and \(B = \{b \mid b \in \mathbb{N}, b = x^3 + y^3 \text{ for some } x, y \in \mathbb{N}\}\), is \(C \cup \{(a^2 + b^2)^3 (u^3 + v^3)^4 \mid a, b, u, v \in \mathbb{N}\}\), where \(C = \{u \mid u \in \mathbb{N}, u = p^6 + q^6 \text{ for some } p, q \in \mathbb{N}\}\).","import Mathlib def A : Set ℕ := {a | ∃ c d : ℕ, a = c ^ 2 + d ^ 2} def B : Set ℕ := {b | ∃ x y : ℕ, b = x ^ 3 + y ^ 3} theorem prove : {x | x ∈ A ∧ x ∈ B} = {x | ∃ a b u v : ℕ, x = (a ^ 2 + b ^ 2) ^ 3 * (u ^ 3 + v ^ 3) ^ 4} ∪ {x | ∃ p q : ℕ, x = p ^ 6 + q ^ 6} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-182355,Let $f(n)$ denote the number of $1$s in the binary representation of $n$. Prove that there exists a sequence $(a_{i})_{i\geq 1}$ such that $\lim_{i\rightarrow \infty}\frac{f(a_{i}^{2})}{f(a_{i})}=0$.,"import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators def f : ℕ → ℕ | n => (Nat.digits 2 n).sum theorem prove : ∃ a : ℕ → ℕ, (∀ i, a i > 0) ∧ Tendsto (λ i => f (a i ^ 2) / f (a i)) atTop (𝓝 0) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-182716,"Prove that for a sequence of natural numbers \(x_1, x_2, \ldots, x_{241}\) with \(\sum_{i = 1}^{241}x_i=360\), it is always possible to partition these numbers into three disjoint sets \(A\), \(B\), and \(C\) such that \(\sum_{x\in A}x = \sum_{x\in B}x=\sum_{x\in C}x = 120\).","import Mathlib theorem prove (x : Fin 241 → ℕ) (h : ∑ i, x i = 360) : ∃ A B C : Finset (Fin 241), A ∪ B ∪ C = Finset.univ ∧ A ∩ B = ∅ ∧ B ∩ C = ∅ ∧ C ∩ A = ∅ ∧ ∑ i ∈ A, x i = 120 ∧ ∑ i ∈ B, x i = 120 ∧ ∑ i ∈ C, x i = 120 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-182743,"Prove that the largest integer $m$ such that there exists an $m$-element subset $A$ of $\{1, 2, 3, \ldots, 2^k\}$ (where $n = 2^k$ for some integer $k$) that does not contain any power of 2 (including $2^0 = 1$) and no two elements of $A$ sum to a power of 2 is $2^{n - 1}-1$.","import Mathlib theorem Prove (k : ℕ) (n : ℕ) (hn : n = 2 ^ k) : IsGreatest {m | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 n ∧ A.card = m ∧ ∀ x ∈ A, ¬∃ j : ℕ, x = 2 ^ j ∧ ∀ x ∈ A, ∀ y ∈ A, x ≠ y → ¬∃ j : ℕ, x + y = 2 ^ j} (2 ^ (n - 1) - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-182870,"Prove that if $M$ is a set of points in the plane such that (i) there exist $7$ points in $M$ that form the vertices of a convex heptagon and (ii) for any $5$ points in $M$ that form the vertices of a convex pentagon, there is at least one point in $M$ that lies in the interior of this pentagon, then the minimum value of the number of elements $n$ in the set $M$ is \(11\).","import Mathlib open Real Set open scoped BigOperators theorem min_points {M : Finset (EuclideanSpace ℝ (Fin 2))} (hM : ∃ S : Finset (EuclideanSpace ℝ (Fin 2)), S ⊆ M ∧ S.card = 7) (hM' : ∀ T : Finset (EuclideanSpace ℝ (Fin 2)), T ⊆ M ∧ T.card = 5 → ∃ U ∈ M, U ∈ interior (convexHull ℝ T)) : IsLeast {n | ∃ M : Finset (EuclideanSpace ℝ (Fin 2)), M.card = n ∧ (∃ S : Finset (EuclideanSpace ℝ (Fin 2)), S ⊆ M ∧ S.card = 7) ∧ (∀ T : Finset (EuclideanSpace ℝ (Fin 2)), T ⊆ M ∧ T.card = 5 → ∃ U ∈ M, U ∈ interior (convexHull ℝ T))} 11 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-183228,"Prove that for any positive integer $n$, at least one of the digits $b_n, b_{n+1}, \dots, b_{2n}$ equals $1$, where $\sqrt{3} = 1.b_1b_2b_3 \dots_{(2)}$ is the binary representation of $\sqrt{3}$.","import Mathlib open Real theorem prove (n : ℕ) (hn : 0 < n) : ∃ k ∈ Finset.Icc n (2 * n), (Nat.floor (2 ^ k * sqrt 3)) % 2 = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-183404,"Let $(X,d)$ be a metric space where $d: X \times X \to \mathbb{R}_{\geq 0}$. Assume that $X$ is both connected and compact. Prove that there exists a constant $\alpha \in \mathbb{R}_{\geq 0}$ such that for any positive integer $n$ and any points $x_1, x_2, \dots, x_n \in X$, there exists a point $x \in X$ for which the average distance from $x$ to the points $x_1, x_2, \dots, x_n$ is $\alpha$, i.e., \[ \frac{d(x, x_1) + d(x, x_2) + \cdots + d(x, x_n)}{n} = \alpha. \]","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem T285831 {X : Type*} [MetricSpace X] [ConnectedSpace X] [CompactSpace X] : ∃ α : ℝ, α ≥ 0 ∧ ∀ n > 0, ∀ x : Fin n → X, ∃ y : X, (∑ i : Fin n, dist y (x i)) / n = α := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-183561,Prove that the value of the sum $\sum_{n=0}^{48} \binom{2016}{42n}$ is $\frac{1}{42} \sum_{k=0}^{41} (1 + e^{\frac{i\pi k}{42}})^{2016}$.,"import Mathlib open Finset Real Complex Polynomial theorem algebra_524941 : ∑ n ∈ range 49, Nat.choose 2016 (42 * n) = ((1 : ℂ) / 42) * ∑ k ∈ range 42, (1 + exp (I * π * k / 42)) ^ 2016 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-183696,"Let $\{a_n\}_{n=1}^{\infty}$ be an infinite sequence defined by $a_1 = 8$ and $a_{n+1} = a_n^2 + a_n + 1$ for every positive integer $n$. Prove that for every positive integer $n$, there exist at least $2^{n-1}$ pairs of positive integers $(b, c)$ such that $1 < b < c < a_n$ and $a_n^2 + 1 = b^2 + c^2$.","import Mathlib theorem algebra_496716 (a : ℕ → ℕ) (h₀ : a 1 = 8) (h₁ : ∀ n > 0, a (n + 1) = a n ^ 2 + a n + 1) : ∀ n > 0, ∃ s : Finset (ℕ × ℕ), s.card ≥ 2 ^ (n - 1) ∧ (∀ b ∈ s, b.1 > 0 ∧ b.2 > 0 ∧ 1 < b.1 ∧ b.1 < b.2 ∧ b.2 < a n ∧ a n ^ 2 + 1 = b.1 ^ 2 + b.2 ^ 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-183760,"Prove the following identity for all non - negative integers \(n\) and \(k\): \[ \sum_{m=0}^{2k+1}{2^{m}\binom{n}{m}\binom{n-m}{\lfloor \frac{2k+1-m}{2} \rfloor}}=\binom{2n+1}{2k+1} \]","import Mathlib open Finset Real Nat theorem sum_id (n k : ℕ) : ∑ m ∈ range (2 * k + 2), 2 ^ m * Nat.choose n m * Nat.choose (n - m) (Nat.floor ((2 * k + 1 - m) / 2)) = Nat.choose (2 * n + 1) (2 * k + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-184019,"Prove that the only pairs of natural numbers $(n, k)$ with $k > 1$ such that $k$ divides each of the binomial coefficients $\binom{n}{1}, \binom{n}{2}, \ldots, \binom{n}{n - 1}$ are of the form $(n, k) = (p^t, p)$, where $p$ is a prime number and $t$ is a positive integer.","import Mathlib theorem prove (n k : ℕ) (hk : k > 1) : (∀ i ∈ Finset.Icc 1 (n - 1), k ∣ Nat.choose n i) ↔ ∃ p t, Nat.Prime p ∧ t > 0 ∧ n = p ^ t ∧ k = p := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-184207,"Prove that for a sequence \(A=\{a_1 < a_2 < a_3<\ldots\}\) of positive integers where each \(a_i\) has at most \(2007\) prime factors (counting repeated factors), it is always possible to extract an infinite subset \(B = \{b_1 < b_2 < b_3<\ldots\}\subseteq A\) such that for any two elements \(g, h\in B\), \(\gcd(g,h)\) is a constant value.","import Mathlib theorem prove (A : ℕ → ℕ) (hA : StrictMono A) (hA1 : ∀ i, 0 < A i) (hA2 : ∀ i, (Nat.primeFactors (A i)).card ≤ 2007) : ∃ B : ℕ → ℕ, StrictMono B ∧ (∀ i, B i ∈ Set.range A) ∧ ∃ k, ∀ g h, g ∈ Set.range B → h ∈ Set.range B → Nat.gcd g h = k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-184324,"Let $n$ be an odd positive integer, and let $x_1, x_2, \ldots, x_n$ and $y_1, y_2, \ldots, y_n$ be non - negative real numbers such that $\sum_{i = 1}^{n} x_i=\sum_{i = 1}^{n} y_i$. Prove that there exists a proper subset $J$ of $\{1, 2, \ldots, n\}$ such that $\frac{n - 1}{n+1} \sum_{j \in J} x_j\leq\sum_{j \in J} y_j\leq\frac{n + 1}{n-1} \sum_{j \in J} x_j$.","import Mathlib open Finset Real theorem OddN (n : ℕ) (hn : Odd n ∧ n > 0) (x y : ℕ → ℝ) (hx : ∀ i ∈ Icc 1 n, 0 ≤ x i) (hy : ∀ i ∈ Icc 1 n, 0 ≤ y i) (hxy : ∑ i ∈ Icc 1 n, x i = ∑ i ∈ Icc 1 n, y i) : ∃ J : Finset ℕ, J ⊂ Icc 1 n ∧ (n - 1) / (n + 1) * ∑ j ∈ J, x j ≤ ∑ j ∈ J, y j ∧ ∑ j ∈ J, y j ≤ (n + 1) / (n - 1) * ∑ j ∈ J, x j := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-184431,"Let $p$ and $q$ be distinct prime numbers, and let $S$ be a subset of $\{1, 2, \dots, p - 1\}$. Define $N(S)$ as the number of solutions to the equation $$\sum_{i = 1}^{q} x_i \equiv 0 \pmod{p}$$ where $x_i \in S$ for $i = 1, 2, \dots, q$. Prove that $q \mid N(S)$.","import Mathlib theorem q_div_solutions (p q : ℕ) (hp : p.Prime) (hq : q.Prime) (hne : p ≠ q) (S : Finset ℕ) (hS : S ⊆ Finset.Icc 1 (p - 1)) : q ∣ {x : Fin q → ℕ | (∀ i, x i ∈ S) ∧ ∑ i, x i ≡ 0 [MOD p]}.ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-184601,"Given a positive integer \(n\), let \(D\) be the set of all positive divisors of \(n\). Consider two subsets \(A\) and \(B\) of \(D\) such that for any \(a \in A\) and \(b \in B\), it holds that \(a \nmid b\) and \(b \nmid a\). Prove that \[ \sqrt{|A|} + \sqrt{|B|} \le \sqrt{|D|}. \]","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (A B : Finset ℕ) (hA : ∀ a ∈ A, ∀ b ∈ B, ¬(a ∣ b)) (hB : ∀ b ∈ B, ∀ a ∈ A, ¬(b ∣ a)) (hAB : A ⊆ Nat.divisors n ∧ B ⊆ Nat.divisors n) : Real.sqrt A.card + Real.sqrt B.card ≤ Real.sqrt (Nat.divisors n).card := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-184656,"Prove that for an odd prime $p$, the expression $(-1)^{(p-1)/2}\binom{p-1}{(p-1)/2} - 4^{p-1}$ is divisible by $p^3$. Here, $\binom{x}{y}$ denotes the binomial coefficient.","import Mathlib theorem number_theory_201821 (p : ℕ) (hp : Odd p ∧ Nat.Prime p) : (p ^ 3 : ℤ) ∣ (-1 : ℤ) ^ ((p - 1) / 2) * Nat.choose (p - 1) ((p - 1) / 2) - 4 ^ (p - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-184732,"Let \(0 \leq x_1, x_2, \ldots, x_k \leq 1\) be real numbers, and let \(l > 0\) be a positive real number such that \(x_1^l + x_2^l + \cdots + x_k^l = n\), where \(n\) is a positive integer and \(n \leq k\). Prove that there exists an \(n\)-element subset \(S \subset \{1, 2, \ldots, k\}\) such that \(\sum_{i \in S} x_i \geq x_1^{l+1} + x_2^{l+1} + \cdots + x_k^{l+1}\).","import Mathlib open Finset Real theorem qwen {k : ℕ} (hk : 0 < k) (x : Fin k → ℝ) (hx : ∀ i, 0 ≤ x i ∧ x i ≤ 1) (l : ℝ) (hl : 0 < l) (n : ℕ) (hn : 0 < n) (h : n ≤ k) (h1 : ∑ i, (x i)^l = n) : ∃ S : Finset (Fin k), S.card = n ∧ ∑ i ∈ S, x i ≥ ∑ i, (x i)^(l + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-184932,"Let $h: \mathbb{R}^2 \to \mathbb{R}^2$ be a surjective function such that for all $x, y \in \mathbb{R}^2$, the inequality $\|h(x) - h(y)\| \geq 3\|x - y\|$ holds, where $\|\cdot\|$ denotes the Euclidean norm on $\mathbb{R}^2$. Prove that the image of every open set in $\mathbb{R}^2$ under the map $h$ is an open set in $\mathbb{R}^2$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem image_of_surjective_function (h : ℝ × ℝ → ℝ × ℝ) (h₀ : ∀ x y, dist (h x) (h y) ≥ 3 * dist x y) (h₁ : Function.Surjective h) : ∀ U, IsOpen U → IsOpen (h '' U) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-184954,"Prove that from the interval \([1, \frac{3^n + 1}{2}]\), it is possible to select a set of \(2^n\) integers such that the set contains no arithmetic triple.","import Mathlib theorem prove (n : ℕ) : ∃ s : Finset ℤ, s.card = 2 ^ n ∧ ∀ x ∈ s, 1 ≤ x ∧ x ≤ (3 ^ n + 1) / 2 ∧ ¬∃ x ∈ s, ∃ y ∈ s, ∃ z ∈ s, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ x - y = y - z := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-185149,"Prove that if $X$ is a finite set of real numbers such that $0 \leq x \leq 1$ for all $x \in X$, and $|X| > 8$, and for every subset $A \subset X$ with $|A| = 8$, there exists an element $t \in X \setminus A$ such that $t + \sum_{i \in A} i \in \mathbb{Z}$, then the only possible value of $|X|$ is \(9\).","import Mathlib theorem FiniteSetOfReal (X : Finset ℝ) (hX : ∀ x ∈ X, 0 ≤ x ∧ x ≤ 1) (hX1 : X.card > 8) (hX2 : ∀ A ⊆ X, A.card = 8 → ∃ t ∈ X \ A, ∃ n : ℤ, t + ∑ i ∈ A, i = n) : X.card = 9 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-185216,"Prove that there exists an integer $n > 2003$ such that in the sequence $\binom{n}{0}$, $\binom{n}{1}$, $\binom{n}{2}$, ..., $\binom{n}{2003}$, each term is a divisor of all the terms that follow it.","import Mathlib theorem prove : ∃ n : ℕ, n > 2003 ∧ (∀ i : Fin 2004, ∀ j : Fin 2004, j > i → (Nat.choose n i) ∣ (Nat.choose n j)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-185217,"Prove that the only sets \(S\) of positive integers such that for any two distinct elements \(a, b \in S\), every positive integer less than \(a + b\) that is relatively prime to \(a + b\) is also an element of \(S\) are (a) the empty set and singletons, (b) \(\{1, 2\}\), \(\{1, 3\}\), and \(\{1, 5\}\), (c) \(\mathbb{Z}^+ \setminus 2\mathbb{Z}^+\) (the odd positive integers), and (d) \(\mathbb{Z}^+\).","import Mathlib theorem SetOfIntegers {S : Set ℕ} (hS : ∀ x ∈ S, x > 0) (hS' : ∀ a ∈ S, ∀ b ∈ S, a ≠ b → ∀ n, n < a + b → n.Coprime (a + b) → n ∈ S) : S = ∅ ∨ (∃! x, x ∈ S) ∨ S = {1, 2} ∨ S = {1, 3} ∨ S = {1, 5} ∨ S = {x | Odd x ∧ x > 0} ∨ S = {x | x > 0} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-185476,"Prove or disprove that if $A$ is a set of positive integers such that $\sum_{a \in A} \frac{1}{a} \in \mathbb{Z}_+$, then there exists a subset $B \subseteq A$ such that $\sum_{b \in B} \frac{1}{b} = 1$.","import Mathlib theorem prove (A : Finset ℕ) (hA : ∀ a ∈ A, a > 0) (hA' : ∃ n : ℕ, ∑ a ∈ A, (1 / a : ℚ) = n) : ∃ B ⊆ A, ∑ b ∈ B, (1 / b : ℚ) = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-185795,"Prove that for any $n \geq 4$, there exist sets $A, B \subset \mathbb{N}$ such that: 1. $A \neq B$ 2. $|A| = |B| = n$ 3. $A \times A = B \times B$, where $S \times S = \{a \cdot b \mid a, b \in S, a \neq b\}$.","import Mathlib theorem prove (n : ℕ) (hn : n ≥ 4) : ∃ A B : Finset ℕ, A ≠ B ∧ A.card = n ∧ B.card = n ∧ {x | ∃ a ∈ A, ∃ b ∈ A, a ≠ b ∧ x = a * b} = {x | ∃ a ∈ B, ∃ b ∈ B, a ≠ b ∧ x = a * b} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-185803,"Prove that for any $n \geq 4$, there exist sets $A, B \subset \mathbb{N}$ such that \(A \neq B\), \(|A| = |B| = n\), and \(A \times A = B \times B\), where \(S \times S = \{a \cdot b \mid a, b \in S, a \neq b\}\) for any \(S \subset \mathbb{N}\).","import Mathlib theorem prove (n : ℕ) (hn : n ≥ 4) : ∃ A B : Finset ℕ, A ≠ B ∧ A.card = n ∧ B.card = n ∧ {x | ∃ a ∈ A, ∃ b ∈ A, x = a * b ∧ a ≠ b} = {x | ∃ a ∈ B, ∃ b ∈ B, x = a * b ∧ a ≠ b} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-185966,"Prove that the $2019$th strictly positive integer $n$ for which the binomial coefficient $\binom{2n}{n}$ is not divisible by $5$, i.e., $\nu_5 \left(\binom{2n}{n}\right) = 0$ where $\nu_5$ denotes the $5$-adic valuation, is equal to $37805$.","import Mathlib theorem number_theory_8348 : Nat.nth {n : ℕ | n > 0 ∧ ¬(5 ∣ Nat.choose (2 * n) n)} 2018 = 37805 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-185988,"Given \(2015\) points in a plane, where from any selection of five points, there exist at least two points whose distance is less than \(1\) unit, prove that there exists a unit disc that contains at least \(504\) of these points.","import Mathlib theorem Qwen (P : Finset (EuclideanSpace ℝ (Fin 2))) (hP : P.card = 2015) (h : ∀ s ⊆ P, s.card = 5 → ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ dist x y < 1) : ∃ O : EuclideanSpace ℝ (Fin 2), ∃ r : ℝ, r = 1 ∧ {x | x ∈ P ∧ dist x O < r}.ncard ≥ 504 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-186173,"Let $0 < p < 1$ be a real number, and define the sequence $\{x_n\}$ such that $x_0 = 1$, and for $n \geq 1$, $$x_n = \sum_{i=0}^{n}\binom{n}{i}p^i(1 - p)^{n - i}x_{2i}.$$ Prove that the value of $x_1$ (which represents the probability that the species never dies out in the context of the problem) is $\frac{1}{p}-1$.","import Mathlib open Finset Real Nat theorem prob_neitherDie {p : ℝ} (hp : 0 < p ∧ p < 1) (x : ℕ → ℝ) (hx0 : x 0 = 1) (hxn : ∀ n ≥ 1, x n = ∑ i ∈ Icc 0 n, Nat.choose n i * p ^ i * (1 - p) ^ (n - i) * x (2 * i)) : x 1 = 1 / p - 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-186255,"Prove that the greatest possible number of elements in a set $S$ of positive integers, where each element of $S$ has no prime factor greater than 20, and the greatest common factor of any two distinct elements of $S$ is an integer greater than 1 and is not divisible by the square of any prime number, is \(136\).","import Mathlib theorem max_set_size (S : Finset ℕ) (hS : ∀ n ∈ S, 0 < n) (hS1 : ∀ n ∈ S, ∀ p, Nat.Prime p → p ∣ n → p ≤ 20) (hS2 : ∀ m ∈ S, ∀ n ∈ S, m ≠ n → ∃ k, Nat.gcd m n = k ∧ 1 < k ∧ ¬∃ p, Nat.Prime p ∧ p^2 ∣ k) : S.card ≤ 136 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-186256,"Prove that the greatest possible number of elements in a set $S$ of positive integers, where each element has no prime factor greater than 20, and the greatest common factor of any two distinct elements of $S$ is an integer greater than 1 and is not divisible by the square of any prime number, is \(131\).","import Mathlib theorem max_set_size (S : Finset ℕ) (hS : ∀ n ∈ S, n > 0) (hS1 : ∀ n ∈ S, ∀ p, Nat.Prime p → p ∣ n → p ≤ 20) (hS2 : ∀ m ∈ S, ∀ n ∈ S, m ≠ n → ∃ d, d = Nat.gcd m n ∧ d > 1 ∧ ¬∃ p, Nat.Prime p ∧ p^2 ∣ d) : S.card ≤ 131 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-186567,"Prove that for any $\epsilon > 0$, there exists a nowhere dense subset $A$ of $[0,1]$ such that $\mu(A) > 1 - \epsilon$, where $\mu$ denotes the standard Lebesgue measure on the unit interval $[0,1]$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Metric.proof_464835 (ε : ℝ) (hε : ε > 0) : ∃ A : Set ℝ, A ⊆ Set.Icc 0 1 ∧ (MeasureTheory.volume A).toReal > 1 - ε ∧ ¬∃ U : Set ℝ, IsOpen U ∧ U ⊆ A ∧ (MeasureTheory.volume U).toReal > 0 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-186642,"Prove that if each integer is painted one of three colors, there exist two distinct integers of the same color whose difference is a perfect square.","import Mathlib theorem prove (f : ℤ → Fin 3) : ∃ i j, i ≠ j ∧ f i = f j ∧ IsSquare (i - j) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-186679,"Prove that the last three digits of the number of clottish pairs $(m, n)$ (where a clottish pair $(m, n)$ with $1 \le m, n \le 2026$ is defined such that there does not exist a positive integer $a$ for which $a^m - n$ is divisible by the prime number $p = 2027$) is \(205\).","import Mathlib theorem count_clottish_pairs : Set.ncard {p : ℕ × ℕ | p.1 ∈ Finset.Icc 1 2026 ∧ p.2 ∈ Finset.Icc 1 2026 ∧ ¬∃ a : ℕ, 0 < a ∧ (2027 : ℤ) ∣ a ^ p.1 - p.2} % 1000 = 205 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-186831,"Let $\mathbb{N}$ be the set of all natural numbers. Let $f: \mathbb{N} \to \mathbb{N}$ be a bijective function. Prove that there exist three numbers $a$, $b$, and $c$ in arithmetic progression such that $a < b < c$ and $f(a) < f(b) < f(c)$.","import Mathlib theorem NatFunction (f : ℕ → ℕ) (hf : Function.Bijective f) : ∃ a b c, ∃ d, b = a + d ∧ c = b + d ∧ a < b ∧ b < c ∧ f a < f b ∧ f b < f c := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-187203,"Let $x, y : \mathbb{N} \to \mathbb{N}$ be two sequences of natural numbers. We say that $x$ and $y$ are [i]completely different[/i] if $x_n \neq y_n$ for all $n \in \mathbb{N}$. Let $F$ be a function that assigns a natural number to every sequence of natural numbers such that $F(x) \neq F(y)$ for any pair of completely different sequences $x$ and $y$, and for constant sequences, $F((k, k, \dots)) = k$. Prove that there exists $n \in \mathbb{N}$ such that $F(x) = x_n$ for all sequences $x$.","import Mathlib open Finset theorem prove (F : (ℕ → ℕ) → ℕ) (hF : ∀ x y, (∀ n, x n ≠ y n) → F x ≠ F y) (hF' : ∀ k, F (fun n => k) = k) : ∃ n, ∀ x, F x = x n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-187204,"Let $x, y : \mathbb{N} \to \mathbb{N}$ be two sequences of natural numbers. We say that $x$ and $y$ are [i]completely different[/i] if $x_n \neq y_n$ for all $n \in \mathbb{N}$. Let $F$ be a function that assigns a natural number to every sequence of natural numbers such that $F(x) \neq F(y)$ for any pair of completely different sequences $x$ and $y$, and for constant sequences, $F((k, k, \dots)) = k$. Prove that for all sequences $(x_1, x_2, \dots)$ of natural numbers, \( F(x_1, x_2, \dots) = x_1 \).","import Mathlib open Finset theorem F (F : (ℕ → ℕ) → ℕ) (hF : ∀ x y, (∀ n, x n ≠ y n) → F x ≠ F y) (hF' : ∀ k, F ((fun n => k) : ℕ → ℕ) = k) : ∀ x, F x = x 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-187229,"Prove that if for $k = 1, 2, 3, \ldots, 1992$, $A_k$ is a set such that $|A_k| = 44$ and $|A_i \cap A_j| = 1$ for all $i, j \in \{1, 2, \ldots, 1992\}$ with $i \neq j$, then $|A_1 \cup A_2 \cup \cdots \cup A_{1992}| = 85656$.","import Mathlib theorem prove(A : ℕ → Set ℕ) (hA : ∀ k ∈ Finset.Icc 1 1992, (A k).ncard = 44) (hA' : ∀ i ∈ Finset.Icc 1 1992, ∀ j ∈ Finset.Icc 1 1992, i ≠ j → ((A i) ∩ (A j)).ncard = 1) : ((⋃ k ∈ Finset.Icc 1 1992, A k).ncard = 85656) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-187231,"Prove that if for $k = 1, 2, 3, \ldots, 1992$, $A_k$ is a set such that $|A_k| = 44$ and $|A_i \cap A_j| = 1$ for all $i, j \in \{1, 2, \ldots, 1992\}$ with $i \neq j$, then $|A_1 \cup A_2 \cup \cdots \cup A_{1992}| = 85657$.","import Mathlib theorem prove (A : Fin 1992 → Set ℕ) (hA : ∀ i, Set.ncard (A i) = 44) (hA' : ∀ i j, i ≠ j → Set.ncard (A i ∩ A j) = 1) : Set.ncard (⋃ i, A i) = 85657 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-187300,"Let $n = 2^{k - 1}$ for some $k \in \mathbb{N}$. Prove that among $2n - 1$ integers, one can select $n$ integers such that their sum is divisible by $n$.","import Mathlib theorem qwen (n : ℕ) (hn : ∃ k, n = 2 ^ (k - 1)) : ∀ s : Finset ℤ, s.card = 2 * n - 1 → ∃ t ⊆ s, t.card = n ∧ ∑ x ∈ t, x ≡ 0 [ZMOD n] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-187464,"Every point in the plane is colored either red or blue. Prove that one of the following statements must be true: $\bullet$ There exist two red points at a distance of $1$ from each other; $\bullet$ There exist four blue points $B_1, B_2, B_3, B_4$ such that the distance between any two points $B_i$ and $B_j$ is $|i - j|$, for all integers $i$ and $j$ where $1 \le i \le 4$ and $1 \le j \le 4$.","import Mathlib theorem color_point (red blue : Set (EuclideanSpace ℝ (Fin 2))) : (∃ p q : EuclideanSpace ℝ (Fin 2), p ∈ red ∧ q ∈ red ∧ dist p q = 1) ∨ (∃ B : Fin 4 → (EuclideanSpace ℝ (Fin 2)), ∀ i j, i ≠ j → dist (B i) (B j) = |(i : ℤ) - j|) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-187586,"Prove that if $\alpha$ and $\beta$ are nonnegative integers and the number of strictly increasing sequences of integers $a_0, a_1, \dots, a_{2014}$ that satisfy $0 \leq a_m \leq 3m$ for all $m \in \{0, 1, \dots, 2014\}$ is expressed as $2^\alpha (2\beta + 1)$, then $\alpha = 11$.","import Mathlib theorem proveα (α β : ℕ) (h : {a : ℕ → ℕ | StrictMonoOn a (Finset.Icc 0 2014) ∧ ∀ m ∈ Finset.Icc 0 2014, 0 ≤ a m ∧ a m ≤ 3 * m}.ncard = 2 ^ α * (2 * β + 1)) : α = 11 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-187635,"Let \(n = (n_k n_{k - 1} \ldots n_1 n_0)_2>1\), which means \(n=\sum_{i = 0}^{k}2^{i}n_{i}\) for all \(n_i\in\{0, 1\}\). Prove that: \[ \sum_{\substack{0 \le i \le n \\ \binom{n}{i} \text{ odd}}} 2^i = \prod_{i = 0}^{k} F_i^{n_i} \] where \(F_i = 2^{2^i}+1\) is the \(i\) - th Fermat number.","import Mathlib open Finset Real Nat theorem sumOddFermat {n : ℕ} (hn : ∃ k, n = ∑ i ∈ range (k + 1), 2 ^ i * (Nat.digits 2 n)[i]!) (h : n > 1) : ∑ i ∈ (Icc 0 n).filter (fun x => Odd (Nat.choose n x)), 2 ^ i = ∏ i ∈ range (k + 1), (2 ^ (2 ^ i) + 1) ^ (Nat.digits 2 n)[i]! := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-188129,"Prove that there exists a permutation $p$ of the set $\{1, 2, \ldots, 32\}$ such that the sums $p(1) + p(2), p(2) + p(3), \ldots, p(31) + p(32), p(32) + p(1)$ are all perfect squares.","import Mathlib theorem existsPerm : ∃ p : Fin 32 → ℕ, (∀ i j, p i = p j → i = j) ∧ (∀ i, p i ∈ Set.Icc 1 32) ∧ (∀ i : Fin 32, IsSquare (p i + p ((i + 1) % 32))) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-188187,"Prove that the maximum possible value of the number of elements \(|S|\) of a subset \(S\) of \(\{1,2,3,\ldots,2023\}\) such that for any two distinct elements \(x, y \in S\), the condition \((x - y)\mid(x + y)\) does not hold is \(675\).","import Mathlib theorem max_s : IsGreatest {n | ∃ S : Finset ℕ, S ⊆ Finset.Icc 1 2023 ∧ S.card = n ∧ ∀ x ∈ S, ∀ y ∈ S, x ≠ y → ¬(x - y ∣ x + y)} 675 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-188235,Prove that \(\sum_{k=0}^{1009}(-1)^k\frac{1}{2019 - k}\binom{2019 - k}{k}=1\).,"import Mathlib open Finset Real Nat theorem sumK : ∑ k ∈ range 1010, (-1 : ℝ)^k / (2019 - k) * Nat.choose (2019 - k) k = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-188287,"Prove that the only finite set \(M \subset \mathbb{R}\) such that \(|M| \geq 2\) and if \(a, b \in M\) with \(a \neq b\), then \(\frac{2}{3}a - b^2 \in M\) is \(M = \left\{-\frac{4}{3}, \frac{2}{3}\right\}\).","import Mathlib theorem FiniteSetReal (M : Set ℝ) (hM : M.Nonempty) (hM1 : M.encard ≥ 2) (hM2 : ∀ a ∈ M, ∀ b ∈ M, a ≠ b → 2 / 3 * a - b ^ 2 ∈ M) : M = {-4 / 3, 2 / 3} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-188334,"Let $p$ and $q$ be given prime numbers, and let $S$ be a subset of $\{1, 2, 3, \dots, p - 2, p - 1\}$. Prove that the number of elements in the set \[ A = \{ (x_1, x_2, \dots, x_q) : x_i \in S, \sum_{i = 1}^q x_i \equiv 0 \pmod{p} \} \] is a multiple of $q$.","import Mathlib theorem qwen (p q : ℕ) (hp : Nat.Prime p) (hq : Nat.Prime q) (S : Finset ℕ) (hS : S ⊆ Finset.Icc 1 (p - 1)) : q ∣ {x : Fin q → ℕ | (∀ i, x i ∈ S) ∧ ∑ i, x i ≡ 0 [MOD p]}.ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-188542,"Let $m > 1$ be an integer, and let $D = \{ d : d \mid m, d > 0 \}$ be the set of all positive divisors of $m$. Let $H$ be a subset of $D$. Prove that if $|H| > \frac{|D|}{2}$, then there exist three numbers (not necessarily distinct) in $H$ whose product is a perfect square.","import Mathlib theorem qwen {m : ℕ} (hm : m > 1) (D H : Finset ℕ) (hD : D = Nat.divisors m) (hH : H ⊆ D) : H.card > D.card / 2 → ∃ x ∈ H, ∃ y ∈ H, ∃ z ∈ H, IsSquare (x * y * z) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-188652,"a) Prove that for every $w \in \mathcal{C}([0,1])$, there exists a unique $\overline{w} \in \mathcal{C}([0,1])$ such that $w = \overline{w} - F\overline{w}$, where $(\mathcal{C}([0,1]),\lVert \cdot \rVert_{\infty})$ is the Banach space of continuous functions on the interval $[0,1]$ equipped with the supremum norm and the map $F:\mathcal{C}([0,1])\rightarrow \mathcal{C}([0,1])$ is defined by $(F a)(t)=\frac{1}{3}\int_t^1 a(v) \, dv$ for all $t\in [0,1]$. b) Prove that the operator $F$ is compact, where $(\mathcal{C}([0,1]),\lVert \cdot \rVert_{\infty})$ is the Banach space of continuous functions on the interval $[0,1]$ equipped with the supremum norm and the map $F:\mathcal{C}([0,1])\rightarrow \mathcal{C}([0,1])$ is defined by $(F a)(t)=\frac{1}{3}\int_t^1 a(v) \, dv$ for all $t\in [0,1]$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove_1 (F : (ℝ → ℝ) → (ℝ → ℝ)) (hF : ∀ a, F a = λ t => (∫ v in (t)..1, a v) / 3) (w : ℝ → ℝ) (hw : ContinuousOn w (Set.Icc 0 1)) : ∃! ω : ℝ → ℝ, ContinuousOn ω (Set.Icc 0 1) ∧ w = ω - F ω := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-188763,"Prove that the maximum possible number of digits of the numbers in the set \[ A = \{ n \in \mathbb{N} : P(n) \text{ is non - zero, square - free, and } S(n) \text{ is a proper divisor of } P(n) \}, \] where $P(n)$ denotes the product of the digits of $n$ and $S(n)$ denotes the sum of the digits of $n$, is \(72\).","import Mathlib open Nat def P : ℕ → ℕ | n => (Nat.digits 10 n).prod def S : ℕ → ℕ | n => (Nat.digits 10 n).sum def A : Set ℕ := {n | P n ≠ 0 ∧ Squarefree n ∧ S n ∣ P n ∧ ¬(P n ∣ S n)} theorem max_digits : IsGreatest {k | ∃ m ∈ A, k = (Nat.digits 10 m).length} 72 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-188799,"Prove that there exists a bijective function \(f: \mathbb{N} \to \mathbb{N}\) such that for any distinct positive integers \(i, j\) with \(i > j\), the condition \(|f(i) - f(j)| \ne i - j\) holds.","import Mathlib theorem g_426517 : ∃ f : ℕ+ → ℕ+, Function.Bijective f ∧ ∀ i j, i > j → |(f i : ℤ) - (f j : ℤ)| ≠ i - j := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-188915,"Let \(z_1, z_2, \ldots, z_n\) (where \(n \geq 4\)) be complex numbers, not necessarily distinct, such that \(|z_1| + |z_2| + \cdots + |z_n| = 1\). Prove that there exists a subset \(A\subseteq\{1,2,\ldots,n\}\) such that \(\left| \sum_{k \in A} z_k \right| > \frac{1}{4}\).","import Mathlib open Finset Real Complex Polynomial theorem Finset.sum.filter {n : ℕ} (hn : n ≥ 4) (f : Fin n → ℂ) (h : ∑ i : Fin n, ‖f i‖ = 1) : ∃ t : Finset (Fin n), ‖∑ i ∈ t, f i‖ > 1 / 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-189141,"Prove that for a pile of \(n\) pebbles arranged in a vertical column and modified according to the rule that a pebble can be moved if it is at the top of a column that contains at least two more pebbles than the column immediately to its right (considering a column with 0 pebbles if there are no pebbles to the right), and at each stage a pebble from among those that can be moved (if any) is chosen and placed at the top of the column to its right, the final configuration (where no pebbles can be moved) is unique for each \(n\) and can be described by the decomposition \(n=(1 + 2+\cdots + k)+\ell\) where \(1\leqslant\ell\leqslant k\).","import Mathlib open Finset theorem prove {n : ℕ} (hn : n > 0) : ∃! k : ℕ, ∃! l : ℕ, n = (∑ i ∈ Icc 1 k, i) + l ∧ 1 ≤ l ∧ l ≤ k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-189228,"Let $A$ be a finite set of positive integers. Prove that there exists a finite set $B$ of positive integers such that $A \subseteq B$ and \[\prod_{x \in B} x = \sum_{x \in B} x^2.\]","import Mathlib theorem Finset.prod_eq_sum_of_squares {A : Finset ℕ} (hA : ∀ x ∈ A, x > 0) : ∃ B : Finset ℕ, (∀ x ∈ B, x > 0) ∧ A ⊆ B ∧ ∏ x ∈ B, x = ∑ x ∈ B, x ^ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-189341,"Prove that if there are more than \(1000000\) points in a three - dimensional space, then there are at least \(80\) distinct distances between any pair of these points.","import Mathlib open Real Set open scoped BigOperators theorem prove_distance (P : Finset (EuclideanSpace ℝ (Fin 3))) : P.card > 1000000 → {d | ∃ x y, d = dist x y ∧ x ∈ P ∧ y ∈ P}.ncard ≥ 80 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-189364,"Prove that for an integer \(n \ge 3\) and \(n\) distinct positive real numbers \(a_1, a_2, \ldots, a_n\), there are at most \(n - 2\) different integer powers of three that can be written as the sum of three distinct elements from the set \(\{a_1, a_2, \ldots, a_n\}\).","import Mathlib theorem Prove (n : ℕ) (hn : 3 ≤ n) (a : Fin n → ℝ) (ha : ∀ i j, a i = a j → i = j) (ha1 : ∀ i, 0 < a i) : Set.ncard {k : ℕ | ∃ i j m, i ≠ j ∧ i ≠ m ∧ j ≠ m ∧ a i + a j + a m = 3 ^ k} ≤ n - 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-189435,"Prove that the number of all distinct functions \(f : D \to D\) such that \((f \circ f \circ f \circ f \circ f)(x) = x\) for all \(x \in D\), where \(\text{Card}(D) = 10\), is \(72576\).","import Mathlib theorem card {D : Type*} [Fintype D] (hD : Fintype.card D = 10) : Set.ncard {f : D → D | ∀ x, f (f (f (f (f x)))) = x} = 72576 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-189482,"Prove that for any odd integer \(n \geq 1\), given a necklace \(A\) with 14 beads and a necklace \(B\) with 19 beads, it is possible to number each of the 33 beads with a unique integer from the sequence \(\{ n, n + 1, n + 2, \dots, n + 32 \}\) such that each integer is used exactly once, and any two adjacent beads are labeled with relatively prime integers, where a ""necklace"" is considered a circular arrangement where each bead is adjacent to two other beads.","import Mathlib theorem prove (n : ℕ) (hn : Odd n ∧ n ≥ 1) : ∃ f : Fin 33 → ℕ, (∀ i j, i ≠ j → f i ≠ f j) ∧ (∀ i, f i ∈ Finset.Icc n (n + 32)) ∧ (∀ i, Nat.Coprime (f i) (f ((i + 1) % 33))) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-189591,"Let $h: \mathbb{R}^2 \to \mathbb{R}^2$ be a surjective function such that $\|h(x) - h(y)\| \geq 3 \|x - y\|$ for all $x, y \in \mathbb{R}^2$. Prove that the image of every open set in $\mathbb{R}^2$ under the map $h$ is open in $\mathbb{R}^2$.","import Mathlib theorem TopologyFilterReal2 (h : (EuclideanSpace ℝ (Fin 2)) → (EuclideanSpace ℝ (Fin 2))) (hs : Function.Surjective h) (h' : ∀ x y, dist (h x) (h y) ≥ 3 * dist x y) : ∀ U : Set (EuclideanSpace ℝ (Fin 2)), IsOpen U → IsOpen (h '' U) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-190426,"Let $\mathcal{S} = \{1, 2, 3, 4, 5, 6\}$. Let $N$ be the number of functions $f: \mathcal{S} \rightarrow \mathcal{S}$ for which there exists a function $g: \mathcal{S} \rightarrow \mathcal{S}$ such that $f(x) = g(g(g(g(x))))$ for all $x \in \mathcal{S}$. Prove that the remainder when $N$ is divided by $1000$ is $721$.","import Mathlib theorem solution : {f : Fin 6 → Fin 6 | ∃ g : Fin 6 → Fin 6, ∀ x, f x = g (g (g (g x)))}.ncard % 1000 = 721 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-190463,"Let \(n \ge 3\) be an integer, and let \(x_1, x_2, \ldots, x_n\) be \(n\) distinct positive real numbers. Prove that there are at most \(n - 2\) different integer powers of three that can be expressed as the sum of three distinct elements from the set \(\{x_1, x_2, \ldots, x_n\}\).","import Mathlib theorem number_theory_462847 (n : ℕ) (hn : 3 ≤ n) (x : Fin n → ℝ) (hx : ∀ i j, x i = x j → i = j) (hx1 : ∀ i, 0 < x i) : Set.ncard {k : ℕ | ∃ i j p : Fin n, i ≠ j ∧ i ≠ p ∧ j ≠ p ∧ x i + x j + x p = 3 ^ k} ≤ n - 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-190549,"Prove that for the set \(A = \{1, 2, \ldots, 2n\}\) and the function \(g: A \to A\) defined by \(g(k)=2n - k + 1\), there exists a function \(f: A \to A\) such that \(f(k)\neq g(k)\) and \(f(f(f(k)))=g(k)\) for all \(k\in A\) if and only if \(3\mid n\).","import Mathlib open Finset theorem algebra_456700 {n : ℕ} (hn : 0 < n) (A : Set ℕ) (hA : A = Icc 1 (2 * n)) (g : A → A) (hg : ∀ k, g k = 2 * n - k + 1) : ∃ f : A → A, (∀ k, f k ≠ g k) ∧ (∀ k, f (f (f k)) = g k) ↔ 3 ∣ n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-190555,"Prove that if \(p\) is a prime number greater than \(3\) and \(a,b\) are positive integers, then \(\binom{ap}{bp} \equiv \binom{a}{b} \pmod{p^3}\).","import Mathlib theorem Nat.choose_apb (p : ℕ) (hp : Nat.Prime p) (h : 3 < p) (a b : ℕ) (ha : 0 < a) (hb : 0 < b) : Nat.choose (a * p) (b * p) ≡ Nat.choose a b [MOD p ^ 3] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-191307,"Prove that for an odd prime \(p\), \((-1)^{(p - 1)/2}\binom{p - 1}{(p - 1)/2}-4^{p - 1}\equiv0\pmod{p^3}\).","import Mathlib theorem prove (p : ℕ) (hp : Odd p ∧ Nat.Prime p) : ((-1) ^ ((p - 1) / 2) * Nat.choose (p - 1) ((p - 1) / 2)) - 4 ^ (p - 1) ≡ 0 [ZMOD p ^ 3] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-191323,"1. Prove that given \(2n - 1\) arbitrary integers, it is always possible to find \(n\) numbers whose sum is divisible by \(n\). 2. Prove that given \(4n - 3\) arbitrary integer pairs \((a,b)\), it is always possible to find \(n\) pairs whose sum is divisible by \(n\). 3. Let \(n\) be an odd number. Prove that given \(2n - 1\) arbitrary distinct elements of \(\mathbb{Z}_n\times\mathbb{Z}_n\), it is always possible to find \(n\) elements whose sum is \((0,0)\).","import Mathlib theorem prove1 (n : ℕ) (hn : 0 < n) (s : Finset ℤ) (h₀ : s.card = 2 * n - 1) : ∃ t ⊆ s, t.card = n ∧ ∑ x ∈ t, x ≡ 0 [ZMOD n] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-191515,"Prove that the number of distinct functions \(f : D \to D\) such that \((f \circ f \circ f \circ f \circ f)(x) = x\) for all \(x \in D\), where \(\text{Card}(D) = 10\), is \(73008\).","import Mathlib theorem card_7412 (n : ℕ) (hn : n = 10) : {f : Fin n → Fin n | ∀ x, f (f (f (f (f x)))) = x}.ncard = 73008 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-192407,"Prove that for all prime numbers \(p \ge 5\), the following congruence holds: \[ (-1)^{\frac{p-1}{2}} \binom{p-1}{\frac{p-1}{2}} \equiv 4^{p-1} \pmod{p^3}. \]","import Mathlib theorem Nat.choose_eq_4 (p : ℕ) [hp : Fact (Nat.Prime p)] (h : 5 ≤ p) : ((-1 : ℤ) ^ ((p - 1) / 2) * Nat.choose (p - 1) ((p - 1) / 2)) ≡ 4 ^ (p - 1) [ZMOD p ^ 3] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-192480,"Prove that for every positive integer \(n \geq 3\), there exist two sets \(A' = \{ x_1 + c, x_2 + c, \ldots, x_n + c \}\) and \(B' = \{ y_1 - c, y_2 - c, \ldots, y_n - c \}\) such that: 1. \(A' \cap B' = \varnothing\). 2. \((x_1 + c)+(x_2 + c)+\cdots+(x_n + c)=(y_1 - c)+(y_2 - c)+\cdots+(y_n - c)\). 3. \((x_1 + c)^2+(x_2 + c)^2+\cdots+(x_n + c)^2=(y_1 - c)^2+(y_2 - c)^2+\cdots+(y_n - c)^2\).","import Mathlib theorem prove (n : ℕ) (hn : 3 ≤ n) : ∃ c : ℝ, ∃ x y : Fin n → ℝ, {z | ∃ i : Fin n, z = x i + c} ∩ {z | ∃ i : Fin n, z = y i - c} = ∅ ∧ (∑ i : Fin n, (x i + c)) = (∑ i : Fin n, (y i - c)) ∧ (∑ i : Fin n, (x i + c)^2) = (∑ i : Fin n, (y i - c)^2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-192756,"Prove that for a positive integer \(n\) and non - zero integers \(k_0,k_1,\dots,k_{2n}\) such that \(k_0 + k_1+\cdots + k_{2n}\neq0\), there exists a permutation \((a_0,a_1,\dots,a_{2n})\) of \((k_0,k_1,\dots,k_{2n})\) such that the polynomial equation \(a_{2n}x^{2n}+a_{2n - 1}x^{2n-1}+\cdots + a_0 = 0\) has no integer roots.","import Mathlib theorem Polynomial.Roots (n : ℕ) (hn : 0 < n) (k : Fin (2 * n + 1) → ℤ) (hk : ∀ i, k i ≠ 0) (hsum : ∑ i, k i ≠ 0) : ∃ p : Equiv.Perm (Fin (2 * n + 1)), ¬∃ x : ℤ, ∑ i : Fin (2 * n + 1), (p i) * x ^ i.val = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-192784,"Given a graph \(G\) with \(n\) vertices, let \(d(v)\) denote the set of vertices adjacent to \(v\) for all \(v \in G\). It is given that \(|d(x) \cap d(y)|\) is even for all distinct \(x, y \in G\). Prove that \(n\), the number of vertices of \(G\), is odd.","import Mathlib theorem OddN {n : ℕ} (hn : n > 0) (d : Fin n → Set (Fin n)) (h : ∀ x y, x ≠ y → Even ((d x ∩ d y).ncard)) : Odd n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-193264,"Let \(n\) be a positive integer, and let \(A\) be a subset of the set \(\{1, 2, 3, \ldots, 4n\}\) such that \(|A| = 3n + 1\). Prove that \(A\) contains three distinct elements \(a, b, c\) such that \(a\) divides \(b\) and \(b\) divides \(c\).","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (A : Finset ℕ) (hA : A ⊆ Finset.Icc 1 (4 * n)) (hA' : A.card = 3 * n + 1) : ∃ a ∈ A, ∃ b ∈ A, ∃ c ∈ A, a ≠ b ∧ a ≠ c ∧ b ≠ c ∧ a ∣ b ∧ b ∣ c := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-193738,"Prove that for any sequence of \(mn + 1\) real numbers \(a_1, a_2, \dots, a_{mn+1}\), there exists either an increasing subsequence of length \(n + 1\) or a decreasing subsequence of length \(m + 1\).","import Mathlib open Finset Real theorem prove (n m : ℕ) (hn : 0 < n) (hm : 0 < m) (a : Fin (m * n + 1) → ℝ) : ∃ b : Finset (Fin (m * n + 1)), b.card = n + 1 ∧ (∀ i ∈ b, ∀ j ∈ b, i < j → a i < a j) ∨ ∃ b : Finset (Fin (m * n + 1)), b.card = m + 1 ∧ (∀ i ∈ b, ∀ j ∈ b, i < j → a i > a j) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-193882,"Prove that if $p$ is a prime number and $n \in \mathbb{N}_+$ such that $n < p < \frac{3}{2}n$, then $p$ divides $\sum_{i=0}^{n}(-1)^i \binom{n}{i}^3$.","import Mathlib theorem Prove (p n : ℕ) [hp : Fact (Nat.Prime p)] (hnpos : 0 < n) (hn : n < (p : ℚ) ∧ p < 3 / 2 * n) : (p : ℤ) ∣ ∑ i ∈ Finset.range (n + 1), (-1 : ℤ) ^ i * Nat.choose n i ^ 3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-194502,"Prove that for any \(2^{n + 1}\) natural numbers given, there exist \(2^n\) numbers among them such that their sum is divisible by \(2^n\), where \(n\) is a natural number.","import Mathlib theorem prove (n : ℕ) (s : Finset ℕ) (h₀ : s.card = 2^(n + 1)) : ∃ t ⊆ s, t.card = 2^n ∧ ∑ i ∈ t, i ≡ 0 [ZMOD 2^n] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-194961,"Let \(S = \{1, 2, 3, \dots, n\}\). Let \(A\) be a subset of \(S\) such that for any \(x, y \in A\), either \(x + y \in A\) or \(x + y - n \in A\). Prove that the number of elements in \(A\) divides \(n\).","import Mathlib theorem q (n : ℕ) (A : Finset ℕ) (hA : A ⊆ Finset.Icc 1 n) (hA' : ∀ x ∈ A, ∀ y ∈ A, (x + y ∈ A ∨ x + y - n ∈ A)) : A.card ∣ n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-195175,"Prove that in the New Republic, if there are \(n\) senators and \(n + 1\) three - member committees with no two committees having the same membership, then there exist at least two committees that share exactly one member.","import Mathlib theorem new_representatives (n : ℕ) (hn : n > 0) (a : Finset (Finset (Fin n))) (ha : a.card = n + 1) (h : ∀ s ∈ a, s.card = 3) : ∃ s ∈ a, ∃ t ∈ a, s ≠ t ∧ (s ∩ t).card = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-195227,"Prove that for integers \(m > n\) and a prime \(p \geq 5\), the following congruence holds: \[ \binom{mp}{np} \equiv \binom{m}{n} \pmod{p^3} \]","import Mathlib theorem Nat.choose_eq (m n p : ℕ) (hmn : m > n) (hp : Nat.Prime p ∧ p ≥ 5) : Nat.choose (m * p) (n * p) ≡ Nat.choose m n [MOD p ^ 3] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-195241,"Let \(n \geqslant 2\) be an integer, and let \(S \subset \mathbb{R}\) be a set with cardinality \(n\). Prove that for any real number \(C\), the number of subsets \(A \subseteq S\) such that \(\sum_{a \in A} a = C\) is less than \(\frac{2^{n+1}}{n+1}\).","import Mathlib open Finset Real theorem number_of_subsets (n : ℕ) (hn : 2 ≤ n) (S : Finset ℝ) (hS : S.card = n) (C : ℝ) : {A : Finset ℝ | A ⊆ S ∧ ∑ a ∈ A, a = C}.ncard < 2^(n + 1) / (n + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-195399,"Prove that in any set of \(n + 1\) positive integers, where all prime factors of these integers belong to a fixed set of \(n\) primes, there exists a non - empty subset of these integers such that the product of the elements in this subset is a perfect square.","import Mathlib theorem prove (n : ℕ) (hn : 0 < n) (s : Finset ℕ) (h₀ : s.card = n) (h₁ : ∀ i ∈ s, Nat.Prime i) (a : Finset ℕ) (ha : a.card = n + 1) (h₂ : ∀ i ∈ a, ∀ p ∈ Nat.primeFactors i, p ∈ s) : ∃ t ⊆ a, t ≠ ∅ ∧ IsSquare (∏ i ∈ t, i) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-195675,"Prove that for every $k \in \mathbb{N}$, if $A(k)$ is defined as the cardinality of the set of integer pairs $(x, y) \in \mathbb{Z} \times \mathbb{Z}$ that satisfy the equation $x^2 + xy + y^2 = k$, then $A(k) \equiv 0 \pmod{6}$.","import Mathlib open Finset theorem A (k : ℕ) : {(x, y) : ℤ × ℤ | x ^ 2 + x * y + y ^ 2 = k}.ncard ≡ 0 [ZMOD 6] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-196394,"Prove that for an odd integer \(m \geq 5\), if \(D(m)\) denotes the number of quadruples \((a_1, a_2, a_3, a_4)\) of distinct integers such that \(1 \leq a_i \leq m\) for all \(i\) and \(m\) divides \(a_1 + a_2 + a_3 + a_4\), and there exists a polynomial \(q(x)=c_3x^3 + c_2x^2 + c_1x + c_0\) such that \(D(m)=q(m)\) for all odd integers \(m \geq 5\), then the value of \(c_1\) is \(14\).","import Mathlib theorem prove (D : ℕ → ℕ) (hD : ∀ m, D m = {(a1, a2, a3, a4) : ℕ × ℕ × ℕ × ℕ | a1 ≠ a2 ∧ a1 ≠ a3 ∧ a1 ≠ a4 ∧ a2 ≠ a3 ∧ a2 ≠ a4 ∧ a3 ≠ a4 ∧ 1 ≤ a1 ∧ a1 ≤ m ∧ 1 ≤ a2 ∧ a2 ≤ m ∧ 1 ≤ a3 ∧ a3 ≤ m ∧ 1 ≤ a4 ∧ a4 ≤ m ∧ m ∣ a1 + a2 + a3 + a4}.ncard) : ∃ q : Polynomial ℤ, ∀ m ≥ 5, Odd m → D m = q.eval (m : ℤ) ∧ q.coeff 1 = 14 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-196744,"Let $n \ge 2$ be a positive integer. For any integer $a$, let $P_a(x)$ denote the polynomial $x^n + ax$. Let $p$ be a prime number and define the set $S_a$ as the set of residues modulo $p$ that $P_a(x)$ attains, i.e., \[ S_a = \{ b \mid 0 \le b \le p-1, \text{ and there is } c \text{ such that } P_a(c) \equiv b \pmod{p} \}. \] Prove that the expression $\frac{1}{p-1} \sum_{a=1}^{p-1} |S_a|$ is an integer.","import Mathlib theorem sum_of_set (n : ℕ) (hn : n ≥ 2) (p : ℕ) (hp : Nat.Prime p) (S : ℕ → Set ℕ) (hS : ∀ a ∈ Finset.Icc 1 (p - 1), S a = {b | ∃ c, (c ^ n + a * c) ≡ b [MOD p]}) : ∃ k, (1 / (p - 1 : ℚ)) * ∑ a ∈ Finset.Icc 1 (p - 1), (Nat.card (S a)) = k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-198005,"Let $(X, d)$ be a complete metric space. Suppose $X$ is expressed as a countable union of closed subsets $X_n$, i.e., $X = \bigcup_{n=1}^{\infty} X_n$. Prove that at least one of the sets $X_n$ must have non-empty interior. In other words, prove that a complete metric space cannot be written as a countable union of closed sets with empty interior.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem complete_metric_space (X : Type*) [MetricSpace X] [CompleteSpace X] (Xn : ℕ → Set X) (hXn : ∀ n, IsClosed (Xn n)) (hX : X = ⋃ n, Xn n) : ∃ n, Nonempty (interior (Xn n)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-198048,"Let $(X, d)$ be a complete metric space, and suppose $X = \bigcup_{n=1}^\infty A_n$, where each $A_n \subseteq X$ is closed and has empty interior. Prove that $\bigcup_{n=1}^\infty A_n \neq X$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MetricCompleteSpace {X : Type*} [MetricSpace X] [CompleteSpace X] (A : ℕ → Set X) (hA : ∀ n, IsClosed (A n)) (hA' : ∀ n, ∅ = interior (A n)) : ⋃ n, A n ≠ ⊤ := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-198167,"Let $A_0, B_0$ be non-empty subsets of $\\mathbb{Q}\\$ (the set of rational numbers) such that the following conditions hold: \\ 1. $A_0$ does not have a maximal element. \\ 2. $ orall a \\in A_0, b \\in B_0$, $a < b$. \\ 3. For all $n \\in \\mathbb{Z}^+$, there exist $a \\in A_0, b \\in B_0$ such that $b - a < \\frac{1}{n}$. \\ Prove that there exists a unique Dedekind cut $(A, B)$ such that $A_0 \\subseteq A$ and $B_0 \\subseteq B$, where: \\ $$A = \\bigcup_{a \\in A_0} \\{q \\in \\mathbb{Q} \\mid q < a \\}$$ \\ $$B = \\mathbb{Q} \\setminus A.$$","import Mathlib theorem rational_dedekind_cut {A0 B0 : Set ℚ} (hA0 : A0.Nonempty) (hB0 : B0.Nonempty) (hAmax : ¬∃ a ∈ A0, ∀ b ∈ A0, a ≤ b) (hAB : ∀ a ∈ A0, ∀ b ∈ B0, a < b) (hn : ∀ n > 0, ∃ a ∈ A0, ∃ b ∈ B0, b - a < 1 / n) : ∃! ab : Set ℚ × Set ℚ, let (A, B) := ab A0 ⊆ A ∧ B0 ⊆ B ∧ A = ⋃ a ∈ A0, {x | x < a} ∧ B = {x | x ∉ A} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-198176,"Let $S$ and $T$ be subsets of $\mathbb{R}^n$ with Lebesgue measure zero. Prove that it is possible for the Minkowski difference $S - T = \{s - t \mid s \in S, t \in T\}$ to have positive Lebesgue measure.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Minkowski_diff_pos_leb (n : ℕ) (S T : Set (EuclideanSpace ℝ (Fin n))) (hS : MeasureTheory.volume S = 0) (hT : MeasureTheory.volume T = 0) : ∃ U : Set (EuclideanSpace ℝ (Fin n)), U = {x | ∃ s ∈ S, ∃ t ∈ T, x = s - t} ∧ MeasureTheory.volume U > 0 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-198377,"Let \( \{a(i, n)\}_{i, n \in \mathbb{N}} \) be a doubly-indexed sequence where \( a(i, n) = \int_{A_i} f_n \, d\lambda \), and suppose that for each fixed \( i \), the sequence \( \{a(i, n)\}_{n \in \mathbb{N}} \) is bounded. Prove that there exists a diagonal subsequence \( \{k_n\}_{n \in \mathbb{N}} \) such that for each \( i \in \mathbb{N} \), the sequence \( \{a(i, k_n)\}_{n \in \mathbb{N}} \) converges as \( n \to \infty \).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem doubleIndexedSequence (A : ℕ → Set ℝ) (f : ℕ → ℝ → ℝ) (a : ℕ → ℕ → ℝ) (h₀ : ∀ i n, a i n = ∫ x in A i, f n x) (h₁ : ∀ i, Bornology.IsBounded {x | ∃ n, a i n = x}) : ∃ k : ℕ → ℕ, (∀ i, ∃ L, Tendsto (λ n => a i (k n)) atTop (𝓝 L)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-198496,"Let $(X, \nu)$ be a measure space and let $E_1, E_2, \dots, E_n \subseteq X$ be measurable sets. Prove that the measure of the union of these sets is given by: $$\nu\left(\bigcup_{k=1}^n E_k\right) = \sum_{\emptyset \neq S \subseteq [n]} (-1)^{|S|-1} \nu\left(\bigcap_{k \in S} E_k\right),$$ where $|S|$ denotes the cardinality of the set $S$ and $[n] = \{1, 2, \dots, n\}.$$","import Mathlib open Finset Real MeasureTheory theorem proveUnionMeasure {X : Type*} [MeasureSpace X] (n : ℕ) (hn : 0 < n) (E : Fin n → Set X) : (MeasureTheory.volume (⋃ k : Fin n, E k)).toReal = ∑ S : Finset (Fin n), (-1) ^ (S.card - 1) * (MeasureTheory.volume (⋂ k ∈ S, E k)).toReal := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-198534,Let $z \\in \\\mathbb{C}$. Prove that the sine function $\\sin(z)$ can be expressed as an infinite product as follows: $$ \\frac{\\sin(z)}{z} = \\prod_{k \\geq 1} \\left(1 - \\frac{z^2}{k^2\\pi^2}\\right). $$,"import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem sin_infinite_product (z : ℂ) : sin z / z = ∏' k : ℕ, if k ≥ 1 then (1 - z ^ 2 / (k ^ 2 * π ^ 2)) else 1 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-198770,"Let $(X, d)$ be a complete metric space. Suppose $\\{U_n\\}_{n \\in \\mathbb{N}}$ is a countable collection of open and dense subsets of $X$. Prove that the intersection $\\bigcap_{n=1}^\\infty U_n$ is also dense in $X$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem complete_metric_space (X : Type*) [MetricSpace X] [CompleteSpace X] (U : ℕ → Set X) (hU : ∀ n, IsOpen (U n)) (hU' : ∀ n, Dense (U n)) : Dense (⋂ n, U n) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-198874,"Let $(X, d)$ be a complete metric space. Suppose $\\{A_n\\}_{n \\in \\\mathbb{N}}$ is a countable collection of closed sets in $X$ such that $\\bigcup_{n \\in \\\mathbb{N}} A_n = X$. Prove that at least one of the sets $A_n$ has non-empty interior.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem complete_space (X : Type*) [MetricSpace X] [CompleteSpace X] (A : ℕ → Set X) (hA : ∀ n, IsClosed (A n)) (hA' : ⋃ n, A n = ⊤) : ∃ n, ∃ x ∈ A n, x ∈ interior (A n) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199051,"Let $E \\subseteq \\mathbb{R}$ be a set defined as $E = \\{r_1, r_2, \\ldots, r_n\\}$, where $r_1, r_2, \\ldots, r_n$ are arbitrary real numbers, and let $x \\in \\mathbb{R}$. If at least one $r_i$ is an irrational number, prove that there does not exist a general algorithm that can determine, for all possible inputs $x$, whether $x \\in E$. This follows from the inherent undecidability of exact equality involving irrational numbers in a computational framework.","import Mathlib open Real Set open scoped BigOperators theorem uncomputable_eq (n : ℕ) (hn : 0 < n) (E : Finset ℝ) (hE : E.card = n) (x : ℝ) (hx : ∃ i ∈ E, Irrational i) : ¬ ∃ f : ℝ → Prop, ∀ x : ℝ, f x ↔ x ∈ E := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199077,"Let $E \subseteq \mathbb{R}$ be a closed subset with empty interior, and let $\mathbb{Q}$ denote the set of rational numbers. Prove that the set $E + \mathbb{Q} = \{e + q \mid e \in E, q \in \mathbb{Q}\}$ is not equal to the entire set of real numbers $\mathbb{R}$. In other words, prove that there exist real numbers $r \in \mathbb{R}$ such that $r \notin E + \mathbb{Q}$.","import Mathlib theorem SetClosedEmptyInterior (E : Set ℝ) (hE : IsClosed E) (hE' : ∀ x ∈ E, x ∉ interior E) : ¬(∀ r : ℝ, ∃ e ∈ E, ∃ q : ℚ, r = e + q) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199127,"Let $(X, d)$ be a complete metric space. Suppose $\\{U_n\\}_{n=1}^\\infty$ is a countable collection of open dense subsets of $X$. Prove that the intersection $\\bigcap_{n=1}^\\infty U_n$ is also dense in $X$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem closure_of_intercept (X : Type*) [MetricSpace X] [CompleteSpace X] (U : ℕ → Set X) (hU : ∀ n, IsOpen (U n)) (hU' : ∀ n, Dense (U n)) : Dense (⋂ n, U n) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199161,"Let $N$ be a positive integer, and $[a,b]$ be a closed interval in $ ext{ℝ}$. Define the density $ ext{μ}_N([a,b])$ as follows: \[ ext{μ}_N([a,b]) = \frac{|\{(m,n) \in \mathbb{Z}^2 : m + n\pi \in [a,b], \; -N \leq m,n \leq N\}|}{(2N+1)^2}, \] where $|\cdot|$ denotes the cardinality of the set. Prove that as $N \to \infty$, $ ext{μ}_N([a,b])$ converges to a limiting value that reflects the density of integer combinations of $m$ and $n$ in $[a,b]$.","import Mathlib open Real Filter Function open scoped Topology theorem μ (a b : ℝ) (ha : a < b) : ∃ x, Tendsto (λ N => {p : ℤ × ℤ | p.1 + p.2 * π ∈ Set.Icc a b ∧ -N ≤ p.1 ∧ p.1 ≤ N ∧ -N ≤ p.2 ∧ p.2 ≤ N}.ncard / (2 * N + 1)^2) atTop (𝓝 x) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199213,"Let $\mathcal{P}(\mathbb{N})$ denote the power set of $\mathbb{N}$. Prove that $\mathcal{P}(\mathbb{N})$ has the same cardinality as the set of real numbers $\mathbb{R}$, denoted by $\mathfrak{c}$. Formally, prove that $\text{card}(\mathcal{P}(\mathbb{N})) = \mathfrak{c}$.","import Mathlib open Set Real theorem card_power_set : (Set.univ : Set (Set ℕ)).encard = c := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199242,Let $X$ be a locally compact Hausdorff space. Suppose $X$ is also a Lindelöf space. Prove that $X$ is a normal space.,"import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem normalSpace {X : Type*} [TopologicalSpace X] (hX : LocallyCompactSpace X) (hX' : T2Space X) (hX'' : LindelofSpace X) : NormalSpace X := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199273,"Let $A$ be an infinite set. Prove that there exists a proper subset $B \neq A$ such that there exists an injective function $f: A \to B$ that is also surjective (i.e., a bijection).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem infinite_set {α : Type*} [Infinite α] : ∃ B : Set α, B ≠ ⊤ ∧ (∃ f : α → B, Function.Injective f ∧ Function.Surjective f) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199398,"Let $(X, d)$ be a metric space and $(x_k)$ a sequence in $X$. Prove that $(x_k)$ is statistically convergent to $\\ell \\in X$, denoted as $\\operatorname{st} - \\lim_{n\\to \\infty}x_{n}= \\ell$, if for every $\\varepsilon > 0$, \\lim_{n\\to \\infty}\\frac{1}{n}\\left|\\{k \\leq n : d(x_k, \\ell) \\geq \\varepsilon\\}\\\\right| = 0.$","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (X : Type*) [MetricSpace X] (x : ℕ → X) (l : X) (h : ∀ ε > 0, Tendsto (λ n => {k | k ≤ n ∧ dist (x k) l ≥ ε}.ncard / n) atTop (𝓝 0)) : Tendsto x atTop (𝓝 l) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199430,"Let $S$ be a set of statements in a formal language. Assume that every finite subset $S_f \triangleq \text{finite subset of } S$ is consistent (i.e., does not contain contradictions). Prove that the set $S$ itself is consistent.","import Mathlib open Finset theorem Consistency {S : Set Prop} (hS : ∀ T ⊆ S, T.Finite → ¬∃ x ∈ T, x ∧ ¬x) : ¬∃ x ∈ S, x ∧ ¬x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199467,"Let $f: \mathbb{R}^n \to \mathbb{R}^m$ be a continuously differentiable function. Prove that if $A \subseteq \mathbb{R}^n$ is a set of measure zero (a nullset), then the image $f(A) \subseteq \mathbb{R}^m$ is also a set of measure zero.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem ContinuousDifferentiable {n m : ℕ} (f : EuclideanSpace ℝ (Fin n) → EuclideanSpace ℝ (Fin m)) (hf : ContDiff ℝ 1 f) (A : Set (EuclideanSpace ℝ (Fin n))) (hA : MeasureTheory.volume A = 0) : MeasureTheory.volume (f '' A) = 0 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199487,"Let $X$ be a set and $P(x, y)$ be a predicate such that for every $x \\in X$, there exists a $y \\in Y$ satisfying $P(x, y)$. Prove that in Intuitionistic Type Theory, there exists a function $f: X \\to Y$ such that $P(x, f(x))$ holds for all $x \\in X$.","import Mathlib open Set theorem exists_function {X Y : Type*} {P : X → Y → Prop} (h : ∀ x, ∃ y, P x y) : ∃ f : X → Y, ∀ x, P x (f x) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199549,"Let $(X, \tau)$ be a topological space, $E \subseteq X$ be a closed subset, and $\{X_n\}_{n \in \mathbb{N}}$ be a sequence of open subsets of $X$. Assume that each $X_n$ is dense in $X$, i.e., $\overline{X_n} = X$ for all $n \in \mathbb{N}$. Prove that it is possible for $\cap_{n \in \mathbb{N}} X_n$ to be dense in $X$ while $\cap_{n \in \mathbb{N}} X_n \cap E = \emptyset$.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem possible_density (X : Type*) [TopologicalSpace X] (E : Set X) (hE : IsClosed E) (Xs : ℕ → Set X) (hXs : ∀ n, IsOpen (Xs n)) (hXs' : ∀ n, Dense (Xs n)) : ∃ D, Dense D ∧ D = ⋂ n, Xs n ∧ D ∩ E = ∅ := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199552,Let $f: \\mathbb{R}^n \\to \\mathbb{R}^m$ be a continuously differentiable function. Let $A \\subset \\mathbb{R}^n$ be a set of measure zero. Prove that $f(A) \\subset \\mathbb{R}^m$ is also a set of measure zero.,"import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MeasureTheory.fmap_zero (n m : ℕ) (f : EuclideanSpace ℝ (Fin n) → EuclideanSpace ℝ (Fin m)) (hf : ContDiff ℝ 1 f) (A : Set (EuclideanSpace ℝ (Fin n))) (hA : MeasureTheory.volume A = 0) : MeasureTheory.volume (f '' A) = 0 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199593,"Let $(X, d)$ be a complete metric space, and let $\{\Omega_n\}_{n \in \mathbb{N}}$ be a countable collection of open dense subsets of $X$. Prove that the intersection $\bigcap_{n=1}^\infty \Omega_n$ is dense in $X$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem countable_dense_Ω (X : Type*) [MetricSpace X] [CompleteSpace X] (Ω : ℕ → Set X) (hΩ : ∀ n, IsOpen (Ω n) ∧ Dense (Ω n)) : Dense (⋂ n, Ω n) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199655,"Let $(X, \tau)$ be a topological space. Assume that $X$ is a Baire space. Prove that for any countable collection of open dense sets $U_1, U_2, \dots, U_n, \dots$ in $X$, the intersection $\bigcap_{n=1}^\infty U_n$ is dense in $X$. Formally, if $U_i \subseteq X$ is open and dense for all $i \in \mathbb{N}$, then for any non-empty open set $V \subseteq X$, $V \cap \bigcap_{n=1}^\infty U_n \neq \emptyset$.","import Mathlib open Filter Real Function open scoped Topology theorem Topology_BaireSpace {α : Type*} [TopologicalSpace α] (hBaireSpace : BaireSpace α) (U : ℕ → Set α) (hU : ∀ n, IsOpen (U n) ∧ Dense (U n)) : ∀ V, IsOpen V → V ≠ ∅ → V ∩ ⋂ n, U n ≠ ∅ := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199663,Let $k$ be a positive integer. Prove that the generalized summation formula $$S_k = \\sum_{n \geq k} \frac{k}{n} \binom{2n}{n+k} 2^{-2n}$$ satisfies $$S_k = 1.$$,"import Mathlib open Real open scoped BigOperators theorem sum_k (k : ℕ) (hk : 0 < k) : ∑' n : ℕ, (if n ≥ k then (k / (n : ℝ)) * Nat.choose (2 * n) (n + k) * 2 ^ (-2 * n : ℤ) else 0) = 1 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199724,"Let $u(x,t)$ be the solution to the PDE given by $K_1 \frac{\partial^2 u}{\partial x^2} + K_2 u = \frac{\partial u}{\partial t}$, where $K_1, K_2 > 0$, and $u_0$ is the initial condition at $t = 0$. Prove that the solution $u(x,t)$ can be expressed as: $$u(x,t) = \frac{2u_0}{\sqrt{\pi}} \int_{\frac{x}{2\sqrt{K_1t}}}^{\infty} \exp\left(-\lambda^2 - \frac{K_2x^2}{4K_1\lambda^2}\right) \ d\lambda$$ using Laplace Transforms and the convolution theorem.","import Mathlib open Real theorem pde_solution {K1 K2 : ℝ} (hK1 : K1 > 0) (hK2 : K2 > 0) (u : ℝ → ℝ → ℝ) (hu : ∀ x t, K1 * iteratedDeriv 2 (fun x => u x t) x + K2 * u x t = deriv (fun t => u x t) t) (u0 : ℝ) (hu0 : u 0 0 = u0) : ∀ x t, u x t = 2 * u0 / sqrt π * ∫ lambda in Set.Ioi (x / (2 * sqrt (K1 * t))), exp (-lambda ^ 2 - K2 * x ^ 2 / (4 * K1 * lambda ^ 2)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199735,"Let $A \\subseteq \\mathbb{R}$ be a countable dense set. Prove that the complement $A^c = \\mathbb{R} \\setminus A$ is not an $F_\\sigma$ set, i.e., $A^c$ cannot be expressed as a countable union of closed sets.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem countably_dense_set {A : Set ℝ} (hA : Countable A) (hA' : Dense A) : ¬ ∃ F : Set ℝ, F = Aᶜ ∧ ∃ U : ℕ → Set ℝ, (∀ i, IsClosed (U i)) ∧ Aᶜ = ⋃ i, U i := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199887,"Let $(P, rianglelefteq)$ be a partially ordered set such that every chain $C \\subseteq P$ has an upper bound $u \\in P$. Prove that $P$ contains at least one maximal element, i.e., an element $m \\in P$ such that there does not exist $x \\in P$ with $m \\triangleleft x$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem partial_order {P : Type*} [PartialOrder P] (h : ∀ C : Set P, ∃ u : P, ∀ x ∈ C, x ≤ u) : ∃ m : P, ¬∃ x : P, m < x := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199898,"Let $(X, d)$ be a complete metric space. Suppose $(A_n)_{n=1}^{ orall}$ is a countable collection of closed subsets of $X$ such that each $A_n$ has empty interior in $X$. Prove that the union $igcup_{n=1}^{ orall} A_n$ also has empty interior in $X$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem empty_interior {X : Type*} [MetricSpace X] [CompleteSpace X] (A : ℕ → Set X) (hA : ∀ n, IsClosed (A n)) (hA' : ∀ n, ¬ ∃ x ∈ (A n), x ∈ interior (A n)) : ¬ ∃ x, x ∈ interior (⋃ n, A n) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-199920,"Let $m_1, m_2, \\dots, m_k$ be pairwise coprime natural numbers with $m_i > 1$ for all $i$. Consider $k$ runners on a circular track of unit circumference, where the $i$-th runner has a constant speed of $\\frac{1}{m_i}$ laps per unit time. Prove that for any $\\varepsilon > 0$, there exists a time $t$ such that the distance between each runner and the origin is at least $\\varepsilon$ modulo 1, provided $\\varepsilon \\leq \\frac{1}{k}$. That is, each runner is 'lonely' at some time $t$.","import Mathlib theorem k_runners (k : ℕ) (hk : 0 < k) (m : Fin k → ℕ) (hm : ∀ i j, i ≠ j → Nat.Coprime (m i) (m j)) (hm1 : ∀ i, 1 < m i) (ε : ℝ) (hε : ε > 0) (hε1 : ε ≤ 1 / k) : ∃ t : ℝ, ∀ i : Fin k, ‖(t * (1 / m i)) % 1‖ ≥ ε := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-200003,"Let $Y(x, t)$ denote the transverse displacement of a beam of length $L$ subjected to an oscillatory force $P_0 \sin(\omega t)$. Assume the beam has a flexural rigidity $EI$ and a damping coefficient $b$. Prove that the solution to the boundary value problem, incorporating the effects of resonance and damping, is given by: $$Y(x,t)=\frac{b P_0 \sin(\omega t)}{2EI \omega}\cdot \left[\frac{\sinh((L-x)\sqrt{\omega/b})}{\sinh(L\sqrt{\omega/b})}-\frac{\sin((L-x)\sqrt{\omega/b})}{\sin(L\sqrt{\omega/b})} \right]$$ $$+\frac{2\omega P_0 b}{\pi EI} \sum_{n=1}^{\infty}\frac{\sin(n\pi x/L) \cdot \sin(bn^2\pi^2t/L^2)}{n(\omega^2-b^2n^4\pi^4/L^4)}.$$","import Mathlib open Real Set open scoped BigOperators theorem transverse_displacement {L : ℝ} (hL : L > 0) (P0 : ℝ) (hP0 : P0 > 0) (ω b : ℝ) (hω : ω > 0) (hb : b > 0) (E : ℝ) (hE : E > 0) (I : ℝ) (hI : I > 0) : let Y := λ x t => b * P0 * sin (ω * t) / (2 * E * I * ω) * (sinh ((L - x) * sqrt (ω / b)) / sinh (L * sqrt (ω / b)) - sin ((L - x) * sqrt (ω / b)) / sin (L * sqrt (ω / b))) + 2 * ω * P0 * b / (Real.pi * E * I) * ∑' n : ℕ, if n > 0 then sin (n * Real.pi * x / L) * sin (b * n ^ 2 * Real.pi ^ 2 * t / L ^ 2) / (n * (ω ^ 2 - b ^ 2 * n ^ 4 * Real.pi ^ 4 / L ^ 4)) else 0 Y = λ x t => b * P0 * sin (ω * t) / (2 * E * I * ω) * (sinh ((L - x) * sqrt (ω / b)) / sinh (L * sqrt (ω / b)) - sin ((L - x) * sqrt (ω / b)) / sin (L * sqrt (ω / b))) + 2 * ω * P0 * b / (Real.pi * E * I) * ∑' n : ℕ, if n > 0 then sin (n * Real.pi * x / L) * sin (b * n ^ 2 * Real.pi ^ 2 * t / L ^ 2) / (n * (ω ^ 2 - b ^ 2 * n ^ 4 * Real.pi ^ 4 / L ^ 4)) else 0 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-200116,"Let $SL(2, \\mathbb{R})$ denote the group of $2 \\times 2$ real matrices with determinant 1, equipped with the standard topology induced from $\\mathbb{R}^4$. Prove that $SL(2, \\mathbb{R})$ has no open subgroups.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem noOpenSubgroup : ¬ ∃ H : Set (Matrix (Fin 2) (Fin 2) ℝ), H ≠ ⊤ ∧ IsOpen H ∧ H ≤ {A | A.det = 1} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-200132,"Let $(X, d)$ be a complete metric space and let $\{U_i \mid i \in \mathbb{N}\}$ be a countable collection of dense open subsets of $X$. Prove that the intersection $\bigcap_{i=1}^{\infty} U_i$ is also dense in $X$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem complete_metric_space (X : Type*) [MetricSpace X] [CompleteSpace X] (U : ℕ → Set X) (hU : ∀ n, IsOpen (U n)) (hU' : ∀ n, Dense (U n)) : Dense (⋂ i, U i) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-200144,"Let $S$ be a finite set of integers, and let $p$ be a prime number. Suppose that for every subset $A \\subseteq S$ with $|A| = p$, the sum of the elements of $A$ is divisible by $p$. Prove that all elements of $S$ are congruent modulo $p$, i.e., $x \\equiv y \\pmod{p}$ for all $x, y \\in S$.","import Mathlib theorem Finset.card_eq_prime (S : Finset ℤ) (p : ℕ) (hp : Nat.Prime p) (hS : ∀ A ⊆ S, A.card = p → ∑ x ∈ A, x ≡ 0 [ZMOD p]) : ∀ x ∈ S, ∀ y ∈ S, x ≡ y [ZMOD p] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-200348,Let $K$ be a field and suppose there exists a topology $\tau$ on $K$ such that a function $f: K \to K$ is continuous if and only if $f$ is a polynomial. Prove that no such topology $\tau$ can exist.,"import Mathlib theorem TopologyField (K : Type*) [Field K] : ¬∃ τ : TopologicalSpace K, ∀ f : K → K, Continuous f ↔ ∃ p : Polynomial K, f = fun x => p.eval x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-200556,"Let $X$ be a locally compact space. Assume $X$ is a $KC$-space, meaning that every compact subset of $X$ is closed. Prove that $X$ is Hausdorff.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem LocallyCompactSpace.prove_hausdorff {X : Type*} [TopologicalSpace X] (hLocallyCompactSpace : LocallyCompactSpace X) (hKC : ∀ K : Set X, IsCompact K → IsClosed K) : T2Space X := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-200818,"Let $X$ be a topological space and suppose $X$ is a Baire space. A subset $A \\subseteq X$ is called nowhere dense if for every non-empty open set $U \\subseteq X$, there exists a non-empty open set $V \\subseteq U$ such that $V \\cap A = \\emptyset$. The complement of a nowhere dense set in $X$ is called a generic set. Prove that the union of countably many nowhere dense subsets of $X$ has an empty interior.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem proveUnionOfNowhereDense {X : Type*} [TopologicalSpace X] [BaireSpace X] (s : ℕ → Set X) (h₀ : ∀ n, IsNowhereDense (s n)) : ¬ ∃ U, IsOpen U ∧ U ⊆ ⋃ n, s n ∧ U ≠ ⊥ := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-200835,"Let $(X, d)$ be a complete metric space. Suppose $X$ is expressed as a countable union of closed sets, i.e., $X = \bigcup_{n=1}^\infty F_n$, where each $F_n \subseteq X$ is closed. Prove that at least one of the sets $F_n$ has a nonempty interior, i.e., there exists $n \in \mathbb{N}$ such that $\operatorname{int}(F_n) \neq \emptyset$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MetricCompleteSpace {X : Type*} [MetricSpace X] [CompleteSpace X] (F : ℕ → Set X) (hF : ∀ n, IsClosed (F n)) (hF' : ∀ x, ∃ n, x ∈ F n) : ∃ n, Nonempty (interior (F n)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-200921,"Let $(X, d)$ be a complete metric space. Suppose $\\{U_n\\}_{n \\in \\mathbb{N}}$ is a countable collection of dense open subsets of $X$. Prove that the intersection $\\bigcap_{n=1}^\\infty U_n$ is also dense in $X$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem T2 (X : Type*) [MetricSpace X] [CompleteSpace X] (U : ℕ → Set X) (hU : ∀ n, IsOpen (U n)) (hU' : ∀ n, Dense (U n)) : Dense (⋂ n, U n) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-200926,"Let $X$ be a topological space that is locally connected, locally compact, and separable. Prove that if $X$ is connected, then $X$ is path connected.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem pathConnected (X : Type*) [TopologicalSpace X] (hlocallyConnected : LocallyConnectedSpace X) (hlocallyCompact : LocallyCompactSpace X) (hseparable : SeparableSpace X) : ConnectedSpace X → PathConnectedSpace X := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-201037,Let $X$ be a compact topological space and $Y$ be a paracompact topological space. Prove that the product space $X \times Y$ is paracompact.,"import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem paracompact (X Y : Type*) [TopologicalSpace X] [TopologicalSpace Y] (hX : CompactSpace X) (hY : ParacompactSpace Y) : ParacompactSpace (X × Y) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-201181,"Let $f_0: X o X$ be the identity function, representing the number zero, and let $f_1: X o X$ be a function representing the successor operation in a number system. Define the sequence of functions $\\{f_n\\}_{n \\in \\mathbb{N}}$ recursively as follows: \\[ f_0(x) = x, \\quad f_{n+1}(x) = f_1(f_n(x)), \\] for all $x \\in X$. Prove that the sequence $\\{f_n\\}$ corresponds to the natural numbers in an alternative number system constructed within lambda calculus, where $f_n$ represents the number $n$ and arithmetic operations can be defined through functional composition.","import Mathlib open Finset theorem lambdaCalculus {X : Type*} [Nonempty X] (f : ℕ → X → X) (h₀ : ∀ x, f 0 x = x) (h₁ : ∀ n x, f (n + 1) x = f 1 (f n x)) : ∃ g : ℕ → X → X, (∀ x, g 0 x = x) ∧ (∀ n x, g (n + 1) x = g 1 (g n x)) ∧ ∀ n, f n = g n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-201303,"Let $[n] = \{1, 2, \ldots, n\}$ and let $\mathcal{P}([n])$ be the poset of subsets of $[n]$ ordered by inclusion. Let $A, B \subseteq [n]$ and let $|B \setminus A|$ denote the cardinality of the set difference $B \setminus A$. Prove that the Möbius function $\mu$ of $\mathcal{P}([n])$ is given by: $$\mu(A, B) = \begin{cases} 0 & \text{if } A \not\subseteq B, \\ (-1)^{|B \setminus A|} & \text{if } A \subseteq B. \end{cases}$$","import Mathlib open Finset theorem Finset.moebius {n : ℕ} (hn : 0 < n) (A B : Finset ℕ) (hA : A ⊆ Icc 1 n) (hB : B ⊆ Icc 1 n) : let mu := fun x y => if x ⊆ y then (-1) ^ (y.card - x.card) else 0 mu A B = if A ⊆ B then (-1) ^ (B.card - A.card) else 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-201399,"Let $f: \\mathbb{R}^n \\to \\mathbb{R}^m$ be a continuous map. Suppose $f$ is also injective and open. Prove that $n \\leq m$, where $n$ and $m$ denote the dimensions of the domain and codomain, respectively.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem ContinuousMapOpenFunction {n m : ℕ} (f : EuclideanSpace ℝ (Fin n) → EuclideanSpace ℝ (Fin m)) (h₀ : Continuous f) (h₁ : Function.Injective f) (h₂ : IsOpenMap f) : n ≤ m := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-201405,Let $\{S_i\}_{i \in I}$ be a family of non-empty sets indexed by a set $I$. Prove that there exists a choice function $f: I \to \bigcup_{i \in I} S_i$ such that $f(i) \in S_i$ for all $i \in I$.,"import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem choice_function {α : Type*} {β : Type*} (S : α → Set β) (hS : ∀ i, S i ≠ ∅) : ∃ f : α → β, ∀ i, f i ∈ S i := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-201424,"Let $(X, d)$ be a complete metric space, and let $\\{U_n\\}_{n=1}^\\infty$ be a countable collection of open dense subsets of $X$. Prove that the intersection $\\bigcap_{n=1}^\\infty U_n$ is also dense in $X$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem countably_dense (X : Type*) [MetricSpace X] [CompleteSpace X] (U : ℕ → Set X) (hU : ∀ n, IsOpen (U n) ∧ Dense (U n)) : Dense (⋂ n, U n) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-201429,"Let $Z$ and $Y$ be two topological spaces, and suppose $Z$ can be continuously deformed into $Y$ through a series of transformations such that no tearing or gluing occurs, and specific positional constraints (e.g., marked points and edges) are preserved. Prove that $Z$ and $Y$ are homeomorphic, i.e., there exists a continuous bijection $f: Z \to Y$ with a continuous inverse $f^{-1}: Y \to Z$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem homeomorphic {Z Y : Type*} [TopologicalSpace Z] [TopologicalSpace Y] (hZ : ∃ f : Z → Y, Continuous f ∧ Function.Bijective f) (hY : ∃ g : Y → Z, Continuous g ∧ Function.Bijective g) : ∃ h : Z → Y, Continuous h ∧ Function.Bijective h := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-201907,"Let $b(n)$ denote the number of binary Lyndon words of length $n$, given by the formula $b(n) = \frac{1}{n} \sum \limits_{d \mid n} \mu(d) 2^{n/d}$, where $\mu(d)$ is the Möbius function. Let $a(n)$ denote the sequence A000740, such that $b(n) = \frac{2}{n} a(n)$. Prove that for $n \geq 3$ and $n$ not divisible by 3, $b(n)$ is divisible by 3.","import Mathlib open Finset theorem b {b : ℕ → ℕ} (hb : ∀ n, b n = (∑ d ∈ (n.divisors : Set ℕ), ArithmeticFunction.moebius d * 2 ^ (n / d)) / n) (a : ℕ → ℕ) (ha : ∀ n, b n = 2 / n * a n) : ∀ n ≥ 3, ¬ 3 ∣ n → 3 ∣ b n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-201910,"Let $X$ be a topological space, and let $A \subseteq X$ be a set that is both an $F_{\sigma}$ set (a countable union of closed sets) and a $G_{\delta}$ set (a countable intersection of open sets). Prove that $A$ has the Baire property, meaning there exists a $G_{\delta}$ set $G \subseteq X$ and a meager set $M \subseteq X$ such that $A = G \cup M$.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem Baireproperty {X : Type*} [TopologicalSpace X] (A : Set X) (hA : ∃ U : ℕ → Set X, (∀ i, IsClosed (U i)) ∧ A = ⋃ i, U i) (hA' : ∃ V : ℕ → Set X, (∀ i, IsOpen (V i)) ∧ A = ⋂ i, V i) : ∃ G : Set X, (∃ U : ℕ → Set X, (∀ i, IsOpen (U i)) ∧ G = ⋂ i, U i) ∧ ∃ M : Set X, (∃ U : ℕ → Set X, (∀ i, IsClosed (U i)) ∧ M = ⋃ i, U i) ∧ A = G ∪ M := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-202179,"Let $(X, d)$ be a complete metric space, and let $\big\{U_n\big\}_{n \in \mathbb{N}}$ be a countable collection of open and dense subsets of $X$. Prove that the intersection $\bigcap_{n \in \mathbb{N}} U_n$ is dense in $X$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem countable_intersection {X : Type*} [MetricSpace X] [CompleteSpace X] (U : ℕ → Set X) (hU : ∀ n, IsOpen (U n)) (hU' : ∀ n, Dense (U n)) : Dense (⋂ n, U n) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-202227,"Let $E \subseteq \mathbb{R}$ be an $F_\sigma$ set, i.e., $E = \bigcup_{n=1}^\infty C_n$, where each $C_n$ is a closed set. Prove that there exists a function $f: \mathbb{R} \to \mathbb{R}$ such that the set of discontinuities of $f$ is exactly $E$, i.e., $D(f) = E$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Fσ_set (E : Set ℝ) (hE : ∃ C : ℕ → Set ℝ, (∀ n, IsClosed (C n)) ∧ E = ⋃ n, C n) : ∃ f : ℝ → ℝ, {x | ¬ ContinuousAt f x} = E := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-202230,"Let $\alpha$ be an irrational number. Define the set $S = \{m\alpha + n \mid m \in \mathbb{N}, n \in \mathbb{Z}\}$. Prove that the closure of $S$ in the real line is $\mathbb{R}$, i.e., $$\overline{S} = \mathbb{R}.$$","import Mathlib open Real Set open scoped BigOperators theorem closure_of {α : ℝ} (hα : Irrational α) : closure {x | ∃ m : ℕ, ∃ n : ℤ, x = m * α + n} = univ := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-202237,"Let $[0,1]$ denote the closed interval of real numbers from $0$ to $1$. Suppose $[0,1] = igcup_{n=1}^\infty I_n$, where $I_n$ are closed intervals such that $I_n \\cap I_m = \\emptyset$ for $n \\ eq m$. Prove that each $I_n$ must be a singleton set.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem proveEachIntroneIsSingleton (I : ℕ → Set ℝ) (hI : ∀ n, ∃ a b, I n = {x | a ≤ x ∧ x ≤ b}) (hI' : ∀ n m, n ≠ m → I n ∩ I m = ∅) (hI'' : ⋃ n, I n = Set.Icc 0 1) : ∀ n, ∃! x, x ∈ I n := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-202507,"Let $X$ be a locally compact Hausdorff space, and let $\{S_n\}_{n=1}^\infty$ be a sequence of open sets in $X$. Prove that \[ \text{int}\left(\bigcap_{n=1}^\infty \text{cl}(S_n)\right) = \text{int}\left(\text{cl}\left(\bigcap_{n=1}^\infty S_n\right)\right). \]","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem int_cl (X : Type*) [TopologicalSpace X] [LocallyCompactSpace X] [T2Space X] (S : ℕ → Set X) (hS : ∀ n, IsOpen (S n)) : interior (⋂ n, closure (S n)) = interior (closure (⋂ n, S n)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-202546,"Let $X$ be a locally compact Hausdorff space, $U \subset X$ be an open set, and $C \subset U$ be a compact set. Prove that there exists a compact set $D \subset U$ such that $C \subset \text{interior}(D)$ and $D \subset U$.","import Mathlib theorem LocallyCompactHausdorff (X : Type*) [TopologicalSpace X] [ LocallyCompactSpace X] [T2Space X] (U : Set X) (hU : IsOpen U) (C : Set X) (hC : IsCompact C ∧ C ⊆ U) : ∃ D : Set X, IsCompact D ∧ D ⊆ U ∧ C ⊆ interior D := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-202652,"Let $S$ denote the set of all non-increasing functions $f: \\mathbb{Q} o \\{0,1\\}$, where $\\mathbb{Q}$ is the set of rational numbers. Prove that $S$ is uncountable.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem uncountable {S : Set (ℚ → ℤ)} (hS : ∀ f ∈ S, ∀ x y, x ≤ y → f x ≤ f y) (hS' : ∀ f ∈ S, ∀ x, f x = 0 ∨ f x = 1) : ¬ Set.Countable S := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-202682,"Let $C \subseteq [0,1]$ denote the Cantor set, defined as the set of numbers in $[0,1]$ that can be expressed in a ternary representation $x = \sum_{k \in \mathbb{N}} \frac{x_k}{3^k}$ with $x_k \in \{0, 2\}$. Prove that $C$ is uncountable.","import Mathlib open Set Real theorem CantorSet : ¬ Countable {x : ℝ | x ∈ Icc 0 1 ∧ ∃ s : ℕ → ℕ, (∀ k, s k = 0 ∨ s k = 2) ∧ x = ∑' k, s k / 3 ^ k} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-202703,"Let $S$ be a finite subset of $ extbf{Z}$ (the set of integers), and let $T$ denote the group of translations acting on $S$, defined by $T(x) = x + t$ for $t \in extbf{Z}$. A subset $M \subseteq S$ is said to be minimally symmetric if for all $m \in M$, the only $t \in \textbf{Z}$ such that $T(m) = m$ for all $m \in M$ is $t = 0$. Prove that for any finite set $S \subseteq \textbf{Z}$, there exists a minimally symmetric subset $M \subseteq S$ such that $|M| \geq \lfloor |S| / 2 \rfloor$.","import Mathlib open Finset theorem forFiniteS : ∀ S : Finset ℤ, ∃ M : Finset ℤ, (∀ m ∈ M, ∀ t : ℤ, (∀ m ∈ M, m + t = m) → t = 0) ∧ M ⊆ S ∧ M.card ≥ ⌊(S.card : ℝ) / 2⌋ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-202732,"Let $X$ and $Y$ be non-empty sets, and let $F: X o \\mathcal{P}(Y)$ be a set-valued map, where $\\mathcal{P}(Y)$ denotes the power set of $Y$. A function $f: X o Y$ is called a selection of $F$ if $f(x) \\in F(x)$ for all $x \\in X$. Assume that $F(x)$ is non-empty for all $x \\in X$. Prove that a selection $f$ exists.","import Mathlib open Set theorem exist_selection {X Y : Type*} [Nonempty X] [Nonempty Y] (F : X → Set Y) (hF : ∀ x, F x ≠ ∅) : ∃ f : X → Y, ∀ x, f x ∈ F x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-202869,"Let $f_n$ be a sequence of continuous functions defined on $[0,1]$. Prove that there exists a sequence of positive scalars $a_n$ and a set $A \\subseteq [0,1]$ with $m(A^c) = 0$ (where $m$ denotes the Lebesgue measure) such that $$ \\lim_{n o \\infty} \\frac{f_n(x)}{a_n} = 0, \\quad \\forall x \\in A. $$","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem ContinuousSequence {f : ℕ → ℝ → ℝ} (hf : ∀ n, ContinuousOn (f n) (Set.Icc 0 1)) : ∃ a : ℕ → ℝ, (∀ n, 0 < a n) ∧ (∃ A : Set ℝ, A ⊆ Set.Icc 0 1 ∧ (MeasureTheory.volume (Aᶜ)).toReal = 0 ∧ ∀ x ∈ A, Tendsto (λ n => f n x / a n) atTop (𝓝 0)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-203018,"Let $S$ be a non-empty, closed, uncountable subset of $\mathbb{R}$. Prove that $S$ has the same cardinality as the set of real numbers $\mathbb{R}$, denoted by $c$. Formally, prove that there exists a bijection $f: S \to \mathbb{R}$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Set.NonemptyClosedUncountable (S : Set ℝ) (hS : IsClosed S) (hS1 : S.Nonempty) (hS2 : ¬ Countable S) : ∃ f : S → ℝ, Function.Bijective f := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-203042,"Let $(X, d)$ be a complete metric space, and let $\\{U_n\\}_{n=1}^\\infty$ be a sequence of open subsets of $X$ such that each $U_n$ is dense in $X$. Prove that the intersection $\\bigcap_{n=1}^\\infty U_n$ is also dense in $X$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem closure_inter {X : Type*} [MetricSpace X] [CompleteSpace X] (U : ℕ → Set X) (hU : ∀ n, IsOpen (U n)) (hU' : ∀ n, Dense (U n)) : Dense (⋂ n, U n) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-203043,"Let $H: \text{Programs} \to \text{Programs}$ be a mapping of programs to programs. Prove that there exists a program $q$ such that for any input $x$, $q(x)$ computes the same function as the program $H(q)$. Formally, prove that there exists $q$ such that: $$ \forall x, q(x) = H(q)(x). $$","import Mathlib open Finset theorem exist_q {H : (ℕ → ℕ) → (ℕ → ℕ)} : ∃ q : ℕ → ℕ, ∀ x : ℕ, q x = H q x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-203115,"Let $L_n(x)$ be the Laguerre polynomials defined as $$L_n(x) = \\sum_{j=0}^n (-1)^j \\frac{{n \\choose j}}{j!} x^j.$$ For all non-negative integers $m$ and $n$, prove that the following orthogonality condition holds: $$\\sum_{i=0}^m \\sum_{j=0}^n (-1)^{i+j} {m \\choose i} {n \\choose j} {i+j \\choose i} = \\delta_{m,n},$$ where $\\delta_{m,n}$ is the Kronecker delta function.","import Mathlib open Finset Real Polynomial theorem orthogonal_laguerre (m n : ℕ) : ∑ i ∈ range (m + 1), ∑ j ∈ range (n + 1), (-1 : ℝ) ^ (i + j) * Nat.choose m i * Nat.choose n j * Nat.choose (i + j) i = if m = n then 1 else 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-203134,"Let $X$ be a connected, compact topological space. Prove that $X$ cannot be written as a countable union of closed, disjoint, non-empty subsets, i.e., prove that there does not exist a collection $\mathcal{F} = \{F_i : i \in \mathbb{N}\}$ of closed, disjoint subsets of $X$ with $F_i \neq \emptyset$ for all $i \in \mathbb{N}$ such that $X = \bigcup_{i \in \mathbb{N}} F_i$.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem NoExistentiallyQuantifiedUnionOfClosedSets {X : Type*} [TopologicalSpace X] [CompactSpace X] [ConnectedSpace X] : ¬ ∃ (F : ℕ → Set X), (∀ i, IsClosed (F i)) ∧ (∀ i j, i ≠ j → Disjoint (F i) (F j)) ∧ (∀ i, F i ≠ ∅) ∧ X = ⋃ i, F i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-203223,"Let $(X, \tau)$ be a locally compact, regular topological space. Prove that there exists a nonempty compact $G_\delta$-set $C \subseteq X$.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem T2 {X : Type*} [TopologicalSpace X] (hT1 : LocallyCompactSpace X) (hT2 : RegularSpace X) : ∃ C : Set X, IsGδ C ∧ IsCompact C ∧ Nonempty C := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-203288,"Let $(X, d)$ be a complete metric space, and let $\big\{ U_n \big\}_{n=1}^\infty$ be a countable collection of subsets of $X$ such that each $U_n$ is open and dense in $X$. Prove that the intersection $\bigcap_{n=1}^\infty U_n$ is dense in $X$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem closureOfInter (X : Type*) [MetricSpace X] [CompleteSpace X] (U : ℕ → Set X) (hU : ∀ n, IsOpen (U n)) (hU' : ∀ n, Dense (U n)) : Dense (⋂ n, U n) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-203438,"Let $A, B \subseteq \mathbb{R}$ be measurable sets with positive Lebesgue measure. Prove that the sum set $A + B = \{a + b : a \in A, b \in B\}$ contains an open interval.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove_measurable_sum (A B : Set ℝ) (hA : MeasurableSet A) (hB : MeasurableSet B) (hA' : 0 < (MeasureTheory.volume A).toReal) (hB' : 0 < (MeasureTheory.volume B).toReal) : ∃ x y, x < y ∧ ∀ t ∈ Set.Ioo x y, ∃ a ∈ A, ∃ b ∈ B, t = a + b := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-203462,"Let $[0,1]$ be the closed interval in $\mathbb{R}$, and let $\{U_\alpha\}_{\alpha \in A}$ be an open cover of $[0,1]$. Prove that there exists a finite subset $\{U_{\alpha_1}, U_{\alpha_2}, \dots, U_{\alpha_n}\} \subseteq \{U_\alpha\}_{\alpha \in A}$ such that $[0,1] \subseteq \bigcup_{i=1}^n U_{\alpha_i}$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem T79880 (A : Type*) [TopologicalSpace A] (U : A → Set ℝ) (hU : ∀ i, IsOpen (U i)) (hU' : ∀ x ∈ Set.Icc 0 1, ∃ i, x ∈ U i) : ∃ s : Finset A, Set.Icc 0 1 ⊆ ⋃ i ∈ s, U i := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-203631,"Let $(X, d)$ be a complete metric space, and let $\big\{G_n\big\}_{n=1}^\infty$ be a countable collection of dense, open subsets of $X$. Prove that the intersection $\bigcap_{n=1}^\infty G_n$ is dense in $X$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem countable_collection_of_dense_and_open_set (X : Type*) [MetricSpace X] [CompleteSpace X] (G : ℕ → Set X) (hG : ∀ n, Dense (G n)) (hG' : ∀ n, IsOpen (G n)) : Dense (⋂ n, G n) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-203700,"Let $U \\subset \\\mathbb{R}^n$ and $V \\subset \\\mathbb{R}^n$ be open sets, and let $f: U \\\to V$ be a continuous and bijective function. Prove that $f$ is an open map, i.e., for every open set $W \\subset U$, the image $f(W)$ is open in $V$.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem f_omap {n : ℕ} (hn : 0 < n) {U V : Set (EuclideanSpace ℝ (Fin n))} (hU : IsOpen U) (hV : IsOpen V) (f : U → V) (hf : Continuous f) (hf' : Function.Bijective f) : ∀ W : Set U, IsOpen W → IsOpen (f '' W) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-203729,"Let $x$ be an irrational number, and let $T = \{\{n x\} : n \in \mathbb{N}\}$. Prove that $T$ is dense in $[0,1]$.","import Mathlib theorem closure_dense (x : ℝ) (hx : Irrational x) : closure {y | ∃ n : ℕ, y = (n * x) % 1} = Set.Icc 0 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-203792,"Let $X$ be a complete metric space. Prove that $X$ is a Baire space, which means that the union of countably many nowhere dense subsets of $X$ cannot equal $X$. Formally, if $\\{A_n\\}_{n \\in \\mathbb{N}}$ is a sequence of nowhere dense subsets of $X$, then: $$X \\neq igcup_{n=1}^{\\infty} A_n.$$","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem complete_space_baire (X : Type*) [MetricSpace X] [CompleteSpace X] : BaireSpace X := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-203810,"Let $(X, d_X)$ and $(Y, d_Y)$ be metric spaces, and let $f: X o Y$ be a continuous function. Assume that $X$ is a compact metric space. Prove that $f$ is uniformly continuous, i.e., for every $\\epsilon > 0$, there exists a \\delta > 0 such that for all $x_1, x_2 \\in X$, $d_X(x_1, x_2) < \\delta$ implies $d_Y(f(x_1), f(x_2)) < \\epsilon$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MetricContinuous (X Y : Type*) [MetricSpace X] [MetricSpace Y] (f : X → Y) (hf : Continuous f) (hX : CompactSpace X) : UniformContinuous f := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-203821,"Let $(0, 1)$ denote the open interval of real numbers between $0$ and $1$. Prove that it is not possible to express $(0, 1)$ as a countable union of disjoint open intervals $I_k$ (for $k eq k')$ such that each $I_k$ is strictly contained within $(0, 1)$.","import Mathlib open Real Set open scoped BigOperators theorem Ioo : ¬ ∃ I : ℕ → Set ℝ, (∀ i j, i ≠ j → Disjoint (I i) (I j)) ∧ (∀ i, IsOpen (I i)) ∧ (∀ i, (I i) ⊂ Ioo 0 1) ∧ (Ioo 0 1 = ⋃ i, I i) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-203977,"Let $D^n \\subset \\mathbb{R}^n$ be a compact and convex subset, and let $f: D^n \\to D^n$ be a continuous function. Prove that there exists at least one point $x \\in D^n$ such that $f(x) = x$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem D_n {n : ℕ} (D : Set (EuclideanSpace ℝ (Fin n))) (hD : IsCompact D) (hD' : Convex ℝ D) (f : D → D) (hf : Continuous f) : ∃ x, f x = x := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-204288,"Let $X$ be a locally compact Hausdorff space, $x \\in X$, and $U \\subset X$ be an open neighborhood of $x$. Prove that there exists an open neighborhood $W$ of $x$ such that $\\overline{W}$ (the closure of $W$) is compact and $\\overline{W} \\subset U$.","import Mathlib theorem LocallyCompactHousdorffSpace {X : Type*} [TopologicalSpace X] [LocallyCompactSpace X] [T2Space X] (x : X) (U : Set X) (hU : IsOpen U) (hU1 : x ∈ U) : ∃ W : Set X, IsOpen W ∧ x ∈ W ∧ IsCompact (closure W) ∧ closure W ⊂ U := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-204353,"Let $S = \{a_i : i \in I\}$ be an uncountable set of positive real numbers indexed by $I$. If the series $\sum_{i \in I} a_i$ is formed by summing all elements of $S$, prove that $\sum_{i \in I} a_i$ diverges to infinity.","import Mathlib open Real Filter Function open scoped Topology theorem uncountable_sum (I : Type*) [TopologicalSpace I] (a : I → ℝ) (ha : ∀ i, 0 < a i) (hun : ¬ Set.Countable {x | ∃ i, a i = x}) : ¬ Summable (λ i => a i) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-204457,Let $z \in \mathbb{C}$. Prove that the following product formula holds: $$ \cos\left(\frac{\pi z}{4}\right) - \sin\left(\frac{\pi z}{4}\right) = \prod_{n=1}^{\infty}\left(1 + \frac{(-1)^n z}{2n-1}\right). $$,"import Mathlib open Real Complex Filter Function Metric Finset open scoped BigOperators Topology theorem cos_diff (z : ℂ) : cos (π * z / 4) - sin (π * z / 4) = ∏' n : ℕ, if n > 0 then (1 + (-1)^n * z / (2 * n - 1)) else 1 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-204461,"Let $^{\mathbb{N}}\{0,1\}$ denote the set of all functions from $\mathbb{N}$ to $\{0,1\}$, and let $\mathbb{R}$ denote the set of real numbers. Prove that there exists a bijection $f: ^{\mathbb{N}}\{0,1\} \to \mathbb{R}$.","import Mathlib open Set Real theorem exist_bj_f : ∃ f : (ℕ → Fin 2) → ℝ, Function.Bijective f := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-204480,"Let $\vdash_m$ denote the provability relation in minimal logic. Prove that the implication $\mathsf{Peirce} \rightarrow \mathsf{Explosion}$ is not valid in minimal logic. Formally, prove that there does not exist a derivation in minimal logic such that: $\forall A. \vdash_m (\neg \neg A \rightarrow A) \rightarrow (F \rightarrow A)$.","import Mathlib open Real open scoped BigOperators theorem minl : ¬ (∀ A, (¬(¬A) → A) → (F → A)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-204514,"Let $(X, \tau)$ be a Fréchet-Urysohn space, and let $\sigma = \langle x_n : n \in \omega \rangle$ be a sequence in $X$. If $p \in X$ is a cluster point of $\sigma$, prove that there exists a subsequence $\langle x_{n_k} : k \in \omega \rangle$ of $\sigma$ such that $x_{n_k} \to p$ as $k \to \infty$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem frechet_urysohn {X : Type*} [TopologicalSpace X] (σ : ℕ → X) (p : X) (hp : p ∈ closure (Set.range σ)) : ∃ f : ℕ → ℕ, ∀ k, f k > 0 ∧ Tendsto (λ k => σ (f k)) atTop (𝓝 p) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-204531,"Let $f: \mathbb{R}^n \to \mathbb{R}$ be a continuous function, where $n \geq 2$. Prove that it is impossible for $f$ to be injective. In other words, prove that there does not exist a continuous and injective function from a higher-dimensional Euclidean space $\mathbb{R}^n$ (with $n \geq 2$) into the real line $\mathbb{R}$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem general_not_injective {n : ℕ} (hn : n ≥ 2) (f : EuclideanSpace ℝ (Fin n) → ℝ) (hf : Continuous f) : ¬ Function.Injective f := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-204536,"Let $D \subset \mathbb{R}$ be a countable dense subset of the real numbers. Prove that $D$ can be partitioned into countably many pairwise disjoint subsets $D_1, D_2, \dots$ such that each $D_i$ is dense in $\mathbb{R}$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem partition_dense_set (D : Set ℝ) (hD : Dense D) (hD1 : Countable D) : ∃ s : ℕ → Set ℝ, (∀ i j, i ≠ j → Disjoint (s i) (s j)) ∧ (∀ i, Dense (s i)) ∧ D = ⋃ i, s i := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-204634,"Let $E \subseteq \mathbb{R}$ be a measurable set with positive outer measure, i.e., $m^*(E) > 0$. Prove that there exists a subset $A \subseteq E$ such that $A$ is not Lebesgue measurable.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem proveMeasureTheory (E : Set ℝ) (hE : MeasurableSet E) (hE' : (MeasureTheory.volume E).toReal > 0) : ∃ A ⊆ E, ¬ MeasurableSet A := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-204667,"Let $x_1, x_2, \ldots, x_{2017}$ be a sequence of numbers where $x_i \in \{-1, 1\}$ for all $i$. Suppose the following conditions hold: 1. The sum of the squares of any 7 numbers equals 7: \[ \sum_{i \in S} x_i^2 = 7, \quad \text{for all subsets } S \subseteq \{1, 2, \ldots, 2017\} \text{ with } |S| = 7. \] 2. The sum of any 11 numbers is positive: \[ \sum_{i \in T} x_i > 0, \quad \text{for all subsets } T \subseteq \{1, 2, \ldots, 2017\} \text{ with } |T| = 11. \] 3. The sum of all 2017 numbers is divisible by 9: \[ \sum_{i=1}^{2017} x_i \equiv 0 \pmod{9}. \] Prove that the sequence $x_1, x_2, \ldots, x_{2017}$ consists of exactly 5 numbers equal to $-1$ and 2012 numbers equal to $1$.","import Mathlib theorem x (x : Fin 2017 → ℤ) (hx : ∀ i, x i = -1 ∨ x i = 1) (h1 : ∀ S : Finset (Fin 2017), S.card = 7 → ∑ i ∈ S, x i ^ 2 = 7) (h2 : ∀ T : Finset (Fin 2017), T.card = 11 → ∑ i ∈ T, x i > 0) (h3 : ∑ i, x i ≡ 0 [ZMOD 9]) : {i | x i = -1}.encard = 5 ∧ {i | x i = 1}.encard = 2012 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-204765,"Let $S$ be a finite set of positive integers such that for any $i, j \\in S$, the value $\\frac{i + j}{\\gcd(i, j)}$ is also in $S$. Prove that $S$ must have the form $S = \\{i, i^2 - i\\}$ for some integer $i \\geq 3$.","import Mathlib theorem FiniteSetOfIntegers (S : Finset ℕ) (hS : ∀ x ∈ S, ∀ y ∈ S, x ≠ 0 → y ≠ 0 → (x + y) / Nat.gcd x y ∈ S) (hS1 : ∀ x ∈ S, x > 0) : ∃ i, S = {i, i ^ 2 - i} ∧ i ≥ 3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-204766,"Let $a_1, a_2, \\ldots, a_{2n+1}$ be $2n+1$ positive integers such that for any selection of $2n$ numbers from this set, they can always be partitioned into two disjoint subsets of $n$ numbers each with equal sums. Prove that all $2n+1$ integers must be equal.","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (a : Fin (2 * n + 1) → ℤ) (ha : ∀ i, 0 < a i) (h : ∀ s : Finset (Fin (2 * n + 1)), s.card = 2 * n → ∃ t : Finset (Fin (2 * n + 1)), t ⊆ s ∧ t.card = n ∧ ∑ i ∈ t, a i = ∑ i ∈ s \ t, a i) : ∃ x, ∀ i, a i = x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-204792,"Let $A_1, A_2, \\ldots, A_{21}$ be 21 sets, each containing 55 elements, such that any four sets have at least one common element. Prove that there exists an element $a \\in A_1 \\cap A_2 \\cap \\ldots \\cap A_{21}$, i.e., all 21 sets have at least one common element.","import Mathlib theorem common_element (A : Fin 21 → Set ℤ) (card_A : ∀ i : Fin 21, (A i).ncard = 55) (any_four : ∀ i j k l : Fin 21, i ≠ j ∧ i ≠ k ∧ i ≠ l ∧ j ≠ k ∧ j ≠ l ∧ k ≠ l → ∃ x ∈ A i, x ∈ A j ∧ x ∈ A k ∧ x ∈ A l) : ∃ x, ∀ i : Fin 21, x ∈ A i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-205218,"Let \( S \) be an infinite set of positive integers. Define \[ S' = \{ x^y + y^x \mid x, y \in S, x \neq y \}. \] Prove that the set of prime factors of \( S' \) is infinite.","import Mathlib theorem Infinite_prime_factors (S : Set ℕ) (hS : Infinite S) (hS1 : ∀ n ∈ S, n > 0) : Infinite {p | p.Prime ∧ ∃ x ∈ S, ∃ y ∈ S, x ≠ y ∧ p ∣ x ^ y + y ^ x} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205231,"For a positive integer $n$, let $D$ denote the set of all positive divisors of $n$. Let $A, B$ be subsets of $D$ such that for any $a \in A$ and $b \in B$, neither $a$ divides $b$ nor $b$ divides $a$. Prove that: $$ \sqrt{|A|} + \sqrt{|B|} \leq \sqrt{|D|}. $$","import Mathlib theorem sqrt_divisors (n : ℕ) (hn : 0 < n) (A B : Finset ℕ) (hA : ∀ x ∈ A, ∀ y ∈ B, ¬(x ∣ y)) (hB : ∀ y ∈ B, ∀ x ∈ A, ¬(y ∣ x)) (hA' : A ⊆ Nat.divisors n) (hB' : B ⊆ Nat.divisors n) : Real.sqrt A.card + Real.sqrt B.card ≤ Real.sqrt (Nat.divisors n).card := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205236,"Prove that in any set of 2000 distinct real numbers, there exist real numbers \( a > b \) and \( c > d \) such that \( a \neq c \) or \( b \neq d \), and \[ \left|\frac{a - b}{c - d} - 1\right| < \frac{1}{10^5}. \]","import Mathlib theorem RealSet (s : Finset ℝ) (h₀ : s.card = 2000) : ∃ a ∈ s, ∃ b ∈ s, ∃ c ∈ s, ∃ d ∈ s, a > b ∧ c > d ∧ (a ≠ c ∨ b ≠ d) ∧ |(a - b) / (c - d) - 1| < 1 / 10 ^ 5 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205244,"Prove: In any 1400 distinct real numbers, there exist three numbers \( x, y, z \) such that \[ \left|\frac{(x-y)(y-z)(z-x)}{x^4+y^4+z^4+1}\right| < 0.002. \]","import Mathlib theorem s : ∀ s : Finset ℝ, s.card = 1400 → ∃ x ∈ s, ∃ y ∈ s, ∃ z ∈ s, |(x - y) * (y - z) * (z - x) / (x ^ 4 + y ^ 4 + z ^ 4 + 1)| < 0.002 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205248,"Let $A_1, A_2, \cdots, A_{2n}$ be non-empty subsets of $\{0, 1, \cdots, 2n-1\}$ such that $\sum_{i=1}^{2n} |A_i| = C_{2n+1}^2$. Prove that there exist elements $a_1, a_2, \cdots, a_{2n}$ with $a_i \in A_i$ for each $i$, such that $\sum_{i=1}^{2n} a_i = C_{2n}^2$.","import Mathlib theorem Finset.sum' (n : ℕ) (A : Fin (2 * n) → Set ℕ) (hA : ∀ i, A i ⊆ Finset.Icc 0 (2 * n - 1)) (hA' : ∀ i, A i ≠ ∅) (hA'' : ∑ i, (A i).ncard = Nat.choose (2 * n + 1) 2) : ∃ a : Fin (2 * n) → ℕ, (∀ i, a i ∈ A i) ∧ (∑ i, a i = Nat.choose (2 * n) 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205267,"Let $n$ be a positive integer such that $n \not\equiv 6 \pmod{8}$. Prove that in $n$-dimensional space, there do not exist $n+2$ points with pairwise odd distances.","import Mathlib open Finset Real EuclideanGeometry theorem Prove (n : ℕ) (hn : n > 0) (hne : ¬(n ≡ 6 [MOD 8])) : ¬∃ s : Finset (EuclideanSpace ℝ (Fin n)), s.card = n + 2 ∧ ∀ x ∈ s, ∀ y ∈ s, x ≠ y → Odd (dist x y) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205281,"Let $x_1, x_2, \cdots, x_n$ be $n$ distinct real numbers, and let $D = \max_{1 \leq i < j \leq n} |x_i - x_j|$. Prove that there exists a permutation $y_1, y_2, \cdots, y_n$ of $x_1, x_2, \cdots, x_n$ such that \begin{equation} \left|\sum_{i=1}^{n} iy_i\right| \geq \frac{n-1}{2} D. \end{equation}","import Mathlib open Finset Real theorem max_diff (n : ℕ) (hn : 0 < n) (x : Fin n → ℝ) (hx : ∀ i j, x i = x j → i = j) : ∃ p : Equiv.Perm (Fin n), ‖∑ i : Fin n, (i + 1) * x (p i)‖ ≥ ((n - 1) / 2) * sSup {abs (x i - x j) | (i : Fin n) (j : Fin n) (hij : i ≠ j)} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205289,"Let $n$ be a positive integer, and let $A$ be a subset of $\{0, 1, \cdots, 5^n\}$ with $4n + 2$ elements. Prove that there exist elements $a < b < c$ in $A$ such that $c + 2a > 3b$.","import Mathlib theorem Qwen (n : ℕ) (hn : n > 0) (A : Finset ℕ) (hA : A ⊆ Finset.Icc 0 (5 ^ n)) (hA' : A.card = 4 * n + 2) : ∃ a ∈ A, ∃ b ∈ A, ∃ c ∈ A, a < b ∧ b < c ∧ c + 2 * a > 3 * b := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205292,"Let real numbers \( x_1, x_2, \cdots, x_n \) satisfy \( |x_1 + x_2 + \cdots + x_n| = 1 \), and \( |x_i| \leq \frac{n+1}{2} \) for \( 1 \leq i \leq n \). Prove that there exists a permutation \( y_1, y_2, \cdots, y_n \) of \( x_1, x_2, \cdots, x_n \) such that \begin{equation} |y_1 + 2y_2 + \cdots + n y_n| \leq \frac{n+1}{2}. \end{equation}","import Mathlib open Finset Real theorem Finset.sum_permutations {n : ℕ} (hn : 0 < n) (x : Fin n → ℝ) (hsum : |∑ i : Fin n, x i| = 1) (hxi : ∀ i : Fin n, |x i| ≤ (n + 1) / 2) : ∃ p : Equiv.Perm (Fin n), |∑ i : Fin n, (i + 1) * x (p i)| ≤ (n + 1) / 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205293,"Let $A$ be a finite set of positive integers, and define $B = \left\{\frac{a + b}{c + d} \mid a, b, c, d \in A\right\}$. Prove that $|B| \geq 2|A|^2 - 1$.","import Mathlib theorem qwen {A : Finset ℕ} (hA : ∀ a ∈ A, a > 0) : Set.ncard {x | ∃ a b c d : ℕ, a ∈ A ∧ b ∈ A ∧ c ∈ A ∧ d ∈ A ∧ x = (a + b) / (c + d)} ≥ 2 * A.card ^ 2 - 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205369,"Let $z_1, z_2, \cdots, z_{2024}$ and $w_1, w_2, \cdots, w_{2024}$ be two sets of complex numbers satisfying: $\sum_{i=1}^{2024} |z_i|^2 > \sum_{i=1}^{2024} |w_i|^2$. Prove that there exists an array $(\varepsilon_1, \varepsilon_2, \cdots, \varepsilon_{2024})$ (where $\varepsilon_i \in \{-1, 1\}$) such that $\left| \sum_{i=1}^{2024} \varepsilon_i z_i \right| > \left| \sum_{i=1}^{2024} \varepsilon_i w_i \right|$.","import Mathlib theorem ComplexSum (z w : Fin 2024 → ℂ) (h₀ : ∑ i, ‖z i‖ ^ 2 > ∑ i, ‖w i‖ ^ 2) : ∃ ε : Fin 2024 → ℤ, (∀ i, ε i = -1 ∨ ε i = 1) ∧ ‖∑ i, ε i * z i‖ > ‖∑ i, ε i * w i‖ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205397,"Let $n \geq 4$ be an integer, and let $A, B$ be subsets of the set $\{1, 2, \cdots, n\}$. It is known that for any $a \in A$ and $b \in B$, the number $ab + 1$ is a perfect square. Prove that $\min\{|A|, |B|\} \leq \log_2 n$.","import Mathlib theorem log_2 (n : ℕ) (hn : 4 ≤ n) (A B : Finset ℕ) (hA : A ⊆ Finset.Icc 1 n) (hB : B ⊆ Finset.Icc 1 n) (hAB : ∀ a ∈ A, ∀ b ∈ B, ∃ k, k^2 = a * b + 1) : min (A.card) (B.card) ≤ Real.logb 2 n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205406,"Given $m = 42$, the set $S = \{1, 2, \cdots, 51m\}$. Let $A$ be a subset of $S$ such that $|A| = 50m$. Prove that there exist non-empty subsets $X, Y \subseteq S$ satisfying: (1) $X \cap Y = X \cap A = Y \cap A = \emptyset$; (2) $\sum_{x \in X} x = \sum_{y \in Y} y; \quad (3) \sum_{x \in X} x^2 = \sum_{y \in Y} y^2.$","import Mathlib theorem qwen {m : ℕ} (hm : m = 42) (S : Finset ℕ) (hS : S = Finset.Icc 1 (51 * m)) (A : Finset ℕ) (hA : A ⊆ S) (hA' : A.card = 50 * m) : ∃ X Y : Finset ℕ, X ⊆ S ∧ Y ⊆ S ∧ X ≠ ∅ ∧ Y ≠ ∅ ∧ X ∩ Y = ∅ ∧ X ∩ A = ∅ ∧ Y ∩ A = ∅ ∧ ∑ x ∈ X, x = ∑ y ∈ Y, y ∧ ∑ x ∈ X, x ^ 2 = ∑ y ∈ Y, y ^ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205434,"For an integer \( n > 1 \), define the set \[ D(n) = \{a - b \mid n = ab, a, b \text{ are positive integers}, a > b\}. \] Prove that for any integer \( k > 1 \), there exist \( k \) distinct integers \( n_1, n_2, \dots, n_k \) greater than 1 such that \[ |D(n_1) \cap D(n_2) \cap \cdots \cap D(n_k)| \geq 2. \]","import Mathlib open Finset theorem prove (k : ℕ) (hk : 1 < k) : ∃ s : Finset ℕ, s.card = k ∧ (∀ n ∈ s, 1 < n) ∧ {x | ∀ n ∈ s, ∃ a b : ℕ, a > 0 ∧ b > 0 ∧ a * b = n ∧ x = a - b}.ncard ≥ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205436,"For a set $A = \{a_1, a_2, \cdots, a_m\}$, denote $P(A) = a_1 a_2 \cdots a_m$. Let $A_1, A_2, \cdots, A_n$ (where $n = C_{2010}^{99}$) be all the 99-element subsets of the set $\{1, 2, \cdots, 2010\}$. Prove that $2011 \mid \sum_{i=1}^{n} P(A_i)$.","import Mathlib open Finset theorem qwen : 2011 ∣ ∑ A ∈ (Icc 1 2010).powerset.filter (fun x => x.card = 99), (∏ i ∈ A, i) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205443,"A function \( f: \mathbb{N} \times \mathbb{N} \to \mathbb{Z} \) is called ""good"" if for any non-negative integers \( m, n \), the following holds: \[ f(m + 1, n + 1) f(m, n) - f(m + 1, n) f(m, n + 1) = 1. \] Let \( A = (a_0, a_1, \cdots) \) and \( B = (b_0, b_1, \cdots) \) be two integer sequences. If there exists a good function \( f \) such that for any non-negative integer \( n \), \( f(n, 0) = a_n \) and \( f(0, n) = b_n \), then we denote \( A \sim B \). Given four integer sequences \( A, B, C, D \), prove that if \( A \sim B \), \( B \sim C \), \( C \sim D \), then \( D \sim A \).","import Mathlib theorem sim (a b c d : ℕ → ℤ) : (∃ f : ℕ → ℕ → ℤ, ∀ m n, f (m + 1) (n + 1) * f m n - f (m + 1) n * f m (n + 1) = 1 ∧ ∀ n, f n 0 = a n ∧ f 0 n = b n) → (∃ g : ℕ → ℕ → ℤ, ∀ m n, g (m + 1) (n + 1) * g m n - g (m + 1) n * g m (n + 1) = 1 ∧ ∀ n, g n 0 = b n ∧ g 0 n = c n) → (∃ h : ℕ → ℕ → ℤ, ∀ m n, h (m + 1) (n + 1) * h m n - h (m + 1) n * h m (n + 1) = 1 ∧ ∀ n, h n 0 = c n ∧ h 0 n = d n) → (∃ i : ℕ → ℕ → ℤ, ∀ m n, i (m + 1) (n + 1) * i m n - i (m + 1) n * i m (n + 1) = 1 ∧ ∀ n, i n 0 = d n ∧ i 0 n = a n) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205454,"Let $p > 3$ be a prime number. Prove that $\sum_{i=0}^{\frac{p-1}{2}} \binom{2i}{i} \equiv \pm 1 \pmod{p}$, where it is stipulated that $\binom{0}{0} = 1$.","import Mathlib theorem Nat.choose0 : Nat.choose 0 0 = 1 := by sorry theorem sumOfchoose (p : ℕ) (hp : Nat.Prime p) (hp1 : 3 < p) : (∑ i ∈ Finset.Icc 0 ((p - 1) / 2), Nat.choose (2 * i) i) ≡ 1 [ZMOD p] ∨ (∑ i ∈ Finset.Icc 0 ((p - 1) / 2), Nat.choose (2 * i) i) ≡ -1 [ZMOD p] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205460,"Let $S$ be the set of sequences of length 2018 whose terms are in the set $\{1, 2, 3, 4, 5, 6, 10\}$ and sum to 3860. Prove that the cardinality of $S$ is at most \begin{equation} 2^{3860} \cdot \left( \frac{2018}{2048} \right)^{2018}. \end{equation} ```","import Mathlib open Finset theorem card (s : Set (Fin 2018 → ℕ)) (hs : s = {t | (∀ i, t i ∈ ({1, 2, 3, 4, 5, 6, 10} : Set ℕ)) ∧ ∑ i, t i = 3860}) : s.ncard ≤ 2^3860 * (2018 / 2048 : ℝ)^2018 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205467,"Let $B$ be a set of more than $\frac{2^{n+1}}{n}$ distinct points with coordinates of the form $(\pm 1, \pm 1, \cdots, \pm 1)$ in $n$-dimensional space with $n \geq 3$. Show that there are three distinct points in $B$ which are the vertices of an equilateral triangle. ```","import Mathlib open Real open scoped BigOperators theorem Equilateral (n : ℕ) (hn : n ≥ 3) (B : Finset (EuclideanSpace ℝ (Fin n))) (hB : B.card > 2^(n + 1) / n) (hB1 : ∀ p ∈ B, ∀ i : Fin n, p i = 1 ∨ p i = -1) : ∃ A ∈ B, ∃ B' ∈ B, ∃ C ∈ B, A ≠ B' ∧ A ≠ C ∧ B' ≠ C ∧ dist A B' = dist A C ∧ dist B' C = dist A C := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205473,"Denote by $S_n$ the group of permutations of the sequence $1, 2, \cdots, n$. Suppose that $G$ is a subgroup of $S_n$, such that for every $\pi \in G \setminus \{e\}$ there exists a unique $k \in \{1, 2, \cdots, n\}$ for which $\pi(k) = k$. (Here $e$ is the unit element in the group $S_n$.) Show that this $k$ is the same for all $\pi \in G \setminus \{e\}$. ","import Mathlib open Finset theorem SubgroupOfSn {n : ℕ} {G : Subgroup ( Equiv.Perm (Fin n))} (hG : ∀ π ∈ G, π ≠ 1 → ∃! k : Fin n, π k = k) : ∃ c : Fin n, ∀ π ∈ G, π ≠ 1 → ∃! k : Fin n, π k = k ∧ k = c := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205489,"For a positive integer $x$, denote its $n^{\text{th}}$ decimal digit by $d_n(x)$, i.e. $d_n(x) \in \{0, 1, \cdots, 9\}$ and $x = \sum_{n=1}^{\infty} d_n(x) 10^{n-1}$. Suppose that for some sequence $\{a_n\}_{n=1}^{\infty}$, there are only finitely many zeros in the sequence $\{d_n(a_n)\}_{n=1}^{\infty}$. Prove that there are infinitely many positive integers that do not occur in the sequence $\{a_n\}_{n=1}^{\infty}$. ","import Mathlib open Finset def d (n : ℕ) (x : ℕ) := x / 10 ^ (n - 1) % 10 theorem prove {a : ℕ → ℕ} (ha : ∀ n, a n > 0) (hzeros : {n | d n (a n) = 0}.Finite) : ∀ N, ∃ m, m > N ∧ ¬∃ n, a n = m := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-205552,"Determine (with proof) whether there is a subset $X$ of the integers with the following property: for any integer $n$ there is exactly one solution of $a + 2b = n$ with $a,b \in X$ . Prove that the answer is Yes, there does exist a subset \( X \) of the integers such that for any integer \( n \) there is exactly one solution to \( a + 2b = n \) with \( a, b \in X \)..","import Mathlib theorem yes : ∃(X : Set ℤ), ∀ n : ℤ, (∃! x : ℤ × ℤ, x.1 ∈ X ∧ x.2 ∈ X ∧ x.1 + 2 * x.2 = n) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Omni-MATH, flc-205702,"Given a permutation $\sigma$ of $\{1,2, \ldots, 2013\}$, let $f(\sigma)$ to be the number of fixed points of $\sigma$ - that is, the number of $k \in\{1,2, \ldots, 2013\}$ such that $\sigma(k)=k$. If $S$ is the set of all possible permutations $\sigma$, compute $$\sum_{\sigma \in S} f(\sigma)^{4}$$ (Here, a permutation $\sigma$ is a bijective mapping from $\{1,2, \ldots, 2013\}$ to $\{1,2, \ldots, 2013\}$.) Prove that the answer is 15(2013!).","import Mathlib open Finset theorem sum_f : ∑ σ : Equiv.Perm (Fin 2013), (Nat.card {k | σ k = k})^4 = 15 * Nat.factorial 2013 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Omni-MATH (HMMT_2), flc-205924,"Let $N$ be the number of functions $f$ from $\{1,2, \ldots, 101\} \rightarrow\{1,2, \ldots, 101\}$ such that $f^{101}(1)=2$. Find the remainder when $N$ is divided by 103. Prove that the answer is 43.","import Mathlib theorem solution : {f : Fin 101 → Fin 101 | f^[101] 1 = 2}.ncard % 103 = 43 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Omni-MATH, flc-206375,"Let $ p$ be an odd prime number. How many $ p$-element subsets $ A$ of $ \{1,2,\dots,2p\}$ are there, the sum of whose elements is divisible by $ p$? Prove that the answer is \boxed{2 + \frac{1}{p} \left(\binom{2p}{p} - 2 \right)}.","import Mathlib theorem card {p : ℕ} (hp : Odd p ∧ Nat.Prime p) : Set.ncard {A : Finset ℕ | A ⊆ Finset.Icc 1 (2 * p) ∧ A.card = p ∧ ∑ x ∈ A, x ≡ 0 [MOD p]} = 2 + ((Nat.choose (2 * p) p - 2) / p : ℚ) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Omni-MATH, flc-206405,"Suppose that $k$ is a positive integer. A bijective map $f : Z \to Z$ is said to be $k$-[i]jumpy [/i] if $|f(z) - z| \le k$ for all integers $z$. Is it that case that for every $k$, each $k$-jumpy map is a composition of $1$-jumpy maps? [i]It is well known that this is the case when the support of the map is finite.[/i] Prove that the answer is \text{Yes}.","import Mathlib open Finset theorem k_jumping (k : ℕ) (hk : 0 < k) : ∀ f : ℤ → ℤ, Function.Bijective f → (∀ z, |f z - z| ≤ k) → ∃ g h : ℤ → ℤ, Function.Bijective g ∧ Function.Bijective h ∧ ∀ z, f z = g (h z) ∧ (∀ z, |g z - z| ≤ 1) ∧ (∀ z, |h z - z| ≤ 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Omni-MATH, flc-207206,"Prove that the maximum number \( k \) of subsets \( A_{1}, A_{2}, \cdots, A_{k} \) of the set \( S = \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\} \) such that \( |A_{i}| = 5 \) for \( 1 \leq i \leq k \) and \( |A_{i} \cap A_{j}| \leq 2 \) for \( 1 \leq i < j \leq k \) is \( 6 \).","import Mathlib open Finset theorem max_k (S : Finset ℕ) (hS : S = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}) : IsGreatest {k | ∃ A : Finset (Finset ℕ), A.card = k ∧ ∀ x ∈ A, x ⊆ S ∧ x.card = 5 ∧ ∀ i ∈ A, ∀ j ∈ A, i ≠ j → (i ∩ j).card ≤ 2} 6 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-208458,"Let $X$ be a complete metric space, and let $A \subseteq X$ be a countable set. Prove that $A$ cannot be expressed as the countable intersection of dense open sets in $X$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem complete_metric_space (X : Type*) [MetricSpace X] [CompleteSpace X] (A : Set X) (hA : Countable A) : ¬ ∃ s : Set (Set X), Countable s ∧ (∀ t ∈ s, IsOpen t ∧ Dense t) ∧ A = ⋂ t ∈ s, t := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-208603,"Let $\mathbb{R}^n$ be the $n$-dimensional Euclidean space, and let $\mathcal{H}(\mathbb{R}^n)$ denote the hyperspace of all subsets of $\mathbb{R}^n$. Define the map $f: \mathbb{R}^n \to \mathcal{H}(\mathbb{R}^n)$ by $f(x) = \{x\}$ for all $x \in \mathbb{R}^n$. Prove that $f$ is an isometry, i.e., for all $x, y \in \mathbb{R}^n$, we have $$d_{\mathbb{R}^n}(x, y) = d_{\mathcal{H}(\mathbb{R}^n)}(f(x), f(y)),$$ where $d_{\mathbb{R}^n}$ is the standard Euclidean distance in $\mathbb{R}^n$ and $d_{\mathcal{H}(\mathbb{R}^n)}$ is the Hausdorff distance in $\mathcal{H}(\mathbb{R}^n)$. Consequently, prove that $\mathbb{R}^n$ can be regarded as a subset of $\mathcal{H}(\mathbb{R}^n)$ via the embedding $f$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem isometry {n : ℕ} (hn : 0 < n) (f : EuclideanSpace ℝ (Fin n) → Set (EuclideanSpace ℝ (Fin n))) (hf : ∀ x, f x = {x}) : ∀ x y, dist x y = sSup {dist z w | (z : EuclideanSpace ℝ (Fin n)) (w : EuclideanSpace ℝ (Fin n)) (h : z ∈ f x) (h' : w ∈ f y)} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-208752,"Let \( n \) be a positive integer. Prove that: \[ \sum_{k=0}^{n} 2^k C_n^k C_{n-k}^{\left[\frac{n-k}{2}\right]} = C_{2n+1}^n. \]","import Mathlib open Finset Real Nat theorem sum_468594 (n : ℕ) (hn : 0 < n) : ∑ k ∈ range (n + 1), 2 ^ k * Nat.choose n k * Nat.choose (n - k) ((n - k) / 2) = Nat.choose (2 * n + 1) n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-208758,"Let \( p > 3 \) be a prime and \( t \) be a positive integer. Prove that: \[ \binom{p^{t+1}}{p^t} \equiv \binom{p^t}{p^{t-1}} \pmod{p^{3t+2}}. \]","import Mathlib theorem Nat.choose_eq (p t : ℕ) (hp : Nat.Prime p) (ht : 0 < t) (h : p > 3) : Nat.choose (p^(t + 1)) (p^t) ≡ Nat.choose (p^t) (p^(t - 1)) [MOD p^(3 * t + 2)] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-208768,"A set $U \subseteq \mathbb{R}$ is called open if for every $x \in U$, there exist real numbers $a, b$ such that $x \in (a, b) \subseteq U$. Let $S \subseteq \mathbb{R}$ satisfy the condition that any open set intersecting $(0, 1)$ also intersects $S$. Let $T$ be a family of countably many open sets each containing $S$. Prove that the intersection of all sets in $T$ is not a countable subset of $\mathbb{R}$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove_not_countable {S : Set ℝ} (hS : ∀ U : Set ℝ, IsOpen U → (U ∩ Set.Ioo 0 1 ≠ ∅ → S ∩ U ≠ ∅)) (T : Set (Set ℝ)) (hT : Countable T) (hT1 : ∀ u ∈ T, IsOpen u ∧ S ⊆ u) : ¬ Countable (⋂ u ∈ T, u) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-208785,"Let integer $n \geq 3$. In a social network, there are $n^3$ users, some of whom are friends with each other. Several (at least three) users can form a group if and only if they are pairwise friends. It is known that among any $n$ users, there exist three who can form a group. Prove that there exists a group with five users.","import Mathlib theorem find_group {n : ℕ} (hn : n ≥ 3) (a : Fin (n ^ 3) → Fin (n ^ 3) → Bool) (h : ∀ s : Finset (Fin (n ^ 3)), s.card = n → ∃ x ∈ s, ∃ y ∈ s, ∃ z ∈ s, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ a x y ∧ a y z ∧ a z x) : ∃ s : Finset (Fin (n ^ 3)), s.card = 5 ∧ ∀ x ∈ s, ∀ y ∈ s, ∀ z ∈ s, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ a x y ∧ a y z ∧ a z x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-209504,"Prove that there exist irrational numbers \(a\) and \(b\) such that \(a > 1\), \(b > 1\), and \(\left\lfloor a^m \right\rfloor\neq\left\lfloor b^n \right\rfloor\) for all natural numbers \(m\) and \(n\).","import Mathlib theorem algebra.univ_483801 : ∃ (a b : ℝ), Irrational a ∧ Irrational b ∧ a > 1 ∧ b > 1 ∧ ∀ m n : ℕ, ⌊a ^ m⌋ ≠ ⌊b ^ n⌋ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-210153,"Prove that the maximum number \(k\) of subsets \(A_{1}, A_{2}, \cdots, A_{k}\) of the set \(S=\{1, 2, \cdots, 10\}\) satisfying \(\left|A_{i}\right| = 5\) for \(i = 1, 2, \cdots, k\) and \(\left|A_{i} \cap A_{j}\right| \leqslant 2\) for \(1 \leqslant i < j \leqslant k\) is \(6\).","import Mathlib theorem max_k (S : Finset ℕ) (hS : S = Finset.Icc 1 10) (A : Finset (Finset ℕ)) (hA : ∀ x ∈ A, x ⊆ S ∧ x.card = 5) (hA' : ∀ i ∈ A, ∀ j ∈ A, i ≠ j → (i ∩ j).card ≤ 2) : A.card ≤ 6 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-211349,"Prove that the minimum number of non - necessarily equal positive real numbers \(m_1,m_2,\cdots,m_n\) such that for any distinct \(a,b,c\in\{1,2,\cdots,n\}\), \(m_a + m_b + m_c<0.05\times(\sum_{i = 1}^{n}m_i-(m_a + m_b + m_c))\) is \(n = 64\).","import Mathlib open Real Set open scoped BigOperators theorem min_num_of_m : IsLeast {n : ℕ | ∃ (m : Fin n → ℝ), (∀ i, 0 < m i) ∧ (∀ a b c, a ≠ b ∧ a ≠ c ∧ b ≠ c → m a + m b + m c < 0.05 * (∑ i, m i -(m a + m b + m c)))} 64 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/NuminaMath-TIR, flc-212273,"Let $n, k$ be integers with $k$ satisfying $k ext{ ≥ 8}$. Suppose $inom{n}{k}$ has no prime factors exceeding $k$. Prove that the binomial coefficient satisfies the inequality: $$inom{n}{k} \leq n^{k/2}.$$","import Mathlib theorem Nat.choose_le (n k : ℕ) (hk : k ≥ 8) (h : ∀ p, Nat.Prime p → p ∣ Nat.choose n k → p ≤ k) : Nat.choose n k ≤ n ^ (k / 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-212415,"Let $A$ be a set with $n$ elements, and let $\mathcal{F}, \mathcal{G}$ be two families of subsets of $A$. If $|\mathcal{F}|, |\mathcal{G}| \geq \left(1 + \frac{1}{n}\right) C_n^2$, prove that there exist subsets $X, Y, Z$ of $A$ such that $X \neq Y$, $X \setminus Z = Y \setminus Z$, and either (1) $X, Y \in \mathcal{F}, Z \in \mathcal{G}$ or (2) $X, Y \in \mathcal{G}, Z \in \mathcal{F}$ holds.","import Mathlib theorem SetTheory {n : ℕ} (hn : 0 < n) (A : Type*) [Fintype A] (hA : Fintype.card A = n) (F G : Finset (Set A)) : F.card ≥ (1 + 1 / n : ℝ) * Nat.choose n 2 ∧ G.card ≥ (1 + 1 / n : ℝ) * Nat.choose n 2 → ∃ X Y Z : Set A, X ≠ Y ∧ X \ Z = Y \ Z ∧ ((X ∈ F ∧ Y ∈ F ∧ Z ∈ G) ∨ (X ∈ G ∧ Y ∈ G ∧ Z ∈ F)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-213414,"Let $c \in \mathbb{R}$ be a fixed constant, and let $S = \bigcup_{n \in \mathbb{N}} \{(a, b) \in \mathbb{R}^2 : a^n + b^n = c\}$. Prove that the Lebesgue measure of $S$ is $0$, i.e., $\text{m}(S) = 0$. Consequently, prove that the set of solutions $(a, b)$ satisfying $a^n + b^n = c$ for some $n \in \mathbb{N}$ is a measure-theoretically negligible subset of $\mathbb{R}^2$.","import Mathlib theorem MeasureTheory_9357 (c : ℝ) : (MeasureTheory.volume {(x, y) | ∃ n : ℕ, x ^ n + y ^ n = c}).toReal = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-213614,"Let $p$ be a prime number, and let $n, k$ be integers with $0 ext{ ≤ } k ext{ ≤ } n$. Prove that the greatest power of $p$ dividing the binomial coefficient $\binom{n}{k}$ is given by: \[ v_p\left(\binom{n}{k}\right) = \frac{1}{p-1}\left((n - s(n)_p) - (k - s(k)_p) - (n-k - s(n-k)_p)\right), \] where $s(x)_p$ denotes the sum of the digits of $x$ in base-$p$ representation.","import Mathlib open Nat theorem p_power (p : ℕ) (hp : Nat.Prime p) (n k : ℕ) (h₀ : 0 ≤ k ∧ k ≤ n) : Nat.factorization (choose n k) p = ((n - (Nat.digits p n).sum) - (k - (Nat.digits p k).sum) - (n - k - (Nat.digits p (n - k)).sum)) / (p - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-214254,"Let $G(x)$ represent the ordinary generating function for the central binomial coefficient $\binom{3n}{n}$, defined as $G(x) = \sum_{n=0}^\infty \binom{3n}{n} x^n$. For $|x| < \frac{4}{27}$, prove that the generating function is given by: $$ G(x) = \frac{2 \cos \left(\frac{1}{3} \arcsin \left(\frac{3 \sqrt{3x}}{2}\right)\right)}{\sqrt{4 - 27x}}. $$","import Mathlib open Real Set open scoped BigOperators theorem gGeneratingFunction (x : ℝ) (hx : |x| < 4/27) : ∑' n : ℕ, Nat.choose (3*n) n * x^n = 2 * cos ((1/3) * arcsin (3*sqrt (3*x)/2)) / sqrt (4 - 27*x) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepTheorem, flc-214742,"Let \( a_1, a_2, \cdots, a_n \) be pairwise coprime integers. \( S \) is a subset of integers satisfying: (1) \( a_i \in S, 1 \leq i \leq n \); (2) \( a_i - a_j \in S, 1 \leq i, j \leq n \); (3) For any \( x, y \in S \), if \( x + y \in S \), then \( x - y \in S \). Prove that \( S = \mathbb{Z} \).","import Mathlib theorem qwen {n : ℕ} (hn : 0 < n) (a : Fin n → ℤ) (hcoprime : ∀ i j, i ≠ j → IsCoprime (a i) (a j)) (S : Set ℤ) (ha : ∀ i, a i ∈ S) (hdiff : ∀ i j, i ≠ j → (a i - a j) ∈ S) (hadd : ∀ x ∈ S, ∀ y ∈ S, (x + y) ∈ S → (x - y) ∈ S) : S = ⊤ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-214743,"Let \( S \) be a finite set, and let \( \mathcal{P}(S) \) be the set of all subsets of \( S \). For any function \( f : \mathcal{P}(S) \to \mathbb{R} \), prove that: \[ \sum_{A \in \mathcal{P}(S)} \sum_{B \in \mathcal{P}(S)} f(A)f(B)2^{|A \cap B|} \geq 0. \]","import Mathlib open Finset Real theorem sumOfProduct (S : Type*) [Fintype S] (f : Set S → ℝ) : ∑ A ∈ (Set.univ : Set (Set S)), ∑ B ∈ (Set.univ : Set (Set S)), f A * f B * 2 ^ (A ∩ B).ncard ≥ 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-214862,"Let $S$ be a non-empty finite set of positive integers. For a non-negative integer $n$, define $\begin{aligned}&A_n = \{(x, y) \mid x, y \in S, x + y = n\}, \\&B_n = \{(x, y) \mid x, y \in S, |x - y| = n\}.\end{aligned}$ Prove that $\sum_{i=0}^{\infty} |A_i|^2 = \frac{1}{2} \left( \sum_{i=0}^{\infty} |B_i|^2 + |S|^2 \right).$","import Mathlib open Finset theorem prove (S : Finset ℕ) (hS : S.Nonempty ∧ ∀ s ∈ S, s > 0) (A B : ℕ → Set (ℕ × ℕ)) (hA : ∀ n, A n = {p | p.1 ∈ S ∧ p.2 ∈ S ∧ p.1 + p.2 = n}) (hB : ∀ n, B n = {p | p.1 ∈ S ∧ p.2 ∈ S ∧ |(p.1 : ℤ) - p.2| = n}) : ∑' i, (Nat.card (A i))^2 = ((∑' i, (Nat.card (B i))^2 + (Nat.card S)^2) / 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-214872,"For positive integers $m, n$, let $S(m, n)=\{(a, b) \in \mathbb{Z}^{2} \mid 1 \leq a \leq m, 1 \leq b \leq n, \gcd(a, b)=1\}.$ Prove that for any positive integers $d, r$, there exist integers $m, n$ not less than $d$ such that $|S(m, n)| \equiv r \pmod{d}$.","import Mathlib open Finset theorem prove (d r : ℕ) (hd : 0 < d) (hr : 0 < r) : ∃ m n : ℕ, m ≥ d ∧ n ≥ d ∧ {x | ∃ a b : ℕ, x = (a, b) ∧ 1 ≤ a ∧ a ≤ m ∧ 1 ≤ b ∧ b ≤ n ∧ Nat.gcd a b = 1}.ncard ≡ r [ZMOD d] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-216858,"Let $p \geq 11$ be a prime number, and let $S$ be a subset of $\mathbb{Z}_p \times \mathbb{Z}_p$ with $3p - 3$ elements. Prove that there exists a subset $T$ of $S$ with $p - 1$ elements such that $\sum_{x \in T} x = (0, 0)$, where the addition is performed modulo $p$.","import Mathlib theorem qwen_prime (p : ℕ) (hp : Nat.Prime p) (h : 11 ≤ p) (S : Finset (ZMod p × ZMod p)) (hS : S.card = 3 * p - 3) : ∃ T ⊆ S, T.card = p - 1 ∧ ∑ x ∈ T, x = (0, 0) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-217053,"Prove that the set of all triples of distinct non - zero integers $(a, b, c)$ such that there exists a subset $Z_0 \subseteq \mathbb{Z}$ for which, for every integer $n \in \mathbb{Z}$, exactly one of the four numbers $n, n + a, n + b, n + c$ belongs to $Z_0$ is the set of triples of the form $(4k + 1, 4l + 2, 4m + 3)$ where $k,l,m\in\mathbb{Z}$.","import Mathlib theorem prove : {(a, b, c) : ℤ × ℤ × ℤ | a ≠ b ∧ a ≠ c ∧ b ≠ c ∧ a ≠ 0 ∧ b ≠ 0 ∧ c ≠ 0 ∧ ∃ Z : Set ℤ, ∀ n : ℤ, (n ∈ Z ∧ ¬(n + a ∈ Z) ∧ ¬(n + b ∈ Z) ∧ ¬(n + c ∈ Z)) ∨ (¬(n ∈ Z) ∧ n + a ∈ Z ∧ ¬(n + b ∈ Z) ∧ ¬(n + c ∈ Z)) ∨ (¬(n ∈ Z) ∧ ¬(n + a ∈ Z) ∧ n + b ∈ Z ∧ ¬(n + c ∈ Z)) ∨ (¬(n ∈ Z) ∧ ¬(n + a ∈ Z) ∧ ¬(n + b ∈ Z) ∧ n + c ∈ Z)} = {(a, b, c) : ℤ × ℤ × ℤ | ∃ k l m : ℤ, a = 4 * k + 1 ∧ b = 4 * l + 2 ∧ c = 4 * m + 3} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-217164,"Prove that if $k$ and $n$ are positive integers such that $\gcd(k,n)=1$ and $k < n$, then the number of sets $A = \{m_1, m_2, \ldots, m_k\}$ with $A \subseteq \{1, 2, \ldots, n\}$ and $\sum_{i=1}^{k} m_i \equiv 0 \pmod{n}$ is $\frac{\binom{n}{k}}{n}$.","import Mathlib theorem number_of_sets (k n : ℕ) (hn : 0 < n) (hk : 0 < k) (hkn : Nat.gcd k n = 1) (hkn' : k < n) : {A : Finset ℕ | A ⊆ Finset.Icc 1 n ∧ A.card = k ∧ ∑ i ∈ A, i ≡ 0 [MOD n]}.ncard = Nat.choose n k / n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-217169,"Prove that the largest possible size of a subset \(M\) of \(\{1, 2, \ldots, 2006\}\) such that for any three elements \(x, y, z\) of \(M\) with \(x < y < z\), the sum \(x + y\) does not divide \(z\) is \(1004\).","import Mathlib theorem max_size : IsGreatest {k | ∃ M : Finset ℕ, M ⊆ Finset.Icc 1 2006 ∧ M.card = k ∧ ∀ x ∈ M, ∀ y ∈ M, ∀ z ∈ M, x < y ∧ y < z → ¬(x + y ∣ z)} 1004 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-217404,"Prove that there exists a measurable set \(A \subset \mathbb{R}\) such that for every open interval \(I\), the Lebesgue measure of the intersection of \(A\) with \(I\) is positive, and the Lebesgue measure of the intersection of the complement of \(A\) with \(I\) is also positive, i.e., \(m(A \cap I) > 0\) and \(m((\mathbb{R} \setminus A) \cap I) > 0\), where \(m\) denotes the Lebesgue measure.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MeasureTheory.exists_measurable_set : ∃ (A : Set ℝ), MeasurableSet A ∧ ∀ (a b : ℝ), a < b → (MeasureTheory.volume (A ∩ Set.Ioo a b)).toReal > 0 ∧ (MeasureTheory.volume ((Set.univ \ A) ∩ Set.Ioo a b)).toReal > 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-217856,"Let \(B\) be a set of more than \(\frac{2^{n + 1}}{n}\) distinct points, where each point has coordinates of the form \((\pm 1, \pm 1, \cdots, \pm 1)\) in \(n\) - dimensional space with \(n\geq3\). Prove that there exist three distinct points in \(B\) which are the vertices of an equilateral triangle.","import Mathlib open Real Set open scoped BigOperators theorem algebra_480255 {n : ℕ} (hn : n ≥ 3) (B : Finset (EuclideanSpace ℝ (Fin n))) (hB : B.card > 2^(n + 1)/n) (hB1 : ∀ p ∈ B, ∀ i : Fin n, p i = 1 ∨ p i = -1) : ∃ x ∈ B, ∃ y ∈ B, ∃ z ∈ B, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ dist x y = dist y z ∧ dist y z = dist x z := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-217927,"Prove that there exists a function $f: P(\mathbb{N}) \to \mathbb{N}$ such that for every subset $A$ of $\mathbb{N}$, the set $\{x \in \mathbb{N} \mid x \notin A \text{ and } f(A \cup \{x\}) \neq x\}$ is finite.","import Mathlib open Set Real open scoped BigOperators theorem existence : ∃ f : Set ℕ → ℕ, ∀ A : Set ℕ, {x | x ∉ A ∧ f (A ∪ {x}) ≠ x}.Finite := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-217943,"Let $\Omega$ be a family of subsets of a set $M$ satisfying the following conditions: 1. If $|A \cap B| \geq 2$ for $A, B \in \Omega$, then $A = B$. 2. There exist distinct subsets $A, B, C \in \Omega$ such that $|A \cap B \cap C| = 1$. 3. For every $A \in \Omega$ and $a \in M \setminus A$, there is a unique $B \in \Omega$ such that $a \in B$ and $A \cap B = \emptyset$. Prove that there exist integers $p$ and $s$ such that: 1. Each element $a \in M$ is contained in exactly $p$ sets in $\Omega$. 2. $|A| = s$ for all $A \in \Omega$. 3. $s + 1 \geq p$.","import Mathlib theorem Ω (M : Type*) [TopologicalSpace M] (Ω : Set (Set M)) (h1 : ∀ A B : Set M, A ∈ Ω → B ∈ Ω → (A ∩ B).ncard ≥ 2 → A = B) (h2 : ∃ A B C : Set M, A ∈ Ω ∧ B ∈ Ω ∧ C ∈ Ω ∧ A ≠ B ∧ A ≠ C ∧ B ≠ C ∧ (A ∩ B ∩ C).ncard = 1) (h3 : ∀ A : Set M, A ∈ Ω → ∀ a : M, a ∉ A → ∃! B : Set M, B ∈ Ω ∧ a ∈ B ∧ A ∩ B = ∅) : ∃ p s : ℕ, (∀ a : M, {A | A ∈ Ω ∧ a ∈ A}.encard = p) ∧ (∀ A : Set M, A ∈ Ω → A.ncard = s) ∧ s + 1 ≥ p := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-218090,"Prove that the number of $(p - 1)$-tuples of natural numbers $(x_1, x_2, \ldots, x_{p - 1})$ that satisfy the following conditions: 1. The sum \(x_1 + 2x_2+\cdots+(p - 1)x_{p - 1}\) is divisible by \(p\). 2. Each \(x_i\) is not greater than \(n - 1\), where \(p\) is an odd prime number and \(n\) is a positive integer relatively prime to \(p\), is \(\left\lceil\frac{n^{p - 1}}{p}\right\rceil\).","import Mathlib theorem prove_tuples (p : ℕ) (hp : Odd p ∧ Nat.Prime p) (n : ℕ) (hn : Nat.Coprime n p) : {(x : Fin (p - 1) → ℕ) | (∑ i : Fin (p - 1), (i + 1) * x i ≡ 0 [MOD p]) ∧ (∀ i : Fin (p - 1), x i ≤ n - 1)}.ncard = ⌈(n ^ (p - 1)) / p⌉₊ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-218585,"Prove that it is possible to select $2^{k}$ distinct numbers from the set $\{0, 1, 2, \ldots, 3^{k} - 1\}$ such that no three of the selected numbers form an arithmetic progression.","import Mathlib theorem prove (k : ℕ) : ∃ s : Finset ℕ, s ⊆ Finset.Icc 0 (3 ^ k - 1) ∧ s.card = 2 ^ k ∧ ∀ x ∈ s, ∀ y ∈ s, ∀ z ∈ s, x ≠ y ∧ y ≠ z ∧ z ≠ x → ¬(∃ d : ℤ, y = x + d ∧ z = y + d) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-218606,"Prove that if $\mathcal{A}$ is a set of $2n + 1$ irrational real numbers, i.e., $\mathcal{A} \subset \mathbb{R} \setminus \mathbb{Q}$, then there exists a subset $\mathcal{B} \subset \mathcal{A}$ with $|\mathcal{B}| = n + 1$ such that the sum of the elements of $\mathcal{B}$, denoted by $S(\mathcal{B})$, is an irrational number, where $S(\mathcal{C})$ denotes the sum of all elements of $\mathcal{C}$ for any non - empty subset $\mathcal{C} \subset \mathcal{A}$.","import Mathlib theorem IrrationalSum (n : ℕ) (A : Finset ℝ) (hA : A.card = 2 * n + 1) (hA' : ∀ x ∈ A, Irrational x) : ∃ B ⊆ A, B.card = n + 1 ∧ ¬∃ q : ℚ, ∑ b ∈ B, b = q := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-218846,"Let $A \subset \mathbb{Z}^{+}$ be defined such that $k \in A$ if and only if there exist $a, b \in \mathbb{Z}^{+}$ for which $k = \frac{2a^2 + b^2}{ab + 1}$. Prove that the set $A$ is infinite, i.e., $|A| = +\infty$.","import Mathlib def A : Set ℕ := {k | ∃ a b : ℕ, 0 < a ∧ 0 < b ∧ k = (2 * a ^ 2 + b ^ 2) / (a * b + 1)} theorem InfiniteA : Infinite A := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-219101,"Given a plane where each point is colored either red or blue, prove that there exists either a pair of red points with a distance of \(1\) unit between them, or a set of \(4\) collinear blue points, each pair of consecutive points being \(1\) unit apart.","import Mathlib theorem color_plane (f : ℝ × ℝ → Fin 2) : ∃ r1 r2 : ℝ × ℝ, f r1 = 0 ∧ f r2 = 0 ∧ Real.sqrt ((r2.1 - r1.1)^2 + (r2.2 - r1.2)^2) = 1 ∨ ∃ b1 b2 b3 b4 : ℝ × ℝ, f b1 = 1 ∧ f b2 = 1 ∧ f b3 = 1 ∧ f b4 = 1 ∧ Collinear ℝ {b1, b2, b3, b4} ∧ Real.sqrt ((b2.1 - b1.1)^2 + (b2.2 - b1.2)^2) = 1 ∧ Real.sqrt ((b3.1 - b2.1)^2 + (b3.2 - b2.2)^2) = 1 ∧ Real.sqrt ((b4.1 - b3.1)^2 + (b4.2 - b3.2)^2) = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-219244,"In a town with \(3n\) citizens, assume that any two individuals share at least one common friend within the town. Prove that it is possible to select a group of \(n\) citizens such that every person among the remaining \(2n\) citizens has at least one friend in this selected group of \(n\).","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (a : Fin (3 * n) → Finset (Fin (3 * n))) (ha : ∀ i j, a i ∩ a j ≠ ∅) : ∃ b : Finset (Fin (3 * n)), b.card = n ∧ ∀ i, i ∉ b → ∃ j ∈ b, j ∈ a i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-219336,Prove that the sum \( \sum_{i = 1}^{p - 1} \binom{p}{i}^2 \) is divisible by \( p^3 \) if and only if \( p \) is a prime number such that \( p > 3 \).,"import Mathlib theorem Nat.choose_power (p : ℕ) (hp : p.Prime) : p ^ 3 ∣ ∑ i ∈ Finset.Icc 1 (p - 1), (Nat.choose p i) ^ 2 ↔ p > 3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-219400,"Prove that for any positive integer \(n\), given a sequence \(a_1, a_2, \ldots, a_{2^n}\) of positive integers such that \(1 \le a_i \le i\) for all \(i = 1, 2, \ldots, 2^n\), there exist positive integers \(1 \le i_1 < i_2 < \cdots < i_{n+1} \le 2^n\) such that \(a_{i_1} \le a_{i_2} \le \cdots \le a_{i_{n+1}}\).","import Mathlib theorem prove (n : ℕ) (hn : 0 < n) (a : ℕ → ℕ) (ha : ∀ i ∈ Finset.Icc 1 (2 ^ n), 0 < a i ∧ a i ≤ i) : ∃ i : Fin (n + 1) → ℕ, (∀ j k, j < k → i j < i k) ∧ (∀ j, i j ∈ Finset.Icc 1 (2 ^ n)) ∧ (∀ j, a (i j) ≤ a (i (j + 1))) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-219478,"Prove that the only prime numbers \(p > 0\) and integers \(q \geq 0\) that satisfy the conditions \(p^{2} \geq q \geq p\) and \(\binom{p^{2}}{q} - \binom{q}{p} = 1\) are \((p, q) = (2, 3)\) and \((p, q) = (3, 7)\).","import Mathlib theorem Nat.choose_eq_one {p q : ℕ} (hp : p.Prime) : p^2 ≥ q ∧ q ≥ p ∧ Nat.choose (p^2) q - Nat.choose q p = 1 ↔ (p = 2 ∧ q = 3) ∨ (p = 3 ∧ q = 7) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-219782,"1. Prove that for all \(x \in \mathbb{R}\), \[ \sum_{k=0}^{n} (-1)^k \binom{n}{k} (x-k)^n = n!. \] 2. Prove that for all positive integers \(n\), \[ \sum_{k=0}^{n} \frac{\binom{n}{k}^2}{(2k+1)\binom{2n}{2k}} = \frac{2^{4n} (n!)^4}{(2n)! (2n+1)!}. \]","import Mathlib open Finset Real Nat theorem prove1 {n : ℕ} (x : ℝ) : ∑ k ∈ range (n + 1), (-1 : ℝ)^k * Nat.choose n k * (x - k)^n = n.factorial := by sorry theorem prove2 {n : ℕ} (hn : 0 < n) : ∑ k ∈ range (n + 1), (Nat.choose n k)^2 / ((2 * k + 1) * Nat.choose (2 * n) (2 * k)) = (2^(4 * n) * (n.factorial)^4) / ((2 * n).factorial * (2 * n + 1).factorial) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-220347,"Let \(S=(a_1,a_2,\ldots,a_{2003})\) where \(a_i\in\mathbb{N}^*\) and \(a_i\neq a_j\) for all \(i\neq j\). Prove that there exist indices \(i\neq j\) such that \(i,j\in\{1,2,\ldots,2003\}\) and \(a_i + a_j \nmid a_1 + a_2+\cdots + a_{2003}\).","import Mathlib theorem Finset.sum' (a : ℕ → ℕ) (ha : ∀ i ∈ Finset.Icc 1 2003, a i > 0) (hij : ∀ i j, i ≠ j → a i ≠ a j) : ∃ i j, i ≠ j ∧ ¬(a i + a j ∣ ∑ k ∈ Finset.Icc 1 2003, a k) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-220498,Prove that the set of pairwise distances between \(10^6\) points in three - dimensional space contains at least 79 distinct elements.,"import Mathlib theorem dist_set (s : Finset (EuclideanSpace ℝ (Fin 3))) (h₀ : s.card = 10^6) : Set.ncard {d | ∃ p ∈ s, ∃ q ∈ s, d = dist p q} ≥ 79 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-220886,"Let $A$ be an infinite set. Prove that for every subset $G$ of the power set $P(A)$ that satisfies the following conditions: (i) $B$ is a finite set for all $B \in G$ (ii) $\bigcup_{B \in G} B = A$ the sets $A$ and $G$ are equipotent, i.e., \( |A| = |G| \).","import Mathlib theorem InfiniteA {A : Type*} [Infinite A] (G : Set (Set A)) (hG : ∀ B ∈ G, Finite B) (hG' : ⋃ B ∈ G, B = A) : ∃ f : A → G, Function.Bijective f := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-220940,"Prove that there does not exist a sequence $\{a_n\}_{n \ge 1}$ of positive integers such that: (i) Every positive integer appears infinitely many times in $\{a_n\}$; (ii) For all $m \in \mathbb{N}^{+}$, the sequence $\{a_n \mod m\}_{n \ge 1}$ is periodic. Here, $\{a_n \mod m\}_{n \ge 1}$ denotes the sequence where each term $b_i \equiv a_i \pmod{m}$ for all $i \in \mathbb{N}^{+}$.","import Mathlib theorem no_sequence : ¬∃ (a : ℕ → ℕ), (∀ n, 0 < a n) ∧ (∀ m > 0, ∃ c, Function.Periodic (fun i => a i % m) c) ∧ (∀ k, 0 < k → {i | a i = k}.Infinite) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-221059,"Let $G$ be a graph representing a group of $n$ tourists, where an edge between two vertices indicates that the corresponding tourists are familiar with each other. Suppose that among every three tourists, there are at least two who are not familiar, and for any partition of the group into two buses, there are at least two familiar tourists in one of the buses. Prove that there exists a vertex $v$ in $G$ such that $\deg(v) \leq \frac{2}{5}n$.","import Mathlib theorem Qwen {n : ℕ} (hn : 0 < n) (G : Fin n → Fin n → Prop) (hG : ∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → ¬(G i j ∧ G i k ∧ G j k)) (hG' : ∀ s1 s2 : Finset (Fin n), s1 ≠ s2 ∧ s1 ∪ s2 = Finset.univ → ∃ i ∈ s1, ∃ j ∈ s1, i ≠ j ∧ G i j ∨ ∃ i ∈ s2, ∃ j ∈ s2, i ≠ j ∧ G i j) : ∃ v : Fin n, {i | G i v}.ncard ≤ (2 / 5 : ℝ) * n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-221140,"Let $n \ge 1$ and $a_1 < a_2 < \dots < a_n$ be a sequence of integers. Define the set $S$ as the collection of pairs $(i, j)$ with $1 \le i < j \le n$ such that $a_j - a_i$ is a power of $2$, and the set $T$ as the collection of pairs $(i, j)$ with $1 \le i < j \le n$ such that $j - i$ is a power of $2$. Prove that the cardinality of $S$ is less than or equal to the cardinality of $T$, i.e., \(|S| \le |T|\).","import Mathlib open Finset theorem cardS {n : ℕ} (hn : 1 ≤ n) (a : ℕ → ℤ) (ha : StrictMonoOn a (Icc 1 n)) : {(i, j) : ℕ × ℕ | 1 ≤ i ∧ i < j ∧ j ≤ n ∧ ∃ k, a j - a i = 2 ^ k}.ncard ≤ {(i, j) : ℕ × ℕ | 1 ≤ i ∧ i < j ∧ j ≤ n ∧ ∃ m, j - i = 2 ^ m}.ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-221144,"Prove that in any set of $2000$ distinct real numbers, there exist two pairs $(a, b)$ and $(c, d)$ such that $a > b$, $c > d$, and $a \neq c$ or $b \neq d$, satisfying the inequality \[ \left| \frac{a-b}{c-d} - 1 \right| < \frac{1}{100000}. \]","import Mathlib theorem prove_464643 (s : Finset ℝ) (h₀ : s.card = 2000) : ∃ (a b c d : ℝ), (a ∈ s ∧ b ∈ s ∧ c ∈ s ∧ d ∈ s) ∧ (a > b ∧ c > d) ∧ (a ≠ c ∨ b ≠ d) ∧ |(a - b) / (c - d) - 1| < 1 / 100000 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-221149,"Let $(r_n)_{n\ge 0}$ be a sequence of positive real numbers such that $\lim_{n\to \infty} r_n = 0$. Define $S$ as the set of all numbers that can be expressed as a sum \[ r_{i_1} + r_{i_2} + \cdots + r_{i_{1994}} \] where $i_1 < i_2 < \cdots < i_{1994}$. Prove that for any nonempty interval $(a, b)$, there exists a nonempty subinterval $(c, d) \subseteq (a, b)$ such that $(c, d) \cap S = \emptyset$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (r : ℕ → ℝ) (hr : ∀ n, 0 < r n) (hrr : Tendsto r atTop (𝓝 0)) : ∀ a b, a < b → ∃ c d, c < d ∧ c ∈ Set.Ioo a b ∧ d ∈ Set.Ioo a b ∧ (Set.Ioo c d) ∩ {x | ∃ i : Fin 1994 → ℕ, (∀ j k, j < k → i j < i k) ∧ x = ∑ j : Fin 1994, r (i j)} = ∅ := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-221174,"Prove that any function $f: \mathbb{Q} \rightarrow \mathbb{Q}$ can be expressed as the sum of two injective functions $g, h: \mathbb{Q} \rightarrow \mathbb{Q}$.","import Mathlib theorem algebra.map_qr : ∀ (f : ℚ → ℚ), ∃ g h : ℚ → ℚ, Function.Injective g ∧ Function.Injective h ∧ f = g + h := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-221313,"Prove that for positive integers $N$ and $Q$, the minimum value of $N$ such that among any set of $N$ lattice points on the $xy$-plane, one can always find $Q$ lattice points for which the sum of the $x$-coordinates and the sum of the $y$-coordinates are both multiples of $Q$ is $4Q - 3$.","import Mathlib theorem prove (N Q : ℕ) (hN : N > 0) (hQ : Q > 0) : IsLeast {N | ∀ s : Finset (ℤ × ℤ), s.card = N → ∃ t ⊆ s, t.card = Q ∧ (∑ x ∈ t, x.1 ≡ 0 [ZMOD Q]) ∧ (∑ y ∈ t, y.2 ≡ 0 [ZMOD Q])} (4 * Q - 3) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-221355,"Let $\mathcal{F}$ be a family of subsets of $\{1,2,\ldots,n\}$ such that for any four sets $A, B, C, D \in \mathcal{F}$, the inequality $|A \cup B \cup C \cup D| \leq n-2$ holds. Prove that the cardinality of $\mathcal{F}$ satisfies $|\mathcal{F}| \leq 2^{n-2}$.","import Mathlib open Finset theorem card_bound (n : ℕ) (hn : 0 < n) (F : Set (Finset (Fin n))) (hF : ∀ A ∈ F, ∀ B ∈ F, ∀ C ∈ F, ∀ D ∈ F, (A ∪ B ∪ C ∪ D).card ≤ n - 2) : F.ncard ≤ 2 ^ (n - 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-221538,"Let there be \(23\) individuals, each with a positive integer weight. Suppose that for any choice of one individual as the referee, the remaining \(22\) individuals can be divided into two teams of \(11\) each such that the total weight of each team is equal. Prove that all \(23\) individuals have the same weight.","import Mathlib theorem weight_eq (w : Fin 23 → ℤ) (hw : ∀ i, w i > 0) (h : ∀ r, ∃ s1 s2 : Finset (Fin 23), s1 ≠ s2 ∧ s1 ∪ s2 = Finset.univ \ {r} ∧ s1.card = 11 ∧ s2.card = 11 ∧ ∑ i ∈ s1, w i = ∑ i ∈ s2, w i) : ∃ x, ∀ i, w i = x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-221963,"Prove that there exist infinitely many nontrivial solutions to the equation \( \binom{a}{b} = \binom{c}{d} \), where nontrivial means that \( a \neq c \), and \( b, d \not\in \{0, 1, a - 1, a, c - 1, c\} \).","import Mathlib theorem InfiniteNontrivialSolutions : ∀ n : ℕ, ∃ a b c d : ℕ, a > n ∧ b > n ∧ c > n ∧ d > n ∧ Nat.choose a b = Nat.choose c d ∧ ¬(a = c) ∧ ¬(b = 0) ∧ ¬(b = 1) ∧ ¬(b = a - 1) ∧ ¬(b = a) ∧ ¬(b = c - 1) ∧ ¬(b = c) ∧ ¬(d = 0) ∧ ¬(d = 1) ∧ ¬(d = a - 1) ∧ ¬(d = a) ∧ ¬(d = c - 1) ∧ ¬(d = c) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-222020,"Prove that the set of real numbers $\mathbb{R}$ is equipotent to the set of all sequences of real numbers $\mathbb{R}^{\mathbb{N}}$, i.e., prove that \(|\mathbb{R}| = |\mathbb{R}^\mathbb{N}|\).","import Mathlib theorem SetEq : (Set.univ : Set ℝ).encard = (Set.univ : Set (ℕ → ℝ)).encard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-222267,"Let $f$ be a bijection from the set of non - negative integers to itself. Prove that there exist non - negative integers $a, b, c$ such that $a < b < c$ and $f(a) + f(c) = 2f(b)$.","import Mathlib theorem exists_abc (f : ℕ → ℕ) (hf : Function.Bijective f) : ∃ a b c, a < b ∧ b < c ∧ f a + f c = 2 * f b := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-222799,"Prove that if $x$ is an irrational number and the function $f(nx) = nx - [nx]$ is defined for $n \in \mathbb{N}$, then the set $\{f(nx) : n \in \mathbb{N}\}$ is dense in the interval $[0,1]$.","import Mathlib open Real theorem algebra_442334 {x : ℝ} (hx : Irrational x) : Dense {y | ∃ n : ℕ, y = n * x - ⌊n * x⌋ ∧ 0 ≤ y ∧ y < 1} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-222817,"Prove that for a prime number \(p\), the statement ""for each integer \(k\), there exists an integer \(n\) such that \(\left(\begin{array}{c}n\\ p\end{array}\right) = \left(\begin{array}{c}n+k\\ p\end{array}\right)\)"" is true if and only if \(p > 3\), where \(\left(\begin{array}{c}a\\ p\end{array}\right)\) denotes the Legendre symbol.","import Mathlib theorem Prove (p : ℕ) [hp : Fact (Nat.Prime p)] : (∀ k : ℤ, ∃ n : ℤ, n^((p - 1) / 2) ≡ (n + k)^((p - 1) / 2) [ZMOD p]) ↔ p > 3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-223685,"Prove that if $A_1, A_2, \ldots, A_m$ are $m$ subsets of a set of size $n$, then $$ \sum_{i=1}^{m} \sum_{j=1}^{m} |A_i| \cdot |A_i \cap A_j| \geq \frac{1}{mn} \left( \sum_{i=1}^{m} |A_i| \right)^3. $$","import Mathlib theorem Prove (m : ℕ) (n : ℕ) (hn : 0 < n) (A : Fin m → Set ℕ) (hA : ∀ i, A i ⊆ Finset.Icc 1 n) : ∑ i, ∑ j, (A i).ncard * (A i ∩ A j).ncard ≥ (1 / (m * n : ℚ)) * (∑ i, (A i).ncard)^3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-224227,"Prove that there exists a subset $S \subseteq F$ such that $|S| = 2006$ and for every $(a_1, a_2, \ldots, a_{2006}) \in F$, there exists $(b_1, b_2, \ldots, b_{2006}) \in S$ satisfying $\sum_{i=1}^{2006} a_i b_i = 0$, where $F = \{(a_1, a_2, \ldots, a_{2006}) : \forall i = 1, 2, \ldots, 2006, a_i \in \{-1, 1\}\}$.","import Mathlib open Finset Real theorem g : ∃ S : Finset (Fin 2006 → ℤ), (∀ s ∈ S, ∀ x, s x ∈ ({-1, 1} : Set ℤ)) ∧ S.card = 2006 ∧ (∀ T : Fin 2006 → ℤ, (∀ x, T x ∈ ({-1, 1} : Set ℤ)) → (∃ s ∈ S, ∑ x : Fin 2006, (T x) * (s x) = 0)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-224374,"Prove that if \(S_{n, k} = \sum_{a=0}^{n} \binom{a}{k}\binom{n - a}{k}\), then the remainder when \(\sum_{n=0}^{200} \sum_{k=0}^{200} S_{n, k}\) is divided by \(1000\) is \(751\), i.e., \(\sum_{n=0}^{200} \sum_{k=0}^{200} S_{n, k}\equiv 751\pmod{1000}\).","import Mathlib open Finset theorem S : (∑ n ∈ Icc 0 200, ∑ k ∈ Icc 0 200, ∑ a ∈ Icc 0 n, Nat.choose a k * Nat.choose (n - a) k) % 1000 = 751 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-224961,"Given a natural number \(n > 4\) and a set of \(2n + 4\) cards numbered \(1, 2, \dots, 2n + 4\). On each card numbered \(m\), a real number \(a_m\) is written such that \(\lfloor a_m \rfloor = m\). Prove that it is possible to select four cards in such a way that the sum of the numbers on the first two cards differs from the sum of the numbers on the two remaining cards by less than \(\frac{1}{n - \sqrt{\frac{n}{2}}}\).","import Mathlib theorem card_set (n : ℕ) (hn : n > 4) (a : ℕ → ℝ) (ha : ∀ m ∈ Finset.Icc 1 (2 * n + 4), ⌊a m⌋ = m) : ∃ w x y z : Finset.Icc 1 (2 * n + 4), w ≠ x ∧ w ≠ y ∧ w ≠ z ∧ x ≠ y ∧ x ≠ z ∧ y ≠ z ∧ |(a w + a x) - (a y + a z)| < 1 / (n - Real.sqrt (n / 2)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-224984,"Prove that the largest positive integer \(n\) such that there exists an \(n\) - element subset \(A\) of the set \(S=\{1,2,\ldots,2000\}\) with the property that for any two distinct elements \(x,y\in A\), the sum \(x + y\) is not divisible by their difference \(x - y\) is \(n = 667\).","import Mathlib open Finset theorem max_n : IsGreatest {n > 0 | ∃ A ⊆ Icc 1 2000, A.card = n ∧ ∀ x ∈ A, ∀ y ∈ A, x ≠ y → ¬(x + y ≡ 0 [ZMOD x - y])} 667 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-225403,"Let $n$ be a positive integer. Prove that for any subset $A$ of $\{0,1,\ldots,5^n\}$ with $4n + 2$ elements, there exist three elements $a < b < c$ from $A$ such that $c + 2a > 3b$.","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (A : Finset ℕ) (hA : A ⊆ Finset.Icc 0 (5 ^ n)) (hA1 : A.card = 4 * n + 2) : ∃ a ∈ A, ∃ b ∈ A, ∃ c ∈ A, a < b ∧ b < c ∧ c + 2 * a > 3 * b := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-225434,"Prove that for all \(n \in \mathbb{N}^*\), the following identity holds: \[ \sum_{k=0}^{2^n - 1} (-1)^{s(k)} (x + k)^n = (-1)^n 2^{\frac{n(n - 1)}{2}} \cdot n! \] where \(s(k)\) denotes the sum of the digits of \(k\) in its binary representation.","import Mathlib open Finset def s : ℕ → ℕ | k => (Nat.digits 2 k).sum theorem prove (n : ℕ) (hn : 0 < n) : ∑ k ∈ range (2 ^ n), (-1 : ℝ) ^ s k * (x + k) ^ n = (-1) ^ n * 2 ^ ((n * (n - 1)) / 2) * Nat.factorial n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-225809,"Prove that for an infinite graph \(G=(V, E)\), where \(V\) is the set of vertices and \(E\) is the set of edges, there exists either an infinite subset \(V_1 \subseteq V\) such that every two distinct vertices in \(V_1\) are connected by an edge, or an infinite subset \(V_2 \subseteq V\) such that no two distinct vertices in \(V_2\) are connected by an edge.","import Mathlib open Finset theorem InfiniteGraph (V : Type*) [Infinite V] (E : Set (V × V)) : ∃ V1 : Set V, Infinite V1 ∧ (∀ v ∈ V1, ∀ w ∈ V1, v ≠ w → (v, w) ∈ E) ∨ ∃ V2 : Set V, Infinite V2 ∧ (∀ v ∈ V2, ∀ w ∈ V2, v ≠ w → ¬(v, w) ∈ E) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-225811,"Given an infinite graph $G = (V, E)$, where $V$ is the set of vertices and $E$ is the set of edges, prove that there exists either an infinite subset $V_1 \subseteq V$ such that every two distinct vertices in $V_1$ are connected by an edge, or an infinite subset $V_2 \subseteq V$ such that no two distinct vertices in $V_2$ are connected by an edge.","import Mathlib open Finset theorem InfiniteGraph {V : Type*} [Infinite V] (E : Set (V × V)) : ∃ V1 : Set V, Infinite V1 ∧ (∀ v ∈ V1, ∀ w ∈ V1, v ≠ w → ∃ e ∈ E, e.1 = v ∧ e.2 = w) ∨ ∃ V2 : Set V, Infinite V2 ∧ (∀ v ∈ V2, ∀ w ∈ V2, v ≠ w → ¬∃ e ∈ E, e.1 = v ∧ e.2 = w) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-225835,"Prove that for any natural number \(N\), there exists an increasing arithmetic progression with \(N\) terms such that the sum of the digits of each term is constant.","import Mathlib open Nat def sumOfDigits (n : ℕ) := (Nat.digits 10 n).sum theorem prove (N : ℕ) : ∃ a d, a > 0 ∧ d > 0 ∧ ∀ i ∈ Finset.range N, sumOfDigits (a + d * i) = sumOfDigits a := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-225917,"Prove that for any bijective function \(f: \mathbb{Z} \to \mathbb{Z}\), there exist integers \(m, n, p, q\) such that \(m < n < p < q\) and \(f(m) + f(q) = f(n) + f(p)\).","import Mathlib theorem prove (f : ℤ → ℤ) (hf : Function.Bijective f) : ∃ m n p q : ℤ, m < n ∧ n < p ∧ p < q ∧ f m + f q = f n + f p := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-226065,"Let $A$ be a set of positive integers that includes the number $1$ and at least one additional element. Given that for any two distinct elements $m, n \in A$, the number $\frac{m+1}{(m+1, n+1)}$ is also an element of $A$. Prove that $A$ is the set of all positive integers.","import Mathlib theorem qwen (A : Set ℕ) (hA : ∀ m ∈ A, ∀ n ∈ A, m ≠ n → (m + 1) / Nat.gcd (m + 1) (n + 1) ∈ A) (hA1 : 1 ∈ A) (hA2 : ∃ m ∈ A, m > 1) : A = {x | 0 < x} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-226069,"Let $n$ be a positive integer. We say that $n$ has property $T$ if for all positive integers $a$ and $b$, the condition $a^3b \equiv -1 \pmod{n}$ implies $a^3 \equiv -b \pmod{n}$. Let $A$ be the set of all positive integers that have property $T$. Prove that $|A| \leq 24$.","import Mathlib def property_t (n : ℕ) := ∀ a b, 0 < a → 0 < b → a ^ 3 * b ≡ -1 [ZMOD n] → a ^ 3 ≡ -b [ZMOD n] theorem number_of_n_with_property_t : Set.ncard {n | 0 < n ∧ property_t n} ≤ 24 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-226089,"For any positive integer $n \geqslant 3$, prove that there exist two sets $A$ and $B$ such that: 1. $|A| = |B| = n$ 2. $|A \cap B| = 0$ 3. $\sum_{a \in A} a = \sum_{b \in B} b$ 4. $\sum_{a \in A} a^2 = \sum_{b \in B} b^2$","import Mathlib theorem algebraic_568495 (n : ℕ) (hn : 3 ≤ n) : ∃ A B : Finset ℕ, A.card = n ∧ B.card = n ∧ A ∩ B = ∅ ∧ (∑ a ∈ A, a = ∑ b ∈ B, b) ∧ (∑ a ∈ A, a ^ 2 = ∑ b ∈ B, b ^ 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-226254,"Prove that it is possible to color all points on the plane using only two colors, black and white, such that any two rational points which are exactly 1 unit apart are always of different colors.","import Mathlib theorem color_points : ∃ f : (ℚ × ℚ) → Fin 2, ∀ p q : ℚ × ℚ, dist p q = 1 → f p ≠ f q := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-226272,Prove that the number of ways a prime number \(p\) can be represented as the sum of the squares of an ordered set of four integers is \(8(p + 1)\) when \(p\) is an odd prime and \(24\) when \(p = 2\).,"import Mathlib theorem number_of_representations (p : ℕ) (hp : Nat.Prime p) : {x : Fin 4 → ℤ | ∑ i, x i ^ 2 = p}.ncard = if Odd p then 8 * (p + 1) else 24 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-226534,"Prove that there exists a function \(f : \mathbb{N} \to P(\mathbb{N})\) such that for every \(a, b \in \mathbb{N}\) with \(a \neq b\), the intersection \(f(a) \cap f(b)\) is finite. Also, prove that there exists a function \(f : \mathbb{R} \to P(\mathbb{N})\) such that for every \(a, b \in \mathbb{R}\) with \(a \neq b\), the intersection \(f(a) \cap f(b)\) is finite.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem exist1 : ∃ f : ℕ → Set ℕ, ∀ a b, a ≠ b → (f a ∩ f b).Finite := by sorry theorem exist2 : ∃ f : ℝ → Set ℕ, ∀ a b, a ≠ b → (f a ∩ f b).Finite := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-226824,"(a) Prove that for given constants \(a, b\) with \(1 < a < 2 < b\), there does not exist a partition of the set of positive integers into two subsets \(A_0\) and \(A_1\) such that for any \(j \in \{0,1\}\) and any \(m, n \in A_j\), either \(\frac{n}{m} < a\) or \(\frac{n}{m} > b\). (b) Prove that all pairs of real numbers \((a, b)\) with \(1 < a < 2 < b\) for which there exists a partition of the set of positive integers into three subsets \(A_0, A_1, A_2\) such that for any \(j \in \{0,1,2\}\) and any \(m, n \in A_j\), either \(\frac{n}{m} < a\) or \(\frac{n}{m} > b\), are the pairs \((a, b)\) satisfying \(b \le a^2\).","import Mathlib open Finset Real theorem a : ∀ a b : ℝ, 1 < a ∧ a < 2 ∧ 2 < b → ¬∃ A0 A1 : Set ℕ, (∀ m ∈ A0, ∀ n ∈ A0, m > 0 → n > 0 → (n / m < a ∨ n / m > b)) ∧ (∀ m ∈ A1, ∀ n ∈ A1, m > 0 → n > 0 → (n / m < a ∨ n / m > b)) ∧ A0 ∪ A1 = {x | x > 0} := by sorry theorem b : ∀ a b : ℝ, 1 < a ∧ a < 2 ∧ 2 < b → ∃ A0 A1 A2 : Set ℕ, (∀ m ∈ A0, ∀ n ∈ A0, m > 0 → n > 0 → (n / m < a ∨ n / m > b)) ∧ (∀ m ∈ A1, ∀ n ∈ A1, m > 0 → n > 0 → (n / m < a ∨ n / m > b)) ∧ (∀ m ∈ A2, ∀ n ∈ A2, m > 0 → n > 0 → (n / m < a ∨ n / m > b)) ∧ A0 ∪ A1 ∪ A2 = {x | x > 0} ↔ b ≤ a ^ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-226849,"Prove that $\mathbb{N}$ can be partitioned into two subsets $A$ and $B$ such that $r_A(n) = r_B(n)$ for all $n \in \mathbb{N}$, where for each subset $S$ of $\mathbb{N}$, $r_S(n)$ denotes the number of ordered pairs $(a, b)$ with $a, b \in S$ and $a \neq b$ such that $a + b = n$.","import Mathlib theorem NatPairings : ∃ A B : Set ℕ, A ∪ B = ℕ ∧ A ∩ B = ∅ ∧ ∀ n : ℕ, {p : ℕ × ℕ | p.1 ∈ A ∧ p.2 ∈ A ∧ p.1 ≠ p.2 ∧ p.1 + p.2 = n}.ncard = {p : ℕ × ℕ | p.1 ∈ B ∧ p.2 ∈ B ∧ p.1 ≠ p.2 ∧ p.1 + p.2 = n}.ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-227332,"Prove that for any positive integer \(M\), there exists a finite set of pairwise - distinct positive integers \(a_1,a_2,\cdots,a_n\) such that \(a_i\geq M\) for all \(i = 1,2,\cdots,n\) and \(\sum_{i = 1}^{n}\frac{1}{a_i}=1\).","import Mathlib open Finset Real theorem prove (M : ℕ) (hM : M > 0) : ∃ n : ℕ, ∃ a : Fin n → ℕ, (∀ i j, i ≠ j → a i ≠ a j) ∧ (∀ i, M ≤ a i) ∧ (∑ i, (1 / a i : ℝ)) = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-227434,"Prove that for any positive integer \(n\), every set of \(2^{n + 1}-1\) integers contains a subset of size \(2^n\) such that the sum of its elements is divisible by \(2^n\).","import Mathlib theorem prove (n : ℕ) (hn : 0 < n) (s : Finset ℤ) (h₀ : s.card = 2^(n + 1) - 1) : ∃ t ⊆ s, t.card = 2^n ∧ ∑ x ∈ t, x ≡ 0 [ZMOD 2^n] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-227530,"Let $p$ be a prime number, and let $n \geq p$. Consider a set $A = \{a_1, a_2, \ldots, a_n\}$ of integers. Define $f_k$ as the number of $k$-element subsets of $A$ whose elements' sum is divisible by $p$. Prove that $\sum_{k=0}^{n} (-1)^k f_k \equiv 0 \pmod{p}$.","import Mathlib open Finset theorem PrimeSum (p n : ℕ) (hp : Nat.Prime p) (hn : p ≤ n) (A : Finset ℤ) (hA : A.card = n) : ∑ k ∈ range (n + 1), (-1 : ℤ)^k * {s : Finset ℤ | s ⊆ A ∧ s.card = k ∧ ∑ x ∈ s, x ≡ 0 [ZMOD p]}.ncard ≡ 0 [ZMOD p] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-228681,"Prove that the set of all positive integers \(n \geq 2\) such that for all integers \(i, j\) where \(0 \leq i, j \leq n\), the sum \(i + j\) and the sum of binomial coefficients \(\binom{n}{i} + \binom{n}{j}\) have the same parity is the set of all integers \(n\) of the form \(n = 2^{m+1} - 2\), where \(m\) is a non - negative integer.","import Mathlib theorem prove (n : ℕ) : n ≥ 2 ∧ (∀ i j, i ≤ n → j ≤ n → (i + j) % 2 = (Nat.choose n i + Nat.choose n j) % 2) ↔ ∃ m, n = 2 ^ (m + 1) - 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-228700,"Prove that the positive integers \(n \geq 2\) such that for all integers \(i, j\) where \(0 \leq i, j \leq n\), the sum \(i + j\) and the sum of binomial coefficients \(\binom{n}{i} + \binom{n}{j}\) have the same parity are of the form \(n = 2^k - 2\) for some integer \(k \geq 2\).","import Mathlib theorem positive : ∀ n : ℕ+, 2 ≤ n → (∀ i j : Fin (n+1), i.1 + j.1 ≡ Nat.choose n i + Nat.choose n j [ZMOD 2]) → ∃ k ≥ 2, n = 2 ^ k - 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-228730,"Prove that the set of all positive integers \(n \geq 2\) such that for all integers \(i, j\) where \(0 \leq i, j \leq n\), the sum \(i + j\) and the sum of binomial coefficients \(\binom{n}{i} + \binom{n}{j}\) have the same parity is the set of all integers \(n\) of the form \(n = 2^p - 2\), where \(p\) is a positive integer.","import Mathlib theorem prove (n : ℕ) (hn : 2 ≤ n) : (∀ i j, 0 ≤ i ∧ i ≤ n → 0 ≤ j ∧ j ≤ n → (i + j) % 2 = (Nat.choose n i + Nat.choose n j) % 2) ↔ ∃ p, 0 < p ∧ n = 2 ^ p - 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-228756,"Prove that the set of all positive integers \(n \geq 2\) such that for all integers \(i, j\) with \(0 \leq i, j \leq n\), the sum \(i + j\) and the sum of binomial coefficients \(\binom{n}{i} + \binom{n}{j}\) have the same parity is the set \(\{2^k - 2 \mid k \in \mathbb{Z}, k > 1\}\).","import Mathlib theorem prove (n : ℕ) (hn : 2 ≤ n) : (∀ i j : ℕ, 0 ≤ i ∧ i ≤ n → 0 ≤ j ∧ j ≤ n → (i + j) % 2 = (Nat.choose n i + Nat.choose n j) % 2) ↔ ∃ k : ℕ, 1 < k ∧ n = 2 ^ k - 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-228783,"Prove that the set of all positive integers \(n \geq 2\) such that for all integers \(i, j\) where \(0 \leq i, j \leq n\), the sum \(i + j\) and the sum of binomial coefficients \(\binom{n}{i} + \binom{n}{j}\) have the same parity is the set \(\{n \mid n = 2^k - 2, k \in \mathbb{Z}^+, k \geq 2\}\).","import Mathlib theorem prove : {n : ℕ | 2 ≤ n ∧ ∀ i j : Fin (n + 1), (i.1 + j.1) % 2 = (Nat.choose n i.1 + Nat.choose n j.1) % 2} = {n | ∃ k : ℕ, 2 ≤ k ∧ n = 2 ^ k - 2} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-229264,"Prove that the minimum value of \(k\) for which there exist a set \(X = \{a_1, a_2, \ldots, a_k\}\) and subsets \(A_1, A_2, \ldots, A_{10} \subset X\) such that \(|A_i| = 8\) for all \(i = 1, 2, \ldots, 10\) and \(|A_i \cap A_j| \leq 1\) for all \(i \neq j\) is \(k = 25\).","import Mathlib open Finset theorem min_value_of_k : IsLeast {k : ℕ | ∃ X : Finset ℕ, X.card = k ∧ ∃ A : Fin 10 → Finset ℕ, (∀ i, A i ⊆ X) ∧ (∀ i, (A i).card = 8) ∧ (∀ i j, i ≠ j → (A i ∩ A j).card ≤ 1)} 25 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-229538,"Prove that the maximum value of \(n\) for which there exist subsets \(X\) and \(Y\) of \(A=\{3,4,5,\ldots,n\}\) such that \(X\cup Y = A\), \(X\cap Y=\emptyset\), for any \(x_i,x_j\in X\) (where \(x_i\) and \(x_j\) may be the same), \(x_i\cdot x_j\notin X\), and for any \(y_i,y_j\in Y\) (where \(y_i\) and \(y_j\) may be the same), \(y_i\cdot y_j\notin Y\) is \(n = 242\).","import Mathlib theorem max_n : IsGreatest {n : ℕ | n ≥ 3 ∧ ∃ X Y : Finset ℕ, X ∪ Y = Finset.Icc 3 n ∧ X ∩ Y = ∅ ∧ ∀ x ∈ X, ∀ y ∈ X, x * y ∉ X ∧ ∀ y ∈ Y, ∀ z ∈ Y, y * z ∉ Y} 242 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-230080,"Prove that the number of positive integers \(j \leq 3^{2013}\) that can be expressed in the form \(j = \sum_{k = 0}^m \left((-1)^k \cdot 3^{a_k}\right)\), where \(\{a_k\}\) is a strictly increasing sequence of nonnegative integers, is \(2^{2013}\).","import Mathlib open Finset theorem number_theory_5769 : {j : ℕ | j ≤ 3 ^ 2013 ∧ ∃ m : ℕ, ∃ a : ℕ → ℕ, StrictMono a ∧ j = ∑ k ∈ Icc 0 m, (-1 : ℤ) ^ k * 3 ^ a k}.ncard = 2 ^ 2013 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-230285,"Prove that for a prime $p$, a positive integer $k$, and an integer $r$, there exist infinitely many positive integers $n$ such that $\binom{2n}{n} \equiv r \pmod{p^k}$.","import Mathlib open Nat theorem Nat.choose_eq_r (p k : ℕ) (hp : Nat.Prime p) (hk : 0 < k) (r : ℤ) : ∀ N, ∃ n : ℕ, n > N ∧ Nat.choose (2 * n) n ≡ r [ZMOD p ^ k] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-230399,"Prove that for a $2$-distance set $A \subseteq \mathbb{R}^n$, where for any two distinct elements $v_i, v_j \in A$, the distance between them is either $r$ or $s$, the upper bound for the cardinality $|A|$ is $\frac{n^2 + 3n + 2}{2}$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove_distance_set (n : ℕ) (r s : ℝ) (hr : r > 0) (hs : s > 0) (A : Set (EuclideanSpace ℝ (Fin n))) (hA : ∀ v ∈ A, ∀ w ∈ A, v ≠ w → dist v w = r ∨ dist v w = s) : Set.ncard A ≤ (n ^ 2 + 3 * n + 2) / 2 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-230400,"Prove that the minimum value of \(k\) for which there exist a set \(X = \{a_1, a_2, \ldots, a_k\}\) and subsets \(A_1, A_2, \ldots, A_{10} \subset X\) such that \(|A_i| = 8\) for all \(i = 1, 2, \ldots, 10\) and \(|A_i \cap A_j| \leq 1\) for all \(i \neq j\) is \(39\).","import Mathlib open Finset theorem min_value : IsLeast {k | ∃ (X : Finset ℕ) (_ : X.card = k) (A : Fin 10 → Finset ℕ), (∀ i, A i ⊆ X) ∧ (∀ i j, i ≠ j → (A i ∩ A j).card ≤ 1) ∧ (∀ i, (A i).card = 8)} 39 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-230927,"Prove that the set of all integers \(k\) such that for any nonnegative integers \(a, b\) with \(a - b = k\), there exists a function \(f : \mathbb{N} \to \mathbb{N}\) satisfying \(f(f(n)) = an + b\) for all positive integers \(n\) is the set of all positive integers and all negative odd integers.","import Mathlib theorem prove (k : ℤ) : (∀ a b : ℕ, a - b = k → ∃ f : ℕ → ℕ, ∀ n > 0, f (f n) = a * n + b) ↔ k > 0 ∨ Odd k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-231187,"Prove that if a function \(f: \mathbb{R} \to \mathbb{R}\) is additive but not linear, then the graph of \(f(x)\), defined as \(G = \{ (x, f(x)) : x \in \mathbb{R} \}\), is a dense set in \(\mathbb{R}^2\).","import Mathlib theorem prove_additive_not_linear (f : ℝ → ℝ) (hadd : ∀ x y, f x + f y = f (x + y)) (hnor : ¬∃ a b, ∀ x, f x = a * x + b) : Dense {p : ℝ × ℝ | p.1 ∈ Set.univ ∧ p.2 = f p.1} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-231521,"Prove that for a given integer \(n \geqslant 1\), the sum \(S = \sum_{k=1}^{n} (-1)^{k} \binom{n}{\left\lfloor \sqrt{k} \right\rfloor}\) is equal to \((-1)^{f(n)} \binom{n - 1}{f(n)} - 1\), where \(f(n)\) is the largest integer \(m\) such that \(n - m^2\) is a non - negative, even integer.","import Mathlib open Finset theorem prove {n : ℕ} (hn : 1 ≤ n) : ∑ k ∈ Icc 1 n, (-1 : ℤ)^k * Nat.choose n (Nat.floor (Real.sqrt k)) = (-1)^sSup {m | ∃ p : ℕ, Even p ∧ n - m^2 = p} * Nat.choose (n - 1) (sSup {m | ∃ p : ℕ, Even p ∧ n - m^2 = p}) - 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-231713,"Prove that for any coloring of the integers using three colors (red, yellow, and green), there always exist integers \(a\), \(b\), and \(c\) such that \(a\), \(b\), \(c\), \(a + b\), \(a + c\), \(b + c\), and \(a + b + c\) are all the same color.","import Mathlib theorem colorIntegers (f : ℤ → Fin 3) : ∃ a b c, f a = f b ∧ f b = f c ∧ f a = f (a + b) ∧ f (a + b) = f (a + c) ∧ f (a + c) = f (b + c) ∧ f (b + c) = f (a + b + c) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-232009,"Prove that if \(M(n)\) is the largest integer \(m\) for which the inequality \(\binom{m}{n - 1} > \binom{m - 1}{n}\) holds, then \(\lim_{n \to \infty} \frac{M(n)}{n} = \frac{3 + \sqrt{5}}{2}\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (M : ℕ → ℕ) (hM : ∀ n, M n = sSup {m | Nat.choose m (n - 1) > Nat.choose (m - 1) n}) : Tendsto (λ n => (M n : ℝ) / n) atTop (𝓝 ((3 + Real.sqrt 5) / 2)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-233482,"(a) Prove that for a positive integer \(n\), the set \(A_n=\{(x, y) \in \mathbb{Z}^2 \mid x^2 + xy + y^2 = n\}\) is always finite. (b) Prove that for a positive integer \(n\), the number of elements of the set \(A_n=\{(x, y) \in \mathbb{Z}^2 \mid x^2 + xy + y^2 = n\}\) is divisible by \(6\). (c) Prove that for a positive integer \(n\), the number of elements of the set \(A_n=\{(x, y) \in \mathbb{Z}^2 \mid x^2 + xy + y^2 = n\}\) is divisible by \(12\) if and only if \(n\) is not of the form \(3k^2\) for any integer \(k\).","import Mathlib open Finset theorem A (n : ℕ) (hn : n > 0) : Finite {p : ℤ × ℤ | p.1 ^ 2 + p.1 * p.2 + p.2 ^ 2 = n} ∧ 6 ∣ {p : ℤ × ℤ | p.1 ^ 2 + p.1 * p.2 + p.2 ^ 2 = n}.ncard ∧ (12 ∣ {p : ℤ × ℤ | p.1 ^ 2 + p.1 * p.2 + p.2 ^ 2 = n}.ncard ↔ ¬∃ k, n = 3 * k ^ 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-233547,"Let \(n = 2^k\) for some integer \(k \geq 0\). Prove that from any set of \(2n - 1\) integers, it is possible to select \(n\) integers such that their sum is divisible by \(n\).","import Mathlib theorem qwen (n k : ℕ) (hn : n = 2 ^ k) : ∀ s : Finset ℤ, s.card = 2 * n - 1 → ∃ t ⊆ s, t.card = n ∧ ∑ x ∈ t, x ≡ 0 [ZMOD n] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-234623,"1. Prove that for positive real numbers \(a, b, c\), \(\frac{a^2}{b} + \frac{b^2}{c} + \frac{c^2}{a} \geq \frac{(a + b + c)(a^2 + b^2 + c^2)}{ab + bc + ca}\). 2. Prove that the natural numbers \(n \geq 3\) such that for any regular \(n\) - gon, natural numbers can be assigned to each vertex in such a way that for any three vertices \(A, B, C\) of the \(n\) - gon with \(AC = BC\), the number assigned to \(C\) is either strictly greater than both numbers assigned to \(A\) and \(B\), or strictly less than both numbers assigned to \(A\) and \(B\), are all powers of 2 greater than 2. 3. Let \(K, L, M\) be the midpoints of sides \(AB, BC, CA\) of triangle \(\triangle ABC\), respectively. Let \(H\) be the foot of the perpendicular from \(B\) to \(AC\). The lines \(CK\) and \(AL\) intersect the circumcircle of \(\triangle ABC\) again at points \(P\) and \(Q\), respectively. Prove that the circumcircles of \(\triangle PQH\) and \(\triangle KLM\) are tangent to each other.","import Mathlib open Real theorem inequalities (a b c : ℝ) (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) : a ^ 2 / b + b ^ 2 / c + c ^ 2 / a ≥ ((a + b + c) * (a ^ 2 + b ^ 2 + c ^ 2)) / (a * b + b * c + c * a) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-235063,"Let \(m, n\) be positive integers. Prove that given a set of \(mn + 1\) closed intervals \(I_1, I_2, \dots, I_{mn+1}\) on the real number line, there are either \(m + 1\) intervals that share a common point or \(n + 1\) pairwise disjoint intervals.","import Mathlib open Real Set open scoped BigOperators theorem mhn (m n : ℕ) (hm : 0 < m) (hn : 0 < n) (I : Fin (m * n + 1) → Set ℝ) (hI : ∀ i, IsClosed (I i)) : ∃ S : Finset (Fin (m * n + 1)), S.card = m + 1 ∧ (∃ x, ∀ i ∈ S, x ∈ I i) ∨ ∃ S : Finset (Fin (m * n + 1)), S.card = n + 1 ∧ (∀ i ∈ S, ∀ j ∈ S, i ≠ j → Disjoint (I i) (I j)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-235614,"Prove that the set of all positive integers \(n \geq 2\) such that for all integers \(i, j\) where \(0 \leq i, j \leq n\), the sum \(i + j\) and the sum of binomial coefficients \(\binom{n}{i} + \binom{n}{j}\) have the same parity is the set \(\{n \mid n = 2^t - 2, t \geq 2\}\).","import Mathlib theorem prove : {n : ℕ | 2 ≤ n ∧ ∀ i j : ℕ, i ≤ n → j ≤ n → (i + j) % 2 = (Nat.choose n i + Nat.choose n j) % 2} = {n | ∃ t : ℕ, 2 ≤ t ∧ n = 2 ^ t - 2} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-235632,"Prove that the set of all positive integers \(n \geq 2\) such that for all integers \(i, j\) with \(0 \leq i, j \leq n\), the sum \(i + j\) and the sum of binomial coefficients \(\binom{n}{i} + \binom{n}{j}\) have the same parity is the set of all integers \(n\) of the form \(n = 2^m - 2\), where \(m\) is a positive integer.","import Mathlib theorem Prove {n : ℕ} (hn : 2 ≤ n) : (∀ i j, 0 ≤ i ∧ i ≤ n → 0 ≤ j ∧ j ≤ n → (i + j) % 2 = (Nat.choose n i + Nat.choose n j) % 2) ↔ ∃ m, 0 < m ∧ n = 2 ^ m - 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-235637,"Prove that the set of all positive integers \(n \geq 2\) such that for all integers \(i, j\) where \(0 \leq i, j \leq n\), the sum \(i + j\) and the sum of binomial coefficients \(\binom{n}{i} + \binom{n}{j}\) have the same parity is given by \(n = 2^{s+1}-2\), where \(s\) is a non - negative integer.","import Mathlib theorem prove (n : ℕ) (hn : 2 ≤ n) : (∀ i j, i ≤ n → j ≤ n → (i + j) % 2 = (Nat.choose n i + Nat.choose n j) % 2) ↔ ∃ s, n = 2 ^ (s + 1) - 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-235693,"Determine the maximal length $L$ of a sequence $a_{1}, \\ldots, a_{L}$ of positive integers satisfying both the following properties: - every term in the sequence is less than or equal to $2^{2023}$, and - there does not exist a consecutive subsequence $a_{i}, a_{i+1}, \\ldots, a_{j}$ (where $1 \\leqslant i \\leqslant j \\leqslant L$ ) with a choice of signs $s_{i}, s_{i+1}, \\ldots, s_{j} \\in\\{1,-1\\}$ for which $$s_{i} a_{i}+s_{i+1} a_{i+1}+\\cdots+s_{j} a_{j}=0$$ Please provide the sum of the base and exponent used in the expression for the maximal length $L$. prove that answer is 2026","import Mathlib open Finset theorem max_length : IsGreatest {L > 0 | ∃(a : ℕ → ℤ), (∀ n, 1 ≤ n → n ≤ L → a n > 0 ∧ a n ≤ 2^2023) ∧ (∀ i j : ℕ, 1 ≤ i → i ≤ j → j ≤ L → ¬∃ (s : ℕ → ℤ), (∀ k ∈ Set.Icc i j, 1 ∈ Icc (-1) 1 → s k = 1 ∨ s k = -1) ∧ (∑ k ∈ Set.Icc i j, s k * a k = 0))} 2026 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-235768,"Consider the set \( S = \{0.2, 0.3, 0.5, 0.7, \ldots\} \), where each element is formed by placing a decimal point at the beginning of each prime number. This set is dense in the interval \((0.1, 1)\). Conjecture: For any subinterval \((a, b)\) of \([0.1, 1)\), there exists an integer \(m\) such that for all integers \(k \ge m\), there exists a number \(t \in (a, b)\) such that \(t \cdot 10^k\) is a prime number. Determine if this conjecture is true. Prove that the answer is True.","import Mathlib open Real Set open scoped BigOperators theorem DenseS : ∀ a b : ℝ, a ∈ Ico 0.1 1 → b ∈ Ico 0.1 1 → ∃ m : ℕ, ∀ k ≥ m, ∃ t ∈ Ioo a b, Prime (t * 10 ^ k) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-235922,"Let integer $n \geq 2$. Prove that there exists a set $S$ consisting of $n$ positive integers such that for any two distinct elements $a, b$ in $S$, the difference $a - b$ divides both $a$ and $b$, but does not divide any other elements in $S$.","import Mathlib theorem Qwen (n : ℕ) (hn : 2 ≤ n) : ∃ S : Finset ℕ, S.card = n ∧ (∀ x ∈ S, 0 < x) ∧ (∀ a ∈ S, ∀ b ∈ S, a ≠ b → (a - b) ∣ a ∧ (a - b) ∣ b ∧ ∀ x ∈ S, x ≠ a → x ≠ b → ¬(a - b) ∣ x) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-235923,"Let $n$ be a positive integer. Prove that: (1) There exists a set $S$ consisting of $6n$ positive integers such that the least common multiple of any two elements in $S$ is at most $32n^2$; (2) For any set $T$ consisting of $6n$ positive integers, there exist two elements whose least common multiple is greater than $9n^2$.","import Mathlib theorem npos (n : ℕ) (hn : 0 < n) : (∃ S : Finset ℕ, S.card = 6 * n ∧ ∀ x ∈ S, 0 < x ∧ ∀ x ∈ S, ∀ y ∈ S, x ≠ y → Nat.lcm x y ≤ 32 * n ^ 2) ∧ (∀ T : Finset ℕ, T.card = 6 * n ∧ ∀ x ∈ T, 0 < x → ∃ x ∈ T, ∃ y ∈ T, x ≠ y ∧ Nat.lcm x y > 9 * n ^ 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-235929,"A broken calculator has only the keys $\sin, \cos, \tan, \arcsin, \arccos, \arctan$ functioning. Initially, it displays 0. Prove that any positive rational number can be obtained by pressing a finite sequence of keys (assuming the calculator performs real-number calculations with infinite precision and all functions use radian mode).","import Mathlib open Real theorem broken_calculator (r : ℚ) (hr : r > 0) : ∃ s : ℕ → ℝ, s 0 = 0 ∧ (∀ i, s (i + 1) = sin (s i) ∨ s (i + 1) = cos (s i) ∨ s (i + 1) = tan (s i) ∨ s (i + 1) = arcsin (s i) ∨ s (i + 1) = arccos (s i) ∨ s (i + 1) = arctan (s i)) ∧ s n = r := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-235933,"For $m \geq 3$, a list of $\binom{m}{3}$ real numbers $a_{ijk} (1 \leq i < j < k \leq m)$ is said to be area definite for $\mathbb{R}^n$ if the inequality \begin{equation} \sum_{1 \leq i < j < k \leq m} a_{ijk} \cdot \text{Area}(\triangle A_i A_j A_k) \geq 0 \end{equation} holds for every choice of $m$ points $A_1, \cdots, A_m$ in $\mathbb{R}^n$. For example, the list of four numbers $a_{123} = a_{124} = a_{134} = 1, a_{234} = -1$ is area definite for $\mathbb{R}^2$. Prove that if a list of $\binom{m}{3}$ numbers is area definite for $\mathbb{R}^2$, then it is area definite for $\mathbb{R}^3$. ","import Mathlib open Real open scoped BigOperators theorem area_definite {m : ℕ} (hm : 3 ≤ m) (a : Fin m → Fin m → Fin m → ℝ) (h : ∀ A : Fin m → EuclideanSpace ℝ (Fin 2), ∑ i : Fin m, ∑ j : Fin m, ∑ k : Fin m, (if (i < j ∧ j < k) then a i j k * (MeasureTheory.volume (convexHull ℝ {A i, A j, A k})).toReal else 0) ≥ 0) : ∀ A : Fin m → EuclideanSpace ℝ (Fin 3), ∑ i : Fin m, ∑ j : Fin m, ∑ k : Fin m, (if (i < j ∧ j < k) then a i j k * (MeasureTheory.volume (convexHull ℝ {A i, A j, A k})).toReal else 0) ≥ 0 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-236045,"Prove that for every function $f: \mathbb{R} \to \mathbb{R}$, the set of points of discontinuity of the first kind is at most countable. A point $x_0$ is a point of discontinuity of the first kind if and only if both $\lim_{x \to x_0^-} f(x)$ and $\lim_{x \to x_0^+} f(x)$ exist but are not equal to $f(x_0)$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove (f : ℝ → ℝ) : Set.Countable {x | ¬ ContinuousAt f x ∧ ∃ L1 L2 : ℝ, Tendsto f (𝓝[<] x) (𝓝 L1) ∧ Tendsto f (𝓝[>] x) (𝓝 L2) ∧ L1 ≠ f x ∧ L2 ≠ f x} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-236057,"For any positive integer \(n\), prove that there exists a set \(X\) containing \(n\) distinct integers, each greater than 1, such that the average of the elements of any non - empty subset of \(X\) is a perfect square, cube, or higher power.","import Mathlib theorem for_n (n : ℕ) (hn : 0 < n) : ∃ X : Finset ℕ, X.card = n ∧ (∀ x ∈ X, 1 < x) ∧ ∀ S ⊆ X, S ≠ ∅ → ∃ m : ℕ, m^2 = ∑ x ∈ S, x / S.card ∨ m^3 = ∑ x ∈ S, x / S.card ∨ ∃ k : ℕ, m^k = ∑ x ∈ S, x / S.card := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-236235,"a) Prove that there exist infinitely many functions $f: \mathbb{N} \rightarrow \mathbb{N}$ such that for any $y \in \mathbb{N}$, the equation $f(x) = y$ has exactly 3 solutions. b) Prove that the only monotonous function $f: \mathbb{N} \rightarrow \mathbb{N}$ such that for any $y \in \mathbb{N}$, the equation $f(x) = y$ has exactly 3 solutions is $f(x) = \left\lfloor \frac{x + 2}{3} \right\rfloor$. c) Prove that there do not exist monotonous functions $f: \mathbb{Q} \rightarrow \mathbb{Q}$ such that for any $y \in \mathbb{Q}$, the equation $f(x) = y$ has exactly 3 solutions.","import Mathlib theorem a : Set.Infinite {f : ℕ → ℕ | ∀ y, {x | f x = y}.encard = 3} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-236355,"Prove that the maximum size of a set $S$ such that: 1) All elements of $S$ are natural numbers not exceeding $100$; 2) For any two elements $a, b \in S$, there exists $c \in S$ such that $(a, c) = (b, c) = 1$; 3) For any two elements $a, b \in S$, there exists $d \in S$ such that $(a, d) > 1$ and $(b, d) > 1$; is equal to $\boxed{72}$.","import Mathlib theorem SetMax : IsGreatest {n | ∃ S : Finset ℕ, S.card = n ∧ (∀ x ∈ S, x ≤ 100) ∧ (∀ a ∈ S, ∀ b ∈ S, ∃ c ∈ S, Nat.Coprime a c ∧ Nat.Coprime b c) ∧ (∀ a ∈ S, ∀ b ∈ S, ∃ d ∈ S, Nat.gcd a d > 1 ∧ Nat.gcd b d > 1)} 72 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-236404,"Prove that for any positive integer \(n\), the following identity holds: \( \sum_{r=1}^{n-1}\binom{n-2}{r-1}r^{r-1}(n-r)^{n-r-2} = n^{n-2} \).","import Mathlib open Finset theorem prove (n : ℕ) (hn : 0 < n) : ∑ r ∈ Icc 1 (n - 1), Nat.choose (n - 2) (r - 1) * r^(r - 1) * (n - r)^(n - r - 2) = n^(n - 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-236441,"Prove that for every $n \in \mathbb{N}$, there exists a set $S$ of $n$ positive integers such that for any two distinct $a, b \in S$, $a - b$ divides both $a$ and $b$, but does not divide any other element of $S$. If there exists a set $S$ of $n$ positive integers satisfying the above - mentioned conditions, then there exists a set $S'=S\cup\{A\}$ of $n + 1$ positive integers that also satisfies the condition that for any two distinct $a,b\in S'$, $a - b$ divides both $a$ and $b$, but does not divide any other element of $S'$.","import Mathlib theorem prove (n : ℕ) : ∃ S : Finset ℕ, S.card = n ∧ (∀ s ∈ S, s > 0) ∧ (∀ a ∈ S, ∀ b ∈ S, a ≠ b → a - b ∣ a ∧ a - b ∣ b ∧ ∀ x ∈ S, x ≠ a → x ≠ b → ¬(a - b ∣ x)) ∧ ∃ A : ℕ, A > 0 ∧ (S ∪ {A}).card = n + 1 ∧ (∀ s ∈ (S ∪ {A}), s > 0) ∧ (∀ a ∈ (S ∪ {A}), ∀ b ∈ (S ∪ {A}), a ≠ b → a - b ∣ a ∧ a - b ∣ b ∧ ∀ x ∈ (S ∪ {A}), x ≠ a → x ≠ b → ¬(a - b ∣ x)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-236742,"(a) Prove that for \(a, b \in \mathbb{R}\) with \(a < b\), an increasing function \(f: (a, b) \to \mathbb{R}\), and \(q \in \mathbb{Q}\), there exists at most one \(x_0 \in (a, b)\) such that \(\sup\{f(x) : x \in (a, x_0)\} < q < \inf\{f(x) : x \in (x_0, b)\}\). (b) Prove that for \(a, b \in \mathbb{R}\) with \(a < b\), an increasing function \(f: (a, b) \to \mathbb{R}\), and \(x_0 \in (a, b)\), \(f\) is not continuous at \(x_0\) if and only if there exists a \(q \in \mathbb{Q}\) such that \(\sup\{f(x) : x \in (a, x_0)\} < q < \inf\{f(x) : x \in (x_0, b)\}\). (c) Prove that for \(a, b \in \mathbb{R}\) with \(a < b\) and an increasing function \(f: (a, b) \to \mathbb{R}\), the set \(D = \{x_0 \in (a, b) : f \text{ is not continuous at } x_0\}\) is countable.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem a {a b : ℝ} (ha : a < b) (f : ℝ → ℝ) (hf : StrictMonoOn f (Set.Ioo a b)) (q : ℚ) : ∃! x₀ ∈ Set.Ioo a b, sSup {f x | x ∈ Set.Ioo a x₀} < q ∧ q < sInf {f x | x ∈ Set.Ioo x₀ b} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-236831,"Prove that if a cake is repeatedly sliced, with the largest piece being selected after each cut and the other pieces discarded, and the proportions of the pieces created by a random cut are given by the probability distribution \(P = \left\{ \left(\frac{2}{3}, \frac{1}{3}\right) \text{ with probability } \frac{3}{4}; \left(\frac{2}{5}, \frac{3}{5}\right) \text{ with probability } \frac{1}{4} \right\}\), then the size of the cake, to the first order in the exponent, after \(n\) cuts is \(V_n \approx V_0 \exp\left(-n \left|\left(\frac{3}{4}\right) \ln\left(\frac{2}{3}\right) + \left(\frac{1}{4}\right) \ln\left(\frac{3}{5}\right)\right|\right)\), where \(V_0\) is the initial volume of the cake.","import Mathlib open Real theorem prove (V0 : ℝ) (hV0 : V0 > 0) (n : ℕ) : ∃ Vn, Vn = V0 * exp (-n * abs ((3 / 4) * log (2 / 3) + (1 / 4) * log (3 / 5))) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-236922,"Let \(a_1, a_2, \ldots, a_n\) be a sequence of integers where \(a_i\leq1\) for \(i = 1,2,\ldots,n\) and \(\sum_{i = 1}^{n}a_i>0\). Define an interesting subsequence as a subsequence of \(a_1, a_2, \ldots, a_n\) whose sum of terms is \(1\). For each interesting subsequence of \(a_1, a_2, \ldots, a_n\), write the number \((k - 1)!(n - k)!\) on a blackboard, where \(k\) is the number of terms in the subsequence. Prove that \(\sum_{ ext{interesting subsequences}}(k - 1)!(n - k)!=n!\).","import Mathlib open Finset theorem sum_interesting_subsequences {n : ℕ} (hn : 0 < n) (a : ℕ → ℤ) (ha : ∀ i ∈ Icc 1 n, a i ≤ 1) (hsum : ∑ i ∈ Icc 1 n, a i > 0) : ∑ t ∈ (Icc 1 n).powerset.filter (fun s => ∑ i ∈ s, a i = 1), Nat.factorial (t.card - 1) * Nat.factorial (n - t.card) = Nat.factorial n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237043,"Prove that for all \(n \in \mathbb{N}\), \(\left \lfloor \frac{10 \sqrt{n} \cdot \binom{2n}{n}}{4^n} \right \rfloor = 5\).","import Mathlib theorem prove (n : ℕ) : ⌊(10 * Real.sqrt n * Nat.choose (2 * n) n) / 4 ^ n⌋ = 5 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237121,"Let \(n\) be a positive integer, and suppose Santa Claus has at least \(n\) gifts to distribute among \(n\) children. For each \(i \in \{1, 2, \ldots, n\}\), the \(i\)-th child finds \(x_i > 0\) of these gifts desirable, where the following condition holds: \[ \sum_{i=1}^{n} \frac{1}{x_i} \leq 1. \] Prove that it is possible for Santa Claus to distribute the gifts such that each child receives a gift that they like.","import Mathlib theorem distribution_gifts (n : ℕ) (hn : 0 < n) (x : Fin n → ℝ) (hx : ∀ i, 0 < x i) (h : ∑ i, 1 / x i ≤ 1) : ∃ y : Fin n → ℕ, (∀ i, 0 < y i) ∧ (∀ i, y i ≤ x i) ∧ (∑ i, y i = n) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237211,"Let $M$ be the set of positive integers that do not have a prime divisor greater than 3. Consider any infinite family of subsets of $M$, denoted as $A_1, A_2, \ldots$. Prove that there exist distinct indices $i$ and $j$ such that for every $x \in A_i$, there exists some $y \in A_j$ for which $y \mid x$.","import Mathlib open Finset theorem prove_infinite (M : Set ℕ) (hM : ∀ n ∈ M, ∀ p, Nat.Prime p → p ∣ n → p ≤ 3) (A : ℕ → Set ℕ) (hA : ∀ i, A i ⊆ M) : ∃ i j, i ≠ j ∧ ∀ x ∈ A i, ∃ y ∈ A j, y ∣ x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237312,"Prove that in a game where Alice and Bob take turns to change a positive - integer $n$ to either $k - 1$ or $\lceil k/2 \rceil$ (with Alice making the first move) and the player who changes the number to $0$ wins, the values of $n$ for which Alice has a winning strategy are \(1\), \(2\times4^k + 1\) (\(k\geq0\)), \(3\times4^k + 1\) (\(k\geq0\)), and \((2l + 5)\times4^k + 1\) (\(k, l\geq0\)).","import Mathlib open Finset theorem prove_winners {n : ℕ} (hn : n > 0) : (∃ k : ℕ, n = 1 ∨ n = 2 * 4 ^ k + 1 ∨ n = 3 * 4 ^ k + 1 ∨ ∃ l : ℕ, n = (2 * l + 5) * 4 ^ k + 1) ↔ n = 1 ∨ ∃ k : ℕ, n = 2 * 4 ^ k + 1 ∨ ∃ k : ℕ, n = 3 * 4 ^ k + 1 ∨ ∃ k l : ℕ, n = (2 * l + 5) * 4 ^ k + 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237487,"Prove that if $p$ is an odd prime and $n$ is a positive integer such that $\gcd(n,p)=1$, then the number of tuples $(a_1, a_2, \ldots, a_{p - 1})$ where each $a_i$ is a natural number not exceeding $n - 1$ and the sum $\sum_{k = 1}^{p - 1} k a_k$ is divisible by $p$ is $\frac{n^{p - 1} + p - 1}{p}$.","import Mathlib theorem number_of_tuples (p n : ℕ) [hp : Fact (Nat.Prime p)] (hn : 0 < n) (hpn : Odd p ∧ Nat.Coprime n p) : Set.ncard {t : Fin (p - 1) → ℕ | (∀ i, t i ≤ n - 1) ∧ p ∣ ∑ k : Fin (p - 1), (k + 1) * t k} = (n ^ (p - 1) + p - 1) / p := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237528,"Prove that the set \( \{ 1, 2, \dots, 2011 \} \) can be colored using 4 colors in such a way that no 9 numbers form an arithmetic progression.","import Mathlib theorem color_set : ∃ f : ℕ → Fin 4, ∀ s : Finset ℕ, s ⊆ Finset.Icc 1 2011 ∧ s.card = 9 → ¬∃ a d : ℕ, a ∈ s ∧ d ≠ 0 ∧ ∀ i ∈ Finset.range 9, a + d * i ∈ s := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237620,"Prove that the number of subsets $T$ of the set $S = \{0, 1, \ldots, 2015\}$ such that for any two elements $a, b \in T$ (not necessarily distinct), the remainder of $2a + b \pmod{2016}$ is also an element of $T$, is \(10^6 - 1\).","import Mathlib theorem prove : Set.ncard {T : Finset ℕ | T ⊆ Finset.Icc 0 2015 ∧ ∀ a ∈ T, ∀ b ∈ T, (2 * a + b) % 2016 ∈ T} = 10 ^ 6 - 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237661,"1. **Statement (a)**: - Prove that there does not exist an entire function \(f\) defined on \(\mathbb{C}\) such that \(f(0)=1\) and \(|f(z)|\leq |z|^{-2}\) for all \(z\in \mathbb{C}\) with \(|z|\geq 10\). 2. **Statement (b)**: - Prove that if \(f:\mathbb{C}\to\mathbb{C}\) is a non - constant entire function, then its image is dense in \(\mathbb{C}\). 3. **Statement (c)**: - Prove that there does not exist a non - constant continuous mapping \(\gamma:[0,1]\to\{z\in\mathbb{C}:|z|\leq 1\}\) with \(\gamma(0)=0\) and an analytic function \(f\) in the disk \(\{z\in\mathbb{C}:|z|\lt 2\}\) such that \(f(0)=0\), \(f(1)=1\), and there exists \(\tau\) with \(0\lt\tau\lt 1\) such that for all \(0\lt t\lt\tau\), we have \(f(\gamma(t))\neq 0\).","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem a : ¬ ∃ f : ℂ → ℂ, Differentiable ℂ f ∧ f 0 = 1 ∧ ∀ z, ‖z‖ ≥ 10 → ‖f z‖ ≤ 1 / ‖z‖ ^ 2 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237692,"Let $X, Y \subset \mathbb{Z}^{+}$ such that $|X| = m$ and $|Y| = n$ with $m, n \geq 2$. Let $S$ be a set containing $m + n - 1$ elements of the form $ab$ where $a \in X$ and $b \in Y$. Prove that there exist $x, y, z \in S$ such that $x \mid yz$ and $x \neq y \neq z$.","import Mathlib theorem Qwen {X Y : Finset ℕ} (hX : X.card ≥ 2) (hY : Y.card ≥ 2) (S : Finset ℕ) (hS : S.card = X.card + Y.card - 1) (hS1 : ∀ s ∈ S, ∃ x ∈ X, ∃ y ∈ Y, s = x * y) : ∃ x ∈ S, ∃ y ∈ S, ∃ z ∈ S, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ x ∣ y * z := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237700,"Prove that there exist a bijective function $g: \mathbb{N} \to \mathbb{N}$ and a function $f: \mathbb{N} \to \mathbb{N}$ such that for all $x \in \mathbb{N}$, the equation $f^{2009}(x) = g(x) + a$ holds if and only if $2009 \mid a$.","import Mathlib theorem exist_bijective_and_f : ∃ (g : ℕ → ℕ) (f : ℕ → ℕ), Function.Bijective g ∧ ∀ x : ℕ, ∀ a : ℤ, f^[2009] x = g x + a ↔ 2009 ∣ a := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237709,"Let \(x_1, x_2, \ldots, x_n\) be distinct natural numbers such that every subset of \(\{x_1, x_2, \ldots, x_n\}\) has a unique sum of its elements, resulting in \(2^n\) different sums denoted by \(a_k\) for \(k = 0, 1, 2, \ldots, 2^n-1\). Prove the following: 1. \(\sum_{k = 1}^{n} x_k \ge 2^n - 1\). 2. \(\sum_{k = 1}^{n} \frac{1}{x_k} \le 2 - \frac{1}{2^{n - 1}}\). 3. \(\sum_{k = 1}^{n} x_k^2+\left(\sum_{k = 1}^{n} x_k\right)^2 \ge \frac{2(2^n - 1)(2^{n+1}-1)}{3}\). 4. \(\sum_{k = 1}^{n} x_k^2 \ge \frac{4^n - 1}{3}\). 5. Using the identity \(\sum_{k = 1}^{n} x_k^2+\left(\sum_{k = 1}^{n} x_k\right)^2=\frac{\sum_{i = 0}^{2^n-1} a_i^2}{2^{n - 2}}\), prove that \(\sum_{k = 1}^{n} x_k^2 \ge \frac{4^n - 1}{3}\).","import Mathlib theorem Finset.sum_eq_sum (n : ℕ) (hn : 0 < n) (x : Fin n → ℕ) (hx : ∀ i j, x i = x j → i = j) (a : Fin (2 ^ n) → ℕ) (ha : ∀ k, ∃! s : Finset (Fin n), ∑ i ∈ s, x i = a k) : (∑ i, x i ≥ 2 ^ n - 1) ∧ (∑ i, (1 / x i : ℚ) ≤ 2 - 1 / 2 ^ (n - 1)) ∧ (∑ i, (x i) ^ 2 + (∑ i, x i) ^ 2 ≥ 2 * (2 ^ n - 1) * (2 ^ (n + 1) - 1) / 3) ∧ (∑ i, (x i) ^ 2 ≥ (4 ^ n - 1) / 3) ∧ (∑ i, (x i) ^ 2 + (∑ i, x i) ^ 2 = (∑ i, (a i) ^ 2) / 2 ^ (n - 2)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237743,"Prove that there exists a function \(f : \mathbb{N} \to P(\mathbb{N})\) and a function \(f : \mathbb{R} \to P(\mathbb{N})\) such that for every \(a, b \in \mathbb{N}\) or \(a, b \in \mathbb{R}\) with \(a \neq b\), the intersection \(f(a) \cap f(b)\) is finite.","import Mathlib open Set Real theorem exist_f_a : ∃ f_a : ℕ → Set ℕ, (∀ a b : ℕ, a ≠ b → (f_a a ∩ f_a b).Finite) := by sorry theorem exist_f_r : ∃ f_r : ℝ → Set ℕ, (∀ a b : ℝ, a ≠ b → (f_r a ∩ f_r b).Finite) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237805,"Let $S$ be a set and consider $A_1, A_2, \ldots, A_m \subseteq S$ such that for any $x, y \in S$ with $x \neq y$, there exists a unique $i \in \{1, 2, \ldots, m\}$ for which $x, y \in A_i$. Additionally, for all $i \in \{1, 2, \ldots, m\}$, it holds that $\operatorname{card}(A_i) \geq 2$. Prove that either $m = 1$ or $m \geq \operatorname{card}(S)$.","import Mathlib theorem Set.Icc.card {S : Type*} (m : ℕ) (A : Fin m → Set S) (h1 : ∀ x y : S, x ≠ y → ∃! i : Fin m, x ∈ A i ∧ y ∈ A i) (h2 : ∀ i : Fin m, (A i).ncard ≥ 2) : m = 1 ∨ m ≥ (Nat.card S) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237835,"Prove that for every integer $n \geq 2$ and every integer $k$ satisfying $2n - 3 \leq k \leq \frac{n(n - 1)}{2}$, there exist $n$ distinct real numbers $a_1, a_2, \ldots, a_n$ such that among the sums $a_i + a_j$ for $1 \leq i \leq j \leq n$, exactly $k$ distinct sums are obtained.","import Mathlib theorem prove (n : ℕ) (hn : 2 ≤ n) (k : ℕ) (hk : 2 * n - 3 ≤ k ∧ k ≤ n * (n - 1) / 2) : ∃ a : Finset ℝ, a.card = n ∧ {x | ∃ i ∈ a, ∃ j ∈ a, x = i + j}.encard = k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237870,"Let $S$ be a set containing $m$ pairs $(a, b)$ of positive integers such that $1 \leq a < b \leq n$. Prove that there are at least \[ \frac{m}{3n} (4m - n^2) \] triples $(a, b, c)$ such that $(a, b)$, $(a, c)$, and $(b, c)$ are all elements of $S$.","import Mathlib theorem qwen {S : Finset (ℕ × ℕ)} {m n : ℕ} (hm : S.card = m) (hn : ∀ a ∈ S, a.2 ≤ n) (hpos : ∀ a ∈ S, 0 < a.1 ∧ 0 < a.2) (hord : ∀ a ∈ S, a.1 < a.2) : ∃ T : Finset (ℕ × ℕ × ℕ), T.card ≥ m / (3 * n) * (4 * m - n ^ 2) ∧ (∀ a ∈ T, ∃ x y z, a = (x, y, z) ∧ (x, y) ∈ S ∧ (x, z) ∈ S ∧ (y, z) ∈ S) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237897,"Let $A_1, A_2, \ldots, A_n$ be subsets of $\{1, 2, \ldots, n\}$. Suppose that for any distinct $i, j \in \{1, 2, \ldots, n\}$, it holds that $i \in A_j$ if and only if $j \notin A_i$, and $i \notin A_i$ for all $i$. Also, assume that there exists a constant $k$ such that $|A_i \cap A_j| = k$ for all distinct $i, j$. Prove that the number of elements in each set $A_i$ is equal to $2k + 1$.","import Mathlib theorem qwen {n : ℕ} (hn : 0 < n) (A : Finset.Icc 1 n → Set (Finset.Icc 1 n)) (hA : ∀ i j, i ≠ j → (i ∈ A j ↔ j ∉ A i) ∧ ∀ i, i ∉ A i) (hk : ∃ k, ∀ i j, i ≠ j → (A i ∩ A j).ncard = k) : ∀ i, (A i).ncard = 2 * k + 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237908,"Prove that the sets $A \subset \mathbb{N}$ that satisfy the condition that for any $a, b \in A$ with $a > b$, the number $\frac{[a, b]}{a - b}$ is also an element of $A$ (where $[a, b]$ denotes the least common multiple of $a$ and $b$) are exactly the sets of the form $\{t^2, t(t + 1)\}$ for some $t\in\mathbb{N}$.","import Mathlib theorem prove {A : Set ℕ} (hA : ∀ a ∈ A, ∀ b ∈ A, a > b → (Nat.lcm a b) / (a - b) ∈ A) : ∃ t : ℕ, A = {x | x = t ^ 2 ∨ x = t * (t + 1)} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-237953,"Prove that the set $\{1, 2, \ldots, 2005\}$ can be partitioned into two subsets such that neither subset contains an arithmetic progression of $18$ terms. Assume that the arithmetic progressions considered are non-constant and have a positive common difference.","import Mathlib theorem prove_partition : ∃ s1 s2 : Finset ℕ, s1 ⊆ Finset.Icc 1 2005 ∧ s2 ⊆ Finset.Icc 1 2005 ∧ s1 ∩ s2 = ∅ ∧ ∀ d > 0, ¬∃ a ∈ s1, ∃ n : ℕ, a + d * (n - 1) ∈ s1 ∧ ∀ i ∈ Finset.range 18, a + d * i ∈ s1 ∧ ∀ d > 0, ¬∃ a ∈ s2, ∃ n : ℕ, a + d * (n - 1) ∈ s2 ∧ ∀ i ∈ Finset.range 18, a + d * i ∈ s2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-238034,"Given a regular 27 - gon, let seven vertices be chosen arbitrarily. Prove that among these seven points, there exist either three points that form an isosceles triangle or four points that form an isosceles trapezoid. Specifically, show that if the vertices are labeled \(a_1, a_2, \ldots, a_7\) in a clockwise manner starting from \(0\), then there are either three vertices \(a, b, c\) such that \(\frac{a + c}{2}\equiv b\pmod{27}\), or four vertices \(a, b, c, d\) such that \(\frac{a + d}{2}\equiv\frac{b + c}{2}\pmod{27}\).","import Mathlib theorem is_tri (S : Finset (Fin 27)) (hS : S.card = 7) : ∃ a ∈ S, ∃ b ∈ S, ∃ c ∈ S, (a + c) / 2 ≡ b [ZMOD 27] ∨ ∃ a ∈ S, ∃ b ∈ S, ∃ c ∈ S, ∃ d ∈ S, (a + d) / 2 ≡ (b + c) / 2 [ZMOD 27] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-238092,"Prove that for \(n > 1\), the sequence \(\varphi(1), \varphi(2), \ldots, \varphi(n)\) can be partitioned into two sets \(\mathcal{A}\) and \(\mathcal{B}\) such that \(\sum_{a \in \mathcal{A}} a = \sum_{b \in \mathcal{B}} b\).","import Mathlib theorem φPartition (n : ℕ) (hn : 1 < n) : ∃ A B : Finset ℕ, A ⊆ Finset.Icc 1 n ∧ B ⊆ Finset.Icc 1 n ∧ A ∩ B = ∅ ∧ ∑ a ∈ A, Nat.totient a = ∑ b ∈ B, Nat.totient b := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-238112,"Prove that each natural number appears exactly once in exactly one of the two sequences $\lfloor \alpha \rfloor, \lfloor 2\alpha \rfloor, \lfloor 3\alpha \rfloor, \ldots$ and $\lfloor \beta \rfloor, \lfloor 2\beta \rfloor, \lfloor 3\beta \rfloor, \ldots$, if and only if $\alpha$ and $\beta$ are positive irrational numbers such that $\frac{1}{\alpha} + \frac{1}{\beta} = 1$.","import Mathlib theorem Nat.floorαβ (α β : ℝ) (h₀ : α > 0) (h₁ : β > 0) (h₂ : Irrational α) (h₃ : Irrational β) : (∀ n : ℕ, ∃! m : ℤ, ⌊(m * α)⌋ = n ∨ ⌊(m * β)⌋ = n) ↔ 1 / α + 1 / β = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-238314,"Prove that there exist irrational numbers \(x\) and \(y\) such that \(x>1\) and \(y > 1\), for which \([x^m] \neq [y^n]\) for any two positive integers \(m\) and \(n\).","import Mathlib theorem prove : ∃ (x y : ℝ), ( Irrational x ) ∧ ( Irrational y ) ∧ ( x > 1 ) ∧ ( y > 1 ) ∧ ∀ m n : ℕ, 0 < m → 0 < n → ⌊x ^ m⌋ ≠ ⌊y ^ n⌋ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-238327,"a) Prove that given \(2005\) boxes, each containing an integer number of apples and bananas, it is possible to select \(669\) boxes such that the total number of apples and the total number of bananas in these boxes are each at least one - third of the total number of apples and bananas, respectively, across all \(2005\) boxes. b) Prove that it is not always possible to select \(669\) boxes from \(2005\) boxes, each containing an integer number of apples, bananas, and pears, such that the total number of apples, bananas, and pears in these boxes are each at least one - third of the total number of apples, bananas, and pears, respectively, across all \(2005\) boxes.","import Mathlib theorem a (a b : Fin 2005 → ℕ) : ∃ c : Finset (Fin 2005), c.card = 669 ∧ (∑ i ∈ c, a i ≥ (1 / 3 : ℚ) * ∑ i : Fin 2005, a i) ∧ (∑ i ∈ c, b i ≥ (1 / 3 : ℚ) * ∑ i : Fin 2005, b i) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-238395,"Prove that the number of solutions in nonnegative integers \(x_1,x_2,\ldots,x_6\) to the system of equations \(x_k x_{k + 1}(1 - x_{k+2})=x_{k + 3}x_{k+4}\), where \(k = 1,2,\ldots,6\) and the indices are taken modulo 6 (i.e., \(x_{k+6}=x_k\)), is 7.","import Mathlib theorem number_of_solutions : {x : Fin 6 → ℕ | ∀ i, x i * x ((i + 1) % 6) * (1 - x ((i + 2) % 6)) = x ((i + 3) % 6) * x ((i + 4) % 6)}.ncard = 7 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-238549,"Prove that if $A$ is an uncountable subset of $\mathbb{R}$ such that for any $x, y \in A$, the difference $x - y \in A$, then the set of limit points of $A$ is $\mathbb{R}$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem uncountable (A : Set ℝ) (hA : ¬ Countable A) (hA' : ∀ x ∈ A, ∀ y ∈ A, x - y ∈ A) : closure A = ⊤ := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-238596,"Let \(n\) be a natural number, \(\sigma\) a permutation of order \(n\), and \(a_1, a_2, \ldots, a_n\) nonnegative real numbers. Prove the inequality: \[ \left( a_1^2 + a_{\sigma(1)} \right) \left( a_2^2 + a_{\sigma(2)} \right) \cdots \left( a_n^2 + a_{\sigma(n)} \right) \ge \left( a_1^2 + a_1 \right) \left( a_2^2 + a_2 \right) \cdots \left( a_n^2 + a_n \right) \]","import Mathlib open Finset Real theorem inequalities {n : ℕ} (hn : 0 < n) (σ : Equiv.Perm (Fin n)) (a : Fin n → ℝ) (ha : ∀ i, 0 ≤ a i) : ∏ i, (a i ^ 2 + a (σ i)) ≥ ∏ i, (a i ^ 2 + a i) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-238597,"Prove that the maximum size of a set $S$ satisfying the following conditions: 1. All elements of $S$ are natural numbers not exceeding $100$, i.e., $S\subseteq\{1,2,\cdots,100\}$; 2. For any two elements $a, b \in S$, there exists $c \in S$ such that $\gcd(a, c)=\gcd(b, c) = 1$; 3. For any two elements $a, b \in S$, there exists $d \in S$ such that $\gcd(a, d)> 1$ and $\gcd(b, d)> 1$; is equal to \(73\).","import Mathlib theorem max_size (S : Finset ℕ) (hS : ∀ x ∈ S, x ≤ 100) (hS1 : ∀ a ∈ S, ∀ b ∈ S, ∃ c ∈ S, Nat.gcd a c = 1 ∧ Nat.gcd b c = 1) (hS2 : ∀ a ∈ S, ∀ b ∈ S, ∃ d ∈ S, Nat.gcd a d > 1 ∧ Nat.gcd b d > 1) : S.card ≤ 73 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-238768,"Prove that the set $\{1, 2, \ldots, 2005\}$ can be partitioned into two subsets such that neither subset contains an arithmetic sequence of $18$ terms.","import Mathlib theorem prove : ∃ s1 s2 : Finset ℕ, s1 ∪ s2 = Finset.Icc 1 2005 ∧ s1 ∩ s2 = ∅ ∧ ∀ a d : ℕ, a ∈ s1 → d ≠ 0 → ¬(∃ k : ℕ, ∀ i ∈ Finset.range 18, a + d * (k + i) ∈ s1) ∧ ∀ a d : ℕ, a ∈ s2 → d ≠ 0 → ¬(∃ k : ℕ, ∀ i ∈ Finset.range 18, a + d * (k + i) ∈ s2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-238782,"Let $Q = \{0,1\}^n$ be the set of all binary sequences of length $n$, and let $A$ be a subset of $Q$ with $|A| = 2^{n-1}$. Prove that there are at least $2^{n-1}$ pairs $(a,b) \in A \times (Q \setminus A)$ such that the sequences $a$ and $b$ differ in exactly one term.","import Mathlib open Finset theorem qwen {n : ℕ} (hn : 0 < n) (Q : Set (Fin n → Bool)) (hQ : Q = {x | ∀ i, x i = 0 ∨ x i = 1}) (A : Set (Fin n → Bool)) (hA : A ⊆ Q) (hA1 : A.ncard = 2 ^ (n - 1)) : {p : (Fin n → Bool) × (Fin n → Bool) | p.1 ∈ A ∧ p.2 ∈ Q \ A ∧ ∃! i, p.1 i ≠ p.2 i}.ncard ≥ 2 ^ (n - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-238832,"Prove that the maximum possible number of elements in a set $S$, where the elements of $S$ are subsets of $A = \{1, 2, 3, \ldots, 2016, 2017, 2018\}$ and no element of $S$ is a subset of another element of $S$, is $\binom{2018}{1009}$.","import Mathlib def A : Finset ℕ := Finset.Icc 1 2018 theorem max_sset (S : Finset (Finset ℕ)) (hS : ∀ s ∈ S, s ⊆ A) (hS' : ∀ s ∈ S, ∀ t ∈ S, s ≠ t → ¬(s ⊆ t)) : S.card ≤ Nat.choose 2018 1009 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-238861,"Let $M$ be a set of positive integers that satisfies the following properties: (1) $2018 \in M$. (2) If $m \in M$, then all positive divisors of $m$ are also in $M$. (3) For any $k, m \in M$ with $1 < k < m$, the number $km + 1$ is also in $M$. Prove that $M = \mathbb{Z}_{\ge 1}$.","import Mathlib theorem qwen (M : Set ℕ) (hM : ∀ x ∈ M, 0 < x) (h2018 : 2018 ∈ M) (hdiv : ∀ x ∈ M, ∀ y ∈ Nat.divisors x, y ∈ M) (hk : ∀ x ∈ M, ∀ y ∈ M, 1 < x → x < y → x * y + 1 ∈ M) : M = {x | 1 ≤ x} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-238936,"Let $S \subset (0, n]$ be a set such that $|S| = n$ and for all $x, y \in S$, there exists $z \in S$ such that $\frac{x + y - z}{n} \in \mathbb{Z}$. Prove that $S = \{1, 2, \ldots, n\}$.","import Mathlib theorem qwen {n : ℕ} (hn : 0 < n) (S : Finset ℕ) (hS : S ⊆ Finset.Ioc 0 n) (hS1 : S.card = n) (hS2 : ∀ x ∈ S, ∀ y ∈ S, ∃ z ∈ S, (x + y - z) % n = 0) : S = Finset.Icc 1 n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-239034,"Prove that for each $N \in \mathbb{N}$, there exist integers $n$ and $m$ such that $n \geqslant m \geqslant N$ and $\binom{n}{m}$ is squarefree, where a number is defined to be squarefree if its prime factorization contains no repeated prime factors.","import Mathlib open Nat theorem prove (N : ℕ) : ∃ n m, n ≥ m ∧ m ≥ N ∧ Squarefree (n.choose m) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-239037,"Prove that the set $\{2^n x - \lfloor 2^n x \rfloor \mid n \in \mathbb{Z}\}$ is not dense in the interval $[0, 1]$ for $x = \sum_{n=100}^{\infty} \frac{1}{2^{n!}}$.","import Mathlib open Real theorem algebra_458739 (x : ℝ) (hx : x = ∑' n : ℕ, if n ≥ 100 then 1 / 2 ^ (Nat.factorial n) else 0) : ¬ Dense {y | ∃ n : ℤ, y = 2 ^ n * x - ⌊2 ^ n * x⌋ ∧ y ∈ Set.Icc 0 1} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-239060,"Let $A$ be a set of natural numbers such that $|A| \geq 2$. For every two elements $a > b$ from $A$, the number $\dfrac{\operatorname{lcm}[a,b]}{a-b}$ also belongs to $A$. Prove that $|A| = 2$.","import Mathlib theorem Qwen {A : Set ℕ} (hA : A.ncard ≥ 2) (hA' : ∀ a ∈ A, ∀ b ∈ A, a > b → (Nat.lcm a b) / (a - b) ∈ A) : A.ncard = 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-239224,"Prove that if $S$ is a set of distinct real numbers such that for any $a, b, c \in S$, at least one of the numbers $a + b$, $b + c$, $a + c$ is also in $S$, then the maximum number of elements that $S$ can have is $7$.","import Mathlib theorem SetMax (S : Finset ℝ) (hS : ∀ a ∈ S, ∀ b ∈ S, ∀ c ∈ S, ∃ x ∈ S, x = a + b ∨ x = b + c ∨ x = a + c) : S.card ≤ 7 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-239308,Let $n$ be a natural number. Prove that there exists a set $S$ with $n$ members such that the sum of the members of any subset of $S$ is not a perfect square.,"import Mathlib theorem number_theory_8204 : ∀ n : ℕ, ∃ S : Finset ℕ, S.card = n ∧ ∀ T ⊆ S, ¬ ∃ m, m^2 = ∑ i ∈ T, i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-239316,"a) Prove that for a finite set of natural numbers $S$ with $m = |S|$, $|S+S| \leq \frac{m(m+1)}{2}$, where $S+S$ is the set of numbers $z = x + y$ with $x, y \in S$. b) Let $m$ be a fixed positive integer. Denote by $C(m)$ the greatest integer $k \geq 1$ for which there exists a set $S$ of $m$ integers such that $\{1, 2, \ldots, k\} \subseteq S \cup (S+S)$. Prove that $\frac{m(m+6)}{4} \leq C(m) \leq \frac{m(m+3)}{2}$.","import Mathlib open Finset theorem prove_a {m : ℕ} (hm : m > 0) : ∀ S : Finset ℕ, S.card = m → ∃ T : Finset ℕ, T = {x | ∃ a b, x = a + b ∧ a ∈ S ∧ b ∈ S} ∧ T.card ≤ m * (m + 1) / 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-239320,"Prove that there exist distinct subsets $(A_i)_{i = 1}^m$ of $\{1, 2, \ldots, n\}$ such that $\left| A_i \cap A_j \right|$ is odd for all $1 \leq i < j \leq m$ and $m>2n$. In particular, show that for $n = 11$, there exist such subsets with $m\geq32$.","import Mathlib theorem Prove_mg24 (n : ℕ) (hn : 0 < n) : ∃ s : Finset (Finset ℕ), (∀ t ∈ s, t ⊆ Finset.Icc 1 n) ∧ (∀ i ∈ s, ∀ j ∈ s, i ≠ j → Odd ((i ∩ j).card)) ∧ s.card > 2 * n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-239396,"Prove that for the $n$-th Bernoulli number $B_n$, defined by $B_0=1$ and $B_n=1-\sum_{k=0}^{n-1} \binom{n}{k}\frac{B_k}{n-k+1}$, the following identity holds: \[ (2n+1)B_{2n}2^{2n} =2n-\sum_{k=1}^{n-1} B_{2k} 2^{2k} \binom{2n+1}{2k}. \]","import Mathlib open Finset Real Nat theorem prove_Bernoulli {B : ℕ → ℝ} (hB0 : B 0 = 1) (hB : ∀ n, B n = 1 - ∑ k ∈ Icc 0 (n - 1), Nat.choose n k * B k / (n - k + 1)) : ∀ n, (2 * n + 1) * B (2 * n) * 2 ^ (2 * n) = 2 * n - ∑ k ∈ Icc 1 (n - 1), B (2 * k) * 2 ^ (2 * k) * Nat.choose (2 * n + 1) (2 * k) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-239426,"Let $S$ be a set containing $m$ pairs $(a, b)$ of positive integers such that $1 \leq a < b \leq n$. Prove that there are at least \[ 4m \cdot \dfrac{(m - \dfrac{n^2}{4})}{3n} \] triples $(a, b, c)$ such that $(a, b)$, $(a, c)$, and $(b, c)$ are all elements of $S$.","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (m : ℕ) (hm : m > 0) (S : Finset (ℕ × ℕ)) (hS : S.card = m) (hS1 : ∀ x ∈ S, x.1 > 0 ∧ x.2 > 0 ∧ 1 ≤ x.1 ∧ x.1 < x.2 ∧ x.2 ≤ n) : {x | ∃ a b c, x = (a, b, c) ∧ (a, b) ∈ S ∧ (a, c) ∈ S ∧ (b, c) ∈ S}.ncard ≥ 4 * m * ((m - n ^ 2 / 4) / (3 * n)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-239514,"Let $A_1, A_2, \ldots, A_n$ be finite sets such that $|A_i \cap A_{i+1}| > \frac{n-2}{n-1}|A_{i+1}|$ for $i = 1, 2, \ldots, n-1$. Prove that $\bigcap_{i=1}^{n} A_i \neq \emptyset$.","import Mathlib theorem FinsetInter {n : ℕ} (hn : 0 < n) (A : ℕ → Set ℝ) (hA : ∀ i ∈ Finset.Icc 1 n, Set.Finite (A i)) (h : ∀ i ∈ Finset.Icc 1 (n - 1), (A i ∩ A (i + 1)).ncard > ((n - 2) / (n - 1)) * (A (i + 1)).ncard) : ∃ x, ∀ i ∈ Finset.Icc 1 n, x ∈ A i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-239565,"Let $p$ be a prime number. Prove that for any integer $0 \le j < p^k - p^{k - 1}$, \[ p \mid \sum_{\frac{j}{p^{k - 1}} \le i \le p - 1} \binom{ip^{k - 1}}{j}. \]","import Mathlib theorem Nat.choose.mod p (hp : Nat.Prime p) (k : ℕ) (hk : 0 < k) : ∀ j : ℕ, j < p ^ k - p ^ (k - 1) → p ∣ ∑ i ∈ Finset.Icc (j / p ^ (k - 1)) (p - 1), Nat.choose (i * p ^ (k - 1)) j := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-239571,"Let $(X, d)$ be a complete metric space, and let $T: X \to X$ be a mapping. Suppose $Y$ is a compact subspace of $X$, and there exists a constant $q < 1$ such that the following conditions hold: i) For all $x, y \in X$ with $x \neq y$, $d(T(x), T(y)) < d(x, y)$, ii) For all $x, y \in X \setminus Y$, $d(T(x), T(y)) \leq q d(x, y)$. Prove that there exists a point $p \in X$ such that $T(p) = p$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem complete_metric_space {X : Type*} [MetricSpace X] [CompleteSpace X] (T : X → X) (Y : Set X) (hY : IsCompact Y) (q : ℝ) (hq : 0 < q ∧ q < 1) (h1 : ∀ x y, x ≠ y → dist (T x) (T y) < dist x y) (h2 : ∀ x y, x ∉ Y → y ∉ Y → dist (T x) (T y) ≤ q * dist x y) : ∃ p, T p = p := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-239573,"Let $S = \left\{\frac{\pi^n}{1992^m} \mid m,n \in \mathbb{Z} \right\}$. Prove that every real number $x \geq 0$ is an accumulation point of $S$.","import Mathlib open Real Filter Function open scoped Topology theorem accum_points (S : Set ℝ) (hS : S = {x | ∃ m n : ℤ, x = π ^ n / 1992 ^ m}) : ∀ x ≥ 0, x ∈ closure S := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-239643,"Let $n$ be an odd positive integer, and let $x_1, x_2, \ldots, x_n$ and $y_1, y_2, \ldots, y_n$ be nonnegative real numbers such that $x_1 + x_2 + \cdots + x_n = y_1 + y_2 + \cdots + y_n$. Prove that there exists a proper, nonempty subset $J \subseteq \{1, 2, \ldots, n\}$ such that \[ \frac{n-1}{n+1} \sum_{j \in J} x_j \leq \sum_{j \in J} y_j \leq \frac{n+1}{n-1} \sum_{j \in J} x_j. \]","import Mathlib open Finset Real theorem OddSum (n : ℕ) (hn : Odd n) (x y : Fin n → ℝ) (hx : ∀ i, 0 ≤ x i) (hy : ∀ i, 0 ≤ y i) (hxs : ∑ i, x i = ∑ i, y i) : ∃ J : Finset (Fin n), J ≠ ⊤ ∧ J ≠ ⊥ ∧ (n - 1) / (n + 1) * ∑ j ∈ J, x j ≤ ∑ j ∈ J, y j ∧ ∑ j ∈ J, y j ≤ (n + 1) / (n - 1) * ∑ j ∈ J, x j := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-239664,"Given sets $A_1, A_2, \ldots, A_{2009} \subseteq \{1, 2, \ldots, 20000\}$ with $|A_1| = |A_2| = \cdots = |A_{2009}| = 12$, prove that it is possible to color each number either red or blue such that every set $A_k$ contains at least one red number and at least one blue number.","import Mathlib theorem color_red_blue (A : Fin 2009 → Set ℕ) (hA : ∀ i, A i ⊆ Finset.Icc 1 20000) (hA' : ∀ i, (A i).ncard = 12) : ∃ c : ℕ → Fin 2, (∀ k, ∃ m ∈ A k, c m = 0) ∧ (∀ k, ∃ m ∈ A k, c m = 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-239854,"Let $x, y, z$ be positive real numbers which satisfy the condition $$ x y + x z + y z + 2 x y z = 1. $$ Find the maximal constant $C$ such that the following inequality holds for all $x, y, z$ satisfying the given constraint: $$ \frac{1}{x} + \frac{1}{y} + \frac{1}{z} \geq C(x + y + z). $$ prove that answer is $$C = 4$$","import Mathlib theorem max_const (C : ℝ) : (∀ x y z : ℝ, x > 0 → y > 0 → z > 0 → x * y + x * z + y * z + 2 * x * y * z = 1 → 1 / x + 1 / y + 1 / z ≥ C * (x + y + z)) ↔ C ≤ 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/IneqMath, flc-241186,"The non-negative real numbers $x, y, z$ satisfy the equality $x + y + z = 1$. Determine the highest possible value of the expression $E(x, y, z) = (x + 2y + 3z)(6x + 3y + 2z)$. prove that answer is 8","import Mathlib open Real Set open scoped BigOperators theorem E : IsGreatest {t : ℝ | ∃ x y z : ℝ, x ≥ 0 ∧ y ≥ 0 ∧ z ≥ 0 ∧ x + y + z = 1 ∧ t = (x + 2 * y + 3 * z) * (6 * x + 3 * y + 2 * z)} 8 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-241325,"$x, y$ are real numbers such that \[x^2 + y^2 = 1, \quad 20x^3 - 15x = 3\] Find the value of \(|20y^3 - 15y|\). prove that answer is 4","import Mathlib theorem q (x y : ℝ) (h₀ : x ^ 2 + y ^ 2 = 1) (h₁ : 20 * x ^ 3 - 15 * x = 3) : |20 * y ^ 3 - 15 * y| = 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-241519,Determine the largest positive integer $n$ which cannot be written as the sum of three numbers greater than $1$ that are pairwise coprime. prove that answer is 17,"import Mathlib theorem number_theory_94081 : IsGreatest {n > 0 | ¬∃ x y z : ℕ, x > 1 ∧ y > 1 ∧ z > 1 ∧ x + y + z = n ∧ Nat.Coprime x y ∧ Nat.Coprime y z ∧ Nat.Coprime z x} 17 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-241622,"Find the largest integer $n$, where $2009^n$ divides $2008^{2009^{2010}} + 2010^{2009^{2008}}$. prove that answer is 2009","import Mathlib theorem max : IsGreatest {n : ℕ | 2009 ^ n ∣ 2008 ^ (2009 ^ 2010) + 2010 ^ (2009 ^ 2008)} 2009 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-241925,"Let $[r,s]$ denote the least common multiple of positive integers $r$ and $s$ . Find the number of ordered triples $(a,b,c)$ of positive integers for which $[a,b] = 1000$ , $[b,c] = 2000$ , and $[c,a] = 2000$ . prove that answer is 70","import Mathlib theorem count : {(a, b, c) : ℕ × ℕ × ℕ | Nat.lcm a b = 1000 ∧ Nat.lcm b c = 2000 ∧ Nat.lcm c a = 2000}.ncard = 70 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-241995,"The equation $2^{333x-2} + 2^{111x+2} = 2^{222x+1} + 1$ has three real roots . Given that their sum is $m/n$ where $m$ and $n$ are relatively prime positive integers , find $m+n.$ prove that answer is 113","import Mathlib theorem algebraic_348467 (f : ℝ → ℝ) (hf : f = fun x => 2^(333*x - 2) + 2^(111*x + 2) - 2^(222*x + 1) - 1) (hroots : ∃ x y z, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ f x = 0 ∧ f y = 0 ∧ f z = 0) (hm : ∃ m n : ℕ, m > 0 ∧ n > 0 ∧ Nat.Coprime m n ∧ x + y + z = m / n) : m + n = 113 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-242803,"The three roots of the cubic $ 30 x^3 - 50x^2 + 22x - 1$ are distinct real numbers strictly between $ 0$ and $ 1$. If the roots are $p$, $q$, and $r$, what is the sum \[ \frac{1}{1-p} + \frac{1}{1-q} +\frac{1}{1-r} ?\] prove that answer is 12","import Mathlib theorem CubicSum (p q r : ℝ) (h₀ : p ∈ Set.Ioo 0 1) (h₁ : q ∈ Set.Ioo 0 1) (h₂ : r ∈ Set.Ioo 0 1) (h₃ : p ≠ q) (h₄ : p ≠ r) (h₅ : q ≠ r) (h₆ : 30 * p ^ 3 - 50 * p ^ 2 + 22 * p - 1 = 0) (h₇ : 30 * q ^ 3 - 50 * q ^ 2 + 22 * q - 1 = 0) (h₈ : 30 * r ^ 3 - 50 * r ^ 2 + 22 * r - 1 = 0) : 1 / (1 - p) + 1 / (1 - q) + 1 / (1 - r) = 12 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-243019,"Find all values of $b$ for which the equations $1988x^2 + bx + 8891 = 0$ and $8891x^2 + bx + 1988 = 0$ have a common root. Enter all the possible values of $b,$ separated by commas. prove that answer is 10879","import Mathlib theorem solution_set : {b | ∃ x, 1988 * x ^ 2 + b * x + 8891 = 0 ∧ 8891 * x ^ 2 + b * x + 1988 = 0} = {10879} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-244194,"**Problem Statement:** A non-empty finite set \( S \) of positive integers is called **flexible** if it satisfies the following property: - Let \( N \) be the sum of all elements in \( S \). Then, for every integer \( n \) with \( 1 \leq n \leq N \), there exists a non-empty subset \( T \subseteq S \) such that the sum of the elements in \( T \) equals \( n \). **Question:** Prove that the number of non-empty flexible subsets of \( \{1, 2, \ldots, 16\} \) is **11,457**. *Guidance:* - First, characterize the structure of flexible sets. - Determine necessary and sufficient conditions for a set to be flexible. - Count all such subsets within \( \{1, 2, \ldots, 16\} \). *(Expected answer: 11,457)*","import Mathlib def isFlexible (S : Finset ℕ) : Prop := S.Nonempty ∧ ∀ N ∈ Finset.Icc 1 (∑ s ∈ S, s), ∃ T ⊆ S, T.Nonempty ∧ ∑ t ∈ T, t = N theorem solution : Set.ncard {S | S ⊆ Finset.Icc 1 16 ∧ isFlexible S} = 11457 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/OnlineMathContest, flc-244229,"For an integer \( n (n \geqslant 2) \), if there exists a family of subsets \( A_1, A_2, \dots, A_n \) of the set \( \{1, 2, \dots, n\} \) satisfying: (a) \( i \notin A_i \), for \( i = 1, 2, \dots, n \); (b) For \( i \neq j \), \( i, j \in \{1, 2, \dots, n\} \), \( i \in A_j \) if and only if \( j \notin A_i \); (c) For any \( i, j \in \{1, 2, \dots, n\}, A_i \cap A_j \neq \varnothing \), then \( n \) is called a ""good number."" Proof: (1) \( 7 \) is a good number. (2) \( n \) is a good number if and only if \( n \geqslant 7 \).","import Mathlib def isGood (n : ℕ) := ∃ A : Finset.Icc 1 n → Set (Finset.Icc 1 n), (∀ i, i ∉ A i) ∧ (∀ i j, i ≠ j → i ∈ A j ↔ j ∉ A i) ∧ (∀ i j, A i ∩ A j ≠ ∅) theorem proveGood : isGood 7 ∧ ∀ n, isGood n ↔ n ≥ 7 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-244237,"Let the positive integer \( n \) have the following property: In any selection of \( n \) numbers from the set \( \{1, 2, \cdots, 1988\} \), there always exist 29 numbers that form an arithmetic progression. Prove that \( n > 1788 \).","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) : (∀ s : Finset ℕ, s ⊆ Finset.Icc 1 1988 ∧ s.card = n → ∃ a d : ℕ, a ∈ s ∧ d ≠ 0 ∧ ∀ i ∈ Finset.range 29, a + d * i ∈ s) → n > 1788 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-244238,"Proof: In the set $\left\{1, 2, 3, \cdots, \frac{3^n+1}{2}\right\}\ (n \in \mathbf{N}^*)$, it is possible to select $2^n$ numbers such that no three of them form an arithmetic progression.","import Mathlib theorem proof {n : ℕ} (hn : n > 0) : ∃ s : Finset ℕ, s ⊆ Finset.Icc 1 ((3 ^ n + 1) / 2) ∧ s.card = 2 ^ n ∧ ∀ x ∈ s, ∀ y ∈ s, ∀ z ∈ s, x ≠ y ∧ y ≠ z ∧ z ≠ x → ¬(∃ d, y = x + d ∧ z = y + d) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-244242,"The set of numbers \( M \) consists of 2003 distinct positive integers. For any three distinct elements \( a, b, c \) in \( M \), the number \( a^2 + bc \) is a rational number. Prove: There exists a positive integer \( n \) such that for any number \( a \) in \( M \), the number \( a\sqrt{n} \) is a rational number.","import Mathlib theorem M (M : Finset ℕ) (hM : M.card = 2003) (hM1 : ∀ x ∈ M, x > 0) (hM2 : ∀ a ∈ M, ∀ b ∈ M, ∀ c ∈ M, a ≠ b ∧ a ≠ c ∧ b ≠ c → ∃ q : ℚ, a^2 + b * c = q) : ∃ n : ℕ, n > 0 ∧ ∀ a ∈ M, ∃ q : ℚ, a * Real.sqrt n = q := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-244255,"Let \( A \) be a subset of the set \( S = \{1, 2, \cdots, 1000000\} \) containing exactly 101 elements. Prove: There exist numbers \( t_1, t_2, \cdots, t_{100} \) in \( S \), such that the sets \[ A_j = \{x + t_j \mid x \in A\}, \quad j = 1, 2, \cdots, 100 \] have pairwise empty intersections.","import Mathlib theorem qwen (A : Finset ℕ) (hA : A ⊆ Finset.Icc 1 1000000) (hA1 : A.card = 101) : ∃ t : Fin 100 → ℕ, (∀ i j, i ≠ j → Disjoint {x | ∃ y ∈ A, x = y + t i} {x | ∃ y ∈ A, x = y + t j}) ∧ (∀ i, t i ∈ Finset.Icc 1 1000000) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-244304,"Prove: For any \( n \) real numbers \( r_1, r_2, \cdots, r_n \), there always exists a subset \( S \) of \( \{1, 2, \cdots, n\} \) such that for any \( i \in \{1, 2, \cdots, n-2\} \), we have \( 1 \leqslant |S \cap \{i, i+1, i+2\}| \leqslant 2 \) (where \( |X| \) represents the number of elements in the finite set \( X \)), and \[ \left| \sum_{i \in S} r_i \right| \geqslant \frac{1}{6} \sum_{i=1}^n \left|r_i\right|. \]","import Mathlib open Finset Real theorem prove (n : ℕ) (hn : 0 < n) (r : ℕ → ℝ) : ∃ S : Finset ℕ, S ⊆ Icc 1 n ∧ ∀ i ∈ Icc 1 (n - 2), 1 ≤ (S ∩ {i, i + 1, i + 2}).card ∧ (S ∩ {i, i + 1, i + 2}).card ≤ 2 ∧ ‖∑ i ∈ S, r i‖ ≥ (1 / 6) * ∑ i ∈ Icc 1 n, ‖r i‖ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-244498,"Let \( A_1, A_2, \cdots, A_{29} \) be 29 distinct sets of positive integers. For \( 1 \leq i < j \leq 29 \) and any positive integer \( x \), define: - \( N_i(x) \): the number of elements in the set \( A_i \) that are less than or equal to \( x \), - \( N_{ij}(x) \): the number of elements in the intersection \( A_i \cap A_j \) that are less than or equal to \( x \). It is given that for all \( i = 1, 2, \cdots, 29 \) and every positive integer \( x \), \[ N_i(x) \geq \frac{x}{\mathrm{e}} \quad (\mathrm{e} = 2.71828 \cdots). \] Prove that there exist \( i, j \) (\( 1 \leq i < j \leq 29 \)) such that \[ N_{ij}(1988) > 200. \]","import Mathlib open Real theorem Qwen (A : Fin 29 → Set ℕ) (hA : ∀ i j, A i = A j → i = j) (hA' : ∀ i, ∀ x, 0 < x → {y | y ∈ A i ∧ y ≤ x}.ncard ≥ x / exp 1) : ∃ i j, 1 ≤ i ∧ i < j ∧ j ≤ 29 ∧ {y | y ∈ A i ∩ A j ∧ y ≤ 1988}.ncard > 200 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-244506,"Let \( A_1, A_2, \cdots, A_{30} \) be subsets of the set \( \{1, 2, \cdots, 2003\} \), where \( \left|A_i\right| \geqslant 660 \) for \( i = 1, 2, \cdots, 30 \). Prove that there exist \( i, j \in \{1, 2, \cdots, 30\} \) with \( i \neq j \) such that \[ \left|A_i \cap A_j\right| \geqslant 2003. \]","import Mathlib theorem qwen (A : Fin 30 → Set ℕ) (hA : ∀ i, A i ⊆ Finset.Icc 1 2003 ∧ (A i).ncard ≥ 660) : ∃ i j, i ≠ j ∧ (A i ∩ A j).ncard ≥ 2003 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-244977,"a) Let $P$ be a non - empty set of natural numbers such that for any $a,b\in P$, $a + b\in P$. Let $B_n$ be the set of all elements in $P$ that cannot be written as $n + x$ where $x\in P$. Prove that \(|B_{a + b}|=|B_a|+|B_b|\) for any \(a,b\in P\). b) Let $P$ be a non - empty set of natural numbers such that for any $a,b\in P$, $a + b\in P$. Let the index of an element $n\in P$ be the number of elements of $P$ that cannot be represented as $n + x$, where $x\in P$ (infinite if this number is not finite). Prove that the index of each element from the set \(P\) is finite. c) Let $P$ be a non - empty set of natural numbers such that for any $a,b\in P$, $a + b\in P$. Let $B_n$ be the set of all elements in $P$ that cannot be written as $n + x$ where $x\in P$. Prove that \(|B_a|\leq a\) for any \(a\in P\).","import Mathlib open Finset theorem algebra_461254 {P : Set ℕ} (hP : ∀ a ∈ P, ∀ b ∈ P, a + b ∈ P) (B : ℕ → Set ℕ) (hB : ∀ n, B n = {p | p ∈ P ∧ ¬∃ x ∈ P, p = n + x}) : ∀ a b, a ∈ P → b ∈ P → (B (a + b)).ncard = (B a).ncard + (B b).ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-245111,"Given \( n \) distinct points on a plane. Prove: The number of pairs of points whose distance is equal to 1 is less than \( 2\sqrt{n^3} \).","import Mathlib open Real Set open scoped BigOperators theorem dist_pairs (n : ℕ) (hn : 0 < n) (a : Fin n → EuclideanSpace ℝ (Fin 2)) : {p : Fin n × Fin n | p.1 ≠ p.2 ∧ dist (a p.1) (a p.2) = 1}.ncard < 2 * sqrt (n ^ 3) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-245367,"Prove that the functions \(f: \mathbb{M} \to \mathbb{M}\) that satisfy the condition \(f(A \cap f(B)) \cap f(A \cap B) = f(A) \cap B\) for all \(A, B \in \mathbb{M}\), where \(S = \{1, 2, 3, \ldots, n\}\) and \(\mathbb{M}\) is the set of all subsets of \(S\), are of the form \(f(A) = C \cap A\) for all \(A \in \mathbb{M}\), where \(C \in \mathbb{M}\).","import Mathlib open Finset theorem prove {n : ℕ} (hn : 0 < n) (f : Set (Fin n) → Set (Fin n)) (h : ∀ A B, f (A ∩ f B) ∩ f (A ∩ B) = f A ∩ B) : ∃ C, ∀ A, f A = C ∩ A := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-245485,"Let \(p\) be a prime number greater than \(3\). Prove that \[ p^2 \Big| \sum_{i=1}^{\left\lfloor\frac{2p}{3}\right\rfloor} \binom{p}{i}. \]","import Mathlib theorem Nat.choose_p_prime (p : ℕ) [hp : Fact (Nat.Prime p)] (h : 3 < p) : p^2 ∣ ∑ i ∈ Finset.Icc 1 ⌊(2 * p / 3 : ℝ)⌋₊, Nat.choose p i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-245518,"1. Prove that there exists an \(n \in \mathbb{N}\) with \(n \geq 3\) such that there is an \(n\times n\) square grid, where each cell is filled with an element from \(M=\{1,2,\ldots,2n - 1\}\), and for every \(i\) (\(1\leq i\leq n\)), the union of the \(i\) - th row and the \(i\) - th column contains all elements of \(M\). 2. Prove that there is no \(2019\times2019\) square grid, where each cell is filled with an element from \(M = \{1,2,\ldots,2\times2019 - 1\}\), such that for every \(i\) (\(1\leq i\leq 2019\)), the union of the \(i\) - th row and the \(i\) - th column contains all elements of \(M\).","import Mathlib open Finset theorem prove1 : ∃ n : ℕ, n ≥ 3 ∧ ∃ M : Finset ℕ, M = Icc 1 (2 * n - 1) ∧ ∃ a : Fin n → Fin n → ℕ, ∀ i j, a i j ∈ M ∧ ∀ i, {x | ∃ j, x = a i j} ∪ {x | ∃ i', x = a i' i} = M ∧ ∀ j, {x | ∃ i, x = a i j} ∪ {x | ∃ j', x = a j' j} = M := by sorry theorem prove2 : ¬∃ a : Fin 2019 → Fin 2019 → ℕ, (∀ i j, a i j ∈ Icc 1 (2 * 2019 - 1)) ∧ (∀ i, {x | ∃ j, x = a i j} ∪ {x | ∃ i', x = a i' i} = Icc 1 (2 * 2019 - 1)) ∧ (∀ j, {x | ∃ i, x = a i j} ∪ {x | ∃ j', x = a j' j} = Icc 1 (2 * 2019 - 1)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-245598,"Prove that for any integer \(n \geq 4\) and any subset \(A\) of the set \(\{1, 2, \ldots, 2n - 1\}\) with \(n\) distinct elements, there exist elements in \(A\) whose sum is divisible by \(2n\).","import Mathlib theorem sum_in_A (n : ℕ) (hn : 4 ≤ n) (A : Finset ℕ) (hA : A ⊆ Finset.Icc 1 (2 * n - 1)) (hA1 : A.card = n) : ∃ x ∈ A, ∃ y ∈ A, x ≠ y ∧ 2 * n ∣ x + y := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-246120,"Prove that if $a, b$ are real numbers such that $\frac{a}{b}$ is irrational and $S_1=\left\{ma - nb : m, n \in \mathbb{N}\right\}$, then $S_1$ is dense in $\mathbb{R}$.","import Mathlib theorem RealDensity (a b : ℝ) (h₀ : Irrational (a / b)) : Dense {x | ∃ m n : ℕ, x = m * a - n * b} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-246162,"Prove that for a given positive integer \(k\), there exists a positive integer \(N\) depending solely on \(k\) such that for any integer \(n \geq N\), the binomial coefficient \(\binom{n}{k}\) has at least \(k\) distinct prime divisors.","import Mathlib theorem Nat.choose_k (k : ℕ) (hk : 0 < k) : ∃ N : ℕ, ∀ n ≥ N, k ≤ (Nat.primeFactors (Nat.choose n k)).card := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-246274,"Prove that the number of sequences of real numbers \(a_1, a_2, a_3, \dots, a_{16}\) that satisfy the condition \[ a_1^n + a_2^{2n} + \dots + a_{16}^{16n} = \begin{cases} 10^{n+1} + 10^n + 1 & \text{if } n \text{ is even} \\ 10^n - 1 & \text{if } n \text{ is odd} \end{cases} \] is \(1091328\).","import Mathlib theorem number_of_seq (n : ℕ) : {a : Fin 16 → ℝ | ∑ i : Fin 16, (a i) ^ ((i.1 + 1) * n) = if Even n then 10 ^ (n + 1) + 10 ^ n + 1 else 10 ^ n - 1}.ncard = 1091328 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-246504,"Prove that for the partial differential equation \(u_t - u_{xx} = 0\) with \(x \in \mathbb{R}\) and \(t > 0\) and the initial condition \(u(x,0) = e^{-x^2}\), the Fourier - transformed solution \(\widehat{u}(s, t)\) is given by \[ \widehat{u}(s, t) = \begin{cases} e^{-\pi^2 s^2 (1 + 4t)} & \text{(Convention A)} \\ \sqrt{\pi} e^{-s^2 \left(\frac{1}{4} + t\right)} & \text{(Convention B)} \\ \sqrt{\frac{\pi}{2}} e^{-s^2 \left(\frac{1}{4} + t\right)} & \text{(Convention C)} \end{cases} \] where the Fourier transform conventions are as follows: **Convention A** \[ \begin{align*} \widehat{f}(s) &= \int_{-\infty}^{\infty} f(x) e^{-2\pi i sx} \, dx \\ f(x) &= \int_{-\infty}^{\infty} \widehat{f}(s) e^{2\pi i sx} \, ds \end{align*} \] **Convention B** \[ \begin{align*} \widehat{f}(s) &= \frac{1}{2\pi} \int_{-\infty}^{\infty} f(x) e^{-i sx} \, dx \\ f(x) &= \int_{-\infty}^{\infty} \widehat{f}(s) e^{i sx} \, ds \end{align*} \] **Convention C** \[ \begin{align*} \widehat{f}(s) &= \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{\infty} f(x) e^{-i sx} \, dx \\ f(x) &= \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{\infty} \widehat{f}(s) e^{i sx} \, ds \end{align*} \]","import Mathlib open Complex Filter Function Metric Finset open scoped BigOperators Topology theorem pde_solution (u : ℝ → ℝ → ℝ) (h₀ : ∀ x t, u x t = Real.exp (-x ^ 2)) : ∃ A B C : ℝ → ℝ → ℝ, (∀ s t, A s t = Real.exp (-Real.pi ^ 2 * s ^ 2 * (1 + 4 * t))) ∧ (∀ s t, B s t = Real.sqrt Real.pi * Real.exp (-s ^ 2 * (1 / 4 + t))) ∧ (∀ s t, C s t = Real.sqrt (Real.pi / 2) * Real.exp (-s ^ 2 * (1 / 4 + t))) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-246903,"Prove that in a complete graph \(K_{2017}\) where each edge is labeled with one of the numbers \(1\), \(2\), or \(3\) and the sum of the labels of the edges of any triangle in the graph is at least \(5\), the minimum possible average of all \(\binom{2017}{2}\) labels is \(2 - \frac{1}{2017}\).","import Mathlib open Finset Real theorem min_average (f : Fin 2017 → Fin 2017 → ℕ) (h₀ : ∀ i j, f i j = 1 ∨ f i j = 2 ∨ f i j = 3) (h₁ : ∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → f i j + f j k + f i k ≥ 5) : IsLeast {x | ∃ f : Fin 2017 → Fin 2017 → ℕ, (∀ i j, f i j = 1 ∨ f i j = 2 ∨ f i j = 3) ∧ (∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → f i j + f j k + f i k ≥ 5) ∧ x = (∑ i, ∑ j, if i < j then f i j else 0) / (Nat.choose 2017 2)} (2 - 1 / 2017) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-246923,"Let \(n\) be a positive integer, and let \(x_1, x_2, \ldots, x_{2n}\) be non - negative real numbers such that \(\sum_{i = 1}^{2n}x_i=4\). Prove that there exist integers \(p\) and \(q\), with \(0\leq q\leq n - 1\), satisfying \[ \sum_{i=1}^q x_{p+2i-1} \le 1 \quad \text{and} \quad \sum_{i=q+1}^{n-1} x_{p+2i} \le 1, \] where the indices are taken modulo \(2n\). Note that if \(q = 0\), then \(\sum_{i=1}^q x_{p+2i-1}=0\); if \(q=n - 1\), then \(\sum_{i=q+1}^{n-1} x_{p+2i}=0\).","import Mathlib open Finset Real theorem x (n : ℕ) (hn : 0 < n) (x : ℕ → ℝ) (hx : ∀ i ∈ Icc 1 (2 * n), 0 ≤ x i) (hxs : ∑ i ∈ Icc 1 (2 * n), x i = 4) : ∃ p q : ℕ, 0 ≤ q ∧ q ≤ n - 1 ∧ (∑ i ∈ Icc 1 q, x ((p + 2 * i - 1) % (2 * n))) ≤ 1 ∧ (∑ i ∈ Icc (q + 1) (n - 1), x ((p + 2 * i) % (2 * n))) ≤ 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-246951,"Given positive integers \(n\) and \(k\) such that \(2 \le n < 2^k\), prove that there exists a subset \(A\) of \(\{0, 1, \ldots, n\}\) such that for any distinct \(x, y \in A\), the binomial coefficient \(\binom{y}{x}\) is even, and the size of \(A\) satisfies the inequality: \[ |A| \ge \frac{\binom{k}{\lfloor \frac{k}{2} \rfloor}}{2^k} \cdot (n+1). \]","import Mathlib open Finset theorem qwen {n k : ℕ} (hn : 2 ≤ n) (hk : n < 2 ^ k) : ∃ A : Finset ℕ, A ⊆ Icc 0 n ∧ ∀ x ∈ A, ∀ y ∈ A, x ≠ y → Even (Nat.choose y x) ∧ A.card ≥ (Nat.choose k ⌊(k / 2 : ℝ)⌋₊) / 2 ^ k * (n + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-247050,"Let \(S = \{1, 2, \ldots, n\}\). Let \(A\) be a subset of \(S\) such that for any \(x, y \in A\), either \(x + y \in A\) or \(x + y - n \in A\). Prove that the number of elements in \(A\) divides \(n\).","import Mathlib theorem Qwen {n : ℕ} (hn : 0 < n) (A : Finset ℕ) (hA : ∀ x ∈ A, ∀ y ∈ A, x + y ∈ A ∨ x + y - n ∈ A) (hA' : A ⊆ Finset.Icc 1 n) : A.card ∣ n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-247195,"Prove that, for any integer \(n \geq 3\), we have \(2^{\frac{n^2}{4}} < f(2^n) < 2^{\frac{n^2}{2}}\), where for each positive integer \(n\), \(f(n)\) denotes the number of ways of representing \(n\) as a sum of powers of \(2\) with nonnegative integer exponents, and representations that differ only in the ordering of their summands are considered to be the same.","import Mathlib open Finset theorem prove {f : ℕ → ℕ} (hf : ∀ n, f n = {s : Multiset ℕ | s.sum = n ∧ ∀ i ∈ s, ∃ k, i = 2 ^ k}.ncard) : ∀ n ≥ 3, 2 ^ ((n ^ 2) / 4) < f (2 ^ n) ∧ f (2 ^ n) < 2 ^ ((n ^ 2) / 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-247341,"Prove that the set of all positive integers \(n > 1\) for which there exist \(2n\) distinct positive integers \(a_1, a_2, \ldots, a_n\) and \(b_1, b_2, \ldots, b_n\) such that \(\sum_{i=1}^{n} a_i = \sum_{i=1}^{n} b_i\) and \(\prod_{i=1}^{n} a_i = \prod_{i=1}^{n} b_i\) is the set of all integers \(n\) such that \(n \geq 3\).","import Mathlib theorem prove (n : ℕ) : n > 1 ∧ ∃ a b : Finset ℕ, (∀ x ∈ a, x > 0) ∧ (∀ x ∈ b, x > 0) ∧ a.card = 2 * n ∧ b.card = 2 * n ∧ ∑ i ∈ a, i = ∑ i ∈ b, i ∧ ∏ i ∈ a, i = ∏ i ∈ b, i ↔ n ≥ 3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-248065,"Let \( p \geqslant 5 \) be a prime number, \( S = \{1, 2, \cdots, p-1\} \), and \( A = \{a \mid a \in S, a^{p-1} \not\equiv 1 \pmod{p^2}\} \). Prove that \( |A| \geqslant \frac{p-1}{2} \).","import Mathlib theorem qwen (p : ℕ) (hp : Nat.Prime p) (h : 5 ≤ p) : Set.ncard {x | x ∈ Finset.Icc 1 (p - 1) ∧ ¬(x ^ (p - 1) ≡ 1 [MOD p ^ 2])} ≥ (p - 1) / 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-248191,"Let \( x_i \in \mathbf{R} \) (\( i = 1, 2, \dots, n \)) and \( \sum_{i=1}^n x_i^2 = 1 \). Prove that for any integer \( k \geqslant 3 \), there exist nonzero integers \( a_i \) such that \( |a_i| \leqslant k - 1 \) and \[ \left| \sum_{i=1}^n a_i x_i \right| \leqslant \frac{(k-1) \sqrt{n}}{k^n - 1}. \]","import Mathlib open Real theorem prove (n : ℕ) (hn : 0 < n) (x : Fin n → ℝ) (h : ∑ i : Fin n, (x i)^2 = 1) (k : ℕ) (hk : 3 ≤ k) : ∃ a : Fin n → ℤ, (∀ i : Fin n, a i ≠ 0) ∧ (∀ i : Fin n, |a i| ≤ k - 1) ∧ |∑ i : Fin n, a i * x i| ≤ ((k - 1) * sqrt n) / (k^n - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-248284,"Let \( n \) be a positive integer, and \( M \) be a set consisting of \( n^2 + 1 \) positive integers with the following property: among any \( n+1 \) numbers in \( M \), there exist two numbers such that one is a multiple of the other. Prove that there exist \( n+1 \) numbers \( a_1, a_2, \dots, a_{n+1} \) in \( M \) such that for any \( i = 1, 2, \dots, n \), \( a_i \) divides \( a_{i+1} \).","import Mathlib theorem Qwen (n : ℕ) (hn : 0 < n) (M : Finset ℕ) (hM : ∀ x ∈ M, 0 < x) (hM' : M.card = n ^ 2 + 1) (hM'' : ∀ S ⊆ M, S.card = n + 1 → ∃ a ∈ S, ∃ b ∈ S, a ≠ b ∧ a ∣ b) : ∃ a : Fin (n + 1) → ℕ, (∀ i j, i < j → a i ∣ a j) ∧ (∀ i, a i ∈ M) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-248397,"Let \( a_j, b_j, c_j \) be integers, where \( 1 \leqslant j \leqslant N \), and for any \( j \), at least one of the numbers \( a_j, b_j, c_j \) is odd. Prove: There exists a set of numbers \( r, s, t \) such that in the set \[ \{r a_j + s b_j + t c_j \mid 1 \leqslant j \leqslant N\}, \] at least \( \frac{4N}{7} \) of the numbers are odd.","import Mathlib theorem OddSum (N : ℕ) (a b c : Fin N → ℤ) (hodd : ∀ i, Odd (a i) ∨ Odd (b i) ∨ Odd (c i)) : ∃ r s t, {i | Odd (r * a i + s * b i + t * c i)}.ncard ≥ 4 * N / 7 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-248404,"Prove that the set of all positive integers \(n \geq 2\) such that for all integers \(i, j\) where \(0 \leq i, j \leq n\), the sum \(i + j\) and the sum of binomial coefficients \(\binom{n}{i} + \binom{n}{j}\) have the same parity is given by \(n = 2^a - 2\), where \(a = 2, 3, 4, \ldots\).","import Mathlib theorem prove (n : ℕ) : (∀ i j, 0 ≤ i ∧ i ≤ n → 0 ≤ j ∧ j ≤ n → (i + j) % 2 = (Nat.choose n i + Nat.choose n j) % 2) ↔ ∃ a, n = 2 ^ a - 2 ∧ a ≥ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-248857,"Prove that if $p$ is an odd prime, and $A$ and $B$ are two distinct non - empty subsets of $\{1, 2, \ldots, p - 1\}$ such that: 1. $A \cup B=\{1, 2, \ldots, p - 1\}$ 2. If $a,b\in A$ or $a,b\in B$, then $ab\bmod p\in A$ 3. If $a\in A$ and $b\in B$, then $ab\bmod p\in B$ then $A = \{\text{quadratic residues modulo } p\}$ and $B = \{\text{quadratic non - residues modulo } p\}$.","import Mathlib theorem quadratic_residue (p : ℕ) (hp : Odd p ∧ Nat.Prime p) (A B : Finset ℕ) (hA : A ⊆ Finset.Icc 1 (p - 1)) (hB : B ⊆ Finset.Icc 1 (p - 1)) (hAB : A ∩ B = ∅) (hA' : A ≠ ∅) (hB' : B ≠ ∅) (hA'' : ∀ a ∈ A, ∀ b ∈ A, a * b % p ∈ A) (hB'' : ∀ a ∈ B, ∀ b ∈ B, a * b % p ∈ B) (hA''' : ∀ a ∈ A, ∀ b ∈ B, a * b % p ∈ B) : A = {x | ∃ y, x = y ^ 2 ∧ x ∈ Finset.Icc 1 (p - 1)} ∧ B = {x | ¬∃ y, x = y ^ 2 ∧ x ∈ Finset.Icc 1 (p - 1)} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-248872,"Let \(a_1, a_2, \ldots, a_{n + 1}\) be \(n+1\) positive integers such that there are exactly \(n\) distinct primes that divide at least one of \(a_1, a_2, \ldots, a_{n+1}\). Prove that there exists a nonempty subset \(S \subseteq \{1, 2, \ldots, n+1\}\) such that the product \(\prod_{i \in S} a_i\) is a perfect square.","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (a : Fin (n + 1) → ℕ) (ha : ∀ i, 0 < a i) (h : {p | p.Prime ∧ ∃ i, p ∣ a i}.encard = n) : ∃ S : Finset (Fin (n + 1)), S ≠ ∅ ∧ IsSquare (∏ i ∈ S, a i) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-248873,"Prove that for two sequences of nonnegative real numbers \(a_1, a_2, \ldots, a_{2n - 1}\) and \(b_1, b_2, \ldots, b_{2n - 1}\), there exists a subset \(A \subset \{1, 2, \ldots, 2n - 1\}\) with \(|A| = n\) such that \(2\sum_{k \in A} a_k \ge \sum_{k = 1}^{2n - 1} a_k\) and \(2\sum_{k \in A} b_k \ge \sum_{k = 1}^{2n - 1} b_k\).","import Mathlib open Finset Real theorem prove (n : ℕ) (hn : 0 < n) (a b : ℕ → ℝ) (ha : ∀ k ∈ Icc 1 (2 * n - 1), 0 ≤ a k) (hb : ∀ k ∈ Icc 1 (2 * n - 1), 0 ≤ b k) : ∃ A : Finset ℕ, A ⊆ Icc 1 (2 * n - 1) ∧ A.card = n ∧ 2 * ∑ k ∈ A, a k ≥ ∑ k ∈ Icc 1 (2 * n - 1), a k ∧ 2 * ∑ k ∈ A, b k ≥ ∑ k ∈ Icc 1 (2 * n - 1), b k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-248916,"Prove that there exists an infinite set \(A \subset \mathbb{Z}\) such that for any distinct elements \(x, y \in A\), there does not exist an integer \(k\) for which \(x + k(y - x)\) is an element of \(A\) different from both \(x\) and \(y\).","import Mathlib theorem Infinite_A : ∃ A : Set ℤ, Infinite A ∧ ∀ x ∈ A, ∀ y ∈ A, x ≠ y → ¬∃ k : ℤ, x + k * (y - x) ∈ A ∧ x ≠ x + k * (y - x) ∧ y ≠ x + k * (y - x) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-249006,"Prove that the number of functions \(f:M\times M\to M\), where \(M = \{0,1,2,\dots,2022\}\), satisfying the properties \(f(a,f(b,a)) = b\) for all \(a,b\in M\) and \(f(x,x)\neq x\) for each \(x\in M\) is \(0\) modulo \(1000\).","import Mathlib theorem prove : {f : Fin 2023 → Fin 2023 → Fin 2023 | (∀ a b, f a (f b a) = b) ∧ ∀ x, f x x ≠ x}.ncard % 1000 = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-249368,"Prove that for a (finite) system of residues and moduli \(a_i \pmod{b_i}\), where \(1 \leq i \leq k\), defined as ""covering"" (i.e., every integer satisfies at least one of the congruences \(x \equiv a_i \pmod{b_i}\)), there exists a non - empty subset \(I \subseteq \{1,\ldots,k\}\) such that \(\sum_{i \in I} \frac{1}{b_i} \in \mathbb{N}\).","import Mathlib open Finset theorem prove {k : ℕ} (hk : 0 < k) (a b : Fin k → ℤ) (h : ∀ i, 1 ≤ b i) (h' : ∀ x, ∃ i, x ≡ a i [ZMOD b i]) : ∃ I : Finset (Fin k), I ≠ ∅ ∧ ∃ m : ℕ, ∑ i ∈ I, (1 / b i : ℚ) = m := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-249422,"Let $\{t_n\}$ be a sequence of real numbers. Define the set $E = \{ x \in \mathbb{R} : \lim\limits_{n\to\infty} e^{i t_n x} \text{ exists} \}$. Prove that if the Lebesgue measure $m(E) > 0$, then the sequence $\{t_n\}$ is convergent.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (f : ℕ → ℝ) : (MeasureTheory.volume {x | ∃ L, Tendsto (λ n => exp (I * f n * x)) atTop (𝓝 L)}).toReal > 0 → ∃ l, Tendsto f atTop (𝓝 l) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-249545,"Prove that for real numbers \(r_1, r_2, \ldots, r_n\), there exists a subset \(S \subseteq \{1, 2, \ldots, n\}\) such that for every \(1 \leq i \leq n - 2\), \[1 \leq |S \cap \{i, i + 1, i + 2\}| \leq 2,\] and \[\left| \sum_{i \in S} r_i \right| \geq \frac{1}{6} \sum_{i = 1}^{n} |r_i|.\]","import Mathlib open Finset Real theorem prove (n : ℕ) (hn : 0 < n) (r : ℕ → ℝ) : ∃ S : Finset ℕ, S ⊆ Icc 1 n ∧ ∀ i ∈ Icc 1 (n - 2), 1 ≤ (S ∩ {i, i + 1, i + 2}).card ∧ (S ∩ {i, i + 1, i + 2}).card ≤ 2 ∧ ‖∑ i ∈ S, r i‖ ≥ (1 / 6) * ∑ i ∈ Icc 1 n, |r i| := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-249709,"Prove that given \(2n + 1\) irrational numbers \(\alpha_1,\alpha_2,\ldots,\alpha_{2n + 1}\), it is possible to select \(n + 1\) of these numbers such that the sum of any subset of these \(n + 1\) numbers (without repetition) is irrational.","import Mathlib theorem prove (n : ℕ) (α : Finset ℝ) (hα : α.card = 2 * n + 1) (hα' : ∀ x ∈ α, Irrational x) : ∃ β ⊆ α, β.card = n + 1 ∧ (∀ s : Finset ℝ, s ⊆ β → s.card > 0 → Irrational (∑ x ∈ s, x)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-249763,"Prove that if in a social gathering, for any two individuals \(A\) and \(B\), there exists a unique individual \(Z\) such that \(A\) and \(Z\), and \(B\) and \(Z\) are friends, then there exists at least one individual who is a friend of all other individuals in the gathering.","import Mathlib theorem prove_friendship (n : ℕ) (hn : n > 0) (a : Fin n → Fin n → Prop) (ha : ∀ i j, ∃! z, a i z ∧ a j z) : ∃ x, ∀ y, a x y := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-249926,"Let \(n\geq1\) be an integer, and let \(p_1,p_2,\cdots,p_n\) be \(n\) prime numbers. Let \(a_1,a_2,\cdots,a_{n + 1}\) be \(n+1\) positive integers, where each \(a_i\) is of the form \(a_i=\prod_{j = 1}^{n}p_j^{k_{ij}}\) with \(k_{ij}\geq0\) for \(i = 1,2,\cdots,n+1\) and \(j=1,2,\cdots,n\). Prove that there exists a non - empty subset \(S\subseteq\{1,2,\cdots,n + 1\}\) such that \(\prod_{i\in S}a_i=m^2\) for some positive integer \(m\).","import Mathlib theorem qwen (n : ℕ) (hn : 1 ≤ n) (p : Fin n → ℕ) (hp : ∀ i, Nat.Prime (p i)) (a : Fin (n + 1) → ℕ) (ha : ∀ i, ∃ k : Fin n → ℕ, a i = ∏ j : Fin n, (p j) ^ (k j)) : ∃ S : Finset (Fin (n + 1)), S ≠ ∅ ∧ ∃ m : ℕ, 0 < m ∧ ∏ i ∈ S, a i = m ^ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-250086,"Prove that the number of pairs of real numbers $(\alpha, \beta)$ for two sequences $\{a_n\}$ and $\{b_n\}$ defined by $a_1 = \alpha$, $b_1 = \beta$, $a_{n + 1} = \alpha a_n - \beta b_n$, and $b_{n + 1} = \beta a_n + \alpha b_n$ such that $a_{1997} = \beta$ and $b_{1997} = \alpha$ is \(1998\).","import Mathlib theorem count : Set.encard {p : ℝ × ℝ | ∃ α β, p = (α, β) ∧ ∃ a b : ℕ → ℝ, a 1 = α ∧ b 1 = β ∧ ∀ n, a (n + 1) = α * a n - β * b n ∧ b (n + 1) = β * a n + α * b n ∧ a 1997 = β ∧ b 1997 = α} = 1998 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-250162,"Let $S$ be a set containing $m$ pairs $(a, b)$ of positive integers such that $1 \leq a < b \leq n$. Prove that there are at least \[ \frac{4m(m - \frac{n^2}{4})}{3n} \] triples $(a, b, c)$ such that $(a, b)$, $(a, c)$, and $(b, c)$ are all elements of $S$.","import Mathlib theorem qwen (m n : ℕ) (S : Finset (ℕ × ℕ)) (hS : ∀ x ∈ S, x.1 > 0 ∧ x.2 > 0 ∧ 1 ≤ x.1 ∧ x.1 < x.2 ∧ x.2 ≤ n) : {x | ∃ a b c : ℕ, x = (a, b, c) ∧ (a, b) ∈ S ∧ (a, c) ∈ S ∧ (b, c) ∈ S}.ncard ≥ 4 * m * (m - n ^ 2 / 4) / (3 * n) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-250243,"Prove that for any positive integer \(k \geq 2\) and any nonnegative integer \(i\), the minimum number of jumps needed to reach \(2^i k\) is greater than the minimum number of jumps needed to reach \(2^i\), where a mathematical frog jumps along the number line starting at \(1\), and if the frog is at an integer \(n\), it can jump either to \(n + 1\) or to \(n+2^{m_n + 1}\), with \(2^{m_n}\) being the largest power of \(2\) that divides \(n\).","import Mathlib open Finset theorem prove (k : ℕ) (hk : 2 ≤ k) (i : ℕ) : IsLeast {x | ∃ s : ℕ → ℕ, s 0 = 1 ∧ ∀ n, s (n + 1) = s n + 1 ∨ s (n + 1) = s n + 2 ^ (Nat.factorization (s n) 2 + 1)} (2 ^ i * k) > IsLeast {x | ∃ s : ℕ → ℕ, s 0 = 1 ∧ ∀ n, s (n + 1) = s n + 1 ∨ s (n + 1) = s n + 2 ^ (Nat.factorization (s n) 2)} (2 ^ i) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-250328,"Prove that there exists an infinite sequence of positive integers \(a_1,a_2,\cdots\) such that each positive integer appears exactly once in the sequence, and for every positive integer \(n\), the sum \(\sum_{i = 1}^{n}a_i\) is divisible by \(n\).","import Mathlib theorem exist : ∃ a : ℕ → ℕ, (∀ n, 0 < a n) ∧ (∀ n, n > 0 → ∑ i ∈ Finset.Icc 1 n, a i ≡ 0 [MOD n]) ∧ (∀ m, 0 < m → ∃! n, a n = m) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-250357,"a. Prove that if every point on the plane is painted one of three colors, then there necessarily exists a pair of points of the same color that are exactly one inch apart. b. Prove that if every point on the plane is painted one of nine colors, then there does not necessarily exist a pair of points of the same color that are exactly one inch apart.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem a (f : (EuclideanSpace ℝ (Fin 2)) → Fin 3) : ∃ x y, f x = f y ∧ dist x y = 1 := sorry theorem b (f : (EuclideanSpace ℝ (Fin 2)) → Fin 9) : ¬ ∃ x y, f x = f y ∧ dist x y = 1 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-250404,"Let $S$ be a subset of $\mathbb{N}$ (the set of all natural numbers) that satisfies the following conditions: 1. Among any $2003$ consecutive natural numbers, there exists at least one number that is an element of $S$. 2. If $n \in S$ and $n > 1$, then $\left\lfloor \frac{n}{2} \right\rfloor \in S$. Prove that $S = \mathbb{N}$.","import Mathlib theorem qwen {S : Set ℕ} (hS1 : ∀ n, ∃ m ∈ S, m ∈ Finset.Icc n (n + 2002)) (hS2 : ∀ n ∈ S, n > 1 → ⌊(n / 2 : ℝ)⌋₊ ∈ S) : S = ⊤ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-250549,"Prove or disprove: For any set $A$ of real numbers with Lebesgue measure $0$ and for any $\epsilon > 0$, it is possible to cover $A$ with a countable family of open intervals $\{I_n\}$ such that each interval $I_n$ has length smaller than $\frac{\epsilon}{2^n}$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MeasureTheory.volume (A : Set ℝ) (hA : MeasureTheory.volume A = 0) (ε : ℝ) (hε : ε > 0) : ∃ f : ℕ → Set ℝ, (∀ n, IsOpen (f n)) ∧ (∀ n, (MeasureTheory.volume (f n)).toReal < ε / 2 ^ n) ∧ (∀ x ∈ A, ∃ n, x ∈ f n) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-250606,"Prove, using a strictly combinatorial argument, that for all positive integers \(n\), the following identity holds: \[ \sum_{k=1}^{n}\binom{2k-2}{k-1}\binom{2n-2k}{n-k}=2^{2n-2} \]","import Mathlib open Finset theorem Nat.choose_sum (n : ℕ) (hn : 0 < n) : ∑ k ∈ Icc 1 n, Nat.choose (2 * k - 2) (k - 1) * Nat.choose (2 * n - 2 * k) (n - k) = 2 ^ (2 * n - 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-250965,"Let \(A = \{a_1, a_2, \ldots, a_n\}\) and \(B = \{b_1, b_2, \ldots, b_m\}\) be two finite collections of positive integers. Define the collections \(A^* = \{a_i + a_j \mid 1 \le i < j \le n\}\) and \(B^* = \{b_i + b_j \mid 1 \le i < j \le m\}\). Prove that if \(A^* = B^* \), then \(|A| = |B| = 2^{k - 1}\) for some positive integer \(k\).","import Mathlib theorem Finset.card_eq {n m : ℕ} (hn : 0 < n) (hm : 0 < m) (A B : Finset ℕ) (hA : A.card = n) (hB : B.card = m) (hA' : ∀ x ∈ A, 0 < x) (hB' : ∀ x ∈ B, 0 < x) (h : {x | ∃ a ∈ A, ∃ b ∈ A, x = a + b ∧ a < b} = {x | ∃ a ∈ B, ∃ b ∈ B, x = a + b ∧ a < b}) : ∃ k : ℕ, 0 < k ∧ A.card = 2 ^ (k - 1) ∧ B.card = 2 ^ (k - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-250966,"Let $A = \{a_1, a_2, \ldots, a_n\}$ and $B = \{b_1, b_2, \ldots, b_m\}$ be two finite collections of positive integers. Define the collections $A^* = \{a_i + a_j \mid 1 \le i < j \le n\}$ and $B^* = \{b_i + b_j \mid 1 \le i < j \le m\}$. Prove that if $A^* = B^*$, then $|A| = |B|$ and $|A|$ (and thus $|B|$) is a power of $2$.","import Mathlib def Astar (A : Finset ℕ) := {x | ∃ i ∈ A, ∃ j ∈ A, x = i + j ∧ i ≠ j} def Bstar (B : Finset ℕ) := {x | ∃ i ∈ B, ∃ j ∈ B, x = i + j ∧ i ≠ j} theorem star_eq {A B : Finset ℕ} (hA : ∀ x ∈ A, x > 0) (hB : ∀ x ∈ B, x > 0) (hstar : Astar A = Bstar B) : A.card = B.card ∧ (∃ k : ℕ, A.card = 2 ^ k) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-250981,"Prove that for any set of \(n\) points in the plane, if a set of points in the plane is defined as [i]free[/i] when no three points in the set form the vertices of an equilateral triangle, then there exists a [i]free[/i] subset containing at least \(\sqrt{n}\) points.","import Mathlib open Real Set open scoped BigOperators theorem prove (n : ℕ) (hn : 0 < n) (a : Fin n → EuclideanSpace ℝ (Fin 2)) : ∃ b : Finset (Fin n), b.card ≥ sqrt n ∧ ∀ i ∈ b, ∀ j ∈ b, ∀ k ∈ b, i ≠ j ∧ i ≠ k ∧ j ≠ k → ¬(dist (a i) (a j) = dist (a i) (a k) ∧ dist (a i) (a j) = dist (a j) (a k)) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-251082,"Prove that given a set of \(2n + 1\) weights (\(n\in\mathbb{Z}^+\)), if any single weight is removed, the remaining \(2n\) weights can be divided into two groups of \(n\) weights each such that the total weight of each group is the same, then all the weights are equal.","import Mathlib theorem prove (n : ℕ) (hn : n > 0) (w : Fin (2 * n + 1) → ℝ) (h : ∀ i, ∃ s1 s2 : Finset (Fin (2 * n + 1)), s1 ≠ s2 ∧ s1 ∪ s2 = Finset.univ \ {i} ∧ s1.card = n ∧ s2.card = n ∧ ∑ j ∈ s1, w j = ∑ j ∈ s2, w j) : ∀ i j, w i = w j := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-251220,"Prove that in a tournament with $23$ competitors having distinct weights $a_1, a_2, \ldots, a_{23}$, where for any eliminated competitor, the remaining $22$ competitors can be divided into two groups of equal total weight, it is not possible for all $23$ competitors to have the same weight.","import Mathlib theorem weight_tournament (a : Fin 23 → ℝ) (ha : ∀ i j, a i = a j → i = j) (h : ∀ k, ∃ s1 s2 : Finset (Fin 23), s1 ≠ s2 ∧ s1 ∪ s2 = Finset.univ \ {k} ∧ ∑ i ∈ s1, a i = ∑ i ∈ s2, a i) : ¬(∃ x, ∀ i, a i = x) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-251880,Prove that the number of monic polynomials \(q(x)\) with integer coefficients of degree \(12\) such that there exists an integer polynomial \(p(x)\) satisfying \(q(x)p(x) = q(x^2)\) is \(581\).,"import Mathlib theorem count_monic_polynomials : Set.ncard {q : Polynomial ℤ | q.Monic ∧ q.degree = 12 ∧ ∃ p : Polynomial ℤ, q * p = q.comp (Polynomial.X ^ 2)} = 581 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-251883,Prove that the number of monic polynomials \(q(x)\) with integer coefficients of degree \(12\) such that there exists an integer polynomial \(p(x)\) satisfying \(q(x)p(x) = q(x^2)\) is \(640\).,"import Mathlib theorem number_of_monic_polynomials : Set.encard {q : Polynomial ℤ | q.Monic ∧ q.degree = 12 ∧ ∃ p : Polynomial ℤ, q * p = q.comp (X ^ 2)} = 640 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-252024,"Let $p$ be a prime number such that $p \geq 3$. Prove that: \[ \sum_{j=0}^p \binom{p}{j} \binom{j+p}{j} \equiv 2^p + 1 \pmod{p^2} \]","import Mathlib open Finset theorem Nat.choose_p : ∀ p : ℕ, Nat.Prime p → p ≥ 3 → ∑ j ∈ range (p + 1), Nat.choose p j * Nat.choose (j + p) j ≡ 2 ^ p + 1 [MOD p ^ 2] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-252402,"Let $\mathcal{S}$ be a set of $\frac{n^2 - n + 2}{2}$ points, where $n \geq 3$, such that no four points are collinear. Prove that there exists a subset of $\mathcal{S}$ containing $n$ points, no three of which are collinear.","import Mathlib theorem qwen (n : ℕ) (hn : n ≥ 3) (S : Finset (EuclideanSpace ℝ (Fin 2))) (hS : S.card = (n ^ 2 - n + 2) / 2) (hS1 : ∀ P ∈ S, ∀ Q ∈ S, ∀ R ∈ S, ∀ T ∈ S, ¬Collinear ℝ {P, Q, R, T}) : ∃ T ⊆ S, T.card = n ∧ ∀ P ∈ T, ∀ Q ∈ T, ∀ R ∈ T, ¬Collinear ℝ {P, Q, R} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-252509,"Given $600$ integers from the set $[1,1000]$ that are colored red, where a natural segment $[n, k]$ is defined as yummy if for every natural number $t$ in the range $[1, k - n]$, there exist two red numbers $a, b$ in $[n, k]$ such that $b - a = t$, prove that there exists a yummy segment $[a, b]$ such that $b - a \geq 199$.","import Mathlib def isYummy (s : Finset ℕ) (n k : ℕ) : Prop := ∀ t ∈ Finset.Icc 1 (k - n), ∃ a ∈ s, ∃ b ∈ s, b - a = t ∧ a ∈ Finset.Icc n k ∧ b ∈ Finset.Icc n k theorem colorRed (s : Finset ℕ) (h₀ : s.card = 600) (h₁ : ∀ x ∈ s, x ∈ Finset.Icc 1 1000) : ∃ a b, isYummy s a b ∧ b - a ≥ 199 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-252617,"Prove that the remainder when the number \(M\) of sets \(A, B, C \subseteq \{1, 2, \dots, 31\}\) such that \(|A \cap B \cap C| + |A \cap B| + |B \cap C| + |A \cap C| = 13\) is divided by \(1000\) is given by \(\left( \binom{31}{3} \cdot \binom{28}{1} \cdot 3 \cdot 4^{27} + \binom{31}{2} \cdot \binom{29}{5} \cdot 3^5 \cdot 4^{24} + \binom{31}{1} \cdot \binom{30}{9} \cdot 3^9 \cdot 4^{21} + \binom{31}{13} \cdot 3^{13} \cdot 4^{18} \right) \mod 1000\).","import Mathlib theorem M : (Nat.choose 31 3 * Nat.choose 28 1 * 3 * 4^27 + Nat.choose 31 2 * Nat.choose 29 5 * 3^5 * 4^24 + Nat.choose 31 1 * Nat.choose 30 9 * 3^9 * 4^21 + Nat.choose 31 13 * 3^13 * 4^18) % 1000 = 13 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-252665,"Prove that the maximum number of elements of a finite set \(M\) of real numbers, with the property that among any three points of \(M\), one can always choose two such that their sum is also in \(M\), is \(7\).","import Mathlib theorem FinsetMax (M : Finset ℝ) (hM : ∀ x ∈ M, ∀ y ∈ M, ∀ z ∈ M, ∃ a ∈ M, a = x + y ∨ a = y + z ∨ a = z + x) : M.card ≤ 7 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-252669,"Prove that the number of ordered $64$-tuples $\{x_0, x_1, \dots, x_{63}\}$ such that $x_0, x_1, \dots, x_{63}$ are distinct elements of the set $\{1, 2, \dots, 2017\}$ and the expression \[x_0 + x_1 + 2x_2 + 3x_3 + \cdots + 63x_{63}\] is divisible by $2017$ is equal to \(63! \left( 2016 + \binom{2016}{63} \right)\).","import Mathlib theorem prove : {(x : Fin 64 → ℕ) | (∀ i j, x i = x j → i = j) ∧ (∀ i, x i ∈ Finset.Icc 1 2017) ∧ 2017 ∣ ∑ i, (i + 1) * x i}.ncard = Nat.factorial 63 * (2016 + Nat.choose 2016 63) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-252841,"Prove that if $h: \mathbb{R}^2 \to \mathbb{R}^2$ is a surjective function such that $\|h(x) - h(y)\| \ge 3\|x - y\|$ for all $x, y \in \mathbb{R}^2$, where $\|\cdot\|$ denotes the Euclidean norm on $\mathbb{R}^2$, then the image of every open set in $\mathbb{R}^2$ under the map $h$ is an open set in $\mathbb{R}^2$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove_surjective_h (f : ℝ × ℝ → ℝ × ℝ) (h₀ : Function.Surjective f) (h₁ : ∀ x y, dist (f x) (f y) ≥ 3 * dist x y) (U : Set (ℝ × ℝ)) (hU : IsOpen U) : IsOpen (Set.image f U) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-252878,"Prove that the only function \(f:2^\mathbb{R}\to2^\mathbb{R}\) such that for all sets \(A,B\subset\mathbb{R}\), the condition \(f(A)\setminus f(B)\subset f(B\setminus A)\) holds is \(f(A) = \mathbb{R}\) for every \(A \subset \mathbb{R}\).","import Mathlib theorem c1 : ∀ f : Set ℝ → Set ℝ, (∀ A B, f '' A \ f '' B ⊂ f '' (B \ A)) ↔ ∀ A, f '' A = Set.univ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-252883,"Prove that if a function $f:2^\mathbb{R}\to2^\mathbb{R}$ satisfies the condition that for all sets $A,B\subset\mathbb{R}$, $f(A)\setminus f(B)\subset f(B\setminus A)$ holds, then $f(A) = f(\emptyset)$ for all $A \subset \mathbb{R}$.","import Mathlib theorem Prove (f : Set ℝ → Set ℝ) (h₀ : ∀ A B, f A \ f B ⊆ f (B \ A)) : ∀ A, f A = f ∅ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-253056,"Prove that if $S \subset \mathbb{R}$ is a dense countable set of real numbers, then there exists a sequence of continuous functions $(f_n: \mathbb{R} \to \mathbb{R})$ such that $\lim\limits_{n \to \infty} f_n(x) = \infty$ if and only if $x \in S$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove (S : Set ℝ) (hS : Dense S ∧ Countable S) : ∃ (f : ℕ → ℝ → ℝ), (∀ n, Continuous (f n)) ∧ (∀ x, Tendsto (λ n => f n x) atTop atTop ↔ x ∈ S) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-253129,"Prove that there does not exist a bijection $f: \mathbb{N} \to \mathbb{N}_0$ such that $f(mn) = f(m) + f(n) + 3f(m)f(n)$ for all $m, n \in \mathbb{N}$. Here, $\mathbb{N}$ denotes the set of positive integers $\{1, 2, 3, \ldots\}$ and $\mathbb{N}_0$ denotes the set of non - negative integers $\{0, 1, 2, \ldots\}$.","import Mathlib theorem no_bijective_f : ¬∃ f : ℕ+ → ℕ, Function.Bijective f ∧ ∀ m n, f (m * n) = f m + f n + 3 * f m * f n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-253271,"Let $A$ be a set defined by the following properties: - All elements of $A$ are positive integers. - If $a \in A$, then all divisors of $a$ are also in $A$. - If $a, b \in A$ and $1 < a < b$, then $1 + ab \in A$. - $A$ contains at least three elements. Prove that $A = \mathbb{N}^*$, where $\mathbb{N}^*$ denotes the set of all positive integers.","import Mathlib theorem qwen (A : Set ℕ) (h₀ : ∀ x ∈ A, 0 < x) (h₁ : ∀ x ∈ A, ∀ d ∈ Nat.divisors x, d ∈ A) (h₂ : ∀ x y, x ∈ A → y ∈ A → 1 < x → x < y → (1 + x * y) ∈ A) (h₃ : ∃ x y z, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ x ∈ A ∧ y ∈ A ∧ z ∈ A) : A = {x | 0 < x} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-253679,"Prove that if we have \(101\) cows with weights \(a_1, a_2, \dots, a_{101}\) such that for any \(i\in\{1,2,\dots,101\}\), the remaining \(100\) cows after removing the \(i\) - th cow can be divided into two groups of \(50\) cows with the same total weight, then \(a_1 = a_2=\cdots=a_{101}\).","import Mathlib theorem prove (a : Fin 101 → ℝ) (h : ∀ i, ∃ s1 s2 : Finset (Fin 101), s1 ≠ s2 ∧ s1 ∪ s2 = Finset.univ \ {i} ∧ s1.card = 50 ∧ s2.card = 50 ∧ ∑ j ∈ s1, a j = ∑ j ∈ s2, a j) : ∀ i j, a i = a j := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-253708,"Prove that the remainder when the number \(Z\) of ordered triples of integers \((a, b, c)\) (where there exists a monic quadratic polynomial \(P(x)=x^{2}+px + q\) with integer coefficients such that \(P(a) = 2(a - b)\), \(P(b)=2(b - c)\), \(P(c)=2(c - a)\), and \(0 < |P(0)| < 2019\)) is divided by \(1000\) is \(124\).","import Mathlib theorem prove : Set.ncard {p : ℤ × ℤ × ℤ | ∃ a b c : ℤ, p = (a, b, c) ∧ ∃ P : Polynomial ℤ, P.Monic ∧ P.degree = 2 ∧ P.eval a = 2 * (a - b) ∧ P.eval b = 2 * (b - c) ∧ P.eval c = 2 * (c - a) ∧ 0 < |P.eval 0| ∧ |P.eval 0| < 2019} % 1000 = 124 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-254000,"Prove that the minimum number of unions that must be formed when there are \(100\) countries, each union contains at most \(50\) countries, and each pair of different countries belongs to at least one common union is \(6\).","import Mathlib theorem min_unions (n : ℕ) (hn : n = 100) : IsLeast {k | ∃ s : Finset (Finset ℕ), s.card = k ∧ (∀ t ∈ s, t ⊆ Finset.range n ∧ t.card ≤ 50) ∧ (∀ i ∈ Finset.range n, ∀ j ∈ Finset.range n, i ≠ j → ∃ t ∈ s, i ∈ t ∧ j ∈ t)} 6 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-254130,"Let \(N = \{0, 1, 2, 3, \ldots\}\) be the set of nonnegative integers. Consider a bijection \(f: N \to N\). Prove that there exist nonnegative integers \(a, b, c \in N\) such that: 1. \(a < b < c\) 2. \(f(b) = \frac{f(a) + f(c)}{2}\).","import Mathlib theorem FunctionBiology (f : ℕ → ℕ) (hf : Function.Bijective f) : ∃ a b c, a < b ∧ b < c ∧ f b = (f a + f c) / 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-254184,"Prove that if $M$ is a finite set and $\mathcal{C}$ is a collection of ordered triples $(A, B, C)$ of elements in $M$ satisfying the following conditions: 1. If $(A, B, C) \in \mathcal{C}$, then $(A, C, B), (B, A, C) \in \mathcal{C}$. 2. For every $A, B \in M$ (not necessarily distinct), there exists a unique $C$ such that $(A, B, C) \in \mathcal{C}$. 3. If $(A, B, C), (C, D, E), (B, D, F) \in \mathcal{C}$, then $(A, E, F) \in \mathcal{C}$. then the number of elements in $M$ is $2^n$ for some non - negative integer $n$.","import Mathlib theorem proveFinite {M : Type*} [Finite M] {C : Finset (M × M × M)} (h1 : ∀ a b c : M, (a, b, c) ∈ C → (a, c, b) ∈ C ∧ (b, a, c) ∈ C) (h2 : ∀ a b : M, ∃! c : M, (a, b, c) ∈ C) (h3 : ∀ a b c d e f : M, (a, b, c) ∈ C ∧ (c, d, e) ∈ C ∧ (b, d, f) ∈ C → (a, e, f) ∈ C) : ∃ n : ℕ, (Nat.card M = 2 ^ n) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-254732,"Given \(91\) distinct positive integers, each greater than \(1\), such that there are at least \(456\) pairs among them that are relatively prime, prove that it is possible to find four integers \(a, b, c, d\) among them such that \(\gcd(a,b)=\gcd(b,c)=\gcd(c,d)=\gcd(d,a)=1\).","import Mathlib theorem s : ∃ s : Finset ℕ, s.card = 91 ∧ (∀ n ∈ s, n > 1) ∧ {p : ℕ × ℕ | p.1 ∈ s ∧ p.2 ∈ s ∧ Nat.Coprime p.1 p.2}.ncard ≥ 456 → ∃ a ∈ s, ∃ b ∈ s, ∃ c ∈ s, ∃ d ∈ s, a ≠ b ∧ a ≠ c ∧ a ≠ d ∧ b ≠ c ∧ b ≠ d ∧ c ≠ d ∧ Nat.gcd a b = 1 ∧ Nat.gcd b c = 1 ∧ Nat.gcd c d = 1 ∧ Nat.gcd d a = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-254734,"Given $91$ distinct positive integers, each greater than $1$, such that there are at least $456$ pairs among them that are relatively prime, prove that there exist four integers $a, b, c, d$ among them such that $\gcd(a,b)=\gcd(b,c)=\gcd(c,d)=\gcd(d,a)=1$.","import Mathlib theorem qwen (s : Finset ℕ) (h₀ : s.card = 91) (h₁ : ∀ x ∈ s, x > 1) (h₂ : {p | ∃ x y, p = (x, y) ∧ x ∈ s ∧ y ∈ s ∧ Nat.Coprime x y}.ncard ≥ 456) : ∃ a b c d, a ∈ s ∧ b ∈ s ∧ c ∈ s ∧ d ∈ s ∧ Nat.gcd a b = 1 ∧ Nat.gcd b c = 1 ∧ Nat.gcd c d = 1 ∧ Nat.gcd d a = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-254906,"Prove that the generating function for the sequence $\{a_n\}$, where \(a_n=\sum_{i = 0}^{\infty} {n\choose i}\cdot {2(n - i)\choose n}\), is \(\frac{1}{\sqrt{1-4x-4x^2}}\).","import Mathlib open Real theorem G (a : ℕ → ℝ) (ha : ∀ n, a n = ∑' i : ℕ, Nat.choose n i * Nat.choose (2*(n - i)) n) : (fun x => ∑' n : ℕ, a n * x^n) = fun x => 1 / sqrt (1 - 4*x - 4*x^2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-255410,"Prove that for a set $S$ containing $2n + 1$ positive integers, where $N(S)$ is defined as the number of non - empty subsets $X$ of $S$ such that $\sum_{a \in X} a\in S$, the inequality \(N(S) \leq 2^{2n}\) always holds.","import Mathlib open Finset theorem prove {n : ℕ} (hn : 0 < n) (S : Finset ℕ) (hS : ∀ x ∈ S, 0 < x) (hS1 : S.card = 2 * n + 1) : {X | X ⊆ S ∧ X ≠ ∅ ∧ ∑ a ∈ X, a ∈ S}.ncard ≤ 2 ^ (2 * n) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-255424,"Prove that given a set \(S\) of \(n\) points in the plane, there exists a subset of at least \(\sqrt{n}\) points in \(S\) such that no three points in this subset are vertices of an equilateral triangle.","import Mathlib open Real Set open scoped BigOperators theorem prove (n : ℕ) (hn : 0 < n) (S : Finset (EuclideanSpace ℝ (Fin 2))) : ∃ T ⊆ S, T.card ≥ sqrt n ∧ ∀ x ∈ T, ∀ y ∈ T, ∀ z ∈ T, (x ≠ y ∧ y ≠ z ∧ z ≠ x) → ¬(∃ A B C : EuclideanSpace ℝ (Fin 2), A = x ∧ B = y ∧ C = z ∧ dist A B = dist B C ∧ dist B C = dist A C) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-255590,"Prove that the maximum number of subsets \(B_i \subset A\) (where \(i = 1, 2, \ldots, n\)) such that \(A = \{1, 2, 3, \ldots, 20\}\), each subset \(B_i\) has exactly \(5\) elements, and for all \(i \neq j\), \(|B_i \cap B_j| = 1\), is \(16\).","import Mathlib theorem max_subsets {A : Finset ℕ} (hA : A = Finset.Icc 1 20) : IsGreatest {n | ∃ B : Fin n → Finset ℕ, (∀ i j, i ≠ j → (B i ∩ B j).card = 1) ∧ (∀ i, B i ⊆ A) ∧ (∀ i, (B i).card = 5)} 16 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-255594,"Prove that the maximum number of subsets \(B_i \subset A\) (where \(i = 1, 2, \ldots, n\)) of the set \(A=\{1, 2, 3, \ldots, 20\}\) such that each subset \(B_i\) has exactly \(5\) elements and any two distinct subsets \(B_i\) and \(B_j\) share exactly one common element (i.e., for all \(i \neq j\), \(|B_i| = 5\) and \(|B_i \cap B_j| = 1\)) is \(16\).","import Mathlib open Finset theorem max_bis {A : Finset ℕ} (hA : A = Icc 1 20) : IsGreatest {n | ∃ B : Finset (Finset ℕ), B.card = n ∧ (∀ b ∈ B, b ⊆ A ∧ b.card = 5) ∧ (∀ i ∈ B, ∀ j ∈ B, i ≠ j → (i ∩ j).card = 1)} 16 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-255931,"Let $(r_j, s_j, t_j)$, for $j = 1, 2, \ldots, N$, be triples of integers such that for each $j$, $r_j, s_j, t_j$ are not all even. Prove that there exist integers $a, b, c$ such that $ar_j + bs_j + ct_j$ is odd for at least $\frac{4N}{7}$ of the indices $j$.","import Mathlib theorem Qwen (N : ℕ) (hN : N > 0) (r s t : Fin N → ℤ) (hr : ∀ j, ¬(Even (r j) ∧ Even (s j) ∧ Even (t j))) : ∃ a b c, {j | Odd (a * r j + b * s j + c * t j)}.ncard ≥ (4 * N : ℝ) / 7 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-255948,"Given \(m\) distinct colours, every positive integer is coloured using one of these \(m\) colours. Prove that there exist natural numbers \(a, b, c, d\) such that: 1. \(a, b, c, d\) are all of the same colour. 2. \(ad = bc\). 3. \(\frac{b}{a}\) is a power of 2 and \(\frac{c}{a}\) is a power of 3.","import Mathlib theorem prove_colouring (m : ℕ) (col : ℕ → Fin m) : ∃ a b c d : ℕ, a > 0 ∧ b > 0 ∧ c > 0 ∧ d > 0 ∧ col a = col b ∧ col b = col c ∧ col c = col d ∧ a * d = b * c ∧ ∃ k l : ℕ, b / a = 2 ^ k ∧ c / a = 3 ^ l := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-256081,"Prove that among the pairwise distances between \(1997\) points in the plane, there are at least \(32\) different values.","import Mathlib open Real Set open scoped BigOperators theorem prove (s : Finset (EuclideanSpace ℝ (Fin 2))) (h₀ : s.card = 1997) : {d | ∃ p ∈ s, ∃ q ∈ s, p ≠ q ∧ d = dist p q}.ncard ≥ 32 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-256527,"Prove that the expression \( \exp \left( \sum_{n=1}^{\infty} \frac{ B(n)}{n(n+1)} \right) \), where \(B(n)\) denotes the number of ones in the binary representation of the positive integer \(n\), is equal to \(4\).","import Mathlib open Real theorem exp_B : exp (∑' n : ℕ+, (Nat.digits 2 n.val).sum / ((n.val + 1) * n.val)) = 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-257249,"Prove that the finite sets $A \subset \mathbb{N}^*$ with $|A| \ge 2$ such that for any $a, b \in A$ with $a \ne b$, the expression $\dfrac{a+b}{\gcd(a,b)}$ is also an element of $A$ are exactly the sets of the form $A = \{u, u^2 - u\}$ for any positive integer $u \geq 3$.","import Mathlib theorem prove (A : Finset ℕ) (hA : ∀ x ∈ A, x > 0) (hA1 : A.card ≥ 2) (hA2 : ∀ a ∈ A, ∀ b ∈ A, a ≠ b → (a + b) / Nat.gcd a b ∈ A) : ∃ u, u > 0 ∧ u ≥ 3 ∧ A = {u, u ^ 2 - u} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-257602,"Prove that if $p$ is a prime number and $A$ is a set of positive integers such that the set of prime divisors of the elements in $A$ consists of exactly $p - 1$ distinct primes and for any non - empty subset of $A$, the product of its elements is not a perfect $p$-th power, then the largest possible number of elements in $A$ is $(p - 1)^2$.","import Mathlib theorem Prove (p : ℕ) (hp : Nat.Prime p) (A : Finset ℕ) (hA : ∀ x ∈ A, x > 0) (hA' : (Nat.primeFactors (∏ x ∈ A, x)).card = p - 1) (hA'' : ∀ B ⊆ A, B ≠ ∅ → ¬∃ m, m^p = ∏ x ∈ B, x) : A.card ≤ (p - 1)^2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-257668,"Let \(m, n\) be positive integers, and consider \(m\) matrices \(B_1, B_2, \dots, B_m\) of size \(n \times n\). Suppose that the sum \(\sum_{i=1}^{m} B_i\) is nonsingular. Prove that there exists a subset \(S \subseteq \{1, 2, \dots, m\}\) such that \(|S| \leq n\) and \(\sum_{i \in S} B_i\) is nonsingular.","import Mathlib theorem MatrixSum (m n : ℕ) (hm : 0 < m) (hn : 0 < n) (B : Fin m → Matrix (Fin n) (Fin n) ℝ) (hsum : Nonempty (Invertible (∑ i : Fin m, B i))) : ∃ S : Finset (Fin m), S.card ≤ n ∧ Nonempty (Invertible (∑ i ∈ S, B i)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-257929,"Given any integer \(0 < n \leq 2^{1000000}\), prove that there exists a set \(S\) of at most \(1100000\) positive integers such that \(S\) includes \(1\) and \(n\), and every element of \(S\) except \(1\) is the sum of two (possibly equal) smaller elements of \(S\).","import Mathlib theorem algebra_568398 (n : ℕ) (hn : 0 < n ∧ n ≤ 2^1000000) : ∃ S : Finset ℕ, (∀ x ∈ S, x > 0) ∧ 1 ∈ S ∧ n ∈ S ∧ (∀ x ∈ S \ {1}, ∃ y z, y ∈ S ∧ z ∈ S ∧ x = y + z) ∧ S.card ≤ 1100000 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-257978,"Prove that the minimum positive integer \(k\) such that for any subset \(A\) of \(M=\{1, 2, \ldots, 2n\}\) with \(k\) elements, there exist four pairwise distinct elements in \(A\) whose sum is \(4n + 1\), is \(k = n+3\).","import Mathlib open Finset theorem prove (n : ℕ) (hn : 0 < n) : IsLeast {k | 0 < k ∧ ∀ A : Finset ℕ, A ⊆ Icc 1 (2 * n) ∧ A.card = k → ∃ x ∈ A, ∃ y ∈ A, ∃ z ∈ A, ∃ w ∈ A, x ≠ y ∧ x ≠ z ∧ x ≠ w ∧ y ≠ z ∧ y ≠ w ∧ z ≠ w ∧ x + y + z + w = 4 * n + 1} (n + 3) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-258110,"Let $S$ be a set of integers (not necessarily positive) satisfying the following conditions: 1. There exist $a, b \in S$ such that $\gcd(a, b) = \gcd(a - 2, b - 2) = 1$. 2. For any $x, y \in S$ (where $x$ and $y$ may be equal), the expression $x^2 - y$ also belongs to $S$. Prove that $S$ is the set of all integers.","import Mathlib theorem proveS : ∀ S : Set ℤ, (∃ a b : ℤ, a ∈ S ∧ b ∈ S ∧ Int.gcd a b = 1 ∧ Int.gcd (a - 2) (b - 2) = 1) ∧ (∀ x y : ℤ, x ∈ S → y ∈ S → (x ^ 2 - y) ∈ S) ↔ S = ⊤ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-258148,"Prove that the number of $M$-partitions of the set $A = \{1, 2, \dots, 2002\}$, where $M = \{1001, 2003, 3005\}$ and an $M$-partition $(A_1, A_2)$ of $A$ is a partition of $A$ into two non - empty subsets $A_1$ and $A_2$ such that $A = A_1\cup A_2$, $A_1\cap A_2=\emptyset$, and both $A_1$ and $A_2$ are $M$-free sets (a non - empty subset $B$ of $A$ is $M$-free if the sum of any two distinct elements in $B$ does not belong to $M$), is $2^{501}$.","import Mathlib def M : Finset ℕ := {1001, 2003, 3005} def A : Finset ℕ := Finset.Icc 1 2002 def isMFree (S : Finset ℕ) : Prop := ∀ x ∈ S, ∀ y ∈ S, x ≠ y → ¬(x + y ∈ M) theorem number_of_M_partitions : {(A1, A2) : Finset ℕ × Finset ℕ | A1 ⊆ A ∧ A2 ⊆ A ∧ A1 ≠ ∅ ∧ A2 ≠ ∅ ∧ A1 ∪ A2 = A ∧ A1 ∩ A2 = ∅ ∧ isMFree A1 ∧ isMFree A2}.ncard = 2^501 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-258156,"Let \(S = \{a_1, a_2, \dots, a_n\}\) be a set of natural numbers such that the sum of the elements of any two distinct subsets of \(S\) are distinct. Prove that: \[ \frac{1}{a_1} + \frac{1}{a_2} + \dots + \frac{1}{a_n} < 2 \]","import Mathlib theorem Finset.sumOfReciprocal {n : ℕ} (hn : 0 < n) (a : Fin n → ℕ) (ha : ∀ s1 s2 : Finset (Fin n), s1 ≠ s2 → ∑ i ∈ s1, a i ≠ ∑ i ∈ s2, a i) : ∑ i : Fin n, (1 : ℚ)/(a i) < 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-258218,"Given a set \(M\) consisting of \(1985\) distinct positive integers, where each integer in \(M\) has no prime divisor greater than \(23\), prove that \(M\) contains a subset of \(4\) elements whose product is the fourth power of an integer.","import Mathlib theorem Qwen (M : Finset ℕ) (hM : M.card = 1985) (hM1 : ∀ m ∈ M, ∀ p, Nat.Prime p → p ∣ m → p ≤ 23) : ∃ T ⊆ M, T.card = 4 ∧ ∃ n, T.prod id = n ^ 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-258333,"Prove that the set $\{1, 2, \ldots, 2^n\}$ can be partitioned into two classes such that neither class contains an arithmetic progression of length $2n$ for all $n \geq 1$.","import Mathlib theorem prove (n : ℕ) (hn : 1 ≤ n) : ∃ s1 s2 : Finset ℕ, s1 ∪ s2 = Finset.Icc 1 (2 ^ n) ∧ s1 ∩ s2 = ∅ ∧ ∀ k ∈ s1, ¬∃ d, ∀ i ∈ Finset.range (2 * n), k + d * i ∈ s1 ∧ ∀ k ∈ s2, ¬∃ d, ∀ i ∈ Finset.range (2 * n), k + d * i ∈ s2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-258511,"Prove that for each integer \(n \geq 3\), the smallest natural number \(f(n)\) such that for every subset \(A \subset \{1, 2, \ldots, n\}\) with \(f(n)\) elements, there exist elements \(x, y, z \in A\) that are pairwise coprime, is given by \(f(n)=\left\lfloor \frac{n}{2} \right\rfloor + \left\lfloor \frac{n}{3} \right\rfloor - \left\lfloor \frac{n}{6} \right\rfloor + 1\).","import Mathlib open Finset theorem f (n : ℕ) (hn : 3 ≤ n) : IsLeast {x | ∀ A ⊆ Icc 1 n, A.card = x → ∃ x ∈ A, ∃ y ∈ A, ∃ z ∈ A, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ Nat.Coprime x y ∧ Nat.Coprime y z ∧ Nat.Coprime z x} (Nat.floor (n / 2) + Nat.floor (n / 3) - Nat.floor (n / 6) + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-258607,"Prove that for an irrational number $\alpha$, every real number $x \in [0,1]$ is a limit point of the sequence $\{n\alpha - \lfloor n\alpha \rfloor\}$.","import Mathlib theorem Topologyfilter (α : ℝ) (hα : Irrational α) (x : ℝ) (hx : x ∈ Set.Icc 0 1) : ∀ ε > 0, ∃ n, |(n * α - ⌊n * α⌋) - x| < ε := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-258906,"Prove that the maximum integer \(n\) such that there exist subsets \(A_1, A_2, \ldots, A_n\) of the set \(S = \{1, 2, \ldots, 25\}\) where each subset \(A_i\) has exactly \(5\) elements and any two distinct subsets \(A_i\) and \(A_j\) intersect in at most \(3\) elements is \(n = 1698\).","import Mathlib open Finset theorem maxn : IsGreatest {n | ∃ A : Fin n → Finset ℕ, (∀ i, A i ⊆ Icc 1 25 ∧ (A i).card = 5) ∧ (∀ i j, i ≠ j → (A i ∩ A j).card ≤ 3)} 1698 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-258946,"Prove that the number of subsets $P_0 \subseteq P$, where $P$ is the set of all prime numbers and $P_0$ is a $*-$set (i.e., for any $a, b \in P_0$, the integer $ab + 4$ also belongs to $P_0$), is equal to \(1\).","import Mathlib theorem Prove : {P0 : Set ℕ | P0 ⊆ {p | p.Prime} ∧ ∀ a ∈ P0, ∀ b ∈ P0, a * b + 4 ∈ P0}.encard = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-259121,"Prove that for $\alpha \in (0,1)$, there exists $x \in (0,1)$ such that $\alpha^n < \{nx\}$ for all $n \in \mathbb{N}$.","import Mathlib theorem Prove : ∀ α ∈ Set.Ioo 0 1, ∃ x ∈ Set.Ioo 0 1, ∀ n : ℕ, α ^ n < (n * x) % 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-259178,"Let \(a = \cos{\frac{\pi}{2n+1}} + i\sin{\frac{\pi}{2n+1}}\). Prove that $$\sum_{r=1}^{2n}\binom{2n+1}{r}\frac{a^{2r}(a^{2nr}-1)}{a^{2r}-1} = 1 - 4^n.$$","import Mathlib open Finset Real Nat theorem prove (n : ℕ) (a : ℂ) (ha : a = Complex.exp (I * π / (2 * n + 1))) : ∑ r ∈ Icc 1 (2 * n), Nat.choose (2 * n + 1) r * (a ^ (2 * r) * (a ^ (2 * n * r) - 1)) / (a ^ (2 * r) - 1) = 1 - 4 ^ n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-259238,"Prove that for any coloring of the natural numbers using two colors (red and blue), there exist three natural numbers \(a\), \(b\), and \(c\) of the same color such that \(a = \frac{b}{2} + \frac{c}{2}\).","import Mathlib theorem prove (f : ℕ → Fin 2) : ∃ a b c, f a = f b ∧ f b = f c ∧ a = (b / 2 : ℚ) + (c / 2 : ℚ) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-259265,"Prove that there does not exist a countable subset \(A \subset \mathbb{R}\) such that for all \(x \in \mathbb{R}\), the intersection \((x + A) \cap A\) is non - empty.","import Mathlib theorem no_countable_A : ¬∃ (A : Set ℝ), Countable A ∧ ∀ x : ℝ, ∃ y ∈ A, (x + y) ∈ A := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-259999,"Let \(f\) and \(g\) be functions defined on the set of integers with values in the same set, such that for all integers \(n\), \(|f(n + 2)-f(n)| \leq 2\), and for all integers \(x\) and \(y\), \(f(x)+f(y)=g(x^{2}+y^{2})\). Define the set \(M=\{f(n)\mid n\in\mathbb{Z}^+\}\). Prove that the maximum number of elements that the set \(M\) can have is \(6\).","import Mathlib theorem SetMax {f g : ℤ → ℤ} (hf : ∀ n, |f (n + 2) - f n| ≤ 2) (hg : ∀ x y, f x + f y = g (x ^ 2 + y ^ 2)) : Set.ncard {x | ∃ n, x = f n ∧ n > 0} ≤ 6 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-260086,"Prove that the maximum possible value of a positive integer \(n\) for which there exists a sequence of \(4n\) complex numbers \(a_1, a_2, \ldots, a_{4n}\) satisfying the following conditions is \(4\): 1. For each \(j\), \(a_j \in \{1, -1, i, -i\}\), where \(i = \sqrt{-1}\). 2. For each \(k = 1, 2, \ldots, 4n\), the real and imaginary parts of the sum \(\sum_{j=1}^k a_j\) lie in the interval \([0, 3]\). 3. For any \(1 \leq j < k < 4n\), the sum \(\sum_{i=j}^k a_i \neq 0\).","import Mathlib open Finset Real Complex Polynomial theorem max_n : IsGreatest { n > 0 | ∃ a : ℕ → ℂ, (∀ j ∈ Icc 1 (4 * n), a j = 1 ∨ a j = -1 ∨ a j = Complex.I ∨ a j = -Complex.I) ∧ (∀ k ∈ Icc 1 (4 * n), 0 ≤ (Finset.sum (Icc 1 k) fun i => (a i).re) ∧ (Finset.sum (Icc 1 k) fun i => (a i).re) ≤ 3 ∧ 0 ≤ (Finset.sum (Icc 1 k) fun i => (a i).im) ∧ (Finset.sum (Icc 1 k) fun i => (a i).im) ≤ 3) ∧ ∀ j ∈ Ico 1 (4 * n), ∀ k ∈ Ico 1 (4 * n), j < k → (Finset.sum (Icc j k) fun i => a i) ≠ 0} 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-260106,"Prove that there exists a sequence $(a_n)$ of real numbers such that the set $\{a_n\}$ is finite, for every $k > 1$, the subsequence $(a_{kn})$ is periodic, but the sequence $(a_n)$ is non - periodic.","import Mathlib theorem exists_finiteperiodic_sequence : ∃ a : ℕ → ℝ, Set.Finite (Set.range a) ∧ (∀ k > 1, ∃ c, Function.Periodic (fun n ↦ a (k * n)) c) ∧ ¬∃ c, Function.Periodic a c := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-260165,"Prove that for a prime \(p > 3\) and positive integers \(a, b\), \(\binom{ap}{bp} \equiv \binom{a}{b} \pmod{p^3}\).","import Mathlib theorem Nat.choose_apb (p : ℕ) (hp : Nat.Prime p) (h : 3 < p) (a b : ℕ) (ha : 0 < a) (hb : 0 < b) : Nat.choose (a * p) (b * p) ≡ Nat.choose a b [MOD p ^ 3] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-260298,"a.) Prove that for a positive integer \(a \geq 2\), where \(N_a\) denotes the number of positive integers \(k\) such that the sum of the squares of the digits of \(k\) in base \(a\) representation equals \(k\), \(N_a\) is odd. b.) Prove that for every positive integer \(M\), there exists a positive integer \(a \geq 2\) such that \(N_a \geq M\), where \(N_a\) denotes the number of positive integers \(k\) such that the sum of the squares of the digits of \(k\) in base \(a\) representation equals \(k\).","import Mathlib open Finset theorem a {a : ℕ} (ha : 2 ≤ a) : Odd {k | 0 < k ∧ ∑ i ∈ range (Nat.digits a k).length, (Nat.digits a k)[i]!^2 = k}.ncard := by sorry theorem b {M : ℕ} (hM : 0 < M) : ∃ a : ℕ, 2 ≤ a ∧ {k | 0 < k ∧ ∑ i ∈ range (Nat.digits a k).length, (Nat.digits a k)[i]!^2 = k}.ncard ≥ M := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-260993,Prove that there exists a set \(M\) of distinct integers such that the sum of any two elements of \(M\) divides the sum of all elements of \(M\).,"import Mathlib theorem exists_set : ∃ M : Finset ℤ, (∀ x ∈ M, ∀ y ∈ M, x ≠ y → (x + y) ∣ ∑ m ∈ M, m) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-261516,"Prove that the maximum number of good pairs that can be formed from \(m^2\) distinct positive integers, where each good pair of numbers has a ratio of either \(2\) or \(3\), is \(2m(m - 1)\).","import Mathlib theorem max_good_pairs (m : ℕ) (hm : 0 < m) : IsGreatest {k | ∃ s : Finset ℕ, s.card = m ^ 2 ∧ k = {p : ℕ × ℕ | p.1 ∈ s ∧ p.2 ∈ s ∧ p.1 ≠ 0 ∧ p.2 ≠ 0 ∧ (p.1 / p.2 = 2 ∨ p.1 / p.2 = 3)}.ncard} (2 * m * (m - 1)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-261556,"Let \(n \in \mathbb{N}\). For \(p = 1, 2, \ldots\), define \[A_p(n) = \sum_{0 \le k \le \frac{n}{2}} (-1)^k \left( \binom{n}{k} - \binom{n}{k-1} \right)^p.\] Prove that whenever \(n\) is odd, \(A_2(n) = n A_1(n)\).","import Mathlib open Finset Real Nat theorem OddnA {n : ℕ} (hn : Odd n) : ∑ k ∈ range ((n / 2) + 1), (-1 : ℝ)^k * (n.choose k - n.choose (k - 1))^2 = n * (∑ k ∈ range ((n / 2) + 1), (-1 : ℝ)^k * (n.choose k - n.choose (k - 1))) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-262046,"Let $p = 4k + 1$ be a prime number. Prove that: \[ C_{4k}^{k} \equiv -1 \pmod{p^2} \]","import Mathlib theorem Nat.choose_eq_p (p k : ℕ) [hp : Fact (Nat.Prime p)] (hpk : p = 4 * k + 1) : Nat.choose (4 * k) k ≡ -1 [ZMOD p ^ 2] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-263288,"Prove that for an integer \(n \ge 1\), the sum \(\sum_{\mathclap{\substack{S \subset \{1,2,\ldots,3n\}\\3 \mid f(S)}}} f(S)\), where \(f(S)\) is the sum of the elements of the subset \(S\) of \(\{1, 2, \ldots, 3n\}\) with \(f(\emptyset)=0\), is equal to \(n(3n + 1)(2^{3n-2}+2^{n - 1})\).","import Mathlib open Finset theorem prove (n : ℕ) (hn : 1 ≤ n) : ∑ S ∈ (Icc 1 (3 * n)).powerset.filter (fun x => 3 ∣ ∑ i ∈ x, i), ∑ i ∈ S, i = n * (3 * n + 1) * (2 ^ (3 * n - 2) + 2 ^ (n - 1)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-263359,"Let \(n > 2\) be an integer. Prove that there is exactly one way to color exactly \(n + 1\) of the numbers \(1, 2, \ldots, 2n-1, 2n\) in red such that there do not exist three distinct red integers \(x, y, z\) satisfying \(x + y = z\).","import Mathlib theorem color_set (n : ℕ) (hn : n > 2) : ∃! s : Finset ℕ, s ⊆ Finset.Icc 1 (2 * n) ∧ s.card = n + 1 ∧ ∀ x ∈ s, ∀ y ∈ s, ∀ z ∈ s, x ≠ y ∧ y ≠ z ∧ z ≠ x → x + y ≠ z := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-263861,"1. **Part (a)** - The user's problem is not initially in a formal proof - problem format. The final conclusion for part (a) from the assistant's answer is \(\boxed{No}\). - The formal math proof statement is: Prove that there do not exist two integer - valued functions \(f\) and \(g\) such that for every integer \(x\), \(f(f(x)) = x\), \(g(g(x)) = x\), \(f(g(x))>x\), and \(g(f(x))>x\). 2. **Part (b)** - The user's problem is not initially in a formal proof - problem format. The final conclusion for part (b) from the assistant's answer is \(\boxed{Yes}\). - The formal math proof statement is: Prove that there exist two integer - valued functions \(f\) and \(g\) such that for every integer \(x\), \(f(f(x)) < x\), \(g(g(x)) < x\), \(f(g(x))>x\), and \(g(f(x))>x\).","import Mathlib theorem a : ¬∃ f g : ℤ → ℤ, ∀ x, f (f x) = x ∧ g (g x) = x ∧ f (g x) > x ∧ g (f x) > x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-264190,"Let \(n > 1\) be an integer, and let \(X = \{1, 2, \cdots, n^2\}\). Consider a subset \(A \subseteq X\) such that \(|A| = n\). Prove that the set difference \(X \setminus A\) contains an arithmetic progression with \(n\) terms.","import Mathlib theorem prove_progression (n : ℕ) (hn : 1 < n) (X : Finset ℕ) (hX : X = Finset.Icc 1 (n ^ 2)) (A : Finset ℕ) (hA : A ⊆ X) (hA' : A.card = n) : ∃ d, ∃ k, ∀ i ∈ Finset.range n, (k + d * i) ∈ X \ A := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-264295,"Prove that for any positive integer \(n\), there exists an \(n \times n\) square in the plane such that all lattice points within this square are blocked, where a lattice point \((x, y) \in \mathbb{Z}^2\) is said to be blocked if \(\gcd(x, y) > 1\).","import Mathlib open Finset theorem prove (n : ℕ) (hn : 0 < n) : ∃ x y : ℤ, ∀ i j : ℕ, i ∈ Icc 1 n → j ∈ Icc 1 n → Int.gcd (x + i - 1) (y + j - 1) > 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-264344,"Prove that the greatest possible value of \(n\) such that any four - element set \(\{a,b,c,d\}\) of positive integers with \(a\leq n\), \(b\leq n\), \(c\leq n\), and \(d\leq n\) is good (where a four - element set \(\{a, b, c, d\}\) of positive integers is called good if there exist two elements such that their product is a multiple of the greatest common divisor (gcd) of the remaining two elements) is \(n = 230\).","import Mathlib def isGood (s : Finset ℕ) : Prop := s.card = 4 ∧ ∃ a ∈ s, ∃ b ∈ s, ∃ c ∈ s, ∃ d ∈ s, a * b ≡ 0 [ZMOD Nat.gcd c d] ∨ a * c ≡ 0 [ZMOD Nat.gcd b d] ∨ a * d ≡ 0 [ZMOD Nat.gcd b c] ∨ b * c ≡ 0 [ZMOD Nat.gcd a d] ∨ b * d ≡ 0 [ZMOD Nat.gcd a c] ∨ c * d ≡ 0 [ZMOD Nat.gcd a b] theorem max_n : IsGreatest {n | ∀ s : Finset ℕ, s ⊆ Finset.Icc 1 n → isGood s} 230 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-264610,"Let $n \geq 3$ be a positive integer and $p$ be a prime number such that $p > 6^{n-1} - 2^n + 1$. Let $S$ be a set of $n$ positive integers, each with a distinct residue modulo $p$. Prove that there exists a positive integer $c$ such that there are exactly two ordered triples $(x, y, z) \in S^3$ with distinct elements, for which $x - y + z - c$ is divisible by $p$.","import Mathlib theorem Qwen (n : ℕ) (hn : 3 ≤ n) (p : ℕ) (hp : Nat.Prime p) (h : p > 6^(n - 1) - 2^n + 1) (S : Finset ℕ) (hS : S.card = n) (hS1 : ∀ x ∈ S, 0 < x) (hS2 : ∀ x ∈ S, ∀ y ∈ S, x ≠ y → x % p ≠ y % p) : ∃ c : ℕ, 0 < c ∧ {t : Fin 3 → ℕ | t 0 ∈ S ∧ t 1 ∈ S ∧ t 2 ∈ S ∧ t 0 ≠ t 1 ∧ t 0 ≠ t 2 ∧ t 1 ≠ t 2 ∧ p ∣ t 0 - t 1 + t 2 - c}.encard = 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-265057,"Let \(n \geq 100\) be an integer. Ivan writes the numbers \(n, n + 1, \ldots, 2n\) on distinct cards. He shuffles these \(n + 1\) cards and divides them into two piles. Prove that at least one of the piles contains two cards such that the sum of their numbers is a perfect square.","import Mathlib theorem card_shuffle (n : ℕ) (hn : 100 ≤ n) (p1 p2 : Finset ℕ) (h₀ : p1 ∪ p2 = Finset.Icc n (2 * n)) (h₁ : p1 ∩ p2 = ∅) : ∃ x ∈ p1, ∃ y ∈ p1, x ≠ y ∧ IsSquare (x + y) ∨ ∃ x ∈ p2, ∃ y ∈ p2, x ≠ y ∧ IsSquare (x + y) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-266020,"Prove that the possible values of \(n\) for which it is possible to place \(n\) points in the plane such that each point has exactly 3 neighboring points, each at a distance of \(d = 1\), are \(n = 2p\) where \(p\) is an integer and \(p \geq 3\).","import Mathlib theorem prove (n : ℕ) : (∃ p : ℤ, p ≥ 3 ∧ n = 2 * p) ↔ ∃ s : Finset (EuclideanSpace ℝ (Fin 2)), s.card = n ∧ ∀ x ∈ s, {y | y ∈ s ∧ dist x y = 1}.encard = 3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-266391,"Prove that the only integer solutions \((m, n)\) to the equation \(1997^{1001}(m^2 - 1)-(2m - 5)=3\binom{2003^{2004}}{n}\) are \((m, n)=(1, 0)\) or \((m, n)=(1, 2003^{2004})\).","import Mathlib theorem algebra_398617 (m n : ℕ) : 1997^1001 * (m^2 - 1) - (2 * m - 5) = 3 * Nat.choose (2003^2004) n ↔ (m = 1 ∧ n = 0) ∨ (m = 1 ∧ n = 2003^2004) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-266590,"Let $S$ be a set of integers (not necessarily positive) satisfying the following conditions: 1. There exist $a, b \in S$ such that $\gcd(a, b) = \gcd(a - 2, b - 2) = 1$. 2. For any $x, y \in S$ (where $x$ and $y$ may be equal), the expression $x^2 - y$ also belongs to $S$. Prove that $S = \mathbb{Z}$.","import Mathlib theorem Qwen {S : Set ℤ} (h1 : ∃ a ∈ S, ∃ b ∈ S, Int.gcd a b = 1 ∧ Int.gcd (a - 2) (b - 2) = 1) (h2 : ∀ x ∈ S, ∀ y ∈ S, x ^ 2 - y ∈ S) : S = ⊤ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-266800,"Let \(a_{1}, a_{2}, \ldots, a_{2n+1} \in \mathbb{R}\) and \(n \in \mathbb{N}^{*}\). Suppose that for every \(1 \leq i \leq 2n+1\), there exist two sets \(G_{1}\) and \(G_{2}\) such that \(\{1, 2, \ldots, i - 1, i+1, \ldots, 2n+1\} = G_{1} \cup G_{2}\), \(G_{1} \cap G_{2} = \varnothing\), \(|G_{1}| = |G_{2}|\), and \(\sum_{j \in G_{1}} a_{j} = \sum_{j \in G_{2}} a_{j}\). Prove that \(a_{1} = a_{2} = \cdots = a_{2n+1}\).","import Mathlib theorem Qwen {n : ℕ} (hn : n > 0) (a : Fin (2 * n + 1) → ℝ) (h : ∀ i : Fin (2 * n + 1), ∃ G1 G2 : Finset (Fin (2 * n + 1)), {x | x ≠ i} = G1 ∪ G2 ∧ G1 ∩ G2 = ∅ ∧ G1.card = G2.card ∧ ∑ j ∈ G1, a j = ∑ j ∈ G2, a j) : ∃ x, ∀ i : Fin (2 * n + 1), a i = x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-267094,"Let \(x_{1}, x_{2}, \dots, x_{n} \in \mathbb{R}\) be distinct real numbers. Prove that there exist values \(f(x_{1}), f(x_{2}), \dots, f(x_{n})\) such that \(f(x_{i}) \in \{\lfloor x_{i} \rfloor, \lceil x_{i} \rceil\}\) for each \(i = 1, 2, \dots, n\), and for every subset \(S \subseteq \{1, 2, \dots, n\}\), the following inequality holds: \[ \left| \sum_{\sigma \in S} f(x_\sigma) - \sum_{\sigma \in S} x_\sigma \right| \leq \frac{n+1}{4} \]","import Mathlib theorem RealFunction (n : ℕ) (hn : 0 < n) (x : Fin n → ℝ) (hx : ∀ i j, x i = x j → i = j) : ∃ f : Fin n → ℤ, (∀ i, f i = ⌊x i⌋ ∨ f i = ⌈x i⌉) ∧ (∀ S : Finset (Fin n), |∑ σ ∈ S, f σ - ∑ σ ∈ S, x σ| ≤ (n + 1) / 4) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-267230,"Prove that the number of elements in the set \(K(2004,2004)\), where \(K(n,0)=\varnothing\) and \(K(n,m + 1)=\left\{k\mid 1\leq k\leq n\text{ and }K(k,m)\cap K(n - k,m)=\varnothing\right\}\) for all non - negative integers \(m\) and \(n\), is \(2^7-1 = 127\).","import Mathlib def K : ℕ → ℕ → Set ℕ | n, 0 => ∅ | n, m + 1 => {k | 1 ≤ k ∧ k ≤ n ∧ (K k m).inter (K (n - k) m) = ∅} theorem number_of_elements : (K 2004 2004).encard = 127 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-267294,"Prove that the only finite sets \(M \subset \mathbb{R}\) with \(|M| \geq 2\) such that for all \(a, b \in M\) with \(a \neq b\), the number \(a^3 - \frac{4}{9}b\) also belongs to \(M\) are the sets \(\left\{-\frac{\sqrt{5}}{3}, \frac{\sqrt{5}}{3}\right\}\), \(\left\{\frac{1 - \sqrt{17}}{6}, \frac{1 + \sqrt{17}}{6}\right\}\), and \(\left\{\frac{-1 - \sqrt{17}}{6}, \frac{-1 + \sqrt{17}}{6}\right\}\).","import Mathlib theorem FiniteSets (M : Finset ℝ) (hM : M.card ≥ 2) (hM' : ∀ a ∈ M, ∀ b ∈ M, a ≠ b → a^3 - 4/9 * b ∈ M) : M = {-Real.sqrt 5/3, Real.sqrt 5/3} ∨ M = {(1 - Real.sqrt 17)/6, (1 + Real.sqrt 17)/6} ∨ M = {(-1 - Real.sqrt 17)/6, (-1 + Real.sqrt 17)/6} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-267431,Prove that there exists a bijection $f : \mathbb{Z}_n \times \mathbb{Z}_m \to \mathbb{Z}_n \times \mathbb{Z}_m$ such that the function $g : \mathbb{Z}_n \times \mathbb{Z}_m \to \mathbb{Z}_n \times \mathbb{Z}_m$ defined by $g(x) = x + f(x)$ is also a bijection if and only if both $n$ and $m$ are odd or both $n$ and $m$ are even.,"import Mathlib open Finset theorem Prove {n m : ℕ} (hn : 0 < n) (hm : 0 < m) : ∃ f : (ZMod n × ZMod m) → (ZMod n × ZMod m), Function.Bijective f ∧ Function.Bijective (fun x => x + f x) ↔ Odd n ∧ Odd m ∨ Even n ∧ Even m := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-267483,"Let $\langle a_1, a_2, a_3, \ldots \rangle$ be an infinite sequence of non - negative integers. A sequence is defined as [i]good[/i] if it satisfies the conditions $a_i \ge a_{i + 1}$ for all $i \ge 1$ and there exists a $j \ge 1$ such that $a_j = 0$. A good sequence $\langle a_1, a_2, a_3, \ldots \rangle$ is said to [i]dominate[/i] another good sequence $\langle b_1, b_2, b_3, \ldots \rangle$ if $a_i \ge b_i$ for all $i \ge 1$. Consider a set $X$ of good sequences such that no sequence $S \in X$ dominates any other sequence $T \in X$ with $S \ne T$. Prove that the set $X$ must be finite.","import Mathlib def isGood (a : ℕ → ℕ) : Prop := (∀ i, a i ≥ a (i + 1)) ∧ ∃ j, a j = 0 theorem SetFinite {X : Set (ℕ → ℕ)} (hX : ∀ a ∈ X, isGood a) (hX' : ∀ S ∈ X, ∀ T ∈ X, S ≠ T → ¬(∀ i, S i ≥ T i)) : Finite X := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-267669,"1. First, note that the user's problem is already a formal math - proof problem. 2. So, we return the user's problem as the final proof statement: Prove that if $M$ is a subset of $13$ elements of the symmetric group $S_4$ (the group of all permutations of four elements), then each element of $S_4$ can be written as the product of two elements of $M$.","import Mathlib open Fintype Set Real Ideal Polynomial open scoped BigOperators theorem prove_symmetric_group {M : Finset (Fin 4 → Fin 4)} (hM : M.card = 13) : ∀ x : Fin 4 → Fin 4, ∃ a ∈ M, ∃ b ∈ M, x = a * b := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-267808,"Show that for any positive integer \(m\), any infinite subset of \(\mathbb{N}^m\) contains two elements \((x_1, \ldots, x_m)\) and \((y_1, \ldots, y_m)\) such that \(x_i \le y_i\) for all \(i = 1, \ldots, m\).","import Mathlib theorem InfiniteSetM (m : ℕ) (hm : 0 < m) (S : Set (Fin m → ℕ)) (hS : Infinite S) : ∃ x ∈ S, ∃ y ∈ S, ∀ i : Fin m, (x i ≤ y i) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-267886,"Prove that if there are $1978$ sets, each of size $40$, such that the size of the intersection of any two sets is exactly $1$, then all the sets have a common element.","import Mathlib theorem prove_common_element (s : Finset (Finset ℕ)) (h₀ : s.card = 1978) (h₁ : ∀ t ∈ s, t.card = 40) (h₂ : ∀ x ∈ s, ∀ y ∈ s, x ≠ y → (x ∩ y).card = 1) : ∃ n, ∀ t ∈ s, n ∈ t := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-267922,"Let $\langle a_1, a_2, a_3, \ldots \rangle$ be an infinite sequence of non - negative integers. A sequence is defined as [i]good[/i] if it satisfies the conditions $a_i \ge a_{i + 1}$ for all $i \ge 1$ and there exists a $j \ge 1$ such that $a_j = 0$. A good sequence $\langle a_1, a_2, a_3, \ldots \rangle$ is said to [i]dominate[/i] another good sequence $\langle b_1, b_2, b_3, \ldots \rangle$ if $a_i \ge b_i$ for all $i \ge 1$. Prove that: Given a set $X$ of good sequences such that no sequence $S \in X$ dominates any other sequence $T \in X$ with $S \ne T$, the set $X$ must be finite.","import Mathlib open scoped BigOperators theorem FiniteGoodSet (X : Set (ℕ → ℕ)) (hX : ∀ a ∈ X, ∀ i, a i ≥ a (i + 1)) (hX' : ∀ a ∈ X, ∃ j, a j = 0) (hX'' : ∀ S ∈ X, ∀ T ∈ X, S ≠ T → ¬(∀ i, S i ≥ T i)) : Finite X := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-268085,"Let $S$ be a set of integers (not necessarily positive) satisfying the following conditions: 1. There exist $a, b \in S$ such that $\gcd(a, b) = \gcd(a - 2, b - 2) = 1$. 2. For any $x, y \in S$ (where $x$ and $y$ may be equal), the expression $x^2 - y$ is also an element of $S$. Prove that $S = \mathbb{Z}$.","import Mathlib theorem Qwen {S : Set ℤ} (hS1 : ∃ a b : ℤ, a ∈ S ∧ b ∈ S ∧ Int.gcd a b = 1 ∧ Int.gcd (a - 2) (b - 2) = 1) (hS2 : ∀ x y : ℤ, x ∈ S → y ∈ S → x ^ 2 - y ∈ S) : S = ⊤ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-268339,"1. **First part**: - The user's problem already starts with “Prove that”, so the formal math - proof statement for the first part is: - Let \(f: \mathbb{R} \to \mathbb{R}\) be a function such that \(f(x) \in \mathbb{Q}\) if and only if \(f(x + 1) \notin \mathbb{Q}\). Prove that \(f\) must have at least one point of discontinuity. 2. **Second part**: - The final conclusion from the assistant's answer for the second part is that the statement remains true for any countable dense subset of \(\mathbb{R}\). - The formal math - proof statement for the second part is: - Let \(D\) be an arbitrary countable dense subset of \(\mathbb{R}\), and let \(f: \mathbb{R} \to \mathbb{R}\) be a function such that \(f(x) \in D\) if and only if \(f(x + 1) \notin D\). Prove that \(f\) must have at least one point of discontinuity.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove_first_part {f : ℝ → ℝ} (h : ∀ x, ∃ q : ℚ, f x = q ↔ ¬∃ q : ℚ, f (x + 1) = q) : ∃ x, ¬ ContinuousAt f x := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-268490,"Prove that if $m, n \geq 1$ are two coprime integers and $s$ is an arbitrary integer, then the number of subsets $A$ of $\{1, 2, \ldots, m + n - 1\}$ such that $|A| = m$ and $\sum_{x \in A} x \equiv s \pmod{n}$ is $\frac{1}{n} \binom{m + n - 1}{m}$.","import Mathlib theorem prove (m n : ℕ) (hm : 1 ≤ m) (hn : 1 ≤ n) (hcoprime : Nat.Coprime m n) (s : ℤ) : {A : Finset ℕ | A ⊆ Finset.Icc 1 (m + n - 1) ∧ A.card = m ∧ ∑ x ∈ A, x ≡ s [ZMOD n]}.ncard = Nat.choose (m + n - 1) m / n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-268705,"Prove that there exist subsets $A$ and $B$ of $\mathbb{R}$ such that $\mu(A) = \mu(B) = 0$, where $\mu$ denotes the Lebesgue measure, and $\mu \left( \{a + b: a \in A, b \in B\} \right) > 0$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem exists_Lebesgue_mu_A_and_B : ∃ A B : Set ℝ, (MeasureTheory.volume A).toReal = 0 ∧ (MeasureTheory.volume B).toReal = 0 ∧ (MeasureTheory.volume {c | ∃ a ∈ A, ∃ b ∈ B, c = a + b}).toReal > 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-268862,"Prove that the number of pairs $(\alpha, \beta)$ of real numbers such that for the sequences $\{a_n\}_{n = 1}^{\infty}$ and $\{b_n\}_{n = 1}^{\infty}$ defined by $a_1=\alpha$, $b_1 = \beta$, and the recurrence relations $a_{n + 1}=\alpha a_n-\beta b_n$ and $b_{n+1}=\beta a_n+\alpha b_n$ for all $n\geq1$, we have $a_{1997}=b_1$ and $b_{1997}=a_1$, is $1999$.","import Mathlib theorem number_of_pairs : Set.ncard {p : ℝ × ℝ | ∃ α β : ℝ, p = (α, β) ∧ ∃ a b : ℕ → ℝ, a 1 = α ∧ b 1 = β ∧ ∀ n ≥ 1, a (n + 1) = α * a n - β * b n ∧ b (n + 1) = β * a n + α * b n ∧ a 1997 = b 1 ∧ b 1997 = a 1} = 1999 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-269182,"For a permutation $\sigma \in S_n$ defined by $(1,2,\dots,n) \mapsto (i_1,i_2,\dots,i_n)$, let \[ D(\sigma) = \sum_{k=1}^n |i_k - k|. \] Define \[ Q(n,d) = \left| \left\{ \sigma \in S_n : D(\sigma) = d \right\} \right|. \] Prove that for $d \geq 2n$, $Q(n,d)$ is an even number.","import Mathlib open Finset theorem EvenQ {n d : ℕ} (hn : 0 < n) (hd : d ≥ 2 * n) : Even {σ : Equiv.Perm (Fin n) | ∑ i : Fin n, |(σ i).val - (i : ℤ)| = d}.ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-269237,"For a finite set $X$ of positive integers, let $\Sigma(X) = \sum_{x \in X} \arctan \frac{1}{x}$. Given a finite set $S$ of positive integers such that $\Sigma(S) < \frac{\pi}{2}$, prove that there exists a finite set $T$ of positive integers for which $S \subset T$ and $\Sigma(T) = \frac{\pi}{2}$.","import Mathlib open Finset Real theorem sumOfArctan (S : Finset ℕ) (hS : ∀ x ∈ S, x > 0) (hS1 : ∑ x ∈ S, arctan (1 / x) < π / 2) : ∃ T : Finset ℕ, (∀ t ∈ T, t > 0) ∧ S ⊆ T ∧ ∑ t ∈ T, arctan (1 / t) = π / 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-269464,"Prove that the greatest positive integer \(k\) such that there exist \(k\) subsets \(A_1, A_2, \ldots, A_k\) of the set \(E=\{1,2,\ldots,n\}\) with the property that for all \(i \neq j\), \(A_i\) is not a subset of \(A_j\) is \(\binom{n}{\left\lfloor \frac{n}{2} \right\rfloor}\).","import Mathlib open Finset Real Nat theorem kIsGreatest {n : ℕ} (hn : 0 < n) : IsGreatest {k | ∃ A : Fin k → Set ℕ, (∀ i j, i ≠ j → ¬(A i ⊆ A j)) ∧ (∀ i, A i ⊆ Icc 1 n)} (Nat.choose n (Nat.floor (n / 2))) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-269478,"Let $S = \{x_1, x_2, \ldots, x_{k + l}\}$ be a $(k + l)$-element set of real numbers contained in the interval $[0, 1]$, where $k$ and $l$ are positive integers. A $k$-element subset $A \subset S$ is called [i]nice[/i] if \[ \left| \frac{1}{k} \sum_{x_i \in A} x_i - \frac{1}{l} \sum_{x_j \in S \setminus A} x_j \right| \le \frac{k + l}{2kl}. \] Prove that the number of nice subsets is at least $\frac{2}{k + l} \binom{k + l}{k}$.","import Mathlib open Finset Real Nat theorem proveNice (k l : ℕ) (hk : 0 < k) (hl : 0 < l) (S : Finset ℝ) (hS : S.card = k + l) (hS1 : ∀ x ∈ S, x ∈ Set.Icc 0 1) : {A | A ⊆ S ∧ A.card = k ∧ |(1 / k) * ∑ x ∈ A, x - (1 / l) * ∑ x ∈ S \ A, x| ≤ (k + l) / (2 * k * l)}.ncard ≥ 2 / (k + l) * Nat.choose (k + l) k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-270035,"Let \(A_n = \sum_{k=0}^{\left\lfloor \frac{n}{2} \right\rfloor} \binom{n-k}{k} 6^k\). Prove that if \(p\) is a prime number greater than 5, then \(p \mid A_{p - 2}\).","import Mathlib open Finset theorem q6513 {A : ℕ → ℕ} (hA : ∀ n, A n = ∑ k ∈ range ((n / 2) + 1), Nat.choose (n - k) k * 6 ^ k) : ∀ p, Nat.Prime p → p > 5 → p ∣ A (p - 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-270088,"Prove that the largest integer \(m\) such that there exists an \(m\) - element subset \(A\) of \(\{1, 2, 3, \ldots, 2^k\}\) that does not contain any power of 2 and no two elements of \(A\) sum to a power of 2 is \(2^{k - 1}-1\).","import Mathlib theorem prove (k : ℕ) : IsGreatest {m | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 (2 ^ k) ∧ A.card = m ∧ ∀ x ∈ A, ¬∃ n, 2 ^ n = x ∧ ∀ x ∈ A, ∀ y ∈ A, x ≠ y → ¬∃ n, 2 ^ n = x + y} (2 ^ (k - 1) - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-270841,"Given \(n\) points on the plane, prove that the number of pairs of points whose distance is exactly \(1\) does not exceed \(\dfrac{n}{4} + \dfrac{\sqrt{2}}{2}n^{\frac{3}{2}}\).","import Mathlib theorem dist_pair (n : ℕ) (hn : 0 < n) (a : Fin n → EuclideanSpace ℝ (Fin 2)) : {(p, q) : Fin n × Fin n | p ≠ q ∧ dist (a p) (a q) = 1}.ncard ≤ n / 4 + Real.sqrt 2 / 2 * n ^ ((3 : ℝ) / 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-271070,"Let $z_1, z_2, \ldots, z_n$ be complex numbers. Prove that there exists a subset $S$ of $\{1, 2, \ldots, n\}$ such that $\left|\sum_{j \in S} z_j\right| \geq \frac{1}{\pi} \sum_{j=1}^{n} |z_j|$.","import Mathlib open Finset Real Complex Polynomial theorem sum_of_zs (n : ℕ) (f : Fin n → ℂ) : ∃ t : Finset (Fin n), ‖∑ i ∈ t, f i‖ ≥ (1 / Real.pi) * ∑ i : Fin n, ‖f i‖ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-271850,"Prove that there exists a function $f: \mathbb{R} \to \mathbb{R}$ such that for every interval $(a, b) \subset \mathbb{R}$, the function $f$ takes on all non-zero real values.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem exists_function : ∃ f : ℝ → ℝ, ∀ a b, a < b → ∀ y : ℝ, y ≠ 0 → ∃ x, a < x ∧ x < b ∧ f x = y := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-272164,"Prove that there exists an infinite subset $S$ of the set $\left\{2^k - 3 \mid k \in \mathbb{N}\right\}$ such that for any two distinct elements $2^m - 3$ and $2^n - 3$ in $S$, the greatest common divisor $\gcd(2^m - 3, 2^n - 3) = 1$.","import Mathlib theorem algebra_547686 : ∃ S : Set ℕ, Infinite S ∧ (∀ x ∈ S, ∃ k : ℕ, x = 2 ^ k - 3) ∧ (∀ m n : ℕ, m ≠ n → (2 ^ m - 3) ∈ S → (2 ^ n - 3) ∈ S → Nat.gcd (2 ^ m - 3) (2 ^ n - 3) = 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-272278,"Prove that the pairs of natural numbers $(n, k)$ with $k > 1$ such that $k$ divides each of the binomial coefficients $C(n, 1), C(n, 2), \ldots, C(n, n - 1)$ are of the form $(p^m, p)$, where $p$ is a prime number and $m$ is a positive integer.","import Mathlib theorem Nat.choose_p (n k : ℕ) (h₀ : 0 < n) (h₁ : 1 < k) (h₂ : ∀ i ∈ Finset.Icc 1 (n - 1), k ∣ Nat.choose n i) : ∃ p m, Nat.Prime p ∧ m > 0 ∧ (n, k) = (p ^ m, p) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-272443,"Given a \(2000\times2000\) board where each unit square contains either \(1\) or \(-1\), and the sum of all numbers on the board is non - negative, prove that there exist \(1000\) columns and \(1000\) rows such that the sum of the numbers in the \(1000^2\) unit squares at their intersections is at least \(1000\).","import Mathlib theorem b202368 (a : Fin 2000 → Fin 2000 → ℤ) (h₀ : ∀ i j, a i j = 1 ∨ a i j = -1) (h₁ : ∑ i, ∑ j, a i j ≥ 0) : ∃ s₁ s₂ : Finset (Fin 2000), s₁.card = 1000 ∧ s₂.card = 1000 ∧ ∑ i ∈ s₁, ∑ j ∈ s₂, a i j ≥ 1000 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-272452,"Let \(n\) be a positive integer, \(P=\{p_1,p_2,\ldots,p_n\}\) be a set of \(n\) primes, and \(M = \{a_1,a_2,\ldots,a_{n + 1}\}\) be a set of at least \(n+1\) natural numbers, each of which is divisible by no primes other than those belonging to \(P\). Prove that there exists a non - empty subset \(\{a_{i_1},a_{i_2},\ldots,a_{i_r}\}\subseteq M\) such that the product \(\prod_{m = 1}^{r}a_{i_m}\) is a perfect square.","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (P : Finset ℕ) (hP : P.card = n ∧ ∀ p ∈ P, Nat.Prime p) (M : Finset ℕ) (hM : M.card ≥ n + 1 ∧ ∀ m ∈ M, ∀ p ∈ Nat.primeFactors m, p ∈ P) : ∃ i : Finset ℕ, i ⊆ M ∧ i ≠ ∅ ∧ IsSquare (∏ m ∈ i, m) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-272520,"Prove that for complex numbers \(z_1, z_2, \ldots, z_n\), there exists a subset \(J \subset \{1, 2, \ldots, n\}\) such that \(\left|\sum_{j \in J} z_j\right| \geq \frac{1}{4\sqrt{2}} \left|\sum_{1 \leq i \leq n} z_i\right|\).","import Mathlib open Finset Complex Polynomial theorem prove (n : ℕ) (hn : 0 < n) (f : ℕ → ℂ) : ∃ J : Finset ℕ, J ⊆ Icc 1 n ∧ ‖∑ j ∈ J, f j‖ ≥ (1 / (4 * Real.sqrt 2)) * ‖∑ i ∈ Icc 1 n, f i‖ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-273204,"Prove that if $X$ is a set with $1983$ elements and $\{S_1, S_2, \ldots, S_k\}$ is a family of subsets of $X$ such that the union of any three of these subsets is the entire set $X$ and the union of any two of these subsets contains at most $1979$ elements, then the largest possible value of $k$ is $31$.","import Mathlib theorem Prove (X : Finset ℕ) (hX : X.card = 1983) (S : Finset (Finset ℕ)) (hS : ∀ T ∈ S, T ⊆ X) (hS1 : ∀ T ∈ S, ∀ U ∈ S, ∀ V ∈ S, T ≠ U ∧ T ≠ V ∧ U ≠ V → (T ∪ U ∪ V) = X) (hS2 : ∀ T ∈ S, ∀ U ∈ S, T ≠ U → (T ∪ U).card ≤ 1979) : S.card ≤ 31 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-273439,"Prove that the largest possible size of a subset $M$ of $\{1, 2, \ldots, 2008\}$ with the property that for any three elements $x, y, z \in M$ where $x < y < z$, the sum $x + y$ does not divide $z$, is \(1005\).","import Mathlib theorem max_size : IsGreatest {Finset.card M | (M : Finset ℕ) (_ : M ⊆ Finset.Icc 1 2008) (_ : ∀ x ∈ M, ∀ y ∈ M, ∀ z ∈ M, x < y ∧ y < z → ¬(x + y ∣ z))} 1005 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-273756,"Prove that for \(x \geq 0\), \[ \sqrt{x} = 1 - 2 \cdot \sum_{n=1}^{\infty} \binom{2n-2}{n-1} \left( -\frac{1}{4} \right)^n \frac{(x-1)^n}{n} \]","import Mathlib open Real theorem sqrt (x : ℝ) (hx : 0 ≤ x) : sqrt x = 1 - 2 * ∑' n : ℕ, Nat.choose (2 * n - 2) (n - 1) * (-1 / 4 : ℝ) ^ n * ((x - 1) ^ n / n) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-273826,"Prove that if $f: \mathbb{N} \times \mathbb{Z} \rightarrow \mathbb{Z}$ is a function such that $f(0,0) = 1$, $f(0,1) = 1$, $f(0,k) = 0$ for all $k \notin \{0,1\}$, and $f(n,k) = f(n - 1,k)+f(n - 1,k - 2n)$ for all $n\geq1$ and $k$, then $\sum_{k = 0}^{\binom{2009}{2}} f(2008,k)=2^{2008}$.","import Mathlib open Finset theorem prove (f : ℕ → ℤ → ℤ) (h₀ : f 0 0 = 1) (h₁ : f 0 1 = 1) (h₂ : ∀ k, k ≠ 0 → k ≠ 1 → f 0 k = 0) (h₃ : ∀ n ≥ 1, ∀ k, f n k = f (n - 1) k + f (n - 1) (k - 2 * n)) : ∑ k ∈ Icc 0 (Nat.choose 2009 2), f 2008 k = 2 ^ 2008 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-273862,"Prove that if $k$ and $s$ are positive integers, $\{\alpha_1, \alpha_2, \ldots, \alpha_s\}$ and $\{\beta_1, \beta_2, \ldots, \beta_s\}$ are sets of real numbers such that $\sum_{i=1}^s \alpha_i^j = \sum_{i=1}^s \beta_i^j$ for all $j \in \{1, 2, \ldots, k\}$ (denoted as $\{\alpha_1, \alpha_2, \ldots, \alpha_s\} \overset{k}{=} \{\beta_1, \beta_2, \ldots, \beta_s\}$), and $s \leq k$, then there exists a permutation $\pi$ of $\{1, 2, \ldots, s\}$ such that $\beta_i = \alpha_{\pi(i)}$ for all $i \in \{1, 2, \ldots, s\}$.","import Mathlib theorem Finset_eq (k s : ℕ) (α β : Fin s → ℝ) (h₀ : 0 < k) (h₁ : 0 < s) (h₂ : ∀ j ∈ Finset.Icc 1 k, ∑ i : Fin s, (α i)^j = ∑ i : Fin s, (β i)^j) (h₃ : s ≤ k) : ∃ π : Equiv.Perm (Fin s), ∀ i : Fin s, β i = α (π i) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-273941,"Prove that if $p$ is an odd prime and $A = \{ X \subset \{1, 2, \ldots, 10p + 2\} \mid |X| = 2p \text{ and } S(X) \equiv 1 \pmod{p} \}$, where $S(X)$ denotes the sum of the elements in $X$, then $|A| = \frac{\binom{10p + 2}{2p} - 55}{p}$.","import Mathlib theorem prove {p : ℕ} (hp : Odd p ∧ Nat.Prime p) : Set.ncard {X : Finset ℕ | X ⊆ Finset.Icc 1 (10 * p + 2) ∧ X.card = 2 * p ∧ ∑ x ∈ X, x ≡ 1 [MOD p]} = (Nat.choose (10 * p + 2) (2 * p) - 55) / p := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-274071,Let $A$ be an infinite set of positive integers. Prove that there exists a positive real number $x$ such that the integer part of $x^n$ is in $A$ for infinitely many values of $n$.,"import Mathlib theorem RealExist (A : Set ℕ) (hA : Infinite A) (hA1 : ∀ x ∈ A, 0 < x) : ∃ x : ℝ, 0 < x ∧ {n | ∃ m ∈ A, ⌊x ^ n⌋ = m}.Infinite := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-274290,"Let \(a_1, a_2, \ldots, a_n\) be distinct positive integers with \(n \ge 3\). Prove that there exist distinct indices \(i\) and \(j\) such that \(a_i + a_j\) does not divide any of the numbers \(3a_1, 3a_2, \ldots, 3a_n\).","import Mathlib theorem dist_pos_a (n : ℕ) (hn : n ≥ 3) (a : Fin n → ℤ) (ha : ∀ i j, a i = a j → i = j) (ha1 : ∀ i, 0 < a i) : ∃ i j, i ≠ j ∧ ¬∃ k, a i + a j ∣ 3 * a k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-274347,"Prove that if $A$ is a measurable set with positive measure, then the set $A - A = \{x - y : x, y \in A\}$ contains an open neighborhood of $0$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove (A : Set ℝ) (hA : MeasurableSet A) (hA1 : 0 < MeasureTheory.volume A) : ∃ U, IsOpen U ∧ 0 ∈ U ∧ U ⊆ {x | ∃ a b, a ∈ A ∧ b ∈ A ∧ x = a - b} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-274384,"Let $A$ be a measurable set with positive measure. Prove that the set $A - A = \{x - y : x, y \in A\}$ contains an open neighborhood of $0$, i.e., prove that there exists an open set $I'$ such that $I' \subseteq A - A$ and $0\in I'$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MeasureTheory.volume (A : Set ℝ) (hA : 0 < (MeasureTheory.volume A).toReal) (hA_measurable : MeasurableSet A) : ∃ I' : Set ℝ, IsOpen I' ∧ I' ⊆ {x | ∃ a b, x = a - b ∧ a ∈ A ∧ b ∈ A} ∧ 0 ∈ I' := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-274504,"Let $A$ be a set of real numbers with at least four distinct elements. Suppose that for all distinct $a, b, c \in A$, the expression $a^2 + bc$ is a rational number. Prove that there exists a positive integer $M$ such that $a\sqrt{M}$ is a rational number for every $a \in A$.","import Mathlib theorem RealSet {A : Set ℝ} (hA : A.ncard ≥ 4) (hA' : ∀ a ∈ A, ∀ b ∈ A, ∀ c ∈ A, a ≠ b ∧ a ≠ c ∧ b ≠ c → ∃ q : ℚ, a ^ 2 + b * c = q) : ∃ M > 0, ∀ a ∈ A, ∃ q : ℚ, a * Real.sqrt M = q := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-274655,"Prove that for any integer \(n \geq 2\), there exists a set \(A_n\) of \(n\) distinct positive integers such that for any two distinct elements \(i, j \in A_n\), the condition \(|i - j|\) divides \(i^2 + j^2\) holds.","import Mathlib theorem g_447025 (n : ℕ) (hn : 2 ≤ n) : ∃ A : Finset ℕ, A.card = n ∧ ∀ i ∈ A, 0 < i ∧ ∀ i ∈ A, ∀ j ∈ A, i ≠ j → |(i : ℤ) - j| ∣ (i ^ 2 + j ^ 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-274677,"Prove that there does not exist a continuous real - valued function \(f(x)\) defined on the real line such that for every real number \(y\), there exist exactly two distinct real numbers \(x_1\) and \(x_2\) satisfying \(f(x_1)=f(x_2)=y\).","import Mathlib theorem does_notexist : ¬∃ (f : ℝ → ℝ) (_ : Continuous f), ∀ y : ℝ, {x | f x = y}.encard = 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-275063,"Let $S = \{a_1, a_2, \ldots, a_n\}$ be a set of natural numbers such that for any two distinct subsets $A$ and $B$ of $S$, the sums $\sum_{a \in A} a$ and $\sum_{b \in B} b$ are not equal. Prove that: 1. $\sum_{i=1}^n a_i^2 \ge \frac{4^n - 1}{3}$ 2. $\sum_{i=1}^n \frac{1}{a_i} < 2$","import Mathlib theorem qwen {n : ℕ} (hn : 0 < n) (a : Fin n → ℕ) (h : ∀ A B : Finset (Fin n), A ≠ B → ∑ i ∈ A, a i ≠ ∑ i ∈ B, a i) : (∑ i : Fin n, (a i)^2 ≥ (4^n - 1)/3) ∧ (∑ i : Fin n, (1 : ℚ)/(a i) < 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-275159,"Prove that the generating function $\sum_{n \ge 0} s_p(n) x^n$, where $s_p(n)$ denotes the sum of the digits of $n$ when written in base $p$, is equal to $\left. \frac{d}{dy} \left( \prod_{k=0}^{\infty} \frac{(yx^{p^k})^p - 1}{yx^{p^k} - 1} \right) \right|_{y=1}$.","import Mathlib open Real open scoped BigOperators theorem prove {p : ℕ} (hp : p > 0) (s : ℕ → ℝ) (h₀ : ∀ n, s n = (Nat.digits p n).sum) : ∑' n, s n * X ^ n = deriv (λ y => ∏' k : ℕ, ((y * X ^ (p ^ k)) ^ p - 1) / (y * X ^ (p ^ k) - 1)) 1 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-275365,"Let $g$ and $n$ be natural numbers such that $\gcd(g^2 - g, n) = 1$. Define the set $A = \{g^i \mid i \in \mathbb{N}\}$ and the set $B = \{x \equiv n \mid x \in A\}$, where $x \equiv n$ denotes the unique number in the set $\{0, 1, \ldots, n-1\}$ that is congruent to $x$ modulo $n$. For $0 \le i \le g-1$, let $a_i = \left| \left[ \frac{ni}{g}, \frac{n(i+1)}{g} \right) \cap B \right|$. Prove that $g-1 \mid \sum_{i=0}^{g-1} i a_i$.","import Mathlib theorem qwen (g n : ℕ) (h₀ : Nat.gcd (g ^ 2 - g) n = 1) (A B : Set ℕ) (h₁ : A = {x | ∃ i, x = g ^ i}) (h₂ : B = {x | ∃ y ∈ A, x = y % n}) (a : ℕ → ℕ) (ha : ∀ i ∈ Finset.Icc 0 (g - 1), a i = {x | x ∈ B ∧ n * i / g ≤ x ∧ x < n * (i + 1) / g}.ncard) : g - 1 ∣ ∑ i ∈ Finset.Icc 0 (g - 1), i * a i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-275457,"Let $m > 1$ be an integer. A set $T \subseteq \{0, 1, 2, \ldots, 4m-1\}$ is called 'strange' if for any $x \in \{0, 1, 2, \ldots, m-1\}$, the following conditions are satisfied: 1. The set $T \cap \{4x-2, 4x-1, 4x, 4x+1, 4x+2\}$ has at most two elements. 2. The set $T \cap \{4x+1, 4x+2, 4x+3\}$ has at most one element. Prove that the number of strange subsets is exactly \(8 \cdot 7^{m - 1}\).","import Mathlib def is_strange (T : Finset ℕ) (m : ℕ) := T ⊆ Finset.Icc 0 (4 * m - 1) ∧ ∀ x ∈ Finset.Icc 0 (m - 1), {y | y ∈ T ∧ y = 4 * x - 2 ∨ y = 4 * x - 1 ∨ y = 4 * x ∨ y = 4 * x + 1 ∨ y = 4 * x + 2}.encard ≤ 2 ∧ {y | y ∈ T ∧ y = 4 * x + 1 ∨ y = 4 * x + 2 ∨ y = 4 * x + 3}.encard ≤ 1 theorem number_of_strange_subset (m : ℕ) (hm : 1 < m) : Set.ncard {T | is_strange T m} = 8 * 7 ^ (m - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-276531,"Prove that there exists a set \(S\) containing 2011 positive integers such that for every pair \(m, n\) of distinct elements of \(S\), the condition \(|m - n| = (m, n)\) holds, where \((m, n)\) denotes the greatest common divisor of \(m\) and \(n\).","import Mathlib theorem exists_set : ∃ S : Finset ℕ, S.card = 2011 ∧ (∀ x ∈ S, x > 0) ∧ (∀ m ∈ S, ∀ n ∈ S, m ≠ n → |(m : ℤ) - n| = Nat.gcd m n) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-276743,"Prove that it is possible to partition the set of natural numbers $\mathbb{N}$ into four distinct sets $A_1, A_2, A_3, A_4$ such that the equation $2x + y - 5z = 0$ has no solutions where $x, y, z$ all belong to the same set $A_i$ for any $i \in \{1, 2, 3, 4\}$.","import Mathlib theorem partitioning_the_set : ∃ A1 A2 A3 A4 : Set ℕ, A1 ∪ A2 ∪ A3 ∪ A4 = NatSet ∧ A1 ∩ A2 = ∅ ∧ A1 ∩ A3 = ∅ ∧ A1 ∩ A4 = ∅ ∧ A2 ∩ A3 = ∅ ∧ A2 ∩ A4 = ∅ ∧ A3 ∩ A4 = ∅ ∧ ∀ x ∈ A1, ∀ y ∈ A1, ∀ z ∈ A1, (2 * x + y - 5 * z) ≠ 0 ∧ ∀ x ∈ A2, ∀ y ∈ A2, ∀ z ∈ A2, (2 * x + y - 5 * z) ≠ 0 ∧ ∀ x ∈ A3, ∀ y ∈ A3, ∀ z ∈ A3, (2 * x + y - 5 * z) ≠ 0 ∧ ∀ x ∈ A4, ∀ y ∈ A4, ∀ z ∈ A4, (2 * x + y - 5 * z) ≠ 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-276853,"(a) Prove that if \(A\) is a set of positive integers such that (i) if \(m,n\in A\), then \(m + n\in A\) and (ii) there is no prime number that divides all elements of \(A\), and \(n_1,n_2\in A\) with \(n_2 - n_1>1\), then there exist \(m_1,m_2\in A\) such that \(0 < m_2 - m_1 < n_2 - n_1\). (b) Prove that if \(A\) is a set of positive integers such that (i) if \(m,n\in A\), then \(m + n\in A\) and (ii) there is no prime number that divides all elements of \(A\), then there are two consecutive integers belonging to \(A\). (c) Prove that if \(A\) is a set of positive integers such that (i) if \(m,n\in A\), then \(m + n\in A\) and (ii) there is no prime number that divides all elements of \(A\), and \(n_0,n_0 + 1\in A\), then for all \(n\geq n_0^2\), \(n\in A\).","import Mathlib theorem a {A : Set ℕ} (hA : ∀ x ∈ A, x > 0) (hA1 : ∀ m ∈ A, ∀ n ∈ A, m + n ∈ A) (hA2 : ¬∃ p, Nat.Prime p ∧ ∀ x ∈ A, p ∣ x) (n1 n2 : ℕ) (hn1 : n1 ∈ A) (hn2 : n2 ∈ A) (hnm : n2 - n1 > 1) : ∃ m1 m2 : ℕ, m1 ∈ A ∧ m2 ∈ A ∧ 0 < m2 - m1 ∧ m2 - m1 < n2 - n1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-277098,"Let $p$ be an odd prime and let $a$ be an integer such that $p \nmid a$. Prove that there are exactly $p^2 + 1$ triples of integers $(x, y, z)$, where $0 \le x, y, z < p$, satisfying the congruence $(x + y + z)^2 \equiv axyz \pmod{p}$.","import Mathlib theorem triplets (p a : ℕ) (hp : Odd p ∧ Nat.Prime p) (hpa : ¬p ∣ a) : {(x, y, z) : ℕ × ℕ × ℕ | 0 ≤ x ∧ x < p ∧ 0 ≤ y ∧ y < p ∧ 0 ≤ z ∧ z < p ∧ (x + y + z)^2 ≡ a * x * y * z [MOD p]}.ncard = p^2 + 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-277463,"Prove that given a coloring of every natural number either \(RED\) or \(BLUE\), there exist two natural numbers \(x\) and \(y\) of the same color such that: (a) \(x + y = z^{1391}\) (b) \(x + y = z^n\) for some natural number \(n\)","import Mathlib theorem NatColoring (f : ℕ → Fin 2) : ∃ x y z, f x = f y ∧ x + y = z ^ 1391 ∧ ∃ n, x + y = z ^ n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-277818,"Let \(k\) be a natural number. Consider a bijection \(f: \mathbb{Z} \rightarrow \mathbb{Z}\) that satisfies the following property: for any integers \(i\) and \(j\), if \(|i - j| \leq k\), then \(|f(i) - f(j)| \leq k\). Prove that for every \(i, j \in \mathbb{Z}\), it holds that \(|f(i) - f(j)| = |i - j|\).","import Mathlib theorem Zbijective (k : ℕ) (f : ℤ → ℤ) (h : Function.Bijective f) (h' : ∀ i j : ℤ, |i - j| ≤ k → |f i - f j| ≤ k) : ∀ i j : ℤ, |f i - f j| = |i - j| := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-277947,"Let $n$ and $d$ be positive integers. Consider vectors $x_1, x_2, \ldots, x_n$ in $\mathbb{R}^d$ such that $\left|x_i\right| > 1$ for all $1 \leq i \leq n$. Prove that the number of pairs $(i, j)$ with $i < j$ and $\left|x_i + x_j\right| < 1$ is at most $\left\lfloor \frac{n^2}{4} \right\rfloor$. Here, for any vector $x \in \mathbb{R}^d$, $|x|$ denotes the Euclidean length of the vector $x$, defined as $|x| = \sqrt{\sum_{k=1}^d x(k)^2}$, where $x(k)$ is the $k$-th entry of the vector $x$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem count_pairs {n : ℕ} (hn : 0 < n) (d : ℕ) (hd : 0 < d) (x : Fin n → EuclideanSpace ℝ (Fin d)) (hx : ∀ i, ‖x i‖ > 1) : Set.ncard {p : Fin n × Fin n | p.1 < p.2 ∧ ‖x p.1 + x p.2‖ < 1} ≤ ⌊(n ^ 2 / 4 : ℝ)⌋ := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-278735,"Prove that the smallest natural number \(k\) such that for any set \(A\) of \(k\) natural numbers, there exists a subset of \(A\) with an even number of elements whose sum is divisible by \(n\) is \(2n\) when \(n\) is odd and \(n + 1\) when \(n\) is even.","import Mathlib theorem prove (n : ℕ) : IsLeast {k | ∀ A : Finset ℕ, A.card = k → ∃ B ⊆ A, Even B.card ∧ ∑ i ∈ B, i ≡ 0 [MOD n]} (if Odd n then 2 * n else n + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-278784,"Prove that the number of ordered sextuples $(a, b, c, d, e, f)$, where each element is selected from the set $\{0, 1, 2, \ldots, p - 1\}$ and $p$ is an odd prime number, such that $a^2 + b^2 + c^2 \equiv d^2 + e^2 + f^2 \pmod{p}$ is equal to \(p^5 + p^3 - p^2\).","import Mathlib theorem number_of_sextuples (p : ℕ) (hp : Odd p ∧ Nat.Prime p) : Set.ncard {x : Fin 6 → ℕ | (∀ i, x i ∈ Finset.Icc 0 (p - 1)) ∧ x 0 ^ 2 + x 1 ^ 2 + x 2 ^ 2 ≡ x 3 ^ 2 + x 4 ^ 2 + x 5 ^ 2 [MOD p]} = p ^ 5 + p ^ 3 - p ^ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-279862,"Prove that for each positive integer \(n > 2\) and for all integers \(0 < i < j < n\), \(\gcd\left(\binom{n}{i}, \binom{n}{j}\right) > 1\).","import Mathlib theorem Nat.gcd' (n : ℕ) (hn : 2 < n) (i j : ℕ) (hi : 0 < i) (hij : i < j ∧ j < n) : Nat.gcd (Nat.choose n i) (Nat.choose n j) > 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-280329,"Prove the Erdös - Ginzburg - Ziv Theorem: ""Among any \(2n - 1\) integers, there are some \(n\) whose sum is divisible by \(n\).""","import Mathlib theorem Ehring (n : ℕ) (hn : 0 < n) (a : Fin (2 * n - 1) → ℤ) : ∃ b : Finset (Fin (2 * n - 1)), b.card = n ∧ ∑ i ∈ b, a i ≡ 0 [ZMOD n] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-280457,"Prove that for any real number \( C \geq 1 \), \[ \mathop{\sum \sum}_{\substack{c \leq C < d \leq c + C \\ (c,d) = 1}} \frac {1}{cd} = \frac {1}{2} \] where \( c, d \in \mathbb{N} \).","import Mathlib open Real open scoped BigOperators theorem prove (C : ℝ) (hC : 1 ≤ C) : ∑' c : ℕ, ∑' d : ℕ, (if (c ≤ C ∧ C < d ∧ d ≤ c + C ∧ Nat.Coprime c d) then (1 / ((c * d) : ℝ)) else 0) = 1 / 2 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-280584,"Let \(n \geq 12\) be an integer, and let \(P_1, P_2, \ldots, P_n, Q\) be distinct points in a plane. Prove that for some \(i\), at least \(\frac{n}{6} - 1\) of the distances \(P_1P_i, P_2P_i, \ldots, P_{i - 1}P_i, P_{i+1}P_i, \ldots, P_nP_i\) are less than \(P_iQ\).","import Mathlib open Real open scoped BigOperators theorem dist_points {n : ℕ} (hn : n ≥ 12) (P : Fin n → EuclideanSpace ℝ (Fin 2)) (hP : ∀ i j, P i = P j → i = j) (Q : EuclideanSpace ℝ (Fin 2)) : ∃ i, {j | j ≠ i ∧ ‖P j - P i‖ < ‖P i - Q‖}.ncard ≥ n / 6 - 1 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-280629,"For every positive integer \(n \geq 3\), prove that there exist two sets \(A = \{ x_1, x_2, \ldots, x_n \}\) and \(B = \{ y_1, y_2, \ldots, y_n \}\) such that: 1. \(A \cap B = \varnothing\). 2. \(x_1 + x_2 + \cdots + x_n = y_1 + y_2 + \cdots + y_n\). 3. \(x_1^2 + x_2^2 + \cdots + x_n^2 = y_1^2 + y_2^2 + \cdots + y_n^2\). Since the user's problem is already a formal math proof problem, we return it as-is.","import Mathlib theorem problem_41578 (n : ℕ) (hn : 3 ≤ n) : ∃ A B : Finset ℤ, A.card = n ∧ B.card = n ∧ A ∩ B = ∅ ∧ ∑ x ∈ A, x = ∑ y ∈ B, y ∧ ∑ x ∈ A, x^2 = ∑ y ∈ B, y^2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-281684,"Prove that for any five real numbers \(a_i\) with \(1\leq i\leq 5\), there exist natural numbers \(n_i\) for \(1\leq i\leq 5\) such that the inequality \(\sum_{1\leq i < j\leq 5} \left( (a_i - a_j) - (n_i - n_j) \right)^2 < 4\) holds.","import Mathlib theorem prove (a : Fin 5 → ℝ) : ∃ n : Fin 5 → ℕ, (∑ i : Fin 5, ∑ j : Fin 5, if i < j then ((a i - a j) - (n i - n j))^2 else 0) < 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-282120,"Prove that if $u$ is an irrational real number and the set $S$ is defined as $S = \{a + bu \mid a, b \in \mathbb{Z}\}$, then $S$ is dense in the set of real numbers.","import Mathlib theorem DenseSet (u : ℝ) (hu : Irrational u) (S : Set ℝ) (hS : S = {x | ∃ a b : ℤ, x = a + b * u}) : Dense S := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-282374,"Let $f : \mathbb{N} \to \mathbb{N}$ be a function such that for every $n \in \mathbb{N}$, the following conditions hold: 1. $(f(2n) + f(2n + 1) + 1)(f(2n + 1) - f(2n) - 1) = 3(1 + 2f(n))$ 2. $f(2n) \geq f(n)$ Define the set $M = \{m \in f(\mathbb{N}) : m \leq 2008\}$. Prove that the number of elements in $M$ is $128$.","import Mathlib theorem qwen_f (f : ℕ → ℕ) (h₀ : ∀ n, (f (2 * n) + f (2 * n + 1) + 1) * (f (2 * n + 1) - f (2 * n) - 1) = 3 * (1 + 2 * f n)) (h₁ : ∀ n, f (2 * n) ≥ f n) : Set.ncard {m | ∃ n, m = f n ∧ m ≤ 2008} = 128 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-282486,"Prove that if \(a, b, c\) are positive integers satisfying \(b > 2a\) and \(c > 2b\), then there exists a real number \(\lambda\) such that \(\{\lambda a\},\{\lambda b\},\{\lambda c\} \in \left(\frac{1}{3}, \frac{2}{3}\right]\), where \(\{x\}\) denotes the fractional part of \(x\).","import Mathlib theorem prove (a b c : ℕ) (_ : 0 < a) (h₀ : 0 < b) (h₁ : 0 < c) (h₂ : b > 2 * a) (h₃ : c > 2 * b) : ∃ lambda : ℝ, 1 / 3 < (lambda * a) % 1 ∧ (lambda * a) % 1 ≤ 2 / 3 ∧ 1 / 3 < (lambda * b) % 1 ∧ (lambda * b) % 1 ≤ 2 / 3 ∧ 1 / 3 < (lambda * c) % 1 ∧ (lambda * c) % 1 ≤ 2 / 3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-283228,Prove that the quadratic generating function \(P(x) = \sum_{n = 0}^{\infty}\binom{3n}{n}x^{2n}\) has the closed - form \(P(x)=\frac{1}{\sqrt[3]{1 - 27x^2}}\).,"import Mathlib open Real theorem quadraticGeneratingFunction (x : ℝ) : ∑' n : ℕ, Nat.choose (3 * n) n * x ^ (2 * n) = 1 / (1 - 27 * x ^ 2) ^ ((1 : ℝ) / 3) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-283472,"Let $A$ be an $m \times n$ matrix $(m \neq n)$ with entries from the set $\{0, 1\}$. Suppose that for any injective function $f: \{1, 2, \cdots, m\} \longrightarrow \{1, 2, \cdots, n\}$, there exists at least one index $1 \leq i \leq m$ such that the element $a_{i, f(i)} = 0$. Prove that there exist subsets $S \subseteq \{1, 2, \cdots, m\}$ and $T \subseteq \{1, 2, \cdots, n\}$ such that: 1. $\forall i \in S, j \in T, a_{i, j} = 0$. 2. $|S| + |T| > n$.","import Mathlib theorem MatrixBijOn (m n : ℕ) (hm : 0 < m) (hn : 0 < n) (hmn : m ≠ n) (a : Fin m → Fin n → Bool) (ha : ∀ i j, a i j = 0 ∨ a i j = 1) (h : ∀ f : Fin m → Fin n, Function.Injective f → ∃ i, a i (f i) = 0) : ∃ S : Finset (Fin m), ∃ T : Finset (Fin n), (∀ i ∈ S, ∀ j ∈ T, a i j = 0) ∧ (S.card + T.card > n) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-284968,"Let \(a_1, a_2, \ldots, a_n, \ldots\) be a permutation of all positive integers. Prove that there exist infinitely many positive integers \(i\) such that \(\gcd(a_i, a_{i + 1}) \leq \frac{3}{4} i\).","import Mathlib theorem qwen (a : ℕ → ℕ) (ha : ∃ p : Equiv.Perm ℕ, ∀ n, a n = p n) : {i | 0 < i ∧ Nat.gcd (a i) (a (i + 1)) ≤ (3 / 4 : ℚ) * i}.Infinite := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-285370,Let $f: \mathbb{N}_0 \rightarrow \mathbb{N}_0$ be a surjective function. Prove that there exist non-negative integers $a < b < c$ such that $f(a) + f(c) = 2f(b)$.,"import Mathlib theorem Function.Surjective.f (f : ℕ → ℕ) (h : Function.Surjective f) : ∃ a b c : ℕ, a < b ∧ b < c ∧ f a + f c = 2 * f b := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-285704,"Prove that if $k$ is a natural number and $f: \mathbb{Z} \rightarrow \mathbb{Z}$ is a bijection such that for any integers $i$ and $j$, if $|i - j| \leq k$, then $|f(i) - f(j)| \leq k$, then for every $i, j \in \mathbb{Z}$, it holds that $|f(i) - f(j)| = |i - j|$.","import Mathlib theorem Prove (k : ℕ) (f : ℤ → ℤ) (h₀ : Function.Bijective f) (h₁ : ∀ i j : ℤ, |i - j| ≤ k → |f i - f j| ≤ k) : ∀ i j : ℤ, |f i - f j| = |i - j| := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-285939,"For each $i = 1, 2, \ldots, N$, let $a_i, b_i, c_i$ be integers such that at least one of them is odd. Prove that there exist integers $x, y, z$ such that the expression $x a_i + y b_i + z c_i$ is odd for at least $\frac{4}{7}N$ different values of $i$.","import Mathlib theorem qwen (N : ℕ) (hN : 0 < N) (a b c : Fin N → ℤ) (ha : ∀ i, Odd (a i) ∨ Odd (b i) ∨ Odd (c i)) : ∃ x y z, {i | Odd (x * a i + y * b i + z * c i)}.ncard ≥ (4 / 7 : ℝ) * N := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-285969,"Let $S$ be a subset of $\{1, 2, 3, \cdots, 1989 \}$ in which no two members differ by exactly $4$ or by exactly $7$. What is the largest number of elements $S$ can have? prove that answer is 905","import Mathlib def isGood (s : Finset ℕ) := ∀ m ∈ s, ∀ n ∈ s, |(m : ℤ) - n| ≠ 4 ∧ |(m : ℤ) - n| ≠ 7 theorem maxGoodSet : IsGreatest {x | ∃ s : Finset ℕ, s ⊆ Finset.Icc 1 1989 ∧ s.card = x ∧ isGood s} 905 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-285990,"Let $A_1, A_2, \ldots, A_{33}$ be $33$ sets satisfying the following conditions: 1. \(|A_i| = 3\) for all \(i = 1, 2, \ldots, 33\). 2. \(|A_1 \cup A_2 \cup \cdots \cup A_{33}| = 32\). 3. \(|A_i \cap A_j| \leq 2\) for all \(1 \leq i < j \leq 33\). Prove that there exist two indices \(m\) and \(n\) such that \(|A_m \cap A_n| = 1\).","import Mathlib theorem SetInter (A : Fin 33 → Set ℕ) (hA : ∀ i, A i ≠ ∅) (hA1 : ∀ i, (A i).encard = 3) (hA2 : (⋃ i, A i).encard = 32) (hA3 : ∀ i j, i ≠ j → (A i ∩ A j).encard ≤ 2) : ∃ m n, m ≠ n ∧ (A m ∩ A n).encard = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-286067,"Arrange 2048 numbers into a circle, where each number is either +1 or -1. Now, simultaneously multiply each number by its right neighbor and replace the original number with the resulting product, thus obtaining a new circle of numbers. Prove: After a finite number of such operations, all the numbers on the circle will become +1.","import Mathlib theorem algebraic (a : Fin 2048 → ℤ) (ha : ∀ i, a i = 1 ∨ a i = -1) (f : (Fin 2048 → ℤ) → (Fin 2048 → ℤ)) (hf : f = fun x => fun i => x i * x ((i + 1) % 2048)) : ∃ n, ∀ i, f^[n] a i = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-286142,"1. Prove that if a positive integer \(N\) can be expressed as the sum of 18 of its positive - integer divisors (possibly with repetitions) and also as the sum of 19 of its positive - integer divisors (possibly with repetitions), then \(N\) can also be expressed as the sum of 20 of its positive - integer divisors (possibly with repetitions). 2. Prove that for any triangle \(ABC\), the inequality \(\cos(A)+\cos(B)+\cos(C)\leq\frac{3}{2}\) holds. 3. Prove that it is impossible to construct 2017 geometric progressions such that every positive integer belongs to at least one of these progressions, where a geometric progression is defined as a sequence of real numbers of the form \(a, ar, ar^{2},\ldots\).","import Mathlib open Real Set open scoped BigOperators theorem triangle_ineq {A B C : Real} (hA : A ∈ Ioo 0 π) (hB : B ∈ Ioo 0 π) (hC : C ∈ Ioo 0 π) (hABC : A + B + C = π) : cos A + cos B + cos C ≤ 3 / 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-286146,"Prove that a set of \(n\) coins, each with a distinct integer weight \(w_1, w_2, \ldots, w_n\), such that for any coin with weight \(w_k\) (\(1 \leq k \leq n\)), if this coin is removed from the set, the remaining coins can be divided into two groups with equal sum of weights, exists if and only if \(n\) is an odd integer greater than \(5\).","import Mathlib theorem Prove (n : ℕ) (hn : 0 < n) : (∃ w : Fin n → ℤ, ∀ i j, i ≠ j → w i ≠ w j ∧ (∀ k : Fin n, ∃ s1 s2 : Finset (Fin n), s1 ≠ s2 ∧ s1 ∪ s2 = Finset.univ \ {k} ∧ ∑ i ∈ s1, w i = ∑ i ∈ s2, w i)) ↔ Odd n ∧ n > 5 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-286147,"Let there be \( n \) new students, such that among any 3 people, there are 2 who know each other, and among any 4 people, there are 2 who do not know each other. Find the maximum value of \( n \).","import Mathlib theorem max_people (n : ℕ) (hn : n ≥ 3) (g : Fin n → Fin n → Prop) (h1 : ∀ s : Finset (Fin n), s.card = 3 → ∃ a ∈ s, ∃ b ∈ s, g a b) (h2 : ∀ s : Finset (Fin n), s.card = 4 → ∃ a ∈ s, ∃ b ∈ s, ¬g a b) : n ≤ 6 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-286165,"Among any 133 positive integers, if there are at least 799 pairs of relatively prime positive integers, prove that there must exist 4 positive integers \(a\), \(b\), \(c\), \(d\) such that \(a\) is relatively prime to \(b\), \(b\) is relatively prime to \(c\), \(c\) is relatively prime to \(d\), and \(d\) is relatively prime to \(a\).","import Mathlib theorem qwen (s : Finset ℕ) (h₀ : s.card = 133) (h₁ : ∃ p : Finset (ℕ × ℕ), p.card ≥ 799 ∧ ∀ m ∈ p, m.1 ∈ s ∧ m.2 ∈ s ∧ Nat.Coprime m.1 m.2) : ∃ a b c d : ℕ, a ∈ s ∧ b ∈ s ∧ c ∈ s ∧ d ∈ s ∧ Nat.Coprime a b ∧ Nat.Coprime b c ∧ Nat.Coprime c d ∧ Nat.Coprime d a := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-286197,"Let \( a_1, a_2, \cdots, a_{20} \) be 20 pairwise distinct integers, and suppose the set \( \{a_i + a_j \mid 1 \leq i \leq j \leq 20\} \) contains 201 distinct elements. Find the minimum possible number of distinct elements in the set \( \{\lvert a_i - a_j \rvert \mid 1 \leq i < j \leq 20\} \).","import Mathlib theorem min_set_diff : IsLeast {x : ℕ | ∃ a : Fin 20 → ℤ, Set.ncard (Set.range a) = 20 ∧ Set.ncard {y : ℤ | ∃ i j, y = a i + a j ∧ i ≤ j} = 201 ∧ x = Set.ncard {y : ℤ | ∃ i j, y = |a i - a j| ∧ i < j}} 199 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-286229,"Prove that for a set of \(n\) coins, each with a distinct integer weight \(w_1, w_2, \ldots, w_n\), where for any coin with weight \(w_k\) (\(1 \leq k \leq n\)), if this coin is removed from the set, the remaining coins can be divided into two groups such that the sum of the weights in each group is equal, then the values of \(n\) for which such a set of coins exists are all odd numbers.","import Mathlib theorem Oddn (n : ℕ) : (∃ w : Fin n → ℤ, (∀ i j, i ≠ j → w i ≠ w j) ∧ (∀ k, ∃ s1 s2 : Finset (Fin n), s1 ∪ s2 = Finset.univ \ {k} ∧ s1 ∩ s2 = ∅ ∧ ∑ i ∈ s1, w i = ∑ i ∈ s2, w i)) ↔ Odd n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-286296,"Prove that for a table with \(k^2 - k + 1\) rows and \(k^2 - k + 1\) columns, where \(k = p + 1\) and \(p\) is a prime number, there exists a way to distribute the numbers 0 and 1, one number in each cell of the table, such that each row and each column contains exactly \(k\) zeros, and no rectangle with sides parallel to the sides of the table has zeros at all four corners.","import Mathlib theorem MatrixDistributor {k : ℕ} (hk : ∃ p : ℕ, Nat.Prime p ∧ k = p + 1) (a : Fin (k ^ 2 - k + 1) → Fin (k ^ 2 - k + 1) → ℕ) (ha : ∀ i j, a i j = 0 ∨ a i j = 1) : (∀ i, {j | a i j = 0}.encard = k) ∧ (∀ j, {i | a i j = 0}.encard = k) ∧ ¬∃ i1 i2 j1 j2 : Fin (k ^ 2 - k + 1), i1 ≠ i2 ∧ j1 ≠ j2 ∧ a i1 j1 = 0 ∧ a i1 j2 = 0 ∧ a i2 j1 = 0 ∧ a i2 j2 = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-286355,"Let $p > 2$ be a prime number, and let $n$ be a positive integer. Prove that for any set $A$ containing $2n - 1$ positive integers, there exists a subset $B \subseteq A$ with $|B| = n$ such that for all $a, b \in B$, the condition $v_p(a + b) = \min\{v_p(a), v_p(b)\}$ holds.","import Mathlib theorem qwen (p : ℕ) (hp : Nat.Prime p) (h : p > 2) (n : ℕ) (hn : 0 < n) (A : Finset ℕ) (hA : A.card = 2 * n - 1) (hA1 : ∀ x ∈ A, 0 < x) : ∃ B ⊆ A, B.card = n ∧ ∀ a ∈ B, ∀ b ∈ B, a ≠ b → Nat.factorization (a + b) p = min (Nat.factorization a p) (Nat.factorization b p) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-286367,"(a) Prove that the series $\sum_{n=1}^{\infty} \frac{n^k}{n!}$ converges for all $k \in \mathbb{N}$, where $k \geq 3$. (b) Prove that $\sum_{n=1}^{\infty} \frac{n^3}{n!} = 5e$. (c) Prove that $\sum_{n=1}^{\infty} \frac{n^5}{n!} = 52e$. (d) Prove that $\sum_{n=1}^{\infty} \frac{n^6}{n!} = 202e$ and prove that the constants appearing in the results of $\sum_{n=1}^{\infty} \frac{n^3}{n!} = 5e$ and $\sum_{n=1}^{\infty} \frac{n^5}{n!} = 52e$ are related to the Bell numbers.","import Mathlib open Real open scoped BigOperators theorem sum_series (k : ℕ) (hk : k ≥ 3) : Summable (λ n => n ^ k / Nat.factorial n) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-286442,"Prove that the number of triangles that can be formed using the dots in a \(3\times11\) rectangular array, where the vertices of each triangle are dots from the array and sets of three collinear dots are excluded, is \(4948\).","import Mathlib theorem prove : Set.ncard {x : Finset (Fin 3 × Fin 11) | x.card = 3 ∧ ¬∃ p q r : Fin 3 × Fin 11, p ∈ x ∧ q ∈ x ∧ r ∈ x ∧ p ≠ q ∧ p ≠ r ∧ q ≠ r} = 4948 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-286456,"Prove that for a grid of dimensions \(m \times n\) where each cell is arbitrarily colored either Black or White, and a [i]Black Rectangle[/i] of size \(a \times b\) (\(1 \le a \le m\), \(1 \le b \le n\)) is defined as a rectangle with all \(ab\) cells colored Black and a [i]Non - Expandable Black Rectangle[/i] is a [i]Black Rectangle[/i] that is not a subset of any larger [i]Black Rectangle[/i], the total number of [i]Non - Expandable Black Rectangles[/i] in the grid does not exceed \(mn\).","import Mathlib open Finset theorem prove (m n : ℕ) (hm : 0 < m) (hn : 0 < n) (f : Fin m → Fin n → Bool) : {x | ∃ i j, x = (i, j) ∧ f i j ∧ ∀ k l, f k l → k ≤ i ∨ l ≤ j}.ncard ≤ m * n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-286470,"Let $S = \{1, 2, 3, \ldots, 2017\}$. For every subset $A$ of $S$, define a real number $f(A) \geq 0$ such that the following conditions hold: 1. For any $A, B \subset S$, $f(A \cup B) + f(A \cap B) \leq f(A) + f(B)$. 2. For any $A \subset B \subset S$, $f(A) \leq f(B)$. 3. For any $k, j \in S$, $f(\{1, 2, \ldots, k+1\}) \geq f(\{1, 2, \ldots, k\} \cup \{j\})$. 4. For the empty set $\varnothing$, $f(\varnothing) = 0$. Prove that for any three - element subset $\{a,b,c\}$ of $S$, the inequality $f(\{a,b,c\}) \leq \frac{27}{19} f(\{1, 2, 3\})$ holds.","import Mathlib open Finset Real theorem prove (S : Finset ℕ) (hS : S = Icc 1 2017) (f : Finset ℕ → ℝ) (hf : ∀ A ⊆ S, f A ≥ 0) (h1 : ∀ A B : Finset ℕ, A ⊆ S → B ⊆ S → f (A ∪ B) + f (A ∩ B) ≤ f A + f B) (h2 : ∀ A B : Finset ℕ, A ⊆ S → B ⊆ S → A ⊆ B → f A ≤ f B) (h3 : ∀ k j : ℕ, k ∈ S → j ∈ S → f (Icc 1 (k + 1)) ≥ f (Icc 1 k ∪ {j})) (h4 : f ∅ = 0) : ∀ a b c : ℕ, a ∈ S → b ∈ S → c ∈ S → a ≠ b ∧ a ≠ c ∧ b ≠ c → f {a, b, c} ≤ (27 / 19) * f {1, 2, 3} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-286882,"Prove that the largest possible value of $n$ for subsets $A_1, A_2, \ldots, A_n \subseteq \{1, 2, \ldots, 100\}$ such that $|A_i| \geq 2$ for all $i = 1, 2, \ldots, n$ and for any $1 \leq i < j < k \leq n$, if $A_i \cap A_j \neq \emptyset$, $A_j \cap A_k \neq \emptyset$, and $A_k \cap A_i \neq \emptyset$, then $A_i \cap A_j \cap A_k \neq \emptyset$, is $2^{99} - 1$.","import Mathlib open Finset theorem max_n : IsGreatest {n | ∃ A : Fin n → Set ℕ, (∀ i, A i ⊆ Icc 1 100) ∧ (∀ i, (A i).ncard ≥ 2) ∧ (∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → (A i ∩ A j ≠ ∅ → A j ∩ A k ≠ ∅ → A k ∩ A i ≠ ∅ → A i ∩ A j ∩ A k ≠ ∅))} (2 ^ 99 - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-286927,"Prove that the number of ways to partition the integers from \(1\) to \(2006\) into three non - empty, disjoint sets such that no set contains a pair of consecutive integers is \(2^{2004}-1\).","import Mathlib theorem prove : Set.ncard {x : Finset (Finset ℕ) | x.card = 3 ∧ ∃ s1 s2 s3 : Finset ℕ, s1 ∪ s2 ∪ s3 = Finset.Icc 1 2006 ∧ s1 ≠ ∅ ∧ s2 ≠ ∅ ∧ s3 ≠ ∅ ∧ s1 ∩ s2 = ∅ ∧ s2 ∩ s3 = ∅ ∧ s3 ∩ s1 = ∅ ∧ ¬∃ n ∈ s1, n + 1 ∈ s1 ∧ ¬∃ n ∈ s2, n + 1 ∈ s2 ∧ ¬∃ n ∈ s3, n + 1 ∈ s3} = 2^2004 - 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-286979,"Prove that every positive integer eventually appears in the sequence $(a_n)$ defined by the initial conditions $a_1 = 1$, $a_2 = 2$, and for $n \ge 3$, $a_n$ is the smallest positive integer such that: (i) $a_n$ does not appear in the set $\{a_1, a_2, \dots, a_{n - 1}\}$, and (ii) $|a_n - a_{n - 1}|$ does not appear in the set $\{|a_2 - a_1|, |a_3 - a_2|, \dots, |a_{n - 1} - a_{n - 2}|\}$.","import Mathlib theorem prove (a : ℕ → ℕ) (h₀ : a 1 = 1) (h₁ : a 2 = 2) (h₂ : ∀ n ≥ 3, ∃ m, IsLeast {x | 0 < x ∧ ¬(∃ i, i ≤ n - 1 ∧ a i = x)} m ∧ ¬(∃ i, i ≤ n - 1 ∧ a i = |(m : ℤ) - a (n - 1)|)) : ∀ n, 0 < n → ∃ m, a m = n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-287041,"Prove that if $\mathfrak{F} = \{A_1, A_2, \ldots, A_n\}$ is a collection of subsets of the set $S = \{1, 2, \ldots, n\}$ such that any two distinct sets from $\mathfrak{F}$ have exactly one element in common and each element of $S$ is contained in exactly $k$ of the sets in $\mathfrak{F}$, then $n$ cannot be equal to $1996$.","import Mathlib theorem prove_not_1996 {n : ℕ} (hn : 0 < n) (S : Finset ℕ) (hS : S = Finset.Icc 1 n) (F : Finset (Finset ℕ)) (hF : ∀ x ∈ F, x ⊆ S) (hF1 : ∀ x ∈ F, ∀ y ∈ F, x ≠ y → ∃! z, z ∈ x ∧ z ∈ y) (k : ℕ) (hk : 0 < k) (hF2 : ∀ x ∈ S, {y | y ∈ F ∧ x ∈ y}.encard = k) : n ≠ 1996 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-287086,"Determine whether there exists a cardinal number \( \kappa \) such that the cardinality of \( \kappa \times \kappa \) is not equal to \( \kappa \). Prove that the answer is Yes.","import Mathlib theorem card : ∃ (k : ℕ), k > 0 ∧ (k * k) ≠ k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-287095,"$A_1, A_2, \ldots, A_n$ are subsets of a set $S$ with $|S| = 2019$ such that the union of any three of them equals $S$, but the union of any two does not equal $S$. Find the maximum value of $n$. prove that answer is 64","import Mathlib theorem max_n (n : ℕ) (hn : n > 0) (A : Finset (Finset ℕ)) (hA : ∀ s ∈ A, s ⊆ Finset.range 2019) (hA1 : ∀ s ∈ A, ∀ t ∈ A, ∀ u ∈ A, s ≠ t ∧ s ≠ u ∧ t ≠ u → s ∪ t ∪ u = Finset.range 2019) (hA2 : ∀ s ∈ A, ∀ t ∈ A, s ≠ t → s ∪ t ≠ Finset.range 2019) : n ≤ 64 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-287224,"Prove that for a set $S$ of $n^2 + 1$ closed intervals, where $n$ is a positive integer, at least one of the following assertions holds: (i) There exists a subset $S'$ of $S$ consisting of $n + 1$ intervals such that the intersection of the intervals in $S'$ is nonempty. (ii) There exists a subset $S''$ of $S$ consisting of $n + 1$ intervals such that any two of the intervals in $S''$ are disjoint.","import Mathlib open Finset Real theorem prove (n : ℕ) (hn : 0 < n) (S : Finset (Set ℝ)) (hS : S.card = n ^ 2 + 1) (hS' : ∀ s ∈ S, ∃ a b, s = {x | a ≤ x ∧ x ≤ b}) : (∃ T ⊆ S, T.card = n + 1 ∧ ∃ x, ∀ s ∈ T, x ∈ s) ∨ (∃ U ⊆ S, U.card = n + 1 ∧ ∀ s ∈ U, ∀ t ∈ U, s ≠ t → Disjoint s t) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-287250,"求具有下述性质的最小正数 $c$ :对任意整数 $n \geq 4$,以及集合 $A \subseteq\{1,2, \cdots, n\}$, 若 $|A|>c n$, 则存在函数 $f: A \rightarrow\{1,-1\}$, 满足 $$ \left|\sum_{a \in A} f(a) \cdot a\right| \leq 1. $$ The original answer is in \frac{m}{n} format, please give the value of m + n. prove that answer is 5","import Mathlib open Real open scoped BigOperators theorem min_c {c : ℝ} (hc : ∀ n ≥ 4, ∀ A : Finset ℕ, A ⊆ Finset.Icc 1 n → A.card > c * n → ∃ f : ℕ → ℤ, (∀ x ∈ A, f x = 1 ∨ f x = -1) ∧ |∑ a ∈ A, f a * a| ≤ 1) : IsLeast {x | 0 < x ∧ (∀ n ≥ 4, ∀ A : Finset ℕ, A ⊆ Finset.Icc 1 n → A.card > x * n → ∃ f : ℕ → ℤ, (∀ x ∈ A, f x = 1 ∨ f x = -1) ∧ |∑ a ∈ A, f a * a| ≤ 1)} (5 / 3) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-287305,"Prove that there exists a positive constant $c = \frac{1}{e^3}$ such that for any positive integer $N$, among any set of $N$ positive integers not exceeding $2N$, there exist two numbers whose greatest common divisor is greater than $cN$.","import Mathlib theorem prove_gcd : ∃ c : ℝ, 0 < c ∧ c = 1 / Real.exp 3 ∧ ∀ N : ℕ, 0 < N → ∀ s : Finset ℕ, s.card = N → (∀ m ∈ s, 0 < m) → (∀ m ∈ s, m ≤ 2 * N) → ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ Nat.gcd x y > c * N := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-287352,Prove that the largest 85 - digit integer such that the sum of its digits is equal to the product of its digits is \(772\underbrace{11\cdots1}_{82\text{ times}}\).,"import Mathlib theorem max_n : IsGreatest {n | (Nat.digits 10 n).length = 85 ∧ (Nat.digits 10 n).sum = (Nat.digits 10 n).prod} 772111111111 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-287413,"设集合 $S$ 是 $\{0,1, \cdots, 98\}$ 的 $m(m \geqslant 3)$元子集,满足对任意的 $x, y \in S$ ,均存在 $z \in$ $S$, 使得 $x+y \equiv 2 z(\bmod 99)$. 求 $m$ 的所有可能值的和. prove that answer is 155","import Mathlib theorem sumOfM : ∑ᶠ m ∈ {m : ℕ | m ≥ 3 ∧ ∃ S : Finset ℕ, S ⊆ Finset.Icc 0 98 ∧ S.card = m ∧ ∀ x ∈ S, ∀ y ∈ S, ∃ z ∈ S, (x + y) % 99 = 2 * z}, m = 155 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-287471,"Can a non-measurable set in the interval $[0,1]$ be constructed with a specified outer measure $x \in (0,1]$ using the Axiom of Choice? Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem can_construct_non_measurable_set (x : ℝ) (hx : 0 < x ∧ x ≤ 1) : ∃ s : Set ℝ, s ⊆ Set.Icc 0 1 ∧ ¬ MeasurableSet s ∧ (MeasureTheory.volume s).toReal = x := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-287516,"Prove that the minimum number \(k\) of colors required to color each number in the set of integers \(S=\{2,3,4,\ldots,1024\}\) such that if \(a\) is a multiple of \(b\), then \(a\) and \(b\) have different colors is \(k = 10\).","import Mathlib theorem min_k (S : Finset ℕ) (hS : S = Finset.Icc 2 1024) : IsLeast {k | ∃ f : ℕ → Fin k, ∀ a ∈ S, ∀ b ∈ S, a ∣ b → f a ≠ f b} 10 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-287605,"Prove that if integers are colored red and blue such that (1) the integer \(1\) is colored red, and (2) if two integers \(a\) and \(b\) (not necessarily distinct) are colored red, then \(a + b\) and \(a - b\) are of different colors, then the integer \(2018\) is colored red.","import Mathlib theorem colorRed {f : ℤ → Fin 2} (h1 : f 1 = 0) (h2 : ∀ a b, f a = 0 → f b = 0 → f (a + b) ≠ f (a - b)) : f 2018 = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-287626,"Let $F$ be a finite set composed of integers, satisfying the following conditions: (1) For any $x \in F$, there exist $y, z \in F$ (possibly the same) such that $x = y + z$; (2) There exists $n \in \mathbf{N}^*$ such that for any positive integer $k$ ($1 \leqslant k \leqslant n$) and any $x_1, x_2, \cdots, x_k \in F$ (possibly the same), the sum $\sum_{i=1}^k x_i \neq 0$. Prove: $F$ contains at least $2n+2$ elements.","import Mathlib theorem Qwen {F : Finset ℤ} (hF1 : ∀ x ∈ F, ∃ y z : ℤ, y ∈ F ∧ z ∈ F ∧ x = y + z) (hF2 : ∃ n > 0, ∀ k ∈ Finset.Icc 1 n, ∀ x : Fin k → ℤ, (∀ i, x i ∈ F) → ∑ i, x i ≠ 0) : F.card ≥ 2 * n + 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-287761,"Let \(G=(V, E)\) be a finite graph representing a social network where \(V\) is the set of vertices (people) and \(E\) is the set of edges (friendships), and the friendship relation is mutual. Given that among any \(4\) vertices in \(G\), there exists a subset of \(3\) vertices that are either all mutually connected (friends) or all mutually disconnected (not friends). Prove that the set of vertices \(V\) can be partitioned into two disjoint subsets \(V_1\) and \(V_2\) such that every pair of vertices in \(V_1\) is connected by an edge, and no two vertices in \(V_2\) are connected by an edge.","import Mathlib theorem social_network {n : ℕ} (hn : n > 0) (a : Fin n → Fin n → Bool) (ha : ∀ i j, a i j = a j i) (h : ∀ s : Finset (Fin n), s.card = 4 → ∃ t ⊆ s, t.card = 3 ∧ (∀ i ∈ t, ∀ j ∈ t, i ≠ j → a i j) ∨ (∀ i ∈ t, ∀ j ∈ t, i ≠ j → ¬a i j)) : ∃ V1 V2 : Finset (Fin n), V1 ∩ V2 = ∅ ∧ V1 ∪ V2 = Finset.univ ∧ (∀ i ∈ V1, ∀ j ∈ V1, i ≠ j → a i j) ∧ (∀ i ∈ V2, ∀ j ∈ V2, i ≠ j → ¬a i j) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-287864,"Let $(a_i)_{i \geq 1}$ be a sequence of natural numbers such that for all $i \geq 1$, $a_{i+2} = a_{i+1} + a_i$ or $a_{i+2} = |a_{i+1} - a_i|$. Given the first 1999 terms of the sequence, $a_1, a_2, \ldots, a_{1999}$, prove that there exists an integer $n \geq 1999$ for which $a_{n+i} = a_i$ for all $i = 1, 2, \ldots, 1999$.","import Mathlib theorem qwen (a : ℕ → ℕ) (h₀ : ∀ i, a (i + 2) = a (i + 1) + a i ∨ a (i + 2) = |(a (i + 1) : ℤ) - a i|) : ∃ n ≥ 1999, ∀ i ∈ Finset.Icc 1 1999, a (n + i) = a i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-287971,"Prove that if $n$ sets $A_1, A_2, \ldots, A_n$ satisfy the conditions: 1. $|A_i \cap A_j| \le \min\{|A_1|, |A_2|, \ldots, |A_n|\} - 1$ for all $i \neq j$ where $i, j \in \{1, 2, \ldots, n\}$. 2. $|A_i| \ge 1$ for all $i = 1, 2, \ldots, n$. then the minimum value of $\left|\bigcup_{i=1}^{n} A_i\right|$ is $\min\{m \mid \binom{m}{\lceil \frac{m}{2} \rceil} \ge n\}$.","import Mathlib open Finset theorem prove (n : ℕ) (hn : 0 < n) (A : Fin n → Set ℝ) (hij : ∀ i j, i ≠ j → (A i ∩ A j).ncard ≤ sInf {x | ∃ i, x = (A i).ncard} - 1) (hA : ∀ i, (A i).ncard ≥ 1) : IsLeast {x | ∃ B : Set ℝ, B = ⋃ i, A i ∧ x = B.ncard} (sInf {m | Nat.choose m (Nat.ceil (m / 2)) ≥ n}) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-288110,"Determine the cardinality of the set of all injective functions from the natural numbers to the real numbers. Prove that the answer is 2^{\aleph_0}.","import Mathlib open Real Set open scoped BigOperators theorem card_injective : {f : ℕ → ℝ | Function.Injective f}.ncard = 2 ^ (Nat.card ℕ) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-288131,"In a room, there are \(9\) people such that for any three of them, at least two know each other. Prove that there exists a group of four people in this room such that all of them know each other.","import Mathlib theorem qwen (a : Fin 9 → Fin 9 → Bool) (h : ∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → a i j ∨ a i k ∨ a j k) : ∃ s : Finset (Fin 9), s.card = 4 ∧ ∀ i ∈ s, ∀ j ∈ s, i ≠ j → a i j := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-288160,"Prove that the set of all integers \(n\) for which there exist an integer \(k \geq 2\) and positive integers \(x_1, x_2, \ldots, x_k\) such that \(x_1x_2 + x_2x_3 + \cdots + x_{k - 1}x_k = n\) and \(x_1 + x_2 + \cdots + x_k = 2019\) is the set \([2018, 1009 \cdot 1010]\).","import Mathlib theorem SetOfIntegers : {n : ℤ | ∃ k ≥ 2, ∃ x : ℕ → ℤ, (∀ i ∈ Finset.range k, x i > 0) ∧ (∑ i ∈ Finset.range (k - 1), x i * x (i + 1)) = n ∧ (∑ i ∈ Finset.range k, x i) = 2019} = {n | 2018 ≤ n ∧ n ≤ 1009 * 1010} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-288173,"Let \( M = \{1, 2, \dots, 20\} \). For any 9-element subset \( S \) of \( M \), the function \( f(S) \) takes an integer value between 1 and 20. Prove: Regardless of the definition of the function \( f \), there always exists a 10-element subset \( T \) of \( M \) such that for all \( k \in T \), the following inequality holds: \[ f(T \setminus \{k\}) \neq k \] (where \( T \setminus \{k\} \) denotes the set difference of \( T \) and \( \{k\} \)).","import Mathlib open Finset theorem f (M : Finset ℕ) (hM : M = Icc 1 20) (f' : Finset ℕ → ℕ) (hf' : ∀ S ⊆ M, S.card = 9 → 1 ≤ f' S ∧ f' S ≤ 20) : ∃ T ⊆ M, T.card = 10 ∧ ∀ k ∈ T, f' (T \ {k}) ≠ k := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-288306,"An infinitely large urn is initially empty. At 1 minute to 12 P.M., balls numbered 1 through 10 are placed in the urn, and ball number 10 is withdrawn. At 1/2 minute to 12 P.M., balls numbered 11 through 20 are placed in the urn, and ball number 20 is withdrawn. This process continues, with balls numbered 21 through 30 being placed in the urn at 1/4 minute to 12 P.M., and ball number 30 being withdrawn, and so on. Determine the number of balls in the urn at 12 P.M. Prove that the answer is \infty.","import Mathlib theorem urn_balls : Set.Infinite {x | ∃ n, x = n ∧ n > 0 ∧ (n % 10) ≠ 0} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-288330,"Let $n$ be a positive integer, and let $p, q$ be odd primes greater than $n$. Prove that it is possible to color the numbers $1, 2, \cdots, n$ with two colors such that for any two distinct numbers $x \neq y$ of the same color, $xy - 1$ is divisible by neither $p$ nor $q$.","import Mathlib theorem color_n (n : ℕ) (hn : 0 < n) (p q : ℕ) (hp : Odd p ∧ Nat.Prime p) (hq : Odd q ∧ Nat.Prime q) (h : p > n ∧ q > n) : ∃ f : Finset.Icc 1 n → Fin 2, ∀ x y : Finset.Icc 1 n, x ≠ y → f x = f y → ¬(p ∣ x * y - 1) ∧ ¬(q ∣ x * y - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-288335,"Let $f$ be a nonnegative function defined on the power set of the set of positive integers with the following properties: $f(X) \le f(Y) \le f(\mathbf{N})=1$ if $X\subseteq Y$; $f(X\cup Y)\le f(X)+f(Y)$; for each $X$ and each $y \in [0,f(X)]$ there exists $Y \subseteq X$ such that $f(Y)=y$. Given a set $A$ such that $f(A)<1$, determine if there exists a set $B$ containing $A$ such that $$ f(A) 0) (a : Fin n → Fin n → Bool) (ha : ∀ i j, a i j ↔ a j i) (h : ∀ i j, i ≠ j → Odd {k | a k i ∧ a k j}.ncard) : Odd n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-288526,"Let $A = \{1, 2, 3, \ldots, 2008\}$. A nonempty subset of $A$ is said to be of type $r$, where $r \in \{0, 1, 2\}$, if the sum of its elements is congruent to $r$ modulo $3$. Denote by $X_r$ the class of all subsets of $A$ that are of type $r$. Prove that the class $X_1$ has the largest cardinality among the classes $X_r$ for $r \in \{0, 1, 2\}$.","import Mathlib def A : Finset ℕ := Finset.Icc 1 2008 def X (r : ℕ) := {s | s ⊆ A ∧ s ≠ ∅ ∧ ∑ x ∈ s, x ≡ r [MOD 3]} theorem max(X1 X2 X3 : Set (Finset ℕ)) (hX1 : X1 = X 1) (hX2 : X2 = X 2) (hX3 : X3 = X 0) : X1.ncard > X2.ncard ∧ X1.ncard > X3.ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-288738,"Prove that given a set \(S\) of \(n^2 + 1\) distinct positive integers, either there exists a subset of \(S\) containing \(n + 1\) integers such that each integer in the subset divides another integer in the subset, or there exists a subset of \(S\) containing \(n + 1\) integers such that no integer in the subset divides any other integer in the subset.","import Mathlib theorem Prove (n : ℕ) (hn : 0 < n) (S : Finset ℕ) (hS : S.card = n ^ 2 + 1) (hS1 : ∀ x ∈ S, 0 < x) : (∃ T ⊆ S, T.card = n + 1 ∧ ∀ x ∈ T, ∃ y ∈ T, x ≠ y ∧ x ∣ y) ∨ (∃ T ⊆ S, T.card = n + 1 ∧ ∀ x ∈ T, ∀ y ∈ T, x ≠ y → ¬(x ∣ y)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-288762,"Prove that for a sequence $(a_n)_{n=1}^{\infty}$ of integers such that for all $n \ge N$ (for some $N$), $a_n$ is the number of indices $i$, $1 \le i < n$, such that $a_i + i \ge n$, the maximum possible number of integers that occur infinitely many times in the sequence is \(2\).","import Mathlib theorem prove (a : ℕ → ℤ) (ha : ∃ N, ∀ n ≥ N, a n = {i | 1 ≤ i ∧ i < n ∧ a i + i ≥ n}.ncard) : Set.ncard {x | {n | a n = x}.Infinite} ≤ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-289213,"Given a positive integer \( n \), and real numbers \( x_1 \leqslant x_2 \leqslant \cdots \leqslant x_n \) and \( y_1 \geqslant y_2 \geqslant \cdots \geqslant y_n \), satisfying: \[ \sum_{i=1}^n i x_i = \sum_{i=1}^n i y_i. \] Prove that for any real number \( \alpha \), the following inequality holds: \[ \sum_{i=1}^n x_i \lfloor i \alpha \rfloor \geqslant \sum_{i=1}^n y_i \lfloor i \alpha \rfloor, \] where \( \lfloor \beta \rfloor \) denotes the greatest integer less than or equal to the real number \( \beta \).","import Mathlib theorem inequalities (n : ℕ) (hn : 0 < n) (x y : Fin n → ℝ) (hx : Monotone x) (hy : Antitone y) (hxy : ∑ i : Fin n, (i + 1) * x i = ∑ i : Fin n, (i + 1) * y i) (α : ℝ) : ∑ i : Fin n, x i * ⌊(i + 1) * α⌋ ≥ ∑ i : Fin n, y i * ⌊(i + 1) * α⌋ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-289225,"The lattice points $(i, j)$ for integers $0 \le i, j \le 3$ are each being painted orange or black. Suppose a coloring is good if for every set of integers $x_1, x_2, y_1, y_2$ such that $0 \le x_1 < x_2 \le 3$ and $0 \le y_1 < y_2 \le 3$, the points $(x_1, y_1),(x_1, y_2),(x_2, y_1),(x_2, y_2)$ are not all the same color. How many good colorings are possible? prove that answer is 840","import Mathlib def isGood (f : Fin 4 → Fin 4 → Fin 2) : Prop := ∀ x1 x2 y1 y2 : Fin 4, x1 < x2 ∧ y1 < y2 → ¬(f x1 y1 = f x1 y2 ∧ f x1 y2 = f x2 y1 ∧ f x2 y1 = f x2 y2) theorem countGood : Set.ncard {f : Fin 4 → Fin 4 → Fin 2 | isGood f} = 840 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-289261,"Prove that if every integer is colored with one of $3$ different colors, there exist two integers of the same color that differ by a perfect square.","import Mathlib theorem prove (f : ℤ → Fin 3) : ∃ m n, m ≠ n ∧ f m = f n ∧ ∃ k, k^2 = m - n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-289349,"Prove that the smallest integer \(k\) such that in every \(k\) - element subset of the set \(\{1, 2, \ldots, 50\}\), there exists a pair of distinct elements \((a, b)\) for which \(a + b\) divides \(ab\) is \(39\).","import Mathlib theorem solution: IsLeast {k | ∀ (S : Finset ℕ), S ⊆ Finset.Icc 1 50 ∧ S.card = k → ∃ a ∈ S, ∃ b ∈ S, a ≠ b ∧ (a + b) ∣ (a * b)} 39 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-289470,"Prove that the sequence $\left(a_{n}\right)_{n\geq1}$ defined by $a_{1}=1$, $a_{2n}=1+\frac{1}{a_{n}}$, and $a_{2n+1}=1-\frac{1}{a_{2n}}$ is injective and that it enumerates all positive rational numbers.","import Mathlib open scoped BigOperators theorem algebra_486691 {a : ℕ → ℚ} (ha1 : a 1 = 1) (han : ∀ n ≥ 1, a (2 * n) = 1 + 1 / a n ∧ a (2 * n + 1) = 1 - 1 / a (2 * n)) : Function.Injective a ∧ ∀ x > 0, ∃ n ≥ 1, a n = x := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-289586,"Prove that the least possible combined number of faces on two fair dice, where each die has at least 6 faces, each face is labeled with a distinct integer from 1 to the number of faces on that die, the probability of rolling a sum of 7 is $\frac{3}{4}$ of the probability of rolling a sum of 10, and the probability of rolling a sum of 12 is $\frac{1}{12}$, is \(17\).","import Mathlib theorem min_faces (a b : ℕ) (ha : a ≥ 6) (hb : b ≥ 6) (hprob : (Nat.card {x | x ∈ Finset.Icc 1 a ∧ ∃ y ∈ Finset.Icc 1 b, x + y = 7}) / (a * b) = 3 / 4 * (Nat.card {x | x ∈ Finset.Icc 1 a ∧ ∃ y ∈ Finset.Icc 1 b, x + y = 10}) / (a * b)) (hprob' : (Nat.card {x | x ∈ Finset.Icc 1 a ∧ ∃ y ∈ Finset.Icc 1 b, x + y = 12}) / (a * b) = 1 / 12) : a + b = 17 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-289700,"Let $m, n, t$ be positive integers, and let $A_{ij}$ ($1 \leq i \leq m$, $1 \leq j \leq n$) be subsets of $\{1,2, \cdots, t\}$ such that for any $j_1 \neq j_2$, there exist $i_1 \neq i_2$ satisfying $A_{i_1j_1} \cap A_{i_2j_2} \neq \emptyset$ and $A_{i_1j_2} \cap A_{i_2j_1} \neq \emptyset$. Let $|A_{ij}| = a_{ij}$. Prove that: \begin{equation} \sum_{j=1}^{n} \frac{a_{1j}! \cdot a_{2j}! \cdots \cdot a_{mj}!}{(a_{1j} + a_{2j} + \cdots + a_{mj})!} \leq 1. \end{equation}","import Mathlib open Finset Real Nat theorem qwen {m n t : ℕ} (hm : 0 < m) (hn : 0 < n) (ht : 0 < t) (A : Fin m → Fin n → Finset ℕ) (hA : ∀ i j, A i j ⊆ Icc 1 t) (hij : ∀ j1 j2 : Fin n, j1 ≠ j2 → ∃ i1 i2 : Fin m, i1 ≠ i2 ∧ A i1 j1 ∩ A i2 j2 ≠ ∅ ∧ A i1 j2 ∩ A i2 j1 ≠ ∅) (a : Fin m → Fin n → ℕ) (ha : ∀ i j, a i j = (A i j).card) : ∑ j : Fin n, (∏ i : Fin m, Nat.factorial (a i j)) / Nat.factorial (∑ i : Fin m, a i j) ≤ 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-289877,"Prove that given a set \(M\) of 1985 distinct positive integers, where each integer in \(M\) has no prime divisor greater than 23, \(M\) contains a subset of four elements whose product is the fourth power of an integer.","import Mathlib theorem prove (M : Finset ℕ) (hM : M.card = 1985) (hM1 : ∀ m ∈ M, ∀ p, Nat.Prime p → p ∣ m → p ≤ 23) : ∃ S ⊆ M, S.card = 4 ∧ ∃ k, S.prod id = k ^ 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-289898,"Prove that in a \(20\times20\) grid of red and green points, where adjacent points (horizontally or vertically) are connected by segments (same - colored adjacent points have a segment of that color and different - colored adjacent points have a black segment), given that there are \(219\) red points with \(39\) of these red points located on the non - corner borders and \(237\) black segments, the number of green segments is \(223\).","import Mathlib theorem ProveGreenSegments (total_points : ℕ × ℕ) (h₀ : total_points = (20, 20)) (red_points : ℕ) (h₁ : red_points = 219) (nonCornerRed : ℕ) (h₂ : nonCornerRed = 39) (black_segments : ℕ) (h₃ : black_segments = 237) : green_segments = 223 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-289954,"Prove that if $M$ is a finite set of real numbers with the property that for any three elements chosen from $M$, there exist two elements whose sum is also in $M$, then \(|M| \le 7\).","import Mathlib theorem ProveFinite (M : Finset ℝ) (hM : ∀ x ∈ M, ∀ y ∈ M, ∀ z ∈ M, ∃ w ∈ M, w = x + y ∨ w = y + z ∨ w = x + z) : M.card ≤ 7 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-290074,"Given a countable collection \( \{ A_i \} \) of subsets of \([0,1]\), can the collection \( \{ \cap_{i \in J} A_i \}_{J \subset \mathbb{N}, |J| = \infty} \) be uncountably infinite? Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem uncountably_infinite (A : ℕ → Set ℝ) (hA : ∀ n, A n ⊆ Set.Icc 0 1) : ¬ Countable {x | ∃ J : Set ℕ, J.Infinite ∧ x = ⋂ i ∈ J, A i} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-290088,"Prove that the number of non - empty subsets of the set \(\{1, 2, \dots, 15\}\) such that the sum of the squares of the elements in each subset is a multiple of \(5\) is \(7583\).","import Mathlib theorem prove : Set.ncard {s : Finset ℕ | s ⊆ Finset.Icc 1 15 ∧ s ≠ ∅ ∧ ∑ x ∈ s, x^2 ≡ 0 [MOD 5]} = 7583 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-290117,"Prove that for any positive integer \(n\), the minimum number of triples \((i, j, k)\) with \(1 \leq i < j < k \leq n\) such that either \(a_i < a_j < a_k\) or \(a_i > a_j > a_k\) holds over all permutations \(a_1, a_2, \dots, a_n\) of the set \(\{1, 2, \dots, n\}\) is \(\frac{(n - 4)(2n^2 - 16n + 36)}{12}\).","import Mathlib open Finset theorem prove (n : ℕ) (hn : 0 < n) : IsLeast {x | ∃ a : Equiv.Perm (Fin n), x = {p | ∃ i j k : Fin n, p = (i, j, k) ∧ i ≠ j ∧ i ≠ k ∧ j ≠ k ∧ a i < a j ∧ a j < a k ∨ a i > a j ∧ a j > a k}.ncard} ((n - 4) * (2 * n ^ 2 - 16 * n + 36) / 12) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-290194,"For every prime \(p\), prove that there exists a coloring of the positive integers using \(p - 1\) colors such that for any positive integer \(a\), the numbers \(\{a, 2a, 3a, \ldots, (p - 1)a\}\) are colored with pairwise distinct colors.","import Mathlib open Finset theorem colorings {p : ℕ} (hp : Nat.Prime p) : ∃ f : ℕ → Fin (p - 1), ∀ a > 0, ∀ i ∈ Icc 1 (p - 1), ∀ j ∈ Icc 1 (p - 1), i ≠ j → f (i * a) ≠ f (j * a) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-290197,"Let \( k \) be a positive integer. Prove that the set \( \{0, 1, 2, \cdots, 2^{k+1} - 1\} \) can be partitioned into two disjoint subsets \( \{x_1, x_2, \cdots, x_{2^k}\} \) and \( \{y_1, y_2, \cdots, y_{2^k}\} \) such that \[ \sum_{i=1}^{2^k} x_i^m = \sum_{i=1}^{2^k} y_i^m \] for all \( m \in \{1, 2, \cdots, k\} \).","import Mathlib theorem partition_set (k : ℕ) (hk : 0 < k) : ∃ s1 s2 : Finset ℕ, s1 ∪ s2 = Finset.Icc 0 (2^(k + 1) - 1) ∧ s1 ∩ s2 = ∅ ∧ ∀ m ∈ Finset.Icc 1 k, ∑ i ∈ s1, i^m = ∑ i ∈ s2, i^m := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-290311,"Let \( A \) be a set of nonzero vectors in the plane. If \( A \) contains at least three elements, and for any \( u \in A \), there exist \( v, w \in A \) such that \( v \neq w \) and \( u = v + w \), then \( A \) is said to have property \( S \). Prove: (1) For any \( n \geqslant 6 \), there exists a vector set with property \( S \) having \( n \) elements. (2) Any finite vector set with property \( S \) must have at least 6 elements.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem property_S (A : Finset (EuclideanSpace ℝ (Fin 2))) (hA : ∀ u ∈ A, ∃ v w : EuclideanSpace ℝ (Fin 2), v ∈ A ∧ w ∈ A ∧ v ≠ w ∧ u = v + w) (hA1 : A.card ≥ 3) (hA2 : ∀ u ∈ A, u ≠ 0) : A.card ≥ 6 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-290384,"In an $n \times n$ grid, each cell is filled with a real number. A set of $n$ cells is called a ""good set"" if no two cells share the same row or column. It is known that the sum of the numbers in every good set is non-negative, and every cell is contained in at least one good set with a sum of zero. Prove that the sum of the numbers in every good set is zero.","import Mathlib open Finset Real theorem prove_zero_sum (n : ℕ) (hn : 0 < n) (a : Fin n → Fin n → ℝ) (h₀ : ∀ s : Finset (Fin n × Fin n), s.card = n → (∀ x ∈ s, ∀ y ∈ s, x ≠ y → x.1 ≠ y.1 ∧ x.2 ≠ y.2) → ∑ x ∈ s, a x.1 x.2 ≥ 0) (h₁ : ∀ i j, ∃ s : Finset (Fin n × Fin n), s.card = n ∧ (∀ x ∈ s, ∀ y ∈ s, x ≠ y → x.1 ≠ y.1 ∧ x.2 ≠ y.2) ∧ ∑ x ∈ s, a x.1 x.2 = 0 ∧ (i, j) ∈ s) : ∀ s : Finset (Fin n × Fin n), s.card = n → (∀ x ∈ s, ∀ y ∈ s, x ≠ y → x.1 ≠ y.1 ∧ x.2 ≠ y.2) → ∑ x ∈ s, a x.1 x.2 = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-290486,"Prove that if in a social gathering of more than three individuals, the relation ""knowing"" is symmetric and for any two individuals, the number of people they both know is exactly one, then any two individuals who do not know each other know the same number of people.","import Mathlib theorem social_gathering (n : ℕ) (hn : n > 3) (a : Fin n → Fin n → Bool) (ha : ∀ i j, a i j = a j i) (hij : ∀ i j, {x | a x i ∧ a x j}.encard = 1) : ∀ i j, ¬a i j → {x | a x i ∧ ¬a x j}.encard = {x | ¬a x i ∧ a x j}.encard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-290603,"Prove that the maximum possible cardinality of a set \(J \subseteq \mathbb{N}\) such that for all \(a, b \in J\) with \(a \neq b\), the condition \(S(a + b) = S(a) + S(b)\) (where \(S(n)\) denotes the sum of the digits of a natural number \(n\)) is \(\infty\).","import Mathlib open Finset def S : ℕ → ℕ | n => (Nat.digits 10 n).sum theorem prove_infinite : IsGreatest {k | ∃ J : Finset ℕ, J.card = k ∧ ∀ a ∈ J, ∀ b ∈ J, a ≠ b → S (a + b) = S a + S b} atTop := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-290710,"Prove that the function \( f = P \circ G \), where \(G: \mathbb{R} \to \mathbb{R}^2\) is a continuous surjective map constructed by gluing together continuous surjective maps from intervals \([n, n + 1]\) to squares \(S_n\) that tile the plane with endpoints mapped to \((0,0)\) and \(P: \mathbb{R}^2 \to \mathbb{R}\) is the standard projection map \(P(x,y)=x\), is a continuous function \(f : \mathbb{R} \to \mathbb{R}\) such that for every \(a \in \mathbb{R}\), the preimage \(f^{-1}(a)\) is uncountable.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem ContinuousProjection (G : ℝ → (ℝ × ℝ)) (hG : Continuous G ∧ Function.Surjective G) (P : (ℝ × ℝ) → ℝ) (hP : P = λ (x, y) => x) : Continuous (λ x => P (G x)) ∧ ∀ a, ¬Set.Countable {x | P (G x) = a} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-290715,"Prove that for a country with \(n = 64\) towns where some pairs of towns are connected by roads, and one can ask yes - no questions about the direct connection between any two specific towns to determine if the entire network of towns is connected (i.e., for any two towns, there exists a sequence of roads that allows travel from one to the other), the minimum number of such questions required is at least \(2016\).","import Mathlib theorem min_questions (n : ℕ) (hn : n = 64) : IsLeast {k | ∃ s : Finset (Fin n × Fin n), s.card = k ∧ (∀ i j, i ≠ j → ∃ x ∈ s, x.1 = i ∧ x.2 = j ∨ x.1 = j ∧ x.2 = i)} 2016 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-290722,"1. **Extract the final conclusions**: - From the assistant's answer, for part (a) when \(k = 41\), the conclusion is that no positive - integer \(n\) exists such that the described group exists. - For part (b) when \(k = 39\), the conclusion is that the positive integers \(n\) for which such a group exists are all \(n\geq381\). 2. **Rewrite the problem as formal proof statements**: - **Part (a)**: Prove that for a group of \(n>20\) people where some pairs of people know each other (and the relationship is symmetric), if the property holds that when any \(20\) people are removed from the group, the number of pairs of people that know each other is at most \(\frac{n - 41}{n}\) times the number of such pairs in the original group, then there is no positive - integer \(n\) for which such a group exists. - **Part (b)**: Prove that for a group of \(n>20\) people where some pairs of people know each other (and the relationship is symmetric), the positive integers \(n\) for which the property holds that when any \(20\) people are removed from the group, the number of pairs of people that know each other is at most \(\frac{n - 39}{n}\) times the number of such pairs in the original group are all \(n\geq381\).","import Mathlib open Finset theorem part_a {n : ℕ} (hn : n > 20) : ¬∃ s : Finset ℕ, s.card = n ∧ ∀ t ⊆ s, t.card = 20 → {p | ∃ x ∈ t, ∃ y ∈ t, p = (x, y) ∧ x ≠ y}.ncard ≤ ((n - 41) / n : ℝ) * {p | ∃ x ∈ s, ∃ y ∈ s, p = (x, y) ∧ x ≠ y}.ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-290758,"Prove that for a natural number \(n \geq 2\), a permutation \(\left( a_{1}, a_{2}, \ldots, a_{n} \right)\) of \(\left( 1, 2, \ldots, n \right)\), and three children placed at positions \(x_A,x_B,x_C \in \left\{ 1, 2, \ldots, n \right\}\) (where raisins are distributed according to the given rules), all three children can be happy if and only if \(2 \leq n \leq 8\).","import Mathlib theorem Prove( n : ℕ ) (hn : 2 ≤ n) : (∃ a : Fin n → ℕ, (∀ i j, a i = a j → i = j) ∧ (∀ i, a i ∈ Finset.Icc 1 n) ∧ (∃ x_A x_B x_C : Fin n, x_A ≠ x_B ∧ x_A ≠ x_C ∧ x_B ≠ x_C ∧ (a x_A + a x_B + a x_C) % n = 0)) ↔ 2 ≤ n ∧ n ≤ 8 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-290769,Let \(a_1 < a_2 < \ldots < a_k\) be a set of \(k\) distinct positive integers such that all \(2^k\) subsets of this set have distinct sums. Prove that \(\frac{1}{a_1} + \frac{1}{a_2} + \ldots + \frac{1}{a_k} < 2\).,"import Mathlib open Finset Real theorem sum_of_reciprocal (k : ℕ) (a : Fin k → ℕ) (ha : StrictMono a) (hpos : ∀ i, 0 < a i) (hsum : ∀ s1 s2 : Finset (Fin k), s1 ≠ s2 → ∑ i ∈ s1, a i ≠ ∑ i ∈ s2, a i) : ∑ i, (1 : ℝ)/(a i) < 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-290781,"Prove that if a grasshopper is situated at an integer point \((x_0, y_0)\) in the Euclidean plane and jumps to another integer point each second according to a constant jump vector \(\langle x_1, y_1 \rangle\), a hunter who can select one integer point in the plane each second can devise a strategy to guarantee that the grasshopper will be caught in a finite amount of time.","import Mathlib theorem prove_grasshopper_catch (x0 y0 x1 y1 : ℤ) : ∃ t : ℕ, ∃ x2 y2 : ℤ, x2 - x0 = x1 * t ∧ y2 - y0 = y1 * t := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-291220,"Let $F$ be a family consisting of $n$ sets, each of size $10$. Suppose that for every subset of $2004$ sets from $F$, there exists an element $x$ that belongs to at least $11$ of these sets. Prove that there exists a set of size $2003$ that intersects with every set in $F$.","import Mathlib theorem qwen (F : Finset (Finset ℕ)) (hF : ∀ s ∈ F, s.card = 10) (hF' : ∀ T ⊆ F, T.card = 2004 → ∃ x, {s | s ∈ T ∧ x ∈ s}.ncard ≥ 11) : ∃ S, S.card = 2003 ∧ ∀ s ∈ F, S ∩ s ≠ ∅ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-291249,"Color each element of the set \( M = \{1, 2, \cdots, n\} \) with one of three given colors. Let \begin{equation} A = \{(x, y, z) \mid x, y, z \in M, x + y + z \equiv 0 \pmod{n}, x, y, z \text{ are of the same color}\}, \end{equation} \begin{equation} B = \{(x, y, z) \mid x, y, z \in M, x + y + z \equiv 0 \pmod{n}, x, y, z \text{ are pairwise distinct in color}\}. \end{equation} Prove that \( 2|A| \geq |B| \).","import Mathlib theorem colorings (n : ℕ) (hn : 0 < n) (M : Finset ℕ) (hM : M = Finset.Icc 1 n) (f : M → Fin 3) : 2 * {(x, y, z) : M × M × M | x + y + z ≡ 0 [MOD n] ∧ f x = f y ∧ f y = f z}.ncard ≥ {(x, y, z) : M × M × M | x + y + z ≡ 0 [MOD n] ∧ f x ≠ f y ∧ f y ≠ f z ∧ f x ≠ f z}.ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-291272,"Prove that for a board with $n$ nails where every pair of nails is connected by a rope and each rope is colored with one of $n$ distinct colors such that for any three different colors, there exist three nails that are connected by ropes of those three colors, it is not possible for $n = 6$ and it is possible for $n = 7$.","import Mathlib theorem n6 : ¬∃ f : Fin 6 → Fin 6 → Fin 6, (∀ i j, f i j = f j i) ∧ (∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → ∃ x y z, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ f x y = i ∧ f y z = j ∧ f z x = k) := by sorry theorem n7 : ∃ f : Fin 7 → Fin 7 → Fin 7, (∀ i j, f i j = f j i) ∧ (∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → ∃ x y z, x ≠ y ∧ y ≠ z ∧ z ≠ x ∧ f x y = i ∧ f y z = j ∧ f z x = k) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-291543,"Let $\mathbb{P}_n$ denote the power set of $\{1, 2, \cdots, n\}$. Define $c(n, m)$ as the number of functions $f : \mathbb{P}_n \to \{1, 2, \cdots, m\}$ such that for all $A, B \in \mathbb{P}_n$, $f(A \cap B) = \min\{f(A), f(B)\}$. Prove that $c(n, m) = \sum_{j = 1}^m j^n$.","import Mathlib open Finset theorem c {n m : ℕ} : {f : Finset (Finset.Icc 1 n) → Finset.Icc 1 m | ∀ A B : Finset (Finset.Icc 1 n), f (A ∩ B) = min (f A) (f B)}.ncard = ∑ j ∈ Icc 1 m, j ^ n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-291686,"Prove that for a regular \(n = 7\) -gon, if one starts at a vertex and moves to an adjacent vertex with equal probability in each move, the probability \(P\) of returning to the starting vertex after \(k\) moves is given by: \[ P = \begin{cases} \frac{1}{2^k} \left( \binom{k}{0} + \binom{k}{7} + \binom{k}{14} + \cdots \right) & \text{if } k \equiv 0 \mod 7 \\ \frac{1}{2^k} \left( \binom{k}{4} + \binom{k}{11} + \binom{k}{18} + \cdots \right) & \text{if } k \equiv 1 \mod 7 \\ \frac{1}{2^k} \left( \binom{k}{1} + \binom{k}{8} + \binom{k}{15} + \cdots \right) & \text{if } k \equiv 2 \mod 7 \\ \frac{1}{2^k} \left( \binom{k}{5} + \binom{k}{12} + \binom{k}{19} + \cdots \right) & \text{if } k \equiv 3 \mod 7 \\ \frac{1}{2^k} \left( \binom{k}{2} + \binom{k}{9} + \binom{k}{16} + \cdots \right) & \text{if } k \equiv 4 \mod 7 \\ \frac{1}{2^k} \left( \binom{k}{6} + \binom{k}{13} + \binom{k}{20} + \cdots \right) & \text{if } k \equiv 5 \mod 7 \\ \frac{1}{2^k} \left( \binom{k}{3} + \binom{k}{10} + \binom{k}{17} + \cdots \right) & \text{if } k \equiv 6 \mod 7 \end{cases} \]","import Mathlib open Finset Real Nat theorem prove {n : ℕ} (hn : n = 7) : ∀ k : ℕ, ∑ i ∈ range (n + 1), Nat.choose k (i * n + 0) / 2 ^ k = if k ≡ 0 [MOD n] then ∑ i ∈ range (n + 1), Nat.choose k (i * n + 0) / 2 ^ k else if k ≡ 1 [MOD n] then ∑ i ∈ range (n + 1), Nat.choose k (i * n + 4) / 2 ^ k else if k ≡ 2 [MOD n] then ∑ i ∈ range (n + 1), Nat.choose k (i * n + 1) / 2 ^ k else if k ≡ 3 [MOD n] then ∑ i ∈ range (n + 1), Nat.choose k (i * n + 5) / 2 ^ k else if k ≡ 4 [MOD n] then ∑ i ∈ range (n + 1), Nat.choose k (i * n + 2) / 2 ^ k else if k ≡ 5 [MOD n] then ∑ i ∈ range (n + 1), Nat.choose k (i * n + 6) / 2 ^ k else if k ≡ 6 [MOD n] then ∑ i ∈ range (n + 1), Nat.choose k (i * n + 3) / 2 ^ k else 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-291734,"Prove that the number of ways to order twenty ballots, where Donald and Joe each receive $10$ votes, such that among any consecutive six votes, there is at least one vote for Donald and one vote for Joe, is \(165114\).","import Mathlib theorem prove : Set.ncard {x : Fin 20 → ℕ | ∃ p q : Finset (Fin 20), p.card = 10 ∧ q.card = 10 ∧ (∀ i ∈ p, x i = 1) ∧ (∀ i ∈ q, x i = 0) ∧ (∀ j : Fin 20, j + 5 < 20 → ∃ k ∈ p, x k = 1 ∧ ∃ m ∈ q, x m = 0)} = 165114 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-291768,"Prove that the number of functions $f:A \to A$, where $A = \{1, 2, 3, \ldots, 10\}$, that satisfy the conditions (1) for all $x \in A$, $f^{30}(x) = x$ and (2) for all $k \in \mathbb{N}$ with $1 \le k \le 29$, there exists an $a \in A$ such that $f^k(a) \neq a$, is equal to \(658161\).","import Mathlib open Finset theorem number_of_favorable_outcomes : {f : Fin 10 → Fin 10 | (∀ i, f^[30] i = i) ∧ ∀ k ∈ Icc 1 29, ∃ a, f^[k] a ≠ a}.ncard = 658161 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-292034,"1. Prove that for any \(n \in \mathbb{Z}^+\), there exists \(m \in \mathbb{Z}^+\) and a prime number \(p \equiv 5 \ (\text{mod} \ 6)\) such that \(p \nmid n\) and \(n \equiv m^3 \ (\text{mod} \ p)\). 2. Prove that if \(n \ge 1\) is an integer and there exist \(2k\) distinct positive integers \(a_1, a_2, \ldots, a_k, b_1, b_2, \ldots, b_k\) such that the sums \(a_1 + b_1, a_2 + b_2, \ldots, a_k + b_k\) are all distinct and strictly less than \(n\), then \(k \le \frac{2n-3}{5}\).","import Mathlib theorem prove1 (n : ℕ) (hn : 0 < n) : ∃ m : ℕ, 0 < m ∧ ∃ p : ℕ, Nat.Prime p ∧ p ≡ 5 [MOD 6] ∧ ¬p ∣ n ∧ n ≡ m ^ 3 [MOD p] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-292253,"设 \mathcal{A} 是所有关于 x,y,z 的整系数多项式构成的集合. 设 \mathcal{B} 是由可以表示为如下形式的多项式构成的 \mathcal{A} 的子集:(x+y+z)P(x,y,z)+(xy+yz+zx)Q(x,y,z)+xyzR(x,y,z),其中 P,Q,R\in\mathcal{A}. 求最小的非负整数 n,使得对任意满足 i+j+k\geq n 的非负整数 i,j,k,均有 x^iy^jz^k\in\mathcal{B}. prove that answer is 4","import Mathlib open MvPolynomial theorem answer_is_4 : IsLeast {n | ∀ i j k : ℕ, (i + j + k ≥ n) → ∃ P Q R : MvPolynomial (Fin 3) ℤ, (MvPolynomial.X 0 ^ i * MvPolynomial.X 1 ^ j * MvPolynomial.X 2 ^ k : MvPolynomial (Fin 3) ℤ) ∈ {p | ∃ P Q R : MvPolynomial (Fin 3) ℤ, p = (MvPolynomial.X 0 + MvPolynomial.X 1 + MvPolynomial.X 2) * P + (MvPolynomial.X 0 * MvPolynomial.X 1 + MvPolynomial.X 1 * MvPolynomial.X 2 + MvPolynomial.X 2 * MvPolynomial.X 0) * Q + (MvPolynomial.X 0 * MvPolynomial.X 1 * MvPolynomial.X 2 : MvPolynomial (Fin 3) ℤ)}} 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-292269,"Let $n \times n$ be a board filled with $0$'s and $1$'s such that any subset of $n$ squares, where no two squares are in the same row or column, contains at least one $1$. Prove that there exist $i$ rows and $j$ columns with $i + j \ge n + 1$ such that the intersection of these rows and columns contains only $1$'s.","import Mathlib theorem Qwen (n : ℕ) (hn : 0 < n) (a : Fin n → Fin n → Bool) (ha : ∀ s : Finset (Fin n × Fin n), (∀ i ∈ s, ∀ j ∈ s, i ≠ j → i.1 ≠ j.1 ∧ i.2 ≠ j.2) → ∃ i ∈ s, a i.1 i.2 = True) : ∃ i j : Finset (Fin n), i.card + j.card ≥ n + 1 ∧ (∀ x ∈ i, ∀ y ∈ j, a x y = True) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-292311,"In the $\textit{Fragmented Game of Spoons}$, eight players are seated in a row, each holding a hand of four cards. Each round, the first player in the row draws the top card from a stack of unplayed cards and either passes it to the second player with probability $\frac{1}{2}$, or swaps it with one of the four cards in his hand, each card having an equal chance of being chosen, and then passes the new card to the second player. The second player then takes the card from the first player and chooses a card to pass to the third player in the same manner. This process continues until the eighth player is passed a card, at which point the card he chooses to pass is removed from the game, and the next round begins. A player wins by holding four cards of the same number, one of each suit. During a game, David, the eighth player, needs an Ace of Clubs to win. At the start of a round, the dealer picks up an Ace of Clubs from the deck. Suppose that Justin, the fifth player, also has an Ace of Clubs, and that all other Ace of Clubs cards have been removed from the game. Let the probability that David is passed an Ace of Clubs during the round be expressed as $\frac{m}{n}$, where $m$ and $n$ are positive integers with $\gcd(m, n) = 1$. Prove that $100m + n = 628$.","import Mathlib theorem Fragmented_Game_of_Spoons (m n : ℕ) (hm : m > 0) (hn : n > 0) (hmn : Nat.gcd m n = 1) : 100 * m + n = 628 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-292450,"Let $n$ be a positive integer, and let the set $H = \{[\sqrt{2}i] \mid i \in \mathbb{N}_+\}$. Prove that there exists a constant $C$ such that for any subset $A \subseteq \{1, 2, \cdots, n\}$, if $|A| \geq C\sqrt{n}$, then there exist $a, b \in A$ satisfying $a - b \in H$.","import Mathlib open Real Set open scoped BigOperators theorem prove (n : ℕ) (hn : 0 < n) : ∃ C : ℝ, ∀ A ⊆ Finset.Icc 1 n, A.card ≥ C * sqrt n → ∃ a ∈ A, ∃ b ∈ A, a ≠ b ∧ ∃ i : ℕ, 0 < i ∧ ⌊Real.sqrt 2 * i⌋ = a - b := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-292497,"对每个正整数 $n$, 记 $g(n)$ 为 $n$ 与 $2015$的最大公约数. 求满足下列条件的有序三元数组 $(a, b, c)$ 的个数: $(1) a 、 b 、 c \in\{1,2, \cdots, 2015\} ;$ $(2) g(a) 、 g(b) 、 g(c) 、 g(a+b) 、$ $g(b+c) 、 g(c+a) 、 g(a+b+c)$ 这七个数两两不同. prove that answer is 138240","import Mathlib def g : ℕ → ℕ | n => Nat.gcd n 2015 theorem solution : {(a, b, c) : ℕ × ℕ × ℕ | a ∈ Finset.Icc 1 2015 ∧ b ∈ Finset.Icc 1 2015 ∧ c ∈ Finset.Icc 1 2015 ∧ (Nat.card {x | x = g a ∨ x = g b ∨ x = g c ∨ x = g (a + b) ∨ x = g (b + c) ∨ x = g (c + a) ∨ x = g (a + b + c)}) = 7}.ncard = 138240 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-292558,"Prove that in a group of \(kn\) persons, where each person knows more than \((k - 1)n\) others (\(k\) and \(n\) are positive integers), one can choose \(k + 1\) persons from this group such that every chosen person knows all the others chosen.","import Mathlib theorem prove (k n : ℕ) (hk : 0 < k) (hn : 0 < n) (a : Fin (k * n) → Fin (k * n)) (ha : ∀ i j, a i = j → a j = i) (h : ∀ i, {j | a j = i}.ncard > (k - 1) * n) : ∃ s : Finset (Fin (k * n)), s.card = k + 1 ∧ (∀ i ∈ s, ∀ j ∈ s, i ≠ j → a i = j) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-292570,"Prove that for an odd integer \(n = 2k + 1>1\), there exists a permutation \(a_0, a_1, \ldots, a_k\) of the set \(\{0, 1, \ldots, k\}\) such that \(a_1^2 - a_0^2 \equiv a_2^2 - a_1^2 \equiv \cdots \equiv a_k^2 - a_{k - 1}^2 \pmod{n}\) if and only if \(k \leq 2\).","import Mathlib theorem Odd_n_2k (n : ℕ) (hn : n > 1) (k : ℕ) (h : n = 2 * k + 1) : ∃ a : Fin (k + 1) → ℕ, (∀ i j, a i = a j → i = j) ∧ (∀ i, a i ∈ Finset.range (k + 1)) ∧ (∃ d, ∀ i, a (i + 1) ^ 2 - a i ^ 2 ≡ d [ZMOD n]) ↔ k ≤ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-292574,"In a group of \(kn\) persons, each person knows more than \((k - 1)n\) others. (Here \(k\) and \(n\) are positive integers.) Prove that one can choose \(k + 1\) persons from this group such that every chosen person knows all the others chosen. (A knows B if and only if B knows A, as usual.)","import Mathlib theorem qwen {k n : ℕ} (hk : 0 < k) (hn : 0 < n) (a : Fin (k * n) → Fin (k * n) → Prop) (ha : ∀ i j, a i j ↔ a j i) (h : ∀ i, {j | a i j}.ncard > (k - 1) * n) : ∃ s : Finset (Fin (k * n)), s.card = k + 1 ∧ (∀ i ∈ s, ∀ j ∈ s, a i j) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-292611,"(a) Prove that for a prime number \(p\), there exists a positive integer \(n\) such that the \(n\)th row of Pascal's triangle forms a complete residue class modulo \(p\). (b) Prove that for a prime number \(p\), there exists a positive integer \(n \leq p^2\) such that the \(n\)th row of Pascal's triangle forms a complete residue class modulo \(p\).","import Mathlib open Finset theorem Nat.choose_pall (p : ℕ) [hp : Fact (Nat.Prime p)] : (∃ n : ℕ, 0 < n ∧ ∀ k ∈ range p, ∃! i ∈ range (n + 1), Nat.choose n i ≡ k [MOD p]) ∧ (∃ n : ℕ, 0 < n ∧ n ≤ p ^ 2 ∧ ∀ k ∈ range p, ∃! i ∈ range (n + 1), Nat.choose n i ≡ k [MOD p]) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-292634,"Prove that the only odd integers \(n = 2k + 1>1\) for which there exists a permutation \(a_0, a_1, \ldots, a_k\) of the set \(\{0, 1, \ldots, k\}\) such that \(a_1^2 - a_0^2 \equiv a_2^2 - a_1^2 \equiv \cdots \equiv a_k^2 - a_{k - 1}^2 \pmod{n}\) are \(n = 3\) and \(n = 5\).","import Mathlib theorem OddN (n : ℕ) : n > 1 ∧ ∃ k, n = 2 * k + 1 ∧ ∃ a : Fin (k + 1) → ℕ, (∀ i j, i < j → a i < a j) ∧ (∀ i, a i ∈ Finset.range (k + 1)) ∧ (∃ d, ∀ i, a (i + 1) ^ 2 - a i ^ 2 ≡ d [ZMOD n]) ↔ n = 3 ∨ n = 5 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-292744,"Let $A_1, A_2, \ldots, A_{20}$ and $B_1, B_2, \ldots, B_{20}$ be two families of disjoint subsets of the set $\{1, 2, 3, \ldots, 400\}$, where each subset $A_i$ and $B_i$ contains exactly 20 elements. Prove that it is possible to find a bijection $f: \{1, 2, \ldots, 20\} \to \{1, 2, \ldots, 20\}$ such that $A_i \cap B_{f(i)} \neq \emptyset$ for all $i \in \{1, 2, \ldots, 20\}$.","import Mathlib theorem DisjointSets {A B : Fin 20 → Set ℕ} (hA : ∀ i, A i ⊆ Finset.Icc 1 400) (hB : ∀ i, B i ⊆ Finset.Icc 1 400) (hAB : ∀ i j, i ≠ j → A i ∩ A j = ∅ ∧ B i ∩ B j = ∅) (hA' : ∀ i, (A i).encard = 20) (hB' : ∀ i, (B i).encard = 20) : ∃ f : Fin 20 → Fin 20, Function.Bijective f ∧ ∀ i, A i ∩ B (f i) ≠ ∅ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-293058,"**Prove the following:** Let \((a_1, a_2, \ldots, a_{24})\) be a rearrangement of \((1, 2, \ldots, 24)\) such that for every pair \((i, j)\) with \(1 \leq i, j \leq 24\), at least one of the following holds: \[ a_i - a_j = i - j \quad \text{or} \quad a_i + a_j = i + j. \] Furthermore, when \(a_1\) is composite, the rearrangement is uniquely determined. For this unique rearrangement, compute the product \(a_{11} \times a_{12} \times a_{13}\). **Answer:** \(\boxed{1152}\)","import Mathlib theorem prove (a : Fin 24 → ℕ) (ha : ∃ p : Equiv.Perm (Fin 24), ∀ i, a i = p i + 1) (h : ∀ i j, i ≠ j → a i - a j = i - j ∨ a i + a j = i + j) (h' : ¬Prime (a 0)) : a 10 * a 11 * a 12 = 1152 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/OnlineMathContest, flc-293184,Prove that there exist two infinite sets \(A\) and \(B\) such that every integer can be written uniquely as a sum of an element from \(A\) and an element from \(B\).,"import Mathlib theorem number_theory_263765 : ∃ A B : Set ℤ, Infinite A ∧ Infinite B ∧ ∀ n : ℤ, ∃! m ∈ A, ∃! p ∈ B, n = m + p := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-293192,"Prove that if \(S = \{1, 2, 3, \ldots, 2006\}\) is partitioned into two disjoint subsets \(A\) and \(B\) such that \(13 \in A\), if \(a \in A\), \(b \in B\), and \(a + b \in S\), then \(a + b \in B\), and if \(a \in A\), \(b \in B\), and \(ab \in S\), then \(ab \in A\), then the number of elements in \(A\) is either \(12\), \(154\), or \(2006\).","import Mathlib theorem Finset.card_A (A B : Finset ℕ) (h₀ : A ∪ B = Finset.Icc 1 2006) (h₁ : A ∩ B = ∅) (h₂ : 13 ∈ A) (h₃ : ∀ a ∈ A, ∀ b ∈ B, a + b ∈ Finset.Icc 1 2006 → a + b ∈ B) (h₄ : ∀ a ∈ A, ∀ b ∈ B, a * b ∈ Finset.Icc 1 2006 → a * b ∈ A) : A.card = 12 ∨ A.card = 154 ∨ A.card = 2006 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-293245,"Prove that the number of bijective functions \(f : \{1, 2, 3, \dots, 8\} \rightarrow \{1, 2, 3, \dots, 8\}\) such that \(f(f(f(a))) \neq a\) for all \(a \in \{1, 2, 3, \dots, 8\}\) is \(378\).","import Mathlib theorem number_of_Bijective_fuctions : Set.ncard {f : Equiv.Perm (Fin 8) | ∀ a, f (f (f a)) ≠ a} = 378 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-293288,Prove that the positive - integer solution \(n\) of the equation \(\frac{\binom{n}{0}}{1 \cdot 2}+\frac{\binom{n}{1}}{2 \cdot 3}+\frac{\binom{n}{2}}{3 \cdot 4}+\cdots+\frac{\binom{n}{n}}{(n + 1)(n + 2)}=\frac{2^{100}-n - 3}{(n + 1)(n + 2)}\) is \(n = 98\).,"import Mathlib theorem prove (n : ℕ) (hn : n > 0) : ∑ i ∈ Finset.range (n + 1), Nat.choose n i / ((i + 1) * (i + 2) : ℚ) = (2 ^ 100 - n - 3) / ((n + 1) * (n + 2)) ↔ n = 98 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-293301,"问:至多能从集合 \{1,2,\cdots,100\} 中取出多少个数,使得其中任意不同两数的和与积均不为 100 的倍数? prove that answer is 45","import Mathlib theorem S : IsGreatest {k | ∃ T : Finset ℕ, T ⊆ Finset.Icc 1 100 ∧ T.card = k ∧ ∀ x ∈ T, ∀ y ∈ T, x ≠ y → ¬(100 ∣ x + y) ∧ ¬(100 ∣ x * y)} 45 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-293302,"设函数 f:\{1,2,\cdots,2019\}\rightarrow\{-1,1\},满足对任意 1\leq k\leq 2019,存在 1\leq l\leq 2019,使得\ds{i:(l-i)(i-k)\geq0}{}f(i)\leq0.求 \ds{i=1}{2019}f(i) 的最大值. prove that answer is 673","import Mathlib open Finset theorem max_value (f : ℕ → ℤ) (hf : ∀ i ∈ Icc 1 2019, f i = -1 ∨ f i = 1) (h : ∀ k ∈ Icc 1 2019, ∃ l ∈ Icc 1 2019, ∀ i ∈ Icc 1 2019, ((l - i) * (i - k) ≥ 0 → f i ≤ 0)) : IsGreatest {∑ i ∈ Icc 1 2019, f i} 673 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-293439,"设 f(x)=\ds{i=1}{2013}\left[\df{x}{i!}\right]. 对整数 n,若关于 x 的方程 f(x)=n 有实数解,则称 n 为""好数"". 求 \{1,3,5,\cdots,2013\} 中好数的个数. prove that answer is 587","import Mathlib open Finset Real Nat theorem number_of_f (f : ℝ → ℝ) (h₀ : ∀ x, f x = ∑ i ∈ range 2013, ⌊x / (Nat.factorial (i + 1))⌋) : {n : ℕ | Odd n ∧ n ≤ 2013 ∧ ∃ x : ℝ, f x = n}.ncard = 587 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-293545,"Let \( X = \{1, 2, \cdots, 2001\} \). Find the smallest positive integer \( m \) such that the following condition is satisfied: For any \( m \)-element subset \( W \) of \( X \), there exist \( u, v \in W \) (\( u \) and \( v \) can be the same) such that \( u + v \) is a power of 2.","import Mathlib def X : Finset ℕ := Finset.Icc 1 2001 theorem minm : IsLeast {m | 0 < m ∧ ∀ W ⊆ X, W.card = m → ∃ u ∈ W, ∃ v ∈ W, u + v = 2 ^ (Nat.factorization (u + v) 2)} 1345 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-293547,"Let $m\ge 5$ be an odd integer, and let $D(m)$ denote the number of quadruples $(a_1, a_2, a_3, a_4)$ of distinct integers with $1\le a_i \le m$ for all $i$ such that $m$ divides $a_1+a_2+a_3+a_4$. There is a polynomial \[q(x) = c_3x^3+c_2x^2+c_1x+c_0\]such that $D(m) = q(m)$ for all odd integers $m\ge 5$. Find the value of $c_1$. prove that answer is 11","import Mathlib theorem q : ∃ c0 c1 c2 c3 : ℤ, ∀ m ≥ 5, Odd m → {p : Fin 4 → ℕ | p.Injective ∧ (∀ i, 1 ≤ p i ∧ p i ≤ m) ∧ m ∣ p 0 + p 1 + p 2 + p 3}.ncard = c3 * m ^ 3 + c2 * m ^ 2 + c1 * m + c0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-293760,"Prove that the number of polynomials of degree 5 with distinct coefficients from the set $\{1,2,3,4,5,6,7,8\}$ that are divisible by the polynomial $x^2 - x + 1$ is \(336\).","import Mathlib theorem count : Set.ncard {p : Polynomial ℤ | p.degree = 5 ∧ ∀ n ∈ p.coeffs, n ∈ Set.Icc 1 8 ∧ ∀ i ∈ Finset.range (p.natDegree + 1), ∀ j ∈ Finset.range (p.natDegree + 1), p.coeff i = p.coeff j → i = j ∧ (X ^ 2 - X + 1) ∣ p} = 336 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-293830,Prove that the maximum size of a set \(S\) such that the sum of any three distinct elements of \(S\) is a prime number is \(4\).,"import Mathlib theorem max_size (S : Finset ℕ) (hS : ∀ x ∈ S, ∀ y ∈ S, ∀ z ∈ S, x ≠ y ∧ y ≠ z ∧ z ≠ x → Prime (x + y + z)) : S.card ≤ 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-293851,"Prove that: 1. There exists a primitive set of infinite cardinality. 2. There are infinitely many primitive sets of infinite cardinality. 3. For a primitive set \(P\) of infinite cardinality, the upper - bound of the sum \(\sum_{n \in P} \frac{1}{n \log n}\) is \(\sum_{p \in \mathbb{P}} \frac{1}{p \log p}\), where \(\mathbb{P}\) is the set of all prime numbers.","import Mathlib open Real theorem InfinitePrimitiveSet : (∃ P : Set ℕ, Infinite P ∧ ∀ n ∈ P, n > 0 ∧ ∀ m ∈ P, m > 0 → n ≠ m → Nat.Coprime n m) ∧ {P : Set ℕ | Infinite P ∧ ∀ n ∈ P, n > 0 ∧ ∀ m ∈ P, m > 0 → n ≠ m → Nat.Coprime n m}.Infinite ∧ ∀ P : Set ℕ, Infinite P ∧ (∀ n ∈ P, n > 0 ∧ ∀ m ∈ P, m > 0 → n ≠ m → Nat.Coprime n m) → ∑ᶠ n ∈ P, (1 / (n * log n)) ≤ ∑ᶠ p ∈ {x | Nat.Prime x}, (1 / (p * log p)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-293941,"Matt is asked to write the numbers from 1 to 10 in order, but he forgets how to count. He writes a permutation of the numbers $\{1, 2, 3\ldots , 10\}$ across his paper such that: [list] [*]The leftmost number is 1. [*]The rightmost number is 10. [*]Exactly one number (not including 1 or 10) is less than both the number to its immediate left and the number to its immediate right.[/list] How many such permutations are there? prove that answer is 1636","import Mathlib theorem solution : {f : Fin 10 → ℕ | f.Injective ∧ ∀ i, f i ∈ Set.Icc 1 10 ∧ f 0 = 1 ∧ f 9 = 10 ∧ (∃! j, j ≠ 0 ∧ j ≠ 9 ∧ f j < f (j - 1) ∧ f j < f (j + 1))}.ncard = 1636 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-294025,"**Prove that** there are exactly 126 triples of integers \((a, b, c)\) satisfying the following conditions: 1. Any two distinct elements of \(\{a, b, c\}\) have a greatest common divisor of at least 2. 2. The greatest common divisor of the pairwise products, \(\gcd(ab, bc, ca)\), is equal to 105. *Provide a complete justification for your count.*","import Mathlib theorem count: {(a, b, c) : ℤ × ℤ × ℤ | a ≠ b ∧ b ≠ c ∧ c ≠ a ∧ Int.gcd a b ≥ 2 ∧ Int.gcd b c ≥ 2 ∧ Int.gcd a c ≥ 2 ∧ Int.gcd (Int.gcd (a * b) (b * c)) (c * a) = 105}.encard = 126 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/OnlineMathContest, flc-294066,"Prove that given twelve distinct prime numbers, there always exist six primes \(a_1, a_2, a_3, a_4, a_5, a_6\) such that the expression \((a_1 - a_2)(a_3 + a_4)(a_5 - a_6)\) is divisible by \(1800\).","import Mathlib theorem P (s : Finset ℕ) (h₀ : s.card = 12) (h₁ : ∀ n ∈ s, Nat.Prime n) : ∃ a b c d e f : ℕ, a ∈ s ∧ b ∈ s ∧ c ∈ s ∧ d ∈ s ∧ e ∈ s ∧ f ∈ s ∧ Nat.Prime a ∧ Nat.Prime b ∧ Nat.Prime c ∧ Nat.Prime d ∧ Nat.Prime e ∧ Nat.Prime f ∧ 1800 ∣ (a - b) * (c + d) * (e - f) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-294168,"Prove that if \(n\) is a given positive integer and \(f(n)\) is the least possible number of positive - integer counterweights \(x_1\leq x_2\leq\cdots\leq x_k\) needed to weigh out the mass of any product weighing \(1,2,\cdots,n\) grams using a counter - balance without a sliding poise, then \(f(n)=m\), where \(m\in\mathbb{N}\) satisfies \(\frac{3^{m - 1}-1}{2} q) : n ≥ 2 ^ (k - 1) - 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-294215,"For positive integers \(m \geq 2\) and \(n \geq 3\), consider the set \[S = \left\{(a, b) \mid a \in \{1, 2, \cdots, m\}, b \in \{1, 2, \cdots, n\} \right\}.\] Let \(A\) be a subset of \(S\) such that there do not exist positive integers \(x_1, x_2, x_3, y_1, y_2, y_3\) with \(x_1 < x_2 < x_3\) and \(y_1 < y_2 < y_3\) for which \[(x_1, y_2), (x_2, y_1), (x_2, y_2), (x_2, y_3), (x_3, y_2) \in A.\] Prove that the maximum possible number of elements in \(A\) is \(2m + 2n - 4\).","import Mathlib theorem maxA (m n : ℕ) (hm : 2 ≤ m) (hn : 3 ≤ n) (A : Finset (ℕ × ℕ)) (hA : ∀ x ∈ A, x.1 ∈ Finset.Icc 1 m ∧ x.2 ∈ Finset.Icc 1 n) (hA' : ¬∃ x1 x2 x3 y1 y2 y3 : ℕ, 0 < x1 ∧ 0 < x2 ∧ 0 < x3 ∧ 0 < y1 ∧ 0 < y2 ∧ 0 < y3 ∧ x1 < x2 ∧ x2 < x3 ∧ y1 < y2 ∧ y2 < y3 ∧ (x1, y2) ∈ A ∧ (x2, y1) ∈ A ∧ (x2, y2) ∈ A ∧ (x2, y3) ∈ A ∧ (x3, y2) ∈ A) : A.card ≤ 2 * m + 2 * n - 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-294218,"Prove that the number of distinct ways \(c_n\) to tile a rectangular area of width \(n\) and height \(2\) using \(1 \times 2\), \(2 \times 1\), and \(2 \times 2\) blocks, where two tiling schemes that are bilateral symmetrical are considered the same, satisfies the recurrence relation \(c_n = c_{n-1} + 3c_{n-2} - c_{n-3} - 2c_{n-5} - 4c_{n-6}\), with initial values \(c_0 = 1\), \(c_1 = 1\), \(c_2 = 3\), \(c_3 = 3\), \(c_4 = 8\), and \(c_5 = 12\).","import Mathlib theorem tiling(c : ℕ → ℤ) (h₀ : c 0 = 1) (h₁ : c 1 = 1) (h₂ : c 2 = 3) (h₃ : c 3 = 3) (h₄ : c 4 = 8) (h₅ : c 5 = 12) : ∀ n, c (n + 6) = c (n + 5) + 3 * c (n + 4) - c (n + 3) - 2 * c (n + 1) - 4 * c n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-294220,"给定集合 $$ I=\left\{\left(x_{1}, x_{2}, x_{3}, x_{4}\right) \mid x_{i} \in\{1,2, \cdots, 11\}\right\}, $$ $A$ 为 $I$ 的子集且满足:对任意的 $$ \left(x_{1}, x_{2}, x_{3}, x_{4}\right) 、\left(y_{1}, y_{2}, y_{3}, y_{4}\right) \in A, $$ 均存在 $i 、 j(1 \leqslant i 0) ∧ (∀ x ∈ S, ∀ y ∈ S, ∀ z ∈ S, x ≠ y ∧ y ≠ z ∧ z ≠ x → ¬(∃ d, y = x + d ∧ z = y + d)) ∧ (∀ T : Finset ℕ, T.card = n → (∀ x ∈ T, x > 0) → (∀ x ∈ T, ∀ y ∈ T, ∀ z ∈ T, x ≠ y ∧ y ≠ z ∧ z ≠ x → ¬(∃ d, y = x + d ∧ z = y + d)) → ∑ s ∈ S, (1 : ℚ)/s ≥ ∑ s ∈ T, (1 : ℚ)/s) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-294443,"**Prove that the 1666th smallest positive integer \( N \) satisfying the following conditions is 7013:** 1. **Distinct digits:** When \( N \) is expressed in decimal notation, all its digits are distinct. 2. **Digit-sum condition:** When \( N \) is expressed in decimal notation, no two distinct digits sum to 9. 3. **Leading digit constraint:** The leading digit of \( N \) is not zero (unless \( N \) is a single-digit number, in which case both conditions are trivially satisfied). *Provide a complete justification for why 7013 is indeed the 1666th smallest such integer.*","import Mathlib theorem n : (Nat.nth {N | N > 0 ∧ (Nat.digits 10 N).length = (Nat.digits 10 N).toFinset.card ∧ ∀ d ∈ (Nat.digits 10 N), ∀ e ∈ (Nat.digits 10 N), d ≠ e → d + e ≠ 9} 1665) = 7013 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/OnlineMathContest, flc-294494,"**Demonstrate that** when performing repeated rounds of coin tosses starting with 4 coins—where in each round all remaining coins are flipped, heads are discarded, and tails are retained for the next round—the probability that the process terminates **exactly** after 5 rounds is \( \dfrac{1162097}{1679616} \). **Verify** that this fraction is in its simplest form (i.e., \( \gcd(1162097, 1679616) = 1 \)), and confirm that the sum of its numerator and denominator is **1162097 + 1679616 = 2841713**. *Provide a rigorous justification for your derivation.* *(Note: The final probability is given here to allow focus on the proof structure. Your solution should clearly establish the combinatorial reasoning or recursive framework leading to this result.)*","import Mathlib theorem combinatorial_prob (p : ℚ) (hp : p = 1162097 / 1679616) : p.den + p.num = 2841713 ∧ p.num.gcd p.den = 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/OnlineMathContest, flc-294528,"Prove that for a graph $G=(V, E)$ with $|V| = n$ vertices that does not contain a 4 - cycle, the number of edges $|E| = e$ satisfies the inequality \(e \leq \frac{n + n\sqrt{4n - 3}}{4}\).","import Mathlib open Real theorem Prove (n : ℕ) (hn : 0 < n) (G : Finset (Fin n × Fin n)) (hG : ∀ v ∈ G, ¬(∃ w x y z : Fin n, w ≠ x ∧ w ≠ y ∧ w ≠ z ∧ x ≠ y ∧ x ≠ z ∧ y ≠ z ∧ (w, x) ∈ G ∧ (x, y) ∈ G ∧ (y, z) ∈ G ∧ (z, w) ∈ G)) : G.card ≤ (n + n * sqrt (4 * n - 3)) / 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-294533,"**Part (a)**: Prove that if \(n \leq k + 1\), the game played on an infinite one - dimensional board with the given transfer and distribute moves can only be played for a finite number of moves. **Part (b)**: Prove that for all natural numbers \(k\), it is possible to choose a natural number \(n\) and distribute \(n\) coins on the infinite one - dimensional board with the given transfer and distribute moves such that the game can be played for an infinite number of moves.","import Mathlib open Finset theorem a {n k : ℕ} (hn : n ≤ k + 1) : Set.Finite {m | ∃ p : Fin m → ℕ, (∀ i j, i < j → p i + p j = p (i + j)) ∧ (∀ i, p i > 0) ∧ (∑' i, p i) = n} := by sorry theorem b {k : ℕ} : ∃ n : ℕ, ∃ p : ℕ → ℕ, (∀ i j, i < j → p i + p j = p (i + j)) ∧ (∀ i, p i > 0) ∧ (∑' i, p i) = n ∧ ¬Set.Finite {m | ∃ p : Fin m → ℕ, (∀ i j, i < j → p i + p j = p (i + j)) ∧ (∀ i, p i > 0) ∧ (∑' i, p i) = n} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-294682,"a) Prove that for a positive integer \(n\), where \(f(n)\) is the maximum number of elements in a set \(A\subset \{1,2,\ldots,n\}\) such that the congruence \(x + y\equiv u + v\pmod{n}\) has no solutions other than the trivial ones \(x = u, y = v\) and \(x = v, y = u\), we have \(f(n)<\sqrt{n}+1\). b) Prove that there exist infinitely many positive integers \(n\) such that for \(f(n)\) defined as the maximum number of elements in a set \(A\subset \{1,2,\ldots,n\}\) with the property that the congruence \(x + y\equiv u + v\pmod{n}\) has no solutions other than the trivial ones \(x = u, y = v\) and \(x = v, y = u\), we have \(f(n)>\sqrt{n}-1\).","import Mathlib open Real theorem a (f : ℕ → ℕ) (h₀ : ∀ n, f n = sSup {k | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 n ∧ A.card = k ∧ (∀ x ∈ A, ∀ y ∈ A, ∀ u ∈ A, ∀ v ∈ A, x + y ≡ u + v [MOD n] → x = u ∧ y = v ∨ x = v ∧ y = u)}) : ∀ n, 0 < n → f n < sqrt n + 1 := by sorry theorem b : ∀ N, ∃ n, n > N ∧ ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 n ∧ A.card > sqrt n - 1 ∧ (∀ x ∈ A, ∀ y ∈ A, ∀ u ∈ A, ∀ v ∈ A, x + y ≡ u + v [MOD n] → x = u ∧ y = v ∨ x = v ∧ y = u) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-294732,"a) Prove that \(|F| = \infty\). b) Prove that for each \(f \in F\), \(|v(f)| < \infty\). c) Prove that the maximum value of \(|v(f)|\) for \(f \in F\) is \(4n + 1\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove_a : Set.Infinite {f : ℝ → ℝ | ∃ x y, f x = y ∧ f y = x} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-294733,"Prove that the minimum cardinality \(n\) of a set \(A\) of integers such that for any set \(A\) with \(\text{card}(A)=n\), there exist \(a_1,a_2,\ldots,a_K\in A\) for which the sum \(a_1 + a_2+\cdots+a_K\) is divisible by \(K\) is \(2K - 1\).","import Mathlib theorem prove (K : ℕ) (hK : 0 < K) : IsLeast {n | ∀ A : Finset ℤ, A.card = n → ∃ a : Fin K → ℤ, (∀ i, a i ∈ A) ∧ (∑ i, a i) % K = 0} (2 * K - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-294776,"A standard deck contains 52 cards numbered from 1 to 52. You randomly select 26 cards without replacement. Determine the number of ways to select these 26 cards such that the sum of the reciprocals of their numbers is exactly 2. Prove that the answer is 0.","import Mathlib theorem card_sum (S : Finset ℕ) (hS : S ⊆ Finset.Icc 1 52) : S.card = 26 → ∑ x ∈ S, (1 : ℚ)/x ≠ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-294791,"**Demonstrate that** the maximum number of squares that can be selected in a \(100 \times 100\) grid, such that no three consecutively adjacent squares in any row or column all contain a flag, is **6667**. *Provide a rigorous proof for this claim.*","import Mathlib open Finset theorem max_squares (a : Fin 100 → Fin 100 → ℕ) (h₀ : ∀ i j, a i j = 0 ∨ a i j = 1) (h₁ : ∀ i j, ¬(a i j = 1 ∧ a i (j + 1) = 1 ∧ a i (j + 2) = 1)) (h₂ : ∀ i j, ¬(a i j = 1 ∧ a (i + 1) j = 1 ∧ a (i + 2) j = 1)) : IsGreatest {k | ∃ s : Finset (Fin 100 × Fin 100), s.card = k ∧ ∀ i ∈ s, a i.1 i.2 = 1} 6667 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/OnlineMathContest, flc-294814,"**Prove that** for the set \( S = \{1, 2, \ldots, 9000\} \), the average value of \( f(T) \) over all non-empty subsets \( T \subseteq S \) is \( \frac{b}{a} \) in lowest terms, where \( f(T) \) is the remainder when the product of the elements of \( T \) is divided by 3. **Furthermore, show that** when \( b \) is divided by the prime 2999, the remainder is 2211. *Your proof should justify the value of \( \frac{b}{a} \) and verify the claimed remainder.*","import Mathlib open Finset theorem sumOfRat (s : Finset ℕ) (f : Finset ℕ → ℚ) (hs: s = Icc 1 9000) (hf : ∀t ⊆ s, f t = (∏ i ∈ t, i) % 3) (a b : ℤ) (hab : a ≠ 0) (havg : (∑ x ∈ s.powerset \ {∅}, f x) / (∑x ∈ s.powerset \ {∅}, 1) = (b / a : ℝ)) (hab1 : IsCoprime a b) : b % 2999 = 2211 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/OnlineMathContest, flc-294838,"Let $\pi(n)$ denote the number of primes less than or equal to $n$. A subset of $S = \{1, 2, \ldots, n\}$ is called [i]primitive[/i] if there are no two elements in it such that one divides the other. Let $M(k)$ denote the number of primitive subsets of $S$ with $k$ elements. Prove that for $n \geq 5$ and $1 \leq k \leq \pi(n)/2$, \( M(k+1) \geq M(k) \).","import Mathlib open Finset theorem M {n : ℕ} (hn : n ≥ 5) (k : ℕ) (hk : 1 ≤ k ∧ k ≤ (Nat.primesBelow n).card / 2) : {s : Finset ℕ | s ⊆ Icc 1 n ∧ s.card = k + 1 ∧ ∀ x ∈ s, ∀ y ∈ s, x ≠ y → ¬(x ∣ y)}.ncard ≥ {s : Finset ℕ | s ⊆ Icc 1 n ∧ s.card = k ∧ ∀ x ∈ s, ∀ y ∈ s, x ≠ y → ¬(x ∣ y)}.ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-294913,"Prove that for any positive integer $n$, and for any integer $m$ where $1 < m \leq n$ and $m$ is not a prime power, given a set of $n$ chairs labeled from $1$ to $n$ and a set of $n$ sheets of paper labeled from $1$ to $n$, it is possible to assign each chair exactly one sheet of paper such that the number on the sheet does not match the number on the chair, and when $n$ party - guests are seated on the chairs (one guest per chair) and upon each clap from the magician, each guest moves to the chair labeled with the number on the sheet attached to their current chair, all guests will return to their original seats after exactly $m$ claps.","import Mathlib theorem prove (n : ℕ) (hn : 0 < n) (m : ℕ) (hm : 1 < m ∧ m ≤ n) (hmp : ¬∃ p k, Nat.Prime p ∧ m = p ^ k) : ∃ f : Fin n → Fin n, (∀ i j, f i = f j → i = j) ∧ (∀ i, f i ≠ i) ∧ (∃ c : ℕ, c = m ∧ ∀ i, f^[c] i = i) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-294965,"**Problem Statement:** Let \( N \) be a positive integer. Define \( v_2(N) \) as the exponent of the highest power of \( 2 \) dividing \( N \). Suppose the smallest positive integer \( k \) satisfying the following conditions is \( 102 \): 1. \( k \leq d(N) \), where \( d(N) \) is the number of positive divisors of \( N \). 2. For any selection of \( k \) distinct positive divisors of \( N \), there exist two distinct divisors \( d_1 \) and \( d_2 \) in the selection such that \( d_1 \cdot d_2 = N \). **Demonstrate that** the sum of all possible values of \( v_2(N) \) is \( 570 \). *Hint: Consider the structure of the divisor pairs of \( N \).*","import Mathlib open Finset theorem solution (N : ℕ) (hN : N ≠ 0) : IsLeast {k | 0 < k ∧ k ≤ (Nat.divisors N).card ∧ ∀ s : Finset ℕ, s ⊆ (Nat.divisors N) ∧ s.card = k → ∃ d ∈ s, ∃ e ∈ s, d ≠ e ∧ d * e = N} 102 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/OnlineMathContest, flc-294988,"给定一个 $2008 \times 2008$ 的棋盘,棋盘上每个小方格的颜色均不相同。在棋盘的每一个小方格中填人 $C 、 G 、 M 、 O$ 这 4 个字母中的一个, 若棋盘中每一个 $2 \times 2$ 的小棋盘中都有 $C 、 G 、 M 、 O$ 这 4 个字母,则称这个棋盘为""和谐棋盘""。标准答案的格式为$a\times b^{c}-d$,计算出a+b+c+d的值。 prove that answer is 2046","import Mathlib open Finset theorem a_b_c_d : ∃ a b c d, a * b ^ c - d = 2008 ∧ a + b + c + d = 2046 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-295004,"Let us refer to a rectangular of size$1 × k$ for any natural k a strip.For $n <= a$ and for $n > 2 · b + 1$can cut a $1995 × n$ rectangle into pairwise different strips, Find the value of $a+b$. prove that answer is 2993","import Mathlib theorem find_a_b (a b : ℕ) (ha : ∀ n ≤ a, ∃ s : Finset ℕ, s.card = n ∧ ∑ i ∈ s, i = 1995 * n) (hb : ∀ n > 2 * b + 1, ∃ s : Finset ℕ, s.card = n ∧ ∑ i ∈ s, i = 1995 * n) : a + b = 2993 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-295077,"设 $n=1990$, 则 $$ \frac{1}{2^{n}}\left(1-3 C_{n}^{2}+3^{2}{ C_n ^4}-3^{3} C_{n}^{6}+\cdots+3^{994} C_{n}^{1998}-3^{995} C_{n}^{1990}=\right. \qquad. $$ The original answer is in $-\frac{m}{n}$ format, please give the value of m + n. prove that answer is 3","import Mathlib open Finset Real Nat theorem q : ∃ m n : ℤ, m > 0 ∧ n > 0 ∧ (1 / 2 ^ 1990) * (∑ i ∈ range 1995, (-3 : ℝ) ^ i * Nat.choose 1990 (2 * i)) = -m / n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-295277,"Prove that the number of ways to label each unit - square of a \(2007\times2007\) board with either \(1\) or \(-1\) such that for every \(3\times3\) sub - square on the board, the absolute value of the sum of the numbers within that sub - square is less than or equal to \(1\) is \(2^{1006}-6\).","import Mathlib open Finset theorem number_of_ways : {f : (Fin 2007 × Fin 2007) → ℤ | ∀ i j, f (i, j) = 1 ∨ f (i, j) = -1 ∧ ∀ k l, k + 2 < 2007 → l + 2 < 2007 → |∑ x ∈ Icc k (k + 2), ∑ y ∈ Icc l (l + 2), f (x, y)| ≤ 1}.ncard = 2 ^ 1006 - 6 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-295336,"Let $N$ be the number of ways of distributing $52$ identical balls into $4$ distinguishable boxes such that no box is empty and the difference between the number of balls in any two of the boxes is not a multiple of $6$. If $N = 100a + b$, where $a, b$ are positive integers less than $100$, find $a + b$. prove that answer is 81","import Mathlib theorem distribution_ways : ∃ a b : ℕ, a > 0 ∧ b > 0 ∧ a < 100 ∧ b < 100 ∧ (Nat.card {x : Fin 4 → ℕ | x 0 ≠ 0 ∧ x 1 ≠ 0 ∧ x 2 ≠ 0 ∧ x 3 ≠ 0 ∧ ∀ i j, i ≠ j → ¬(6 ∣ x i - x j) ∧ ∑ i, x i = 52}) = 100 * a + b := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-295394,"Define an ordered triple $(A, B, C)$ of sets to be minimally intersecting if $|A \cap B| = |B \cap C| = |C \cap A| = 1$ and $A \cap B \cap C = \emptyset$. For example, $(\{1,2\},\{2,3\},\{1,3,4\})$ is a minimally intersecting triple. Let $N$ be the number of minimally intersecting ordered triples of sets for which each set is a subset of $\{1,2,3,4,5,6,7\}$. Find the remainder when $N$ is divided by $1000$. prove that answer is 760","import Mathlib def is_minimally_intersecting (a b c : Finset ℕ) : Prop := a ∩ b ≠ ∅ ∧ b ∩ c ≠ ∅ ∧ c ∩ a ≠ ∅ ∧ (a ∩ b).card = 1 ∧ (b ∩ c).card = 1 ∧ (c ∩ a).card = 1 ∧ a ∩ b ∩ c = ∅ theorem solution : {x : Fin 3 → Finset ℕ | x 0 ⊆ Finset.Icc 1 7 ∧ x 1 ⊆ Finset.Icc 1 7 ∧ x 2 ⊆ Finset.Icc 1 7 ∧ is_minimally_intersecting (x 0) (x 1) (x 2)}.ncard % 1000 = 760 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-295402,"Let $n$ be a positive integer, and let $2n$ non-negative real numbers $x_1, x_2, \cdots, x_{2n}$ satisfy $x_1 + x_2 + \cdots + x_{2n} = 4$. Prove that there exist non-negative integers $p, q$ such that $q \leq n - 1$, and where the subscripts are understood modulo $2n$.","import Mathlib theorem Finset.sum' (n : ℕ) (hn : 0 < n) (x : Fin (2 * n) → ℝ) (hx : ∑ i : Fin (2 * n), x i = 4) : ∃ p q : ℕ, q ≤ n - 1 ∧ ∑ i : Fin (2 * n), (if (i + p) % (2 * n) = q then x i else 0) = 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-295470,"Let the prime numbers be arranged in increasing order as $p_1 < p_2 < \cdots$. Denote $a_n = \prod_{i=1}^{n} p_i$, and let $A_n$ be the set of all positive divisors of $a_n$. Prove that for any positive integer $m \leq a_n$, there exist distinct $b_1, b_2, \cdots, b_k \in A_n$, where $k \leq 2n$, such that $$m = b_1 + b_2 + \cdots + b_k.$$","import Mathlib theorem qwen {p : ℕ → ℕ} (hp : ∀ n, Nat.Prime (p n)) (hpn : ∀ n, p n < p (n + 1)) (a : ℕ → ℕ) (ha : ∀ n, a n = ∏ i ∈ Finset.Icc 1 n, p i) : ∀ m n, 0 < m ∧ m ≤ a n → ∃ k ≤ 2 * n, ∃ s : Finset ℕ, (∀ x ∈ s, x ∣ a n) ∧ m = ∑ x ∈ s, x := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-295666,"Prove that the maximum number of elements in a set \(M\) consisting solely of integers, such that for every 3 - element subset of \(M\), there exist two numbers whose sum is a power of two with an integer exponent, is 6.","import Mathlib theorem maxM : IsGreatest {x | ∃ M : Finset ℤ, M.card = x ∧ ∀ S ⊆ M, S.card = 3 → ∃ a ∈ S, ∃ b ∈ S, a ≠ b ∧ ∃ k : ℕ, a + b = 2 ^ k} 6 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-295876,"Prove that: (a) 7 is a friendly number, where an integer \(n\) (\(n \geq 2\)) is defined as friendly if there exists a family of subsets \(A_1, A_2, \ldots, A_n\) of the set \(\{1, 2, \ldots, n\}\) such that: - \(i \notin A_i\) for every \(i \in \{1, 2, \ldots, n\}\); - \(i \in A_j\) if and only if \(j \notin A_i\), for every distinct \(i, j \in \{1, 2, \ldots, n\}\); - \(A_i \cap A_j\) is non - empty for every \(i, j \in \{1, 2, \ldots, n\}\). (b) \(n\) is friendly if and only if \(n \geq 7\), with the same definition of a friendly number as above.","import Mathlib def isFriendly (n : ℕ) := ∃ A : Finset.Icc 1 n → Set (Finset.Icc 1 n), (∀ i, ¬(i ∈ A i)) ∧ (∀ i j, i ≠ j → i ∈ A j ↔ j ∈ A i) ∧ (∀ i j, i ≠ j → A i ∩ A j ≠ ∅) theorem friendly_number : isFriendly 7 ∧ ∀ n ≥ 2, isFriendly n ↔ n ≥ 7 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-295926,"Prove that for the polynomial \(P(x) = a_{0} + a_{1}x + \dots + a_{2n}x^{2n}\) which satisfies \(P(x)=(x + 2x^{2}+\dots+nx^{n})^{2}\), the sum \(\sum_{i=n + 1}^{2n}a_{i}=C_{2n+2}^{4}-C_{n+2}^{4}\).","import Mathlib theorem PolynomialSum {n : ℕ} (P : Polynomial ℝ) (hP : P.degree = 2 * n) (hP' : ∀ x : ℝ, P.eval x = (∑ i ∈ Finset.range n, (i + 1) * x ^ (i + 1)) ^ 2) : ∑ i ∈ Finset.Icc (n + 1) (2 * n), P.coeff i = Nat.choose (2 * n + 2) 4 - Nat.choose (n + 2) 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-296240,"Prove that for positive integers \(n,k>1\), where \(P(n, k)\) is the number of polynomials \(f(x)\) with nonnegative integer coefficients such that \(f(k) = n\), the following inequality holds: \[ \frac{n - 1}{k-1} - \left\lfloor \log_k n \right\rfloor + 1 \leq P(n, k) \leq 1 + \frac{n - 1}{k-1} \]","import Mathlib open Real theorem inequalities (n k : ℕ) (hn : 1 < n) (hk : 1 < k) : (n - 1) / (k - 1) - ⌊logb k n⌋ + 1 ≤ {f : Polynomial ℕ | ∀ x, f.eval x ≥ 0 ∧ f.eval k = n}.ncard ∧ {f : Polynomial ℕ | ∀ x, f.eval x ≥ 0 ∧ f.eval k = n}.ncard ≤ 1 + (n - 1) / (k - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-296264,"Prove that there exists a sequence of positive integers $\{x_n\}$ in which every positive integer occurs exactly once, and for every $k = 1, 2, 3, \ldots$, the sum of the first $k$ terms, $\sum_{i=1}^{k} x_i$, is divisible by $k$.","import Mathlib theorem exists_sequence : ∃ x : ℕ → ℕ, (∀ n, x n > 0) ∧ (∀ k > 0, ∃! i, x i = k) ∧ (∀ k ≥ 1, k ∣ ∑ i ∈ Finset.Icc 1 k, x i) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-296375,"Regular octagon $ABCDEFGH$ has its center at $J$. Each of the vertices and the center are to be associated with one of the digits $1$ through $9$, with each digit used once, in such a way that the sums of the numbers on the lines $AJE$, $BJF$, $CJG$, and $DJH$ are all equal. In how many ways can this be done? [asy] pair A,B,C,D,E,F,G,H,J; A=(20,20(2+sqrt(2))); B=(20(1+sqrt(2)),20(2+sqrt(2))); C=(20(2+sqrt(2)),20(1+sqrt(2))); D=(20(2+sqrt(2)),20); E=(20(1+sqrt(2)),0); F=(20,0); G=(0,20); H=(0,20(1+sqrt(2))); J=(10(2+sqrt(2)),10(2+sqrt(2))); draw(A--B); draw(B--C); draw(C--D); draw(D--E); draw(E--F); draw(F--G); draw(G--H); draw(H--A); dot(A); dot(B); dot(C); dot(D); dot(E); dot(F); dot(G); dot(H); dot(J); label(""$A$"",A,NNW); label(""$B$"",B,NNE); label(""$C$"",C,ENE); label(""$D$"",D,ESE); label(""$E$"",E,SSE); label(""$F$"",F,SSW); label(""$G$"",G,WSW); label(""$H$"",H,WNW); label(""$J$"",J,SE); size(4cm); [/asy] prove that answer is 1152","import Mathlib open Finset theorem number_theory_28638 : {(a, b, c, d, e, f, g, h, j) : ℕ × ℕ × ℕ × ℕ × ℕ × ℕ × ℕ × ℕ × ℕ | a ∈ Icc 1 9 ∧ b ∈ Icc 1 9 ∧ c ∈ Icc 1 9 ∧ d ∈ Icc 1 9 ∧ e ∈ Icc 1 9 ∧ f ∈ Icc 1 9 ∧ g ∈ Icc 1 9 ∧ h ∈ Icc 1 9 ∧ j ∈ Icc 1 9 ∧ a ≠ b ∧ a ≠ c ∧ a ≠ d ∧ a ≠ e ∧ a ≠ f ∧ a ≠ g ∧ a ≠ h ∧ b ≠ c ∧ b ≠ d ∧ b ≠ e ∧ b ≠ f ∧ b ≠ g ∧ b ≠ h ∧ c ≠ d ∧ c ≠ e ∧ c ≠ f ∧ c ≠ g ∧ c ≠ h ∧ d ≠ e ∧ d ≠ f ∧ d ≠ g ∧ d ≠ h ∧ e ≠ f ∧ e ≠ g ∧ e ≠ h ∧ f ≠ g ∧ f ≠ h ∧ g ≠ h ∧ a + e + j = b + f + j ∧ b + f + j = c + g + j ∧ c + g + j = d + h + j}.ncard = 1152 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-296407,"Let \( X = \{1, 2, \dots, 2001\} \). Find the smallest positive integer \( m \) such that for any \( m \)-element subset \( W \) of \( X \), there exist \( u, v \in W \) (where \( u \) and \( v \) may be the same) such that \( u + v \) is a power of 2.","import Mathlib open Finset theorem min_m : IsLeast {m > 0 | ∀ W : Finset ℕ, W ⊆ Icc 1 2001 ∧ W.card = m → ∃ u ∈ W, ∃ v ∈ W, u + v = 2 ^ k} 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-296557,"Prove that the sets of positive integers \(S\) where each element of \(S\) is less than or equal to \(1000\) and for any \(a,b\in S\) the digits of \(a^2\) can be rearranged to form \(b^2\) are exactly the sets stored in the dictionary \(\text{sets}\).","import Mathlib open Finset theorem prove (S : Finset ℕ) : (∀ s ∈ S, s ≤ 1000 ∧ ∀ a ∈ S, ∀ b ∈ S, (Nat.digits 10 (a ^ 2)).toFinset = (Nat.digits 10 (b ^ 2)).toFinset) ↔ S = {1, 3, 5, 7} ∨ S = {2, 4, 6, 8} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-296711,"Let $U_n = \{A \in M_n(\mathbb{R}); A^3 = 0 \text{ and its entries are } \geq 0\}$, and let $a_n$ denote the maximum number of nonzero entries of a matrix in $U_n$. Prove that \(a_n = \lfloor n^2/3 \rfloor\). In particular, prove that \(a_8 = 21\) and \(a_9 = 27\).","import Mathlib open Matrix Finset theorem a (n : ℕ) : IsGreatest {k | ∃ A : Matrix (Fin n) (Fin n) ℝ, (∀ i j, A i j ≥ 0) ∧ A ^ 3 = 0 ∧ k = {i | A i ≠ 0}.ncard} (Nat.floor (n ^ 2 / 3)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-296716,"Let \( f(x) \) be a periodic function, where both \( T \) and \( 1 \) are periods of \( f(x) \), and \( 0 < T < 1 \). Prove: (1) If \( T \) is a rational number, then there exists a prime number \( p \) such that \( \frac{1}{p} \) is a period of \( f(x) \). (2) If \( T \) is an irrational number, then there exists a sequence \( \{a_n\} \) consisting entirely of irrational numbers, satisfying \( 1 > a_n > a_{n+1} > 0 \) (\( n = 1, 2, \dots \)), and each \( a_n \) (\( n = 1, 2, \dots \)) is a period of \( f(x) \).","import Mathlib theorem F (f : ℝ → ℝ) (T : ℝ) (hT : T > 0) (h1 : ∀ x, f (x + T) = f x) (h2 : ∀ x, f (x + 1) = f x) (h3 : T < 1) : (¬Irrational T → ∃ p : ℕ, Nat.Prime p ∧ ∀ x, f (x + 1 / p) = f x) ∧ (Irrational T → ∃ a : ℕ → ℝ, (∀ n, Irrational (a n)) ∧ (∀ n, 1 > a n ∧ a n > a (n + 1) ∧ a (n + 1) > 0) ∧ (∀ n, ∀ x, f (x + a n) = f x)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-296884,"对正整数 n 及实数 x(0\leq x 0) (h₁ : Nat.Prime (a^2 + b^2 + c^2)) (h₂ : a^2 + b^2 + c^2 ∣ a^4 + b^4 + c^4) : a^2 + b^2 + c^2 = 2 ∨ a^2 + b^2 + c^2 = 3 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-297113,"Prove that if there is a circle on which \(2012\) numbers, each being \(1\) or \(-1\), are written and no set of \(10\) consecutive numbers has a sum of \(0\), then the possible values of the sum of these \(2012\) numbers are \(404, 406, 408, \ldots, 2012\).","import Mathlib theorem Prove (a : ZMod 2012 → ℤ) (ha : ∀ i, a i = 1 ∨ a i = -1) (h : ∀ i, ∑ j ∈ Finset.range 10, a (i + j) ≠ 0) : ∃ s : Finset (ZMod 2012), s.card = 2012 ∧ (∀ i ∈ s, a i = 1 ∨ a i = -1) ∧ (∀ i ∈ s, ∑ j ∈ Finset.range 10, a (i + j) ≠ 0) ∧ (∑ i ∈ s, a i = 404 ∨ ∑ i ∈ s, a i = 406 ∨ ∑ i ∈ s, a i = 408 ∨ ∑ i ∈ s, a i = 2012) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-297322,"Prove that in a social gathering with \(2n + 1\) individuals, where for any subset of \(n\) individuals, there exists at least one individual outside this subset who is acquainted with all \(n\) individuals in the subset, there exists an individual who is acquainted with all other \(2n\) individuals in the gathering.","import Mathlib theorem prove_acquainted (n : ℕ) (hn : 0 < n) (a : Fin (2 * n + 1) → Finset (Fin (2 * n + 1))) (ha : ∀ s : Finset (Fin (2 * n + 1)), s.card = n → ∃ t : Fin (2 * n + 1), t ∉ s ∧ ∀ x ∈ s, a t ∩ {x} ≠ ∅) : ∃ x : Fin (2 * n + 1), ∀ y : Fin (2 * n + 1), y ≠ x → a x ∩ {y} ≠ ∅ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-297499,"In an exhibition, there are \(1999\) participants. It is known that among any group of \(50\) participants, there are at least two who do not know each other. Prove that there exists a subset of \(41\) participants such that each participant in this subset knows at most \(1958\) other participants.","import Mathlib theorem prove (a : Fin 1999 → Fin 1999 → Bool) (h : ∀ s : Finset (Fin 1999), s.card = 50 → ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ ¬a x y) : ∃ t : Finset (Fin 1999), t.card = 41 ∧ ∀ x ∈ t, {y | a x y}.encard ≤ 1958 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-297566,"Prove that the maximum possible distance between any two good vectors $(a_1, a_2, \ldots, a_n)$ and $(b_1, b_2, \ldots, b_n)$, where $r, n$ are positive integers with $r > n$, the $a_i$'s and $b_i$'s are distinct and satisfy $r \geq a_i \geq 1$ and $r \geq b_i \geq 1$ for all $i$, and the distance is defined as the minimum number of moves required to transform one vector into the other, is \(n + \lfloor n/2 \rfloor\).","import Mathlib open Finset theorem prove (n : ℕ) (hn : 0 < n) (r : ℕ) (hr : r > n) (a b : Fin n → ℕ) (ha : ∀ i j, a i = a j → i = j) (hb : ∀ i j, b i = b j → i = j) (h : ∀ i, 1 ≤ a i ∧ a i ≤ r) (h' : ∀ i, 1 ≤ b i ∧ b i ≤ r) : IsGreatest {d | ∃ x y : Fin n → ℕ, (∀ i, x i = a i) ∧ (∀ i, y i = b i) ∧ d = {i | x i ≠ y i}.ncard} (n + ⌊n / 2⌋₊) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-297612,"Prove that an $N \times N$ board can be completely tiled using tiles of dimensions $5 \times 5$ and $1 \times 3$, without any overlaps or gaps, if and only if $N \ne 1, 2, 4$, where $N$ is a positive integer.","import Mathlib theorem tiling (N : ℕ) : N > 0 ∧ ¬(N = 1 ∨ N = 2 ∨ N = 4) ↔ ∃ k l : ℕ, k * 5 + l * 3 = N ^ 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-297620,"Prove that in a $100 \times 100$ grid where each point is colored in one of four colors (red, green, blue, or yellow) and each row and each column contains exactly $25$ points of each color, there exist two rows and two columns such that the four intersection points of these rows and columns are all of different colors.","import Mathlib theorem prove_coloring (a : Fin 100 → Fin 100 → Fin 4) (h₀ : ∀ i j, a i j = 0 ∨ a i j = 1 ∨ a i j = 2 ∨ a i j = 3) (h₁ : ∀ i, {j | a i j = 0}.encard = 25 ∧ {j | a i j = 1}.encard = 25 ∧ {j | a i j = 2}.encard = 25 ∧ {j | a i j = 3}.encard = 25) (h₂ : ∀ j, {i | a i j = 0}.encard = 25 ∧ {i | a i j = 1}.encard = 25 ∧ {i | a i j = 2}.encard = 25 ∧ {i | a i j = 3}.encard = 25) : ∃ r₁ r₂ c₁ c₂ : Fin 100, r₁ ≠ r₂ ∧ c₁ ≠ c₂ ∧ a r₁ c₁ ≠ a r₁ c₂ ∧ a r₁ c₁ ≠ a r₂ c₁ ∧ a r₁ c₁ ≠ a r₂ c₂ ∧ a r₂ c₁ ≠ a r₁ c₁ ∧ a r₂ c₁ ≠ a r₁ c₂ ∧ a r₂ c₂ ≠ a r₁ c₁ ∧ a r₂ c₂ ≠ a r₁ c₂ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-297634,"Prove that in a \(100\times100\) grid where each point is colored in one of four colors (red, green, blue, or yellow) and each row and each column contains exactly \(25\) points of each color, there exist two rows and two columns such that the four intersection points of these rows and columns are all of different colors.","import Mathlib theorem prove_460279 (a : Fin 100 → Fin 100 → Fin 4) (h₀ : ∀ i j, a i j = 0 ∨ a i j = 1 ∨ a i j = 2 ∨ a i j = 3) (h₁ : ∀ i, {j | a i j = 0}.encard = 25) (h₂ : ∀ i, {j | a i j = 1}.encard = 25) (h₃ : ∀ i, {j | a i j = 2}.encard = 25) (h₄ : ∀ i, {j | a i j = 3}.encard = 25) (h₅ : ∀ j, {i | a i j = 0}.encard = 25) (h₆ : ∀ j, {i | a i j = 1}.encard = 25) (h₇ : ∀ j, {i | a i j = 2}.encard = 25) (h₈ : ∀ j, {i | a i j = 3}.encard = 25) : ∃ r₁ r₂ c₁ c₂ : Fin 100, r₁ ≠ r₂ ∧ c₁ ≠ c₂ ∧ a r₁ c₁ ≠ a r₁ c₂ ∧ a r₁ c₁ ≠ a r₂ c₁ ∧ a r₁ c₁ ≠ a r₂ c₂ ∧ a r₁ c₂ ≠ a r₂ c₁ ∧ a r₁ c₂ ≠ a r₂ c₂ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-297842,"Necklace $A$ consists of 14 beads, and necklace $B$ consists of 19 beads. Prove that for every positive odd integer $n$, it is possible to label the 33 beads with the integers $n, n+1, \cdots, n+32$, each used exactly once, such that any two adjacent beads correspond to coprime integers.","import Mathlib theorem necklace_A (n : ℕ) (hn : Odd n) : ∃ p : Fin 33 → ℕ, (∀ i j, i ≠ j → p i ≠ p j) ∧ (∀ i, p i ∈ Finset.Icc n (n + 32)) ∧ (∀ i, Nat.Coprime (p i) (p ((i + 1) % 33))) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-297875,"Let \( a_1, a_2, \cdots, a_k \) be a finite sequence whose terms are positive integers not exceeding \( n \), where any two adjacent terms in the sequence are distinct, and there do not exist four indices \( p < q < r < s \) such that \( a_p = a_r \neq a_q = a_s \). Find the maximum value of \( k \).","import Mathlib theorem max (n : ℕ) (hnpos : 0 < n) : IsGreatest {k | ∃ a : ℕ → ℕ, ∀ i ∈ Finset.range k, 0 < a i ∧ a i ≤ n ∧ (∀ j ∈ Finset.range k, j + 1 ∈ Finset.range k → a j ≠ a (j+1)) ∧ ¬∃ p q r s : Fin k, p < q ∧ q < r ∧ r < s ∧ a p = a r ∧ a r ≠ a q ∧ a q = a s} (2 * n - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-297892,"Let \( k \) be a positive integer. Prove that the set \( \{0, 1, 2, 3, \dots, 2^{k+1} - 1\} \) can be divided into two disjoint subsets \( \{x_1, x_2, \dots, x_{2^k}\} \) and \( \{y_1, y_2, \dots, y_{2^k}\} \) such that for any \( m \in \{1, 2, \dots, k\} \), the equality \[ \sum_{i=1}^{2^k} x_i^m = \sum_{i=1}^{2^k} y_i^m \] holds.","import Mathlib theorem Qwen (k : ℕ) (hk : 0 < k) : ∃ s1 s2 : Finset ℕ, s1 ∪ s2 = Finset.Icc 0 (2^(k + 1) - 1) ∧ s1 ∩ s2 = ∅ ∧ ∀ m ∈ Finset.Icc 1 k, ∑ i ∈ s1, i^m = ∑ i ∈ s2, i^m := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-297938,"Determine all even natural numbers \( n \) such that the numbers \( 1, 2, \ldots, n^2 \) can be partitioned into two sets \( A \) and \( B \) of equal size, with the sums of the elements in \( A \) and \( B \) satisfying \( \frac{S_A}{S_B} = \frac{39}{64} \). Prove that the answer is 206.","import Mathlib theorem determineEvenN (n : ℕ) : Even n ∧ ∃ A B : Finset ℕ, A ∪ B = Finset.Icc 1 (n ^ 2) ∧ A ∩ B = ∅ ∧ A.card = B.card ∧ (∑ x ∈ A, x) * 64 = 39 * (∑ x ∈ B, x) ↔ n = 206 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-298181,"Let $n \geq 3$ be an integer, and let $\mathcal{A}$ be a family of subsets of $\{1,2,\cdots,n\}$ such that for any $X, Y \in \mathcal{A}$, if $X$ and $Y$ are incomparable (i.e., neither $X \subseteq Y$ nor $Y \subseteq X$), then all subsets of $X \cap Y$ are not in $\mathcal{A}$. Prove that $|\mathcal{A}| \leq 3 \cdot 2^{n-3} + n - 1$.","import Mathlib open Finset theorem N282859 {n : ℕ} (hn : 3 ≤ n) (A : Finset (Finset (Icc 1 n))) (hA : ∀ X ∈ A, ∀ Y ∈ A, (¬(X ⊆ Y)) ∧ (¬(Y ⊆ X)) → ∀ S : Finset (Icc 1 n), S ⊆ X ∩ Y → S ∉ A) : A.card ≤ 3 * 2^(n - 3) + n - 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-298222,"Prove that the value of the infinite series \( \sum_{n=0}^{\infty} \frac{1}{C_n} \), where \( C_n = \frac{1}{n + 1} \binom{2n}{n} \) is the \(n\) - th Catalan number, is \( \frac{4\pi\sqrt{3}}{27} + 1 \).","import Mathlib open Real theorem sum_infinite_series (C : ℕ → ℝ) (hC : ∀ n, C n = (1 / (n + 1)) * Nat.choose (2 * n) n) : ∑' n, 1 / C n = 4 * π * sqrt 3 / 27 + 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-298250,"1. First, note that the user's problem is not a proof problem. 2. Extract the final conclusions from the assistant's answer: - When the labeling of the sets \(A\), \(B\), and \(C\) is important, the number of ways is \(6^n - 3 \cdot 5^n + 3 \cdot 4^n - 3^n\). - When the labeling of the sets \(A\), \(B\), and \(C\) is not important, the number of ways is \(\frac{6^n - 3 \cdot 5^n + 3 \cdot 4^n - 3^n}{6}\). 3. Rewrite the user's problem into formal math - proof statements: - **Proof statement for labeled sets**: Prove that the number of ways to partition the set \(S=\{1,2,\ldots,n\}\) into three non - empty sets \(A\), \(B\), and \(C\) such that \(A\cap B\neq\varnothing\), \(B\cap C\neq\varnothing\), \(C\cap A\neq\varnothing\), and \(A\cap B\cap C = \varnothing\) is \(6^n - 3 \cdot 5^n + 3 \cdot 4^n - 3^n\). - **Proof statement for unlabeled sets**: Prove that the number of ways to partition the set \(S = \{1,2,\ldots,n\}\) into three non - empty unlabeled sets \(A\), \(B\), and \(C\) such that \(A\cap B\neq\varnothing\), \(B\cap C\neq\varnothing\), \(C\cap A\neq\varnothing\), and \(A\cap B\cap C=\varnothing\) is \(\frac{6^n - 3 \cdot 5^n + 3 \cdot 4^n - 3^n}{6}\).","import Mathlib theorem prove_1 (n : ℕ) : {(A, B, C) : Finset ℕ × Finset ℕ × Finset ℕ | A ∪ B ∪ C = Finset.Icc 1 n ∧ A ≠ ∅ ∧ B ≠ ∅ ∧ C ≠ ∅ ∧ A ∩ B ≠ ∅ ∧ B ∩ C ≠ ∅ ∧ C ∩ A ≠ ∅ ∧ A ∩ B ∩ C = ∅}.ncard = 6 ^ n - 3 * 5 ^ n + 3 * 4 ^ n - 3 ^ n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-298377,"Let $a_{1}, a_{2}, \ldots, a_{2n+1} \in \mathbb{R}$ and $n \in \mathbb{N}^{*}$. Suppose that for every $1 \leq i \leq 2n+1$, there exist two sets $G_{1}$ and $G_{2}$ such that $\{1, 2, \ldots, i - 1, i+1, \ldots, 2n+1\} = G_{1} \cup G_{2}$, $G_{1} \cap G_{2} = \varnothing$, and $|G_{1}| = |G_{2}|$, and $\sum_{j \in G_{1}} a_{j} = \sum_{j \in G_{2}} a_{j}$. Prove that $a_{1} = a_{2} = \cdots = a_{2n+1}$.","import Mathlib theorem Qwen (n : ℕ) (hn : n > 0) (a : Finset.Icc 1 (2 * n + 1) → ℝ) (h : ∀ i : Finset.Icc 1 (2 * n + 1), ∃ G1 G2 : Finset (Finset.Icc 1 (2 * n + 1)), {x | x < i} ∪ {x | x > i} = G1 ∪ G2 ∧ G1 ∩ G2 = ∅ ∧ G1.card = G2.card ∧ ∑ j ∈ G1, a j = ∑ j ∈ G2, a j) : ∀ i j : Finset.Icc 1 (2 * n + 1), a i = a j := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-298393,"Prove that the sum of all rational numbers that can be expressed as $\sqrt{\dfrac{1}{a}+\dfrac{1}{b}}$, where $a$ and $b$ are relatively prime positive integers less than $1000$, is $\dfrac{139}{140}$.","import Mathlib open Real theorem sum_rat : ∑ᶠ (x : ℚ) (_ : ∃ a b : ℕ, 0 < a ∧ a < 1000 ∧ 0 < b ∧ b < 1000 ∧ IsCoprime a b ∧ x = sqrt ((1 / a : ℝ) + 1 / b)), x = 139 / 140 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-298501,"Prove that for a set $S$ of $6$ positive integers such that $D(S) \leq 18$, the minimum possible value of $E(S)$ is $\boxed{78}$, where $D(S)$ denotes the number of distinct positive integers that can be written as the sum of two (not necessarily distinct) elements of $S$, and $E(S)$ denotes the number of ordered tuples $(a,b,c,d)$ of elements of $S$ such that $a + b = c + d$.","import Mathlib open Finset theorem Prove : IsLeast {x | ∃ S : Finset ℕ, S.card = 6 ∧ (∀ n ∈ S, n > 0) ∧ x = {p | ∃ a b c d : ℕ, p = (a, b, c, d) ∧ a ∈ S ∧ b ∈ S ∧ c ∈ S ∧ d ∈ S ∧ a + b = c + d}.ncard ∧ {n | ∃ a b : ℕ, a ∈ S ∧ b ∈ S ∧ n = a + b}.encard ≤ 18} 78 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-298510,"Prove that for a set $S$ of $6$ positive integers such that $D(S) \leq 18$, the minimum possible value of $E(S)$ is $78$, where $D(S)$ denotes the number of distinct positive integers that can be written as the sum of two (not necessarily distinct) elements of $S$, and $E(S)$ denotes the number of ordered tuples $(a,b,c,d)$ of elements of $S$ such that $a + b = c + d$.","import Mathlib open Finset theorem prove : IsLeast {x | ∃ S : Finset ℕ, S.card = 6 ∧ (∀ s ∈ S, s > 0) ∧ {d | ∃ a ∈ S, ∃ b ∈ S, d = a + b}.ncard ≤ 18 ∧ x = {t | ∃ a ∈ S, ∃ b ∈ S, ∃ c ∈ S, ∃ d ∈ S, t = (a, b, c, d) ∧ a + b = c + d}.ncard} 78 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-298520,"Let $n$ and $k$ be constants, and let $f(s)$ for $0 \leq s \leq kn$ denote the number of $k$-element sequences $a_1, \ldots, a_k$ satisfying $0 \leq a_1, \ldots, a_k \leq n$ and $a_1 + \ldots + a_k = s$. Prove that the polynomial \[ f(0) + f(1)x + f(2)x^2 + \ldots + f(kn)x^{kn} \] has no real roots other than $-1$.","import Mathlib theorem PolynomialRoots (n k : ℕ) (f : ℕ → ℕ) (h₀ : ∀ s ∈ Finset.Icc 0 (k * n), f s = {a : Fin k → ℕ | (∀ i, a i ∈ Finset.Icc 0 n) ∧ ∑ i, a i = s}.ncard) : ∀ x : ℝ, ∑ i ∈ Finset.range (k * n + 1), f i * x ^ i = 0 → x = -1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-298616,"Prove that in a senate consisting of 30 members where each pair of senators is either friends or enemies and each senator has exactly 6 enemies, the total number of committees formed by selecting any three senators where the members are either all friends or all enemies of each other is \(1990\).","import Mathlib theorem prove (a : Fin 30 → Fin 30 → Bool) (ha : ∀ i j, a i j = a j i) (h : ∀ i, {j | ¬a i j}.encard = 6) : Set.ncard {x | ∃ i j k, x = (i, j, k) ∧ i ≠ j ∧ i ≠ k ∧ j ≠ k ∧ a i j = a i k ∧ a i j = a j k} = 1990 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-298688,"(Total score: 40 points) Given an integer \( k \geq 2 \) and \( k \) non-zero real numbers \( a_1, a_2, \cdots, a_k \). Prove that there are at most finitely many \( k \)-tuples of positive integers \( (n_1, n_2, \cdots, n_k) \) such that \( n_1, n_2, \cdots, n_k \) are pairwise distinct and \begin{equation} a_1 \cdot n_1! + a_2 \cdot n_2! + \cdots + a_k \cdot n_k! = 0. \end{equation}","import Mathlib theorem FiniteTuples (k : ℕ) (hk : 2 ≤ k) (a : Fin k → ℝ) (ha : ∀ i, a i ≠ 0) : Set.Finite {x : Fin k → ℕ | (∀ i j, x i = x j → i = j) ∧ (∀ i, 0 < x i) ∧ ∑ i, a i * Nat.factorial (x i) = 0} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-298796,"Consider an \(8 \times 8\) chessboard where each unit square is colored either black or white. A \(step\) is defined as selecting a \(3 \times 4\) rectangle and changing the color of each square within this rectangle. A coloring of the board is called \(good\) if, after a sequence of steps, the entire board can be transformed into a board where all unit squares are white. Conversely, a coloring is called \(bad\) if it is impossible to achieve a completely white board through any sequence of steps. Prove that \(2^{64} - 2^{60} = 15 \cdot 2^{60}\), where \(2^{64}\) is the total number of possible colorings of the board, \(2^{60}\) is the number of good colorings, and \(2^{64}-2^{60}\) is the number of bad colorings.","import Mathlib open Finset theorem prove : (2^64 - 2^60) = 15 * 2^60 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-298846,"Prove that if \(A = \{2, 3, \ldots, 70\}\) is a set of integers and these numbers are distributed into four boxes (which may be empty), then there exist three numbers \(a, b, c \in A\) within the same box such that \(71 \mid ab - c\).","import Mathlib theorem prove (A : Finset ℕ) (hA : A = Finset.Icc 2 70) : ∀ s1 s2 s3 s4 : Finset ℕ, s1 ∪ s2 ∪ s3 ∪ s4 = A ∧ s1 ∩ s2 = ∅ ∧ s1 ∩ s3 = ∅ ∧ s1 ∩ s4 = ∅ ∧ s2 ∩ s3 = ∅ ∧ s2 ∩ s4 = ∅ ∧ s3 ∩ s4 = ∅ → ∃ a ∈ s1, ∃ b ∈ s1, ∃ c ∈ s1, 71 ∣ a * b - c ∨ ∃ a ∈ s2, ∃ b ∈ s2, ∃ c ∈ s2, 71 ∣ a * b - c ∨ ∃ a ∈ s3, ∃ b ∈ s3, ∃ c ∈ s3, 71 ∣ a * b - c ∨ ∃ a ∈ s4, ∃ b ∈ s4, ∃ c ∈ s4, 71 ∣ a * b - c := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-298877,"Find the number of all unordered pairs $\{A,B \}$ of subsets of an $8$-element set, such that $A \cap B \neq \emptyset$ and $|A| \neq |B|$. prove that answer is 23606","import Mathlib theorem solution : Set.ncard {p : Finset (Finset ℕ) | p.card = 2 ∧ ∃ A B : Finset ℕ, A ⊆ Finset.range 8 ∧ B ⊆ Finset.range 8 ∧ A ∩ B ≠ ∅ ∧ A.card ≠ B.card} = 23606 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-298993,"Prove that for real numbers \(r_1, r_2, \ldots, r_n\), there exists a subset \(I\) of \(\{1, 2, \ldots, n\}\), which has one or two elements in common with each of the sets \(\{i, i + 1, i + 2\}\) for \(1 \leq i \leq n - 2\), such that \[ \left| \sum_{i \in I} r_i \right| \geq \frac{1}{6} \sum_{i = 1}^n \left| r_i \right|. \]","import Mathlib open Finset Real theorem Prove (n : ℕ) (hn : 0 < n) (r : ℕ → ℝ) : ∃ I : Finset ℕ, I ⊆ Icc 1 n ∧ (∀ i ∈ Icc 1 (n - 2), I ∩ {i, i + 1, i + 2} ≠ ∅ ∧ (I ∩ {i, i + 1, i + 2}).card ≤ 2) ∧ |∑ i ∈ I, r i| ≥ (1 / 6) * ∑ i ∈ Icc 1 n, |r i| := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-298999,"There are 1000 players participating in a round-robin Go tournament, where every pair of players plays exactly one match with no draws. Prove that all players can be arranged in a line such that for each of the 998 players not at either end, they either defeat both adjacent players or lose to both adjacent players.","import Mathlib theorem round_robin_tournament (a : Fin 1000 → Fin 1000 → Bool) (h₀ : ∀ i j, i ≠ j → a i j ∨ a j i) : ∃ p : Equiv.Perm (Fin 1000), ∀ i, i > 0 ∧ i < 999 → (a (p i) (p (i - 1)) ∧ a (p i) (p (i + 1))) ∨ (¬a (p i) (p (i - 1)) ∧ ¬a (p i) (p (i + 1))) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-299113,"Around a circle are written $2009$ integers, not necessarily distinct, so that if two numbers are neighbors, their difference is $1$ or $2$. We will say that a number is *huge* if it is greater than its two neighbors, and that it is *tiny* if it is less than its two neighbors. The sum of all the huge numbers is equal to the sum of all the tiny numbers plus $1810$. Determine how many odd numbers there can be around the circumference. prove that answer is 1005","import Mathlib theorem OddSum (a : Fin 2009 → ℤ) (h : ∀ i j, (i + 1) % 2009 = j ∨ (j + 1) % 2009 = i → |a i - a j| = 1 ∨ |a i - a j| = 2) (h' : ∑ i, (if a i > a ((i - 1) % 2009) ∧ a i > a ((i + 1) % 2009) then a i else 0) = ∑ i, (if a i < a ((i - 1) % 2009) ∧ a i < a ((i + 1) % 2009) then a i else 0) + 1810) : {i | Odd (a i)}.encard = 1005 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-299146,"Prove that there exists an infinite number of pairs of positive integers \((m, n)\) such that the expression \(\frac{(m + n - k)!}{m!n!}\) is an integer if and only if \(k \geq n + 1\), where \(k\) is a positive integer.","import Mathlib open Nat theorem prove : ∀ N : ℕ, ∃ m n : ℕ, m > N ∧ n > N ∧ ∀ k : ℕ, k > 0 → ∃ j : ℤ, (m + n - k) ! / (m ! * n !) = j ↔ k ≥ n + 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-299169,"Determine whether there exist sets \(S_i \subseteq \mathbb{R}\) for \(i \leq n\) such that the sets \(S_i\) are disjoint, have the same cardinality, and are dense in \(\mathbb{R}\). Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem determine {n : ℕ} (hn : 0 < n) : ∃ S : Fin n → Set ℝ, (∀ i j, i ≠ j → Disjoint (S i) (S j)) ∧ (∀ i, Dense (S i)) ∧ ∃ c, ∀ i, (S i).encard = c := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-299232,"Let \(A \subset \mathbb{R}\) be a set with \(m(A) > 0\), where \(m\) denotes the Lebesgue measure on \(\mathbb{R}\). Prove that the cardinality of \(A\) is the continuum.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem card_A (A : Set ℝ) (hA : (MeasureTheory.volume A).toReal > 0) : ¬ Set.Countable A := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-299361,"Determine whether the following statement is true or false: For any function \( f:\mathbb{R}\rightarrow\mathbb{R} \) that is continuous everywhere and differentiable everywhere except on a subset \( S \) of \( \mathbb{R} \) with measure zero, the set \( S \) must be countable. Prove that the answer is B.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem B : ¬ (∀ (f : ℝ → ℝ), Continuous f ∧ DifferentiableOn ℝ f (Set.univ \ S) → MeasureTheory.volume S = 0 → Countable S) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-299369,"Determine whether every uncountable subset of the complex plane contains a sequence of distinct elements that does not converge to 0. Answer with 'Yes' or 'No'. Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem uncountable (s : Set ℂ) (h₀ : ¬ Countable s) : ∃ (a : ℕ → ℂ), (∀ i j, i ≠ j → a i ≠ a j) ∧ ¬ Tendsto a atTop (𝓝 0) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-299411,"Prove that for $n \geq 1$ and $1 \leq k \leq n/2$, the maximum size of a collection of distinct subsets $A_1, A_2, \ldots, A_m$ of the set $\{1, 2, \ldots, n\}$ such that for any distinct indices $1 \leq i < j \leq m$, the union $|A_i \cup A_j| \leq 2k$, is $\binom{n}{0} + \binom{n}{1} + \cdots + \binom{n}{k}$.","import Mathlib open Finset theorem max_size (n : ℕ) (hn : 1 ≤ n) (k : ℕ) (hk : 1 ≤ k ∧ k ≤ n / 2) : IsGreatest {x | ∃ s : Finset (Finset ℕ), s.card = x ∧ (∀ a ∈ s, a ⊆ Icc 1 n) ∧ (∀ i ∈ s, ∀ j ∈ s, i ≠ j → (i ∪ j).card ≤ 2 * k)} (∑ i ∈ range (k+1), Nat.choose n i) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-299438,"Prove that the maximum number of digits of a positive integer written in decimal notation, with all distinct digits and divisible by each of its digits, is \(7\).","import Mathlib open Nat def isGood (n : ℕ) : Prop := (Nat.digits 10 n).length = 7 ∧ (Nat.digits 10 n).toFinset.card = 7 ∧ (∀ d ∈ (Nat.digits 10 n), n % d = 0) theorem maxGood : IsGreatest {x | ∃ n, x = (Nat.digits 10 n).length ∧ isGood n} 7 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-299466,"Determine the cardinality of the set \(E(a)\), where \(E(a) = \{(r_1, r_2, \ldots, r_n, \ldots) \mid r_n \in \mathbb{Q} \cap [0,1], r_n \leq r_{n+1}, \forall n \geq 1, \sum_{n=1}^\infty \frac{r_n}{2^n} = a\}\) for any \(a \in (0,1)\). What is \(|E(a)|\)? Prove that the answer is 2^{\aleph_0}.","import Mathlib open Set Real theorem E (a : ℝ) (ha : 0 < a ∧ a < 1) : {x : ℕ → ℚ | (∀ n, x n ∈ Icc 0 1) ∧ (∀ n, x n ≤ x (n + 1)) ∧ ∑' n, x n / 2 ^ n = a}.encard = 2 ^ (Nat.card ℕ) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-299503,Prove that $\sum_{g}\frac{1}{g+1}\binom{99}{g}\binom{200}{120-g} = \frac{3387855719777216941916700072855965838731449786513697812611304705899817561744957253520}{300}$.,"import Mathlib open Finset Real Nat theorem sum_g : ∑ g ∈ range 100, (1 / (g + 1)) * Nat.choose 99 g * Nat.choose 200 (120 - g) = 3387855719777216941916700072855965838731449786513697812611304705899817561744957253520 / 300 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-299629,"There are 1650 students arranged in 22 rows and 75 columns. It is known that among any two columns, in the same row, the number of pairs of students with the same gender does not exceed 11. Prove that the number of male students does not exceed 928.","import Mathlib theorem male_students (a : Fin 22 → Fin 75 → ℕ) (h₀ : ∀ i j, a i j = 0 ∨ a i j = 1) (h₁ : ∀ i j k, j ≠ k → {p : Fin 75 × Fin 75 | p.1 = j ∧ p.2 = k ∧ a i p.1 = a i p.2}.encard ≤ 11) : ∑ i, ∑ j, a i j ≤ 928 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-299704,"Let $M=\{0,1,2,\dots,2022\}$ and let $f:M\times M\to M$ such that for any $a,b\in M$, \[f(a,f(b,a))=b\] and $f(x,x)\neq x$ for each $x\in M$. How many possible functions $f$ are there $\pmod{1000}$? prove that answer is 0","import Mathlib theorem solution : {f : Fin 2023 → Fin 2023 → Fin 2023 | (∀ a b, f a (f b a) = b) ∧ (∀ x, f x x ≠ x)}.encard = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-299733,"Prove that the maximal value of \(k\) for a collection of non - empty subsets \((B_1,B_2,\dots,B_k)\) of the set \(A=\{0,1,2,\dots,9\}\) such that for any \(i\neq j\), the intersection \(B_i\cap B_j\) contains at most two elements is \(175\).","import Mathlib open Finset theorem max_n: IsGreatest {n | ∃ B : Fin n → Set ℕ, (∀ i j, i ≠ j → (B i ∩ B j).ncard ≤ 2) ∧ (∀ i, B i ≠ ∅) ∧ (∀ i, B i ⊆ Icc 0 9)} 175 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-299865,"(a) Prove that every [i]admissible[/i] set in $\mathbb{Z}^2$ contains a [i]null[/i] set. (b) Prove that the set $A$, obtained by taking $A' := \{(i,j,k) \in \mathbb{Z}^3 : i,j,k \in \{0,1,2\} \}$ and removing the points $(0,0,0), (2,2,2), (2,1,0), (2,0,1), (1,2,1), (1,0,2), (0,1,2)$ from $A'$, is an [i]admissible[/i] set in $\mathbb{Z}^3$ that does not contain any [i]null[/i] subset.","import Mathlib open Finset theorem prove_a : ∀ A : Set (ℤ × ℤ), (∀ x ∈ A, x.1 ≥ 0 ∧ x.2 ≥ 0) → ∃ B ⊆ A, B ≠ ∅ ∧ ∀ x ∈ B, x.1 = 0 ∨ x.2 = 0 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-299876,"Prove that the number of doubly - troll numbers (where a doubly - troll number is defined as a number \(x\) such that repeated application of the function \(f(x)\) defined as \(f(x)=\begin{cases}x^4 + 1, &\text{if }x\text{ is odd}\\0.5x, &\text{if }x\text{ is even}\end{cases}\) eventually results in the number 1) in the range \(9000 < x < 19876543210\) is \(21\).","import Mathlib open Finset theorem count_doubly_troll_number (f : ℕ → ℕ) (h₀ : ∀ n, Odd n → f n = n ^ 4 + 1) (h₁ : ∀ n, Even n → f n = n / 2) : {n | 9000 < n ∧ n < 19876543210 ∧ ∃ k, f^[k] n = 1}.ncard = 21 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-299886,"Let \( S \) be a subset of \( \{ 1, 2, \cdots, 2^m n \} \), where the number of elements in \( S \), \( |S| \), satisfies \( |S| \geq (2^m - 1)n + 1 \). Prove that \( S \) contains \( m+1 \) distinct numbers \( a_0, a_1, \cdots, a_m \) such that \( a_{i-1} \mid a_i \) (for \( i = 1, 2, \cdots, m \)).","import Mathlib theorem qwen {m n : ℕ} {S : Finset ℕ} (hS : ∀ x ∈ S, x ≤ 2 ^ m * n) (hS1 : S.card ≥ (2 ^ m - 1) * n + 1) : ∃ T ⊆ S, T.card = m + 1 ∧ ∀ i ∈ T, ∀ j ∈ T, i < j → i ∣ j := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-299939,"Let \(f: \mathbb{R} \rightarrow \mathbb{R}\) be a function, and define \(E = \{x \in \mathbb{R} \mid \lim_{y \rightarrow x} f(y) = +\infty \}\). Prove that the set \(E\) is countable. Specifically, prove that for any \(x \in E\), there exists a neighborhood \((x - \delta_x, x + \delta_x)\) such that for any \(x_1, x_2 \in E\), the neighborhoods \((x_1 - \delta_{x_1}, x_1 + \delta_{x_1})\) and \((x_2 - \delta_{x_2}, x_2 + \delta_{x_2})\) are disjoint, and conclude that the family \(\{(x - \delta_x, x + \delta_x) \mid x \in E \}\) of disjoint open sets is countable.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem countable {f : ℝ → ℝ} (E : Set ℝ) (hE : E = {x | Tendsto f (𝓝 x) atTop}) : Countable E := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-299962,"Prove that if \(f: (a, b) \to \mathbb{R}\) is a convex function (and thus continuous on \((a, b)\) but not necessarily differentiable), then the set of points in \((a, b)\) at which \(f\) is not differentiable is at most countable.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem convex_function {f : ℝ → ℝ} (hf : ConvexOn ℝ (Set.Ioo a b) f) (ha : a < b) : Set.Countable {x | ¬ DifferentiableAt ℝ f x ∧ x ∈ Set.Ioo a b} := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-300241,"Let $m, n$ be two fixed natural numbers with $m < n$. For any $0 \leq k < n$, denote $S_k = \sum i^m$, where $i$ runs over all natural numbers having at most $n$ digits in their binary representation, with exactly $k$ of those digits being non-zero. Prove that $S_0 + S_2 + S_4 + \dots = S_1 + S_3 + S_5 + \dots$.","import Mathlib open Finset theorem sumOfS (m n : ℕ) (hm : m < n) (S : ℕ → ℕ) (hS : ∀ k ∈ Ico 0 n, S k = ∑ i ∈ (Icc 0 (2 ^ n - 1)).filter (fun j => (Nat.digits 2 j).length ≤ n ∧ (Nat.digits 2 j).count 1 = k), i ^ m) : ∑ i ∈ range ((n + 1) / 2), S (2 * i) = ∑ i ∈ range (n / 2), S (2 * i + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-300349,"Let \( S = \{1, 2, \dots, 15\} \). From \( S \), extract \( n \) subsets \( A_1, A_2, \dots, A_n \), satisfying the following conditions: 1. \( |A_i| = 7 \) (\( i = 1, 2, \dots, n \)); 2. \( |A_i \cap A_j| \leq 3 \) (\( 1 \leq i < j \leq n \)); 3. For any 3-element subset \( M \) of \( S \), there exists some \( A_k \) such that \( M \subset A_k \). Find the minimum value of \( n \).","import Mathlib open Finset theorem min_n : IsLeast {n : ℕ | ∃ S : Finset ℕ, S = Icc 1 15 ∧ ∃ A : Fin n → Finset ℕ, (∀ i, A i ⊆ S) ∧ (∀ i j, i ≠ j → (A i ∩ A j).card ≤ 3) ∧ (∀ M : Finset ℕ, M ⊆ S ∧ M.card = 3 → ∃ k, M ⊆ A k)} 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-300367,"The set $X$ has $1983$ members. There exists a family of subsets $\{S_1, S_2, \ldots , S_k \}$ such that: 1. The union of any three of these subsets is the entire set $X$. 2. The union of any two of them contains at most $1979$ members. What is the largest possible value of $k$? prove that answer is 31","import Mathlib theorem maxk (X : Finset ℕ) (hX : X.card = 1983) (k : ℕ) (hk : k > 0) (S : Fin k → Finset ℕ) (hS : ∀ i j l, i ≠ j ∧ i ≠ l ∧ j ≠ l → (S i ∪ S j ∪ S l) = X) (hS' : ∀ i j, i ≠ j → (S i ∪ S j).card ≤ 1979) : k ≤ 31 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-300377,"The user's problem is already a formal math proof problem. So, the final proof statement is: Prove that for a $2^n \times 2^n$ table whose rows and columns are numbered from $0$ to $2^n - 1$, and where for each $0 \leq i, j \leq 2^n - 1$, the $j$-th cell in the $i$-th row and the $(i + j)$-th cell in the $j$-th row have the same color (with indices of cells in a row considered modulo $2^n$), the maximum number of distinct colors that can be used is $2^n$.","import Mathlib open Finset theorem prove_max_colors {n : ℕ} (hn : 0 < n) : IsGreatest {k | ∃ f : Fin (2 ^ n) → Fin (2 ^ n) → Fin k, ∀ i j, f i j = f j (i + j)} (2 ^ n) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-300557,"Given that \(b \mid (a^2 + 1)\) and \(a \mid (b^2 + 1)\), prove that there exists a natural number \(k\) such that \(a^2 + b^2 + 1 = kab\). Then, using this relationship, define sequences \(\{x_n\}\) and \(\{y_n\}\) and prove that the sequence terminates with \(x_n = y_n = 1\), and finally prove that \(k = 3\).","import Mathlib theorem qwen {a b : ℕ} (ha : a ∣ (b ^ 2 + 1)) (hb : b ∣ (a ^ 2 + 1)) : ∃ k, a ^ 2 + b ^ 2 + 1 = k * a * b := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-300623,"Prove that equality holds in the Lubell–Yamamoto–Meshalkin (LYM) Inequality $\sum_{A \in \mathcal{X}} \frac{1}{\binom{n}{|A|}} \leq 1$, where $\mathcal{X}$ is a family of subsets of $\{1, 2, \ldots, n\}$ such that no $A_1, A_2 \in \mathcal{X}$ satisfies $A_1 \subset A_2$, if and only if $\mathcal{X} = \binom{[n]}{k}$ for some $k \in \{0,1,\ldots,n\}$.","import Mathlib open Finset Real Nat theorem LYM {n : ℕ} (hn : 0 < n) (X : Finset (Finset ℕ)) (hX : ∀ A ∈ X, ∀ B ∈ X, A ≠ B → ¬(A ⊆ B)) : ∑ A ∈ X, (1 / Nat.choose n (A.card : ℕ)) ≤ 1 ↔ ∃ k : ℕ, X = {s | s ⊆ Icc 1 n ∧ s.card = k} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-300656,"Prove that equality holds in the Lubell–Yamamoto–Meshalkin (LYM) Inequality, which states that if $\mathcal{X}$ is a family of subsets of $\{1, 2, \ldots, n\}$ such that no $A_1, A_2 \in \mathcal{X}$ satisfies $A_1 \subset A_2$, i.e., $\sum_{A \in \mathcal{X}} \frac{1}{\binom{n}{|A|}} = 1$, if and only if $\mathcal{X}$ is a uniform family, i.e., $\mathcal{X} = \binom{[n]}{k}$ for some $k$.","import Mathlib open Finset Real Nat theorem lubell_yhamo_mushl (n : ℕ) (hn : 0 < n) (X : Finset (Finset (Icc 1 n))) (hX : ∀ A ∈ X, ∀ B ∈ X, A ≠ B → ¬(A ⊆ B)) : (∑ A ∈ X, 1 / Nat.choose n (A.card : ℕ)) = 1 ↔ ∃ k, X = {A | ∃ s : Finset (Icc 1 n), A = s ∧ s.card = k} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-300683,"Prove that for an odd prime $p$ and a positive integer $n$ such that $\gcd(n, p) = 1$, the number of sequences $\left(a_1, a_2, \ldots, a_{p - 1}\right)$, where each $a_i$ is a natural number not exceeding $n - 1$ and $\sum\limits_{k = 1}^{p - 1} k a_k \equiv 0 \pmod{p}$, is $\left\lceil \frac{n^{p - 1}}{p} \right\rceil$.","import Mathlib theorem number_of_sequences (p : ℕ) (hp : Odd p ∧ Nat.Prime p) (n : ℕ) (hn : 0 < n) (hpn : Nat.gcd n p = 1) : {a : Fin (p - 1) → ℕ | (∀ i, a i ≤ n - 1) ∧ ∑ k : Fin (p - 1), (k + 1) * a k ≡ 0 [MOD p]}.ncard = ⌈(n ^ (p - 1)) / p⌉₊ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-300713,"Prove that for an infinite sequence \(a_1, a_2, \dots\) of positive integers with \(a_1 = 1\) and for all positive integers \(k\) and \(n\) satisfying \(a_n \mid a_k + a_{k+1} + \dots + a_{k+n-1}\), the maximum possible value of \(a_{2m}\) for a given positive integer \(m\) is \(2^m - 1\).","import Mathlib theorem Prove (a : ℕ → ℕ) (ha : ∀ k, 0 < a k) (h1 : a 1 = 1) (h2 : ∀ k n, a n ∣ ∑ i ∈ Finset.range n, a (k + i)) : ∀ m, 0 < m → a (2 * m) ≤ 2 ^ m - 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-300778,"Prove that for a given positive integer \(k\), there exists a positive integer \(N = k^{3k^2}\) such that for any integer \(n \geq N\), the binomial coefficient \(\binom{n}{k}\) has at least \(k\) distinct prime divisors.","import Mathlib theorem prove (k : ℕ) (hk : 0 < k) : ∃ N : ℕ, 0 < N ∧ N = k^(3*k^2) ∧ ∀ n ≥ N, k ≤ (Nat.primeFactors (Nat.choose n k)).card := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-300811,"For a set $S \subseteq \mathbb{N}$, define $f(S) = \{\lceil \sqrt{s} \rceil \mid s \in S\}$. Find the number of sets $T$ such that $|f(T)| = 2$ and $f(f(T)) = \{2\}$. prove that answer is 5043","import Mathlib open Real theorem solution (f : Set ℕ → Set ℕ) (hf : ∀ S, f S = {x : ℕ | ∃ s ∈ S, x = ⌈Real.sqrt s⌉}) : Set.ncard {T | (f T).encard = 2 ∧ f (f T) = {2}} = 5043 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-300931,"For any finite set $X$, let $| X |$ denote the number of elements in $X$. Define \[S_n = \sum | A \cap B | ,\] where the sum is taken over all ordered pairs $(A, B)$ such that $A$ and $B$ are subsets of $\left\{ 1 , 2 , 3, \cdots , n \right\}$ with $|A| = |B|$. For example, $S_2 = 4$ because the sum is taken over the pairs of subsets \[(A, B) \in \left\{ (\emptyset, \emptyset) , ( \{1\} , \{1\} ), ( \{1\} , \{2\} ) , ( \{2\} , \{1\} ) , ( \{2\} , \{2\} ) , ( \{1 , 2\} , \{1 , 2\} ) \right\} ,\] giving $S_2 = 0 + 1 + 0 + 0 + 1 + 2 = 4$. Let $\frac{S_{2022}}{S_{2021}} = \frac{p}{q}$, where $p$ and $q$ are relatively prime positive integers. Find the remainder when $p + q$ is divided by 1000. prove that answer is 245","import Mathlib open Finset Real theorem algebra_578863 {S : ℕ → ℕ} (hS : ∀ n, S n = ∑' A : Finset ℕ, ∑' B : Finset ℕ, if (A ⊆ Icc 1 n ∧ B ⊆ Icc 1 n ∧ A.card = B.card) then (A ∩ B).card else 0) : (S 2022 / S 2021 : ℚ).num + (S 2022 / S 2021 : ℚ).den ≡ 245 [ZMOD 1000] := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-301038,"Plusses and minuses are inserted in the expression: \[ \pm 1 \pm 2 \pm 3 \dots \pm 2016 \] such that when evaluated, the result is divisible by 2017. Let there be $N$ ways for this to occur. Compute the remainder when $N$ is divided by 503. prove that answer is 52","import Mathlib theorem count : {p : Fin 2016 → ℤ | (∀ i, p i = 1 ∨ p i = -1) ∧ 2017 ∣ ∑ i, (i + 1) * p i}.ncard % 503 = 52 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-301081,"Prove that in a town with $3n$ citizens where any two individuals share at least one common friend who is also a resident of the town, it is possible to select a subset of $n$ citizens such that each of the remaining $2n$ citizens has at least one friend within this subset.","import Mathlib theorem prove (n : ℕ) (hn : 0 < n) (a : Fin (3 * n) → Finset (Fin (3 * n))) (ha : ∀ i j, i ≠ j → ∃ x, x ∈ a i ∧ x ∈ a j) : ∃ b : Finset (Fin (3 * n)), b.card = n ∧ ∀ i, ¬i ∈ b → ∃ j, j ∈ b ∧ j ∈ a i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-301205,"What is the size of the largest subset $S'$ of $S = \{2^x 3^y 5^z : 0 \le x,y,z \le 4\}$ such that there are no distinct elements $p,q \in S'$ with $p \mid q$? prove that answer is 19","import Mathlib open Finset theorem max: IsGreatest {n | ∃ S : Finset ℕ, S.card = n ∧ (∀s ∈ S, s ∈ {k | ∃ x y z : ℕ, k = 2 ^ x * 3 ^ y * 5 ^ z ∧ 0 ≤ x ∧ x ≤ 4 ∧ 0 ≤ y ∧ y ≤ 4 ∧ 0 ≤ z ∧ z ≤ 4}) ∧ ∀p ∈ S, ∀q ∈ S, p ≠ q → ¬(p ∣ q)} 19 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-301283,"Proof: Except for finitely many positive integers, any other positive integer \( n \) can be expressed as the sum of 2004 distinct positive integers: \[ n = a_1 + a_2 + \cdots + a_{2004} \] satisfying \( 1 \leq a_1 < a_2 < \cdots < a_{2004} \) and \( a_i \mid a_{i+1} \) (for \( i = 1, 2, \ldots, 2003 \)).","import Mathlib theorem proof : Set.Finite {n : ℕ | n > 0 ∧ ¬∃ a : Fin 2004 → ℕ, (∀ i j, i < j → a i < a j) ∧ (∀ i, a i ∣ a (i + 1)) ∧ n = ∑ i, a i} := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-301336,"Prove that the maximum number of non - empty subsets of the set $[20]=\{1,2,\cdots,20\}$ such that any two distinct subsets have at most two elements in common is \(1351\).","import Mathlib open Finset theorem max_n_empty {n : ℕ} (hn : n = 20) : IsGreatest {k | ∃ s : Finset (Finset ℕ), s.card = k ∧ (∀ t ∈ s, t ⊆ Icc 1 n) ∧ ∀ x ∈ s, x ≠ ∅ ∧ ∀ x ∈ s, ∀ y ∈ s, x ≠ y → (x ∩ y).card ≤ 2} 1351 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-301353,"Determine the minimum number of colors required to properly color the vertices of an infinite graph $G$. The vertices are represented by natural numbers, and two vertices $n$ and $m$ are connected by an edge if the absolute difference $|m - n|$ is a prime number. Prove that the answer is 4.","import Mathlib open Finset theorem mincolors (G : ℕ → ℕ → Prop) (hG : ∀ m n, G m n ↔ Prime (|(m : ℤ) - n|)) : IsLeast {k | ∃ f : ℕ → Fin k, ∀ m n, G m n → f m ≠ f n} 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-301361,"Prove that the number of functions \(f : S \to B\) that satisfy the condition \(f(A_1 \cap A_2) = \min(f(A_1), f(A_2))\) for any \(A_1, A_2 \in S\), where \(A = \{1, 2, \ldots, 2012\}\), \(B = \{1, 2, \ldots, 19\}\), and \(S\) is the set of all subsets of \(A\), is \(\sum_{j = 1}^{19}j^{2012}\).","import Mathlib open Finset theorem algebra_456722 {A : Finset ℕ} (hA : A = Icc 1 2012) {B : Finset ℕ} (hB : B = Icc 1 19) : {f : Set A → B | ∀ x y, f (x ∩ y) = min (f x) (f y)}.ncard = ∑ j ∈ Icc 1 19, j^2012 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-301409,"Determine whether it is possible to find an uncountable collection of infinite sets of natural numbers such that any two sets in this collection have only finitely many elements in common. Prove that the answer is Yes.","import Mathlib theorem yes : ∃ C : Set (Set ℕ), (C.Nonempty ∧ ¬C.Countable) ∧ (∀ S ∈ C, Infinite S) ∧ (∀ S ∈ C, ∀ T ∈ C, S ≠ T → {x | x ∈ S ∧ x ∈ T}.Finite) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-301494,"Prove that for a sequence of length $n \geq 42$ consisting of the numbers $-1$ and $1$, where the sum of every $40$ consecutive numbers is $0$ and the sum of every $42$ consecutive numbers is not equal to $0$, the maximum possible value of the sum $S_n$ of all the numbers in the sequence is $20$.","import Mathlib open Finset Real theorem maxSum {n : ℕ} (hn : n ≥ 42) (a : ℕ → ℤ) (ha : ∀ i ∈ Icc 1 n, a i = -1 ∨ a i = 1) (hsum : ∀ i ∈ Icc 1 (n - 39), ∑ j ∈ range 40, a (i + j) = 0) (hsum' : ∀ i ∈ Icc 1 (n - 41), ∑ j ∈ range 42, a (i + j) ≠ 0) : ∑ i ∈ Icc 1 n, a i ≤ 20 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-301564,"Find the maximal possible number of integers you can choose from the set \( \{1, 2, \ldots, 100\} \) such that no product of any non-empty subset of these numbers is a perfect square. prove that answer is 25","import Mathlib theorem max_nonempty_subset : IsGreatest {n | ∃ s : Finset ℕ, s ⊆ Finset.Icc 1 100 ∧ s.card = n ∧ ∀ t ⊆ s, t ≠ ∅ → ¬ IsSquare (∏ i ∈ t, i)} 25 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-301629,"1. Prove that if $V$ is a finite set with $n$ elements, $\mathcal{E} \subseteq \mathcal{P}(V)$ is an ideal (i.e., $A \subset B \in \mathcal{E} \implies A \in \mathcal{E}$), and $\mathcal{F} \subseteq \mathcal{P}(V)$ is a filter (i.e., $A \supset B \in \mathcal{F} \implies A \in \mathcal{F}$), then \(|\mathcal{E} \cap \mathcal{F}| \leq 2^{-n} \cdot |\mathcal{E}| \cdot |\mathcal{F}|\). 2. Prove that if $\mathcal{H} = (V, \mathcal{E})$ is a hypergraph with $n$ vertices and $m$ edges such that for any $E, F \in \mathcal{E}$, we have $E \cap F \neq \emptyset$ and $E \cup F \neq V$, then \(m \leq 2^{n - 2}\).","import Mathlib open Finset Real theorem prove1 {n : ℕ} (hn : 0 < n) (V : Type*) [Fintype V] [Nonempty V] (hV : Fintype.card V = n) (E F : Set (Set V)) (hE : ∀ A B, A ⊆ B ∧ B ∈ E → A ∈ E) (hF : ∀ A B, A ⊇ B ∧ B ∈ F → A ∈ F) : (E ∩ F).ncard ≤ (2 : ℝ)^(-n : ℤ) * E.ncard * F.ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-301703,"On the board, we write a series of $n$ numbers, where $n \geq 40$, and each one of them is equal to either $1$ or $-1$, such that the following conditions both hold: 1. The sum of every $40$ consecutive numbers is equal to $0$. 2. The sum of every $42$ consecutive numbers is not equal to $0$. We denote by $S_n$ the sum of the $n$ numbers on the board. Find the maximum possible value of $S_n$ for all possible values of $n$. prove that answer is 20","import Mathlib open Finset theorem max_sum {n : ℕ} (hn : n ≥ 40) (a : ℕ → ℤ) (ha : ∀ i ∈ range n, a i = 1 ∨ a i = -1) (hsum : ∀ i ∈ range (n - 39), ∑ j ∈ range 40, a (i + j) = 0) (hsum' : ∀ i ∈ range (n - 41), ¬∑ j ∈ range 42, a (i + j) = 0) : ∑ i ∈ range n, a i ≤ 20 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-301849,"A $12 \times 12$ board is divided into $144$ unit squares by drawing lines parallel to the sides. Two rooks placed on two unit squares are said to be non-attacking if they are not in the same column or same row. Find the least number $N$ such that if $N$ rooks are placed on the unit squares, one rook per square, we can always find $7$ rooks such that no two are attacking each other. prove that answer is 73","import Mathlib def is_non_attacking (a b : Fin 12 × Fin 12) := ¬(a.1 = b.1 ∧ a.2 ≠ b.2) ∧ ¬(a.2 = b.2 ∧ a.1 ≠ b.1) theorem min_n : IsLeast {N | ∀ s : Finset (Fin 12 × Fin 12), s.card = N → ∃ t : Finset (Fin 12 × Fin 12), t ⊆ s ∧ t.card = 7 ∧ ∀ a ∈ t, ∀ b ∈ t, a ≠ b → is_non_attacking a b} 73 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-301859,"Let $m = 30030$ and let $M$ be the set of its positive divisors which have exactly $2$ prime factors. Determine the smallest positive integer $n$ with the following property: for any choice of $n$ numbers from $M$, there exist 3 numbers $a$, $b$, $c$ among them satisfying $abc = m$. prove that answer is 11","import Mathlib theorem solution (m : ℕ) (hm : m = 30030) (M : Finset ℕ) (hM : M = {x | x ∣ m ∧ x.primeFactors.card = 2}) : IsLeast {n | 0 < n ∧ ∀ T ⊆ M, T.card = n → ∃ a ∈ T, ∃ b ∈ T, ∃ c ∈ T, a * b * c = m} 11 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-301866,"Prove that for a $2002$-element set $S$, if several different non - empty subsets of $S$ are chosen such that for each chosen subset $T$, there exists an element $x\in S$ with (i) $x otin T$ and (ii) if $U$ is any chosen subset such that $x otin U$, then either $T = U$ or $T$ and $U$ are disjoint, then the maximum possible number of chosen subsets is $2002$.","import Mathlib theorem prove (S : Finset ℝ) (hS : S.card = 2002) (T : Finset (Finset ℝ)) (hT : ∀ t ∈ T, t ≠ ∅) (hT1 : ∀ t ∈ T, ∃ x ∈ S, x ∉ t ∧ ∀ u ∈ T, x ∉ u → u = t ∨ Disjoint u t) : T.card ≤ 2002 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-301869,"Let $a_1, a_2, \ldots, a_k$ be natural numbers. Define $S(n)$ as the number of solutions in nonnegative integers to the equation $a_1x_1 + a_2x_2 + \cdots + a_kx_k = n$. Given that $S(n) \neq 0$ for all sufficiently large $n$, prove that for all sufficiently large $n$, \(S(n+1) < 2S(n)\).","import Mathlib theorem Qwen (k : ℕ) (a : Fin k → ℕ) (h : ∀ N, ∃ n, n > N ∧ {x : Fin k → ℕ | ∑ i : Fin k, a i * x i = n}.encard ≠ 0) : ∀ N, ∃ n, n > N ∧ {x : Fin k → ℕ | ∑ i : Fin k, a i * x i = n + 1}.encard < 2 * {x : Fin k → ℕ | ∑ i : Fin k, a i * x i = n}.encard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-302018,"对正整数 $n$ 及实数 $x(0 \leqslant x 0 ∧ n > 0 ∧ m < n → (∑ i ∈ Icc 1 n, x i) ^ m = ∑ k ∈ Icc 1 (n - 1), (-1) ^ (k - 1) * ∑ α ∈ (Icc 1 n).powerset.filter (fun s => s.card = n - k), (∑ j ∈ α, x j) ^ m := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-302418,"Consider the set \(S = \{1, 2, \ldots, 2010\}\). Let \(\mathcal{F}\) be the family of all subsets of \(S\) that do not contain two consecutive integers. For each subset \(A \in \mathcal{F}\), let \(P(A)\) denote the product of the elements in \(A\). Prove that \(\sum_{A \in \mathcal{F}} P(A)^2 = 2011! - 1\).","import Mathlib open Finset Nat theorem sumOfSquare {P : Finset ℕ → ℕ} (hP : ∀ A, P A = ∏ x ∈ A, x) : ∑ A ∈ (Icc 1 2010).powerset.filter (fun x => ¬∃ n, n ∈ x ∧ n + 1 ∈ x), (P A)^2 = 2011! - 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-302514,"Let $M = \{1, 2, \ldots, 2008\}$ be a set of integers. Each element of $M$ is colored with one of three colors: blue, yellow, or red, such that each color is used to color at least one element. Define the following sets: $S_1 = \{(x, y, z) \in M^3 \mid x, y, z \text{ have the same color and } 2008 \mid (x + y + z)\}$, $S_2 = \{(x, y, z) \in M^3 \mid x, y, z \text{ have three different colors and } 2008 \mid (x + y + z)\}$. Prove that $2|S_1| > |S_2|$, where $|X|$ denotes the number of elements in a set $X$.","import Mathlib open Finset theorem prove (M : Finset ℕ) (hM : M = Icc 1 2008) (color : ℕ → Fin 3) (hcolor : ∀ n ∈ M, ∃ m, color n = m) (hcolor' : ∀ m, ∃ n ∈ M, color n = m) : 2 * {p : Fin 3 → ℕ | p 0 ∈ M ∧ p 1 ∈ M ∧ p 2 ∈ M ∧ color (p 0) = color (p 1) ∧ color (p 1) = color (p 2) ∧ 2008 ∣ p 0 + p 1 + p 2}.ncard > {p : Fin 3 → ℕ | p 0 ∈ M ∧ p 1 ∈ M ∧ p 2 ∈ M ∧ color (p 0) ≠ color (p 1) ∧ color (p 1) ≠ color (p 2) ∧ color (p 2) ≠ color (p 0) ∧ 2008 ∣ p 0 + p 1 + p 2}.ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-302675,"Prove that the probability that a customer, who randomly selects an office from a company with 100 offices where 70 are randomly closed and follows the sign at a closed - office to another randomly chosen office, will eventually reach an open office is \(1 - \sum_{n = 2}^{70}\left(\frac{98!}{(100 - n)!}\frac{n - 1}{99^{n - 1}}\right)\left(\frac{70!(100 - n)!}{(70 - n)!100!}\right)\).","import Mathlib open Real theorem prove (p : ℝ) (hp : p = 1 - ∑ n ∈ Finset.Icc 2 70, (Nat.factorial 98 / Nat.factorial (100 - n)) * ((n - 1) / 99 ^ (n - 1)) * (Nat.factorial 70 * (Nat.factorial (100 - n)) / (Nat.factorial (70 - n) * Nat.factorial 100))) : p = 1 - ∑ n ∈ Finset.Icc 2 70, (Nat.factorial 98 / Nat.factorial (100 - n)) * ((n - 1) / 99 ^ (n - 1)) * (Nat.factorial 70 * (Nat.factorial (100 - n)) / (Nat.factorial (70 - n) * Nat.factorial 100)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-302704,"Let \( n \geq 5 \) be a positive integer, and \( n \) distinct positive integers \( a_1, a_2, \cdots, a_n \) satisfy the following property: For any two distinct non-empty subsets \( A \) and \( B \) of the set \( S = \{ a_1, a_2, \cdots, a_n \} \), the sum of all elements in \( A \) is not equal to the sum of all elements in \( B \). Under the above conditions, find the maximum value of \[ \frac{1}{a_1} + \frac{1}{a_2} + \cdots + \frac{1}{a_n}. \]","import Mathlib theorem max_ratio (n : ℕ) (hn : 5 ≤ n) (hnpos : n > 0) (s : Finset ℤ) (hs : s.card = n) : (∀ a ∈ s, 0 < a) → (∀ A ⊆ s, ∀ B ⊆ s, A ≠ B → A.Nonempty → B.Nonempty → ∑ a ∈ A, a ≠ ∑ b ∈ B, b) → IsGreatest {x | x = ∑ a ∈ s, (1 : ℝ)/a} (2/(3*n - 6)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-302714,"Let $S$ be a set of positive integers. Prove that at least one of the following statements holds: (1) There exist distinct finite subsets $F, G$ of $S$ such that $\sum_{x \in F} \frac{1}{x} = \sum_{x \in G} \frac{1}{x}$; (2) There exists a rational number $r \in (0,1)$ such that for any finite subset $F$ of $S$, $\sum_{x \in F} \frac{1}{x} \neq r$.","import Mathlib open Finset Real theorem Prove {S : Finset ℕ} (hS : ∀ x ∈ S, x > 0) : ∃ (T : Finset ℕ), T ⊆ S ∧ (∃ (U : Finset ℕ), U ⊆ S ∧ U ≠ T ∧ ∑ x ∈ T, (1 / x : ℚ) = ∑ x ∈ U, (1 / x : ℚ)) ∨ ∃ r : ℚ, 0 < r ∧ r < 1 ∧ ∀ T : Finset ℕ, T ⊆ S → ∑ x ∈ T, (1 / x : ℚ) ≠ r := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-302728,"Let the set \( X = \{1, 2, \cdots, 6k\}, k \in \mathbf{N}^* \). Construct a family of 3-element subsets \( \mathscr{A} \) of \( X \) such that: (1) Every 2-element subset of \( X \) is contained in at least one 3-element subset from the family \( \mathscr{A} \); (2) \( |\mathscr{A}| = 6k^2 \).","import Mathlib theorem Qwen (k : ℕ) (hk : 0 < k) (X : Finset ℕ) (hX : X = Finset.Icc 1 (6 * k)) : ∃ A : Finset (Finset ℕ), A.card = 6 * k ^ 2 ∧ (∀ s ∈ A, s ⊆ X ∧ s.card = 3) ∧ (∀ t ∈ X, ∀ u ∈ X, t ≠ u → ∃ s ∈ A, s ⊆ {t, u}) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-302801,"Let $a, b$ be integers greater than 2. Prove that there exist a positive integer $k$ and a sequence of positive integers $n_1, n_2, \cdots, n_k$ such that $n_1 = a$, $n_k = b$, and for any $1 \leq i < k$, $n_i + n_{i+1}$ divides $n_i n_{i+1}$.","import Mathlib theorem a_a (a b : ℕ) (ha : a > 2) (hb : b > 2) : ∃ k : ℕ, 0 < k ∧ ∃ n : ℕ → ℕ, (∀ i ∈ Finset.range k, 0 < n i) ∧ n 0 = a ∧ n (k - 1) = b ∧ ∀ i ∈ Finset.range (k - 1), (n i + n (i + 1)) ∣ n i * n (i + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-302814,"Let \( k \) be a positive integer, and \( A \subseteq \mathbb{Z} \). If there exist \( x_1, x_2, \cdots, x_k \in \mathbb{Z} \) such that for any \( i \neq j \), \( (x_i + A) \cap (x_j + A) = \emptyset \), then \( A \) is called a \( k \)-set, where \( x + A = \{x + a \mid a \in A\} \). Prove that if \( A_1, A_2, \cdots, A_t \) are \( k_1, k_2, \cdots, k_t \)-sets respectively, and \( A_1 \cup A_2 \cup \cdots \cup A_t = \mathbb{Z} \), then \( \frac{1}{k_1} + \frac{1}{k_2} + \cdots + \frac{1}{k_t} \geq 1 \).","import Mathlib open Finset theorem sum_of_reciprocal (t : ℕ) (A : Fin t → Set ℤ) (k : Fin t → ℕ) (hk : ∀ i, 0 < k i) (hA : ∀ i, ∃ x : Fin (k i) → ℤ, ∀ i' j', i' ≠ j' → Disjoint {x' + a | a ∈ A i} {x' + a | a ∈ A i'}) (hA' : ⋃ i, A i = ⊤) : 1 ≤ ∑ i, (1 : ℚ)/(k i) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-302867,Prove that the integer \(a\) in the range \(0 \leq a \leq 10^6 - 1\) that maximizes the value of \(\binom{10^6}{a + 1}-\binom{10^6}{a}\) is \(a = 499499\).,"import Mathlib open Nat theorem max_a : IsMaxOn (fun (a : ℕ) ↦ Nat.choose (10 ^ 6) (a + 1) - Nat.choose (10 ^ 6) a) (Finset.Icc 0 (10 ^ 6 - 1)) 499499 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-302884,"Let $F$ be a family consisting of $n$ sets, each of size $10$. Suppose that for every subset of $2004$ sets from $F$, there exists an element $x$ that belongs to at least $11$ of these sets. Prove that there exists a set $S$ with $|S| = 2003$ such that $S\cap A eq\varnothing$ for all $A\in F$.","import Mathlib theorem qwen (F : Finset (Finset ℕ)) (hF : ∀ s ∈ F, s.card = 10) (hF' : ∀ T ⊆ F, T.card = 2004 → ∃ x, {s | x ∈ s ∧ s ∈ T}.ncard ≥ 11) : ∃ S, S.card = 2003 ∧ ∀ A ∈ F, S ∩ A = ∅ := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-302951,"若集合 $X \subseteq\{1,2, \cdots, n\}$ 满足: 在 $X$ 的任意五元子集 $A$ 中都可以找到两个元素 $a 、 b(a N\), the inequality \(f(n) \leq cn\) holds, where \(f(n)\) is the smallest positive integer \(x\) for which there exists a positive integer \(k\) and a sequence of \(k\) distinct positive integers \(n = a_0 < a_1 < a_2 < \cdots < a_{k - 1}=x\) such that the product \(a_0a_1\cdots a_{k - 1}\) is a perfect square, is \(c = 2\).","import Mathlib open Real open scoped BigOperators theorem prove : IsLeast {c : ℝ | ∃ N : ℕ, ∀ n > N, ∃ x : ℕ, IsLeast {y | 0 < y ∧ ∃ k : ℕ, ∃ a : Fin k → ℕ, (∀ i j, a i = a j → i = j) ∧ (∀ i, 0 < a i) ∧ IsSquare (∏ i, a i)} x ∧ x ≤ c * n} (2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-303234,"Prove that if $A = \{ n \in \mathbb{N} \mid 5 \text{ divides } n \}$, $B = \{ n \in \mathbb{N} \mid \text{both } n \text{ and } \frac{n}{5} \text{ contain only odd digits} \}$, and $C = \{ n \in \mathbb{N} \mid \text{both } n \text{ and } \frac{n}{5} \text{ contain exactly 2006 digits} \}$, then \(|A \cap B \cap C| = 3^{2005}\).","import Mathlib def A : Set ℕ := {n | 5 ∣ n} def B : Set ℕ := {n | ∀ d ∈ Nat.digits 10 n, Odd d ∧ ∀ d ∈ Nat.digits 10 (n / 5), Odd d} def C : Set ℕ := {n | (Nat.digits 10 n).length = 2006 ∧ (Nat.digits 10 (n / 5)).length = 2006} theorem prove : Set.ncard (A ∩ B ∩ C) = 3 ^ 2005 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-303283,"Prove that if a plane is painted with two colors, then there always exists an isosceles right triangle whose vertices are all of the same color.","import Mathlib theorem prove (f : ℝ → ℝ → Fin 2) : ∃ x y, f x y = f (x + 1) (y + 1) ∧ f x y = f (x - 1) (y - 1) ∧ f x y = f (x + 1) (y - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-303328,"Prove that for a meteorology researcher recording weather conditions in \(n\) cities over a period of 10 days, where each day the weather in a city can be either ""Sunny"" or ""Rainy"", and for any two different days, the number of cities that have the same weather on those two days is equal to the number of cities that have different weather on those two days, the possible values of \(n\) satisfy \(4 \mid n\).","import Mathlib theorem prove (n : ℕ) (hn : n > 0) (a : Fin 10 → Fin n → Bool) (ha : ∀ i j, a i j = True ∨ a i j = False) (hij : ∀ i j, i ≠ j → {x | a x i = a x j}.encard = {x | a x i ≠ a x j}.encard) : 4 ∣ n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-303357,"Given two integers \(n \geq 1\) and \(q \geq 2\), let \(A = \{(a_1, \ldots, a_n) : a_i \in \{0, \ldots, q - 1\}, i = 1, \ldots, n\}\). For any \(a = (a_1, \ldots, a_n)\) and \(b = (b_1, \ldots, b_n)\) in \(A\), define \(\delta(a, b) = \#\{i : a_i \neq b_i\}\). Let \(t\) be a non - negative integer and \(B\) a non - empty subset of \(A\) such that \(\delta(a, b) \geq 2t + 1\) for any distinct \(a, b \in B\). Prove that the following two statements are equivalent: a) For any \(a \in A\), there exists a unique \(b \in B\) such that \(\delta(a, b) \leq t\). b) \(\displaystyle |B| \cdot \sum_{k=0}^t \binom{n}{k} (q - 1)^k = q^n\).","import Mathlib open Finset theorem δ {n : ℕ} {q : ℕ} (hn : 1 ≤ n) (hq : 2 ≤ q) (A : Set (Fin n → ℕ)) (hA : ∀ a ∈ A, ∀ i, a i ∈ Icc 0 (q - 1)) (B : Set (Fin n → ℕ)) (hB : B ⊆ A) (hB' : ∀ a ∈ B, ∀ b ∈ B, a ≠ b → {i | a i ≠ b i}.ncard ≥ 2 * t + 1) : (∀ a ∈ A, ∃! b ∈ B, {i | a i ≠ b i}.ncard ≤ t) ↔ (B.ncard * ∑ k ∈ range (t + 1), Nat.choose n k * (q - 1)^k = q^n) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-303416,"Prove that the only infinite sequences \(a_1, a_2, \ldots\) of positive integers that satisfy the following conditions: 1. The sequence is strictly increasing, i.e., \(a_1 < a_2 < a_3 < \cdots\). 2. There are no positive integers \(i\), \(j\), and \(k\) (not necessarily distinct) such that \(a_i + a_j = a_k\). 3. There are infinitely many indices \(k\) for which \(a_k = 2k - 1\). are the sequences where \(a_k = 2k - 1\) for all \(k\).","import Mathlib theorem InfiniteSequence (a : ℕ → ℤ) (ha : ∀ n, 0 < a n) (hinc : StrictMono a) (hnij : ¬∃ i j k, 0 < i ∧ 0 < j ∧ 0 < k ∧ a i + a j = a k) (h2k1 : {n | a n = 2 * n - 1}.Infinite) : ∀ k, a k = 2 * k - 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-303548,"Prove that the largest integer \(d\) such that for any set \(S\) of \(n\) integers (\(n>3\)), there exist four distinct (but not necessarily disjoint) nonempty subsets of \(S\), the sum of the elements of each of which is divisible by \(d\), is \(n - 2\).","import Mathlib theorem number_theory_889496 {n : ℕ} (hn : n > 3) : IsGreatest {d | ∀ S : Finset ℤ, S.card = n → ∃ T U V W : Finset ℤ, T ⊆ S ∧ U ⊆ S ∧ V ⊆ S ∧ W ⊆ S ∧ T ≠ U ∧ T ≠ V ∧ T ≠ W ∧ U ≠ V ∧ U ≠ W ∧ V ≠ W ∧ T.Nonempty ∧ U.Nonempty ∧ V.Nonempty ∧ W.Nonempty ∧ d ∣ Finset.sum T id ∧ d ∣ Finset.sum U id ∧ d ∣ Finset.sum V id ∧ d ∣ Finset.sum W id} (n - 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-303646,"Prove that for a positive integer \(n\), if \(f(n)\) denotes the number of permutations \(\sigma\) of the set \(\{1, 2, \ldots, n\}\) such that \(\sigma(i) \neq i\) for all \(i = 1, 2, \ldots, n\) and there are no \(1 \leq i < j \leq n\) such that \(\sigma(i) = j\) and \(\sigma(j) = i\), then \(\lim_{n \to +\infty} \frac{f(n)}{n!}=e^{-3/2}\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (f : ℕ → ℕ) (h₀ : ∀ n, f n = {σ : Equiv.Perm (Fin n) | (∀ i, σ i ≠ i) ∧ ¬∃ i j, i ≠ j ∧ σ i = j ∧ σ j = i}.ncard) : Tendsto (λ n => (f n : ℝ) / Nat.factorial n) atTop (𝓝 (Real.exp (-3/2))) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-303654,"Prove that for a set of \(2n\) positive integers, if there exists a non - square matching (a matching where the product of the two numbers in each pair is not a perfect square), then there are at least \(n!\) non - square matchings, where \(n! = 1\times2\times\cdots\times n\).","import Mathlib theorem prove_non_square_matchings (n : ℕ) (hn : 0 < n) (s : Finset ℕ) (h₀ : s.card = 2 * n) (h₁ : ∀ x ∈ s, x > 0) (h₂ : ∃ p : Finset (ℕ × ℕ), p.card = n ∧ (∀ i ∈ p, i.1 ∈ s ∧ i.2 ∈ s) ∧ (∀ i ∈ p, ¬ ∃ m : ℕ, m^2 = i.1 * i.2)) : {p : Finset (ℕ × ℕ) | p.card = n ∧ (∀ i ∈ p, i.1 ∈ s ∧ i.2 ∈ s) ∧ (∀ i ∈ p, ¬ ∃ m : ℕ, m^2 = i.1 * i.2)}.ncard ≥ Nat.factorial n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-303668,"Prove that if for \(2n\) positive integers, there exists a non - square matching (a matching where the product of the two numbers in each pair is not a perfect square), then there are at least \(n!\) non - square matchings, where \(n! = 1\times2\times3\times\cdots\times n\).","import Mathlib theorem prove_non_square_matchings (n : ℕ) (hn : 0 < n) (a : Finset ℕ) (ha : a.card = 2 * n) (hpos : ∀ x ∈ a, 0 < x) (hnon_square : ∃ p : Finset (ℕ × ℕ), p.card = n ∧ (∀ i ∈ p, ¬ ∃ m : ℕ, m^2 = i.1 * i.2)) : {p : Finset (ℕ × ℕ) | p.card = n ∧ (∀ i ∈ p, ¬ ∃ m : ℕ, m^2 = i.1 * i.2)}.ncard ≥ Nat.factorial n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-303735,"(a) Prove that for any pair of positive integers $(m, n)$, the set of all positive integers can be partitioned into four pairwise - disjoint nonempty subsets such that none of these subsets contains two numbers whose absolute difference is equal to $m$, $n$, or $m + n$. (b) Prove that the set of all positive integers cannot be partitioned into three pairwise - disjoint nonempty subsets such that none of these subsets contains two numbers whose absolute difference is equal to $m$, $n$, or $m + n$ if and only if both $m$ and $n$ are odd.","import Mathlib theorem a (m n : ℕ) (hm : 0 < m) (hn : 0 < n) : ∃ s1 s2 s3 s4 : Set ℕ, s1 ∪ s2 ∪ s3 ∪ s4 = ℕ ∧ s1 ∩ s2 = ∅ ∧ s1 ∩ s3 = ∅ ∧ s1 ∩ s4 = ∅ ∧ s2 ∩ s3 = ∅ ∧ s2 ∩ s4 = ∅ ∧ s3 ∩ s4 = ∅ ∧ s1 ≠ ∅ ∧ s2 ≠ ∅ ∧ s3 ≠ ∅ ∧ s4 ≠ ∅ ∧ ∀ x ∈ s1, ∀ y ∈ s1, |(x : ℤ) - y| ≠ m ∧ |(x : ℤ) - y| ≠ n ∧ |(x : ℤ) - y| ≠ m + n ∧ ∀ x ∈ s2, ∀ y ∈ s2, |(x : ℤ) - y| ≠ m ∧ |(x : ℤ) - y| ≠ n ∧ |(x : ℤ) - y| ≠ m + n ∧ ∀ x ∈ s3, ∀ y ∈ s3, |(x : ℤ) - y| ≠ m ∧ |(x : ℤ) - y| ≠ n ∧ |(x : ℤ) - y| ≠ m + n ∧ ∀ x ∈ s4, ∀ y ∈ s4, |(x : ℤ) - y| ≠ m ∧ |(x : ℤ) - y| ≠ n ∧ |(x : ℤ) - y| ≠ m + n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-303800,"设 $a_{1}, a_{2}, \cdots, a_{17}$ 是 $1,2, \cdots, 17$ 的一个排列,且满足 $\left(a_{1}-a_{2}\right)\left(a_{2}-a_{3}\right) \cdots\left(a_{16}-a_{17}\right)\left(a_{17}-a_{1}\right)$ $=n^{17}$. 求正整数 $n$ 的最大值。 prove that answer is 6","import Mathlib theorem max_value : IsGreatest {n | ∃(p : Fin 17 → ℕ), (∀i j, p i = p j → i = j) ∧ (∀ i, p i ∈ Set.Icc (1 : ℕ) 17) ∧ (∏ i, (p i - p ((i + 1) % 17)) = n ^ 17)} 6 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-303816,"Given a coloring of all integers using two colors, RED and BLUE, such that: 1. Every integer is colored either RED or BLUE. 2. For any subset of consecutive integers, the absolute difference between the number of integers colored RED and the number of integers colored BLUE is at most 1000. Prove that there exists a subset of 2000 consecutive integers such that the number of integers colored RED is equal to the number of integers colored BLUE.","import Mathlib theorem colorredblue (f : ℤ → Fin 2) (h₀ : ∀ n, f n = 0 ∨ f n = 1) (h₁ : ∀ n m, n ≤ m → |(Finset.Icc n m).sum (fun i => f i) - (Finset.Icc n m).sum (fun i => if f i = 0 then 1 else 0)| ≤ 1000) : ∃ k, {x | x ∈ Finset.Icc k (k + 1999) ∧ f x = 0}.ncard = {x | x ∈ Finset.Icc k (k + 1999) ∧ f x = 1}.ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-303825,"The squares of a $3\times3$ grid are filled with positive integers such that $1$ is the label of the upper- leftmost square, $2009$ is the label of the lower-rightmost square, and the label of each square divides the ne directly to the right of it and the one directly below it. How many such labelings are possible? prove that answer is 2448","import Mathlib open Finset theorem number_of_labelings : {f : (Fin 3 × Fin 3) → ℕ | ∀ x, f x > 0 ∧ f ⟨0, 0⟩ = 1 ∧ f ⟨2, 2⟩ = 2009 ∧ (∀ i j, i < 2 → f ⟨i, j⟩ ∣ f ⟨i + 1, j⟩) ∧ (∀ i j, j < 2 → f ⟨i, j⟩ ∣ f ⟨i, j + 1⟩)}.ncard = 2448 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-303920,"Prove that for a set \(S\) with \(2002\) elements and an integer \(N\) such that \(0 \leq N \leq 2^{2002}\), it is possible to color every subset of \(S\) either black or white so that: (a) The union of any two white subsets is white. (b) The union of any two black subsets is black. (c) There are exactly \(N\) white subsets.","import Mathlib theorem prove (S : Finset ℝ) (hS : S.card = 2002) (N : ℕ) (hN : 0 ≤ N ∧ N ≤ 2^2002) : ∃ f : Finset ℝ → Fin 2, (∀ T U, T ⊆ S → U ⊆ S → (f T = 1 ∧ f U = 1) → f (T ∪ U) = 1) ∧ (∀ T U, T ⊆ S → U ⊆ S → (f T = 0 ∧ f U = 0) → f (T ∪ U) = 0) ∧ {T | T ⊆ S ∧ f T = 1}.encard = N := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-304020,"Let \(S\) be an infinite set of real numbers such that for every finite subset \(\{x_1, x_2, \ldots, x_n\}\) of \(S\), the inequality \(|x_1 + x_2 + \cdots + x_n| \leq 1\) holds. Prove that \(S\) is countable.","import Mathlib theorem InfiniteSet (S : Set ℝ) (hS : Infinite S) (hS' : ∀ n > 0, ∀ x : Finset ℝ, (∀ i ∈ x, i ∈ S) ∧ x.card = n → |∑ i ∈ x, i| ≤ 1) : Countable S := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-304029,"Prove that the only infinite sequences \(a_1, a_2, \ldots\) of positive integers that satisfy the following conditions: 1. The sequence is strictly increasing, i.e., \(a_1 < a_2 < a_3 < \cdots\). 2. There are no positive integers \(i\), \(j\), and \(k\) (not necessarily distinct) such that \(a_i + a_j = a_k\). 3. There are infinitely many indices \(k\) for which \(a_k = 2k - 1\). are the sequences where \(a_n = 2n - 1\) for all \(n \in \mathbb{N}\).","import Mathlib theorem Prove (a : ℕ → ℤ) (apos : ∀ n, 0 < a n) (hinc : StrictMono a) (hnij : ¬∃ i j k, 0 < i ∧ 0 < j ∧ 0 < k ∧ a i + a j = a k) (hint : {k | a k = 2 * k - 1}.Infinite) : ∀ n, a n = 2 * n - 1 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-304046,"1. Prove that if $X$ is a regular topological space with a countable basis, then there exists a countable collection of continuous functions $f_n : X \to [0,1]$ such that for any point $x_0 \in X$ and any neighborhood $U$ of $x_0$ (where a neighborhood is an open set containing $x_0$), there exists an index $n$ such that $f_n(x_0) > 0$ and $f_n(x) = 0$ for all $x \notin U$. 2. Prove that if $X$ is a Hausdorff regular topological space with a countable basis, and the map $F: X \to \mathbb{R}^{\omega}$ is defined by \[ F(x) = (f_1(x), f_2(x), \ldots), \] where $\{f_n\}$ is the countable collection of continuous functions from part 1, then $F$ is an embedding.","import Mathlib open Filter Set TopologicalSpace open scoped Topology theorem part1 {X : Type*} [TopologicalSpace X] [RegularSpace X] (hX : ∃ B : Set (Set X), B.Countable ∧ ∀ x : X, ∃ U ∈ B, IsOpen U ∧ x ∈ U) : ∃ f : ℕ → X → ℝ, (∀ n, Continuous (f n)) ∧ (∀ n, ∀ x, f n x ∈ Icc 0 1) ∧ (∀ x0, ∀ U : Set X, IsOpen U → x0 ∈ U → ∃ n, f n x0 > 0 ∧ ∀ x, x ∉ U → f n x = 0) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-304053,"Compute the number of sequences of integers $(a_1, \ldots, a_{200})$ such that the following conditions hold: 1. $0 \leq a_1 < a_2 < \cdots < a_{200} \leq 202$. 2. There exists a positive integer $N$ with the following property: for every index $i \in \{1, \ldots, 200\}$, there exists an index $j \in \{1, \ldots, 200\}$ such that $a_i + a_j - N$ is divisible by $203$. prove that answer is 20503","import Mathlib theorem number_of_sequences : Set.ncard {a : Fin 200 → ℕ | StrictMono a ∧ (∀ i, a i ≤ 202) ∧ ∃ N > 0, ∀ i, ∃ j, 203 ∣ a i + a j - N} = 20503 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-304166,"Let $F$ be a finite set of integers such that: 1. For any $x \in F$, there exist $y, z \in F$ such that $x = y + z$. 2. There exists an integer $n$ such that for any positive integer $k$ ($1 \leq k \leq n$) and any $k$ elements $x_1, x_2, \ldots, x_k \in F$, the sum $\sum_{i=1}^{k} x_i \neq 0$. Prove that $|F| \geq 2n + 2$.","import Mathlib theorem Qwen {F : Finset ℤ} (h1 : ∀ x ∈ F, ∃ y z, x = y + z) (h2 : ∃ n, ∀ k ∈ Finset.Icc 1 n, ∀ s : Finset ℤ, s ⊆ F ∧ s.card = k → ∑ i ∈ s, i ≠ 0) : F.card ≥ 2 * n + 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-304333,"Let $x_1, x_2, \cdots, x_{2022}$ be non-negative real numbers with a sum of 1, satisfying $\sum\limits_{i=1}^{2022} x_i x_{i+1} = \frac{1}{2000}$, where $x_{2023} = x_1$. Prove that there exist $i, j \in \{1, 2, \cdots, 2022\}$ such that $|x_i - x_j| > \frac{1}{10000}$.","import Mathlib theorem qwen (x : Fin 2022 → ℝ) (h₀ : ∑ i, x i = 1) (h₁ : ∑ i, x i * x ((i + 1) % 2022) = 1 / 2000) (h₂ : ∀ i, 0 ≤ x i) : ∃ i j, |x i - x j| > 1 / 10000 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-304394,"(a) Prove that the set \(A = \{1, 6, 7, 12, 13, 18, 19, 24, 25, 30\}\) consists of ten positive integers such that no six distinct elements of \(A\) have a sum that is divisible by \(6\). (b) Prove that it is not possible to construct a set of eleven positive integers such that no six distinct elements of the set have a sum that is divisible by \(6\).","import Mathlib theorem a : ∃ A : Finset ℕ, A.card = 10 ∧ (∀ x ∈ A, x > 0) ∧ (∀ s : Finset ℕ, s ⊆ A ∧ s.card = 6 → ¬(∑ x ∈ s, x ≡ 0 [MOD 6])) := by sorry theorem b : ¬∃ S : Finset ℕ, S.card = 11 ∧ (∀ x ∈ S, x > 0) ∧ (∀ s : Finset ℕ, s ⊆ S ∧ s.card = 6 → ¬(∑ x ∈ s, x ≡ 0 [MOD 6])) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-304408,"Prove that for an \(m \times n\) chessboard, a rook can visit every square exactly once under the condition that every vertical move must be followed by a horizontal move and every horizontal move must be followed by a vertical move if and only if \((m,n) = (2,n)\), \((m,2)\), or \((2k, 2l)\) for any positive integers \(k\) and \(l\).","import Mathlib open Finset theorem chessboard_rook (m n : ℕ) : (∃ k l : ℕ, 0 < k ∧ 0 < l ∧ m = 2 * k ∧ n = 2 * l) ∨ (m = 2 ∧ n > 0) ∨ (n = 2 ∧ m > 0) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-304418,"Prove that the number of pairs $ (\alpha, S) $, where $\alpha$ is a permutation of the set $ \{1, 2, \dots, n\} $ and $ S $ is a subset of $ \{1, 2, \dots, n\} $, such that \[ \forall x \in S: \alpha(x) \not\in S, \] is equal to $ n!F_{n + 1} $, where $ F_n $ is the Fibonacci sequence defined by $ F_1 = F_2 = 1 $.","import Mathlib open Finset Nat theorem number_of_pairs {n : ℕ} (hn : 0 < n) : {p : Equiv.Perm (Fin n) × Finset (Fin n) | ∀ x ∈ p.2, p.1 x ∉ p.2}.ncard = n.factorial * Nat.fib (n + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-304540,"Prove that the number of non - empty subsets $T$ of the set $S=\{0,1,\ldots,2015\}$ such that for any $a,b\in T$, the remainder of the division of $2a + b$ by $2016$ also lies in $T$ is $\boxed{66}$.","import Mathlib def S : Finset ℕ := Finset.Icc 0 2015 theorem count : Set.ncard {T : Finset ℕ | T ⊆ S ∧ T.Nonempty ∧ ∀ a ∈ T, ∀ b ∈ T, (2 * a + b) % 2016 ∈ T} = 66 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-304693,"Prove that the number of functions \(f : \{1, 2, \ldots, n\} \rightarrow \{1, 2, \ldots, n\}\) such that \(f(f(k)) = n - k + 1\) for all \(k \in \{1, 2, \ldots, n\}\) is given by \(N = \sum_{k=1}^{n - 1} C_{n - 1}^k \cdot k^{n - k - 1}\), where \(n \geq 2\) and \(C_{n - 1}^k=\frac{(n - 1)!}{k!(n - 1 - k)!}\).","import Mathlib open Finset theorem funs_count {n : ℕ} [NeZero n] (hn : 2 ≤ n) : {f : Icc 1 n → Icc 1 n | ∀ k, f (f k) = n - k + 1}.ncard = ∑ k ∈ Icc 1 (n - 1), Nat.choose (n - 1) k * k^(n - k - 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-304816,"Prove that there exists a partition of $\mathbb{R} = A \cup B$ such that $A \cap B = \emptyset$, where both $A$ and $B$ are uncountable and dense subsets of $\mathbb{R}$.","import Mathlib theorem TopologyPartition : ∃ A B : Set ℝ, A ∪ B = ℝ ∧ A ∩ B = ∅ ∧ (¬Set.Countable A) ∧ (¬Set.Countable B) ∧ (Dense A) ∧ (Dense B) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-304845,"In a group of $6$ people playing the card game Tractor, all $54$ cards from $3$ decks are dealt evenly to all the players at random. Each deck is dealt individually. Let the probability that no one has at least two of the same card be $X$. Find the largest integer $n$ such that the $n$th root of $X$ is rational. prove that answer is 54","import Mathlib open Real open scoped BigOperators theorem max_n : IsGreatest {n | ∃ q : ℚ, (X : ℝ) ^ ((1 : ℝ) / n) = q} 54 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-304879,"1. **First part**: - The original problem already asks for a proof. So, the formal proof statement is: ""Prove that for a set of integers called **legendary**, where for any two integers \(x,y\) in the set (where \(x\) and \(y\) may or may not be distinct), the number \(xy - y^2 - y + x=(y + 1)(x - y)\) can also be added to the set, the set contains at least 8 distinct integers."" 2. **Second part**: - The original problem asks to determine the minimum - number of elements and provide an example. The final conclusion from the assistant's answer is that the minimum number of elements in a legendary set, where \(x\) and \(y\) must be distinct, is 8. - The formal proof statement is: ""Prove that for a set of integers called **legendary**, where for any two distinct integers \(x,y\) in the set, the number \(xy - y^2 - y + x=(y + 1)(x - y)\) can also be added to the set, the minimum number of elements in such a set is 8.""","import Mathlib theorem min_set : IsLeast {n | ∃ s : Finset ℤ, s.card = n ∧ (∀ x ∈ s, ∀ y ∈ s, x ≠ y → (x * y - y ^ 2 - y + x) ∈ s)} 8 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-304915,"Prove that the cardinality of the set $\mathbb{Z}_{\geq 0}^{\infty}$, which is the set of all infinite sequences where each term is a nonnegative integer, is equal to the cardinality of the set of real numbers $\mathbb{R}$, i.e., prove that \(|\mathbb{Z}_{\geq 0}^{\infty}| = |\mathbb{R}|\).","import Mathlib open Set Real theorem prove : {s : ℕ → ℕ | (∀ n, s n ≥ 0) ∧ (∃ f : ℕ → ℝ, ∀ n, s n = f n)}.ncard = {r : ℝ | True}.ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-304954,"Prove that for all integers \(n \geq 3\), there exists a sequence of positive integers \(a_1 < a_2 < \ldots < a_n\) such that \(\frac{1}{a_1} + \frac{1}{a_2} + \ldots + \frac{1}{a_n} = 1\) and the product \(a_1 a_2 \cdots a_n\) is a perfect square.","import Mathlib theorem g : (3 ≤ n → ∃ a : Fin n → ℕ, StrictMono a ∧ (∑ i, (1 : ℚ)/(a i) = 1) ∧ IsSquare (∏ i, a i)) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-305000,"Color the 36 edges connecting 9 distinct points on a circle either red or blue. Assume that every triangle formed by any three of the 9 points contains at least one red edge. Prove that there exist 4 points such that every edge connecting any two of these points is red.","import Mathlib theorem color_36 (a : Fin 9 → Fin 9 → Bool) (h₀ : ∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → a i j ∨ a i k ∨ a j k) : ∃ b c d e : Fin 9, b ≠ c ∧ b ≠ d ∧ b ≠ e ∧ c ≠ d ∧ c ≠ e ∧ d ≠ e ∧ a b c ∧ a b d ∧ a b e ∧ a c d ∧ a c e ∧ a d e := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-305161,"Given a set $I=\{(x_1,x_2,x_3,x_4) \mid x_i \in \{1,2,\cdots,11\}\}$. $A \subseteq I$, satisfying that for any $(x_1,x_2,x_3,x_4), (y_1,y_2,y_3,y_4) \in A$, there exists $i, j \ (1 \leq i < j \leq 4)$, such that $(x_i - x_j)(y_i - y_j) < 0$. Find the maximum value of $|A|$. prove that answer is 24","import Mathlib open Finset theorem max_A {I : Set (Fin 4 → ℕ)} (hI : ∀ x ∈ I, ∀ i, x i ∈ Icc 1 11) (A : Set (Fin 4 → ℕ)) (hA : A ⊆ I) (hA' : ∀ x ∈ A, ∀ y ∈ A, ∃ i j, i ≠ j ∧ i < j ∧ (x i - x j) * (y i - y j) < 0) : A.ncard ≤ 24 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-305197,"Prove that for a positive integer \(n\), if \(p(n)\) denotes the number of nonnegative integer tuples \((x, y, z, w)\) such that \(x + 2y + 2z + 3w = n\), and \(q(n)\) denotes the number of nonnegative integer tuples \((a, b, c, d)\) such that \(a + b + c + d = n\), \(a \ge b \ge d\), and \(a \ge c \ge d\), then \(p(n) = q(n)\) for all \(n\).","import Mathlib open Finset theorem p (n : ℕ) : {(x, y, z, w) : ℕ × ℕ × ℕ × ℕ | x + 2 * y + 2 * z + 3 * w = n}.ncard = {(a, b, c, d) : ℕ × ℕ × ℕ × ℕ | a + b + c + d = n ∧ a ≥ b ∧ b ≥ d ∧ a ≥ c ∧ c ≥ d}.ncard := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-305230,"Suppose that for every $\alpha \in \mathbb{R}$, there is a subset $A_\alpha \subseteq \mathbb{R}$ with $|A_\alpha| = \mathfrak{c}$. Does there always exist a set $D \subseteq \mathbb{R}$ such that $D \cap A_\alpha \neq \varnothing$ and $A_\alpha \nsubseteq D$ for each $\alpha \in \mathbb{R}$? Equivalently, do there always exist two choice functions $f, g: \mathbb{R} \to \mathbb{R}$ such that $f(\alpha), g(\alpha) \in A_\alpha$ for all $\alpha \in \mathbb{R}$, while $\{f(\alpha)\}_{\alpha \in \mathbb{R}}$ and $\{g(\alpha)\}_{\alpha \in \mathbb{R}}$ are disjoint? Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem choice_function (A : ℝ → Set ℝ) (hA : ∀ α, A α ≠ ∅ ∧ Set.ncard (A α) = c) : ∃ D, ∀ α, D ∩ A α ≠ ∅ ∧ ¬(A α ⊆ D) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-305280,"Prove that the number of ordered pairs of positive integers $(m, n)$ such that there are exactly $m$ sets of $100$ consecutive positive integers, each with its least element less than $100$, that contain exactly $m + 1$ multiples of $n$ is $6$.","import Mathlib theorem prove : {(m, n) : ℕ × ℕ | m > 0 ∧ n > 0 ∧ {k | ∃ j, k = j ∧ (j < 100) ∧ {x | x ∈ Finset.Icc k (k + 99) ∧ n ∣ x}.encard = m + 1}.ncard = m}.ncard = 6 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-305284,"Prove that if \(x_1, x_2, x_3, x_4, x_5\) are distinct positive integers such that \(x_1 + x_2 + x_3 + x_4 + x_5 = 100\), then the maximum value of the expression \[ \frac{(x_2 x_5 + 1)(x_3 x_5 + 1)(x_4 x_5 + 1)}{(x_2 - x_1)(x_3 - x_1)(x_4 - x_1)} + \frac{(x_1 x_5 + 1)(x_3 x_5 + 1)(x_4 x_5 + 1)}{(x_1 - x_2)(x_3 - x_2)(x_4 - x_2)} + \frac{(x_1 x_5 + 1)(x_2 x_5 + 1)(x_4 x_5 + 1)}{(x_1 - x_3)(x_2 - x_3)(x_4 - x_3)} + \frac{(x_1 x_5 + 1)(x_2 x_5 + 1)(x_3 x_5 + 1)}{(x_1 - x_4)(x_2 - x_4)(x_3 - x_4)} \] is \(26\).","import Mathlib open Finset Real theorem max_value (x : Fin 5 → ℕ) (hx : ∑ i, x i = 100) (hxi : ∀ i j, i ≠ j → x i ≠ x j) : IsGreatest {y | ∃ t : Fin 5 → ℕ, (∑ i, t i = 100) ∧ (∀ i j, i ≠ j → t i ≠ t j) ∧ y = ((t 1 * t 4 + 1) * (t 2 * t 4 + 1) * (t 3 * t 4 + 1)) / ((t 1 - t 0) * (t 2 - t 0) * (t 3 - t 0)) + ((t 0 * t 4 + 1) * (t 2 * t 4 + 1) * (t 3 * t 4 + 1)) / ((t 0 - t 1) * (t 2 - t 1) * (t 3 - t 1)) + ((t 0 * t 4 + 1) * (t 1 * t 4 + 1) * (t 3 * t 4 + 1)) / ((t 0 - t 2) * (t 1 - t 2) * (t 3 - t 2)) + ((t 0 * t 4 + 1) * (t 1 * t 4 + 1) * (t 2 * t 4 + 1)) / ((t 0 - t 3) * (t 1 - t 3) * (t 2 - t 3))} 26 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-305332,"What is the cardinality of the set of countably infinite subsets of a countably infinite set? Prove that the answer is 2^{\aleph_0}.","import Mathlib open Set Real open scoped BigOperators theorem card_infinite : {x : Set ℕ | ∃ y : Set ℕ, x = y ∧ Infinite y}.encard = 2 ^ (Nat.card ℕ) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-305460,"Given an uncountable subset $S$ of the unit interval $[0,1]$, determine whether $S$ has an accumulation point that is also a member of $S$. Provide a justification for your answer. Prove that the answer is Yes.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem unit_interval_accumulation_point (S : Set ℝ) (hS : S ⊆ Set.Icc 0 1) (hSc : ¬ Set.Countable S) : ∃ x ∈ S, ClusterPt x (𝓟 S) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DeepMath-103k, flc-305485,"The user's problem is not a proof problem. The final conclusion we want to prove is the value of the fraction \(\frac{p_{2004} - p_{2002} - p_{1999}}{p_{2000} + p_{2001}}\). We can rewrite the problem as the following formal math proof statement: Prove that if \(a_n\) denotes the number of \(n\) - length words that end in \(A\) and have a specific property, \(b_n\) denotes the number of \(n\) - length words that end in \(B\) and have the same property, and \(p_n=a_n + b_n\), and the recursive relations are \[ \begin{cases} p_{n + 1}=p_n + p_{n-1}+b_{n - 2}\\ a_{n+1}=b_n + b_{n-1}+b_{n-2}\\ b_{n+1}=a_n + a_{n-1} \end{cases} \] then the value of the fraction \(\frac{p_{2004}-p_{2002}-p_{1999}}{p_{2000}+p_{2001}}\) is equal to the value obtained from the above - given recursive relations and calculations. (Since the assistant's answer did not give a final numerical value, we can't state a specific result in the proof statement. If a numerical value was obtained, we would write ""then \(\frac{p_{2004}-p_{2002}-p_{1999}}{p_{2000}+p_{2001}}=\text{[numerical value]}\)"")","import Mathlib theorem algebraic_solution {a b p : ℕ → ℕ} (ha : ∀ n, a (n + 1) = b n + b (n - 1) + b (n - 2)) (hb : ∀ n, b (n + 1) = a n + a (n - 1)) (hp : ∀ n, p n = a n + b n) (h : ∀ n, p (n + 1) = p n + p (n - 1) + b (n - 2)) : (p 2004 - p 2002 - p 1999 : ℚ) / (p 2000 + p 2001) = 3 / 5 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-305518,Prove that \(\sum_{k=0}^{\infty} \binom{n}{ak} = \sum_{j=0}^{a-1} \frac{2^n \cos^n \left( \frac{j \pi}{a} \right) \cos \left( \frac{nj \pi}{a} \right)}{a}\).,"import Mathlib open Real Set open scoped BigOperators theorem prove {n : ℕ} (hn : n > 0) (a : ℕ) : ∑' k : ℕ, Nat.choose n (a * k) = ∑ j : Fin a, (2 ^ n * (Real.cos (j * π / a)) ^ n * (Real.cos (n * j * π / a))) / a := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-305532,"Prove that the largest possible value of \(n\) for real - numbers \(x_1,x_2,\ldots,x_n\) satisfying \(1\leq x_1,x_2,\ldots,x_n\leq160\) and \(x_i^2 + x_j^2 + x_k^2\geq2(x_i x_j + x_j x_k + x_k x_i)\) for all \(1\leq i < j < k\leq n\) is \(6\).","import Mathlib open Real Set open scoped BigOperators theorem prove : IsGreatest {n | ∃ x : Fin n → ℝ, (∀ i, 1 ≤ x i ∧ x i ≤ 160) ∧ (∀ i j k, i ≠ j ∧ i ≠ k ∧ j ≠ k → x i ^ 2 + x j ^ 2 + x k ^ 2 ≥ 2 * (x i * x j + x j * x k + x k * x i))} 6 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-305632,"Prove that if $M$ is a finite subset of real numbers such that for any three distinct elements $x, y, z \in M$, there exist two elements whose sum is also in $M$, then the maximum number of elements that $M$ can have is $7$.","import Mathlib theorem FiniteSet.card (M : Finset ℝ) (hM : ∀ x ∈ M, ∀ y ∈ M, ∀ z ∈ M, x ≠ y ∧ y ≠ z ∧ z ≠ x → ∃ w ∈ M, w = x + y ∨ w = y + z ∨ w = z + x) : M.card ≤ 7 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-305637,"A classroom consists of a $5 \times 5$ array of desks, to be filled by anywhere from 0 to 25 students, inclusive. No student will sit at a desk unless either all other desks in its row or all others in its column are filled (or both). Considering only the set of desks that are occupied (and not which student sits at each desk), how many possible arrangements are there? prove that answer is 962","import Mathlib open Finset theorem n : {a : Fin 5 → Fin 5 → Fin 2 | (∀ i j, a i j = 1 → (∀ k, a k j = 1 ∨ a i k = 1))}.ncard = 962 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k (HMMT_2), flc-305703,"Prove that if \(f_i = \sum\limits_{k=0}^n (-1)^k k^i \binom{n}{k}\), then \(f_{n+2} = (-1)^n (n+2)! \cdot \left(\frac{n}{6} + \frac{n(n-1)}{8}\right)\) and \(f_{n+3} = (-1)^n (n+3)! \cdot \left(\frac{n}{24} + \frac{n(n-1)}{12} + \frac{n(n-1)(n-2)}{48}\right)\).","import Mathlib open Finset Real Nat theorem f_453299 {n : ℕ} (f : ℕ → ℝ) (h₀: ∀ i, f i = ∑ k ∈ range (n + 1), (-1 : ℝ)^k * k^i * Nat.choose n k) : f (n + 2) = (-1 : ℝ)^n * (Nat.factorial (n + 2)) * ((n / (6 : ℝ)) + (n * (n - 1) / (8 : ℝ))) ∧ f (n + 3) = (-1 : ℝ)^n * (Nat.factorial (n + 3)) * ((n / (24 : ℝ)) + (n * (n - 1) / (12 : ℝ)) + (n * (n - 1) * (n - 2) / (48 : ℝ))) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-305810,"Prove that the smallest possible number of cards, each with a number of the form \(m!\) (\(m\) is a positive integer), in a collection such that for any positive integer \(t\leq n!\), it is possible to select some card(s) from this collection so that the sum of the number(s) on the selected card(s) is exactly \(t\), is \(\frac{n^2 + n + 2}{2}\).","import Mathlib open Nat Set open scoped BigOperators theorem min_number_of_cards {n : ℕ} (hn : 0 < n) : IsLeast {k | ∃ s : Finset ℕ, s.card = k ∧ (∀ t ∈ Icc 1 (n !), ∃ x ⊆ s, ∑ m ∈ x, m ! = t)} ((n ^ 2 + n + 2) / 2) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-305811,"A solitaire game is played as follows. Six distinct pairs of matched tiles are placed in a bag. The player randomly draws tiles one at a time from the bag and retains them, except that matching tiles are put aside as soon as they appear in the player's hand. The game ends if the player ever holds three tiles, no two of which match; otherwise the drawing continues until the bag is empty. The probability that the bag will be emptied is $p/q,$ where $p$ and $q$ are relatively prime positive integers. Find $p+q.$ prove that answer is 394","import Mathlib open Real open scoped BigOperators theorem solitaireprob : ∃ p q : ℕ, p.Coprime q ∧ (p / q : ℚ) = solitaire_empty_prob ∧ p + q = 394 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-305812,"Prove that given a set $M$ consisting of $1985$ distinct positive integers, where each integer in $M$ has no prime divisor greater than $23$, $M$ contains a subset of $4$ elements whose product is the fourth power of an integer.","import Mathlib theorem prove (M : Finset ℕ) (hM : M.card = 1985) (hM1 : ∀ m ∈ M, 0 < m) (hM2 : ∀ m ∈ M, ∀ p, Nat.Prime p → p ∣ m → p ≤ 23) : ∃ S ⊆ M, S.card = 4 ∧ ∃ k, S.prod id = k ^ 4 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-305834,"Given the set \( M = \{x_1, x_2, \cdots, x_{4n+3}\} \), its \( 4n+3 \) subsets \( A_1, A_2, \cdots, A_{4n+3} \) satisfy the following properties: 1. Every \( n+1 \) elements of \( M \) belong to exactly one subset \( A_j \) (\(1 \leq j \leq 4n+3\)); 2. \( |A_i| \geq 2n+1 \) (\( i = 1, 2, \cdots, 4n+3 \)). **Prove**: For any two subsets \( A_i \) and \( A_j \) (\( 1 \leq i < j \leq 4n+3 \)), they have exactly \( n \) common elements.","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (M : Finset ℝ) (hM : M.card = 4 * n + 3) (A : Fin (4 * n + 3) → Finset ℝ) (hA : ∀ s : Finset ℝ, s ⊆ M ∧ s.card = n + 1 → ∃! j : Fin (4 * n + 3), A j = s) (hA' : ∀ i : Fin (4 * n + 3), (A i).card ≥ 2 * n + 1) : ∀ i j : Fin (4 * n + 3), i ≠ j → (A i ∩ A j).card = n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-305851,"Prove that for all positive integers \(n\): \(\displaystyle\sum_{k=1}^n \displaystyle\binom{n}{k} k^{k-1} (n-k)^{n-k} = n^n\) [When evaluating \((n - k)^{n - k}\) in the sum for \(k = n\), interpret \(0^0\) as 1].","import Mathlib open Finset theorem Nat.choose_sum {n : ℕ} (hn : 0 < n) : ∑ k ∈ Icc 1 n, Nat.choose n k * k^(k - 1) * (n - k)^(n - k) = n^n := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-305892,"Let $a_1, a_2, \cdots$ be a permutation of all positive integers. Prove that there exist infinitely many positive integers $i$ such that $\gcd(a_i, a_{i+1}) \leq \frac{3}{4} i$.","import Mathlib theorem gcd_a (a : ℕ → ℕ) (ha : ∃ p : Equiv.Perm ℕ, ∀ n, a n = p n + 1) : ∀ N, ∃ i, i > N ∧ Nat.gcd (a i) (a (i + 1)) ≤ (3 / 4 : ℚ) * i := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-305944,"Let $p$ be a prime number, and let $A$ be an infinite set of integers. Prove that there exists a subset $B'$ of $A$ with $2p - 2$ elements such that the arithmetic mean of any $p$ pairwise distinct elements in $B'$ does not belong to $A$.","import Mathlib theorem qwen (p : ℕ) (hp : Nat.Prime p) (A : Set ℤ) (hA : Infinite A) : ∃ B' : Set ℤ, B' ⊆ A ∧ B'.ncard = 2 * p - 2 ∧ ∀ s : Finset ℤ, s.card = p → (∀ x ∈ s, x ∈ B') → ¬∃ y ∈ A, (Finset.sum s id) / p = y := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-306001,"Let $S = \{1, 2, \dots, 9\}$. Compute the number of functions $f : S \rightarrow S$ such that, for all $s \in S$, $f(f(f(s))) = s$ and $f(s) - s$ is not divisible by $3$. prove that answer is 288","import Mathlib theorem solution : {f : Fin 9 → Fin 9 | (∀ i, f (f (f i)) = i) ∧ (∀ i, ¬(3 ∣ (f i - i)))}.ncard = 288 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-306115,"Let $G$ be a graph with $N$ vertices, where $N > M$ and $M$ is an odd positive integer. Suppose that for any set of $M$ vertices in $G$, there exists at least one vertex in $G$ that is connected to at least $M - 1$ of these $M$ vertices. Prove that there exists a set of $M + 1$ vertices in $G$ such that it is impossible to select $\frac{M + 3}{2}$ vertices from this set where no two selected vertices are adjacent.","import Mathlib theorem graph_amicable {N : ℕ} (hN : N > M) (hM : Odd M ∧ M > 0) (g : Fin N → Fin N → Bool) (hg : ∀ s : Finset (Fin N), s.card = M → ∃ t : Fin N, t ∉ s ∧ {u | u ∈ s ∧ g u t}.ncard ≥ M - 1) : ∃ s : Finset (Fin N), s.card = M + 1 ∧ ¬∃ t : Finset (Fin N), t ⊆ s ∧ t.card = (M + 3) / 2 ∧ ∀ u ∈ t, ∀ v ∈ t, u ≠ v → ¬g u v := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-306127,"Prove that the chromatic number $\chi(\mathbb{E}^2)$ of the infinite unit - distance graph $G$, where each point in the plane $\mathbb{E}^2$ is a vertex and an edge exists between two vertices if they are separated by a unit distance, satisfies the inequality \(4 \leq \chi(\mathbb{E}^2) \leq 7\).","import Mathlib open Real Set open scoped BigOperators theorem inequalities : 4 ≤ (sInf {n | ∃ f : EuclideanSpace ℝ (Fin 2) → Fin n, ∀ p q : EuclideanSpace ℝ (Fin 2), dist p q = 1 → f p ≠ f q}) ∧ (sInf {n | ∃ f : EuclideanSpace ℝ (Fin 2) → Fin n, ∀ p q : EuclideanSpace ℝ (Fin 2), dist p q = 1 → f p ≠ f q}) ≤ 7 := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-306195,"Let \( a_1, a_2, \cdots \) be an increasing sequence of positive integers such that for any positive integer \( n \), \( a_n \) cannot be expressed as \( \sum_{i=1}^{n-1} c_i a_i \), where \( c_i \in \{0, 1\} \). For a positive integer \( m \), let \( f(m) \) denote the number of \( a_i \) not exceeding \( m \). Prove that for any positive integers \( m \) and \( k \), \( f(m) \leq a_k + \frac{m}{k+1} \).","import Mathlib open Finset theorem prove (a : ℕ → ℕ) (ha : StrictMono a) (hpos : ∀ n, 0 < a n) (hn : ∀ n, ¬∃ c : ℕ → ℕ, (∀ i ∈ Icc 1 (n - 1), c i = 0 ∨ c i = 1) ∧ a n = ∑ i ∈ Icc 1 (n - 1), c i * a i) : ∀ m k, {x | ∃ i, x = a i ∧ x ≤ m}.ncard ≤ a k + m / (k + 1 : ℚ) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-306240,"Prove that for the set \(X = \{1, 2, \ldots, 2^{1996} - 1\}\), there exists a subset \(A \subseteq X\) such that: 1. \(1 \in A\) and \(2^{1996} - 1 \in A\); 2. Every element of \(A\) except \(1\) is the sum of two (possibly equal) elements from \(A\); 3. The maximum number of elements in \(A\) is \(2012\).","import Mathlib theorem Prove : ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 (2 ^ 1996 - 1) ∧ 1 ∈ A ∧ (2 ^ 1996 - 1) ∈ A ∧ (∀ x ∈ A, x ≠ 1 → ∃ y z, y ∈ A ∧ z ∈ A ∧ x = y + z) ∧ A.card ≤ 2012 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-306411,"Prove that the number of functions $f: \{1, 2, \dots, 15\} \to \{1, 2, \dots, 15\}$ such that for all $x \in \{1, 2, \dots, 15\}$, the expression $\frac{f(f(x)) - 2f(x) + x}{15}$ is an integer is equal to \(375\).","import Mathlib theorem count: Set.ncard {f : Fin 15 → Fin 15 | ∀ i, f (f i) - 2 * f i + i ≡ 0 [ZMOD 15]} = 375 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-306420,"Prove that the number of functions $f: \{1, 2, \dots, 15\} \to \{1, 2, \dots, 15\}$ such that for all $x \in \{1, 2, \dots, 15\}$, the expression $\frac{f(f(x)) - 2f(x) + x}{15}$ is an integer is \(375\).","import Mathlib theorem number_of_integer_favorable_maps : Set.encard {f : Finset.Icc (1 : ℕ) 15 → Finset.Icc (1 : ℕ) 15 | ∀ x : Finset.Icc (1 : ℕ) 15, ∃ k : ℤ, ((f (f x) - (2 * f x) + x) / (15 : ℚ) = k)} = 375 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-306542,"Prove that in a strategic game where Ann selects \(300\) points in the plane and paints them red, and Bruno's objective is to either identify a set of \(10\) collinear points or a set of \(10\) points where no three points are collinear (Bruno wins if he succeeds, Ann wins otherwise), Bruno can ensure his victory under optimal play.","import Mathlib open Finset Real theorem strategic_game_bruce (A : Fin 300 → ℝ × ℝ) (hA : ∀ i j, A i = A j → i = j) : ∃ S : Finset (Fin 300), S.card = 10 ∧ (∀ x ∈ S, ∀ y ∈ S, ∀ z ∈ S, x ≠ y ∧ y ≠ z ∧ z ≠ x → ¬Collinear ℝ {A x, A y, A z}) ∨ ∃ S : Finset (Fin 300), S.card = 10 ∧ (∀ x ∈ S, ∀ y ∈ S, ∀ z ∈ S, x ≠ y ∧ y ≠ z ∧ z ≠ x → Collinear ℝ {A x, A y, A z}) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-306625,"Prove that for some $k$, the sequence $A_k$ contains an element $x$ such that $|x| \geq \frac{n}{2}$, where $A_0 = (a_1, \dots, a_n)$ is a finite sequence of real numbers, and for each $k \geq 0$, from the sequence $A_k = (x_1, \dots, x_n)$, a new sequence $A_{k+1}$ is constructed as follows: 1. Choose a partition $\{1, \dots, n\} = I \cup J$, where $I$ and $J$ are two disjoint sets, such that the expression \[ \left| \sum_{i \in I} x_i - \sum_{j \in J} x_j \right| \] attains its minimum value. (We allow $I$ or $J$ to be empty, in which case the corresponding sum is 0.) If there are multiple such partitions, choose one arbitrarily. 2. Set $A_{k+1} = (y_1, \dots, y_n)$ where $y_i = x_i + 1$ if $i \in I$, and $y_i = x_i - 1$ if $i \in J$.","import Mathlib open Finset Real theorem prove {n : ℕ} (hn : 0 < n) (a : ℕ → ℝ) (A : ℕ → ℕ → ℝ) (hA0 : ∀ i ∈ Icc 1 n, A 0 i = a i) (hAk : ∀ k ≥ 0, ∃ I J : Finset ℕ, I ⊆ Icc 1 n ∧ J ⊆ Icc 1 n ∧ I ∩ J = ∅ ∧ |∑ i ∈ I, A k i - ∑ j ∈ J, A k j| = sInf {abs (∑ i ∈ I, A k i - ∑ j ∈ J, A k j) | (I : Finset ℕ) (J : Finset ℕ) (hIJ : I ∩ J = ∅)} ∧ ∀ i ∈ Icc 1 n, A (k + 1) i = if i ∈ I then A k i + 1 else A k i - 1) : ∃ k, ∃ i ∈ Icc 1 n, |A k i| ≥ n / 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-306688,Prove that the largest possible number of elements in a subset $S$ of the set $T$ of all positive - integer divisors of $2004^{100}$ such that no element in $S$ divides any other element in $S$ is \(10000\).,"import Mathlib theorem max_s : IsGreatest {x | ∃ S : Finset ℕ, S ⊆ Nat.divisors (2004^100) ∧ S.card = x ∧ ∀ m ∈ S, ∀ n ∈ S, m ≠ n → ¬(m ∣ n)} 10000 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-306763,"Let $S$ be the set of all ordered triple of integers $(a_1,a_2,a_3)$ with $1 \le a_1,a_2,a_3 \le 10$. Each ordered triple in $S$ generates a sequence according to the rule $a_n=a_{n-1}\cdot | a_{n-2}-a_{n-3} |$ for all $n\ge 4$. Find the number of such sequences for which $a_n=0$ for some $n$. prove that answer is 494","import Mathlib open Finset theorem number_of_triple_with_zero_sequence : {(a1, a2, a3) : ℤ × ℤ × ℤ | (1 ≤ a1 ∧ a1 ≤ 10) ∧ (1 ≤ a2 ∧ a2 ≤ 10) ∧ (1 ≤ a3 ∧ a3 ≤ 10) ∧ ∃ (f : ℕ → ℤ), f 0 = a1 ∧ f 1 = a2 ∧ f 2 = a3 ∧ ∀ n ≥ 3, f n = f (n - 1) * |f (n - 2) - f (n - 3)| ∧ ∃ n, f n = 0}.ncard = 494 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-306839,"设 $a_{1}, a_{2}, \cdots, a_{20} \in\{1,2, \cdots, 5\}, b_{1}, b_{2}, \cdots, b_{20} \in\{1,2, \cdots, 10\}$, 集合 $X=\{(i, j) \mid$ $\left.1 \leqslant i 0 ∧ b > 0 ∧ p.Prime ∧ ¬p ∣ a ∧ (a / p ^ b : ℚ) = {z : Fin 12 → ℂ | (∀ i, z i ∈ {x | x = Real.sqrt 2 * I ∨ x = -Real.sqrt 2 * I ∨ x = (1 + I) / Real.sqrt 8 ∨ x = (-1 + I) / Real.sqrt 8 ∨ x = (1 - I) / Real.sqrt 8 ∨ x = (-1 - I) / Real.sqrt 8}) ∧ ∏ i, z i = -1}.ncard / 6 ^ 12 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-306850,"A quadratic polynomial $f(x)$ is called sparse if its degree is exactly 2 , if it has integer coefficients, and if there exists a nonzero polynomial $g(x)$ with integer coefficients such that $f(x) g(x)$ has degree at most 3 and $f(x) g(x)$ has at most two nonzero coefficients. Find the number of sparse quadratics whose coefficients lie between 0 and 10, inclusive. prove that answer is 228","import Mathlib def isSparse (f : Polynomial ℤ) : Prop := f.degree = 2 ∧ ∃ g : Polynomial ℤ, g ≠ 0 ∧ (f * g).degree ≤ 3 ∧ {i | (f * g).coeff i ≠ 0}.encard ≤ 2 theorem countSparse : Set.ncard {f : Polynomial ℤ | 0 ≤ f.coeff 0 ∧ f.coeff 0 ≤ 10 ∧ 0 ≤ f.coeff 1 ∧ f.coeff 1 ≤ 10 ∧ 0 ≤ f.coeff 2 ∧ f.coeff 2 ≤ 10 ∧ isSparse f} = 228 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-306858,"Prove that for positive integers \(n\) and \(m\), if \(v_2(m) \neq v_2(n)\), then there does not exist an infinite sequence \(\{x_k\}\) of \(0\)s and \(1\)s such that if \(x_i = 0\), then \(x_{i+m} = 1\), and if \(x_i = 1\), then \(x_{i+n} = 0\).","import Mathlib theorem prove (n m : ℕ) (hn : 0 < n) (hm : 0 < m) (hnm : Nat.factorization m 2 ≠ Nat.factorization n 2) : ¬∃ x : ℕ → ℕ, (∀ i, x i = 0 ∨ x i = 1) ∧ (∀ i, x i = 0 → x (i + m) = 1) ∧ (∀ i, x i = 1 → x (i + n) = 0) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-306859,"For a positive integer $n$, define $f(n)$ as the largest integer $k$ such that $k! \leq n$. Define $g(n)$ as $n - (f(n))!$. For $j \geq 1$, define the function $g^j(n)$ as: \[ g^j(n) = \underbrace{g(\dots(g(n))\dots)}_{\text{$j$ times}}. \] Find the smallest positive integer $n$ such that $g^j(n) > 0$ for all $j < 30$ and $g^{30}(n) = 0$. prove that answer is 120959","import Mathlib open Nat theorem g_48746 {f g : ℕ → ℕ} (hf : ∀ n, IsGreatest {k | k ! ≤ n} (f n)) (hg : ∀ n, g n = n - (f n)!) (g_seq : ℕ → ℕ → ℕ) (h_gseq : ∀ n j, g_seq n j = if 0 ≤ j then g^[j] n else n) : IsLeast {n : ℕ | 0 < n ∧ (∀ j < 30, g_seq n j > 0) ∧ g_seq n 30 = 0} 120959 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-306877,"The integers from 1 to $2008^2$ are written on each square of a $2008 \times 2008$ board. For every row and column, the difference between the maximum and minimum numbers is computed. Let $S$ be the sum of these 4016 numbers. Find the greatest possible value of $S$. prove that answer is 16184704896","import Mathlib open Finset theorem max_value: IsGreatest {x | ∃ f : Fin 2008 → Fin 2008 → ℕ, (∀ i j, f i j ∈ Icc 1 (2008 ^ 2)) ∧ x = ∑ i, (sSup {f i j | j:Fin 2008} - sInf {f i j | j:Fin 2008}) + ∑ j, (sSup {f i j | i:Fin 2008} - sInf {f i j | i:Fin 2008})} 16184704896 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-306926,"Prove that for every positive real number $\varepsilon$, with the exception of finitely many positive integers $n$, every simple graph with $n$ vertices and at least $(1 + \varepsilon)n$ edges contains two cycles of the same length.","import Mathlib open Finset Real theorem prove (ε : ℝ) (hε : ε > 0) : {n : ℕ | n > 0 ∧ ¬∃ s : Finset (Fin n × Fin n), s.card ≥ (1 + ε) * n ∧ ∀ x ∈ s, x.1 ≠ x.2}.Finite := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-306930,"Prove that a pair $(n, m)$ of positive integers is such that there exists an infinite sequence $\{x_k\}$ of $0$s and $1$s with the property that if $x_i = 0$, then $x_{i+m} = 1$, and if $x_i = 1$, then $x_{i+n} = 0$ if and only if $v_2(m) = v_2(n)$, where $v_2(x)$ denotes the highest power of $2$ dividing $x$.","import Mathlib theorem prove (n m : ℕ) (hn : 0 < n) (hm : 0 < m) : (∃ x : ℕ → ℕ, (∀ i, x i = 0 ∨ x i = 1) ∧ (∀ i, x i = 0 → x (i + m) = 1) ∧ (∀ i, x i = 1 → x (i + n) = 0)) ↔ Nat.factorization m 2 = Nat.factorization n 2 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-307279,Prove that the sum \(S_{0}=\sum_{k} \binom{4k}{n}\) of the binomial coefficients \(\binom{n}{m}\) where \(m = 4k\) for non - negative integers \(k\) is given by \(S_{0}=2^{n - 2}+2^{\frac{n}{2}-1}\cos\frac{n\pi}{4}\).,"import Mathlib open Real Set open scoped BigOperators theorem sumOfCoeffs (S : ℕ → ℝ) (hS : ∀ n, S n = ∑' k : ℕ, Nat.choose (4*k) n): ∀ n, S n = 2^(n - 2) + 2^(n/2 - 1) * cos (n*π / 4) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-307400,"Let $n, b$ be positive integers. If there exists a set of $n$ distinct positive integers, all less than $b$, such that for any two distinct subsets $U, V$, the sum of the elements in $U$ is not equal to the sum of the elements in $V$, then $n$ is said to be ""$b$-distinguishable."" Prove that: (1) $8$ is $100$-distinguishable; (2) $9$ is not $100$-distinguishable.","import Mathlib def is_b_distinguishable (n : ℕ) (b : ℕ) := ∃ s : Finset ℕ, s.card = n ∧ ∀ x ∈ s, x < b ∧ ∀ U V : Finset ℕ, U ⊆ s ∧ V ⊆ s ∧ U ≠ V → ∑ u ∈ U, u ≠ ∑ v ∈ V, v theorem prove : is_b_distinguishable 8 100 ∧ ¬is_b_distinguishable 9 100 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-307469,"Prove that the maximum number of elements of a subset \(G\) of the set \(S=\{1,2,\ldots,2012\}\) such that for any two numbers \(a,b\in G\), the sum \(a + b\) is not divisible by their positive difference \(|a - b|\) is \(671\).","import Mathlib def S : Finset ℕ := Finset.Icc 1 2012 theorem IsG : IsGreatest {x | ∃ G : Finset ℕ, G ⊆ S ∧ G.card = x ∧ ∀ a ∈ G, ∀ b ∈ G, ¬(a + b ≡ 0 [ZMOD |(a : ℤ) - b|])} 671 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-307488,"All possible $6$-digit numbers, in each of which the digits occur in non-increasing order (from left to right, e.g., $877550$), are written as a sequence in increasing order. Find the $2005^{\text{th}}$ number in this sequence. prove that answer is 864100","import Mathlib theorem solution : (Nat.nth {n | (Nat.digits 10 n).length = 6 ∧ ∀ i j, i < j → (Nat.digits 10 n).get i ≥ (Nat.digits 10 n).get j} 2004) = 864100 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-307570,"Prove that every connected metric space with more than one point is uncountable. Specifically, consider a countable metric space $X$ and distinct points $x_0, y_0 \in X$ such that $d(x_0, y_0) = \xi > 0$. Show that the existence of a $\delta \in (0, \xi) \setminus \Omega$, where $\Omega = \{d(x, y) : x, y \in X\}$, leads to a contradiction of the connectedness of $X$ by constructing disjoint, non-empty open sets $E$ and $G$ whose union is $X$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove_uncountable {X : Type*} [MetricSpace X] [ConnectedSpace X] (hX : ∃ x y : X, x ≠ y ∧ dist x y > 0) : ¬ Countable X := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-307738,"Let $n$ be a positive integer and $A$ a set of integers such that the set $\{x = a + b\ |\ a, b \in A\}$ contains all the squares of the first $n$ positive integers, i.e., $\{1^2, 2^2, \dots, n^2\}$. Prove that there exists a positive integer $N$ such that if $n \ge N$, then the cardinality of $A$, denoted by $|A|$, satisfies $|A| > n^{0.666}$.","import Mathlib theorem a182939 (n : ℕ) (hn : 0 < n) (A : Finset ℤ) (h : ∀ i ∈ Finset.Icc 1 n, ∃ a b, a ∈ A ∧ b ∈ A ∧ i^2 = a + b) : ∃ N : ℕ, 0 < N ∧ ∀ n ≥ N, (A.card : ℝ) > n ^ ((666 : ℝ) / 1000) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-307964,"Given positive integers $n$ and $k$ such that $2 \le n < 2^k$, prove that there exists a subset $A$ of $\{0, 1, \ldots, n\}$ such that for any distinct $x, y \in A$, the binomial coefficient ${y \choose x}$ is even, and the size of $A$ satisfies the inequality: \[ |A| \ge \frac{{k \choose \lfloor \frac{k}{2} \rfloor}}{2^k} \cdot (n+1). \]","import Mathlib theorem Qwen {n k : ℕ} (hn : 0 < n) (hk : 0 < k) (h : 2 ≤ n ∧ n < 2 ^ k) : ∃ A : Finset ℕ, A ⊆ Finset.Icc 0 n ∧ (∀ x ∈ A, ∀ y ∈ A, x ≠ y → Even (Nat.choose y x)) ∧ A.card ≥ Nat.choose k ⌊(k / 2 : ℝ)⌋₊ / (2 ^ k) * (n + 1) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-308023,"Prove that the smallest integer \(n\) such that for any \(n\) - element subset of the set \(A=\{p^a q^b r^c:0\leq a,b,c\leq5\}\), where \(p,q,r\) are distinct prime numbers, there exist two distinct elements \(x\) and \(y\) such that \(x\) divides \(y\) is \(n = 29\).","import Mathlib open Finset theorem ProveIsLeast {A : Set ℕ} (hA : A = {x | ∃ p a q b r c : ℕ, p.Prime ∧ q.Prime ∧ r.Prime ∧ p ≠ q ∧ p ≠ r ∧ q ≠ r ∧ a ≤ 5 ∧ b ≤ 5 ∧ c ≤ 5 ∧ x = p ^ a * q ^ b * r ^ c}) : IsLeast {n : ℕ | ∀ S ⊆ A, S.encard = n → ∃ x ∈ S, ∃ y ∈ S, x ≠ y ∧ x ∣ y} 29 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-308231,"Let $A_1, A_2, A_3, \cdots$ be a sequence of sets such that for any positive integer $j$, there are only finitely many positive integers $i$ with $A_i \subseteq A_j$. Prove that there exists a sequence of positive integers $a_1, a_2, a_3, \cdots$ such that for any positive integers $i, j$, $a_i \mid a_j$ if and only if $A_i \subseteq A_j$.","import Mathlib theorem seq_of_set (A : ℕ → Set ℕ) (hA : ∀ j > 0, {i | i > 0 ∧ A i ⊆ A j}.Finite) : ∃ a : ℕ → ℕ, (∀ i, 0 < a i) ∧ (∀ i j, a i ∣ a j ↔ A i ⊆ A j) := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/Multi-Source_Math_Competition, flc-308487,"Prove that \(\lim_{n \to \infty} \frac{p_{k}(n)}{n^{k - 1}} = \frac{1}{k!(k - 1)!}\), where \(p_{k}(n)\) denotes the number of distinct partitions of \(n\) into parts no larger than \(k\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (p : ℕ → ℕ → ℕ) (h₀ : ∀ n k, p n k = {s : Finset ℕ | s.card > 0 ∧ ∑ i ∈ s, i = n ∧ ∀ i ∈ s, i ≤ k}.ncard) : ∀ k, Tendsto (λ n => p n k / n ^ (k - 1)) atTop (𝓝 (1 / (Nat.factorial k * Nat.factorial (k - 1)))) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-308513,"Let \(k = 2^n + 1\) functions \(f_1, f_2, \ldots, f_k\) be defined on the interval \([0,1]\) with values in the same set, and assume that each function is increasing and satisfies the condition \(|f_i(x) - f_i(y)| \leq |x - y|\) for all \(x, y \in [0,1]\). Prove that there exist distinct indices \(i, j \in \{1, 2, \ldots, k\}\) such that \(|f_i(x) - f_j(x)| \leq \frac{1}{n+1}\) for all \(x \in [0,1]\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove {n : ℕ} (hn : 0 < n) (k : ℕ) (hk : k = 2 ^ n + 1) (f : Fin k → ℝ → ℝ) (h₀ : ∀ i, MonotoneOn (f i) (Set.Icc 0 1)) (h₁ : ∀ x y, ∀ i, |(f i x) - (f i y)| ≤ |x - y|) : ∃ i j, i ≠ j ∧ ∀ x ∈ Set.Icc 0 1, |(f i x) - (f j x)| ≤ 1 / (n + 1) := sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-308664,Prove that the number of non - empty sets $V$ of non - zero integers for which there exists a polynomial $P(x)$ with integer coefficients such that $P(0)=330$ and $P(v) = 2|v|$ for all $v\in V$ is $210$.,"import Mathlib theorem number_of_validsets : Set.ncard {V : Finset ℤ | V.Nonempty ∧ (∀ v ∈ V, v ≠ 0) ∧ ∃ P : Polynomial ℤ, P.eval 0 = 330 ∧ ∀ v ∈ V, P.eval v = 2 * abs v} = 210 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-308798,"Prove that if there are \(2012\) evenly - spaced points on a line, and each point is to be painted either orange or green, with the condition that for any three distinct points \(A\), \(B\), and \(C\) such that \(AB = BC\), if \(A\) and \(C\) are painted the same color, then \(B\) must also be painted the same color, then the total number of possible ways to paint these points is \(2010\times1006\).","import Mathlib theorem prove (n : ℕ) (hn : n = 2012) : Set.ncard {f : Fin n → Bool | ∀ A B C : Fin n, A ≠ B ∧ A ≠ C ∧ B ≠ C ∧ (A < B ∧ B < C ∨ B < A ∧ A < C) → f A = f C → f B = f A} = 2010 * 1006 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/AoPs, flc-308847,"Let the set \( M = \{1, 2, \cdots, 10\} \). Consider its 5-element subsets \( A_1, A_2, \cdots, A_k \) satisfying the condition that any two elements of \( M \) appear in at most two distinct subsets \( A_i \) and \( A_j \) (\( i \neq j \)). Find the maximum value of \( k \).","import Mathlib theorem maxset : IsGreatest {k | ∃ S : Finset (Finset ℕ), S.card = k ∧ (∀ T ∈ S, T ⊆ Finset.Icc 1 10 ∧ T.card = 5) ∧ (∀ x ∈ Finset.Icc 1 10, ∀ y ∈ Finset.Icc 1 10, x ≠ y → {T | T ∈ S ∧ x ∈ T ∧ y ∈ T}.encard ≤ 2)} 8 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/BlueMO, flc-308855,"Twenty seven unit cubes are painted orange on a set of four faces so that two non-painted faces share an edge. The 27 cubes are randomly arranged to form a $3\times 3 \times 3$ cube. Given the probability of the entire surface area of the larger cube is orange is $\frac{p^a}{q^br^c},$ where $p,q,$ and $r$ are distinct primes and $a,b,$ and $c$ are positive integers, find $a+b+c+p+q+r.$ prove that answer is 74","import Mathlib theorem solution (p q r : ℕ) (hpqr : p.Prime ∧ q.Prime ∧ r.Prime) (hqr : q ≠ r) (hpr : p ≠ r) (hqr' : q ≠ p) (a b c : ℕ) (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) : a + b + c + p + q + r = 74 := by sorry ",Combinatorics,3. Difficulty 7,7.0,FineLeanCorpus/DAPO-Math-17k, flc-924,"Let $U, V$ be two subsets of the power set $P(X)$, where $|X| = n$. Suppose that for any $a \in U$ and $b \subseteq a$, it holds that $b \in U$, and for any $a \in V$ and $b \subseteq a$, it holds that $b \in V$. Prove that $|U| \cdot |V| \leq 2^n |U \cap V|$.","import Mathlib theorem SetPowerSet {X : Type*} [Fintype X] (n : ℕ) (hn : Fintype.card X = n) (U V : Set (Set X)) (hU : ∀ a ∈ U, ∀ b ⊆ a, b ∈ U) (hV : ∀ a ∈ V, ∀ b ⊆ a, b ∈ V) : U.ncard * V.ncard ≤ 2 ^ n * (U ∩ V).ncard := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-1334,"Let $a_{1}, a_{2}, \ldots, a_{n} \in \{-1, 1\}$ be a sequence of numbers such that $a_{1} + a_{2} + \cdots + a_{n} = 0$. Prove that there exists a $k \in \{1, 2, \ldots, n\}$ for which $|a_{1} + 2a_{2} + \cdots + ka_{k}| \leq \left\lfloor \frac{k}{2} \right\rfloor$.","import Mathlib open Finset Real Int Nat theorem sumOfSeq {n : ℕ} (hn : 0 < n) (a : ℕ → ℤ) (ha : ∀ i ∈ Icc 1 n, a i = -1 ∨ a i = 1) (hsum : ∑ i ∈ Icc 1 n, a i = 0) : ∃ k ∈ Icc 1 n, |∑ i ∈ Icc 1 k, i * a i| ≤ ⌊(k / 2 : ℝ)⌋ := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-1650,"1. **Part (a)** - The original problem is not a proof - type problem. The final conclusion from the assistant's answer is that the set \(S=\left\{1,\frac{1}{2},\frac{1}{4},\frac{1}{16}\right\}\) is a powerful set containing exactly four elements. - The formal math proof statement is: Prove that the set \(S = \left\{1,\frac{1}{2},\frac{1}{4},\frac{1}{16}\right\}\) is a powerful set, where a set \(S\) of positive real numbers is defined as powerful if for any two distinct elements \(a,b\in S\), at least one of \(a^{b}\) or \(b^{a}\) is also an element of \(S\). 2. **Part (b)** - The original problem is already a proof problem. So, the formal math proof statement remains: Prove that every finite powerful set \(S\) contains at most four elements, where a set \(S\) of positive real numbers is defined as powerful if for any two distinct elements \(a,b\in S\), at least one of \(a^{b}\) or \(b^{a}\) is also an element of \(S\).","import Mathlib open Real theorem power_set (S : Finset ℝ) (hS : ∀ x ∈ S, x > 0) (hS' : ∀ a ∈ S, ∀ b ∈ S, a ≠ b → (a ^ b ∈ S ∨ b ^ a ∈ S)) : S.card ≤ 4 := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-1756,"Let \(n > 1\) be an odd integer, and let \(a_1, a_2, \dots, a_n\) be distinct real numbers. Let \(M\) be the maximum of these numbers and \(m\) the minimum. Prove that it is possible to choose the signs in the expression \(s = \pm a_1 \pm a_2 \pm \dots \pm a_n\) such that \[ m < s < M. \]","import Mathlib theorem Odd_n (n : ℕ) (hn : Odd n ∧ n > 1) (a : Fin n → ℝ) (ha : ∀ i j, a i = a j → i = j) (M m : ℝ) (hM : ∃ i, a i = M) (hm : ∃ i, a i = m) (hMub : ∀ i, a i ≤ M) (hmub : ∀ i, a i ≥ m) : ∃ s : Fin n → ℤ, (∀ i, s i = 1 ∨ s i = -1) ∧ m < ∑ i, s i * a i ∧ ∑ i, s i * a i < M := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-1833,"Prove that given 8 integers chosen from the set \(\{1, 2, \ldots, 2011\}\), there always exist four integers \(a, b, c, d\) among them such that \(4 + d \leq a + b + c \leq 4d\).","import Mathlib theorem s : ∀ (s : Finset ℕ), s.card = 8 ∧ ∀ n ∈ s, n ∈ Finset.Icc 1 2011 → ∃ a ∈ s, ∃ b ∈ s, ∃ c ∈ s, ∃ d ∈ s, 4 + d ≤ a + b + c ∧ a + b + c ≤ 4 * d := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-1969,"Let \(a_1, a_2, \ldots, a_n \in [0,1]\) and \(\lambda\) be a real number such that \(\sum_{i = 1}^{n}a_i=n + 1 - \lambda\). Prove that for any permutation \((b_i)_{i = 1}^{n}\) of \((a_i)_{i = 1}^{n}\), we have \(\sum_{i = 1}^{n}a_ib_i\geq n + 1 - \lambda^2\).","import Mathlib theorem qwen (n : ℕ) (hn : 0 < n) (a b : Fin n → ℝ) (ha : ∀ i, a i ∈ Set.Icc 0 1) (hb : ∃ p : Equiv.Perm (Fin n), ∀ i, b i = a (p i)) (l : ℝ) (h : ∑ i, a i = n + 1 - l) : ∑ i, a i * b i ≥ n + 1 - l ^ 2 := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-2130,"Prove that for any set of \(2015\) distinct integers, there exists a subset of \(1008\) integers \(x_1,x_2,\ldots,x_{1008}\) such that \(x_1 + x_2+\cdots + x_{1008}=1008k\) for some integer \(k\in\mathbb{Z}\).","import Mathlib theorem prove (S : Finset ℤ) (hS : S.card = 2015) : ∃ T ⊆ S, T.card = 1008 ∧ ∃ k : ℤ, ∑ t ∈ T, t = 1008 * k := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-2548,"Let \(T = \{1, 2, 3, \ldots, 2016\}\). Prove that for any selection of 21 numbers from \(T\), there exist three distinct numbers \(a, b, c\) such that \(ab \leq c^2 \leq 4ab\).","import Mathlib def T : Finset ℕ := Finset.Icc 1 2016 theorem prove (S : Finset ℕ) (hS : S ⊆ T) (hS1 : S.card = 21) : ∃ a ∈ S, ∃ b ∈ S, ∃ c ∈ S, a ≠ b ∧ a ≠ c ∧ b ≠ c ∧ a * b ≤ c ^ 2 ∧ c ^ 2 ≤ 4 * a * b := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-2637,"Prove that if $X = \{1, 2, \ldots, 7\}$, $\mathcal{A} = \{F_1, F_2, \ldots, F_n\}$ is a collection of distinct subsets of $X$ such that $|F_i \cap F_j| = 1$ for all $i \neq j$, and for each $i \in X$, $r_i$ denotes the number of elements of $\mathcal{A}$ that contain $i$ with $r_1 = r_2 = 1$, $r_3 = r_4 = r_5 = r_6 = 2$, and $r_7 = 4$, then $n^2 - n = 20$.","import Mathlib theorem prove (X : Finset ℕ) (hX : X = Finset.Icc 1 7) (A : Finset (Finset ℕ)) (hA : ∀ i ∈ A, i ⊆ X) (hA' : ∀ i ∈ A, ∀ j ∈ A, i ≠ j → (i ∩ j).card = 1) (r : ℕ → ℕ) (hr : ∀ i ∈ X, r i = {j | j ∈ A ∧ i ∈ j}.ncard) (hrr : r 1 = 1 ∧ r 2 = 1 ∧ r 3 = 2 ∧ r 4 = 2 ∧ r 5 = 2 ∧ r 6 = 2 ∧ r 7 = 4) : A.card ^ 2 - A.card = 20 := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-3138,"Prove that given two sequences, one with 13 numbers \(x_1,x_2,\ldots,x_{13}\) such that \(x_i\leq93\) for \(i = 1,2,\ldots,13\), and another with 93 numbers \(y_1,y_2,\ldots,y_{93}\) such that \(y_j\leq13\) for \(j = 1,2,\ldots,93\), there exist indices \(a,b,j,k\) with \(1\leq j < k\leq93\) and \(1\leq a < b\leq13\) such that \(\sum_{i = j + 1}^{k}y_i=\sum_{i = a+1}^{b}x_i\).","import Mathlib theorem prove (x : Fin 13 → ℝ) (y : Fin 93 → ℝ) (hx : ∀ i, x i ≤ 93) (hy : ∀ j, y j ≤ 13) : ∃ a b j k, 1 ≤ j ∧ j < k ∧ k ≤ 93 ∧ 1 ≤ a ∧ a < b ∧ b ≤ 13 ∧ ∑ i in Finset.Icc (j + 1) k, y i = ∑ i in Finset.Icc (a + 1) b, x i := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-3329,"Let $k$ be a positive integer. For any positive integer $n$, let $s(n)$ denote the sum of its digits in decimal representation. Define $A_k$ as the set of all $k$-digit numbers $n$ such that $s(n) < s(2n)$, and $B_k$ as the set of all $k$-digit numbers $n$ such that $s(n) > s(2n)$. Prove that the sets $A_k$ and $B_k$ have the same number of elements.","import Mathlib def s : ℕ → ℕ | n => (Nat.digits 10 n).sum def A (k : ℕ) := {n | (Nat.digits 10 n).length = k ∧ s n < s (2 * n)} def B (k : ℕ) := {n | (Nat.digits 10 n).length = k ∧ s n > s (2 * n)} theorem kpos : 0 < k → Set.ncard (A k) = Set.ncard (B k) := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-4030,"Let \(A = \{1, 2, \ldots, 2007\}\). Prove that any subset of \(A\) containing \(27\) elements must include three distinct numbers \(a, b, c\) such that \(\gcd(a, b) \mid c\).","import Mathlib def A : Finset ℕ := Finset.Icc 1 2007 theorem prove (s : Finset ℕ) (h₀ : s ⊆ A) (h₁ : s.card = 27) : ∃ a ∈ s, ∃ b ∈ s, ∃ c ∈ s, a ≠ b ∧ a ≠ c ∧ b ≠ c ∧ Nat.gcd a b ∣ c := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-4087,"Prove that for all positive integers \(n\), if \(p(n)\) denotes the number of non - negative integer tuples \((x, y, z, w)\) such that \(x + y + 2z + 3w = n - 1\) and \(q(n)\) denotes the number of non - negative integer tuples \((a, b, c, d)\) such that \(a + b + c + d = n\), \(a\geq b\), \(c\geq d\), \(a\geq d\), and \(b < c\), then \(p(n)=q(n)\).","import Mathlib theorem prove {n : ℕ} (hn : n > 0) : {(x, y, z, w) : ℕ × ℕ × ℕ × ℕ | x + y + 2 * z + 3 * w = n - 1}.ncard = {(a, b, c, d) : ℕ × ℕ × ℕ × ℕ | a + b + c + d = n ∧ a ≥ b ∧ c ≥ d ∧ a ≥ d ∧ b < c}.ncard := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-4298,Prove the following identity: \(\left(\sum_{k=0}^{n}\binom{n+k}{n}2^{-k}\right)^2=\sum_{k=0}^{n}\binom{2n-k}{n-k}2^{k}\).,"import Mathlib theorem q : ∀ n : ℕ, (∑ k in Finset.range (n + 1), Nat.choose (n + k) n * (2 : ℝ) ^ (-k : ℤ)) ^ 2 = ∑ k in Finset.range (n + 1), Nat.choose (2 * n - k) (n - k) * (2 : ℝ) ^ k := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-4308,"Prove that for a positive integer \(n\), the value of the integral \(\int_0^1 \sin^{2n}(\ln x) \, dx\) is given by \(\frac{\binom{2n}{n}}{4^n} + \frac{2}{4^n} \sum_{k=0}^{n-1} (-1)^{n-k} \frac{\binom{2n}{k}}{4(n-k)^2 + 1}\).","import Mathlib open Real Set open scoped BigOperators theorem integral (n : ℕ) (hn : n > 0) : ∫ x in (0)..1, sin (log x)^(2*n) = Nat.choose (2*n) n / 4^n + 2/(4^n) * ∑ k in Finset.range n, (-1 : ℝ)^(n-k) * Nat.choose (2*n) k / (4*(n-k)^2 + 1) := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-4418,Prove that the value of the infinite series \( \sum_{k=0}^{\infty}\frac{k(2k+1)^2\binom{2k}{k}}{6^k} \) is \( 117 \sqrt{3} \).,"import Mathlib open Real theorem infinite_series : ∑' k : ℕ, (k * (2 * k + 1) ^ 2 * Nat.choose (2 * k) k) / (6 ^ k : ℝ) = 117 * sqrt 3 := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-5128,"Let $S = \{1, 2, 3, \ldots, 2015\}$. A subset $A \subseteq S$ is called a **good subset** if for every element $x \in A$, the condition $\left(\sum_{y \in A, y \neq x} y\right) \equiv x \pmod{10}$ holds. (a) Prove that there exists a good subset with 400 elements. (b) Prove that there is no good subset with 405 elements.","import Mathlib def isGood (A : Finset ℕ) : Prop := ∀ x ∈ A, (∑ y in A \ {x}, y) ≡ x [ZMOD 10] theorem A : (∃ A : Finset ℕ, A ⊆ Finset.Icc 1 2015 ∧ isGood A ∧ A.card = 400) ∧ ¬∃ A : Finset ℕ, A ⊆ Finset.Icc 1 2015 ∧ isGood A ∧ A.card = 405 := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-5229,"Prove that the maximum possible number of elements in a subset $S$ of $\{1, 2, \ldots, 500\}$ such that no two distinct elements of $S$ have a product that is a perfect square is $306$.","import Mathlib theorem maxSet : IsGreatest { Finset.card S | (S : Finset ℕ) (_ : S ⊆ Finset.Icc 1 500 ∧ ∀ m ∈ S, ∀ n ∈ S, m ≠ n → ¬ ∃ k, k^2 = m * n) } 306 := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-5690,"Prove that for positive integers \(n\) and \(k\) with \(n \geq k + 1\), the following identity holds: \[ n^k = \sum_{l=1}^{k} (-1)^{k-l} \binom{n}{l} \binom{n-1-l}{k-l} l^k. \]","import Mathlib theorem Nat.choose_sum (n k : ℕ) (h₀ : 0 < n) (h₁ : 0 < k) (h₂ : n ≥ k + 1) : n ^ k = ∑ l in Finset.Icc 1 k, (-1 : ℤ) ^ (k - l) * Nat.choose n l * Nat.choose (n - 1 - l) (k - l) * l ^ k := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-6551,"a) Prove that for any positive integers \(a\), \(b\), and \(c\), there exists a positive integer \(N\) such that \(a_N = b_N = c_N\), where the sequences \(\{a_n\}\), \(\{b_n\}\), and \(\{c_n\}\) are defined as \(a_1 = a\), \(b_1 = b\), \(c_1 = c\) and for \(n \geq 1\), \(a_{n+1} = \lfloor \sqrt{a_n b_n} \rfloor\), \(b_{n+1} = \lfloor \sqrt{b_n c_n} \rfloor\), and \(c_{n+1} = \lfloor \sqrt{c_n a_n} \rfloor\). b) Prove that the smallest positive integer \(N\) such that \(a_N = b_N = c_N\) for some choice of positive integers \(a\), \(b\), and \(c\) with \(a \geq 2\) and \(b + c = 2a - 1\) is \(3\), where the sequences \(\{a_n\}\), \(\{b_n\}\), and \(\{c_n\}\) are defined as \(a_1 = a\), \(b_1 = b\), \(c_1 = c\) and for \(n \geq 1\), \(a_{n+1} = \lfloor \sqrt{a_n b_n} \rfloor\), \(b_{n+1} = \lfloor \sqrt{b_n c_n} \rfloor\), and \(c_{n+1} = \lfloor \sqrt{c_n a_n} \rfloor\).","import Mathlib open Real theorem a (a b c : ℕ) (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) (a_seq b_seq c_seq : ℕ → ℕ) (h_a1 : a_seq 1 = a) (h_b1 : b_seq 1 = b) (h_c1 : c_seq 1 = c) (h_an : ∀ n ≥ 1, a_seq (n + 1) = ⌊Real.sqrt (a_seq n * b_seq n)⌋) (h_bn : ∀ n ≥ 1, b_seq (n + 1) = ⌊Real.sqrt (b_seq n * c_seq n)⌋) (h_cn : ∀ n ≥ 1, c_seq (n + 1) = ⌊Real.sqrt (c_seq n * a_seq n)⌋) : ∃ N, 0 < N ∧ a_seq N = b_seq N ∧ b_seq N = c_seq N := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-6798,Prove the identity \(\sum\limits_{k=0}^{n}{\frac{{{\binom{n}{k}}^{2}}}{\binom{2n}{2k}}}=\frac{{{2}^{2n}}}{\binom{2n}{n}}\).,"import Mathlib open Finset Real Nat theorem prove (n : ℕ) : ∑ k ∈ range (n + 1), ((Nat.choose n k)^2 / Nat.choose (2 * n) (2 * k)) = (2^(2 * n))/(Nat.choose (2 * n) n) := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-7335,Prove that the remainder when $\sum_{n=0}^{200} \sum_{k=0}^{200} \sum_{a=0}^{n} \dbinom{a}{k}\dbinom{n - a}{k}$ is divided by $1000$ is $751$.,"import Mathlib theorem prove : (∑ n in Finset.Icc 0 200, ∑ k in Finset.Icc 0 200, ∑ a in Finset.Icc 0 n, Nat.choose a k * Nat.choose (n - a) k) % 1000 = 751 := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-7585,"Prove that if \(Q_n = \sum_{j=0}^{2^n} (-1)^j \binom{2^n - j}{j}\), then \(Q_{1000}=-1\).","import Mathlib def Q : ℕ → ℤ | n => ∑ j in Finset.Icc 0 (2 ^ n), (-1) ^ j * Nat.choose (2 ^ n - j) j theorem Q_1000 : Q 1000 = -1 := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-7614,Prove that the set \( \{ n\sqrt{2} \mid n \in \mathbb{N} \} \) is closed in \( \mathbb{R} \).,"import Mathlib theorem SetClosed : IsClosed {x | ∃ n : ℕ, x = n * Real.sqrt 2} := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-8017,"Let $S \subseteq \mathbb{R}^+$ be a finite set such that for all $a, b \in S$ with $a \neq b$, at least one of the following conditions holds: i) $a^b \in S$ ii) $b^a \in S$ Prove that $|S| \leq 4$.","import Mathlib theorem SetFinite (S : Finset ℝ) (hS : ∀ x ∈ S, 0 < x) (hS' : ∀ a ∈ S, ∀ b ∈ S, a ≠ b → (a ^ b ∈ S ∨ b ^ a ∈ S)) : S.card ≤ 4 := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-8247,Prove that every isometry \(f: X \to X\) of a compact metric space \(X\) into itself is surjective.,"import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem IsometrySurjective {X : Type*} [MetricSpace X] [CompactSpace X] (f : X → X) (h : Isometry f) : Function.Surjective f := sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-8559,"Let $n, p, q \in \mathbb{N}_+$. Prove that $$\binom{n}{p}\binom{n}{q} = \sum_{k=0}^n \binom{p}{k}\binom{q}{k}\binom{n+k}{p+q}.$$","import Mathlib theorem Nat.choose.sum (n p q : ℕ) (hn : 0 < n) (hp : 0 < p) (hq : 0 < q) : Nat.choose n p * Nat.choose n q = ∑ k in Finset.Icc 0 n, Nat.choose p k * Nat.choose q k * Nat.choose (n + k) (p + q) := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-8768,"Prove that for all positive integers \(n\) and \(m\), where \(m\) is odd, the expression \(\frac{1}{3^m n} \sum_{k=0}^{m} \binom{3m}{3k} (3n - 1)^k\) is an integer, or equivalently, prove that \(\sum_{k=0}^{m} \binom{3m}{3k} (3n - 1)^k\) is divisible by \(3^m n\) for all positive odd integers \(m\) and positive integers \(n\).","import Mathlib theorem sumIsDivisible (m n : ℕ) (hn : 0 < n) (hm : Odd m): 3 ^ m * n ∣ ∑ k in Finset.Icc 0 m, Nat.choose (3 * m) (3 * k) * (3 * n - 1) ^ k := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-8781,"Prove that if a set $S$ satisfies the condition that for every $a, b \in S$, the relation $a^2 + b^2 - ab \mid (ab)^2$ holds, then the set $S$ must be of the form $S = \{0, a\}$ where $a \neq 0$.","import Mathlib theorem prove {S : Finset ℝ} (hS : ∀ a ∈ S, ∀ b ∈ S, (a ^ 2 + b ^ 2 - a * b) ∣ (a * b) ^ 2) : ∃ a, a ≠ 0 ∧ S = {0, a} := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-8961,"Let \(S = \{1, 2, 3, \ldots, n\}\) be a set of the first \(n\) positive integers. A subset \(A\) of \(S\) is defined as **NORMAL** if and only if it is non - empty and the arithmetic mean of its elements is an integer. Prove that the number of **NORMAL** subsets of \(S\) and \(n\) have the same parity.","import Mathlib def S (n : ℕ) := Finset.Icc 1 n def isNormal (A : Finset ℕ) : Prop := A.Nonempty ∧ ∃ k : ℤ, (A.sum id) / A.card = k theorem number_of_normal_subset (n : ℕ) : Even {A | A ⊆ S n ∧ isNormal A}.ncard ↔ Even n := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-9104,"Prove that if \(f: [a, b] \rightarrow \mathbb{R}\) is a strictly increasing function, then the set of points of discontinuity of \(f\) within the interval \([a, b]\) is countable (either finite or countably infinite).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Set.Icc_a_b (f : ℝ → ℝ) (a b : ℝ) (hf : StrictMonoOn f (Set.Icc a b)) : Countable {x | x ∈ Set.Icc a b ∧ ¬ ContinuousAt f x} := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-9131,"Given \(4n\) pebbles with weights \(1, 2, 3, \dots, 4n\), where each pebble is colored in one of \(n\) colors and there are exactly four pebbles of each color, prove that there exists a way to divide these pebbles into two piles such that: 1. The total weight of each pile is \(n(4n + 1)\). 2. Each pile contains exactly two pebbles of each color.","import Mathlib theorem pebble_division (n : ℕ) (hn : 0 < n) (weights : Fin (4 * n) → ℕ) (h : ∀ i, weights i ∈ Finset.Icc 1 (4 * n)) (colors : Fin (4 * n) → Fin n) (h' : ∀ c, {i | colors i = c}.encard = 4) : ∃ s1 s2 : Finset (Fin (4 * n)), s1 ≠ s2 ∧ s1 ∪ s2 = Finset.univ ∧ ∑ i ∈ s1, weights i = n * (4 * n + 1) ∧ ∑ i ∈ s2, weights i = n * (4 * n + 1) ∧ ∀ c, {i | i ∈ s1 ∧ colors i = c}.encard = 2 ∧ ∀ c, {i | i ∈ s2 ∧ colors i = c}.encard = 2 := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-9195,"Prove that the number of connected graphs that can be formed with 6 distinct vertices, where isomorphic graphs are counted as distinct if their vertex labels differ, is \(26704\).","import Mathlib open Finset theorem card_graphs : {G : SimpleGraph (Fin 6) | G.Connected}.ncard = 26704 := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-9323,"a) Prove that if \(z_1, z_2, z_3\) are three complex numbers with the same absolute value and \(z_1 + z_2 + z_3 = 0\), then the points corresponding to \(z_1, z_2, z_3\) in the complex plane form the vertices of an equilateral triangle. b) Prove that for the roots of unity, when \(3\nmid n\), no subsets exist such that no three elements of the subset form the vertices of an equilateral triangle, and when \(3\mid n\), the subsets for which no three elements form the vertices of an equilateral triangle are \(\left\{0, \frac{n}{3}, \frac{2n}{3}\right\}\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem prove_a (z1 z2 z3 : ℂ) (h₀ : ‖z1‖ = ‖z2‖ ∧ ‖z2‖ = ‖z3‖) (h₁ : z1 + z2 + z3 = 0) : ∃ (A B C : ℂ), A = z1 ∧ B = z2 ∧ C = z3 ∧ (dist A B = dist B C ∧ dist B C = dist A C) := sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-9425,"Let $a_1 < a_2 < \ldots < a_k$ be a set of $k$ distinct positive integers such that all $2^k$ subsets of this set have distinct sums. Prove that the sum of the reciprocals of these integers is less than 2, i.e., $\frac{1}{a_1} + \frac{1}{a_2} + \ldots + \frac{1}{a_k} < 2$.","import Mathlib theorem Finset.sumReciprocal (k : ℕ) (a : Fin k → ℕ) (ha : StrictMono a) (hpos : ∀ i, 0 < a i) (hsum : ∀ s : Finset (Fin k), s.card > 0 → ∃! t : ℕ, ∑ i ∈ s, a i = t) : ∑ i, (1 : ℚ)/(a i) < 2 := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-9925,"Prove that there exists a function $f: \mathbf{N} \rightarrow \mathbf{N}$ with no fixed points such that there exists an $n \in \mathbf{N}$ for which $f^{(n)}(x) = x$ for all $x \in \mathbf{N}$. Here, $f^{(n)}$ denotes the $n$-fold iterate of $f$.","import Mathlib open Finset theorem exists_iterate_no_fixed_points : ∃ (f : ℕ → ℕ), (¬∃ n : ℕ, f n = n) ∧ (∃ n : ℕ, ∀ x : ℕ, f^[n] x = x) := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-10336,"Let $\{A_n\}_{n=1}^{\infty}$ be an infinite sequence of measurable sets in the interval $(0,1)$ such that the measure of each set $A_n$ satisfies $m(A_n) \geq \alpha > 0$. Prove that there exists a point $x \in (0,1)$ that belongs to infinitely many of the sets $A_n$.","import Mathlib theorem InfiniteMeasure (α : ℝ) (hα : α > 0) (A : ℕ → Set ℝ) (hA : ∀ n, A n ⊆ Set.Ioo 0 1 ∧ (MeasureTheory.volume (A n)).toReal ≥ α) : ∃ x, x ∈ Set.Ioo 0 1 ∧ {n | x ∈ A n}.Infinite := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-10602,"Let $(X,d)$ be a connected metric space. Prove that for any two points $a, b \in X$ and for any positive number $\delta > 0$, there exists a finite sequence of points $c_1, c_2, \ldots, c_n \in X$ such that $a = c_1$, $b = c_n$, and for every $k \in \{1, 2, \ldots, n-1\}$, the distance $d(c_k, c_{k+1}) \leq \delta$.","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem MetricConnectedSpace {X : Type*} [MetricSpace X] [ConnectedSpace X] (a b : X) (δ : ℝ) (hδ : δ > 0) : ∃ n : ℕ, ∃ c : ℕ → X, a = c 0 ∧ b = c (n - 1) ∧ ∀ k ∈ Icc 1 (n - 1), dist (c k) (c (k + 1)) ≤ δ := sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-10838,"Prove that for the set \(M_x=\{x,x + 1,x + 2,\ldots,x + 999\}\), where \(x\in\mathbb{N}\), there exists an \(x\in\{1,2,\ldots,1001!+2\}\) such that the number of prime numbers in \(M_x\) is exactly 5.","import Mathlib theorem prove : ∃ x : ℕ, x ∈ Finset.Icc 1 (Nat.factorial 1001 + 2) ∧ {p | p.Prime ∧ ∃ i ∈ Finset.range 1000, p = x + i}.encard = 5 := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-11068,"Prove that for an integer \(k > 1\), \(\lim_{n\to \infty} \sqrt[n]{\binom{nk}{n}} = \frac{k^k}{(k - 1)^{k - 1}}\).","import Mathlib open Topology Filter Real Complex TopologicalSpace Finset open scoped BigOperators theorem Tendsto (k : ℕ) (hk : 1 < k) : Tendsto (λ n => (Nat.choose (n * k) n : ℝ) ^ ((1 : ℝ) / n)) atTop (𝓝 (k ^ k / (k - 1) ^ (k - 1))) := sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-11651,"Let $f$ be a function from the set of non - negative integers into itself such that for all $n \geq 0$, the following conditions hold: 1. $\left(f(2n + 1)\right)^{2}-\left(f(2n)\right)^{2}=6f(n)+1$ 2. $f(2n)\geq f(n)$ Prove that the number of non - negative integers less than $2003$ that are in the image of $f$ is $128$.","import Mathlib theorem prove (f : ℕ → ℕ) (h₀ : ∀ n, (f (2 * n + 1)) ^ 2 - (f (2 * n)) ^ 2 = 6 * f n + 1) (h₁ : ∀ n, f (2 * n) ≥ f n) : Set.ncard {x | ∃ n, x = f n ∧ x < 2003} = 128 := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-12095,Prove that the number of ways to fill an \(n \times n\) matrix with entries of \(+1\) and \(-1\) such that the product of the entries in each row and each column equals \(-1\) is \(2^{(n - 1)^2}\).,"import Mathlib theorem Matrixfills (n : ℕ) : Set.ncard {A : Matrix (Fin n) (Fin n) ℤ | (∀ i j, A i j = 1 ∨ A i j = -1) ∧ (∀ i, ∏ j : Fin n, A i j = -1) ∧ (∀ j, ∏ i : Fin n, A i j = -1)} = 2 ^ ((n - 1) ^ 2) := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-12155,"Let \(n\) be a positive integer, and define \(A_n\) and \(B_n\) as the sets of nonnegative integers \(k < n\) such that the number of distinct prime factors of \(\gcd(n, k)\) is even and odd, respectively. Prove that \(|A_n| = |B_n|\) if \(n\) is even, and \(|A_n| > |B_n|\) if \(n\) is odd.","import Mathlib open Finset theorem number_theory_72816 (n : ℕ) (hn : 0 < n) : Even n → {k | k < n ∧ Even ((Nat.primeFactors (Nat.gcd n k)).card)}.ncard = {k | k < n ∧ Odd ((Nat.primeFactors (Nat.gcd n k)).card)}.ncard ∧ Odd n → {k | k < n ∧ Even ((Nat.primeFactors (Nat.gcd n k)).card)}.ncard > {k | k < n ∧ Odd ((Nat.primeFactors (Nat.gcd n k)).card)}.ncard := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-14524,"For every positive integer \(n \geq 3\), prove that there exist two sets \(A = \{ x_1, x_2, \ldots, x_n \}\) and \(B = \{ y_1, y_2, \ldots, y_n \}\) such that: 1. \(A \cap B = \varnothing\). 2. \(\sum_{i=1}^{n} x_i = \sum_{i=1}^{n} y_i\). 3. \(\sum_{i=1}^{n} x_i^2 = \sum_{i=1}^{n} y_i^2\).","import Mathlib theorem for_n_ge_3 (n : ℕ) (hn : 3 ≤ n) : ∃ A B : Finset ℝ, A.card = n ∧ B.card = n ∧ A ∩ B = ∅ ∧ ∑ i ∈ A, i = ∑ i ∈ B, i ∧ ∑ i ∈ A, i^2 = ∑ i ∈ B, i^2 := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs, flc-14761,"Prove that if \(n\) is a natural number such that \(n = 3k\), then \[ \sum_{j=0}^{k - 1} \binom{n}{3j + 1} 2^{3j + 1} = \frac{3^n + \omega^2 (1 + 2\omega)^n + \omega (1 + 2\omega^2)^n - 1}{3} \] where \(\omega = \exp(2\pi i / 3)\) is a primitive third - root of unity.","import Mathlib open Finset Real Complex Polynomial theorem prove {n k : ℕ} (hn : n = 3 * k) : ∑ j ∈ range k, Nat.choose n (3 * j + 1) * 2 ^ (3 * j + 1) = (3 ^ n + (exp (2 * π * I / 3)) ^ 2 * (1 + 2 * exp (2 * π * I / 3)) ^ n + (exp (2 * π * I / 3)) * (1 + 2 * (exp (2 * π * I / 3)) ^ 2) ^ n - 1) / 3 := by sorry ",Combinatorics,4. Difficulty 6,6.0,FineLeanCorpus/AoPs,