You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$(b_n)$ is a strictly increasing sequence of nonnegative integers and $b_1=0$, hence unbounded, so there exists $N>1$ such that $b_N \geq a_0$. Choose the smallest such $N$, which then gives $b_{N-1} < a_0$. So $N-1$ satisfies $b_{N-1} < a_0 \leq b_N$.
Assume there is another $N'$ satisfying $b_{N'} < a_0 \leq b_{N'+1}$:
Therefore, $N' = N-1$. There exists an unique $n$ such that $b_n<a_0\leq b_{n+1}$. Equivalently, there exists an unique $n$ such that $a_n < \frac{a_0+a_1+a_2+\cdots+a_n}{n} \leq a_{n+1} $. $\quad \square$
Implementation in Lean
We follow the folling steps based on the solution above:
Step 0: Definitions
First define the sequence $(a_n)$ as a function $\mathbb{N} \to \mathbb{N}$, mapping each index to a natural number, with two additional conditions: (1) stricly increasing (StrictMono), (2) All elements in the sequence are positive integers.
Next define the sequence $(b_n)$ as in the solution above, with an index shift by $1$ so that the sequence starts with index $0$, in particular,
Step 3: Show the existence and uniqueness of $n$ that satisfies $b_n<a_0\leq b_{n+1}$.
There exists $N$ such that $b_N ≥ a_0$.
Find the smallest such $N$.
Show that $n = N-1$ satisies $b_n<a_0\leq b_{n+1}$.
Show the uniqueness of $n$ by contradiction: if there exists $m$ satisfying the inequality and $m \neq n$, then $m < n$ or $m > n$, either of which leads to contradiction.
Step 4: State and conclude the problem
theorem imo_problem :
∃! n, (a n : ℝ) < (∑ k ∈ Finset.range (n+1), a k) / n ∧
(∑ k ∈ Finset.range (n+1), a k) / n ≤ (a (n+1) : ℝ)