Proof Atlas.

arXiv:2603.07435v4 · local manuscript and PDF · thm:four

Four-symbol rate and variance

Automated comparison found no discrepancy

How the statements compare

The two descriptions give the same parity-group optimization and the same distortion-selected operating point. The key comparison is between the paper’s class probabilities and the word prior used in Lean.

Case-by-case comparison
CasePaperChecked Lean statementWhy
Allocation within one parity
not classified
Mass wᵢ is the positive part of sᵢ/η−L/k. Positive weights form a prefix; at zero group mass the first prefix sets η.PaperGroup uses c=L/k, the same maximum over prefix sums and wᵢ=max(0,sᵢ/η−c). It distributes wᵢ across the words in its class.Substituting c gives exactly the clipping formula. At m=0 the first (largest) class sets the multiplier and all allocated weights are zero.
Choosing θ and u
not classified
Choose θ from the endpoint derivative signs or an interior root. At fixed weights the derivative in u gives 4D.The formal statement gives the one-sided derivative G at the endpoints and an optimizing θ. It supplies a selected u and θ for each interior D, with weights held fixed in the derivative.The derivative in θ selects the parity split. The derivative in u enforces the Hamming-cost constraint. Keeping the two derivatives separate yields the paper’s operating equation.
Rate, variance and threshold
not classified
The rate uses class normalizers, the variance is a pair sum, and a class at a support change has zero mass and column value one.The formal joint attains cost 4D. The display theorem turns the word-score variance into the same class pair sum. The threshold predicate uses limits from zero- and positive-weight optima.Members of a class share a normalizer, so their probabilities add in the variance. The two-sided threshold condition captures an actual support change.

Scope of the conclusion

The four-symbol statement works for 0 < p < 1/2 and 0 < D < 1/2. Its threshold condition identifies what happens at a change; determining entry or exit uses the neighboring allocations.

Paper theorem

For a stationary symmetric chain with 0 < p < 1/2 and 0 < D < 1/2, the complement-and-reversal classes are ordered by decreasing source probability within each parity. Even representatives 0000, 0011, 0110, 0101 have probabilities (1 − p)³, p(1 − p)², p²(1 − p), p³. Odd representatives 0001, 0010 have probabilities 2p(1 − p)², 2p²(1 − p). At trial 0 < u < 1 let m_E = θ and m_O = 1 − θ be the group masses. Put α = (1 + u⁴)/2, β = (u + u³)/2, χ = u², k_E = α − χ, k_O = k_E/2, and L_g = χm_g + β(1 − m_g). In each group g let Sⱼ be the sum of its first j source probabilities. The group multiplier η_g is the maximum of Sⱼ/(m_g + jL_g/k_g) over all nonempty prefixes. Each class i in group g has optimal mass wᵢ = max(0, sᵢ/η_g − L_g/k_g) and normalizer Zᵢ = L_g + k_g wᵢ. The classes with positive mass form a prefix. When m_g = 0, the maximum occurs at j = 1, η_g = s₁k_g/L_g using the first probability in this group, and all its masses are zero. This supplies the one-sided derivative for an empty group. Write T_g for the sum of sᵢ/Zᵢ in group g. The derivative of the optimized objective Σᵢ sᵢ ln Zᵢ with respect to θ is G(θ) = η_E − η_O + (χ − β)(T_E − T_O). Choose θ = 0 if G(0) ≤ 0, θ = 1 if G(1) ≥ 0, and a root of G otherwise. With that allocation, choose u so that 4D equals u times the sum over all classes of sᵢ(L′_g + k′_g wᵢ)/Zᵢ, holding θ and all wᵢ fixed in the derivatives. These conditions determine the optimum. The rate is R₄(4D) = 4D log₂ u − Σᵢ sᵢ log₂ Zᵢ, and V₄(4D) is the sum of sᵢsⱼ[log₂(Zᵢ/Zⱼ)]² over i < j. At a support threshold a class has zero mass and column value one. The allocations on either side show whether it enters or leaves.

Paper lines 345–366 (statement). Source probabilities and normalizers at 262–276, 314–327, and 336–343.

Original manuscript passage
\begin{theorem}[Four-symbol rate and variance]\label{thm:four}
For $0<D<1/2$, the rate and variance are
\[
 R_4(4D)=4D\log_2u-\sum_i s_i\log_2Z_i,\qquad V_4(4D)=\Vfun(s,Z).
\]
Here $Z_i$ is given by \eqref{eq:fourz}, with the class probabilities in Table~\ref{tab:four} listed in decreasing order within each parity group. At multiplier $u$ and total even mass $\theta$, let $\eta_g$ be the multiplier for the mass constraint in group $g$. This multiplier and the optimal class masses are
\begin{equation}
 \eta_g=\max_{1\le j\le |g|}\frac{\sum_{i=1}^j s_{g,i}}{m_g+jL_g/k_g},\qquad
 w_{g,i}=[s_{g,i}/\eta_g-L_g/k_g]_+,                          \label{eq:water}
\end{equation}
where $[z]_+=\max(0,z)$. Within each group, the active classes are the first $j$ in decreasing order of source probability, with $j$ equal to the number of positive masses. At $m_g=0$ the maximum in \eqref{eq:water} is attained at $j=1$, so $\eta_g=s_{g,1}k_g/L_g$ and all $w_{g,i}=0$. This supplies the one-sided derivative for an empty group at either endpoint. After optimizing those masses, the derivative of the objective $\sum_i s_i\ln Z_i$ with respect to $\theta$ is
\begin{equation}
 G(\theta)=\eta_E-\eta_O+(\chi_u-\beta_u)
      \left(\sum_{i\in E}\frac{s_i}{Z_i}-\sum_{i\in O}\frac{s_i}{Z_i}\right).
                                                                     \label{eq:G}
\end{equation}
Concavity gives the maximizer at $\theta=0$ if $G(0)\le0$, at $\theta=1$ if $G(1)\ge0$, and at a root $G(\theta)=0$ otherwise. With this allocation at each trial $u$, choose $u$ to satisfy the distortion equation
\begin{equation}
 4D=u\sum_{g}\sum_{i\in g}s_i\frac{L_g'+k_g'w_i}{Z_i},          \label{eq:fourD}
\end{equation}
where primes differentiate in $u$ with $\theta,w_i$ held fixed. These conditions determine the optimum at each $u$. At a threshold a class mass is zero and its column value equals one. The allocations on either side determine whether the class enters or leaves.
\end{theorem}

What Lean proved

Mathematical reading of the audited Lean statement

