Skip to content

Commit 9d3764f

Browse files
committed
Refactor Remark 1.3.10: move helper lemmas and simplify structure
- Move geometric series and floor helper lemmas (tsum_two_thirds_geometric, tsum_tail_bound, floor_two_mul_odd_ge, floor_two_mul_even_le, floor_two_mul_eq_of_mod_eq) before Remark_1_3_10 namespace - Remove BinaryToTernaryProperties structure and binaryToTernaryFn definition (unused) - Simplify DyadicRationals comment - Clean up proof structure and organization
1 parent cb2dc1d commit 9d3764f

File tree

1 file changed

+123
-124
lines changed

1 file changed

+123
-124
lines changed

analysis/Analysis/MeasureTheory/Section_1_3_2.lean

Lines changed: 123 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,9 +1781,8 @@ Both versions work for the theorem because:
17811781
- Both map [0,1] into CantorSet ∪ {0}
17821782
- Both give measurable f with f⁻¹(E) = F non-measurable
17831783
-/
1784-
namespace Remark_1_3_10
17851784

1786-
/-- Dyadic rationals in [0,1]: numbers of the form k/2^n where k ≤ 2^n.
1785+
/-- Dyadic rationals: numbers of the form k/2^n where k ≤ 2^n.
17871786
These are exactly the real numbers with terminating binary expansions. -/
17881787
def DyadicRationals : Set ℝ := {x : ℝ | ∃ (k n : ℕ), x = k / 2^n ∧ k ≤ 2^n}
17891788

@@ -1799,41 +1798,15 @@ lemma DyadicRationals.countable : DyadicRationals.Countable := by
17991798
have hk_lt : k < 2^n + 1 := Nat.lt_succ_of_le hk_le
18001799
exact ⟨⟨k, hk_lt⟩, hk.symm⟩
18011800

1802-
/-- The properties required of the binary-to-ternary function for this construction.
1803-
The function maps [0,1] into the Cantor set C by converting binary digits to ternary.
1804-
1805-
Note: Unlike the textbook (which sets g(x) = 0 for dyadic rationals), our g is defined
1806-
uniformly for all x ∈ [0,1]. This makes g monotone on ALL of [0,1], not just on A. -/
1807-
structure BinaryToTernaryProperties (g : ℝ → ℝ) : Prop where
1808-
nonneg : ∀ x, 0 ≤ g x
1809-
bounded : ∀ x, g x ≤ 1
1810-
zero_outside : ∀ x, x ∉ Set.Icc 0 1 → g x = 0 -- g(x) = 0 outside [0,1]
1811-
zero_at_zero : g 0 = 0 -- g(0) = 0 (binary 0.000... maps to ternary 0.000...)
1812-
zero_set_countable : (Set.Icc 0 1 ∩ {x | g x = 0}).Countable -- {g = 0} ∩ [0,1] = {0}
1813-
monotone_on : MonotoneOn g (Set.Icc 0 1) -- g is monotone on ALL of [0,1]
1814-
image_in_cantor : g '' (Set.Icc 0 1) ⊆ CantorSet ∪ {0}
1815-
injective_on_nonterminating : ∃ A : Set ℝ, A ⊆ Set.Icc 0 1
1816-
(Set.Icc 0 1 \ A).Countable ∧ -- A is co-countable in [0,1]
1817-
Set.InjOn g A ∧ -- g is injective on A (hence bijective onto g(A) ⊆ C)
1818-
A ∩ DyadicRationals = ∅ -- A excludes dyadic rationals
1819-
1820-
/-! ### Binary digit extraction and helper lemmas -/
1821-
18221801
/-- Binary digit extraction: bⱼ(x) = ⌊2^j · x⌋ mod 2.
1823-
For x ∈ [0,1), this extracts the j-th binary digit (1-indexed).
1802+
For x ∈ [0,1), this extracts the j-th binary digit.
18241803
Special case: x = 1 has all digits = 1 (1 = 0.111...₂).
18251804
For x ∉ [0,1], all digits are 0. -/
18261805
noncomputable def binaryDigit (x : ℝ) (j : ℕ) : ℕ :=
18271806
if x ∈ Set.Ico (0:ℝ) 1 then ⌊(2:ℝ)^j * x⌋₊ % 2
18281807
else if x = 1 then 1
18291808
else 0
18301809

