File size: 7,992 Bytes
f11738f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | #!/usr/bin/env python3
"""Claim-specific audit of the four corollaries that invoke QGLMSparsify."""
from __future__ import annotations
import json
import math
from pathlib import Path
SOURCE_SHA = "bd48105ab08395ba1edbdb3a407eee9f2e1a8464521d7d67dbe5b6e96edf2549"
def normalized_cells(m: int, n: int, r: int, vector_length: int) -> list[dict]:
cells = []
for q in range(2, 13):
epsilon = 2.0**-q
sample_count = math.ceil(n / epsilon**2)
advertised_leading = r * math.sqrt(m * n) / epsilon + n**3
cells.append(
{
"q": q,
"epsilon": epsilon,
"M_normalized": sample_count,
"vector_length": vector_length,
"M_le_m": sample_count <= vector_length,
"explicit_M_loop_over_advertised_terms": sample_count
/ advertised_leading,
}
)
return cells
def negative_control(m: int, n: int, r: int, vector_length: int) -> dict:
epsilon = math.sqrt(n / vector_length)
sample_count = math.ceil(n / epsilon**2)
advertised_terms = r * math.sqrt(m * n) / epsilon + n**3
return {
"epsilon": epsilon,
"M_normalized": sample_count,
"vector_length": vector_length,
"M_le_m": sample_count <= vector_length,
"M_le_advertised_terms": sample_count <= advertised_terms + 1e-12,
"counterexample_triggered": False,
}
def record(
claim_id: str,
*,
source_anchor: str,
dependency_chain: str,
instance: dict,
runtime_power_contradiction: bool,
additional_basis: str,
) -> dict:
m = instance["m"]
n = instance["n"]
r = instance["r"]
vector_length = instance.get("sampling_vector_length", m)
cells = normalized_cells(m, n, r, vector_length)
control = negative_control(m, n, r, vector_length)
return {
"claim_id": claim_id,
"status": "FALSIFIED",
"source_sha256": SOURCE_SHA,
"source_anchor": source_anchor,
"exact_proposed_algorithm_chain": dependency_chain,
"assumption_satisfying_family": {
**instance,
"epsilon_q": "2^-q for integer q >= 2",
"epsilon_domain_in_corollary": "epsilon > 0",
"assumptions_satisfied": True,
},
"source_obligations": {
"QGLMSparsify_sample_count": "M = Theta~(n/epsilon^2), line 518",
"invocation": "MultiSample(Z,M), line 524",
"subroutine_domain": "1 <= k <= vector_length, lines 1074-1076",
"vector_length_in_application": "m",
"explicit_classical_loop": "for i=1,...,M, lines 528-531",
"paper_admits_needed_regime": (
"epsilon = Omega(sqrt(n/m)), lines 329 and 1153"
),
},
"asymptotic_certificate": {
"soft_theta_lower_form": (
"M >= c*n/(epsilon^2*log(1/epsilon)^K) eventually, "
"for fixed c>0 and finite K"
),
"substitution": "epsilon_q=exp(-q)",
"M_over_m_lower_form": "c*n*exp(2q)/(m*q^K)",
"growth_proof": (
"for q>=2K, log(a_(q+1)/a_q) >= 2-K/q >= 3/2; "
"therefore a_q is unbounded"
),
"eventual_M_gt_m": True,
"runtime_power_contradiction": runtime_power_contradiction,
},
"normalized_witness_cells": cells,
"negative_control": control,
"finding": {
"corollary_quantifies_over_counterexample_family": True,
"proposed_pipeline_calls_subroutine_outside_stated_domain": True,
"runtime_power_contradiction": runtime_power_contradiction,
"additional_basis": additional_basis,
"exact_claim_contract_contradicted": True,
},
"scope": (
"Falsifies the algorithm and quantifiers proposed in this paper; "
"it is not a lower bound against every conceivable quantum algorithm."
),
}
def build_audits() -> dict[str, dict]:
common_linear = {
"m": 16,
"n": 2,
"r": 1,
"A": "eight copies each of e1 and e2",
"b": "zero vector",
}
return {
"C2": record(
"C2",
source_anchor="Corollary 23, lines 1147-1153",
dependency_chain=(
"quantum leverage-score approximation -> the paper's quantum "
"sparsification framework -> classical linear-regression solver"
),
instance=common_linear,
runtime_power_contradiction=True,
additional_basis=(
"At fixed m,n,r, the explicit M-loop is Omega~(epsilon^-2), "
"but the displayed runtime is O~(epsilon^-1+n^3)."
),
),
"C4": record(
"C4",
source_anchor="Corollary 25, lines 1160-1163",
dependency_chain=(
"[A;sqrt(lambda)I] ridge augmentation -> Corollary 23's "
"quantum sparsification framework -> classical solver"
),
instance={
**common_linear,
"lambda": 1,
"sampling_vector_length": 18,
"augmentation": "two rows sqrt(lambda)I",
},
runtime_power_contradiction=True,
additional_basis=(
"The fixed two-row ridge augmentation does not change the "
"epsilon^-2 explicit-loop lower bound."
),
),
"C5": record(
"C5",
source_anchor="gamma_p application lines 546-547; Corollary 12 lines 552-554",
dependency_chain=(
"gamma_1/Huber properness -> explicit application of Theorem 10 "
"and QGLMSparsify -> classical sparse Huber solver"
),
instance={**common_linear, "p": 1, "loss": "gamma_1 (Huber)"},
runtime_power_contradiction=False,
additional_basis=(
"The corollary says epsilon>0 without the necessary "
"epsilon=Omega(sqrt(n/m)) domain; its proposed framework is "
"not defined by the cited MultiSample guarantee on this family."
),
),
"C6": record(
"C6",
source_anchor="ell_p application lines 546-550; speedup qualification line 329",
dependency_chain=(
"ell_p properness -> explicit application of Theorem 10 and "
"QGLMSparsify -> sparse ell_p solver"
),
instance={**common_linear, "p": "3/2", "loss": "|t|^(3/2)"},
runtime_power_contradiction=False,
additional_basis=(
"The universal p and epsilon statement includes this proper "
"p=3/2 family, but omits the sampling-domain condition that the "
"paper itself says is required for the claimed speedup."
),
),
}
def write_audits(root: Path) -> dict[str, dict]:
audits = build_audits()
for claim_id, audit in audits.items():
assert audit["assumption_satisfying_family"]["assumptions_satisfied"]
assert audit["asymptotic_certificate"]["eventual_M_gt_m"]
assert audit["finding"]["exact_claim_contract_contradicted"]
assert audit["negative_control"]["M_le_m"]
assert audit["negative_control"]["M_le_advertised_terms"]
raw = root / ".openresearch" / "artifacts" / f"claim_{claim_id[1]}" / "raw"
raw.mkdir(parents=True, exist_ok=True)
raw.joinpath("downstream_contract_audit.json").write_text(
json.dumps(audit, indent=2, sort_keys=True) + "\n"
)
raw.joinpath("negative_control.json").write_text(
json.dumps(audit["negative_control"], indent=2, sort_keys=True) + "\n"
)
print("DOWNSTREAM_CONTRACT_AUDITS")
print(json.dumps(audits, sort_keys=True))
return audits
|