For a stationary symmetric binary Markov four-word source P with flip probability 0<p<1/2, partition the 16 words into six classes. In index order, representatives are 0000,0011,0110,0101,0001,0010 with their bit complements and reversals. The four even-weight classes have two words apiece and source masses ((1−p)³,p(1−p)²,p²(1−p),p³). The two odd-weight classes have four words apiece and masses (2p(1−p)²,2p²(1−p)). The source masses sᵢ are nonincreasing within each group. For a six-class reproduction vector w, the word prior Q divides wᵢ equally among class i. For Hamming distance d, write Zᵢ(u,w)=ΣᵧQ(y)u^{d(x,y)} for x in class i. • There exist common allocation and multiplier functions w(u,θ), e(u,θ), o(u,θ). For each 0<u<1 and 0≤θ≤1, even and odd totals are θ and 1−θ. Put b=(u+u³)/2, k=(1+u⁴)/2−u². In a group with total m, use kᵢ=k for even and kᵢ=k/2 for odd, with B=u²m+b(1−m), c=B/kᵢ. Its multiplier η (e or o) is positive and equals the maximum over nonempty prefixes of (prefix sum of source masses)/(m+prefix length·c). The weights wᵢ=max(0,sᵢ/η−c) sum to m. Positive entries form the initial segment of length equal to their count. If m=0, the first prefix realizes the maximum, η=s_first/c and all group entries are zero. Zᵢ=B+kᵢwᵢ. The joined vector maximizes Σᵢsᵢln Zᵢ among simplex vectors with even mass θ. • For fixed u, let F(θ) be this optimized objective and rᵢ=sᵢ/Zᵢ. Set G(θ)=e−o+(u²−b)(Σ_even rᵢ−Σ_odd rᵢ). This is the derivative of F within [0,1], including the endpoint one-sided derivatives. For all θ,t∈[0,1], F(t)≤F(θ)+G(θ)(t−θ). At least one θ satisfies the selection rule θ=0 with G≤0, θ=1 with G≥0, or G=0. At every such θ the allocation is the unique global maximizer over the six-class simplex. • For every 0<D<1/2 there exist 0<u<1 and a selected θ for which these same weights yield the normalizers above. Holding w fixed, B′=2um+(1+3u²)(1−m)/2 and kᵢ′=(2u³−2u)/(|class i|/2) are the derivatives in u. Then 4D=uΣᵢsᵢ(B′+kᵢ′wᵢ)/Zᵢ, with each B′ evaluated for class i. The joint P(x)Q(y)u^{d(x,y)}/Z_class(x) attains cost 4D and minimizes mutual information over all joints with source P and cost ≤4D. Its information in bits per block is 4D log₂u−Σᵢsᵢlog₂Zᵢ. Its tilted variance Var_P[4D log₂u−log₂Z_class(X)] equals Var_s[−log₂Zᵢ]. • On the graph of globally maximizing (u,w) with 0<u<1, suppose a graph point belongs both to the closure of points with wᵢ=0 and to the closure of points with wᵢ>0. At that point wᵢ=0 and the same class-normalizer operator applied to r gives Zᵢ(u,r)=1. The additional display holds for all real p,D, every u>0 and every nonnegative w of sum one. The weighted central second moment Var_P[4D log₂u−log₂Z_class(X)] equals Σᵢ<ⱼ sᵢsⱼ[log₂(Zᵢ/Zⱼ)]². This identity includes vectors outside the optimizing graph.

BlockHierarchy/PairVariance/FourStatement.lean lines 7 (FourFullStatement); BlockHierarchy/Four/PaperStatement.lean lines 14–86 (PaperGroup, PaperAllocation, PaperParity, PaperPoint, PaperThresholds, FourSymbolStatement); BlockHierarchy/PairVariance/Statement.lean lines 9–10,18–21 (pairSum, FourDisplayStatement); BlockHierarchy/Four/Classes.lean lines 7–45,87–109 (orbits, source, prior, class kernel); BlockHierarchy/Four/WaterClasses.lean lines 8–25 and BlockHierarchy/Four/WaterFilling.lean lines 8–10 (prefix and clipping); BlockHierarchy/Four/Maximizer.lean lines 12–13 (objective); BlockHierarchy/Four/ParityOptimality.lean lines 6–10,60–61 and BlockHierarchy/Four/ParityChoice.lean lines 8–9 (affine formula, parity slope and selection); BlockHierarchy/Four/Distortion.lean lines 8–11 (derivatives); BlockHierarchy/Four/Channel.lean lines 24,62–63 (ratio, classTiltVariance); BlockHierarchy/FiniteRD.lean lines 8–18 (Optimal, joint)

Paper PDF · Lean source and verification evidence

Inspect the exact Lean statement and definitions
BlockHierarchy.PairVariance.FourFullStatement · BlockHierarchy/PairVariance/FourStatement.lean L6
/-- The complete numbered theorem together with its displayed pairwise-variance formula. -/
def FourFullStatement : Prop := Four.FourSymbolStatement ∧ FourDisplayStatement
BlockHierarchy.Channel.cost · FiniteChannel.lean L17
def cost (d J : X → Y → ℝ) : ℝ := ∑ x, ∑ y, J x y * d x y
BlockHierarchy.Channel.info · FiniteChannel.lean L13
/-- Mutual information in nats, expressed in terms of the joint mass and marginals. -/
noncomputable def info (P : X → ℝ) (q : Y → ℝ) (J : X → Y → ℝ) : ℝ :=
  ∑ x, ∑ y, J x y * (Real.log (J x y) - Real.log (P x) - Real.log (q y))