1831-
/-- The binary-to-ternary function: g(x) = ∑_{j≥1} 2·bⱼ(x)·3^{-j} for x ∈ [0,1], else 0. -/
1832-
noncomputable def binaryToTernaryFn (x : ℝ) : ℝ :=
1833-
if x ∈ Set.Icc (0:ℝ) 1 then
1834-
∑' j : ℕ, (2 * binaryDigit x (j + 1) : ℝ) * (1/3:ℝ)^(j + 1)
1835-
else 0
1836-
18371810
/-- Binary digits are in {0, 1}. -/
18381811
lemma binaryDigit_le_one (x : ℝ) (j : ℕ) : binaryDigit x j ≤ 1 := by
18391812
simp only [binaryDigit]
@@ -1850,6 +1823,127 @@ lemma binaryDigit_zero (j : ℕ) : binaryDigit 0 j = 0 := by
18501823
lemma binaryDigit_one (j : ℕ) : binaryDigit 1 j = 1 := by
18511824
simp only [binaryDigit, Set.mem_Ico, lt_self_iff_false, and_false, ↓reduceIte]
18521825

1826+
/-- The full sum ∑_{j≥0} 2·(1/3)^{j+1} = 1. -/
1827+
lemma tsum_two_thirds_geometric : ∑' j : ℕ, (2:ℝ) * (1/3:ℝ)^(j + 1) = 1 := by
1828+
have h1 : ∑' j : ℕ, (1/3:ℝ)^j = (1 - 1/3)⁻¹ :=
1829+
tsum_geometric_of_lt_one (by norm_num) (by norm_num)
1830+
calc ∑' j : ℕ, (2:ℝ) * (1/3:ℝ)^(j + 1)
1831+
= ∑' j : ℕ, (2/3:ℝ) * (1/3:ℝ)^j := by congr 1; ext j; ring
1832+
_ = (2/3) * ∑' j : ℕ, (1/3:ℝ)^j := by rw [tsum_mul_left]
1833+
_ = (2/3) * (1 - 1/3)⁻¹ := by rw [h1]
1834+
_ = 1 := by norm_num
1835+
1836+
/-- The tail sum bound: ∑_{j≥k} 2·(1/3)^{j+1} = (1/3)^k. -/
1837+
lemma tsum_tail_bound (k : ℕ) :
1838+
∑' j : ℕ, (2:ℝ) * (1/3:ℝ)^(k + j + 1) = (1/3:ℝ)^k := by
1839+
have h1 : ∑' j : ℕ, (1/3:ℝ)^j = (1 - 1/3)⁻¹ :=
1840+
tsum_geometric_of_lt_one (by norm_num) (by norm_num)
1841+
calc ∑' j : ℕ, (2:ℝ) * (1/3:ℝ)^(k + j + 1)
1842+
= ∑' j : ℕ, (2:ℝ) * ((1/3:ℝ)^(k+1) * (1/3:ℝ)^j) := by
1843+
congr 1; ext j; rw [← pow_add]; ring_nf
1844+
_ = (2:ℝ) * (1/3:ℝ)^(k+1) * ∑' j : ℕ, (1/3:ℝ)^j := by
1845+
rw [← tsum_mul_left]; congr 1; ext j; ring
1846+
_ = (2:ℝ) * (1/3:ℝ)^(k+1) * (1 - 1/3)⁻¹ := by rw [h1]
1847+
_ = (1/3:ℝ)^k := by field_simp; ring
1848+
1849+
/-- Helper: if ⌊2z⌋₊ % 2 = 1 then ⌊2z⌋₊ ≥ 2⌊z⌋₊ + 1 -/
1850+
lemma floor_two_mul_odd_ge {z : ℝ} (hz : 0 ≤ z) (hodd : ⌊2 * z⌋₊ % 2 = 1) :
1851+
2 * z⌋₊ ≥ 2 * ⌊z⌋₊ + 1 := by
1852+
have h_decomp : ⌊2 * z⌋₊ = 2 * (⌊2 * z⌋₊ / 2) + ⌊2 * z⌋₊ % 2 := (Nat.div_add_mod _ _).symm
1853+
rw [hodd] at h_decomp
1854+
have h_div : ⌊2 * z⌋₊ / 2 ≥ ⌊z⌋₊ := by
1855+
have h1 : (2 * ⌊z⌋₊ : ℕ) ≤ ⌊2 * z⌋₊ := by
1856+
have hfloor := Nat.floor_le hz
1857+
apply Nat.le_floor
1858+
simp only [Nat.cast_mul, Nat.cast_ofNat]
1859+
linarith
1860+
rw [mul_comm] at h1
1861+
exact (Nat.le_div_iff_mul_le (by norm_num : 0 < 2)).mpr h1
1862+
omega
1863+
1864+
/-- Helper: if ⌊2z⌋₊ % 2 = 0 then ⌊2z⌋₊ ≤ 2⌊z⌋₊ -/
1865+
lemma floor_two_mul_even_le {z : ℝ} (hz : 0 ≤ z) (heven : ⌊2 * z⌋₊ % 2 = 0) :
1866+
2 * z⌋₊ ≤ 2 * ⌊z⌋₊ := by
1867+
have h_decomp : ⌊2 * z⌋₊ = 2 * (⌊2 * z⌋₊ / 2) + ⌊2 * z⌋₊ % 2 := (Nat.div_add_mod _ _).symm
1868+
rw [heven, add_zero] at h_decomp
1869+
have h_div : ⌊2 * z⌋₊ / 2 ≤ ⌊z⌋₊ := by
1870+
have h1 : ⌊2 * z⌋₊ < 2 * (⌊z⌋₊ + 1) := by
1871+
have := Nat.lt_floor_add_one z
1872+
have h2 : 2 * z < 2 * (⌊z⌋₊ + 1) := by linarith
1873+
have h3 : (⌊2 * z⌋₊ : ℝ) ≤ 2 * z := Nat.floor_le (mul_nonneg (by norm_num) hz)
1874+
have h4 : (⌊2 * z⌋₊ : ℝ) < 2 * (↑⌊z⌋₊ + 1) := lt_of_le_of_lt h3 h2
1875+
have h5 : (⌊2 * z⌋₊ : ℝ) < 2 * ⌊z⌋₊ + 2 := by linarith
1876+
exact_mod_cast h5
1877+
omega
1878+
omega
1879+
1880+
/-- Helper: equal mod 2 and equal ⌊z⌋ implies equal ⌊2z⌋ -/
1881+
lemma floor_two_mul_eq_of_mod_eq {x y : ℝ} (hx : 0 ≤ x) (hy : 0 ≤ y)
1882+
(h_floor : ⌊x⌋₊ = ⌊y⌋₊) (h_mod : ⌊2 * x⌋₊ % 2 = ⌊2 * y⌋₊ % 2) :
1883+
2 * x⌋₊ = ⌊2 * y⌋₊ := by
1884+
by_cases hxodd : ⌊2 * x⌋₊ % 2 = 1
1885+
· have hyodd := h_mod ▸ hxodd
1886+
have hx_ge := floor_two_mul_odd_ge hx hxodd
1887+
have hy_ge := floor_two_mul_odd_ge hy hyodd
1888+
have hx_lt : ⌊2 * x⌋₊ < 2 * ⌊x⌋₊ + 2 := by
1889+
have := Nat.lt_floor_add_one x
1890+
have h2 : 2 * x < 2 * (⌊x⌋₊ + 1) := by linarith
1891+
have h3 : (⌊2 * x⌋₊ : ℝ) ≤ 2 * x := Nat.floor_le (mul_nonneg (by norm_num) hx)
1892+
have h4 : (⌊2 * x⌋₊ : ℝ) < 2 * ⌊x⌋₊ + 2 := by linarith
1893+
exact_mod_cast h4
1894+
have hy_lt : ⌊2 * y⌋₊ < 2 * ⌊y⌋₊ + 2 := by
1895+
have := Nat.lt_floor_add_one y
1896+
have h2 : 2 * y < 2 * (⌊y⌋₊ + 1) := by linarith
1897+
have h3 : (⌊2 * y⌋₊ : ℝ) ≤ 2 * y := Nat.floor_le (mul_nonneg (by norm_num) hy)
1898+
have h4 : (⌊2 * y⌋₊ : ℝ) < 2 * ⌊y⌋₊ + 2 := by linarith
1899+
exact_mod_cast h4
1900+
omega
1901+
· have hxeven : ⌊2 * x⌋₊ % 2 = 0 := Nat.mod_two_eq_zero_or_one (⌊2 * x⌋₊) |>.resolve_right hxodd
1902+
have hyeven := h_mod ▸ hxeven
1903+
have hx_le := floor_two_mul_even_le hx hxeven
1904+
have hy_le := floor_two_mul_even_le hy hyeven
1905+
have hx_ge : ⌊2 * x⌋₊ ≥ 2 * ⌊x⌋₊ := by
1906+
have h1 : (2 * ⌊x⌋₊ : ℕ) ≤ ⌊2 * x⌋₊ := by
1907+
have hfloor := Nat.floor_le hx
1908+
apply Nat.le_floor
1909+
simp only [Nat.cast_mul, Nat.cast_ofNat]
1910+
linarith
1911+
exact h1
1912+
have hy_ge : ⌊2 * y⌋₊ ≥ 2 * ⌊y⌋₊ := by
1913+
have h1 : (2 * ⌊y⌋₊ : ℕ) ≤ ⌊2 * y⌋₊ := by
1914+
have hfloor := Nat.floor_le hy
1915+
apply Nat.le_floor
1916+
simp only [Nat.cast_mul, Nat.cast_ofNat]
1917+
linarith
1918+
exact h1
1919+
omega
1920+
1921+
namespace Remark_1_3_10
1922+
1923+
/-- The properties required of the binary-to-ternary function for this construction.
1924+
The function maps [0,1] into the Cantor set C by converting binary digits to ternary.
1925+
1926+
Note: Unlike the textbook (which sets g(x) = 0 for dyadic rationals), our g is defined
1927+
uniformly for all x ∈ [0,1]. This makes g monotone on ALL of [0,1], not just on A. -/
1928+
structure BinaryToTernaryProperties (g : ℝ → ℝ) : Prop where
1929+
nonneg : ∀ x, 0 ≤ g x
1930+
bounded : ∀ x, g x ≤ 1
1931+
zero_outside : ∀ x, x ∉ Set.Icc 0 1 → g x = 0 -- g(x) = 0 outside [0,1]
1932+
zero_at_zero : g 0 = 0 -- g(0) = 0 (binary 0.000... maps to ternary 0.000...)
1933+
zero_set_countable : (Set.Icc 0 1 ∩ {x | g x = 0}).Countable -- {g = 0} ∩ [0,1] = {0}
1934+
monotone_on : MonotoneOn g (Set.Icc 0 1) -- g is monotone on ALL of [0,1]
1935+
image_in_cantor : g '' (Set.Icc 0 1) ⊆ CantorSet ∪ {0}
1936+
injective_on_nonterminating : ∃ A : Set ℝ, A ⊆ Set.Icc 0 1
1937+
(Set.Icc 0 1 \ A).Countable ∧ -- A is co-countable in [0,1]
1938+
Set.InjOn g A ∧ -- g is injective on A (hence bijective onto g(A) ⊆ C)
1939+
A ∩ DyadicRationals = ∅ -- A excludes dyadic rationals
1940+
1941+
/-- The binary-to-ternary function: g(x) = ∑_{j≥1} 2·bⱼ(x)·3^{-j} for x ∈ [0,1], else 0. -/
1942+
noncomputable def binaryToTernaryFn (x : ℝ) : ℝ :=
1943+
if x ∈ Set.Icc (0:ℝ) 1 then
1944+
∑' j : ℕ, (2 * binaryDigit x (j + 1) : ℝ) * (1/3:ℝ)^(j + 1)
1945+
else 0
1946+
18531947
/-- The series ∑ 2·bⱼ(x)·3^{-j} is summable for any x. -/
18541948
lemma binaryToTernary_summable (x : ℝ) :
18551949
Summable (fun j => (2 * binaryDigit x (j + 1) : ℝ) * (1/3:ℝ)^(j + 1)) := by
@@ -1866,16 +1960,6 @@ lemma binaryToTernary_summable (x : ℝ) :
18661960
· have h : Summable (fun j : ℕ => (1/3:ℝ)^j) := summable_geometric_of_lt_one (by norm_num) (by norm_num)
18671961
exact (h.mul_left 2).comp_injective (fun _ _ h => Nat.succ_injective h)
18681962

