ほぼ二値のデータでは、総和と二乗和が順位の隔たりを保証する。鋭い不等式と、誤差を広げたときに「島」が生まれ、合流する境目を辿る。For nearly binary data, the total and squared norm can force rank gaps. Follow sharp bounds to the thresholds where a wider error band creates new islands and joins them again.
横田さん × AI による数学探索 · 日本語/EnglishA mathematical exploration by Yokota and AI · 日本語/English 2026 09 09 · レビュー統合版 1.2Integrated review edition 1.2
THE CORE CERTIFICATE
2D + e² + g² ≥ 1
0 ≤ xᵢ ≤ 1。D は二値性の欠損、e は総和のずれ、g は隣り合う順位の間隔。For 0 ≤ xᵢ ≤ 1: D is the binary defect, e the error in the total, and g the gap between two adjacent ranks.
この一枚に、本文・図・監査・証明ソースを収録。One file: exposition, figures, audit and proof sources.
本文にはT1–T9の通常の数学的証明があります。追加Leanコードの実行検証は未完了です。掲載前の確認には、末尾のレビュー依頼と検証範囲をご利用ください。The text contains ordinary mathematical proofs of T1–T9. The added Lean scripts have not been executed. Review priorities and evidence boundaries are provided below.
帯 P は凸なのでこの線分は帯内にあり、式から D は非増加である。さらに v から z へは、小数座標を η→0 または 1−η→1 と動かすだけでよい。η≤1/2 のためこの線分でも D は非増加となる。これで任意の点から、その二値代表へ高々二本の線分で到達できた。これは各点に対する経路の構成であり、点 x に応じた候補の選び方の連続性は示していない。従ってこの構成だけから、全体の変形収縮を結論しない。
成分の分類。δ<δc ではT2より境目の間隔が正である。連続経路の途中で上位 s 個の添字集合を変えるには、その境目で同値が生じる必要があるから、上位集合は経路上で変わらない。一方、同じ上位集合を持つ点は上の経路で同じ代表へ結べる。全ての s 元集合に二値代表が存在するので、成分数は (sn) である。
δ≥δc では、1と0を交換する二座標だけを
(1,0)⟶(1−η,0)⟶(0,1−η)⟶(0,1)(8)
と動かす。他の s−1 個の1は固定する。総和のずれは η 以内であり、最初と最後の線分上の最大欠損は δ0、中央の最大欠損は δc。一つずつ添字を交換すれば任意の二値代表を結べる。任意の点は代表に結ばれているため、集合全体が道連結となる。閾値ちょうどもこの側に含まれる。
k = η(1 − η) は4成分が新たに現れる閾値、c = (1 − η²)/2 と h = 1/4 は合流の閾値です。閾値ボタンは丸め前の値を選び、等号は変化後の成分数に含めます。η = 1/√2 では c = h で合流が同時に起きます。非常に短い区間の帯内数値は省略されます。
証明の道具:凸障害物と辺グラフ。 コンパクト凸多面体 P と連続凹関数 f に対し、X={f≤δ} の成分数は、許容頂点 f(v)≤δ と、全体が許容される辺 maxef≤δ のグラフの成分数に等しい。
この事実を確認する。U={f>δ} は相対的に開いた凸集合である。U と交わる面を次元の大きい順に処理し、その面の相対内部に c∈U を選ぶ。面内の x∈/U を、c から x に向かう半直線上で面の境界まで動かす。凸性により、x を過ぎてから U に再び入ることはない。これは境界を固定する連続な変形であり、他の面上の恒等写像と貼り合わせられる。有限回の処理により、X は U と交わらない閉じた面の複体 K に強変形収縮する。U と交わる面の相対内点が選べることは U の相対的開性から従う。各面の辺グラフは連結なので、K とその 1 次元骨格の成分数は等しい。この骨格が上記の許容グラフである。
頂点の全列挙。 帯だけを課した多面体を P とする。その頂点は次の三種類で尽くされる。
型
座標の構成
個数
D
B
s 個の 1、残り 0
b
0
L
s−1 個の 1、1 個の a、残り 0
sb
k
U
s 個の 1、1 個の η、残り 0
(n−s)b
k
帯境界が活性でない頂点は箱の頂点であり、許容される整数和は s だけである。帯境界が活性なら少なくとも n−1 座標が 0 または 1 に固定され、残りの座標は和の条件で a または η に決まる。これで完全性と個数が従う。
[x,ρF(x)] は U に入らない。もしその先の点 y が U に入れば、cF,y∈U と凸性により、その間にある x も U に入ってしまうからである。従って
HF(x,t)=(1−t)x+tρF(x)(13)
は F∖U を ∂F∖U へ縮め、境界を固定する。
処理済みの高次元交差面の内部は既に除かれている。また、U を避ける高次元面が F を含むことは、F∩U=∅ に矛盾する。従って現在の空間の他の面と F との交わりは境界にあり、(13)を他の部分の恒等変形と貼り合わせられる。面は有限個の閉集合なので、貼り合わせは連続である。最後には U を避ける面だけが残り、K は全過程で固定される。U に含まれる頂点は最初から補集合にない。これで強変形収縮を得る。
を証明している。Leanの実数平方根は負の引数で0となるため、保証が正になるための条件と、定理自体の成立条件は区別されている。数学上の順位記法は、有限列から上位 s 個を選んだこの分割の特殊化である。形式ファイルの入出力は分割と極値を達成する添字を明示しており、並べ替え手続きの検証を必要としない。T1の平方不等式の主張と、この形式化された分割版の間に、未形式化の並べ替えアルゴリズムを補う必要はない。
Alexander N. Gorban, Thermodynamic Tree: The Space of Admissible Paths, 2013。PDF版のLemma 2.1, p.11、Proposition 2.4, p.13、Lemma 3.2, pp.18–19、§4.2・Fig.4.5, pp.26–27。頂点への接続、辺による成分分類、等位集合との対応、成分数が増加する例。旧稿が参照したHTML版のLemma 4、Proposition 7、Lemma 14は、それぞれ上記PDFのLemma 2.1、Proposition 2.4、Lemma 3.2に対応する。
Research note · Version 1.2 · 2026 09 09 · Exploration candidate X01 · Consolidated review edition
The principal finite-sample inequality has a preserved successful Lean run from 2026 09 08, covering 14 theorem declarations in the original module. The 33 additional proof scripts are NOT COMPILED: the pinned Mathlib source was obtained, but the Lean executable is absent and its download stopped at a cancelled network approval. The mathematical proofs, finite computational checks, historical Lean result, and uncompiled extension are distinguished throughout this document. No claim of established academic novelty is made.
1. What the two moments can reveal
Version 1.2: consolidated material for further review (2026 09 09). This single document combines T1–T9, their proofs and figures, the additional novelty audit, and the formalization supplement with its sources and execution records. The earlier Fable5.1 review led to the clarified partition statement and T9. The new audit identifies older explicit bounds in Rosenberg–Jakobsson (2008) and an existing example of nonmonotone component counts in Gorban (2013). These attributions narrow the possible novelty claims. A further Fable review is planned, not recorded as completed; see the review request.
Let n≥2, let x=(x1,…,xn)∈[0,1]n, and write its entries in decreasing order as x(1)≥⋯≥x(n). Define
S=i∑xi,Q=i∑xi2,D=S−Q=i∑xi(1−xi).
The nonnegative quantity D is zero exactly at binary vectors. With mean μ=S/n and variance V=n−1∑i(xi−μ)2, it satisfies
D=n[μ(1−μ)−V].
Thus D measures the deficit from the endpoint variance bound μ(1−μ), multiplied by n. For a fixed noninteger sum, that endpoint bound need not be attainable by a finite vector; Section 6 accounts for the resulting positive minimum of D. The question is how much this aggregate information forces the individual entries to separate.
The useful regime is nearly binary data, with small total defect and a sum close to a specified integer 1≤s<n. Write e=S−s. This is not a positive-gap guarantee for broadly distributed statistical data. More precisely, the positive certificate below satisfies
2D+e2<1⟺0≤μ(1−μ)−V<2n1−e2.
Thus ∣e∣<1 is necessary, and the variance must lie within O(1/n) of the endpoint bound. For a fixed finite noninteger sum S=m+r, 0≤r<1, the actual maximum variance is μ(1−μ)−r(1−r)/n, as shown in Section 6. Nearly idempotent self-adjoint matrices are a natural application through their eigenvalues; Section 2 states that corollary and explains why the vector topology does not transfer to the full matrix space.
For an integer 1≤s<n, put e=S−s and gs=x(s)−x(s+1). We prove
2D+e2+gs2≥1.(1)
If 2D+e2<1, the largest s entries are separated from the others by a positive gap. This also prevents the identity of that top group from changing along a continuous deformation that preserves the strict inequality. Aggregate statistics certify separation; they do not identify the labels of the largest entries without observing the vector.
The note develops this observation in three directions: an exact worst-case gap under uncertainty in the sum, a constructive classification of connected components, and a small example where holes appear and disappear. All component counts concern labeled vectors, not vectors modulo permutation and not one-dimensional projections onto a partial sum.
Figure 1
A forced gap between two ranks
Switch configurations to inspect the relation between total error, defect, and the rank gap.
Displayed numbers are rounded. These configurations illustrate the result; the nonnegative decomposition in the text proves it universally.
2. A universal rank inequality, its equality cases, and stability
Theorem 1: the square inequality for an arbitrary finite partition
Assume x∈[0,1]n. Choose any nonempty proper subset I of the index set, put J=Ic and s=∣I∣, and choose indices attaining the boundary extrema:
u=i∈Iminxi=xa,v=j∈Jmaxxj=xb,gI=u−v.
Here a∈I, b∈J, and gI is signed. Then
2D+(S−s)2+gI2≥1.
Neither integrality of S nor cross-ordering u≥v is assumed for this squared statement. If I is the set of the largest s entries, then gI=gs≥0, and it gives (1) and
gs≥max{1−2D−(S−s)2,0}.
For an arbitrary partition, the squared inequality does not imply a positive signed gap. The square-root conclusion additionally requires u≥v.
Proof. Write g=gI, e=S−s, and define
σ=i∈I∑(1−xi),ρ=j∈J∑xj,
A=σ−(1−u)=i∈I∖{a}∑(1−xi),B=ρ−v=j∈J∖{b}∑xj.
Empty sums are zero. In particular A,B≥0, and e=ρ−σ. Define
T=i∈I∑(xi−u)(1−xi)+j∈J∑(v−xj)xj.
Every summand is nonnegative by the extremum condition on its own side and the box bounds; cross-ordering is not used. The following exact identity holds:
2D+e2+g2−1=2T+2(1−v)A+2uB+(B−A)2.(2)
For i∈I, write
xi(1−xi)=u(1−xi)+(xi−u)(1−xi).
For i∈J, write
xi(1−xi)=(1−v)xi+(v−xi)xi.
Summing gives D=uσ+(1−v)ρ+T. Substitute σ=1−u+A, ρ=v+B, e=u+v−1+B−A, and g=u−v. Expanding and collecting terms gives (2). Since 0≤u≤1 and 0≤v≤1, its right-hand side is nonnegative. This proves the partition statement and, by choosing a top set, (1). This is an identity for arbitrary finite vectors, not an inference from numerical samples. ∎
Equality and quantitative stability
If g>0, then u≥g and 1−v≥g. Hence, with R=2D+e2+g2−1,
R≥2g(A+B),A+B≤2gR.(3)
Consequently, for g>0, equality in (1) holds precisely for the sorted vectors
(s−11,…,1,u,v,n−s−10,…,0).(4)
Indeed, R=0 forces A=B=0; nonnegative summands then force all the indicated entries to be endpoints. Conversely, (4) makes A=B=T=0, so (2) gives equality.
More generally, g≥γ>0 and R≤ε force the total distance of all entries other than the boundary pair from their indicated endpoints to be at most ε/(2γ). This estimate degenerates as the gap approaches zero. Replacing those entries by endpoints does not necessarily preserve S: the change in the sum is A−B.
Corollary: a spectral certificate for a Hermitian contraction
Let X be an n×n self-adjoint matrix with 0≤X≤In in the operator order, and let λ1≥⋯≥λn be its eigenvalues. For 1≤s<n,
2Tr(X−X2)+(TrX−s)2+(λs−λs+1)2≥1,
λs−λs+1≥max{1−2Tr(X−X2)−(TrX−s)2,0}.
Proof. By the spectral theorem, λi∈[0,1], TrX=∑iλi, and Tr(X−X2)=∑iλi(1−λi). Apply Theorem 1 and its rank corollary to the eigenvalue vector. ∎
This immediate transfer is a useful application, rather than an independent principal theorem. The gap formulas in Sections 3 and 6 transfer in the same way. The component and hole classifications require a different model: they concern labeled coordinates, equivalently diagonal matrices in a fixed basis. Eigenvectors may rotate in the full matrix space. For example,
Pθ=(cos2θcosθsinθcosθsinθsin2θ),0≤θ≤2π,
is a continuous path from diag(1,0) to diag(0,1), with Pθ2=Pθ, trace 1, and defect D=0 throughout. More generally, complex orthogonal projections of the same rank are unitarily conjugate, and varying the eigenphases of a unitary matrix continuously supplies a connecting path. Hence the vector count (sn) cannot be asserted for the full matrix space. Reframing the entire note around matrices would leave the gap formulas largely intact, but would require new topological questions and proofs for the component and hole sections.
Here η bounds the sum error; the corresponding mean error is η/n. This is a joint constraint on S and D=S−Q, not an arbitrary rectangular uncertainty set in the mean and variance.
The formulas agree at shared endpoints. When η=0, the first branch consists only of δ=0. The set is nonempty because it contains all binary vectors with s ones; compactness and continuity also ensure the minimum exists.
Figure 2
The smallest gap under moment uncertainty
The solid curve is the sharp, attainable bound. The dashed curve uses only the universal inequality.
η bounds error in the total, not in the mean. Assume 0 ≤ η ≤ 1/2. Each point on the curve optimizes over every vector satisfying D ≤ δ.
Proof. If two entries satisfy 0<a≤b<1, set h=min(a,1−b)>0 and replace (a,b) by (a−h,b+h). The sum stays fixed, both entries remain in the box, and the squared sum increases by 2h(b−a)+2h2>0. At least one of the two entries becomes an endpoint. Repeating this finite operation leaves at most one nonintegral entry. The resulting vector has ⌊t⌋ ones, one entry {t} if this is nonzero, and zeros elsewhere. Its squared sum is ϕ(t), which proves both inequalities. ∎
This packed-vector extremum is classical; see Rosenberg–Jakobsson, Appendix Lemma 3, and the finite-data formulation by Ellis [R1–R2]. Its proof is included to make the optimization below self-contained.
Proof of the lower bounds
Let a=∣S−s∣≤η≤1/2. Equation (6) gives D≥a(1−a), including either sign of S−s. For S=s−a, the fractional part is 1−a when a>0, and zero when a=0; both give the stated defect bound.
If 0≤δ≤δ0, define
b=21−1−4δ.
Since t(1−t) is increasing on [0,1/2], we obtain a≤b≤η. Theorem 1 now yields
gs2≥1−2D−e2≥1−2δ−b2=(1−b)2.
As gs≥0, this proves the first branch. For δ0≤δ≤δc, Theorem 1 directly gives gs2≥1−2δ−η2≥0. The bound gs≥0 proves the third branch's lower bound.
Attainment in every branch
Use s−1 initial ones and n−s−1 final zeros, leaving exactly two boundary entries.
For the first branch, choose (1−b,0). Then S=s−b, D=b(1−b)=δ, and gs=1−b.
For the second branch, put h=1−2δ−η2 and choose
(21−η+h,21−η−h).(7)
The condition δ≥δ0 is equivalent to h≤1−η; hence both entries lie in [0,1]. Their sum is 1−η, their difference is h, and their defect is (1−η2−h2)/2=δ. Finally, for δ≥δc, the same construction at h=0 has an exact tie and remains feasible. This proves all three branches and their sharpness. ∎
For example, n=6,s=2,η=0.1,δ=0.2 forces a gap of at least 0.59≈0.7681146. Equality is attained by
(1,0.8340573…,0.0659427…,0,0,0).
There is also stability of the optimizing configurations. If the value in (5) is q>0, the preceding bounds imply 2D+e2≤1−q2. Therefore
0≤R≤gs2−q2,A+B≤2gsgs2−q2.
A nearly minimal positive gap requires nearly all nonbinary mass to concentrate in the two boundary entries.
4. Components and a constructive path to a binary representative
Theorem 3: the exact merging threshold
For the same parameter range,
#π0(Fs,η,δ)={(sn),1,0≤δ<δc,δ≥δc.(8)
Here π0 denotes path components. Below the threshold, a component is specified by the labels of the largest s entries. At equality the components have already merged. The result is an explicit consequence of the general polytope-complement theory of Gorban [R3], but the following proof is independent of that theory.
Step 1: at most two line segments reach a binary vector
Take any x∈Ps,η, sort its coordinates, and let z=(1s,0n−s), where 1k means k consecutive ones. Define weights wi=2xi−1. Choose an auxiliary point v as follows, with the first applicable case taking priority:
If xs≤1/2, choose v=(1s−1,1−η,0n−s).
Otherwise, if xs+1≥1/2, choose v=(1s,η,0n−s−1).
Otherwise choose v=z.
All three candidates belong to the sum band. We claim
c:=i∑wi(vi−xi)≥0.(9)
In the first case put α=ws≤0 and write
c=i∑(wi−α)(vi−xi)+α[(s−η)−S].
For i<s, both factors of the summand are nonnegative. For i>s, both are nonpositive. For i=s, the first factor is zero. The final product is nonnegative because S≥s−η. This proves (9).
In the second case use α=ws+1≥0. For i≤s, both factors are nonnegative; for i>s+1, both are nonpositive; and the boundary summand vanishes. The final term is α[(s+η)−S]≥0. In the third case, wi and zi−xi have the same sign in each coordinate, proving (9) directly. These sign arguments also explain the greedy linear optimization behind the construction.
For 0≤t≤1, an exact expansion now gives
D(x+t(v−x))=D(x)−tc−t2∥v−x∥22≤D(x).(10)
The segment stays in Ps,η by convexity. Moreover, its defect is nonincreasing in t. If v=z, continue along the coordinate segment from v to z. This moves η down to 0, or 1−η up to 1. Since η≤1/2, the function a(1−a) decreases along that segment. The sum stays in the band. Thus every x∈Fs,η,δ reaches the binary representative of its chosen top group by at most two line segments, without increasing the defect.
This constructs a path for each starting point. The choice of the auxiliary vertex has not been proved continuous as the starting point varies; the construction therefore does not assert a deformation retraction of an entire component. Gorban's earlier vertex-access Lemma 2.1 in the PDF (Lemma 4 in the HTML version) is a related general result about reaching a polytope vertex by a segment avoiding a convex obstacle [R3]. The greedy choice and the binary endpoint used here are given explicitly by the sign proof above.
Step 2: count the separated components
If δ<δc, Theorem 2 gives gs>0 everywhere in F. The top-s label set is consequently locally constant: strict separation persists in a sufficiently small coordinate neighborhood. It is therefore constant along a continuous path. Every s-element label set occurs at its binary representative. Conversely, all points with one such label set are connected to that same representative by Step 1. There are exactly (sn) components.
Step 3: connect all representatives at the threshold
Suppose δ≥δc. To exchange one selected label with one unselected label, keep the other s−1 ones fixed and move the two relevant coordinates through
(1,0)⟶(1−η,0)⟶(0,1−η)⟶(0,1).
The first and last segments have defect at most δ0. On the middle segment the two entries have sum 1−η; their defect is largest when equal and is then (1−η2)/2=δc. The sum error never exceeds η. Every two s-element subsets can be joined by a sequence of single-element exchanges, so all binary representatives are connected. Step 1 connects all other points to them. This proves (8), including η=0. ∎
Two limits of the statement
The two-segment construction cannot in general be replaced by a direct segment to z. Let n=2,s=1,η=1/2, and x=(3/8,1/8). Here D(x)=11/32<δc=3/8. Along the segment z+t(x−z), where z=(1,0),
D=43t−3213t2.
At t=12/13 this equals 9/26>11/32. Thus the asserted components need not be star-shaped about their binary representatives.
The restriction η≤1/2 is substantive. For n=2,s=1,η=0.9,δ=0.1, both (0.1,0) and (1,0) are feasible. Any continuous path between them makes the first coordinate equal 1/2, forcing D≥1/4>0.1. The set is disconnected even though 0.1>(1−0.92)/2=0.095. Formula (8) therefore does not extend to this larger error range.
4.1 Beyond a half-unit tolerance: the birth and merger of components
The restriction η≤1/2 in the preceding result is essential. Nevertheless, for 1/2<η<1, a complete component count in every dimension follows by examining the vertices and edges of the band polytope. Let
Fδ={x∈[0,1]n:i∑xi−s≤η,D(x)=i∑xi(1−xi)≤δ}.
Throughout this section, n≥2, 1≤s<n are integers, 1/2<η<1, and δ≥0.
Theorem T9 (complete component count for a wide band). Put
Rows with empty intervals are omitted. Equality c=h holds precisely when η=1/2; both intermediate rows then disappear. The displayed formula includes every threshold value with the indicated inequalities.
Figure 3
A wider sum band: components appear, then merge
Fix n = 2 and s = 1. The diagram counts path components of the set satisfying |x₁ + x₂ − 1| ≤ η and x₁(1 − x₁) + x₂(1 − x₂) ≤ δ. Numbers inside the band are component counts.
At k = η(1 − η), four new components appear; c = (1 − η²)/2 and h = 1/4 are merger thresholds. Threshold buttons select unrounded values, with equality assigned to the state after the transition. At η = 1/√2, c = h and both mergers occur simultaneously. Labels inside very short intervals are omitted.
A graph lemma for convex obstacles. If P is a compact convex polytope and f is continuous and concave, the path components of X={f≤δ} correspond to the components of the graph retaining vertices with f(v)≤δ and edges with maxef≤δ.
Here is a proof. The set U={f>δ} is relatively open and convex. Process the faces meeting U in decreasing dimension. In each such face choose z∈U in its relative interior; relative openness guarantees that this is possible. Move each point outside U outward along the ray from z, until it reaches the face boundary. Convexity ensures that a ray cannot re-enter U after passing a point outside it. This continuous deformation fixes the boundary and therefore glues to the identity on the other remaining faces. After finitely many steps, X strongly deformation retracts onto the complex K of closed faces disjoint from U. Each face has a connected edge graph, so the components of K are precisely those of its one-skeleton. That one-skeleton is the stated graph.
All vertices. Let P impose only the box and band constraints. Its vertices have exactly three types.
Type
Coordinates
Count
D
B
s ones, all remaining entries zero
b
0
L
s−1 ones, one entry a, all others zero
sb
k
U
s ones, one entry η, all others zero
(n−s)b
k
Indeed, a vertex away from the band boundaries must be a cube vertex, and s is the only allowed integer sum. At a band boundary, at least n−1 coordinates must be fixed at zero or one. The sum constraint determines the remaining coordinate as a or η. This proves completeness and the counts.
All edges and their thresholds. Edges inherited from the cube are exactly the segments L↔B, with one coordinate ranging from a to 1, and B↔U, with one coordinate ranging from 0 to η. Both intervals contain 1/2, so their maximum deficit is h=1/4. Each L or U vertex has exactly one edge of this kind, connecting it to a unique B vertex.
Edges within the band boundaries have the following four types. All coordinates other than the displayed pair are fixed at zero or one.
Band boundary
Endpoints of the moving pair
Maximum D
Lower, short edge
(a,0)↔(0,a)
c
Lower, long edge
(1,a)↔(a,1)
d=(1−a2)/2
Upper, short edge
(1,η)↔(η,1)
c
Upper, long edge
(η,0)↔(0,η)
d
A type is absent if its required coordinates do not fit the dimension or sum. At the relative interior of an edge, either no band boundary is active and n−1 coordinates are fixed, or one band boundary is active and n−2 coordinates are fixed. Thus the list is exhaustive. For a moving pair with fixed sum t,
y(1−y)+(t−y)(1−t+y)=t−2t2−2(y−t/2)2.
The midpoint belongs to each listed segment, yielding the stated maxima. Moreover,
c−k=2(1−η)2>0,h−k=(η−21)2>0,d>max(c,h).
Counting the graph components. For δ<k, only the B vertices are present. For k≤δ<min(c,h), all (n+1)b vertices are present. No edges have yet appeared in either interval.
If c<h and c≤δ<h, the short band edges appear first. On the lower boundary, they connect each group with a fixed set of s−1 one-coordinates; there are (s−1n) such groups. On the upper boundary, they connect each group with a fixed positive support of size s+1; there are (s+1n) groups. The b binary vertices remain isolated. Adding these counts gives the third row of T9.
If h<c and h≤δ<c, the cube segments appear first. Each binary vertex is the center of a star whose leaves are its associated L and U vertices. Because every leaf has a unique binary neighbor, these are b disjoint stars.
Once δ≥max(c,h), all binary vertices are connected. To see this, identify a binary vertex with its set I of s one-coordinates. If I′ differs by exchanging one element, keep the common s−1 ones fixed and use three edges: a cube segment, a short lower-boundary edge exchanging the position of a, and another cube segment. Any two s-element subsets are related by successive single-element exchanges. Every L and U vertex also attaches to a binary vertex, so the entire graph is connected. This occurs before the long edges appear. No new vertices appear later, and adding edges preserves connectedness. The graph lemma now proves T9. □
The reviewer's numerical example. For n=2,s=1,η=0.9,
k=0.09,c=0.095,h=0.25.
The component count therefore evolves as
2δ=0.096δ=0.0954δ=0.251.
At each marked threshold the count on its right already applies. Thus the reviewer's observations 6,4,4,1 at δ=0.09,0.10,0.20,0.26, respectively, are correct. Although the sets grow with δ, their component count need not decrease monotonically: new components are born at new feasible vertices.
Additional corollary: holes in dimension two. For n=2,s=1, put p=x1+x2−1 and q=x1−x2. The band polytope becomes the hexagon
∣p∣+∣q∣≤1,∣p∣≤η,D=(1−p2−q2)/2.
For δ<1/2, the origin is excluded. Radially expanding points from the origin to the hexagon boundary gives a strong deformation retraction onto the feasible boundary: the norm never decreases, so the deficit constraint is preserved. The boundary has four sloping edges with threshold h and two vertical edges with threshold c. Therefore each component is contractible for δ<max(c,h); for max(c,h)≤δ<1/2, the entire boundary is feasible and Fδ≃S1. For δ≥1/2, the full hexagon is feasible and contractible. Connectedness and the disappearance of the hole are different events.
Status. T9 applies Gorban’s general theory of polytopes with convex obstacles, notably Proposition 2.4 in the PDF (Proposition 7 in the HTML). His §4.2, Fig.4.5 already gives an example where a growing feasible set acquires new isolated components. That phenomenon is therefore not claimed as a discovery here. The same explicit thresholds and binomial count for this particular band were not identified in the limited search; their priority remains unresolved. T9 has ordinary mathematical proofs and finite checks, but no Lean formalization.
5. Nearest binary rounding has an earlier threshold
Selecting the largest s entries and rounding each entry at 1/2 are different operations. For coordinatewise nearest rounding, the sharp threshold is
δR=21−η2.(11)
Theorem 4. If ∣S−s∣≤η≤1/2 and D<δR, every coordinate has a unique nearest value in {0,1}, and the rounded vector has exactly s ones.
Proof. Suppose a coordinate equals 1/2. The remaining coordinates have sum s−1/2+e, with ∣e∣≤η. The packed-square lemma, including the endpoint cases e=±1/2, gives
D≥41+(21+e)(21−e)=21−e2≥δR.
Thus no coordinate can equal 1/2 under the strict defect bound. Follow the nonincreasing-defect path from Section 4 to a binary representative with s ones. No coordinate can cross 1/2 along this path, so its rounding remains unchanged and equals that representative. ∎
The threshold is sharp for the joint guarantee of uniqueness and sum preservation. The vector
(1s−1,1/2,1/2−η,0n−s−1)
has S=s−η and D=δR, but at least one rounding tie. When η>0, the strict inequality δR<δc leaves a range in which a top group remains separated while nearest rounding may have the wrong number of ones. Replace the boundary pair by
(1/2−ε,1/2−η+ε).
For sufficiently small 0<ε<η/2, both are below 1/2, their gap remains positive, and
D=δR+2ηε−2ε2lies between δR and δc.
For example, s=1,η=0.1,x=(0.49,0.41) gives D=0.4918<δc=0.495. The first entry is the unique largest entry, but both entries round to zero.
6. An exact noninteger sum produces two merging events
Let S=m+r, where m∈{0,…,n−1} and 0<r<1. Define
HS={x∈[0,1]n:i∑xi=S},M=m+r2,
E=M−Q,Emax=M−nS2,XE={x∈HS:Q=M−E}.
The feasible range is exactly 0≤E≤Emax. The packed-square lemma gives the maximum Q=M. The identity Q=S2/n+∑i(xi−S/n)2 gives the minimum S2/n, uniquely attained at c=(S/n,…,S/n). Interpolation from c to a packed vertex attains every intermediate value.
The quantities D and E must not be confused:
D=r(1−r)+E.(12)
Theorem 5: both relevant rank gaps are sharp
For every feasible E, and only when the stated rank exists,
Proof of the lower bounds. Apply Theorem 1 with s=m, so e=r, and substitute (12). This yields gm2≥(1−r)2−2E. Apply it with s=m+1, so e=r−1, to get gm+12≥r2−2E. The gaps are nonnegative, giving the displayed bounds.
Attainment before the thresholds. Put b=(1−r)2/2. For 0≤E≤b, let d=(1−r)2−2E and choose
w=(1m−1,(1+r+d)/2,(1+r−d)/2,0n−m−1).
Since 0≤d≤1−r, this is a sorted box vector with sum S, gap d, and squared sum M−E. Similarly, put a=r2/2. For 0≤E≤a, the vector
w=(1m,(r+d)/2,(r−d)/2,0n−m−2),d=r2−2E,
attains (14). The assumed rank conditions make all multiplicities valid.
Attainment after the thresholds. In either construction, let y be the vector at its threshold t, where t=b or a, so the boundary pair is tied. Interpolate by x(λ)=(1−λ)y+λc, 0≤λ≤1. Sorting is preserved and the same pair remains tied. Orthogonality to the constant vector gives
E(x(λ))=Emax−(1−λ)2(Emax−t).
Thus every E∈[t,Emax] is attained with gap zero. If t=Emax, only the endpoint needs to be considered. ∎
Figure 4
Two rank gaps vanish at different thresholds
Fix n = 6 and m = 2, then vary r and E. Components refer to the full set of labelled vectors.
a = r²/2 and b = (1−r)²/2. Merging has already occurred at equality. E = Emax is the single uniform vector. Curves show the minimum of each rank gap.
Theorem 6: component counts from a weighted edge graph
For the internal case 1≤m≤n−2, set
a=r2/2,b=(1−r)2/2,N=(mn)(n−m).
The following table gives the number of path components of XE. Empty intervals are ignored.
Range of E
Number of components
Constant label within a component
E<a and E<b
N
top-m set A, together with the next label j
a≤E<b
(mn)
top-m set A
b≤E<a
(m+1n)
top-(m+1) set
E≥a and E≥b
1
no separation into components
We use the following known result explicitly. Gorban's Thermodynamic Tree, Proposition 2.4 in the PDF (Proposition 7 in the HTML), identifies the path components of a convex polytope P minus a convex set U with those of the graph formed by vertices outside U and edges entirely outside U. His Lemma 3.2 in the PDF (Lemma 14 in the HTML) identifies the relevant components of a strictly convex level set with those of its superlevel set [R3]. In this quadratic setting the latter step also has the direct deformation retraction below.
Vertices and edges. A point of HS with two entries strictly between 0 and 1 admits a nonzero perturbation of those entries with fixed sum, in both signs. Hence it is not a vertex. All vertices are therefore packed vectors: m ones, one r, and zeros elsewhere. Conversely, fixing those n−1 endpoint coordinates fixes the remaining coordinate, so each is a vertex. Label it (A,j), with ∣A∣=m, j∈/A.
Every edge has exactly two free coordinates in its relative interior. Indeed, fixing its endpoint coordinates leaves a cube slice of dimension one, so the number of free coordinates is two. Their sum must be r or 1+r. Thus there are only two edge types:
Type
Moving coordinates
Maximum E on the edge
L
(r,0)↔(0,r)
a=r2/2
U
(1,r)↔(r,1)
b=(1−r)2/2
Each maximum occurs at the midpoint, by direct expansion of the squared sum. Define
ΩE={x∈HS:Q≥M−E},UE={x∈HS:Q<M−E}.
The removed set UE is relatively open and convex. An L edge is wholly in ΩE exactly when E≥a; a U edge is wholly there exactly when E≥b. The use of the strict inequality in UE explains why merging is already complete at the threshold itself.
For E<Emax, put RE=M−E−S2/n>0. Every x∈ΩE has ∥x−c∥≥RE, and
pE(x)=c+∥x−c∥RE(x−c)
belongs to XE. The homotopy
c+[(1−t)+t∥x−c∥RE](x−c),0≤t≤1,
stays in HS by convexity and has radius at least RE, so it remains in ΩE. It fixes XE. Hence ΩE strongly deformation retracts onto XE. At E=Emax, XE={c} is handled directly.
Count the surviving graph. With neither edge type present, all N vertices are isolated. With only L edges, A is fixed and the n−m choices of j form a complete graph; this gives (mn) components. With only U edges, B=A∪{j} is fixed and its m+1 choices of j form a complete graph; this gives (m+1n) components. With both types present, the graph is connected. Explicitly, use an L move to designate a desired new element as the fractional coordinate, then a U move to exchange it with an element of A. Repeated single-element exchanges connect all m-subsets, and L moves connect all fractional labels for each subset. Gorban's proposition and the retraction transfer these counts to XE.
Finally, (13) keeps the top-m label set fixed whenever E<b, and (14) keeps the top-(m+1) set fixed whenever E<a. Each possible label is realized on the segment from its packed vertex toward c. The number of labels equals the component count in each row, proving the stated labeling. ∎
For r<1/2, the counts are N→(mn)→1; for r>1/2, they are N→(m+1n)→1. When r=1/2, both edge types enter at 1/8, and the intermediate stage disappears. For example, n=6,S=2.3 gives 60→15→1 at E=0.045 and 0.245.
At the boundaries, m=0 has only L edges and only (14): n components merge into one at E=a. The case m=n−1 has only U edges and only (13), with merging at E=b. For n=2, the applicable threshold equals Emax, so two points meet at the uniform point. If one allows n=1, the whole slice is already a single point.
7. Beyond connectivity: holes appear and disappear
Take n=4,S=5/4. Then m=1,r=1/4, M=17/16, and Emax=43/64. The component count is 12→4→1, but this does not describe all changes in shape.
The homotopy sequence to be proved
Range of E
Homotopy type of XE
Betti numbers (β0,β1,β2)
0≤E<1/32
twelve points
(12,0,0)
1/32≤E<1/24
four disjoint circles
(4,4,0)
1/24≤E<9/32
four points
(4,0,0)
9/32≤E<13/24
a wedge of three circles
(1,3,0)
13/24≤E<43/64
the sphere S2
(1,0,1)
E=43/64
one point
(1,0,0)
Having the homotopy type of a point means being contractible; it does not mean the set literally consists of one point. Likewise, the other rows specify homotopy type rather than an exact embedding or homeomorphism. The Betti numbers displayed here agree over the integers and over F2, as follows from the identified homotopy types.
Figure 5
Holes appear, fill in, and appear again
n = 4, S = 5/4. The diagram shows the face complex K_E with the same homotopy type as the level set.
E
Type
β₀, β₁, β₂
[0, 1/32)
12 points
12, 0, 0
[1/32, 1/24)
4 circles
4, 4, 0
[1/24, 9/32)
4 points
4, 0, 0
[9/32, 13/24)
Wedge of 3 circles
1, 3, 0
[13/24, 43/64)
Sphere S²
1, 0, 1
{43/64}
One point
1, 0, 0
This is a three-dimensional projection of the exact vertices, edges, and faces of K_E. Generally K_E is not a subset of X_E. They are homotopy equivalent; a point-like type need not mean the original set is a single point.
Theorem 7: retract a convex-set complement to uncut faces
Let P be a compact convex polytope, let U⊂P be relatively open and convex, and let K be the union of all closed faces of P disjoint from U. Include P itself among its faces. Then P∖U strongly deformation retracts onto K.
Proof. The assertion is immediate if U is empty. Otherwise process every positive-dimensional face F meeting U, in decreasing dimension. Because U is relatively open in P, a point in U∩F can be perturbed within F into its relative interior while staying in U. Choose cF∈U∩relint(F).
For x∈F∖U, let ρF(x) be the point where the ray from cF through x meets ∂F, where the boundary is taken within the affine hull of F. The center is in the relative interior and does not belong to F∖U, so this radial map is continuous on its domain; it fixes every boundary point. One can see continuity directly by representing F with finitely many affine inequalities: the distance to the boundary along a ray is the minimum of the positive intersection parameters with the supporting hyperplanes.
The entire segment [x,ρF(x)] avoids U. Otherwise, for some farther point y∈U on that ray, x would lie on the segment from cF∈U to y∈U, contradicting convexity of U. Therefore
HF(x,t)=(1−t)x+tρF(x)
deforms F∖U into ∂F∖U, staying outside U and fixing the boundary throughout.
At this stage, every higher-dimensional face meeting U has already been collapsed. A higher-dimensional face avoiding U cannot contain F, since F∩U=∅. Thus the currently remaining part of F∖U meets the rest of the remaining space only along its boundary. Extend HF by the identity on that rest. The maps agree on the overlap, and the finite closed-face pasting property gives a continuous homotopy. After finitely many steps, only faces disjoint from U remain. Vertices in U were absent from the complement from the start. Every point of K is fixed during every step, so the resulting deformation retraction is strong. The empty-complement case is interpreted trivially. ∎
This is an explicit finite-dimensional geometric argument; it is not presented as a newly discovered general topological theorem.
Compute the threshold for every face
Apply the lemma with P=HS and U=UE={Q<M−E}. A face has j coordinates fixed to 1, p free coordinates, and the rest fixed to 0, with 0<S−j<p. Its dimension is p−1. On this face,
Q=j+free i∑xi2≥j+p(S−j)2,
because the sum of squared deviations of the free entries from their mean is nonnegative. Equality is attained when all free entries equal (S−j)/p∈(0,1). The face is entirely outside UE exactly when
E≥EF:=M−j−p(S−j)2.(15)
Let KE contain precisely these faces. Theorem 7 gives HS∖UE≃KE, and Section 6 gives HS∖UE≃XE for E<Emax. These are two deformation retractions from the common space ΩE=HS∖UE. We do not claim a direct deformation retraction from XE to KE: in general, KE is not a subset of XE. At the endpoint, KE=HS and XE={c} are both contractible.
For n=4,S=5/4, this polytope is combinatorially a truncated tetrahedron. Its complete face table is
Face type
j
p
Count
Entry threshold EF
vertex
1
1
12
0
L edge
1
2
12
1/32
triangular face
1
3
4
1/24
U edge
0
2
6
9/32
hexagonal face
0
3
4
13/24
full polytope
0
4
1
43/64
For completeness, the counts follow by choosing the coordinate positions: vertices choose one fixed 1 and one fractional coordinate, giving 4⋅3=12; L edges choose a fixed 1 and two free positions among the other three, giving 4(23)=12; triangular faces choose their fixed 1, giving four; U edges choose their two free positions, giving (24)=6; hexagonal faces choose their fixed 0, giving four. No other possibilities satisfy 0<5/4−j<p in the relevant dimension.
Theorem 8: the six-stage homotopy classification
For n=4,S=5/4, the six homotopy types and their exact parameter intervals are those stated at the start of this section.
Proof. Read the face complex KE at each successive threshold.
Initially KE consists of twelve isolated vertices. At E=1/32, the twelve L edges form four disjoint triangular boundaries, one for each position of the fixed 1. At E=1/24, the four triangular faces enter and fill these circles, giving four disjoint disks.
At E=9/32, the six U edges enter. Each pair of triangular disks is joined by one such edge: the edge with free positions i,j connects the disk whose fixed 1 is at i to the one whose fixed 1 is at j. In each triangle, choose one of its boundary edges. It is a free edge, because no other two-dimensional cell meets it. Collapse the triangle together with that edge onto the other two edges, keeping all three vertices and all joining edges. Each triangle has become a tree connecting its three attachment points. Contracting these four trees in the resulting graph gives the complete graph K4; these elementary collapses and graph-tree contractions preserve homotopy type. Finally, contract a spanning tree of K4. Its 6−4+1=3 remaining edges form a wedge of three circles.
At E=13/24, all hexagonal faces enter, so KE is the entire boundary of the three-dimensional convex polytope. Radial projection from any interior point identifies that boundary homeomorphically with S2. At E=43/64, the whole polytope enters and is contractible. These arguments prove every row, including the equality conventions. ∎
Independent computation enumerated the faces and formed the cellular boundary matrices over F2, verified that consecutive boundary maps compose to zero, and recovered the displayed Betti numbers. These finite calculations corroborate the result. The homotopy types themselves follow from the direct cell descriptions above, not from mod-2 homology alone.
8. What Lean verified, and what it did not
The recorded run used Lean 4.19.0 and Mathlib v4.19.0, at Mathlib commit c44e0c8ee63ca166450922a373c7409c5d26b00b. It compiled all 14 theorem declarations in MomentIslands.lean, with final exit code 0. These are proofs over the real numbers and arbitrary finite index types, not numerical-grid checks.
That successful compilation was performed on 2026 09 08 and is recorded in the accompanying log. On 2026 09 09, the official tag-to-commit mapping was checked and the pinned Mathlib source was obtained at the stated commit. Fetching the Lean distribution stopped twice because the network approval was cancelled before a decision was returned. A subsequent search did not recover a reusable Lean executable or distribution archive. The Mathlib source enabled API inspection but did not provide a Lean runtime or compiled dependencies. No fresh Lean compilation was performed.
The count of 14 is the number of theorem declarations in the file, not 14 independent principal results of X01. In particular, four_variable_gap_bound and four_variable_gap record an earlier four-variable impossibility example and lie outside the main results of this note.
Formal theorem names
Verified scope
rank_gap_partition, rank_gap_partition_sqrt
Theorem 1 for an arbitrary finite partition with box bounds and attained extrema; the square-root form adds cross-ordering
finite_rank_gap
The bridge from finite sums and boundary hypotheses to the scalar rank certificate
rank_gap_core, rank_gap_sqrt, rank_gap_slack
Scalar algebraic rank inequalities and a quantitative slack bound
The quadratic defect bound and its inversion for two nonnegative error families explicitly assumed to have the same mass
pair_square_upper, pair_square_upper_complement
Two elementary two-variable squared-sum bounds
four_variable_gap_bound, four_variable_gap
Total 2 and first-pair total 1/2 force Q≤3/2, and hence exclude Q=9/5; two auxiliary examples outside X01's main results
concentration_from_square_deficit
Concentration derived from a nonnegative vector's squared-sum deficit
The formal theorem rank_gap_partition takes any nontrivial finite partition I,Ic, an index a∈I attaining its minimum, and an index b∈/I attaining the maximum outside I. It proves precisely the squared statement of Theorem 1, without requiring I to be a top set. The separate theorem rank_gap_partition_sqrt adds xb≤xa and proves
1−2i∑xi(1−xi)−(i∑xi−∣I∣)2≤xa−xb.
Lean's real square root is zero on negative arguments. Thus the formal statement covers that case as well; a positive radicand is what provides a positive gap. Mathematical order-statistic notation specializes this interface by choosing a top set of size s. The formal input explicitly supplies the partition and indices attaining its extrema. No sorting procedure is needed to state or prove this interface, and no unformalized sorting algorithm is required to fill a gap between the partition statement in this note and the formal theorem.
The historical module does not formally establish the complete three-branch optimization with attaining vectors, the nearest-rounding count-preservation theorem, the full equality classification, the two-segment paths, or any topological classification. In particular, its lemma assuming equal error masses does not prove that a particular rounding procedure produces those masses. The extension below attempts to close the optimization and rounding gaps, but its scripts have not been compiled. The nonnegative identity in Section 2 has a mathematical proof, and its aggregate algebraic identity occurs inside rank_gap_core; exact formal coverage must be read from the declarations.
Each of the 14 historical declarations was audited with #print axioms. Every output listed only propext, Classical.choice, and Quot.sound. There was no sorryAx, proof placeholder, or newly declared axiom. This means no unproved holes were added on top of the usual Lean/Mathlib foundations; it does not mean that the proofs are axiom-free. No successful axiom audit is claimed for the extension.
During the 2026 09 08 run, the official Lean executable initially failed to locate itself because this host's process-ID namespace did not match its /proc view. A narrowly scoped compatibility shim maps only the current executable's readlink(/proc/<getpid()>/exe) lookup to /proc/self/exe. Lean's source, mathematical kernel, and proof checks were not changed. The reproduction material records the shim source, binary and source hashes, tool versions, failed intermediate attempts, and final successful log. The shim is unnecessary on a standard host.
With the supplied lean-toolchain and lakefile.toml, standard reproduction is
lake update
lake exe cache get
lake env lean MomentIslands.lean
The 33 added declarations: source candidates, NOT COMPILED
Module
Added declarations
Intended coverage
Execution status
Packing.lean
6
Integer-offset defect bound by finite induction; absolute offset; exclusion of half-valued coordinates; scaled packing
NOT COMPILED
BandSharp.lean
8
The three scalar lower bounds of T2 and their two-coordinate attainment witnesses
NOT COMPILED
FiniteBand.lean
7
Actual finite-vector lower bound, binary padding for attainment in arbitrary dimensions, and a half-valued witness at the T4 threshold
NOT COMPILED
Rounding.lean
12
Nearest binary rounding, preservation of the number of ones, uniqueness of the binary L1 minimizer, and the sharp integer-total error bound
NOT COMPILED
finite_band_gap explicitly receives a partition, indices attaining its extrema, and the boundary ordering. finite_band_attainment uses the finite index type (Fin p ⊕ Unit) ⊕ (Unit ⊕ Fin q) to provide p ones, two boundary entries, and q zeros, with all box and moment conditions in the statement. Transport through a sorting algorithm on a particular Fin n enumeration is not a separate implemented theorem.
The rounding extension includes the sufficient condition ∣S−s∣≤η, D<1/2−η2 for count preservation and absence of ties. Its sharp threshold witness assumes 0≤η≤1/2; it does not claim an optimal threshold for larger tolerances. T3 and T6–T9, including paths, components, face retractions, and higher homotopy, remain outside Lean coverage.
Mathematical derivation, static source inspection, and rational normalization of 13 polynomial identities were completed for the extension. These do not check Lean elaboration, casts, tactic execution, kernel acceptance, or every inequality inference. The package therefore contains 14 historically checked declarations plus 33 uncompiled candidates, not 47 checked theorems.
The embedded source package includes all five mathematical modules, the import module, version pins, reproduction scripts, historical logs, current blocked-status records, and the algebra check. On a standard machine with the official Lean environment available, the added modules are intended to be checked by:
lake update
lake exe cache get
python3 verify.py
The verifier is designed to record PASS only after a successful build and axiom audit; a missing runtime gives BLOCKED, and a failed build gives FAIL. Its successful end-to-end execution has not yet been demonstrated. Source or runner corrections may still be necessary. This HTML contains the sources and records, not the Lean executable or a complete offline Mathlib installation.
60 rational polytopes; 660 critical-value and midpoint checks
PASS (added in this review)
Hole transitions
Six face-complex stages; boundary matrices over F2, including boundary-squared-zero checks
PASS
The scripts use Python's standard-library integer and rational arithmetic. Different checks reuse some samples; these counts must not be added and reported as independent sample counts. Finite checks do not establish a theorem over a continuous domain. The generality comes from the mathematical proofs and, for the stated formal scope, the Lean proofs.
9. Novelty and attribution
This is a research and exposition note with independently derived formulas, not a certified discovery of new mathematics. Correctness, formal verification, and priority are separate questions. The focused additional audit on 2026 09 09 identified more known special cases and narrowed the remaining search. “Not identified” below means that an identical prior statement was not located in this limited search; it is not positive evidence of novelty.
Two findings materially update the earlier edition. Rosenberg–Jakobsson (2008), Theorem 1(ii), already states the sharp maximum-probability bound used in the rounding comparison [R1]. The earlier edition had principally cited that paper's packing lemma and a later explicit description in Rastegin (2023) [R4]. Also, Gorban (2013), §4.2, Fig.4.5, already exhibits newly born isolated components as the feasible set grows [R3]. Neither the probability bound nor that nonmonotonicity phenomenon is claimed as new here.
Result
Current attribution and remaining scope
Packed maximum squared sum at fixed total
The same extremal formula is known [R1–R2]; not a novelty candidate
Rank form of T1 at the first or last boundary, or with integer total
A short consequence of a known bound or elementary aggregation; reductions are given below
Rank form of T1 at an internal boundary with noninteger total
The same general expression was not identified; priority remains unresolved
Their individual priority is unresolved; identifying some rank special cases does not settle all of these statements
T2, T4, and T5
Explicit consequences of T1 and/or known extremal facts; the same particular formulas were not identified, and no separate general principle is claimed
T3, T6, and T9
Applications of known convex-polytope component theory [R3]; priority of the displayed closed formulas remains unresolved
T7 and T8
An explicit face-retraction argument and a concrete higher-homotopy calculation; a component theorem alone does not establish their full homotopy statements
Matrix corollary
Standard transfer through the spectral theorem; vector component counts do not transfer to the full matrix space
Lean material
Evidence about the specified statements and proof scripts, never evidence of bibliographic priority
A known sharp probability bound
For a probability vector p, put H=∑ipi2 and M=maxipi. Rosenberg–Jakobsson's Theorem 1(ii), p.2028, gives, in particular,
M≥21+2H−1,21<H<1.(17)
At H=1, one coordinate is one and the same expression holds. This is an explicit antecedent from 2008, earlier than the checked 2023 statement; first historical priority is not asserted. The following normalizations and aggregations are our comparison arguments, not claims that the cited paper uses X01's notation or application.
First and last rank boundaries reduce to the known bound
For s=1, T1 simplifies exactly to
g12≥2Q−S2.
If S=0, all entries vanish. If 2Q≤S2, the inequality is immediate. Otherwise set pi=xi/S, so H=Q/S2>1/2. Since p(2)≤1−p(1), (17), with the endpoint handled as above, yields
g1=S(p(1)−p(2))≥S(2p(1)−1)≥S2H−1=2Q−S2.
This argument needs only nonnegative entries; their upper bound by one is unnecessary in this special case.
For s=n−1, complement and reorder the entries: yi=1−xi. Then Dy=D, Sy=n−S, and g1(y)=gn−1(x). Moreover,
(Sy−1)2=(S−(n−1))2.
The last-rank case therefore reduces to the first-rank case.
Integer totals and the sharp rounding estimate
If S is an integer different from s, then (S−s)2≥1 and T1 is immediate. If S=s and D≥1/2, it is also immediate. It remains to consider S=s and D<1/2.
Put di=min(xi,1−xi). For any nearest binary rounding z,
i∑∣xi−zi∣=i∑di≤2D<1.
Thus the integer ∑izi−s has absolute value less than one and is zero. If a coordinate were 1/2, changing its rounding alone would produce another nearest rounding with a different total, contradicting the same conclusion. Rounding is therefore unique, and the coordinates rounded to one are exactly the top s coordinates.
The two error families have equal mass
ρ=zi=0∑xi=zi=1∑(1−xi),2ρ<1.
The sum of squares of nonnegative numbers is at most the square of their sum. Applying this separately to both families gives
D=2ρ−zi=0∑xi2−zi=1∑(1−xi)2≥2ρ(1−ρ).
Since 1−2ρ>0, it follows that
1−2ρ≥1−2D,∥x−z∥1=2ρ≤1−1−2D.(16)
Also, gs≥1−2ρ, which proves the integer-total rank inequality. This short calculation does not by itself prove the entire sum-band rounding threshold in T4.
For a further bibliographic correspondence, form p=(1−ρ,(xi)zi=0). Its largest coordinate is 1−ρ, and
H(p)−(1−D)=ρ2−zi=1∑(1−xi)2≥0.
Hence (17) also yields (16). We do not attribute this aggregation or the same rounding formulation to the 2008 paper. The old Lean module verifies the equal-mass squared-sum argument under an explicit equal-mass hypothesis. The new rounding scripts attempt to establish the rounding procedure's preservation and uniqueness properties, but remain uncompiled.
The remaining rank candidate is narrower
After the reductions above, the nontrivial rank form still requiring priority comparison can be restricted to
n≥4,2≤s≤n−2,S∈/Z,2D+(S−s)2<1.
Outside the last condition the rank inequality gives no positive gap certificate. This narrows the search; it does not prove that the remaining case is new or cannot follow shortly from other known inequalities. The signed arbitrary-partition statement and its slack identity require their own comparison.
T2 follows from T1 and the known packed squared-sum bound. Derivability from these ingredients does not establish that the exact three-branch statement was previously published, but it limits any claim of an independent new principle. For T9, the open novelty question concerns the explicit combination k=η(1−η), c=(1−η2)/2, h=1/4, and its binomial component counts, not the general graph reduction or the birth of new components.
What was actually compared, and what remains unread
The audit checked specific results rather than treating similar titles as mathematical equivalence:
Known vertex/edge and level-set reductions, and a known nonmonotone component-count example
The Gorban numbers in this table follow the PDF; the corresponding older HTML numbers are Lemma 4, Proposition 7, and Lemma 14. His component correspondence alone does not establish the higher-homotopy sequence in T8; its face and cell proofs remain necessary. Matching Betti numbers alone is insufficient for that conclusion.
Selected related portions of The Wonderful Geometry of the Vandermonde map, including Lemma 2.12, and Harper's Morse Matchings on a Hypersimplex were also compared [R13–R14]. Ordered-chamber fibers, labeled vectors, and integer hypersimplices must be distinguished. No full survey of those papers' references is claimed.
Important full-text comparisons remain incomplete: Rubensson–Rudberg–Sałek (2008) [R10], Fahmy–Proschan (1981), Schaus–Régin (2014), Kvålseth (2015), and Kobayashi–Tanaka (2025) [R15]. Their abstracts or references do not establish absence of an equivalent theorem. The search covered English terminology from bounded order statistics, trace bounds, density-matrix purification, SPREAD constraints, and polytope complements. It did not exhaust MathSciNet, zbMATH, books, non-English literature, or every citation chain.
An appropriate publication position is therefore an explicit synthesis, derivation, and verification record with unresolved priority for the remaining formulas. Neither a search miss nor a Lean success certifies novelty.
10. References and source roles
These links identify primary sources. The listed reading scope is deliberately narrower than a claim to have audited every theorem in each paper.
[R1] N. A. Rosenberg and M. Jakobsson, The Relationship Between Homozygosity and the Frequency of the Most Frequent Allele, Genetics 179 (2008), 2027–2036. Theorem 1(ii), p.2028, gives the maximum-probability bound; Appendix Lemma 3, p.2032, gives packing. Both and their relevant proofs were inspected. Author-hosted PDF.
[R2] J. L. Ellis, The maximum variance of a finite dataset, given its mean, minimum, and maximum, arXiv:2508.17525v2 (2025). The seven-page preprint was inspected, particularly Theorem 1, pp.4–5, and Example 2, p.6. This citation refers to the audited arXiv version. arXiv PDF.
[R3] A. N. Gorban, Thermodynamic Tree: The Space of Admissible Paths, SIAM Journal on Applied Dynamical Systems 12 (2013), 246–278. Lemma 2.1, p.11; Proposition 2.4, p.13; Lemma 3.2, pp.18–19; §4.2, Fig.4.5, pp.26–27 of the PDF were compared. Source for vertex access, graph and level-set reductions, and a prior example of nonmonotone component counts. Author's arXiv PDF. The HTML version instead numbers those first three statements Lemma 4, Proposition 7, and Lemma 14.
[R4] A. E. Rastegin, Uncertainty relations in terms of generalized entropies derived from information diagrams (2023), Theorem 1, equations (30)–(31). A later explicit description of the high-collision-probability bound, retained for comparison; [R1] provides an older explicit antecedent. arXiv full text.
[R5] A. Goroncy and T. Rychlik, How deviant can you be? The complete solution, Mathematical Inequalities & Applications 9 (2006), 633–647. §2, p.637; §3, Example 2, pp.642–643 inspected. Its domain differs from the externally fixed-box setting. Publisher PDF.
[R6] E. H. Rubensson and A. M. N. Niklasson, arXiv:1302.7292 (2013 preprint), §5.1, equations (13)–(16). Comparison for near-idempotency residuals and eigenvalue estimation. The inspected bounds include ∥A∥F2/TrA≤∥A∥2 for nonzero denominator and exclusion of a central open interval using the residual norm. arXiv PDF.
[R7] A. Ek, A. Schutt, P. J. Stuckey, and G. Tack, Explaining Propagation for Gini and Spread with Variable Mean, CP 2022, LIPIcs 235, 21:1–21:16. §3, Lemmas 3–5 and Algorithm 1, pp.21:4–21:7 inspected beyond the abstract. Official proceedings PDF.
[R8]Parameterless stopping criteria for recursive density matrix expansions, arXiv:1507.02087v3. Introduction, Theorem 1, and the HOMO/LUMO discussion in §6 were inspected as a related source on convergence of idempotency errors. arXiv full text.
[R9] Lean 4.19.0 and Mathlib v4.19.0. Official version records for the proof environment: Lean release and Mathlib tag. The acquired Mathlib source matches commit c44e0c8ee63ca166450922a373c7409c5d26b00b; this is not evidence of a new Lean compilation.
[R10] E. H. Rubensson, E. Rudberg, and P. Sałek, Density matrix purification with rigorous error control, Journal of Chemical Physics 128, 074106 (2008). Bibliography and abstract only; full-text equation comparison remains outstanding.DOI and publisher record.
[R11] H. Wolkowicz and G. P. H. Styan, Bounds for eigenvalues using traces, Linear Algebra and its Applications 29 (1980), 471–506. §2, especially Theorem 2.4, (2.40), p.482, and Theorem 2.5, pp.483–484, inspected. Author-hosted PDF.
[R12] R. Sharma and M. Pal, Note on bounds for eigenvalues using traces, Operators and Matrices 16 (2022), 759–773. Theorem 5, (3.3), p.767, inspected. Publisher PDF.
[R13]The Wonderful Geometry of the Vandermonde map. Selected portions of §2.1, including Lemma 2.12, inspected for connectedness of ordered-chamber power-sum fibers. Publisher full text.
[R14] J. T. Harper, Morse Matchings on a Hypersimplex, arXiv:1211.6483. The integer-hypersimplex face description and the statement and explanation of Theorem 6.11 were compared; the entire matching proof and associated thesis were not audited. arXiv full text.
The immediate review task is to check that each theorem's assumptions, threshold endpoints, and stated formal coverage agree. The Fable review request provides focused questions, while the source package makes the proof scripts and records available from this single HTML file. This edition has not yet received that further review.
For formal verification, the next concrete step is to run the existing 33 extension scripts under the pinned Lean and Mathlib versions, correct any elaboration or proof failures, and retain a fresh build and axiom-audit log. Only then can their status change from NOT COMPILED. The two-segment construction and topological results T3 and T6–T9 still require separate formalization.
T9 classifies path components for every admissible n,s when 1/2<η<1. Mathematical extensions include higher homotopy types in this regime and η≥1, where further integer-sum vertices enter the band. Bibliographic work should concentrate on the remaining internal noninteger-rank case and the unread sources listed above.
This document records exact formulas, ordinary mathematical proofs, known antecedents, historical machine checks, and current uncompiled work. It does not register established academic novelty, alter the previously published E01/E02 ledger, or include the separate triangle-audit candidate X04. Blog publication remains a later decision by Yokota.
INDEPENDENT REVIEW
Fableへの確認依頼Review request for Fable
今回の統合版を渡す際に使える依頼文です。以前受け取ったFableのレビュー原文も資料に残していますが、この版への新しいレビューが済んだという意味ではありません。Use the request below when sharing this edition. The earlier Fable review is preserved, but it is not a new review of this integrated edition.
Please review this self-contained HTML before possible blog publication.
The labels T1–T9 are internal references, not certifications of novelty.
Evidence status
The original 14 declarations in MomentIslands.lean have a preserved successful run dated 2026 09 08; the source hash matches.
The 33 added declarations in Packing.lean, BandSharp.lean, FiniteBand.lean and Rounding.lean are not compiled. Inspection against the pinned Mathlib APIs does not substitute for elaboration or kernel checking.
If Lean is available, use version 4.19.0 and Mathlib commit c44e0c8ee63ca166450922a373c7409c5d26b00b with the included verify.py. Otherwise state that no execution occurred.
Component and homotopy classifications have ordinary mathematical proofs and are outside the Lean-checked scope.
Some exact prior statements remain unidentified; novelty is unconfirmed.
Review priorities
Distinguish T1's arbitrary-partition squared inequality from the square-root version requiring boundary order. Check the nonnegative slack decomposition, equality conditions and stability assumptions.
Check all three branches of T2, including eta=0, eta=1/2 and both defect thresholds, as well as attaining configurations in arbitrary dimensions. Check quantifiers in the bridge from finite vectors to Lean partitions and from padded configurations to ranked gaps.
Check T4's preserved rounded count, uniqueness of the binary L1 minimizer, and the strict threshold. Inspect the topology-free argument in the added code.
Check the assumptions in the polytope/convex-obstacle reduction for T6–T9. T7 includes P itself among closed faces and uses relative boundaries. In T8, distinguish two retractions from a common complement from a direct retraction of the level set onto the face complex.
Check T9 at k=eta(1-eta), c=(1-eta^2)/2 and h=1/4, including c=h, boundary ranks and equality at every threshold.
Check attribution against the 2008 maximum-coordinate bound, the known integer-total and boundary-rank corollaries, and Gorban's example of nonmonotone component counts. Identify any overclaim or closer antecedent, with a precise source and theorem location.
Distinguish scalar eigenvalue bounds from topology of matrix spaces. Ensure finite numerical checks are not presented as proofs over an entire continuous space.
Check that assumptions, conclusions and evidence status agree between the Japanese and English versions.
Requested response
For each finding, give the theorem/section, issue type, evidence or counterexample, and required correction.
Separate mathematical errors, omitted proof steps, Lean implementation errors, attribution, and editorial improvements.
For portions with no issue found, describe the scope actually checked. Do not call a reading review formal verification.
Copy the review request
SOURCES & EVIDENCE
証明と検証記録を、すべて手元に。Keep the proofs and evidence together.
本文・数式・5種類の操作できる図・下のソースは、このHTMLだけで読めます。先行論文を開く場合やLeanの実行環境を取得する場合は通信が必要です。The exposition, formulas, five interactive figures and sources below can be read from this HTML alone. Opening cited papers or installing Lean requires a connection.
検証の区別Evidence boundary
既存14宣言の成功記録は2026 09 08のものです。追加33定理は未コンパイルで、現在の一括検証記録はBLOCKEDです。Mathlibソースの取得・API照合、有限検算、静的点検をLeanの実行成功とは数えていません。The successful original 14-declaration run dates to 2026 09 08. The 33 added candidates remain uncompiled and the current runner reports BLOCKED. Fetching Mathlib source, API inspection, finite checks and static review are not successful Lean execution.
追加コードに用いた、有限和と丸めの証明の接続The finite-sum and rounding bridges used in the added code
These are ordinary mathematical derivations, not a report that the added Lean scripts compiled.
From finite sums. For every integer k, with S=∑xi and D=∑xi(1−xi), prove
(S−k)(1−(S−k))≤D.
Write F(S,D,k)=D−(S−k)(1−(S−k)). Then
F(S+t,D+t(1−t),k)=(1−t)F(S,D,k)+tF(S,D,k−1).
The empty sequence gives F(0,0,k)=k(k+1)≥0. Both weights are nonnegative for 0≤t≤1, so finite induction proves the claim. This is a floor-free route to the classical packing bound.
To the rounded count. Assume 0≤η≤1/2, ∣S−s∣≤η, and D<1/2−η2. Round each coordinate to a nearest binary endpoint, with error di≤1/2. Since di≤2xi(1−xi), the total error is less than one.
If the rounded count differs from s, one side's error mass ρ is at least 1−η, while ρ<1. Apply the finite-sum bound to 2di∈[0,1] on that side, with integer offset k=1. It gives
∑di2≤ρ2−ρ+21,∑di(1−di)≥21−(1−ρ)2≥21−η2.
This contradicts the total defect bound. A half-valued coordinate is excluded by applying packing to the remaining coordinates. This route makes the rounding proof independent of the topological classification.
Thirteen polynomial identities, including those used here, passed exact coefficient normalization. This does not check all inequality inferences, induction, square-root semantics or Lean types.
MomentIslands.lean · 既存14宣言/過去の成功記録ありMomentIslands.lean · original 14 declarations / historical PASS
import Mathlib.Data.Real.Sqrt
import Mathlib.Algebra.Order.BigOperators.Ring.Finset
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.NormNum
import Mathlib.Tactic.Ring
/-!
Formal algebraic core of the moment-islands exploration.
The ambient scalar type is `Real`; these are universal proofs, not grid tests.
The global topological classification is deliberately outside this file.
-/
open scoped BigOperators
namespace MomentIslands
/-- The sharp upper bound on the squared norm of a nonnegative pair. -/
theorem pair_square_upper (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) :
a ^ 2 + b ^ 2 ≤ (a + b) ^ 2 := by
nlinarith [mul_nonneg ha hb]
/-- Applying the same fact to the distances from the upper endpoint. -/
theorem pair_square_upper_complement (a b : ℝ) (ha : a ≤ 1) (hb : b ≤ 1) :
a ^ 2 + b ^ 2 ≤ 1 + (a + b - 1) ^ 2 := by
nlinarith [mul_nonneg (sub_nonneg.mpr ha) (sub_nonneg.mpr hb)]
/-- The four-variable example: partial sum one half forces Q ≤ 3/2. -/
theorem four_variable_gap_bound (a b c d : ℝ)
(ha : 0 ≤ a) (hb : 0 ≤ b) (hc : c ≤ 1) (hd : d ≤ 1)
(hs : a + b + c + d = 2) (ht : a + b = 1 / 2) :
a ^ 2 + b ^ 2 + c ^ 2 + d ^ 2 ≤ 3 / 2 := by
have hab := pair_square_upper a b ha hb
have hcd := pair_square_upper_complement c d hc hd
have hsum : c + d = 3 / 2 := by linarith
rw [ht] at hab
rw [hsum] at hcd
nlinarith
/-- There is no real witness to the article's forbidden partial sum. -/
theorem four_variable_gap (a b c d : ℝ)
(ha : 0 ≤ a) (hb : 0 ≤ b) (hc : c ≤ 1) (hd : d ≤ 1)
(hs : a + b + c + d = 2) (ht : a + b = 1 / 2)
(hq : a ^ 2 + b ^ 2 + c ^ 2 + d ^ 2 = 9 / 5) : False := by
have h := four_variable_gap_bound a b c d ha hb hc hd hs ht
linarith
/-- Finite nonnegative errors on two sides, each summing to rho, obey
the sharp quadratic defect bound D ≥ 2 rho (1-rho). No dimension is fixed. -/
theorem balanced_error_defect {ι κ : Type*} (I : Finset ι) (J : Finset κ)
(u : ι → ℝ) (v : κ → ℝ) (rho : ℝ)
(hu : ∀ i ∈ I, 0 ≤ u i) (hv : ∀ j ∈ J, 0 ≤ v j)
(hsu : ∑ i ∈ I, u i = rho) (hsv : ∑ j ∈ J, v j = rho) :
2 * rho * (1 - rho) ≤
(∑ i ∈ I, u i * (1 - u i)) + ∑ j ∈ J, v j * (1 - v j) := by
have hu2 := Finset.sum_sq_le_sq_sum_of_nonneg hu
have hv2 := Finset.sum_sq_le_sq_sum_of_nonneg hv
rw [hsu] at hu2
rw [hsv] at hv2
have eu : (∑ i ∈ I, u i * (1 - u i)) = rho - ∑ i ∈ I, (u i) ^ 2 := by
calc
_ = ∑ i ∈ I, (u i - (u i) ^ 2) := by
apply Finset.sum_congr rfl
intro i hi
ring
_ = _ := by rw [Finset.sum_sub_distrib, hsu]
have ev : (∑ j ∈ J, v j * (1 - v j)) = rho - ∑ j ∈ J, (v j) ^ 2 := by
calc
_ = ∑ j ∈ J, (v j - (v j) ^ 2) := by
apply Finset.sum_congr rfl
intro j hj
ring
_ = _ := by rw [Finset.sum_sub_distrib, hsv]
rw [eu, ev]
nlinarith
/-- Inversion on the small-error branch. This is the square-root constant
used in the sharp rounding estimate. -/
theorem invert_defect_bound (rho D : ℝ) (hrho : rho ≤ 1 / 2)
(hbound : 2 * rho * (1 - rho) ≤ D) :
rho ≤ (1 - Real.sqrt (1 - 2 * D)) / 2 := by
have hn : 0 ≤ 1 - 2 * rho := by linarith
have hs : 1 - 2 * D ≤ (1 - 2 * rho) ^ 2 := by nlinarith
have hroot : Real.sqrt (1 - 2 * D) ≤ 1 - 2 * rho :=
(Real.sqrt_le_left hn).mpr hs
linarith
/-- Arbitrary finite nonnegative balanced errors satisfy the sharp bound
whenever their common mass is at most one half. -/
theorem balanced_error_sharp_bound {ι κ : Type*} (I : Finset ι) (J : Finset κ)
(u : ι → ℝ) (v : κ → ℝ) (rho D : ℝ)
(hu : ∀ i ∈ I, 0 ≤ u i) (hv : ∀ j ∈ J, 0 ≤ v j)
(hsu : ∑ i ∈ I, u i = rho) (hsv : ∑ j ∈ J, v j = rho)
(hrho : rho ≤ 1 / 2)
(hD : (∑ i ∈ I, u i * (1 - u i)) +
(∑ j ∈ J, v j * (1 - v j)) = D) :
rho ≤ (1 - Real.sqrt (1 - 2 * D)) / 2 := by
apply invert_defect_bound rho D hrho
rw [← hD]
exact balanced_error_defect I J u v rho hu hv hsu hsv
/-- A quantitative near-equality certificate. If a nonnegative vector of
mass rho has a designated maximal entry m, then its missing squared norm
controls all mass outside that entry. -/
theorem concentration_from_square_deficit {ι : Type*} (I : Finset ι)
(u : ι → ℝ) (rho m eps : ℝ)
(hu : ∀ i ∈ I, 0 ≤ u i) (hm : ∀ i ∈ I, u i ≤ m)
(hs : ∑ i ∈ I, u i = rho)
(hgap : rho ^ 2 - ∑ i ∈ I, (u i) ^ 2 ≤ eps) :
rho * (rho - m) ≤ eps := by
have hsq : (∑ i ∈ I, (u i) ^ 2) ≤ m * rho := by
calc
_ ≤ ∑ i ∈ I, m * u i := by
apply Finset.sum_le_sum
intro i hi
nlinarith [mul_nonneg (hu i hi) (sub_nonneg.mpr (hm i hi))]
_ = _ := by rw [← Finset.mul_sum, hs]
nlinarith
/-- Scalar rank-gap core. The hypotheses are aggregated mass and defect
bounds; no claim that they automatically describe a sorted vector is hidden. -/
theorem rank_gap_core (u v sigma rho D e g : ℝ)
(hu : 0 ≤ u) (hv : v ≤ 1)
(hsigma : 1 - u ≤ sigma) (hrho : v ≤ rho)
(hD : u * sigma + (1 - v) * rho ≤ D)
(he : e = rho - sigma) (hg : g = u - v) :
1 ≤ 2 * D + e ^ 2 + g ^ 2 := by
have hpA := mul_nonneg (sub_nonneg.mpr hv) (sub_nonneg.mpr hsigma)
have hpB := mul_nonneg hu (sub_nonneg.mpr hrho)
have hsq := sq_nonneg ((rho - v) - (sigma - (1 - u)))
have hid : 2 * D + e ^ 2 + g ^ 2 - 1 =
2 * (D - (u * sigma + (1 - v) * rho)) +
2 * ((1 - v) * (sigma - (1 - u))) +
2 * (u * (rho - v)) + ((rho - v) - (sigma - (1 - u))) ^ 2 := by
rw [he, hg]
ring
nlinarith
/-- A square-root version, on the nonnegative gap branch. -/
theorem rank_gap_sqrt (D e g : ℝ) (hg : 0 ≤ g)
(h : 1 ≤ 2 * D + e ^ 2 + g ^ 2) :
Real.sqrt (1 - 2 * D - e ^ 2) ≤ g := by
apply (Real.sqrt_le_left hg).mpr
linarith
/-- Near equality forces the mass outside the two boundary coordinates
to be small, with the coefficients and all hypotheses left explicit. -/
theorem rank_gap_slack (u v sigma rho D e g : ℝ)
(hu : 0 ≤ u) (hv : v ≤ 1)
(hsigma : 1 - u ≤ sigma) (hrho : v ≤ rho)
(hD : u * sigma + (1 - v) * rho ≤ D)
(he : e = rho - sigma) (hg : g = u - v) :
2 * (1 - v) * (sigma - (1 - u)) ≤ 2 * D + e ^ 2 + g ^ 2 - 1 ∧
2 * u * (rho - v) ≤ 2 * D + e ^ 2 + g ^ 2 - 1 := by
have hpA := mul_nonneg (sub_nonneg.mpr hv) (sub_nonneg.mpr hsigma)
have hpB := mul_nonneg hu (sub_nonneg.mpr hrho)
have hsq := sq_nonneg ((rho - v) - (sigma - (1 - u)))
have hid : 2 * D + e ^ 2 + g ^ 2 - 1 =
2 * (D - (u * sigma + (1 - v) * rho)) +
2 * ((1 - v) * (sigma - (1 - u))) +
2 * (u * (rho - v)) + ((rho - v) - (sigma - (1 - u))) ^ 2 := by
rw [he, hg]
ring
constructor <;> nlinarith
/-- The rank-gap inequality for arbitrary finite top/rest collections.
`a` is a minimum of the top collection, `b` a maximum of the rest.
Disjointness is not needed for this algebraic statement; a sorted vector's
disjoint partition is a direct specialization. -/
theorem finite_rank_gap {ι : Type*} (I J : Finset ι) (x : ι → ℝ) (a b : ι)
(ha : a ∈ I) (hb : b ∈ J)
(hI : ∀ i ∈ I, 0 ≤ x i ∧ x i ≤ 1)
(hJ : ∀ j ∈ J, 0 ≤ x j ∧ x j ≤ 1)
(hmin : ∀ i ∈ I, x a ≤ x i) (hmax : ∀ j ∈ J, x j ≤ x b) :
1 ≤ 2 * ((∑ i ∈ I, x i * (1 - x i)) +
∑ j ∈ J, x j * (1 - x j)) +
((∑ j ∈ J, x j) - (∑ i ∈ I, (1 - x i))) ^ 2 + (x a - x b) ^ 2 := by
have hsigma : 1 - x a ≤ ∑ i ∈ I, (1 - x i) :=
Finset.single_le_sum (fun i hi => sub_nonneg.mpr (hI i hi).2) ha
have hrho : x b ≤ ∑ j ∈ J, x j :=
Finset.single_le_sum (fun j hj => (hJ j hj).1) hb
have htop : x a * (∑ i ∈ I, (1 - x i)) ≤
∑ i ∈ I, x i * (1 - x i) := by
rw [Finset.mul_sum]
apply Finset.sum_le_sum
intro i hi
exact mul_le_mul_of_nonneg_right (hmin i hi) (sub_nonneg.mpr (hI i hi).2)
have hrest : (1 - x b) * (∑ j ∈ J, x j) ≤
∑ j ∈ J, x j * (1 - x j) := by
rw [Finset.mul_sum]
apply Finset.sum_le_sum
intro j hj
nlinarith [mul_nonneg (hJ j hj).1 (sub_nonneg.mpr (hmax j hj))]
exact rank_gap_core (x a) (x b) _ _ _ _ _
(hI a ha).1 (hJ b hb).2 hsigma hrho (add_le_add htop hrest) rfl rfl
/-- The same bound expressed using the actual total and defect of a finite
vector. For a top-s partition the cardinality of I is exactly s. -/
theorem rank_gap_partition {ι : Type*} [Fintype ι] [DecidableEq ι]
(I : Finset ι) (x : ι → ℝ) (a b : ι)
(ha : a ∈ I) (hb : b ∉ I)
(hbox : ∀ i, 0 ≤ x i ∧ x i ≤ 1)
(hmin : ∀ i ∈ I, x a ≤ x i) (hmax : ∀ j ∉ I, x j ≤ x b) :
1 ≤ 2 * (∑ i, x i * (1 - x i)) +
((∑ i, x i) - (I.card : ℝ)) ^ 2 + (x a - x b) ^ 2 := by
have hb' : b ∈ Iᶜ := by simpa using hb
have hmax' : ∀ j ∈ Iᶜ, x j ≤ x b := by
intro j hj
exact hmax j (by simpa using hj)
have h := finite_rank_gap I Iᶜ x a b ha hb'
(fun i _ => hbox i) (fun j _ => hbox j) hmin hmax'
have htot := I.sum_add_sum_compl x
have hdef := I.sum_add_sum_compl (fun i => x i * (1 - x i))
have hsigma : (∑ i ∈ I, (1 - x i)) = (I.card : ℝ) - ∑ i ∈ I, x i := by
simp only [Finset.sum_sub_distrib, Finset.sum_const, nsmul_eq_mul, mul_one]
have he : (∑ j ∈ Iᶜ, x j) - (∑ i ∈ I, (1 - x i)) =
(∑ i, x i) - (I.card : ℝ) := by
rw [hsigma]
linarith
rwa [hdef, he] at h
/-- The robust separation estimate for the actual finite-vector moments.
The ordering assumption chooses the nonnegative square-root branch. -/
theorem rank_gap_partition_sqrt {ι : Type*} [Fintype ι] [DecidableEq ι]
(I : Finset ι) (x : ι → ℝ) (a b : ι)
(ha : a ∈ I) (hb : b ∉ I)
(hbox : ∀ i, 0 ≤ x i ∧ x i ≤ 1)
(hmin : ∀ i ∈ I, x a ≤ x i) (hmax : ∀ j ∉ I, x j ≤ x b)
(hab : x b ≤ x a) :
Real.sqrt (1 - 2 * (∑ i, x i * (1 - x i)) -
((∑ i, x i) - (I.card : ℝ)) ^ 2) ≤ x a - x b := by
exact rank_gap_sqrt _ _ _ (sub_nonneg.mpr hab)
(rank_gap_partition I x a b ha hb hbox hmin hmax)
end MomentIslands
#print axioms MomentIslands.pair_square_upper
#print axioms MomentIslands.pair_square_upper_complement
#print axioms MomentIslands.four_variable_gap_bound
#print axioms MomentIslands.four_variable_gap
#print axioms MomentIslands.balanced_error_defect
#print axioms MomentIslands.invert_defect_bound
#print axioms MomentIslands.balanced_error_sharp_bound
#print axioms MomentIslands.concentration_from_square_deficit
#print axioms MomentIslands.rank_gap_core
#print axioms MomentIslands.rank_gap_sqrt
#print axioms MomentIslands.rank_gap_slack
#print axioms MomentIslands.finite_rank_gap
#print axioms MomentIslands.rank_gap_partition
#print axioms MomentIslands.rank_gap_partition_sqrt
#check MomentIslands.rank_gap_partition_sqrt
#check MomentIslands.balanced_error_sharp_bound
'MomentIslands.pair_square_upper' depends on axioms: [propext, Classical.choice, Quot.sound]
'MomentIslands.pair_square_upper_complement' depends on axioms: [propext, Classical.choice, Quot.sound]
'MomentIslands.four_variable_gap_bound' depends on axioms: [propext, Classical.choice, Quot.sound]
'MomentIslands.four_variable_gap' depends on axioms: [propext, Classical.choice, Quot.sound]
'MomentIslands.balanced_error_defect' depends on axioms: [propext, Classical.choice, Quot.sound]
'MomentIslands.invert_defect_bound' depends on axioms: [propext, Classical.choice, Quot.sound]
'MomentIslands.balanced_error_sharp_bound' depends on axioms: [propext, Classical.choice, Quot.sound]
'MomentIslands.concentration_from_square_deficit' depends on axioms: [propext, Classical.choice, Quot.sound]
'MomentIslands.rank_gap_core' depends on axioms: [propext, Classical.choice, Quot.sound]
'MomentIslands.rank_gap_sqrt' depends on axioms: [propext, Classical.choice, Quot.sound]
'MomentIslands.rank_gap_slack' depends on axioms: [propext, Classical.choice, Quot.sound]
'MomentIslands.finite_rank_gap' depends on axioms: [propext, Classical.choice, Quot.sound]
'MomentIslands.rank_gap_partition' depends on axioms: [propext, Classical.choice, Quot.sound]
'MomentIslands.rank_gap_partition_sqrt' depends on axioms: [propext, Classical.choice, Quot.sound]
MomentIslands.rank_gap_partition_sqrt.{u_1} {ι : Type u_1} [Fintype ι] [DecidableEq ι] (I : Finset ι) (x : ι → ℝ)
(a b : ι) (ha : a ∈ I) (hb : b ∉ I) (hbox : ∀ (i : ι), 0 ≤ x i ∧ x i ≤ 1) (hmin : ∀ i ∈ I, x a ≤ x i)
(hmax : ∀ j ∉ I, x j ≤ x b) (hab : x b ≤ x a) : √(1 - 2 * ∑ i, x i * (1 - x i) - (∑ i, x i - ↑I.card) ^ 2) ≤ x a - x b
MomentIslands.balanced_error_sharp_bound.{u_1, u_2} {ι : Type u_1} {κ : Type u_2} (I : Finset ι) (J : Finset κ)
(u : ι → ℝ) (v : κ → ℝ) (rho D : ℝ) (hu : ∀ i ∈ I, 0 ≤ u i) (hv : ∀ j ∈ J, 0 ≤ v j) (hsu : ∑ i ∈ I, u i = rho)
(hsv : ∑ j ∈ J, v j = rho) (hrho : rho ≤ 1 / 2) (hD : ∑ i ∈ I, u i * (1 - u i) + ∑ j ∈ J, v j * (1 - v j) = D) :
rho ≤ (1 - √(1 - 2 * D)) / 2
既存ソースの検証記録 JSON · 過去の実行Original verification JSON · historical run
import MomentIslands
open scoped BigOperators
namespace MomentIslands
/-- A floor-free form of the classical packing bound. It holds for every
integer offset, even when the offset is not the floor of the sum. -/
theorem integer_offset_defect {ι : Type*} (I : Finset ι) (x : ι → ℝ)
(k : ℤ) (hbox : ∀ i ∈ I, 0 ≤ x i ∧ x i ≤ 1) :
((∑ i ∈ I, x i) - (k : ℝ)) *
(1 - ((∑ i ∈ I, x i) - (k : ℝ))) ≤
∑ i ∈ I, x i * (1 - x i) := by
classical
revert hbox
induction I using Finset.induction_on generalizing k with
| empty =>
intro hbox
simp only [Finset.sum_empty]
by_cases hk : 0 ≤ k
· have hk' : (0 : ℝ) ≤ (k : ℝ) := by exact_mod_cast hk
nlinarith [mul_nonneg hk' (show 0 ≤ (k : ℝ) + 1 by linarith)]
· have hk1 : k + 1 ≤ 0 := Int.add_one_le_iff.mpr (lt_of_not_ge hk)
have hk1' : (k : ℝ) + 1 ≤ 0 := by exact_mod_cast hk1
nlinarith [mul_nonneg (show 0 ≤ -(k : ℝ) by linarith)
(show 0 ≤ -(k : ℝ) - 1 by linarith)]
| @insert a I ha ih =>
intro hbox
have hI : ∀ i ∈ I, 0 ≤ x i ∧ x i ≤ 1 := by
intro i hi
exact hbox i (Finset.mem_insert_of_mem hi)
have ht := hbox a (Finset.mem_insert_self a I)
have h0 := ih k hI
have h1 := ih (k - 1) hI
rw [Int.cast_sub, Int.cast_one] at h1
have hw0 := mul_le_mul_of_nonneg_left h0 (sub_nonneg.mpr ht.2)
have hw1 := mul_le_mul_of_nonneg_left h1 ht.1
simp only [Finset.sum_insert ha]
nlinarith [hw0, hw1]
/-- The usual sum-of-squares packing inequality, expressed at any integer
offset. Choosing the floor gives its sharp classical form. -/
theorem square_sum_integer_offset {ι : Type*} (I : Finset ι) (x : ι → ℝ)
(k : ℤ) (hbox : ∀ i ∈ I, 0 ≤ x i ∧ x i ≤ 1) :
(∑ i ∈ I, (x i) ^ 2) ≤
(k : ℝ) + ((∑ i ∈ I, x i) - (k : ℝ)) ^ 2 := by
have h := integer_offset_defect I x k hbox
have hD : (∑ i ∈ I, x i * (1 - x i)) =
(∑ i ∈ I, x i) - ∑ i ∈ I, (x i) ^ 2 := by
rw [← Finset.sum_sub_distrib]
apply Finset.sum_congr rfl
intro i hi
ring
rw [hD] at h
nlinarith
/-- The distance to any integer obeys the corresponding defect bound.
Only the range where this distance is at most one is informative. -/
theorem abs_integer_offset_defect {ι : Type*} (I : Finset ι) (x : ι → ℝ)
(k : ℤ) (hbox : ∀ i ∈ I, 0 ≤ x i ∧ x i ≤ 1) :
|(∑ i ∈ I, x i) - (k : ℝ)| *
(1 - |(∑ i ∈ I, x i) - (k : ℝ)|) ≤
∑ i ∈ I, x i * (1 - x i) := by
by_cases h : 0 ≤ (∑ i ∈ I, x i) - (k : ℝ)
· rw [abs_of_nonneg h]
exact integer_offset_defect I x k hbox
· have hn : (∑ i ∈ I, x i) - (k : ℝ) ≤ 0 := le_of_not_ge h
rw [abs_of_nonpos hn]
have hbound := integer_offset_defect I x (k - 1) hbox
rw [Int.cast_sub, Int.cast_one] at hbound
nlinarith
/-- At a half-valued coordinate the defect has the sharp lower bound
1/2 minus the square of the total's offset from any integer. -/
theorem half_coordinate_defect {ι : Type*} [DecidableEq ι]
(I : Finset ι) (x : ι → ℝ) (a : ι) (k : ℤ)
(ha : a ∈ I) (hhalf : x a = 1 / 2)
(hbox : ∀ i ∈ I, 0 ≤ x i ∧ x i ≤ 1) :
1 / 2 - ((∑ i ∈ I, x i) - (k : ℝ)) ^ 2 ≤
∑ i ∈ I, x i * (1 - x i) := by
have h := integer_offset_defect (I.erase a) x (k - 1)
(fun i hi => hbox i (Finset.mem_of_mem_erase hi))
rw [Int.cast_sub, Int.cast_one] at h
have hS := Finset.sum_erase_add I x ha
have hD := Finset.sum_erase_add I (fun i => x i * (1 - x i)) ha
rw [hhalf] at hS hD
nlinarith
/-- Below the half-coordinate barrier no coordinate can equal one half. -/
theorem no_half_below_barrier {ι : Type*} [DecidableEq ι]
(I : Finset ι) (x : ι → ℝ) (k : ℤ) (eta delta : ℝ)
(hbox : ∀ i ∈ I, 0 ≤ x i ∧ x i ≤ 1)
(hmean : |(∑ i ∈ I, x i) - (k : ℝ)| ≤ eta)
(hD : (∑ i ∈ I, x i * (1 - x i)) ≤ delta)
(hdelta : delta < 1 / 2 - eta ^ 2) :
∀ a ∈ I, x a ≠ 1 / 2 := by
intro a ha hhalf
have h := half_coordinate_defect I x a k ha hhalf hbox
have he : ((∑ i ∈ I, x i) - (k : ℝ)) ^ 2 ≤ eta ^ 2 := by
have he0 := abs_nonneg ((∑ i ∈ I, x i) - (k : ℝ))
have hp := mul_nonneg (sub_nonneg.mpr hmean)
(show 0 ≤ eta + |(∑ i ∈ I, x i) - (k : ℝ)| by linarith)
nlinarith [sq_abs ((∑ i ∈ I, x i) - (k : ℝ)), hp]
linarith
/-- If entries lie in [0,1/2] and their total lies in [1-eta,1],
then their defect is at least 1/2-eta^2. This is the scaled packing
inequality used to rule out an incorrect nearest-integer count. -/
theorem half_bounded_mass_defect {ι : Type*} (I : Finset ι)
(d : ι → ℝ) (eta : ℝ)
(hbox : ∀ i ∈ I, 0 ≤ d i ∧ d i ≤ 1 / 2)
(heta : 0 ≤ eta)
(hlower : 1 - eta ≤ ∑ i ∈ I, d i)
(hupper : (∑ i ∈ I, d i) ≤ 1) :
1 / 2 - eta ^ 2 ≤ ∑ i ∈ I, d i * (1 - d i) := by
have h := integer_offset_defect I (fun i => 2 * d i) 1 (by
intro i hi
constructor <;> nlinarith [(hbox i hi).1, (hbox i hi).2])
have hS : (∑ i ∈ I, 2 * d i) = 2 * ∑ i ∈ I, d i := by
rw [Finset.mul_sum]
have hD : (∑ i ∈ I, (2 * d i) * (1 - 2 * d i)) =
4 * (∑ i ∈ I, d i * (1 - d i)) - 2 * ∑ i ∈ I, d i := by
rw [Finset.mul_sum, Finset.mul_sum, ← Finset.sum_sub_distrib]
apply Finset.sum_congr rfl
intro i hi
ring
rw [hS, hD] at h
norm_num only [Int.cast_one] at h
have hsq : ((∑ i ∈ I, d i) - 1) ^ 2 ≤ eta ^ 2 := by
nlinarith [mul_nonneg (show 0 ≤ eta + ((∑ i ∈ I, d i) - 1) by linarith)
(show 0 ≤ eta - ((∑ i ∈ I, d i) - 1) by linarith)]
nlinarith
end MomentIslands
#print axioms MomentIslands.integer_offset_defect
#print axioms MomentIslands.square_sum_integer_offset
#print axioms MomentIslands.abs_integer_offset_defect
#print axioms MomentIslands.half_coordinate_defect
#print axioms MomentIslands.no_half_below_barrier
#print axioms MomentIslands.half_bounded_mass_defect
BandSharp.lean · 8定理候補/未コンパイルBandSharp.lean · 8 candidates / NOT COMPILED
import MomentIslands
/-!
Sharp scalar optimization for the narrow moment band, 0 ≤ eta ≤ 1/2.
The vector-to-scalar reduction is deliberately supplied in a separate file.
Status: candidate Lean 4.19 / mathlib 4.19 source; this addition has NOT
been compiled in the present environment. No axiom or proof placeholder
is introduced. The `#print axioms` commands are instructions for the next
actual run, not a report that this run has already happened.
-/
namespace MomentIslands
/-- The proposed optimal adjacent-gap certificate for the narrow band. -/
noncomputable def bandGap (eta delta : ℝ) : ℝ :=
if delta ≤ eta * (1 - eta) then (1 + Real.sqrt (1 - 4 * delta)) / 2
else if delta ≤ (1 - eta ^ 2) / 2 then Real.sqrt (1 - 2 * delta - eta ^ 2)
else 0
theorem band_small_lower (eta delta a D g : ℝ)
(heta : 0 ≤ eta) (hetaHalf : eta ≤ 1 / 2) (hdelta : 0 ≤ delta)
(ha : 0 ≤ a) (haeta : a ≤ eta)
(hpacking : a * (1 - a) ≤ D) (hD : D ≤ delta)
(hg : 0 ≤ g) (hcore : 1 ≤ 2 * D + a ^ 2 + g ^ 2)
(hsmall : delta ≤ eta * (1 - eta)) :
(1 + Real.sqrt (1 - 4 * delta)) / 2 ≤ g := by
have hrad : 0 ≤ 1 - 4 * delta := by
nlinarith [sq_nonneg (2 * eta - 1)]
have hs := Real.sq_sqrt hrad
have ht := Real.sqrt_nonneg (1 - 4 * delta)
have htone : Real.sqrt (1 - 4 * delta) ≤ 1 := by
apply (Real.sqrt_le_left (by norm_num : (0 : ℝ) ≤ 1)).mpr
linarith
have htbound : Real.sqrt (1 - 4 * delta) ≤ 1 - 2 * a := by
apply (Real.sqrt_le_left (by linarith : 0 ≤ 1 - 2 * a)).mpr
nlinarith
have har : a ≤ (1 - Real.sqrt (1 - 4 * delta)) / 2 := by linarith
have hprod := mul_nonneg (sub_nonneg.mpr har)
(show 0 ≤ (1 - Real.sqrt (1 - 4 * delta)) / 2 + a by linarith)
have hsq : ((1 + Real.sqrt (1 - 4 * delta)) / 2) ^ 2 ≤ g ^ 2 := by
nlinarith
exact (sq_le_sq₀ (by linarith) hg).mp hsq
theorem band_middle_lower (eta delta a D g : ℝ)
(heta : 0 ≤ eta) (ha : 0 ≤ a) (haeta : a ≤ eta)
(hD : D ≤ delta) (hg : 0 ≤ g)
(hcore : 1 ≤ 2 * D + a ^ 2 + g ^ 2) :
Real.sqrt (1 - 2 * delta - eta ^ 2) ≤ g := by
apply (Real.sqrt_le_left hg).mpr
have hprod := mul_nonneg (sub_nonneg.mpr haeta) (add_nonneg heta ha)
nlinarith
/-- Universal scalar lower bound. The packing premise is a separate,
explicit obligation when this theorem is applied to finite vectors. -/
theorem band_gap_lower (eta delta a D g : ℝ)
(heta : 0 ≤ eta) (hetaHalf : eta ≤ 1 / 2) (hdelta : 0 ≤ delta)
(ha : 0 ≤ a) (haeta : a ≤ eta)
(hpacking : a * (1 - a) ≤ D) (hD : D ≤ delta)
(hg : 0 ≤ g) (hcore : 1 ≤ 2 * D + a ^ 2 + g ^ 2) :
bandGap eta delta ≤ g := by
by_cases hsmall : delta ≤ eta * (1 - eta)
· simp only [bandGap, if_pos hsmall]
exact band_small_lower eta delta a D g heta hetaHalf hdelta
ha haeta hpacking hD hg hcore hsmall
· by_cases hmiddle : delta ≤ (1 - eta ^ 2) / 2
· simp only [bandGap, if_neg hsmall, if_pos hmiddle]
exact band_middle_lower eta delta a D g heta ha haeta hD hg hcore
· simpa only [bandGap, if_neg hsmall, if_neg hmiddle] using hg
/-- Two coordinates realize a prescribed error and gap whenever
the elementary box condition g ≤ 1-a holds. -/
theorem pair_realization (a g : ℝ) (ha : 0 ≤ a) (haone : a ≤ 1)
(hg : 0 ≤ g) (hga : g ≤ 1 - a) :
let u := (1 - a + g) / 2
let v := (1 - a - g) / 2
0 ≤ v ∧ v ≤ u ∧ u ≤ 1 ∧ u + v = 1 - a ∧ u - v = g ∧
u * (1 - u) + v * (1 - v) = (1 - a ^ 2 - g ^ 2) / 2 := by
dsimp
constructor
· linarith
constructor
· linarith
constructor
· linarith
constructor
· ring
constructor
· ring
· ring
/-- In the first branch one fractional coordinate suffices, and the
defect constraint is attained exactly. -/
theorem band_small_witness (eta delta : ℝ)
(heta : 0 ≤ eta) (hetaHalf : eta ≤ 1 / 2)
(hdelta : 0 ≤ delta) (hsmall : delta ≤ eta * (1 - eta)) :
let t := Real.sqrt (1 - 4 * delta)
let a := (1 - t) / 2
let u := (1 + t) / 2
0 ≤ a ∧ a ≤ eta ∧ 0 ≤ u ∧ u ≤ 1 ∧
u = 1 - a ∧ u * (1 - u) = delta ∧
u = bandGap eta delta := by
dsimp
have hrad : 0 ≤ 1 - 4 * delta := by
nlinarith [sq_nonneg (2 * eta - 1)]
have hs := Real.sq_sqrt hrad
have ht := Real.sqrt_nonneg (1 - 4 * delta)
have htone : Real.sqrt (1 - 4 * delta) ≤ 1 := by
apply (Real.sqrt_le_left (by norm_num : (0 : ℝ) ≤ 1)).mpr
linarith
have hleta : 1 - 2 * eta ≤ Real.sqrt (1 - 4 * delta) := by
apply (sq_le_sq₀ (by linarith : 0 ≤ 1 - 2 * eta) ht).mp
nlinarith
refine ⟨by linarith, by linarith, by linarith, by linarith, by ring, ?_, ?_⟩
· nlinarith
· simp only [bandGap, if_pos hsmall]
/-- In the middle branch both the sum-band and defect constraints are
attained exactly by two fractional coordinates. -/
theorem band_middle_witness (eta delta : ℝ)
(heta : 0 ≤ eta) (hetaHalf : eta ≤ 1 / 2)
(hfirst : eta * (1 - eta) ≤ delta)
(hmiddle : delta ≤ (1 - eta ^ 2) / 2) :
let g := Real.sqrt (1 - 2 * delta - eta ^ 2)
let u := (1 - eta + g) / 2
let v := (1 - eta - g) / 2
0 ≤ v ∧ v ≤ u ∧ u ≤ 1 ∧ u + v = 1 - eta ∧
u - v = g ∧ u * (1 - u) + v * (1 - v) = delta := by
have hrad : 0 ≤ 1 - 2 * delta - eta ^ 2 := by linarith
have hs := Real.sq_sqrt hrad
have hg := Real.sqrt_nonneg (1 - 2 * delta - eta ^ 2)
have hga : Real.sqrt (1 - 2 * delta - eta ^ 2) ≤ 1 - eta := by
apply (Real.sqrt_le_left (by linarith : 0 ≤ 1 - eta)).mpr
nlinarith
have hp := pair_realization eta (Real.sqrt (1 - 2 * delta - eta ^ 2))
heta (by linarith) hg hga
dsimp at hp ⊢
refine ⟨hp.1, hp.2.1, hp.2.2.1, hp.2.2.2.1, hp.2.2.2.2.1, ?_⟩
nlinarith [hp.2.2.2.2.2]
/-- The zero branch is attained already at its first threshold. -/
theorem band_zero_witness (eta delta : ℝ)
(heta : 0 ≤ eta) (hetaHalf : eta ≤ 1 / 2)
(hlarge : (1 - eta ^ 2) / 2 ≤ delta) :
let u := (1 - eta) / 2
0 ≤ u ∧ u ≤ 1 ∧ u + u = 1 - eta ∧
u * (1 - u) + u * (1 - u) ≤ delta := by
dsimp
refine ⟨by linarith, by linarith, by ring, ?_⟩
nlinarith
/-- Sharpness data for all branches, including every endpoint.
Append s-1 ones and n-s-1 zeroes to obtain an n-coordinate witness. -/
theorem band_gap_witness (eta delta : ℝ)
(heta : 0 ≤ eta) (hetaHalf : eta ≤ 1 / 2) (hdelta : 0 ≤ delta) :
∃ a u v : ℝ, 0 ≤ a ∧ a ≤ eta ∧ 0 ≤ v ∧ v ≤ u ∧ u ≤ 1 ∧
u + v = 1 - a ∧ u * (1 - u) + v * (1 - v) ≤ delta ∧
u - v = bandGap eta delta := by
by_cases hsmall : delta ≤ eta * (1 - eta)
· have h := band_small_witness eta delta heta hetaHalf hdelta hsmall
dsimp at h
refine ⟨(1 - Real.sqrt (1 - 4 * delta)) / 2,
(1 + Real.sqrt (1 - 4 * delta)) / 2, 0,
h.1, h.2.1, le_rfl, h.2.2.1, h.2.2.2.1, ?_, ?_, ?_⟩
· simpa using h.2.2.2.2.1
· simpa using le_of_eq h.2.2.2.2.2.1
· simpa using h.2.2.2.2.2.2
· by_cases hmiddle : delta ≤ (1 - eta ^ 2) / 2
· have h := band_middle_witness eta delta heta hetaHalf
(le_of_lt (lt_of_not_ge hsmall)) hmiddle
dsimp at h
refine ⟨eta, (1 - eta + Real.sqrt (1 - 2 * delta - eta ^ 2)) / 2,
(1 - eta - Real.sqrt (1 - 2 * delta - eta ^ 2)) / 2,
heta, le_rfl, h.1, h.2.1, h.2.2.1, h.2.2.2.1,
le_of_eq h.2.2.2.2.2, ?_⟩
simpa only [bandGap, if_neg hsmall, if_pos hmiddle] using h.2.2.2.2.1
· have h := band_zero_witness eta delta heta hetaHalf
(le_of_lt (lt_of_not_ge hmiddle))
dsimp at h
refine ⟨eta, (1 - eta) / 2, (1 - eta) / 2,
heta, le_rfl, h.1, le_rfl, h.2.1, h.2.2.1, h.2.2.2, ?_⟩
simp only [sub_self, bandGap, if_neg hsmall, if_neg hmiddle]
end MomentIslands
#print axioms MomentIslands.band_gap_lower
#print axioms MomentIslands.band_gap_witness
FiniteBand.lean · 7定理候補/未コンパイルFiniteBand.lean · 7 candidates / NOT COMPILED
import Packing
import BandSharp
import Mathlib
/-!
Draft extension, not compiled in the present environment.
The lower bound uses actual finite-vector moments.
The attainment theorem supplies arbitrarily many binary padding coordinates,
including explicit bounds identifying the two boundary values.
-/
open scoped BigOperators
namespace MomentIslands
theorem finite_band_gap {ι : Type*} [Fintype ι] [DecidableEq ι]
(I : Finset ι) (x : ι → ℝ) (a b : ι) (eta delta : ℝ)
(ha : a ∈ I) (hb : b ∉ I)
(hbox : ∀ i, 0 ≤ x i ∧ x i ≤ 1)
(hmin : ∀ i ∈ I, x a ≤ x i) (hmax : ∀ j ∉ I, x j ≤ x b)
(hab : x b ≤ x a)
(heta : 0 ≤ eta) (hetaHalf : eta ≤ 1 / 2) (hdelta : 0 ≤ delta)
(hmean : |(∑ i, x i) - (I.card : ℝ)| ≤ eta)
(hdefect : (∑ i, x i * (1 - x i)) ≤ delta) :
bandGap eta delta ≤ x a - x b := by
have hcore := rank_gap_partition I x a b ha hb hbox hmin hmax
have hpacking := abs_integer_offset_defect Finset.univ x (I.card : ℤ)
(fun i _ => hbox i)
simp only [Int.cast_natCast] at hpacking
apply band_gap_lower eta delta |(∑ i, x i) - (I.card : ℝ)|
(∑ i, x i * (1 - x i)) (x a - x b)
heta hetaHalf hdelta (abs_nonneg _) hmean hpacking hdefect
(sub_nonneg.mpr hab)
simpa only [sq_abs] using hcore
abbrev PaddedIndex (p q : ℕ) := (Fin p ⊕ Unit) ⊕ (Unit ⊕ Fin q)
def pairPadded (p q : ℕ) (u v : ℝ) : PaddedIndex p q → ℝ :=
Sum.elim (Sum.elim (fun _ => 1) (fun _ => u))
(Sum.elim (fun _ => v) (fun _ => 0))
theorem pairPadded_sum (p q : ℕ) (u v : ℝ) :
(∑ i, pairPadded p q u v i) = (p : ℝ) + u + v := by
simp [pairPadded, Fintype.sum_sum_type] <;> ring
theorem pairPadded_defect (p q : ℕ) (u v : ℝ) :
(∑ i, pairPadded p q u v i * (1 - pairPadded p q u v i)) =
u * (1 - u) + v * (1 - v) := by
simp [pairPadded, Fintype.sum_sum_type]
theorem pairPadded_box (p q : ℕ) (u v : ℝ)
(hv : 0 ≤ v) (hvu : v ≤ u) (hu : u ≤ 1) :
∀ i, 0 ≤ pairPadded p q u v i ∧ pairPadded p q u v i ≤ 1 := by
intro i
rcases i with (i | i) | (i | i)
· simp [pairPadded]
· exact ⟨le_trans hv hvu, hu⟩
· exact ⟨hv, le_trans hvu hu⟩
· simp [pairPadded]
/-- The top block has minimum u and the bottom block has maximum v.
The boundary coordinates themselves occur in the two Unit summands. -/
theorem pairPadded_boundaries (p q : ℕ) (u v : ℝ)
(hv : 0 ≤ v) (hu : u ≤ 1) :
(∀ i : Fin p ⊕ Unit, u ≤ pairPadded p q u v (Sum.inl i)) ∧
(∀ i : Unit ⊕ Fin q, pairPadded p q u v (Sum.inr i) ≤ v) ∧
pairPadded p q u v (Sum.inl (Sum.inr ())) = u ∧
pairPadded p q u v (Sum.inr (Sum.inl ())) = v := by
refine ⟨?_, ?_, rfl, rfl⟩
· intro i
cases i <;> simp [pairPadded, hu]
· intro i
cases i <;> simp [pairPadded, hv]
/-- Arbitrarily many ones and zeros can be appended to the two-coordinate
sharpness witness. The top block has p+1 coordinates and the bottom q+1.
No fixed dimension or finite numerical grid is assumed. -/
theorem finite_band_attainment (p q : ℕ) (eta delta : ℝ)
(heta : 0 ≤ eta) (hetaHalf : eta ≤ 1 / 2) (hdelta : 0 ≤ delta) :
∃ u v : ℝ,
let x := pairPadded p q u v
(∀ i, 0 ≤ x i ∧ x i ≤ 1) ∧
v ≤ u ∧
|(∑ i, x i) - ((p : ℝ) + 1)| ≤ eta ∧
(∑ i, x i * (1 - x i)) ≤ delta ∧
(∀ i : Fin p ⊕ Unit, u ≤ x (Sum.inl i)) ∧
(∀ i : Unit ⊕ Fin q, x (Sum.inr i) ≤ v) ∧
x (Sum.inl (Sum.inr ())) = u ∧
x (Sum.inr (Sum.inl ())) = v ∧
u - v = bandGap eta delta := by
obtain ⟨a, u, v, ha, haeta, hv, hvu, hu, hsum, hD, hgap⟩ :=
band_gap_witness eta delta heta hetaHalf hdelta
have hb := pairPadded_boundaries p q u v hv hu
refine ⟨u, v, ?_⟩
dsimp only
refine ⟨pairPadded_box p q u v hv hvu hu, hvu, ?_, ?_,
hb.1, hb.2.1, hb.2.2.1, hb.2.2.2, hgap⟩
· rw [pairPadded_sum]
have he : (p : ℝ) + u + v - ((p : ℝ) + 1) = -a := by linarith
rw [he, abs_neg, abs_of_nonneg ha]
exact haeta
· rw [pairPadded_defect]
exact hD
/-- At the rounding threshold a genuine half-valued coordinate is already
present. Binary padding gives this witness in every dimension p+q+2.
The total has offset -eta from the integer p+1. -/
theorem finite_rounding_barrier_attainment (p q : ℕ) (eta : ℝ)
(heta : 0 ≤ eta) (hetaHalf : eta ≤ 1 / 2) :
let x := pairPadded p q (1 / 2) (1 / 2 - eta)
(∀ i, 0 ≤ x i ∧ x i ≤ 1) ∧
|(∑ i, x i) - ((p : ℝ) + 1)| = eta ∧
(∑ i, x i * (1 - x i)) = 1 / 2 - eta ^ 2 ∧
x (Sum.inl (Sum.inr ())) = 1 / 2 := by
dsimp only
refine ⟨pairPadded_box p q (1 / 2) (1 / 2 - eta)
(by linarith) (by linarith) (by norm_num), ?_, ?_, rfl⟩
· rw [pairPadded_sum]
have he : (p : ℝ) + 1 / 2 + (1 / 2 - eta) - ((p : ℝ) + 1) = -eta := by
ring
rw [he, abs_neg, abs_of_nonneg heta]
· rw [pairPadded_defect]
ring
end MomentIslands
#print axioms MomentIslands.finite_band_gap
#print axioms MomentIslands.pairPadded_sum
#print axioms MomentIslands.pairPadded_defect
#print axioms MomentIslands.pairPadded_box
#print axioms MomentIslands.pairPadded_boundaries
#print axioms MomentIslands.finite_band_attainment
#print axioms MomentIslands.finite_rounding_barrier_attainment
Rounding.lean · 12定理候補/未コンパイルRounding.lean · 12 candidates / NOT COMPILED
import MomentIslands
import Packing
import Mathlib.Tactic
/-!
Finite-vector nearest-binary rounding. No sortedness hypothesis and no
topological connectedness theorem are needed for the integer-total result.
-/
open scoped BigOperators
namespace MomentIslands
noncomputable def round01 (t : ℝ) : ℝ := by
classical
exact if 1 / 2 < t then 1 else 0
noncomputable def roundedOnes {ι : Type*} [Fintype ι] (x : ι → ℝ) : Finset ι := by
classical
exact Finset.univ.filter (fun i => 1 / 2 < x i)
theorem mem_roundedOnes {ι : Type*} [Fintype ι] (x : ι → ℝ) (i : ι) :
i ∈ roundedOnes x ↔ 1 / 2 < x i := by
classical
simp [roundedOnes]
/-- The chosen rounded value is always binary. -/
theorem round01_binary (t : ℝ) : round01 t = 0 ∨ round01 t = 1 := by
classical
unfold round01
split_ifs <;> simp
/-- The sum of rounded entries is exactly the cardinality of the ones set. -/
theorem sum_round01 {ι : Type*} [Fintype ι] [DecidableEq ι] (x : ι → ℝ) :
(∑ i, round01 (x i)) = ((roundedOnes x).card : ℝ) := by
classical
let I := roundedOnes x
have htop : (∑ i ∈ I, round01 (x i)) = (I.card : ℝ) := by
calc
_ = ∑ _i ∈ I, (1 : ℝ) := by
apply Finset.sum_congr rfl
intro i hi
exact if_pos ((mem_roundedOnes x i).mp hi)
_ = _ := by simp
have hrest : (∑ i ∈ Iᶜ, round01 (x i)) = 0 := by
apply Finset.sum_eq_zero
intro i hi
have hn : i ∉ roundedOnes x := by simpa [I] using hi
exact if_neg (fun h => hn ((mem_roundedOnes x i).mpr h))
have h := I.sum_add_sum_compl (fun i => round01 (x i))
rw [htop, hrest, add_zero] at h
exact h.symm
/-- Off the tie hyperplane, the nearer binary endpoint is unique. -/
theorem round01_unique_nearest (t b : ℝ) (ht : t ≠ 1 / 2)
(hb : b = 0 ∨ b = 1) (hbest : |t - b| ≤ |t - round01 t|) :
b = round01 t := by
classical
unfold round01 at *
split_ifs at * with h
· rcases hb with rfl | rfl
· have ht0 : 0 ≤ t := by linarith
rw [sub_zero, abs_of_nonneg ht0] at hbest
have hab : |t - 1| < t := by
apply abs_lt.mpr
constructor <;> linarith
linarith
· rfl
· have ht' : t < 1 / 2 := by
rcases lt_or_eq_of_le (le_of_not_gt h) with hlt | heq
· exact hlt
· exact (ht heq).elim
rcases hb with rfl | rfl
· rfl
· have ht1 : t - 1 ≤ 0 := by linarith
rw [abs_of_nonpos ht1, sub_zero] at hbest
have hab : |t| < 1 - t := by
apply abs_lt.mpr
constructor <;> linarith
linarith
/-- The error of either nearest endpoint is at most twice the scalar defect. -/
theorem round01_error_le (t : ℝ) (ht0 : 0 ≤ t) (ht1 : t ≤ 1) :
|t - round01 t| ≤ 2 * (t * (1 - t)) := by
classical
unfold round01
split_ifs with h
· rw [abs_of_nonpos (by linarith : t - 1 ≤ 0)]
nlinarith [mul_nonneg (by linarith : 0 ≤ 1 - t) (by linarith : 0 ≤ 2 * t - 1)]
· rw [sub_zero, abs_of_nonneg ht0]
nlinarith [mul_nonneg ht0 (by linarith : 0 ≤ 1 - 2 * t)]
/-- Rounding minimizes distance among the two endpoints, including ties. -/
theorem round01_nearest (t b : ℝ) (hb : b = 0 ∨ b = 1) :
|t - round01 t| ≤ |t - b| := by
classical
unfold round01
split_ifs with h
· rcases hb with rfl | rfl
· rw [sub_zero, abs_of_nonneg (by linarith : 0 ≤ t)]
apply abs_le.mpr
constructor <;> linarith
· exact le_rfl
· rcases hb with rfl | rfl
· exact le_rfl
· rw [sub_zero, abs_of_nonpos (by linarith : t - 1 ≤ 0)]
apply abs_le.mpr
constructor <;> linarith
/-- Without half-valued coordinates the rounded vector is the unique global
l1 minimizer among all binary vectors; no prescribed rank is assumed. -/
theorem round01_l1_unique {ι : Type*} [Fintype ι]
(x z : ι → ℝ) (ht : ∀ i, x i ≠ 1 / 2)
(hz : ∀ i, z i = 0 ∨ z i = 1)
(hbest : (∑ i, |x i - z i|) ≤ ∑ i, |x i - round01 (x i)|) :
z = fun i => round01 (x i) := by
classical
have hd : ∀ i, 0 ≤ |x i - z i| - |x i - round01 (x i)| := by
intro i
exact sub_nonneg.mpr (round01_nearest (x i) (z i) (hz i))
have hsum : (∑ i, (|x i - z i| - |x i - round01 (x i)|)) ≤ 0 := by
rw [Finset.sum_sub_distrib]
linarith
funext i
apply round01_unique_nearest (x i) (z i) (ht i) (hz i)
have hi := Finset.single_le_sum (fun j _ => hd j) (Finset.mem_univ i)
linarith
/-- Integer total below defect one half: rounding preserves the exact total,
has no ambiguous coordinate, and satisfies the sharp l1 error bound. -/
theorem integer_total_rounding {ι : Type*} [Fintype ι] [DecidableEq ι]
(x : ι → ℝ) (s : ℕ)
(hbox : ∀ i, 0 ≤ x i ∧ x i ≤ 1)
(hs : ∑ i, x i = (s : ℝ))
(hD : (∑ i, x i * (1 - x i)) < 1 / 2) :
(roundedOnes x).card = s ∧
(∀ i, x i ≠ 1 / 2) ∧
(∑ i, |x i - round01 (x i)|) ≤
1 - Real.sqrt (1 - 2 * ∑ i, x i * (1 - x i)) := by
classical
let I := roundedOnes x
let sigma : ℝ := ∑ i ∈ I, (1 - x i)
let rho : ℝ := ∑ i ∈ Iᶜ, x i
let D : ℝ := ∑ i, x i * (1 - x i)
have hI : ∀ i ∈ I, 1 / 2 < x i := by
intro i hi
exact (mem_roundedOnes x i).mp hi
have hJ : ∀ i ∈ Iᶜ, x i ≤ 1 / 2 := by
intro i hi
have hn : i ∉ roundedOnes x := by simpa [I] using hi
exact le_of_not_gt (fun h => hn ((mem_roundedOnes x i).mpr h))
have hsigma0 : 0 ≤ sigma :=
Finset.sum_nonneg (fun i _ => sub_nonneg.mpr (hbox i).2)
have hrho0 : 0 ≤ rho := Finset.sum_nonneg (fun i _ => (hbox i).1)
have hsigmadef : sigma = (I.card : ℝ) - ∑ i ∈ I, x i := by
simp [sigma, Finset.sum_sub_distrib]
have hmass : rho - sigma = (s : ℝ) - I.card := by
have ht := I.sum_add_sum_compl x
rw [hs] at ht
rw [hsigmadef]
dsimp [rho]
linarith
have herror : (∑ i, |x i - round01 (x i)|) = sigma + rho := by
rw [← I.sum_add_sum_compl (fun i => |x i - round01 (x i)|)]
apply congrArg₂ (· + ·)
· apply Finset.sum_congr rfl
intro i hi
rw [round01, if_pos (hI i hi), abs_of_nonpos (by linarith [(hbox i).2])]
ring
· apply Finset.sum_congr rfl
intro i hi
rw [round01, if_neg (not_lt.mpr (hJ i hi)), sub_zero,
abs_of_nonneg (hbox i).1]
have herrorD : sigma + rho ≤ 2 * D := by
rw [← herror, D, Finset.mul_sum]
exact Finset.sum_le_sum (fun i _ => round01_error_le (x i) (hbox i).1 (hbox i).2)
have herror1 : sigma + rho < 1 := by dsimp [D] at herrorD; linarith
have hksR : (I.card : ℝ) < (s : ℝ) + 1 := by linarith
have hskR : (s : ℝ) < (I.card : ℝ) + 1 := by linarith
have hks : I.card < s + 1 := by exact_mod_cast hksR
have hsk : s < I.card + 1 := by exact_mod_cast hskR
have hcount : I.card = s := by omega
have hbalanced : sigma = rho := by rw [hcount] at hmass; linarith
have hrhohalf : rho < 1 / 2 := by linarith
have hnotie : ∀ i, x i ≠ 1 / 2 := by
intro i heq
have hi : i ∈ Iᶜ := by
simp only [Finset.mem_compl, I, mem_roundedOnes]
rw [heq]
exact lt_irrefl _
have hsingle : x i ≤ rho := Finset.single_le_sum (fun j _ => (hbox j).1) hi
linarith
have hdef : (∑ i ∈ I, (1 - x i) * (1 - (1 - x i))) +
(∑ i ∈ Iᶜ, x i * (1 - x i)) = D := by
have h := I.sum_add_sum_compl (fun i => x i * (1 - x i))
change _ = ∑ i, x i * (1 - x i)
rw [← h]
congr 1
apply Finset.sum_congr rfl
intro i hi
ring
have hsharp := balanced_error_sharp_bound I Iᶜ (fun i => 1 - x i) x rho D
(fun i _ => sub_nonneg.mpr (hbox i).2) (fun i _ => (hbox i).1)
hbalanced rfl (le_of_lt hrhohalf) hdef
refine ⟨hcount, hnotie, ?_⟩
rw [herror, hbalanced]
change rho + rho ≤ 1 - Real.sqrt (1 - 2 * D)
linarith
/-- In particular, the coordinatewise nearest binary vector is uniquely
specified by the nearest-endpoint inequalities. -/
theorem integer_total_rounding_unique {ι : Type*} [Fintype ι] [DecidableEq ι]
(x z : ι → ℝ) (s : ℕ)
(hbox : ∀ i, 0 ≤ x i ∧ x i ≤ 1)
(hs : ∑ i, x i = (s : ℝ))
(hD : (∑ i, x i * (1 - x i)) < 1 / 2)
(hz : ∀ i, z i = 0 ∨ z i = 1)
(hnear : ∀ i, |x i - z i| ≤ |x i - round01 (x i)|) :
z = fun i => round01 (x i) := by
funext i
exact round01_unique_nearest (x i) (z i)
((integer_total_rounding x s hbox hs hD).2.1 i) (hz i) (hnear i)
/-- The previous theorem also gives uniqueness for a global l1 objective. -/
theorem integer_total_rounding_l1_unique {ι : Type*} [Fintype ι] [DecidableEq ι]
(x z : ι → ℝ) (s : ℕ)
(hbox : ∀ i, 0 ≤ x i ∧ x i ≤ 1)
(hs : ∑ i, x i = (s : ℝ))
(hD : (∑ i, x i * (1 - x i)) < 1 / 2)
(hz : ∀ i, z i = 0 ∨ z i = 1)
(hbest : (∑ i, |x i - z i|) ≤ ∑ i, |x i - round01 (x i)|) :
z = fun i => round01 (x i) := by
exact round01_l1_unique x z (integer_total_rounding x s hbox hs hD).2.1 hz hbest
/-- The robust rounding barrier (T4): an integer-centred total-error band
and defect strictly below 1/2-eta^2 force the nearest binary rank to be s.
This elementary proof uses the packing bound on errors in [0,1/2]. -/
theorem robust_total_rounding {ι : Type*} [Fintype ι] [DecidableEq ι]
(x : ι → ℝ) (s : ℕ) (eta : ℝ)
(hbox : ∀ i, 0 ≤ x i ∧ x i ≤ 1)
(heta : 0 ≤ eta)
(hmean : |(∑ i, x i) - (s : ℝ)| ≤ eta)
(hD : (∑ i, x i * (1 - x i)) < 1 / 2 - eta ^ 2) :
(roundedOnes x).card = s ∧ (∀ i, x i ≠ 1 / 2) := by
classical
let I := roundedOnes x
let sigma : ℝ := ∑ i ∈ I, (1 - x i)
let rho : ℝ := ∑ i ∈ Iᶜ, x i
let D : ℝ := ∑ i, x i * (1 - x i)
have hI : ∀ i ∈ I, 1 / 2 < x i := by
intro i hi
exact (mem_roundedOnes x i).mp hi
have hJ : ∀ i ∈ Iᶜ, x i ≤ 1 / 2 := by
intro i hi
have hn : i ∉ roundedOnes x := by simpa [I] using hi
exact le_of_not_gt (fun h => hn ((mem_roundedOnes x i).mpr h))
have hsigma0 : 0 ≤ sigma :=
Finset.sum_nonneg (fun i _ => sub_nonneg.mpr (hbox i).2)
have hrho0 : 0 ≤ rho := Finset.sum_nonneg (fun i _ => (hbox i).1)
have hsigmadef : sigma = (I.card : ℝ) - ∑ i ∈ I, x i := by
simp [sigma, Finset.sum_sub_distrib]
have hmass : rho - sigma = (∑ i, x i) - I.card := by
have ht := I.sum_add_sum_compl x
rw [hsigmadef]
dsimp [rho]
linarith
have herror : (∑ i, |x i - round01 (x i)|) = sigma + rho := by
rw [← I.sum_add_sum_compl (fun i => |x i - round01 (x i)|)]
apply congrArg₂ (· + ·)
· apply Finset.sum_congr rfl
intro i hi
rw [round01, if_pos (hI i hi), abs_of_nonpos (by linarith [(hbox i).2])]
ring
· apply Finset.sum_congr rfl
intro i hi
rw [round01, if_neg (not_lt.mpr (hJ i hi)), sub_zero,
abs_of_nonneg (hbox i).1]
have herrorD : sigma + rho ≤ 2 * D := by
rw [← herror, D, Finset.mul_sum]
exact Finset.sum_le_sum (fun i _ => round01_error_le (x i) (hbox i).1 (hbox i).2)
have herror1 : sigma + rho < 1 := by
dsimp [D] at herrorD
nlinarith [sq_nonneg eta]
have hdef := I.sum_add_sum_compl (fun i => x i * (1 - x i))
have hdefI0 : 0 ≤ ∑ i ∈ I, x i * (1 - x i) :=
Finset.sum_nonneg (fun i _ => mul_nonneg (hbox i).1 (sub_nonneg.mpr (hbox i).2))
have hdefJ0 : 0 ≤ ∑ i ∈ Iᶜ, x i * (1 - x i) :=
Finset.sum_nonneg (fun i _ => mul_nonneg (hbox i).1 (sub_nonneg.mpr (hbox i).2))
have htopDef : (∑ i ∈ I, (1 - x i) * (1 - (1 - x i))) =
∑ i ∈ I, x i * (1 - x i) := by
apply Finset.sum_congr rfl
intro i hi
ring
have hcount : I.card = s := by
rcases lt_trichotomy I.card s with hlt | heq | hgt
· have hstep : I.card + 1 ≤ s := Nat.succ_le_of_lt hlt
have hstepR : (I.card : ℝ) + 1 ≤ (s : ℝ) := by exact_mod_cast hstep
have hlower : 1 - eta ≤ rho := by
have hm := (abs_le.mp hmean).1
linarith
have hupper : rho ≤ 1 := by linarith
have hpack := half_bounded_mass_defect Iᶜ x eta
(fun i hi => ⟨(hbox i).1, hJ i hi⟩) heta hlower hupper
exact False.elim (by linarith)
· exact heq
· have hstep : s + 1 ≤ I.card := Nat.succ_le_of_lt hgt
have hstepR : (s : ℝ) + 1 ≤ (I.card : ℝ) := by exact_mod_cast hstep
have hlower : 1 - eta ≤ sigma := by
have hm := (abs_le.mp hmean).2
linarith
have hupper : sigma ≤ 1 := by linarith
have hpack := half_bounded_mass_defect I (fun i => 1 - x i) eta
(fun i hi => ⟨sub_nonneg.mpr (hbox i).2, by linarith [hI i hi]⟩)
heta hlower hupper
rw [htopDef] at hpack
exact False.elim (by linarith)
have hmean' : |(∑ i, x i) - ((s : ℤ) : ℝ)| ≤ eta := by simpa using hmean
have hnotie := no_half_below_barrier Finset.univ x (s : ℤ) eta D
(fun i _ => hbox i) hmean' (le_refl _) hD
exact ⟨hcount, fun i => hnotie i (Finset.mem_univ i)⟩
/-- Under the robust barrier the global nearest binary vector is unique. -/
theorem robust_total_rounding_l1_unique {ι : Type*} [Fintype ι] [DecidableEq ι]
(x z : ι → ℝ) (s : ℕ) (eta : ℝ)
(hbox : ∀ i, 0 ≤ x i ∧ x i ≤ 1)
(heta : 0 ≤ eta)
(hmean : |(∑ i, x i) - (s : ℝ)| ≤ eta)
(hD : (∑ i, x i * (1 - x i)) < 1 / 2 - eta ^ 2)
(hz : ∀ i, z i = 0 ∨ z i = 1)
(hbest : (∑ i, |x i - z i|) ≤ ∑ i, |x i - round01 (x i)|) :
z = fun i => round01 (x i) := by
exact round01_l1_unique x z (robust_total_rounding x s eta hbox heta hmean hD).2 hz hbest
end MomentIslands
#print axioms MomentIslands.round01_binary
#print axioms MomentIslands.sum_round01
#print axioms MomentIslands.round01_unique_nearest
#print axioms MomentIslands.round01_error_le
#print axioms MomentIslands.round01_nearest
#print axioms MomentIslands.round01_l1_unique
#print axioms MomentIslands.integer_total_rounding
#print axioms MomentIslands.integer_total_rounding_unique
#print axioms MomentIslands.integer_total_rounding_l1_unique
#print axioms MomentIslands.robust_total_rounding
#print axioms MomentIslands.robust_total_rounding_l1_unique
name = "moment_islands_extension"
version = "0.2.0"
defaultTargets = ["X01"]
[[require]]
name = "mathlib"
git = "https://github.com/leanprover-community/mathlib4.git"
rev = "c44e0c8ee63ca166450922a373c7409c5d26b00b"
[[lean_lib]]
name = "MomentIslands"
[[lean_lib]]
name = "Packing"
[[lean_lib]]
name = "BandSharp"
[[lean_lib]]
name = "FiniteBand"
[[lean_lib]]
name = "Rounding"
[[lean_lib]]
name = "X01"
#!/usr/bin/env python3
"""Replay the Lean development, pin versions, and reject proof placeholders.
No mathematical PASS is emitted without a successful Lean build and axiom audit.
Dependencies must first be installed using the README commands.
"""
from pathlib import Path
import hashlib,json,re,shutil,subprocess,sys
ROOT=Path(__file__).resolve().parent
OUT=ROOT/'run-results'
OUT.mkdir(exist_ok=True)
FILES=['MomentIslands.lean','Packing.lean','BandSharp.lean','FiniteBand.lean','Rounding.lean','X01.lean']
PIN='c44e0c8ee63ca166450922a373c7409c5d26b00b'
ALLOWED={'propext','Classical.choice','Quot.sound'}
record={'status':'NOT_RUN','scope':'Lean build and per-theorem axiom audit',
'expected_lean':'4.19.0','expected_mathlib_commit':PIN,'sources':{},'commands':[]}
theorems=[]
def finish(status,reason,exitcode):
record.update(status=status,reason=reason)
(OUT/'verification.json').write_text(json.dumps(record,ensure_ascii=False,indent=2)+'\n')
print(json.dumps({'status':status,'reason':reason,'theorems':len(theorems)},ensure_ascii=False))
raise SystemExit(exitcode)
for name in FILES:
p=ROOT/name
if not p.is_file(): finish('FAIL','Missing source: '+name,1)
txt=p.read_text()
names=re.findall(r'^(?:theorem|lemma)\s+([A-Za-z_][A-Za-z_0-9]*)',txt,re.M)
theorems.extend('MomentIslands.'+n for n in names)
record['sources'][name]={'sha256':hashlib.sha256(p.read_bytes()).hexdigest(),'theorems':len(names)}
if re.search(r'\b(?:sorry|admit|native_decide)\b',txt) or re.search(r'^\s*(?:axiom|unsafe)\s',txt,re.M):
finish('FAIL','Forbidden proof escape token: '+name,1)
if len(set(theorems))!=len(theorems): finish('FAIL','Duplicate theorem names',1)
record['static_audit']={'theorem_count':len(theorems),'placeholder_tokens':False,'new_axiom_declarations':False}
if not shutil.which('lake') or not shutil.which('lean'):
finish('BLOCKED','Lean/Lake executables are not installed on PATH; no Lean theorem was checked.',2)
def run(args,logname):
try:
r=subprocess.run(args,cwd=ROOT,text=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
except OSError as e: finish('BLOCKED',str(e),2)
(OUT/logname).write_text(r.stdout)
record['commands'].append({'argv':args,'exit_code':r.returncode,'log':logname})
return r
v=run(['lake','env','lean','--version'],'lean-version.log')
if v.returncode or not re.search(r'\bversion 4\.19\.0\b',v.stdout):
finish('FAIL','Lean version is unavailable or does not match 4.19.0.',1)
c=run(['git','-C','.lake/packages/mathlib','rev-parse','HEAD'],'mathlib-commit.log')
if c.returncode or c.stdout.strip()!=PIN:
finish('FAIL','Mathlib checkout does not match the pinned commit; run the documented setup first.',1)
b=run(['lake','build'],'build.log')
if b.returncode: finish('FAIL','Lean build failed; inspect run-results/build.log.',1)
audit='import X01\n'+'\n'.join('#print axioms '+n for n in theorems)+'\n'
(ROOT/'Audit.lean').write_text(audit)
r=run(['lake','env','lean','Audit.lean'],'axioms.log')
if r.returncode: finish('FAIL','Lean axiom query failed.',1)
if 'sorryAx' in b.stdout+r.stdout: finish('FAIL','Lean reports a proof placeholder axiom.',1)
actual={}
for n in theorems:
m=re.search(re.escape("'"+n+"'")+r'\s+depends on axioms:\s*\[([^\]]*)\]',r.stdout,re.S)
if m:
ax={a.strip() for a in m.group(1).split(',') if a.strip()}
elif re.search(re.escape("'"+n+"'")+r'\s+does not depend on any axioms',r.stdout):
ax=set()
else: finish('FAIL','Missing axiom result for '+n,1)
actual[n]=sorted(ax)
if not ax<=ALLOWED: finish('FAIL','Unexpected axioms for '+n+': '+str(sorted(ax-ALLOWED)),1)
record['axioms']=actual
finish('PASS','Every listed theorem compiled under the pinned versions and passed the axiom audit.',0)
# X01 — formal proof development checkpoint / 形式証明の追加作業
Date / 日付: 2026 09 09
**New code status: NOT COMPILED. 追加した証明コードは Lean 実行未確認です。**
This package contains 33 new theorem statements with proof scripts, plus the
unchanged 14-theorem original module. The 14 original declarations have a
preserved successful run from 2026 09 08. That historical run does not cover the
new modules and is not a fresh run in this environment.
追加分について実施したのは数学的導出、独立の静的点検、13個の有理係数多項式恒等式の
正規化検査です。Lean の構文・型・タクティク・カーネル検査は実行できていません。
追加公理や証明の穴を宣言して穴埋めするコードは入れていませんが、それだけで
コンパイル成功や形式証明の完成を意味しません。
## Why execution is blocked / 実行できなかった理由
Lean, Lake and Elan are absent from the current environment.
An attempt to fetch the official Lean 4.19.0 release ended with:
"network approval was cancelled before a decision was returned".
No successful download or new Lean compilation was recorded.
No alternate mirror or access-control workaround was used.
After the user explicitly authorized a retry, the Lean release download
returned the same cancellation. The pinned Mathlib source checkout succeeded
and matches c44e0c8ee63ca166450922a373c7409c5d26b00b.
That source checkout enables API inspection, but supplies neither the Lean
runtime nor compiled dependencies. See retry-record.json.
明示的な再試行の許可後もLean取得は同じエラーで停止しました。
一方、Mathlibの固定版ソースは取得でき、使用APIとの照合に利用しました。
ソース取得をLean検証成功とは扱いません。
## Added scope / 追加した範囲
- Packing.lean: finite induction for the integer-offset defect bound;
absolute integer offset; exclusion of half-valued coordinates; scaled packing.
- BandSharp.lean: all three scalar branches of T2 and their two-coordinate witnesses.
- FiniteBand.lean: actual finite-vector lower bound, arbitrary-dimensional padded
attainment witnesses, and a half-valued witness at the T4 rounding threshold.
- Rounding.lean: nearest 0/1 rounding, cardinality preservation, unique global
binary L1 minimizer, and the sharp integer-total L1 error estimate.
finite_band_gap makes the partition, attained extrema and their ordering explicit.
finite_band_attainment uses the index type
(Fin p ⊕ Unit) ⊕ (Unit ⊕ Fin q), with p+1 upper and q+1 lower coordinates.
It proves the box, moments and boundary ordering for arbitrary p and q.
Transport to a particular sorted Fin n enumeration is not implemented as an
additional sorting-algorithm theorem.
robust_total_rounding proves a sufficient condition with eta >= 0:
|S-s| <= eta and D < 1/2-eta^2 imply the rounded cardinality is s and no tie occurs.
The threshold witness assumes 0 <= eta <= 1/2. No optimal threshold for wider
eta is claimed.
Theorems about path components and higher homotopy (T3, T6–T9), the complete
equality classification and full stability statement are not newly formalized
in this package. Priority and novelty are not questions settled by Lean.
## Main mathematical step / 有限和をつなぐ核
For any finite x_i in [0,1] and any integer k, define S=sum x_i and
D=sum x_i(1-x_i). Then
(S-k)(1-(S-k)) <= D.
Write F(S,D,k)=D-(S-k)(1-(S-k)).
For a new coordinate t in [0,1],
F(S+t, D+t(1-t), k)
= (1-t) F(S,D,k) + t F(S,D,k-1).
The empty-vector case is F(0,0,k)=k(k+1)>=0 for integer k.
Both weights are nonnegative, so finite induction gives the result.
This is a floor-free proof of a classical packing bound, not a novelty claim.
For rounding, an incorrect count forces an error mass rho >= 1-eta on one side.
Each error is in [0,1/2]; D<1/2-eta^2 implies rho<1.
The scaled packing inequality gives that side's defect >=1/2-(1-rho)^2
>=1/2-eta^2, a contradiction. This avoids a dependency on topology.
## Reproduce with a standard Lean installation / 再現手順
Use the [official Lean installation instructions](https://lean-lang.org/install/).
Then, in the directory containing these files:
lake update
lake exe cache get
python3 verify.py
Lean is pinned to 4.19.0, and Mathlib to commit
c44e0c8ee63ca166450922a373c7409c5d26b00b.
The verifier checks both versions, runs lake build, queries every theorem's
axioms and records logs and source SHA-256 hashes in run-results/.
Only propext, Classical.choice and Quot.sound are allowed.
Missing runtime is BLOCKED, proof/build failure is FAIL, and only a completed
build plus axiom audit can produce PASS.
The included verification record is BLOCKED, because no Lean runtime exists.
The full Lean runner itself has not yet been exercised against a successful
installation; its setup/build steps may require ordinary corrections.
## Optional exact algebra check / 補助的な恒等式検査
python3 algebra_check.py
This uses rational coefficient normalization without external Python packages.
It checks only the 13 listed polynomial identities.
It does not check all inequality inferences, finite induction, casts, square-root
semantics or Lean proofs, and is not a replacement proof assistant.
## Historical evidence / 過去の記録
historical/ contains the original verification JSON and Lean output for the
unchanged MomentIslands.lean, preserved separately from the current result.
They must not be presented as evidence that the extension compiled.
#!/usr/bin/env python3
"""Exact rational polynomial identity checks; NOT a Lean/proof-kernel substitute."""
from fractions import Fraction as F
import json
from pathlib import Path
class P:
def __init__(self, terms=0):
self.d = terms if isinstance(terms, dict) else ({():F(terms)} if terms else {})
self.d = {m:F(c) for m,c in self.d.items() if c}
def __add__(self, other):
o=poly(other); r=dict(self.d)
for m,c in o.d.items(): r[m]=r.get(m,F(0))+c
return P(r)
__radd__=__add__
def __neg__(self): return P({m:-c for m,c in self.d.items()})
def __sub__(self,other): return self+-poly(other)
def __rsub__(self,other): return poly(other)+-self
def __mul__(self,other):
o=poly(other); r={}
for m,c in self.d.items():
for n,d in o.d.items():
z=tuple(sorted(m+n)); r[z]=r.get(z,F(0))+c*d
return P(r)
__rmul__=__mul__
def __truediv__(self,n): return self*F(1,n)
def __pow__(self,n):
assert isinstance(n,int) and n>=0
r=P(1)
for _ in range(n): r=r*self
return r
def poly(x): return x if isinstance(x,P) else P(x)
def V(name): return P({(name,):F(1)})
S,D,k,t,a,g,eta,delta,rho,Q=[V(s) for s in 'S D k t a g eta delta rho Q'.split()]
def deficit(S,D,k): return D-(S-k)*(1-S+k)
checks=[]
def check(name,lhs,rhs):
diff=poly(lhs)-poly(rhs)
checks.append({'name':name,'passed':not diff.d,
'nonzero_coefficients':{str(m):str(c) for m,c in diff.d.items()}})
check('packing_induction_affine_identity',
deficit(S+t,D+t*(1-t),k),
(1-t)*deficit(S,D,k)+t*deficit(S,D,k-1))
check('packing_base_integer_product',deficit(0,0,k),k*(k+1))
check('packing_negative_offset',deficit(S,D,k-1),D-(k-S)*(1-(k-S)))
check('half_coordinate_barrier',
deficit(S-F(1,2),D-F(1,4),k-1),D-F(1,2)+(S-k)**2)
u=(1-a+g)/2; v=(1-a-g)/2
check('pair_sum',u+v,1-a)
check('pair_gap',u-v,g)
check('pair_defect',u*(1-u)+v*(1-v),(1-a*a-g*g)/2)
b=(1-t)/2; w=(1+t)/2
check('first_branch_defect_mod_root',w*(1-w)-delta,(1-4*delta-t*t)/4)
check('first_branch_bound_mod_root',1-2*delta-b*b-w*w,(1-4*delta-t*t)/2)
check('first_branch_endpoint_order',1-4*delta-(1-2*eta)**2,4*(eta*(1-eta)-delta))
check('middle_branch_box_order',(1-eta)**2-(1-2*delta-eta*eta),2*(delta-eta*(1-eta)))
check('half_scaled_packing',2*rho-4*Q-(2*rho-1)*(2-2*rho),4*(rho*rho-rho+F(1,2)-Q))
check('rounding_barrier_attainment',
F(1,4)+(F(1,2)-eta)*(F(1,2)+eta),F(1,2)-eta*eta)
record={'status':'PASS' if all(c['passed'] for c in checks) else 'FAIL',
'scope':'Exact rational coefficient normalization of listed polynomial identities only.',
'not_checked':['Lean parsing/elaboration/kernel','inequality inference','finite induction validity',
'integer casts','sqrt branch semantics','topology','novelty'],
'checks':checks}
out=Path(__file__).resolve().parent/'algebra-check.json'
out.write_text(json.dumps(record,ensure_ascii=False,indent=2)+'\n')
print(json.dumps({'status':record['status'],'identities':len(checks),
'scope':record['scope']},ensure_ascii=False))
raise SystemExit(record['status']!='PASS')
# 統合時の限定的な数学点検 / Limited integration review
2026 09 09
T1・T2・T4、T7の面収縮、T8の臨界値を含むホモトピー型、T9の頂点・辺と閾値等号を読んだ範囲で、
実質的な反例や証明の欠落は同定しなかった。全文の認証・新しいLean実行・学術的優先権の確認ではない。
反映した小修正:
- T2で S=s−a の端数は a>0 なら1−a、a=0なら0と明記。
- T7の閉面にはP自身を含む。∂Fはaff F内の相対境界と明記。
A limited read of T1, T2, T4, the face retraction in T7, critical levels in T8,
and vertices/edges/threshold equality in T9 found no substantive counterexample
or missing proof step. This is not full certification, a fresh Lean run or a priority audit.
Small corrections incorporated:
- In T2, the fractional part of S=s-a is 1-a for a>0, and 0 for a=0.
- In T7, closed faces include P itself and the boundary is relative to aff F.
ZIPを利用しなくても、上の各ソースを開いて読んだり個別に保存できます。一括ZIP内のhistorical-v1.1は過去の資料です。Lean本体やコンパイル済みMathlibは含みません。The individual sources can be inspected and saved without using ZIP. The historical-v1.1 directory in the complete bundle contains older material. A Lean runtime and compiled Mathlib are not included.