Spectral detection and coherent state conversion #
Ported from the corresponding upstream modules listed by the source sections below.
References beginning with Source name these retained sections.
The chord form of a unitary #
A spike for the spectral layer. Spectral windows for a unitary U are
usually stated with Complex.arg of its eigenvalues, which drags in branch cuts
and trigonometry. The chord distance ‖1 - z‖ avoids that, and it has a
matrix avatar that avoids diagonalizing U at all:
chordSq U = (1 - U)ᴴ (1 - U).
This matrix is Hermitian (chordSq_conjTranspose) and positive semidefinite, so
Mathlib's spectral theory
for Hermitian matrices applies directly — no eigenbasis for a general unitary
is needed. Its quadratic form is exactly the squared chord distance
(qNormSq_sub_mulVec), so "the eigenvalues of chordSq U are at most Δ²" is
precisely "the chord-distance window of threshold Δ²" (equivalently of radius
|Δ| — nothing here assumes Δ nonnegative).
Two facts make one Hermitian decomposition serve both halves of the phase detector:
chordSq_commute—chordSq Ucommutes withU, soUpreserves each of its spectral subspaces. This is what removes the need for simultaneous diagonalization: the windows are defined by a Hermitian matrix, andUacts within them.one_sub_mul_geom_sum—(1 - U) ∑_{t<T} U^t = 1 - U^T, the telescoping identity behind the uniform-clock estimate on the far window.
On a unitary the chord form collapses to 2 - U - Uᴴ, which is where both
facts come from.
The chord form of U: (1 - U)ᴴ (1 - U).
Equations
- QuantumQueryComplexity.chordSq U = (1 - U).conjTranspose * (1 - U)
Instances For
The chord form is Hermitian — stated as the raw identity, so this section needs no extra Mathlib import.
The quadratic form of chordSq is the squared chord distance. This is
what makes a spectral window of chordSq U a chord-distance window.
On a unitary the chord form collapses.
The chord form commutes with the unitary, so U preserves each spectral
subspace of chordSq U. No simultaneous diagonalization is needed.
The core identity of the effective gap. If L (the plan's Λ) kills
w, the product of the two reflections moves w by exactly 2 P w (the plan's
2 Π w). Π is reserved notation in Lean, hence the renaming.
The telescoping identity behind the uniform clock.
Orthogonal projectors and reflections, as raw matrices #
A spike, to fix the representation before the witness construction.
The upper bound reflects about the span of a finite family of vectors coming
from a DualPair. Rather than build projectors by hand, construct the subspace
in EuclideanSpace ℂ H, take Mathlib's Submodule.starProjection, and carry it
back to a raw Matrix H H ℂ.
The transport is Matrix.toEuclideanCLM, which is a star-algebra
equivalence — not merely a linear one. That single fact is what makes this
representation the right one: idempotence and self-adjointness of the projector
come from map_mul and map_star, with no matrix computation at all, and
IsQProjector (hence qRefl, already proved unitary and involutive) follows
immediately.
What the spike establishes #
subProj_mulVec— the raw action:subProj K *ᵥ ψisK.starProjectionapplied toψ, read back throughWithLp.subProj_mulVec_of_mem/subProj_mulVec_of_mem_orthogonal— the fixed space and the killed space, the two characterizations a reflection argument actually uses.isQProjector_subProj, and hencesubReflwithsubRefl_mul_self,subRefl_mem_unitaryGroup,subRefl_mulVec_of_mem(+ψ) andsubRefl_mulVec_of_mem_orthogonal(-ψ).spanProj/spanRefl— the finite-span case, which is the one the witness construction needs.
The membership side conditions are stated in EuclideanSpace (WithLp.toLp 2 ψ ∈ K)
rather than raw, deliberately: that is where the span of a family of vectors is
easy to reason about, and WithLp.toLp is an equivalence, so nothing is lost.
The projector #
The orthogonal projector onto K, as a raw matrix.
Instances For
The raw action of the projector.
It is an orthogonal projector. Both halves come from
Matrix.toEuclideanCLM being a star-algebra equivalence.
The fixed space.
The fixed space, as an iff. What a witness construction has to hit: being fixed by the projector is membership.
The killed space.
The reflection #
The reflection about K.
Equations
Instances For
The reflection fixes K.
The reflection negates Kᗮ.
The orthogonal complement #
The sign matters. The plan's Λ is the projector onto span{ψₓ}ᗮ, and its
reflection is minus the reflection about the span. A global sign shifts every
eigenphase by π, so it cannot be dropped when the operator is fed to
controlled phase detection.
The projector onto the orthogonal complement.
The reflection about the complement is minus the reflection about the subspace. This is the sign that must not be dropped.
Finite spans #
The case the witness construction needs: reflect about the span of a finite family of raw vectors.
The subspace spanned by a finite family of raw vectors.
Equations
- QuantumQueryComplexity.rawSpan v = Submodule.span ℂ (Set.range fun (i : ι') => WithLp.toLp 2 (v i))
Instances For
The projector onto the span of a finite family.
Equations
Instances For
The reflection about the span of a finite family.
Equations
Instances For
Each spanning vector is fixed by the projector.
Each spanning vector is fixed by the reflection.
The chord-distance spectral windows #
The near and far windows of a unitary U at threshold Δ² — equivalently
chord radius |Δ|, since Δ is not assumed nonnegative anywhere — as the
spectral projectors of the Hermitian matrix chordSq U = (1-U)ᴴ(1-U):
chordNearProj U Δ = cfc (fun l => if l ≤ Δ² then 1 else 0) (chordSq U),
chordFarProj U Δ = 1 - chordNearProj U Δ.
Two things make this work where diagonalizing a general unitary would not:
- The discontinuous mask is legitimate. Mathlib's
cfcneeds the function continuous only on the spectrum, and a matrix has finite real spectrum (Matrix.finite_real_spectrum), which is discrete — soSet.Finite.continuousOndischarges every side condition. Nothing here is an approximation of an indicator; it is the indicator. Upreserves the windows.chordSq_commutesaysUcommutes withchordSq U, andCommute.cfc_realupgrades that to commuting with anycfcof it. No simultaneous diagonalization, and no eigenbasis forU.
The complement of a projector is a projector.
The near window: the spectral projector of chordSq U for eigenvalues
at most Δ², i.e. chord distance at most |Δ|.
Equations
Instances For
The far window.
Equations
Instances For
U preserves the near window.
U preserves the far window.
Quadratic forms #
The bound below is an inequality between quadratic forms, so these are the manipulations it needs. Nothing here is specific to the chord form.
For an operator commuting with a projector, the quadratic form restricts to the projector's range.
A cfc of a nonnegative function has nonnegative quadratic form. Proved
by writing g = √g · √g, so the matrix is MᴴM; no order theory is needed.
The near-window bound #
The gap function (Δ² - l)·mask l, nonnegative everywhere.
Equations
- QuantumQueryComplexity.chordGapFun Δ l = (Δ ^ 2 - l) * QuantumQueryComplexity.chordMask Δ l
Instances For
The near-window bound: on the near window the chord distance is at most
|Δ| (stated squared, so no absolute value appears).
Decomposition, and the fixed space #
The two windows are complementary orthogonal projectors, so every state splits
into a near part and a far part with no cross term. And the fixed space of
U sits entirely in the near window, for every Δ: a vector with U x = x
has chord distance 0, and 0 ≤ Δ² always. That is the statement a phase
detector needs in order to conclude that it never mistakes a fixed vector for a
rotating one.
The Pythagorean decomposition across the two windows.
If g vanishes at 0 then cfc g a kills the kernel of a. Proved by
factoring g l = l · h l — legitimate for any g here, since h need only
be continuous on a finite spectrum.
The far window misses the fixed space.
The far-window bound #
The companion to chordNear_bound_sq, and the coercivity estimate the
uniform-clock argument consumes: off the near window the chord distance is at
least |Δ|. Same proof shape, with the gap function's sign reversed.
The far gap function (l - Δ²)·(1 - mask l), nonnegative everywhere.
Equations
- QuantumQueryComplexity.chordFarGapFun Δ l = (l - Δ ^ 2) * (1 - QuantumQueryComplexity.chordMask Δ l)
Instances For
The far-window bound (coercivity): off the near window the chord
distance is at least |Δ|.
The effective spectral gap #
The statement is naturally squared: everything in sight is a squared norm, and
squaring avoids square roots entirely. The core is the elementary identity
(1 - R_P R_L) w = 2 P w of SourceQuantumChordGap; the spectral content is only that
the near window contracts 1 - U by Δ and that a projector does not expand.
The effective spectral gap. If L annihilates w, then the part of
P w lying in the chord-distance window of threshold Δ² (radius |Δ|) of
R_P R_L has squared norm at most (Δ²/4)‖w‖².
No sign hypothesis on Δ is needed: the squared formulation makes 0 ≤ Δ
vacuous, since only Δ² ever appears.
Uniform-clock suppression on the far window #
The spectral half of the uniform-clock detector, and nothing operational: this section knows about a unitary and its chord windows, not about clocks, routines, or queries.
The statement is that on the far window — chord distance at least |Δ| — the
uniform average of the first T powers is small:
‖T⁻¹ ∑_{c<T} Uᶜ x‖² ≤ 4/(T²Δ²) · ‖x‖².
The proof is three lines of mathematics. Telescoping gives
(1 - U)·∑_{t<T} Uᵗ = 1 - Uᵀ, so the average, hit with 1 - U, becomes
T⁻¹(1 - Uᵀ)x, which has norm at most 2/T·‖x‖ because Uᵀ is unitary. On the
far window ‖(1 - U)y‖ ≥ |Δ|·‖y‖ (chordFar_bound_sq), and dividing by Δ
gives the bound. The far projector commutes with U, so it commutes with the
geometric sum and can be moved wherever it is needed.
The workhorse is stated multiplied out, T²Δ²·‖avg‖² ≤ 4‖x‖², which holds
for every Δ and every T with no positivity hypothesis; the divided form
follows for 0 < Δ and 0 < T.
A unitary moves a vector by at most twice its norm: ‖(1 - Uᵀ)x‖ ≤ 2‖x‖,
squared.
The far projector commutes with the geometric sum, since it commutes with
U.
Uniform-clock suppression, multiplied out. Holds for every Δ and every
T, with no positivity hypothesis: it is vacuous at Δ = 0 or T = 0,
which is exactly why the divided form below is the one that asks for both to be
positive.
Uniform-clock suppression, in the form the detector uses:
‖T⁻¹ ∑_{c<T} Uᶜ x‖² ≤ 4/(T²Δ²)·‖x‖² on the far window.
The input-dependent reflection, in exactly two queries #
The reflection the upper bound needs is about the orthogonal complement of a span of input-dependent vectors; it is built as
O_a · (fixed reflection) · O_a,
one query on each side of a fixed unitary, and that is exactly two queries —
QRoutine.conjFixed costs 2 · R.len, and inversion is free because the
transposition oracle is self-adjoint.
The sign is part of the statement. spanRefl v fixes the span, but the
construction reflects about the complement, and
subRefl (rawSpan v)ᗮ = -spanRefl v. Dropping that minus would shift every
eigenphase by π, which controlled phase detection would then read off wrongly.
inputRefl_run therefore carries the negation explicitly.
The input-dependent reflection: reflect about the orthogonal complement of a span, conjugated by one query on each side.
Equations
Instances For
Exactly two queries.
The operator it implements, with the complement's sign explicit.
The same, before the sign is resolved: it is the conjugate of the complement reflection.
The bridge to the mathematical layer #
The effective-gap theorem is cleanest stated for an arbitrary projector. This is the projector the operational two-query reflection actually reflects about, so the final algorithm can instantiate the abstract theorem with it.
The input-dependent projector: the fixed complement projector, conjugated by one query on each side.
Equations
Instances For
The operational reflection is the reflection about that projector.
The composition-order trap #
QRoutine.comp composes in execution order, while the matrix product
composes in the opposite one: comp_run : (R.comp S).run a = S.run a * R.run a.
So the operator R_P · R_L — the one the effective-gap theorem takes — is
implemented by running L first, i.e. by RL.comp RP. Getting this
backwards would silently build R_L · R_P, whose spectrum is the same but whose
eigenvectors are not, so it is pinned here as a theorem rather than a comment.
The reflection product, in execution order.
The reflection product #
effective_chord_gap_sq consumes qRefl P * qRefl L. This definition builds
exactly that operator as a routine, and in doing so pins the two facts a query
count depends on:
- the order —
Lis run first, so the operator isR_P · R_Land not its reverse (see the trap above); - the cost — the
L-side reflection is a fixed, input-independent unitary, supplied as a zero-queryofUnitary. So the product costs exactly the two queries of the input-dependent side.inputRefl_len = 2on its own says nothing about this: if both sides were input-dependent the product would cost four, and every downstream clock estimate would double.
inputReflProduct_len is therefore the theorem that licenses the 2 in the
detector's query accounting. The specialization of the effective-gap theorem to
this routine is proved in SourceQuantumOperationalGap.
The reflection product R_P · R_L, with R_L a fixed zero-query
reflection and R_P the input-dependent two-query reflection.
Equations
Instances For
Exactly two queries — because the L-side is fixed.
The operator it implements, in the order effective_chord_gap_sq
expects.
Lifting a routine along a workspace extension #
A routine built on workspace W runs unchanged on V × W: lift every fixed
step with liftReg, and the queries pass through because the oracle ignores the
workspace (blockFam_oracle). The query count is unchanged, and on the encoded
subspace the lifted routine does exactly what the original does.
This is what lets a subroutine written for a small workspace be used inside a circuit that carries extra registers — a phase register, say.
Lift a routine along a workspace extension.
Equations
- QuantumQueryComplexity.QRoutine.liftReg V R = { len := R.len, step := fun (t : ℕ) => QuantumQueryComplexity.liftReg V (R.step t), step_unitary := ⋯ }
Instances For
The lifted routine acts as the original on the encoded subspace.
The clock compiler: coherent powers of a routine #
A uniform clock needs selectPowers, the coherent map
|c⟩|ψ⟩ ↦ |c⟩ Uᶜ|ψ⟩,
which is not QRoutine.iterate — that applies a global Uⁿ to every branch.
The compilation is the standard one: T-1 rounds, the j-th applying U
exactly on the branches whose clock has reached j. Each round is
XOR the predicate j ≤ c into the control bit (a basis permutation, free)
→ QRoutine.control of the lifted routine (R.len queries)
→ XOR it back (free),
so a round costs exactly R.len and selectPowers R T costs (T-1)·R.len.
On top of SELECT this section builds the rest of the operational side of a
uniform-clock detector:
clockPack— a packed history, one workspace vector per clock branch. The branches are orthogonal, so Pythagoras holds andSELECTacts entrywise.uniformClock— the constant packed history, normalized.clockAvgProj— projection of the clock register onto its uniform superposition. On a packed history it returns the exact vector averageT⁻¹ ∑_{c<T} f c; onSELECTapplied to a uniform clock,T⁻¹ ∑_{c<T} Uᶜψ.clockPhaseRefl— the conjugationSELECTᴴ · clockRefl · SELECT, of exact length2(T-1)·R.len: the reflection is a fixed unitary, so conjugation is the only cost.
The workspace is CtrlWork ι (Fin T × W): the control bit and parking slot of
SourceQuantumControl, then the clock register, then the routine's own workspace. This
file depends only on Control and RoutineLift; whether that average is
small — the spectral half of the detector — is proved elsewhere, and the
connection to spectral suppression belongs in a later file, not here.
The workspace of a clocked routine.
Equations
- QuantumQueryComplexity.ClockWork ι T W = QuantumQueryComplexity.CtrlWork ι (Fin T × W)
Instances For
The state with clock c, control bit b, blank parking slot, and ψ
elsewhere.
Equations
Instances For
Flipping the control bit on the clock #
Flip the control bit exactly on the branches whose clock has reached j.
Equations
Instances For
The bit flip, as a permutation of the basis.
Equations
Instances For
The bit flip, as a zero-query unitary.
Equations
Instances For
The bit flip reads the clock and touches nothing else.
One round #
One clocked round: apply R exactly on the branches whose clock has reached
j. The two bit flips are free, so this costs exactly R.len queries.
Equations
- One or more equations did not get rendered due to their size.
Instances For
One round applies R exactly on the branches that have reached j.
Coherent powers #
The first n clocked rounds.
Equations
Instances For
Coherent powers: |c⟩|ψ⟩ ↦ |c⟩ Uᶜ|ψ⟩, compiled as T-1 rounds.
Equations
Instances For
The exact query count: (T-1) · R.len.
Coherent powers, verified: on a branch with clock c the routine has
been applied exactly c times.
Packed histories #
A packed history places a clock-indexed family in the clock branches, all
with a blank control bit. It is the shape every statement about the clock takes:
selectPowers acts on one entrywise, the branches are mutually orthogonal, and
the uniform clock is the constant packed history, normalized.
The packed history: f c in the branch whose clock reads c.
Equations
- QuantumQueryComplexity.clockPack f = ∑ c : Fin T, QuantumQueryComplexity.embedClock c false (f c)
Instances For
SELECT acts on a packed history entrywise: branch c gets Uᶜ.
The uniform clock #
The uniform clock: ψ in every branch, normalized.
Equations
- QuantumQueryComplexity.uniformClock T ψ = (↑√↑T)⁻¹ • QuantumQueryComplexity.clockPack fun (x : Fin T) => ψ
Instances For
The clock spread preserves basis support: where the underlying vector vanishes at the stripped coordinate, the clocked vector vanishes at the full one. This is what lets a readout of the underlying workspace act through the clock.
SELECT on the uniform clock builds the history Uᶜψ.
The averaging projector #
Projecting the clock register back onto the uniform superposition is what turns a
packed history into the vector average T⁻¹ ∑_{c<T} Uᶜψ. That average is
the whole point of a uniform clock: it is 1 on a fixed vector and small on a
vector whose chord distance is large, which is the suppression the detector
needs.
The averaging projector on the clock register.
Equations
Instances For
The averaging projector produces the exact vector average. On the packed
history f it returns the constant history T⁻¹ ∑_{c<T} f c — in particular, on
SELECT applied to a uniform clock, T⁻¹ ∑_{c<T} Uᶜψ.
The phase reflection #
clockRefl reflects about the uniform-clock subspace; it is a fixed unitary,
touching no oracle. Conjugating it by SELECT is the phase reflection of a
uniform-clock detector, and the conjugation is where the query count doubles —
and only doubles.
The reflection about the uniform-clock subspace.
Equations
Instances For
SELECTᴴ undoes the powers branchwise.
SELECTᴴ on a packed history.
The clock reflection is self-adjoint — it is the reflection about a projector. No positivity hypothesis.
The phase reflection: SELECTᴴ · clockRefl · SELECT.
Equations
Instances For
The exact query count of the phase reflection: 2(T-1)·R.len. The
reflection itself is free, so conjugation is the only cost.
The detector is self-adjoint. Conjugating a self-adjoint reflection by a unitary keeps it self-adjoint. With unitarity this is what makes the two signed conversion errors orthogonal, so they combine by an exact half-sum rather than a triangle inequality — which is where the constant would otherwise be lost.
The averaging identity, and exact completeness #
Two facts fix the detector's behaviour at the two extremes. On a fixed
vector it is exactly the identity — not approximately, which is what lets the
effective-gap argument conclude anything at all. On a general vector it returns
the vector average T⁻¹ ∑_{c<T} Uᶜψ, whose size is the detector's entire
content; bounding that is the spectral half, proved elsewhere.
The normalized averaging identity. Projecting SELECT applied to a
uniform clock returns a uniform clock carrying the exact vector average.
The uniform clock is fixed by the averaging projector: averaging a constant history changes nothing.
The reflection fixes the uniform clock (+1).
The reflection negates the complement (-1). This is the sign: with
qRefl P = 2P - 1 the uniform subspace is the +1 eigenspace, so a detector
built from it reports agreement as +1 and disagreement as -1.
SELECT fixes a uniform clock over a fixed vector: every branch applies
a power of U, and every power fixes ψ.
Exact completeness: on a fixed vector the detector is the identity, with no error term at all.
The uniform clock, as an isometry #
Moved down from SourceQuantumDetection: this geometry is generic, and the uniform
witness needs the clock isometry without importing the Boolean detection
layer.
The uniform clock is additive.
The uniform clock is ℂ-homogeneous.
The uniform clock is subtractive.
The empty clock carries nothing: at T = 0 the clock pack is an empty
sum, so uniformClock 0 ψ = 0. This is what lets T = 0 splits downstream
avoid positivity hypotheses.
The effective gap, for the operational reflection product #
The effective-gap specialization bridge, where the operational layer
(routines, queries, oracles) and the spectral layer (functional calculus,
chord windows) meet for the reflection product. It is not the only such
crossing — SourceQuantumClockDetector is the suppression bridge, joining the same
two layers for the uniform clock — so the two are kept apart, and
SourceQuantumInputDetector combines both estimates.
SourceQuantumChordWindow states the effective gap for an arbitrary pair of projectors,
which is how it should be stated — it is a fact about reflections, not about
queries. SourceQuantumReflection builds the operational product R_P · R_L as a
two-query routine. This section instantiates the spectral theorem with that routine.
The effective gap, for the operational product. The abstract theorem of
SourceQuantumChordWindow, instantiated by the two-query routine of
SourceQuantumReflection.
The uniform-clock detector #
The suppression bridge: the operational clock of SourceQuantumClock meets the
spectral estimate of SourceQuantumClockGap. It needs those two and nothing else — in
particular not SourceQuantumOperationalGap, which is for specializing this to the
input reflection product, not for stating it.
The detector is clockPhaseRefl R T = SELECTᴴ · clockRefl · SELECT, and the two
facts about it are exactly the two extremes:
Completeness (
SourceQuantumClock): on a fixed vector it is the identity, exactly.Soundness (here): on the far window it is
-1up to an error that shrinks like1/T:`‖D·u + u‖² ≤ 16/(T²Δ²)·‖x‖²`, `u = uniformClock T (F x)`.
Both come from one algebraic identity, D·u + u = 2·SELECTᴴ P SELECT u: the
detector's deviation from -1 is twice the averaging projector's output, so
soundness is precisely the statement that the vector average is small. The 16
is 4 · 4: one factor from that 2, squared, and one from ‖1 - Uᵀ‖ ≤ 2 inside
the suppression bound.
The detector's deviation from -1 is twice the averaged state. This is
the identity behind everything below: D·u + u = 2·SELECTᴴ P SELECT u.
Soundness of the detector, multiplied out. On the far window the
detector is -1 up to an error controlled by 1/(TΔ). As with the suppression
bound it rests on, this form needs no positivity hypothesis: at T = 0 the
factor T² kills the left side.
Soundness of the detector, in divided form:
‖D·u + u‖² ≤ 16/(T²Δ²)·‖x‖².
The detector for the input reflection product #
The specialization, and the only file that needs both the suppression bridge
(SourceQuantumClockDetector) and the effective gap for the operational product
(SourceQuantumOperationalGap). Everything upstream stays generic: ClockDetector
knows nothing about input reflections, OperationalGap nothing about clocks.
Three facts, which together are the detector's guarantee on P w:
- Cost.
4(T-1)queries, exactly.inputReflProductcosts2because theL-side reflection is a fixed, zero-queryofUnitary, and conjugatingSELECTdoubles(T-1)·2. If both sides were input-dependent this would be8(T-1). - The far part is large. The effective gap bounds the near part of
P wby(Δ²/4)‖w‖², so by the Pythagorean decomposition the far part carries at least‖P w‖² - (Δ²/4)‖w‖². - The detector reads
-1there, up to16/(T²Δ²)·‖P w‖².
Completeness is clockPhaseRefl_run_mulVec_uniformClock_of_fixed: on a vector
fixed by the reflection product the detector is exactly the identity, so the
two verdicts are separated with no error on one side.
The exact cost of the input detector: 4(T-1) queries.
The far window carries what the effective gap leaves. The near part of
P w is at most (Δ²/4)‖w‖², so the far part — the part the detector sees — is
at least ‖P w‖² minus that.
The input detector reads -1 on the far window, multiplied out — and,
like the bound it specializes, with no positivity hypothesis.
The input detector reads -1 on the far window, in divided form.
Witness states for state conversion #
The detector of SourceQuantumInputDetector distinguishes two
kinds of vector: those fixed by the reflection product R_P R_L, which it
reports as +1 exactly, and those in the far window, which it reports as
-1 up to 16/(T²Δ²). State conversion has to supply both, from a dual
adversary solution.
This section fixes the contracts — what a construction must prove — and derives everything that follows from them formally, so that the construction itself has a single, sharp target.
The positive side #
A positive witness for the input a is a state φ with
inputProj v a *ᵥ φ = φ and L *ᵥ φ = φ.
Both reflections then fix φ, hence so does inputReflProduct, hence the
detector is exactly the identity on uniformClock T φ. No estimate is
involved on this side, which is the point.
The witness is not the bare target. In the corrected LMRSS construction the
fixed point is φₓ = t₊ + (witness-workspace term), not t₊ itself: t₊ alone
is in general not fixed by inputProj v a, since being fixed means the
oracle-rotated state is orthogonal to every generator v i, which the
workspace term is exactly what arranges. Building the algorithm around bare
t₊ would be a real error, not a normalization detail, so the overlap
⟪t₊, φₓ⟫ is a separate obligation of the construction rather than something
this interface can assume.
inputProj_mulVec_eq_self_iff reduces the first contract to one inner product
per generator, which is the form a construction can discharge.
The negative side #
A negative witness is a w with L *ᵥ w = 0. That is precisely the hypothesis
of effective_chord_gap_sq_inputReflProduct, so the near component of P w is
at most (Δ²/4)‖w‖² and — by le_qNormSq_chordFar_inputProj — the far window
carries the rest.
That is the spectral half of the negative side, and it is all this interface supplies. It is not all the construction owes. Two further obligations stay with the concrete witness, and neither is formal:
- a bound on
‖w‖², since the effective gap charges(Δ²/4)‖w‖²against‖P w‖²— a negative witness of uncontrolled norm buys nothing; - the identification of
inputProj v a *ᵥ wwith the intendedt₋direction. As on the positive side,wcarries a correction term beyondt₋, and what has to be shown is thatinputProjkills that term, leaving the direction the algorithm measures.
So the asymmetry between the two sides is real but small: the positive side ends
in an exact fixed-point identity, the negative side in two estimates. Both are
quantitative facts about a particular construction, which is why neither lives
in IsPosWitness.
Being fixed by the input projector #
Fixed by the input projector = orthogonal to every generator, after the
query. inputProj v a conjugates the complement projector by one oracle call
on each side, so its fixed space is the pullback along the oracle of the
orthogonal complement of the generators.
The positive witness #
A positive witness for the input a: fixed by the input projector and by
L. These are the two contracts a state-conversion construction must
discharge; everything below is formal consequence.
The oracle-rotated witness is orthogonal to every generator.
The witness lies in the fixed space of
L.
Instances For
Build a witness from the generator-orthogonality form.
The input reflection fixes the witness.
The L-reflection fixes the witness.
The reflection product fixes the witness. Both factors do, so the product does — and this is the hypothesis the detector's completeness theorem asks for.
Detector completeness, immediately. On a uniform clock over a positive
witness the detector is exactly the identity — no error term, at cost
4(T-1).
The witness lies in the near window for every Δ: it is fixed, so its chord
distance is zero.
…and therefore contributes nothing to the far window, which is what keeps the two verdicts apart.
Generators are killed by the input projector #
inputProj v a is oracleMat a conjugating the projector onto
(rawSpan v)ᗮ. A generator, carried through the oracle, therefore lands on
the span itself and is annihilated. This is the one fact the uniform
witness's projector contracts need, and it is generic: nothing about the
particular family v enters.
The fixed space of inputProj, in the form a witness can check: one
inner product per generator, no spans.
The coherent target states #
These coherent targets fix the normalization used by the uniform extraction.
The Boolean witness construction is retained in SourceQuantumWitness.
The output register must not be indexed by O — O is an arbitrary
decidable type with no Fintype — but it need not be: only the image of
f is ever occupied, and Set.range f is finite whenever X is, whatever
O is. So the workspace is Option ↥(Set.range f): one "common"
coordinate beside one coordinate per attained output. (X = ∅ is handled
separately by the caller; [Nonempty O] is what keeps the readout total.)
The target states are
t_{x±} = (|common⟩ ± |f x⟩) / √2
and the identity that drives the whole construction is
⟪t_{y−}, t_{x+}⟫ = ½·[f y ≠ f x].
The ½ is load-bearing. It is what forces the witness scaling to be
φ_x = t_{x+} + α·V_x, w_y = t_{y−} − (2α)⁻¹·U_y,
since then (2α)⁻¹·α = ½ cancels the ½ above against
⟪U_y, V_x⟫ = [f y ≠ f x], giving exact orthogonality ⟪w_y, φ_x⟫ = 0.
Dropping the ½ — scaling by α⁻¹ instead — would destroy that
cancellation, and the resulting norm bound 1 + 2α⁻²c is in any case four
times looser than the correct 1 + c/(2α²).
These states are literally the alphabet gadget of SourceQuantumUniformAlphabet
applied to the alphabet Set.range f and rescaled by (√2)⁻¹: the ½ in
the overlap is exactly that rescaling squared. So the (1, ±e)
factorization does double duty — packets on σ, targets on range f — and
the two ½s that cancel have a common origin.
The attained output of x, as an element of the finite workspace.
Equations
- QuantumQueryComplexity.rangeElem f x = ⟨f x, ⋯⟩
Instances For
The + target state (|common⟩ + |f x⟩)/√2.
Equations
Instances For
The − target state (|common⟩ − |f x⟩)/√2.
Equations
Instances For
The normalization fact in the form the conversion bounds consume.
The target states are unit vectors.
The same identity in the form the orthogonality computation uses: the
overlap is ½ exactly on the pairs the dual constraint has to separate.
The common and output vectors #
The conversion combines the two signed targets through
common = (t_{x+} + t_{x−})/√2 out(f x) = (t_{x+} − t_{x−})/√2,
which are exactly the constant coordinate and the attained-output
coordinate: the algorithm starts on the input-independent common
state, and the detector carries it onto the output-labelled unit vector.
Distinct outputs give orthogonal out vectors, which is what the final
readout measures — one coherent conversion, never one detector per
output.
The common initial vector: the constant coordinate alone.
Equations
Instances For
The output-labelled vector: the coordinate of one attained output.
Equations
- QuantumQueryComplexity.outVec r none = 0
- QuantumQueryComplexity.outVec r (some val) = if val = r then 1 else 0
Instances For
The common and output vectors are orthogonal.
The tagged query packets #
The packet register is one Option σ block per pair (i, k) — every
pair carries its own flag coordinate. A shared flag would make different
blocks overlap, and the whole point of the construction is that they do not.
g_{i,k} = idleFlag_{i,k} + activeBlank_{i,k}
leftAtom_{i,k,a} = idleFlag_{i,k} + answer_{i,k,a} (the oracle image)
rightAtom_{i,k,a} = idleFlag_{i,k} − answer_{i,k,a}
Inside a block these are exactly uniformLeft and uniformRight, so the
[a ≠ b] factorization is inherited blockwise, and distinct blocks are
orthogonal. The ambient space is the target register direct-summed with
the packet blocks, which makes every target/packet cross term vanish by
construction.
A real vector placed in the packet block p, zero elsewhere. Every
block carries its own flag coordinate, which is what keeps distinct blocks
orthogonal.
Equations
Instances For
The one computation the packet layer needs: blocks are orthogonal, and inside a block the pairing is the real one.
idleFlag_{i,k} + answer_{i,k,a}: the oracle image of the tagged
generator g_{i,k} = idleFlag_{i,k} + activeBlank_{i,k}.
Equations
Instances For
idleFlag_{i,k} − answer_{i,k,a}.
Equations
Instances For
The blockwise factorization: distinct blocks are orthogonal, and inside a block the pairing is the inequality indicator.
Each atom has squared norm 2 — independently of the alphabet.
Targets and packets never interfere: they sit in complementary summands.
The packets of a dual solution #
U_x and V_x are the two dual families spent against the tagged atoms —
u on the left (oracle images), v on the right — without swapping the
families. One bilinear computation (qInner_sum_blockVec) serves both the
cross pairing and the norms, exactly as qInner_blockVec served the atoms.
The one bilinear computation of the packet layer. Block-diagonal by construction, so only the diagonal survives.
The left packet: the u-family against the oracle images.
Equations
- QuantumQueryComplexity.packetU u read x = ∑ p : ι × K, ↑(u x p.1 p.2) • QuantumQueryComplexity.blockVec p (QuantumQueryComplexity.uniformLeft (read x p.1))
Instances For
The right packet: the v-family against the flipped atoms.
Equations
- QuantumQueryComplexity.packetV v read x = ∑ p : ι × K, ↑(v x p.1 p.2) • QuantumQueryComplexity.blockVec p (QuantumQueryComplexity.uniformRight (read x p.1))
Instances For
The cross pairing is the dual constraint's left-hand side, verbatim and with the families unswapped.
The same, evaluated on a feasible dual solution: the packets realise the inequality indicator of the outputs.
The exact norms: ‖U_x‖² = 2·∑ u², no alphabet anywhere.
Targets never meet packets.
Two convenience pairings #
qInner_uTarget_uTarget transfers every target norm and overlap from the
real computation of the first section without repeating the real-to-complex
step; qInner_packetV_uTarget makes the ‖φ‖² expansion symmetric.
Operational realization #
UBasis is an abstract Hilbert basis: it cannot be handed to oracleMat or
inputProj, which live on QBasis. The realization places it inside a
genuine query basis whose workspace is
UWork R ι K = Option R ⊕ (ι × K)
— the target register, or the name of a packet block — by
target s ↦ (none, none, Sum.inl s)
block (i,k), ⊥ ↦ (none, none, Sum.inr (i,k))
block (i,k), some a ↦ (some i, some a, Sum.inr (i,k))
so a block's flag coordinate is idle (no index queried) and its answer coordinates are active at the block's own index. That is exactly what makes the oracle carry the physical generator
gen (i,k) = |⊥, ⊥, (i,k)⟩ + |i, ⊥, (i,k)⟩
onto the leftAtom packet: the second summand is the active-blank register,
which the transposition oracle fills with some (a i).
The embedding is injective but not surjective; uRealize extends by zero,
which is why it preserves qInner and qNormSq on the nose.
The workspace of the realized space: the target register, or the name of a packet block.
Equations
- QuantumQueryComplexity.UWork R ι K = (Option R ⊕ ι × K)
Instances For
Equations
Equations
- QuantumQueryComplexity.instUWorkFintype = { elems := Finset.univ.disjSum Finset.univ, complete := ⋯ }
The realized query basis.
Equations
- QuantumQueryComplexity.UQBasis R ι σ K = QuantumQueryComplexity.QBasis ι σ (QuantumQueryComplexity.UWork R ι K)
Instances For
The realization: place an abstract vector in the query basis, extending by zero off the embedded coordinates.
Equations
- QuantumQueryComplexity.uRealize ψ (none, none, Sum.inl s) = ψ (Sum.inl s)
- QuantumQueryComplexity.uRealize ψ (none, none, Sum.inr p) = ψ (Sum.inr (p, none))
- QuantumQueryComplexity.uRealize ψ (some i, some a, Sum.inr p) = if p.1 = i then ψ (Sum.inr (p, some a)) else 0
- QuantumQueryComplexity.uRealize ψ q = 0
Instances For
The embedding itself, as a function. Its image is not
oracle-invariant: the oracle swaps a realized answer coordinate with the
active-blank coordinate (some i, none, Sum.inr (i,k)), which is
deliberately outside the image. So there is no general theorem
oracleMat a *ᵥ uRealize ψ = uRealize (…) — that statement is false, and
only the generator-specific identities below hold.
Equations
Instances For
The physical generator #
idleFlag p = |⊥, ⊥, p⟩
activeBlank p = |p.1, ⊥, p⟩
uniformGen p = idleFlag p + activeBlank p
The oracle fixes the idle summand (no index is queried there) and fills the
active blank with some (a p.1), so it carries the generator exactly onto
the realized leftAtom packet. This is the generator-specific transport
identity the construction uses — arbitrary uRealize transport is false
(the image is not oracle-invariant, and the active-blank coordinate is
precisely the off-image coordinate the oracle uses), though linear
combinations of generator identities of course still hold.
|⊥, ⊥, p⟩ — the block's flag, idle.
Instances For
|p.1, ⊥, p⟩ — the block's blank answer register, active at its own
index. Outside the image of uRealize, by design.
Equations
Instances For
The tagged generator g_{i,k}.
Equations
Instances For
The realized leftAtom is a two-term basis sum.
The generator-specific transport identity.
The scalar pullback the projector proof consumes: testing a realized
vector against a generator, through the oracle, is testing it against the
leftAtom packet.
The per-generator cancellation. inputProj asks orthogonality
against each generator separately, so the aggregate ⟪U, V⟫ identity is
not enough: this is the statement that on the same input the letters agree
in every block, so every term of V_x is killed.
The realized states, and their contracts #
Named realized states, with their pairings and norms transported through the isometry immediately — after this section nothing downstream needs to know how the realization is built.
A realized target state.
Equations
Instances For
The realized u-packet.
Equations
Instances For
The realized v-packet.
Equations
Instances For
Transported pairings and norms #
The operational form of the u-packet #
The u-packet is the oracle applied to a combination of generators.
This is what puts it inside the killed space of inputProj.
The projector contracts #
The u-packet is killed.
The v-packet is fixed.
Targets are fixed.
Real-valued norm corollaries #
The scaled witnesses #
φ_x = t_{x+} + α·V_x
w_x = t_{x−} − (2α)⁻¹·U_x
ψ_x = 2α·t_{x−} − U_x ( = 2α·w_x when α ≠ 0)
α : ℝ, deliberately: a complex scaling would drag conjugation into the
cancellation. ⟪ψ_y, φ_x⟫ = 0 holds for every α: the target term
contributes 2α · ½·[f y ≠ f x] = α·[f y ≠ f x], and the packet term
contributes α · ⟪U_y, V_x⟫ = α·[f y ≠ f x], with opposite signs.
One global projector L = spanProj (uniformPhi P α) indexed by all
promise inputs — not one per output.
The realized + target.
Equations
Instances For
The realized − target.
Equations
Instances For
φ_x = t_{x+} + α·V_x.
Equations
- QuantumQueryComplexity.uniformPhi P α x = QuantumQueryComplexity.realizedTPlus f x + ↑α • QuantumQueryComplexity.realizedPacketV P.v read x
Instances For
w_x = t_{x−} − (2α)⁻¹·U_x.
Equations
- QuantumQueryComplexity.uniformW P α x = QuantumQueryComplexity.realizedTMinus f x - ↑(2 * α)⁻¹ • QuantumQueryComplexity.realizedPacketU P.u read x
Instances For
ψ_x = 2α·t_{x−} − U_x.
Equations
- QuantumQueryComplexity.uniformPsi P α x = ↑(2 * α) • QuantumQueryComplexity.realizedTMinus f x - QuantumQueryComplexity.realizedPacketU P.u read x
Instances For
The exact orthogonality, for every α.
ψ = 2α·w once α ≠ 0.
Hence ⟪w_y, φ_x⟫ = 0 for α ≠ 0.
The reversed pairing, by conjugation.
The global projector, indexed by all promise inputs.
Equations
Instances For
The exact norms #
Orthogonality of target and packet makes both a Pythagorean sum.
‖φ_x‖² = 1 + 2α²·(the v-mass) — no hypothesis on α.
‖w_x‖² = 1 + (2α)⁻²·2·(the u-mass) — valid for every α
(at α = 0 the inverse is 0, so this reads ‖w‖² = 1).
The displayed form, for α ≠ 0.
The input-projector contracts #
φ is a positive witness.
Realized-target wrappers #
t₊ ⟂ t₋ on matching outputs — in particular for the same input.
The target overlap the readout reads: ⟪t_{x+}, φ_x⟫ = 1.
The common and output states, realized #
The conversion's initial state is input-independent; its target is labelled
by the output alone. Both are unit vectors, and distinct outputs give
orthogonal targets — the coherent readout geometry, with no cardinality of
O anywhere.
The realized common initial state.
Equations
Instances For
The realized output-labelled target state.
Equations
Instances For
common = (t₊ + t₋)/√2, realized — for every x.
out(f x) = (t₊ − t₋)/√2, realized.
The output states are labelled by the output: the overlap is the equality indicator, which is what the final readout measures.
The output state is supported on its own label: off the target
coordinate (⊥, ⊥, inl (some (f x))) the realized output state vanishes.
This is exactly what the final readout consumes.
The witness states, built from a dual adversary solution #
From a DualPairOn read K f this section constructs the
generators, the fixed subspace, and both witness families, and discharges the
IsPosWitness contracts from the dual's feasibility identity.
The layout #
The workspace is Option K: the dual's register, plus a slot none used as a
flag. Three kinds of basis point matter, and the oracle is what separates them:
τ = (none, none, none) the target, in the idle sector
b i k = (some i, none, some k) blank answer — the generators
e i s k = (some i, some s, some k) the answer register holds `s`
The generators are the blank-answer states b i k. That single choice is
what makes the whole construction work, because the transposition oracle sends
O_x (b i k) = e i (read x i) k,
so span {O_x · gen} is the span of the true-answer states of x — the
input-dependent subspace, produced by conjugation rather than by fiat. By
inputProj_mulVec_eq_self_iff, a state is fixed by inputProj gen (read x)
exactly when it vanishes at every true-answer point of x.
The two witnesses #
posWitness x = τ - ∑_{i,k} u x i k · (∑_{s ≠ read x i} e i s k)
negWitness y = τ + ∑_{i,k} v y i k · e i (read y i) k
The positive witness puts the dual's u x on every false answer letter, so
it vanishes on the true-answer points of x and the first contract is immediate.
The negative witness puts the dual's v y on the true answer letters of y,
so it is τ plus a correction supported exactly where inputProj gen (read y)
kills.
They meet only where the two inputs disagree, and there the dual's feasibility identity
∑ i, [read x i ≠ read y i] · ∑ k, u x i k · v y i k = [f x ≠ f y]
says precisely what is needed:
⟪posWitness x, negWitness y⟫ = 1 - [f x ≠ f y] = [f x = f y].
So distinct outputs give orthogonal witnesses. Taking L to be the
projector onto the span of the positive witnesses of the inputs with f x = o
then fixes every positive witness and annihilates every negative one — the two
IsPosWitness contracts, and the negative side's L *ᵥ w = 0, all from one
inner product.
The |σ| - 1 in qNormSq_posWitness is the price of spreading u x i k over
every false letter: the construction cannot know which letter y will read. It
is 1 for a Boolean alphabet.
States of the construction's shape #
Every state below is α on the target and A i s k on the answer-letter
points. Proving the inner product and the norm once, for this shape, is what
keeps the rest of the file free of basis manipulation.
A state of the construction's shape.
Equations
Instances For
The generators and the target #
The generators: the blank-answer states, one per index and dual register.
Equations
Instances For
The target: the flag state of the idle sector.
Equations
- QuantumQueryComplexity.scTarget = QuantumQueryComplexity.scState 1 fun (x : ι) (x_1 : σ) (x_2 : K) => 0
Instances For
What the generators test. Pairing a generator against a state read through the oracle picks out the amplitude at a true-answer point.
Being fixed by the input projector is vanishing on the true answers.
The two witness families #
The positive witness for x: the target, minus the dual's u x spread
over every false answer letter.
Equations
- QuantumQueryComplexity.posWitness read f P x = QuantumQueryComplexity.scState 1 fun (i : ι) (s : σ) (k : K) => if s = read x i then 0 else -↑(P.u x i k)
Instances For
The negative witness for y: the target, plus the dual's v y on the
true answer letters.
Equations
- QuantumQueryComplexity.negWitness read f P y = QuantumQueryComplexity.scState 1 fun (i : ι) (s : σ) (k : K) => if s = read y i then ↑(P.v y i k) else 0
Instances For
The negative witness's correction term, supported exactly on the true-answer
points of y.
Equations
- QuantumQueryComplexity.negCorr read f P y = QuantumQueryComplexity.scState 0 fun (i : ι) (s : σ) (k : K) => if s = read y i then ↑(P.v y i k) else 0
Instances For
The dual constraint, as an inner product #
The one computation the construction rests on.
Distinct outputs give orthogonal witnesses. This is the dual's feasibility identity, read as an inner product.
The positive contracts #
The positive witness vanishes on the true answers of its own input, which is the first contract.
The fixed subspace: the span of the positive witnesses of the inputs that
f sends to o.
Equations
- QuantumQueryComplexity.scKer read f P o = QuantumQueryComplexity.subProj (QuantumQueryComplexity.rawSpan fun (x : { x : X // f x = o }) => QuantumQueryComplexity.posWitness read f P ↑x)
Instances For
The fixed subspace fixes the positive witnesses, which is the second contract.
Both contracts, so the detector of SourceQuantumInputDetector answers +1 on
this witness exactly, at cost 4(T-1).
The negative side #
The fixed subspace annihilates the negative witnesses. This is the
hypothesis effective_chord_gap_sq_inputReflProduct asks for, and it is exactly
the orthogonality supplied by the dual constraint.
A projector kills anything orthogonal to its own image of that vector. This is the general fact; it is stated here because nothing upstream needs it yet.
The input projector kills the negative witness's correction term, which is supported exactly on the true-answer points it annihilates.
The negative witness is the target, up to what the input projector kills. This is the negative side's projected-direction obligation.
Overlap and norms #
The exact algebra above says nothing about size; these are the estimates the query bound will consume.
The positive witness has overlap exactly 1 with the target. The
correction term lives entirely off the target, so nothing is lost.
The negative witness's norm is 1 plus the dual's v-mass.
The positive witness's norm, exactly: 1 plus the dual's u-mass, once
per false letter.
The negative witness is short: ‖w‖² ≤ 1 + c for a dual of cost c.
The detector on the witness states: the two acceptance estimates #
The last quantitative step of the state-conversion construction.
SourceQuantumWitness built the witness states from a DualPairOn and discharged the
exact contracts; this section adds the estimates and combines them with the
fidelity bounds of SourceQuantumFidelity into the two numbers the eventual
measurement reads: for the detector D = scDetector at clock length T and
the initial state u = uniformClock T scTarget,
f x = o(le_re_qInner_scDetector_of_eq):Re⟪u, D_x u⟫ ≥ 2/(1 + (|σ|−1)cu) − 1, from the exact fixed pointposWitness x, its overlap⟪τ, φₓ⟫ = 1, and its norm‖φₓ‖² ≤ 1 + (|σ|−1)cu;f y ≠ o(re_qInner_scDetector_le_of_ne):Re⟪u, D_y u⟫ ≤ (Δ/2)√(1+cv) + 4/(TΔ) − (1 − (Δ²/4)(1+cv)), from the effective gap applied tonegWitness y(whose input projection is exactlyτ) and the uniform-clock suppression on the far window.
With Δ ~ 1/√(1+cv) and T ~ 1/Δ ~ √(1+cv) the second bound is ≈ −1 while the
first is ≈ +1 for small (|σ|−1)cu — the separation a Hadamard test turns
into a bounded-error measurement. Choosing those parameters, and the dual
rescaling DualPairOn.scale that balances cu against cv, is the algorithm
extraction's job; this section keeps every bound parametric.
The clock geometry those estimates ride on — the isometry
qInner_uniformClock, additivity uniformClock_add, and their companions —
is supplied by SourceQuantumClock and is shared with the uniform extraction.
Rescaling a dual pair #
Rescaling a dual pair: u ↦ αu, v ↦ α⁻¹v. Feasibility is
scale-invariant, and the two sides' masses trade against each other — the
balancing device of the algorithm extraction.
Equations
Instances For
The u-mass scales by α².
The v-mass scales by α⁻².
The witness norms, bounded #
The positive witness is at least a unit vector.
The positive witness is short: ‖φₓ‖² ≤ 1 + (|σ|−1)·cu when the
dual's u-mass at x is at most cu. The |σ|−1 is the price of spreading
u x over every false letter; it is 1 for a Boolean alphabet.
The detector #
The detector for output o: the uniform-clock phase detector of the
reflection product built from the witness construction's generators and the
span of the positive witnesses of f⁻¹(o). Cost: 4(T−1) queries.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The negative input, prepared #
For f y ≠ o the fixed subspace annihilates negWitness y, whose input
projection is exactly the target. So the effective gap bounds the near part
of the target itself, and the detector's far-window guarantee applies to the
rest — with ‖·‖² = 1 on the right of both.
The near part of the target is small on a negative input:
‖N_Δ τ‖² ≤ (Δ²/4)(1 + cv).
The detector reads −1 on the target's far part, up to 16/(T²Δ²).
(The bound holds for every input; only its use is specific to f y ≠ o.)
The two acceptance estimates #
The detector accepts a positive input: for f x = o,
Re⟪u, D u⟫ ≥ 2/(1 + (|σ|−1)cu) − 1 on u = uniformClock T scTarget.
The detector rejects a negative input: for f y ≠ o,
Re⟪u, D u⟫ ≤ (Δ/2)√(1+cv) + 4/(TΔ) − (1 − (Δ²/4)(1+cv)) on
u = uniformClock T scTarget.
The uniform detector and its conversion errors #
The detector of the cardinality-free construction: the clocked phase
reflection of the reflection product built from the physical generators and
the one global projector uniformL P α, at exactly 4(T-1) queries. The
two signed conversion errors are
e₊ = D·clock(t_{x+}) − clock(t_{x+}),
e₋ = D·clock(t_{x−}) + clock(t_{x−}),
and this section proves the three conversion-distance facts:
- the positive bound
‖e₊‖² ≤ 8α²c— the detector fixes the clocked witnessclock(φ_x)exactly, so on the bare target the error is the moved packet,e₊ = α·(1 − D)·clock(V_x), one unitary-move bound away from thev-mass thatP.IsCostLecontrols. AT = 0split (uniformClock_zero) keeps the statement free of any positivity hypothesis onT; - the negative bound
‖e₋‖ ≤ Δ√(1 + c/(2α²)) + 4/(TΔ)by one near/far split of the−target, the only statement needinghα,hT,hΔ; - the combination: the end-to-end error
D·clock(common) − clock(out)is(e₊ + e₋)/√2by pure linearity, ande₊ ⟂ e₋exactly — the detector is self-adjoint and unitary — so its squared norm is the exact half-sum(‖e₊‖² + ‖e₋‖²)/2, never a triangle bound.
Nested register instances #
Named canonical instances for QBasis, CtrlWork, and UWork keep the
nested register types within the default instance-search limit. The proofs
retain the same finite types and oracle model.
The uniform detector: the clocked phase reflection of the reflection
product R_P·R_L, for the physical generators and the global projector
uniformL P α.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The unfolding equation, so nothing downstream unfolds the definition.
The exact cost of the uniform detector: 4(T-1) queries.
The detector fixes the clocked witness exactly — φ_x is a positive
witness, so this is completeness with no error term.
The two conversion errors #
e₊ = D·clock(t_{x+}) − clock(t_{x+}): the deviation of the detector
from +1 on the clocked + target.
Equations
- One or more equations did not get rendered due to their size.
Instances For
e₋ = D·clock(t_{x−}) + clock(t_{x−}): the deviation of the detector
from -1 on the clocked − target. The + is the sign of the detector's
-1 verdict.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The positive bound #
The rearranged plus error: the detector fixes clock(φ_x) and
φ_x = t_{x+} + α·V_x, so the error on the bare target is the moved packet,
e₊ = α·(1 − D)·clock(V_x).
The positive conversion bound: ‖e₊‖² ≤ 8α²c. No hypothesis on T
or α: the T = 0 clock is zero, and the bound's sign comes from the cost
hypothesis itself.
The negative bound #
w_x is a negative witness — uniformL kills it — and inputProj sends it
to the bare − target, so the effective gap and the divided detector bound
apply to the near/far split of t_{x−} directly:
- the near part is small —
‖N‖² ≤ (Δ²/4)‖w_x‖²byeffective_chord_gap_sq_inputReflProduct— so its detector error costs at most2‖N‖; - on the far part the detector reads
-1up to4/(TΔ), byqNormSq_clockPhaseRefl_add_le_div_inputReflProductand‖t_{x−}‖ = 1.
One near/far triangle inequality combines the two. This is the only place
hα, hT, hΔ are genuinely needed.
The near part of the realized − target, at window Δ.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The far part of the realized − target, at window Δ.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The near/far split of the − target.
The near part is small: the effective gap charges it to ‖w_x‖²,
which the cost hypothesis bounds.
The detector reads -1 on the far part, up to 16/(T²Δ²) — the
− target is a unit vector, so no witness norm enters.
The negative conversion bound:
‖e₋‖ ≤ Δ·√(1 + c/(2α²)) + 4/(TΔ), by one near/far triangle
inequality.
The combined conversion error #
The end-to-end error runs the detector on the clocked input-independent
common state against the clocked output-labelled target; by linearity it
is (e₊ + e₋)/√2. The two signed errors are exactly orthogonal: the
detector is self-adjoint (a reflection conjugated by a unitary) and
unitary, so in
⟪e₊, e₋⟫ = ⟪Ds₊, Ds₋⟫ + ⟪Ds₊, s₋⟫ − ⟪s₊, Ds₋⟫ − ⟪s₊, s₋⟫
the outer terms cancel by unitarity and the middle terms by
self-adjointness. The conversion error is therefore the exact half-sum
½(‖e₊‖² + ‖e₋‖²) — a triangle bound here would not support 8192.
The detector is self-adjoint, inherited from
clockPhaseRefl_run_conjTranspose.
The two signed errors are orthogonal — exactly, for every T and
α.
The end-to-end conversion error: the detector applied to the clocked input-independent common state, against the clocked output-labelled target.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The conversion error is the scaled sum of the signed errors — pure linearity, no hypotheses at all.
The exact half-sum: with e₊ ⟂ e₋,
‖err‖² = (‖e₊‖² + ‖e₋‖²)/2 — an equality, not a triangle bound.
The combined conversion bound — the two component estimates through the exact half-sum; the only statement needing all three parameter hypotheses.
The parameters #
With B = 1 + c:
α = (√(128B))⁻¹, Δ = (64B)⁻¹, T = ⌈2048B⌉.
Then 8α²c = c/(16B) ≤ 1/16; the near coefficient 1 + c/(2α²) = 1 + 64cB ≤ 64B² so the near term is at most Δ·8B = 1/8; TΔ ≥ 2048B/(64B) = 32
so the far term is at most 1/8; hence ‖e₋‖² ≤ 1/16 and the combined
squared conversion distance is at most (1/16 + 1/16)/2 = 1/16 — at
4(T − 1) ≤ 8192(1 + c) queries — the
uniformExtractionConstant, attained. Only Δ and α balance against c; the
budget hypothesis is just 0 ≤ c.
The instantiated conversion bound: at the chosen parameters the
squared conversion distance is at most 1/16, for every promise input.
The detector at the chosen clock stays within the acceptance
budget: 4(T − 1) ≤ 8192(1 + c) — the
uniformExtractionConstant is attained.
The uniform extraction #
The packaging of the cardinality-free construction: the detector run on the
clocked input-independent common state, with the readout announcing the
label held in the target register, is an algorithm computing f on the
promise with error 1/16 — within 8192(1 + c) queries.
The acceptance statement exists_algorithm_of_dualPairOn_uniform has the
required scope, every clause load-bearing:
- arbitrary decidable output
O, no[Fintype O]; uniformExtractionConstant = 8192, one fixed absolute constant — independent of|σ|,|O|,|range f|;[Nonempty O](the readout needs a junk label off the target register) and0 ≤ care genuine hypotheses;- promise-native, and no appeal to general-output strong duality.
The correctness chain is three moves: the algorithm's final state is
D·clock(common), which is within squared distance 1/16 of
clock(out(f x)) (qNormSq_uniformConvError_le_sixteenth); the clocked
output state announces f x surely (its support carries the label in
the target register — realizedOut_apply_of_ne through
uniformClock_apply_eq_zero); and the distance-to-success bridge
(le_qProb_of_qNormSq_sub_le, output-cardinality-free by design) converts
the distance into the success probability ≥ 1 − 1/16.
The uniform extraction constant — one fixed absolute constant, never a free variable.
Equations
Instances For
The readout #
The label of one workspace coordinate: the output held in the target
register, or the junk label o₀ anywhere else.
Equations
- QuantumQueryComplexity.uniformLabel f o₀ (Sum.inl (some r)) = ↑r
- QuantumQueryComplexity.uniformLabel f o₀ (Sum.inl none) = o₀
- QuantumQueryComplexity.uniformLabel f o₀ (Sum.inr val) = o₀
Instances For
The readout: announce the label held in the target register of the clocked workspace.
Equations
- QuantumQueryComplexity.uniformReadout f o₀ T b = QuantumQueryComplexity.uniformLabel f o₀ b.2.2.2.2.2
Instances For
The clocked output state announces its label surely: it is its own
restriction to the f x-sector of the readout.
The algorithm #
The uniform extraction algorithm: prepare the clocked common state, run the detector, read the target register.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The uniform algorithm computes f at the chosen parameters: error
1/16 on the promise, in exactly 4(T − 1) queries.
The acceptance statement #
A dual solution is an algorithm, with no cardinality anywhere: cost
c yields error 1/16 within uniformExtractionConstant·(1 + c) queries —
independent of |σ|, |O| and |range f|, for any decidable output type.
The dual-to-algorithm upper bound #
The extraction: a feasible DualPairOn read K f for a Boolean f becomes
a quantum query algorithm. The algorithm is nothing but the Hadamard test of
the o = true detector on the target state,
scAlg = hadTest (scDetector read f P true T) (uniformClock T scTarget),
at exactly 4(T−1) queries, and its correctness is the two acceptance
estimates of SourceQuantumDetection pushed through hadTest_prob_true/false:
scAlg_computes— the parametric correctness: any(T, Δ, cu, cv, ε)satisfying the two explicit inequalities givesComputesWithErrorOn (scAlg …) (4(T−1)) read f ε;exists_algorithm_of_dualPairOn— the endgame: a dual of costc > 0is compiled, after thescalebalancingα² = (16|σ|c)⁻¹and the choicesΔ = (16√B)⁻¹,T = ⌈2048√B⌉forB = 1 + 16|σ|c², into membership4(T−1) ∈ QueryCounts read f (1/16), 4(T−1) ≤ 8192·(1 + 4√|σ|·c),with the
qQueryOncorollaryqQueryOn_le_of_dualPairOn. For a Boolean alphabet√|σ| = √2, so the bound isO(c)with an explicit constant.
The error budget of the endgame, for the record: positive side
s·cu = (|σ|−1)/(16|σ|) ≤ 1/16, so the acceptance is at least
1/(1 + 1/16) = 16/17 ≥ 15/16; negative side
1/64 + 1/64 + 1/2048 = 65/2048 ≤ 1/16. Nothing is tight — the constants
are chosen round, not small.
The output convention: scAlg announces true on constructive interference
(control 0), which is the f x = true side because scKer read f P true
spans the positive witnesses of f⁻¹(true).
The extracted algorithm: the Hadamard test of the o = true detector
on the target state. Cost: exactly 4(T−1) queries.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Parametric correctness of the extracted algorithm. The two hypotheses are exactly the two acceptance estimates' final forms; any parameter choice satisfying them gives a bounded-error algorithm.
The endgame: choosing the parameters #
Balance with α² = (16|σ|c)⁻¹, detect at radius Δ = (16√B)⁻¹ with clock
T = ⌈2048√B⌉, where B = 1 + 16|σ|c².
A dual solution of cost c is an algorithm: error 1/16, at most
8192(1 + 4√|σ|·c) queries.
The qQueryOn corollary: Q_{1/16}(f) ≤ 8192(1 + 4√|σ|·c) for any
dual of cost c.
Uniform extraction: the HasDualOn wrappers #
The bundled form of the cardinality-free extraction. HasDualOn hides the
dual dimension type and is defined in SourcePromiseHasDual in Adversary.
These wrappers connect it to the operational constructions in StateConversion.
Both wrappers are one destructuring away from
exists_algorithm_of_dualPairOn_uniform: any bundled dual solution of cost
c gives Q_{1/16}(f) ≤ 8192(1 + c), and Q_{1/3} by error
monotonicity — for any decidable output type, with no |σ|, |O| or
|range f| anywhere.
Cardinality-free extraction from a bundled dual:
Q_{1/16}(f) ≤ 8192(1 + c) for any decidable output type.
The bounded-error form, by error monotonicity.