1869-
/-- The full sum ∑_{j≥0} 2·(1/3)^{j+1} = 1. -/
1870-
lemma tsum_two_thirds_geometric : ∑' j : ℕ, (2:ℝ) * (1/3:ℝ)^(j + 1) = 1 := by
1871-
have h1 : ∑' j : ℕ, (1/3:ℝ)^j = (1 - 1/3)⁻¹ :=
1872-
tsum_geometric_of_lt_one (by norm_num) (by norm_num)
1873-
calc ∑' j : ℕ, (2:ℝ) * (1/3:ℝ)^(j + 1)
1874-
= ∑' j : ℕ, (2/3:ℝ) * (1/3:ℝ)^j := by congr 1; ext j; ring
1875-
_ = (2/3) * ∑' j : ℕ, (1/3:ℝ)^j := by rw [tsum_mul_left]
1876-
_ = (2/3) * (1 - 1/3)⁻¹ := by rw [h1]
1877-
_ = 1 := by norm_num
1878-
18791963
/-! ### Helper lemmas for monotonicity proof -/
18801964

18811965
/-- For x ∈ (0, 1), there exists a position where the binary digit is 1. -/
@@ -1931,78 +2015,6 @@ lemma binaryDigit_partial_sum_lt (x : ℝ) (n : ℕ) :
19312015
apply div_lt_div_of_pos_right h1 h2n_pos
19322016
_ = (⌊(2:ℝ)^n * x⌋₊ : ℝ) / (2:ℝ)^n + (1:ℝ) / (2:ℝ)^n := by ring
19332017