BlockHierarchy.FiniteRD.Optimal · BlockHierarchy/FiniteRD.lean L8
def Optimal (P : X → ℝ) (q : Y → ℝ) (d : X → Y → ℕ) (J : X → Y → ℝ) (b : ℝ) : Prop :=
  (∀ x y, 0 ≤ J x y) ∧ (∀ x, ∑ y, J x y = P x) ∧ (∀ y, ∑ x, J x y = q y) ∧
  Channel.cost (fun x y => (d x y : ℝ)) J ≤ b ∧
  ∀ t L, (∀ x y, 0 ≤ L x y) → (∀ x, ∑ y, L x y=P x) → (∀ y, ∑ x, L x y=t y) →
    Channel.cost (fun x y => (d x y : ℝ)) L ≤ b → Channel.info P q J ≤ Channel.info P t L
BlockHierarchy.FiniteRD.joint · BlockHierarchy/FiniteRD.lean L17
noncomputable def joint (P Z : X → ℝ) (q : Y → ℝ) (d : X → Y → ℕ) (u : ℝ) (x : X) (y : Y) :=
  q y * kernel P Z d u x y
BlockHierarchy.FiniteRD.kernel · BlockHierarchy/FiniteRD.lean L14
noncomputable def kernel (P Z : X → ℝ) (d : X → Y → ℕ) (u : ℝ) (x : X) (y : Y) :=
  P x/Z x * u^(d x y)
BlockHierarchy.Four.Class · BlockHierarchy/Four/Classes.lean L8
abbrev Class := Fin 6
BlockHierarchy.Four.FourSymbolStatement · BlockHierarchy/Four/PaperStatement.lean L73
/-- Theorem 4 of arXiv:2603.07435v4. The same allocation and multipliers
serve the parity optimization and the prescribed-distortion calculation. -/
def FourSymbolStatement : Prop :=
  ∀ p : ℝ, 0 < p → p < 1/2 →
    (∀ i j, i≤j → j<4 → evenS p j ≤ evenS p i) ∧
    (∀ i j, i≤j → j<2 → oddS p j ≤ oddS p i) ∧
    ∃ (w : ℝ → ℝ → Class → ℝ) (e o : ℝ → ℝ → ℝ),
      (∀ u ∈ Ioo (0:ℝ) 1, ∀ θ ∈ Icc (0:ℝ) 1,
        PaperAllocation p u θ (e u θ) (o u θ) (w u θ)) ∧
      (∀ u ∈ Ioo (0:ℝ) 1, PaperParity p u (w u) (e u) (o u)) ∧
      (∀ D ∈ Ioo (0:ℝ) (1/2), ∃ u ∈ Ioo (0:ℝ) 1, ∃ θ ∈ Icc (0:ℝ) 1,
        ParityChoice (fun t => paritySlope u (ratio p u (w u t)) (e u t) (o u t)) θ ∧
        PaperPoint p D u (w u θ)) ∧
      PaperThresholds p
BlockHierarchy.Four.PaperAllocation · BlockHierarchy/Four/PaperStatement.lean L21
/-- One trial (u,θ). The two group totals are fixed. The active classes, the
normalizers, and global optimality among allocations on this parity slice
all concern the same six-component vector. -/
def PaperAllocation (p u θ e o : ℝ) (w : Class → ℝ) : Prop :=
  let cE := base u θ/kE u
  let cO := base u (1-θ)/(kE u/2)
  PaperGroup (evenS p) 4 θ cE e ∧ PaperGroup (oddS p) 2 (1-θ) cO o ∧
  w=join (WaterFilling.clipped (evenS p) e cE) (WaterFilling.clipped (oddS p) o cO) ∧
  w ∈ paritySlice θ ∧ oddMass w=1-θ ∧
  (∀ i, Z u w i=baseline u w i+coefficient u i*w i) ∧
  IsMaxOn (objective p u) (paritySlice θ) w
BlockHierarchy.Four.PaperGroup · BlockHierarchy/Four/PaperStatement.lean L11
/-- Equations (water) for one parity group. Indices start at zero. The number
of positive masses determines the support without a tie-breaking convention
for a maximizing prefix. At zero mass the first prefix attains the maximum. -/
def PaperGroup (s : ℕ → ℝ) (n : ℕ) (m c η : ℝ) : Prop :=
  let w := WaterFilling.clipped s η c
  PrefixMaximum s n m c η ∧ 0 < η ∧
  (∑ i ∈ Finset.range n, w i)=m ∧
  (∀ i < n, 0 < w i ↔ i < ((Finset.range n).filter (fun j => 0 < w j)).card) ∧
  (m=0 → η=s 0/c ∧ ∀ i < n, w i=0)
BlockHierarchy.Four.PaperParity · BlockHierarchy/Four/PaperStatement.lean L33
/-- Equation (G) for the optimized value, including the interior derivative
and the one-sided derivatives at both endpoints. Every endpoint or interior
root selected by the derivative rule is a global maximizer. -/
def PaperParity (p u : ℝ) (w : ℝ → Class → ℝ) (e o : ℝ → ℝ) : Prop :=
  let G := fun θ => paritySlope u (ratio p u (w θ)) (e θ) (o θ)
  let F := fun θ => objective p u (w θ)
  (∀ θ ∈ Icc (0:ℝ) 1, HasDerivWithinAt F (G θ) (Icc 0 1) θ) ∧
  (∀ θ ∈ Icc (0:ℝ) 1, ∀ t ∈ Icc (0:ℝ) 1, F t ≤ F θ+G θ*(t-θ)) ∧
  (∃ θ ∈ Icc (0:ℝ) 1, ParityChoice G θ) ∧
  (∀ θ ∈ Icc (0:ℝ) 1, ParityChoice G θ →
    IsMaxOn (objective p u) (stdSimplex ℝ Class) (w θ) ∧
    ∀ v ∈ stdSimplex ℝ Class, IsMaxOn (objective p u) (stdSimplex ℝ Class) v → v=w θ)
BlockHierarchy.Four.PaperPoint · BlockHierarchy/Four/PaperStatement.lean L46
/-- Equations (fourD) and the four-symbol rate and variance at the same
achieving channel. Optimality is against every joint law on the 16 words.
The two derivatives hold the six reproduction masses fixed. -/
def PaperPoint (p D u : ℝ) (w : Class → ℝ) : Prop :=
  let z := fun x => Z u w (orbit x)
  let J := FiniteRD.joint (source p) z (prior w) distance u
  (∀ x, (∑ y, prior w y*u^distance x y)=z x) ∧
  (∀ i, HasDerivAt (fun t => baseline t w i) (baselineD u w i) u ∧
        HasDerivAt (fun t => coefficient t i) (coefficientD u i) u) ∧
  4*D=u*∑ i, sourceClasses p i*((baselineD u w i+coefficientD u i*w i)/Z u w i) ∧
  Channel.cost (fun x y => (distance x y : ℝ)) J=4*D ∧
  FiniteRD.Optimal (source p) (prior w) distance J (4*D) ∧
  Channel.info (source p) (prior w) J/Real.log 2 =
    4*D*logTwo u - ∑ i, sourceClasses p i*logTwo (Z u w i) ∧
  variance (source p) (fun x => 4*D*logTwo u-logTwo (z x))=classTiltVariance p u w
BlockHierarchy.Four.PaperThresholds · BlockHierarchy/Four/PaperStatement.lean L62
/-- A support threshold is approached on the optimal graph by active and
inactive allocations. This treats entry and exit symmetrically and allows
either direction as the multiplier increases. -/
def PaperThresholds (p : ℝ) : Prop :=
  let S : Set (ℝ × (Class → ℝ)) := {t | t.1 ∈ Ioo 0 1 ∧ t.2 ∈ stdSimplex ℝ Class ∧
    IsMaxOn (objective p t.1) (stdSimplex ℝ Class) t.2}
  ∀ i : Class, ∀ t ∈ S,
    t ∈ closure {x | x ∈ S ∧ x.2 i=0} →
    t ∈ closure {x | x ∈ S ∧ 0<x.2 i} →
    t.2 i=0 ∧ Z t.1 (ratio p t.1 t.2) i=1
BlockHierarchy.Four.ParityChoice · BlockHierarchy/Four/ParityChoice.lean L8
def ParityChoice (G : ℝ → ℝ) (θ : ℝ) : Prop :=
  (θ=0 ∧ G θ≤0) ∨ (θ=1 ∧ 0≤G θ) ∨ G θ=0
BlockHierarchy.Four.WaterClasses.PrefixMaximum · BlockHierarchy/Four/WaterClasses.lean L23
def PrefixMaximum (s : ℕ → ℝ) (n : ℕ) (m c r : ℝ) : Prop :=
  ∃ k, 1 ≤ k ∧ k ≤ n ∧ r=WaterFilling.ratio s m c k ∧
    (∀ j, 1≤j → j≤n → WaterFilling.ratio s m c j≤r) ∧ (m=0 → k=1)
BlockHierarchy.Four.WaterClasses.base · BlockHierarchy/Four/WaterClasses.lean L19
noncomputable def base (u m : ℝ) := u^2*m+(u+u^3)/2*(1-m)
BlockHierarchy.Four.WaterClasses.evenS · BlockHierarchy/Four/WaterClasses.lean L8
noncomputable def evenS (p : ℝ) : ℕ → ℝ
  | 0 => (1-p)^3
  | 1 => p*(1-p)^2
  | 2 => p^2*(1-p)
  | _ => p^3
BlockHierarchy.Four.WaterClasses.join · BlockHierarchy/Four/WaterClasses.lean L20
noncomputable def join (e o : ℕ → ℝ) (i : Class) :=
  if evenGroup i then e i.val else o (i.val-4)
BlockHierarchy.Four.WaterClasses.kE · BlockHierarchy/Four/WaterClasses.lean L18
noncomputable def kE (u : ℝ) := (1+u^4)/2-u^2
BlockHierarchy.Four.WaterClasses.oddS · BlockHierarchy/Four/WaterClasses.lean L14
noncomputable def oddS (p : ℝ) : ℕ → ℝ
  | 0 => 2*p*(1-p)^2
  | _ => 2*p^2*(1-p)
BlockHierarchy.Four.WaterFilling.clipped · BlockHierarchy/Four/WaterFilling.lean L10
def clipped (s : ℕ → ℝ) (r c : ℝ) (i : ℕ) := max 0 (s i/r-c)
BlockHierarchy.Four.WaterFilling.pref · BlockHierarchy/Four/WaterFilling.lean L8
def pref (s : ℕ → ℝ) (n : ℕ) := ∑ i ∈ Finset.range n, s i
BlockHierarchy.Four.WaterFilling.ratio · BlockHierarchy/Four/WaterFilling.lean L9
def ratio (s : ℕ → ℝ) (m c : ℝ) (j : ℕ) := pref s j/(m+(j:ℝ)*c)
BlockHierarchy.Four.Word · BlockHierarchy/Four/Classes.lean L7
abbrev Word := Bool × Three.Word
BlockHierarchy.Four.Z · BlockHierarchy/Four/Classes.lean L105
noncomputable def Z (u : ℝ) := classKernel (fun d => u^d)
BlockHierarchy.Four.baseline · BlockHierarchy/Four/ParityOptimality.lean L6
noncomputable def baseline (u : ℝ) (a : Class → ℝ) (i : Class) :=
  u^2*groupMass a i+((u+u^3)/2)*otherMass a i
BlockHierarchy.Four.baselineD · BlockHierarchy/Four/Distortion.lean L8
noncomputable def baselineD (u : ℝ) (w : Class → ℝ) (i : Class) :=
  2*u*groupMass w i + ((1+3*u^2)/2)*otherMass w i
