Exact Lean source
Nonadditivity.OperationalBlockRates
Download original .lean · View on GitHub · Jump to source
Direct imports
Nonadditivity.OperationalCapacityMathlib.Analysis.SpecificLimits.Basicdependency
Imported by project modules
2 direct reverse imports
Relationships above come from literal import commands. The declarations below link to types and references extracted from Lean’s environment. Source text is complete and unchanged.
Declarations in this module
20 project constants, including generated, internal and private declarations.
20 declarations
Nonadditivity.Operational.BlockRates.blockCountNonadditivity.Operational.BlockRates.blockCount_posNonadditivity.Operational.BlockRates.blockCount_pos._proof_1_1internal/detail/privateNonadditivity.Operational.BlockRates.blockCount_pos._proof_1_2internal/detail/privateNonadditivity.Operational.BlockRates.blockCount_ratio_tendstoNonadditivity.Operational.BlockRates.blockCount_ratio_tendsto._simp_1_1internal/detail/privateNonadditivity.Operational.BlockRates.blockCount_ratio_tendsto._simp_1_2internal/detail/privateNonadditivity.Operational.BlockRates.blockCount_ratio_tendsto._simp_1_3internal/detail/privateNonadditivity.Operational.BlockRates.blockCount_ratio_tendsto._simp_1_4internal/detail/privateNonadditivity.Operational.BlockRates.blockCount_ratio_tendsto._simp_1_5internal/detail/privateNonadditivity.Operational.BlockRates.blockCount_ratio_tendsto._simp_1_6internal/detail/privateNonadditivity.Operational.BlockRates.blockCount_ratio_tendsto._simp_1_7internal/detail/privateNonadditivity.Operational.BlockRates.blockCount_tendstoNonadditivity.Operational.BlockRates.blockIndexNonadditivity.Operational.BlockRates.blockIndex_add_oneNonadditivity.Operational.BlockRates.blockIndex_ratio_tendstoNonadditivity.Operational.BlockRates.blockIndex_tendstoNonadditivity.Operational.BlockRates.coveredFraction_tendsto_oneNonadditivity.Operational.BlockRates.error_subsequenceNonadditivity.Operational.BlockRates.rescaled_rate
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.OperationalCapacity7import Mathlib.Analysis.SpecificLimits.Basic89/-! # Full-length rate preservation when padding fixed-size channel blocks -/1011noncomputable section12namespace Nonadditivity.Operational.BlockRates13open Filter Topology1415/-- Number of complete blocks of `k+1` uses within a length-`n+1` code. -/16def blockCount (k n : ℕ) : ℕ := (n+1)/(k+1)1718/-- Positive-power index of the complete blocks; only its eventual values matter. -/19def blockIndex (k n : ℕ) : ℕ := blockCount k n - 12021theorem blockCount_tendsto (k : ℕ) : Tendsto (blockCount k) atTop atTop :=22(Nat.tendsto_div_const_atTop (Nat.succ_ne_zero k)).comp (tendsto_add_atTop_nat 1)2324theorem blockIndex_tendsto (k : ℕ) : Tendsto (blockIndex k) atTop atTop :=25(tendsto_sub_atTop_nat 1).comp (blockCount_tendsto k)2627theorem blockCount_pos {k n : ℕ} (h : k ≤ n) : 0 < blockCount k n := by28unfold blockCount29exact Nat.div_pos (by omega) (by omega)3031theorem blockIndex_add_one {k n : ℕ} (h : k ≤ n) :32blockIndex k n + 1 = blockCount k n := by33unfold blockIndex34exact Nat.sub_add_cancel (blockCount_pos h)3536/-- At most `k` padding uses are discarded, so their relative cost vanishes. -/37theorem coveredFraction_tendsto_one (k : ℕ) :38Tendsto (fun n => (blockCount k n : ℝ) * ((k+1 : ℕ) : ℝ) / ((n+1 : ℕ) : ℝ))39atTop (𝓝 1) := by40have hmod := (tendsto_mod_div_atTop_nhds_zero_nat (Nat.succ_pos k)).comp41(tendsto_add_atTop_nat 1)42have hlim : Tendsto (fun n : ℕ => 1 - (((n+1)%(k+1) : ℕ) : ℝ) /43((n+1 : ℕ) : ℝ)) atTop (𝓝 1) := by44simpa using tendsto_const_nhds.sub hmod45convert hlim using 146funext n47have hn : (((n+1 : ℕ) : ℝ)) ≠ 0 := by positivity48have hid : ((((n+1)%(k+1) : ℕ) : ℝ)) + ((k+1 : ℕ) : ℝ) * (blockCount k n : ℝ) =49((n+1 : ℕ) : ℝ) := by exact_mod_cast Nat.mod_add_div (n+1) (k+1)50field_simp51nlinarith5253theorem blockCount_ratio_tendsto (k : ℕ) :54Tendsto (fun n => (blockCount k n : ℝ) / ((n+1 : ℕ) : ℝ))55atTop (𝓝 (1 / ((k+1 : ℕ) : ℝ))) := by56have h := (coveredFraction_tendsto_one k).div_const ((k+1 : ℕ) : ℝ)57convert h using 158funext n59have hk : (((k+1 : ℕ) : ℝ)) ≠ 0 := by positivity60field_simp6162theorem blockIndex_ratio_tendsto (k : ℕ) :63Tendsto (fun n => ((blockIndex k n+1 : ℕ) : ℝ) / ((n+1 : ℕ) : ℝ))64atTop (𝓝 (1 / ((k+1 : ℕ) : ℝ))) := by65apply (blockCount_ratio_tendsto k).congr'66filter_upwards [eventually_ge_atTop k] with n hn67rw [blockIndex_add_one hn]6869/-- Any eventual lower communication rate on complete blocks transfers to all70lengths with exactly the factor `k+1`, including the intervening padded lengths. -/71theorem rescaled_rate (k : ℕ) (f : ℕ → ℝ) {R : ℝ}72(hR : ∀ r < R, ∀ᶠ n in atTop, r ≤ f n / ((n+1 : ℕ) : ℝ)) :73∀ r < R / ((k+1 : ℕ) : ℝ),74∀ᶠ n in atTop, r ≤ f (blockIndex k n) / ((n+1 : ℕ) : ℝ) := by75intro r hr76have hk : (0 : ℝ) < ((k+1 : ℕ) : ℝ) := by positivity77have hrR : r * ((k+1 : ℕ) : ℝ) < R := (lt_div_iff₀ hk).mp hr78obtain ⟨s, hrs, hsR⟩ := exists_between hrR79have hrs' : r < s / ((k+1 : ℕ) : ℝ) := (lt_div_iff₀ hk).mpr hrs80have hlimit : Tendsto (fun n => s *81(((blockIndex k n+1 : ℕ) : ℝ) / ((n+1 : ℕ) : ℝ)))82atTop (𝓝 (s / ((k+1 : ℕ) : ℝ))) := by83simpa only [mul_one_div] using (blockIndex_ratio_tendsto k).const_mul s84have hlower := (blockIndex_tendsto k).eventually (hR s hsR)85have hnear : ∀ᶠ n in atTop, r < s *86(((blockIndex k n+1 : ℕ) : ℝ) / ((n+1 : ℕ) : ℝ)) :=87hlimit.eventually (lt_mem_nhds hrs')88filter_upwards [hlower, hnear] with n hn hsn89have hden : (0 : ℝ) < ((blockIndex k n+1 : ℕ) : ℝ) := by positivity90have hn' := (le_div_iff₀ hden).mp hn91apply hsn.le.trans92rw [← mul_div_assoc]93exact div_le_div_of_nonneg_right hn' (by positivity)9495/-- Vanishing errors remain vanishing under the complete-block subsequence. -/96theorem error_subsequence {E : ℕ → ℝ} (k : ℕ)97(hE : Tendsto E atTop (𝓝 0)) :98Tendsto (fun n => E (blockIndex k n)) atTop (𝓝 0) :=99hE.comp (blockIndex_tendsto k)100101end Nonadditivity.Operational.BlockRates