1934-
/-- Helper: if ⌊2z⌋₊ % 2 = 1 then ⌊2z⌋₊ ≥ 2⌊z⌋₊ + 1 -/
1935-
lemma floor_two_mul_odd_ge {z : ℝ} (hz : 0 ≤ z) (hodd : ⌊2 * z⌋₊ % 2 = 1) :
1936-
2 * z⌋₊ ≥ 2 * ⌊z⌋₊ + 1 := by
1937-
have h_decomp : ⌊2 * z⌋₊ = 2 * (⌊2 * z⌋₊ / 2) + ⌊2 * z⌋₊ % 2 := (Nat.div_add_mod _ _).symm
1938-
rw [hodd] at h_decomp
1939-
have h_div : ⌊2 * z⌋₊ / 2 ≥ ⌊z⌋₊ := by
1940-
have h1 : (2 * ⌊z⌋₊ : ℕ) ≤ ⌊2 * z⌋₊ := by
1941-
have hfloor := Nat.floor_le hz
1942-
apply Nat.le_floor
1943-
simp only [Nat.cast_mul, Nat.cast_ofNat]
1944-
linarith
1945-
rw [mul_comm] at h1
1946-
exact (Nat.le_div_iff_mul_le (by norm_num : 0 < 2)).mpr h1
1947-
omega
1948-
1949-
/-- Helper: if ⌊2z⌋₊ % 2 = 0 then ⌊2z⌋₊ ≤ 2⌊z⌋₊ -/
1950-
lemma floor_two_mul_even_le {z : ℝ} (hz : 0 ≤ z) (heven : ⌊2 * z⌋₊ % 2 = 0) :
1951-
2 * z⌋₊ ≤ 2 * ⌊z⌋₊ := by
1952-
have h_decomp : ⌊2 * z⌋₊ = 2 * (⌊2 * z⌋₊ / 2) + ⌊2 * z⌋₊ % 2 := (Nat.div_add_mod _ _).symm
1953-
rw [heven, add_zero] at h_decomp
1954-
have h_div : ⌊2 * z⌋₊ / 2 ≤ ⌊z⌋₊ := by
1955-
have h1 : ⌊2 * z⌋₊ < 2 * (⌊z⌋₊ + 1) := by
1956-
have := Nat.lt_floor_add_one z
1957-
have h2 : 2 * z < 2 * (⌊z⌋₊ + 1) := by linarith
1958-
have h3 : (⌊2 * z⌋₊ : ℝ) ≤ 2 * z := Nat.floor_le (mul_nonneg (by norm_num) hz)
1959-
have h4 : (⌊2 * z⌋₊ : ℝ) < 2 * (↑⌊z⌋₊ + 1) := lt_of_le_of_lt h3 h2
1960-
have h5 : (⌊2 * z⌋₊ : ℝ) < 2 * ⌊z⌋₊ + 2 := by linarith
1961-
exact_mod_cast h5
1962-
omega
1963-
omega
1964-
1965-
/-- Helper: equal mod 2 and equal ⌊z⌋ implies equal ⌊2z⌋ -/
1966-
lemma floor_two_mul_eq_of_mod_eq {x y : ℝ} (hx : 0 ≤ x) (hy : 0 ≤ y)
1967-
(h_floor : ⌊x⌋₊ = ⌊y⌋₊) (h_mod : ⌊2 * x⌋₊ % 2 = ⌊2 * y⌋₊ % 2) :
1968-
2 * x⌋₊ = ⌊2 * y⌋₊ := by
1969-
by_cases hxodd : ⌊2 * x⌋₊ % 2 = 1
1970-
·
1971-
have hyodd := h_mod ▸ hxodd
1972-
have hx_ge := floor_two_mul_odd_ge hx hxodd
1973-
have hy_ge := floor_two_mul_odd_ge hy hyodd
1974-
have hx_lt : ⌊2 * x⌋₊ < 2 * ⌊x⌋₊ + 2 := by
1975-
have := Nat.lt_floor_add_one x
1976-
have h2 : 2 * x < 2 * (⌊x⌋₊ + 1) := by linarith
1977-
have h3 : (⌊2 * x⌋₊ : ℝ) ≤ 2 * x := Nat.floor_le (mul_nonneg (by norm_num) hx)
1978-
have h4 : (⌊2 * x⌋₊ : ℝ) < 2 * ⌊x⌋₊ + 2 := by linarith
1979-
exact_mod_cast h4
1980-
have hy_lt : ⌊2 * y⌋₊ < 2 * ⌊y⌋₊ + 2 := by
1981-
have := Nat.lt_floor_add_one y
1982-
have h2 : 2 * y < 2 * (⌊y⌋₊ + 1) := by linarith
1983-
have h3 : (⌊2 * y⌋₊ : ℝ) ≤ 2 * y := Nat.floor_le (mul_nonneg (by norm_num) hy)
1984-
have h4 : (⌊2 * y⌋₊ : ℝ) < 2 * ⌊y⌋₊ + 2 := by linarith
1985-
exact_mod_cast h4
1986-
rw [h_floor] at hx_ge hx_lt
1987-
omega
1988-
·
1989-
have hxeven : ⌊2 * x⌋₊ % 2 = 0 := by omega
1990-
have hyeven := h_mod ▸ hxeven
1991-
have hx_le := floor_two_mul_even_le hx hxeven
1992-
have hy_le := floor_two_mul_even_le hy hyeven
1993-
have hx_ge : 2 * ⌊x⌋₊ ≤ ⌊2 * x⌋₊ := by
1994-
have hfl := Nat.floor_le hx
1995-
apply Nat.le_floor
1996-
simp only [Nat.cast_mul, Nat.cast_ofNat]
1997-
linarith
1998-
have hy_ge : 2 * ⌊y⌋₊ ≤ ⌊2 * y⌋₊ := by
1999-
have hfl := Nat.floor_le hy
2000-
apply Nat.le_floor
2001-
simp only [Nat.cast_mul, Nat.cast_ofNat]
2002-
linarith
2003-
rw [h_floor] at hx_le hx_ge
2004-
omega
2005-
20062018
/-- Key lemma: if bₖ(x) = 1, then x ≥ ⌊2^k * x⌋₊ / 2^k + 2^{-(k+1)} -/
20072019
lemma binaryDigit_one_implies_lower_bound {x : ℝ} (hx : x ∈ Set.Ico (0:ℝ) 1) (k : ℕ)
20082020
(hbk : binaryDigit x (k + 1) = 1) :
@@ -2117,19 +2129,6 @@ lemma binaryDigit_first_diff {x y : ℝ} (hx : x ∈ Set.Ico (0:ℝ) 1) (hy : y
21172129
rw [h_floor_eq] at hx_lb
21182130
linarith
21192131

2120-
/-- The tail sum bound: ∑_{j≥k} 2·(1/3)^{j+1} = (1/3)^k. -/
2121-
lemma tsum_tail_bound (k : ℕ) :
2122-
∑' j : ℕ, (2:ℝ) * (1/3:ℝ)^(k + j + 1) = (1/3:ℝ)^k := by
2123-
have h1 : ∑' j : ℕ, (1/3:ℝ)^j = (1 - 1/3)⁻¹ :=
2124-
tsum_geometric_of_lt_one (by norm_num) (by norm_num)
2125-
calc ∑' j : ℕ, (2:ℝ) * (1/3:ℝ)^(k + j + 1)
2126-
= ∑' j : ℕ, (2:ℝ) * ((1/3:ℝ)^(k+1) * (1/3:ℝ)^j) := by
2127-
congr 1; ext j; rw [← pow_add]; ring_nf
2128-
_ = (2:ℝ) * (1/3:ℝ)^(k+1) * ∑' j : ℕ, (1/3:ℝ)^j := by
2129-
rw [← tsum_mul_left]; congr 1; ext j; ring
2130-
_ = (2:ℝ) * (1/3:ℝ)^(k+1) * (1 - 1/3)⁻¹ := by rw [h1]
2131-
_ = (1/3:ℝ)^k := by field_simp; ring
2132-
21332132
/-- Monotonicity: if digits agree up to k and bₖ(x) < bₖ(y), then g(x) < g(y). -/
21342133
lemma binaryToTernary_lt_of_digit_lt {x y : ℝ}
21352134
(hx : x ∈ Set.Icc (0:ℝ) 1) (hy : y ∈ Set.Icc (0:ℝ) 1) (k : ℕ)

0 commit comments

Comments
 (0)