BlockHierarchy.Four.cardinal · BlockHierarchy/Four/Classes.lean L32
def cardinal (i : Class) : ℝ := if evenGroup i then 2 else 4
BlockHierarchy.Four.classKernel · BlockHierarchy/Four/Classes.lean L93
noncomputable def classKernel (f : ℕ → ℝ) (w : Class → ℝ) (i : Class) :=
  f 2*groupMass w i+((f 1+f 3)/2)*otherMass w i+
  (((f 0+f 4)/2-f 2)/(cardinal i/2))*w i
BlockHierarchy.Four.classTiltVariance · BlockHierarchy/Four/Channel.lean L62
noncomputable def classTiltVariance (p u : ℝ) (w : Class → ℝ) :=
  variance (sourceClasses p) (fun i => -logTwo (Z u w i))
BlockHierarchy.Four.coefficient · BlockHierarchy/Four/ParityOptimality.lean L9
noncomputable def coefficient (u : ℝ) (i : Class) :=
  (((1+u^4)/2-u^2)/(cardinal i/2))
BlockHierarchy.Four.coefficientD · BlockHierarchy/Four/Distortion.lean L11
noncomputable def coefficientD (u : ℝ) (i : Class) := (2*u^3-2*u)/(cardinal i/2)
BlockHierarchy.Four.distance · BlockHierarchy/Four/Classes.lean L36
def distance (x y : Word) := (if x.1=y.1 then 0 else 1)+Three.hamming x.2 y.2
BlockHierarchy.Four.evenGroup · BlockHierarchy/Four/Classes.lean L29
def evenGroup (i : Class) : Prop := i.val < 4
BlockHierarchy.Four.evenMass · BlockHierarchy/Four/ParityOptimality.lean L16
noncomputable def evenMass (w : Class → ℝ) := w 0+w 1+w 2+w 3
BlockHierarchy.Four.groupMass · BlockHierarchy/Four/Classes.lean L87
def groupMass (w : Class → ℝ) (i : Class) :=
  if evenGroup i then w 0+w 1+w 2+w 3 else w 4+w 5
BlockHierarchy.Four.instDecidableEvenGroup · BlockHierarchy/Four/Classes.lean L30
instance (i : Class) : Decidable (evenGroup i) := inferInstanceAs (Decidable (i.val < 4))
BlockHierarchy.Four.objective · BlockHierarchy/Four/Maximizer.lean L12
noncomputable def objective (p u : ℝ) (w : Class → ℝ) :=
  ∑ i, sourceClasses p i * Real.log (Z u w i)
BlockHierarchy.Four.oddMass · BlockHierarchy/Four/ParityOptimality.lean L17
noncomputable def oddMass (w : Class → ℝ) := w 4+w 5
BlockHierarchy.Four.orbit · BlockHierarchy/Four/Classes.lean L10
/-- In each parity group the order agrees with the source probabilities in Table 1. -/
def orbit : Word → Class
  | (false,false,false,false) => 0
  | (false,false,false,true) => 4
  | (false,false,true,false) => 5
  | (false,false,true,true) => 1
  | (false,true,false,false) => 5
  | (false,true,false,true) => 3
  | (false,true,true,false) => 2
  | (false,true,true,true) => 4
  | (true,false,false,false) => 4
  | (true,false,false,true) => 2
  | (true,false,true,false) => 3
  | (true,false,true,true) => 5
  | (true,true,false,false) => 1
  | (true,true,false,true) => 5
  | (true,true,true,false) => 4
  | (true,true,true,true) => 0
BlockHierarchy.Four.otherMass · BlockHierarchy/Four/Classes.lean L90
def otherMass (w : Class → ℝ) (i : Class) :=
  if evenGroup i then w 4+w 5 else w 0+w 1+w 2+w 3
BlockHierarchy.Four.paritySlice · BlockHierarchy/Four/Maximizer.lean L39
def paritySlice (θ : ℝ) :=
  (stdSimplex ℝ Class) ∩ {w | w 0+w 1+w 2+w 3=θ}
