Repository navigation
feat(Classes/BQP): BQP ⊆ AWPP ⊆ PP via path sums (#896 M3) - #1924
Conversation
…M2) Define BQP by polynomial-time uniform families of quantum circuits over the Hadamard, NOT, CNOT and Toffoli gates, accepting by measuring qubit 0, with bounded error 2/3 vs 1/3 (Samuel's 2026-10-30 decision on #896). Gate codes, their decoding to M1 placed gates and the acceptance probability live under Circuit/Quantum; the class and its closure under complement under Classes. Tests cover exact deciders, interference and a family that decides nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Amplitudes of Hadamard–Toffoli circuits are signed path counts over √2^h, so the acceptance probability of a uniform family is acceptGap/2^h. A polynomial-time path simulation makes acceptGap a GapP function, and mem_AWPP_of_polyTime_exponent gives BQP ⊆ AWPP (Fortnow–Rogers Thm 3.1); AWPP_subset_PP gives BQP ⊆ PP (Adleman–DeMarrais–Huang). Adds List.set_ofFn beside List.getD_ofFn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
|
|
edemaine
left a comment
There was a problem hiding this comment.
reviewer-codex-edemaine: APPROVE at bcf47ab (independent agent review).
Read the complete six-file layer over reviewed #1916 and the actual GapP/AWPP aggregation interfaces. The generalized-sign induction gives each amplitude as its signed path count times 2^(−h/2). Squaring correctly retains cross terms: acceptance counts pairs ending at the same accepting register, with denominator 2^h. Well-formedness connects the simulator to decoded gates; positive width handles output qubit 0. Zero Hadamards and exact acceptance probabilities 0/1 are covered.
The simulator has polynomially bounded encoded state and gate list, and both path lengths are computed in unary. Two existing GapP sums therefore cover the signed pair count. Unitarity supplies 0 ≤ gap ≤ 2^h, and the member/nonmember inequalities transfer exactly to the existing Fenner AWPP characterization; its padding lemma and AWPP_subset_PP finish the result. The list-update helper is appropriately placed and reused.
Verified Fortnow–Rogers cs/9811023v1, §2.3, Definition 2.5, Theorem 3.1 (“BQP ⊆ AWPP”) and Lemma 3.2, printed pp.3–6. The QTM/circuit denominator change and AWPP convention are disclosed correctly. This concerns M2's fixed-gate uniform circuit class; its equivalence remark and the absence of lowness/amplification proofs remain as stated. No curated-abstract impact.
The checked examples exercise signs, Toffoli, HH cancellation and both inclusions. Independent enumeration agrees with amplitudes, pair gaps and normalization in 1,200 small circuits. Whitespace and the 3,197-module aggregate pass. Author reports all six local gates. At inspection Lean CI and Guide were running; title passed. No reviewer Lean build. Live head/history rechecked before posting.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
|
|
|
Carry-forward record ( |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
|
Carry-forward record ( |
Change
Milestone M3 of #896:
BQP ⊆ AWPPandBQP ⊆ PP. Mathematical progress. Stacked on #1916 (M2, theBQPdefinition); the base branch isclaude/bqp-896, so this diff shows only M3.What is proved (for every instance type
αand injective encodingenc : α ↪ List Bool):Cslib.Complexity.BQP_subset_AWPP : BQP enc ⊆ AWPP enc, whereAWPPis the library's existing Fenner characterization (Classes/AWPP.lean);Cslib.Complexity.BQP_subset_PP : BQP enc ⊆ PP enc, from the existingAWPP_subset_PP.Both depend only on
propext,Classical.choiceandQuot.sound.How.
Circuit/Quantum/PathSum.leanis pure mathematics on the M2 gate codes. Over the M2 gate set ({H, NOT, CNOT, Toffoli}, Samuel's 2026-10-30 decision), a classical simulationpathStepfollows one branch per Hadamard gate.run_ofCodes_apply: every amplitude of a decoded circuit ispathGap / √2^h, withhthe number of Hadamard gates. Proved by induction over the gates, using the M2 basis-state lemmas for H and the classical gates.acceptProb_eq_acceptGap: the acceptance probability isacceptGap / 2^h, whereacceptGapis a signed count of pairs of paths ending in the same register with qubit 0 = 1.Classes/BQP/Counting.leanholds the complexity part:pathStepand its fold run in polynomial time (computableInPolyTime_pathStep,computableInPolyTime_foldl_pathStep, proved with plainfun_prop).acceptGapis a polynomial-time integer, and the gap isGapPby two applications ofGapP.sum_bits_mem.his computed in unary, andmem_AWPP_of_polyTime_exponentabsorbs the input-dependent denominator2^h.Everything is plain computability; nothing tidy.
Source mapping (locators checked at source).
BQP ⊆ AWPP.M,Pr[M(x) accepts] = f(x)/5^{2t(|x|)}withf ∈ GapP. The amplitudes are restricted as in their §2.3, to{0, ±3/5, ±4/5, ±1}(due to ADH and Solovay–Yao).acceptProb_eq_acceptGap, for circuits over {H, Toffoli, …} with denominator2^hinstead of5^{2t}.q, error2^{-q}) differs from the library's Fenner constant-error form; the proof targets the library's existingAWPPdefinition.BQP ⊆ PP; FR's introduction attributes the PP bound to them. The paper is paywalled, so it is cited without a theorem locator, and nothing here claims to follow its proof.BQP ⊆ PP. After Theorem 20.25 (BQP ⊆ PSPACE) it only remarks that the bound improves toBQP ⊆ P^{#P}. I did not check the 2009 print, so AB is not cited for this theorem.Existing notions considered.
GapP,SharpPandAWPPare reused, together withGapP.sum_bits_mem,mem_GapP_of_polyTime,mem_AWPP_of_polyTime_exponentandAWPP_subset_PP. The plain fold ruleComputableInPolyTime.foldl_of_bounded_growthis reused too. The register is a raw bit string, andList.setis expressed throughtake/dropfor the polynomial-time proof.List.getD_ofFn_of_lt(Foundations) is reused; its companionList.set_ofFnis added beside it inFoundations/Data/List/Lookup.lean.pathStep,pathRun,pathTerm,pathGap,acceptTermandacceptGapare new definitions specific to this gate set; no existing path-sum or quantum-simulation API was found. (Circuit/Rational/Quantum*is unrelated.)Tests (
ComplexityTests/BQPCounting.lean):decideruns of the simulation (Toffoli flips; Hadamard writes the path bit and its sign);H|1⟩(1and-1);HHfrom|0⟩gives0, from|1⟩gives4 = 2^2;1/2of oneH;FirstBit ∈ AWPP,FirstBitᶜ ∈ PP.Limits. The result concerns
BQPas defined in M2: fixed gate set, uniform circuit families. Equivalence with QTM-based or arbitrary-gate definitions remains the cited remark from M2. Lowness (PP^BQP = PP, FR Corollary 3.4) is not attempted here.Abstract impact: none on existing abstracts. A headline abstract candidate for
BQP ⊆ PPcan follow as a separate PR once this lands; that is Samuel's choice.Validation
scripts/check.sh --quickfell back to all six gates (becausereferences.bibchanged). All passed locally on bcf47ab: build, mk_all, test, lint, lint-style, checkInitImports.check_changed_files.pyalso passes.check_hygiene.pypasses. Hosted CI will run on the PR.AI assistance
Written by
worker-claude-e6cf7b0d-bqp(Claude Code, Opus), a subagent ofcoordinator-claude-e6cf7b0d: proofs, tests and this description. Not yet independently reviewed; it needs a non-Claude-fleet reviewer.🤖 Generated with Claude Code
https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG