The sequence space with Devaney's metric, and the shift map
DefinitionDevaney_sigma2The sequence space (Definition 6.1). is the set of one-sided infinite sequences with every entry .
The metric (Proposition 6.2). is metrized by
The series converges, being dominated by , and the file establishes that is a genuine metric, so Proposition 6.2 of the book is part of this definitional layer rather than a separate milestone. Two sequences are close in this metric exactly when they agree on a long initial block.
The shift (Definition 6.4). The shift map forgets the first entry, . It is a two-to-one map, and it is the model against which the quadratic family will be compared.
import Mathlib
namespace Devaney
/-- Devaney, Definition 6.1: the sequence space `Σ₂` of one-sided infinite sequences of
`0`'s and `1`'s. -/
def Sigma2 : Type := ℕ → Fin 2
namespace Sigma2
/-- The `i`-th entry of a sequence in `Σ₂`, as a real number. -/
def entry (s : Sigma2) (i : ℕ) : ℝ := ((s i : ℕ) : ℝ)
lemma entry_mem (s : Sigma2) (i : ℕ) : s.entry i = 0 ∨ s.entry i = 1 := by
have h := (s i).isLt
interval_cases h' : (s i : ℕ)
· exact Or.inl (by simp [entry, h'])
· exact Or.inr (by simp [entry, h'])
lemma abs_entry_sub_le_one (s t : Sigma2) (i : ℕ) : |s.entry i - t.entry i| ≤ 1 := by
rcases entry_mem s i with hs | hs <;> rcases entry_mem t i with ht | ht <;>
simp [hs, ht]
/-- Devaney, §1.6: the term `|sᵢ - tᵢ| / 2ⁱ` of the defining series of the metric on `Σ₂`. -/
noncomputable def distTerm (s t : Sigma2) (i : ℕ) : ℝ := |s.entry i - t.entry i| / 2 ^ i
lemma distTerm_nonneg (s t : Sigma2) (i : ℕ) : 0 ≤ distTerm s t i := by
unfold distTerm
positivity
lemma distTerm_le (s t : Sigma2) (i : ℕ) : distTerm s t i ≤ (1 / 2 : ℝ) ^ i := by
unfold distTerm
rw [div_pow, one_pow]
have hpow : (0 : ℝ) < 2 ^ i := by positivity
gcongr
exact abs_entry_sub_le_one s t i
lemma summable_distTerm (s t : Sigma2) : Summable (distTerm s t) := by
refine Summable.of_nonneg_of_le (distTerm_nonneg s t) (distTerm_le s t) ?_
exact summable_geometric_of_lt_one (by norm_num) (by norm_num)
/-- Devaney, §1.6: the distance `d[s,t] = ∑ᵢ |sᵢ - tᵢ| / 2ⁱ` on the sequence space. -/
noncomputable def dist' (s t : Sigma2) : ℝ := ∑' i, distTerm s t i
end Sigma2
open Sigma2 in
/-- `Σ₂` with Devaney's metric `d[s,t] = ∑ᵢ |sᵢ - tᵢ| / 2ⁱ` (Proposition 6.2). -/
noncomputable instance : MetricSpace Sigma2 where
dist := dist'
dist_self s := by
simp [dist', distTerm, entry]
dist_comm s t := by
simp only [dist', distTerm]
exact tsum_congr fun i => by rw [abs_sub_comm]
dist_triangle s t u := by
have hsum := (summable_distTerm s t).add (summable_distTerm t u)
calc dist' s u ≤ ∑' i, (distTerm s t i + distTerm t u i) := by
refine Summable.tsum_le_tsum ?_ (summable_distTerm s u) hsum
intro i
unfold distTerm
rw [← add_div]
have hpow : (0 : ℝ) < 2 ^ i := by positivity
gcongr
exact abs_sub_le _ _ _
_ = dist' s t + dist' t u := (summable_distTerm s t).tsum_add (summable_distTerm t u)
eq_of_dist_eq_zero := by
intro s t h
have hterm : ∀ i, distTerm s t i = 0 := by
intro i
have h1 : distTerm s t i ≤ ∑' j, distTerm s t j :=
(summable_distTerm s t).le_tsum i fun j _ => distTerm_nonneg s t j
have h2 : (0 : ℝ) ≤ distTerm s t i := distTerm_nonneg s t i
have : distTerm s t i ≤ 0 := by
rw [show (∑' j, distTerm s t j) = dist' s t from rfl, h] at h1
exact h1
linarith
funext i
have := hterm i
unfold distTerm at this
have h2 : |s.entry i - t.entry i| = 0 := by
have hpow : (2 : ℝ) ^ i ≠ 0 := by positivity
rcases div_eq_zero_iff.mp this with h | h
· exact h
· exact absurd h hpow
have h3 : s.entry i = t.entry i := by
have := abs_eq_zero.mp h2
linarith
have : ((s i : ℕ) : ℝ) = ((t i : ℕ) : ℝ) := h3
exact Fin.ext (Nat.cast_injective this)
/-- Devaney, Definition 6.4: the shift map `σ(s₀s₁s₂…) = (s₁s₂s₃…)` on `Σ₂`. -/
def shift : Sigma2 → Sigma2 := fun s n => s (n + 1)
end Devaney
Read-back
What the Lean code literally says, in plain math · self-authored by the drafting agent (non-blind, not an independent auditor)
Provenance note — this read-back is NOT blind. It was written by the same agent that drafted the Lean statements in this proposal, not by an independent auditor working from the code alone. It therefore is not independent testimony: any blind spot in the formalization is likely shared by this text, and agreement between the two should not be read as confirmation that the formalization is faithful.
The file defines a type together with a metric and a self-map.
The type. is the type of functions , i.e. one-sided infinite sequences indexed from with entries in a two-element type. Auxiliary notation: is the real number corresponding to the -th entry, so ; the file records that each entry is or and hence .
The distance. The -th term of the defining series is
which is nonnegative and bounded above by , hence summable by comparison with a geometric series. The distance is the sum of the series,
and the file supplies a metric-space structure on whose distance function is exactly this : it proves , , , and that forces . Consequently the topology, uniformity and metric-space typeclass data on are those induced by this series, not the product topology imported from elsewhere.
The shift. is defined entrywise by ; no continuity or surjectivity claim is made here.
Confirmed by the mission captain (proposal self-audit).