Exact Lean source
Nonadditivity.Dimensions
Download original .lean · View on GitHub · Jump to source
Direct imports
Nonadditivity.ScalarMathlib.Analysis.SpecialFunctions.Pow.AsymptoticsdependencyMathlib.Algebra.Order.Floor.Semiringdependency
Imported by project modules
3 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
8 project constants, including generated, internal and private declarations.
8 declarations
Nonadditivity.Dimensions.inputDimensionNonadditivity.Dimensions.inputQubitsNonadditivity.Dimensions.input_qubits_formulaNonadditivity.Dimensions.input_size_remainder_tendstoNonadditivity.Dimensions.log_matrixDimension_errorNonadditivity.Dimensions.matrixDimensionNonadditivity.Dimensions.matrixDimension_posNonadditivity.Dimensions.weighted_log_ceiling_error_tendsto
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Nonadditivity.Scalar7import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics8import Mathlib.Algebra.Order.Floor.Semiring910/-!11# The input-qubit count for the exact integer dimension1213These are numerical dimension statements. They do not assert existence of a14channel with these dimensions. Unlike a big-O-only estimate, the ceiling15error below vanishes even after multiplication by the block length.16-/1718noncomputable section1920namespace Nonadditivity.Dimensions2122open Scalar Filter Topology2324def inputDimension (K N n : ℕ) : ℕ := 2 * N ^ n * K ^ (2 * n)25def matrixDimension (b : ℝ) (n : ℕ) : ℕ := ⌈Real.exp (b * n)⌉₊26def inputQubits (K N n : ℕ) : ℝ := log2 (inputDimension K N n : ℝ)2728theorem input_qubits_formula {K N : ℕ} (n : ℕ) (hK : 0 < K) (hN : 0 < N) :29inputQubits K N n = 1 + (n : ℝ) * log2 N + 2 * (n : ℝ) * log2 K := by30have hKr : (K : ℝ) ≠ 0 := by exact_mod_cast Nat.ne_of_gt hK31have hNr : (N : ℝ) ≠ 0 := by exact_mod_cast Nat.ne_of_gt hN32unfold inputQubits inputDimension log233push_cast34rw [Real.log_mul (by positivity) (pow_ne_zero _ hKr),35Real.log_mul (by norm_num) (pow_ne_zero _ hNr), Real.log_pow, Real.log_pow]36push_cast37field_simp3839theorem matrixDimension_pos (b : ℝ) (n : ℕ) : 0 < matrixDimension b n := by40apply Nat.ceil_pos.mpr41exact Real.exp_pos _4243/-- The exact ceiling contributes at most exp(-bn) to its logarithm. -/44theorem log_matrixDimension_error (b : ℝ) (n : ℕ) :450 ≤ Real.log (matrixDimension b n : ℝ) - b * n ∧46Real.log (matrixDimension b n : ℝ) - b * n ≤ Real.exp (-(b * n)) := by47have hexp : 0 < Real.exp (b * n) := Real.exp_pos _48have hN : 0 < (matrixDimension b n : ℝ) := by49exact_mod_cast matrixDimension_pos b n50have hlo : Real.exp (b * n) ≤ (matrixDimension b n : ℝ) := Nat.le_ceil _51have hhi : (matrixDimension b n : ℝ) ≤ Real.exp (b * n) + 1 :=52(Nat.ceil_lt_add_one hexp.le).le53have hloglo := Real.log_le_log hexp hlo54rw [Real.log_exp] at hloglo55have hloghi := Real.log_le_log hN hhi56have hsplit : Real.exp (b * n) + 1 =57Real.exp (b * n) * (1 + Real.exp (-(b * n))) := by58rw [mul_add, mul_one, ← Real.exp_add]59simp60rw [hsplit, Real.log_mul hexp.ne' (by positivity), Real.log_exp] at hloghi61have hsmall := Real.log_le_sub_one_of_pos62(show 0 < 1 + Real.exp (-(b * n)) by positivity)63constructor <;> linarith6465theorem weighted_log_ceiling_error_tendsto {b : ℝ} (hb : 0 < b) :66Tendsto (fun n : ℕ => (n : ℝ) *67(Real.log (matrixDimension b n : ℝ) - b * n)) atTop (𝓝 0) := by68have hexp : Tendsto (fun n : ℕ => (n : ℝ) * Real.exp (-(b * n))) atTop (𝓝 0) := by69simpa only [Real.rpow_one, neg_mul] using70(tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero 1 b hb).comp71tendsto_natCast_atTop_atTop72apply squeeze_zero (fun n => mul_nonneg (Nat.cast_nonneg n)73(log_matrixDimension_error b n).1)74(fun n => mul_le_mul_of_nonneg_left (log_matrixDimension_error b n).275(Nat.cast_nonneg n)) hexp7677/-- The input-size equation in the manuscript, including the o(1) ceiling78correction. Written as a remainder tending to zero to avoid informal notation. -/79theorem input_size_remainder_tendsto {K : ℕ} (hK : 0 < K) {b : ℝ} (hb : 0 < b) :80Tendsto (fun n : ℕ => inputQubits K (matrixDimension b n) n -81(b / Real.log 2 * (n : ℝ) ^ 2 + 2 * (n : ℝ) * log2 K + 1))82atTop (𝓝 0) := by83have h : Tendsto (fun n : ℕ => ((n : ℝ) *84(Real.log (matrixDimension b n : ℝ) - b * n)) / Real.log 2) atTop (𝓝 0) := by85simpa only [zero_div] using86(weighted_log_ceiling_error_tendsto hb).div_const (Real.log 2)87convert h using 188ext n89rw [input_qubits_formula n hK (matrixDimension_pos b n)]90unfold log291ring9293end Nonadditivity.Dimensions