BlockHierarchy.Four.paritySlope · BlockHierarchy/Four/ParityOptimality.lean L58
/-- Moving one unit of mass from the odd to the even group yields the
difference of the two group multipliers, including the baseline terms. -/
noncomputable def paritySlope (u : ℝ) (a : Class → ℝ) (ηE ηO : ℝ) :=
  ηE-ηO+(u^2-(u+u^3)/2)*(evenMass a-oddMass a)
BlockHierarchy.Four.prior · BlockHierarchy/Four/Classes.lean L34
noncomputable def prior (w : Class → ℝ) (y : Word) := w (orbit y)/cardinal (orbit y)
BlockHierarchy.Four.ratio · BlockHierarchy/Four/Channel.lean L24
noncomputable def ratio (p u : ℝ) (w : Class → ℝ) (i : Class) := sourceClasses p i / Z u w i
BlockHierarchy.Four.source · BlockHierarchy/Four/Classes.lean L35
noncomputable def source (p : ℝ) (x : Word) := Three.step p x.1 x.2.1 * Three.markov p x.2
BlockHierarchy.Four.sourceClasses · BlockHierarchy/Four/Classes.lean L38
def sourceClasses (p : ℝ) (i : Class) : ℝ :=
  match i.val with
  | 0 => (1-p)^3
  | 1 => p*(1-p)^2
  | 2 => p^2*(1-p)
  | 3 => p^3
  | 4 => 2*p*(1-p)^2
  | _ => 2*p^2*(1-p)
BlockHierarchy.PairVariance.FourDisplayStatement · BlockHierarchy/PairVariance/Statement.lean L18
def FourDisplayStatement : Prop :=
  ∀ (p D u : ℝ) (w : Four.Class → ℝ), 0<u → (∀ i, 0≤w i) → (∑ i, w i)=1 →
    variance (Four.source p) (fun x => 4*D*logTwo u-logTwo (Four.Z u w (Four.orbit x))) =
      pairSum (Four.sourceClasses p) (Four.Z u w)
BlockHierarchy.PairVariance.pairSum · BlockHierarchy/PairVariance/Statement.lean L7
/-- Equation (pairvar) in arXiv:2603.07435v4. Each unordered pair of distinct
classes occurs once, with the square of its log-ratio in bits. -/
noncomputable def pairSum {I : Type*} [Fintype I] [LinearOrder I]
    (s Z : I → ℝ) := ∑ i, ∑ j ∈ Finset.univ.filter (i < ·), s i*s j*(logTwo (Z i/Z j))^2
BlockHierarchy.Three.Word · BlockHierarchy/Three/Classes.lean L8
abbrev Word := Bool × Bool × Bool
BlockHierarchy.Three.hamming · BlockHierarchy/Three/Classes.lean L13
def hamming (x y : Word) : ℕ :=
  (if x.1 = y.1 then 0 else 1) + (if x.2.1 = y.2.1 then 0 else 1) +
  (if x.2.2 = y.2.2 then 0 else 1)
BlockHierarchy.Three.markov · BlockHierarchy/Three/Classes.lean L24
noncomputable def markov (p : ℝ) (x : Word) : ℝ :=
  (1/2) * step p x.1 x.2.1 * step p x.2.1 x.2.2
BlockHierarchy.Three.step · BlockHierarchy/Three/Classes.lean L22
def step (p : ℝ) (a b : Bool) := if a = b then 1-p else p
BlockHierarchy.logTwo · ReducedPair/Moments.lean L8
noncomputable def logTwo (p : ℝ) := Real.log p / Real.log 2
BlockHierarchy.mean · ReducedPair/Moments.lean L10
noncomputable def mean {X : Type*} [Fintype X] (P f : X → ℝ) := ∑ x, P x*f x
BlockHierarchy.variance · ReducedPair/Moments.lean L12
noncomputable def variance {X : Type*} [Fintype X] (P f : X → ℝ) :=
  ∑ x, P x*(f x-mean P f)^2

Next action · Author (optional)
Review the comparison whenever convenient.

To respond, ask your agent to open the local review dashboard for this paper.