Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The sequence space Σ2\Sigma_2Σ2​ with Devaney's metric, and the shift map

Definition
Devaney_sigma2

by LG · Sep 14, 2026 · Mathlib 0df444a (Lean v4.33.1)

dynamical-systemsmetric-spacessymbolic-dynamics

The sequence space (Definition 6.1). Σ2\Sigma_2Σ2​ is the set of one-sided infinite sequences s=(s0s1s2… )s = (s_0 s_1 s_2 \dots)s=(s0​s1​s2​…) with every entry si∈{0,1}s_i \in \{0,1\}si​∈{0,1}.

The metric (Proposition 6.2). Σ2\Sigma_2Σ2​ is metrized by

d[s,t]=∑i=0∞∣si−ti∣2i.d[s,t] = \sum_{i=0}^{\infty} \frac{|s_i - t_i|}{2^{i}} .d[s,t]=i=0∑∞​2i∣si​−ti​∣​.

The series converges, being dominated by ∑i2−i=2\sum_i 2^{-i} = 2∑i​2−i=2, and the file establishes that ddd 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 σ:Σ2→Σ2\sigma : \Sigma_2 \to \Sigma_2σ:Σ2​→Σ2​ forgets the first entry, σ(s0s1s2… )=(s1s2s3… )\sigma(s_0 s_1 s_2 \dots) = (s_1 s_2 s_3 \dots)σ(s0​s1​s2​…)=(s1​s2​s3​…). It is a two-to-one map, and it is the model against which the quadratic family will be compared.

Definition code
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
Source
Robert L. Devaney, An Introduction to Chaotic Dynamical Systems, 2nd edition, Westview Press, 2003, ISBN 0-8133-4085-3, §1.6, pp. 40–41, Definition 6.1, Proposition 6.2, Definition 6.4
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 Σ2\Sigma_2Σ2​ together with a metric and a self-map.

The type. Σ2\Sigma_2Σ2​ is the type of functions s:N→{0,1}s : \mathbb{N} \to \{0,1\}s:N→{0,1}, i.e. one-sided infinite sequences indexed from 000 with entries in a two-element type. Auxiliary notation: entry(s,i)\mathrm{entry}(s,i)entry(s,i) is the real number corresponding to the iii-th entry, so entry(s,i)∈{0,1}⊆R\mathrm{entry}(s,i) \in \{0,1\} \subseteq \mathbb{R}entry(s,i)∈{0,1}⊆R; the file records that each entry is 000 or 111 and hence ∣entry(s,i)−entry(t,i)∣≤1|\mathrm{entry}(s,i) - \mathrm{entry}(t,i)| \le 1∣entry(s,i)−entry(t,i)∣≤1.

The distance. The iii-th term of the defining series is

distTerm(s,t,i)=∣entry(s,i)−entry(t,i)∣2i,\mathrm{distTerm}(s,t,i) = \frac{|\mathrm{entry}(s,i) - \mathrm{entry}(t,i)|}{2^{i}},distTerm(s,t,i)=2i∣entry(s,i)−entry(t,i)∣​,

which is nonnegative and bounded above by (1/2)i(1/2)^{i}(1/2)i, hence summable by comparison with a geometric series. The distance is the sum of the series,

d(s,t)=∑i=0∞∣entry(s,i)−entry(t,i)∣2i,d(s,t) = \sum_{i=0}^{\infty} \frac{|\mathrm{entry}(s,i) - \mathrm{entry}(t,i)|}{2^{i}},d(s,t)=i=0∑∞​2i∣entry(s,i)−entry(t,i)∣​,

and the file supplies a metric-space structure on Σ2\Sigma_2Σ2​ whose distance function is exactly this ddd: it proves d(s,s)=0d(s,s) = 0d(s,s)=0, d(s,t)=d(t,s)d(s,t) = d(t,s)d(s,t)=d(t,s), d(s,u)≤d(s,t)+d(t,u)d(s,u) \le d(s,t) + d(t,u)d(s,u)≤d(s,t)+d(t,u), and that d(s,t)=0d(s,t) = 0d(s,t)=0 forces s=ts = ts=t. Consequently the topology, uniformity and metric-space typeclass data on Σ2\Sigma_2Σ2​ are those induced by this series, not the product topology imported from elsewhere.

The shift. σ:Σ2→Σ2\sigma : \Sigma_2 \to \Sigma_2σ:Σ2​→Σ2​ is defined entrywise by σ(s)(n)=s(n+1)\sigma(s)(n) = s(n+1)σ(s)(n)=s(n+1); no continuity or surjectivity claim is made here.

Human review
  • Endorsed by Shuze Chen · Sep 14, 2026

  • Endorsed by LG · Sep 14, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me