Formalization: Exact Randomized Designs for Two-Block Interference Experiments

The complete Lean development behind this paper — every definition, lemma, and theorem of its module, including helpers the paper text never cites. Identifiers link within this page, into the Causalean library, or out to the official Mathlib docs.

Basic 45 declarations All certificates live on the reduced triangle T_m in the spectral coordinates (x,y,z) produced by lem:block-spectral-coordinates; the objective there is the linear-plus-weighted-Frobenius form phi.

Environment S2 — reduced spectral-coordinate world (real objective geometry)

All certificates live on the reduced triangle T_m in the spectral coordinates (x,y,z) produced by lem:block-spectral-coordinates; the objective there is the linear-plus-weighted-Frobenius form phi. These are the shared reduced primitives.

def qParam

Reduced multiplicity weight q = 2(m-1) (block-contrast eigenspace multiplicity; a derived constant, NOT the core tradeoff ratio r).

Definition (Lean source)
def qParam (m : ℕ) : ℝ := 2 * ((m : ℝ) - 1)
def InReducedTriangle

The reduced triangle T_m = {x,y,z ≥ 0 : q x + y + z = 2m}. @realizes X(u,v)(reduced coordinates x,y,z on T_m)

Definition (Lean source)
def InReducedTriangle (m : ℕ) (x y z : ℝ) : Prop := 0 ≤ x ∧ 0 ≤ y ∧ 0 ≤ z ∧ qParam m * x + y + z = 2 * (m : ℝ)
CausalSmith.Experimentation.DesignPm1.InReducedTriangle · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:49
def reducedObjective

The reduced objective φ(x,y,z) = c_x x + c_y y + c_z z + κ √(q x² + y² + z²). @realizes F_{r,kappa}(X)(reduced form c_x x + c_y y + c_z z + κ‖·‖) @realizes kappa(carrier ℝ; robustness weight on the Frobenius term κ√(q x²+y²+z²); range [0,∞) pinned by the 0 ≤ kappa premises threaded through the consuming theorems/lemmas)

Definition (Lean source)
noncomputable def reducedObjective (q cx cy cz kappa x y z : ℝ) : ℝ := cx * x + cy * y + cz * z + kappa * sqrt (q * x ^ 2 + y ^ 2 + z ^ 2)
CausalSmith.Experimentation.DesignPm1.reducedObjective · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:54
def cX

Reduced linear coefficient on x: c_x = q((a+b) + r/(a+b)). @realizes F_{r,kappa}(X)(c_x = q((a+b)+r/(a+b))) @realizes r(carrier ℝ; tradeoff ratio entering c_x via the r/(a+b) term) @realizes a(within-block weight in a+b and r/(a+b)) @realizes b(cross-block weight in a+b and r/(a+b))

Definition (Lean source)
noncomputable def cX (m : ℕ) (a b r : ℝ) : ℝ := qParam m * ((a + b) + r / (a + b))
def cY

Reduced linear coefficient on y: c_y = 2b + r/(2b). @realizes F_{r,kappa}(X)(c_y = 2b + r/(2b)) @realizes r(carrier ℝ; tradeoff ratio entering c_y via the r/(2b) term) @realizes b(cross-block weight in 2b and r/(2b))

Definition (Lean source)
noncomputable def cY (b r : ℝ) : ℝ := 2 * b + r / (2 * b)
def cZ

Reduced linear coefficient on z: c_z = 2m. @realizes F_{r,kappa}(X)(c_z = 2m)

Definition (Lean source)
def cZ (m : ℕ) : ℝ := 2 * (m : ℝ)
def parityThreshold

Parity feasibility threshold d_m = 0 (m even), 2/m (m odd).

Definition (Lean source)
noncomputable def parityThreshold (m : ℕ) : ℝ := if Even m then 0 else 2 / (m : ℝ)
CausalSmith.Experimentation.DesignPm1.parityThreshold · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:78
def frobeniusNorm

Frobenius (Schatten-2) norm ‖X‖_{S_2} = √(∑ᵢⱼ Xᵢⱼ²). @realizes F_{r,kappa}(X)(κ‖X‖_{S_2}, Frobenius norm)

Definition (Lean source)
noncomputable def frobeniusNorm {ι : Type*} [Fintype ι] (X : Matrix ι ι ℝ) : ℝ := sqrt (∑ i, ∑ j, (X i j) ^ 2)
def allOnesMatrix

The all-ones matrix J_n = 1_n 1_nᵀ. @realizes J_n(all-ones matrix)

Definition (Lean source)
def allOnesMatrix (m : ℕ) : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ := of fun _ _ => 1
def signVec

The community sign vector s_m (+1 on block A_m = {i : i < m}, −1 on B_m). @realizes s_m(sign vector +1 on A_m, −1 on B_m)

Definition (Lean source)
def signVec (m : ℕ) : Fin (2 * m) → ℝ := fun i => if i.val < m then 1 else -1
def onesProj

Orthogonal projection onto span 1_n, i.e. J_n / n.

Definition (Lean source)
noncomputable def onesProj (m : ℕ) : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ := of fun _ _ => (1 : ℝ) / (2 * (m : ℝ))
def signProj

Orthogonal projection onto span s_m, i.e. s_m s_mᵀ / n.

Definition (Lean source)
noncomputable def signProj (m : ℕ) : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ := of fun i j => signVec m i * signVec m j / (2 * (m : ℝ))
def blockSymMatrix

The block-symmetric matrix X(u,v): diagonal 1, common within-block off-diagonal entry u, common across-block entry v. @realizes X(u,v)(diag 1, within-block u, across-block v)

Definition (Lean source)
def blockSymMatrix (m : ℕ) (u v : ℝ) : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ := of fun i j => if i = j then 1 else if (decide (i.val < m) = decide (j.val < m)) then u else v

The weighted two-block homophily adjacency W: a/m within a block, b/m across blocks, 0 on the diagonal. @realizes G_m(a,b)(within-block a/m, across-block b/m, diag 0) @realizes a(within-block edge weight a/m; range 0<b<a pinned by TwoBlockHomophily) @realizes b(cross-block edge weight b/m; range 0<b pinned by TwoBlockHomophily) @realizes A_m, B_m(two communities via block membership i.val < m, |A_m|=|B_m|=m)

Definition (Lean source)
noncomputable def twoBlockGraph (m : ℕ) (a b : ℝ) : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ := of fun i j => if i = j then 0 else if (decide (i.val < m) = decide (j.val < m)) then a / (m : ℝ) else b / (m : ℝ)
def twoBlockLaplacian

The graph Laplacian L_m = D − W of the two-block graph (D the degree diagonal). @realizes L_m(graph Laplacian of G_m(a,b))

Definition (Lean source)
noncomputable def twoBlockLaplacian (m : ℕ) (a b : ℝ) : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ := of fun i j => if i = j then (∑ k, twoBlockGraph m a b i k) else - twoBlockGraph m a b i j
CausalSmith.Experimentation.DesignPm1.twoBlockLaplacian · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:123
def twoBlockLaplacianPinv

The Moore–Penrose pseudoinverse L_m^†, realized by its spectral action: eigenvalues 1/(a+b) on the block-contrast subspace, 1/(2b) on span s_m, 0 on span 1_n (the only way it is consumed downstream). @realizes L_m^dagger(pseudoinverse via spectral action 1/(a+b), 1/(2b), 0)

Definition (Lean source)
noncomputable def twoBlockLaplacianPinv (m : ℕ) (a b : ℝ) : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ := (1 / (a + b)) • ((1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) - onesProj m - signProj m) + (1 / (2 * b)) • signProj m
CausalSmith.Experimentation.DesignPm1.twoBlockLaplacianPinv · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:129
def cutCovariance

The cut covariance X_cut = s_m s_mᵀ. @realizes X_cut(s_m s_mᵀ)

Definition (Lean source)
def cutCovariance (m : ℕ) : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ := of fun i j => signVec m i * signVec m j
def spreadCovariance

The spread covariance X_spread with reduced coordinates (m/(m-1), 0, 0) (the u = -1/(m-1), v = 0 block-symmetric point).

Definition (Lean source)
noncomputable def spreadCovariance (m : ℕ) : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ := blockSymMatrix m (-1 / ((m : ℝ) - 1)) 0
CausalSmith.Experimentation.DesignPm1.spreadCovariance · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:143

The normalized design objective F_{r,κ}(X) = Tr(L_m X) + r Tr(L_m^† X) + κ ‖X‖_{S_2} + Tr(J_n X). @realizes F_{r,kappa}(X)(Tr(L_m X) + r Tr(L_m^† X) + κ‖X‖ + Tr(J_n X)) @realizes r(carrier ℝ; homophily tradeoff weight on the r * Tr(L^† X) term) @realizes kappa(carrier ℝ; robustness weight on the Schatten-2 penalty κ‖X‖_{S_2}; range [0,∞) pinned by the 0 ≤ kappa premises threaded through the consuming theorems/lemmas)

Definition (Lean source)
noncomputable def designObjective (m : ℕ) (a b r kappa : ℝ) (X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) : ℝ := trace (twoBlockLaplacian m a b * X) + r * trace (twoBlockLaplacianPinv m a b * X) + kappa * frobeniusNorm X + trace (allOnesMatrix m * X)
def TwoBlockHomophily Assumption 1 in the paper ↗

Two-block homophily: m ≥ 2 and a > b > 0 (within-block weight strictly dominates the positive cross-block weight).

Definition (Lean source)
def TwoBlockHomophily (m : ℕ) (a b : ℝ) : Prop := 2 ≤ m ∧ b < a ∧ -- @realizes a(range: 0 < b < a pins a ∈ (0,∞)) 0 < b -- @realizes b(range: 0 < b pins b ∈ (0,∞))
CausalSmith.Experimentation.DesignPm1.TwoBlockHomophily · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:165
def LowScaleTwoBlock Assumption 3 in the paper ↗

Low-scale two-block normalization a + 3b < 2m (ensures D = 2m − a − 3b > 0).

Definition (Lean source)
def LowScaleTwoBlock (m : ℕ) (a b : ℝ) : Prop := a + 3 * b < 2 * (m : ℝ)
CausalSmith.Experimentation.DesignPm1.LowScaleTwoBlock · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:173
def OddCommunitySize Assumption 4 in the paper ↗

Odd community size (parity feasibility: forces S_A, S_B odd, so y + z ≥ 2/m).

Definition (Lean source)
def OddCommunitySize (m : ℕ) : Prop := Odd m
CausalSmith.Experimentation.DesignPm1.OddCommunitySize · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:177
structure BlockElliptopeMem

Membership witness for the block-symmetric elliptope slice E_m^blk, over the two-block homophily regime. Its member atom is ass:two-block-homophily; the three inequalities are exactly the PSD constraints of the spectral coordinates x = 1−u, y = 1+(m−1)u−mv, z = 1+(m−1)u+mv.

Definition (Lean source)
m :
a b u v :
Member atom: the two-block homophily regime.
homophily :
`x = 1 − u ≥ 0`.
psd_x :
0 ≤ 1 - u
`y = 1 + (m−1)u − m v ≥ 0`.
psd_y :
0 ≤ 1 + ((m : ℝ) - 1) * u - (m : ℝ) * v
`z = 1 + (m−1)u + m v ≥ 0`.
psd_z :
0 ≤ 1 + ((m : ℝ) - 1) * u + (m : ℝ) * v
CausalSmith.Experimentation.DesignPm1.BlockElliptopeMem · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:183
def blockElliptope

The block-symmetric elliptope slice E_m^blk as a set of matrices. @realizes E_m^blk(set of PSD block-symmetric correlation matrices X(u,v))

Definition (Lean source)
def blockElliptope (m : ℕ) (a b : ℝ) : Set (Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) := { X | ∃ u v : ℝ, X = blockSymMatrix m u v ∧ BlockElliptopeMem m a b u v }
def signOf

The ±1 sign vector of an assignment z (true ↦ +1, false ↦ −1). @realizes Z(±1 assignment sign vector)

Definition (Lean source)
def signOf (m : ℕ) (z : Fin (2 * m) → Bool) : Fin (2 * m) → ℝ := fun i => if z i then 1 else -1
def cutPlus

The cut assignment s_m (treat block A_m, control block B_m).

Definition (Lean source)
def cutPlus (m : ℕ) : Fin (2 * m) → Bool := fun i => decide (i.val < m)
def cutMinus

The reversed cut assignment −s_m.

Definition (Lean source)
def cutMinus (m : ℕ) : Fin (2 * m) → Bool := fun i => decide (¬ i.val < m)
def assignmentSecondMoment

The assignment second-moment matrix X(P) = E_P[Z Zᵀ]. @realizes X(P)(second-moment matrix E_P[Z Zᵀ]) @realizes P(design-law argument D : FiniteDesign (Fin (2*m) → Bool), the law over which the second moment is taken)

Definition (Lean source)
noncomputable def assignmentSecondMoment (m : ℕ) (D : FiniteDesign (Fin (2 * m) → Bool)) : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ := of fun i j => D.E (fun z => signOf m z i * signOf m z j)
CausalSmith.Experimentation.DesignPm1.assignmentSecondMoment · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:227
def cutDesign

The cut design P_cut: mass 1/2 on s_m and 1/2 on −s_m. @realizes P_cut(½ δ_{s_m} + ½ δ_{−s_m}) @realizes P(cluster member — CONCRETE CARRIER+CONSTRAINTS instance: a FiniteDesign (Fin (2*m) → Bool), i.e. a probability law on {-1,1}^n, whose p_nonneg/p_sum fields below discharge the PMF constraints that pin the symbol's space)

Definition (Lean source)
noncomputable def cutDesign (m : ℕ) : FiniteDesign (Fin (2 * m) → Bool) where p := fun z => (if z = cutPlus m then (1 : ℝ) / 2 else 0) + (if z = cutMinus m then (1 : ℝ) / 2 else 0) p_nonneg := fun z => by -- @realizes P(constraint 0 ≤ p z: nonnegativity of the law) have h : ∀ w : Fin (2 * m) → Bool, (0 : ℝ) ≤ if z = w then (1 : ℝ) / 2 else 0 := by intro w; split_ifs <;> norm_num exact add_nonneg (h _) (h _) p_sum := by -- @realizes P(constraint ∑ p = 1: total unit mass of the law) rw [Finset.sum_add_distrib, Finset.sum_ite_eq' univ (cutPlus m) (fun _ => (1 : ℝ) / 2), Finset.sum_ite_eq' univ (cutMinus m) (fun _ => (1 : ℝ) / 2)] simp only [Finset.mem_univ, if_true]; norm_num
def iidDesign

The iid Rademacher design P_iid: uniform on {-1,1}^n. @realizes P_iid(uniform Rademacher design) @realizes P(cluster member — CONCRETE CARRIER+CONSTRAINTS instance: a FiniteDesign (Fin (2*m) → Bool), i.e. a probability law on {-1,1}^n, whose p_nonneg/p_sum fields below discharge the PMF constraints that pin the symbol's space)

Definition (Lean source)
noncomputable def iidDesign (m : ℕ) : FiniteDesign (Fin (2 * m) → Bool) where p := fun _ => (card (Fin (2 * m) → Bool) : ℝ)⁻¹ p_nonneg := fun _ => by positivity -- @realizes P(constraint 0 ≤ p z: nonnegativity of the law) p_sum := by -- @realizes P(constraint ∑ p = 1: total unit mass of the law) rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] exact mul_inv_cancel₀ (Nat.cast_ne_zero.mpr Fintype.card_ne_zero)
def BalancedSignDesign Assumption 2 in the paper ↗

Balanced sign-symmetric design: P(Z = z) = P(Z = −z) for all z (global sign symmetry, implying zero one-point margins). @realizes P(design-law argument D : FiniteDesign (Fin (2*m) → Bool), the probability law on {-1,1}^n this predicate constrains)

Definition (Lean source)
def BalancedSignDesign (m : ℕ) (D : FiniteDesign (Fin (2 * m) → Bool)) : Prop := ∀ z, D.p z = D.p (fun i => ! z i)
CausalSmith.Experimentation.DesignPm1.BalancedSignDesign · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:266
structure BalancedDesignClass

The balanced design class P_m^bal, bundling the single sign-symmetry atom. @realizes P_m^bal(designs with global sign symmetry) @realizes P(cluster member: the bundled law D : FiniteDesign (Fin (2*m) → Bool), a probability law on {-1,1}^n via the carrier's p_nonneg/p_sum fields)

Definition (Lean source)
m :
D :
FiniteDesign (Fin (2 * m) → Bool)
Member atom: global sign symmetry.
balanced :
CausalSmith.Experimentation.DesignPm1.BalancedDesignClass · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:274
def IsBlockAuto

A permutation of the units is a two-block automorphism: it either preserves both blocks setwise or swaps them.

Definition (Lean source)
def IsBlockAuto (m : ℕ) (σ : Perm (Fin (2 * m))) : Prop := (∀ i, ((σ i).val < m ↔ i.val < m)) ∨ (∀ i, ((σ i).val < m ↔ ¬ i.val < m))
def blockExchangeableDesignClass Definition 3 in the paper ↗

The block-exchangeable design class P_m^sym: laws in P_m^bal invariant under permutations within A_m, within B_m, and under the community swap (the full two-block automorphism group). (D0.R provisional revision carried as revised.) @realizes P_m^sym(balanced designs invariant under the two-block automorphism group) @realizes P(cluster member: this Set (FiniteDesign (Fin (2*m) → Bool)) is the class of probability laws P consumed downstream by implementableCovarianceClass/ implementabilityGap; each element is a probability law via the carrier's PMF fields)

Definition (Lean source)
def blockExchangeableDesignClass (m : ℕ) : Set (FiniteDesign (Fin (2 * m) → Bool)) := { D | BalancedDesignClass m D ∧ ∀ σ : Perm (Fin (2 * m)), IsBlockAuto m σ → ∀ z, D.p (fun i => z (σ i)) = D.p z }
CausalSmith.Experimentation.DesignPm1.blockExchangeableDesignClass · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:288
def implementableCovarianceClass Definition 5 in the paper ↗

The implementable covariance class C_m^pm = { X(P) : P ∈ P_m^sym }. @realizes C_m^pm(second moments of block-exchangeable designs) @realizes P(cluster member: the bound design law D ∈ blockExchangeableDesignClass m ranges over the probability laws P whose second moment X(P) defines this class)

Definition (Lean source)
def implementableCovarianceClass (m : ℕ) : Set (Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) := { X | ∃ D ∈ blockExchangeableDesignClass m, X = assignmentSecondMoment m D }
CausalSmith.Experimentation.DesignPm1.implementableCovarianceClass · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:301
def blockSumA

Community sum S_A = ∑_{i ∈ A_m} Z_i (integer-valued). @realizes A_m, B_m(community A_m = {i : i.val < m}, cardinality m)

Definition (Lean source)
def blockSumA (m : ℕ) (z : Fin (2 * m) → Bool) : ℤ := ∑ i ∈ Finset.univ.filter (fun i : Fin (2 * m) => i.val < m), (if z i then (1 : ℤ) else -1)
def blockSumB

Community sum S_B = ∑_{i ∈ B_m} Z_i (integer-valued). @realizes A_m, B_m(community B_m = {i : ¬ i.val < m}, cardinality m)

Definition (Lean source)
def blockSumB (m : ℕ) (z : Fin (2 * m) → Bool) : ℤ := ∑ i ∈ Finset.univ.filter (fun i : Fin (2 * m) => ¬ i.val < m), (if z i then (1 : ℤ) else -1)

The block-sum law handle B(P): the joint pmf of the two community sums (S_A, S_B) under P (the OEQ parity handle). @realizes B(P)(joint law of the two community sums)

Definition (Lean source)
noncomputable def blockSumHandle (m : ℕ) (D : FiniteDesign (Fin (2 * m) → Bool)) (kl : ℤ × ℤ) : ℝ := D.E (fun z => if blockSumA m z = kl.1 ∧ blockSumB m z = kl.2 then 1 else 0)
def implementabilityGap Definition 7 in the paper ↗

The implementability gap Δ_m^±(r,κ) = inf_{P ∈ P_m^sym} F(X(P)) − inf_{X ∈ E_m^blk} F(X), as an sInf difference over the objective images. @realizes Delta_m^pm(r,kappa)(implementable inf − relaxed inf; CARRIER of the gap. The bare sInf − sInf real difference is a plain ; its core-declared range [0,∞) is NOT carried by this def alone but by the CONJUNCTION of this carrier with the companion range lemma implementabilityGap_nonneg in Helpers/GapReduction.lean, which pins 0 ≤ Δ_m^± via the reduced constrained-minus-unconstrained identity.) @realizes P(cluster member — AUTHORITATIVE link into the sharp_rho_star target block: the implementable sInf is taken over designObjective … '' implementableCovarianceClass m, i.e. over the second moments X(P) of the probability laws P ∈ P_m^sym; this is the decl through which the P realization cluster enters thm:sharp-rho-star) @realizes kappa(carrier ℝ; robustness argument of the gap; range [0,∞) pinned by the 0 ≤ kappa premises of the consuming theorems sharp_rho_star/rounding_gap_reduction)

Definition (Lean source)
noncomputable def implementabilityGap (m : ℕ) (a b r kappa : ℝ) : ℝ := sInf (designObjective m a b r kappa '' implementableCovarianceClass m) - sInf (designObjective m a b r kappa '' blockElliptope m a b)
CausalSmith.Experimentation.DesignPm1.implementabilityGap · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:329
def relaxedReducedValue

The relaxed reduced value min_{T_m} φ.

Definition (Lean source)
noncomputable def relaxedReducedValue (m : ℕ) (a b r kappa : ℝ) : ℝ := sInf { v | ∃ x y z, InReducedTriangle m x y z ∧ v = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z }
CausalSmith.Experimentation.DesignPm1.relaxedReducedValue · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:346
def implementableReducedValue

The implementable reduced value min_{T_m ∩ {y+z ≥ d_m}} φ.

Definition (Lean source)
noncomputable def implementableReducedValue (m : ℕ) (a b r kappa : ℝ) : ℝ := sInf { v | ∃ x y z, InReducedTriangle m x y z ∧ parityThreshold m ≤ y + z ∧ v = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z }
CausalSmith.Experimentation.DesignPm1.implementableReducedValue · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:351
def roundingLossCertificate

The tight rounding-loss certificate ρ_⋆, realized as the reduced-coordinate implementable-minus-relaxed value (proved equal to Δ_m^± by rounding_gap_reduction). The bare implementableReducedValue − relaxedReducedValue real difference is a plain ; its core-declared range [0,∞) is NOT carried by this def alone but by the CONJUNCTION of this carrier with the companion range lemma roundingLossCertificate_nonneg below, which pins 0 ≤ ρ_⋆ (the constrained reduced value dominating the unconstrained one, exactly as Δ_m^± is pinned nonnegative by implementabilityGap_nonneg). @realizes rho_star(m,a,b,r,kappa)(reduced constrained-minus-unconstrained value; CARRIER of the certificate, range [0,∞) pinned via the companion lemma below)

Definition (Lean source)
noncomputable def roundingLossCertificate (m : ℕ) (a b r kappa : ℝ) : ℝ := implementableReducedValue m a b r kappa - relaxedReducedValue m a b r kappa
CausalSmith.Experimentation.DesignPm1.roundingLossCertificate · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:356
theorem roundingLossCertificate_nonneg

Range lemma for ρ_⋆. The rounding-loss certificate lands in its core-declared space [0,∞): 0 ≤ ρ_⋆(m,a,b,r,κ). This holds because the implementable reduced value (the constrained sInf over T_m ∩ {y+z ≥ d_m}) dominates the relaxed reduced value (the unconstrained sInf over the larger set T_m), the implementable feasible set being a subset of the relaxed one. Together with the roundingLossCertificate carrier def above, this lemma IS the realization of the symbol's standing range condition (the bare sInf − sInf real difference does not by itself guarantee nonnegativity). @realizes rho_star(m,a,b,r,kappa)(range [0,∞) pinned via {y+z ≥ d_m}-constrained inf ≥ unconstrained inf ⇒ implementable reduced value ≥ relaxed reduced value)

Formal statement
m :
a b r kappa :
hHom :
hr0 :
0 ≤ r
hk :
0 ≤ kappa
0 ≤ roundingLossCertificate m a b r kappa
Proof (Lean source)
-- @node: roundingLossCertificate_nonneg lemma roundingLossCertificate_nonneg (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hr0 : 0 ≤ r) (hk : 0 ≤ kappa) : 0 ≤ roundingLossCertificate m a b r kappa := by unfold roundingLossCertificate implementableReducedValue relaxedReducedValue rw [sub_nonneg] let Srel : Set ℝ := { v | ∃ x y z, InReducedTriangle m x y z ∧ v = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z } let Simp : Set ℝ := { v | ∃ x y z, InReducedTriangle m x y z ∧ parityThreshold m ≤ y + z ∧ v = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z } change sInf Srel ≤ sInf Simp apply csInf_le_csInf · refine ⟨0, ?_⟩ intro v hv rcases hv with ⟨x, y, z, hT, rfl⟩ rcases hHom with ⟨hm, hba, hb⟩ rcases hT with ⟨hx, hy, hz, _hsum⟩ unfold reducedObjective cX cY cZ have hq_nonneg : 0 ≤ qParam m := by unfold qParam have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm nlinarith have hsum_pos : 0 < a + b := by linarith have hb2_pos : 0 < 2 * b := by positivity have hcx_nonneg : 0 ≤ qParam m * (a + b + r / (a + b)) := by positivity have hcy_nonneg : 0 ≤ 2 * b + r / (2 * b) := by positivity have hcz_nonneg : 0 ≤ 2 * (m : ℝ) := by positivity have hsqrt_nonneg : 0 ≤ sqrt (qParam m * x ^ 2 + y ^ 2 + z ^ 2) := Real.sqrt_nonneg _ nlinarith [mul_nonneg hcx_nonneg hx, mul_nonneg hcy_nonneg hy, mul_nonneg hcz_nonneg hz, mul_nonneg hk hsqrt_nonneg] · refine ⟨reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa 1 1 1, ?_⟩ refine ⟨1, 1, 1, ?_, ?_, rfl⟩ · refine ⟨by norm_num, by norm_num, by norm_num, ?_⟩ unfold qParam ring · unfold parityThreshold by_cases hEven : Even m · rw [if_pos hEven] norm_num · rw [if_neg hEven] rcases hHom with ⟨hm, _hba, _hb⟩ have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm have hmpos : 0 < (m : ℝ) := by linarith have hdiv : 2 / (m : ℝ) ≤ 2 := by rw [div_le_iff₀ hmpos] nlinarith nlinarith · intro v hv rcases hv with ⟨x, y, z, hT, _hpar, rfl⟩ exact ⟨x, y, z, hT, rfl⟩
CausalSmith.Experimentation.DesignPm1.roundingLossCertificate_nonneg · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:368
def IsSharpExactnessBoundary

Sharp cut-break exactness boundary r_⋆(m,a,b,κ) — the HONEST-OPEN frontier symbol (open_phase_boundary role; it has NO statement node and NO closed form by design; its clean/set-valued shape is deliberately left open, see honest scope). This predicate is the dedicated carrier that realizes the symbol's [0,∞) SPACE together with its defining boundary role: rStar is a nonnegative ratio (its [0,∞) space) below which the rounding loss vanishes — i.e. it lower-bounds a zero-loss r-region [0, rStar), the "cut-break ratio separating zero implementability loss from positive loss". No existence, uniqueness, or exact value of such an rStar is asserted anywhere (honest open scope); only the space and the separating role are pinned here. @realizes r_star(m,a,b,kappa)(carrier/predicate for the open boundary object; its [0,∞) space is pinned by the 0 ≤ rStar conjunct, its separating role by the zero-loss clause)

Definition (Lean source)
def IsSharpExactnessBoundary (m : ℕ) (a b kappa rStar : ℝ) : Prop := 0 ≤ rStar ∧ -- @realizes r_star(range 0 ≤ r_⋆ pins the boundary object into its [0,∞) space) ∀ r, 0 ≤ r → r < rStar → roundingLossCertificate m a b r kappa = 0
CausalSmith.Experimentation.DesignPm1.IsSharpExactnessBoundary · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:432
def IsIidExactnessFrontier

iid-exactness frontier κ_iid(m,a,b,r) — the dedicated carrier that realizes the symbol's [0,∞) SPACE together with its defining frontier role (iid_exactness_frontier, role derived_phase_boundary). κ_iid is the smallest nonnegative robustness weight from which the iid covariance I_n = X(P_iid) remains optimal over the block-symmetric elliptope slice E_m^blk, and it dominates the cut frontier κ_cut(m,a,b) = max 0 (min (a−b) (2(m−b))) (the core relation κ_iid ≥ κ_cut). This predicate is that carrier: the 0 ≤ κ_iid conjunct pins the [0,∞) space, the κ_cut ≤ κ_iid conjunct records the core ordering, and the trailing clause pins the frontier role — above the frontier weight, I_n minimizes F_{r,κ} on E_m^blk. No existence, uniqueness, or closed form of such a κ_iid is asserted here (the iid frontier, like r_⋆, is bound only as a symbol; robust_corner_exactness supplies the finiteness criterion for its EXISTENCE — a finite frontier exists iff the affine-balanced locus holds — not its value). Mirrors the IsSharpExactnessBoundary carrier for r_⋆. @realizes kappa_iid(m,a,b,r)(carrier/predicate for the iid-exactness frontier; its [0,∞) space is pinned by the 0 ≤ κ_iid conjunct, the κ_iid ≥ κ_cut ordering by the second conjunct, and its frontier role by the optimality clause)

Definition (Lean source)
def IsIidExactnessFrontier (m : ℕ) (a b r kappaIid : ℝ) : Prop := 0 ≤ kappaIid ∧ -- @realizes kappa_iid(range 0 ≤ κ_iid pins the frontier into its [0,∞) space) max 0 (min (a - b) (2 * ((m : ℝ) - b))) ≤ kappaIid ∧ -- @realizes kappa_iid(ordering κ_iid ≥ κ_cut(m,a,b), core-def closed form of κ_cut) ∀ kappa : ℝ, kappaIid < kappa → (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) ∈ blockElliptope m a b ∧ ∀ X ∈ blockElliptope m a b, designObjective m a b r kappa 1 ≤ designObjective m a b r kappa X
CausalSmith.Experimentation.DesignPm1.IsIidExactnessFrontier · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Basic.lean:450
Helpers.BlockPairSums 3 declarations Finite pair-count identities over A_m and B_m, used by the spectral-coordinate trace and Frobenius calculations.

Pair counts for the balanced two-block partition

Finite pair-count identities over A_m and B_m, used by the spectral-coordinate trace and Frobenius calculations.

theorem sum_if_eq_else_self_real Lemma sum_if_eq_else_self_real in the paper ↗

Sum a two-valued function over a finite set when one distinguished point takes the diagonal value.

Formal statement
α :
Type*
s :
a b :
i :
α
hi :
i ∈ s
(∑ j ∈ s, (if i = j then a else b)) = a + ((s.card - 1 : ℕ) : ℝ) * b
Proof (Lean source)
lemma sum_if_eq_else_self_real {α : Type*} [DecidableEq α] (s : Finset α) (a b : ℝ) {i : α} (hi : i ∈ s) : (∑ j ∈ s, (if i = j then a else b)) = a + ((s.card - 1 : ℕ) : ℝ) * b := by rw [← Finset.sum_erase_add s (fun j => if i = j then a else b) hi] have herase : (∑ x ∈ s.erase i, (if i = x then a else b)) = ∑ x ∈ s.erase i, b := by apply Finset.sum_congr rfl intro x hx have hxne : i ≠ x := by have hx' := (Finset.mem_erase.mp hx).1 exact fun h => hx' h.symm simp [hxne] rw [herase] rw [Finset.sum_const, Finset.card_erase_of_mem hi, nsmul_eq_mul] simp ring

Pair count over the two equal blocks: diagonal pairs contribute d, same-community off-diagonal pairs contribute s, and cross-community pairs contribute c.

Formal statement
m :
d s c :
(∑ i : Fin (2 * m), ∑ j : Fin (2 * m), if i = j then d else if (i.val < m ↔ j.val < m) then s else c)
= 2 * (m : ℝ) * d + 2 * (m : ℝ) * ((m : ℝ) - 1) * s + 2 * (m : ℝ) * (m : ℝ) * c
Proof (Lean source)
lemma block_pair_sum (m : ℕ) (d s c : ℝ) : (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), if i = j then d else if (i.val < m ↔ j.val < m) then s else c) = 2 * (m : ℝ) * d + 2 * (m : ℝ) * ((m : ℝ) - 1) * s + 2 * (m : ℝ) * (m : ℝ) * c := by let A := blockAFin m let B := blockBFin m have hsplit_outer : (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), if i = j then d else if (i.val < m ↔ j.val < m) then s else c) = (∑ i ∈ A, ∑ j : Fin (2 * m), if i = j then d else if (i.val < m ↔ j.val < m) then s else c) + (∑ i ∈ B, ∑ j : Fin (2 * m), if i = j then d else if (i.val < m ↔ j.val < m) then s else c) := by dsimp [A, B, blockAFin, blockBFin] rw [← Finset.sum_filter_add_sum_filter_not (s := univ) (p := fun i : Fin (2 * m) => i.val < m) (f := fun i => ∑ j : Fin (2 * m), if i = j then d else if (i.val < m ↔ j.val < m) then s else c)] have hinnerA : ∀ i ∈ A, (∑ j : Fin (2 * m), if i = j then d else if (i.val < m ↔ j.val < m) then s else c) = d + ((m - 1 : ℕ) : ℝ) * s + (m : ℝ) * c := by intro i hi have hi' : i.val < m := by simpa [A, blockAFin] using hi have hsplit_inner : (∑ j : Fin (2 * m), if i = j then d else if (i.val < m ↔ j.val < m) then s else c) = (∑ j ∈ A, if i = j then d else if (i.val < m ↔ j.val < m) then s else c) + (∑ j ∈ B, if i = j then d else if (i.val < m ↔ j.val < m) then s else c) := by dsimp [A, B, blockAFin, blockBFin] rw [← Finset.sum_filter_add_sum_filter_not (s := univ) (p := fun j : Fin (2 * m) => j.val < m) (f := fun j => if i = j then d else if (i.val < m ↔ j.val < m) then s else c)] rw [hsplit_inner] have hAA : (∑ j ∈ A, if i = j then d else if (i.val < m ↔ j.val < m) then s else c) = d + ((m - 1 : ℕ) : ℝ) * s := by have hAcard : A.card = m := by dsimp [A]; exact card_blockAFin m calc (∑ j ∈ A, if i = j then d else if (i.val < m ↔ j.val < m) then s else c) = ∑ j ∈ A, if i = j then d else s := by apply Finset.sum_congr rfl intro j hj have hj' : j.val < m := by simpa [A, blockAFin] using hj by_cases hij : i = j <;> simp [hij, hi', hj'] _ = d + ((A.card - 1 : ℕ) : ℝ) * s := sum_if_eq_else_self_real A d s hi _ = d + ((m - 1 : ℕ) : ℝ) * s := by rw [hAcard] have hAB : (∑ j ∈ B, if i = j then d else if (i.val < m ↔ j.val < m) then s else c) = (m : ℝ) * c := by have hBcard : B.card = m := by dsimp [B]; exact card_blockBFin m calc (∑ j ∈ B, if i = j then d else if (i.val < m ↔ j.val < m) then s else c) = ∑ j ∈ B, c := by apply Finset.sum_congr rfl intro j hj have hj' : ¬ j.val < m := by simpa [B, blockBFin] using hj have hne : i ≠ j := by intro h exact hj' (by simpa [h] using hi') have hnot : ¬ (i.val < m ↔ j.val < m) := by intro hiff exact hj' (hiff.mp hi') simp [hne, hnot] _ = (m : ℝ) * c := by rw [Finset.sum_const, nsmul_eq_mul, hBcard] rw [hAA, hAB] have hinnerB : ∀ i ∈ B, (∑ j : Fin (2 * m), if i = j then d else if (i.val < m ↔ j.val < m) then s else c) = d + ((m - 1 : ℕ) : ℝ) * s + (m : ℝ) * c := by intro i hi have hi' : ¬ i.val < m := by simpa [B, blockBFin] using hi have hsplit_inner : (∑ j : Fin (2 * m), if i = j then d else if (i.val < m ↔ j.val < m) then s else c) = (∑ j ∈ A, if i = j then d else if (i.val < m ↔ j.val < m) then s else c) + (∑ j ∈ B, if i = j then d else if (i.val < m ↔ j.val < m) then s else c) := by dsimp [A, B, blockAFin, blockBFin] rw [← Finset.sum_filter_add_sum_filter_not (s := univ) (p := fun j : Fin (2 * m) => j.val < m) (f := fun j => if i = j then d else if (i.val < m ↔ j.val < m) then s else c)] rw [hsplit_inner] have hBA : (∑ j ∈ A, if i = j then d else if (i.val < m ↔ j.val < m) then s else c) = (m : ℝ) * c := by have hAcard : A.card = m := by dsimp [A]; exact card_blockAFin m calc (∑ j ∈ A, if i = j then d else if (i.val < m ↔ j.val < m) then s else c) = ∑ j ∈ A, c := by apply Finset.sum_congr rfl intro j hj have hj' : j.val < m := by simpa [A, blockAFin] using hj have hne : i ≠ j := by intro h exact hi' (by simpa [h] using hj') have hnot : ¬ (i.val < m ↔ j.val < m) := by intro hiff exact hi' (hiff.mpr hj') simp [hne, hnot] _ = (m : ℝ) * c := by rw [Finset.sum_const, nsmul_eq_mul, hAcard] have hBB : (∑ j ∈ B, if i = j then d else if (i.val < m ↔ j.val < m) then s else c) = d + ((m - 1 : ℕ) : ℝ) * s := by have hBcard : B.card = m := by dsimp [B]; exact card_blockBFin m calc (∑ j ∈ B, if i = j then d else if (i.val < m ↔ j.val < m) then s else c) = ∑ j ∈ B, if i = j then d else s := by apply Finset.sum_congr rfl intro j hj have hj' : ¬ j.val < m := by simpa [B, blockBFin] using hj by_cases hij : i = j <;> simp [hij, hi', hj'] _ = d + ((B.card - 1 : ℕ) : ℝ) * s := sum_if_eq_else_self_real B d s hi _ = d + ((m - 1 : ℕ) : ℝ) * s := by rw [hBcard] rw [hBA, hBB] ring rw [hsplit_outer] calc (∑ i ∈ A, ∑ j : Fin (2 * m), if i = j then d else if (i.val < m ↔ j.val < m) then s else c) + (∑ i ∈ B, ∑ j : Fin (2 * m), if i = j then d else if (i.val < m ↔ j.val < m) then s else c) = (∑ i ∈ A, (d + ((m - 1 : ℕ) : ℝ) * s + (m : ℝ) * c)) + (∑ i ∈ B, (d + ((m - 1 : ℕ) : ℝ) * s + (m : ℝ) * c)) := by congr 1 · apply Finset.sum_congr rfl exact hinnerA · apply Finset.sum_congr rfl exact hinnerB _ = 2 * (m : ℝ) * d + 2 * (m : ℝ) * ((m : ℝ) - 1) * s + 2 * (m : ℝ) * (m : ℝ) * c := by dsimp [A, B] rw [Finset.sum_const, Finset.sum_const, card_blockAFin, card_blockBFin] simp [nsmul_eq_mul] cases m with | zero => ring | succ n => have hsub : (n + 1 - 1 : ℕ) = n := by omega simp [hsub] ring

The same pair count with a community-sign multiplier. Same-community pairs have sign product +1, and cross-community pairs have sign product -1.

Formal statement
m :
d s c :
(∑ i : Fin (2 * m), ∑ j : Fin (2 * m), signVec m i * signVec m j * (if i = j then d else if (i.val < m ↔ j.val < m) then s else c))
= 2 * (m : ℝ) * d + 2 * (m : ℝ) * ((m : ℝ) - 1) * s - 2 * (m : ℝ) * (m : ℝ) * c
Proof (Lean source)
lemma block_signed_pair_sum (m : ℕ) (d s c : ℝ) : (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), signVec m i * signVec m j * (if i = j then d else if (i.val < m ↔ j.val < m) then s else c)) = 2 * (m : ℝ) * d + 2 * (m : ℝ) * ((m : ℝ) - 1) * s - 2 * (m : ℝ) * (m : ℝ) * c := by have hpoint : ∀ i j : Fin (2 * m), signVec m i * signVec m j * (if i = j then d else if (i.val < m ↔ j.val < m) then s else c) = if i = j then d else if (i.val < m ↔ j.val < m) then s else -c := by intro i j by_cases hi : i.val < m <;> by_cases hj : j.val < m <;> by_cases hij : i = j <;> simp [signVec, hi, hj, hij] calc (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), signVec m i * signVec m j * (if i = j then d else if (i.val < m ↔ j.val < m) then s else c)) = ∑ i : Fin (2 * m), ∑ j : Fin (2 * m), if i = j then d else if (i.val < m ↔ j.val < m) then s else -c := by apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ exact hpoint i j _ = 2 * (m : ℝ) * d + 2 * (m : ℝ) * ((m : ℝ) - 1) * s - 2 * (m : ℝ) * (m : ℝ) * c := by have h := block_pair_sum m d s (-c) nlinarith [h]
Helpers.FrobeniusCenter 3 declarations Frobenius-center certificate on the reduced triangle

Frobenius-center certificate on the reduced triangle

theorem frobeniusCenterTangentXY_deriv Lemma frobeniusCenterTangentXY_deriv in the paper ↗

Along the tangent (x,y,z) = (1+t, 1-q t, 1), the Frobenius term has zero first derivative at the center, so the objective derivative is c_x - q c_y.

Formal statement
q cx cy cz kappa :
hq :
0 < q
HasDerivAt (fun t : ℝ => reducedObjective q cx cy cz kappa (1 + t) (1 - q * t) 1) (cx - q * cy) 0
Proof (Lean source)
lemma frobeniusCenterTangentXY_deriv (q cx cy cz kappa : ℝ) (hq : 0 < q) : HasDerivAt (fun t : ℝ => reducedObjective q cx cy cz kappa (1 + t) (1 - q * t) 1) (cx - q * cy) 0 := by have h1 : HasDerivAt (fun t : ℝ => (1 : ℝ) + t) 1 0 := by simpa using (hasDerivAt_const (0 : ℝ) (1 : ℝ)).fun_add (hasDerivAt_id (0 : ℝ)) have hqt : HasDerivAt (fun t : ℝ => q * t) q 0 := by simpa using (hasDerivAt_const (0 : ℝ) q).fun_mul (hasDerivAt_id (0 : ℝ)) have hy : HasDerivAt (fun t : ℝ => (1 : ℝ) - q * t) (-q) 0 := by simpa using (hasDerivAt_const (0 : ℝ) (1 : ℝ)).fun_sub hqt have hz : HasDerivAt (fun _t : ℝ => (1 : ℝ)) 0 0 := hasDerivAt_const (0 : ℝ) (1 : ℝ) have hcx : HasDerivAt (fun _t : ℝ => cx) 0 0 := hasDerivAt_const (0 : ℝ) cx have hcy : HasDerivAt (fun _t : ℝ => cy) 0 0 := hasDerivAt_const (0 : ℝ) cy have hcz : HasDerivAt (fun _t : ℝ => cz) 0 0 := hasDerivAt_const (0 : ℝ) cz have hk : HasDerivAt (fun _t : ℝ => kappa) 0 0 := hasDerivAt_const (0 : ℝ) kappa have hqconst : HasDerivAt (fun _t : ℝ => q) 0 0 := hasDerivAt_const (0 : ℝ) q have hpoly : HasDerivAt (fun t : ℝ => q * (1 + t) ^ 2 + (1 - q * t) ^ 2 + 1 ^ 2) 0 0 := by have hraw : HasDerivAt (fun t : ℝ => q * (1 + t) ^ 2 + (1 - q * t) ^ 2 + 1 ^ 2) (0 * ((1 + (0 : ℝ)) ^ 2) + q * (2 * (1 + (0 : ℝ)) ^ (2 - 1) * 1) + (2 * (1 - q * (0 : ℝ)) ^ (2 - 1) * (-q)) + 0) 0 := by simpa using ((hqconst.mul (h1.pow 2)).add (hy.pow 2)).add_const (1 ^ 2 : ℝ) convert hraw using 1 ring have hval_ne : q * (1 + (0 : ℝ)) ^ 2 + (1 - q * (0 : ℝ)) ^ 2 + 1 ^ 2 ≠ 0 := by positivity have hnorm : HasDerivAt (fun t : ℝ => sqrt (q * (1 + t) ^ 2 + (1 - q * t) ^ 2 + 1 ^ 2)) 0 0 := by convert hpoly.sqrt hval_ne using 1 ring have hraw := ((((hcx.mul h1).add (hcy.mul hy)).add (hcz.mul hz)).add (hk.mul hnorm)) have hraw_fun : HasDerivAt (fun t : ℝ => cx * (1 + t) + cy * (1 - q * t) + cz * 1 + kappa * sqrt (q * (1 + t) ^ 2 + (1 - q * t) ^ 2 + 1 ^ 2)) (0 * (1 + (0 : ℝ)) + cx * 1 + (0 * (1 - q * (0 : ℝ)) + cy * (-q)) + (0 * (1 : ℝ) + cz * 0) + (0 * sqrt (q * (1 + (0 : ℝ)) ^ 2 + (1 - q * (0 : ℝ)) ^ 2 + 1 ^ 2) + kappa * 0)) 0 := by refine hraw.congr_of_eventuallyEq ?_ filter_upwards [] with t simp only [Pi.add_apply, Pi.mul_apply] have hraw' : HasDerivAt (fun t : ℝ => cx * (1 + t) + cy * (1 - q * t) + cz * 1 + kappa * sqrt (q * (1 + t) ^ 2 + (1 - q * t) ^ 2 + 1 ^ 2)) (cx - q * cy) 0 := by convert hraw_fun using 1 ring simpa [reducedObjective] using hraw'
CausalSmith.Experimentation.DesignPm1.frobeniusCenterTangentXY_deriv · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/FrobeniusCenter.lean:17
theorem frobeniusCenterTangentYZ_deriv Lemma frobeniusCenterTangentYZ_deriv in the paper ↗

Along the tangent (x,y,z) = (1, 1+t, 1-t), the Frobenius term has zero first derivative at the center, so the objective derivative is c_y - c_z.

Formal statement
q cx cy cz kappa :
hq :
0 < q
HasDerivAt (fun t : ℝ => reducedObjective q cx cy cz kappa 1 (1 + t) (1 - t)) (cy - cz) 0
Proof (Lean source)
lemma frobeniusCenterTangentYZ_deriv (q cx cy cz kappa : ℝ) (hq : 0 < q) : HasDerivAt (fun t : ℝ => reducedObjective q cx cy cz kappa 1 (1 + t) (1 - t)) (cy - cz) 0 := by have hx : HasDerivAt (fun _t : ℝ => (1 : ℝ)) 0 0 := hasDerivAt_const (0 : ℝ) (1 : ℝ) have hy : HasDerivAt (fun t : ℝ => (1 : ℝ) + t) 1 0 := by simpa using (hasDerivAt_const (0 : ℝ) (1 : ℝ)).fun_add (hasDerivAt_id (0 : ℝ)) have hz : HasDerivAt (fun t : ℝ => (1 : ℝ) - t) (-1) 0 := by simpa using (hasDerivAt_const (0 : ℝ) (1 : ℝ)).fun_sub (hasDerivAt_id (0 : ℝ)) have hcx : HasDerivAt (fun _t : ℝ => cx) 0 0 := hasDerivAt_const (0 : ℝ) cx have hcy : HasDerivAt (fun _t : ℝ => cy) 0 0 := hasDerivAt_const (0 : ℝ) cy have hcz : HasDerivAt (fun _t : ℝ => cz) 0 0 := hasDerivAt_const (0 : ℝ) cz have hk : HasDerivAt (fun _t : ℝ => kappa) 0 0 := hasDerivAt_const (0 : ℝ) kappa have hq1 : HasDerivAt (fun _t : ℝ => q * 1 ^ 2) 0 0 := hasDerivAt_const (0 : ℝ) (q * 1 ^ 2) have hpoly : HasDerivAt (fun t : ℝ => q * 1 ^ 2 + (1 + t) ^ 2 + (1 - t) ^ 2) 0 0 := by have hraw : HasDerivAt (fun t : ℝ => q * 1 ^ 2 + (1 + t) ^ 2 + (1 - t) ^ 2) (0 + (2 * (1 + (0 : ℝ)) ^ (2 - 1) * 1) + (2 * (1 - (0 : ℝ)) ^ (2 - 1) * (-1))) 0 := by simpa using (hq1.fun_add (hy.fun_pow 2)).fun_add (hz.fun_pow 2) convert hraw using 1 ring have hval_ne : q * 1 ^ 2 + (1 + (0 : ℝ)) ^ 2 + (1 - (0 : ℝ)) ^ 2 ≠ 0 := by positivity have hnorm : HasDerivAt (fun t : ℝ => sqrt (q * 1 ^ 2 + (1 + t) ^ 2 + (1 - t) ^ 2)) 0 0 := by convert hpoly.sqrt hval_ne using 1 ring have hraw := ((((hcx.mul hx).add (hcy.mul hy)).add (hcz.mul hz)).add (hk.mul hnorm)) have hraw_fun : HasDerivAt (fun t : ℝ => cx * 1 + cy * (1 + t) + cz * (1 - t) + kappa * sqrt (q * 1 ^ 2 + (1 + t) ^ 2 + (1 - t) ^ 2)) (0 * (1 : ℝ) + cx * 0 + (0 * (1 + (0 : ℝ)) + cy * 1) + (0 * (1 - (0 : ℝ)) + cz * (-1)) + (0 * sqrt (q * 1 ^ 2 + (1 + (0 : ℝ)) ^ 2 + (1 - (0 : ℝ)) ^ 2) + kappa * 0)) 0 := by refine hraw.congr_of_eventuallyEq ?_ filter_upwards [] with t simp only [Pi.add_apply, Pi.mul_apply] have hraw' : HasDerivAt (fun t : ℝ => cx * 1 + cy * (1 + t) + cz * (1 - t) + kappa * sqrt (q * 1 ^ 2 + (1 + t) ^ 2 + (1 - t) ^ 2)) (cy - cz) 0 := by convert hraw_fun using 1 ring simpa [reducedObjective] using hraw'
CausalSmith.Experimentation.DesignPm1.frobeniusCenterTangentYZ_deriv · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/FrobeniusCenter.lean:72
theorem frobenius_center_certificate Lemma 4 in the paper ↗

Frobenius-center certificate: (1,1,1) uniquely minimizes the weighted Frobenius term on T_m; it minimizes the full objective for finite κ only if c_x/q = c_y = c_z, and under that equality with κ > 0 it is the unique minimizer.

Formal statement
m :
cx cy cz kappa :
hq :
0 < qParam m
(InReducedTriangle m 1 1 1 ∧ ∀ x y z, InReducedTriangle m x y z → (x, y, z) ≠ (1, 1, 1) → sqrt (qParam m * 1 ^ 2 + 1 ^ 2 + 1 ^ 2) < sqrt (qParam m * x ^ 2 + y ^ 2 + z ^ 2)) ∧
((∀ x y z, InReducedTriangle m x y z → reducedObjective (qParam m) cx cy cz kappa 1 1 1 ≤ reducedObjective (qParam m) cx cy cz kappa x y z) → cx / qParam m = cy ∧ cy = cz) ∧
(0 < kappa → cx / qParam m = cy → cy = cz → ∀ x y z, InReducedTriangle m x y z → (x, y, z) ≠ (1, 1, 1) → reducedObjective (qParam m) cx cy cz kappa 1 1 1 < reducedObjective (qParam m) cx cy cz kappa x y z)
Proof (Lean source)
lemma frobenius_center_certificate (m : ℕ) (cx cy cz kappa : ℝ) (hq : 0 < qParam m) : (InReducedTriangle m 1 1 1 ∧ ∀ x y z, InReducedTriangle m x y z → (x, y, z) ≠ (1, 1, 1) → sqrt (qParam m * 1 ^ 2 + 1 ^ 2 + 1 ^ 2) < sqrt (qParam m * x ^ 2 + y ^ 2 + z ^ 2)) ∧ ((∀ x y z, InReducedTriangle m x y z → reducedObjective (qParam m) cx cy cz kappa 1 1 1 ≤ reducedObjective (qParam m) cx cy cz kappa x y z) → cx / qParam m = cy ∧ cy = cz) ∧ (0 < kappa → cx / qParam m = cy → cy = cz → ∀ x y z, InReducedTriangle m x y z → (x, y, z) ≠ (1, 1, 1) → reducedObjective (qParam m) cx cy cz kappa 1 1 1 < reducedObjective (qParam m) cx cy cz kappa x y z) := by let q := qParam m have hq' : 0 < q := by simpa [q] using hq have hqM : q + 2 = 2 * (m : ℝ) := by simp [q, qParam] ring have hnorm : InReducedTriangle m 1 1 1 ∧ ∀ x y z, InReducedTriangle m x y z → (x, y, z) ≠ (1, 1, 1) → sqrt (qParam m * 1 ^ 2 + 1 ^ 2 + 1 ^ 2) < sqrt (qParam m * x ^ 2 + y ^ 2 + z ^ 2) := by constructor · unfold InReducedTriangle constructor · norm_num constructor · norm_num constructor · norm_num · change q * 1 + 1 + 1 = 2 * (m : ℝ) nlinarith [hqM] · intro x y z hT hneq rcases hT with ⟨hx, hy, hz, hsum⟩ have hsumq : q * x + y + z = 2 * (m : ℝ) := by simpa [q] using hsum have hdecomp : q * x ^ 2 + y ^ 2 + z ^ 2 = (q * 1 ^ 2 + 1 ^ 2 + 1 ^ 2) + (q * (x - 1) ^ 2 + (y - 1) ^ 2 + (z - 1) ^ 2) := by nlinarith [hsumq, hqM] have hsquares_nonneg : 0 ≤ q * (x - 1) ^ 2 + (y - 1) ^ 2 + (z - 1) ^ 2 := by positivity have hsquares_pos : 0 < q * (x - 1) ^ 2 + (y - 1) ^ 2 + (z - 1) ^ 2 := by by_contra hnot have hzero : q * (x - 1) ^ 2 + (y - 1) ^ 2 + (z - 1) ^ 2 = 0 := le_antisymm (le_of_not_gt hnot) hsquares_nonneg have hqx_nonneg : 0 ≤ q * (x - 1) ^ 2 := mul_nonneg (le_of_lt hq') (sq_nonneg _) have hy_nonneg : 0 ≤ (y - 1) ^ 2 := sq_nonneg _ have hz_nonneg : 0 ≤ (z - 1) ^ 2 := sq_nonneg _ have hqx_zero : q * (x - 1) ^ 2 = 0 := by nlinarith have hy_zero : (y - 1) ^ 2 = 0 := by nlinarith have hz_zero : (z - 1) ^ 2 = 0 := by nlinarith have hx1 : x = 1 := by have hx_sq_zero : (x - 1) ^ 2 = 0 := (mul_eq_zero.mp hqx_zero).resolve_left (ne_of_gt hq') exact sub_eq_zero.mp (sq_eq_zero_iff.mp hx_sq_zero) have hy1 : y = 1 := sub_eq_zero.mp (sq_eq_zero_iff.mp hy_zero) have hz1 : z = 1 := sub_eq_zero.mp (sq_eq_zero_iff.mp hz_zero) apply hneq ext <;> simp [hx1, hy1, hz1] have hsq_lt : q * 1 ^ 2 + 1 ^ 2 + 1 ^ 2 < q * x ^ 2 + y ^ 2 + z ^ 2 := by rw [hdecomp] nlinarith exact Real.sqrt_lt_sqrt (by positivity) (by simpa [q] using hsq_lt) refine ⟨hnorm, ?_, ?_⟩ · intro hmin constructor · let g : ℝ → ℝ := fun t => reducedObjective q cx cy cz kappa (1 + t) (1 - q * t) 1 have hloc : IsLocalMin g 0 := by unfold IsLocalMin IsMinFilter have hδ : 0 < min 1 (1 / q) := by positivity filter_upwards [Metric.ball_mem_nhds (0 : ℝ) hδ] with t ht have habs : |t| < min 1 (1 / q) := by simpa [Real.dist_eq] using ht have ht_lt_one : t < 1 := lt_of_le_of_lt (le_abs_self t) (lt_of_lt_of_le habs (min_le_left _ _)) have hneg_lt_one : -t < 1 := lt_of_le_of_lt (neg_le_abs t) (lt_of_lt_of_le habs (min_le_left _ _)) have ht_gt_neg_one : -1 < t := by linarith have htq_lt_one : q * t < 1 := by have ht_lt_inv : t < 1 / q := lt_of_le_of_lt (le_abs_self t) (lt_of_lt_of_le habs (min_le_right _ _)) have hmul := mul_lt_mul_of_pos_left ht_lt_inv hq' have hqinv : q * (1 / q) = 1 := by field_simp [ne_of_gt hq'] nlinarith have hT : InReducedTriangle m (1 + t) (1 - q * t) 1 := by unfold InReducedTriangle constructor · linarith constructor · linarith constructor · norm_num · dsimp [q] nlinarith [hqM] have := hmin (1 + t) (1 - q * t) 1 hT simpa [g, q] using this have hderiv : HasDerivAt g (cx - q * cy) 0 := by simpa [g, q] using frobeniusCenterTangentXY_deriv q cx cy cz kappa hq' have hzero : cx - q * cy = 0 := hloc.hasDerivAt_eq_zero hderiv have hcx : cx = q * cy := by linarith rw [hcx] exact mul_div_cancel_left₀ cy (ne_of_gt hq') · let g : ℝ → ℝ := fun t => reducedObjective q cx cy cz kappa 1 (1 + t) (1 - t) have hloc : IsLocalMin g 0 := by unfold IsLocalMin IsMinFilter have hδ : 0 < (1 : ℝ) := by norm_num filter_upwards [Metric.ball_mem_nhds (0 : ℝ) hδ] with t ht have habs : |t| < (1 : ℝ) := by simpa [Real.dist_eq] using ht have ht_lt_one : t < 1 := lt_of_le_of_lt (le_abs_self t) habs have hneg_lt_one : -t < 1 := lt_of_le_of_lt (neg_le_abs t) habs have ht_gt_neg_one : -1 < t := by linarith have hT : InReducedTriangle m 1 (1 + t) (1 - t) := by unfold InReducedTriangle constructor · norm_num constructor · linarith constructor · linarith · change q * 1 + (1 + t) + (1 - t) = 2 * (m : ℝ) nlinarith [hqM] have := hmin 1 (1 + t) (1 - t) hT simpa [g, q] using this have hderiv : HasDerivAt g (cy - cz) 0 := by simpa [g, q] using frobeniusCenterTangentYZ_deriv q cx cy cz kappa hq' have hzero : cy - cz = 0 := hloc.hasDerivAt_eq_zero hderiv linarith · intro hk hcxq hcyz x y z hT hneq have hnorm_lt := hnorm.2 x y z hT hneq rcases hT with ⟨hx, hy, hz, hsum⟩ have hsumq : q * x + y + z = 2 * (m : ℝ) := by simpa [q] using hsum have hcx_eq0 : cx = qParam m * cy := by rw [← hcxq] field_simp [ne_of_gt hq] have hcx_eq : cx = q * cy := by simpa [q] using hcx_eq0 have hsum_center : q + 1 + 1 = q * x + y + z := by nlinarith [hsumq, hqM] have hlinear : cx * 1 + cy * 1 + cz * 1 = cx * x + cy * y + cz * z := by rw [hcx_eq, ← hcyz] calc q * cy * 1 + cy * 1 + cy * 1 = cy * (q + 1 + 1) := by ring _ = cy * (q * x + y + z) := by rw [hsum_center] _ = q * cy * x + cy * y + cy * z := by ring have hpen : kappa * sqrt (q * 1 ^ 2 + 1 ^ 2 + 1 ^ 2) < kappa * sqrt (q * x ^ 2 + y ^ 2 + z ^ 2) := by exact mul_lt_mul_of_pos_left (by simpa [q] using hnorm_lt) hk unfold reducedObjective nlinarith [hlinear, hpen]
CausalSmith.Experimentation.DesignPm1.frobenius_center_certificate · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/FrobeniusCenter.lean:126
Helpers.GapReduction 12 declarations Assembles prop:symmetry-reduction, lem:block-spectral-coordinates, and lem:pm-reduced-slice-characterization into the reduced-coordinate identity for the implementability gap: Δ_m^± = min_{T_m ∩ {y+z ≥ d_m}} φ − min_{T_m

Rounding-gap reduction

Assembles prop:symmetry-reduction, lem:block-spectral-coordinates, and lem:pm-reduced-slice-characterization into the reduced-coordinate identity for the implementability gap: Δ_m^± = min_{T_m ∩ {y+z ≥ d_m}} φ − min_{T_m} φ.

theorem rounding_gap_reduction Lemma 8 in the paper ↗

The implementability gap equals the reduced-coordinate implementable-minus-relaxed value: Δ_m^±(r,κ) = implementableReducedValue − relaxedReducedValue.

Formal statement
m :
a b r kappa :
hHom :
hk :
0 ≤ kappa
implementabilityGap m a b r kappa
= implementableReducedValue m a b r kappa - relaxedReducedValue m a b r kappa
Proof (Lean source)
lemma rounding_gap_reduction (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 ≤ kappa) : implementabilityGap m a b r kappa = implementableReducedValue m a b r kappa - relaxedReducedValue m a b r kappa := by have _hk : 0 ≤ kappa := hk have hm : 2 ≤ m := hHom.1 have coord_inv : ∀ x y z : ℝ, InReducedTriangle m x y z → let u := 1 - x let v := (z - y) / (2 * (m : ℝ)) (1 - u = x) ∧ (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v = y) ∧ (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v = z) := by intro x y z htri u v rcases htri with ⟨_hx, _hy, _hz, hsum⟩ have hm0 : (m : ℝ) ≠ 0 := by have : (0 : ℕ) < m := lt_of_lt_of_le (by decide : 0 < 2) hm exact_mod_cast (ne_of_gt this) have hq : qParam m = 2 * ((m : ℝ) - 1) := rfl constructor · simp [u] constructor · dsimp [u, v] rw [hq] at hsum field_simp [hm0] nlinarith [hsum] · dsimp [u, v] rw [hq] at hsum field_simp [hm0] nlinarith [hsum] have hRel : image (designObjective m a b r kappa) (blockElliptope m a b) = { val : ℝ | ∃ x y z, InReducedTriangle m x y z ∧ val = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z } := by ext val constructor · rintro ⟨X, hX, rfl⟩ rcases hX with ⟨u, v, rfl, hmem⟩ have hspec := block_spectral_coordinates m a b r kappa u v hHom have htri : InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) := by exact hspec.1.mp ⟨u, v, rfl, hmem⟩ exact ⟨1 - u, 1 + ((m : ℝ) - 1) * u - (m : ℝ) * v, 1 + ((m : ℝ) - 1) * u + (m : ℝ) * v, htri, hspec.2.1⟩ · rintro ⟨x, y, z, htri, rfl⟩ let u : ℝ := 1 - x let v : ℝ := (z - y) / (2 * (m : ℝ)) have hcoords := coord_inv x y z htri have htri_uv : InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) := by simpa [u, v, hcoords.1, hcoords.2.1, hcoords.2.2] using htri have hspec := block_spectral_coordinates m a b r kappa u v hHom have hmem : blockSymMatrix m u v ∈ blockElliptope m a b := hspec.1.mpr htri_uv refine ⟨blockSymMatrix m u v, hmem, ?_⟩ simpa [u, v, hcoords.1, hcoords.2.1, hcoords.2.2] using hspec.2.1 have hImp : image (designObjective m a b r kappa) (implementableCovarianceClass m) = { val : ℝ | ∃ x y z, InReducedTriangle m x y z ∧ parityThreshold m ≤ y + z ∧ val = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z } := by ext val constructor · rintro ⟨X, hX, rfl⟩ rcases hX with ⟨D, hDmem, hXeq⟩ rcases secondMoment_blockSym_of_exchangeable m hm D hDmem with ⟨u, v, hblock⟩ have hslice := pm_slice_forward m hm u v D hblock have hspec := block_spectral_coordinates m a b r kappa u v hHom refine ⟨1 - u, 1 + ((m : ℝ) - 1) * u - (m : ℝ) * v, 1 + ((m : ℝ) - 1) * u + (m : ℝ) * v, hslice.1, hslice.2, ?_⟩ rw [hXeq, hblock] exact hspec.2.1 · rintro ⟨x, y, z, htri, hpar, rfl⟩ let u : ℝ := 1 - x let v : ℝ := (z - y) / (2 * (m : ℝ)) have hcoords := coord_inv x y z htri have htri_uv : InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) := by simpa [u, v, hcoords.1, hcoords.2.1, hcoords.2.2] using htri have hpar_uv : parityThreshold m ≤ (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) + (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) := by simpa [u, v, hcoords.2.1, hcoords.2.2] using hpar have himp : blockSymMatrix m u v ∈ implementableCovarianceClass m := by rw [pm_reduced_slice_characterization m hm u v] exact ⟨htri_uv, hpar_uv⟩ have hspec := block_spectral_coordinates m a b r kappa u v hHom refine ⟨blockSymMatrix m u v, himp, ?_⟩ simpa [u, v, hcoords.1, hcoords.2.1, hcoords.2.2] using hspec.2.1 unfold implementabilityGap implementableReducedValue relaxedReducedValue rw [hImp, hRel]
theorem implementabilityGap_nonneg

Range lemma for Δ_m^±. The implementability gap lands in its core-declared space [0,∞): 0 ≤ Δ_m^±(r,κ). The reduction lemma identifies it with the reduced constrained-minus-unconstrained value, whose nonnegativity is proved by roundingLossCertificate_nonneg. @realizes Delta_m^pm(r,kappa)(range [0,∞) pinned via the reduced constrained-minus-unconstrained identity)

Formal statement
m :
a b r kappa :
hHom :
hr0 :
0 ≤ r
hk :
0 ≤ kappa
0 ≤ implementabilityGap m a b r kappa
Proof (Lean source)
lemma implementabilityGap_nonneg (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hr0 : 0 ≤ r) (hk : 0 ≤ kappa) : 0 ≤ implementabilityGap m a b r kappa := by rw [rounding_gap_reduction m a b r kappa hHom hk] simpa [roundingLossCertificate] using roundingLossCertificate_nonneg m a b r kappa hHom hr0 hk
CausalSmith.Experimentation.DesignPm1.implementabilityGap_nonneg · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/GapReduction.lean:119
theorem pos_gap_of_unique_min_outside_slice

If the relaxed reduced objective has a unique minimizer outside the implementable parity slice, and the implementable reduced problem is attained, then the implementability gap is strictly positive.

Formal statement
m :
a b r kappa :
hHom :
hk :
0 ≤ kappa
X_rel X_impl :
ℝ × ℝ × ℝ
hRelMin :
InReducedTriangle m X_rel.1 X_rel.2.1 X_rel.2.2 ∧
∀ x y z,
InReducedTriangle m x y z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2
reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z
hRelUnique :
∃! t : ℝ × ℝ × ℝ
if
InReducedTriangle m t.1 t.2.1 t.2.2 ∧ ∀ x y z, InReducedTriangle m x y z
then
reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t.1 t.2.1 t.2.2
reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z
hOutside :
X_rel.2.1 + X_rel.2.2 < parityThreshold m
hImplMin :
InReducedTriangle m X_impl.1 X_impl.2.1 X_impl.2.2 ∧
parityThreshold m ≤ X_impl.2.1 + X_impl.2.2 ∧
∀ x y z,
≤ y
+ z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2
reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z
0 < implementabilityGap m a b r kappa
Proof (Lean source)
lemma pos_gap_of_unique_min_outside_slice (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 ≤ kappa) (X_rel X_impl : ℝ × ℝ × ℝ) (hRelMin : InReducedTriangle m X_rel.1 X_rel.2.1 X_rel.2.2 ∧ ∀ x y z, InReducedTriangle m x y z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z) (hRelUnique : ∃! t : ℝ × ℝ × ℝ, InReducedTriangle m t.1 t.2.1 t.2.2 ∧ ∀ x y z, InReducedTriangle m x y z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t.1 t.2.1 t.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z) (hOutside : X_rel.2.1 + X_rel.2.2 < parityThreshold m) (hImplMin : InReducedTriangle m X_impl.1 X_impl.2.1 X_impl.2.2 ∧ parityThreshold m ≤ X_impl.2.1 + X_impl.2.2 ∧ ∀ x y z, InReducedTriangle m x y z → parityThreshold m ≤ y + z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z) : 0 < implementabilityGap m a b r kappa := by let obj : ℝ × ℝ × ℝ → ℝ := fun t => reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t.1 t.2.1 t.2.2 have hImpl_ne : X_impl ≠ X_rel := by intro hEq have hpar : parityThreshold m ≤ X_rel.2.1 + X_rel.2.2 := by simpa [hEq] using hImplMin.2.1 linarith have hRel_le_impl : obj X_rel ≤ obj X_impl := hRelMin.2 X_impl.1 X_impl.2.1 X_impl.2.2 hImplMin.1 have hStrict : obj X_rel < obj X_impl := by by_contra hnot have hImpl_le_rel : obj X_impl ≤ obj X_rel := le_of_not_gt hnot have hEqObj : obj X_impl = obj X_rel := le_antisymm hImpl_le_rel hRel_le_impl have hImplRelMin : InReducedTriangle m X_impl.1 X_impl.2.1 X_impl.2.2 ∧ ∀ x y z, InReducedTriangle m x y z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := by refine ⟨hImplMin.1, ?_⟩ intro x y z hT rw [show reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2 = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2 from hEqObj] exact hRelMin.2 x y z hT rcases hRelUnique with ⟨X0, hX0, huniq⟩ have hImpl_eq : X_impl = X0 := huniq X_impl hImplRelMin have hRel_eq : X_rel = X0 := huniq X_rel hRelMin exact hImpl_ne (hImpl_eq.trans hRel_eq.symm) have hRelInf : relaxedReducedValue m a b r kappa = obj X_rel := by unfold relaxedReducedValue apply csInf_eq_of_forall_ge_of_forall_gt_exists_lt · exact ⟨obj X_rel, ⟨X_rel.1, X_rel.2.1, X_rel.2.2, hRelMin.1, rfl⟩⟩ · rintro _ ⟨x, y, z, hT, rfl⟩ exact hRelMin.2 x y z hT · intro w hw exact ⟨obj X_rel, ⟨X_rel.1, X_rel.2.1, X_rel.2.2, hRelMin.1, rfl⟩, hw⟩ have hImplInf : implementableReducedValue m a b r kappa = obj X_impl := by unfold implementableReducedValue apply csInf_eq_of_forall_ge_of_forall_gt_exists_lt · exact ⟨obj X_impl, ⟨X_impl.1, X_impl.2.1, X_impl.2.2, hImplMin.1, hImplMin.2.1, rfl⟩⟩ · rintro _ ⟨x, y, z, hT, hpar, rfl⟩ exact hImplMin.2.2 x y z hT hpar · intro w hw exact ⟨obj X_impl, ⟨X_impl.1, X_impl.2.1, X_impl.2.2, hImplMin.1, hImplMin.2.1, rfl⟩, hw⟩ rw [rounding_gap_reduction m a b r kappa hHom hk, hImplInf, hRelInf] exact sub_pos.mpr hStrict
CausalSmith.Experimentation.DesignPm1.pos_gap_of_unique_min_outside_slice · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/GapReduction.lean:132
theorem relaxedReducedValue_eq_of_min

If a reduced triangle point globally minimizes the relaxed reduced objective, then the sInf defining relaxedReducedValue is its objective value.

Formal statement
m :
a b r kappa :
X_rel :
ℝ × ℝ × ℝ
hRelMin :
InReducedTriangle m X_rel.1 X_rel.2.1 X_rel.2.2 ∧
∀ x y z,
InReducedTriangle m x y z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2
reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z
relaxedReducedValue m a b r kappa
= reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2
Proof (Lean source)
lemma relaxedReducedValue_eq_of_min (m : ℕ) (a b r kappa : ℝ) (X_rel : ℝ × ℝ × ℝ) (hRelMin : InReducedTriangle m X_rel.1 X_rel.2.1 X_rel.2.2 ∧ ∀ x y z, InReducedTriangle m x y z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z) : relaxedReducedValue m a b r kappa = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2 := by unfold relaxedReducedValue apply csInf_eq_of_forall_ge_of_forall_gt_exists_lt · exact ⟨reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2, ⟨X_rel.1, X_rel.2.1, X_rel.2.2, hRelMin.1, rfl⟩⟩ · rintro _ ⟨x, y, z, hT, rfl⟩ exact hRelMin.2 x y z hT · intro w hw exact ⟨reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2, ⟨X_rel.1, X_rel.2.1, X_rel.2.2, hRelMin.1, rfl⟩, hw⟩
CausalSmith.Experimentation.DesignPm1.relaxedReducedValue_eq_of_min · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/GapReduction.lean:211
theorem implementableReducedValue_eq_of_min

If a reduced triangle point globally minimizes the parity-truncated reduced objective, then the sInf defining implementableReducedValue is its objective value.

Formal statement
m :
a b r kappa :
X_impl :
ℝ × ℝ × ℝ
hImplMin :
InReducedTriangle m X_impl.1 X_impl.2.1 X_impl.2.2 ∧
parityThreshold m ≤ X_impl.2.1 + X_impl.2.2 ∧
∀ x y z,
≤ y
+ z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2
reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z
= reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2
Proof (Lean source)
lemma implementableReducedValue_eq_of_min (m : ℕ) (a b r kappa : ℝ) (X_impl : ℝ × ℝ × ℝ) (hImplMin : InReducedTriangle m X_impl.1 X_impl.2.1 X_impl.2.2 ∧ parityThreshold m ≤ X_impl.2.1 + X_impl.2.2 ∧ ∀ x y z, InReducedTriangle m x y z → parityThreshold m ≤ y + z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z) : implementableReducedValue m a b r kappa = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2 := by unfold implementableReducedValue apply csInf_eq_of_forall_ge_of_forall_gt_exists_lt · exact ⟨reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2, ⟨X_impl.1, X_impl.2.1, X_impl.2.2, hImplMin.1, hImplMin.2.1, rfl⟩⟩ · rintro _ ⟨x, y, z, hT, hpar, rfl⟩ exact hImplMin.2.2 x y z hT hpar · intro w hw exact ⟨reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2, ⟨X_impl.1, X_impl.2.1, X_impl.2.2, hImplMin.1, hImplMin.2.1, rfl⟩, hw⟩
CausalSmith.Experimentation.DesignPm1.implementableReducedValue_eq_of_min · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/GapReduction.lean:235
theorem exists_relaxed_reduced_minimizer

The relaxed reduced problem attains its minimum: some point of the reduced triangle minimizes the reduced objective over the whole triangle. This is the existence statement behind the relaxed value being a genuine minimum rather than only an infimum; it is proved by transporting the triangle to the weighted simplex, where the linear-plus-weighted-norm objective has an explicit minimizer (an active-set point when the robustness weight is positive, an exposed-face vertex when it is zero).

Formal statement
m :
a b r kappa :
hHom :
hk :
0 ≤ kappa
∃ X_rel : ℝ × ℝ × ℝ
if
InReducedTriangle m X_rel.1 X_rel.2.1 X_rel.2.2 ∧ ∀ x y z, InReducedTriangle m x y z
then
reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2
reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z
Proof (Lean source)
lemma exists_relaxed_reduced_minimizer (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 ≤ kappa) : ∃ X_rel : ℝ × ℝ × ℝ, InReducedTriangle m X_rel.1 X_rel.2.1 X_rel.2.2 ∧ ∀ x y z, InReducedTriangle m x y z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := by classical have hm : 2 ≤ m := hHom.1 have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm have hq : 0 < qParam m := by unfold qParam nlinarith have hq0 : 0 ≤ qParam m := le_of_lt hq have hM : 0 < 2 * (m : ℝ) := by positivity let alpha : Fin 3 → ℝ := ![cX m a b r / qParam m, cY b r, cZ m] let beta : Fin 3 → ℝ := ![1 / qParam m, 1, 1] have hbetaPos : ∀ i, 0 < beta i := by intro i fin_cases i · have : 0 < 1 / qParam m := by positivity simpa [beta] using this · simp [beta] · simp [beta] have hSimplexMin : ∃ t_rel : Fin 3 → ℝ, InSimplex (2 * (m : ℝ)) t_rel ∧ ∀ s : Fin 3 → ℝ, InSimplex (2 * (m : ℝ)) s → wsObj alpha beta kappa t_rel ≤ wsObj alpha beta kappa s := by by_cases hkpos : 0 < kappa · obtain ⟨⟨S, lam⟩, hp, _huniq⟩ := (weighted_simplex_active_set (2 * (m : ℝ)) hM alpha beta kappa hbetaPos hk).1 hkpos refine ⟨activeSetPoint (2 * (m : ℝ)) alpha beta S lam, hp.2.1, ?_⟩ intro s hs by_cases hsEq : s = activeSetPoint (2 * (m : ℝ)) alpha beta S lam · simp [hsEq] · exact le_of_lt (hp.2.2.1 s hs hsEq) · have hk0 : kappa = 0 := le_antisymm (le_of_not_gt hkpos) hk subst kappa obtain ⟨k, hkmin⟩ := (Finite.exists_min alpha : ∃ k : Fin 3, ∀ i, alpha k ≤ alpha i) let t_rel : Fin 3 → ℝ := fun i => if i = k then 2 * (m : ℝ) else 0 have hface : t_rel ∈ exposedMinFace (2 * (m : ℝ)) alpha := by refine ⟨?_, ?_⟩ · constructor · intro i dsimp [t_rel] by_cases hi : i = k · simp [hi, le_of_lt hM] · simp [hi] · dsimp [t_rel] fin_cases k <;> simp [Fin.sum_univ_three] · intro i hi j dsimp [t_rel] at hi by_cases hik : i = k · simpa [hik] using hkmin j · simp [hik] at hi exact ⟨t_rel, hface.1, exposedMinFace_isMinimizer (2 * (m : ℝ)) alpha beta t_rel hface⟩ rcases hSimplexMin with ⟨t_rel, hrelS, hrelMin⟩ let X_rel : ℝ × ℝ × ℝ := (t_rel 0 / qParam m, t_rel 1, t_rel 2) refine ⟨X_rel, by simpa [X_rel] using simplex_to_reducedTriangle m t_rel hq hrelS, ?_⟩ intro x y z hT let s : Fin 3 → ℝ := ![qParam m * x, y, z] have hsS : InSimplex (2 * (m : ℝ)) s := reducedTriangle_to_simplex m x y z hq0 hT have hle := hrelMin s hsS have hleft : wsObj alpha beta kappa t_rel = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2 := by rw [show wsObj alpha beta kappa t_rel = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa t_rel by rfl] rw [wsObj_eq_reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t_rel (ne_of_gt hq)] have hright : wsObj alpha beta kappa s = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := by rw [show wsObj alpha beta kappa s = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa s by rfl] rw [reducedObjective_eq_wsObj (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z (ne_of_gt hq)] simpa [hleft, hright] using hle
CausalSmith.Experimentation.DesignPm1.exists_relaxed_reduced_minimizer · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/GapReduction.lean:261
theorem exists_implementable_reduced_minimizer

The implementable reduced problem attains its minimum: some point of the reduced triangle satisfies the parity constraint and minimizes the reduced objective over all triangle points that satisfy it. This is the parity-truncated counterpart of exists_relaxed_reduced_minimizer, and it is what makes the implementability gap a difference of two attained minima.

Formal statement
m :
a b r kappa :
hHom :
hk :
0 ≤ kappa
∃ X_impl : ℝ × ℝ × ℝ
if
InReducedTriangle m X_impl.1 X_impl.2.1 X_impl.2.2 ∧
parityThreshold m ≤ X_impl.2.1 + X_impl.2.2 ∧
∀ x y z, InReducedTriangle m x y z
and
parityThreshold m ≤ y + z
then
reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2
reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z
Proof (Lean source)
lemma exists_implementable_reduced_minimizer (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 ≤ kappa) : ∃ X_impl : ℝ × ℝ × ℝ, InReducedTriangle m X_impl.1 X_impl.2.1 X_impl.2.2 ∧ parityThreshold m ≤ X_impl.2.1 + X_impl.2.2 ∧ ∀ x y z, InReducedTriangle m x y z → parityThreshold m ≤ y + z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := by classical have hm : 2 ≤ m := hHom.1 have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm have hmpos : 0 < (m : ℝ) := by positivity have hq : 0 < qParam m := by unfold qParam nlinarith have hq0 : 0 ≤ qParam m := le_of_lt hq have hM : 0 < 2 * (m : ℝ) := by positivity let alpha : Fin 3 → ℝ := ![cX m a b r / qParam m, cY b r, cZ m] let beta : Fin 3 → ℝ := ![1 / qParam m, 1, 1] have hbetaPos : ∀ i, 0 < beta i := by intro i fin_cases i · have : 0 < 1 / qParam m := by positivity simpa [beta] using this · simp [beta] · simp [beta] have hbetaY : beta 1 = 1 := by simp [beta] have hbetaZ : beta 2 = 1 := by simp [beta] have hd0 : 0 ≤ parityThreshold m := by unfold parityThreshold by_cases hEven : Even m · rw [if_pos hEven] · rw [if_neg hEven] positivity have hdM : parityThreshold m ≤ 2 * (m : ℝ) := by unfold parityThreshold by_cases hEven : Even m · rw [if_pos hEven] positivity · rw [if_neg hEven] have : 2 / (m : ℝ) ≤ 2 * (m : ℝ) := by rw [div_le_iff₀ hmpos] nlinarith [sq_nonneg ((m : ℝ) - 1)] exact this obtain ⟨X_rel, hRelMin⟩ := exists_relaxed_reduced_minimizer m a b r kappa hHom hk let t_rel : Fin 3 → ℝ := ![qParam m * X_rel.1, X_rel.2.1, X_rel.2.2] have hrelS : InSimplex (2 * (m : ℝ)) t_rel := reducedTriangle_to_simplex m X_rel.1 X_rel.2.1 X_rel.2.2 hq0 hRelMin.1 have hrelWsMin : ∀ s : Fin 3 → ℝ, InSimplex (2 * (m : ℝ)) s → wsObj alpha beta kappa t_rel ≤ wsObj alpha beta kappa s := by intro s hs have hsRed := simplex_to_reducedTriangle m s hq hs have hle := hRelMin.2 (s 0 / qParam m) (s 1) (s 2) hsRed have hleft : wsObj alpha beta kappa t_rel = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2 := by rw [show wsObj alpha beta kappa t_rel = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa t_rel by rfl] rw [reducedObjective_eq_wsObj (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2 (ne_of_gt hq)] have hright : wsObj alpha beta kappa s = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa (s 0 / qParam m) (s 1) (s 2) := by rw [show wsObj alpha beta kappa s = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa s by rfl] exact wsObj_eq_reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa s (ne_of_gt hq) simpa [hleft, hright] using hle obtain ⟨htruncFeasOfFeas, htruncOfInfeas⟩ := trunc_from_minimizer (2 * (m : ℝ)) (parityThreshold m) hdM alpha beta kappa (hbetaPos 0).le hbetaY hbetaZ hk t_rel hrelS hrelWsMin by_cases hfeas : parityThreshold m ≤ t_rel 1 + t_rel 2 · let X_impl : ℝ × ℝ × ℝ := (t_rel 0 / qParam m, t_rel 1, t_rel 2) have htruncMin := htruncFeasOfFeas ⟨hrelS, hfeas⟩ refine ⟨X_impl, by simpa [X_impl] using simplex_to_reducedTriangle m t_rel hq hrelS, by simpa [X_impl] using hfeas, ?_⟩ intro x y z hT hpar let s : Fin 3 → ℝ := ![qParam m * x, y, z] have hsS : InSimplex (2 * (m : ℝ)) s := reducedTriangle_to_simplex m x y z hq0 hT have hsTrunc : InTruncSimplex (2 * (m : ℝ)) (parityThreshold m) s := ⟨hsS, by simpa [s] using hpar⟩ have hle := htruncMin s hsTrunc have hleft : wsObj alpha beta kappa t_rel = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2 := by rw [show wsObj alpha beta kappa t_rel = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa t_rel by rfl] rw [wsObj_eq_reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t_rel (ne_of_gt hq)] have hright : wsObj alpha beta kappa s = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := by rw [show wsObj alpha beta kappa s = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa s by rfl] rw [reducedObjective_eq_wsObj (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z (ne_of_gt hq)] simpa [hleft, hright] using hle · obtain ⟨htruncFeas, htruncMin⟩ := htruncOfInfeas hfeas let t_impl : Fin 3 → ℝ := truncSegPoint (2 * (m : ℝ)) (parityThreshold m) (truncSelector (2 * (m : ℝ)) (parityThreshold m) alpha beta kappa) let X_impl : ℝ × ℝ × ℝ := (t_impl 0 / qParam m, t_impl 1, t_impl 2) refine ⟨X_impl, by simpa [X_impl, t_impl] using simplex_to_reducedTriangle m t_impl hq htruncFeas.1, by simpa [X_impl, t_impl] using htruncFeas.2, ?_⟩ intro x y z hT hpar let s : Fin 3 → ℝ := ![qParam m * x, y, z] have hsS : InSimplex (2 * (m : ℝ)) s := reducedTriangle_to_simplex m x y z hq0 hT have hsTrunc : InTruncSimplex (2 * (m : ℝ)) (parityThreshold m) s := ⟨hsS, by simpa [s] using hpar⟩ have hle := htruncMin s hsTrunc have hleft : wsObj alpha beta kappa t_impl = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2 := by rw [show wsObj alpha beta kappa t_impl = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa t_impl by rfl] rw [wsObj_eq_reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t_impl (ne_of_gt hq)] have hright : wsObj alpha beta kappa s = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := by rw [show wsObj alpha beta kappa s = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa s by rfl] rw [reducedObjective_eq_wsObj (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z (ne_of_gt hq)] simpa [t_impl, hleft, hright] using hle
CausalSmith.Experimentation.DesignPm1.exists_implementable_reduced_minimizer · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/GapReduction.lean:353
theorem implementabilityGap_nonneg_of_reduced_minimizers

The implementability gap is never negative: restricting a design to be realizable by an actual ±1 assignment law can only raise the achievable objective value. Formally, both reduced problems attain their minima and the implementable problem optimizes over a subset of the relaxed feasible set, so its minimum dominates. This is the range condition for Δ_m^± promised in the definition of implementabilityGap.

Formal statement
m :
a b r kappa :
hHom :
hk :
0 ≤ kappa
0 ≤ implementabilityGap m a b r kappa
Proof (Lean source)
lemma implementabilityGap_nonneg_of_reduced_minimizers (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 ≤ kappa) : 0 ≤ implementabilityGap m a b r kappa := by obtain ⟨X_rel, hRelMin⟩ := exists_relaxed_reduced_minimizer m a b r kappa hHom hk obtain ⟨X_impl, hImplMin⟩ := exists_implementable_reduced_minimizer m a b r kappa hHom hk have hRelVal := relaxedReducedValue_eq_of_min m a b r kappa X_rel hRelMin have hImplVal := implementableReducedValue_eq_of_min m a b r kappa X_impl hImplMin have hle : reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2 := hRelMin.2 X_impl.1 X_impl.2.1 X_impl.2.2 hImplMin.1 rw [rounding_gap_reduction m a b r kappa hHom hk, hImplVal, hRelVal] exact sub_nonneg.mpr hle
CausalSmith.Experimentation.DesignPm1.implementabilityGap_nonneg_of_reduced_minimizers · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/GapReduction.lean:499
theorem zero_gap_iff_argmin_meets_slice

Zero implementability gap is equivalent to the relaxed argmin set meeting the implementable parity slice.

Formal statement
m :
a b r kappa :
hHom :
hk :
0 ≤ kappa
implementabilityGap m a b r kappa
= 0 ↔ ∃ x y z, InReducedTriangle m x y z ∧ (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ∧ parityThreshold m ≤ y
+ z
Proof (Lean source)
lemma zero_gap_iff_argmin_meets_slice (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 ≤ kappa) : implementabilityGap m a b r kappa = 0 ↔ ∃ x y z, InReducedTriangle m x y z ∧ (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ∧ parityThreshold m ≤ y + z := by obtain ⟨X_rel, hRelMin⟩ := exists_relaxed_reduced_minimizer m a b r kappa hHom hk obtain ⟨X_impl, hImplMin⟩ := exists_implementable_reduced_minimizer m a b r kappa hHom hk have hRelVal := relaxedReducedValue_eq_of_min m a b r kappa X_rel hRelMin have hImplVal := implementableReducedValue_eq_of_min m a b r kappa X_impl hImplMin constructor · intro hgap have hvalEq : reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2 = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2 := by have hsub : implementableReducedValue m a b r kappa - relaxedReducedValue m a b r kappa = 0 := by simpa [rounding_gap_reduction m a b r kappa hHom hk] using hgap have hEq := sub_eq_zero.mp hsub linarith refine ⟨X_impl.1, X_impl.2.1, X_impl.2.2, hImplMin.1, ?_, hImplMin.2.1⟩ intro x y z hT rw [hvalEq] exact hRelMin.2 x y z hT · rintro ⟨x, y, z, hT, hRelMinAt, hpar⟩ have hRelValAt : relaxedReducedValue m a b r kappa = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := relaxedReducedValue_eq_of_min m a b r kappa (x, y, z) ⟨hT, hRelMinAt⟩ have hImpl_le : reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := hImplMin.2.2 x y z hT hpar have hRel_le : reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2 := hRelMinAt X_impl.1 X_impl.2.1 X_impl.2.2 hImplMin.1 have hObjEq : reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2 = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := le_antisymm hImpl_le hRel_le rw [rounding_gap_reduction m a b r kappa hHom hk, hImplVal, hRelValAt, hObjEq] ring
CausalSmith.Experimentation.DesignPm1.zero_gap_iff_argmin_meets_slice · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/GapReduction.lean:520
theorem zero_gap_iff_unique_min_in_slice

In the unique-relaxed-minimizer case (in particular the κ > 0 active-set case), zero gap is equivalent to that unique minimizer lying in the parity slice.

Formal statement
m :
a b r kappa :
hHom :
hk :
0 ≤ kappa
_hkpos :
0 < kappa
X_rel :
ℝ × ℝ × ℝ
hRelMin :
InReducedTriangle m X_rel.1 X_rel.2.1 X_rel.2.2 ∧
∀ x y z,
InReducedTriangle m x y z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2
reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z
hRelUnique :
∃! t : ℝ × ℝ × ℝ
if
InReducedTriangle m t.1 t.2.1 t.2.2 ∧ ∀ x y z, InReducedTriangle m x y z
then
reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t.1 t.2.1 t.2.2
reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z
implementabilityGap m a b r kappa = 0 ↔ parityThreshold m ≤ X_rel.2.1 + X_rel.2.2
Proof (Lean source)
lemma zero_gap_iff_unique_min_in_slice (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 ≤ kappa) (_hkpos : 0 < kappa) (X_rel : ℝ × ℝ × ℝ) (hRelMin : InReducedTriangle m X_rel.1 X_rel.2.1 X_rel.2.2 ∧ ∀ x y z, InReducedTriangle m x y z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z) (hRelUnique : ∃! t : ℝ × ℝ × ℝ, InReducedTriangle m t.1 t.2.1 t.2.2 ∧ ∀ x y z, InReducedTriangle m x y z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t.1 t.2.1 t.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z) : implementabilityGap m a b r kappa = 0 ↔ parityThreshold m ≤ X_rel.2.1 + X_rel.2.2 := by constructor · intro hgap rcases (zero_gap_iff_argmin_meets_slice m a b r kappa hHom hk).1 hgap with ⟨x, y, z, hT, hMin, hpar⟩ rcases hRelUnique with ⟨X0, _hX0, huniq⟩ have hxyz_eq : ((x, y, z) : ℝ × ℝ × ℝ) = X0 := huniq (x, y, z) ⟨hT, hMin⟩ have hrel_eq : X_rel = X0 := huniq X_rel hRelMin have hcoord : (x, y, z) = X_rel := hxyz_eq.trans hrel_eq.symm have hy : y = X_rel.2.1 := congrArg (fun p : ℝ × ℝ × ℝ => p.2.1) hcoord have hz : z = X_rel.2.2 := congrArg (fun p : ℝ × ℝ × ℝ => p.2.2) hcoord simpa [hy, hz] using hpar · intro hpar exact (zero_gap_iff_argmin_meets_slice m a b r kappa hHom hk).2 ⟨X_rel.1, X_rel.2.1, X_rel.2.2, hRelMin.1, hRelMin.2, hpar⟩
CausalSmith.Experimentation.DesignPm1.zero_gap_iff_unique_min_in_slice · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/GapReduction.lean:573
theorem zero_gap_iff_unique_argmin_subset_slice

Unique-minimizer form matching the sharp_rho_star clause: with a unique relaxed minimizer, zero gap is equivalent to every relaxed minimizer lying in the parity slice.

Formal statement
m :
a b r kappa :
hHom :
hk :
0 ≤ kappa
hkpos :
0 < kappa
hRelUnique :
∃! t : ℝ × ℝ × ℝ
if
InReducedTriangle m t.1 t.2.1 t.2.2 ∧ ∀ x y z, InReducedTriangle m x y z
then
reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t.1 t.2.1 t.2.2
reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z
implementabilityGap m a b r kappa
= 0 ↔ ∀ x y z, InReducedTriangle m x y z → (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') → parityThreshold m ≤ y
+ z
Proof (Lean source)
lemma zero_gap_iff_unique_argmin_subset_slice (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 ≤ kappa) (hkpos : 0 < kappa) (hRelUnique : ∃! t : ℝ × ℝ × ℝ, InReducedTriangle m t.1 t.2.1 t.2.2 ∧ ∀ x y z, InReducedTriangle m x y z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t.1 t.2.1 t.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z) : implementabilityGap m a b r kappa = 0 ↔ ∀ x y z, InReducedTriangle m x y z → (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') → parityThreshold m ≤ y + z := by constructor · intro hgap x y z hT hMin rcases hRelUnique with ⟨X_rel, hRelMin, huniq⟩ have hSlice := (zero_gap_iff_unique_min_in_slice m a b r kappa hHom hk hkpos X_rel hRelMin ⟨X_rel, hRelMin, huniq⟩).1 hgap have hxyz_eq : ((x, y, z) : ℝ × ℝ × ℝ) = X_rel := huniq (x, y, z) ⟨hT, hMin⟩ have hy : y = X_rel.2.1 := congrArg (fun p : ℝ × ℝ × ℝ => p.2.1) hxyz_eq have hz : z = X_rel.2.2 := congrArg (fun p : ℝ × ℝ × ℝ => p.2.2) hxyz_eq simpa [hy, hz] using hSlice · intro hall rcases hRelUnique with ⟨X_rel, hRelMin, huniq⟩ exact (zero_gap_iff_unique_min_in_slice m a b r kappa hHom hk hkpos X_rel hRelMin ⟨X_rel, hRelMin, huniq⟩).2 (hall X_rel.1 X_rel.2.1 X_rel.2.2 hRelMin.1 hRelMin.2)
CausalSmith.Experimentation.DesignPm1.zero_gap_iff_unique_argmin_subset_slice · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/GapReduction.lean:606
theorem pos_gap_kappa_zero_exposed_face

At κ = 0, if the exposed relaxed min-face is disjoint from the implementable slice, then the implementability gap is strictly positive.

Formal statement
m :
a b r :
hHom :
hDisjoint :
∀ t : Fin 3 → ℝ
if
t ∈ exposedMinFace (2 * (m : ℝ)) ![cX m a b r / qParam m, cY b r, cZ m]
then
¬ parityThreshold m ≤ t 1 + t 2
0 < implementabilityGap m a b r 0
Proof (Lean source)
lemma pos_gap_kappa_zero_exposed_face (m : ℕ) (a b r : ℝ) (hHom : TwoBlockHomophily m a b) (hDisjoint : ∀ t : Fin 3 → ℝ, t ∈ exposedMinFace (2 * (m : ℝ)) ![cX m a b r / qParam m, cY b r, cZ m] → ¬ parityThreshold m ≤ t 1 + t 2) : 0 < implementabilityGap m a b r 0 := by classical have hm : 2 ≤ m := hHom.1 have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm have hq : 0 < qParam m := by unfold qParam nlinarith have hq0 : 0 ≤ qParam m := le_of_lt hq have hM : 0 < 2 * (m : ℝ) := by positivity let alpha : Fin 3 → ℝ := ![cX m a b r / qParam m, cY b r, cZ m] let beta : Fin 3 → ℝ := ![1 / qParam m, 1, 1] have hNoMeet : ¬ ∃ x y z, InReducedTriangle m x y z ∧ (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) 0 x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) 0 x' y' z') ∧ parityThreshold m ≤ y + z := by rintro ⟨x, y, z, hT, hMin, hpar⟩ let t : Fin 3 → ℝ := ![qParam m * x, y, z] have htS : InSimplex (2 * (m : ℝ)) t := reducedTriangle_to_simplex m x y z hq0 hT have hwsMin : ∀ s : Fin 3 → ℝ, InSimplex (2 * (m : ℝ)) s → wsObj alpha beta 0 t ≤ wsObj alpha beta 0 s := by intro s hs have hsRed := simplex_to_reducedTriangle m s hq hs have hle := hMin (s 0 / qParam m) (s 1) (s 2) hsRed have hleft : wsObj alpha beta 0 t = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) 0 x y z := by rw [show wsObj alpha beta 0 t = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] 0 t by rfl] rw [reducedObjective_eq_wsObj (qParam m) (cX m a b r) (cY b r) (cZ m) 0 x y z (ne_of_gt hq)] have hright : wsObj alpha beta 0 s = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) 0 (s 0 / qParam m) (s 1) (s 2) := by rw [show wsObj alpha beta 0 s = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] 0 s by rfl] exact wsObj_eq_reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) 0 s (ne_of_gt hq) simpa [hleft, hright] using hle have hface : t ∈ exposedMinFace (2 * (m : ℝ)) alpha := (kappa_zero_face (2 * (m : ℝ)) alpha t).1 ⟨htS, by simpa [wsObj] using hwsMin⟩ exact (hDisjoint t (by simpa [alpha] using hface)) (by simpa [t] using hpar) have hne : implementabilityGap m a b r 0 ≠ 0 := by intro hgap exact hNoMeet ((zero_gap_iff_argmin_meets_slice m a b r 0 hHom le_rfl).1 hgap) have hnonneg : 0 ≤ implementabilityGap m a b r 0 := implementabilityGap_nonneg_of_reduced_minimizers m a b r 0 hHom le_rfl exact lt_of_le_of_ne hnonneg (Ne.symm hne)
CausalSmith.Experimentation.DesignPm1.pos_gap_kappa_zero_exposed_face · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/GapReduction.lean:637
Helpers.ParitySlice 3 declarations After full two-block symmetrization, the ±1 covariance image in spectral coordinates is T_m (m even) or T_m ∩ {y+z ≥ 2/m} (m odd), via y + z = m⁻¹ E[S_A² + S_B²] and the parity bound S_A², S_B² ≥ 1 for odd m.

±1 reduced-slice characterization (parity content)

After full two-block symmetrization, the ±1 covariance image in spectral coordinates is T_m (m even) or T_m ∩ {y+z ≥ 2/m} (m odd), via y + z = m⁻¹ E[S_A² + S_B²] and the parity bound S_A², S_B² ≥ 1 for odd m.

theorem pm_reduced_slice_characterization Lemma 5 in the paper ↗

The ±1 covariance image of the block-exchangeable class in spectral coordinates is exactly the reduced triangle truncated by the parity threshold d_m (0 for even m, 2/m for odd m). In particular, for odd m the spread vertex (m/(m−1), 0, 0) is not implementable, while for even m the whole slice is.

Formal statement
m :
hm :
2 ≤ m
u v :
↔ (InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) ∧ parityThreshold m ≤ (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) + (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v))
Proof (Lean source)
lemma pm_reduced_slice_characterization (m : ℕ) (hm : 2 ≤ m) (u v : ℝ) : blockSymMatrix m u v ∈ implementableCovarianceClass m ↔ (InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) ∧ parityThreshold m ≤ (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) + (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v)) := by constructor · rintro ⟨D, hDmem, hDeq⟩ exact pm_slice_forward m hm u v D hDeq.symm · rintro ⟨htri, hpar⟩ exact pm_slice_backward m hm u v htri hpar
CausalSmith.Experimentation.DesignPm1.pm_reduced_slice_characterization · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/ParitySlice.lean:21
theorem blockElliptope_subset_implementable_of_even

For even m, the whole block elliptope slice is implementable.

Formal statement
m :
a b :
hEven :
Proof (Lean source)
lemma blockElliptope_subset_implementable_of_even (m : ℕ) (a b : ℝ) (hEven : Even m) : blockElliptope m a b ⊆ implementableCovarianceClass m := by intro X hX rcases hX with ⟨u, v, hXeq, hmem⟩ subst X rw [pm_reduced_slice_characterization m hmem.homophily.1] constructor · simp [InReducedTriangle, qParam, hmem.psd_x, hmem.psd_y, hmem.psd_z] ring · simp [parityThreshold, hEven] linarith [hmem.psd_y, hmem.psd_z]
CausalSmith.Experimentation.DesignPm1.blockElliptope_subset_implementable_of_even · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/ParitySlice.lean:41
theorem spreadCovariance_not_implementable_of_odd

For odd m ≥ 2, the spread covariance is not ±1 implementable.

Formal statement
m :
hm :
2 ≤ m
hOdd :
Odd m
Proof (Lean source)
lemma spreadCovariance_not_implementable_of_odd (m : ℕ) (hm : 2 ≤ m) (hOdd : Odd m) : spreadCovariance m ∉ implementableCovarianceClass m := by intro h rw [spreadCovariance, pm_reduced_slice_characterization m hm] at h have hNotEven : ¬ Even m := Nat.not_even_iff_odd.mpr hOdd have hm_ne : (m : ℝ) - 1 ≠ 0 := by have hmR : (1 : ℝ) < (m : ℝ) := by exact_mod_cast (Nat.lt_of_succ_le hm) linarith have hm_pos : (0 : ℝ) < (m : ℝ) := by have : (0 : ℕ) < m := lt_of_lt_of_le (by decide : 0 < 2) hm exact_mod_cast this have hyz : 1 + ((m : ℝ) - 1) * (-1 / ((m : ℝ) - 1)) + (1 + ((m : ℝ) - 1) * (-1 / ((m : ℝ) - 1))) = 0 := by field_simp [hm_ne] ring have hthr : 0 < 2 / (m : ℝ) := div_pos (by norm_num) hm_pos simp [InReducedTriangle, parityThreshold, hNotEven, qParam] at h nlinarith [h.2, hyz, hthr]
CausalSmith.Experimentation.DesignPm1.spreadCovariance_not_implementable_of_odd · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/ParitySlice.lean:54
Helpers.ParitySliceDesigns 2 declarations Every point of the parity-truncated reduced triangle is the second moment of a block-exchangeable ±1 design.

±1 reduced-slice characterization: the backward (sufficiency) direction

Every point of the parity-truncated reduced triangle is the second moment of a block-exchangeable ±1 design. For even m the point is the barycentric mixture (y/2m)·cut + (z/2m)·all + (x·(m−1)/m)·spread of the three triangle vertices; for odd m the origin is unavailable and the region is a quadrilateral cut off at y+z = 2/m, handled by pm_slice_backward_odd.

theorem pm_slice_backward_even

Backward direction, even m: the barycentric 3-vertex mixture.

Formal statement
m :
hm :
2 ≤ m
hEven :
u v :
htri :
InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v)
Proof (Lean source)
lemma pm_slice_backward_even (m : ℕ) (hm : 2 ≤ m) (hEven : Even m) (u v : ℝ) (htri : InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v)) : blockSymMatrix m u v ∈ implementableCovarianceClass m := by obtain ⟨hx, hy, hz, htrace⟩ := htri set x : ℝ := 1 - u with hxdef set y : ℝ := 1 + ((m : ℝ) - 1) * u - (m : ℝ) * v with hydef set z : ℝ := 1 + ((m : ℝ) - 1) * u + (m : ℝ) * v with hzdef have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm have hm0 : (0 : ℝ) < (m : ℝ) := by linarith have hm1 : (0 : ℝ) < (m : ℝ) - 1 := by linarith -- weights, components, and vertex coordinates let w : Fin 3 → ℝ := ![y / (2 * m), z / (2 * m), x * ((m : ℝ) - 1) / m] let Ds : Fin 3 → FiniteDesign (Fin (2 * m) → Bool) := ![cutVDesign m, allVDesign m, spreadVDesign m hEven] let uu : Fin 3 → ℝ := ![1, 1, -1 / ((m : ℝ) - 1)] let vv : Fin 3 → ℝ := ![-1, 1, 0] have hw0 : ∀ i, 0 ≤ w i := by intro i fin_cases i <;> simp only [w, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons, Matrix.cons_val_two, Matrix.tail_cons] · exact div_nonneg hy (by positivity) · exact div_nonneg hz (by positivity) · apply div_nonneg _ (le_of_lt hm0); exact mul_nonneg hx (le_of_lt hm1) have hw1 : ∑ i, w i = 1 := by simp only [w, Fin.sum_univ_three, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons, Matrix.cons_val_two, Matrix.tail_cons] have hqp : qParam m = 2 * ((m : ℝ) - 1) := rfl rw [hqp] at htrace field_simp nlinarith [htrace] refine ⟨mixtureDesign m w Ds hw0 hw1, mixtureDesign_mem m w Ds hw0 hw1 ?_, ?_⟩ · intro i fin_cases i <;> simp only [Ds, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons, Matrix.cons_val_two, Matrix.tail_cons] · exact cutVDesign_mem m · exact allVDesign_mem m · exact spreadVDesign_mem m hEven · have hSM := mixtureDesign_secondMoment m w Ds hw0 hw1 uu vv ?_ · rw [hSM] congr 1 · -- ∑ w_i uu_i = u simp only [w, uu, Fin.sum_univ_three, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons, Matrix.cons_val_two, Matrix.tail_cons] have hqp : qParam m = 2 * ((m : ℝ) - 1) := rfl rw [hqp] at htrace field_simp nlinarith [htrace] · -- ∑ w_i vv_i = v simp only [w, vv, Fin.sum_univ_three, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons, Matrix.cons_val_two, Matrix.tail_cons] field_simp ring · intro i fin_cases i <;> simp only [Ds, uu, vv, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons, Matrix.cons_val_two, Matrix.tail_cons] · exact cutVDesign_secondMoment m · exact allVDesign_secondMoment m · exact spreadVDesign_secondMoment m hm hEven
theorem pm_slice_backward

Backward (sufficiency) direction. Any parity-truncated reduced-triangle point is realized by a block-exchangeable ±1 design.

Formal statement
m :
hm :
2 ≤ m
u v :
htri :
InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v)
hpar :
≤ (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) + (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v)
Proof (Lean source)
lemma pm_slice_backward (m : ℕ) (hm : 2 ≤ m) (u v : ℝ) (htri : InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v)) (hpar : parityThreshold m ≤ (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) + (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v)) : blockSymMatrix m u v ∈ implementableCovarianceClass m := by by_cases hEven : Even m · exact pm_slice_backward_even m hm hEven u v htri · exact pm_slice_backward_odd m hm (Nat.not_even_iff_odd.mp hEven) u v htri hpar
Helpers.ParitySliceForward 16 declarations If a ±1 design D realizes the block-symmetric second moment X(u,v) (i.e.

±1 reduced-slice characterization: the forward (necessity) direction

If a ±1 design D realizes the block-symmetric second moment X(u,v) (i.e. E_D[Z Zᵀ] = X(u,v)), then its reduced spectral coordinates x = 1−u, y = 1+(m−1)u−mv, z = 1+(m−1)u+mv are nonnegative (PSD of a Gram matrix) and satisfy the parity bound y + z ≥ d_m (0 for even m, 2/m for odd m). The whole argument is elementary second-moment algebra: reading the matrix entries 1 (diagonal), u (within-block), v (across-block), the block sums S_A = ∑_{i∈A} Z_i, S_B = ∑_{i∈B} Z_i satisfy E[S_A²] = E[S_B²] = m + m(m−1)u, E[S_A S_B] = m² v, whence E[(S_A−S_B)²] = 2m·y ≥ 0, E[(S_A+S_B)²] = 2m·z ≥ 0, and for odd m the parity S_A, S_B odd forces E[S_A²], E[S_B²] ≥ 1, so y+z = (E[S_A²]+E[S_B²])/m ≥ 2/m.

def blockAFin

Community A_m = {i : i.val < m} as a Finset.

Definition (Lean source)
def blockAFin (m : ℕ) : Finset (Fin (2 * m)) := Finset.univ.filter (fun i : Fin (2 * m) => i.val < m)
def blockBFin

Community B_m = {i : ¬ i.val < m} as a Finset.

Definition (Lean source)
def blockBFin (m : ℕ) : Finset (Fin (2 * m)) := Finset.univ.filter (fun i : Fin (2 * m) => ¬ i.val < m)
def sumAr

The real community sum S_A(z) = ∑_{i ∈ A_m} Z_i.

Definition (Lean source)
noncomputable def sumAr (m : ℕ) (z : Fin (2 * m) → Bool) : ℝ := ∑ i ∈ blockAFin m, signOf m z i
def sumBr

The real community sum S_B(z) = ∑_{i ∈ B_m} Z_i.

Definition (Lean source)
noncomputable def sumBr (m : ℕ) (z : Fin (2 * m) → Bool) : ℝ := ∑ i ∈ blockBFin m, signOf m z i
theorem signOf_sq

Each ±1 sign squares to 1.

Formal statement
m :
z :
Fin (2 * m) → Bool
i :
Fin (2 * m)
signOf m z i * signOf m z i = 1
Proof (Lean source)
lemma signOf_sq (m : ℕ) (z : Fin (2 * m) → Bool) (i : Fin (2 * m)) : signOf m z i * signOf m z i = 1 := by unfold signOf; split <;> ring
theorem card_blockAFin

|A_m| = m.

Formal statement
m :
(blockAFin m).card = m
Proof (Lean source)
lemma card_blockAFin (m : ℕ) : (blockAFin m).card = m := by unfold blockAFin refine Finset.card_eq_of_bijective (fun i hi => (⟨i, by omega⟩ : Fin (2 * m))) ?surj ?mem ?inj · intro a ha simp only [mem_filter, Finset.mem_univ, true_and] at ha exact ⟨a.val, ha, Fin.ext rfl⟩ · intro i hi simp [hi] · intro i j hi hj h exact congrArg val h
theorem card_blockBFin

|B_m| = m.

Formal statement
m :
(blockBFin m).card = m
Proof (Lean source)
lemma card_blockBFin (m : ℕ) : (blockBFin m).card = m := by unfold blockBFin refine Finset.card_eq_of_bijective (fun i hi => (⟨m + i, by omega⟩ : Fin (2 * m))) ?surj ?mem ?inj · intro a ha simp only [mem_filter, Finset.mem_univ, true_and] at ha refine ⟨a.val - m, by omega, ?_⟩ apply Fin.ext simp omega · intro i hi simp only [mem_filter, Finset.mem_univ, true_and] omega · intro i j hi hj h have := congrArg val h simp at this omega
theorem secondMoment_entry

The design second-moment entries read off from X(u,v): the (i,j) entry is 1 on the diagonal, u within a block, v across blocks.

Formal statement
m :
u v :
D :
FiniteDesign (Fin (2 * m) → Bool)
i j :
Fin (2 * m)
D.E (fun z => signOf m z i * signOf m z j) = blockSymMatrix m u v i j
Proof (Lean source)
lemma secondMoment_entry (m : ℕ) (u v : ℝ) (D : FiniteDesign (Fin (2 * m) → Bool)) (hD : assignmentSecondMoment m D = blockSymMatrix m u v) (i j : Fin (2 * m)) : D.E (fun z => signOf m z i * signOf m z j) = blockSymMatrix m u v i j := by have := congrFun (congrFun hD i) j simpa [assignmentSecondMoment] using this
theorem E_sumAr_sq

E[S_A²] = m + m(m−1) u (and identically E[S_B²]).

Formal statement
m :
u v :
D :
FiniteDesign (Fin (2 * m) → Bool)
D.E (fun z => sumAr m z * sumAr m z) = (m : ℝ) + (m : ℝ) * ((m : ℝ) - 1) * u
Proof (Lean source)
lemma E_sumAr_sq (m : ℕ) (u v : ℝ) (D : FiniteDesign (Fin (2 * m) → Bool)) (hD : assignmentSecondMoment m D = blockSymMatrix m u v) : D.E (fun z => sumAr m z * sumAr m z) = (m : ℝ) + (m : ℝ) * ((m : ℝ) - 1) * u := by let A := blockAFin m have hE : D.E (fun z => sumAr m z * sumAr m z) = ∑ i ∈ A, ∑ j ∈ A, D.E (fun z => signOf m z i * signOf m z j) := by calc D.E (fun z => sumAr m z * sumAr m z) = D.E (fun z => ∑ i ∈ A, ∑ j ∈ A, signOf m z i * signOf m z j) := by apply D.E_congr intro z simp [sumAr, A, Finset.sum_mul_sum] _ = ∑ i ∈ A, D.E (fun z => ∑ j ∈ A, signOf m z i * signOf m z j) := by rw [D.E_sum] _ = ∑ i ∈ A, ∑ j ∈ A, D.E (fun z => signOf m z i * signOf m z j) := by apply Finset.sum_congr rfl intro i hi rw [D.E_sum] calc D.E (fun z => sumAr m z * sumAr m z) = ∑ i ∈ A, ∑ j ∈ A, (if i = j then (1 : ℝ) else u) := by rw [hE] apply Finset.sum_congr rfl intro i hi apply Finset.sum_congr rfl intro j hj rw [secondMoment_entry m u v D hD, blockSymMatrix_AA m u v hi hj] _ = (A.card : ℝ) * 1 + (A.card : ℝ) * ((A.card - 1 : ℕ) : ℝ) * u := by exact sum_sum_if_eq_else A 1 u _ = (m : ℝ) + (m : ℝ) * ((m : ℝ) - 1) * u := by subst A rw [card_blockAFin] cases m <;> simp
theorem E_sumBr_sq

E[S_B²] = m + m(m−1) u: whenever a design's assignment second moment is the block-symmetric matrix X(u,v), the mean square of the community-B sign sum depends only on the common within-block correlation u (not on the across-block entry v), and equals the corresponding community-A quantity. The two blocks have the same size m, so this is the mirror image of E_sumAr_sq.

Formal statement
m :
u v :
D :
FiniteDesign (Fin (2 * m) → Bool)
D.E (fun z => sumBr m z * sumBr m z) = (m : ℝ) + (m : ℝ) * ((m : ℝ) - 1) * u
Proof (Lean source)
lemma E_sumBr_sq (m : ℕ) (u v : ℝ) (D : FiniteDesign (Fin (2 * m) → Bool)) (hD : assignmentSecondMoment m D = blockSymMatrix m u v) : D.E (fun z => sumBr m z * sumBr m z) = (m : ℝ) + (m : ℝ) * ((m : ℝ) - 1) * u := by let B := blockBFin m have hE : D.E (fun z => sumBr m z * sumBr m z) = ∑ i ∈ B, ∑ j ∈ B, D.E (fun z => signOf m z i * signOf m z j) := by calc D.E (fun z => sumBr m z * sumBr m z) = D.E (fun z => ∑ i ∈ B, ∑ j ∈ B, signOf m z i * signOf m z j) := by apply D.E_congr intro z simp [sumBr, B, Finset.sum_mul_sum] _ = ∑ i ∈ B, D.E (fun z => ∑ j ∈ B, signOf m z i * signOf m z j) := by rw [D.E_sum] _ = ∑ i ∈ B, ∑ j ∈ B, D.E (fun z => signOf m z i * signOf m z j) := by apply Finset.sum_congr rfl intro i hi rw [D.E_sum] calc D.E (fun z => sumBr m z * sumBr m z) = ∑ i ∈ B, ∑ j ∈ B, (if i = j then (1 : ℝ) else u) := by rw [hE] apply Finset.sum_congr rfl intro i hi apply Finset.sum_congr rfl intro j hj rw [secondMoment_entry m u v D hD, blockSymMatrix_BB m u v hi hj] _ = (B.card : ℝ) * 1 + (B.card : ℝ) * ((B.card - 1 : ℕ) : ℝ) * u := by exact sum_sum_if_eq_else B 1 u _ = (m : ℝ) + (m : ℝ) * ((m : ℝ) - 1) * u := by subst B rw [card_blockBFin] cases m <;> simp
theorem E_sumAr_sumBr

E[S_A S_B] = m² v.

Formal statement
m :
u v :
D :
FiniteDesign (Fin (2 * m) → Bool)
D.E (fun z => sumAr m z * sumBr m z) = (m : ℝ) ^ 2 * v
Proof (Lean source)
lemma E_sumAr_sumBr (m : ℕ) (u v : ℝ) (D : FiniteDesign (Fin (2 * m) → Bool)) (hD : assignmentSecondMoment m D = blockSymMatrix m u v) : D.E (fun z => sumAr m z * sumBr m z) = (m : ℝ) ^ 2 * v := by let A := blockAFin m let B := blockBFin m have hE : D.E (fun z => sumAr m z * sumBr m z) = ∑ i ∈ A, ∑ j ∈ B, D.E (fun z => signOf m z i * signOf m z j) := by calc D.E (fun z => sumAr m z * sumBr m z) = D.E (fun z => ∑ i ∈ A, ∑ j ∈ B, signOf m z i * signOf m z j) := by apply D.E_congr intro z simp [sumAr, sumBr, A, B, Finset.sum_mul_sum] _ = ∑ i ∈ A, D.E (fun z => ∑ j ∈ B, signOf m z i * signOf m z j) := by rw [D.E_sum] _ = ∑ i ∈ A, ∑ j ∈ B, D.E (fun z => signOf m z i * signOf m z j) := by apply Finset.sum_congr rfl intro i hi rw [D.E_sum] calc D.E (fun z => sumAr m z * sumBr m z) = ∑ i ∈ A, ∑ j ∈ B, v := by rw [hE] apply Finset.sum_congr rfl intro i hi apply Finset.sum_congr rfl intro j hj rw [secondMoment_entry m u v D hD, blockSymMatrix_AB m u v hi hj] _ = (m : ℝ) ^ 2 * v := by subst A subst B simp [Finset.sum_const, nsmul_eq_mul, card_blockAFin, card_blockBFin] ring
theorem u_le_one

The within-block second moment u ≤ 1 (from E[(Z_i − Z_j)²] ≥ 0 for a within-block pair, available since m ≥ 2).

Formal statement
m :
hm :
2 ≤ m
u v :
D :
FiniteDesign (Fin (2 * m) → Bool)
u ≤ 1
Proof (Lean source)
lemma u_le_one (m : ℕ) (hm : 2 ≤ m) (u v : ℝ) (D : FiniteDesign (Fin (2 * m) → Bool)) (hD : assignmentSecondMoment m D = blockSymMatrix m u v) : u ≤ 1 := by let i0 : Fin (2 * m) := ⟨0, by omega⟩ let j0 : Fin (2 * m) := ⟨1, by omega⟩ have hi0 : i0 ∈ blockAFin m := by simp [blockAFin, i0] omega have hj0 : j0 ∈ blockAFin m := by simp [blockAFin, j0] omega have hne : i0 ≠ j0 := by intro h have := congrArg val h simp [i0, j0] at this have hcross : D.E (fun z => signOf m z i0 * signOf m z j0) = u := by rw [secondMoment_entry m u v D hD, blockSymMatrix_AA m u v hi0 hj0] simp [hne] have hsqi : D.E (fun z => signOf m z i0 * signOf m z i0) = 1 := by calc D.E (fun z => signOf m z i0 * signOf m z i0) = D.E (fun _ => (1 : ℝ)) := by apply D.E_congr intro z exact signOf_sq m z i0 _ = 1 := by rw [D.E_const] have hsqj : D.E (fun z => signOf m z j0 * signOf m z j0) = 1 := by calc D.E (fun z => signOf m z j0 * signOf m z j0) = D.E (fun _ => (1 : ℝ)) := by apply D.E_congr intro z exact signOf_sq m z j0 _ = 1 := by rw [D.E_const] have hnonneg : 0 ≤ D.E (fun z => (signOf m z i0 - signOf m z j0) * (signOf m z i0 - signOf m z j0)) := by apply D.E_nonneg intro z nlinarith [sq_nonneg (signOf m z i0 - signOf m z j0)] have hE : D.E (fun z => (signOf m z i0 - signOf m z j0) * (signOf m z i0 - signOf m z j0)) = 2 - 2 * u := by calc D.E (fun z => (signOf m z i0 - signOf m z j0) * (signOf m z i0 - signOf m z j0)) = D.E (fun z => (signOf m z i0 * signOf m z i0 + signOf m z j0 * signOf m z j0) - 2 * (signOf m z i0 * signOf m z j0)) := by apply D.E_congr intro z ring _ = D.E (fun z => signOf m z i0 * signOf m z i0 + signOf m z j0 * signOf m z j0) - D.E (fun z => 2 * (signOf m z i0 * signOf m z j0)) := by rw [D.E_sub] _ = (D.E (fun z => signOf m z i0 * signOf m z i0) + D.E (fun z => signOf m z j0 * signOf m z j0)) - 2 * D.E (fun z => signOf m z i0 * signOf m z j0) := by rw [D.E_add, D.E_const_mul] _ = 2 - 2 * u := by rw [hsqi, hsqj, hcross] ring nlinarith
theorem blockSumA_odd

For odd m, the integer block sum S_A is odd for every assignment.

Formal statement
m :
hOdd :
Odd m
z :
Fin (2 * m) → Bool
Proof (Lean source)
lemma blockSumA_odd (m : ℕ) (hOdd : Odd m) (z : Fin (2 * m) → Bool) : Odd (blockSumA m z) := by unfold blockSumA apply odd_int_sum_pm_one_of_odd_card · intro i hi by_cases hz : z i <;> simp [hz] · change Odd (blockAFin m).card simpa [card_blockAFin] using hOdd
theorem one_le_E_sumAr_sq

For odd m, E[S_A²] ≥ 1.

Formal statement
m :
hOdd :
Odd m
D :
FiniteDesign (Fin (2 * m) → Bool)
(1 : ℝ) ≤ D.E (fun z => sumAr m z * sumAr m z)
Proof (Lean source)
lemma one_le_E_sumAr_sq (m : ℕ) (hOdd : Odd m) (D : FiniteDesign (Fin (2 * m) → Bool)) : (1 : ℝ) ≤ D.E (fun z => sumAr m z * sumAr m z) := by have hnonneg : 0 ≤ D.E (fun z => sumAr m z * sumAr m z - 1) := by apply D.E_nonneg intro z have hsquare : (1 : ℝ) ≤ (blockSumA m z : ℝ) * (blockSumA m z : ℝ) := one_le_sq_of_odd_int (blockSumA_odd m hOdd z) have hcast := sumAr_eq_blockSumA_cast m z rw [hcast] nlinarith have hsub : D.E (fun z => sumAr m z * sumAr m z - 1) = D.E (fun z => sumAr m z * sumAr m z) - 1 := by rw [D.E_sub, D.E_const] nlinarith
theorem one_le_E_sumBr_sq

For odd m, E[S_B²] ≥ 1 under every design. Community B has an odd number m of units, so its sign sum is an odd integer for every assignment and therefore has square at least one; averaging preserves the bound. This is the parity obstruction that keeps the odd-m reduced slice away from the spread vertex.

Formal statement
m :
hOdd :
Odd m
D :
FiniteDesign (Fin (2 * m) → Bool)
(1 : ℝ) ≤ D.E (fun z => sumBr m z * sumBr m z)
Proof (Lean source)
lemma one_le_E_sumBr_sq (m : ℕ) (hOdd : Odd m) (D : FiniteDesign (Fin (2 * m) → Bool)) : (1 : ℝ) ≤ D.E (fun z => sumBr m z * sumBr m z) := by have hnonneg : 0 ≤ D.E (fun z => sumBr m z * sumBr m z - 1) := by apply D.E_nonneg intro z have hsquare : (1 : ℝ) ≤ (blockSumB m z : ℝ) * (blockSumB m z : ℝ) := one_le_sq_of_odd_int (blockSumB_odd m hOdd z) have hcast := sumBr_eq_blockSumB_cast m z rw [hcast] nlinarith have hsub : D.E (fun z => sumBr m z * sumBr m z - 1) = D.E (fun z => sumBr m z * sumBr m z) - 1 := by rw [D.E_sub, D.E_const] nlinarith
theorem pm_slice_forward

Forward (necessity) direction. A design realizing X(u,v) has reduced spectral coordinates in the parity-truncated triangle.

Formal statement
m :
hm :
2 ≤ m
u v :
D :
FiniteDesign (Fin (2 * m) → Bool)
InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) ∧
≤ (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) + (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v)
Proof (Lean source)
lemma pm_slice_forward (m : ℕ) (hm : 2 ≤ m) (u v : ℝ) (D : FiniteDesign (Fin (2 * m) → Bool)) (hD : assignmentSecondMoment m D = blockSymMatrix m u v) : InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) ∧ parityThreshold m ≤ (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) + (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) := by let A2 := fun z => sumAr m z * sumAr m z let B2 := fun z => sumBr m z * sumBr m z let AB := fun z => sumAr m z * sumBr m z let y : ℝ := 1 + ((m : ℝ) - 1) * u - (m : ℝ) * v let zc : ℝ := 1 + ((m : ℝ) - 1) * u + (m : ℝ) * v have hmpos_nat : 0 < m := by omega have hmpos : 0 < (m : ℝ) := by exact_mod_cast hmpos_nat have hA2 := E_sumAr_sq m u v D hD have hB2 := E_sumBr_sq m u v D hD have hAB := E_sumAr_sumBr m u v D hD have hminus_nonneg : 0 ≤ D.E (fun w => (sumAr m w - sumBr m w) * (sumAr m w - sumBr m w)) := by apply D.E_nonneg intro w nlinarith [sq_nonneg (sumAr m w - sumBr m w)] have hplus_nonneg : 0 ≤ D.E (fun w => (sumAr m w + sumBr m w) * (sumAr m w + sumBr m w)) := by apply D.E_nonneg intro w nlinarith [sq_nonneg (sumAr m w + sumBr m w)] have hminusE : D.E (fun w => (sumAr m w - sumBr m w) * (sumAr m w - sumBr m w)) = 2 * (m : ℝ) * y := by calc D.E (fun w => (sumAr m w - sumBr m w) * (sumAr m w - sumBr m w)) = D.E (fun w => (A2 w + B2 w) - 2 * AB w) := by apply D.E_congr intro w simp [A2, B2, AB] ring _ = D.E (fun w => A2 w + B2 w) - D.E (fun w => 2 * AB w) := by rw [D.E_sub] _ = (D.E A2 + D.E B2) - 2 * D.E AB := by rw [D.E_add, D.E_const_mul] _ = 2 * (m : ℝ) * y := by subst A2 subst B2 subst AB subst y rw [hA2, hB2, hAB] ring have hplusE : D.E (fun w => (sumAr m w + sumBr m w) * (sumAr m w + sumBr m w)) = 2 * (m : ℝ) * zc := by calc D.E (fun w => (sumAr m w + sumBr m w) * (sumAr m w + sumBr m w)) = D.E (fun w => (A2 w + B2 w) + 2 * AB w) := by apply D.E_congr intro w simp [A2, B2, AB] ring _ = D.E (fun w => A2 w + B2 w) + D.E (fun w => 2 * AB w) := by rw [D.E_add] _ = (D.E A2 + D.E B2) + 2 * D.E AB := by rw [D.E_add, D.E_const_mul] _ = 2 * (m : ℝ) * zc := by subst A2 subst B2 subst AB subst zc rw [hA2, hB2, hAB] ring have hx_nonneg : 0 ≤ 1 - u := by have hu := u_le_one m hm u v D hD nlinarith have hy_nonneg : 0 ≤ y := by nlinarith [hminus_nonneg, hminusE, hmpos] have hz_nonneg : 0 ≤ zc := by nlinarith [hplus_nonneg, hplusE, hmpos] constructor · subst y subst zc unfold InReducedTriangle refine ⟨hx_nonneg, ?_, ?_, ?_⟩ · simpa using hy_nonneg · simpa using hz_nonneg · simp [qParam] ring · by_cases hEven : Even m · simp [parityThreshold, hEven] nlinarith [hy_nonneg, hz_nonneg] · have hOdd : Odd m := Nat.not_even_iff_odd.mp hEven have hA_ge := one_le_E_sumAr_sq m hOdd D have hB_ge := one_le_E_sumBr_sq m hOdd D have hsum_moment : D.E A2 + D.E B2 = (m : ℝ) * (y + zc) := by subst A2 subst B2 subst y subst zc rw [hA2, hB2] ring have hprod : (2 : ℝ) ≤ (m : ℝ) * (y + zc) := by nlinarith have hdiv : (2 : ℝ) / (m : ℝ) ≤ y + zc := by rw [div_le_iff₀ hmpos] nlinarith simp [parityThreshold, hEven] subst y subst zc simpa using hdiv
Helpers.ParitySliceMixture 13 declarations Reusable primitives for the sufficiency direction: * uniformOnDesign — the uniform law on a nonempty finset of assignments, with membership in the block-exchangeable class whenever the support is invariant under global n

Mixture designs and block-symmetry of second moments (backward-direction core)

Reusable primitives for the sufficiency direction:

* uniformOnDesign — the uniform law on a nonempty finset of assignments, with membership in the block-exchangeable class whenever the support is invariant under global negation and the two-block automorphism group; * mixtureDesign — a finite convex mixture of designs, its expectation (E) linearity, its membership in the class, and the affine action on the block-symmetric second moment X(u,v); * secondMoment_blockSym_of_exchangeable — the second moment of any block-exchangeable design is block-symmetric (= X(u,v) for the reference-pair values u,v), proved by transporting pair expectations along block automorphisms.

def reindexBy

Reindex an assignment z by a permutation σ: (R σ z) i = z (σ i).

Definition (Lean source)
def reindexBy (m : ℕ) (σ : Perm (Fin (2 * m))) (z : Fin (2 * m) → Bool) : Fin (2 * m) → Bool := fun i => z (σ i)
theorem E_reindex_invariant

Change of variables: for a design invariant under the block-automorphism σ (D.p (reindexBy σ z) = D.p z), expectation is invariant under precomposition by reindexBy σ.

Formal statement
m :
D :
FiniteDesign (Fin (2 * m) → Bool)
σ :
Perm (Fin (2 * m))
hInv :
∀ z, D.p (reindexBy m σ z) = D.p z
f :
(Fin (2 * m) → Bool) → ℝ
D.E (fun z => f (reindexBy m σ z)) = D.E f
Proof (Lean source)
lemma E_reindex_invariant (m : ℕ) (D : FiniteDesign (Fin (2 * m) → Bool)) (σ : Perm (Fin (2 * m))) (hInv : ∀ z, D.p (reindexBy m σ z) = D.p z) (f : (Fin (2 * m) → Bool) → ℝ) : D.E (fun z => f (reindexBy m σ z)) = D.E f := by rw [FiniteDesign.E] have hbij : Bijective (reindexBy m σ) := by refine ⟨?_, ?_⟩ · intro z₁ z₂ h funext i have h' := congrFun h (σ.symm i) simpa [reindexBy] using h' · intro z refine ⟨reindexBy m σ.symm z, ?_⟩ funext i simp [reindexBy] calc (∑ z, D.p z * f (reindexBy m σ z)) = ∑ z, D.p (reindexBy m σ z) * f (reindexBy m σ z) := by apply Finset.sum_congr rfl intro z _ rw [hInv z] _ = ∑ z, D.p z * f z := by exact hbij.sum_comp (fun z => D.p z * f z)
theorem signOf_reindex

The pointwise sign transports under reindexing: signOf (R σ z) i = signOf z (σ i).

Formal statement
m :
σ :
Perm (Fin (2 * m))
z :
Fin (2 * m) → Bool
i :
Fin (2 * m)
signOf m (reindexBy m σ z) i = signOf m z (σ i)
Proof (Lean source)
lemma signOf_reindex (m : ℕ) (σ : Perm (Fin (2 * m))) (z : Fin (2 * m) → Bool) (i : Fin (2 * m)) : signOf m (reindexBy m σ z) i = signOf m z (σ i) := rfl
theorem E_pair_transport

Pair-expectation transport: if D is invariant under the block-automorphism σ then E[Z_{σ i} Z_{σ j}] = E[Z_i Z_j].

Formal statement
m :
D :
FiniteDesign (Fin (2 * m) → Bool)
σ :
Perm (Fin (2 * m))
hInv :
∀ z, D.p (reindexBy m σ z) = D.p z
i j :
Fin (2 * m)
D.E (fun z => signOf m z (σ i) * signOf m z (σ j))
= D.E (fun z => signOf m z i * signOf m z j)
Proof (Lean source)
lemma E_pair_transport (m : ℕ) (D : FiniteDesign (Fin (2 * m) → Bool)) (σ : Perm (Fin (2 * m))) (hInv : ∀ z, D.p (reindexBy m σ z) = D.p z) (i j : Fin (2 * m)) : D.E (fun z => signOf m z (σ i) * signOf m z (σ j)) = D.E (fun z => signOf m z i * signOf m z j) := by simpa [signOf_reindex] using (E_reindex_invariant m D σ hInv (fun z => signOf m z i * signOf m z j))
theorem isBlockAuto_swap_within

A within-block transposition (swap two indices of block A, fixing everything else) is a two-block automorphism.

Formal statement
m :
Fin (2 * m)
hi :
i.val < m
hj :
j.val < m
Proof (Lean source)
lemma isBlockAuto_swap_within (m : ℕ) {i j : Fin (2 * m)} (hi : i.val < m) (hj : j.val < m) : IsBlockAuto m (swap i j) := by left intro k by_cases hki : k = i · subst k simp [hi, hj] · by_cases hkj : k = j · subst k simp [hi, hj] · simp [Equiv.swap_apply_of_ne_of_ne hki hkj]
theorem secondMoment_blockSym_of_exchangeable

The block-symmetry general lemma. For a block-exchangeable design D, its second moment is block-symmetric: it equals X(u,v) with u = E[Z_{i₀} Z_{j₀}] the within-block reference-pair value and v = E[Z_{i₀} Z_{k₀}] the cross-block reference-pair value.

Formal statement
m :
hm :
2 ≤ m
D :
FiniteDesign (Fin (2 * m) → Bool)
∃ u v : ℝ, assignmentSecondMoment m D = blockSymMatrix m u v
Proof (Lean source)
lemma secondMoment_blockSym_of_exchangeable (m : ℕ) (hm : 2 ≤ m) (D : FiniteDesign (Fin (2 * m) → Bool)) (hD : D ∈ blockExchangeableDesignClass m) : ∃ u v : ℝ, assignmentSecondMoment m D = blockSymMatrix m u v := by let i0 : Fin (2 * m) := ⟨0, by omega⟩ let j0 : Fin (2 * m) := ⟨1, by omega⟩ let k0 : Fin (2 * m) := ⟨m, by omega⟩ let u : ℝ := D.E (fun z => signOf m z i0 * signOf m z j0) let v : ℝ := D.E (fun z => signOf m z i0 * signOf m z k0) refine ⟨u, v, ?_⟩ rw [← Matrix.ext_iff] intro i j simp only [assignmentSecondMoment, Matrix.of_apply] by_cases hij : i = j · subst j calc D.E (fun z => signOf m z i * signOf m z i) = D.E (fun _ => (1 : ℝ)) := by apply D.E_congr intro z exact signOf_sq m z i _ = 1 := D.E_const 1 _ = blockSymMatrix m u v i i := by simp [blockSymMatrix] · by_cases hsame : i.val < m ↔ j.val < m · have hi_cases : i.val < m ∨ ¬ i.val < m := em _ rcases hi_cases with hi | hi · have hj : j.val < m := hsame.mp hi have hi0 : i0.val < m := by simp [i0]; omega have hj0 : j0.val < m := by simp [j0]; omega have hmem : ((i0.val < m ↔ i.val < m) ∧ (j0.val < m ↔ j.val < m)) ∨ ((i0.val < m ↔ ¬ i.val < m) ∧ (j0.val < m ↔ ¬ j.val < m)) := by left constructor <;> simp [hi0, hj0, hi, hj] have hi0j0 : i0 ≠ j0 := by intro h have := congrArg val h simp [i0, j0] at this rcases exists_blockAuto_pair m hi0j0 hij hmem with ⟨σ, hσ, hσi, hσj⟩ have hInv : ∀ z, D.p (reindexBy m σ z) = D.p z := by intro z exact hD.2 σ hσ z have ht := E_pair_transport m D σ hInv i0 j0 have hval : D.E (fun z => signOf m z i * signOf m z j) = u := by simpa [u, hσi, hσj] using ht simpa [blockSymMatrix, hij, hsame] using hval · have hj : ¬ j.val < m := fun hj => hi (hsame.mpr hj) have hi0 : i0.val < m := by simp [i0]; omega have hj0 : j0.val < m := by simp [j0]; omega have hmem : ((i0.val < m ↔ i.val < m) ∧ (j0.val < m ↔ j.val < m)) ∨ ((i0.val < m ↔ ¬ i.val < m) ∧ (j0.val < m ↔ ¬ j.val < m)) := by right constructor <;> simp [hi0, hj0, hi, hj] have hi0j0 : i0 ≠ j0 := by intro h have := congrArg val h simp [i0, j0] at this rcases exists_blockAuto_pair m hi0j0 hij hmem with ⟨σ, hσ, hσi, hσj⟩ have hInv : ∀ z, D.p (reindexBy m σ z) = D.p z := by intro z exact hD.2 σ hσ z have ht := E_pair_transport m D σ hInv i0 j0 have hval : D.E (fun z => signOf m z i * signOf m z j) = u := by simpa [u, hσi, hσj] using ht simpa [blockSymMatrix, hij, hsame] using hval · have hi_cases : i.val < m ∨ ¬ i.val < m := em _ rcases hi_cases with hi | hi · have hj : ¬ j.val < m := fun hj => hsame ⟨fun _ => hj, fun _ => hi⟩ have hi0 : i0.val < m := by simp [i0]; omega have hk0 : ¬ k0.val < m := by simp [k0] have hmem : ((i0.val < m ↔ i.val < m) ∧ (k0.val < m ↔ j.val < m)) ∨ ((i0.val < m ↔ ¬ i.val < m) ∧ (k0.val < m ↔ ¬ j.val < m)) := by left constructor · simp [hi0, hi] · simp [hk0, hj] have hi0k0 : i0 ≠ k0 := by intro h have := congrArg val h simp [i0, k0] at this omega rcases exists_blockAuto_pair m hi0k0 hij hmem with ⟨σ, hσ, hσi, hσj⟩ have hInv : ∀ z, D.p (reindexBy m σ z) = D.p z := by intro z exact hD.2 σ hσ z have ht := E_pair_transport m D σ hInv i0 k0 have hval : D.E (fun z => signOf m z i * signOf m z j) = v := by simpa [v, hσi, hσj] using ht simpa [blockSymMatrix, hij, hsame] using hval · have hj : j.val < m := by by_contra hj exact hsame ⟨fun hi' => elim (hi hi'), fun hj' => elim (hj hj')⟩ have hi0 : i0.val < m := by simp [i0]; omega have hk0 : ¬ k0.val < m := by simp [k0] have hmem : ((i0.val < m ↔ j.val < m) ∧ (k0.val < m ↔ i.val < m)) ∨ ((i0.val < m ↔ ¬ j.val < m) ∧ (k0.val < m ↔ ¬ i.val < m)) := by left constructor · simp [hi0, hj] · simp [hk0, hi] have hi0k0 : i0 ≠ k0 := by intro h have := congrArg val h simp [i0, k0] at this omega have hji : j ≠ i := fun h => hij h.symm rcases exists_blockAuto_pair m hi0k0 hji hmem with ⟨σ, hσ, hσi, hσj⟩ have hInv : ∀ z, D.p (reindexBy m σ z) = D.p z := by intro z exact hD.2 σ hσ z have ht := E_pair_transport m D σ hInv i0 k0 have hvalji : D.E (fun z => signOf m z j * signOf m z i) = v := by simpa [v, hσi, hσj] using ht have hswap : D.E (fun z => signOf m z i * signOf m z j) = D.E (fun z => signOf m z j * signOf m z i) := by apply D.E_congr intro z ring have hval : D.E (fun z => signOf m z i * signOf m z j) = v := hswap.trans hvalji simpa [blockSymMatrix, hij, hsame] using hval
CausalSmith.Experimentation.DesignPm1.secondMoment_blockSym_of_exchangeable · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/ParitySliceMixture.lean:211
def uniformOnDesign

The uniform law on a nonempty finset S of assignments.

Definition (Lean source)
noncomputable def uniformOnDesign (m : ℕ) (S : Finset (Fin (2 * m) → Bool)) (hS : S.Nonempty) : FiniteDesign (Fin (2 * m) → Bool) where p := fun z => if z ∈ S then ((S.card : ℝ))⁻¹ else 0 p_nonneg := fun z => by split · positivity · exact le_refl 0 p_sum := by rw [Finset.sum_ite_mem, Finset.univ_inter, Finset.sum_const, nsmul_eq_mul] exact mul_inv_cancel₀ (by exact_mod_cast (Finset.card_ne_zero_of_mem hS.choose_spec))
theorem uniformOnDesign_mem

If the support S is invariant under global negation and under reindexing by every two-block automorphism, the uniform design lies in the block-exchangeable class.

Formal statement
m :
S :
Finset (Fin (2 * m) → Bool)
hS :
S.Nonempty
hNeg :
∀ z, (fun i => !z i) ∈ S ↔ z ∈ S
hAuto :
∀ σ : Perm (Fin (2 * m))
then
∀ z, reindexBy m σ z ∈ S ↔ z ∈ S
Proof (Lean source)
lemma uniformOnDesign_mem (m : ℕ) (S : Finset (Fin (2 * m) → Bool)) (hS : S.Nonempty) (hNeg : ∀ z, (fun i => !z i) ∈ S ↔ z ∈ S) (hAuto : ∀ σ : Perm (Fin (2 * m)), IsBlockAuto m σ → ∀ z, reindexBy m σ z ∈ S ↔ z ∈ S) : uniformOnDesign m S hS ∈ blockExchangeableDesignClass m := by refine ⟨⟨?_⟩, ?_⟩ · intro z change (if z ∈ S then ((S.card : ℝ))⁻¹ else 0) = (if (fun i => !z i) ∈ S then ((S.card : ℝ))⁻¹ else 0) by_cases hz : z ∈ S · simp [hz, (hNeg z).2 hz] · have hnz : (fun i => !z i) ∉ S := fun h => hz ((hNeg z).1 h) simp [hz, hnz] · intro σ hσ z change (if reindexBy m σ z ∈ S then ((S.card : ℝ))⁻¹ else 0) = (if z ∈ S then ((S.card : ℝ))⁻¹ else 0) by_cases hz : z ∈ S · simp [hz, (hAuto σ hσ z).2 hz] · have hnz : reindexBy m σ z ∉ S := fun h => hz ((hAuto σ hσ z).1 h) simp [hz, hnz]
def mixtureDesign

A finite convex mixture ∑ᵢ wᵢ Dᵢ of designs.

Definition (Lean source)
noncomputable def mixtureDesign {k : ℕ} (m : ℕ) (w : Fin k → ℝ) (Ds : Fin k → FiniteDesign (Fin (2 * m) → Bool)) (hw0 : ∀ i, 0 ≤ w i) (hw1 : ∑ i, w i = 1) : FiniteDesign (Fin (2 * m) → Bool) where p := fun z => ∑ i, w i * (Ds i).p z p_nonneg := fun z => sum_nonneg (fun i _ => mul_nonneg (hw0 i) ((Ds i).p_nonneg z)) p_sum := by rw [Finset.sum_comm] have : ∀ i : Fin k, ∑ z, w i * (Ds i).p z = w i := by intro i; rw [← Finset.mul_sum, (Ds i).p_sum, mul_one] simp_rw [this]; exact hw1
theorem mixtureDesign_E

Expectation of a mixture is the convex combination of expectations.

Formal statement
k :
m :
w :
Fin k → ℝ
Ds :
Fin k → FiniteDesign (Fin (2 * m) → Bool)
hw0 :
∀ i, 0 ≤ w i
hw1 :
∑ i, w i = 1
f :
(Fin (2 * m) → Bool) → ℝ
(mixtureDesign m w Ds hw0 hw1).E f = ∑ i, w i * (Ds i).E f
Proof (Lean source)
lemma mixtureDesign_E {k : ℕ} (m : ℕ) (w : Fin k → ℝ) (Ds : Fin k → FiniteDesign (Fin (2 * m) → Bool)) (hw0 : ∀ i, 0 ≤ w i) (hw1 : ∑ i, w i = 1) (f : (Fin (2 * m) → Bool) → ℝ) : (mixtureDesign m w Ds hw0 hw1).E f = ∑ i, w i * (Ds i).E f := by simp only [FiniteDesign.E, mixtureDesign, Finset.sum_mul] rw [Finset.sum_comm] congr 1 ext i rw [Finset.mul_sum] congr 1 ext z ring
theorem mixtureDesign_mem

A mixture of block-exchangeable designs is block-exchangeable.

Formal statement
k :
m :
w :
Fin k → ℝ
Ds :
Fin k → FiniteDesign (Fin (2 * m) → Bool)
hw0 :
∀ i, 0 ≤ w i
hw1 :
∑ i, w i = 1
hDs :
Proof (Lean source)
lemma mixtureDesign_mem {k : ℕ} (m : ℕ) (w : Fin k → ℝ) (Ds : Fin k → FiniteDesign (Fin (2 * m) → Bool)) (hw0 : ∀ i, 0 ≤ w i) (hw1 : ∑ i, w i = 1) (hDs : ∀ i, Ds i ∈ blockExchangeableDesignClass m) : mixtureDesign m w Ds hw0 hw1 ∈ blockExchangeableDesignClass m := by refine ⟨⟨?_⟩, ?_⟩ · intro z simp only [mixtureDesign] apply Finset.sum_congr rfl intro i _ rw [(hDs i).1.balanced z] · intro σ hσ z simp only [mixtureDesign] apply Finset.sum_congr rfl intro i _ rw [(hDs i).2 σ hσ z]
theorem sum_blockSymMatrix

Averaging block-symmetric matrices with weights summing to 1.

Formal statement
k :
m :
w :
Fin k → ℝ
uu vv :
Fin k → ℝ
hw1 :
∑ i, w i = 1
(∑ i, w i • blockSymMatrix m (uu i) (vv i))
= blockSymMatrix m (∑ i, w i * uu i) (∑ i, w i * vv i)
Proof (Lean source)
lemma sum_blockSymMatrix {k : ℕ} (m : ℕ) (w : Fin k → ℝ) (uu vv : Fin k → ℝ) (hw1 : ∑ i, w i = 1) : (∑ i, w i • blockSymMatrix m (uu i) (vv i)) = blockSymMatrix m (∑ i, w i * uu i) (∑ i, w i * vv i) := by rw [← Matrix.ext_iff] intro a b have hsum : (∑ i, w i • blockSymMatrix m (uu i) (vv i)) a b = ∑ i, (w i • blockSymMatrix m (uu i) (vv i)) a b := by exact map_sum (Matrix.entryLinearMap ℝ ℝ a b) (fun i : Fin k => w i • blockSymMatrix m (uu i) (vv i)) univ rw [hsum] simp only [Matrix.smul_apply, smul_eq_mul] by_cases hab : a = b · simp [blockSymMatrix, hab, hw1] · by_cases hs : a.val < m ↔ b.val < m · simp [blockSymMatrix, hab, hs] · simp [blockSymMatrix, hab, hs]
theorem mixtureDesign_secondMoment

The second moment of a mixture whose components have block-symmetric second moments X(uᵢ,vᵢ) is X(∑ wᵢ uᵢ, ∑ wᵢ vᵢ).

Formal statement
k :
m :
w :
Fin k → ℝ
Ds :
Fin k → FiniteDesign (Fin (2 * m) → Bool)
hw0 :
∀ i, 0 ≤ w i
hw1 :
∑ i, w i = 1
uu vv :
Fin k → ℝ
hcomp :
∀ i, assignmentSecondMoment m (Ds i) = blockSymMatrix m (uu i) (vv i)
= blockSymMatrix m (∑ i, w i * uu i) (∑ i, w i * vv i)
Proof (Lean source)
lemma mixtureDesign_secondMoment {k : ℕ} (m : ℕ) (w : Fin k → ℝ) (Ds : Fin k → FiniteDesign (Fin (2 * m) → Bool)) (hw0 : ∀ i, 0 ≤ w i) (hw1 : ∑ i, w i = 1) (uu vv : Fin k → ℝ) (hcomp : ∀ i, assignmentSecondMoment m (Ds i) = blockSymMatrix m (uu i) (vv i)) : assignmentSecondMoment m (mixtureDesign m w Ds hw0 hw1) = blockSymMatrix m (∑ i, w i * uu i) (∑ i, w i * vv i) := by rw [← sum_blockSymMatrix m w uu vv hw1] rw [← Matrix.ext_iff] intro i j have hsum : (∑ k, w k • blockSymMatrix m (uu k) (vv k)) i j = ∑ k, (w k • blockSymMatrix m (uu k) (vv k)) i j := by exact map_sum (Matrix.entryLinearMap ℝ ℝ i j) (fun k : Fin k => w k • blockSymMatrix m (uu k) (vv k)) univ rw [hsum] simp only [Matrix.smul_apply, smul_eq_mul, assignmentSecondMoment, Matrix.of_apply] rw [mixtureDesign_E] apply Finset.sum_congr rfl intro k _ have hk := congrFun (congrFun (hcomp k) i) j simpa [assignmentSecondMoment] using congrArg (fun x => w k * x) hk
Helpers.ParitySliceParity 17 declarations For odd m the spread origin (0,0) is not implementable (parity forces S_A, S_B odd, hence y+z ≥ 2/m).

Odd-m parity vertex designs and the quadrilateral backward direction

For odd m the spread origin (0,0) is not implementable (parity forces S_A, S_B odd, hence y+z ≥ 2/m). The feasible region is the quadrilateral with the two extra parity vertices

  • pcutVDesignX(−1/m, −1/m²), reduced (2/m, 0) (block sums (±1, ∓1));
  • pallVDesignX(−1/m, 1/m²), reduced (0, 2/m) (block sums (±1, ±1)).

An arbitrary quadrilateral point is the convex combination of the four vertices cut, all, pcut, pall with the outer/inner-edge weights `λμ, λ(1−μ), (1−λ)μ, (1−λ)(1−μ), μ = y/(y+z), λ = ((y+z)−2/m)/(2m−2/m)`.

def pcutSupport

The (±1, ∓1) block-sum support (pcut).

Definition (Lean source)
def pcutSupport (m : ℕ) : Finset (Fin (2 * m) → Bool) := Finset.univ.filter (fun z => (blockSumA m z = 1 ∧ blockSumB m z = -1) ∨ (blockSumA m z = -1 ∧ blockSumB m z = 1))
def pallSupport

The (±1, ±1) block-sum support (pall).

Definition (Lean source)
def pallSupport (m : ℕ) : Finset (Fin (2 * m) → Bool) := Finset.univ.filter (fun z => (blockSumA m z = 1 ∧ blockSumB m z = 1) ∨ (blockSumA m z = -1 ∧ blockSumB m z = -1))
def pcutWitness

An assignment with S_A = 1, S_B = -1 (odd m): (m+1)/2 true on block A, (m-1)/2 true on block B.

Definition (Lean source)
def pcutWitness (m : ℕ) : Fin (2 * m) → Bool := fun i => decide (i.val < (m + 1) / 2 ∨ (m ≤ i.val ∧ i.val < m + (m - 1) / 2))
def pallWitness

An assignment with S_A = 1, S_B = 1 (odd m).

Definition (Lean source)
def pallWitness (m : ℕ) : Fin (2 * m) → Bool := fun i => decide (i.val < (m + 1) / 2 ∨ (m ≤ i.val ∧ i.val < m + (m + 1) / 2))
theorem pcutSupport_nonempty

For odd m some assignment has community sign sums (1, −1), so the pcut parity support is nonempty and the uniform law on it is well defined. When m is odd each community sum is an odd integer, so (±1, ∓1) is the closest an oppositely-signed pair of communities can come to being balanced.

Formal statement
m :
hOdd :
Odd m
(pcutSupport m).Nonempty
Proof (Lean source)
lemma pcutSupport_nonempty (m : ℕ) (hOdd : Odd m) : (pcutSupport m).Nonempty := by refine ⟨pcutWitness m, ?_⟩ simp [pcutSupport, blockSumA_pcutWitness m hOdd, blockSumB_pcutWitness m hOdd]
theorem pallSupport_nonempty

For odd m some assignment has community sign sums (1, 1), so the pall parity support is nonempty and the uniform law on it is well defined. This is the companion of pcutSupport_nonempty for the equally-signed parity vertex.

Formal statement
m :
hOdd :
Odd m
(pallSupport m).Nonempty
Proof (Lean source)
lemma pallSupport_nonempty (m : ℕ) (hOdd : Odd m) : (pallSupport m).Nonempty := by refine ⟨pallWitness m, ?_⟩ simp [pallSupport, blockSumA_pallWitness m hOdd, blockSumB_pallWitness m hOdd]
def pcutVDesign

The pcut parity design.

Definition (Lean source)
noncomputable def pcutVDesign (m : ℕ) (hOdd : Odd m) : FiniteDesign (Fin (2 * m) → Bool) := uniformOnDesign m (pcutSupport m) (pcutSupport_nonempty m hOdd)
def pallVDesign

The pall parity design.

Definition (Lean source)
noncomputable def pallVDesign (m : ℕ) (hOdd : Odd m) : FiniteDesign (Fin (2 * m) → Bool) := uniformOnDesign m (pallSupport m) (pallSupport_nonempty m hOdd)
theorem pcutVDesign_mem

For odd m, the pcut parity design — uniform over the assignments whose community sign sums are (1, −1) or (−1, 1) — belongs to the block-exchangeable design class. Negating an assignment swaps the two cases, and a two-block automorphism either fixes the pair of community sums or transposes it, so the support is invariant either way.

Formal statement
m :
hOdd :
Odd m
Proof (Lean source)
lemma pcutVDesign_mem (m : ℕ) (hOdd : Odd m) : pcutVDesign m hOdd ∈ blockExchangeableDesignClass m := by unfold pcutVDesign apply uniformOnDesign_mem · intro z simp only [pcutSupport, mem_filter, Finset.mem_univ, true_and, blockSumA_neg, blockSumB_neg] constructor · intro hz rcases hz with ⟨hA, hB⟩ | ⟨hA, hB⟩ · right constructor <;> omega · left constructor <;> omega · intro hz rcases hz with ⟨hA, hB⟩ | ⟨hA, hB⟩ · right constructor <;> omega · left constructor <;> omega · intro σ hσ z rcases blockSum_reindex m σ hσ z with h | h · simp [pcutSupport, h.1, h.2] · simp only [pcutSupport, mem_filter, Finset.mem_univ, true_and, h.1, h.2] constructor · intro hz rcases hz with ⟨hB, hA⟩ | ⟨hB, hA⟩ · right exact ⟨hA, hB⟩ · left exact ⟨hA, hB⟩ · intro hz rcases hz with ⟨hA, hB⟩ | ⟨hA, hB⟩ · right exact ⟨hB, hA⟩ · left exact ⟨hB, hA⟩
theorem pallVDesign_mem

For odd m, the pall parity design — uniform over the assignments whose community sign sums are (1, 1) or (−1, −1) — belongs to the block-exchangeable design class, by the same negation and two-block-automorphism invariance of its support.

Formal statement
m :
hOdd :
Odd m
Proof (Lean source)
lemma pallVDesign_mem (m : ℕ) (hOdd : Odd m) : pallVDesign m hOdd ∈ blockExchangeableDesignClass m := by unfold pallVDesign apply uniformOnDesign_mem · intro z simp only [pallSupport, mem_filter, Finset.mem_univ, true_and, blockSumA_neg, blockSumB_neg] constructor · intro hz rcases hz with ⟨hA, hB⟩ | ⟨hA, hB⟩ · right constructor <;> omega · left constructor <;> omega · intro hz rcases hz with ⟨hA, hB⟩ | ⟨hA, hB⟩ · right constructor <;> omega · left constructor <;> omega · intro σ hσ z rcases blockSum_reindex m σ hσ z with h | h · simp [pallSupport, h.1, h.2] · simp [pallSupport, h.1, h.2, and_comm]
theorem pcutVDesign_sumAr_sq

On pcutSupport, S_A² = 1, so E[S_A²] = 1.

Formal statement
m :
hOdd :
Odd m
(pcutVDesign m hOdd).E (fun z => sumAr m z * sumAr m z) = 1
Proof (Lean source)
lemma pcutVDesign_sumAr_sq (m : ℕ) (hOdd : Odd m) : (pcutVDesign m hOdd).E (fun z => sumAr m z * sumAr m z) = 1 := by unfold pcutVDesign apply uniformOnDesign_E_eq_const intro z hz have hzmem : (blockSumA m z = 1 ∧ blockSumB m z = -1) ∨ (blockSumA m z = -1 ∧ blockSumB m z = 1) := by simpa [pcutSupport] using hz rw [sumAr_eq_blockSumA_cast_parity] rcases hzmem with h | h <;> rw [h.1] <;> norm_num
theorem pcutVDesign_sumAr_sumBr

On pcutSupport, S_A S_B = -1.

Formal statement
m :
hOdd :
Odd m
(pcutVDesign m hOdd).E (fun z => sumAr m z * sumBr m z) = -1
Proof (Lean source)
lemma pcutVDesign_sumAr_sumBr (m : ℕ) (hOdd : Odd m) : (pcutVDesign m hOdd).E (fun z => sumAr m z * sumBr m z) = -1 := by unfold pcutVDesign apply uniformOnDesign_E_eq_const intro z hz have hzmem : (blockSumA m z = 1 ∧ blockSumB m z = -1) ∨ (blockSumA m z = -1 ∧ blockSumB m z = 1) := by simpa [pcutSupport] using hz rw [sumAr_eq_blockSumA_cast_parity, sumBr_eq_blockSumB_cast_parity] rcases hzmem with h | h <;> rw [h.1, h.2] <;> norm_num
theorem pallVDesign_sumAr_sq

Under the pall parity design the community-A sign sum has mean square 1, because every assignment in its support has that sum equal to +1 or −1.

Formal statement
m :
hOdd :
Odd m
(pallVDesign m hOdd).E (fun z => sumAr m z * sumAr m z) = 1
Proof (Lean source)
lemma pallVDesign_sumAr_sq (m : ℕ) (hOdd : Odd m) : (pallVDesign m hOdd).E (fun z => sumAr m z * sumAr m z) = 1 := by unfold pallVDesign apply uniformOnDesign_E_eq_const intro z hz have hzmem : (blockSumA m z = 1 ∧ blockSumB m z = 1) ∨ (blockSumA m z = -1 ∧ blockSumB m z = -1) := by simpa [pallSupport] using hz rw [sumAr_eq_blockSumA_cast_parity] rcases hzmem with h | h <;> rw [h.1] <;> norm_num
theorem pallVDesign_sumAr_sumBr

Under the pall parity design the two community sign sums have cross moment +1: they always carry the same sign, both +1 or both −1. This is the sign flip of the corresponding pcut value and is what separates the two parity vertices.

Formal statement
m :
hOdd :
Odd m
(pallVDesign m hOdd).E (fun z => sumAr m z * sumBr m z) = 1
Proof (Lean source)
lemma pallVDesign_sumAr_sumBr (m : ℕ) (hOdd : Odd m) : (pallVDesign m hOdd).E (fun z => sumAr m z * sumBr m z) = 1 := by unfold pallVDesign apply uniformOnDesign_E_eq_const intro z hz have hzmem : (blockSumA m z = 1 ∧ blockSumB m z = 1) ∨ (blockSumA m z = -1 ∧ blockSumB m z = -1) := by simpa [pallSupport] using hz rw [sumAr_eq_blockSumA_cast_parity, sumBr_eq_blockSumB_cast_parity] rcases hzmem with h | h <;> rw [h.1, h.2] <;> norm_num
theorem pcutVDesign_secondMoment

For odd m ≥ 2 the pcut parity design has assignment second moment X(−1/m, −1/m²): units in the same community carry correlation −1/m, units in opposite communities −1/m². Its reduced spectral coordinates are y = 2/m, z = 0, so it sits exactly on the parity threshold y + z = 2/m — one of the two extra vertices that odd community size creates.

Formal statement
m :
hm :
2 ≤ m
hOdd :
Odd m
= blockSymMatrix m (-1 / (m : ℝ)) (-1 / (m : ℝ) ^ 2)
Proof (Lean source)
lemma pcutVDesign_secondMoment (m : ℕ) (hm : 2 ≤ m) (hOdd : Odd m) : assignmentSecondMoment m (pcutVDesign m hOdd) = blockSymMatrix m (-1 / (m : ℝ)) (-1 / (m : ℝ) ^ 2) := by rcases secondMoment_blockSym_of_exchangeable m hm (pcutVDesign m hOdd) (pcutVDesign_mem m hOdd) with ⟨u, v, hUV⟩ have hEqU : (m : ℝ) + (m : ℝ) * ((m : ℝ) - 1) * u = 1 := by rw [← E_sumAr_sq m u v (pcutVDesign m hOdd) hUV, pcutVDesign_sumAr_sq] have hEqV : (m : ℝ) ^ 2 * v = -1 := by rw [← E_sumAr_sumBr m u v (pcutVDesign m hOdd) hUV, pcutVDesign_sumAr_sumBr] have hmposR : 0 < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by norm_num : 0 < 2) hm) have hm0 : (m : ℝ) ≠ 0 := ne_of_gt hmposR have hmgt1 : (1 : ℝ) < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by norm_num : 1 < 2) hm) have hm1 : (m : ℝ) - 1 ≠ 0 := by linarith have huProd : ((m : ℝ) - 1) * ((m : ℝ) * u + 1) = 0 := by nlinarith [hEqU] have hlin : (m : ℝ) * u + 1 = 0 := (mul_eq_zero.mp huProd).resolve_left hm1 have hu : u = -1 / (m : ℝ) := by field_simp [hm0] linarith have hv : v = -1 / (m : ℝ) ^ 2 := by have hm2 : (m : ℝ) ^ 2 ≠ 0 := pow_ne_zero 2 hm0 field_simp [hm2] nlinarith rw [hUV, hu, hv]
theorem pallVDesign_secondMoment

For odd m ≥ 2 the pall parity design has assignment second moment X(−1/m, 1/m²): units in the same community carry correlation −1/m, units in opposite communities +1/m². Its reduced spectral coordinates are y = 0, z = 2/m, the second parity vertex, again sitting exactly on the threshold y + z = 2/m.

Formal statement
m :
hm :
2 ≤ m
hOdd :
Odd m
= blockSymMatrix m (-1 / (m : ℝ)) (1 / (m : ℝ) ^ 2)
Proof (Lean source)
lemma pallVDesign_secondMoment (m : ℕ) (hm : 2 ≤ m) (hOdd : Odd m) : assignmentSecondMoment m (pallVDesign m hOdd) = blockSymMatrix m (-1 / (m : ℝ)) (1 / (m : ℝ) ^ 2) := by rcases secondMoment_blockSym_of_exchangeable m hm (pallVDesign m hOdd) (pallVDesign_mem m hOdd) with ⟨u, v, hUV⟩ have hEqU : (m : ℝ) + (m : ℝ) * ((m : ℝ) - 1) * u = 1 := by rw [← E_sumAr_sq m u v (pallVDesign m hOdd) hUV, pallVDesign_sumAr_sq] have hEqV : (m : ℝ) ^ 2 * v = 1 := by rw [← E_sumAr_sumBr m u v (pallVDesign m hOdd) hUV, pallVDesign_sumAr_sumBr] have hmposR : 0 < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by norm_num : 0 < 2) hm) have hm0 : (m : ℝ) ≠ 0 := ne_of_gt hmposR have hmgt1 : (1 : ℝ) < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by norm_num : 1 < 2) hm) have hm1 : (m : ℝ) - 1 ≠ 0 := by linarith have huProd : ((m : ℝ) - 1) * ((m : ℝ) * u + 1) = 0 := by nlinarith [hEqU] have hlin : (m : ℝ) * u + 1 = 0 := (mul_eq_zero.mp huProd).resolve_left hm1 have hu : u = -1 / (m : ℝ) := by field_simp [hm0] linarith have hv : v = 1 / (m : ℝ) ^ 2 := by have hm2 : (m : ℝ) ^ 2 ≠ 0 := pow_ne_zero 2 hm0 field_simp [hm2] nlinarith rw [hUV, hu, hv]
theorem pm_slice_backward_odd

Backward direction, odd m: the 4-vertex quadrilateral mixture.

Formal statement
m :
hm :
2 ≤ m
hOdd :
Odd m
u v :
htri :
InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v)
hpar :
≤ (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) + (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v)
Proof (Lean source)
lemma pm_slice_backward_odd (m : ℕ) (hm : 2 ≤ m) (hOdd : Odd m) (u v : ℝ) (htri : InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v)) (hpar : parityThreshold m ≤ (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) + (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v)) : blockSymMatrix m u v ∈ implementableCovarianceClass m := by obtain ⟨hx, hy, hz, htrace⟩ := htri set x : ℝ := 1 - u with hxdef set y : ℝ := 1 + ((m : ℝ) - 1) * u - (m : ℝ) * v with hydef set z : ℝ := 1 + ((m : ℝ) - 1) * u + (m : ℝ) * v with hzdef set s : ℝ := y + z with hsdef have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm have hm0pos : 0 < (m : ℝ) := by linarith have hm0 : (m : ℝ) ≠ 0 := ne_of_gt hm0pos have hm1pos : 0 < (m : ℝ) - 1 := by linarith have hden_pos : 0 < 2 * (m : ℝ) - 2 / (m : ℝ) := by field_simp [hm0] nlinarith [hmR] have hnotEven : ¬ Even m := Nat.not_even_iff_odd.mpr hOdd have hpar_s : 2 / (m : ℝ) ≤ s := by simpa [parityThreshold, hnotEven, hsdef, hydef, hzdef] using hpar have hs_pos : 0 < s := by have htwo : 0 < 2 / (m : ℝ) := by positivity linarith have hs_le : s ≤ 2 * (m : ℝ) := by have hqp_nonneg : 0 ≤ qParam m * x := by apply mul_nonneg · simp [qParam] linarith · exact hx nlinarith [htrace, hsdef, hqp_nonneg] let mu : ℝ := y / s let lam : ℝ := (s - 2 / (m : ℝ)) / (2 * (m : ℝ) - 2 / (m : ℝ)) let w : Fin 4 → ℝ := ![lam * mu, lam * (1 - mu), (1 - lam) * mu, (1 - lam) * (1 - mu)] let Ds : Fin 4 → FiniteDesign (Fin (2 * m) → Bool) := ![cutVDesign m, allVDesign m, pcutVDesign m hOdd, pallVDesign m hOdd] let uu : Fin 4 → ℝ := ![1, 1, -1 / (m : ℝ), -1 / (m : ℝ)] let vv : Fin 4 → ℝ := ![-1, 1, -1 / (m : ℝ) ^ 2, 1 / (m : ℝ) ^ 2] have hmu0 : 0 ≤ mu := by exact div_nonneg hy (le_of_lt hs_pos) have hmu1 : mu ≤ 1 := by dsimp [mu] field_simp [hs_pos.ne'] nlinarith [hsdef, hz] have h1mu0 : 0 ≤ 1 - mu := by linarith have hlam0 : 0 ≤ lam := by dsimp [lam] exact div_nonneg (sub_nonneg.mpr hpar_s) (le_of_lt hden_pos) have hlam1 : lam ≤ 1 := by dsimp [lam] rw [div_le_one hden_pos] nlinarith [hpar_s, hs_le] have h1lam0 : 0 ≤ 1 - lam := by linarith have hw0 : ∀ i, 0 ≤ w i := by intro i fin_cases i <;> simp only [w, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons, Matrix.cons_val_two, Matrix.cons_val_three, Matrix.tail_cons] · exact mul_nonneg hlam0 hmu0 · exact mul_nonneg hlam0 h1mu0 · exact mul_nonneg h1lam0 hmu0 · exact mul_nonneg h1lam0 h1mu0 have hw1 : ∑ i, w i = 1 := by simp only [w, Fin.sum_univ_four, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons, Matrix.cons_val_two, Matrix.cons_val_three, Matrix.tail_cons] ring refine ⟨mixtureDesign m w Ds hw0 hw1, mixtureDesign_mem m w Ds hw0 hw1 ?_, ?_⟩ · intro i fin_cases i <;> simp only [Ds, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons, Matrix.cons_val_two, Matrix.cons_val_three, Matrix.tail_cons] · exact cutVDesign_mem m · exact allVDesign_mem m · exact pcutVDesign_mem m hOdd · exact pallVDesign_mem m hOdd · have hSM := mixtureDesign_secondMoment m w Ds hw0 hw1 uu vv ?_ · rw [hSM] congr 1 · simp only [w, uu, Fin.sum_univ_four, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons, Matrix.cons_val_two, Matrix.cons_val_three, Matrix.tail_cons] have htrace' : 2 * ((m : ℝ) - 1) * (1 - u) + s = 2 * (m : ℝ) := by simp [qParam] at htrace nlinarith [htrace, hsdef, hxdef] have hlam_u : lam + (1 - lam) * (-1 / (m : ℝ)) = u := by exact parity_lam_outer_eq_u m hm u s htrace' rw [← hlam_u] ring · simp only [w, vv, Fin.sum_univ_four, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons, Matrix.cons_val_two, Matrix.cons_val_three, Matrix.tail_cons] have hcollapse : lam * mu * (-1) + lam * (1 - mu) * 1 + (1 - lam) * mu * (-1 / (m : ℝ) ^ 2) + (1 - lam) * (1 - mu) * (1 / (m : ℝ) ^ 2) = (1 - 2 * mu) * (lam + (1 - lam) / (m : ℝ) ^ 2) := by ring rw [hcollapse] have hmu_diff : 1 - 2 * mu = (z - y) / s := by exact parity_mu_diff y z s hs_pos.ne' hsdef have hlamid : lam + (1 - lam) / (m : ℝ) ^ 2 = s / (2 * (m : ℝ)) := by exact parity_lam_inner_eq m hm s have hv_yz : v = (z - y) / (2 * (m : ℝ)) := by exact parity_v_eq_z_sub_y m hm u v y z hydef hzdef calc v = (z - y) / (2 * (m : ℝ)) := hv_yz _ = ((z - y) / s) * (s / (2 * (m : ℝ))) := by field_simp [hm0, hs_pos.ne'] _ = (1 - 2 * mu) * (lam + (1 - lam) / (m : ℝ) ^ 2) := by rw [← hmu_diff, ← hlamid] · intro i fin_cases i <;> simp only [Ds, uu, vv, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons, Matrix.cons_val_two, Matrix.cons_val_three, Matrix.tail_cons] · exact cutVDesign_secondMoment m · exact allVDesign_secondMoment m · exact pcutVDesign_secondMoment m hm hOdd · exact pallVDesign_secondMoment m hm hOdd
Helpers.ParitySliceVertices 19 declarations Explicit block-exchangeable designs realizing the triangle vertices: * cutVDesign — X(1,−1), reduced (0, 2m, 0) (uniform on {s_m, −s_m}); * allVDesign — X(1, 1), reduced (0, 0, 2m) (uniform on {1, −1} assignments); * spr

Vertex designs for the backward direction

Explicit block-exchangeable designs realizing the triangle vertices:

* cutVDesignX(1,−1), reduced (0, 2m, 0) (uniform on {s_m, −s_m}); * allVDesignX(1, 1), reduced (0, 0, 2m) (uniform on {1, −1} assignments); * spreadVDesign (even m) — X(−1/(m−1), 0), reduced (2m/q, 0, 0) (uniform on the balanced-in-each-block assignments, second moment via block symmetry and the deterministic block sums S_A = S_B = 0).

The block-sum transport lemmas (blockSumA under negation and block automorphism) supply the support-invariance the class membership needs.

theorem blockSumA_neg

Negating an assignment negates each community sum.

Formal statement
m :
z :
Fin (2 * m) → Bool
blockSumA m (fun i => ! z i) = - blockSumA m z
Proof (Lean source)
lemma blockSumA_neg (m : ℕ) (z : Fin (2 * m) → Bool) : blockSumA m (fun i => ! z i) = - blockSumA m z := by unfold blockSumA rw [← Finset.sum_neg_distrib] apply Finset.sum_congr rfl intro i _ by_cases h : z i <;> simp [h]
theorem blockSumB_neg

Negating an assignment negates the community-B sign sum, the mirror of blockSumA_neg. Together the two make every sign-symmetric support closed under global negation, which is what the balanced-design membership proofs need.

Formal statement
m :
z :
Fin (2 * m) → Bool
blockSumB m (fun i => ! z i) = - blockSumB m z
Proof (Lean source)
lemma blockSumB_neg (m : ℕ) (z : Fin (2 * m) → Bool) : blockSumB m (fun i => ! z i) = - blockSumB m z := by unfold blockSumB rw [← Finset.sum_neg_distrib] apply Finset.sum_congr rfl intro i _ by_cases h : z i <;> simp [h]
theorem blockSum_reindex

Under a block-automorphism σ, the pair of community sums of reindexBy σ z is either (S_A, S_B) (block-preserving) or (S_B, S_A) (block-swapping).

Formal statement
m :
σ :
Perm (Fin (2 * m))
:
z :
Fin (2 * m) → Bool
(blockSumA m (reindexBy m σ z) = blockSumA m z ∧ blockSumB m (reindexBy m σ z) = blockSumB m z) ∨ (blockSumA m (reindexBy m σ z) = blockSumB m z ∧ blockSumB m (reindexBy m σ z) = blockSumA m z)
Proof (Lean source)
lemma blockSum_reindex (m : ℕ) (σ : Perm (Fin (2 * m))) (hσ : IsBlockAuto m σ) (z : Fin (2 * m) → Bool) : (blockSumA m (reindexBy m σ z) = blockSumA m z ∧ blockSumB m (reindexBy m σ z) = blockSumB m z) ∨ (blockSumA m (reindexBy m σ z) = blockSumB m z ∧ blockSumB m (reindexBy m σ z) = blockSumA m z) := by rcases hσ with hpres | hswap · left exact ⟨blockSumA_reindex_pres m σ hpres z, blockSumB_reindex_pres m σ hpres z⟩ · right exact ⟨blockSumA_reindex_swap m σ hswap z, blockSumB_reindex_swap m σ hswap z⟩
theorem uniformOnDesign_two_E

Expectation under the uniform law on a two-element support {z₁, z₂}.

Formal statement
m :
z₁ z₂ :
Fin (2 * m) → Bool
hne :
z₁ ≠ z₂
f :
(Fin (2 * m) → Bool) → ℝ
(uniformOnDesign m {z₁, z₂} ⟨z₁, by simp⟩).E f = (f z₁ + f z₂) / 2
Proof (Lean source)
lemma uniformOnDesign_two_E (m : ℕ) (z₁ z₂ : Fin (2 * m) → Bool) (hne : z₁ ≠ z₂) (f : (Fin (2 * m) → Bool) → ℝ) : (uniformOnDesign m {z₁, z₂} ⟨z₁, by simp⟩).E f = (f z₁ + f z₂) / 2 := by rw [FiniteDesign.E] have hcard : ({z₁, z₂} : Finset (Fin (2 * m) → Bool)).card = 2 := by simp [hne] simp only [uniformOnDesign] rw [hcard] calc (∑ x, (if x ∈ ({z₁, z₂} : Finset (Fin (2 * m) → Bool)) then (2 : ℝ)⁻¹ else 0) * f x) = ∑ x, ((if x = z₁ then (2 : ℝ)⁻¹ * f x else 0) + (if x = z₂ then (2 : ℝ)⁻¹ * f x else 0)) := by apply Finset.sum_congr rfl intro x _ by_cases h1 : x = z₁ · simp [h1, hne] · by_cases h2 : x = z₂ · simp [h2, hne.symm] · simp [h1, h2] _ = (∑ x, if x = z₁ then (2 : ℝ)⁻¹ * f x else 0) + (∑ x, if x = z₂ then (2 : ℝ)⁻¹ * f x else 0) := by rw [Finset.sum_add_distrib] _ = (f z₁ + f z₂) / 2 := by simp [Finset.sum_ite_eq'] ring
def cutVDesign

The cut vertex design ½δ_{s_m} + ½δ_{−s_m}.

Definition (Lean source)
noncomputable def cutVDesign (m : ℕ) : FiniteDesign (Fin (2 * m) → Bool) := uniformOnDesign m {cutPlus m, cutMinus m} ⟨cutPlus m, by simp⟩
def allVDesign

The all-ones vertex design ½δ_{1} + ½δ_{−1}.

Definition (Lean source)
noncomputable def allVDesign (m : ℕ) : FiniteDesign (Fin (2 * m) → Bool) := uniformOnDesign m {(fun _ => true), (fun _ => false)} ⟨fun _ => true, by simp⟩
theorem cutVDesign_mem

The cut vertex design — a fair coin between "treat community A, control community B" and its reverse — belongs to the block-exchangeable design class: its two-point support is closed under global sign flip and under every two-block automorphism (relabelling units inside a community fixes each of the two assignments, swapping the communities exchanges them).

Formal statement
m :
Proof (Lean source)
lemma cutVDesign_mem (m : ℕ) : cutVDesign m ∈ blockExchangeableDesignClass m := by unfold cutVDesign apply uniformOnDesign_mem · intro z simp only [Finset.mem_insert, mem_singleton] constructor · intro hz rcases hz with hz | hz · right funext i have hpoint := congrFun hz i change z i = decide (¬ i.val < m) change (!(z i)) = decide (i.val < m) at hpoint by_cases h : i.val < m <;> simp [h] at hpoint ⊢ <;> exact hpoint · left funext i have hpoint := congrFun hz i change z i = decide (i.val < m) change (!(z i)) = decide (¬ i.val < m) at hpoint by_cases h : i.val < m <;> simp [h] at hpoint ⊢ <;> exact hpoint · intro hz rcases hz with rfl | rfl · right exact neg_cutPlus m · left exact neg_cutMinus m · intro σ hσ z simp only [Finset.mem_insert, mem_singleton] rcases hσ with hpres | hswap · constructor · intro hz rcases hz with hz | hz · left apply reindexBy_injective m σ rw [hz, reindex_cutPlus_pres m σ hpres] · right apply reindexBy_injective m σ rw [hz, reindex_cutMinus_pres m σ hpres] · intro hz rcases hz with rfl | rfl · left exact reindex_cutPlus_pres m σ hpres · right exact reindex_cutMinus_pres m σ hpres · constructor · intro hz rcases hz with hz | hz · right apply reindexBy_injective m σ rw [hz, reindex_cutMinus_swap m σ hswap] · left apply reindexBy_injective m σ rw [hz, reindex_cutPlus_swap m σ hswap] · intro hz rcases hz with rfl | rfl · right exact reindex_cutPlus_swap m σ hswap · left exact reindex_cutMinus_swap m σ hswap
theorem allVDesign_mem

The all-ones vertex design — a fair coin between "treat everyone" and "control everyone" — belongs to the block-exchangeable design class: its two-point support is closed under global sign flip, and both constant assignments are fixed by every permutation of the units, hence by every two-block automorphism.

Formal statement
m :
Proof (Lean source)
lemma allVDesign_mem (m : ℕ) : allVDesign m ∈ blockExchangeableDesignClass m := by unfold allVDesign apply uniformOnDesign_mem · intro z simp only [Finset.mem_insert, mem_singleton] constructor · intro hz rcases hz with hz | hz · right funext i have := congrFun hz i simpa using congrArg not this · left funext i have := congrFun hz i simpa using congrArg not this · intro hz rcases hz with rfl | rfl <;> simp · intro σ _ z simp only [Finset.mem_insert, mem_singleton] constructor · intro hz rcases hz with hz | hz · left apply reindexBy_injective m σ rw [hz, reindex_const_true m σ] · right apply reindexBy_injective m σ rw [hz, reindex_const_false m σ] · intro hz rcases hz with rfl | rfl · left exact reindex_const_true m σ · right exact reindex_const_false m σ
theorem cutVDesign_secondMoment

The cut vertex design has assignment second moment X(1,−1): two units in the same community always receive the same sign, and two units in opposite communities always receive opposite signs. In the reduced spectral coordinates this is the triangle vertex (0, 2m, 0).

Formal statement
m :
Proof (Lean source)
lemma cutVDesign_secondMoment (m : ℕ) : assignmentSecondMoment m (cutVDesign m) = blockSymMatrix m 1 (-1) := by by_cases hm0 : m = 0 · subst m ext i j exact Fin.elim0 i · have hmpos : 0 < m := Nat.pos_of_ne_zero hm0 have hne : cutPlus m ≠ cutMinus m := by intro h let k : Fin (2 * m) := ⟨0, by omega⟩ have hk := congrFun h k simp [cutPlus, cutMinus, k, hmpos] at hk ext i j simp only [assignmentSecondMoment, Matrix.of_apply] unfold cutVDesign rw [uniformOnDesign_two_E m (cutPlus m) (cutMinus m) hne] by_cases hij : i = j · subst j by_cases hi : i.val < m · have hnle : ¬ m ≤ i.val := by omega simp [signOf, cutPlus, cutMinus, blockSymMatrix, hi, hnle] · have hle : m ≤ i.val := by omega simp [signOf, cutPlus, cutMinus, blockSymMatrix, hi, hle] · by_cases hi : i.val < m <;> by_cases hj : j.val < m · simp [signOf, cutPlus, cutMinus, blockSymMatrix, hij, hi, hj] · have hji : m ≤ j.val := by omega simp [signOf, cutPlus, cutMinus, blockSymMatrix, hij, hi, hj, hji] · have hii : m ≤ i.val := by omega simp [signOf, cutPlus, cutMinus, blockSymMatrix, hij, hi, hj, hii] · have hii : m ≤ i.val := by omega have hji : m ≤ j.val := by omega simp [signOf, cutPlus, cutMinus, blockSymMatrix, hij, hi, hj, hii, hji]
theorem allVDesign_secondMoment

The all-ones vertex design has assignment second moment X(1,1): every pair of units always receives the same sign, whether or not they share a community. In the reduced spectral coordinates this is the triangle vertex (0, 0, 2m).

Formal statement
m :
Proof (Lean source)
lemma allVDesign_secondMoment (m : ℕ) : assignmentSecondMoment m (allVDesign m) = blockSymMatrix m 1 1 := by by_cases hm0 : m = 0 · subst m ext i j exact Fin.elim0 i · have hne : (fun _ : Fin (2 * m) => true) ≠ (fun _ => false) := by intro h have hmpos : 0 < m := Nat.pos_of_ne_zero hm0 let k : Fin (2 * m) := ⟨0, by omega⟩ have hk := congrFun h k simp at hk ext i j unfold allVDesign simp only [assignmentSecondMoment, Matrix.of_apply] rw [uniformOnDesign_two_E m (fun _ : Fin (2 * m) => true) (fun _ => false) hne] simp [signOf, blockSymMatrix]
def spreadSupport

The balanced-in-each-block support {z : S_A(z) = 0 ∧ S_B(z) = 0}.

Definition (Lean source)
def spreadSupport (m : ℕ) : Finset (Fin (2 * m) → Bool) := Finset.univ.filter (fun z => blockSumA m z = 0 ∧ blockSumB m z = 0)
def spreadWitness

For even m, an explicit balanced-in-each-block assignment (true on the first half of each block).

Definition (Lean source)
def spreadWitness (m : ℕ) : Fin (2 * m) → Bool := fun i => decide (i.val < m / 2 ∨ (m ≤ i.val ∧ i.val < m + m / 2))
theorem spreadWitness_mem

For even m, the explicit half-and-half assignment (treat the first half of each community, control the second half) really is balanced in each block: both community sign sums are zero.

Formal statement
m :
hEven :
Proof (Lean source)
lemma spreadWitness_mem (m : ℕ) (hEven : Even m) : spreadWitness m ∈ spreadSupport m := by simp [spreadSupport, blockSumA_spreadWitness m hEven, blockSumB_spreadWitness m hEven]
theorem spreadSupport_nonempty

For even m at least one assignment has both community sign sums equal to zero, so the balanced-in-each-block support is nonempty and the uniform law on it is well defined. Evenness is essential: for odd m each community sum is an odd integer and this support is empty.

Formal statement
m :
hEven :
(spreadSupport m).Nonempty
Proof (Lean source)
lemma spreadSupport_nonempty (m : ℕ) (hEven : Even m) : (spreadSupport m).Nonempty := ⟨spreadWitness m, spreadWitness_mem m hEven⟩
def spreadVDesign

The spread vertex design (even m).

Definition (Lean source)
noncomputable def spreadVDesign (m : ℕ) (hEven : Even m) : FiniteDesign (Fin (2 * m) → Bool) := uniformOnDesign m (spreadSupport m) (spreadSupport_nonempty m hEven)
theorem spreadVDesign_mem

For even m, the spread vertex design — uniform over the assignments that are exactly balanced inside each community — belongs to the block-exchangeable design class. Negating an assignment and relabelling units by a two-block automorphism both leave the pair of community sign sums at (0,0), so the support is invariant.

Formal statement
m :
hEven :
Proof (Lean source)
lemma spreadVDesign_mem (m : ℕ) (hEven : Even m) : spreadVDesign m hEven ∈ blockExchangeableDesignClass m := by unfold spreadVDesign apply uniformOnDesign_mem · intro z simp [spreadSupport, blockSumA_neg, blockSumB_neg] · intro σ hσ z rcases blockSum_reindex m σ hσ z with h | h · simp [spreadSupport, h.1, h.2] · simp [spreadSupport, h.1, h.2, and_comm]
theorem spreadVDesign_sumAr_zero

On the spread support the real community sums vanish, so E[S_A²]=E[S_A S_B]=0.

Formal statement
m :
hEven :
(spreadVDesign m hEven).E (fun z => sumAr m z * sumAr m z) = 0
Proof (Lean source)
lemma spreadVDesign_sumAr_zero (m : ℕ) (hEven : Even m) : (spreadVDesign m hEven).E (fun z => sumAr m z * sumAr m z) = 0 := by unfold spreadVDesign rw [FiniteDesign.E] apply Finset.sum_eq_zero intro z _ by_cases hz : z ∈ spreadSupport m · have hzmem : blockSumA m z = 0 ∧ blockSumB m z = 0 := by simpa [spreadSupport] using hz have hsum : sumAr m z = 0 := by rw [sumAr_eq_blockSumA_cast, hzmem.1] norm_num simp [uniformOnDesign, hz, hsum] · simp [uniformOnDesign, hz]
theorem spreadVDesign_sumAr_sumBr_zero

Under the spread vertex design the two community sign sums have zero cross moment, since every assignment in its support has both sums equal to zero pointwise. With the companion spreadVDesign_sumAr_zero this pins the design's reduced coordinates.

Formal statement
m :
hEven :
(spreadVDesign m hEven).E (fun z => sumAr m z * sumBr m z) = 0
Proof (Lean source)
lemma spreadVDesign_sumAr_sumBr_zero (m : ℕ) (hEven : Even m) : (spreadVDesign m hEven).E (fun z => sumAr m z * sumBr m z) = 0 := by unfold spreadVDesign rw [FiniteDesign.E] apply Finset.sum_eq_zero intro z _ by_cases hz : z ∈ spreadSupport m · have hzmem : blockSumA m z = 0 ∧ blockSumB m z = 0 := by simpa [spreadSupport] using hz have hsum : sumAr m z = 0 := by rw [sumAr_eq_blockSumA_cast, hzmem.1] norm_num simp [uniformOnDesign, hz, hsum] · simp [uniformOnDesign, hz]
CausalSmith.Experimentation.DesignPm1.spreadVDesign_sumAr_sumBr_zero · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/ParitySliceVertices.lean:586
theorem spreadVDesign_secondMoment

For even m ≥ 2 the spread vertex design has assignment second moment X(−1/(m−1), 0): units in different communities are uncorrelated, and units in the same community carry the small negative correlation −1/(m−1) forced by the community sign sum being identically zero. These are the reduced coordinates (2m/q, 0, 0) — the spread vertex of the triangle — so for even m the spread covariance is implementable.

Formal statement
m :
hm :
2 ≤ m
hEven :
assignmentSecondMoment m (spreadVDesign m hEven) = blockSymMatrix m (-1 / ((m : ℝ) - 1)) 0
Proof (Lean source)
lemma spreadVDesign_secondMoment (m : ℕ) (hm : 2 ≤ m) (hEven : Even m) : assignmentSecondMoment m (spreadVDesign m hEven) = blockSymMatrix m (-1 / ((m : ℝ) - 1)) 0 := by rcases secondMoment_blockSym_of_exchangeable m hm (spreadVDesign m hEven) (spreadVDesign_mem m hEven) with ⟨u, v, hUV⟩ have hEqU : (m : ℝ) + (m : ℝ) * ((m : ℝ) - 1) * u = 0 := by rw [← E_sumAr_sq m u v (spreadVDesign m hEven) hUV, spreadVDesign_sumAr_zero] have hEqV : (m : ℝ) ^ 2 * v = 0 := by rw [← E_sumAr_sumBr m u v (spreadVDesign m hEven) hUV, spreadVDesign_sumAr_sumBr_zero] have hmposR : 0 < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by norm_num : 0 < 2) hm) have hm0 : (m : ℝ) ≠ 0 := ne_of_gt hmposR have hmgt1 : (1 : ℝ) < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by norm_num : 1 < 2) hm) have hm1 : (m : ℝ) - 1 ≠ 0 := by linarith have huProd : ((m : ℝ) - 1) * u = -1 := by have hfac : (m : ℝ) * (1 + ((m : ℝ) - 1) * u) = 0 := by nlinarith [hEqU] have hlin : 1 + ((m : ℝ) - 1) * u = 0 := (mul_eq_zero.mp hfac).resolve_left hm0 linarith have hu : u = -1 / ((m : ℝ) - 1) := by field_simp [hm1] nlinarith have hv : v = 0 := by have hm2 : (m : ℝ) ^ 2 ≠ 0 := pow_ne_zero 2 hm0 exact (mul_eq_zero.mp hEqV).resolve_left hm2 rw [hUV, hu, hv]
Helpers.ReducedSimplexBridge 4 declarations Bridge between reduced triangle coordinates and weighted-simplex coordinates

Bridge between reduced triangle coordinates and weighted-simplex coordinates

theorem reducedTriangle_to_simplex Lemma reducedTriangle_to_simplex in the paper ↗

The change of variables t = (q x, y, z) sends the reduced triangle to Δ_{2m}.

Formal statement
m :
x y z :
hq0 :
0 ≤ qParam m
hT :
InSimplex (2 * (m : ℝ)) ![qParam m * x, y, z]
Proof (Lean source)
lemma reducedTriangle_to_simplex (m : ℕ) (x y z : ℝ) (hq0 : 0 ≤ qParam m) (hT : InReducedTriangle m x y z) : InSimplex (2 * (m : ℝ)) ![qParam m * x, y, z] := by rcases hT with ⟨hx, hy, hz, hsum⟩ constructor · intro i fin_cases i · simp [mul_nonneg hq0 hx] · simpa using hy · simpa using hz · simpa [Fin.sum_univ_three] using hsum
theorem simplex_to_reducedTriangle Lemma simplex_to_reducedTriangle in the paper ↗

The inverse change of variables x = t_x/q, y = t_y, z = t_z.

Formal statement
m :
t :
Fin 3 → ℝ
hq :
0 < qParam m
hS :
InSimplex (2 * (m : ℝ)) t
InReducedTriangle m (t 0 / qParam m) (t 1) (t 2)
Proof (Lean source)
lemma simplex_to_reducedTriangle (m : ℕ) (t : Fin 3 → ℝ) (hq : 0 < qParam m) (hS : InSimplex (2 * (m : ℝ)) t) : InReducedTriangle m (t 0 / qParam m) (t 1) (t 2) := by rcases hS with ⟨hnonneg, hsum⟩ constructor · exact div_nonneg (hnonneg 0) (le_of_lt hq) constructor · exact hnonneg 1 constructor · exact hnonneg 2 · rw [Fin.sum_univ_three] at hsum field_simp [ne_of_gt hq] exact hsum
theorem reducedObjective_eq_wsObj Lemma reducedObjective_eq_wsObj in the paper ↗

Under t = (q x, y, z), the reduced objective is the weighted-simplex objective with α = (c_x/q, c_y, c_z) and β = (1/q, 1, 1).

Formal statement
q cx cy cz kappa x y z :
hq :
q ≠ 0
reducedObjective q cx cy cz kappa x y z
= wsObj ![cx / q, cy, cz] ![1 / q, 1, 1] kappa ![q * x, y, z]
Proof (Lean source)
lemma reducedObjective_eq_wsObj (q cx cy cz kappa x y z : ℝ) (hq : q ≠ 0) : reducedObjective q cx cy cz kappa x y z = wsObj ![cx / q, cy, cz] ![1 / q, 1, 1] kappa ![q * x, y, z] := by unfold reducedObjective wsObj simp [Fin.sum_univ_three] field_simp [hq]
theorem wsObj_eq_reducedObjective Lemma wsObj_eq_reducedObjective in the paper ↗

The inverse form of reducedObjective_eq_wsObj, for a simplex point t.

Formal statement
q cx cy cz kappa :
t :
Fin 3 → ℝ
hq :
q ≠ 0
wsObj ![cx / q, cy, cz] ![1 / q, 1, 1] kappa t
= reducedObjective q cx cy cz kappa (t 0 / q) (t 1) (t 2)
Proof (Lean source)
lemma wsObj_eq_reducedObjective (q cx cy cz kappa : ℝ) (t : Fin 3 → ℝ) (hq : q ≠ 0) : wsObj ![cx / q, cy, cz] ![1 / q, 1, 1] kappa t = reducedObjective q cx cy cz kappa (t 0 / q) (t 1) (t 2) := by unfold reducedObjective wsObj simp [Fin.sum_univ_three] field_simp [hq]
Helpers.RobustConvergence 2 declarations
theorem reduced_norm_sq_block_coords Lemma reduced_norm_sq_block_coords in the paper ↗

The reduced Frobenius square at X(u,v) is the identity square plus the two off-diagonal block contributions.

Formal statement
m :
u v :
qParam m * (1 - u) ^ 2
+ (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) ^ 2
+ (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) ^ 2
= (qParam m * 1 ^ 2 + 1 ^ 2 + 1 ^ 2) + NsameR m * u ^ 2 + NcrossR m * v ^ 2
Proof (Lean source)
lemma reduced_norm_sq_block_coords (m : ℕ) (u v : ℝ) : qParam m * (1 - u) ^ 2 + (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) ^ 2 + (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) ^ 2 = (qParam m * 1 ^ 2 + 1 ^ 2 + 1 ^ 2) + NsameR m * u ^ 2 + NcrossR m * v ^ 2 := by unfold qParam NsameR NcrossR ring
CausalSmith.Experimentation.DesignPm1.reduced_norm_sq_block_coords · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/RobustConvergence.lean:18
theorem robust_minimizers_tendsto_identity_entries

Any choice of relaxed minimizers converges entrywise to the identity as κ → ∞.

Formal statement
m :
a b r :
hHom :
hr0 :
0 ≤ r
Xseq :
ℝ → Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ
hXseq :
∀ kappa : ℝ
if
0 < kappa
then
Xseq kappa ∈ blockElliptope m a b ∧
∀ X ∈ blockElliptope m a b,
designObjective m a b r kappa (Xseq kappa) ≤ designObjective m a b r kappa X
∀ i j,
Tendsto (fun kappa => Xseq kappa i j) atTop (𝓝 ((1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) i j))
Proof (Lean source)
lemma robust_minimizers_tendsto_identity_entries (m : ℕ) (a b r : ℝ) (hHom : TwoBlockHomophily m a b) (hr0 : 0 ≤ r) (Xseq : ℝ → Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) (hXseq : ∀ kappa : ℝ, 0 < kappa → Xseq kappa ∈ blockElliptope m a b ∧ ∀ X ∈ blockElliptope m a b, designObjective m a b r kappa (Xseq kappa) ≤ designObjective m a b r kappa X) : ∀ i j, Tendsto (fun kappa => Xseq kappa i j) atTop (𝓝 ((1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) i j)) := by classical rcases hHom with ⟨hm, hba, hb⟩ have hHom' : TwoBlockHomophily m a b := ⟨hm, hba, hb⟩ have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm have hmpos : (0 : ℝ) < (m : ℝ) := by nlinarith have hqpos : 0 < qParam m := by unfold qParam nlinarith have hcenterSq_pos : 0 < qParam m * 1 ^ 2 + (1 : ℝ) ^ 2 + (1 : ℝ) ^ 2 := by positivity have hqM : qParam m * 1 ^ 2 + (1 : ℝ) ^ 2 + (1 : ℝ) ^ 2 = 2 * (m : ℝ) := by unfold qParam ring have hsumpos : 0 < a + b := by nlinarith have hb2pos : 0 < 2 * b := by positivity have hcx_nonneg : 0 ≤ cX m a b r := by unfold cX have hrdiv : 0 ≤ r / (a + b) := div_nonneg hr0 (le_of_lt hsumpos) exact mul_nonneg (le_of_lt hqpos) (by nlinarith) have hcy_nonneg : 0 ≤ cY b r := by unfold cY have hrdiv : 0 ≤ r / (2 * b) := div_nonneg hr0 (le_of_lt hb2pos) nlinarith have hcz_nonneg : 0 ≤ cZ m := by unfold cZ nlinarith let centerSq : ℝ := qParam m * 1 ^ 2 + (1 : ℝ) ^ 2 + (1 : ℝ) ^ 2 let centerNorm : ℝ := Real.sqrt centerSq let L : ℝ := cX m a b r + cY b r + cZ m have hIobj : ∀ kappa : ℝ, designObjective m a b r kappa (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) = L + kappa * centerNorm := by intro kappa calc designObjective m a b r kappa (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa 1 1 1 := identity_objective_eq_reduced_center m a b r kappa hHom' _ = L + kappa * centerNorm := by simp [reducedObjective, L, centerNorm, centerSq] intro i j by_cases hij : i = j · subst j rw [Metric.tendsto_nhds] intro ε hε refine Filter.eventually_atTop.2 ⟨(1 : ℝ), ?_⟩ intro kappa hk have hkpos : 0 < kappa := by linarith rcases (hXseq kappa hkpos).1 with ⟨u, v, hXeq, _hmem⟩ have hdist : dist (Xseq kappa i i) ((1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) i i) = 0 := by simp [hXeq, blockSymMatrix] rw [hdist] exact hε · have hIentry : ((1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) i j) = 0 := by simp [hij] by_cases hsame : decide (i.val < m) = decide (j.val < m) · rw [Metric.tendsto_nhds] intro ε hε let C : ℝ := NsameR m have hCpos : 0 < C := by dsimp [C, NsameR] nlinarith let δ : ℝ := Real.sqrt (centerSq + C * ε ^ 2) - centerNorm have hδpos : 0 < δ := by have hlt : centerSq < centerSq + C * ε ^ 2 := by have : 0 < C * ε ^ 2 := mul_pos hCpos (sq_pos_of_pos hε) linarith dsimp [δ, centerNorm] exact sub_pos.mpr (Real.sqrt_lt_sqrt (le_of_lt hcenterSq_pos) hlt) refine Filter.eventually_atTop.2 ⟨max (1 : ℝ) ((L + 1) / δ), ?_⟩ intro kappa hklarge have hkpos : 0 < kappa := by have h1 : (1 : ℝ) ≤ kappa := le_trans (le_max_left _ _) hklarge linarith have hkδ_gt : L < kappa * δ := by have hkT : (L + 1) / δ ≤ kappa := le_trans (le_max_right _ _) hklarge have hmul := mul_le_mul_of_nonneg_right hkT (le_of_lt hδpos) have hdiv : ((L + 1) / δ) * δ = L + 1 := by field_simp [ne_of_gt hδpos] nlinarith by_contra hnotdist have habs : ε ≤ |Xseq kappa i j| := by have : ¬ |Xseq kappa i j| < ε := by simpa [Real.dist_eq, hIentry] using hnotdist exact le_of_not_gt this rcases (hXseq kappa hkpos).1 with ⟨u, v, hXeq, hmem⟩ have hentry : Xseq kappa i j = u := by have hsameProp : i.val < m ↔ j.val < m := by simpa [decide_eq_decide] using hsame simp [hXeq, blockSymMatrix, hij, hsameProp] have hu_abs : ε ≤ |u| := by simpa [hentry] using habs have hu_sq : ε ^ 2 ≤ u ^ 2 := by exact (sq_le_sq.mpr (by simpa [abs_of_pos hε] using hu_abs)) have hspec := block_spectral_coordinates m a b r kappa u v hHom' have htri : InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) := hspec.1.mp ⟨u, v, rfl, hmem⟩ rcases htri with ⟨hx, hy, hz, _hsum⟩ have hlin_nonneg : 0 ≤ cX m a b r * (1 - u) + cY b r * (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) + cZ m * (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) := by exact add_nonneg (add_nonneg (mul_nonneg hcx_nonneg hx) (mul_nonneg hcy_nonneg hy)) (mul_nonneg hcz_nonneg hz) let normSq : ℝ := qParam m * (1 - u) ^ 2 + (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) ^ 2 + (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) ^ 2 let normRed : ℝ := Real.sqrt normSq have hnormSq_eq : normSq = centerSq + NsameR m * u ^ 2 + NcrossR m * v ^ 2 := by simp [normSq, centerSq, reduced_norm_sq_block_coords] have hnorm_lower : centerNorm + δ ≤ normRed := by have hcross_nonneg : 0 ≤ NcrossR m * v ^ 2 := by dsimp [NcrossR] positivity have hsame_sq : C * ε ^ 2 ≤ NsameR m * u ^ 2 := by dsimp [C] exact mul_le_mul_of_nonneg_left hu_sq (le_of_lt hCpos) have hsq_le : centerSq + C * ε ^ 2 ≤ normSq := by rw [hnormSq_eq] dsimp [C] at hsame_sq ⊢ linarith have hsqrt := Real.sqrt_le_sqrt hsq_le simpa [normRed, δ, centerNorm] using hsqrt have hobj_lower : kappa * normRed ≤ designObjective m a b r kappa (blockSymMatrix m u v) := by rw [hspec.2.1] change kappa * normRed ≤ (cX m a b r * (1 - u) + cY b r * (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) + cZ m * (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) + kappa * normRed) exact le_add_of_nonneg_left hlin_nonneg have hleBlock : designObjective m a b r kappa (blockSymMatrix m u v) ≤ designObjective m a b r kappa (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) := by have hle := (hXseq kappa hkpos).2 (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) (identity_mem_blockElliptope m a b hHom') rwa [hXeq] at hle have hmain : kappa * (centerNorm + δ) ≤ L + kappa * centerNorm := by calc kappa * (centerNorm + δ) ≤ kappa * normRed := mul_le_mul_of_nonneg_left hnorm_lower (le_of_lt hkpos) _ ≤ designObjective m a b r kappa (blockSymMatrix m u v) := hobj_lower _ ≤ designObjective m a b r kappa (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) := hleBlock _ = L + kappa * centerNorm := hIobj kappa have hkδ_le : kappa * δ ≤ L := by have hmain' : kappa * centerNorm + kappa * δ ≤ L + kappa * centerNorm := by simpa [mul_add] using hmain linarith exact (not_lt_of_ge hkδ_le) hkδ_gt · rw [Metric.tendsto_nhds] intro ε hε let C : ℝ := NcrossR m have hCpos : 0 < C := by dsimp [C, NcrossR] nlinarith let δ : ℝ := Real.sqrt (centerSq + C * ε ^ 2) - centerNorm have hδpos : 0 < δ := by have hlt : centerSq < centerSq + C * ε ^ 2 := by have : 0 < C * ε ^ 2 := mul_pos hCpos (sq_pos_of_pos hε) linarith dsimp [δ, centerNorm] exact sub_pos.mpr (Real.sqrt_lt_sqrt (le_of_lt hcenterSq_pos) hlt) refine Filter.eventually_atTop.2 ⟨max (1 : ℝ) ((L + 1) / δ), ?_⟩ intro kappa hklarge have hkpos : 0 < kappa := by have h1 : (1 : ℝ) ≤ kappa := le_trans (le_max_left _ _) hklarge linarith have hkδ_gt : L < kappa * δ := by have hkT : (L + 1) / δ ≤ kappa := le_trans (le_max_right _ _) hklarge have hmul := mul_le_mul_of_nonneg_right hkT (le_of_lt hδpos) have hdiv : ((L + 1) / δ) * δ = L + 1 := by field_simp [ne_of_gt hδpos] nlinarith by_contra hnotdist have habs : ε ≤ |Xseq kappa i j| := by have : ¬ |Xseq kappa i j| < ε := by simpa [Real.dist_eq, hIentry] using hnotdist exact le_of_not_gt this rcases (hXseq kappa hkpos).1 with ⟨u, v, hXeq, hmem⟩ have hentry : Xseq kappa i j = v := by have hcrossProp : ¬ (i.val < m ↔ j.val < m) := by intro hprop exact hsame (by simpa [decide_eq_decide] using hprop) simp [hXeq, blockSymMatrix, hij, hcrossProp] have hv_abs : ε ≤ |v| := by simpa [hentry] using habs have hv_sq : ε ^ 2 ≤ v ^ 2 := by exact (sq_le_sq.mpr (by simpa [abs_of_pos hε] using hv_abs)) have hspec := block_spectral_coordinates m a b r kappa u v hHom' have htri : InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) := hspec.1.mp ⟨u, v, rfl, hmem⟩ rcases htri with ⟨hx, hy, hz, _hsum⟩ have hlin_nonneg : 0 ≤ cX m a b r * (1 - u) + cY b r * (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) + cZ m * (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) := by exact add_nonneg (add_nonneg (mul_nonneg hcx_nonneg hx) (mul_nonneg hcy_nonneg hy)) (mul_nonneg hcz_nonneg hz) let normSq : ℝ := qParam m * (1 - u) ^ 2 + (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) ^ 2 + (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) ^ 2 let normRed : ℝ := Real.sqrt normSq have hnormSq_eq : normSq = centerSq + NsameR m * u ^ 2 + NcrossR m * v ^ 2 := by simp [normSq, centerSq, reduced_norm_sq_block_coords] have hnorm_lower : centerNorm + δ ≤ normRed := by have hsame_nonneg : 0 ≤ NsameR m * u ^ 2 := by have hNsame : 0 ≤ NsameR m := by dsimp [NsameR] nlinarith exact mul_nonneg hNsame (sq_nonneg u) have hcross_sq : C * ε ^ 2 ≤ NcrossR m * v ^ 2 := by dsimp [C] exact mul_le_mul_of_nonneg_left hv_sq (le_of_lt hCpos) have hsq_le : centerSq + C * ε ^ 2 ≤ normSq := by rw [hnormSq_eq] dsimp [C] at hcross_sq ⊢ linarith have hsqrt := Real.sqrt_le_sqrt hsq_le simpa [normRed, δ, centerNorm] using hsqrt have hobj_lower : kappa * normRed ≤ designObjective m a b r kappa (blockSymMatrix m u v) := by rw [hspec.2.1] change kappa * normRed ≤ (cX m a b r * (1 - u) + cY b r * (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) + cZ m * (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) + kappa * normRed) exact le_add_of_nonneg_left hlin_nonneg have hleBlock : designObjective m a b r kappa (blockSymMatrix m u v) ≤ designObjective m a b r kappa -- … truncated; follow the source link for the rest …
CausalSmith.Experimentation.DesignPm1.robust_minimizers_tendsto_identity_entries · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/RobustConvergence.lean:31
Helpers.RobustCorner 10 declarations Robust-corner helper lemmas

Robust-corner helper lemmas

theorem iidDesign_sign_pair_sum_zero Lemma iidDesign_sign_pair_sum_zero in the paper ↗

Under the uniform iid sign law, the raw sum of two distinct coordinate signs is zero.

Formal statement
m :
i j :
Fin (2 * m)
hij :
i ≠ j
(∑ z : Fin (2 * m) → Bool, signOf m z i * signOf m z j) = 0
Proof (Lean source)
lemma iidDesign_sign_pair_sum_zero (m : ℕ) (i j : Fin (2 * m)) (hij : i ≠ j) : (∑ z : Fin (2 * m) → Bool, signOf m z i * signOf m z j) = 0 := by classical have hji : j ≠ i := fun h => hij h.symm let e : (Fin (2 * m) → Bool) ≃ (Fin (2 * m) → Bool) := { toFun := fun z k => if k = i then ! z k else z k invFun := fun z k => if k = i then ! z k else z k left_inv := by intro z funext k by_cases hk : k = i <;> simp [hk] right_inv := by intro z funext k by_cases hk : k = i <;> simp [hk] } have hflip : ∀ z : Fin (2 * m) → Bool, signOf m (e z) i * signOf m (e z) j = - (signOf m z i * signOf m z j) := by intro z unfold signOf simp [e, hji] by_cases zi : z i <;> by_cases zj : z j <;> simp [zi, zj] have hsum_eq : (∑ z : Fin (2 * m) → Bool, signOf m z i * signOf m z j) = ∑ z : Fin (2 * m) → Bool, signOf m (e z) i * signOf m (e z) j := by simpa using (Equiv.sum_comp e (fun z : Fin (2 * m) → Bool => signOf m z i * signOf m z j)).symm have hsum_neg : (∑ z : Fin (2 * m) → Bool, signOf m z i * signOf m z j) = - (∑ z : Fin (2 * m) → Bool, signOf m z i * signOf m z j) := by calc (∑ z : Fin (2 * m) → Bool, signOf m z i * signOf m z j) = ∑ z : Fin (2 * m) → Bool, signOf m (e z) i * signOf m (e z) j := hsum_eq _ = ∑ z : Fin (2 * m) → Bool, - (signOf m z i * signOf m z j) := by exact Finset.sum_congr rfl (fun z _ => hflip z) _ = - (∑ z : Fin (2 * m) → Bool, signOf m z i * signOf m z j) := by simp linarith
CausalSmith.Experimentation.DesignPm1.iidDesign_sign_pair_sum_zero · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/RobustCorner.lean:18

The iid Rademacher design has identity second-moment matrix.

Formal statement
m :
Proof (Lean source)
lemma iidDesign_secondMoment (m : ℕ) : assignmentSecondMoment m (iidDesign m) = 1 := by ext i j by_cases hij : i = j · subst j simp [assignmentSecondMoment_diag] · have hsum0 := iidDesign_sign_pair_sum_zero m i j hij calc assignmentSecondMoment m (iidDesign m) i j = (card (Fin (2 * m) → Bool) : ℝ)⁻¹ * (∑ z : Fin (2 * m) → Bool, signOf m z i * signOf m z j) := by simp [assignmentSecondMoment, iidDesign, FiniteDesign.E, Finset.mul_sum, mul_comm] _ = 0 := by simp [hsum0] _ = (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) i j := by simp [hij]
theorem identity_mem_blockElliptope

The identity covariance is the block-symmetric center (u,v)=(0,0), hence lies in E_m^blk under two-block homophily.

Formal statement
m :
a b :
hHom :
(1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) ∈ blockElliptope m a b
Proof (Lean source)
lemma identity_mem_blockElliptope (m : ℕ) (a b : ℝ) (hHom : TwoBlockHomophily m a b) : (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) ∈ blockElliptope m a b := by have hspec := block_spectral_coordinates m a b 0 0 0 0 hHom have hcenter := hspec.2.2.2.2 have htri : InReducedTriangle m (1 - (0 : ℝ)) (1 + ((m : ℝ) - 1) * (0 : ℝ) - (m : ℝ) * (0 : ℝ)) (1 + ((m : ℝ) - 1) * (0 : ℝ) + (m : ℝ) * (0 : ℝ)) := by simpa [hcenter] using (frobenius_center_certificate m 0 0 0 1 (by rcases hHom with ⟨hm, _, _⟩ unfold qParam have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm nlinarith)).1.1 rw [identity_eq_blockSym] exact hspec.1.mpr htri
CausalSmith.Experimentation.DesignPm1.identity_mem_blockElliptope · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/RobustCorner.lean:74
theorem robust_coeff_r_eq_of_center

The center first-order equality c_x/q = c_y forces r = 2b(a+b).

Formal statement
m :
a b r :
hHom :
hxy :
cX m a b r / qParam m = cY b r
r = 2 * b * (a + b)
Proof (Lean source)
lemma robust_coeff_r_eq_of_center (m : ℕ) (a b r : ℝ) (hHom : TwoBlockHomophily m a b) (hxy : cX m a b r / qParam m = cY b r) : r = 2 * b * (a + b) := by rcases hHom with ⟨hm, hba, hb⟩ have hq : qParam m ≠ 0 := by unfold qParam have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm nlinarith have hsum : a + b ≠ 0 := by nlinarith have hb2 : 2 * b ≠ 0 := by positivity have hdiff : a - b ≠ 0 := by nlinarith unfold cX cY at hxy have hraw : a + b + r / (a + b) = 2 * b + r / (2 * b) := by have hcancel : qParam m * (a + b + r / (a + b)) / qParam m = a + b + r / (a + b) := by field_simp [hq] simpa [hcancel] using hxy have hmul : (a - b) * (1 - r / (2 * b * (a + b))) = 0 := by have hrearr : (a + b + r / (a + b)) - (2 * b + r / (2 * b)) = (a - b) * (1 - r / (2 * b * (a + b))) := by field_simp [hsum, hb2] ring nlinarith have hunit : 1 - r / (2 * b * (a + b)) = 0 := (mul_eq_zero.mp hmul).resolve_left hdiff have hden : 2 * b * (a + b) ≠ 0 := by nlinarith field_simp [hden] at hunit linarith
CausalSmith.Experimentation.DesignPm1.robust_coeff_r_eq_of_center · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/RobustCorner.lean:93
theorem robust_locus_of_center_coeffs

The two center coefficient equalities are equivalent to the affine-balanced locus.

Formal statement
m :
a b r :
hHom :
hxy :
cX m a b r / qParam m = cY b r
hyz :
cY b r = cZ m
a + 3 * b = 2 * (m : ℝ) ∧ r = 2 * b * (a + b)
Proof (Lean source)
lemma robust_locus_of_center_coeffs (m : ℕ) (a b r : ℝ) (hHom : TwoBlockHomophily m a b) (hxy : cX m a b r / qParam m = cY b r) (hyz : cY b r = cZ m) : a + 3 * b = 2 * (m : ℝ) ∧ r = 2 * b * (a + b) := by have hr : r = 2 * b * (a + b) := robust_coeff_r_eq_of_center m a b r hHom hxy constructor · rcases hHom with ⟨_, _, hb⟩ have hb2 : 2 * b ≠ 0 := by positivity unfold cY cZ at hyz rw [hr] at hyz field_simp [hb2] at hyz linarith · exact hr
CausalSmith.Experimentation.DesignPm1.robust_locus_of_center_coeffs · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/RobustCorner.lean:125
theorem robust_center_coeffs_of_locus

On the affine-balanced locus, the reduced linear coefficients are all equal.

Formal statement
m :
a b r :
hHom :
hloc :
a + 3 * b = 2 * (m : ℝ) ∧ r = 2 * b * (a + b)
cX m a b r / qParam m = cY b r ∧ cY b r = cZ m
Proof (Lean source)
lemma robust_center_coeffs_of_locus (m : ℕ) (a b r : ℝ) (hHom : TwoBlockHomophily m a b) (hloc : a + 3 * b = 2 * (m : ℝ) ∧ r = 2 * b * (a + b)) : cX m a b r / qParam m = cY b r ∧ cY b r = cZ m := by rcases hHom with ⟨hm, hba, hb⟩ have hq : qParam m ≠ 0 := by unfold qParam have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm nlinarith have hsum : a + b ≠ 0 := by nlinarith have hb2 : 2 * b ≠ 0 := by positivity constructor · unfold cX cY rw [hloc.2] field_simp [hq, hsum, hb2] ring · unfold cY cZ rw [hloc.2] field_simp [hb2] linarith [hloc.1]
CausalSmith.Experimentation.DesignPm1.robust_center_coeffs_of_locus · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/RobustCorner.lean:142

Inverse map from reduced coordinates to block-symmetric (u,v) coordinates.

Formal statement
m :
x y z :
hm :
2 ≤ m
htri :
let u := 1 - x let v := (z - y) / (2 * (m : ℝ)) (1 - u = x) ∧
(1 + ((m : ℝ) - 1) * u - (m : ℝ) * v = y) ∧
(1 + ((m : ℝ) - 1) * u + (m : ℝ) * v = z)
Proof (Lean source)
lemma reduced_coord_inverse (m : ℕ) (x y z : ℝ) (hm : 2 ≤ m) (htri : InReducedTriangle m x y z) : let u := 1 - x let v := (z - y) / (2 * (m : ℝ)) (1 - u = x) ∧ (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v = y) ∧ (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v = z) := by intro u v rcases htri with ⟨_hx, _hy, _hz, hsum⟩ have hm0 : (m : ℝ) ≠ 0 := by have : (0 : ℕ) < m := lt_of_lt_of_le (by decide : 0 < 2) hm exact_mod_cast (ne_of_gt this) have hq : qParam m = 2 * ((m : ℝ) - 1) := rfl constructor · simp [u] constructor · dsimp [u, v] rw [hq] at hsum field_simp [hm0] nlinarith [hsum] · dsimp [u, v] rw [hq] at hsum field_simp [hm0] nlinarith [hsum]
theorem identity_objective_eq_reduced_center

The matrix objective at I_n is the reduced objective at (1,1,1).

Formal statement
m :
a b r kappa :
hHom :
designObjective m a b r kappa (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ)
= reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa 1 1 1
Proof (Lean source)
lemma identity_objective_eq_reduced_center (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) : designObjective m a b r kappa (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa 1 1 1 := by have hspec := block_spectral_coordinates m a b r kappa 0 0 hHom have hcoords := hspec.2.2.2.2 rw [identity_eq_blockSym] simpa [hcoords] using hspec.2.1
CausalSmith.Experimentation.DesignPm1.identity_objective_eq_reduced_center · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/RobustCorner.lean:192
theorem center_coeffs_of_identity_relaxed_min

If I_n minimizes the matrix objective on the block elliptope, the reduced center first-order coefficient equalities hold.

Formal statement
m :
a b r kappa :
hHom :
hmin :
∀ X ∈ blockElliptope m a b,
designObjective m a b r kappa (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ)
designObjective m a b r kappa X
cX m a b r / qParam m = cY b r ∧ cY b r = cZ m
Proof (Lean source)
lemma center_coeffs_of_identity_relaxed_min (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hmin : ∀ X ∈ blockElliptope m a b, designObjective m a b r kappa (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) ≤ designObjective m a b r kappa X) : cX m a b r / qParam m = cY b r ∧ cY b r = cZ m := by have hm : 2 ≤ m := hHom.1 have hq : 0 < qParam m := by unfold qParam have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm nlinarith have hcert := frobenius_center_certificate m (cX m a b r) (cY b r) (cZ m) kappa hq refine hcert.2.1 ?_ intro x y z htri let u : ℝ := 1 - x let v : ℝ := (z - y) / (2 * (m : ℝ)) have hcoords := reduced_coord_inverse m x y z hm htri have htri_uv : InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) := by simpa [u, v, hcoords.1, hcoords.2.1, hcoords.2.2] using htri have hspec := block_spectral_coordinates m a b r kappa u v hHom have hmem : blockSymMatrix m u v ∈ blockElliptope m a b := hspec.1.mpr htri_uv calc reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa 1 1 1 = designObjective m a b r kappa (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) := (identity_objective_eq_reduced_center m a b r kappa hHom).symm _ ≤ designObjective m a b r kappa (blockSymMatrix m u v) := hmin (blockSymMatrix m u v) hmem _ = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := by simpa [u, v, hcoords.1, hcoords.2.1, hcoords.2.2] using hspec.2.1
CausalSmith.Experimentation.DesignPm1.center_coeffs_of_identity_relaxed_min · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/RobustCorner.lean:203
theorem identity_strict_relaxed_min_of_locus

On the affine-balanced locus and for κ>0, I_n is the strict relaxed minimizer over the block elliptope.

Formal statement
m :
a b r kappa :
hHom :
hk :
0 < kappa
hloc :
a + 3 * b = 2 * (m : ℝ) ∧ r = 2 * b * (a + b)
(1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) ∈ blockElliptope m a b ∧
∀ X ∈ blockElliptope m a b,
X
≠ 1 → designObjective m a b r kappa (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) < designObjective m a b r kappa X
Proof (Lean source)
lemma identity_strict_relaxed_min_of_locus (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 < kappa) (hloc : a + 3 * b = 2 * (m : ℝ) ∧ r = 2 * b * (a + b)) : (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) ∈ blockElliptope m a b ∧ ∀ X ∈ blockElliptope m a b, X ≠ 1 → designObjective m a b r kappa (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) < designObjective m a b r kappa X := by have hm : 2 ≤ m := hHom.1 have hmpos : (0 : ℝ) < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by decide : 0 < 2) hm) have hm0 : (m : ℝ) ≠ 0 := ne_of_gt hmpos have hq : 0 < qParam m := by unfold qParam have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm nlinarith have hcoeff := robust_center_coeffs_of_locus m a b r hHom hloc have hcert := frobenius_center_certificate m (cX m a b r) (cY b r) (cZ m) kappa hq constructor · exact identity_mem_blockElliptope m a b hHom · intro X hX hne rcases hX with ⟨u, v, rfl, hmem⟩ have hspec := block_spectral_coordinates m a b r kappa u v hHom have htri : InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) := hspec.1.mp ⟨u, v, rfl, hmem⟩ have hcoord_ne : ((1 - u, 1 + ((m : ℝ) - 1) * u - (m : ℝ) * v, 1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) : ℝ × ℝ × ℝ) ≠ (1, 1, 1) := by intro hcoord have hx1 : 1 - u = 1 := congrArg Prod.fst hcoord have hz1 : 1 + ((m : ℝ) - 1) * u + (m : ℝ) * v = 1 := congrArg (fun p : ℝ × ℝ × ℝ => p.2.2) hcoord have hu : u = 0 := by linarith have hv : v = 0 := by subst u have hmv : (m : ℝ) * v = 0 := by nlinarith exact (mul_eq_zero.mp hmv).resolve_left hm0 apply hne rw [identity_eq_blockSym, hu, hv] calc designObjective m a b r kappa (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa 1 1 1 := identity_objective_eq_reduced_center m a b r kappa hHom _ < reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) := hcert.2.2 hk hcoeff.1 hcoeff.2 _ _ _ htri hcoord_ne _ = designObjective m a b r kappa (blockSymMatrix m u v) := hspec.2.1.symm
CausalSmith.Experimentation.DesignPm1.identity_strict_relaxed_min_of_locus · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/RobustCorner.lean:239
Helpers.SharpActive 1 declarations Sharp-certificate active-set assembly helpers

Sharp-certificate active-set assembly helpers

theorem sharp_reduced_active_set_and_unique

For κ > 0, the active-set SOCP certificate gives the unique relaxed minimizer in reduced coordinates and the relaxed value formula.

Formal statement
m :
a b r kappa :
hHom :
hk :
0 ≤ kappa
hkpos :
0 < kappa
(∃! t : ℝ × ℝ × ℝ, InReducedTriangle m t.1 t.2.1 t.2.2 ∧ ∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t.1 t.2.1 t.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ∧
(∃ S : Finset (Fin 3), ∃ lam : ℝ, IsAdmissibleSupport ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa S lam ∧ InReducedTriangle m (activeSetPoint (2 * (m : ℝ)) ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] S lam 0 / qParam m) (activeSetPoint (2 * (m : ℝ)) ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] S lam 1) (activeSetPoint (2 * (m : ℝ)) ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] S lam 2) ∧ (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa (activeSetPoint (2 * (m : ℝ)) ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] S lam 0 / qParam m) (activeSetPoint (2 * (m : ℝ)) ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] S lam 1) (activeSetPoint (2 * (m : ℝ)) ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] S lam 2) ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ∧ relaxedReducedValue m a b r kappa = 2 * (m : ℝ) * lam)
Proof (Lean source)
lemma sharp_reduced_active_set_and_unique (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 ≤ kappa) (hkpos : 0 < kappa) : (∃! t : ℝ × ℝ × ℝ, InReducedTriangle m t.1 t.2.1 t.2.2 ∧ ∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t.1 t.2.1 t.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ∧ (∃ S : Finset (Fin 3), ∃ lam : ℝ, IsAdmissibleSupport ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa S lam ∧ InReducedTriangle m (activeSetPoint (2 * (m : ℝ)) ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] S lam 0 / qParam m) (activeSetPoint (2 * (m : ℝ)) ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] S lam 1) (activeSetPoint (2 * (m : ℝ)) ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] S lam 2) ∧ (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa (activeSetPoint (2 * (m : ℝ)) ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] S lam 0 / qParam m) (activeSetPoint (2 * (m : ℝ)) ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] S lam 1) (activeSetPoint (2 * (m : ℝ)) ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] S lam 2) ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ∧ relaxedReducedValue m a b r kappa = 2 * (m : ℝ) * lam) := by have hm : 2 ≤ m := hHom.1 have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm have hq : 0 < qParam m := by unfold qParam nlinarith have hq0 : 0 ≤ qParam m := le_of_lt hq have hM : 0 < 2 * (m : ℝ) := by positivity let alpha : Fin 3 → ℝ := ![cX m a b r / qParam m, cY b r, cZ m] let beta : Fin 3 → ℝ := ![1 / qParam m, 1, 1] have hbetaPos : ∀ i, 0 < beta i := by intro i fin_cases i · have : 0 < 1 / qParam m := by positivity simpa [beta] using this · simp [beta] · simp [beta] obtain ⟨⟨S, lam⟩, hp, _huniqPair⟩ := (weighted_simplex_active_set (2 * (m : ℝ)) hM alpha beta kappa hbetaPos hk).1 hkpos let t0 : Fin 3 → ℝ := activeSetPoint (2 * (m : ℝ)) alpha beta S lam let X0 : ℝ × ℝ × ℝ := (t0 0 / qParam m, t0 1, t0 2) have ht0S : InSimplex (2 * (m : ℝ)) t0 := by simpa [t0] using hp.2.1 have ht0Strict : ∀ s : Fin 3 → ℝ, InSimplex (2 * (m : ℝ)) s → s ≠ t0 → wsObj alpha beta kappa t0 < wsObj alpha beta kappa s := by simpa [t0] using hp.2.2.1 have hMin : InReducedTriangle m X0.1 X0.2.1 X0.2.2 ∧ ∀ x y z, InReducedTriangle m x y z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X0.1 X0.2.1 X0.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := by refine ⟨by simpa [X0] using simplex_to_reducedTriangle m t0 hq ht0S, ?_⟩ intro x y z hT let s : Fin 3 → ℝ := ![qParam m * x, y, z] have hsS : InSimplex (2 * (m : ℝ)) s := reducedTriangle_to_simplex m x y z hq0 hT have hleWs : wsObj alpha beta kappa t0 ≤ wsObj alpha beta kappa s := by by_cases hEq : s = t0 · rw [hEq] · exact le_of_lt (ht0Strict s hsS hEq) have hleft : wsObj alpha beta kappa t0 = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X0.1 X0.2.1 X0.2.2 := by rw [show wsObj alpha beta kappa t0 = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa t0 by rfl] rw [wsObj_eq_reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t0 (ne_of_gt hq)] have hright : wsObj alpha beta kappa s = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := by rw [show wsObj alpha beta kappa s = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa s by rfl] rw [reducedObjective_eq_wsObj (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z (ne_of_gt hq)] simpa [hleft, hright] using hleWs have hUnique : ∃! t : ℝ × ℝ × ℝ, InReducedTriangle m t.1 t.2.1 t.2.2 ∧ ∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t.1 t.2.1 t.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z' := by refine ⟨X0, hMin, ?_⟩ rintro ⟨x, y, z⟩ ht let s : Fin 3 → ℝ := ![qParam m * x, y, z] have hsS : InSimplex (2 * (m : ℝ)) s := reducedTriangle_to_simplex m x y z hq0 ht.1 have hsEq : s = t0 := by by_contra hne have hlt := ht0Strict s hsS hne have hleRed := ht.2 X0.1 X0.2.1 X0.2.2 hMin.1 have hleft : wsObj alpha beta kappa s = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := by rw [show wsObj alpha beta kappa s = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa s by rfl] rw [reducedObjective_eq_wsObj (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z (ne_of_gt hq)] have hright : wsObj alpha beta kappa t0 = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X0.1 X0.2.1 X0.2.2 := by rw [show wsObj alpha beta kappa t0 = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa t0 by rfl] rw [wsObj_eq_reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t0 (ne_of_gt hq)] have hleWs : wsObj alpha beta kappa s ≤ wsObj alpha beta kappa t0 := by simpa [hleft, hright] using hleRed exact (not_lt_of_ge hleWs) hlt have hx : x = t0 0 / qParam m := by have h0 := congrFun hsEq 0 dsimp [s] at h0 rw [← h0] field_simp [ne_of_gt hq] have hy : y = t0 1 := by have h1 := congrFun hsEq 1 simpa [s] using h1 have hz : z = t0 2 := by have h2 := congrFun hsEq 2 simpa [s] using h2 ext <;> simp [X0, hx, hy, hz] have hRelVal : relaxedReducedValue m a b r kappa = 2 * (m : ℝ) * lam := by have hval := relaxedReducedValue_eq_of_min m a b r kappa X0 hMin have hwsVal : wsObj alpha beta kappa t0 = 2 * (m : ℝ) * lam := by simpa [t0] using hp.2.2.2 have hobj : reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X0.1 X0.2.1 X0.2.2 = wsObj alpha beta kappa t0 := by rw [show wsObj alpha beta kappa t0 = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa t0 by rfl] rw [wsObj_eq_reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t0 (ne_of_gt hq)] rw [hval, hobj, hwsVal] refine ⟨hUnique, S, lam, ?_, ?_, ?_, hRelVal⟩ · simpa [alpha, beta] using hp.1 · simpa [X0, t0, alpha, beta] using hMin.1 · simpa [X0, t0, alpha, beta] using hMin.2
CausalSmith.Experimentation.DesignPm1.sharp_reduced_active_set_and_unique · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SharpActive.lean:17
Helpers.SharpTrunc 2 declarations Sharp-certificate truncation helpers

Sharp-certificate truncation helpers

theorem sharp_truncation_value_of_no_reduced_argmin_in_slice

If no relaxed minimizer meets the parity slice, the implementable reduced value is the weighted-simplex truncation value at the selector.

Formal statement
m :
a b r kappa :
hHom :
hk :
0 ≤ kappa
hNoMeet :
¬ ∃ x y z, InReducedTriangle m x y z ∧ (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ∧ parityThreshold m
≤ y + z
= wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa (truncSegPoint (2 * (m : ℝ)) (parityThreshold m) (truncSelector (2 * (m : ℝ)) (parityThreshold m) ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa))
Proof (Lean source)
lemma sharp_truncation_value_of_no_reduced_argmin_in_slice (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 ≤ kappa) (hNoMeet : ¬ ∃ x y z, InReducedTriangle m x y z ∧ (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ∧ parityThreshold m ≤ y + z) : implementableReducedValue m a b r kappa = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa (truncSegPoint (2 * (m : ℝ)) (parityThreshold m) (truncSelector (2 * (m : ℝ)) (parityThreshold m) ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa)) := by have hm : 2 ≤ m := hHom.1 have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm have hmpos : 0 < (m : ℝ) := by positivity have hq : 0 < qParam m := by unfold qParam nlinarith have hq0 : 0 ≤ qParam m := le_of_lt hq have hM : 0 < 2 * (m : ℝ) := by positivity let alpha : Fin 3 → ℝ := ![cX m a b r / qParam m, cY b r, cZ m] let beta : Fin 3 → ℝ := ![1 / qParam m, 1, 1] have hbetaPos : ∀ i, 0 < beta i := by intro i fin_cases i · have : 0 < 1 / qParam m := by positivity simpa [beta] using this · simp [beta] · simp [beta] have hbetaY : beta 1 = 1 := by simp [beta] have hbetaZ : beta 2 = 1 := by simp [beta] have hd0 : 0 ≤ parityThreshold m := by unfold parityThreshold by_cases hEven : Even m · simp [hEven] · simp [hEven] positivity have hdM : parityThreshold m ≤ 2 * (m : ℝ) := by unfold parityThreshold by_cases hEven : Even m · simp [hEven] · simp [hEven] have : 2 / (m : ℝ) ≤ 2 * (m : ℝ) := by rw [div_le_iff₀ hmpos] nlinarith [sq_nonneg ((m : ℝ) - 1)] exact this obtain ⟨X_rel, hRelMin⟩ := exists_relaxed_reduced_minimizer m a b r kappa hHom hk let t_rel : Fin 3 → ℝ := ![qParam m * X_rel.1, X_rel.2.1, X_rel.2.2] have hrelS : InSimplex (2 * (m : ℝ)) t_rel := reducedTriangle_to_simplex m X_rel.1 X_rel.2.1 X_rel.2.2 hq0 hRelMin.1 have hrelWsMin : ∀ s : Fin 3 → ℝ, InSimplex (2 * (m : ℝ)) s → wsObj alpha beta kappa t_rel ≤ wsObj alpha beta kappa s := by intro s hs have hsRed := simplex_to_reducedTriangle m s hq hs have hle := hRelMin.2 (s 0 / qParam m) (s 1) (s 2) hsRed have hleft : wsObj alpha beta kappa t_rel = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2 := by rw [show wsObj alpha beta kappa t_rel = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa t_rel by rfl] rw [reducedObjective_eq_wsObj (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_rel.1 X_rel.2.1 X_rel.2.2 (ne_of_gt hq)] have hright : wsObj alpha beta kappa s = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa (s 0 / qParam m) (s 1) (s 2) := by rw [show wsObj alpha beta kappa s = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa s by rfl] exact wsObj_eq_reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa s (ne_of_gt hq) simpa [hleft, hright] using hle have hrelInfeas : ¬ parityThreshold m ≤ t_rel 1 + t_rel 2 := by intro hfeas exact hNoMeet ⟨X_rel.1, X_rel.2.1, X_rel.2.2, hRelMin.1, hRelMin.2, by simpa [t_rel] using hfeas⟩ obtain ⟨htruncFeas, htruncMin⟩ := (trunc_from_minimizer (2 * (m : ℝ)) (parityThreshold m) hdM alpha beta kappa (hbetaPos 0).le hbetaY hbetaZ hk t_rel hrelS hrelWsMin).2 hrelInfeas let t_impl : Fin 3 → ℝ := truncSegPoint (2 * (m : ℝ)) (parityThreshold m) (truncSelector (2 * (m : ℝ)) (parityThreshold m) alpha beta kappa) let X_impl : ℝ × ℝ × ℝ := (t_impl 0 / qParam m, t_impl 1, t_impl 2) have hImplMin : InReducedTriangle m X_impl.1 X_impl.2.1 X_impl.2.2 ∧ parityThreshold m ≤ X_impl.2.1 + X_impl.2.2 ∧ ∀ x y z, InReducedTriangle m x y z → parityThreshold m ≤ y + z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := by refine ⟨by simpa [X_impl, t_impl] using simplex_to_reducedTriangle m t_impl hq htruncFeas.1, by simpa [X_impl, t_impl] using htruncFeas.2, ?_⟩ intro x y z hT hpar let s : Fin 3 → ℝ := ![qParam m * x, y, z] have hsS : InSimplex (2 * (m : ℝ)) s := reducedTriangle_to_simplex m x y z hq0 hT have hsTrunc : InTruncSimplex (2 * (m : ℝ)) (parityThreshold m) s := ⟨hsS, by simpa [s] using hpar⟩ have hle := htruncMin s hsTrunc have hleft : wsObj alpha beta kappa t_impl = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2 := by rw [show wsObj alpha beta kappa t_impl = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa t_impl by rfl] rw [wsObj_eq_reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t_impl (ne_of_gt hq)] have hright : wsObj alpha beta kappa s = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := by rw [show wsObj alpha beta kappa s = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa s by rfl] rw [reducedObjective_eq_wsObj (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z (ne_of_gt hq)] simpa [t_impl, hleft, hright] using hle have hVal := implementableReducedValue_eq_of_min m a b r kappa X_impl hImplMin have hobj : reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa X_impl.1 X_impl.2.1 X_impl.2.2 = wsObj alpha beta kappa t_impl := by rw [show wsObj alpha beta kappa t_impl = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa t_impl by rfl] rw [wsObj_eq_reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t_impl (ne_of_gt hq)] rw [hVal, hobj]
CausalSmith.Experimentation.DesignPm1.sharp_truncation_value_of_no_reduced_argmin_in_slice · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SharpTrunc.lean:17
theorem sharp_roundingLoss_zero_of_even

For even community size, the parity threshold is zero, so every relaxed minimizer already lies in the implementable reduced slice.

Formal statement
m :
a b r kappa :
hHom :
hk :
0 ≤ kappa
hEven :
roundingLossCertificate m a b r kappa = 0
Proof (Lean source)
lemma sharp_roundingLoss_zero_of_even (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 ≤ kappa) (hEven : Even m) : roundingLossCertificate m a b r kappa = 0 := by rw [sharp_roundingLoss_zero_iff_argmin_meets_slice m a b r kappa hHom hk] obtain ⟨X_rel, hRelMin⟩ := exists_relaxed_reduced_minimizer m a b r kappa hHom hk refine ⟨X_rel.1, X_rel.2.1, X_rel.2.2, hRelMin.1, hRelMin.2, ?_⟩ rcases hRelMin.1 with ⟨_hx, hy, hz, _hsum⟩ simp [parityThreshold, hEven, add_nonneg hy hz]
CausalSmith.Experimentation.DesignPm1.sharp_roundingLoss_zero_of_even · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SharpTrunc.lean:149
Helpers.SharpZero 3 declarations Sharp-certificate zero-loss and exposed-face helpers

Sharp-certificate zero-loss and exposed-face helpers

theorem sharp_roundingLoss_zero_iff_argmin_meets_slice

The rounding-loss carrier has zero value exactly when a relaxed reduced minimizer meets the parity slice.

Formal statement
m :
a b r kappa :
hHom :
hk :
0 ≤ kappa
= 0 ↔ ∃ x y z, InReducedTriangle m x y z ∧ (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ∧ parityThreshold m ≤ y
+ z
Proof (Lean source)
lemma sharp_roundingLoss_zero_iff_argmin_meets_slice (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 ≤ kappa) : roundingLossCertificate m a b r kappa = 0 ↔ ∃ x y z, InReducedTriangle m x y z ∧ (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ∧ parityThreshold m ≤ y + z := by rw [roundingLossCertificate, ← rounding_gap_reduction m a b r kappa hHom hk] exact zero_gap_iff_argmin_meets_slice m a b r kappa hHom hk
CausalSmith.Experimentation.DesignPm1.sharp_roundingLoss_zero_iff_argmin_meets_slice · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SharpZero.lean:17
theorem sharp_roundingLoss_zero_iff_unique_argmin_subset_slice

In the unique-relaxed-minimizer case, zero rounding loss is equivalent to every relaxed minimizer lying in the parity slice.

Formal statement
m :
a b r kappa :
hHom :
hk :
0 ≤ kappa
hkpos :
0 < kappa
hRelUnique :
∃! t : ℝ × ℝ × ℝ
if
InReducedTriangle m t.1 t.2.1 t.2.2 ∧ ∀ x y z, InReducedTriangle m x y z
then
reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t.1 t.2.1 t.2.2
reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z
= 0 ↔ ∀ x y z, InReducedTriangle m x y z → (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') → parityThreshold m ≤ y
+ z
Proof (Lean source)
lemma sharp_roundingLoss_zero_iff_unique_argmin_subset_slice (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 ≤ kappa) (hkpos : 0 < kappa) (hRelUnique : ∃! t : ℝ × ℝ × ℝ, InReducedTriangle m t.1 t.2.1 t.2.2 ∧ ∀ x y z, InReducedTriangle m x y z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t.1 t.2.1 t.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z) : roundingLossCertificate m a b r kappa = 0 ↔ ∀ x y z, InReducedTriangle m x y z → (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') → parityThreshold m ≤ y + z := by rw [roundingLossCertificate, ← rounding_gap_reduction m a b r kappa hHom hk] exact zero_gap_iff_unique_argmin_subset_slice m a b r kappa hHom hk hkpos hRelUnique
CausalSmith.Experimentation.DesignPm1.sharp_roundingLoss_zero_iff_unique_argmin_subset_slice · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SharpZero.lean:31
theorem sharp_kappa_zero_reduced_min_iff

At κ = 0, reduced minimizers are exactly the exposed face of the minimum coordinates of α = (c_x/q, c_y, c_z).

Formal statement
m :
a b r kappa x y z :
hHom :
hk0 :
kappa = 0
hT :
((∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ↔ (x ≠ 0 → cX m a b r / qParam m ≤ cY b r ∧ cX m a b r / qParam m ≤ cZ m) ∧ (y ≠ 0 → cY b r ≤ cX m a b r / qParam m ∧ cY b r ≤ cZ m) ∧ (z ≠ 0 → cZ m ≤ cX m a b r / qParam m ∧ cZ m ≤ cY b r))
Proof (Lean source)
lemma sharp_kappa_zero_reduced_min_iff (m : ℕ) (a b r kappa x y z : ℝ) (hHom : TwoBlockHomophily m a b) (hk0 : kappa = 0) (hT : InReducedTriangle m x y z) : ((∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ↔ (x ≠ 0 → cX m a b r / qParam m ≤ cY b r ∧ cX m a b r / qParam m ≤ cZ m) ∧ (y ≠ 0 → cY b r ≤ cX m a b r / qParam m ∧ cY b r ≤ cZ m) ∧ (z ≠ 0 → cZ m ≤ cX m a b r / qParam m ∧ cZ m ≤ cY b r)) := by subst kappa have hm : 2 ≤ m := hHom.1 have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm have hq : 0 < qParam m := by unfold qParam nlinarith have hq0 : 0 ≤ qParam m := le_of_lt hq have hM : 0 < 2 * (m : ℝ) := by positivity let alpha : Fin 3 → ℝ := ![cX m a b r / qParam m, cY b r, cZ m] let beta : Fin 3 → ℝ := ![1 / qParam m, 1, 1] let t : Fin 3 → ℝ := ![qParam m * x, y, z] have htS : InSimplex (2 * (m : ℝ)) t := reducedTriangle_to_simplex m x y z hq0 hT constructor · intro hMin have hwsMin : ∀ s : Fin 3 → ℝ, InSimplex (2 * (m : ℝ)) s → wsObj alpha beta 0 t ≤ wsObj alpha beta 0 s := by intro s hs have hsRed := simplex_to_reducedTriangle m s hq hs have hle := hMin (s 0 / qParam m) (s 1) (s 2) hsRed have hleft : wsObj alpha beta 0 t = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) 0 x y z := by rw [show wsObj alpha beta 0 t = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] 0 t by rfl] rw [reducedObjective_eq_wsObj (qParam m) (cX m a b r) (cY b r) (cZ m) 0 x y z (ne_of_gt hq)] have hright : wsObj alpha beta 0 s = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) 0 (s 0 / qParam m) (s 1) (s 2) := by rw [show wsObj alpha beta 0 s = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] 0 s by rfl] exact wsObj_eq_reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) 0 s (ne_of_gt hq) simpa [hleft, hright] using hle have hface : t ∈ exposedMinFace (2 * (m : ℝ)) alpha := (kappa_zero_face (2 * (m : ℝ)) alpha t).1 ⟨htS, by simpa [wsObj] using hwsMin⟩ rcases hface with ⟨_htS, hsupport⟩ refine ⟨?_, ?_, ?_⟩ · intro hx have ht0 : t 0 ≠ 0 := by intro ht0 have hx0 : x = 0 := by have : qParam m * x = 0 := by simpa [t] using ht0 exact (mul_eq_zero.mp this).resolve_left (ne_of_gt hq) exact hx hx0 exact ⟨by simpa [alpha] using hsupport 0 ht0 1, by simpa [alpha] using hsupport 0 ht0 2⟩ · intro hy have ht1 : t 1 ≠ 0 := by simpa [t] using hy exact ⟨by simpa [alpha] using hsupport 1 ht1 0, by simpa [alpha] using hsupport 1 ht1 2⟩ · intro hz have ht2 : t 2 ≠ 0 := by simpa [t] using hz exact ⟨by simpa [alpha] using hsupport 2 ht2 0, by simpa [alpha] using hsupport 2 ht2 1⟩ · rintro ⟨hxMin, hyMin, hzMin⟩ have hface : t ∈ exposedMinFace (2 * (m : ℝ)) alpha := by refine ⟨htS, ?_⟩ intro i hti j fin_cases i <;> fin_cases j <;> simp [alpha] · exact (hxMin (by intro hx exact hti (by simp [t, hx]))).1 · exact (hxMin (by intro hx exact hti (by simp [t, hx]))).2 · exact (hyMin (by simpa [t] using hti)).1 · exact (hyMin (by simpa [t] using hti)).2 · exact (hzMin (by simpa [t] using hti)).1 · exact (hzMin (by simpa [t] using hti)).2 have hwsMin := (kappa_zero_face (2 * (m : ℝ)) alpha t).2 hface intro x' y' z' hT' let s : Fin 3 → ℝ := ![qParam m * x', y', z'] have hsS : InSimplex (2 * (m : ℝ)) s := reducedTriangle_to_simplex m x' y' z' hq0 hT' have hle : wsObj alpha beta 0 t ≤ wsObj alpha beta 0 s := by simpa [wsObj] using hwsMin.2 s hsS have hleft : wsObj alpha beta 0 t = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) 0 x y z := by rw [show wsObj alpha beta 0 t = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] 0 t by rfl] rw [reducedObjective_eq_wsObj (qParam m) (cX m a b r) (cY b r) (cZ m) 0 x y z (ne_of_gt hq)] have hright : wsObj alpha beta 0 s = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) 0 x' y' z' := by rw [show wsObj alpha beta 0 s = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] 0 s by rfl] rw [reducedObjective_eq_wsObj (qParam m) (cX m a b r) (cY b r) (cZ m) 0 x' y' z' (ne_of_gt hq)] simpa [hleft, hright] using hle
CausalSmith.Experimentation.DesignPm1.sharp_kappa_zero_reduced_min_iff · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SharpZero.lean:51
Helpers.SpectralCoordinates 3 declarations The four-way orthogonal eigendecomposition of ℝⁿ (span 1_n, span s_m, the within-A and within-B contrast subspaces) reads off the eigenvalues of X(u,v) as x = 1−u, y = 1+(m−1)u−mv, z = 1+(m−1)u+mv, converts elliptope mem

Block spectral coordinates

The four-way orthogonal eigendecomposition of ℝⁿ (span 1_n, span s_m, the within-A and within-B contrast subspaces) reads off the eigenvalues of X(u,v) as x = 1−u, y = 1+(m−1)u−mv, z = 1+(m−1)u+mv, converts elliptope membership into the reduced triangle, and gives the closed-form objective φ.

theorem cutCovariance_eq_blockSym

The cut covariance is the block-symmetric point X(1,−1), with spectral coordinates (0, 2m, 0).

Formal statement
m :
Proof (Lean source)
lemma cutCovariance_eq_blockSym (m : ℕ) : cutCovariance m = blockSymMatrix m 1 (-1) := by ext i j by_cases hi : i.val < m <;> by_cases hj : j.val < m <;> by_cases hij : i = j <;> simp [cutCovariance, blockSymMatrix, signVec, hi, hj, hij]
theorem identity_eq_blockSym

The identity I_n is the block-symmetric point X(0,0), with spectral coordinates (1, 1, 1).

Formal statement
m :
(1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) = blockSymMatrix m 0 0
Proof (Lean source)
lemma identity_eq_blockSym (m : ℕ) : (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) = blockSymMatrix m 0 0 := by ext i j by_cases hij : i = j <;> simp [blockSymMatrix, Matrix.one_apply, hij]
theorem block_spectral_coordinates Lemma 1 in the paper ↗

X(u,v) lies in E_m^blk iff its spectral coordinates lie in the reduced triangle T_m, and the design objective equals the reduced form φ with c_x = q((a+b)+r/(a+b)), c_y = 2b + r/(2b), c_z = 2m and q = 2(m−1). The last two conjuncts record the corner coordinate readings the note states: X_cut = X(1,−1) has spectral coordinates (0, 2m, 0) and I_n = X(0,0) has spectral coordinates (1, 1, 1).

Formal statement
m :
a b r kappa u v :
hHom :
(blockSymMatrix m u v ∈ blockElliptope m a b ↔ InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v)) ∧
designObjective m a b r kappa (blockSymMatrix m u v)
= reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) ∧
(cutCovariance m = blockSymMatrix m 1 (-1) ∧ ((1 : ℝ) - 1, 1 + ((m : ℝ) - 1) * 1 - (m : ℝ) * (-1), 1 + ((m : ℝ) - 1) * 1 + (m : ℝ) * (-1)) = ((0 : ℝ), 2 * (m : ℝ), (0 : ℝ))) ∧
((1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) = blockSymMatrix m 0 0 ∧ ((1 : ℝ) - 0, 1 + ((m : ℝ) - 1) * 0 - (m : ℝ) * 0, 1 + ((m : ℝ) - 1) * 0 + (m : ℝ) * 0) = ((1 : ℝ), (1 : ℝ), (1 : ℝ)))
Proof (Lean source)
lemma block_spectral_coordinates (m : ℕ) (a b r kappa u v : ℝ) (hHom : TwoBlockHomophily m a b) : (blockSymMatrix m u v ∈ blockElliptope m a b ↔ InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v)) ∧ designObjective m a b r kappa (blockSymMatrix m u v) = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) ∧ (cutCovariance m = blockSymMatrix m 1 (-1) ∧ ((1 : ℝ) - 1, 1 + ((m : ℝ) - 1) * 1 - (m : ℝ) * (-1), 1 + ((m : ℝ) - 1) * 1 + (m : ℝ) * (-1)) = ((0 : ℝ), 2 * (m : ℝ), (0 : ℝ))) ∧ ((1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) = blockSymMatrix m 0 0 ∧ ((1 : ℝ) - 0, 1 + ((m : ℝ) - 1) * 0 - (m : ℝ) * 0, 1 + ((m : ℝ) - 1) * 0 + (m : ℝ) * 0) = ((1 : ℝ), (1 : ℝ), (1 : ℝ))) := by have hm2 : 2 ≤ m := hHom.1 have hmposR : (0 : ℝ) < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by decide : 0 < 2) hm2) have hm0R : (m : ℝ) ≠ 0 := ne_of_gt hmposR have hm20R : 2 * (m : ℝ) ≠ 0 := by positivity have hcast_m_sub_one : ((m - 1 : ℕ) : ℝ) = (m : ℝ) - 1 := by have hm1 : 1 ≤ m := by omega rw [Nat.cast_sub hm1] norm_num constructor · exact blockSymMatrix_mem_blockElliptope_iff_reducedTriangle m a b u v hHom · constructor · have hJ : trace (allOnesMatrix m * blockSymMatrix m u v) = 2 * (m : ℝ) * (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) := by simp [trace, allOnesMatrix, blockSymMatrix, Matrix.mul_apply] have h' : (∑ x : Fin (2 * m), ∑ x_1 : Fin (2 * m), if x_1 = x then (1 : ℝ) else if (x_1.val < m ↔ x.val < m) then u else v) = 2 * (m : ℝ) * 1 + 2 * (m : ℝ) * ((m : ℝ) - 1) * u + 2 * (m : ℝ) * (m : ℝ) * v := by simpa [eq_comm, iff_comm] using block_pair_sum m (1 : ℝ) u v rw [h'] ring have hFrob : frobeniusNorm (blockSymMatrix m u v) = sqrt (qParam m * (1 - u) ^ 2 + (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) ^ 2 + (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) ^ 2) := by unfold frobeniusNorm congr 1 simp [blockSymMatrix] have h' : (∑ x : Fin (2 * m), ∑ x_1 : Fin (2 * m), if x = x_1 then (1 : ℝ) else if (x.val < m ↔ x_1.val < m) then u ^ 2 else v ^ 2) = 2 * (m : ℝ) * 1 + 2 * (m : ℝ) * ((m : ℝ) - 1) * (u ^ 2) + 2 * (m : ℝ) * (m : ℝ) * (v ^ 2) := by simpa using block_pair_sum m (1 : ℝ) (u ^ 2) (v ^ 2) rw [h'] unfold qParam ring have hTraceX : trace (blockSymMatrix m u v) = 2 * (m : ℝ) := by simp [trace, blockSymMatrix] have hOnesProj : trace (onesProj m * blockSymMatrix m u v) = 1 + ((m : ℝ) - 1) * u + (m : ℝ) * v := by simp [trace, Matrix.mul_apply, onesProj, blockSymMatrix] have h' : (∑ x : Fin (2 * m), ∑ x_1 : Fin (2 * m), if x_1 = x then (m : ℝ)⁻¹ * 2⁻¹ else if x_1.val < m ↔ x.val < m then (m : ℝ)⁻¹ * 2⁻¹ * u else (m : ℝ)⁻¹ * 2⁻¹ * v) = 2 * (m : ℝ) * ((m : ℝ)⁻¹ * 2⁻¹) + 2 * (m : ℝ) * ((m : ℝ) - 1) * ((m : ℝ)⁻¹ * 2⁻¹ * u) + 2 * (m : ℝ) * (m : ℝ) * ((m : ℝ)⁻¹ * 2⁻¹ * v) := by simpa [eq_comm, iff_comm] using block_pair_sum m ((m : ℝ)⁻¹ * 2⁻¹) ((m : ℝ)⁻¹ * 2⁻¹ * u) ((m : ℝ)⁻¹ * 2⁻¹ * v) rw [h'] field_simp have hSign : trace (signProj m * blockSymMatrix m u v) = 1 + ((m : ℝ) - 1) * u - (m : ℝ) * v := by simp [trace, Matrix.mul_apply, signProj, blockSymMatrix] calc (∑ x : Fin (2 * m), ∑ x_1 : Fin (2 * m), if x_1 = x then signVec m x * signVec m x_1 / (2 * (m : ℝ)) else if x_1.val < m ↔ x.val < m then signVec m x * signVec m x_1 / (2 * (m : ℝ)) * u else signVec m x * signVec m x_1 / (2 * (m : ℝ)) * v) = (2 * (m : ℝ))⁻¹ * (∑ x : Fin (2 * m), ∑ x_1 : Fin (2 * m), signVec m x * signVec m x_1 * (if x_1 = x then (1 : ℝ) else if x_1.val < m ↔ x.val < m then u else v)) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro x _ rw [Finset.mul_sum] apply Finset.sum_congr rfl intro x_1 _ by_cases hdiag : x_1 = x <;> by_cases hsame : x_1.val < m ↔ x.val < m <;> simp [hdiag, hsame] <;> ring_nf _ = 1 + ((m : ℝ) - 1) * u - (m : ℝ) * v := by have h' : (∑ x : Fin (2 * m), ∑ x_1 : Fin (2 * m), signVec m x * signVec m x_1 * (if x_1 = x then (1 : ℝ) else if x_1.val < m ↔ x.val < m then u else v)) = 2 * (m : ℝ) * 1 + 2 * (m : ℝ) * ((m : ℝ) - 1) * u - 2 * (m : ℝ) * (m : ℝ) * v := by simpa [eq_comm, iff_comm, mul_assoc, mul_left_comm, mul_comm] using block_signed_pair_sum m (1 : ℝ) u v rw [h'] field_simp [hm20R] have hPinv : trace (twoBlockLaplacianPinv m a b * blockSymMatrix m u v) = qParam m * (1 - u) / (a + b) + (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) / (2 * b) := by rw [twoBlockLaplacianPinv] simp [Matrix.add_mul, Matrix.sub_mul, Matrix.trace_add, Matrix.trace_sub, Matrix.trace_smul] rw [hTraceX, hOnesProj, hSign] unfold qParam ring have hL : trace (twoBlockLaplacian m a b * blockSymMatrix m u v) = qParam m * (a + b) * (1 - u) + 2 * b * (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) := by let deg : ℝ := ((m : ℝ) - 1) * (a / (m : ℝ)) + (m : ℝ) * (b / (m : ℝ)) have hDegree : ∀ i : Fin (2 * m), (∑ j : Fin (2 * m), twoBlockGraph m a b i j) = deg := by intro i let A := blockAFin m let B := blockBFin m by_cases hi : i.val < m · have hsplit : (∑ j : Fin (2 * m), twoBlockGraph m a b i j) = (∑ j ∈ A, twoBlockGraph m a b i j) + (∑ j ∈ B, twoBlockGraph m a b i j) := by dsimp [A, B, blockAFin, blockBFin] rw [← Finset.sum_filter_add_sum_filter_not (s := univ) (p := fun j : Fin (2 * m) => j.val < m) (f := fun j => twoBlockGraph m a b i j)] rw [hsplit] have hA : (∑ j ∈ A, twoBlockGraph m a b i j) = ((m - 1 : ℕ) : ℝ) * (a / (m : ℝ)) := by have hiA : i ∈ A := by simpa [A, blockAFin] using hi have hAcard : A.card = m := by dsimp [A]; exact card_blockAFin m calc (∑ j ∈ A, twoBlockGraph m a b i j) = ∑ j ∈ A, if i = j then 0 else a / (m : ℝ) := by apply Finset.sum_congr rfl intro j hj have hj' : j.val < m := by simpa [A, blockAFin] using hj by_cases hij : i = j <;> simp [twoBlockGraph, hij, hi, hj'] _ = 0 + ((A.card - 1 : ℕ) : ℝ) * (a / (m : ℝ)) := sum_if_eq_else_self_real A 0 (a / (m : ℝ)) hiA _ = ((m - 1 : ℕ) : ℝ) * (a / (m : ℝ)) := by rw [hAcard] ring have hB : (∑ j ∈ B, twoBlockGraph m a b i j) = (m : ℝ) * (b / (m : ℝ)) := by have hBcard : B.card = m := by dsimp [B]; exact card_blockBFin m calc (∑ j ∈ B, twoBlockGraph m a b i j) = ∑ j ∈ B, b / (m : ℝ) := by apply Finset.sum_congr rfl intro j hj have hj' : ¬ j.val < m := by simpa [B, blockBFin] using hj have hne : i ≠ j := by intro h exact hj' (by simpa [h] using hi) have hnot : ¬ (i.val < m ↔ j.val < m) := by intro hiff exact hj' (hiff.mp hi) simp [twoBlockGraph, hne, hnot] _ = (m : ℝ) * (b / (m : ℝ)) := by rw [Finset.sum_const, nsmul_eq_mul, hBcard] rw [hA, hB, hcast_m_sub_one] · have hsplit : (∑ j : Fin (2 * m), twoBlockGraph m a b i j) = (∑ j ∈ A, twoBlockGraph m a b i j) + (∑ j ∈ B, twoBlockGraph m a b i j) := by dsimp [A, B, blockAFin, blockBFin] rw [← Finset.sum_filter_add_sum_filter_not (s := univ) (p := fun j : Fin (2 * m) => j.val < m) (f := fun j => twoBlockGraph m a b i j)] rw [hsplit] have hA : (∑ j ∈ A, twoBlockGraph m a b i j) = (m : ℝ) * (b / (m : ℝ)) := by have hAcard : A.card = m := by dsimp [A]; exact card_blockAFin m calc (∑ j ∈ A, twoBlockGraph m a b i j) = ∑ j ∈ A, b / (m : ℝ) := by apply Finset.sum_congr rfl intro j hj have hj' : j.val < m := by simpa [A, blockAFin] using hj have hne : i ≠ j := by intro h exact hi (by simpa [h] using hj') have hnot : ¬ (i.val < m ↔ j.val < m) := by intro hiff exact hi (hiff.mpr hj') simp [twoBlockGraph, hne, hnot] _ = (m : ℝ) * (b / (m : ℝ)) := by rw [Finset.sum_const, nsmul_eq_mul, hAcard] have hB : (∑ j ∈ B, twoBlockGraph m a b i j) = ((m - 1 : ℕ) : ℝ) * (a / (m : ℝ)) := by have hiB : i ∈ B := by simpa [B, blockBFin] using hi have hBcard : B.card = m := by dsimp [B]; exact card_blockBFin m calc (∑ j ∈ B, twoBlockGraph m a b i j) = ∑ j ∈ B, if i = j then 0 else a / (m : ℝ) := by apply Finset.sum_congr rfl intro j hj have hj' : ¬ j.val < m := by simpa [B, blockBFin] using hj by_cases hij : i = j <;> simp [twoBlockGraph, hij, hi, hj'] _ = 0 + ((B.card - 1 : ℕ) : ℝ) * (a / (m : ℝ)) := sum_if_eq_else_self_real B 0 (a / (m : ℝ)) hiB _ = ((m - 1 : ℕ) : ℝ) * (a / (m : ℝ)) := by rw [hBcard] ring rw [hA, hB, hcast_m_sub_one] ring have hTraceRaw : trace (twoBlockLaplacian m a b * blockSymMatrix m u v) = ∑ i : Fin (2 * m), ∑ j : Fin (2 * m), if i = j then deg else if (i.val < m ↔ j.val < m) then -(a / (m : ℝ) * u) else -(b / (m : ℝ) * v) := by simp [trace, Matrix.mul_apply, twoBlockLaplacian] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ by_cases hij : j = i · subst j rw [if_pos rfl, if_pos rfl, hDegree] have hdiagX : blockSymMatrix m u v i i = 1 := by simp [blockSymMatrix] rw [hdiagX] ring · have hji : i ≠ j := fun h => hij h.symm by_cases hsame : i.val < m ↔ j.val < m · have hsame' : j.val < m ↔ i.val < m := hsame.symm have hW : twoBlockGraph m a b i j = a / (m : ℝ) := by simp [twoBlockGraph, hji, hsame] have hX : blockSymMatrix m u v j i = u := by simp [blockSymMatrix, hij, hsame'] rw [hW, hX] simp [hji, hsame] · have hsame' : ¬ (j.val < m ↔ i.val < m) := by intro h exact hsame h.symm have hW : twoBlockGraph m a b i j = b / (m : ℝ) := by simp [twoBlockGraph, hji, hsame] have hX : blockSymMatrix m u v j i = v := by simp [blockSymMatrix, hij, hsame'] rw [hW, hX] simp [hji, hsame] -- … truncated; follow the source link for the rest …
Helpers.SpectralMembership 1 declarations Membership algebra for block spectral coordinates

Membership algebra for block spectral coordinates

theorem blockSymMatrix_mem_blockElliptope_iff_reducedTriangle

For m ≥ 2, membership of the concrete block-symmetric matrix X(u,v) in E_m^blk is equivalent to the three reduced-coordinate PSD inequalities plus the trace identity q x + y + z = 2m.

Formal statement
m :
a b u v :
hHom :
InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v)
Proof (Lean source)
lemma blockSymMatrix_mem_blockElliptope_iff_reducedTriangle (m : ℕ) (a b u v : ℝ) (hHom : TwoBlockHomophily m a b) : blockSymMatrix m u v ∈ blockElliptope m a b ↔ InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) := by have hm2 : 2 ≤ m := hHom.1 constructor · rintro ⟨u', v', hX, hmem⟩ have hfin0 : 0 < 2 * m := by omega have hfin1 : 1 < 2 * m := by omega have hfinm : m < 2 * m := by omega have hu : u = u' := by let i0 : Fin (2 * m) := ⟨0, hfin0⟩ let j0 : Fin (2 * m) := ⟨1, hfin1⟩ have hentry := congrFun (congrFun hX i0) j0 have hne : i0 ≠ j0 := by intro h have := congrArg val h simp [i0, j0] at this have hi : i0.val < m := by simp [i0]; omega have hj : j0.val < m := by simp [j0]; omega simpa [blockSymMatrix, hne, hi, hj] using hentry have hv : v = v' := by let i0 : Fin (2 * m) := ⟨0, hfin0⟩ let k0 : Fin (2 * m) := ⟨m, hfinm⟩ have hentry := congrFun (congrFun hX i0) k0 have hne : i0 ≠ k0 := by intro h have := congrArg val h simp [i0, k0] at this omega have hi : i0.val < m := by simp [i0]; omega have hk : ¬ k0.val < m := by simp [k0] simp [blockSymMatrix, hne, hi, hk] at hentry exact hentry subst u' subst v' exact ⟨hmem.psd_x, hmem.psd_y, hmem.psd_z, by simp [qParam]; ring⟩ · intro h exact ⟨u, v, rfl, ⟨hHom, h.1, h.2.1, h.2.2.1⟩⟩
CausalSmith.Experimentation.DesignPm1.blockSymMatrix_mem_blockElliptope_iff_reducedTriangle · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SpectralMembership.lean:15
Helpers.SpreadGap 1 declarations Turns a reduced-coordinate spread-vertex certificate into the matrix relaxed minimizer statement and the strict implementability gap in the odd-community slice.

Spread-vertex gap assembly

Turns a reduced-coordinate spread-vertex certificate into the matrix relaxed minimizer statement and the strict implementability gap in the odd-community slice.

theorem spread_certificate_relaxed_minimizer_and_gap

Suppose the community size is odd and, in reduced spectral coordinates, the spread vertex is the strict minimizer of the reduced objective over the reduced triangle. Then three things follow at the matrix level: the spread covariance lies in the relaxed block-symmetric elliptope slice and is its unique minimizer of the design objective; it is not the second moment of any block-exchangeable ±1 design; and the implementability gap is strictly positive.

Formal statement
m :
a b r kappa :
hHom :
hk :
0 ≤ kappa
hOdd :
hcert :
InReducedTriangle m (2 * (m : ℝ) / qParam m) 0 0 ∧
∀ x y z,
InReducedTriangle m x y z → ((x, y, z) : ℝ × ℝ × ℝ)
≠ (2 * (m : ℝ) / qParam m, 0, 0) → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa (2 * (m : ℝ) / qParam m) 0 0 < reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z
(spreadCovariance m ∈ blockElliptope m a b ∧ ∀ X ∈ blockElliptope m a b, X ≠ spreadCovariance m → designObjective m a b r kappa (spreadCovariance m) < designObjective m a b r kappa X) ∧
0 < implementabilityGap m a b r kappa
Proof (Lean source)
lemma spread_certificate_relaxed_minimizer_and_gap (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 ≤ kappa) (hOdd : OddCommunitySize m) (hcert : InReducedTriangle m (2 * (m : ℝ) / qParam m) 0 0 ∧ ∀ x y z, InReducedTriangle m x y z → ((x, y, z) : ℝ × ℝ × ℝ) ≠ (2 * (m : ℝ) / qParam m, 0, 0) → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa (2 * (m : ℝ) / qParam m) 0 0 < reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z) : (spreadCovariance m ∈ blockElliptope m a b ∧ ∀ X ∈ blockElliptope m a b, X ≠ spreadCovariance m → designObjective m a b r kappa (spreadCovariance m) < designObjective m a b r kappa X) ∧ spreadCovariance m ∉ implementableCovarianceClass m ∧ 0 < implementabilityGap m a b r kappa := by have hm : 2 ≤ m := hHom.1 have hOddNat : Odd m := hOdd have hNotEven : ¬ Even m := Nat.not_even_iff_odd.mpr hOddNat have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm have hmpos : (0 : ℝ) < (m : ℝ) := by have hmNat : (0 : ℕ) < m := lt_of_lt_of_le (by decide : 0 < 2) hm exact_mod_cast hmNat have hm1 : (m : ℝ) - 1 ≠ 0 := by nlinarith have hq : 0 < qParam m := by unfold qParam nlinarith have hq0 : 0 ≤ qParam m := le_of_lt hq have hxSpread : 1 - (-1 / ((m : ℝ) - 1)) = 2 * (m : ℝ) / qParam m := by unfold qParam field_simp [hm1] ring have hySpread : 1 + ((m : ℝ) - 1) * (-1 / ((m : ℝ) - 1)) - (m : ℝ) * (0 : ℝ) = 0 := by field_simp [hm1] ring have hzSpread : 1 + ((m : ℝ) - 1) * (-1 / ((m : ℝ) - 1)) + (m : ℝ) * (0 : ℝ) = 0 := by field_simp [hm1] ring have hySpread' : 1 + ((m : ℝ) - 1) * (-1 / ((m : ℝ) - 1)) = 0 := by field_simp [hm1] ring have hspecSpread := block_spectral_coordinates m a b r kappa (-1 / ((m : ℝ) - 1)) 0 hHom have hspreadTriUV : InReducedTriangle m (1 - (-1 / ((m : ℝ) - 1))) (1 + ((m : ℝ) - 1) * (-1 / ((m : ℝ) - 1)) - (m : ℝ) * (0 : ℝ)) (1 + ((m : ℝ) - 1) * (-1 / ((m : ℝ) - 1)) + (m : ℝ) * (0 : ℝ)) := by simpa [hxSpread, hySpread, hzSpread, hySpread'] using hcert.1 have hspreadMem : spreadCovariance m ∈ blockElliptope m a b := by unfold spreadCovariance exact hspecSpread.1.mpr hspreadTriUV have hspreadObj : designObjective m a b r kappa (spreadCovariance m) = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa (2 * (m : ℝ) / qParam m) 0 0 := by simpa [spreadCovariance, hxSpread, hySpread, hzSpread, hySpread'] using hspecSpread.2.1 have hrelStrict : ∀ X ∈ blockElliptope m a b, X ≠ spreadCovariance m → designObjective m a b r kappa (spreadCovariance m) < designObjective m a b r kappa X := by intro X hX hne rcases hX with ⟨u, v, rfl, hmem⟩ have hspec := block_spectral_coordinates m a b r kappa u v hHom have htri : InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) := hspec.1.mp ⟨u, v, rfl, hmem⟩ have hcoord_ne : ((1 - u, 1 + ((m : ℝ) - 1) * u - (m : ℝ) * v, 1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) : ℝ × ℝ × ℝ) ≠ (2 * (m : ℝ) / qParam m, 0, 0) := by intro hcoord have hy0 : 1 + ((m : ℝ) - 1) * u - (m : ℝ) * v = 0 := congrArg (fun p : ℝ × ℝ × ℝ => p.2.1) hcoord have hz0 : 1 + ((m : ℝ) - 1) * u + (m : ℝ) * v = 0 := congrArg (fun p : ℝ × ℝ × ℝ => p.2.2) hcoord have hv : v = 0 := by have hmv : (2 * (m : ℝ)) * v = 0 := by nlinarith exact (mul_eq_zero.mp hmv).resolve_left (by positivity) have hu : u = -1 / ((m : ℝ) - 1) := by subst v have hmul : ((m : ℝ) - 1) * u = -1 := by linarith have hmul' : u * ((m : ℝ) - 1) = -1 := by linarith exact (eq_div_iff hm1).2 hmul' apply hne unfold spreadCovariance rw [hu, hv] calc designObjective m a b r kappa (spreadCovariance m) = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa (2 * (m : ℝ) / qParam m) 0 0 := hspreadObj _ < reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) := hcert.2 _ _ _ htri hcoord_ne _ = designObjective m a b r kappa (blockSymMatrix m u v) := hspec.2.1.symm have hspreadNotImp : spreadCovariance m ∉ implementableCovarianceClass m := spreadCovariance_not_implementable_of_odd m hm hOddNat let Xrel : ℝ × ℝ × ℝ := (2 * (m : ℝ) / qParam m, 0, 0) have hRelMin : InReducedTriangle m Xrel.1 Xrel.2.1 Xrel.2.2 ∧ ∀ x y z, InReducedTriangle m x y z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa Xrel.1 Xrel.2.1 Xrel.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := by refine ⟨by simpa [Xrel] using hcert.1, ?_⟩ intro x y z hT by_cases hEq : ((x, y, z) : ℝ × ℝ × ℝ) = Xrel · have hx : x = Xrel.1 := congrArg Prod.fst hEq have hy : y = Xrel.2.1 := congrArg (fun p : ℝ × ℝ × ℝ => p.2.1) hEq have hz : z = Xrel.2.2 := congrArg (fun p : ℝ × ℝ × ℝ => p.2.2) hEq subst x subst y subst z rfl · exact le_of_lt (hcert.2 x y z hT hEq) have hRelUnique : ∃! t : ℝ × ℝ × ℝ, InReducedTriangle m t.1 t.2.1 t.2.2 ∧ ∀ x y z, InReducedTriangle m x y z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t.1 t.2.1 t.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := by refine ⟨Xrel, hRelMin, ?_⟩ rintro ⟨x, y, z⟩ ht by_cases hEq : ((x, y, z) : ℝ × ℝ × ℝ) = Xrel · exact hEq · have hlt := hcert.2 x y z ht.1 hEq have hle := ht.2 Xrel.1 Xrel.2.1 Xrel.2.2 hRelMin.1 exact elim ((not_lt_of_ge hle) hlt) have hOutside : Xrel.2.1 + Xrel.2.2 < parityThreshold m := by unfold parityThreshold rw [if_neg hNotEven] dsimp [Xrel] have htwo : (0 : ℝ) < 2 := by norm_num simpa using div_pos htwo hmpos let alpha : Fin 3 → ℝ := ![cX m a b r / qParam m, cY b r, cZ m] let beta : Fin 3 → ℝ := ![1 / qParam m, 1, 1] let trel : Fin 3 → ℝ := ![2 * (m : ℝ), 0, 0] have htrelS : InSimplex (2 * (m : ℝ)) trel := by constructor · intro i fin_cases i · simp [trel] · simp [trel] · simp [trel] · simp [trel, Fin.sum_univ_three] have hws_min : ∀ s : Fin 3 → ℝ, InSimplex (2 * (m : ℝ)) s → wsObj alpha beta kappa trel ≤ wsObj alpha beta kappa s := by intro s hs have hsRed := simplex_to_reducedTriangle m s hq hs have hle := hRelMin.2 (s 0 / qParam m) (s 1) (s 2) hsRed have htrelObj : wsObj alpha beta kappa trel = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa (2 * (m : ℝ) / qParam m) 0 0 := by rw [show wsObj alpha beta kappa trel = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa trel by rfl] rw [wsObj_eq_reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa trel (ne_of_gt hq)] simp [trel] have hsObj : wsObj alpha beta kappa s = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa (s 0 / qParam m) (s 1) (s 2) := by rw [show wsObj alpha beta kappa s = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa s by rfl] exact wsObj_eq_reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa s (ne_of_gt hq) simpa [Xrel, htrelObj, hsObj] using hle have hd0 : 0 ≤ parityThreshold m := by unfold parityThreshold by_cases hEven : Even m · simp [hEven] · simp [hEven] positivity have hdM : parityThreshold m ≤ 2 * (m : ℝ) := by unfold parityThreshold by_cases hEven : Even m · simp [hEven] · simp [hEven] have : 2 / (m : ℝ) ≤ 2 * (m : ℝ) := by rw [div_le_iff₀ hmpos] nlinarith [sq_nonneg ((m : ℝ) - 1)] exact this have hbetaPos : ∀ i, 0 < beta i := by intro i fin_cases i · have : 0 < 1 / qParam m := by positivity simpa [beta] using this · simp [beta] · simp [beta] have hbetaY : beta 1 = 1 := by simp [beta] have hbetaZ : beta 2 = 1 := by simp [beta] have htrelInfeas : ¬ (parityThreshold m ≤ trel 1 + trel 2) := by simp [trel] linarith [hOutside] obtain ⟨htruncFeas, htruncMin⟩ := (trunc_from_minimizer (2 * (m : ℝ)) (parityThreshold m) hdM alpha beta kappa (hbetaPos 0).le hbetaY hbetaZ hk trel htrelS hws_min).2 htrelInfeas let Ximpl : ℝ × ℝ × ℝ := (truncSegPoint (2 * (m : ℝ)) (parityThreshold m) (truncSelector (2 * (m : ℝ)) (parityThreshold m) alpha beta kappa) 0 / qParam m, truncSegPoint (2 * (m : ℝ)) (parityThreshold m) (truncSelector (2 * (m : ℝ)) (parityThreshold m) alpha beta kappa) 1, truncSegPoint (2 * (m : ℝ)) (parityThreshold m) (truncSelector (2 * (m : ℝ)) (parityThreshold m) alpha beta kappa) 2) have hImplMin : InReducedTriangle m Ximpl.1 Ximpl.2.1 Ximpl.2.2 ∧ parityThreshold m ≤ Ximpl.2.1 + Ximpl.2.2 ∧ ∀ x y z, InReducedTriangle m x y z → parityThreshold m ≤ y + z → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa Ximpl.1 Ximpl.2.1 Ximpl.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := by refine ⟨by simpa [Ximpl] using simplex_to_reducedTriangle m _ hq htruncFeas.1, by simpa [Ximpl] using htruncFeas.2, ?_⟩ intro x y z hT hpar let s : Fin 3 → ℝ := ![qParam m * x, y, z] have hsS : InSimplex (2 * (m : ℝ)) s := reducedTriangle_to_simplex m x y z hq0 hT have hsTrunc : InTruncSimplex (2 * (m : ℝ)) (parityThreshold m) s := by exact ⟨hsS, by simpa [s] using hpar⟩ have hle := htruncMin s hsTrunc have hleft : wsObj alpha beta kappa (truncSegPoint (2 * (m : ℝ)) (parityThreshold m) (truncSelector (2 * (m : ℝ)) (parityThreshold m) alpha beta kappa)) = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa Ximpl.1 Ximpl.2.1 Ximpl.2.2 := by rw [show wsObj alpha beta kappa (truncSegPoint (2 * (m : ℝ)) (parityThreshold m) (truncSelector (2 * (m : ℝ)) (parityThreshold m) alpha beta kappa)) = wsObj ![cX m a b r / qParam m, cY b r, cZ m] ![1 / qParam m, 1, 1] kappa (truncSegPoint (2 * (m : ℝ)) (parityThreshold m) (truncSelector (2 * (m : ℝ)) (parityThreshold m) alpha beta kappa)) by rfl] rw [wsObj_eq_reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa _ (ne_of_gt hq)] have hright : wsObj alpha beta kappa s = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z := by -- … truncated; follow the source link for the rest …
CausalSmith.Experimentation.DesignPm1.spread_certificate_relaxed_minimizer_and_gap · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SpreadGap.lean:22
Helpers.SymRedDesign 22 declarations The block-automorphism group H acts on sign assignments by pull-back (σ · z) i = z (σ i).

Design-side symmetry reduction (orbit averaging over the automorphism group)

The block-automorphism group H acts on sign assignments by pull-back (σ · z) i = z (σ i). Averaging a balanced law D over H gives D'.p z = |H|⁻¹ ∑_{σ∈H} D.p (z∘σ), a genuine PMF that is balanced and H-invariant, hence block-exchangeable, with zero one-point margins. Its second moment is the orbit average X(D')ᵢⱼ = |H|⁻¹ ∑_σ X(D)_{σi,σj}. Because each σ∈H permutes the within/cross pair-Finsets, the block sums are preserved (Ssame(X(D')) = Ssame(X(D)), likewise Scross), so every trace term is unchanged, while the Frobenius norm drops by convexity — giving a no-worse block-exchangeable law.

def pbAct

The pull-back action of a permutation on sign assignments.

Definition (Lean source)
def pbAct (m : ℕ) (σ : Perm (Fin (2 * m))) (z : Fin (2 * m) → Bool) : Fin (2 * m) → Bool := fun i => z (σ i)
def blockAutoFinset

The block-automorphism group as a Finset of permutations.

Definition (Lean source)
noncomputable def blockAutoFinset (m : ℕ) : Finset (Perm (Fin (2 * m))) := Finset.univ.filter (fun σ => IsBlockAuto m σ)
theorem one_mem_blockAutoFinset

The identity is a block automorphism.

Formal statement
m :
(1 : Perm (Fin (2 * m))) ∈ blockAutoFinset m
Proof (Lean source)
lemma one_mem_blockAutoFinset (m : ℕ) : (1 : Perm (Fin (2 * m))) ∈ blockAutoFinset m := by simp [blockAutoFinset, IsBlockAuto]
theorem blockAutoFinset_card_pos

blockAutoFinset is nonempty (so |H| > 0).

Formal statement
m :
0 < (blockAutoFinset m).card
Proof (Lean source)
lemma blockAutoFinset_card_pos (m : ℕ) : 0 < (blockAutoFinset m).card := by exact Finset.card_pos.mpr ⟨1, one_mem_blockAutoFinset m⟩
theorem mul_mem_blockAutoFinset

The block-automorphism set is closed under composition.

Formal statement
m :
Perm (Fin (2 * m))
:
:
σ * τ ∈ blockAutoFinset m
Proof (Lean source)
lemma mul_mem_blockAutoFinset (m : ℕ) {σ τ : Perm (Fin (2 * m))} (hσ : σ ∈ blockAutoFinset m) (hτ : τ ∈ blockAutoFinset m) : σ * τ ∈ blockAutoFinset m := by rw [blockAutoFinset] at hσ hτ ⊢ simp only [mem_filter, Finset.mem_univ, true_and] at hσ hτ ⊢ rcases hσ with hσ | hσ <;> rcases hτ with hτ | hτ · left intro i exact (hσ (τ i)).trans (hτ i) · right intro i exact (hσ (τ i)).trans (hτ i) · right intro i have h1 := hσ (τ i) have h2 := hτ i tauto · left intro i have h1 := hσ (τ i) have h2 := hτ i tauto
theorem inv_mem_blockAutoFinset

The block-automorphism set is closed under inverse.

Formal statement
m :
Perm (Fin (2 * m))
:
σ⁻¹ ∈ blockAutoFinset m
Proof (Lean source)
lemma inv_mem_blockAutoFinset (m : ℕ) {σ : Perm (Fin (2 * m))} (hσ : σ ∈ blockAutoFinset m) : σ⁻¹ ∈ blockAutoFinset m := by rw [blockAutoFinset] at hσ ⊢ simp only [mem_filter, Finset.mem_univ, true_and] at hσ ⊢ rcases hσ with hσ | hσ · left intro i have h := hσ (σ⁻¹ i) simpa using h.symm · right intro i have h := hσ (σ⁻¹ i) have h' : i.val < m ↔ ¬ (σ⁻¹ i).val < m := by simpa using h tauto
theorem blockAuto_maps_sameOffPairs

A block automorphism maps within-community pairs to within-community pairs (and preserves distinctness); i.e. it permutes sameOffPairs.

Formal statement
m :
Perm (Fin (2 * m))
:
i j :
Fin (2 * m)
h :
(i, j) ∈ sameOffPairs m
(σ i, σ j) ∈ sameOffPairs m
Proof (Lean source)
lemma blockAuto_maps_sameOffPairs (m : ℕ) {σ : Perm (Fin (2 * m))} (hσ : σ ∈ blockAutoFinset m) {i j : Fin (2 * m)} (h : (i, j) ∈ sameOffPairs m) : (σ i, σ j) ∈ sameOffPairs m := by rw [sameOffPairs] at h ⊢ simp only [mem_filter, Finset.mem_univ, true_and] at h ⊢ rcases h with ⟨hij, hsame⟩ constructor · exact fun hEq => hij (σ.injective hEq) · rw [blockAutoFinset] at hσ simp only [mem_filter, Finset.mem_univ, true_and] at hσ rcases hσ with hpres | hswap · simpa [hpres i, hpres j] using hsame · by_cases hi : i.val < m <;> by_cases hj : j.val < m <;> simp [hi, hj] at hsame ⊢ <;> simp [hswap i, hswap j, hi, hj]
CausalSmith.Experimentation.DesignPm1.blockAuto_maps_sameOffPairs · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SymRedDesign.lean:81
theorem blockAuto_maps_crossPairs

A block automorphism permutes crossPairs.

Formal statement
m :
Perm (Fin (2 * m))
:
i j :
Fin (2 * m)
h :
(i, j) ∈ crossPairs m
(σ i, σ j) ∈ crossPairs m
Proof (Lean source)
lemma blockAuto_maps_crossPairs (m : ℕ) {σ : Perm (Fin (2 * m))} (hσ : σ ∈ blockAutoFinset m) {i j : Fin (2 * m)} (h : (i, j) ∈ crossPairs m) : (σ i, σ j) ∈ crossPairs m := by rw [crossPairs] at h ⊢ simp only [mem_filter, Finset.mem_univ, true_and] at h ⊢ rw [blockAutoFinset] at hσ simp only [mem_filter, Finset.mem_univ, true_and] at hσ rcases hσ with hpres | hswap · intro hsame apply h simpa [hpres i, hpres j] using hsame · intro hsame apply h have hnot : decide (¬ i.val < m) = decide (¬ j.val < m) := by simpa [hswap i, hswap j] using hsame by_cases hi : i.val < m <;> by_cases hj : j.val < m <;> simp [hi, hj] at hnot ⊢
CausalSmith.Experimentation.DesignPm1.blockAuto_maps_crossPairs · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SymRedDesign.lean:99
def orbitAvgDesign

The orbit-averaged design D'.p z = |H|⁻¹ ∑_{σ∈H} D.p (z∘σ).

Definition (Lean source)
noncomputable def orbitAvgDesign (m : ℕ) (D : FiniteDesign (Fin (2 * m) → Bool)) : FiniteDesign (Fin (2 * m) → Bool) where p := fun z => (∑ σ ∈ blockAutoFinset m, D.p (pbAct m σ z)) / (blockAutoFinset m).card p_nonneg := by intro z exact div_nonneg (sum_nonneg (fun σ _ => D.p_nonneg (pbAct m σ z))) (by exact_mod_cast zero_le (blockAutoFinset m).card) p_sum := by classical have hcard_ne : ((blockAutoFinset m).card : ℝ) ≠ 0 := by exact_mod_cast (ne_of_gt (blockAutoFinset_card_pos m)) have hinner : ∀ σ : Perm (Fin (2 * m)), ∑ z, D.p (pbAct m σ z) = 1 := by intro σ let e : (Fin (2 * m) → Bool) ≃ (Fin (2 * m) → Bool) := { toFun := fun z => pbAct m σ z invFun := fun z => pbAct m σ⁻¹ z left_inv := by intro z funext i simp [pbAct] right_inv := by intro z funext i simp [pbAct] } calc (∑ z, D.p (pbAct m σ z)) = ∑ z, D.p z := by simpa [e, pbAct] using (Equiv.sum_comp e D.p) _ = 1 := D.p_sum simp only [div_eq_mul_inv] rw [← Finset.sum_mul] rw [Finset.sum_comm] simp_rw [Finset.sum_mul] calc (∑ x ∈ blockAutoFinset m, ∑ i, D.p (pbAct m x i) * (((blockAutoFinset m).card : ℝ)⁻¹)) = ∑ x ∈ blockAutoFinset m, (1 : ℝ) * (((blockAutoFinset m).card : ℝ)⁻¹) := by apply Finset.sum_congr rfl intro σ hσ rw [← Finset.sum_mul, hinner σ] _ = 1 := by rw [Finset.sum_const, nsmul_eq_mul] field_simp [hcard_ne]
theorem orbitAvgDesign_balanced

The orbit average of a balanced design is balanced.

Formal statement
m :
D :
FiniteDesign (Fin (2 * m) → Bool)
Proof (Lean source)
lemma orbitAvgDesign_balanced (m : ℕ) (D : FiniteDesign (Fin (2 * m) → Bool)) (hD : BalancedSignDesign m D) : BalancedSignDesign m (orbitAvgDesign m D) := by intro z simp [orbitAvgDesign, pbAct] apply congrArg (fun x : ℝ => x / ((blockAutoFinset m).card : ℝ)) apply Finset.sum_congr rfl intro σ _ exact hD (pbAct m σ z)
theorem orbitAvgDesign_blockAuto_invariant

The orbit average is invariant under the block-automorphism group.

Formal statement
m :
D :
FiniteDesign (Fin (2 * m) → Bool)
σ :
Perm (Fin (2 * m))
:
z :
Fin (2 * m) → Bool
(orbitAvgDesign m D).p (fun i => z (σ i)) = (orbitAvgDesign m D).p z
Proof (Lean source)
lemma orbitAvgDesign_blockAuto_invariant (m : ℕ) (D : FiniteDesign (Fin (2 * m) → Bool)) (σ : Perm (Fin (2 * m))) (hσ : IsBlockAuto m σ) (z : Fin (2 * m) → Bool) : (orbitAvgDesign m D).p (fun i => z (σ i)) = (orbitAvgDesign m D).p z := by classical have hσmem : σ ∈ blockAutoFinset m := by rw [blockAutoFinset] simp [hσ] simp [orbitAvgDesign, pbAct] apply congrArg (fun x : ℝ => x / ((blockAutoFinset m).card : ℝ)) refine Finset.sum_bij' (fun τ _ => σ * τ) (fun ρ _ => σ⁻¹ * ρ) ?_ ?_ ?_ ?_ ?_ · intro τ hτ exact mul_mem_blockAutoFinset m hσmem hτ · intro ρ hρ exact mul_mem_blockAutoFinset m (inv_mem_blockAutoFinset m hσmem) hρ · intro τ hτ ext i simp [Equiv.Perm.mul_apply] · intro ρ hρ ext i simp [Equiv.Perm.mul_apply] · intro τ hτ congr 1
CausalSmith.Experimentation.DesignPm1.orbitAvgDesign_blockAuto_invariant · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SymRedDesign.lean:173
theorem balanced_zero_margin

A balanced design has zero one-point margins.

Formal statement
m :
D :
FiniteDesign (Fin (2 * m) → Bool)
i :
Fin (2 * m)
D.E (fun z => signOf m z i) = 0
Proof (Lean source)
lemma balanced_zero_margin (m : ℕ) (D : FiniteDesign (Fin (2 * m) → Bool)) (hD : BalancedSignDesign m D) (i : Fin (2 * m)) : D.E (fun z => signOf m z i) = 0 := by classical let e : (Fin (2 * m) → Bool) ≃ (Fin (2 * m) → Bool) := { toFun := fun z k => ! z k invFun := fun z k => ! z k left_inv := by intro z; funext k; simp right_inv := by intro z; funext k; simp } have hflip : D.E (fun z => signOf m z i) = ∑ z : Fin (2 * m) → Bool, D.p (fun k => ! z k) * signOf m (fun k => ! z k) i := by simpa [FiniteDesign.E, e] using (Equiv.sum_comp e (fun z => D.p z * signOf m z i)).symm have hneg : (∑ z : Fin (2 * m) → Bool, D.p (fun k => ! z k) * signOf m (fun k => ! z k) i) = - D.E (fun z => signOf m z i) := by rw [FiniteDesign.E, ← Finset.sum_neg_distrib] apply Finset.sum_congr rfl intro z _ have hs : signOf m (fun k => ! z k) i = - signOf m z i := by unfold signOf by_cases h : z i <;> simp [h] rw [← hD z, hs] ring have hself : D.E (fun z => signOf m z i) = -D.E (fun z => signOf m z i) := hflip.trans hneg linarith
theorem orbitAvgDesign_mem_class

The orbit average lands in the block-exchangeable class.

Formal statement
m :
D :
FiniteDesign (Fin (2 * m) → Bool)
Proof (Lean source)
lemma orbitAvgDesign_mem_class (m : ℕ) (D : FiniteDesign (Fin (2 * m) → Bool)) (hD : BalancedDesignClass m D) : orbitAvgDesign m D ∈ blockExchangeableDesignClass m := by exact ⟨⟨orbitAvgDesign_balanced m D hD.balanced⟩, fun σ hσ z => orbitAvgDesign_blockAuto_invariant m D σ hσ z⟩
theorem assignmentSecondMoment_symm

Second moments are symmetric.

Formal statement
m :
D :
FiniteDesign (Fin (2 * m) → Bool)
i j :
Fin (2 * m)
Proof (Lean source)
lemma assignmentSecondMoment_symm (m : ℕ) (D : FiniteDesign (Fin (2 * m) → Bool)) (i j : Fin (2 * m)) : assignmentSecondMoment m D i j = assignmentSecondMoment m D j i := by simp [assignmentSecondMoment, mul_comm]
CausalSmith.Experimentation.DesignPm1.assignmentSecondMoment_symm · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SymRedDesign.lean:236
theorem assignmentSecondMoment_diag

Second moments have unit diagonal.

Formal statement
m :
D :
FiniteDesign (Fin (2 * m) → Bool)
i :
Fin (2 * m)
Proof (Lean source)
lemma assignmentSecondMoment_diag (m : ℕ) (D : FiniteDesign (Fin (2 * m) → Bool)) (i : Fin (2 * m)) : assignmentSecondMoment m D i i = 1 := by have hs : ∀ z : Fin (2 * m) → Bool, signOf m z i * signOf m z i = 1 := by intro z unfold signOf by_cases h : z i <;> simp [h] simp [assignmentSecondMoment, hs]
CausalSmith.Experimentation.DesignPm1.assignmentSecondMoment_diag · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SymRedDesign.lean:242
theorem assignmentSecondMoment_posSemidef

Second moments are positive semidefinite (Gram matrix E[Z Zᵀ]).

Formal statement
m :
D :
FiniteDesign (Fin (2 * m) → Bool)
Proof (Lean source)
lemma assignmentSecondMoment_posSemidef (m : ℕ) (D : FiniteDesign (Fin (2 * m) → Bool)) : (assignmentSecondMoment m D).PosSemidef := by classical refine Matrix.PosSemidef.of_dotProduct_mulVec_nonneg ?_ ?_ · exact Matrix.IsHermitian.ext fun i j => by simp [assignmentSecondMoment, mul_comm] · intro x have hquad : dotProduct x ((assignmentSecondMoment m D).mulVec x) = ∑ z, D.p z * (∑ i, signOf m z i * x i) ^ 2 := by simp [dotProduct, mulVec, assignmentSecondMoment, FiniteDesign.E, Finset.mul_sum, Finset.sum_mul, sq, mul_assoc, mul_left_comm, mul_comm] calc (∑ x_1, ∑ x_2, ∑ i, x x_1 * (x x_2 * (signOf m i x_1 * (signOf m i x_2 * D.p i)))) = ∑ x_1, ∑ i, ∑ x_2, x x_1 * (x x_2 * (signOf m i x_1 * (signOf m i x_2 * D.p i))) := by apply Finset.sum_congr rfl intro a _ rw [Finset.sum_comm] _ = ∑ i, ∑ x_1, ∑ x_2, x x_1 * (x x_2 * (signOf m i x_1 * (signOf m i x_2 * D.p i))) := by rw [Finset.sum_comm] _ = ∑ x_1, ∑ x_2, ∑ x_3, x x_2 * (x x_3 * (signOf m x_1 x_2 * (signOf m x_1 x_3 * D.p x_1))) := by rfl simpa [hquad] using sum_nonneg (fun z _ => mul_nonneg (D.p_nonneg z) (sq_nonneg _))
CausalSmith.Experimentation.DesignPm1.assignmentSecondMoment_posSemidef · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SymRedDesign.lean:251
theorem iidDesign_mem_blockExchangeable

The uniform iid Rademacher design is block-exchangeable (a nonempty witness).

Formal statement
m :
Proof (Lean source)
lemma iidDesign_mem_blockExchangeable (m : ℕ) : iidDesign m ∈ blockExchangeableDesignClass m := by refine ⟨⟨fun z => rfl⟩, fun σ _ z => rfl⟩
CausalSmith.Experimentation.DesignPm1.iidDesign_mem_blockExchangeable · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SymRedDesign.lean:281
theorem orbitAvg_secondMoment_entry

The second moment of the orbit average is the orbit average of the second moment: X(D')ᵢⱼ = |H|⁻¹ ∑_{σ∈H} X(D)_{σi,σj}.

Formal statement
m :
D :
FiniteDesign (Fin (2 * m) → Bool)
i j :
Fin (2 * m)
= (∑ σ ∈ blockAutoFinset m, assignmentSecondMoment m D (σ i) (σ j)) / (blockAutoFinset m).card
Proof (Lean source)
lemma orbitAvg_secondMoment_entry (m : ℕ) (D : FiniteDesign (Fin (2 * m) → Bool)) (i j : Fin (2 * m)) : assignmentSecondMoment m (orbitAvgDesign m D) i j = (∑ σ ∈ blockAutoFinset m, assignmentSecondMoment m D (σ i) (σ j)) / (blockAutoFinset m).card := by classical have hinner : ∀ σ : Perm (Fin (2 * m)), (∑ z : Fin (2 * m) → Bool, D.p (pbAct m σ z) * (signOf m z i * signOf m z j)) = assignmentSecondMoment m D (σ⁻¹ i) (σ⁻¹ j) := by intro σ let e : (Fin (2 * m) → Bool) ≃ (Fin (2 * m) → Bool) := { toFun := fun z => pbAct m σ z invFun := fun z => pbAct m σ⁻¹ z left_inv := by intro z; funext k; simp [pbAct] right_inv := by intro z; funext k; simp [pbAct] } calc (∑ z : Fin (2 * m) → Bool, D.p (pbAct m σ z) * (signOf m z i * signOf m z j)) = ∑ z : Fin (2 * m) → Bool, D.p (e z) * (signOf m (e z) (σ⁻¹ i) * signOf m (e z) (σ⁻¹ j)) := by refine Finset.sum_congr rfl fun z _ => ?_ simp [e, signOf, pbAct] _ = ∑ w : Fin (2 * m) → Bool, D.p w * (signOf m w (σ⁻¹ i) * signOf m w (σ⁻¹ j)) := Equiv.sum_comp e (fun w => D.p w * (signOf m w (σ⁻¹ i) * signOf m w (σ⁻¹ j))) _ = assignmentSecondMoment m D (σ⁻¹ i) (σ⁻¹ j) := rfl have hinvsum : (∑ σ ∈ blockAutoFinset m, assignmentSecondMoment m D (σ⁻¹ i) (σ⁻¹ j)) = ∑ σ ∈ blockAutoFinset m, assignmentSecondMoment m D (σ i) (σ j) := by refine Finset.sum_bij' (fun σ _ => σ⁻¹) (fun σ _ => σ⁻¹) ?_ ?_ ?_ ?_ ?_ · intro σ hσ exact inv_mem_blockAutoFinset m hσ · intro σ hσ exact inv_mem_blockAutoFinset m hσ · intro σ hσ simp · intro σ hσ simp · intro σ hσ simp calc assignmentSecondMoment m (orbitAvgDesign m D) i j = (∑ σ ∈ blockAutoFinset m, assignmentSecondMoment m D (σ⁻¹ i) (σ⁻¹ j)) / (blockAutoFinset m).card := by simp only [assignmentSecondMoment, Matrix.of_apply, FiniteDesign.E, orbitAvgDesign] simp_rw [div_eq_mul_inv] simp_rw [Finset.sum_mul] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro σ hσ calc (∑ x, D.p (pbAct m σ x) * (((blockAutoFinset m).card : ℝ)⁻¹) * (signOf m x i * signOf m x j)) = ∑ x, D.p (pbAct m σ x) * (signOf m x i * signOf m x j) * (((blockAutoFinset m).card : ℝ)⁻¹) := by apply Finset.sum_congr rfl intro z _ ring _ = (∑ x, D.p (pbAct m σ x) * (signOf m x i * signOf m x j)) * (((blockAutoFinset m).card : ℝ)⁻¹) := by rw [← Finset.sum_mul] _ = (∑ x, D.p x * (signOf m x (σ⁻¹ i) * signOf m x (σ⁻¹ j))) * (((blockAutoFinset m).card : ℝ)⁻¹) := by simpa [assignmentSecondMoment, FiniteDesign.E] using congrArg (fun t : ℝ => t * (((blockAutoFinset m).card : ℝ)⁻¹)) (hinner σ) _ = ∑ x, D.p x * (signOf m x (σ⁻¹ i) * signOf m x (σ⁻¹ j)) * (((blockAutoFinset m).card : ℝ)⁻¹) := by rw [Finset.sum_mul] _ = (∑ σ ∈ blockAutoFinset m, assignmentSecondMoment m D (σ i) (σ j)) / (blockAutoFinset m).card := by rw [hinvsum]
CausalSmith.Experimentation.DesignPm1.orbitAvg_secondMoment_entry · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SymRedDesign.lean:286
theorem Ssame_orbitAvg

Orbit averaging preserves the within-community entry sum.

Formal statement
m :
D :
FiniteDesign (Fin (2 * m) → Bool)
Proof (Lean source)
lemma Ssame_orbitAvg (m : ℕ) (D : FiniteDesign (Fin (2 * m) → Bool)) : Ssame m (assignmentSecondMoment m (orbitAvgDesign m D)) = Ssame m (assignmentSecondMoment m D) := by classical have hcard_ne : ((blockAutoFinset m).card : ℝ) ≠ 0 := by exact_mod_cast (ne_of_gt (blockAutoFinset_card_pos m)) have hpair : ∀ σ ∈ blockAutoFinset m, (∑ p ∈ sameOffPairs m, assignmentSecondMoment m D (σ p.1) (σ p.2)) = Ssame m (assignmentSecondMoment m D) := by intro σ hσ unfold Ssame refine Finset.sum_bij' (fun p _ => (σ p.1, σ p.2)) (fun q _ => (σ⁻¹ q.1, σ⁻¹ q.2)) ?_ ?_ ?_ ?_ ?_ · intro p hp; exact blockAuto_maps_sameOffPairs m hσ hp · intro q hq; exact blockAuto_maps_sameOffPairs m (inv_mem_blockAutoFinset m hσ) hq · intro p hp; ext <;> simp · intro q hq; ext <;> simp · intro p hp; rfl unfold Ssame simp_rw [orbitAvg_secondMoment_entry m D] simp only [div_eq_mul_inv] rw [← Finset.sum_mul] rw [Finset.sum_comm] simp_rw [Finset.sum_mul] calc (∑ x ∈ blockAutoFinset m, ∑ i ∈ sameOffPairs m, assignmentSecondMoment m D (x i.1) (x i.2) * (((blockAutoFinset m).card : ℝ)⁻¹)) = ∑ x ∈ blockAutoFinset m, Ssame m (assignmentSecondMoment m D) * (((blockAutoFinset m).card : ℝ)⁻¹) := by apply Finset.sum_congr rfl intro σ hσ rw [← Finset.sum_mul, hpair σ hσ] _ = ∑ p ∈ sameOffPairs m, assignmentSecondMoment m D p.1 p.2 := by rw [Finset.sum_const, nsmul_eq_mul] field_simp [hcard_ne] rfl
theorem Scross_orbitAvg

Orbit averaging preserves the cross-community entry sum.

Formal statement
m :
D :
FiniteDesign (Fin (2 * m) → Bool)
Proof (Lean source)
lemma Scross_orbitAvg (m : ℕ) (D : FiniteDesign (Fin (2 * m) → Bool)) : Scross m (assignmentSecondMoment m (orbitAvgDesign m D)) = Scross m (assignmentSecondMoment m D) := by classical have hcard_ne : ((blockAutoFinset m).card : ℝ) ≠ 0 := by exact_mod_cast (ne_of_gt (blockAutoFinset_card_pos m)) have hpair : ∀ σ ∈ blockAutoFinset m, (∑ p ∈ crossPairs m, assignmentSecondMoment m D (σ p.1) (σ p.2)) = Scross m (assignmentSecondMoment m D) := by intro σ hσ unfold Scross refine Finset.sum_bij' (fun p _ => (σ p.1, σ p.2)) (fun q _ => (σ⁻¹ q.1, σ⁻¹ q.2)) ?_ ?_ ?_ ?_ ?_ · intro p hp; exact blockAuto_maps_crossPairs m hσ hp · intro q hq; exact blockAuto_maps_crossPairs m (inv_mem_blockAutoFinset m hσ) hq · intro p hp; ext <;> simp · intro q hq; ext <;> simp · intro p hp; rfl unfold Scross simp_rw [orbitAvg_secondMoment_entry m D] simp only [div_eq_mul_inv] rw [← Finset.sum_mul] rw [Finset.sum_comm] simp_rw [Finset.sum_mul] calc (∑ x ∈ blockAutoFinset m, ∑ i ∈ crossPairs m, assignmentSecondMoment m D (x i.1) (x i.2) * (((blockAutoFinset m).card : ℝ)⁻¹)) = ∑ x ∈ blockAutoFinset m, Scross m (assignmentSecondMoment m D) * (((blockAutoFinset m).card : ℝ)⁻¹) := by apply Finset.sum_congr rfl intro σ hσ rw [← Finset.sum_mul, hpair σ hσ] _ = ∑ p ∈ crossPairs m, assignmentSecondMoment m D p.1 p.2 := by rw [Finset.sum_const, nsmul_eq_mul] field_simp [hcard_ne] rfl
theorem frobeniusNorm_orbitAvg_le

Orbit averaging weakly decreases the Frobenius norm of the second moment.

Formal statement
m :
D :
FiniteDesign (Fin (2 * m) → Bool)
Proof (Lean source)
lemma frobeniusNorm_orbitAvg_le (m : ℕ) (D : FiniteDesign (Fin (2 * m) → Bool)) : frobeniusNorm (assignmentSecondMoment m (orbitAvgDesign m D)) ≤ frobeniusNorm (assignmentSecondMoment m D) := by classical let X := assignmentSecondMoment m D let Y := assignmentSecondMoment m (orbitAvgDesign m D) have hcard_pos : (0 : ℝ) < ((blockAutoFinset m).card : ℝ) := by exact_mod_cast blockAutoFinset_card_pos m have hcard_ne : ((blockAutoFinset m).card : ℝ) ≠ 0 := ne_of_gt hcard_pos have hentry : ∀ i j : Fin (2 * m), (Y i j) ^ 2 ≤ (∑ σ ∈ blockAutoFinset m, (X (σ i) (σ j)) ^ 2) / ((blockAutoFinset m).card : ℝ) := by intro i j have hcs := sq_sum_le_card_mul_sum_sq (s := blockAutoFinset m) (f := fun σ : Perm (Fin (2 * m)) => X (σ i) (σ j)) have hY : Y i j = (∑ σ ∈ blockAutoFinset m, X (σ i) (σ j)) / ((blockAutoFinset m).card : ℝ) := by dsimp [Y, X] exact orbitAvg_secondMoment_entry m D i j rw [hY] rw [show ((∑ σ ∈ blockAutoFinset m, X (σ i) (σ j)) / ((blockAutoFinset m).card : ℝ)) ^ 2 = ((∑ σ ∈ blockAutoFinset m, X (σ i) (σ j)) ^ 2) / ((blockAutoFinset m).card : ℝ) ^ 2 by ring] field_simp [hcard_ne] nlinarith [hcs] have hperm_sum : ∀ σ : Perm (Fin (2 * m)), (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), (X (σ i) (σ j)) ^ 2) = ∑ i : Fin (2 * m), ∑ j : Fin (2 * m), (X i j) ^ 2 := by intro σ have hrow : ∀ i : Fin (2 * m), (∑ j : Fin (2 * m), (X (σ i) (σ j)) ^ 2) = ∑ j : Fin (2 * m), (X (σ i) j) ^ 2 := by intro i exact Fintype.sum_bijective (fun j : Fin (2 * m) => σ j) σ.bijective (fun j => (X (σ i) (σ j)) ^ 2) (fun j => (X (σ i) j) ^ 2) (fun j => rfl) calc (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), (X (σ i) (σ j)) ^ 2) = ∑ i : Fin (2 * m), ∑ j : Fin (2 * m), (X (σ i) j) ^ 2 := by apply Finset.sum_congr rfl intro i _ exact hrow i _ = ∑ i : Fin (2 * m), ∑ j : Fin (2 * m), (X i j) ^ 2 := by exact Fintype.sum_bijective (fun i : Fin (2 * m) => σ i) σ.bijective (fun i => ∑ j : Fin (2 * m), (X (σ i) j) ^ 2) (fun i => ∑ j : Fin (2 * m), (X i j) ^ 2) (fun i => rfl) have hsum_le : (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), (Y i j) ^ 2) ≤ ∑ i : Fin (2 * m), ∑ j : Fin (2 * m), (∑ σ ∈ blockAutoFinset m, (X (σ i) (σ j)) ^ 2) / ((blockAutoFinset m).card : ℝ) := by apply Finset.sum_le_sum intro i _ apply Finset.sum_le_sum intro j _ exact hentry i j have havg_eq : (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), (∑ σ ∈ blockAutoFinset m, (X (σ i) (σ j)) ^ 2) / ((blockAutoFinset m).card : ℝ)) = ∑ i : Fin (2 * m), ∑ j : Fin (2 * m), (X i j) ^ 2 := by simp only [div_eq_mul_inv, Finset.sum_mul] calc (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), ∑ σ ∈ blockAutoFinset m, X (σ i) (σ j) ^ 2 * (((blockAutoFinset m).card : ℝ)⁻¹)) = ∑ i : Fin (2 * m), ∑ σ ∈ blockAutoFinset m, ∑ j : Fin (2 * m), X (σ i) (σ j) ^ 2 * (((blockAutoFinset m).card : ℝ)⁻¹) := by apply Finset.sum_congr rfl intro i _ rw [Finset.sum_comm] _ = ∑ σ ∈ blockAutoFinset m, ∑ i : Fin (2 * m), ∑ j : Fin (2 * m), X (σ i) (σ j) ^ 2 * (((blockAutoFinset m).card : ℝ)⁻¹) := by rw [Finset.sum_comm] _ = ∑ σ ∈ blockAutoFinset m, (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), X i j ^ 2) * (((blockAutoFinset m).card : ℝ)⁻¹) := by apply Finset.sum_congr rfl intro σ hσ calc (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), X (σ i) (σ j) ^ 2 * (((blockAutoFinset m).card : ℝ)⁻¹)) = ∑ i : Fin (2 * m), (∑ j : Fin (2 * m), X (σ i) (σ j) ^ 2) * (((blockAutoFinset m).card : ℝ)⁻¹) := by apply Finset.sum_congr rfl intro i _ rw [← Finset.sum_mul] _ = (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), X (σ i) (σ j) ^ 2) * (((blockAutoFinset m).card : ℝ)⁻¹) := by rw [← Finset.sum_mul] _ = (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), X i j ^ 2) * (((blockAutoFinset m).card : ℝ)⁻¹) := by rw [hperm_sum σ] _ = ∑ i : Fin (2 * m), ∑ j : Fin (2 * m), X i j ^ 2 := by rw [Finset.sum_const, nsmul_eq_mul] field_simp [hcard_ne] unfold frobeniusNorm apply Real.sqrt_le_sqrt exact le_trans hsum_le (le_of_eq havg_eq)
theorem design_symmetrize

Design-side symmetry reduction (master export). For every balanced design D, its orbit average orbitAvgDesign m D over the full two-block automorphism group is the witness: it is block-exchangeable, has the same zero one-point margins, and has a weakly smaller objective.

Formal statement
m :
a b r kappa :
hHom :
hk :
0 ≤ kappa
D :
FiniteDesign (Fin (2 * m) → Bool)
(∀ i, (orbitAvgDesign m D).E (fun z => signOf m z i) = 0) ∧
designObjective m a b r kappa (assignmentSecondMoment m D)
Proof (Lean source)
lemma design_symmetrize (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 ≤ kappa) (D : FiniteDesign (Fin (2 * m) → Bool)) (hD : BalancedDesignClass m D) : orbitAvgDesign m D ∈ blockExchangeableDesignClass m ∧ (∀ i, (orbitAvgDesign m D).E (fun z => signOf m z i) = 0) ∧ designObjective m a b r kappa (assignmentSecondMoment m (orbitAvgDesign m D)) ≤ designObjective m a b r kappa (assignmentSecondMoment m D) := by refine ⟨orbitAvgDesign_mem_class m D hD, ?_, ?_⟩ · intro i exact balanced_zero_margin m (orbitAvgDesign m D) (orbitAvgDesign_balanced m D hD.balanced) i · exact designObjective_le_of_blockSums m a b r kappa hHom hk (assignmentSecondMoment m D) (assignmentSecondMoment m (orbitAvgDesign m D)) (assignmentSecondMoment_symm m D) (assignmentSecondMoment_symm m (orbitAvgDesign m D)) (assignmentSecondMoment_diag m D) (assignmentSecondMoment_diag m (orbitAvgDesign m D)) (Ssame_orbitAvg m D) (Scross_orbitAvg m D) (frobeniusNorm_orbitAvg_le m D)
Helpers.SymRedMatrix 28 declarations The objective matrices L_m, L_m^†, J_n are all block-constant: their entries depend only on the pair type (diagonal / within-community / cross-community).

Matrix-side symmetry reduction (block-constant averaging, no group action)

The objective matrices L_m, L_m^†, J_n are all block-constant: their entries depend only on the pair type (diagonal / within-community / cross-community). For a block-constant M and a symmetric X,

Tr(M X) = d·∑ᵢ Xᵢᵢ + w·Ssame(X) + c·Scross(X),

where Ssame/Scross are the within/cross off-diagonal entry sums. Setting u = Ssame(X)/Nsame, v = Scross(X)/Ncross (the block averages) makes the block sums of X(u,v) match those of X, so every trace term is exactly preserved, while the Frobenius term drops by Cauchy–Schwarz ((∑x)² ≤ N·∑x²). PSD unit-diagonal X further forces X(u,v) ∈ E_m^blk via the quadratic forms 1ᵀX1 ≥ 0, sᵀXs ≥ 0, (eᵢ−eⱼ)ᵀX(eᵢ−eⱼ) ≥ 0. Hence orbit-averaging never worsens the objective — with no group machinery.

def blockConstMat

Block-constant matrix G(d,w,c): entry d on the diagonal, w within a community, c across communities. blockSymMatrix m u v = blockConstMat m 1 u v.

Definition (Lean source)
def blockConstMat (m : ℕ) (d w c : ℝ) : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ := of fun i j => if i = j then d else if (decide (i.val < m) = decide (j.val < m)) then w else c
def sameOffPairs

The within-community off-diagonal ordered pairs.

Definition (Lean source)
def sameOffPairs (m : ℕ) : Finset (Fin (2 * m) × Fin (2 * m)) := Finset.univ.filter fun p => p.1 ≠ p.2 ∧ decide (p.1.val < m) = decide (p.2.val < m)
def crossPairs

The cross-community ordered pairs.

Definition (Lean source)
def crossPairs (m : ℕ) : Finset (Fin (2 * m) × Fin (2 * m)) := Finset.univ.filter fun p => decide (p.1.val < m) ≠ decide (p.2.val < m)
def Ssame

The within-community entry sum ∑_{same, i≠j} Xᵢⱼ.

Definition (Lean source)
def Ssame (m : ℕ) (X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) : ℝ := ∑ p ∈ sameOffPairs m, X p.1 p.2
def Scross

The cross-community entry sum ∑_{cross} Xᵢⱼ.

Definition (Lean source)
def Scross (m : ℕ) (X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) : ℝ := ∑ p ∈ crossPairs m, X p.1 p.2
def NsameR

Number of within-community off-diagonal ordered pairs = 2m(m−1).

Definition (Lean source)
def NsameR (m : ℕ) : ℝ := 2 * (m : ℝ) * ((m : ℝ) - 1)
def NcrossR

Number of cross-community ordered pairs = 2m².

Definition (Lean source)
def NcrossR (m : ℕ) : ℝ := 2 * (m : ℝ) * (m : ℝ)
def uOf

The block average u of X.

Definition (Lean source)
noncomputable def uOf (m : ℕ) (X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) : ℝ := Ssame m X / NsameR m
def vOf

The block average v of X.

Definition (Lean source)
noncomputable def vOf (m : ℕ) (X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) : ℝ := Scross m X / NcrossR m
theorem blockSymMatrix_eq_blockConst

blockSymMatrix is the d = 1 block-constant matrix.

Formal statement
m :
u v :
Proof (Lean source)
lemma blockSymMatrix_eq_blockConst (m : ℕ) (u v : ℝ) : blockSymMatrix m u v = blockConstMat m 1 u v := rfl
CausalSmith.Experimentation.DesignPm1.blockSymMatrix_eq_blockConst · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SymRedMatrix.lean:67
theorem blockConstMat_symm

A block-constant matrix is symmetric.

Formal statement
m :
d w c :
i j :
Fin (2 * m)
blockConstMat m d w c i j = blockConstMat m d w c j i
Proof (Lean source)
lemma blockConstMat_symm (m : ℕ) (d w c : ℝ) (i j : Fin (2 * m)) : blockConstMat m d w c i j = blockConstMat m d w c j i := by by_cases hi : i.val < m <;> by_cases hj : j.val < m <;> by_cases hij : i = j <;> simp [blockConstMat, hi, hj, hij, eq_comm]
theorem card_sameOffPairs

|sameOffPairs m| = 2m(m−1).

Formal statement
m :
(sameOffPairs m).card = 2 * m * (m - 1)
Proof (Lean source)
lemma card_sameOffPairs (m : ℕ) : (sameOffPairs m).card = 2 * m * (m - 1) := by have hpair := block_pair_sum m (0 : ℝ) 1 0 have hpair' : (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), if i = j then (0 : ℝ) else if i.val < m ↔ j.val < m then 1 else 0) = 2 * (m : ℝ) * ((m : ℝ) - 1) := by simpa using hpair have hsum : (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), (if i ≠ j ∧ decide (i.val < m) = decide (j.val < m) then (1 : ℝ) else 0)) = 2 * (m : ℝ) * ((m : ℝ) - 1) := by rw [← hpair'] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ by_cases hij : i = j <;> by_cases hsame : i.val < m ↔ j.val < m <;> simp [hij, hsame] have hreal : ((sameOffPairs m).card : ℝ) = 2 * (m : ℝ) * ((m : ℝ) - 1) := by have hcard : ((sameOffPairs m).card : ℝ) = ∑ p ∈ sameOffPairs m, (1 : ℝ) := by simp rw [hcard, sameOffPairs, Finset.sum_filter, ← Finset.univ_product_univ, Finset.sum_product] simpa [decide_eq_decide, eq_comm] using hsum apply Nat.cast_injective (R := ℝ) rw [hreal] cases m <;> simp
theorem card_crossPairs

|crossPairs m| = 2m².

Formal statement
m :
(crossPairs m).card = 2 * m * m
Proof (Lean source)
lemma card_crossPairs (m : ℕ) : (crossPairs m).card = 2 * m * m := by have hpair := block_pair_sum m (0 : ℝ) 0 1 have hpair' : (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), if i = j then (0 : ℝ) else if i.val < m ↔ j.val < m then 0 else 1) = 2 * (m : ℝ) * (m : ℝ) := by simpa using hpair have hsum : (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), (if decide (i.val < m) ≠ decide (j.val < m) then (1 : ℝ) else 0)) = 2 * (m : ℝ) * (m : ℝ) := by rw [← hpair'] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ by_cases hij : i = j <;> by_cases hsame : i.val < m ↔ j.val < m <;> simp [hij, hsame] have hreal : ((crossPairs m).card : ℝ) = 2 * (m : ℝ) * (m : ℝ) := by have hcard : ((crossPairs m).card : ℝ) = ∑ p ∈ crossPairs m, (1 : ℝ) := by simp rw [hcard, crossPairs, Finset.sum_filter, ← Finset.univ_product_univ, Finset.sum_product] simpa [decide_eq_decide, eq_comm] using hsum apply Nat.cast_injective (R := ℝ) rw [hreal] norm_num
theorem trace_blockConstMat_mul

Master trace decomposition. For block-constant M = G(d,w,c) and symmetric X, the trace splits into the diagonal, within, and cross sums.

Formal statement
m :
d w c :
X :
Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ
hSymm :
∀ i j, X i j = X j i
trace (blockConstMat m d w c * X)
= d * (∑ i, X i i) + w * Ssame m X + c * Scross m X
Proof (Lean source)
lemma trace_blockConstMat_mul (m : ℕ) (d w c : ℝ) (X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) (hSymm : ∀ i j, X i j = X j i) : trace (blockConstMat m d w c * X) = d * (∑ i, X i i) + w * Ssame m X + c * Scross m X := by have htrace : trace (blockConstMat m d w c * X) = ∑ i : Fin (2 * m), ∑ j : Fin (2 * m), (if i = j then d else if decide (i.val < m) = decide (j.val < m) then w else c) * X i j := by simp [trace, Matrix.mul_apply, blockConstMat] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ rw [hSymm j i] have hdiag : (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), if i = j then d * X i j else 0) = d * (∑ i, X i i) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro i _ rw [Finset.sum_eq_single i] · simp · intro j _ hji have hij : i ≠ j := fun h => hji h.symm simp [hij] · intro hi simp at hi have hsame : (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), if i ≠ j ∧ decide (i.val < m) = decide (j.val < m) then w * X i j else 0) = w * Ssame m X := by unfold Ssame sameOffPairs rw [Finset.mul_sum] rw [Finset.sum_filter] rw [← Finset.univ_product_univ, Finset.sum_product] have hcross : (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), if decide (i.val < m) ≠ decide (j.val < m) then c * X i j else 0) = c * Scross m X := by unfold Scross crossPairs rw [Finset.mul_sum] rw [Finset.sum_filter] rw [← Finset.univ_product_univ, Finset.sum_product] rw [htrace] calc (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), (if i = j then d else if decide (i.val < m) = decide (j.val < m) then w else c) * X i j) = (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), if i = j then d * X i j else 0) + (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), if i ≠ j ∧ decide (i.val < m) = decide (j.val < m) then w * X i j else 0) + (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), if decide (i.val < m) ≠ decide (j.val < m) then c * X i j else 0) := by simp_rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ by_cases hij : i = j <;> by_cases hsame : decide (i.val < m) = decide (j.val < m) <;> simp [hij, hsame] _ = d * (∑ i, X i i) + w * Ssame m X + c * Scross m X := by rw [hdiag, hsame, hcross]
theorem Ssame_blockSym

Ssame of a block-symmetric matrix X(u',v') is Nsame · u'.

Formal statement
m :
u v :
Ssame m (blockSymMatrix m u v) = NsameR m * u
Proof (Lean source)
lemma Ssame_blockSym (m : ℕ) (u v : ℝ) : Ssame m (blockSymMatrix m u v) = NsameR m * u := by unfold Ssame calc (∑ p ∈ sameOffPairs m, blockSymMatrix m u v p.1 p.2) = ∑ p ∈ sameOffPairs m, u := by apply Finset.sum_congr rfl intro p hp simp only [sameOffPairs, mem_filter, Finset.mem_univ, true_and] at hp have hsame : p.1.val < m ↔ p.2.val < m := by simpa [decide_eq_decide] using hp.2 simp [blockSymMatrix, hp.1, hsame] _ = NsameR m * u := by rw [Finset.sum_const, nsmul_eq_mul, card_sameOffPairs] unfold NsameR cases m <;> simp
theorem Scross_blockSym

Scross of a block-symmetric matrix X(u',v') is Ncross · v'.

Formal statement
m :
u v :
Scross m (blockSymMatrix m u v) = NcrossR m * v
Proof (Lean source)
lemma Scross_blockSym (m : ℕ) (u v : ℝ) : Scross m (blockSymMatrix m u v) = NcrossR m * v := by unfold Scross calc (∑ p ∈ crossPairs m, blockSymMatrix m u v p.1 p.2) = ∑ p ∈ crossPairs m, v := by apply Finset.sum_congr rfl intro p hp simp only [crossPairs, mem_filter, Finset.mem_univ, true_and] at hp have hne : p.1 ≠ p.2 := by intro h exact hp (by simp [h]) have hcross : ¬ (p.1.val < m ↔ p.2.val < m) := by intro hsame exact hp (by simp [hsame]) simp [blockSymMatrix, hne, hcross] _ = NcrossR m * v := by rw [Finset.sum_const, nsmul_eq_mul, card_crossPairs] unfold NcrossR norm_num
theorem diagSum_of_diag_one

Diagonal sum of a unit-diagonal matrix is 2m.

Formal statement
m :
X :
Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ
hdiag :
∀ i, X i i = 1
(∑ i, X i i) = 2 * (m : ℝ)
Proof (Lean source)
lemma diagSum_of_diag_one (m : ℕ) (X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) (hdiag : ∀ i, X i i = 1) : (∑ i, X i i) = 2 * (m : ℝ) := by simp [hdiag]
theorem trace_symmetrize

Trace preservation. For block-constant M and symmetric unit-diagonal X, symmetrizing to the block averages preserves the trace Tr(M X).

Formal statement
m :
d w c :
X :
Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ
hSymm :
∀ i j, X i j = X j i
hdiag :
∀ i, X i i = 1
hm :
2 ≤ m
trace (blockConstMat m d w c * X)
= trace (blockConstMat m d w c * blockSymMatrix m (uOf m X) (vOf m X))
Proof (Lean source)
lemma trace_symmetrize (m : ℕ) (d w c : ℝ) (X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) (hSymm : ∀ i j, X i j = X j i) (hdiag : ∀ i, X i i = 1) (hm : 2 ≤ m) : trace (blockConstMat m d w c * X) = trace (blockConstMat m d w c * blockSymMatrix m (uOf m X) (vOf m X)) := by have hblockSymm : ∀ i j, blockSymMatrix m (uOf m X) (vOf m X) i j = blockSymMatrix m (uOf m X) (vOf m X) j i := by intro i j simpa [blockSymMatrix_eq_blockConst] using blockConstMat_symm m 1 (uOf m X) (vOf m X) i j have hblockDiag : ∀ i, blockSymMatrix m (uOf m X) (vOf m X) i i = 1 := by intro i simp [blockSymMatrix] have hNsame : NsameR m ≠ 0 := by unfold NsameR have hmpos : (0 : ℝ) < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by decide : 0 < 2) hm) have hmgt1 : (1 : ℝ) < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by decide : 1 < 2) hm) exact ne_of_gt (mul_pos (mul_pos (by norm_num) hmpos) (by linarith)) have hNcross : NcrossR m ≠ 0 := by unfold NcrossR have hmpos : (0 : ℝ) < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by decide : 0 < 2) hm) positivity rw [trace_blockConstMat_mul m d w c X hSymm, trace_blockConstMat_mul m d w c (blockSymMatrix m (uOf m X) (vOf m X)) hblockSymm] rw [diagSum_of_diag_one m X hdiag, diagSum_of_diag_one m _ hblockDiag] rw [Ssame_blockSym, Scross_blockSym] unfold uOf vOf field_simp [hNsame, hNcross]
theorem twoBlockLaplacian_isBlockConst

twoBlockLaplacian is block-constant.

Formal statement
m :
a b :
hm :
2 ≤ m
∃ d w c, twoBlockLaplacian m a b = blockConstMat m d w c
Proof (Lean source)
lemma twoBlockLaplacian_isBlockConst (m : ℕ) (a b : ℝ) (hm : 2 ≤ m) : ∃ d w c, twoBlockLaplacian m a b = blockConstMat m d w c := by let deg : ℝ := ((m : ℝ) - 1) * (a / (m : ℝ)) + (m : ℝ) * (b / (m : ℝ)) have hcast_m_sub_one : ((m - 1 : ℕ) : ℝ) = (m : ℝ) - 1 := by have hm1 : 1 ≤ m := by omega rw [Nat.cast_sub hm1] norm_num have hDegree : ∀ i : Fin (2 * m), (∑ j : Fin (2 * m), twoBlockGraph m a b i j) = deg := by intro i let A := blockAFin m let B := blockBFin m by_cases hi : i.val < m · have hsplit : (∑ j : Fin (2 * m), twoBlockGraph m a b i j) = (∑ j ∈ A, twoBlockGraph m a b i j) + (∑ j ∈ B, twoBlockGraph m a b i j) := by dsimp [A, B, blockAFin, blockBFin] rw [← Finset.sum_filter_add_sum_filter_not (s := univ) (p := fun j : Fin (2 * m) => j.val < m) (f := fun j => twoBlockGraph m a b i j)] rw [hsplit] have hA : (∑ j ∈ A, twoBlockGraph m a b i j) = ((m - 1 : ℕ) : ℝ) * (a / (m : ℝ)) := by have hiA : i ∈ A := by simpa [A, blockAFin] using hi have hAcard : A.card = m := by dsimp [A]; exact card_blockAFin m calc (∑ j ∈ A, twoBlockGraph m a b i j) = ∑ j ∈ A, if i = j then 0 else a / (m : ℝ) := by apply Finset.sum_congr rfl intro j hj have hj' : j.val < m := by simpa [A, blockAFin] using hj by_cases hij : i = j <;> simp [twoBlockGraph, hij, hi, hj'] _ = 0 + ((A.card - 1 : ℕ) : ℝ) * (a / (m : ℝ)) := sum_if_eq_else_self_real A 0 (a / (m : ℝ)) hiA _ = ((m - 1 : ℕ) : ℝ) * (a / (m : ℝ)) := by rw [hAcard] ring have hB : (∑ j ∈ B, twoBlockGraph m a b i j) = (m : ℝ) * (b / (m : ℝ)) := by have hBcard : B.card = m := by dsimp [B]; exact card_blockBFin m calc (∑ j ∈ B, twoBlockGraph m a b i j) = ∑ j ∈ B, b / (m : ℝ) := by apply Finset.sum_congr rfl intro j hj have hj' : ¬ j.val < m := by simpa [B, blockBFin] using hj have hne : i ≠ j := by intro h exact hj' (by simpa [h] using hi) have hnot : ¬ (i.val < m ↔ j.val < m) := by intro hiff exact hj' (hiff.mp hi) simp [twoBlockGraph, hne, hnot] _ = (m : ℝ) * (b / (m : ℝ)) := by rw [Finset.sum_const, nsmul_eq_mul, hBcard] rw [hA, hB, hcast_m_sub_one] · have hsplit : (∑ j : Fin (2 * m), twoBlockGraph m a b i j) = (∑ j ∈ A, twoBlockGraph m a b i j) + (∑ j ∈ B, twoBlockGraph m a b i j) := by dsimp [A, B, blockAFin, blockBFin] rw [← Finset.sum_filter_add_sum_filter_not (s := univ) (p := fun j : Fin (2 * m) => j.val < m) (f := fun j => twoBlockGraph m a b i j)] rw [hsplit] have hA : (∑ j ∈ A, twoBlockGraph m a b i j) = (m : ℝ) * (b / (m : ℝ)) := by have hAcard : A.card = m := by dsimp [A]; exact card_blockAFin m calc (∑ j ∈ A, twoBlockGraph m a b i j) = ∑ j ∈ A, b / (m : ℝ) := by apply Finset.sum_congr rfl intro j hj have hj' : j.val < m := by simpa [A, blockAFin] using hj have hne : i ≠ j := by intro h exact hi (by simpa [h] using hj') have hnot : ¬ (i.val < m ↔ j.val < m) := by intro hiff exact hi (hiff.mpr hj') simp [twoBlockGraph, hne, hnot] _ = (m : ℝ) * (b / (m : ℝ)) := by rw [Finset.sum_const, nsmul_eq_mul, hAcard] have hB : (∑ j ∈ B, twoBlockGraph m a b i j) = ((m - 1 : ℕ) : ℝ) * (a / (m : ℝ)) := by have hiB : i ∈ B := by simpa [B, blockBFin] using hi have hBcard : B.card = m := by dsimp [B]; exact card_blockBFin m calc (∑ j ∈ B, twoBlockGraph m a b i j) = ∑ j ∈ B, if i = j then 0 else a / (m : ℝ) := by apply Finset.sum_congr rfl intro j hj have hj' : ¬ j.val < m := by simpa [B, blockBFin] using hj by_cases hij : i = j <;> simp [twoBlockGraph, hij, hi, hj'] _ = 0 + ((B.card - 1 : ℕ) : ℝ) * (a / (m : ℝ)) := sum_if_eq_else_self_real B 0 (a / (m : ℝ)) hiB _ = ((m - 1 : ℕ) : ℝ) * (a / (m : ℝ)) := by rw [hBcard] ring rw [hA, hB, hcast_m_sub_one] ring refine ⟨deg, -(a / (m : ℝ)), -(b / (m : ℝ)), ?_⟩ ext i j by_cases hij : i = j · subst j simp [twoBlockLaplacian, blockConstMat, hDegree] · by_cases hsame : i.val < m ↔ j.val < m · have hsameDec : decide (i.val < m) = decide (j.val < m) := by simp [decide_eq_decide, hsame] simp [twoBlockLaplacian, twoBlockGraph, blockConstMat, hij, hsame, hsameDec] · have hsameDec : decide (i.val < m) ≠ decide (j.val < m) := by intro h exact hsame (by simpa [decide_eq_decide] using h) simp [twoBlockLaplacian, twoBlockGraph, blockConstMat, hij, hsame, hsameDec]
CausalSmith.Experimentation.DesignPm1.twoBlockLaplacian_isBlockConst · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SymRedMatrix.lean:266
theorem twoBlockLaplacianPinv_isBlockConst

twoBlockLaplacianPinv is block-constant.

Formal statement
m :
a b :
hm :
2 ≤ m
∃ d w c, twoBlockLaplacianPinv m a b = blockConstMat m d w c
Proof (Lean source)
lemma twoBlockLaplacianPinv_isBlockConst (m : ℕ) (a b : ℝ) (hm : 2 ≤ m) : ∃ d w c, twoBlockLaplacianPinv m a b = blockConstMat m d w c := by refine ⟨(1 / (a + b)) * (1 - 1 / (2 * (m : ℝ)) - 1 / (2 * (m : ℝ))) + (1 / (2 * b)) * (1 / (2 * (m : ℝ))), (1 / (a + b)) * (0 - 1 / (2 * (m : ℝ)) - 1 / (2 * (m : ℝ))) + (1 / (2 * b)) * (1 / (2 * (m : ℝ))), (1 / (a + b)) * (0 - 1 / (2 * (m : ℝ)) - (-1 / (2 * (m : ℝ)))) + (1 / (2 * b)) * (-1 / (2 * (m : ℝ))), ?_⟩ ext i j by_cases hi : i.val < m <;> by_cases hj : j.val < m <;> by_cases hij : i = j <;> simp [twoBlockLaplacianPinv, blockConstMat, onesProj, signProj, signVec, Matrix.add_apply, Matrix.sub_apply, Matrix.smul_apply, Matrix.one_apply, hi, hj, hij]
CausalSmith.Experimentation.DesignPm1.twoBlockLaplacianPinv_isBlockConst · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SymRedMatrix.lean:381
theorem allOnesMatrix_isBlockConst

allOnesMatrix is block-constant G(1,1,1).

Formal statement
m :
Proof (Lean source)
lemma allOnesMatrix_isBlockConst (m : ℕ) : allOnesMatrix m = blockConstMat m 1 1 1 := by ext i j by_cases hij : i = j <;> by_cases hsame : decide (i.val < m) = decide (j.val < m) <;> simp [allOnesMatrix, blockConstMat, hij, hsame]
CausalSmith.Experimentation.DesignPm1.allOnesMatrix_isBlockConst · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SymRedMatrix.lean:395
theorem frobeniusNorm_symmetrize_le

Frobenius drop. Symmetrizing weakly decreases the Frobenius norm.

Formal statement
m :
hm :
2 ≤ m
X :
Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ
hSymm :
∀ i j, X i j = X j i
hdiag :
∀ i, X i i = 1
Proof (Lean source)
lemma frobeniusNorm_symmetrize_le (m : ℕ) (hm : 2 ≤ m) (X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) (hSymm : ∀ i j, X i j = X j i) (hdiag : ∀ i, X i i = 1) : frobeniusNorm (blockSymMatrix m (uOf m X) (vOf m X)) ≤ frobeniusNorm X := by let X2 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ := of fun i j => (X i j) ^ 2 have hX2symm : ∀ i j, X2 i j = X2 j i := by intro i j simp [X2, hSymm i j] have hradX : (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), (X i j) ^ 2) = 2 * (m : ℝ) + Ssame m X2 + Scross m X2 := by have ht := trace_blockConstMat_mul m 1 1 1 X2 hX2symm have hleft : trace (blockConstMat m 1 1 1 * X2) = ∑ i : Fin (2 * m), ∑ j : Fin (2 * m), X2 i j := by simp [trace, Matrix.mul_apply, blockConstMat] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ rw [hX2symm j i] have hdiag2 : (∑ i : Fin (2 * m), X2 i i) = 2 * (m : ℝ) := by simp [X2, hdiag] rw [hleft] at ht rw [hdiag2] at ht simpa [X2, one_mul] using ht have hradY : (∑ i : Fin (2 * m), ∑ j : Fin (2 * m), (blockSymMatrix m (uOf m X) (vOf m X) i j) ^ 2) = 2 * (m : ℝ) + NsameR m * (uOf m X) ^ 2 + NcrossR m * (vOf m X) ^ 2 := by simp [blockSymMatrix] have h' := block_pair_sum m (1 : ℝ) ((uOf m X) ^ 2) ((vOf m X) ^ 2) rw [h'] unfold NsameR NcrossR ring have hNsamePos : 0 < NsameR m := by unfold NsameR have hmpos : (0 : ℝ) < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by decide : 0 < 2) hm) have hmgt1 : (1 : ℝ) < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by decide : 1 < 2) hm) exact mul_pos (mul_pos (by norm_num) hmpos) (by linarith) have hNcrossPos : 0 < NcrossR m := by unfold NcrossR have hmpos : (0 : ℝ) < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by decide : 0 < 2) hm) exact mul_pos (mul_pos (by norm_num) hmpos) hmpos have hcardSameR : ((sameOffPairs m).card : ℝ) = NsameR m := by rw [card_sameOffPairs] unfold NsameR cases m <;> simp have hcardCrossR : ((crossPairs m).card : ℝ) = NcrossR m := by rw [card_crossPairs] unfold NcrossR norm_num have hsameAvg : NsameR m * (uOf m X) ^ 2 ≤ Ssame m X2 := by have hc := sq_sum_le_card_mul_sum_sq (s := sameOffPairs m) (f := fun p => X p.1 p.2) have hc' : (Ssame m X) ^ 2 ≤ NsameR m * Ssame m X2 := by simpa [Ssame, X2, hcardSameR] using hc unfold uOf have hNne : NsameR m ≠ 0 := ne_of_gt hNsamePos rw [show NsameR m * (Ssame m X / NsameR m) ^ 2 = (Ssame m X) ^ 2 / NsameR m by field_simp [hNne]] exact (div_le_iff₀ hNsamePos).mpr (by simpa [mul_comm] using hc') have hcrossAvg : NcrossR m * (vOf m X) ^ 2 ≤ Scross m X2 := by have hc := sq_sum_le_card_mul_sum_sq (s := crossPairs m) (f := fun p => X p.1 p.2) have hc' : (Scross m X) ^ 2 ≤ NcrossR m * Scross m X2 := by simpa [Scross, X2, hcardCrossR] using hc unfold vOf have hNne : NcrossR m ≠ 0 := ne_of_gt hNcrossPos rw [show NcrossR m * (Scross m X / NcrossR m) ^ 2 = (Scross m X) ^ 2 / NcrossR m by field_simp [hNne]] exact (div_le_iff₀ hNcrossPos).mpr (by simpa [mul_comm] using hc') unfold frobeniusNorm apply Real.sqrt_le_sqrt rw [hradY, hradX] nlinarith [hsameAvg, hcrossAvg]
CausalSmith.Experimentation.DesignPm1.frobeniusNorm_symmetrize_le · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SymRedMatrix.lean:402
theorem designObjective_le_of_blockSums

Unified objective comparison. If Y matches X on the block sums and has no larger Frobenius norm, then Y has no larger objective. Both the matrix-side and the design-side symmetrizations feed through this lemma.

Formal statement
m :
a b r kappa :
hHom :
hk :
0 ≤ kappa
X Y :
Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ
hXsym :
∀ i j, X i j = X j i
hYsym :
∀ i j, Y i j = Y j i
hXdiag :
∀ i, X i i = 1
hYdiag :
∀ i, Y i i = 1
hSs :
Ssame m Y = Ssame m X
hSc :
Scross m Y = Scross m X
hFrob :
designObjective m a b r kappa Y ≤ designObjective m a b r kappa X
Proof (Lean source)
lemma designObjective_le_of_blockSums (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 ≤ kappa) (X Y : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) (hXsym : ∀ i j, X i j = X j i) (hYsym : ∀ i j, Y i j = Y j i) (hXdiag : ∀ i, X i i = 1) (hYdiag : ∀ i, Y i i = 1) (hSs : Ssame m Y = Ssame m X) (hSc : Scross m Y = Scross m X) (hFrob : frobeniusNorm Y ≤ frobeniusNorm X) : designObjective m a b r kappa Y ≤ designObjective m a b r kappa X := by have hm : 2 ≤ m := hHom.1 have hTraceEq_of_block : ∀ M : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ, (∃ d w c, M = blockConstMat m d w c) → trace (M * Y) = trace (M * X) := by intro M hM rcases hM with ⟨d, w, c, rfl⟩ rw [trace_blockConstMat_mul m d w c Y hYsym, trace_blockConstMat_mul m d w c X hXsym] rw [diagSum_of_diag_one m Y hYdiag, diagSum_of_diag_one m X hXdiag, hSs, hSc] have hL := hTraceEq_of_block (twoBlockLaplacian m a b) (twoBlockLaplacian_isBlockConst m a b hm) have hPinv := hTraceEq_of_block (twoBlockLaplacianPinv m a b) (twoBlockLaplacianPinv_isBlockConst m a b hm) have hJ := hTraceEq_of_block (allOnesMatrix m) ⟨1, 1, 1, allOnesMatrix_isBlockConst m⟩ have hF : kappa * frobeniusNorm Y ≤ kappa * frobeniusNorm X := mul_le_mul_of_nonneg_left hFrob hk unfold designObjective rw [hL, hPinv, hJ] nlinarith
CausalSmith.Experimentation.DesignPm1.designObjective_le_of_blockSums · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SymRedMatrix.lean:475
theorem abs_entry_le_one

Off-diagonal entries of a PSD unit-diagonal matrix are bounded by 1.

Formal statement
m :
X :
Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ
hpsd :
X.PosSemidef
hdiag :
∀ i, X i i = 1
i j :
Fin (2 * m)
|X i j| ≤ 1
Proof (Lean source)
lemma abs_entry_le_one (m : ℕ) (X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) (hpsd : X.PosSemidef) (hdiag : ∀ i, X i i = 1) (i j : Fin (2 * m)) : |X i j| ≤ 1 := by by_cases hij : i = j · subst j simp [hdiag] · have hsym : X j i = X i j := by have h := hpsd.1.apply i j simpa using h let vm : Fin (2 * m) → ℝ := single i 1 - single j 1 have hmnonneg := hpsd.dotProduct_mulVec_nonneg vm have hmnonneg' : 0 ≤ vm ⬝ᵥ X.mulVec vm := by simpa using hmnonneg have hmcalc : vm ⬝ᵥ X.mulVec vm = 2 - 2 * X i j := by classical calc vm ⬝ᵥ X.mulVec vm = X i i - X i j - X j i + X j j := by simp only [vm] rw [Matrix.mulVec_sub] rw [dotProduct_sub, sub_dotProduct] simp [Matrix.mulVec_single, single_dotProduct] ring _ = 2 - 2 * X i j := by simp [hdiag, hsym] ring have hle : X i j ≤ 1 := by nlinarith [hmnonneg', hmcalc] let vp : Fin (2 * m) → ℝ := single i 1 + single j 1 have hpnonneg := hpsd.dotProduct_mulVec_nonneg vp have hpnonneg' : 0 ≤ vp ⬝ᵥ X.mulVec vp := by simpa using hpnonneg have hpcalc : vp ⬝ᵥ X.mulVec vp = 2 + 2 * X i j := by classical calc vp ⬝ᵥ X.mulVec vp = X i i + X i j + X j i + X j j := by simp only [vp] rw [Matrix.mulVec_add] rw [dotProduct_add, add_dotProduct] simp [Matrix.mulVec_single, single_dotProduct] ring _ = 2 + 2 * X i j := by simp [hdiag, hsym] ring have hge : -1 ≤ X i j := by nlinarith [hpnonneg', hpcalc] exact abs_le.mpr ⟨hge, hle⟩
theorem designObjective_bddBelow

Objective bounded below on the elliptope.

Formal statement
m :
a b r kappa :
hHom :
hk :
0 ≤ kappa
BddBelow (designObjective m a b r kappa '' { X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ | X.PosSemidef ∧ ∀ i, X i i = 1 })
Proof (Lean source)
lemma designObjective_bddBelow (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 ≤ kappa) : BddBelow (designObjective m a b r kappa '' { X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ | X.PosSemidef ∧ ∀ i, X i i = 1 }) := by have hm : 2 ≤ m := hHom.1 rcases twoBlockLaplacian_isBlockConst m a b hm with ⟨dL, wL, cL, hLmat⟩ rcases twoBlockLaplacianPinv_isBlockConst m a b hm with ⟨dP, wP, cP, hPmat⟩ let BL : ℝ := |dL| * (2 * (m : ℝ)) + |wL| * NsameR m + |cL| * NcrossR m let BP : ℝ := |dP| * (2 * (m : ℝ)) + |wP| * NsameR m + |cP| * NcrossR m let BJ : ℝ := (1 : ℝ) * (2 * (m : ℝ)) + (1 : ℝ) * NsameR m + (1 : ℝ) * NcrossR m refine ⟨-(BL + |r| * BP + BJ), ?_⟩ rintro y ⟨X, hX, rfl⟩ rcases hX with ⟨hpsd, hdiag⟩ have hSymm : ∀ i j, X i j = X j i := by intro i j have h := hpsd.1.apply j i simpa using h have hcardSameR : ((sameOffPairs m).card : ℝ) = NsameR m := by rw [card_sameOffPairs] unfold NsameR cases m <;> simp have hcardCrossR : ((crossPairs m).card : ℝ) = NcrossR m := by rw [card_crossPairs] unfold NcrossR norm_num have hAbsSame : |Ssame m X| ≤ NsameR m := by calc |Ssame m X| = |∑ p ∈ sameOffPairs m, X p.1 p.2| := rfl _ ≤ ∑ p ∈ sameOffPairs m, |X p.1 p.2| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ p ∈ sameOffPairs m, (1 : ℝ) := by gcongr with p hp exact abs_entry_le_one m X hpsd hdiag p.1 p.2 _ = NsameR m := by rw [Finset.sum_const, nsmul_eq_mul, hcardSameR] ring have hAbsCross : |Scross m X| ≤ NcrossR m := by calc |Scross m X| = |∑ p ∈ crossPairs m, X p.1 p.2| := rfl _ ≤ ∑ p ∈ crossPairs m, |X p.1 p.2| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ p ∈ crossPairs m, (1 : ℝ) := by gcongr with p hp exact abs_entry_le_one m X hpsd hdiag p.1 p.2 _ = NcrossR m := by rw [Finset.sum_const, nsmul_eq_mul, hcardCrossR] ring have hTraceAbs : ∀ d w c : ℝ, |trace (blockConstMat m d w c * X)| ≤ |d| * (2 * (m : ℝ)) + |w| * NsameR m + |c| * NcrossR m := by intro d w c rw [trace_blockConstMat_mul m d w c X hSymm, diagSum_of_diag_one m X hdiag] calc |d * (2 * (m : ℝ)) + w * Ssame m X + c * Scross m X| ≤ |d * (2 * (m : ℝ))| + |w * Ssame m X| + |c * Scross m X| := by calc |d * (2 * (m : ℝ)) + w * Ssame m X + c * Scross m X| ≤ |d * (2 * (m : ℝ)) + w * Ssame m X| + |c * Scross m X| := abs_add_le _ _ _ ≤ |d * (2 * (m : ℝ))| + |w * Ssame m X| + |c * Scross m X| := by nlinarith [abs_add_le (d * (2 * (m : ℝ))) (w * Ssame m X)] _ = |d| * |2 * (m : ℝ)| + |w| * |Ssame m X| + |c| * |Scross m X| := by rw [abs_mul (d) (2 * (m : ℝ)), abs_mul (w) (Ssame m X), abs_mul (c) (Scross m X)] _ ≤ |d| * (2 * (m : ℝ)) + |w| * NsameR m + |c| * NcrossR m := by have htwononneg : 0 ≤ 2 * (m : ℝ) := by positivity rw [abs_of_nonneg htwononneg] gcongr have hLAbs : |trace (twoBlockLaplacian m a b * X)| ≤ BL := by rw [hLmat] exact hTraceAbs dL wL cL have hPAbs : |trace (twoBlockLaplacianPinv m a b * X)| ≤ BP := by rw [hPmat] exact hTraceAbs dP wP cP have hJAbs : |trace (allOnesMatrix m * X)| ≤ BJ := by rw [allOnesMatrix_isBlockConst] simpa [BJ] using hTraceAbs 1 1 1 have hLlower : -BL ≤ trace (twoBlockLaplacian m a b * X) := (abs_le.mp hLAbs).1 have hPlower : -(|r| * BP) ≤ r * trace (twoBlockLaplacianPinv m a b * X) := by have hmulAbs : |r * trace (twoBlockLaplacianPinv m a b * X)| ≤ |r| * BP := by rw [abs_mul] gcongr exact (abs_le.mp hmulAbs).1 have hJlower : -BJ ≤ trace (allOnesMatrix m * X) := (abs_le.mp hJAbs).1 have hFrobNonneg : 0 ≤ kappa * frobeniusNorm X := by unfold frobeniusNorm exact mul_nonneg hk (Real.sqrt_nonneg _) unfold designObjective nlinarith
theorem sInf_image_reduce

Generic sInf reduction. If T ⊆ S, T is nonempty, f '' S is bounded below, and every point of S is dominated by some point of T, then the two infima of f over S and T coincide.

Formal statement
α :
Type*
f :
α → ℝ
S T :
Set α
hTS :
T ⊆ S
hTne :
T.Nonempty
hbdd :
BddBelow (f '' S)
hreduce :
∀ x ∈ S, ∃ y ∈ T, f y ≤ f x
sInf (f '' S) = sInf (f '' T)
Proof (Lean source)
lemma sInf_image_reduce {α : Type*} (f : α → ℝ) (S T : Set α) (hTS : T ⊆ S) (hTne : T.Nonempty) (hbdd : BddBelow (f '' S)) (hreduce : ∀ x ∈ S, ∃ y ∈ T, f y ≤ f x) : sInf (f '' S) = sInf (f '' T) := by have hSne : S.Nonempty := hTne.mono hTS have hTbdd : BddBelow (f '' T) := hbdd.mono (Set.image_mono hTS) apply le_antisymm · exact csInf_le_csInf hbdd (hTne.image f) (Set.image_mono hTS) · refine le_csInf (hSne.image f) ?_ intro z hz rcases hz with ⟨x, hxS, rfl⟩ rcases hreduce x hxS with ⟨y, hyT, hle⟩ exact le_trans (csInf_le hTbdd ⟨y, hyT, rfl⟩) hle
theorem blockElliptopeMem_symmetrize

Membership. The block averages of a PSD unit-diagonal X land in E_m^blk.

Formal statement
m :
a b :
hHom :
X :
Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ
hpsd :
X.PosSemidef
hdiag :
∀ i, X i i = 1
BlockElliptopeMem m a b (uOf m X) (vOf m X)
Proof (Lean source)
lemma blockElliptopeMem_symmetrize (m : ℕ) (a b : ℝ) (hHom : TwoBlockHomophily m a b) (X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) (hpsd : X.PosSemidef) (hdiag : ∀ i, X i i = 1) : BlockElliptopeMem m a b (uOf m X) (vOf m X) := by have hm : 2 ≤ m := hHom.1 have hSymm : ∀ i j, X i j = X j i := by intro i j have h := hpsd.1.apply j i simpa using h have hmpos : (0 : ℝ) < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by decide : 0 < 2) hm) have htwompos : 0 < 2 * (m : ℝ) := by positivity have hNsamePos : 0 < NsameR m := by unfold NsameR have hmgt1 : (1 : ℝ) < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by decide : 1 < 2) hm) exact mul_pos (mul_pos (by norm_num) hmpos) (by linarith) have hNcrossPos : 0 < NcrossR m := by unfold NcrossR exact mul_pos (mul_pos (by norm_num) hmpos) hmpos have hcardSameR : ((sameOffPairs m).card : ℝ) = NsameR m := by rw [card_sameOffPairs] unfold NsameR cases m <;> simp have hNsame_u : NsameR m * uOf m X = Ssame m X := by unfold uOf field_simp [ne_of_gt hNsamePos] have hNcross_v : NcrossR m * vOf m X = Scross m X := by unfold vOf field_simp [ne_of_gt hNcrossPos] refine ⟨hHom, ?_, ?_, ?_⟩ · have hentry : ∀ p ∈ sameOffPairs m, X p.1 p.2 ≤ 1 := by intro p hp exact (abs_le.mp (abs_entry_le_one m X hpsd hdiag p.1 p.2)).2 have hSle : Ssame m X ≤ NsameR m := by calc Ssame m X = ∑ p ∈ sameOffPairs m, X p.1 p.2 := rfl _ ≤ ∑ p ∈ sameOffPairs m, (1 : ℝ) := by gcongr with p hp exact hentry p hp _ = NsameR m := by rw [Finset.sum_const, nsmul_eq_mul, hcardSameR] ring have hu : uOf m X ≤ 1 := by unfold uOf exact (div_le_iff₀ hNsamePos).mpr (by simpa using hSle) linarith · let sv : Fin (2 * m) → ℝ := signVec m have hnonneg := hpsd.dotProduct_mulVec_nonneg sv have hnonneg' : 0 ≤ sv ⬝ᵥ X.mulVec sv := by simpa using hnonneg have hquad : sv ⬝ᵥ X.mulVec sv = 2 * (m : ℝ) + Ssame m X - Scross m X := by have htrace := trace_blockConstMat_mul m 1 1 (-1) X hSymm have hleft : trace (blockConstMat m 1 1 (-1) * X) = sv ⬝ᵥ X.mulVec sv := by simp [trace, Matrix.mul_apply, dotProduct, mulVec, blockConstMat, sv, signVec] apply Finset.sum_congr rfl intro i _ by_cases hi : i.val < m · simp [hi] apply Finset.sum_congr rfl intro j _ rw [hSymm j i] by_cases hij : i = j · subst j simp [hi] · by_cases hj : j.val < m <;> simp [hi, hj, hij] · simp [hi] rw [← Finset.sum_neg_distrib] apply Finset.sum_congr rfl intro j _ rw [hSymm j i] by_cases hij : i = j · subst j simp [hi] · by_cases hj : j.val < m <;> simp [hi, hj, hij] have hdiagSum := diagSum_of_diag_one m X hdiag rw [hleft] at htrace rw [hdiagSum] at htrace linarith have hyprod : 0 ≤ 2 * (m : ℝ) * (1 + ((m : ℝ) - 1) * uOf m X - (m : ℝ) * vOf m X) := by rw [show 2 * (m : ℝ) * (1 + ((m : ℝ) - 1) * uOf m X - (m : ℝ) * vOf m X) = 2 * (m : ℝ) + NsameR m * uOf m X - NcrossR m * vOf m X by unfold NsameR NcrossR ring] rw [hNsame_u, hNcross_v] simpa [hquad] using hnonneg' have hyprod' : 0 ≤ (1 + ((m : ℝ) - 1) * uOf m X - (m : ℝ) * vOf m X) * (2 * (m : ℝ)) := by simpa [mul_comm] using hyprod exact nonneg_of_mul_nonneg_left hyprod' htwompos · let ov : Fin (2 * m) → ℝ := fun _ => 1 have hnonneg := hpsd.dotProduct_mulVec_nonneg ov have hnonneg' : 0 ≤ ov ⬝ᵥ X.mulVec ov := by simpa using hnonneg have hquad : ov ⬝ᵥ X.mulVec ov = 2 * (m : ℝ) + Ssame m X + Scross m X := by have htrace := trace_blockConstMat_mul m 1 1 1 X hSymm have hleft : trace (blockConstMat m 1 1 1 * X) = ov ⬝ᵥ X.mulVec ov := by simp [trace, Matrix.mul_apply, dotProduct, mulVec, blockConstMat, ov] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ rw [hSymm j i] have hdiagSum := diagSum_of_diag_one m X hdiag rw [hleft] at htrace rw [hdiagSum] at htrace linarith have hzprod : 0 ≤ 2 * (m : ℝ) * (1 + ((m : ℝ) - 1) * uOf m X + (m : ℝ) * vOf m X) := by rw [show 2 * (m : ℝ) * (1 + ((m : ℝ) - 1) * uOf m X + (m : ℝ) * vOf m X) = 2 * (m : ℝ) + NsameR m * uOf m X + NcrossR m * vOf m X by unfold NsameR NcrossR ring] rw [hNsame_u, hNcross_v] simpa [hquad] using hnonneg' have hzprod' : 0 ≤ (1 + ((m : ℝ) - 1) * uOf m X + (m : ℝ) * vOf m X) * (2 * (m : ℝ)) := by simpa [mul_comm] using hzprod exact nonneg_of_mul_nonneg_left hzprod' htwompos
CausalSmith.Experimentation.DesignPm1.blockElliptopeMem_symmetrize · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SymRedMatrix.lean:658
theorem symmetrize_objective_le

Matrix-side symmetry reduction (master export). For PSD unit-diagonal X, the block-average point X(uOf X, vOf X) is an elliptope point with weakly smaller objective.

Formal statement
m :
a b r kappa :
hHom :
hk :
0 ≤ kappa
X :
Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ
hpsd :
X.PosSemidef
hdiag :
∀ i, X i i = 1
BlockElliptopeMem m a b (uOf m X) (vOf m X) ∧
designObjective m a b r kappa (blockSymMatrix m (uOf m X) (vOf m X))
designObjective m a b r kappa X
Proof (Lean source)
lemma symmetrize_objective_le (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hk : 0 ≤ kappa) (X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) (hpsd : X.PosSemidef) (hdiag : ∀ i, X i i = 1) : BlockElliptopeMem m a b (uOf m X) (vOf m X) ∧ designObjective m a b r kappa (blockSymMatrix m (uOf m X) (vOf m X)) ≤ designObjective m a b r kappa X := by have hm : 2 ≤ m := hHom.1 have hSymm : ∀ i j, X i j = X j i := by intro i j have h := hpsd.1.apply j i simpa using h have hblockSymm : ∀ i j, blockSymMatrix m (uOf m X) (vOf m X) i j = blockSymMatrix m (uOf m X) (vOf m X) j i := by intro i j simpa [blockSymMatrix_eq_blockConst] using blockConstMat_symm m 1 (uOf m X) (vOf m X) i j have hblockDiag : ∀ i, blockSymMatrix m (uOf m X) (vOf m X) i i = 1 := by intro i simp [blockSymMatrix] have hNsamePos : 0 < NsameR m := by unfold NsameR have hmpos : (0 : ℝ) < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by decide : 0 < 2) hm) have hmgt1 : (1 : ℝ) < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by decide : 1 < 2) hm) exact mul_pos (mul_pos (by norm_num) hmpos) (by linarith) have hNcrossPos : 0 < NcrossR m := by unfold NcrossR have hmpos : (0 : ℝ) < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by decide : 0 < 2) hm) exact mul_pos (mul_pos (by norm_num) hmpos) hmpos have hSs : Ssame m (blockSymMatrix m (uOf m X) (vOf m X)) = Ssame m X := by rw [Ssame_blockSym] unfold uOf field_simp [ne_of_gt hNsamePos] have hSc : Scross m (blockSymMatrix m (uOf m X) (vOf m X)) = Scross m X := by rw [Scross_blockSym] unfold vOf field_simp [ne_of_gt hNcrossPos] exact ⟨blockElliptopeMem_symmetrize m a b hHom X hpsd hdiag, designObjective_le_of_blockSums m a b r kappa hHom hk X (blockSymMatrix m (uOf m X) (vOf m X)) hSymm hblockSymm hdiag hblockDiag hSs hSc (frobeniusNorm_symmetrize_le m hm X hSymm hdiag)⟩
Helpers.SymRedPSD 6 declarations The block-symmetric matrix X(u,v) has the orthogonal eigendecomposition X(u,v) = x • (1 − P₁ − P_s) + y • P_s + z • P₁, with x = 1−u, y = 1+(m−1)u−mv, z = 1+(m−1)u+mv, where P₁ = J/2m (projection onto span 1) and P_s = s

PSD of block-symmetric elliptope points

The block-symmetric matrix X(u,v) has the orthogonal eigendecomposition

X(u,v) = x • (1 − P₁ − P_s) + y • P_s + z • P₁,

with x = 1−u, y = 1+(m−1)u−mv, z = 1+(m−1)u+mv, where P₁ = J/2m (projection onto span 1) and P_s = s sᵀ/2m (projection onto span s). Each of P₁, P_s, 1 − P₁ − P_s is PSD, so nonnegative spectral coordinates force X(u,v) PSD. This supplies the inclusion E_m^blk ⊆ {PSD, diag 1} used by the sInf reductions.

theorem onesProj_posSemidef

The quadratic form of X(u,v) on a vector w: wᵀ X(u,v) w = x·(Q − P²/2m − D²/2m) + y·(D²/2m) + z·(P²/2m) with Q = ∑ wᵢ², P = ∑ wᵢ, D = ∑ sᵢ wᵢ.

Formal statement
m :
Proof (Lean source)
lemma onesProj_posSemidef (m : ℕ) : (onesProj m).PosSemidef := by classical refine Matrix.PosSemidef.of_dotProduct_mulVec_nonneg ?_ ?_ · exact Matrix.IsHermitian.ext fun i j => by simp [onesProj] · intro x by_cases hm0 : m = 0 · subst m simp [dotProduct] · have hquad : dotProduct x ((onesProj m).mulVec x) = (1 / (2 * (m : ℝ))) * (∑ i, x i) ^ 2 := by simp [dotProduct, mulVec, onesProj, Finset.mul_sum, Finset.sum_mul, sq, mul_assoc, mul_left_comm, mul_comm] simpa [hquad] using mul_nonneg (by positivity) (sq_nonneg (∑ i, x i))
theorem signProj_posSemidef

signProj = s sᵀ / 2m is PSD.

Formal statement
m :
Proof (Lean source)
lemma signProj_posSemidef (m : ℕ) : (signProj m).PosSemidef := by classical refine Matrix.PosSemidef.of_dotProduct_mulVec_nonneg ?_ ?_ · exact Matrix.IsHermitian.ext fun i j => by simp [signProj, mul_comm, mul_left_comm, mul_assoc] · intro x by_cases hm0 : m = 0 · subst m simp [dotProduct] · have hquad : dotProduct x ((signProj m).mulVec x) = (1 / (2 * (m : ℝ))) * (∑ i, signVec m i * x i) ^ 2 := by simp [dotProduct, mulVec, signProj, Finset.mul_sum, Finset.sum_mul, sq, mul_assoc, mul_left_comm, mul_comm] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ ring simpa [hquad] using mul_nonneg (by positivity) (sq_nonneg (∑ i, signVec m i * x i))
theorem projComplement_posSemidef

The complementary projection 1 − P₁ − P_s is PSD.

Formal statement
m :
hm :
2 ≤ m
((1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) - onesProj m - signProj m).PosSemidef
Proof (Lean source)
lemma projComplement_posSemidef (m : ℕ) (hm : 2 ≤ m) : ((1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) - onesProj m - signProj m).PosSemidef := by classical refine Matrix.PosSemidef.of_dotProduct_mulVec_nonneg ?_ ?_ · exact ((Matrix.isHermitian_one.sub (onesProj_posSemidef m).1).sub (signProj_posSemidef m).1) · intro x change 0 ≤ dotProduct x (((1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) - onesProj m - signProj m).mulVec x) let A : ℝ := ∑ i ∈ blockAFin m, x i let B : ℝ := ∑ i ∈ blockBFin m, x i let QA : ℝ := ∑ i ∈ blockAFin m, x i ^ 2 let QB : ℝ := ∑ i ∈ blockBFin m, x i ^ 2 have hmposR : (0 : ℝ) < (m : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by decide : 0 < 2) hm) have hm0 : (m : ℝ) ≠ 0 := ne_of_gt hmposR have hP1 : dotProduct x ((onesProj m).mulVec x) = (1 / (2 * (m : ℝ))) * (∑ i, x i) ^ 2 := by simp [dotProduct, mulVec, onesProj, Finset.mul_sum, Finset.sum_mul, sq, mul_assoc, mul_left_comm, mul_comm] have hPs : dotProduct x ((signProj m).mulVec x) = (1 / (2 * (m : ℝ))) * (∑ i, signVec m i * x i) ^ 2 := by simp [dotProduct, mulVec, signProj, Finset.mul_sum, Finset.sum_mul, sq, mul_assoc, mul_left_comm, mul_comm] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ ring have hSelf : dotProduct x x = ∑ i, x i ^ 2 := by simp [dotProduct, pow_two] have hsumx : (∑ i, x i) = A + B := by dsimp [A, B, blockAFin, blockBFin] rw [← Finset.sum_filter_add_sum_filter_not (s := univ) (p := fun i : Fin (2 * m) => i.val < m) (f := fun i => x i)] have hsumq : (∑ i, x i ^ 2) = QA + QB := by dsimp [QA, QB, blockAFin, blockBFin] rw [← Finset.sum_filter_add_sum_filter_not (s := univ) (p := fun i : Fin (2 * m) => i.val < m) (f := fun i => x i ^ 2)] have hsumd : (∑ i, signVec m i * x i) = A - B := by have hA : (∑ i ∈ blockAFin m, signVec m i * x i) = A := by dsimp [A] apply Finset.sum_congr rfl intro i hi have hi' : i.val < m := by simpa [blockAFin] using hi simp [signVec, hi'] have hB : (∑ i ∈ blockBFin m, signVec m i * x i) = -B := by dsimp [B] rw [← Finset.sum_neg_distrib] apply Finset.sum_congr rfl intro i hi have hi' : ¬ i.val < m := by simpa [blockBFin] using hi simp [signVec, hi'] calc (∑ i, signVec m i * x i) = (∑ i ∈ blockAFin m, signVec m i * x i) + (∑ i ∈ blockBFin m, signVec m i * x i) := by dsimp [blockAFin, blockBFin] rw [← Finset.sum_filter_add_sum_filter_not (s := univ) (p := fun i : Fin (2 * m) => i.val < m) (f := fun i => signVec m i * x i)] _ = A - B := by rw [hA, hB] ring have hquad : dotProduct x (((1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) - onesProj m - signProj m).mulVec x) = (QA + QB) - (1 / (2 * (m : ℝ))) * (A + B) ^ 2 - (1 / (2 * (m : ℝ))) * (A - B) ^ 2 := by rw [Matrix.sub_mulVec, Matrix.sub_mulVec, Matrix.one_mulVec] rw [dotProduct_sub, dotProduct_sub, hSelf, hP1, hPs, hsumx, hsumd, hsumq] have hAcs : A ^ 2 ≤ (m : ℝ) * QA := by dsimp [A, QA] simpa [card_blockAFin] using (sq_sum_le_card_mul_sum_sq (s := blockAFin m) (f := fun i => x i)) have hBcs : B ^ 2 ≤ (m : ℝ) * QB := by dsimp [B, QB] simpa [card_blockBFin] using (sq_sum_le_card_mul_sum_sq (s := blockBFin m) (f := fun i => x i)) have hmain : 0 ≤ (QA + QB) - (1 / (2 * (m : ℝ))) * (A + B) ^ 2 - (1 / (2 * (m : ℝ))) * (A - B) ^ 2 := by have hle : (A ^ 2 + B ^ 2) / (m : ℝ) ≤ QA + QB := by rw [div_le_iff₀ hmposR] nlinarith [hAcs, hBcs] have halg : (1 / (2 * (m : ℝ))) * (A + B) ^ 2 + (1 / (2 * (m : ℝ))) * (A - B) ^ 2 = (A ^ 2 + B ^ 2) / (m : ℝ) := by field_simp [hm0] ring nlinarith simpa [hquad] using hmain
CausalSmith.Experimentation.DesignPm1.projComplement_posSemidef · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SymRedPSD.lean:66
theorem blockSymMatrix_decomp

Spectral decomposition of the block-symmetric matrix.

Formal statement
m :
u v :
= (1 - u) • ((1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) - onesProj m - signProj m)
+ (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) • signProj m
+ (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) • onesProj m
Proof (Lean source)
lemma blockSymMatrix_decomp (m : ℕ) (u v : ℝ) : blockSymMatrix m u v = (1 - u) • ((1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) - onesProj m - signProj m) + (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) • signProj m + (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) • onesProj m := by classical rcases Nat.eq_zero_or_pos m with rfl | hmpos · ext i exact Fin.elim0 i · have hm0 : (m : ℝ) ≠ 0 := by exact_mod_cast (ne_of_gt hmpos) ext i j by_cases hij : i = j · subst j by_cases hi : i.val < m · simp [blockSymMatrix, onesProj, signProj, signVec, hi, hm0, smul_eq_mul] field_simp [hm0] ring · simp [blockSymMatrix, onesProj, signProj, signVec, hi, hm0, smul_eq_mul] field_simp [hm0] ring · by_cases hi : i.val < m <;> by_cases hj : j.val < m · simp [blockSymMatrix, onesProj, signProj, signVec, Matrix.one_apply, hij, hi, hj, hm0, smul_eq_mul] field_simp [hm0] ring · simp [blockSymMatrix, onesProj, signProj, signVec, Matrix.one_apply, hij, hi, hj, hm0, smul_eq_mul] field_simp [hm0] ring · simp [blockSymMatrix, onesProj, signProj, signVec, Matrix.one_apply, hij, hi, hj, hm0, smul_eq_mul] field_simp [hm0] ring · simp [blockSymMatrix, onesProj, signProj, signVec, Matrix.one_apply, hij, hi, hj, hm0, smul_eq_mul] field_simp [hm0] ring
theorem blockSymMatrix_posSemidef

PSD from nonnegative spectral coordinates.

Formal statement
m :
u v :
hm :
2 ≤ m
hx :
0 ≤ 1 - u
hy :
0 ≤ 1 + ((m : ℝ) - 1) * u - (m : ℝ) * v
hz :
0 ≤ 1 + ((m : ℝ) - 1) * u + (m : ℝ) * v
Proof (Lean source)
lemma blockSymMatrix_posSemidef (m : ℕ) (u v : ℝ) (hm : 2 ≤ m) (hx : 0 ≤ 1 - u) (hy : 0 ≤ 1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (hz : 0 ≤ 1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) : (blockSymMatrix m u v).PosSemidef := by rw [blockSymMatrix_decomp] exact (((projComplement_posSemidef m hm).smul hx).add ((signProj_posSemidef m).smul hy)).add ((onesProj_posSemidef m).smul hz)
CausalSmith.Experimentation.DesignPm1.blockSymMatrix_posSemidef · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SymRedPSD.lean:203
theorem blockElliptope_subset_elliptope

Block-symmetric elliptope points are PSD with unit diagonal: E_m^blk ⊆ {X : PSD ∧ diag 1}.

Formal statement
m :
a b :
blockElliptope m a b ⊆ { X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ | X.PosSemidef ∧ ∀ i, X i i = 1 }
Proof (Lean source)
lemma blockElliptope_subset_elliptope (m : ℕ) (a b : ℝ) : blockElliptope m a b ⊆ { X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ | X.PosSemidef ∧ ∀ i, X i i = 1 } := by intro X hX obtain ⟨u, v, rfl, hmem⟩ := hX exact ⟨blockSymMatrix_posSemidef m u v hmem.homophily.1 hmem.psd_x hmem.psd_y hmem.psd_z, fun i => by simp [blockSymMatrix]⟩
CausalSmith.Experimentation.DesignPm1.blockElliptope_subset_elliptope · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Helpers/SymRedPSD.lean:213
Helpers.SymmetryReduction 1 declarations Orbit-averaging over the finite group H generated by within-A_m, within-B_m permutations and the community swap: convexity of the PSD cone, H-invariance of L_m, L_m^†, J_n, and orthogonal-invariance/convexity of the Frob

Symmetry reduction (orbit averaging over the two-block automorphism group)

Orbit-averaging over the finite group H generated by within-A_m, within-B_m permutations and the community swap: convexity of the PSD cone, H-invariance of L_m, L_m^†, J_n, and orthogonal-invariance/convexity of the Frobenius norm give a no-worse H-symmetrized point/law. Hence the relaxed and implementable infima are attained on the block-symmetric slices.

theorem symmetry_reduction Proposition 1 in the paper ↗

Symmetry reduction. The orbit-average over the full two-block automorphism group (permutations within A_m, within B_m, and the community swap) is the explicit, named no-worse witness — not merely some existing block-symmetric point (the note's load-bearing clauses):

Formal statement
m :
a b r kappa :
hHom :
hr0 :
0 ≤ r
hk :
0 ≤ kappa
(∀ X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ, X.PosSemidef → (∀ i, X i i = 1) → BlockElliptopeMem m a b (uOf m X) (vOf m X) ∧ designObjective m a b r kappa (blockSymMatrix m (uOf m X) (vOf m X)) ≤ designObjective m a b r kappa X) ∧
(∀ D : FiniteDesign (Fin (2 * m) → Bool), BalancedDesignClass m D → orbitAvgDesign m D ∈ blockExchangeableDesignClass m ∧ (∀ i, (orbitAvgDesign m D).E (fun z => signOf m z i) = 0) ∧ designObjective m a b r kappa (assignmentSecondMoment m (orbitAvgDesign m D)) ≤ designObjective m a b r kappa (assignmentSecondMoment m D)) ∧
sInf (designObjective m a b r kappa '' { X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ | X.PosSemidef ∧ ∀ i, X i i = 1 })
= sInf (designObjective m a b r kappa '' blockElliptope m a b) ∧
sInf ((fun D => designObjective m a b r kappa (assignmentSecondMoment m D)) '' { D | BalancedDesignClass m D })
Proof (Lean source)
lemma symmetry_reduction (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hr0 : 0 ≤ r) (hk : 0 ≤ kappa) : (∀ X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ, X.PosSemidef → (∀ i, X i i = 1) → BlockElliptopeMem m a b (uOf m X) (vOf m X) ∧ designObjective m a b r kappa (blockSymMatrix m (uOf m X) (vOf m X)) ≤ designObjective m a b r kappa X) ∧ (∀ D : FiniteDesign (Fin (2 * m) → Bool), BalancedDesignClass m D → orbitAvgDesign m D ∈ blockExchangeableDesignClass m ∧ (∀ i, (orbitAvgDesign m D).E (fun z => signOf m z i) = 0) ∧ designObjective m a b r kappa (assignmentSecondMoment m (orbitAvgDesign m D)) ≤ designObjective m a b r kappa (assignmentSecondMoment m D)) ∧ sInf (designObjective m a b r kappa '' { X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ | X.PosSemidef ∧ ∀ i, X i i = 1 }) = sInf (designObjective m a b r kappa '' blockElliptope m a b) ∧ sInf ((fun D => designObjective m a b r kappa (assignmentSecondMoment m D)) '' { D | BalancedDesignClass m D }) = sInf ((fun D => designObjective m a b r kappa (assignmentSecondMoment m D)) '' blockExchangeableDesignClass m) := by refine ⟨?_, ?_, ?_, ?_⟩ · -- Conjunct 1: matrix-side symmetrization — witness is the orbit average `(uOf, vOf)`. intro X hpsd hdiag exact symmetrize_objective_le m a b r kappa hHom hk X hpsd hdiag · -- Conjunct 2: design-side symmetrization — witness is `orbitAvgDesign m D`. intro D hD exact design_symmetrize m a b r kappa hHom hk D hD · -- Conjunct 3: relaxed inf = block-symmetric-slice inf. refine sInf_image_reduce (designObjective m a b r kappa) { X : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ | X.PosSemidef ∧ ∀ i, X i i = 1 } (blockElliptope m a b) (blockElliptope_subset_elliptope m a b) ?_ (designObjective_bddBelow m a b r kappa hHom hk) ?_ · exact ⟨blockSymMatrix m 0 0, 0, 0, rfl, ⟨hHom, by norm_num, by norm_num, by norm_num⟩⟩ · intro X hX obtain ⟨hpsd, hdiag⟩ := hX obtain ⟨hmem, hle⟩ := symmetrize_objective_le m a b r kappa hHom hk X hpsd hdiag exact ⟨blockSymMatrix m (uOf m X) (vOf m X), ⟨uOf m X, vOf m X, rfl, hmem⟩, hle⟩ · -- Conjunct 4: implementable inf = symmetry-reduced inf. refine sInf_image_reduce (fun D => designObjective m a b r kappa (assignmentSecondMoment m D)) { D | BalancedDesignClass m D } (blockExchangeableDesignClass m) (fun D hD => hD.1) ⟨iidDesign m, iidDesign_mem_blockExchangeable m⟩ ?_ ?_ · -- Bounded below: second moments are PSD unit-diagonal, so land in the elliptope. refine BddBelow.mono ?_ (designObjective_bddBelow m a b r kappa hHom hk) rintro _ ⟨D, _, rfl⟩ exact ⟨assignmentSecondMoment m D, ⟨assignmentSecondMoment_posSemidef m D, assignmentSecondMoment_diag m D⟩, rfl⟩ · intro D hD obtain ⟨hmem, _, hle⟩ := design_symmetrize m a b r kappa hHom hk D hD exact ⟨orbitAvgDesign m D, hmem, hle⟩
Helpers.VertexCertificates 3 declarations Three elementary linear-plus-weighted-Frobenius optimality certificates over T_m: the cut vertex (0,2m,0), the spread vertex (2m/q,0,0), and the Frobenius center (1,1,1).

Vertex certificates on the reduced triangle

Three elementary linear-plus-weighted-Frobenius optimality certificates over T_m: the cut vertex (0,2m,0), the spread vertex (2m/q,0,0), and the Frobenius center (1,1,1). The 0 < qParam m side-condition is the non-degeneracy m ≥ 2 regularity premise.

Cut-vertex certificate: on T_m, if κ ≥ 0, c_x/q > c_y + κ and c_z > c_y + κ then (0, 2m, 0) is the unique minimizer of φ.

Formal statement
m :
cx cy cz kappa :
hq :
0 < qParam m
hk :
0 ≤ kappa
h1 :
cx / qParam m > cy + kappa
h2 :
cz > cy + kappa
InReducedTriangle m 0 (2 * (m : ℝ)) 0 ∧
∀ x y z,
InReducedTriangle m x y z → (x, y, z)
≠ (0, 2 * (m : ℝ), 0) → reducedObjective (qParam m) cx cy cz kappa 0 (2 * (m : ℝ)) 0 < reducedObjective (qParam m) cx cy cz kappa x y z
Proof (Lean source)
lemma cut_vertex_certificate (m : ℕ) (cx cy cz kappa : ℝ) (hq : 0 < qParam m) (hk : 0 ≤ kappa) (h1 : cx / qParam m > cy + kappa) (h2 : cz > cy + kappa) : InReducedTriangle m 0 (2 * (m : ℝ)) 0 ∧ ∀ x y z, InReducedTriangle m x y z → (x, y, z) ≠ (0, 2 * (m : ℝ), 0) → reducedObjective (qParam m) cx cy cz kappa 0 (2 * (m : ℝ)) 0 < reducedObjective (qParam m) cx cy cz kappa x y z := by let q := qParam m let M : ℝ := 2 * (m : ℝ) constructor · unfold InReducedTriangle constructor · norm_num constructor · positivity constructor · norm_num · ring · intro x y z hT hneq rcases hT with ⟨hx, _hy, hz, hsum⟩ have hsumq : q * x + y + z = M := by simpa [q, M] using hsum have hq0 : 0 ≤ q := le_of_lt hq have hnorm_sq : y ^ 2 ≤ q * x ^ 2 + y ^ 2 + z ^ 2 := by have hx2 : 0 ≤ q * x ^ 2 := mul_nonneg hq0 (sq_nonneg x) have hz2 : 0 ≤ z ^ 2 := sq_nonneg z nlinarith have hnorm : y ≤ sqrt (q * x ^ 2 + y ^ 2 + z ^ 2) := Real.le_sqrt_of_sq_le hnorm_sq have hknorm : kappa * y ≤ kappa * sqrt (q * x ^ 2 + y ^ 2 + z ^ 2) := mul_le_mul_of_nonneg_left hnorm hk have hcxmul : (cx / q) * q = cx := by exact div_mul_cancel₀ cx (ne_of_gt hq) have hcoefx : 0 < cx - q * cy - q * kappa := by have hmul := mul_lt_mul_of_pos_right h1 hq nlinarith [hcxmul] have hcoefz : 0 < cz - cy - kappa := by nlinarith [h2] have hxz : x ≠ 0 ∨ z ≠ 0 := by by_contra hnot push_neg at hnot have hyM : y = M := by nlinarith [hsumq, hnot.1, hnot.2] apply hneq ext <;> simp [hnot.1, hnot.2, hyM, M] have hposcombo : 0 < (cx - q * cy - q * kappa) * x + (cz - cy - kappa) * z := by rcases hxz with hxne | hzne · have hxpos : 0 < x := lt_of_le_of_ne hx (Ne.symm hxne) have hleft : 0 < (cx - q * cy - q * kappa) * x := mul_pos hcoefx hxpos have hright : 0 ≤ (cz - cy - kappa) * z := mul_nonneg (le_of_lt hcoefz) hz nlinarith · have hzpos : 0 < z := lt_of_le_of_ne hz (Ne.symm hzne) have hleft : 0 ≤ (cx - q * cy - q * kappa) * x := mul_nonneg (le_of_lt hcoefx) hx have hright : 0 < (cz - cy - kappa) * z := mul_pos hcoefz hzpos nlinarith have hdiff_eq : (cx * x + cy * y + cz * z + kappa * y) - (cy * M + kappa * M) = (cx - q * cy - q * kappa) * x + (cz - cy - kappa) * z := by have hMexpr : M = q * x + y + z := by linarith [hsumq] rw [hMexpr] ring have hlinear : cy * M + kappa * M < cx * x + cy * y + cz * z + kappa * y := by nlinarith [hposcombo, hdiff_eq] have hobjLower : cx * x + cy * y + cz * z + kappa * y ≤ reducedObjective q cx cy cz kappa x y z := by unfold reducedObjective nlinarith [hknorm] calc reducedObjective (qParam m) cx cy cz kappa 0 (2 * (m : ℝ)) 0 = cy * M + kappa * M := by simp [reducedObjective, M] _ < cx * x + cy * y + cz * z + kappa * y := hlinear _ ≤ reducedObjective q cx cy cz kappa x y z := hobjLower _ = reducedObjective (qParam m) cx cy cz kappa x y z := by rfl
theorem spreadObjectiveDiff_mul_sqrt Lemma spreadObjectiveDiff_mul_sqrt in the paper ↗

Algebraic difference identity used by the spread-vertex certificate after multiplying through by sqrt q.

Formal statement
cx cy cz kappa x y z M q s :
hs :
s ≠ 0
hsq :
s * s = q
hM :
M = q * x + y + z
((cx * x + cy * y + cz * z + kappa * (s * x)) - (cx * (M / q) + kappa * (s * (M / q)))) * s
= ((cy - cx / q) * s - kappa) * y + ((cz - cx / q) * s - kappa) * z
Proof (Lean source)
lemma spreadObjectiveDiff_mul_sqrt (cx cy cz kappa x y z M q s : ℝ) (hs : s ≠ 0) (hsq : s * s = q) (hM : M = q * x + y + z) : ((cx * x + cy * y + cz * z + kappa * (s * x)) - (cx * (M / q) + kappa * (s * (M / q)))) * s = ((cy - cx / q) * s - kappa) * y + ((cz - cx / q) * s - kappa) * z := by rw [hM] rw [← hsq] field_simp [hs] ring

Spread-vertex certificate: on T_m, if κ ≥ 0, c_y > c_x/q + κ/√q and c_z > c_x/q + κ/√q then (2m/q, 0, 0) is the unique minimizer of φ.

Formal statement
m :
cx cy cz kappa :
hq :
0 < qParam m
hk :
0 ≤ kappa
h1 :
cy > cx / qParam m + kappa / sqrt (qParam m)
h2 :
cz > cx / qParam m + kappa / sqrt (qParam m)
InReducedTriangle m (2 * (m : ℝ) / qParam m) 0 0 ∧
∀ x y z,
InReducedTriangle m x y z → (x, y, z)
≠ (2 * (m : ℝ) / qParam m, 0, 0) → reducedObjective (qParam m) cx cy cz kappa (2 * (m : ℝ) / qParam m) 0 0 < reducedObjective (qParam m) cx cy cz kappa x y z
Proof (Lean source)
lemma spread_vertex_certificate (m : ℕ) (cx cy cz kappa : ℝ) (hq : 0 < qParam m) (hk : 0 ≤ kappa) (h1 : cy > cx / qParam m + kappa / Real.sqrt (qParam m)) (h2 : cz > cx / qParam m + kappa / Real.sqrt (qParam m)) : InReducedTriangle m (2 * (m : ℝ) / qParam m) 0 0 ∧ ∀ x y z, InReducedTriangle m x y z → (x, y, z) ≠ (2 * (m : ℝ) / qParam m, 0, 0) → reducedObjective (qParam m) cx cy cz kappa (2 * (m : ℝ) / qParam m) 0 0 < reducedObjective (qParam m) cx cy cz kappa x y z := by let q := qParam m let M : ℝ := 2 * (m : ℝ) let s := Real.sqrt q have hM0 : 0 ≤ M := by positivity have hq0 : 0 ≤ q := le_of_lt hq have hspos : 0 < s := by simpa [s] using Real.sqrt_pos.2 hq have hs0 : 0 ≤ s := le_of_lt hspos have hsq : s ^ 2 = q := by simpa [s] using Real.sq_sqrt hq0 have hsq_mul : s * s = q := by nlinarith [hsq] constructor · unfold InReducedTriangle constructor · exact div_nonneg hM0 hq0 constructor · norm_num constructor · norm_num · field_simp [q, M, ne_of_gt hq] ring_nf · intro x y z hT hneq rcases hT with ⟨hx, hy, hz, hsum⟩ have hsumq : q * x + y + z = M := by simpa [q, M] using hsum have hsx_sq_le : (s * x) ^ 2 ≤ q * x ^ 2 + y ^ 2 + z ^ 2 := by have hy2 : 0 ≤ y ^ 2 := sq_nonneg y have hz2 : 0 ≤ z ^ 2 := sq_nonneg z nlinarith [hsq] have hnorm : s * x ≤ Real.sqrt (q * x ^ 2 + y ^ 2 + z ^ 2) := Real.le_sqrt_of_sq_le hsx_sq_le have hknorm : kappa * (s * x) ≤ kappa * Real.sqrt (q * x ^ 2 + y ^ 2 + z ^ 2) := mul_le_mul_of_nonneg_left hnorm hk have hspreadNorm : Real.sqrt (q * (M / q) ^ 2 + 0 ^ 2 + 0 ^ 2) = s * (M / q) := by have hMq0 : 0 ≤ M / q := div_nonneg hM0 hq0 calc Real.sqrt (q * (M / q) ^ 2 + 0 ^ 2 + 0 ^ 2) = Real.sqrt ((s * (M / q)) ^ 2) := by rw [← hsq_mul] ring_nf _ = s * (M / q) := Real.sqrt_sq (mul_nonneg hs0 hMq0) have hcoefyS : 0 < (cy - cx / q) * s - kappa := by have h1' : cx / q + kappa / s < cy := by simpa [q, s] using h1 have hmul := mul_lt_mul_of_pos_right h1' hspos have hkdiv : (kappa / s) * s = kappa := div_mul_cancel₀ kappa (ne_of_gt hspos) nlinarith [hmul, hkdiv] have hcoefzS : 0 < (cz - cx / q) * s - kappa := by have h2' : cx / q + kappa / s < cz := by simpa [q, s] using h2 have hmul := mul_lt_mul_of_pos_right h2' hspos have hkdiv : (kappa / s) * s = kappa := div_mul_cancel₀ kappa (ne_of_gt hspos) nlinarith [hmul, hkdiv] have hyz : y ≠ 0 ∨ z ≠ 0 := by by_contra hnot push_neg at hnot have hxM : x = M / q := by have hqx : x * q = M := by nlinarith [hsumq, hnot.1, hnot.2] exact eq_div_of_mul_eq (ne_of_gt hq) hqx apply hneq ext <;> simp [hxM, hnot.1, hnot.2, q, M] have hposcomboS : 0 < ((cy - cx / q) * s - kappa) * y + ((cz - cx / q) * s - kappa) * z := by rcases hyz with hyne | hzne · have hypos : 0 < y := lt_of_le_of_ne hy (Ne.symm hyne) have hleft : 0 < ((cy - cx / q) * s - kappa) * y := mul_pos hcoefyS hypos have hright : 0 ≤ ((cz - cx / q) * s - kappa) * z := mul_nonneg (le_of_lt hcoefzS) hz nlinarith · have hzpos : 0 < z := lt_of_le_of_ne hz (Ne.symm hzne) have hleft : 0 ≤ ((cy - cx / q) * s - kappa) * y := mul_nonneg (le_of_lt hcoefyS) hy have hright : 0 < ((cz - cx / q) * s - kappa) * z := mul_pos hcoefzS hzpos nlinarith have hdiff_eq : ((cx * x + cy * y + cz * z + kappa * (s * x)) - (cx * (M / q) + kappa * (s * (M / q)))) * s = ((cy - cx / q) * s - kappa) * y + ((cz - cx / q) * s - kappa) * z := spreadObjectiveDiff_mul_sqrt cx cy cz kappa x y z M q s (ne_of_gt hspos) hsq_mul (by linarith [hsumq]) have hlinear : cx * (M / q) + kappa * (s * (M / q)) < cx * x + cy * y + cz * z + kappa * (s * x) := by have hdiffpos : 0 < ((cx * x + cy * y + cz * z + kappa * (s * x)) - (cx * (M / q) + kappa * (s * (M / q)))) * s := by simpa [hdiff_eq] using hposcomboS have hdiff_pos : 0 < (cx * x + cy * y + cz * z + kappa * (s * x)) - (cx * (M / q) + kappa * (s * (M / q))) := (mul_pos_iff_of_pos_right hspos).mp hdiffpos linarith have hobjLower : cx * x + cy * y + cz * z + kappa * (s * x) ≤ reducedObjective q cx cy cz kappa x y z := by unfold reducedObjective linarith [hknorm] have hobjSpread : reducedObjective (qParam m) cx cy cz kappa (2 * (m : ℝ) / qParam m) 0 0 = cx * (M / q) + kappa * (s * (M / q)) := by change cx * (M / q) + cy * 0 + cz * 0 + kappa * Real.sqrt (q * (M / q) ^ 2 + 0 ^ 2 + 0 ^ 2) = cx * (M / q) + kappa * (s * (M / q)) rw [hspreadNorm] ring calc reducedObjective (qParam m) cx cy cz kappa (2 * (m : ℝ) / qParam m) 0 0 = cx * (M / q) + kappa * (s * (M / q)) := hobjSpread _ < cx * x + cy * y + cz * z + kappa * (s * x) := hlinear _ ≤ reducedObjective q cx cy cz kappa x y z := hobjLower _ = reducedObjective (qParam m) cx cy cz kappa x y z := by rfl
Tcut 5 declarations For 0 ≤ r < r_cut, X_cut = s_m s_mᵀ is the unique minimizer of F over E_m^blk, the implementability gap vanishes, and the cut design P_cut ∈ P_m^sym attains the implementable optimum.

Sharp cut-corner exactness (thm:cut-corner-exactness)

For 0 ≤ r < r_cut, X_cut = s_m s_mᵀ is the unique minimizer of F over E_m^blk, the implementability gap vanishes, and the cut design P_cut ∈ P_m^sym attains the implementable optimum.

theorem cutDesign_eq_cutVDesign Lemma cutDesign_eq_cutVDesign in the paper ↗

The core cutDesign is the same two-point law as the vertex-design helper.

Formal statement
m :
Proof (Lean source)
lemma cutDesign_eq_cutVDesign (m : ℕ) : cutDesign m = cutVDesign m := by unfold cutDesign cutVDesign uniformOnDesign congr funext z by_cases hsame : cutPlus m = cutMinus m · by_cases hz : z = cutMinus m · simp [hsame, hz] norm_num · simp [hsame, hz] · have hsame' : ¬ cutMinus m = cutPlus m := fun h => hsame h.symm by_cases hp : z = cutPlus m <;> by_cases hm : z = cutMinus m <;> simp [hp, hm, hsame, hsame']
CausalSmith.Experimentation.DesignPm1.cutDesign_eq_cutVDesign · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Tcut.lean:21
theorem sInf_image_eq_of_minimizer Lemma sInf_image_eq_of_minimizer in the paper ↗

If x0 is a minimizer of f on S, then the infimum of the objective image is f x0.

Formal statement
α :
Type*
f :
α → ℝ
S :
Set α
x0 :
α
hx0 :
x0 ∈ S
hmin :
∀ x ∈ S, f x0 ≤ f x
sInf (f '' S) = f x0
Proof (Lean source)
lemma sInf_image_eq_of_minimizer {α : Type*} (f : α → ℝ) (S : Set α) (x0 : α) (hx0 : x0 ∈ S) (hmin : ∀ x ∈ S, f x0 ≤ f x) : sInf (f '' S) = f x0 := by apply csInf_eq_of_forall_ge_of_forall_gt_exists_lt · exact ⟨f x0, ⟨x0, hx0, rfl⟩⟩ · rintro _ ⟨x, hx, rfl⟩ exact hmin x hx · intro w hw exact ⟨f x0, ⟨x0, hx0, rfl⟩, hw⟩
CausalSmith.Experimentation.DesignPm1.sInf_image_eq_of_minimizer · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Tcut.lean:36
def rCut

The cut-exactness frontier r_cut(m,a,b,κ) = max 0 (min{2b(a+b)(1 − κ/(a−b)), 2b(2m−2b−κ)}): the largest ratio up to which X_cut stays optimal on the block-symmetric slice, taken as a nonnegative frontier (= 0 on the vacuous cells where the cut region is empty). @realizes r_cut(m,a,b,kappa)(closed form min{2b(a+b)(1−κ/(a−b)), 2b(2m−2b−κ)}; the declared [0,∞) space is PINNED BY CONSTRUCTION via the outer max 0 clamp, so r_cut ∈ [0,∞) holds unconditionally — not merely under the homophily regime. Given 0 ≤ r, the consuming cut region r < r_cut is equivalent to r < min{…}, so the clamp leaves cut_corner_exactness unchanged in strength.) @realizes kappa(carrier ℝ argument kappa; robustness weight entering both branches of the cut frontier; range [0,∞) pinned by 0 ≤ kappa on the consuming theorem cut_corner_exactness)

Definition (Lean source)
noncomputable def rCut (m : ℕ) (a b kappa : ℝ) : ℝ := max 0 (min (2 * b * (a + b) * (1 - kappa / (a - b))) (2 * b * (2 * (m : ℝ) - 2 * b - kappa)))
def kappaCut

The low-robustness cut frontier κ_cut(m,a,b) = max 0 (min{a−b, 2(m−b)}): the largest robustness weight below which the cut-exactness region [0, r_cut(m,a,b,κ)) stays nonempty, taken as a nonnegative frontier. @realizes kappa_cut(m,a,b)(AUTHORITATIVE closed form min{a−b, 2(m−b)} clamped by an outer max 0; the derived-phase [0,∞) space is PINNED BY CONSTRUCTION via that clamp, so κ_cut ∈ [0,∞) holds unconditionally — = 0 exactly on the vacuous cells where no cut-exactness region persists (a ≤ b or b ≥ m), and = min{a−b, 2(m−b)} > 0 under the homophily regime with b < m. The range no longer depends on the regime holding.)

Definition (Lean source)
noncomputable def kappaCut (m : ℕ) (a b : ℝ) : ℝ := max 0 (min (a - b) (2 * ((m : ℝ) - b)))
theorem cut_corner_exactness Theorem 1 in the paper ↗

Cut-corner exactness. Under two-block homophily, for 0 ≤ r < r_cut(m,a,b,κ) the cut covariance X_cut is the unique minimizer of F_{r,κ} over E_m^blk; the implementability gap is zero; X_cut is the unique minimizer over C_m^pm; and the cut design P_cut ∈ P_m^sym realizes it with X(P_cut) = X_cut. (The ass:balanced-sign-design atom is realized through membership in the block-exchangeable class C_m^pm/P_m^sym, which bundles BalancedDesignClass.)

Formal statement
m :
a b r kappa :
hHom :
hr0 :
0 ≤ r
@realizes r(range 0 ≤ r pins r ∈ [0,∞))
hk0 :
0 ≤ kappa
@realizes kappa(range 0 ≤ κ pins κ ∈ [0,∞), its definitional domain)
hr :
r < rCut m a b kappa
(cutCovariance m ∈ blockElliptope m a b ∧ ∀ X ∈ blockElliptope m a b, X ≠ cutCovariance m → designObjective m a b r kappa (cutCovariance m) < designObjective m a b r kappa X) ∧
implementabilityGap m a b r kappa = 0 ∧
(cutCovariance m ∈ implementableCovarianceClass m ∧ ∀ X ∈ implementableCovarianceClass m, X ≠ cutCovariance m → designObjective m a b r kappa (cutCovariance m) < designObjective m a b r kappa X) ∧
Proof (Lean source)
theorem cut_corner_exactness (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hr0 : 0 ≤ r) -- @realizes r(range 0 ≤ r pins r ∈ [0,∞)) (hk0 : 0 ≤ kappa) -- @realizes kappa(range 0 ≤ κ pins κ ∈ [0,∞), its definitional domain) (hr : r < rCut m a b kappa) : -- @realizes r_cut(m,a,b,kappa)(cut region r < r_cut) (cutCovariance m ∈ blockElliptope m a b ∧ ∀ X ∈ blockElliptope m a b, X ≠ cutCovariance m → designObjective m a b r kappa (cutCovariance m) < designObjective m a b r kappa X) ∧ implementabilityGap m a b r kappa = 0 ∧ (cutCovariance m ∈ implementableCovarianceClass m ∧ ∀ X ∈ implementableCovarianceClass m, X ≠ cutCovariance m → designObjective m a b r kappa (cutCovariance m) < designObjective m a b r kappa X) ∧ cutDesign m ∈ blockExchangeableDesignClass m ∧ assignmentSecondMoment m (cutDesign m) = cutCovariance m := by rcases hHom with ⟨hm, hba, hb⟩ have hHom' : TwoBlockHomophily m a b := ⟨hm, hba, hb⟩ have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm have hmpos : (0 : ℝ) < (m : ℝ) := by nlinarith have hm0 : (m : ℝ) ≠ 0 := ne_of_gt hmpos have hq : 0 < qParam m := by unfold qParam nlinarith have hdiff : 0 < a - b := by linarith have hsum : 0 < a + b := by linarith have hb2 : 0 < 2 * b := by positivity set A : ℝ := 2 * b * (a + b) * (1 - kappa / (a - b)) set B : ℝ := 2 * b * (2 * (m : ℝ) - 2 * b - kappa) have hmin : r < min A B := by unfold rCut at hr by_cases hle : min A B ≤ 0 · have hmax : max 0 (min A B) = 0 := max_eq_left hle linarith · have hmax : max 0 (min A B) = min A B := max_eq_right (le_of_lt (lt_of_not_ge hle)) simpa [A, B, hmax] using hr have hrA : r < A := lt_of_lt_of_le hmin (min_le_left A B) have hrB : r < B := lt_of_lt_of_le hmin (min_le_right A B) have h1 : cX m a b r / qParam m > cY b r + kappa := by unfold cX cY have hden : 0 < 2 * b * (a + b) := mul_pos hb2 hsum have hAdiv : r / (2 * b * (a + b)) < 1 - kappa / (a - b) := by rw [div_lt_iff₀ hden] nlinarith [hrA] have htarget' : kappa < (a - b) * (1 - r / (2 * b * (a + b))) := by have hmul := mul_lt_mul_of_pos_left hAdiv hdiff field_simp [ne_of_gt hdiff] at hmul ⊢ nlinarith have hrepr : (a + b) + r / (a + b) - (2 * b + r / (2 * b) + kappa) = (a - b) * (1 - r / (2 * b * (a + b))) - kappa := by field_simp [ne_of_gt hb2, ne_of_gt hsum] ring have hcx : qParam m * (a + b + r / (a + b)) / qParam m = a + b + r / (a + b) := by field_simp [ne_of_gt hq] rw [hcx] nlinarith have h2 : cZ m > cY b r + kappa := by unfold cY cZ have hB' : r < 2 * b * (2 * (m : ℝ) - 2 * b - kappa) := by simpa [B] using hrB have htarget : 2 * b + r / (2 * b) + kappa < 2 * (m : ℝ) := by have hdiv : r / (2 * b) < 2 * (m : ℝ) - 2 * b - kappa := by rw [div_lt_iff₀ hb2] nlinarith [hB'] nlinarith linarith have hcert := cut_vertex_certificate m (cX m a b r) (cY b r) (cZ m) kappa hq hk0 h1 h2 have hspecCut := block_spectral_coordinates m a b r kappa 1 (-1) hHom' have hcutCoords := hspecCut.2.2.1.2 have hxCut : (1 : ℝ) - 1 = 0 := congrArg Prod.fst hcutCoords have hyCut : 1 + ((m : ℝ) - 1) * (1 : ℝ) - (m : ℝ) * (-1 : ℝ) = 2 * (m : ℝ) := congrArg (fun p : ℝ × ℝ × ℝ => p.2.1) hcutCoords have hzCut : 1 + ((m : ℝ) - 1) * (1 : ℝ) + (m : ℝ) * (-1 : ℝ) = 0 := congrArg (fun p : ℝ × ℝ × ℝ => p.2.2) hcutCoords have hcutTriUV : InReducedTriangle m (1 - (1 : ℝ)) (1 + ((m : ℝ) - 1) * (1 : ℝ) - (m : ℝ) * (-1 : ℝ)) (1 + ((m : ℝ) - 1) * (1 : ℝ) + (m : ℝ) * (-1 : ℝ)) := by simpa [hxCut, hyCut, hzCut, two_mul] using hcert.1 have hcutBlockMem : blockSymMatrix m 1 (-1) ∈ blockElliptope m a b := hspecCut.1.mpr hcutTriUV have hcutMem : cutCovariance m ∈ blockElliptope m a b := by rw [cutCovariance_eq_blockSym] exact hcutBlockMem have hcutObj : designObjective m a b r kappa (cutCovariance m) = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa 0 (2 * (m : ℝ)) 0 := by rw [cutCovariance_eq_blockSym] simpa [hxCut, hyCut, hzCut, two_mul] using hspecCut.2.1 have hrelStrict : ∀ X ∈ blockElliptope m a b, X ≠ cutCovariance m → designObjective m a b r kappa (cutCovariance m) < designObjective m a b r kappa X := by intro X hX hne rcases hX with ⟨u, v, rfl, hmem⟩ have hspec := block_spectral_coordinates m a b r kappa u v hHom' have htri : InReducedTriangle m (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) := by exact hspec.1.mp ⟨u, v, rfl, hmem⟩ have hcoord_ne : ((1 - u, 1 + ((m : ℝ) - 1) * u - (m : ℝ) * v, 1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) : ℝ × ℝ × ℝ) ≠ (0, 2 * (m : ℝ), 0) := by intro hcoord have hx0 : 1 - u = 0 := congrArg Prod.fst hcoord have hz0 : 1 + ((m : ℝ) - 1) * u + (m : ℝ) * v = 0 := congrArg (fun p : ℝ × ℝ × ℝ => p.2.2) hcoord have hu : u = 1 := by linarith have hv : v = -1 := by subst u have hmv : (m : ℝ) * (1 + v) = 0 := by nlinarith have hv1 : 1 + v = 0 := (mul_eq_zero.mp hmv).resolve_left hm0 linarith apply hne rw [cutCovariance_eq_blockSym, hu, hv] calc designObjective m a b r kappa (cutCovariance m) = reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa 0 (2 * (m : ℝ)) 0 := hcutObj _ < reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa (1 - u) (1 + ((m : ℝ) - 1) * u - (m : ℝ) * v) (1 + ((m : ℝ) - 1) * u + (m : ℝ) * v) := hcert.2 _ _ _ htri hcoord_ne _ = designObjective m a b r kappa (blockSymMatrix m u v) := hspec.2.1.symm have hcutD_eq : cutDesign m = cutVDesign m := cutDesign_eq_cutVDesign m have hcutDmem : cutDesign m ∈ blockExchangeableDesignClass m := by rw [hcutD_eq] exact cutVDesign_mem m have hcutSM : assignmentSecondMoment m (cutDesign m) = cutCovariance m := by rw [hcutD_eq, cutVDesign_secondMoment, ← cutCovariance_eq_blockSym] have hcutImp : cutCovariance m ∈ implementableCovarianceClass m := ⟨cutDesign m, hcutDmem, hcutSM.symm⟩ have himp_subset : implementableCovarianceClass m ⊆ blockElliptope m a b := by intro X hX rcases hX with ⟨D, hDmem, hXeq⟩ rcases secondMoment_blockSym_of_exchangeable m hm D hDmem with ⟨u, v, hblock⟩ rw [hXeq, hblock] have hslice := pm_slice_forward m hm u v D hblock have hspec := block_spectral_coordinates m a b r kappa u v hHom' exact hspec.1.mpr hslice.1 have himpStrict : ∀ X ∈ implementableCovarianceClass m, X ≠ cutCovariance m → designObjective m a b r kappa (cutCovariance m) < designObjective m a b r kappa X := by intro X hX hne exact hrelStrict X (himp_subset hX) hne have hrelLe : ∀ X ∈ blockElliptope m a b, designObjective m a b r kappa (cutCovariance m) ≤ designObjective m a b r kappa X := by intro X hX by_cases hEq : X = cutCovariance m · subst X rfl · exact le_of_lt (hrelStrict X hX hEq) have himpLe : ∀ X ∈ implementableCovarianceClass m, designObjective m a b r kappa (cutCovariance m) ≤ designObjective m a b r kappa X := by intro X hX by_cases hEq : X = cutCovariance m · subst X rfl · exact le_of_lt (himpStrict X hX hEq) have hrelInf : sInf (designObjective m a b r kappa '' blockElliptope m a b) = designObjective m a b r kappa (cutCovariance m) := sInf_image_eq_of_minimizer (designObjective m a b r kappa) (blockElliptope m a b) (cutCovariance m) hcutMem hrelLe have himpInf : sInf (designObjective m a b r kappa '' implementableCovarianceClass m) = designObjective m a b r kappa (cutCovariance m) := sInf_image_eq_of_minimizer (designObjective m a b r kappa) (implementableCovarianceClass m) (cutCovariance m) hcutImp himpLe refine ⟨⟨hcutMem, hrelStrict⟩, ?_, ⟨⟨hcutImp, himpStrict⟩, hcutDmem, hcutSM⟩⟩ unfold implementabilityGap rw [himpInf, hrelInf] ring
CausalSmith.Experimentation.DesignPm1.cut_corner_exactness · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Tcut.lean:73
Tgap 8 declarations For 0 ≤ κ < κ_gap and r ∈ (r_gap^-, r_gap^+) the spread vertex is the unique relaxed minimizer but violates y+z ≥ 2/m, so Δ_m^± > 0.

Odd-m positive-gap window (thm:gap-window)

For 0 ≤ κ < κ_gap and r ∈ (r_gap^-, r_gap^+) the spread vertex is the unique relaxed minimizer but violates y+z ≥ 2/m, so Δ_m^± > 0. Even m makes the whole slice implementable, so the positive gap fails (parity necessity).

def kappaGap

The low-robustness gap ceiling κ_gap(m,a,b) = ((2m−a−3b)(a−b)√q)/(a+b).

Definition (Lean source)
noncomputable def kappaGap (m : ℕ) (a b : ℝ) : ℝ := ((2 * (m : ℝ) - a - 3 * b) * (a - b) * sqrt (qParam m)) / (a + b)
def rCutGap

The cut-frontier value at the gap scale r_cut_gap(m,a,b,κ) = max 0 (2b(a+b)(1 − κ/(a−b))) (the closed form is independent of m); this is the first ((a−b)) branch of the cut-exactness frontier r_cut(m,a,b,κ), active in the low-scale gap regime, taken as a nonnegative frontier. @realizes r_cut(m,a,b,kappa)(gap-scale branch 2b(a+b)(1−κ/(a−b)); the declared [0,∞) space is PINNED BY CONSTRUCTION via the outer max 0 clamp, so r_cut_gap ∈ [0,∞) holds unconditionally, consistent with the r_cut cluster in Tcut.lean.)

Definition (Lean source)
noncomputable def rCutGap (a b kappa : ℝ) : ℝ := max 0 (2 * b * (a + b) * (1 - kappa / (a - b)))
def RxMinus

Lower spread frontier R_x^-(m,a,b,κ) = 2b(a+b)(1 + κ/((a−b)√q)).

Definition (Lean source)
noncomputable def RxMinus (m : ℕ) (a b kappa : ℝ) : ℝ := 2 * b * (a + b) * (1 + kappa / ((a - b) * sqrt (qParam m)))
def RxPlus

Upper spread frontier R_x^+(m,a,b,κ) = (a+b)(2m−a−b−κ/√q).

Definition (Lean source)
noncomputable def RxPlus (m : ℕ) (a b kappa : ℝ) : ℝ := (a + b) * (2 * (m : ℝ) - a - b - kappa / sqrt (qParam m))
def rGapMinus

Lower gap-window frontier r_gap^-(m,a,b,κ) = (R_x^- + R_x^+)/2. @realizes r_gap^-(m,a,b,kappa), r_gap^+(m,a,b,kappa)(AUTHORITATIVE carrier of the FIRST component r_gap^- of the pair symbol whose declared space is [0,∞)^2; closed form (R_x^- + R_x^+)/2 with R_x^- = 2b(a+b)(1+κ/((a−b)√q)) and R_x^+ = (a+b)(2m−a−b−κ/√q). The bare closed form is a plain , NOT nonnegative by construction; the FIRST factor of the [0,∞)^2 range is carried by the CONJUNCTION of this carrier with the companion range lemma rGapFrontiers_nonneg below — which pins 0 ≤ r_gap^- on the consuming window 0 ≤ κ < κ_gap via r_cut_gap = max 0 (…) ≥ 0 < r_gap^- — exactly as implementabilityGap/roundingLossCertificate pair with their *_nonneg lemmas in Basic.lean.)

Definition (Lean source)
noncomputable def rGapMinus (m : ℕ) (a b kappa : ℝ) : ℝ := (RxMinus m a b kappa + RxPlus m a b kappa) / 2
def rGapPlus

Upper gap-window frontier r_gap^+(m,a,b,κ) = R_x^+. @realizes r_gap^-(m,a,b,kappa), r_gap^+(m,a,b,kappa)(AUTHORITATIVE carrier of the SECOND component r_gap^+ of the pair symbol whose declared space is [0,∞)^2; closed form R_x^+ = (a+b)(2m−a−b−κ/√q). The bare closed form is a plain , NOT nonnegative by construction; the SECOND factor of the [0,∞)^2 range is carried by the CONJUNCTION of this carrier with the companion range lemma rGapFrontiers_nonneg below, which pins 0 ≤ r_gap^+ on the consuming window 0 ≤ κ < κ_gap via r_gap^- < r_gap^+ (placing the open gap interval (r_gap^-, r_gap^+) ⊂ [0,∞)).)

Definition (Lean source)
noncomputable def rGapPlus (m : ℕ) (a b kappa : ℝ) : ℝ := RxPlus m a b kappa
theorem rGapFrontiers_nonneg

Range lemma for the gap-window frontier pair (r_gap^-, r_gap^+). On the consuming window 0 ≤ κ < κ_gap, under two-block homophily and the low-scale normalization, the frontier pair lands in its core-declared space [0,∞)^2: 0 ≤ r_gap^- and 0 ≤ r_gap^+. This holds because r_cut_gap = max 0 (…) ≥ 0 and the window strictly orders the frontiers r_cut_gap < r_gap^- < r_gap^+ (the ordering proved by gap_window), so both frontiers are positive. Together with the rGapMinus/rGapPlus carrier defs above, this lemma IS the realization of the pair's standing [0,∞)^2 range condition (the bare (R_x^- + R_x^+)/2 and R_x^+ closed forms are plain , not nonnegative by construction), exactly mirroring how implementabilityGap_nonneg / roundingLossCertificate_nonneg pin the Δ_m^± / ρ_⋆ ranges in Basic.lean. @realizes r_gap^-(m,a,b,kappa), r_gap^+(m,a,b,kappa)(AUTHORITATIVE range clause for the pair symbol's declared space [0,∞)^2: the conjunction 0 ≤ r_gap^- ∧ 0 ≤ r_gap^+ pins BOTH factors on the consuming window 0 ≤ κ < κ_gap, via r_cut_gap = max 0 (…) ≥ 0 < r_gap^- < r_gap^+. This lemma, together with the rGapMinus/rGapPlus carrier defs above, IS the realizing cluster of the pair's standing [0,∞)^2 range condition.)

Formal statement
m :
a b kappa :
hHom :
hLow :
hk0 :
0 ≤ kappa
hkGap :
kappa < kappaGap m a b
0 ≤ rGapMinus m a b kappa ∧ 0 ≤ rGapPlus m a b kappa
Proof (Lean source)
lemma rGapFrontiers_nonneg (m : ℕ) (a b kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hLow : LowScaleTwoBlock m a b) (hk0 : 0 ≤ kappa) (hkGap : kappa < kappaGap m a b) : 0 ≤ rGapMinus m a b kappa ∧ 0 ≤ rGapPlus m a b kappa := by rcases hHom with ⟨hm, hba, hb⟩ have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm have hq : 0 < qParam m := by unfold qParam nlinarith have hsqrtq : 0 < sqrt (qParam m) := Real.sqrt_pos.2 hq have hA : 0 < a + b := by nlinarith have hdiff : 0 < a - b := by linarith have hD : 0 < 2 * (m : ℝ) - a - 3 * b := by unfold LowScaleTwoBlock at hLow linarith have hkap_div : kappa / sqrt (qParam m) < (2 * (m : ℝ) - a - 3 * b) * (a - b) / (a + b) := by unfold kappaGap at hkGap have hrw : (2 * (m : ℝ) - a - 3 * b) * (a - b) / (a + b) * sqrt (qParam m) = (2 * (m : ℝ) - a - 3 * b) * (a - b) * sqrt (qParam m) / (a + b) := by field_simp rw [div_lt_iff₀ hsqrtq, hrw] exact hkGap have hD_bound : (2 * (m : ℝ) - a - 3 * b) * (a - b) / (a + b) < 2 * (m : ℝ) - a - b := by rw [div_lt_iff₀ hA] nlinarith [hD, hb] have hplus_pos : 0 < rGapPlus m a b kappa := by unfold rGapPlus RxPlus have hinner : 0 < 2 * (m : ℝ) - a - b - kappa / sqrt (qParam m) := by linarith exact mul_pos hA hinner have hminus_nonneg : 0 ≤ RxMinus m a b kappa := by unfold RxMinus have hden : 0 < (a - b) * sqrt (qParam m) := mul_pos hdiff hsqrtq have hfrac : 0 ≤ kappa / ((a - b) * sqrt (qParam m)) := div_nonneg hk0 (le_of_lt hden) have hfactor : 0 ≤ 2 * b * (a + b) := by positivity have hinner : 0 ≤ 1 + kappa / ((a - b) * sqrt (qParam m)) := by positivity exact mul_nonneg hfactor hinner constructor · unfold rGapMinus have hplus_nonneg : 0 ≤ RxPlus m a b kappa := by simpa [rGapPlus] using le_of_lt hplus_pos nlinarith [hminus_nonneg, hplus_nonneg] · exact le_of_lt hplus_pos
CausalSmith.Experimentation.DesignPm1.rGapFrontiers_nonneg · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Tgap.lean:64
theorem gap_window Theorem 3 in the paper ↗

Positive-gap window. Under two-block homophily and low-scale: if m is odd, then for every 0 ≤ κ < κ_gap the frontiers are strictly ordered r_cut_gap < r_gap^- < r_gap^+, and for r ∈ (r_gap^-, r_gap^+) the spread vertex is the unique relaxed minimizer of F over E_m^blk but is not ±1 implementable, so Δ_m^±(r,κ) > 0. The oddness is necessary as a separate even-m case (NOT nested under the odd hypothesis, so it does not fire vacuously): for even m the whole block elliptope slice is implementable, hence the claimed positive gap is false.

Formal statement
m :
a b :
hHom :
hLow :
(OddCommunitySize m → ∀ kappa : ℝ, 0 ≤ kappa → kappa < kappaGap m a b → rCutGap a b kappa < rGapMinus m a b kappa ∧ rGapMinus m a b kappa < rGapPlus m a b kappa ∧ ∀ r : ℝ, rGapMinus m a b kappa < r → r < rGapPlus m a b kappa → (spreadCovariance m ∈ blockElliptope m a b ∧ ∀ X ∈ blockElliptope m a b, X ≠ spreadCovariance m → designObjective m a b r kappa (spreadCovariance m) < designObjective m a b r kappa X) ∧ spreadCovariance m ∉ implementableCovarianceClass m ∧ 0 < implementabilityGap m a b r kappa) ∧
Proof (Lean source)
theorem gap_window (m : ℕ) (a b : ℝ) (hHom : TwoBlockHomophily m a b) (hLow : LowScaleTwoBlock m a b) : (OddCommunitySize m → ∀ kappa : ℝ, 0 ≤ kappa → kappa < kappaGap m a b → rCutGap a b kappa < rGapMinus m a b kappa ∧ -- @realizes r_cut(m,a,b,kappa) rGapMinus m a b kappa < rGapPlus m a b kappa ∧ -- @realizes r(bound within the gap window rGapMinus < r < rGapPlus ⊂ [0,∞)) ∀ r : ℝ, rGapMinus m a b kappa < r → r < rGapPlus m a b kappa → (spreadCovariance m ∈ blockElliptope m a b ∧ ∀ X ∈ blockElliptope m a b, X ≠ spreadCovariance m → designObjective m a b r kappa (spreadCovariance m) < designObjective m a b r kappa X) ∧ spreadCovariance m ∉ implementableCovarianceClass m ∧ 0 < implementabilityGap m a b r kappa) ∧ (Even m → blockElliptope m a b ⊆ implementableCovarianceClass m) := by rcases hHom with ⟨hm, hba, hb⟩ have hHom' : TwoBlockHomophily m a b := ⟨hm, hba, hb⟩ have hmR : (2 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm have hmpos : (0 : ℝ) < (m : ℝ) := by nlinarith have hm0 : (m : ℝ) ≠ 0 := ne_of_gt hmpos have hm1 : (m : ℝ) - 1 ≠ 0 := by nlinarith have hq : 0 < qParam m := by unfold qParam nlinarith have hq0 : 0 ≤ qParam m := le_of_lt hq have hsqrtq : 0 < sqrt (qParam m) := Real.sqrt_pos.2 hq have hA : 0 < a + b := by linarith have hdiff : 0 < a - b := by linarith have hb2 : 0 < 2 * b := by positivity have hD : 0 < 2 * (m : ℝ) - a - 3 * b := by unfold LowScaleTwoBlock at hLow linarith constructor · intro hOdd kappa hk0 hkGap have hkA_div : kappa * (a + b) / ((a - b) * sqrt (qParam m)) < 2 * (m : ℝ) - a - 3 * b := by rw [div_lt_iff₀ (mul_pos hdiff hsqrtq)] have hmul := mul_lt_mul_of_pos_right hkGap hA unfold kappaGap at hmul field_simp [ne_of_gt hA] at hmul nlinarith have hRxDiff : 0 < RxPlus m a b kappa - RxMinus m a b kappa := by have hinner : 0 < (2 * (m : ℝ) - a - 3 * b) - kappa * (a + b) / ((a - b) * sqrt (qParam m)) := by linarith have hident : RxPlus m a b kappa - RxMinus m a b kappa = (a + b) * ((2 * (m : ℝ) - a - 3 * b) - kappa * (a + b) / ((a - b) * sqrt (qParam m))) := by unfold RxPlus RxMinus field_simp [ne_of_gt hdiff, ne_of_gt hsqrtq] ring rw [hident] exact mul_pos hA hinner have hRx_lt : RxMinus m a b kappa < RxPlus m a b kappa := sub_pos.mp hRxDiff have hRx_minus_lt_gap : RxMinus m a b kappa < rGapMinus m a b kappa := by unfold rGapMinus nlinarith have hgap_lt_plus : rGapMinus m a b kappa < rGapPlus m a b kappa := by unfold rGapMinus rGapPlus nlinarith have hRx_nonneg : 0 ≤ RxMinus m a b kappa := by unfold RxMinus have hden : 0 < (a - b) * sqrt (qParam m) := mul_pos hdiff hsqrtq have hfrac : 0 ≤ kappa / ((a - b) * sqrt (qParam m)) := div_nonneg hk0 (le_of_lt hden) positivity have hcutBare_le_Rx : 2 * b * (a + b) * (1 - kappa / (a - b)) ≤ RxMinus m a b kappa := by unfold RxMinus have hfactor : 0 ≤ 2 * b * (a + b) := by positivity have hden : 0 < (a - b) * sqrt (qParam m) := mul_pos hdiff hsqrtq have hfrac1 : 0 ≤ kappa / (a - b) := div_nonneg hk0 (le_of_lt hdiff) have hfrac2 : 0 ≤ kappa / ((a - b) * sqrt (qParam m)) := div_nonneg hk0 (le_of_lt hden) have hinner : 1 - kappa / (a - b) ≤ 1 + kappa / ((a - b) * sqrt (qParam m)) := by linarith exact mul_le_mul_of_nonneg_left hinner hfactor have hcut_le_Rx : rCutGap a b kappa ≤ RxMinus m a b kappa := by unfold rCutGap exact max_le hRx_nonneg hcutBare_le_Rx have hcut_lt_gap : rCutGap a b kappa < rGapMinus m a b kappa := lt_of_le_of_lt hcut_le_Rx hRx_minus_lt_gap refine ⟨hcut_lt_gap, hgap_lt_plus, ?_⟩ intro r hrLower hrUpper have hrRx : RxMinus m a b kappa < r := lt_trans hRx_minus_lt_gap hrLower have h1 : cY b r > cX m a b r / qParam m + kappa / sqrt (qParam m) := by unfold cX cY have hden : 0 < 2 * b * (a + b) := mul_pos hb2 hA have hrdiv : 1 + kappa / ((a - b) * sqrt (qParam m)) < r / (2 * b * (a + b)) := by have hrRx' : (1 + kappa / ((a - b) * sqrt (qParam m))) * (2 * b * (a + b)) < r := by simpa [RxMinus, mul_assoc, mul_left_comm, mul_comm] using hrRx rw [lt_div_iff₀ hden] exact hrRx' have htarget : kappa / sqrt (qParam m) < (a - b) * (r / (2 * b * (a + b)) - 1) := by have hmul := mul_lt_mul_of_pos_left (by linarith : kappa / ((a - b) * sqrt (qParam m)) < r / (2 * b * (a + b)) - 1) hdiff have hleft : (a - b) * (kappa / ((a - b) * sqrt (qParam m))) = kappa / sqrt (qParam m) := by field_simp [ne_of_gt hdiff, ne_of_gt hsqrtq] nlinarith have hcx : qParam m * (a + b + r / (a + b)) / qParam m = a + b + r / (a + b) := by field_simp [ne_of_gt hq] rw [hcx] have hid : 2 * b + r / (2 * b) - (a + b + r / (a + b)) = (a - b) * (r / (2 * b * (a + b)) - 1) := by field_simp [ne_of_gt hb2, ne_of_gt hA] ring nlinarith have h2 : cZ m > cX m a b r / qParam m + kappa / sqrt (qParam m) := by unfold cX cZ have hrdiv : r / (a + b) < 2 * (m : ℝ) - a - b - kappa / sqrt (qParam m) := by have hrUpper' : r < (2 * (m : ℝ) - a - b - kappa / sqrt (qParam m)) * (a + b) := by simpa [RxPlus, rGapPlus, mul_assoc, mul_left_comm, mul_comm] using hrUpper rw [div_lt_iff₀ hA] exact hrUpper' have hcx : qParam m * (a + b + r / (a + b)) / qParam m = a + b + r / (a + b) := by field_simp [ne_of_gt hq] rw [hcx] linarith have hcert := spread_vertex_certificate m (cX m a b r) (cY b r) (cZ m) kappa hq hk0 h1 h2 exact spread_certificate_relaxed_minimizer_and_gap m a b r kappa hHom' hk0 hOdd hcert · intro hEven exact blockElliptope_subset_implementable_of_even m a b hEven
Trobust 1 declarations Finite-κ iid exactness holds iff on the affine-balanced locus a+3b=2m, r=2b(a+b).

Robust-corner exactness (thm:robust-corner-exactness)

Finite-κ iid exactness holds iff on the affine-balanced locus a+3b=2m, r=2b(a+b). On the locus, for every κ > 0, I_n is the unique relaxed minimizer attained by P_iid; off the locus, I_n is never a finite-κ minimizer but minimizers converge to I_n as κ → ∞.

theorem robust_corner_exactness Theorem 2 in the paper ↗

Robust-corner exactness. Under two-block homophily: I_n is a minimizer of F_{r,κ} over E_m^blk for some finite κ iff a+3b=2m and r=2b(a+b); on this locus, for every κ > 0, I_n is the unique relaxed minimizer and P_iid ∈ P_m^sym attains it with X(P_iid)=I_n; off the locus I_n is never a finite-κ minimizer, though relaxed minimizers converge (entrywise) to I_n as κ → ∞.

Formal statement
m :
a b r :
hHom :
hr0 :
0 ≤ r
((∃ kappa : ℝ, 0 ≤ kappa ∧ (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) ∈ blockElliptope m a b ∧ ∀ X ∈ blockElliptope m a b, designObjective m a b r kappa 1 ≤ designObjective m a b r kappa X) ↔ (a + 3 * b = 2 * (m : ℝ) ∧ r = 2 * b * (a + b))) ∧
((a + 3 * b = 2 * (m : ℝ) ∧ r = 2 * b * (a + b)) → ∀ kappa : ℝ, 0 < kappa → ((1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) ∈ blockElliptope m a b ∧ ∀ X ∈ blockElliptope m a b, X ≠ 1 → designObjective m a b r kappa 1 < designObjective m a b r kappa X)) ∧
(¬ (a + 3 * b = 2 * (m : ℝ) ∧ r = 2 * b * (a + b)) → (∀ kappa : ℝ, 0 < kappa → ¬ (∀ X ∈ blockElliptope m a b, designObjective m a b r kappa 1 ≤ designObjective m a b r kappa X)) ∧ (∀ (Xseq : ℝ → Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ), (∀ kappa : ℝ, 0 < kappa → Xseq kappa ∈ blockElliptope m a b ∧ ∀ X ∈ blockElliptope m a b, designObjective m a b r kappa (Xseq kappa) ≤ designObjective m a b r kappa X) → ∀ i j, Tendsto (fun kappa => Xseq kappa i j) atTop (𝓝 ((1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) i j))))
Proof (Lean source)
theorem robust_corner_exactness (m : ℕ) (a b r : ℝ) (hHom : TwoBlockHomophily m a b) (hr0 : 0 ≤ r) : -- @realizes r(range 0 ≤ r pins r ∈ [0,∞)) ((∃ kappa : ℝ, 0 ≤ kappa ∧ (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) ∈ blockElliptope m a b ∧ ∀ X ∈ blockElliptope m a b, designObjective m a b r kappa 1 ≤ designObjective m a b r kappa X) -- @realizes kappa_iid(m,a,b,r)(finiteness criterion: a finite iid-exactness -- weight EXISTS iff the affine-balanced locus a+3b=2m ∧ r=2b(a+b); off-locus =+∞) ↔ (a + 3 * b = 2 * (m : ℝ) ∧ r = 2 * b * (a + b))) ∧ ((a + 3 * b = 2 * (m : ℝ) ∧ r = 2 * b * (a + b)) → -- @realizes kappa_iid(m,a,b,r)(on-locus value: every κ>0 makes I_n the unique -- relaxed minimizer, so the infimal admissible weight kappa_iid = 0 (≥ kappa_cut)) ∀ kappa : ℝ, 0 < kappa → ((1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) ∈ blockElliptope m a b ∧ ∀ X ∈ blockElliptope m a b, X ≠ 1 → designObjective m a b r kappa 1 < designObjective m a b r kappa X)) ∧ (iidDesign m ∈ blockExchangeableDesignClass m ∧ assignmentSecondMoment m (iidDesign m) = 1) ∧ (¬ (a + 3 * b = 2 * (m : ℝ) ∧ r = 2 * b * (a + b)) → (∀ kappa : ℝ, 0 < kappa → ¬ (∀ X ∈ blockElliptope m a b, designObjective m a b r kappa 1 ≤ designObjective m a b r kappa X)) ∧ (∀ (Xseq : ℝ → Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ), (∀ kappa : ℝ, 0 < kappa → Xseq kappa ∈ blockElliptope m a b ∧ ∀ X ∈ blockElliptope m a b, designObjective m a b r kappa (Xseq kappa) ≤ designObjective m a b r kappa X) → ∀ i j, Tendsto (fun kappa => Xseq kappa i j) atTop (𝓝 ((1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) i j)))) := by have hiff : ((∃ kappa : ℝ, 0 ≤ kappa ∧ (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) ∈ blockElliptope m a b ∧ ∀ X ∈ blockElliptope m a b, designObjective m a b r kappa 1 ≤ designObjective m a b r kappa X) ↔ (a + 3 * b = 2 * (m : ℝ) ∧ r = 2 * b * (a + b))) := by constructor · rintro ⟨kappa, _hk, _hmem, hmin⟩ exact robust_locus_of_center_coeffs m a b r hHom (center_coeffs_of_identity_relaxed_min m a b r kappa hHom hmin).1 (center_coeffs_of_identity_relaxed_min m a b r kappa hHom hmin).2 · intro hloc refine ⟨1, by norm_num, ?_, ?_⟩ · exact (identity_strict_relaxed_min_of_locus m a b r 1 hHom (by norm_num) hloc).1 · intro X hX by_cases hEq : X = (1 : Matrix (Fin (2 * m)) (Fin (2 * m)) ℝ) · subst X rfl · exact le_of_lt ((identity_strict_relaxed_min_of_locus m a b r 1 hHom (by norm_num) hloc).2 X hX hEq) refine ⟨hiff, ?_⟩ refine ⟨?_, ?_⟩ · intro hloc kappa hk exact identity_strict_relaxed_min_of_locus m a b r kappa hHom hk hloc refine ⟨?_, ?_⟩ · exact ⟨iidDesign_mem_blockExchangeable m, iidDesign_secondMoment m⟩ · intro hnot constructor · intro kappa hk hmin exact hnot (robust_locus_of_center_coeffs m a b r hHom (center_coeffs_of_identity_relaxed_min m a b r kappa hHom hmin).1 (center_coeffs_of_identity_relaxed_min m a b r kappa hHom hmin).2) · intro Xseq hXseq i j exact robust_minimizers_tendsto_identity_entries m a b r hHom hr0 Xseq hXseq i j
CausalSmith.Experimentation.DesignPm1.robust_corner_exactness · CausalSmith/Experimentation/EXP_DesignPm1ExactnessBoundaryV1_Research/Trobust.lean:24
Tsharp 3 declarations The tight certificate ρ_⋆ = Δ_m^±, computed by the active-set SOCP over the reduced triangle, with the exact zero-loss criterion ρ_⋆ = 0 iff the relaxed argmin meets the implementable slice {y+z ≥ d_m}.

Headline rounding-loss certificate (thm:sharp-rho-star)

The tight certificate ρ_⋆ = Δ_m^±, computed by the active-set SOCP over the reduced triangle, with the exact zero-loss criterion ρ_⋆ = 0 iff the relaxed argmin meets the implementable slice {y+z ≥ d_m}. No exact r_star frontier is asserted (honest open scope).

def sharpAlpha

Reduced-coordinate active-set data α = (c_x/q, c_y, c_z) for the linear change of variables t = (q x, y, z) that carries the reduced triangle T_m onto the scaled simplex Δ_M (M = 2m) and φ onto wsObj α β κ. This is the α fed to lem:weighted-simplex-active-set / lem:weighted-simplex-truncation.

Definition (Lean source)
noncomputable def sharpAlpha (m : ℕ) (a b r : ℝ) : Fin 3 → ℝ := ![cX m a b r / qParam m, cY b r, cZ m]
def sharpBeta

Reduced-coordinate weights β = (1/q, 1, 1) (so β_y = β_z = 1), the β fed to lem:weighted-simplex-active-set / lem:weighted-simplex-truncation under the change of variables t = (q x, y, z).

Definition (Lean source)
noncomputable def sharpBeta (m : ℕ) : Fin 3 → ℝ := ![1 / qParam m, 1, 1]
theorem sharp_rho_star Theorem 4 in the paper ↗

Sharp ρ_⋆ certificate. Under two-block homophily, the rounding-loss certificate equals the implementability gap (ρ_⋆ = Δ_m^±); the gap is nonnegative (Δ_m^± ≥ 0, its definitional domain [0,∞)); ρ_⋆ = 0 iff the relaxed argmin over T_m meets the implementable slice {y+z ≥ d_m}; for κ > 0 the relaxed minimizer over T_m is unique (active-set uniqueness), and equivalently ρ_⋆ = 0 iff that unique minimizer satisfies y+z ≥ d_m; for κ = 0 the relaxed argmin set is the exposed face on the per-unit α-minimizing coordinates (α = (c_x/q, c_y, c_z)); and for even m (d_m = 0) the certificate vanishes identically. No r_star frontier is characterized.

Formal statement
m :
a b r kappa :
hHom :
hr0 :
0 ≤ r
@realizes r(range 0 ≤ r pins r ∈ [0,∞))
hk :
0 ≤ kappa
roundingLossCertificate m a b r kappa = implementabilityGap m a b r kappa ∧
0 ≤ roundingLossCertificate m a b r kappa ∧
0 ≤ implementabilityGap m a b r kappa ∧
(roundingLossCertificate m a b r kappa = 0 ↔ ∃ x y z, InReducedTriangle m x y z ∧ (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ∧ parityThreshold m ≤ y + z) ∧
(0 < kappa → (∃! t : ℝ × ℝ × ℝ, InReducedTriangle m t.1 t.2.1 t.2.2 ∧ ∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t.1 t.2.1 t.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ∧ (roundingLossCertificate m a b r kappa = 0 ↔ ∀ x y z, InReducedTriangle m x y z → (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') → parityThreshold m ≤ y + z)) ∧
(kappa = 0 → ∀ x y z, InReducedTriangle m x y z → ((∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ↔ (x ≠ 0 → cX m a b r / qParam m ≤ cY b r ∧ cX m a b r / qParam m ≤ cZ m) ∧ (y ≠ 0 → cY b r ≤ cX m a b r / qParam m ∧ cY b r ≤ cZ m) ∧ (z ≠ 0 → cZ m ≤ cX m a b r / qParam m ∧ cZ m ≤ cY b r))) ∧
(0 < kappa → ∃ S : Finset (Fin 3), ∃ lam : ℝ, IsAdmissibleSupport (sharpAlpha m a b r) (sharpBeta m) kappa S lam ∧ InReducedTriangle m (activeSetPoint (2 * (m : ℝ)) (sharpAlpha m a b r) (sharpBeta m) S lam 0 / qParam m) (activeSetPoint (2 * (m : ℝ)) (sharpAlpha m a b r) (sharpBeta m) S lam 1) (activeSetPoint (2 * (m : ℝ)) (sharpAlpha m a b r) (sharpBeta m) S lam 2) ∧ (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa (activeSetPoint (2 * (m : ℝ)) (sharpAlpha m a b r) (sharpBeta m) S lam 0 / qParam m) (activeSetPoint (2 * (m : ℝ)) (sharpAlpha m a b r) (sharpBeta m) S lam 1) (activeSetPoint (2 * (m : ℝ)) (sharpAlpha m a b r) (sharpBeta m) S lam 2) ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ∧ relaxedReducedValue m a b r kappa = 2 * (m : ℝ) * lam) ∧
((¬ ∃ x y z, InReducedTriangle m x y z ∧ (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ∧ parityThreshold m ≤ y + z) → implementableReducedValue m a b r kappa = wsObj (sharpAlpha m a b r) (sharpBeta m) kappa (truncSegPoint (2 * (m : ℝ)) (parityThreshold m) (truncSelector (2 * (m : ℝ)) (parityThreshold m) (sharpAlpha m a b r) (sharpBeta m) kappa))) ∧
(Even m → roundingLossCertificate m a b r kappa = 0)
Proof (Lean source)
theorem sharp_rho_star (m : ℕ) (a b r kappa : ℝ) (hHom : TwoBlockHomophily m a b) (hr0 : 0 ≤ r) -- @realizes r(range 0 ≤ r pins r ∈ [0,∞)) (hk : 0 ≤ kappa) : -- @realizes kappa(range 0 ≤ κ pins κ ∈ [0,∞), its definitional domain) roundingLossCertificate m a b r kappa = implementabilityGap m a b r kappa ∧ -- @realizes rho_star(m,a,b,r,kappa)(standing range clause 0 ≤ ρ_⋆ pinning space [0,∞); -- discharged by the companion range lemma `roundingLossCertificate_nonneg` in Basic) 0 ≤ roundingLossCertificate m a b r kappa ∧ -- @realizes Delta_m^pm(r,kappa)(standing range clause 0 ≤ Δ_m^± pinning space [0,∞); -- discharged by the companion range lemma `implementabilityGap_nonneg` in Basic) 0 ≤ implementabilityGap m a b r kappa ∧ (roundingLossCertificate m a b r kappa = 0 ↔ ∃ x y z, InReducedTriangle m x y z ∧ (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ∧ parityThreshold m ≤ y + z) ∧ (0 < kappa → (∃! t : ℝ × ℝ × ℝ, InReducedTriangle m t.1 t.2.1 t.2.2 ∧ ∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa t.1 t.2.1 t.2.2 ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ∧ (roundingLossCertificate m a b r kappa = 0 ↔ ∀ x y z, InReducedTriangle m x y z → (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') → parityThreshold m ≤ y + z)) ∧ (kappa = 0 → ∀ x y z, InReducedTriangle m x y z → ((∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ↔ (x ≠ 0 → cX m a b r / qParam m ≤ cY b r ∧ cX m a b r / qParam m ≤ cZ m) ∧ (y ≠ 0 → cY b r ≤ cX m a b r / qParam m ∧ cY b r ≤ cZ m) ∧ (z ≠ 0 → cZ m ≤ cX m a b r / qParam m ∧ cZ m ≤ cY b r))) ∧ -- Active-set computation of the relaxed minimizer (lem:weighted-simplex-active-set): -- for κ > 0 the unique relaxed argmin over `T_m` is the active-set point of an -- admissible support/multiplier `(S, λ)` under the change of variables `t = (q x, y, z)` -- (`α = sharpAlpha`, `β = sharpBeta`), with relaxed value `M · λ` (`M = 2m`). (0 < kappa → ∃ S : Finset (Fin 3), ∃ lam : ℝ, IsAdmissibleSupport (sharpAlpha m a b r) (sharpBeta m) kappa S lam ∧ InReducedTriangle m (activeSetPoint (2 * (m : ℝ)) (sharpAlpha m a b r) (sharpBeta m) S lam 0 / qParam m) (activeSetPoint (2 * (m : ℝ)) (sharpAlpha m a b r) (sharpBeta m) S lam 1) (activeSetPoint (2 * (m : ℝ)) (sharpAlpha m a b r) (sharpBeta m) S lam 2) ∧ (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa (activeSetPoint (2 * (m : ℝ)) (sharpAlpha m a b r) (sharpBeta m) S lam 0 / qParam m) (activeSetPoint (2 * (m : ℝ)) (sharpAlpha m a b r) (sharpBeta m) S lam 1) (activeSetPoint (2 * (m : ℝ)) (sharpAlpha m a b r) (sharpBeta m) S lam 2) ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ∧ relaxedReducedValue m a b r kappa = 2 * (m : ℝ) * lam) ∧ -- Truncation correction (lem:weighted-simplex-truncation): when the relaxed argmin -- set is disjoint from the implementable slice `{y+z ≥ d_m}`, the implementable value -- is attained on the truncation segment `{y+z = d_m}` at the endpoint/interior selector -- `truncSelector`, so `Δ_m^±` is computed by this boundary-segment formula. ((¬ ∃ x y z, InReducedTriangle m x y z ∧ (∀ x' y' z', InReducedTriangle m x' y' z' → reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x y z ≤ reducedObjective (qParam m) (cX m a b r) (cY b r) (cZ m) kappa x' y' z') ∧ parityThreshold m ≤ y + z) → implementableReducedValue m a b r kappa = wsObj (sharpAlpha m a b r) (sharpBeta m) kappa (truncSegPoint (2 * (m : ℝ)) (parityThreshold m) (truncSelector (2 * (m : ℝ)) (parityThreshold m) (sharpAlpha m a b r) (sharpBeta m) kappa))) ∧ (Even m → roundingLossCertificate m a b r kappa = 0) := by have hGapEq : roundingLossCertificate m a b r kappa = implementabilityGap m a b r kappa := by rw [roundingLossCertificate, rounding_gap_reduction m a b r kappa hHom hk] refine ⟨hGapEq, roundingLossCertificate_nonneg m a b r kappa hHom hr0 hk, implementabilityGap_nonneg m a b r kappa hHom hr0 hk, sharp_roundingLoss_zero_iff_argmin_meets_slice m a b r kappa hHom hk, ?_, ?_, ?_, ?_, ?_⟩ · intro hkpos have hAU := sharp_reduced_active_set_and_unique m a b r kappa hHom hk hkpos exact ⟨hAU.1, sharp_roundingLoss_zero_iff_unique_argmin_subset_slice m a b r kappa hHom hk hkpos hAU.1⟩ · intro hk0 x y z hT exact sharp_kappa_zero_reduced_min_iff m a b r kappa x y z hHom hk0 hT · intro hkpos have hAU := sharp_reduced_active_set_and_unique m a b r kappa hHom hk hkpos simpa [sharpAlpha, sharpBeta] using hAU.2 · intro hNoMeet simpa [sharpAlpha, sharpBeta] using sharp_truncation_value_of_no_reduced_argmin_in_slice m a b r kappa hHom hk hNoMeet · intro hEven exact sharp_roundingLoss_zero_of_even m a b r kappa hHom hk hEven