Analysis I, Section 6.6: Subsequences

I have attempted to make the translation as faithful a paraphrasing as possible of the original text. When there is a choice between a more idiomatic Lean solution and a more faithful translation, I have generally chosen the latter. In particular, there will be places where the Lean code could be "golfed" to be more elegant and idiomatic, but I have consciously avoided doing so.

Main constructions and results of this section:

namespace Chapter6

Definition 6.6.1

abbrev Sequence.subseq (a b: ) : Prop := f : , StrictMono f n, b n = a (f n)
/- Example 6.6.2 -/ declaration uses 'sorry'example (a: ) : Sequence.subseq a (fun n a (2 * n)) := a: Sequence.subseq a fun n => a (2 * n) All goals completed! 🐙declaration uses 'sorry'example {f: } (hf: StrictMono f) : Function.Injective f := f: hf:StrictMono fFunction.Injective f All goals completed! 🐙declaration uses 'sorry'example : Sequence.subseq (fun n if Even n then 1 + (10:)^(-(n/2:)-1) else (1:)^(-(n/2:)-1)) (fun n 1 + (10:)^(-(n:)-1)) := Sequence.subseq (fun n => if Even n then 1 + 10 ^ (-(n / 2) - 1) else 1 ^ (-(n / 2) - 1)) fun n => 1 + 10 ^ (-n - 1) All goals completed! 🐙declaration uses 'sorry'example : Sequence.subseq (fun n if Even n then 1 + (10:)^(-(n/2:)-1) else (1:)^(-(n/2:)-1)) (fun n (10:)^(-(n:)-1)) := Sequence.subseq (fun n => if Even n then 1 + 10 ^ (-(n / 2) - 1) else 1 ^ (-(n / 2) - 1)) fun n => 10 ^ (-n - 1) All goals completed! 🐙

Lemma 6.6.4 / Exercise 6.6.1

theorem declaration uses 'sorry'Sequence.subseq_self (a: ) : Sequence.subseq a a := a: subseq a a All goals completed! 🐙

Lemma 6.6.4 / Exercise 6.6.1

theorem declaration uses 'sorry'Sequence.subseq_trans {a b c: } (hab: Sequence.subseq a b) (hbc: Sequence.subseq b c) : Sequence.subseq a c := a: b: c: hab:subseq a bhbc:subseq b csubseq a c All goals completed! 🐙

Proposition 6.6.5 / Exercise 6.6.4

theorem declaration uses 'sorry'Sequence.convergent_iff_subseq (a: ) (L:) : (a:Sequence).TendsTo L b: , Sequence.subseq a b (b:Sequence).TendsTo L := a: L:(↑a).TendsTo L (b : ), subseq a b (↑b).TendsTo L All goals completed! 🐙

Proposition 6.6.6 / Exercise 6.6.5

theorem declaration uses 'sorry'Sequence.limit_point_iff_subseq (a: ) (L:) : (a:Sequence).LimitPoint L b: , Sequence.subseq a b (b:Sequence).TendsTo L := a: L:(↑a).LimitPoint L b, subseq a b (↑b).TendsTo L All goals completed! 🐙

Theorem 6.6.8 (Bolzano-Weierstrass theorem)

theorem Sequence.convergent_of_subseq_of_bounded {a: } (ha: (a:Sequence).IsBounded) : b: , Sequence.subseq a b (b:Sequence).Convergent := a: ha:(↑a).IsBounded b, subseq a b (↑b).Convergent -- This proof is written to follow the structure of the original text. a: ha:(↑a).IsBoundedL_plus:hL_plus:(↑a).limsup = L_plusw✝:h✝:(↑a).liminf = w✝ b, subseq a b (↑b).Convergent a: ha:(↑a).IsBoundedL_plus:hL_plus:(↑a).limsup = L_plusw✝:h✝:(↑a).liminf = w✝this:?_mvar.2454 := Chapter6.Sequence.limit_point_of_limsup _fvar.2432 b, subseq a b (↑b).Convergent a: ha:(↑a).IsBoundedL_plus:hL_plus:(↑a).limsup = L_plusw✝:h✝:(↑a).liminf = w✝this: b, subseq a b (↑b).TendsTo L_plus b, subseq a b (↑b).Convergent; a: ha:(↑a).IsBoundedL_plus:hL_plus:(↑a).limsup = L_plusw✝:h✝:(↑a).liminf = w✝this✝: b, subseq a b (↑b).TendsTo L_plusb✝: p✝:subseq a b✝this:(↑b✝).TendsTo L_plus(↑b✝).Convergent; All goals completed! 🐙
/- Exercise 6.6.2 -/ def declaration uses 'sorry'Sequence.exist_subseq_of_subseq : Decidable ( a b : , a b Sequence.subseq a b Sequence.subseq b a) := Decidable (∃ a b, a b subseq a b subseq b a) -- The first line of this construction should be `apply isTrue` or `apply isFalse`. All goals completed! 🐙

Exercise 6.6.3. You may find the API around Mathlib's Nat.find {p : Prop} [DecidablePred p] (H : n, p n) : Nat.find to be useful (and to avoid any decidability issues)

theorem declaration uses 'sorry'Sequence.subseq_of_unbounded {a: } (ha: ¬ (a:Sequence).IsBounded) : b: , Sequence.subseq a b (b:Sequence)⁻¹.TendsTo 0 := a: ha:¬(↑a).IsBounded b, subseq a b (↑b)⁻¹.TendsTo 0 All goals completed! 🐙
end Chapter6