Fundamental Limitations on Subquadratic Alternatives to Transformers

2 Fine-grained complexity and similarity problems

Definition 43 Truly subquadratic time
#

A nonnegative running-time bound \(T:\mathbb {N}\to \mathbb {R}\) is truly subquadratic in \(n\) if there exist constants \(\varepsilon {\gt}0\), \(C{\gt}0\), and \(n_0\in \mathbb {N}\) such that for every \(n\geq n_0\),

\[ T(n)\leq C n^{2-\varepsilon }. \]

When an auxiliary dimension \(\ell \) is present, a bound \(T:\mathbb {N}\times \mathbb {N}\to \mathbb {R}\) is truly subquadratic up to polynomial factors in \(\ell \) if there are \(\varepsilon {\gt}0\), \(C{\gt}0\), an exponent \(b\in \mathbb {N}\), and \(n_0\) such that

\[ T(n,\ell )\leq C n^{2-\varepsilon }(1+\ell )^b \]

for all \(n\geq n_0\) and all allowed \(\ell \).

Definition 44 Computational problem specification
#

A computational problem \(P\) with principal size parameter \(n\) and auxiliary dimension parameter \(\ell \) consists of the following concrete data: an input type \(I_P\), size functions

\[ N_P:I_P\to \mathbb {N},\qquad L_P:I_P\to \mathbb {N}, \]

a valid-input predicate \(\Valid _P(x)\), an output type \(O_P(x)\) for each input \(x\), and a correctness relation

\[ \Correct _P(x,y) \]

for \(y\in O_P(x)\). The relation \(\Correct _P(x,y)\) is required to encode the real yes/no, optimization, or approximation condition of the problem, not merely that \(y\) has the right syntactic type. For a decision problem, \(O_P(x)=\{ 0,1\} \) and correctness means output \(1\) exactly on promised yes instances and output \(0\) exactly on promised no instances.

Definition 45 Deterministic operational semantics

Fix a computational problem \(P\). A deterministic computation model for algorithms solving \(P\) consists of a type of program codes, and for each program code \(A\) and input \(x\in I_P\), a concrete configuration type \(\operatorname {Config}_A(x)\) together with: an initial configuration \(\operatorname {init}_A(x)\in \operatorname {Config}_A(x)\), a deterministic step map

\[ \operatorname {step}_A(x): \operatorname {Config}_A(x)\to \operatorname {Config}_A(x), \]

a halting predicate \(\operatorname {Halt}_A(x,c)\) on configurations, and an output relation

\[ \operatorname {Out}_A(x,c,y) \]

between halted configurations \(c\) and outputs \(y\in O_P(x)\). The run after \(s\) steps is defined recursively by

\[ \operatorname {Run}_A(x,0)=\operatorname {init}_A(x),\qquad \operatorname {Run}_A(x,s+1)= \operatorname {step}_A(x)(\operatorname {Run}_A(x,s)). \]

The statement

\[ \operatorname {HaltsWith}_A(x,s,y) \]

means the run first halts at exactly step \(s\) and returns \(y\):

\[ \operatorname {Halt}_A(x,\operatorname {Run}_A(x,s))\wedge \operatorname {Out}_A(x,\operatorname {Run}_A(x,s),y) \]

and, for every \(r{\lt}s\), \(\neg \operatorname {Halt}_A(x,\operatorname {Run}_A(x,r))\). The output relation is functional on halted configurations, and the deterministic run has a unique first halting time: if \(\operatorname {HaltsWith}_A(x,s,y)\) and \(\operatorname {HaltsWith}_A(x,s',y')\), then \(s=s'\) and \(y=y'\). Every halted configuration has a unique output: if \(\operatorname {Halt}_A(x,c)\), then there exists a unique \(y\in O_P(x)\) such that \(\operatorname {Out}_A(x,c,y)\). Hence a halted configuration determines a concrete output value by unique description, not by an externally supplied oracle-answer parameter.

This node is the operational semantics used below. A step count is the finite number \(s\) appearing in \(\operatorname {HaltsWith}_A(x,s,y)\), not an arbitrary field attached to a total function.

Definition 46 Correct algorithm for a problem

An algorithm \(A\) for a computational problem \(P\) is a program code in the deterministic operational semantics of Definition 45. Its execution on input \(x\) is the concrete run \(\operatorname {Run}_A(x,s)\) generated by the initial configuration and step map. For a valid input \(x\), the notation \(A(x)\) denotes the unique output \(y\in O_P(x)\) for which there exists a finite step count \(s\) with \(\operatorname {HaltsWith}_A(x,s,y)\); this notation is defined only from the halting relation and the uniqueness guaranteed by the operational semantics.

The algorithm halts on promised inputs when, for every valid \(x\), there exist \(s\in \mathbb {N}\) and \(y\in O_P(x)\) such that \(\operatorname {HaltsWith}_A(x,s,y)\). It is correct when

\[ \Valid _P(x)\Rightarrow \exists s\in \mathbb {N},\ \exists y\in O_P(x), \operatorname {HaltsWith}_A(x,s,y)\wedge \Correct _P(x,y) \]

for every input \(x\). Its running-time witness is a function \(T_A:\mathbb {N}\times \mathbb {N}\to \mathbb {R}_{\geq 0}\) such that on every valid input \(x\) there are \(s\in \mathbb {N}\) and \(y\in O_P(x)\) with

\[ \operatorname {HaltsWith}_A(x,s,y),\qquad \Correct _P(x,y),\qquad s\leq T_A(N_P(x),L_P(x)). \]

Thus the claimed running time is semantically linked to the first halting time of the operational execution, and the returned value is linked to the problem’s correctness relation. The structure does not permit an unconstrained \(\operatorname {computation\_ steps}\) witness or an arbitrary total function unrelated to execution.

Definition 47 Exact worst-case running-time bound

A function \(T:\mathbb {N}\times \mathbb {N}\to \mathbb {R}_{\geq 0}\) is a worst-case running-time bound for an algorithm \(A\) solving \(P\) if for every valid input \(x\) with \(N_P(x)=n\) and \(L_P(x)=\ell \), the execution of \(A\) on \(x\) halts within \(T(n,\ell )\) steps and returns an output satisfying \(\Correct _P(x,A(x))\). The bound is exact for a pair \((n,\ell )\) if it is the maximum of these running times over all valid inputs with those parameters, and it is an upper bound if it is at least that maximum.

Lemma 48 Promised-input solvers halt correctly

If \(A\) is a correct algorithm for \(P\) with worst-case running-time bound \(T\), then for every valid promised input \(x\), \(A(x)\) halts within \(T(N_P(x),L_P(x))\) steps and \(\Correct _P(x,A(x))\) holds.

Proof

This is the defining universal guarantee of a correct algorithm equipped with the stated worst-case running-time bound, specialized to the valid input \(x\).

Definition 49 Oracle reduction data

An oracle reduction datum \(R\) from \(P\) to \(Q\) assigns to every valid \(P\)-input \(x\) a finite number \(r(x)\) of oracle calls, a sequence of concrete \(Q\)-inputs

\[ q_1(x),\ldots ,q_{r(x)}(x)\in I_Q, \]

and a postprocessing map which turns any sequence of oracle answers \(z_s\in O_Q(q_s(x))\) into a final output

\[ y_R(x;z_1,\ldots ,z_{r(x)})\in O_P(x). \]

Adaptive reductions are represented by allowing the later query \(q_s\) to be the query produced after the earlier answer values \(z_1,\ldots ,z_{s-1}\) have been fixed; the completed run is still the finite sequence of concrete query-answer pairs and the final output above.

Definition 50 Oracle reduction trace

For an oracle reduction datum \(R\) and a valid \(P\)-input \(x\), an oracle reduction trace is the finite sequence

\[ (q_1,z_1),\ldots ,(q_r,z_r),y. \]

It is consistent with \(R\) when \(r=r(x)\), each \(q_s\) is the query produced by \(R\) at call \(s\) on input \(x\) after the earlier answers in the trace, each \(z_s\in O_Q(q_s)\), and

\[ y=y_R(x;z_1,\ldots ,z_r). \]
Definition 51 Valid oracle queries

An oracle reduction datum \(R\) sends valid \(P\)-inputs to valid \(Q\)-queries if for every valid \(P\)-input \(x\) and every trace consistent with \(R\) on \(x\), each query in the trace satisfies \(\Valid _Q(q_s)\).

Definition 52 Correct oracle answers

In a trace for a reduction from \(P\) to \(Q\), the oracle answers are correct when every answer \(z_s\) satisfies the target problem’s correctness relation on the concrete query that produced it:

\[ \Correct _Q(q_s,z_s) \]

for all oracle-call positions \(s\).

Definition 53 Oracle reduction validity and correctness obligations

An oracle reduction datum \(R\) from \(P\) to \(Q\) is correct if both of the following universal obligations hold. First, it sends every valid \(P\)-input only to valid \(Q\)-queries in the sense of Definition 51. Second, for every valid \(P\)-input \(x\) and every trace consistent with \(R\) on \(x\), if all oracle answers in that trace are correct for their concrete \(Q\)-queries, then the final output \(y\) in the trace satisfies

\[ \Correct _P(x,y). \]

This requirement is uniform over all possible correct oracle answers, so the reduced algorithm may not rely on a special choice among multiple valid answers returned by the oracle.

Definition 54 Oracle reduction answer-history type

For an oracle reduction datum \(R\), a valid \(P\)-input \(x\), and a phase index \(s\in \{ 0,\ldots ,r(x)\} \), the answer-history type

\[ \Hist _R(x,s) \]

is the concrete type of finite query-answer prefixes of length \(s\):

\[ H=((q_1,z_1),\ldots ,(q_s,z_s)). \]

Such an \(H\) is well formed when every \(q_u\) is the \(u\)th query produced by the reduction datum \(R\) on input \(x\) after the earlier answers \(z_1,\ldots ,z_{u-1}\), and every \(z_u\in O_Q(q_u)\). Thus \(\Hist _R(x,0)\) contains the empty history, while \(\Hist _R(x,r(x))\) contains full oracle-answer histories for completed runs of \(R\) on \(x\).

This history type is the only place in the local-phase presentation where raw oracle answers and query-answer pairs live. It is passed as a separate argument to later query, update, and postprocessing functions.

Definition 55 Oracle reduction non-oracle component types

A local-phase presentation of an oracle reduction datum \(R\) supplies one global, history-free record of component type families. Lean-facing, the declaration

\[ \operatorname {def\_ oracle\_ reduction\_ local\_ component\_ types}(P,Q,R) \]

is a structure with exactly the following six named fields and no others:

\[ \begin{aligned} \operatorname {Control}& : \prod _{x:I_P}\prod _{h_x:\Valid _P(x)} \{ 0,\ldots ,r(x)\} \to \operatorname {Type},\\ \operatorname {CounterName}& : \prod _{x:I_P}\prod _{h_x:\Valid _P(x)} \{ 0,\ldots ,r(x)\} \to \operatorname {Type},\\ \operatorname {TapeName}& : \prod _{x:I_P}\prod _{h_x:\Valid _P(x)} \{ 0,\ldots ,r(x)\} \to \operatorname {Type},\\ \operatorname {TapeSymbol}& : \prod _{x:I_P}\prod _{h_x:\Valid _P(x)} \{ 0,\ldots ,r(x)\} \to \operatorname {Type},\\ \operatorname {RegisterName}& : \prod _{x:I_P}\prod _{h_x:\Valid _P(x)} \{ 0,\ldots ,r(x)\} \to \operatorname {Type},\\ \operatorname {RegisterValue}& : \prod _{x:I_P}\prod _{h_x:\Valid _P(x)} \{ 0,\ldots ,r(x)\} \to \operatorname {Type}. \end{aligned} \]

For a valid \(P\)-input \(x\), proof \(h_x:\Valid _P(x)\), and phase \(s\in \{ 0,\ldots ,r(x)\} \), the six instantiated history-free component types are therefore

\[ \operatorname {Control}_R(x,h_x,s),\quad \operatorname {CounterName}_R(x,h_x,s),\quad \operatorname {TapeName}_R(x,h_x,s),\quad \operatorname {TapeSymbol}_R(x,h_x,s),\quad \operatorname {RegisterName}_R(x,h_x,s),\quad \operatorname {RegisterValue}_R(x,h_x,s). \]

The record itself is indexed only by \((P,Q,R)\). The phase is an argument to each of the six fields, not an enclosing answer-history-dependent parameter. The structure has no field named \(\operatorname {AnswerHistory}\), \(\operatorname {History}\), \(\operatorname {Trace}\), or any synonym, and it has no constructor argument whose type is an oracle-answer history. In particular, the declaration must not include a parameter \(H:\Hist _R(x,s)\), a default parameter \(H:=\Hist _R(x,s)\), a let-bound reference to \(\Hist _R(x,s)\), or any field that returns or stores \(\Hist _R(x,s)\).

These types are parameters of the local presentation at \((R,x,h_x,s)\) and are chosen before any oracle answers are supplied. None of their declarations, indices, constructors, fields, subtype predicates, quotient relations, default arguments, local definitions, or field bodies may mention an answer-history type, a trace prefix, a prefix-history selector, a query produced from an answer prefix, or an oracle answer type \(O_Q(q)\).

The component meanings are fixed as follows. \(\operatorname {Control}_R(x,h_x,s)\) is the control-state type. \(\operatorname {CounterName}_R(x,h_x,s)\to \mathbb {N}\) is the counter store. \(\operatorname {TapeName}_R(x,h_x,s)\to (\mathbb {Z}\to \operatorname {TapeSymbol}_R(x,h_x,s))\) is the work-tape content store, and \(\operatorname {TapeName}_R(x,h_x,s)\to \mathbb {Z}\) is the work-head-position store. \(\operatorname {RegisterName}_R(x,h_x,s)\to \operatorname {RegisterValue}_R(x,h_x,s)\) is the store for all remaining deterministic local registers. These store types are derived in the snapshot-record node from the six component fields above; they are not additional fields of \(\operatorname {def\_ oracle\_ reduction\_ local\_ component\_ types}\). These six component fields are the only data types from which local snapshots are built.

Definition 56 Oracle reduction local snapshot record

For a local-phase presentation of \(R\), a valid input \(x\), and a phase \(s\in \{ 0,\ldots ,r(x)\} \), the concrete local snapshot record is the product with exactly the following named projections:

\[ \begin{aligned} \operatorname {control}_R(x,s,u)& \in \operatorname {Control}_R(x,s),\\ \operatorname {counters}_R(x,s,u)& \in \operatorname {CounterName}_R(x,s)\to \mathbb {N},\\ \operatorname {workTape}_R(x,s,u)& \in \operatorname {TapeName}_R(x,s)\to (\mathbb {Z}\to \operatorname {TapeSymbol}_R(x,s)),\\ \operatorname {workHead}_R(x,s,u)& \in \operatorname {TapeName}_R(x,s)\to \mathbb {Z},\\ \operatorname {registers}_R(x,s,u)& \in \operatorname {RegisterName}_R(x,s)\to \operatorname {RegisterValue}_R(x,s). \end{aligned} \]

Equivalently, the record carrier is

\[ \begin{aligned} & \operatorname {Control}_R(x,s) \times (\operatorname {CounterName}_R(x,s)\to \mathbb {N}) \times (\operatorname {TapeName}_R(x,s)\to (\mathbb {Z}\to \operatorname {TapeSymbol}_R(x,s)))\\ & \qquad \times (\operatorname {TapeName}_R(x,s)\to \mathbb {Z}) \times (\operatorname {RegisterName}_R(x,s)\to \operatorname {RegisterValue}_R(x,s)), \end{aligned} \]

with the displayed projection names. This declaration is not an erased placeholder: any implementation of a local snapshot must provide exactly these non-oracle fields, even when some component type is empty or singleton for a particular reduction and phase.

Definition 57 Oracle reduction non-oracle local snapshots

For an oracle reduction datum \(R\), a valid \(P\)-input \(x\), and a phase \(s\in \{ 0,\ldots ,r(x)\} \), the type

\[ \operatorname {Local}_R(x,s) \]

is definitionally the local snapshot record of Definition 56. Thus an element \(u\in \operatorname {Local}_R(x,s)\) consists exactly of the non-oracle local data held by the reduction after \(s\) oracle calls have been completed: its control state, counter store, work-tape contents, work-head positions, and deterministic register store.

Lean-facing, \(\operatorname {Local}_R(x,s)\) is indexed only by \((R,x,s)\) and is chosen before any particular answer history is supplied. Its declaration is an answer-history-free local state type: no constructor argument, field, projection, invariant, subtype predicate, or field type may mention \(\Hist _R(x,s)\), a prefix-history selector, a trace prefix, or an oracle answer type \(O_Q(q)\) in any position. In particular, a local snapshot may not contain a field such as \(\Hist _R(x,s)\to T\), \(T\to \Hist _R(x,s)\), \(\forall H:\Hist _R(x,s),\, T(H)\), \(\exists H:\Hist _R(x,s),\, T(H)\), a dependent pair over histories, a quotient by a relation using histories, or any analogous function/product/subtype whose domain, codomain, index, or proposition can encode oracle answers. A field named “control state”, “work tape”, or similar is permitted only when its type is built from non-oracle data already available from \((R,x,s)\) and does not contain histories or oracle answers under any type former. In particular, the declaration may not replace the record by \(\operatorname {Unit}\) unless the five displayed component fields themselves are still present with their named projections.

Thus \(\operatorname {Local}_R(x,s)\) stores only history-independent local data. Any semantic fact saying that a local snapshot is the one reached after a particular oracle-answer prefix must therefore be stated as a relation with two separate arguments,

\[ u\in \operatorname {Local}_R(x,s),\qquad H\in \Hist _R(x,s), \]

not by storing \(H\) or the answers inside \(u\).

Definition 58 Oracle reduction local compatibility relation

For a local-phase presentation of \(R\), the external local compatibility relation is the proposition

\[ \operatorname {LocalCompatible}_R(x,s,u,H) \]

on separate arguments

\[ u\in \operatorname {Local}_R(x,s),\qquad H\in \Hist _R(x,s). \]

It holds exactly when \(H\) is a well-formed answer history of length \(s\) and the five projections of \(u\) are the control state, counter store, work-tape contents, work-head positions, and deterministic register store obtained by running the non-oracle part of \(R\) on input \(x\) through the first \(s\) oracle calls using the answer prefix \(H\).

This is a relation, not a field of \(u\) and not a subtype condition in \(\operatorname {Local}_R(x,s)\). The history argument remains external, so compatibility ties a history-independent snapshot to a particular answer prefix without encoding that prefix or any oracle answer inside the snapshot.

Definition 59 Oracle reduction raw state representation

For a local-phase presentation of \(R\), the raw state representation on a valid \(P\)-input \(x\) is the phase-indexed dependent sum

\[ \operatorname {RawState}_R(x) = \{ \, (s,u)\mid s\in \{ 0,\ldots ,r(x)\} ,\ u\in \operatorname {Local}_R(x,s)\, \} . \]

It has the named projections

\[ \operatorname {rawPhase}_R(x,(s,u))=s,\qquad \operatorname {rawLocal}_R(x,(s,u))=u. \]

The projection equations are part of the representation contract. A state implementation therefore exposes the phase coordinate and local snapshot by name, rather than only through anonymous dependent-pair eliminators.

Definition 60 Oracle reduction state compatibility relation

For a raw state \(\sigma \in \operatorname {RawState}_R(x)\) and a separately supplied answer history \(H\), the state-history compatibility relation is

\[ \operatorname {StateCompatible}_R(x,\sigma ,H) \quad \Longleftrightarrow \quad \operatorname {LocalCompatible}_R \bigl(x,\operatorname {rawPhase}_R(x,\sigma ), \operatorname {rawLocal}_R(x,\sigma ),H\bigr). \]

Hence compatibility simultaneously asserts that \(H\) is a well-formed history prefix of the state’s named phase and that the state’s named local snapshot is the deterministic non-oracle snapshot reached after that prefix. The relation is external to the state carrier and has the three displayed arguments \((x,\sigma ,H)\).

Definition 61 Oracle reduction state space

For a local-phase presentation of an oracle reduction datum \(R\), the state space on a valid \(P\)-input \(x\) is the concrete raw state representation of Definition 59:

\[ \operatorname {State}_R(x)=\operatorname {RawState}_R(x). \]

Its projections are

\[ \operatorname {phase}_R(x,\sigma ) =\operatorname {rawPhase}_R(x,\sigma ), \qquad \operatorname {local}_R(x,\sigma ) =\operatorname {rawLocal}_R(x,\sigma ), \]

with the displayed names. The phase coordinate is bounded by the oracle-call count \(r(x)\) from the reduction datum \(R\), and the local projection has type \(\operatorname {Local}_R(x,\operatorname {phase}_R(x,\sigma ))\), so every state is explicitly tied to a definite point of an \(R\)-run and to the corresponding non-oracle snapshot.

The state type contains only the phase and the non-oracle local snapshot. It does not contain an answer history and does not contain oracle answers. Compatibility with a particular prefix of oracle answers is instead the external relation

\[ \operatorname {StateCompatible}_R(x,\sigma ,H) \]

from Definition 60, equivalently \(\operatorname {LocalCompatible}_R(x,\operatorname {phase}_R(x,\sigma ), \operatorname {local}_R(x,\sigma ),H)\). Thus the state-space contract consists of the carrier \(\operatorname {State}_R(x)\), the named phase projection, the named local projection, and the named external compatibility relation.

Consequently, later query, update, and postprocessing functions receive \(\sigma \in \operatorname {State}_R(x)\) and the relevant history \(H\) as separate arguments: \(\sigma \) supplies the non-oracle local data, while \(H\) supplies exactly the oracle query-answer prefix determined by \(R\).

Definition 62 Oracle reduction initial-state construction semantics

For a local-phase presentation of \(R\), the initialization computation on a valid \(P\)-input \(x\) is specified by concrete non-oracle operational data, separate from all oracle histories. It consists of a configuration type

\[ \operatorname {InitConfig}_R(x), \]

an input-reading initial configuration

\[ \operatorname {initConfig}_R(x)\in \operatorname {InitConfig}_R(x), \]

a deterministic local step map

\[ \operatorname {initStep}_R(x): \operatorname {InitConfig}_R(x)\to \operatorname {InitConfig}_R(x), \]

a halting predicate \(\operatorname {InitHalt}_R(x,c)\) on initialization configurations, and an output relation

\[ \operatorname {InitOut}_R(x,c,\sigma ) \]

between a halted initialization configuration \(c\) and a state \(\sigma \in \operatorname {State}_R(x)\).

The initialization run is defined recursively by

\[ \operatorname {InitRun}_R(x,0)=\operatorname {initConfig}_R(x), \qquad \operatorname {InitRun}_R(x,s+1)= \operatorname {initStep}_R(x)(\operatorname {InitRun}_R(x,s)). \]

The predicate

\[ \operatorname {InitHaltsWith}_R(x,s,\sigma ) \]

means that this non-oracle run first halts at exactly step \(s\) and outputs exactly the state \(\sigma \):

\[ \operatorname {InitHalt}_R(x,\operatorname {InitRun}_R(x,s)) \wedge \operatorname {InitOut}_R(x,\operatorname {InitRun}_R(x,s),\sigma ) \]

and, for every \(r{\lt}s\),

\[ \neg \operatorname {InitHalt}_R(x,\operatorname {InitRun}_R(x,r)). \]

The output relation is functional on halted initialization configurations, and the deterministic initialization run has a unique first halting time: if \(\operatorname {InitHaltsWith}_R(x,s,\sigma )\) and \(\operatorname {InitHaltsWith}_R(x,s',\sigma ')\), then \(s=s'\) and \(\sigma =\sigma '\).

This node supplies the semantics for the initial-state construction only. It contains no oracle query, oracle answer, answer history, trace prefix, or target-problem output. Its step count is the actual first halting time of this displayed initialization run.

Definition 63 Oracle reduction initial state

For a local-phase presentation of \(R\), the initial-state constructor and its local step count are not independent data. They are a function

\[ \operatorname {init}_R(x)\in \operatorname {State}_R(x) \]

and a natural number \(\operatorname {InitSteps}_R(x)\in \mathbb {N}\) defined for every valid \(P\)-input \(x\), together with the semantic certificate

\[ \operatorname {InitHaltsWith}_R \bigl(x,\operatorname {InitSteps}_R(x),\operatorname {init}_R(x)\bigr). \]

Equivalently, \(\operatorname {InitSteps}_R(x)\) is the exact first halting time of the concrete initialization run from Definition 62, and \(\operatorname {init}_R(x)\) is exactly the state output by that halted run. The declaration therefore has the following invariant:

\[ \forall s,\sigma ,\quad \operatorname {InitHaltsWith}_R(x,s,\sigma ) \Rightarrow s=\operatorname {InitSteps}_R(x)\wedge \sigma =\operatorname {init}_R(x). \]

Thus an implementation cannot certify this node by choosing an arbitrary natural-number field; the step count must be witnessed by the displayed non-oracle construction of exactly the displayed initial state.

Definition 64 Oracle reduction trace prefix history

Define \(\operatorname {def\_ oracle\_ reduction\_ trace\_ prefix\_ history}(P,Q,R)\) to be the type of prefix-history selector functions \(H\). Such an \(H\) takes a valid \(P\)-input \(x\), a trace \((q_1,z_1),\ldots ,(q_r,z_r),y\) of \(R\) on \(x\), and an index \(s\in \{ 1,\ldots ,r+1\} \), and returns the finite list

\[ H(x,t,s)=((q_1,z_1),\ldots ,(q_{s-1},z_{s-1})). \]

In particular \(H(x,t,r+1)\) is the full query-answer history.

This declaration is a type of selectors, not a recursively defined function with a hidden body. The equality saying that the selected list is the first \(s-1\) entries of the trace is part of the local trace-consistency predicate below, so later nodes use a concrete selector argument \(H\) rather than an undefined global prefix-history value.

Definition 65 Oracle reduction state-dependent query construction

At oracle-call position \(s\), the query constructor of a local-phase presentation is a state-dependent function

\[ \operatorname {query}_R(x,s,\sigma ,H_s)\in I_Q \]

where \(\sigma \in \operatorname {State}_R(x)\) is the previous local state and \(H_s\) is the prefix history before call \(s\). Its local step count is the function

\[ \operatorname {QuerySteps}_R(x,s,\sigma ,H_s)\in \mathbb {N}. \]

Thus the query and its construction cost are both allowed to depend on the previous state, not only on \(x\), the call index, and the earlier query-answer pairs. In a locally generated trace, the concrete query at position \(s\) satisfies

\[ q_s=\operatorname {query}_R(x,s,\sigma _{s-1},H_s). \]
Definition 66 Oracle reduction state update

After oracle-call position \(s\), the state-transition function is

\[ \operatorname {update}_R(x,s,\sigma _{s-1},H_s,q_s,z_s)\in \operatorname {State}_R(x). \]

Its local step count

\[ \operatorname {UpdateSteps}_R(x,s,\sigma _{s-1},H_s,q_s,z_s)\in \mathbb {N} \]

counts exactly the non-oracle work needed to update the local state after the answer \(z_s\) to query \(q_s\) is available. The next state in the run is

\[ \sigma _s=\operatorname {update}_R(x,s,\sigma _{s-1},H_s,q_s,z_s). \]
Definition 67 Oracle reduction generated state sequence

For a concrete trace \(t=(q_1,z_1),\ldots ,(q_r,z_r),y\) of \(R\) on a valid input \(x\), define

\[ \operatorname {def\_ oracle\_ reduction\_ generated\_ state\_ sequence} \]

to be the predicate on candidate finite state sequences

\[ G:\{ 0,\ldots ,r\} \to \operatorname {State}_R(x). \]

The predicate holds exactly when \(G\) satisfies the two recursive equations

\[ G(0)=\operatorname {init}_R(x), \]

and for every \(1\leq s\leq r\),

\[ G(s)=\operatorname {update}_R(x,s,G(s-1),H(x,t,s),q_s,z_s). \]

This node is a proposition relating an explicit candidate sequence \(G\) to the update equations. It does not introduce a separate globally named recursive function returning \(G\), and later nodes quantify over such a concrete \(G\).

Definition 68 Oracle reduction final postprocessing

The final postprocessing function of a local-phase presentation is

\[ \operatorname {finish}_R(x,\sigma ,H)\in O_P(x), \]

where \(\sigma \) is an explicitly supplied final local state and \(H\) is an explicitly supplied full query-answer history. Its local step count

\[ \operatorname {FinishSteps}_R(x,\sigma ,H)\in \mathbb {N} \]

counts exactly the non-oracle work needed to produce the final output from those arguments. In a locally generated trace with generated state sequence \(G\), the final state argument is \(G(r)\), the history argument is \(H(x,t,r+1)\), and the final output satisfies

\[ y=\operatorname {finish}_R(x,G(r),H(x,t,r+1)). \]
Definition 69 Oracle reduction local trace consistency

A trace

\[ (q_1,z_1),\ldots ,(q_r,z_r),y \]

is locally generated by the local-phase presentation of \(R\) on \(x\) when there exists an explicit state sequence \(G:\{ 0,\ldots ,r\} \to \operatorname {State}_R(x)\) such that Definition 67 holds for \(G\), the selector \(H(x,t,s)\) is the first \(s-1\) query-answer entries of the trace for every \(s\), and both displayed equations hold:

\[ \forall \, 1\leq s\leq r,\qquad q_s=\operatorname {query}_R(x,s,G(s-1),H(x,t,s)), \]

and

\[ y=\operatorname {finish}_R(x,G(r),H(x,t,r+1)). \]

This predicate is the formal link between an oracle reduction trace and the state-dependent local operational data. In particular, the query at call \(s\) is certified from the explicit generated previous state \(G(s-1)\).

Definition 70 Oracle reduction local phases

For a trace \(t=(q_1,z_1),\ldots ,(q_r,z_r),y\) of \(R\) on \(x\), define \(\operatorname {def\_ oracle\_ reduction\_ local\_ phases}\) to be the relation between a candidate generated state sequence \(G:\{ 0,\ldots ,r\} \to \operatorname {State}_R(x)\) and a natural number \(L\). It holds exactly when the trace is locally generated using \(G\) in the sense of Definition 69 and \(L\) is the local running-time sum

\[ L = \operatorname {InitSteps}_R(x) +\sum _{s=1}^{r} \Bigl( \operatorname {QuerySteps}_R(x,s,G(s-1),H(x,t,s)) + \operatorname {UpdateSteps}_R(x,s,G(s-1),H(x,t,s),q_s,z_s) \Bigr) +\operatorname {FinishSteps}_R(x,G(r),H(x,t,r+1)). \]

The query term uses the previous generated state \(G(s-1)\) explicitly, and the update term is tied to the state equation defining \(G(s)\) in Definition 67. The local running-time value \(L\) includes exactly the initial-state construction, every state-dependent query construction, every state update after an oracle answer, and final postprocessing. It does not include the time spent solving the \(Q\)-queries.

Definition 71 Oracle reduction cost accounting

Fix a correct \(Q\)-algorithm with running-time bound \(T_Q\). For a trace \(t=(q_1,z_1),\ldots ,(q_r,z_r),y\) of \(R\) on input \(x\), a candidate generated state sequence \(G\), and a natural number \(L\) satisfying \(\operatorname {def\_ oracle\_ reduction\_ local\_ phases}(x,t,G,L)\), the induced running time of the simulated reduction run is bounded by

\[ L +\sum _{s=1}^{r} T_Q(N_Q(q_s),L_Q(q_s)). \]

If no such \(G\) and \(L\) exist, the trace is not a locally generated trace of the reduction and contributes no valid simulated execution. The oracle-cost term uses the actual principal size and auxiliary dimension of each constructed query, not the parameters of the original \(P\)-input.

Definition 72 Subquadratic oracle-query budget

An oracle reduction datum \(R\) has a subquadratic transfer budget from \(P\) to \(Q\) if the following implication holds for every valid \(P\)-input \(x\) with \(N_P(x)=n\) and \(L_P(x)=\ell \). Whenever the assumed \(Q\)-algorithm has running time

\[ T_Q(n',\ell ')\leq C(n')^{2-\varepsilon }(1+\ell ')^b, \]

every trace of \(R\) on \(x\) satisfies a bound

\[ L+\sum _s T_Q(N_Q(q_s),L_Q(q_s)) \leq C' n^{2-\varepsilon '}(1+\ell )^{b'} \]

for every locally generated trace and every local-cost witness \(\operatorname {def\_ oracle\_ reduction\_ local\_ phases}(x,t,G,L)\), for some constants \(\varepsilon '{\gt}0\), \(C'{\gt}0\), and \(b'\in \mathbb {N}\) that depend only on \(\varepsilon ,C,b\) and the reduction, not on the particular input \(x\) or oracle answers. Thus the number of calls, query sizes, and all local construction, update, and postprocessing costs are explicitly included in the transfer.

Definition 73 Quadratic-time baseline algorithm

A computational problem \(P\) has a quadratic-time baseline algorithm if there is a concrete deterministic algorithm \(B_P\) for \(P\), a worst-case running-time bound \(T_{B_P}:\mathbb {N}\times \mathbb {N}\to \mathbb {R}_{\geq 0}\) for the actual operational execution of \(B_P\), and constants \(C{\gt}0\), \(b\in \mathbb {N}\), and \(n_0\in \mathbb {N}\) such that \(B_P\) halts correctly on every valid input and

\[ T_{B_P}(n,\ell )\leq C n^2(1+\ell )^b \]

for every \(n\geq n_0\) and every auxiliary dimension \(\ell \) in the domain of \(P\).

Lean-facing, the proposition

\[ \operatorname {def\_ quadratic\_ baseline\_ algorithm}(P) \]

contains the displayed witnesses \((B_P,T_{B_P},C,b,n_0)\) and the two displayed obligations: semantic correctness of \(B_P\) in the sense of Definition 46, and the quadratic polynomial upper bound above. It is not a name tag on \(P\) and it is not automatically true for an arbitrary computational-problem specification.

Definition 74 Composed oracle-reduction query phase machine

For fixed data \((R,x,s,\sigma ,H_s)\) with \(\sigma \in \operatorname {State}_R(x)\) and \(H_s\) the prefix history before oracle call \(s\), the query phase in the composed program is the canonical countdown machine

\[ \operatorname {QueryConfig}_{R}(x,s,\sigma ,H_s) =\{ 0,\ldots ,\operatorname {QuerySteps}_R(x,s,\sigma ,H_s)\} . \]

Its initial configuration is \(\operatorname {QuerySteps}_R(x,s,\sigma ,H_s)\), its step map sends a positive counter \(k+1\) to \(k\) and fixes \(0\), its halt predicate is exactly \(k=0\), and its output at the halted configuration is exactly

\[ \operatorname {query}_R(x,s,\sigma ,H_s)\in I_Q . \]

Thus the query phase has no externally supplied query output: the only query it can emit is the state-dependent query constructor from Definition 65, after exactly the displayed number of local countdown steps.

Definition 75 Composed oracle-reduction update phase machine

For fixed data \((R,x,s,\sigma ,H_s,q,z)\), the update phase in the composed program is the canonical countdown machine

\[ \operatorname {UpdateConfig}_{R}(x,s,\sigma ,H_s,q,z) =\{ 0,\ldots ,\operatorname {UpdateSteps}_R(x,s,\sigma ,H_s,q,z)\} . \]

Its initial configuration is \(\operatorname {UpdateSteps}_R(x,s,\sigma ,H_s,q,z)\), its step map decrements a positive counter and fixes \(0\), its halt predicate is exactly \(k=0\), and its output at the halted configuration is exactly the next local state

\[ \operatorname {update}_R(x,s,\sigma ,H_s,q,z)\in \operatorname {State}_R(x). \]

Hence the update phase cannot choose an independent next state; its only halted output is the state-transition value from Definition 66.

Definition 76 Composed oracle-reduction finish phase machine

For fixed data \((R,x,\sigma ,H)\) with \(\sigma \in \operatorname {State}_R(x)\) and \(H\) a full answer history, the finish phase in the composed program is the canonical countdown machine

\[ \operatorname {FinishConfig}_{R}(x,\sigma ,H) =\{ 0,\ldots ,\operatorname {FinishSteps}_R(x,\sigma ,H)\} . \]

Its initial configuration is \(\operatorname {FinishSteps}_R(x,\sigma ,H)\), its step map decrements a positive counter and fixes \(0\), its halt predicate is exactly \(k=0\), and its output at the halted configuration is exactly

\[ \operatorname {finish}_R(x,\sigma ,H)\in O_P(x). \]

Thus the final \(P\)-output of the composed program is produced by the displayed final-postprocessing function, not by a separate output parameter.

Definition 77 Composed oracle-reduction phase records

Fix a local-phase oracle reduction datum \(R\) from \(P\) to \(Q\) and a concrete deterministic \(Q\)-algorithm \(A_Q\). The configuration carrier of the composed program \(R[A_Q]\) on a valid input \(x\) is the disjoint union of the following concrete phase records, with no additional output-producing case:

\[ \operatorname {InitPhase}(c_{\rm init}), \quad \operatorname {QueryPhase}(s,\sigma _{s-1},H_s,c_{\rm qry}), \]
\[ \operatorname {OraclePhase}(s,\sigma _{s-1},H_s,q_s,c_Q), \quad \operatorname {UpdatePhase}(s,\sigma _{s-1},H_s,q_s,z_s,c_{\rm upd}), \]

and

\[ \operatorname {FinishPhase}(\sigma _r,H_{r+1},c_{\rm fin}). \]

Here \(c_{\rm init}\) is an initialization configuration of Definition 63. The configurations \(c_{\rm qry}\), \(c_{\rm upd}\), and \(c_{\rm fin}\) are respectively elements of the canonical countdown machines of Definitions 74, 75, and 76. The configuration \(c_Q\) is an actual operational configuration of \(A_Q\) on the displayed concrete query. The phase record stores the previous state and prefix history as separate arguments whenever they are needed; it does not store arbitrary oracle answers or an arbitrary final \(P\)-output.

Definition 78 Composed oracle-reduction boundary equations

For a valid \(P\)-input \(x\), a trace \(t=(q_1,z_1),\ldots ,(q_{r(x)},z_{r(x)}),y\), and a candidate generated state sequence \(G:\{ 0,\ldots ,r(x)\} \to \operatorname {State}_R(x)\), the boundary-equation predicate is the conjunction of exactly the following two equalities:

\[ G(0)=\operatorname {init}_R(x) \]

and

\[ y=\operatorname {finish}_R(x,G(r(x)),H(x,t,r(x)+1)). \]

Lean-facing, the declaration \(\operatorname {def\_ composed\_ oracle\_ boundary\_ equations}(x,t,G)\) is a proposition with these equalities as eliminable conjuncts. It cannot be proved by constructing an initialization phase record or a finish phase record unless the displayed equality tying that record to the supplied sequence \(G\) and output \(y\) is also proved.

Definition 79 Composed oracle-reduction per-call equations

For a valid \(P\)-input \(x\), a trace \(t=(q_1,z_1),\ldots ,(q_{r(x)},z_{r(x)}),y\), a candidate generated state sequence \(G:\{ 0,\ldots ,r(x)\} \to \operatorname {State}_R(x)\), and oracle first-halting-time data \(U:\{ 1,\ldots ,r(x)\} \to \mathbb {N}\), the per-call-equation predicate holds when the following three facts hold for every oracle-call position \(1\leq s\leq r(x)\):

\[ q_s=\operatorname {query}_R(x,s,G(s-1),H(x,t,s)), \]
\[ \operatorname {HaltsWith}_{A_Q}(q_s,U(s),z_s), \]

and

\[ G(s)=\operatorname {update}_R(x,s,G(s-1),H(x,t,s),q_s,z_s). \]

The same preceding state \(G(s-1)\), prefix history \(H(x,t,s)\), query \(q_s\), and oracle answer \(z_s\) must appear in all three conjuncts. In particular, the update equation is not a local statement about an independently built update-phase configuration: it is an equality whose left-hand side is the supplied next state \(G(s)\) from the candidate state sequence.

Definition 80 Composed oracle-reduction ordered phase trace

For the same data \((x,t,G,U)\), an ordered phase trace is a finite sequence \(\Pi \) of concrete phase records from Definition 77, indexed by the ordered positions

\[ 0,1,\ldots ,3r(x)+1. \]

It satisfies the following positional equations. Position \(0\) is an initialization phase whose halted output state is exactly \(G(0)\), and this same state satisfies the equality \(G(0)=\operatorname {init}_R(x)\). For every \(1\leq s\leq r(x)\), the three consecutive positions \(3s-2,3s-1,3s\) are respectively

\[ \operatorname {QueryPhase}(s,G(s-1),H(x,t,s),c_{\rm qry,s}), \]
\[ \operatorname {OraclePhase}(s,G(s-1),H(x,t,s),q_s,c_{Q,s}), \]

and

\[ \operatorname {UpdatePhase}(s,G(s-1),H(x,t,s),q_s,z_s,c_{\rm upd,s}), \]

where the query value, oracle answer, and next state obey the per-call equations of Definition 79. The final position \(3r(x)+1\) is

\[ \operatorname {FinishPhase}(G(r(x)),H(x,t,r(x)+1),c_{\rm fin}), \]

and its output is exactly the trace output \(y=\operatorname {finish}_R(x,G(r(x)),H(x,t,r(x)+1))\).

Thus \(\operatorname {def\_ composed\_ oracle\_ ordered\_ phase\_ trace}(x,t,G,U)\) is a proposition asserting the existence of this single ordered sequence \(\Pi \) together with the displayed positional equalities. It is not satisfied by a collection of phase records constructed independently of \(\Pi \), and it is not satisfied by records whose state arguments differ from the entries of \(G\). The ordered trace is the bridge between the syntactic phase records and the semantic equations in the trace certificate.

Definition 81 Composed oracle-reduction run equations

The Lean-facing predicate

\[ \operatorname {def\_ composed\_ oracle\_ run\_ equations}(x,t,G,U) \]

is the concrete trace certificate generated by the step relation of the composed program \(R[A_Q]\). Its arguments are a valid \(P\)-input \(x\), a trace

\[ t=(q_1,z_1),\ldots ,(q_{r(x)},z_{r(x)}),y, \]

a candidate generated state sequence \(G:\{ 0,\ldots ,r(x)\} \to \operatorname {State}_R(x)\), and oracle first-halting-time data \(U:\{ 1,\ldots ,r(x)\} \to \mathbb {N}\). The predicate is definitionally the conjunction of the following three subpredicates:

\[ \operatorname {def\_ composed\_ oracle\_ boundary\_ equations}(x,t,G), \]
\[ \operatorname {def\_ composed\_ oracle\_ call\_ equations}(x,t,G,U), \]

and

\[ \operatorname {def\_ composed\_ oracle\_ ordered\_ phase\_ trace}(x,t,G,U). \]

Consequently, eliminating a proof of \(\operatorname {def\_ composed\_ oracle\_ run\_ equations}(x,t,G,U)\) yields all of the following concrete obligations for the same trace \(t\), state sequence \(G\), and oracle time data \(U\):

\[ G(0)=\operatorname {init}_R(x), \]
\[ \forall \, 1\leq s\leq r(x),\quad q_s=\operatorname {query}_R(x,s,G(s-1),H(x,t,s)), \]
\[ \forall \, 1\leq s\leq r(x),\quad \operatorname {HaltsWith}_{A_Q}(q_s,U(s),z_s), \]
\[ \forall \, 1\leq s\leq r(x),\quad G(s)=\operatorname {update}_R(x,s,G(s-1),H(x,t,s),q_s,z_s), \]
\[ y=\operatorname {finish}_R(x,G(r(x)),H(x,t,r(x)+1)), \]

and a single ordered phase-record sequence \(\Pi =(\operatorname {InitPhase},\operatorname {QueryPhase}, \operatorname {OraclePhase},\operatorname {UpdatePhase},\ldots , \operatorname {FinishPhase})\) whose records carry exactly these same states, histories, queries, oracle answers, and final output in the order specified by Definition 80.

This definition is intentionally not a mere constructor for phase records. A Lean declaration for this node must expose the three displayed conjuncts (or an equivalent proposition from which each displayed equation and the ordered phase trace can be projected). It must not replace the initialization equality, the update equalities, or the ordered run/trace relation by local let-bound phase records, by an existentially chosen unrelated state sequence, or by a predicate that only says the phase records are well typed.

Definition 82 Composed oracle-reduction program carrier

For fixed \((P,Q,R,A_Q)\) and a valid \(P\)-input \(x\), define

\[ \operatorname {ComposedConfig}_{R,A_Q}(x) \]

to be exactly the disjoint union of phase records from Definition 77. The five constructors are

\[ \operatorname {InitPhase},\quad \operatorname {QueryPhase},\quad \operatorname {OraclePhase},\quad \operatorname {UpdatePhase},\quad \operatorname {FinishPhase}, \]

with the arguments and component configuration types specified in that definition. There is no sixth constructor, no externally supplied halted output constructor, and no constructor that packages a complete trace certificate.

Definition 83 Composed oracle-reduction initial configuration

The initial configuration of the composed program on a valid \(P\)-input \(x\) is the concrete phase record

\[ \operatorname {ComposedInit}_{R,A_Q}(x) = \operatorname {InitPhase}(\operatorname {initConfig}_R(x)) \in \operatorname {ComposedConfig}_{R,A_Q}(x). \]

This definition has no argument for a starting state, trace, answer history, or precomputed output. The initialization phase begins with the actual initial configuration of the initialization machine of \(R\).

Definition 84 Composed oracle-reduction history operations

For a valid \(P\)-input \(x\), the composed program uses concrete prefix histories, independent of any completed trace selector. The empty history is the unique element

\[ \operatorname {EmptyHist}_R(x)\in \Hist _R(x,0) \]

whose finite query-answer list has length \(0\).

For an oracle-call index \(1\leq s\leq r(x)\), a prefix history \(H_s\in \Hist _R(x,s-1)\) before call \(s\), a query \(q\in I_Q\), and an answer \(z\in O_Q(q)\), the append operation is the concrete finite-list append

\[ \operatorname {AppendHist}_R(x,s,H_s,q,z)\in \Hist _R(x,s). \]

Its first \(s-1\) query-answer entries are exactly the entries of \(H_s\) in the same order, and its \(s\)th entry is exactly \((q,z)\). Equivalently, for every position \(u{\lt}s\),

\[ \operatorname {AppendHist}_R(x,s,H_s,q,z)[u]=H_s[u], \]

and

\[ \operatorname {AppendHist}_R(x,s,H_s,q,z)[s]=(q,z). \]

These equations are definitional branch data for the composed step map. The implementation must not replace the empty history or appended history by an existentially chosen history satisfying a later trace predicate.

Definition 85 Oracle halted-output selector

Let \(A_Q\) be the concrete deterministic \(Q\)-program used by the composed reduction, let \(q\in I_Q\), and let \(c_Q\in \operatorname {Config}_{A_Q}(q)\) be an oracle configuration satisfying \(\operatorname {Halt}_{A_Q}(q,c_Q)\). The halted-output selector is the uniquely determined value

\[ \operatorname {HaltedOut}_{A_Q}(q,c_Q)\in O_Q(q) \]

such that

\[ \operatorname {Out}_{A_Q} \bigl(q,c_Q,\operatorname {HaltedOut}_{A_Q}(q,c_Q)\bigr). \]

Moreover, if \(\operatorname {Out}_{A_Q}(q,c_Q,z')\), then \(z'=\operatorname {HaltedOut}_{A_Q}(q,c_Q)\). This selector is the only oracle answer used by the halted-oracle branch of \(\operatorname {ComposedStep}_{R,A_Q}\). It is not an argument of that branch and it is not chosen by an existential proof of trace consistency.

Definition 86 Composed oracle-reduction step branch targets

For fixed \((P,Q,R,A_Q)\), valid input \(x\), and a current configuration \(c\in \operatorname {ComposedConfig}_{R,A_Q}(x)\), the branch target of the composed step is the following total case split.

If \(c=\operatorname {InitPhase}(c_{\rm init})\) and \(\operatorname {InitHalt}_R(x,c_{\rm init})\) is false, the target is

\[ \operatorname {InitPhase} \bigl(\operatorname {initStep}_R(x)(c_{\rm init})\bigr). \]

If \(c=\operatorname {InitPhase}(c_{\rm init})\) and \(\operatorname {InitHalt}_R(x,c_{\rm init})\) is true, the target ignores any output value carried by the halted initialization configuration and uses the definitionally displayed state \(\operatorname {init}_R(x)\). When \(r(x)=0\) it is

\[ \operatorname {FinishPhase} \bigl(\operatorname {init}_R(x),\operatorname {EmptyHist}_R(x), \operatorname {FinishSteps}_R (x,\operatorname {init}_R(x),\operatorname {EmptyHist}_R(x))\bigr), \]

and when \(r(x){\gt}0\) it is

\[ \operatorname {QueryPhase} \bigl(1,\operatorname {init}_R(x),\operatorname {EmptyHist}_R(x), \operatorname {QuerySteps}_R (x,1,\operatorname {init}_R(x),\operatorname {EmptyHist}_R(x))\bigr). \]

If \(c=\operatorname {QueryPhase}(s,\sigma ,H_s,c_{\rm qry})\) and the query countdown value \(c_{\rm qry}\) is positive, the target is the same query phase with countdown predecessor \(c_{\rm qry}-1\). If \(c_{\rm qry}=0\), define

\[ q=\operatorname {query}_R(x,s,\sigma ,H_s). \]

The target is exactly

\[ \operatorname {OraclePhase} \bigl(s,\sigma ,H_s,q,\operatorname {init}_{A_Q}(q)\bigr). \]

If \(c=\operatorname {OraclePhase}(s,\sigma ,H_s,q,c_Q)\) and \(\operatorname {Halt}_{A_Q}(q,c_Q)\) is false, the target is

\[ \operatorname {OraclePhase} \bigl(s,\sigma ,H_s,q,\operatorname {step}_{A_Q}(q)(c_Q)\bigr). \]

If \(\operatorname {Halt}_{A_Q}(q,c_Q)\) is true, define

\[ z=\operatorname {HaltedOut}_{A_Q}(q,c_Q). \]

The target is exactly

\[ \operatorname {UpdatePhase} \bigl(s,\sigma ,H_s,q,z, \operatorname {UpdateSteps}_R(x,s,\sigma ,H_s,q,z)\bigr). \]

If \(c=\operatorname {UpdatePhase}(s,\sigma ,H_s,q,z,c_{\rm upd})\) and the update countdown value \(c_{\rm upd}\) is positive, the target is the same update phase with countdown predecessor \(c_{\rm upd}-1\). If \(c_{\rm upd}=0\), define

\[ \sigma '=\operatorname {update}_R(x,s,\sigma ,H_s,q,z), \qquad H_{s+1}=\operatorname {AppendHist}_R(x,s,H_s,q,z). \]

When \(s{\lt}r(x)\) the target is exactly

\[ \operatorname {QueryPhase} \bigl(s+1,\sigma ',H_{s+1}, \operatorname {QuerySteps}_R(x,s+1,\sigma ',H_{s+1})\bigr), \]

and when \(s=r(x)\) the target is exactly

\[ \operatorname {FinishPhase} \bigl(\sigma ',H_{s+1}, \operatorname {FinishSteps}_R(x,\sigma ',H_{s+1})\bigr). \]

If \(c=\operatorname {FinishPhase}(\sigma ,H,c_{\rm fin})\) and \(c_{\rm fin}\) is positive, the target is the same finish phase with countdown predecessor \(c_{\rm fin}-1\). If \(c_{\rm fin}=0\), the target is exactly the unchanged configuration \(\operatorname {FinishPhase}(\sigma ,H,0)\).

The phrase “the target is exactly” is part of the formal contract: each branch returns the displayed constructor with the displayed arguments. No branch target may be replaced by an existentially chosen phase record, by a field supplied in a structure of step-map data, or by a configuration known only to satisfy a later trace-characterization predicate.

The deterministic step map

\[ \operatorname {ComposedStep}_{R,A_Q}(x): \operatorname {ComposedConfig}_{R,A_Q}(x)\to \operatorname {ComposedConfig}_{R,A_Q}(x) \]

is the concrete total function whose value at every configuration is the branch target of Definition 86. Equivalently, it is defined by case analysis on the five phase constructors as follows.

On \(\operatorname {InitPhase}(c)\), if \(c\) has not halted for the initialization machine of \(R\), the next configuration is \(\operatorname {InitPhase}(\operatorname {initStep}_R(x)(c))\). If \(c\) has halted, the next state is the displayed initial state \(\operatorname {init}_R(x)\). If \(r(x)=0\) the step enters the finish countdown phase

\[ \operatorname {FinishPhase} \bigl(\operatorname {init}_R(x),\operatorname {EmptyHist}_R(x), \operatorname {FinishSteps}_R (x,\operatorname {init}_R(x),\operatorname {EmptyHist}_R(x))\bigr), \]

and otherwise it enters the first query countdown phase

\[ \operatorname {QueryPhase} \bigl(1,\operatorname {init}_R(x),\operatorname {EmptyHist}_R(x), \operatorname {QuerySteps}_R (x,1,\operatorname {init}_R(x),\operatorname {EmptyHist}_R(x))\bigr). \]

On a query phase \(\operatorname {QueryPhase}(s,\sigma ,H_s,c_{\rm qry})\), if the query countdown has not halted, the step decrements \(c_{\rm qry}\) inside the same phase. If it has halted, the emitted query is definitionally

\[ q=\operatorname {query}_R(x,s,\sigma ,H_s), \]

and the next configuration is

\[ \operatorname {OraclePhase}(s,\sigma ,H_s,q,\operatorname {init}_{A_Q}(q)). \]

On an oracle phase \(\operatorname {OraclePhase}(s,\sigma ,H_s,q,c_Q)\), if \(c_Q\) has not halted for the operational semantics of \(A_Q\) on \(q\), the next configuration is

\[ \operatorname {OraclePhase} (s,\sigma ,H_s,q,\operatorname {step}_{A_Q}(q)(c_Q)). \]

If \(c_Q\) has halted, let \(z\) be the unique output selected by the output relation of \(A_Q\) at this halted configuration, namely \(z=\operatorname {HaltedOut}_{A_Q}(q,c_Q)\). The next configuration is

\[ \operatorname {UpdatePhase} \bigl(s,\sigma ,H_s,q,z, \operatorname {UpdateSteps}_R(x,s,\sigma ,H_s,q,z)\bigr). \]

On an update phase \(\operatorname {UpdatePhase}(s,\sigma ,H_s,q,z,c_{\rm upd})\), if the update countdown has not halted, the step decrements \(c_{\rm upd}\) inside the same phase. If it has halted, define

\[ \sigma '=\operatorname {update}_R(x,s,\sigma ,H_s,q,z), \qquad H_{s+1}=\operatorname {AppendHist}_R(x,s,H_s,q,z). \]

If \(s{\lt}r(x)\) the next configuration is the query phase for call \(s+1\) with state \(\sigma '\) and history \(H_{s+1}\); if \(s=r(x)\) it is the finish countdown phase with state \(\sigma '\) and full history \(H_{s+1}\).

On a finish phase \(\operatorname {FinishPhase}(\sigma ,H,c_{\rm fin})\), if the finish countdown has not halted, the step decrements \(c_{\rm fin}\) inside the same phase; if it has halted, the step map fixes that halted finish configuration.

These clauses are the complete definition of the step map. The oracle-phase clause invokes the actual step map and output relation of the supplied program \(A_Q\) on the actual query \(q\); no oracle answer is provided as an external parameter to the composed program. Lean-facing, the declaration \(\operatorname {def\_ composed\_ oracle\_ step\_ map}\) must return the function \(\operatorname {ComposedStep}_{R,A_Q}(x)\) itself. It is not a structure with a field named \(\operatorname {ComposedStep}\), \(\operatorname {step}\), \(\operatorname {next}\), or any synonym, and it is not a proposition asserting the existence of a function satisfying branch equations. The five branch equations above are definitional equalities or projection lemmas about this single returned function; they are not caller-supplied axioms and they do not authorize existential branch choices.

Definition 88 Composed oracle-reduction halt and output

The halt predicate of the composed program is true exactly on halted finish countdown records:

\[ \operatorname {ComposedHalt}_{R,A_Q} \bigl(x,\operatorname {FinishPhase}(\sigma ,H,c_{\rm fin})\bigr) \quad \Longleftrightarrow \quad c_{\rm fin}=0, \]

and it is false on \(\operatorname {InitPhase}\), \(\operatorname {QueryPhase}\), \(\operatorname {OraclePhase}\), and \(\operatorname {UpdatePhase}\) records. The output relation at a halted finish record is

\[ \operatorname {ComposedOut}_{R,A_Q} \bigl(x,\operatorname {FinishPhase}(\sigma ,H,0),y\bigr) \quad \Longleftrightarrow \quad y=\operatorname {finish}_R(x,\sigma ,H). \]

Thus the only possible returned \(P\)-output is the final-postprocessing value for the state and full history stored in the halted finish phase.

Definition 89 Composed oracle-reduction operational semantics

The deterministic operational semantics used by the composed substitution \(R[A_Q]\) is a concrete semantics for the source problem \(P\), denoted

\[ \mathsf{Sem}_{R,A_Q}. \]

For each valid \(P\)-input \(x\), its configuration carrier, initial configuration, step map, halt predicate, and output relation are exactly

\[ \begin{aligned} & \operatorname {Config}_{\mathsf{Sem}_{R,A_Q}}(x) =\operatorname {ComposedConfig}_{R,A_Q}(x),\\ & \operatorname {init}_{\mathsf{Sem}_{R,A_Q}}(x) =\operatorname {ComposedInit}_{R,A_Q}(x),\\ & \operatorname {step}_{\mathsf{Sem}_{R,A_Q}}(x) =\operatorname {ComposedStep}_{R,A_Q}(x),\\ & \operatorname {Halt}_{\mathsf{Sem}_{R,A_Q}}(x,c) =\operatorname {ComposedHalt}_{R,A_Q}(x,c),\\ & \operatorname {Out}_{\mathsf{Sem}_{R,A_Q}}(x,c,y) =\operatorname {ComposedOut}_{R,A_Q}(x,c,y). \end{aligned} \]

Lean-facing, this node is the declaration \(\operatorname {def\_ composed\_ oracle\_ operational\_ semantics}\) and returns a value of the existing deterministic-operational-semantics type for \(P\) from Definition 45. It is not a new structure packaging a semantics together with a program code, and it does not introduce any declaration named \(\operatorname {def\_ composed\_ oracle\_ program\_ code}\). The five displayed component equations are the complete semantics of the composed run.

Definition 90 Composed oracle-reduction program code

The deterministic \(P\)-program code underlying the substitution \(R[A_Q]\) is the single concrete program code inside the operational semantics \(\mathsf{Sem}_{R,A_Q}\) of Definition 89. It is denoted

\[ \mathsf{Code}_{R,A_Q} :=\operatorname {code}(\mathsf{Sem}_{R,A_Q}). \]

Expanding the code inside that semantics gives exactly the tuple

\[ \begin{aligned} & \operatorname {Config}_{R[A_Q]}(x) =\operatorname {ComposedConfig}_{R,A_Q}(x),\\ & \operatorname {init}_{R[A_Q]}(x) =\operatorname {ComposedInit}_{R,A_Q}(x),\\ & \operatorname {step}_{R[A_Q]}(x) =\operatorname {ComposedStep}_{R,A_Q}(x),\\ & \operatorname {Halt}_{R[A_Q]}(x,c) =\operatorname {ComposedHalt}_{R,A_Q}(x,c),\\ & \operatorname {Out}_{R[A_Q]}(x,c,y) =\operatorname {ComposedOut}_{R,A_Q}(x,c,y). \end{aligned} \]

Lean-facing, this node is exactly the declaration \(\operatorname {def\_ composed\_ oracle\_ program\_ code}\), and it returns only this program-code value. It is not a structure, record, or proposition with fields such as \(\operatorname {Semantics}\), \(\operatorname {code}\), or a “concrete” compatibility proof. No later node may redeclare \(\operatorname {def\_ composed\_ oracle\_ program\_ code}\) as a type of program packages; later nodes must refer to the value defined here, or to the separate semantics value \(\operatorname {def\_ composed\_ oracle\_ operational\_ semantics}\). This declaration contains no correctness proof, no running-time proof, and no externally supplied trace or accounting predicate; those are separate lemmas about this constructed code.

For every valid input \(x\), step count \(S\), and output \(y\), the operational halting fact

\[ \operatorname {HaltsWith}_{R[A_Q]}(x,S,y) \]

holds if and only if there exist a trace

\[ t=(q_1,z_1),\ldots ,(q_r,z_r),y, \]

a generated state sequence \(G:\{ 0,\ldots ,r\} \to \operatorname {State}_R(x)\), oracle first-halting-time data \(U:\{ 1,\ldots ,r\} \to \mathbb {N}\), and a local cost \(L\) such that

\[ \operatorname {def\_ composed\_ oracle\_ run\_ equations}(x,t,G,U), \]
\[ \operatorname {def\_ oracle\_ reduction\_ local\_ phases}(x,t,G,L), \]

and

\[ S=L+\sum _{s=1}^{r}U(s). \]

In particular, any such certificate includes the displayed local-phase equations

\[ G(0)=\operatorname {init}_R(x),\qquad G(s)=\operatorname {update}_R(x,s,G(s-1),H(x,t,s),q_s,z_s), \]

the final-output equation

\[ y=\operatorname {finish}_R(x,G(r),H(x,t,r+1)), \]

and the actual oracle-run facts

\[ \operatorname {HaltsWith}_{A_Q}(q_s,U(s),z_s) \qquad (1\leq s\leq r). \]

Equivalently, every halting execution of the composed program is represented by exactly such a trace certificate, and any trace certificate satisfying \(\operatorname {def\_ composed\_ oracle\_ run\_ equations}(x,t,G,U)\), \(\operatorname {def\_ oracle\_ reduction\_ local\_ phases}(x,t,G,L)\), with step count \(S=L+\sum _s U(s)\) is a halting execution of the same composed program \(R[A_Q]\) with output \(y\). Here \(\operatorname {HaltsWith}_{R[A_Q]}\) is the concrete first-halting predicate from Definition 45 applied to the semantics \(\operatorname {def\_ composed\_ oracle\_ operational\_ semantics}\) and to its code value \(\operatorname {def\_ composed\_ oracle\_ program\_ code}\). This lemma introduces no new type, structure, or compatibility predicate named \(\operatorname {def\_ composed\_ oracle\_ program\_ code}\); that name is already the concrete code value of Definition 90. It is invalid to formalize this trace-characterization node by replacing the existing code value with a fresh package whose fields are \(\operatorname {Semantics}\) and \(\operatorname {code}\), or by adding a second declaration named \(\operatorname {def\_ composed\_ oracle\_ program\_ code}\). The only formal declaration for this node is the lemma \(\operatorname {lem\_ composed\_ oracle\_ trace\_ characterization}\).

Proof

Unfold the phase-record transition relation and the certificate predicate of Definition 81. Reading a halting execution from left to right records exactly the query-answer pairs created during the oracle phases, the oracle first-halting times \(U(s)\), the states generated by the update equations, and the final postprocessing output. The non-oracle phase lengths give the local-cost witness \(L\) from Definition 70, while the oracle phases contribute precisely \(\sum _s U(s)\) steps, giving \(S=L+\sum _s U(s)\). Conversely, a trace satisfying \(\operatorname {def\_ composed\_ oracle\_ run\_ equations}(x,t,G,U)\) and the local-phase relation determines the same finite sequence of phase records: initialization, query construction, the actual first-halting run of \(A_Q\) on each displayed query, update, and final postprocessing. Therefore the deterministic composed program halts with the displayed output \(y\) at the displayed step count \(S\).

In the trace characterization of a halting execution of \(R[A_Q]\), if the simulated oracle calls halt at first halting times \(u_1,\ldots ,u_r\), then the first halting step count \(s\) of the composed execution is exactly

\[ s=L+\sum _{i=1}^{r}u_i . \]

If \(A_Q\) has worst-case running-time bound \(T_Q\), then the same execution satisfies the induced cost bound

\[ s\leq L+\sum _{i=1}^{r}T_Q(N_Q(q_i),L_Q(q_i)). \]

The step count \(s\) is the first-halting time supplied by the \(\operatorname {HaltsWith}\) predicate of Definition 45 for the composed operational semantics and code value of Definitions 89 and 90. This accounting lemma does not introduce or require any separate program-code wrapper; it uses the same concrete code value as Lemma 91.

Proof

Definition 70 counts exactly the non-oracle initialization, query-construction, update, and postprocessing transitions. The remaining transitions are precisely the simulated executions of \(A_Q\) on the constructed queries, whose first halting times are \(u_i\). Summing the disjoint phase lengths gives the equality for \(s\). Applying Lemma 48 to each valid constructed query bounds each \(u_i\) by \(T_Q(N_Q(q_i),L_Q(q_i))\), yielding the displayed inequality.

Definition 93 Composed oracle-reduction algorithm
#

Let \(R\) be a correct oracle reduction datum from \(P\) to \(Q\) with a local-phase presentation, and let \(A_Q\) be a concrete correct deterministic algorithm for \(Q\) with running-time bound \(T_Q\). The composed algorithm

\[ R[A_Q] \]

is definitionally the deterministic \(P\)-program code of Definition 90. Lean-facing, the declaration

\[ \operatorname {def\_ composed\_ oracle\_ reduction\_ algorithm}(P,Q,R,A_Q) \]

has exactly the displayed construction arguments and returns the program-code value \(\operatorname {def\_ composed\_ oracle\_ program\_ code}\) inside the semantics value \(\operatorname {def\_ composed\_ oracle\_ operational\_ semantics}\). The configuration carrier, initial configuration, step map, halt predicate, and output relation are respectively the five component equations named in Definitions 89 and 90. Consequently the construction has no parameter for an alternative \(P\)-semantics, no parameter for an arbitrary \(P\)-algorithm, no wrapper type of program packages, and no assumptions asserting that some externally supplied algorithm is equivalent to the composition.

The separate trace characterization for this constructed code is Lemma 91. For every valid input \(x\), natural number \(S\), and output \(y\), that lemma states that the halting predicate of the returned program holds exactly when there exist one trace \(t=(q_1,z_1),\ldots ,(q_{r(x)},z_{r(x)}),y\), one generated state sequence \(G\), one oracle first-halting-time function \(U\), and one local cost \(L\) satisfying the concrete run-equation certificate \(\operatorname {def\_ composed\_ oracle\_ run\_ equations}(x,t,G,U)\), the local phase relation \(\operatorname {def\_ oracle\_ reduction\_ local\_ phases}(x,t,G,L)\), and the exact step-count equation

\[ S=L+\sum _{s=1}^{r(x)}U(s). \]

Each \(U(s)\) is the first halting time of the actual run \(\operatorname {HaltsWith}_{A_Q}(q_s,U(s),z_s)\) on the actual query \(q_s\) from the same trace. Thus oracle answers are not assumed as free data: they are outputs of \(A_Q\) inside the returned program’s step relation.

Therefore a Lean declaration for this node is the code alias above, with its operational projections supplied by Definitions 82, 83, 87, 88, and 90. The trace and accounting statements remain the separate lemmas named in the ist. It is invalid to prove this node by taking arbitrary parameters named like \(\operatorname {SP}\), \(\operatorname {AP}\), \(\operatorname {\_ configuration\_ carrier}\), \(\operatorname {\_ halting\_ output}\), \(\operatorname {\_ trace\_ semantics}\), or \(\operatorname {\_ step\_ count\_ governance}\), or by requiring the caller to supply proof hypotheses that an unrelated program has the desired carrier, trace semantics, output relation, or running-time accounting. Those components are part of the constructed program code above, not external obligations.

Definition 94 Composed witness halting fact

Fix \(P,Q,R,A_Q\), a valid \(P\)-input \(x\), a step count \(s\in \mathbb {N}\), and an output \(y\in O_P(x)\). The predicate

\[ \operatorname {def\_ fg\_ composed\_ halting\_ fact}(P,Q,R,A_Q,x,s,y) \]

is exactly the single proposition

\[ \operatorname {HaltsWith}_{R[A_Q]}(x,s,y). \]

The program in this halting fact is the single composed program \(R[A_Q]\) of Definition 93. This predicate has no argument for an alternative \(P\)-algorithm, no trace certificate argument, and no field that can replace the displayed halting fact.

Definition 95 Composed witness correctness fact

Fix \(P,Q,R,A_Q\), a valid \(P\)-input \(x\), a step count \(s\in \mathbb {N}\), and an output \(y\in O_P(x)\). The predicate

\[ \operatorname {def\_ fg\_ composed\_ correctness\_ fact}(P,Q,R,A_Q,x,s,y) \]

is exactly the single proposition

\[ \Correct _P(x,y). \]

The parameters \(R\), \(A_Q\), and \(s\) are retained only so this predicate has the same witness arguments as the corresponding halting fact; they do not add any alternative program, trace data, or replaceable correctness field.

Definition 96 Composed witness halting and correctness

Fix \(P,Q,R,A_Q\), a valid \(P\)-input \(x\), a step count \(s\in \mathbb {N}\), and an output \(y\in O_P(x)\). The predicate

\[ \operatorname {def\_ fg\_ composed\_ halting\_ correctness}(P,Q,R,A_Q,x,s,y) \]

is exactly the two-conjunct proposition

\[ \operatorname {def\_ fg\_ composed\_ halting\_ fact}(P,Q,R,A_Q,x,s,y) \quad \text{and}\quad \operatorname {def\_ fg\_ composed\_ correctness\_ fact}(P,Q,R,A_Q,x,s,y). \]

Expanding the two helper predicates gives exactly

\[ \operatorname {HaltsWith}_{R[A_Q]}(x,s,y) \quad \text{and}\quad \Correct _P(x,y). \]

The program in the halting conjunct is the single composed program \(R[A_Q]\) of Definition 93. This predicate has no argument for an alternative \(P\)-algorithm and no field that can replace either displayed fact.

Definition 97 Composed witness trace certificate

Fix \(P,Q,R,A_Q\), a valid \(P\)-input \(x\), an output \(y\in O_P(x)\), a trace

\[ t=((q_1,z_1),\ldots ,(q_{r(x)},z_{r(x)}),y), \]

a generated state sequence \(G:\{ 0,\ldots ,r(x)\} \to \operatorname {State}_R(x)\), and oracle first-halting-time data \(U:\{ 1,\ldots ,r(x)\} \to \mathbb {N}\). The predicate

\[ \operatorname {def\_ fg\_ composed\_ trace\_ certificate}(P,Q,R,A_Q,x,y,t,G,U) \]

is exactly the conjunction of

\[ \operatorname {def\_ composed\_ oracle\_ run\_ equations}(x,t,G,U), \]
\[ \forall \, 1\leq i\leq r(x),\qquad \operatorname {HaltsWith}_{A_Q}(q_i,U(i),z_i), \]

and

\[ y=\operatorname {finish}_R(x,G(r(x)),H(x,t,r(x)+1)). \]

The entries \(q_i,z_i\) are the query and answer entries of the displayed trace \(t\), and the prefix-history selector \(H\) is the one from the fixed local-phase presentation of \(R\). The oracle halting facts and the final postprocessing equality are conjuncts of this predicate, so they are eliminable from a proof for the same witnesses \((x,y,t,G,U)\) rather than consequences quoted only through a lemma name.

Definition 98 Composed witness local accounting

Fix \(P,Q,R,A_Q,T_Q\), a valid \(P\)-input \(x\), a step count \(s\in \mathbb {N}\), a trace \(t=((q_1,z_1),\ldots ,(q_{r(x)},z_{r(x)}),y)\), a generated state sequence \(G:\{ 0,\ldots ,r(x)\} \to \operatorname {State}_R(x)\), oracle first-halting-time data \(U:\{ 1,\ldots ,r(x)\} \to \mathbb {N}\), and a local cost \(L\in \mathbb {N}\). The predicate

\[ \operatorname {def\_ fg\_ composed\_ local\_ accounting} (P,Q,R,A_Q,T_Q,x,s,t,G,U,L) \]

is exactly the conjunction of

\[ \operatorname {def\_ oracle\_ reduction\_ local\_ phases}(x,t,G,L), \]
\[ s=L+\sum _{i=1}^{r(x)}U(i), \]

and

\[ s\leq L+\sum _{i=1}^{r(x)}T_Q(N_Q(q_i),L_Q(q_i)). \]

Thus the local-phase certificate, the exact first-halting step-count equation, and the induced oracle-cost upper bound are separate eliminable conjuncts for the same trace \(t\), state sequence \(G\), oracle time data \(U\), and local cost \(L\).

Definition 99 Composed witness subquadratic transfer bound

Fix \(P,Q,R\), constants \(\varepsilon '{\gt}0\), \(C'{\gt}0\), and \(b'\in \mathbb {N}\), a valid \(P\)-input \(x\), and a step count \(s\in \mathbb {N}\). The predicate

\[ \operatorname {def\_ fg\_ composed\_ transfer\_ bound}(P,Q,R,\varepsilon ',C',b',x,s) \]

is the single inequality

\[ s\leq C' N_P(x)^{2-\varepsilon '}(1+L_P(x))^{b'}. \]

This is only the final transferred \(P\)-running-time bound. It contains no trace data, no local-cost data, and no oracle-run data; those are the separate obligations of Definitions 97 and 98.

Definition 100 Fine-grained composed witness obligations

Fix \(P,Q,R,A_Q,T_Q\) and constants \(\varepsilon '{\gt}0\), \(C'{\gt}0\), and \(b'\in \mathbb {N}\). The predicate

\[ \operatorname {def\_ fine\_ grained\_ composed\_ witness\_ obligations} (P,Q,R,A_Q,T_Q,\varepsilon ',C',b') \]

is a proposition with exactly these displayed arguments and no additional program, semantics, trace-characterization, accounting, or helper-proof parameters. It holds exactly when, for every valid \(P\)-input \(x\), there exist concrete data

\[ s\in \mathbb {N},\quad y\in O_P(x),\quad t=((q_1,z_1),\ldots ,(q_{r(x)},z_{r(x)}),y), \]

a generated state sequence \(G:\{ 0,\ldots ,r(x)\} \to \operatorname {State}_R(x)\), oracle first-halting-time data \(U:\{ 1,\ldots ,r(x)\} \to \mathbb {N}\), and a local cost \(L\in \mathbb {N}\) such that all four one-to-one witness obligations hold for those same witnesses:

\[ \operatorname {def\_ fg\_ composed\_ halting\_ correctness} (P,Q,R,A_Q,x,s,y), \]
\[ \operatorname {def\_ fg\_ composed\_ trace\_ certificate} (P,Q,R,A_Q,x,y,t,G,U), \]
\[ \operatorname {def\_ fg\_ composed\_ local\_ accounting} (P,Q,R,A_Q,T_Q,x,s,t,G,U,L), \]

and

\[ \operatorname {def\_ fg\_ composed\_ transfer\_ bound} (P,Q,R,\varepsilon ',C',b',x,s). \]

Expanding these four helper predicates gives exactly the original displayed universal-existential proposition: the composed program halts with output \(y\), that output satisfies \(\Correct _P(x,y)\), the trace satisfies \(\operatorname {def\_ composed\_ oracle\_ run\_ equations}(x,t,G,U)\), the same witnesses satisfy \(\operatorname {def\_ oracle\_ reduction\_ local\_ phases}(x,t,G,L)\),

\[ s=L+\sum _{i=1}^{r(x)}U(i), \]

each oracle answer satisfies \(\operatorname {HaltsWith}_{A_Q}(q_i,U(i),z_i)\), the final output satisfies

\[ y=\operatorname {finish}_R(x,G(r(x)),H(x,t,r(x)+1)), \]

the induced oracle-cost bound

\[ s\leq L+\sum _{i=1}^{r(x)}T_Q(N_Q(q_i),L_Q(q_i)) \]

holds, and the transferred subquadratic bound

\[ s\leq C' N_P(x)^{2-\varepsilon '}(1+L_P(x))^{b'} \]

holds. The helper predicates do not add a new program, trace, state sequence, or local-cost witness; they only name four individually formalizable conjunct groups of the same proposition.

The Lean-facing fine-grained reduction predicate has the explicit arguments

\[ \operatorname {def\_ fine\_ grained\_ reduction} (P,Q,h_P,h_Q), \]

where \(P\) and \(Q\) are computational problem specifications and

\[ h_P:\operatorname {def\_ quadratic\_ baseline\_ algorithm}(P), \qquad h_Q:\operatorname {def\_ quadratic\_ baseline\_ algorithm}(Q) \]

are required baseline-algorithm witnesses from Definition 73. The predicate is not defined for bare problem specifications with no baseline witnesses.

With those baseline witnesses fixed, \(P\) reduces to \(Q\) in the fine-grained subquadratic sense if, for every constant \(\varepsilon {\gt}0\) and every particular correct deterministic \(Q\)-algorithm \(A_Q\) whose actual operational running-time bound satisfies

\[ T_Q(n',\ell ')\leq C(n')^{2-\varepsilon }(1+\ell ')^b \]

on valid \(Q\)-instances, there exist an oracle reduction datum \(R\) from \(P\) to \(Q\), a local-phase presentation of \(R\), and constants \(\varepsilon '{\gt}0\), \(C'{\gt}0\), and \(b'\in \mathbb {N}\) such that all of the following obligations hold for this same displayed tuple \((R,A_Q,T_Q,\varepsilon ',C',b')\).

First, \(R\) is a correct oracle reduction: it sends valid \(P\)-inputs to valid \(Q\)-queries and every locally generated trace with correct oracle answers has a final output satisfying \(\Correct _P\), exactly as in Definition 53. Second, \(R\) has the subquadratic transfer budget of Definition 72 against the displayed running-time bound \(T_Q\). Third, the \(P\)-algorithm witnessing the reduction is definitionally the composed algorithm

\[ A_P=R[A_Q] \]

from Definition 93. Its program code, run relation, output, and step count are the concrete substitution simulation of \(R\) using the actual runs of \(A_Q\) on the actual constructed oracle queries. The reduction is not allowed to existentially choose any other \(P\)-algorithm \(A_P\).

Fourth, the composed witness obligations of Definition 100 hold for that same \(R[A_Q]\). Thus the final subquadratic correctness and time guarantee is not a separate existential consequence: it is the halting, correctness, final-postprocessing, oracle-answer, and step-count accounting certificate of the composed algorithm constructed in the third obligation. Problems are subquadratic equivalent if the same baseline-witnessed reduction predicate holds in both directions.

Definition 102 \(k\)SAT decision problem
#

For positive integers \(k\) and \(n\), a \(k\)CNF formula on variables \(x_1,\ldots ,x_n\) is a finite conjunction of clauses, where each clause is a disjunction of at most \(k\) literals and each literal is either \(x_i\) or \(\neg x_i\) for some \(i\). An assignment is a function \(\sigma :\{ 1,\ldots ,n\} \to \{ 0,1\} \). It satisfies a positive literal \(x_i\) when \(\sigma (i)=1\), satisfies a negative literal \(\neg x_i\) when \(\sigma (i)=0\), satisfies a clause when it satisfies at least one literal in that clause, and satisfies the formula when it satisfies every clause. The decision problem \(k\mathrm{SAT}\) asks whether a given \(k\)CNF formula has a satisfying assignment.

Conjecture 103 Strong Exponential Time Hypothesis, Definition 2.4/A.1

For every \(\varepsilon {\gt}0\), there is a positive integer \(k\) such that no correct deterministic decision algorithm for \(k\mathrm{SAT}\) decides all valid \(k\)CNF formulas with \(n\) variables in time \(O(2^{(1-\varepsilon )n}\operatorname {poly}(M))\), uniformly for every encoded-size parameter \(M\in \mathbb {N}\), for all sufficiently large \(n\).

Lean-facing, this conjecture quantifies only over program codes \(A\) for the \(k\mathrm{SAT}\) computational-problem specification together with semantic worst-case running-time bounds \(T\) in the sense of Definitions 46 and 47. The forbidden fast-algorithm statement is: there do not exist \(A,T,C,b,n_0\) such that \(A\) halts on every valid \(k\mathrm{SAT}\) input, returns \(1\) exactly when the formula is satisfiable and \(0\) exactly when it is unsatisfiable, \(T\) bounds the actual first halting time of that correct execution on every valid input, and

\[ T(n,M)\leq C\, 2^{(1-\varepsilon )n}(1+M)^b \]

for every \(n\geq n_0\) and every natural number \(M\in \mathbb {N}\), including size parameters for which no valid encoded \(k\)CNF formula with \(n\) variables exists. For valid inputs, the relevant value of \(M\) is the input’s actual encoded formula size; the quantified running-time bound itself is a uniform bound on the full size-parameter function \(T(n,M)\), not only on the subset of parameter pairs realized by valid formulas. Incorrect programs, partial programs, and arbitrary exact-time functions unattached to a correct halting execution are outside the quantified obstruction.

Definition 104 Orthogonal Vectors, Definition 2.5/A.2
#

Given binary vectors \(v_1,\ldots ,v_n\in \{ 0,1\} ^{\ell }\), the problem \(\mathrm{OV}_{n,\ell }\) asks whether there are indices \(i\neq j\) with \(\left\langle v_i,v_j\right\rangle =0\).

Conjecture 105 Orthogonal Vectors Conjecture, Conjecture 2.6/A.3

For every \(\varepsilon {\gt}0\) there exists a constant \(c{\gt}0\) such that \(\mathrm{OV}_{n,\ell _c(n)}\) cannot be solved in \(O(n^{2-\varepsilon })\) time, where \(c\) is a positive real constant and the integer dimension schedule is

\[ \ell _c(n)=\max \{ 1,\lceil c\log _2(\max \{ n,2\} )\rceil \} . \]

Equivalently, the paper’s notation \(c\log n\) means this real-constant logarithmic dimension up to the displayed integer rounding, not an integer-valued constant multiplied by an integer logarithm.

Lean-facing, this conjecture is the direct negation of the existence of a correct deterministic \(\mathrm{OV}\) decision program with the displayed semantic worst-case bound. For each \(\varepsilon {\gt}0\) there is a real number \(c\) with \(c{\gt}0\) such that there do not exist a program code \(A\), a worst-case running-time bound \(T:\mathbb {N}\times \mathbb {N}\to \mathbb {R}_{\geq 0}\), constants \(C{\gt}0\) and \(n_0\), and the correctness and halting witnesses from Definitions 46 and 47, satisfying all of the following: for every valid \(\mathrm{OV}\) input with \(n\) vectors in the rounded dimension \(\ell _c(n)\) above, \(A\) halts and returns \(1\) exactly when some distinct pair has inner product \(0\) and returns \(0\) exactly otherwise, \(T\) bounds the actual first halting time of that execution, and

\[ T(n,\ell _c(n))\leq C n^{2-\varepsilon } \]

for every \(n\geq n_0\). The constant \(c\) is not a natural number, and \(\ell _c(n)\) is not the narrower expression \(c_{\mathbb {N}}\cdot \operatorname {Nat.log2}(n)\) for some \(c_{\mathbb {N}}\in \mathbb {N}\); any formalization must retain the positive real constant and the explicit ceiling/max conversion to a positive integer dimension. No additional premise such as \(\operatorname {def\_ truly\_ subquadratic}(T)\) is part of the forbidden fast-algorithm package. The predicate \(\operatorname {def\_ truly\_ subquadratic}\) may be derived from the displayed big-\(O\) bound when needed, but it is not a separate hypothesis that weakens the conjecture.

Theorem 106 SETH implies OVC

If SETH holds, then OVC holds.

Definition 107 Bichromatic Orthogonal Vectors

In bichromatic \(\mathrm{OV}_{n,\ell }\) one is given \(A=\{ a_1,\ldots ,a_n\} \) and \(B=\{ b_1,\ldots ,b_n\} \) in \(\{ 0,1\} ^{\ell }\) and asks whether some pair \((a_i,b_j)\) satisfies \(\left\langle a_i,b_j\right\rangle =0\).

Definition 108 Monochromatic-to-bichromatic OV reduction datum

The reduction datum \(R_{\rm mono\to bi}\) from monochromatic \(\mathrm{OV}\) to bichromatic \(\mathrm{OV}\) acts on a monochromatic input \(V=(v_1,\ldots ,v_n)\subseteq \{ 0,1\} ^{\ell }\) as the following concrete one-query-or-zero-query local-phase reduction. The fine-grained regime is \(n\geq 2\); the finitely many inputs with \(n{\lt}2\) are decided by the constant zero-query branch by directly returning no, since no distinct pair of indices exists.

First it computes the Boolean value

\[ Z(V)\quad \Longleftrightarrow \quad \exists i\in \{ 1,\ldots ,n\} ,\ \forall r\in \{ 1,\ldots ,\ell \} ,\ v_i[r]=0 \]

by the deterministic nested scan over all entries of the input matrix. The scan step count is exactly bounded by a fixed constant multiple of \(n(1+\ell )\), because each of the \(n\ell \) Boolean coordinates is inspected at most once and the per-row accumulator is updated in constant time.

If \(n\geq 2\) and \(Z(V)\) is true, then the oracle-call count is \(r(V)=0\), there is no bichromatic query, and the final postprocessing output is the yes answer for monochromatic \(\mathrm{OV}\). If \(Z(V)\) is false, then the oracle-call count is \(r(V)=1\) and the unique query is the concrete bichromatic instance

\[ q_1(V)=(A(V),B(V)),\qquad A(V)=V,\qquad B(V)=V, \]

with principal size \(N_Q(q_1(V))=n\) and auxiliary dimension \(L_Q(q_1(V))=\ell \). The copy phase writes the two lists \(A(V)\) and \(B(V)\) coordinatewise, so its step count is also bounded by a fixed constant multiple of \(n(1+\ell )\). The update phase merely stores the oracle answer \(z_1\in \{ 0,1\} \), and the final postprocessing returns exactly \(z_1\) as the monochromatic \(\mathrm{OV}\) answer. Thus every locally generated trace has local non-oracle cost

\[ L\leq C_0\, n(1+\ell ) \]

for an absolute constant \(C_0\), and the oracle-cost sum is either \(0\) in the zero-vector branch or exactly \(T_Q(n,\ell )\) in the one-query branch. These scan, query-size, postprocessing, and cost equalities are part of the datum; they are not deferred to a later opaque reduction predicate.

Lemma 109 Monochromatic-to-bichromatic OV query correctness

For every monochromatic OV input \(V=(v_1,\ldots ,v_n)\) with \(n\geq 2\), the two branches of \(R_{\rm mono\to bi}\) preserve the yes/no condition as follows. If \(Z(V)\) is true, then \(V\) is a yes instance of monochromatic \(\mathrm{OV}\). If \(Z(V)\) is false, then the unique query \((V,V)\) is a yes instance of bichromatic \(\mathrm{OV}\) if and only if \(V\) is a yes instance of monochromatic \(\mathrm{OV}\).

Proof

If \(Z(V)\) is true, choose a zero row \(v_i\). Since \(n\geq 2\), choose an index \(j\neq i\). Then \(\left\langle v_i,v_j\right\rangle =0\), so the monochromatic instance is yes. If \(Z(V)\) is false, then every vector is nonzero. For a binary vector, nonzero means it has some coordinate equal to \(1\), and hence \(\left\langle v_i,v_i\right\rangle \geq 1\). Thus no self-pair in the bichromatic query \((V,V)\) is orthogonal. A bichromatic orthogonal pair must therefore use two distinct original rows, giving a monochromatic OV witness. Conversely any distinct monochromatic OV witness is exactly the same cross-pair in the query \((V,V)\).

Lemma 110 Monochromatic-to-bichromatic OV branch answer transfer

For every valid monochromatic OV input \(V=(v_1,\ldots ,v_n)\), the oracle-answer correctness obligation for \(R_{\rm mono\to bi}\) is exactly branch-sensitive.

If \(n{\lt}2\), then \(r(V)=0\), the final postprocessing output is \(0\), and this is the correct monochromatic OV answer because no distinct pair of input rows exists. If \(n\geq 2\) and \(Z(V)\) is true, then \(r(V)=0\), there is no query and no oracle answer to quantify over, the final postprocessing output is \(1\), and this is the correct monochromatic OV answer.

If \(n\geq 2\) and \(Z(V)\) is false, then \(r(V)=1\) and the unique query is

\[ q_1(V)=(V,V). \]

In this one-query branch, and only in this branch, every correct yes/no oracle answer \(z_1\) for the bichromatic query \(q_1(V)\) is the correct yes/no answer for the original monochromatic instance \(V\). Equivalently, in the nonzero branch the final postprocessing value \(\operatorname {finish}_{R_{\rm mono\to bi}}(V,\sigma _1,H_2)=z_1\) satisfies the monochromatic OV correctness relation whenever \(z_1\) satisfies the bichromatic OV correctness relation on \(q_1(V)\).

The zero-vector branch has no proposition of the form “every correct oracle answer on \(q_1(V)\) gives the correct original answer”, because \(q_1(V)\) is not constructed there. In particular, the correctness proof must not use the self-query \((V,V)\) in the zero-vector branch, where that query could contain self-pair artefacts and is irrelevant to the reduction run.

Proof

The branch equations for \(r(V)\), \(q_1(V)\), and final postprocessing are part of Definition 108. For \(n{\lt}2\), the monochromatic OV witness predicate is empty because it requires distinct indices. For \(n\geq 2\) and \(Z(V)\) true, Lemma 109 proves that \(V\) is a yes instance, so the direct output \(1\) is correct without any oracle call. For \(n\geq 2\) and \(Z(V)\) false, the same lemma states that the unique query \((V,V)\) is a yes instance exactly when the original instance is a yes instance. Therefore a correct Boolean answer to that unique query is exactly the correct Boolean answer for \(V\), and the update/finish clauses return that same answer.

Lemma 111 Monochromatic-to-bichromatic OV local cost transfer

Suppose a bichromatic \(\mathrm{OV}\) algorithm has a semantic running-time bound

\[ T_Q(n',\ell ')\leq C(n')^{2-\varepsilon }(1+\ell ')^b \]

on valid bichromatic inputs. For every locally generated trace of \(R_{\rm mono\to bi}\) on a monochromatic input of size \((n,\ell )\), the composed reduction run has total time

\[ L+\sum _s T_Q(N_Q(q_s),L_Q(q_s)) \leq C_0n(1+\ell )+C n^{2-\varepsilon }(1+\ell )^b. \]

Consequently, for every fixed \(\varepsilon {\gt}0\) there are constants \(\varepsilon '{\gt}0\), \(C'{\gt}0\), and \(b'\in \mathbb {N}\) such that the same total time is at most

\[ C'n^{2-\varepsilon '}(1+\ell )^{b'} \]

for all sufficiently large \(n\). In particular, a truly subquadratic bichromatic OV solver transfers to a truly subquadratic monochromatic OV solver with only polynomial overhead in \(\ell \).

Proof

The datum gives \(L\leq C_0n(1+\ell )\). In the zero-vector branch the oracle sum is empty. In the nonzero branch there is exactly one query, and its size and dimension are exactly \((n,\ell )\), so the oracle contribution is at most \(T_Q(n,\ell )\leq Cn^{2-\varepsilon }(1+\ell )^b\). This proves the first displayed inequality. Taking for example \(\varepsilon '=\varepsilon /2\) and \(b'=\max (b,1)\), the linear local term is absorbed into \(C'n^{2-\varepsilon '}(1+\ell )^{b'}\) for sufficiently large \(n\), and the oracle term is bounded by the same expression after increasing \(C'\).

Lemma 112 Monochromatic-to-bichromatic OV reduction correctness and cost

For any fixed baseline witnesses for monochromatic \(\mathrm{OV}\) and bichromatic \(\mathrm{OV}\), the datum \(R_{\rm mono\to bi}\) satisfies

\[ \operatorname {def\_ fine\_ grained\_ reduction} (\mathrm{OV},\operatorname {BiOV},h_{\rm mono},h_{\rm bi}). \]

In particular, substituting any truly subquadratic bichromatic \(\mathrm{OV}\) algorithm into the composed program \(R_{\rm mono\to bi}[A_{\rm bi}]\) gives the concrete monochromatic \(\mathrm{OV}\) algorithm certified by Definition 101. More explicitly, the witness for this reduction includes the following eliminable obligations:

\[ r(V)=0\ \text{and final output }1\quad \text{when }n\geq 2\text{ and }Z(V), \]
\[ r(V)=1,\quad q_1(V)=(V,V),\quad N_Q(q_1(V))=n,\quad L_Q(q_1(V))=\ell \quad \text{when }\neg Z(V), \]

the zero-vector scan and copy construction have local cost at most \(C_0n(1+\ell )\), and the oracle-answer correctness obligation is exactly the branch-sensitive obligation of Lemma 110: the \(n{\lt}2\) and zero-vector branches have no query and their direct final outputs are correct, while in the nonzero one-query branch every correct oracle answer on the displayed query \(q_1(V)=(V,V)\) gives the correct monochromatic \(\mathrm{OV}\) answer. There is no universal correctness obligation for an oracle answer on \((V,V)\) in the zero-vector branch. Finally, any oracle bound \(T_Q(n',\ell ')\leq C(n')^{2-\varepsilon }(1+\ell ')^b\) transfers to a composed running-time bound \(C'n^{2-\varepsilon '}(1+\ell )^{b'}\) for fixed constants \(\varepsilon '{\gt}0,C'{\gt}0,b'\).

Proof

Lemma 109 proves the two correctness branches: the zero-vector branch is a direct yes instance, and in the nonzero branch the query \((V,V)\) has a bichromatic orthogonal pair exactly when the original instance has a distinct orthogonal pair. The datum itself supplies the branch equations \(r(V)=0\) or \(r(V)=1\), the query equation \(q_1(V)=(V,V)\), and the size equations \(N_Q(q_1(V))=n\), \(L_Q(q_1(V))=\ell \). Lemma 110 supplies the formal oracle-answer transfer in precisely the one-query branch and supplies the direct-output correctness in the two zero-query branches. Lemma 111 supplies the local scan and copy cost, the one-query oracle-cost accounting, and the preservation of a truly subquadratic exponent after composition. Therefore the oracle reduction correctness, subquadratic transfer budget, and composed witness obligations required by Definition 101 all hold for the concrete composed program \(R_{\rm mono\to bi}[A_{\rm bi}]\).

Definition 113 Bichromatic-to-monochromatic OV reduction datum

The reduction datum \(R_{\rm bi\to mono}\) from bichromatic \(\mathrm{OV}\) to monochromatic \(\mathrm{OV}\) maps a bichromatic input \(A=\{ a_1,\ldots ,a_n\} \) and \(B=\{ b_1,\ldots ,b_n\} \) in \(\{ 0,1\} ^{\ell }\) to the single monochromatic instance in dimension \(\ell +2\) consisting of

\[ a'_i=(a_i,1,0),\qquad b'_j=(b_j,0,1). \]

It queries monochromatic \(\mathrm{OV}\) on the multiset \(A'\cup B'\) and returns exactly the oracle’s yes/no answer. The construction doubles the number of vectors, increases the dimension by \(2\), and has only linear local overhead in the input encoding size.

Lemma 114 Bichromatic-to-monochromatic OV query equivalence

Let \(A=\{ a_1,\ldots ,a_n\} \) and \(B=\{ b_1,\ldots ,b_n\} \) be a valid bichromatic OV input in dimension \(\ell \), and let

\[ A'=\{ (a_i,1,0):1\leq i\leq n\} ,\qquad B'=\{ (b_j,0,1):1\leq j\leq n\} \]

be the transformed rows in the single monochromatic query \(Q(A,B)=A'\cup B'\). Then the query has an orthogonal pair of distinct rows if and only if the original bichromatic input has a cross orthogonal pair:

\[ \exists u\neq v\in Q(A,B),\ \left\langle u,v\right\rangle =0 \quad \Longleftrightarrow \quad \exists i,j,\ \left\langle a_i,b_j\right\rangle =0. \]

More granularly, for all \(i,i'\) and \(j,j'\),

\[ \left\langle (a_i,1,0),(a_{i'},1,0)\right\rangle =\left\langle a_i,a_{i'}\right\rangle +1\geq 1, \]
\[ \left\langle (b_j,0,1),(b_{j'},0,1)\right\rangle =\left\langle b_j,b_{j'}\right\rangle +1\geq 1, \]

and

\[ \left\langle (a_i,1,0),(b_j,0,1)\right\rangle =\left\langle a_i,b_j\right\rangle . \]

Thus every orthogonal witness in the monochromatic query is necessarily a cross pair with one row from \(A'\) and one row from \(B'\).

Proof

Expanding the three appended coordinates gives the displayed inner-product equalities. Same-side transformed pairs receive an additional contribution \(1\) from the side marker coordinate, so they cannot be orthogonal. Cross pairs receive no contribution from the two marker coordinates, so their transformed inner product is exactly the original inner product. Therefore any monochromatic orthogonal pair must be cross and gives a bichromatic witness, while any bichromatic witness gives the corresponding cross orthogonal pair in the query.

Lemma 115 Bichromatic-to-monochromatic OV oracle answer transfer

For the reduction \(R_{\rm bi\to mono}\) on a valid bichromatic input \((A,B)\), the oracle-call count is \(1\), the unique oracle query is the monochromatic instance \(Q(A,B)=A'\cup B'\) from Definition 113, and final postprocessing returns exactly the oracle answer \(z_1\).

Consequently, every correct yes/no answer \(z_1\) for the monochromatic query \(Q(A,B)\) is the correct yes/no answer for the original bichromatic OV input \((A,B)\). Equivalently, if \(z_1=1\), then \(Q(A,B)\) has an orthogonal pair and hence \((A,B)\) has a cross orthogonal pair; if \(z_1=0\), then \(Q(A,B)\) has no orthogonal pair and hence \((A,B)\) has no cross orthogonal pair.

Proof

The query-count, query-construction, and final-postprocessing equations are the concrete clauses of Definition 113. Lemma 114 identifies the yes condition of the query with the yes condition of the original bichromatic input. A correct Boolean oracle answer is therefore true exactly in the original yes case and false exactly in the original no case, and the final postprocessing returns that same Boolean value.

Lemma 116 Bichromatic-to-monochromatic OV reduction correctness and cost

For any fixed baseline witnesses for bichromatic \(\mathrm{OV}\) and monochromatic \(\mathrm{OV}\), the datum \(R_{\rm bi\to mono}\) satisfies

\[ \operatorname {def\_ fine\_ grained\_ reduction} (\operatorname {BiOV},\mathrm{OV},h_{\rm bi},h_{\rm mono}). \]

In particular, substituting any truly subquadratic monochromatic \(\mathrm{OV}\) algorithm into the composed program \(R_{\rm bi\to mono}[A_{\rm mono}]\) gives the concrete bichromatic \(\mathrm{OV}\) algorithm certified by Definition 101. More explicitly, the witness for this reduction includes the following eliminable obligations:

\[ r(A,B)=1,\qquad q_1(A,B)=A'\cup B', \]
\[ N_Q(q_1(A,B))=2n,\qquad L_Q(q_1(A,B))=\ell +2, \]

the iff

\[ q_1(A,B)\text{ is a yes instance of monochromatic }\mathrm{OV}\quad \Longleftrightarrow \quad (A,B)\text{ is a yes instance of bichromatic }\mathrm{OV}, \]

and the answer-transfer statement that every correct oracle answer on \(q_1(A,B)\) is the correct final answer for \((A,B)\) because final postprocessing returns that same answer.

Proof

Lemma 114 gives the central correctness equivalence: the constructed monochromatic query has an orthogonal pair exactly when the original bichromatic instance has a cross orthogonal pair. Lemma 115 turns that equivalence into the required oracle-answer correctness obligation for the single query and the final postprocessing step. The size changes from \(n\) to \(2n\), the dimension changes from \(\ell \) to \(\ell +2\), and the encoding construction is linear, so the subquadratic exponent and the polynomial-in-\(\ell \) factor are preserved. The final algorithm is the composed program \(R_{\rm bi\to mono}[A_{\rm mono}]\) named in Definition 101, not a separately chosen existential solver.

Lemma 117 Monochromatic and bichromatic OV are equivalent, Lemma A.4

With fixed quadratic-baseline witnesses for the monochromatic and bichromatic OV problem specifications, there are fine-grained reductions in both directions:

\[ \operatorname {def\_ fine\_ grained\_ reduction} (\mathrm{OV},\operatorname {BiOV},h_{\rm mono},h_{\rm bi}) \]

and

\[ \operatorname {def\_ fine\_ grained\_ reduction} (\operatorname {BiOV},\mathrm{OV},h_{\rm bi},h_{\rm mono}). \]

Consequently a truly subquadratic algorithm for \(\mathrm{OV}_{n,\ell }\) exists if and only if a truly subquadratic algorithm for bichromatic \(\mathrm{OV}_{n,\ell }\) exists, up to polynomial factors in \(\ell \).

Proof

Lemma 112 supplies the reduction from monochromatic OV to bichromatic OV by the concrete composed algorithm \(R_{\rm mono\to bi}[A_{\rm bi}]\). Therefore any truly subquadratic bichromatic solver transfers to a truly subquadratic monochromatic solver with only polynomial overhead in \(\ell \). Lemma 116 supplies the reverse reduction by the concrete composed algorithm \(R_{\rm bi\to mono}[A_{\rm mono}]\), so any truly subquadratic monochromatic solver transfers to a truly subquadratic bichromatic solver with the same allowed overhead. These are exactly the two implications in the displayed equivalence.

Definition 118 Minimum Inner Product, Definition 2.7/A.5
#

Given binary vectors \(v_1,\ldots ,v_n\in \{ 0,1\} ^{\ell }\), \(\mathrm{Min\mbox{-}IP}_{n,\ell }\) asks to find a pair \(i\neq j\) minimizing \(\left\langle v_i,v_j\right\rangle \).

Definition 119 Approximate Minimum Inner Product, Definition 2.8/A.6

For \(\gamma \geq 1\), \(\gamma \)-\(\mathrm{Min\mbox{-}IP}_{n,\ell }\) asks to find a pair whose inner product is a \(\gamma \)-approximation of the minimum inner product.

Definition 120 Minimum Inner Product decision version, Definition 2.9/A.7

Given a threshold \(0\leq t\leq \ell \), \(\mathrm{Min\mbox{-}IP}_{n,\ell ,t}\) asks whether some pair \(i\neq j\) has \(\left\langle v_i,v_j\right\rangle \leq t\).

Definition 121 Bichromatic Minimum Inner Product

A rectangular bichromatic Min-IP input consists of two nonempty finite indexed lists

\[ A:\{ 1,\ldots ,n_A\} \to \{ 0,1\} ^{\ell },\qquad B:\{ 1,\ldots ,n_B\} \to \{ 0,1\} ^{\ell }. \]

Its principal size is \(N=\max \{ n_A,n_B\} \) and its auxiliary dimension is \(\ell \). The exact optimization version asks for a pair \((i,j)\in \{ 1,\ldots ,n_A\} \times \{ 1,\ldots ,n_B\} \) minimizing \(\left\langle A_i,B_j\right\rangle \). The \(\gamma \)-approximate version, for \(\gamma \geq 1\), asks for a pair \((i^*,j^*)\) satisfying

\[ \min _{i,j}\left\langle A_i,B_j\right\rangle \leq \left\langle A_{i^*},B_{j^*}\right\rangle \leq \gamma \min _{i,j}\left\langle A_i,B_j\right\rangle . \]

The threshold version with \(0\leq t\leq \ell \) asks for the Boolean answer

\[ \exists i,j,\quad \left\langle A_i,B_j\right\rangle \leq t. \]

The equal-size paper notation is the special case \(n_A=n_B=n\). The divide-and-recurse reductions below use the rectangular formulation so that canonical balanced splits of an arbitrary input length can be queried without adding artificial vectors that might change the minimum.

Definition 122 Concrete OV-from-Min-IP reduction datum

Fix \(\gamma \geq 1\). The reduction datum is not a single ambiguous “Min-IP solver” interface. It has a source branch

\[ \operatorname {source}\in \operatorname {ExactSource}(A_{\rm exact}) \; \sqcup \; \operatorname {GammaSource}(A_{\gamma }), \]

where \(A_{\rm exact}\) is a correct exact \(\mathrm{Min\mbox{-}IP}_{n,\ell }\) program and \(A_{\gamma }\) is a correct \(\gamma \)-\(\mathrm{Min\mbox{-}IP}_{n,\ell }\) program. The two source branches have separate returned-pair selectors and separate halting facts.

Lean-facing, this source is a genuine disjoint sum with branch-dependent payload. An element of \(\operatorname {ExactSource}(A_{\rm exact})\) contains only the exact \(\mathrm{Min\mbox{-}IP}\) program, its exact correctness/halting data, and the exact output selector below. It contains no \(\gamma \)-\(\mathrm{Min\mbox{-}IP}\) program, no approximate correctness proof, no approximate returned-pair selector, and no \(\gamma \)-branch running-time bound. An element of \(\operatorname {GammaSource}(A_{\gamma })\) contains only the \(\gamma \)-\(\mathrm{Min\mbox{-}IP}\) program, its approximate correctness/halting data, and the approximate output selector below. It contains no exact \(\mathrm{Min\mbox{-}IP}\) program, no exact correctness proof, no exact returned-pair selector, and no exact-branch running-time bound. Later declarations quantify over one value \(\operatorname {source}\) of this disjoint sum and eliminate it by cases; they do not take a pair of exact-and-approximate algorithms or a pair of exact-and-approximate runtime hypotheses.

In the exact branch, for every input \(V=(v_1,\ldots ,v_n)\subseteq \{ 0,1\} ^{\ell }\) with \(n\geq 2\), the selector

\[ \operatorname {ExactOutPair}_R(V)=(i^*_{\rm ex},j^*_{\rm ex}) \]

is exactly the halted output pair of \(A_{\rm exact}\) on the exact Min-IP input \(V\), at that program’s first halting time. Its correctness relation is the exact equality

\[ \left\langle v_{i^*_{\rm ex}},v_{j^*_{\rm ex}}\right\rangle =\min _{i\neq j}\left\langle v_i,v_j\right\rangle . \]

In the \(\gamma \) branch, for every such \(V\), the selector

\[ \operatorname {GammaOutPair}_R(V)=(i^*_{\gamma },j^*_{\gamma }) \]

is exactly the halted output pair of \(A_{\gamma }\) on the \(\gamma \)-\(\mathrm{Min\mbox{-}IP}\) input \((V,\gamma )\), at that program’s first halting time. Its correctness relation is the approximation inequality

\[ \min _{i\neq j}\left\langle v_i,v_j\right\rangle \leq \left\langle v_{i^*_{\gamma }},v_{j^*_{\gamma }}\right\rangle \leq \gamma \min _{i\neq j}\left\langle v_i,v_j\right\rangle . \]

The two selectors are branch-specific data. A formalization must not use \(\operatorname {ExactOutPair}_R(V)\), a field named \(\operatorname {exactPair}\), or any exact-output witness as the halted output of the \(\gamma \)-\(\mathrm{Min\mbox{-}IP}\) program. Conversely, \(\operatorname {GammaOutPair}_R(V)\) is not available in the exact branch.

The induced OV decision program \(R_{\mathrm{Min\mbox{-}IP}\to \mathrm{OV}}[A_{\min }]\) has the following concrete operational phases. On input \(V\), if \(n{\lt}2\) it halts immediately and outputs \(0\). If \(n\geq 2\) and the source is exact, it runs \(A_{\rm exact}\) on \(V\) until the first halting output \(\operatorname {ExactOutPair}_R(V)\) is produced. If \(n\geq 2\) and the source is \(\gamma \)-approximate, it runs \(A_{\gamma }\) on \((V,\gamma )\) until the first halting output \(\operatorname {GammaOutPair}_R(V)\) is produced. In either branch it then performs the deterministic coordinate scan of the branch’s own returned pair:

\[ \beta _{\rm ex}(V) =\sum _{r=1}^{\ell }v_{i^*_{\rm ex}}[r]v_{j^*_{\rm ex}}[r], \qquad \beta _{\gamma }(V) =\sum _{r=1}^{\ell }v_{i^*_{\gamma }}[r]v_{j^*_{\gamma }}[r]. \]

The scan step count is the concrete value \(\operatorname {LocalScanSteps}_R(V)\) and satisfies the displayed datum inequality

\[ \operatorname {LocalScanSteps}_R(V)\leq C_0(1+\ell ) \]

for an absolute constant \(C_0\) supplied by the datum. The branch/output overhead is bounded by an absolute constant \(C_1\). The final Boolean output is \(1\) exactly when the scanned value for the active branch is \(0\), and is \(0\) otherwise.

Thus the only subroutine call is the actual run of the active branch’s program on the original Min-IP input, the returned pair is the active branch’s own first halted output, and the final Boolean is the equality test on the concrete inner product of that same pair. There is no externally supplied OV answer, no abstract correctness-equivalence field, and no shared output-pair field that can be used for both exact and approximate sources.

Lemma 123 Min-IP optimum is zero exactly on OV yes instances

For every binary-vector input \(V=(v_1,\ldots ,v_n)\) with \(n\geq 2\),

\[ \min _{i\neq j}\left\langle v_i,v_j\right\rangle =0 \quad \Longleftrightarrow \quad V\text{ is a yes instance of }\mathrm{OV}_{n,\ell }. \]
Proof

Inner products of binary vectors are sums of nonnegative terms, so every feasible pair has inner product at least \(0\). If an OV witness \(i\neq j\) exists, then the minimum is at most \(\left\langle v_i,v_j\right\rangle =0\), hence it is exactly \(0\). Conversely, if the minimum is \(0\), any pair attaining that minimum is a distinct orthogonal pair and therefore an OV witness.

Lemma 124 Exact Min-IP output gives correct OV answer

Suppose \(n\geq 2\) and the exact \(\mathrm{Min\mbox{-}IP}\) algorithm in Definition 122 halts on \(V\) with a pair \((i^*,j^*)\) satisfying

\[ \left\langle v_{i^*},v_{j^*}\right\rangle =\min _{i\neq j}\left\langle v_i,v_j\right\rangle . \]

Then the final test \(\left\langle v_{i^*},v_{j^*}\right\rangle =0\) outputs \(1\) exactly on OV yes instances and outputs \(0\) exactly on OV no instances.

Proof

By the exact-output hypothesis, the tested value is the global minimum inner product over distinct pairs. Lemma 123 identifies the event that this minimum is \(0\) with the OV yes condition. The final branch of Definition 122 returns precisely the Boolean value of that equality test.

Lemma 125 Approximate Min-IP output gives correct OV answer

Suppose \(n\geq 2\), \(\gamma \geq 1\), and the \(\gamma \)-\(\mathrm{Min\mbox{-}IP}\) algorithm in Definition 122 halts on \(V\) with a pair \((i^*,j^*)\) satisfying

\[ \min _{i\neq j}\left\langle v_i,v_j\right\rangle \leq \left\langle v_{i^*},v_{j^*}\right\rangle \leq \gamma \min _{i\neq j}\left\langle v_i,v_j\right\rangle . \]

Then the final test \(\left\langle v_{i^*},v_{j^*}\right\rangle =0\) outputs \(1\) exactly on OV yes instances and outputs \(0\) exactly on OV no instances.

Proof

If \(V\) is an OV yes instance, Lemma 123 gives that the minimum is \(0\). The approximation inequalities become \(0\leq \left\langle v_{i^*},v_{j^*}\right\rangle \leq 0\), so the tested inner product is \(0\) and the final output is \(1\). If \(V\) is an OV no instance, the same lemma says the minimum is not \(0\); since all binary inner products are nonnegative integers, the minimum is at least \(1\), and the lower approximation inequality gives \(\left\langle v_{i^*},v_{j^*}\right\rangle \geq 1\). The equality test is then false and the final output is \(0\).

Lemma 126 Exact Min-IP detects OV: branch correctness certificate

In the exact source case \(\operatorname {source}=\operatorname {ExactSource}(A_{\rm exact})\), the concrete program \(R_{\mathrm{Min\mbox{-}IP}\to \mathrm{OV}}[A_{\rm exact}]\) has a correctness certificate

\[ \operatorname {ExactMinIPDetectsOVCorrect}_R(A_{\rm exact}) \]

with exactly the following content. If \(n{\lt}2\), the program makes no Min-IP call and outputs \(0\). If \(n\geq 2\), it runs only the exact program \(A_{\rm exact}\) on the exact \(\mathrm{Min\mbox{-}IP}\) input \(V\) until the first halted output \(\operatorname {ExactOutPair}_R(V)\), scans that same pair, and outputs \(1\) exactly when the scanned inner product is \(0\):

\[ R_{\mathrm{Min\mbox{-}IP}\to \mathrm{OV}}[A_{\rm exact}](V)=1 \quad \Longleftrightarrow \quad \exists i\neq j,\ \left\langle v_i,v_j\right\rangle =0. \]

It outputs \(0\) exactly in the negation of this condition, and its local first-halting-time equation is

\[ s_{\mathrm{OV}}(V)=s_{\rm exact}(V) +\operatorname {LocalScanSteps}_R(V)+C_1. \]

This node has no parameters or hypotheses for a \(\gamma \)-\(\mathrm{Min\mbox{-}IP}\) program, no \(\gamma \)-branch returned pair, and no runtime bound for either branch. It is a correctness and local first-halting certificate for the exact branch alone.

Proof

Unfold the exact branch of Definition 122. The small-input branch is correct because no distinct pair exists. For \(n\geq 2\), the scanned pair is exactly \(\operatorname {ExactOutPair}_R(V)\), the first halted output of the exact Min-IP program. Lemma 124 proves that testing this pair for inner product zero gives precisely the OV yes/no answer. The local first-halting-time equation is the exact-branch phase decomposition from the same reduction datum.

Lemma 127 \(\gamma \)-Min-IP detects OV: branch correctness certificate

In the approximate source case \(\operatorname {source}=\operatorname {GammaSource}(A_{\gamma })\), the concrete program \(R_{\mathrm{Min\mbox{-}IP}\to \mathrm{OV}}[A_{\gamma }]\) has a correctness certificate

\[ \operatorname {GammaMinIPDetectsOVCorrect}_R(A_{\gamma }) \]

with exactly the following content. If \(n{\lt}2\), the program makes no Min-IP call and outputs \(0\). If \(n\geq 2\), it runs only the \(\gamma \)-\(\mathrm{Min\mbox{-}IP}\) program \(A_{\gamma }\) on the approximate input \((V,\gamma )\) until the first halted output \(\operatorname {GammaOutPair}_R(V)\), scans that same approximate output pair, and outputs \(1\) exactly when the scanned inner product is \(0\):

\[ R_{\mathrm{Min\mbox{-}IP}\to \mathrm{OV}}[A_{\gamma }](V)=1 \quad \Longleftrightarrow \quad \exists i\neq j,\ \left\langle v_i,v_j\right\rangle =0. \]

It outputs \(0\) exactly in the negation of this condition, and its local first-halting-time equation is

\[ s_{\mathrm{OV}}(V)=s_{\gamma }(V,\gamma ) +\operatorname {LocalScanSteps}_R(V)+C_1. \]

This node has no parameters or hypotheses for an exact \(\mathrm{Min\mbox{-}IP}\) program, no exact-branch returned pair, and no runtime bound for either branch. It is a correctness and local first-halting certificate for the \(\gamma \) branch alone. Every occurrence of the returned pair in this statement is \(\operatorname {GammaOutPair}_R(V)\).

Proof

Unfold the approximate branch of Definition 122. The small-input branch is correct because no distinct pair exists. For \(n\geq 2\), the scanned pair is exactly \(\operatorname {GammaOutPair}_R(V)\), the first halted output of the \(\gamma \)-\(\mathrm{Min\mbox{-}IP}\) program. Lemma 125 proves that testing this pair for inner product zero gives precisely the OV yes/no answer. The local first-halting-time equation is the \(\gamma \)-branch phase decomposition from the same reduction datum.

Let \(R\) be the concrete reduction datum of Definition 122. The running-time statement is a branch-by-branch theorem about the induced OV program \(R_{\mathrm{Min\mbox{-}IP}\to \mathrm{OV}}[A_{\min }]\), not an assumption about an externally supplied \(T_{\mathrm{OV}}\).

In the exact branch, suppose \(A_{\rm exact}\) has semantic worst-case bound \(T_{\min }\) in the sense of Definition 47. Then for every valid OV input \(V\) with \(n\geq 2\), the first halting time of the induced OV program on \(V\) is exactly

\[ s_{\mathrm{OV}}(V) = s_{\rm exact}(V) +\operatorname {LocalScanSteps}_R(V)+C_1, \]

where \(s_{\rm exact}(V)\) is the first halting time of \(A_{\rm exact}\) on the exact Min-IP input \(V\), and its halted output is \(\operatorname {ExactOutPair}_R(V)\). Therefore

\[ s_{\mathrm{OV}}(V) \leq T_{\min }(n,\ell )+C_0(1+\ell )+C_1 . \]

In the \(\gamma \) branch, suppose \(A_{\gamma }\) has semantic worst-case bound \(T_{\min }\) on \(\gamma \)-\(\mathrm{Min\mbox{-}IP}\) inputs. Then for every valid OV input \(V\) with \(n\geq 2\), the first halting time of the induced OV program on \(V\) is exactly

\[ s_{\mathrm{OV}}(V) = s_{\gamma }(V,\gamma ) +\operatorname {LocalScanSteps}_R(V)+C_1, \]

where \(s_{\gamma }(V,\gamma )\) is the first halting time of \(A_{\gamma }\) on the approximate input \((V,\gamma )\), and its halted output is \(\operatorname {GammaOutPair}_R(V)\). Therefore

\[ s_{\mathrm{OV}}(V) \leq T_{\min }(n,\ell )+C_0(1+\ell )+C_1 . \]

In the small-input branch \(n{\lt}2\), the induced OV program makes no Min-IP call and halts within the same absolute overhead constant \(C_1\). Hence the total worst-case bound for the constructed OV program is the concrete function

\[ T_{\mathrm{OV}}^R(n,\ell )=T_{\min }(n,\ell )+C_0(1+\ell )+C_1 \]

for \(n\geq 2\), with the constant branch bound for \(n{\lt}2\). If

\[ T_{\min }(n,\ell )\leq C n^{2-\varepsilon }(1+\ell )^b \]

for some \(\varepsilon {\gt}0\), then this displayed constructed bound \(T_{\mathrm{OV}}^R\) is truly subquadratic in \(n\) up to polynomial factors in \(\ell \), after decreasing the exponent and increasing the polynomial factor if necessary.

Lean-facing, this lemma must expose the two branch conclusions above. It must derive the \(T_{\mathrm{OV}}^R\) bound from the first-halting time of the active Min-IP program plus \(\operatorname {LocalScanSteps}_R(V)\) and \(C_1\). It must not take as hypotheses a predicate named \(\operatorname {runtime\_ accounting}\), an assumed inequality for an arbitrary \(T_{\mathrm{OV}}\), or a small-input bound for an externally supplied OV solver. In the \(\gamma \) branch, every halting fact and every scan equation must use \(\operatorname {GammaOutPair}_R(V)\), not \(\operatorname {ExactOutPair}_R(V)\) or any field named \(\operatorname {exactPair}\).

Proof

Unfold Definition 122. In the exact branch, the constructed program first executes the exact Min-IP program on \(V\) until its first halted output \(\operatorname {ExactOutPair}_R(V)\) appears, then performs exactly the displayed coordinate scan and final Boolean branch. In the \(\gamma \) branch, the same phase decomposition uses the first halted output \(\operatorname {GammaOutPair}_R(V)\) of the \(\gamma \)-\(\mathrm{Min\mbox{-}IP}\) program on \((V,\gamma )\). The phase lengths are disjoint, so their sum gives the two displayed first-halting-time equations. The semantic worst-case bound controls the active Min-IP phase, and the datum inequality \(\operatorname {LocalScanSteps}_R(V)\leq C_0(1+\ell )\) controls the scan phase. The \(n{\lt}2\) branch is the direct constant-time output branch. The added linear-in-\(\ell \) and constant terms are absorbed into the allowed polynomial-in-\(\ell \) factor after reducing the subquadratic exponent, for example from \(\varepsilon \) to \(\varepsilon /2\).

Lemma 129 OV-from-Min-IP inherited running-time certificate

Fix \(\gamma \geq 1\) and one active source branch of Definition 122. Suppose the active exact or \(\gamma \)-approximate Min-IP program is a correct algorithm with semantic worst-case bound \(T_{\min }\), and suppose there are constants \(\varepsilon {\gt}0\), \(C{\gt}0\), \(b\in \mathbb {N}\), and \(n_0\) such that

\[ T_{\min }(n,\ell )\leq C n^{2-\varepsilon }(1+\ell )^b \]

for every \(n\geq n_0\) and every allowed dimension \(\ell \).

Then the concrete induced OV program

\[ A_{\mathrm{OV}}^R=R_{\mathrm{Min\mbox{-}IP}\to \mathrm{OV}}[A_{\min }] \]

from Definition 122 has the explicit inherited running-time certificate

\[ \operatorname {InheritedOVTimeCert}_R(A_{\min },T_{\min }) \]

consisting of exactly the following data and facts:

\[ T_{\mathrm{OV}}^R(n,\ell )= \begin{cases} C_1, & n{\lt}2,\\ T_{\min }(n,\ell )+C_0(1+\ell )+C_1, & n\geq 2, \end{cases} \]

a proof that \(T_{\mathrm{OV}}^R\) is a semantic worst-case running-time bound for the actual first-halting execution of the same program \(A_{\mathrm{OV}}^R\), and constants

\[ \varepsilon '=\varepsilon /2{\gt}0,\qquad b'=\max \{ b,1\} , \]

together with a constant \(C'{\gt}0\) and threshold \(n_0'\) such that

\[ T_{\mathrm{OV}}^R(n,\ell )\leq C'n^{2-\varepsilon '}(1+\ell )^{b'} \]

for every \(n\geq n_0'\) and every allowed dimension \(\ell \).

This certificate is part of the conclusion, not a hypothesis. The worst-case-bound proof is derived from the branch-specific first-halting-time equations of Lemma 128; the subquadratic inequality is derived from the displayed bound on \(T_{\min }\). The same constructed program \(A_{\mathrm{OV}}^R\) appears in the correctness certificate, the worst-case-bound certificate, and the truly subquadratic certificate. Lean-facing, a declaration for this node must return the tuple

\[ (T_{\mathrm{OV}}^R,\ h_{\rm worst},\ \varepsilon ',\ C',\ b',\ n_0', h_{\rm subquad}) \]

with the displayed meanings. It must not assume \(\operatorname {def\_ truly\_ subquadratic}(T_{\mathrm{OV}})\) for an arbitrary externally supplied \(T_{\mathrm{OV}}\), and it must not prove only branch-local inequalities without producing the global worst-case bound \(T_{\mathrm{OV}}^R\) for \(A_{\mathrm{OV}}^R\).

Proof

Define \(T_{\mathrm{OV}}^R\) by the displayed small-input and \(n\geq 2\) cases. In each source branch, Lemma 128 identifies the first halting time of the induced OV program with the active Min-IP first-halting time plus the scan and constant overhead, and bounds that sum by \(T_{\min }(n,\ell )+C_0(1+\ell )+C_1\). This proves that \(T_{\mathrm{OV}}^R\) is a worst-case bound for the actual induced program. Substituting the assumed bound on \(T_{\min }\) gives \(T_{\mathrm{OV}}^R(n,\ell )\leq C n^{2-\varepsilon }(1+\ell )^b+C_0(1+\ell )+C_1\) for \(n\geq 2\). With \(\varepsilon '=\varepsilon /2\) and \(b'=\max \{ b,1\} \), the linear and constant overheads are absorbed into \(C'n^{2-\varepsilon '}(1+\ell )^{b'}\) after increasing \(C'\) and \(n_0'\). The \(n{\lt}2\) branch is covered by the constant case of \(T_{\mathrm{OV}}^R\).

Lemma 130 Minimum inner product detects OV: correctness certificate

For every \(\gamma \geq 1\) and every active source branch

\[ \operatorname {source}\in \operatorname {ExactSource}(A_{\rm exact}) \sqcup \operatorname {GammaSource}(A_{\gamma }) \]

from Definition 122, the concrete run-and-test program for that one active branch returns the OV answer on every valid OV input. This node contains only the correctness and local first-halting behavior of the constructed program. It has no worst-case running-time hypotheses and no inactive-branch hypotheses.

More precisely, it returns the certificate

\[ \operatorname {MinIPDetectsOVCorrect}_R(\operatorname {source}) \]

defined by case analysis on the displayed disjoint sum:

\[ \operatorname {MinIPDetectsOVCorrect}_R (\operatorname {ExactSource}(A_{\rm exact})) = \operatorname {ExactMinIPDetectsOVCorrect}_R(A_{\rm exact}), \]
\[ \operatorname {MinIPDetectsOVCorrect}_R (\operatorname {GammaSource}(A_{\gamma })) = \operatorname {GammaMinIPDetectsOVCorrect}_R(A_{\gamma }). \]

Eliminating the exact branch yields exactly Lemma 126; eliminating the \(\gamma \) branch yields exactly Lemma 127. A Lean statement for this label must therefore have one active source argument and must not require hypotheses named like \(h_{\rm Exact}\) and \(h_{\rm Gamma}\) simultaneously. In particular, it must not ask for a semantic worst-case-running-time bound for the inactive exact branch in the \(\gamma \) case, nor for a semantic worst-case-running-time bound for the inactive \(\gamma \) branch in the exact case.

Proof

Cases on the disjoint-sum source. In the exact case, return Lemma 126. In the \(\gamma \) case, return Lemma 127. Since the case split exposes only the active branch payload, no inactive-branch program, correctness proof, or running-time bound is available or needed.

Lemma 131 Minimum inner product detects OV: inherited runtime component

Fix \(\gamma \geq 1\) and one active source branch

\[ \operatorname {source}\in \operatorname {ExactSource}(A_{\rm exact}) \sqcup \operatorname {GammaSource}(A_{\gamma }) \]

from Definition 122. Let \(A_{\min }(\operatorname {source})\) be the exact program in the exact case and the \(\gamma \)-\(\mathrm{Min\mbox{-}IP}\) program in the \(\gamma \) case. Let \(T_{\min }:\mathbb {N}\times \mathbb {N}\to \mathbb {R}_{\geq 0}\) be a semantic worst-case bound for that active Min-IP program. Suppose there are constants \(\varepsilon {\gt}0\), \(C{\gt}0\), \(b\in \mathbb {N}\), and \(n_0\) such that

\[ T_{\min }(n,\ell )\leq C n^{2-\varepsilon }(1+\ell )^b \]

for every \(n\geq n_0\) and every allowed dimension \(\ell \).

Then the constructed OV program \(R_{\mathrm{Min\mbox{-}IP}\to \mathrm{OV}}[A_{\min }(\operatorname {source})]\) has the inherited runtime component

\[ \operatorname {MinIPDetectsOVRuntime}_R (\operatorname {source},T_{\min },C,\varepsilon ,b,n_0), \]

which is exactly the certificate supplied by Lemma 129. Eliminating it gives the concrete bound

\[ T_{\mathrm{OV}}^R(n,\ell )= \begin{cases} C_1, & n{\lt}2,\\ T_{\min }(n,\ell )+C_0(1+\ell )+C_1, & n\geq 2, \end{cases} \]

a proof that \(T_{\mathrm{OV}}^R\) bounds the actual first-halting time of the same constructed OV program, and constants \(\varepsilon '{\gt}0\), \(C'{\gt}0\), \(b'\in \mathbb {N}\), and \(n_0'\) with

\[ \forall n\geq n_0',\ \forall \ell ,\qquad T_{\mathrm{OV}}^R(n,\ell )\leq C'n^{2-\varepsilon '}(1+\ell )^{b'}. \]

This node has the explicit parameters \(T_{\min }\), \(C\), \(\varepsilon \), \(b\), and \(n_0\) for the active source only; the runtime component is not derivable from branch-local accounting alone and is not an assumed property of an arbitrary OV bound. It must not require a runtime bound for the inactive source branch.

Proof

Apply Lemma 129 to the active source branch, its semantic bound \(T_{\min }\), and the displayed constants. The resulting tuple is precisely the stated \(\operatorname {MinIPDetectsOVRuntime}_R\) component.

Lemma 132 Minimum inner product detects OV

Fix \(\gamma \geq 1\), one active source branch

\[ \operatorname {source}\in \operatorname {ExactSource}(A_{\rm exact}) \sqcup \operatorname {GammaSource}(A_{\gamma }) \]

from Definition 122. Let \(A_{\min }(\operatorname {source})\) denote the program carried by that branch: it is \(A_{\rm exact}\) in the exact case and \(A_{\gamma }\) in the \(\gamma \) case. Let \(T_{\min }\) be a semantic worst-case bound for this same active program and for no other source branch. Suppose there are constants \(\varepsilon {\gt}0\), \(C{\gt}0\), \(b\in \mathbb {N}\), and \(n_0\) such that

\[ T_{\min }(n,\ell )\leq C n^{2-\varepsilon }(1+\ell )^b \]

for every \(n\geq n_0\) and every allowed dimension \(\ell \).

The concrete run-and-test program \(R_{\mathrm{Min\mbox{-}IP}\to \mathrm{OV}}[A_{\min }(\operatorname {source})]\) directly certifies an OV solver together with the inherited subquadratic running-time certificate. Lean-facing, the conclusion of this node is exactly the ordered pair

\[ \bigl( \operatorname {MinIPDetectsOVCorrect}_R(\operatorname {source}), \operatorname {MinIPDetectsOVRuntime}_R (\operatorname {source},T_{\min },C,\varepsilon ,b,n_0) \bigr). \]

The first component is the branch-specific correctness certificate of Lemma 130: direct small-input behavior, active subroutine first-halting output, scanned active pair, OV yes/no correctness, and first-halting-time-plus-scan accounting. The second component is the inherited runtime component of Lemma 131: the concrete piecewise bound \(T_{\mathrm{OV}}^R\), the semantic worst-case proof for the actual constructed OV program, and the constants \(\varepsilon '{\gt}0\), \(C'{\gt}0\), \(b'\in \mathbb {N}\), and \(n_0'\) proving

\[ T_{\mathrm{OV}}^R(n,\ell )\leq C'n^{2-\varepsilon '}(1+\ell )^{b'} \]

for all \(n\geq n_0'\) and every allowed \(\ell \).

Thus the declaration for this label has exactly one active source parameter, one active semantic bound \(T_{\min }\) for the program in that source, and hypotheses for \(C\), \(\varepsilon \), \(b\), and \(n_0\) about that same bound. In the exact case it may require the exact program’s correctness and the exact bound; it must not require any \(\gamma \)-program correctness or runtime hypothesis. In the \(\gamma \) case it may require the \(\gamma \) program’s correctness and the \(\gamma \) bound; it must not require any exact-program correctness or runtime hypothesis. A statement with simultaneous hypotheses for both branches, such as both \(h_{\rm Exact}\) and \(h_{\rm Gamma}\) or both \(T_{\rm exact}\) and \(T_{\gamma }\), is strictly stronger than this node and is not a valid formalization of this label.

Proof

The first component is Lemma 130. The second component is Lemma 131 applied to the same active source branch, the displayed semantic bound \(T_{\min }\), and the constants \(C,\varepsilon ,b,n_0\). Pairing those two components gives exactly the stated certificate for the same constructed program \(R_{\mathrm{Min\mbox{-}IP}\to \mathrm{OV}}[A_{\min }(\operatorname {source})]\). The proof is by the same case split on \(\operatorname {source}\) in both components, so the exact branch never mentions approximate-source data and the approximate branch never mentions exact-source data.

Definition 133 Balanced recursive split tree for Min-IP

For a monochromatic input \(V:\{ 1,\ldots ,n\} \to \{ 0,1\} ^{\ell }\), the balanced split tree is the following concrete finite list of intervals; it is not an arbitrary tree-like structure. An interval is encoded by endpoints \((L,R)\) with \(1\leq L\leq R\leq n\), denoting \(\{ L,\ldots ,R\} \). For every such interval define

\[ M(L,R)=L+\lfloor (R-L)/2\rfloor . \]

The recursive interval-list constructor \(\operatorname {SplitIntervals}_n(L,R)\) is defined by primitive recursion on the length \(R-L+1\). Its Lean-facing defining equations are exactly the following equations, with no hidden tree parameter:

\[ \operatorname {SplitIntervals}_n(L,L)=[(L,L)], \]

and, when \(L{\lt}R\),

\[ \operatorname {SplitIntervals}_n(L,R) = [(L,R)] \mathbin {++} \operatorname {SplitIntervals}_n(L,M(L,R)) \mathbin {++} \operatorname {SplitIntervals}_n(M(L,R)+1,R). \]

Equivalently, if the recursion is implemented by well-founded recursion rather than by a primitive-recursive syntax form, the recursive calls in the defining body are precisely the two calls on the strict subintervals \((L,M(L,R))\) and \((M(L,R)+1,R)\), and the two displayed equations are projection lemmas for the declaration itself. The split tree for the input size \(n\) is definitionally

\[ \mathcal T_n= \begin{cases} [\, ], & n=0,\\ \operatorname {SplitIntervals}_n(1,n), & n\geq 1. \end{cases} \]

It depends on \(V\) only through the row values used by attached queries; the node set depends only on \(n\). The internal-node list is the filter

\[ \operatorname {InternalIntervals}_n =\{ (L,R)\in \mathcal T_n : L{\lt}R\} \]

with inherited list order, and the leaf list is the complementary filter \(L=R\). The child intervals of an internal node \((L,R)\) are exactly

\[ I_L=(L,M(L,R)) \]

and right child

\[ I_R=(M(L,R)+1,R). \]

These two children are nonempty, disjoint, their union is \((L,R)\), and both children occur as the next recursively generated roots in \(\mathcal T_n\). No other intervals are nodes: every node of \(\mathcal T_n\) is produced by exactly one application of the displayed recursion from the root, and the list has no duplicate endpoint pairs.

The parent relation, ancestor relation, depth, and internal-node predicate are derived from this concrete list and these child equations. Consequently the following invariants are part of this definition, not later optional hypotheses: two generated intervals are either disjoint or one contains the other; every non-root node has a unique parent; every internal node has exactly the two displayed children; and every endpoint pair appears at most once in \(\mathcal T_n\).

The bichromatic query attached to an internal node \(I=(L,R)\) is the rectangular instance

\[ Q_I(V)=\bigl((v_i)_{i\in I_L},(v_j)_{j\in I_R}\bigr) \]

of Definition 121, with principal size \(N_I=\max \{ |I_L|,|I_R|\} \leq |I|\) and dimension \(\ell \). The canonical query schedule is the finite list

\[ \operatorname {SplitQueries}_n(V) = [\, Q_I(V): I\in \operatorname {InternalIntervals}_n \text{ in inherited list order}\, ]. \]

If \(\operatorname {InternalIntervals}_n[s]=(L_s,R_s)\) and \(M_s=M(L_s,R_s)\), then the \(s\)th query record is definitionally the rectangular bichromatic input

\[ \operatorname {SplitQueries}_n(V)[s] = \bigl(A_s,B_s\bigr), \]

where

\[ A_s:\{ L_s,\ldots ,M_s\} \to \{ 0,1\} ^{\ell },\qquad A_s(i)=v_i, \]

and

\[ B_s:\{ M_s+1,\ldots ,R_s\} \to \{ 0,1\} ^{\ell },\qquad B_s(j)=v_j. \]

The principal size and dimension projections of this concrete query are

\[ N(\operatorname {SplitQueries}_n(V)[s]) =\max \{ M_s-L_s+1,R_s-M_s\} , \qquad L(\operatorname {SplitQueries}_n(V)[s])=\ell . \]

Lean-facing, the declaration for this node must define the interval list \(\mathcal T_n\), the internal-node filtered list \(\operatorname {InternalIntervals}_n\), the midpoint function \(M\), the two child functions, the query function \(Q_I(V)\), and the query-schedule list \(\operatorname {SplitQueries}_n(V)\) by the displayed equations. The recursive constructor \(\operatorname {SplitIntervals}_n(L,R)\) must be part of this declaration’s exposed definitional data: callers can unfold it at \((L,L)\) and at \((L,R)\) with \(L{\lt}R\) to obtain the two equations above. It is not acceptable for this node to return only a wrapper around an unspecified helper such as \(\operatorname {minipSplitIntervals}\) unless that helper is the same declaration’s exposed recursive component and the base/step equations above are fields or projection lemmas of this node. It must not instead introduce a structure with fields such as \(\operatorname {nodes}\), \(\operatorname {children}\), \(\operatorname {isTree}\), or \(\operatorname {coversPairs}\) that can be instantiated by an arbitrary object. It must also not define \(\operatorname {InternalIntervals}_n\) or \(\operatorname {SplitQueries}_n(V)\) from an arbitrary list satisfying a tree predicate. Extra nodes, duplicate endpoint pairs, missing recursive children, duplicate intervals with the same endpoints, and extra or missing query records are ruled out definitionally by the list recursion and the displayed map from internal intervals to attached rectangular queries.

Lemma 134 Split tree covers each unordered pair once

For every distinct pair of indices \(p\neq q\) in \(\{ 1,\ldots ,n\} \), there is a unique endpoint pair \((L,R)\) in the concrete filtered list \(\operatorname {InternalIntervals}_n\) of Definition 133 such that \(L\leq p,q\leq R\) and the two indices lie in different displayed children:

\[ \bigl(p\leq M(L,R){\lt}q\bigr) \quad \text{or}\quad \bigl(q\leq M(L,R){\lt}p\bigr). \]

Equivalently, the unordered pair \(\{ p,q\} \) appears as a cross-pair in exactly one attached bichromatic query \(Q_{(L,R)}(V)\) from the canonical split-tree query schedule. The uniqueness quantifier ranges only over the recursively generated list \(\operatorname {InternalIntervals}_n\); there is no arbitrary split-tree value in the statement.

The query-schedule form of the same uniqueness is also part of the lemma. For every monochromatic input \(V:\{ 1,\ldots ,n\} \to \{ 0,1\} ^{\ell }\) and every distinct pair \(p\neq q\), there is a unique query-list position

\[ s\in \{ 1,\ldots , \operatorname {length}(\operatorname {SplitQueries}_n(V))\} \]

such that, writing \(\operatorname {InternalIntervals}_n[s]=(L_s,R_s)\) and \(M_s=M(L_s,R_s)\), the query at that position is exactly

\[ \operatorname {SplitQueries}_n(V)[s] = \bigl((v_i)_{L_s\leq i\leq M_s}, (v_j)_{M_s{\lt}j\leq R_s}\bigr), \]

and the pair \((p,q)\) is represented in this concrete query with one index in its left row list and one index in its right row list:

\[ (L_s\leq p\leq M_s\ \wedge \ M_s{\lt}q\leq R_s) \quad \text{or}\quad (L_s\leq q\leq M_s\ \wedge \ M_s{\lt}p\leq R_s). \]

If a second query-list position \(s'\) has the same property, then \(s'=s\) and hence

\[ \operatorname {SplitQueries}_n(V)[s'] = \operatorname {SplitQueries}_n(V)[s] \]

as the same attached rectangular bichromatic query record, not merely as the same endpoint pair. Conversely, if a query record in \(\operatorname {SplitQueries}_n(V)\) contains \((p,q)\) as such a left-right cross-pair, then its position is this unique \(s\).

More explicitly, if \((L,R)\) and \((L',R')\) are both internal intervals from \(\operatorname {InternalIntervals}_n\) satisfying the displayed separation predicate for the same pair \((p,q)\), then \(L=L'\) and \(R=R'\). If \((L,R)\) is the unique interval, the pair occurs in the query

\[ Q_{(L,R)}(V)= \bigl((v_i)_{L\leq i\leq M(L,R)}, (v_j)_{M(L,R){\lt}j\leq R}\bigr) \]

with one index on each side, and it occurs in no other query in the query list.

Lean-facing, the formal statement for this label must expose both uniqueness results: uniqueness of the separating generated interval and uniqueness of the corresponding element of the concrete list \(\operatorname {SplitQueries}_n(V)\). It must not replace the query-list uniqueness conclusion by a second copy of endpoint-pair uniqueness, and it must not state only that some endpoint pair could be used to build a query. The query conclusion must identify the actual attached bichromatic query record, including its left vector list, right vector list, principal size, and dimension projections inherited from Definition 133.

Proof

Starting at the root, follow the unique child interval that contains both \(p\) and \(q\) as long as such a child exists. This descent must stop before a singleton leaf because a singleton cannot contain two distinct indices. At the stopping node, the two indices lie in different children, giving existence in the concrete list. Uniqueness follows from the invariants built into Definition 133: generated intervals are laminar and have no duplicate endpoint pairs. Above the stopping node both indices are in the same child, below it no descendant contains both indices, and a disjoint interval contains neither both indices. Hence no second generated internal interval can satisfy the same separation predicate. The query-schedule statement follows because \(\operatorname {SplitQueries}_n(V)\) is definitionally the list obtained by mapping each internal interval, in inherited order, to its attached rectangular query \(Q_I(V)\). The no-duplicate endpoint invariant gives a one-to-one correspondence between internal-interval positions and query-list positions. Therefore the unique separating interval gives a unique actual query-list position, and unfolding \(Q_I(V)\) gives exactly the displayed left and right row lists, size projection, and dimension projection. Any other query record containing the same pair as a cross-pair would come from another separating internal interval, contradicting the interval uniqueness already proved.

Definition 135 Rectangular bichromatic Min-IP oracle problem specs

From the rectangular input record of Definition 121 we form three concrete computational-problem specifications. Their input type is the same rectangular record

\[ X=(A:\{ 1,\ldots ,n_A\} \to \{ 0,1\} ^{\ell }, B:\{ 1,\ldots ,n_B\} \to \{ 0,1\} ^{\ell }), \]

with validity condition \(n_A\geq 1\) and \(n_B\geq 1\), principal size \(N(X)=\max \{ n_A,n_B\} \), and auxiliary dimension \(L(X)=\ell \).

The exact oracle specification \(\operatorname {BiMinIPExactSpec}\) has output type \(\{ 1,\ldots ,n_A\} \times \{ 1,\ldots ,n_B\} \). Its correctness relation \(\operatorname {exact\_ correct}(X,(i^*,j^*))\) is exactly

\[ \forall i\in \{ 1,\ldots ,n_A\} ,\ \forall j\in \{ 1,\ldots ,n_B\} ,\qquad \left\langle A_{i^*},B_{j^*}\right\rangle \leq \left\langle A_i,B_j\right\rangle . \]

The \(\gamma \)-approximate oracle specification \(\operatorname {BiMinIPGammaSpec}(\gamma )\), for \(\gamma \geq 1\), has the same output type. Its correctness relation \(\operatorname {gamma\_ correct}(X,(i^*,j^*))\) is exactly

\[ \min _{i,j}\left\langle A_i,B_j\right\rangle \leq \left\langle A_{i^*},B_{j^*}\right\rangle \leq \gamma \min _{i,j}\left\langle A_i,B_j\right\rangle . \]

The threshold oracle specification \(\operatorname {BiMinIPThresholdSpec}(t)\), for \(0\leq t\leq \ell \), has output type \(\{ 0,1\} \). Its correctness relation \(\operatorname {threshold\_ correct}(X,z)\) is exactly

\[ z=1\Longleftrightarrow \exists i\in \{ 1,\ldots ,n_A\} ,\exists j\in \{ 1,\ldots ,n_B\} , \left\langle A_i,B_j\right\rangle \leq t, \]

and \(z=0\) in the negation of this condition.

These are real computational-problem specifications in the sense of Definition 44. They are not aliases for a family tag and they do not require any additional abstract correctness fields: the only output and correctness relations are the three displayed relations named \(\operatorname {exact\_ correct}\), \(\operatorname {gamma\_ correct}\), and \(\operatorname {threshold\_ correct}\).

Definition 136 Promised monochromatic Min-IP source problem specs

The monochromatic exact and \(\gamma \)-approximate Min-IP source specifications used in the recursive reduction have the input type \(V:\{ 1,\ldots ,n\} \to \{ 0,1\} ^{\ell }\) but are valid only under the promise

\[ n\geq 2. \]

This promise is part of the valid-input predicate, because the output type for both optimization variants is the distinct-pair subtype

\[ \{ (i,j):\{ 1,\ldots ,n\} \times \{ 1,\ldots ,n\} \mid i\neq j\} . \]

The exact correctness relation requires the returned distinct pair \((i^*,j^*)\) to satisfy

\[ \forall i,j,\ i\neq j\Rightarrow \left\langle v_{i^*},v_{j^*}\right\rangle \leq \left\langle v_i,v_j\right\rangle . \]

The \(\gamma \)-approximate correctness relation, for \(\gamma \geq 1\), requires

\[ \min _{i\neq j}\left\langle v_i,v_j\right\rangle \leq \left\langle v_{i^*},v_{j^*}\right\rangle \leq \gamma \min _{i\neq j}\left\langle v_i,v_j\right\rangle . \]

The threshold source specification \(\operatorname {MonoMinIPThresholdSpec}(t)\) has Boolean output type and may be evaluated for all \(n\); when \(n{\lt}2\) its yes condition is false because there is no feasible distinct pair. For \(n\geq 2\) it asks exactly whether some distinct pair has inner product at most \(t\). Thus the optimization sources never quantify over an infeasible distinct pair type, while the decision source keeps the paper’s constant-time \(n{\lt}2\) no branch.

Lemma 137 Split-tree query views are valid rectangular queries

Let \(V:\{ 1,\ldots ,n\} \to \{ 0,1\} ^{\ell }\) and let \(I=(L,R)\) be an internal interval of \(\operatorname {InternalIntervals}_n\). With \(M=L+\lfloor (R-L)/2\rfloor \), the left child range \(\{ L,\ldots ,M\} \) and the right child range \(\{ M+1,\ldots ,R\} \) are both nonempty. The concrete query view

\[ Q_I(V)= \bigl((v_i)_{L\leq i\leq M},(v_j)_{M{\lt}j\leq R}\bigr) \]

is therefore a valid rectangular input for each of \(\operatorname {BiMinIPExactSpec}\), \(\operatorname {BiMinIPGammaSpec}(\gamma )\), and \(\operatorname {BiMinIPThresholdSpec}(t)\). Its principal size and dimension are exactly

\[ N(Q_I(V))=\max \{ M-L+1,R-M\} ,\qquad L(Q_I(V))=\ell . \]

The query uses row views into the original input with the displayed index maps; it does not pad, copy to an arbitrary list, or hide validity behind an existential rectangular-input witness.

Proof

Since \(I\) is internal, \(L{\lt}R\). The midpoint satisfies \(L\leq M{\lt}R\), so both ranges \(\{ L,\ldots ,M\} \) and \(\{ M+1,\ldots ,R\} \) contain at least one index. Substituting these nonempty ranges into Definition 121 gives a valid rectangular record. The displayed equations for principal size and dimension are the projections of that record.

Definition 138 Affine local index maps for split-query answers

For an internal interval \(I=(L,R)\) of \(\operatorname {InternalIntervals}_n\), write \(M=L+\lfloor (R-L)/2\rfloor \). The local left index type of the attached rectangular query is

\[ U_I=\{ 1,\ldots ,M-L+1\} , \]

and the local right index type is

\[ W_I=\{ 1,\ldots ,R-M\} . \]

Define the two concrete affine inclusions

\[ \operatorname {leftIndex}_I:U_I\to \{ 1,\ldots ,n\} , \qquad \operatorname {rightIndex}_I:W_I\to \{ 1,\ldots ,n\} \]

by the equations

\[ \operatorname {leftIndex}_I(u)=L+u-1, \qquad \operatorname {rightIndex}_I(v)=M+v. \]

If the rectangular query is implemented using the child-range subtype indices \(\{ L,\ldots ,M\} \) and \(\{ M+1,\ldots ,R\} \) instead of local ordinals, these same maps are the coercions to the underlying original row indices. This node defines only the two index maps and their displayed equations.

Lemma 139 Affine split-answer indices are valid and distinct

For every internal interval \(I=(L,R)\) with midpoint \(M\), every \(u\in \{ 1,\ldots ,M-L+1\} \), and every \(v\in \{ 1,\ldots ,R-M\} \),

\[ L\leq \operatorname {leftIndex}_I(u)\leq M, \qquad M{\lt}\operatorname {rightIndex}_I(v)\leq R. \]

Consequently both indices are original input indices in \(\{ 1,\ldots ,n\} \) and

\[ \operatorname {leftIndex}_I(u)\neq \operatorname {rightIndex}_I(v). \]
Proof

The bounds on \(u\) give \(0\leq u-1\leq M-L\), hence \(L\leq L+u-1\leq M\). The bounds on \(v\) give \(1\leq v\leq R-M\), hence \(M{\lt} M+v\leq R\). Since the first index is at most \(M\) and the second is strictly greater than \(M\), they are distinct.

Definition 140 Local row functions projected from a split-query view

Let \(V:\{ 1,\ldots ,n\} \to \{ 0,1\} ^{\ell }\) and let \(I=(L,R)\) be an internal interval with midpoint \(M\). Let

\[ Q_I(V)= \bigl((v_i)_{L\leq i\leq M},(v_j)_{M{\lt}j\leq R}\bigr) \]

be the actual rectangular query view from Lemma 137. Define

\[ \operatorname {SplitLeftRows}_I(V): \{ 1,\ldots ,M-L+1\} \to \{ 0,1\} ^{\ell } \]

and

\[ \operatorname {SplitRightRows}_I(V): \{ 1,\ldots ,R-M\} \to \{ 0,1\} ^{\ell } \]

to be the first and second row functions obtained by projecting this same query record \(Q_I(V)\) and reindexing its child-range domains by the canonical local ordinal maps

\[ u\mapsto L+u-1,\qquad v\mapsto M+v. \]

Equivalently,

\[ \bigl(\operatorname {SplitLeftRows}_I(V), \operatorname {SplitRightRows}_I(V)\bigr) \]

is the local-ordinal row view of the concrete rectangular query \(Q_I(V)\). This node defines only these two row functions as projections of the actual split-query view. It does not define them by an independent direct lookup into \(V\), does not accept caller-supplied row functions, and does not add any oracle-validity hypothesis beyond the fact that \(I\) is an internal interval whose query view is the one displayed above.

Lemma 141 Left split-query row projection has the affine index

Let \(V:\{ 1,\ldots ,n\} \to \{ 0,1\} ^{\ell }\) and let \(I=(L,R)\) be an internal interval with midpoint \(M\). For every \(u\in \{ 1,\ldots ,M-L+1\} \),

\[ \operatorname {SplitLeftRows}_I(V)(u) = v_{\operatorname {leftIndex}_I(u)}. \]
Proof

Unfold the local row-function projection from Definition 140. The left row function is the first component of the actual query record \(Q_I(V)\), reindexed by \(u\mapsto L+u-1\). Unfolding Definition 138 identifies this original row index with \(\operatorname {leftIndex}_I(u)\).

Lemma 142 Right split-query row projection has the affine index

Let \(V:\{ 1,\ldots ,n\} \to \{ 0,1\} ^{\ell }\) and let \(I=(L,R)\) be an internal interval with midpoint \(M\). For every \(w\in \{ 1,\ldots ,R-M\} \),

\[ \operatorname {SplitRightRows}_I(V)(w) = v_{\operatorname {rightIndex}_I(w)}. \]
Proof

Unfold the local row-function projection from Definition 140. The right row function is the second component of the actual query record \(Q_I(V)\), reindexed by \(w\mapsto M+w\). Unfolding Definition 138 identifies this original row index with \(\operatorname {rightIndex}_I(w)\).

Lemma 143 Affine split-answer indices preserve query rows

Let \(V:\{ 1,\ldots ,n\} \to \{ 0,1\} ^{\ell }\) and let \(I=(L,R)\) be an internal interval with midpoint \(M\). Let

\[ U_I=\{ 1,\ldots ,M-L+1\} , \qquad W_I=\{ 1,\ldots ,R-M\} \]

be exactly the local left and right answer-index types introduced in Definition 138. In the query

\[ Q_I(V)= \bigl((v_i)_{L\leq i\leq M},(v_j)_{M{\lt}j\leq R}\bigr), \]

let the public row functions be exactly the local-ordinal projections of this query record:

\[ A=\operatorname {SplitLeftRows}_I(V), \qquad B=\operatorname {SplitRightRows}_I(V). \]

Thus \(A\) and \(B\) are the rows produced by the split-query view, not caller-supplied functions and not independent direct lookups into \(V\). For every

\[ u:U_I,\qquad w:W_I, \]
\[ A(u)=v_{\operatorname {leftIndex}_I(u)}, \qquad B(w)=v_{\operatorname {rightIndex}_I(w)}. \]

Therefore

\[ \left\langle A(u),B(w)\right\rangle = \left\langle v_{\operatorname {leftIndex}_I(u)},v_{\operatorname {rightIndex}_I(w)}\right\rangle . \]

Lean-facing, the declaration \(\operatorname {lem\_ minip\_ split\_ answer\_ row\_ preservation}\) must quantify directly over these displayed local ordinal types:

\[ \forall \, u:U_I,\ \forall \, w:W_I,\quad A(u)=v_{\operatorname {leftIndex}_I(u)} \ \wedge B(w)=v_{\operatorname {rightIndex}_I(w)} \ \wedge \left\langle A(u),B(w)\right\rangle = \left\langle v_{\operatorname {leftIndex}_I(u)},v_{\operatorname {rightIndex}_I(w)}\right\rangle . \]

Here \(A\) and \(B\) are fixed by the preceding displayed equations as \(\operatorname {SplitLeftRows}_I(V)\) and \(\operatorname {SplitRightRows}_I(V)\), the two projections of the actual query \(Q_I(V)\). The declaration has no premise asserting validity of an unrelated oracle problem instance and no parameter supplying alternate row functions. It is not enough to quantify over implementation-list indices such as \(\operatorname {Fin}(\operatorname {leftRows.length})\) and \(\operatorname {Fin}(\operatorname {rightRows.length})\) with extra caller-supplied bound hypotheses. If the rectangular query is internally stored as lists, the implementation must first expose the definitional identification of those list index types with \(U_I\) and \(W_I\), and the preservation lemma for this label must still have \(u:U_I\) and \(v:W_I\) as its public quantified variables. No hypotheses named like \(h_u\), \(h_v\), \(\operatorname {hu}\), or \(\operatorname {hv}\) may be required to turn an implementation-list index into a valid local answer index.

Proof

Fix arbitrary \(u:U_I\) and \(w:W_I\). Unfold the rectangular query view \(Q_I(V)\) only through the projected row functions \(\operatorname {SplitLeftRows}_I(V)\) and \(\operatorname {SplitRightRows}_I(V)\). Lemma 141 gives \(A(u)=v_{\operatorname {leftIndex}_I(u)}\), and Lemma 142 gives \(B(w)=v_{\operatorname {rightIndex}_I(w)}\). Substituting these two projection equalities into the inner product gives the displayed equality, still for the same quantified variables \(u:U_I\) and \(w:W_I\).

Definition 144 Local-to-global decoding of split-query answers
#

For an internal interval \(I=(L,R)\) with midpoint \(M\), define the deterministic decoding map

\[ \operatorname {DecodePair}_I: \{ 1,\ldots ,M-L+1\} \times \{ 1,\ldots ,R-M\} \to \{ (a,b):\{ 1,\ldots ,n\} \times \{ 1,\ldots ,n\} \mid a\neq b\} \]

by

\[ \operatorname {DecodePair}_I(u,v) = \bigl(\operatorname {leftIndex}_I(u), \operatorname {rightIndex}_I(v)\bigr), \]

where membership in the distinct-pair subtype is certified by Lemma 139. The row-value and inner-product preservation facts for this decoded pair are exactly Lemma 143.

Lean-facing, the declaration

\[ \operatorname {def\_ minip\_ split\_ answer\_ local\_ to\_ global\_ decoding} (n,\ell ,V,I) \]

returns this function \(\operatorname {DecodePair}_I\) itself. It is not a proposition, interface, or structure with a caller-supplied decoding field. Its only computational body is the displayed pair of affine index maps; the bounds, distinctness, row-value preservation, and inner-product preservation obligations are separate projection lemmas in the ist.

Definition 145 Decoded optimization candidates from a split history

For a full optimization history

\[ H=((Q_{I_1}(V),z_1),\ldots ,(Q_{I_m}(V),z_m)) \]

in the same list order as \(\operatorname {InternalIntervals}_n\), with optimization oracle answers \(z_s=(u_s,v_s)\), define the decoded candidate at history position \(s\) to be

\[ \operatorname {CandPair}(V,H,s) = (a_s,b_s)=\operatorname {DecodePair}_{I_s}(u_s,v_s). \]

Define its score by

\[ \operatorname {CandBeta}(V,H,s)=\left\langle v_{a_s},v_{b_s}\right\rangle . \]

This node defines only the finite indexed candidate-pair and beta-value functions obtained by decoding each history position.

Definition 146 First minimum beta position in split history

For a nonempty optimization history \(H\) of length \(m{\gt}0\), define

\[ \operatorname {MinBeta}(V,H) = \min _{1\leq r\leq m}\operatorname {CandBeta}(V,H,r). \]

The selected history position is the natural-order first position attaining this value:

\[ \operatorname {FirstMinBetaPos}(V,H) = \min \{ s\in \{ 1,\ldots ,m\} : \operatorname {CandBeta}(V,H,s)=\operatorname {MinBeta}(V,H)\} . \]

Tie-breaking is by the finite history position \(s\), not by the decoded pair value and not by a list search on pair values. If two different history positions decode to the same global pair, they remain separate positions in this minimum scan.

Lean-facing, this declaration is not just two equations assigning \(\operatorname {MinBeta}\) to the score at some implementation-selected index. It returns the concrete finite-minimum package

\[ \operatorname {def\_ minip\_ split\_ history\_ first\_ min\_ beta}(V,H) = \bigl(\operatorname {MinBeta}(V,H), \operatorname {FirstMinBetaPos}(V,H), h_{\rm in},h_{\rm att},h_{\rm le},h_{\rm first}\bigr) \]

with exactly the following eliminable fields. First,

\[ h_{\rm in}:\quad 1\leq \operatorname {FirstMinBetaPos}(V,H)\leq m . \]

Second, the selected position attains the displayed finite minimum:

\[ h_{\rm att}:\quad \operatorname {CandBeta} \bigl(V,H,\operatorname {FirstMinBetaPos}(V,H)\bigr) = \operatorname {MinBeta}(V,H). \]

Third, the selected value is no larger than every history-position score:

\[ h_{\rm le}:\quad \forall r\in \{ 1,\ldots ,m\} ,\qquad \operatorname {MinBeta}(V,H) \leq \operatorname {CandBeta}(V,H,r). \]

Fourth, the selected position is the natural-order first minimizer:

\[ h_{\rm first}:\quad \forall r\in \{ 1,\ldots ,m\} ,\quad r{\lt}\operatorname {FirstMinBetaPos}(V,H) \Rightarrow \operatorname {CandBeta}(V,H,r) \neq \operatorname {MinBeta}(V,H). \]

Equivalently, the pair \((h_{\rm att},h_{\rm first})\) states that \(\operatorname {FirstMinBetaPos}(V,H)\) is the least natural-number position among all positions attaining \(\operatorname {MinBeta}(V,H)\).

These four fields are part of this node’s formal content. A declaration for this label is invalid if it merely chooses an index such as \(\operatorname {minIPSplitFirstIndexByNat}\) and then defines \(\operatorname {MinBeta}\) to be \(\operatorname {CandBeta}\) at that index without proving \(h_{\rm le}\) and \(h_{\rm first}\). The minimum property must quantify over the actual finite position type \(\{ 1,\ldots ,m\} \) of the supplied history \(H\), and the firstness property must use the natural order on those history positions. No decoded-pair tie-breaking, pair-value search, existential minimizer, or caller-supplied proof of optimality may replace these fields.

Definition 147 Pair-valued split-history finish scan

For a nonempty optimization history \(H\), define the concrete pair-valued finish function by

\[ \operatorname {def\_ minip\_ split\_ finish\_ pair}(V,H) = \operatorname {CandPair} \bigl(V,H,\operatorname {FirstMinBetaPos}(V,H)\bigr). \]

If a total formal function is required on empty histories, its empty-history branch is an arbitrary fixed distinct-pair default supplied only after a proof that the optimization source is invalid there; the defining equation above is the only equation used for valid optimization histories.

Definition 148 Threshold split-history Boolean OR scan

For a threshold history

\[ H=((Q_{I_1}(V),z_1),\ldots ,(Q_{I_m}(V),z_m)), \qquad z_s\in \{ 0,1\} , \]

define the concrete Boolean finish function by the finite OR

\[ \operatorname {def\_ minip\_ split\_ finish\_ threshold}(H) = \bigvee _{s=1}^{m} z_s. \]

For \(m=0\) this OR is the empty finite OR and has value \(0\).

Definition 149 Deterministic split-history postprocessing

The deterministic split-history postprocessors are exactly the two concrete functions

\[ \operatorname {def\_ minip\_ split\_ finish\_ pair} \qquad \text{and}\qquad \operatorname {def\_ minip\_ split\_ finish\_ threshold} \]

defined in Definitions 147 and 148. The exact and \(\gamma \)-approximate variants use the pair-valued first-minimum beta scan; the threshold variant uses the Boolean OR scan.

Lean-facing, this node is not a proposition stating equations about externally supplied functions, and it is not a record accepting \(\operatorname {FinishPair}\) or \(\operatorname {FinishThreshold}\) fields from the caller. It exposes these two already-defined functions as the postprocessing functions for the split-tree reduction. The pair-valued function’s nonempty-history equation and the threshold function’s empty and nonempty OR equations are inherited from the two helper definitions.

Definition 150 Threshold-indexed Min-IP split reduction variant

For a fixed dimension \(\ell \), the split-tree Min-IP reduction variant is the following concrete tagged parameter:

\[ \operatorname {MinIPSplitReductionVariant}(\ell ) = \operatorname {exact} \; \sqcup \; \operatorname {gamma}(\gamma ,h_\gamma ) \; \sqcup \; \operatorname {threshold}(t,h_{0},h_{\ell }). \]

Here \(h_\gamma \) is the proof \(\gamma \geq 1\), \(h_0\) is the proof \(0\leq t\), and \(h_\ell \) is the proof \(t\leq \ell \). The threshold tag is not a nullary constructor: it carries the actual natural threshold \(t\) and both displayed bounds. Define

\[ \operatorname {thresholdOf} (\operatorname {threshold}(t,h_0,h_\ell ))=t \]

with projection lemmas returning \(h_0\) and \(h_\ell \).

The variant determines the source and target problem specifications by the following equations:

\[ P_{\operatorname {exact}}=\operatorname {MonoMinIPExactSpec},\qquad Q_{\operatorname {exact}}=\operatorname {BiMinIPExactSpec}, \]
\[ P_{\operatorname {gamma}(\gamma ,h_\gamma )} =\operatorname {MonoMinIPGammaSpec}(\gamma ),\qquad Q_{\operatorname {gamma}(\gamma ,h_\gamma )} =\operatorname {BiMinIPGammaSpec}(\gamma ), \]

and

\[ P_{\operatorname {threshold}(t,h_0,h_\ell )} =\operatorname {MonoMinIPThresholdSpec}(t),\qquad Q_{\operatorname {threshold}(t,h_0,h_\ell )} =\operatorname {BiMinIPThresholdSpec}(t). \]

Lean-facing, the declaration

\[ \operatorname {def\_ minip\_ threshold\_ indexed\_ reduction\_ variant}(\ell ) \]

is the dependent package consisting of this parameter type and the two specification selectors

\[ \operatorname {sourceSpec}_{\ell }: \operatorname {MinIPSplitReductionVariant}(\ell ) \to \operatorname {ComputationalProblemSpec}, \]
\[ \operatorname {oracleSpec}_{\ell }: \operatorname {MinIPSplitReductionVariant}(\ell ) \to \operatorname {ComputationalProblemSpec}, \]

defined by case analysis on the displayed constructors. The threshold branch equations of these returned selector functions are definitional projection equations:

\[ \operatorname {sourceSpec}_{\ell } (\operatorname {threshold}(t,h_0,h_\ell )) = \operatorname {MonoMinIPThresholdSpec}(t), \]
\[ \operatorname {oracleSpec}_{\ell } (\operatorname {threshold}(t,h_0,h_\ell )) = \operatorname {BiMinIPThresholdSpec}(t). \]

The same carried threshold variable \(t\) appears on both right-hand sides, before either specification is formed.

A formalization must not use a frozen constructor \(\operatorname {threshold}\) with no threshold field, must not default the threshold to \(0\), and must not recover \(t\) from a source input after the target oracle specification has already been chosen. It must also not implement \(\operatorname {sourceSpec}_{\ell }(\operatorname {threshold}(t,h_0,h_\ell ))\) by returning a tag-only or tuple-projection specification such as an unapplied threshold component of Definition 136. The threshold selector must apply that source specification to the carried \(t\), so eliminating the threshold case yields the exact equality \(P_{\operatorname {threshold}(t,h_0,h_\ell )} =\operatorname {MonoMinIPThresholdSpec}(t)\), not merely a threshold-family tag. The fixed threshold is part of the variant datum before both \(\operatorname {MonoMinIPThresholdSpec}(t)\) and \(\operatorname {BiMinIPThresholdSpec}(t)\) are formed.

Definition 151 Fixed-threshold source and oracle specification alignment

Given a threshold variant

\[ \theta =\operatorname {threshold}(t,h_0,h_\ell ) \in \operatorname {MinIPSplitReductionVariant}(\ell ), \]

define the threshold split reduction’s paired problem specifications directly from this constructor pattern, not by reusing a possibly threshold-erasing selector:

\[ \operatorname {FixedThresholdSourceSpec}_{\ell }(\theta ) :=\operatorname {MonoMinIPThresholdSpec}(t), \qquad \operatorname {FixedThresholdOracleSpec}_{\ell }(\theta ) :=\operatorname {BiMinIPThresholdSpec}(t). \]

The projection equations

\[ P_\theta = \operatorname {FixedThresholdSourceSpec}_{\ell }(\theta ) = \operatorname {MonoMinIPThresholdSpec}(t), \]

and

\[ Q_\theta = \operatorname {FixedThresholdOracleSpec}_{\ell }(\theta ) = \operatorname {BiMinIPThresholdSpec}(t) \]

are part of this node’s returned data. For a monochromatic source input \(V:\{ 1,\ldots ,n\} \to \{ 0,1\} ^{\ell }\), the source yes condition is

\[ \exists i,j,\ i\neq j\wedge \left\langle v_i,v_j\right\rangle \leq t. \]

For every split-tree query \(Q_I(V)=((v_i)_{L\leq i\leq M},(v_j)_{M{\lt}j\leq R})\), the target oracle yes condition for the same fixed \(\theta \) is

\[ \exists u,w,\quad \left\langle \operatorname {SplitLeftRows}_I(V)(u),\operatorname {SplitRightRows}_I(V)(w)\right\rangle \leq t. \]

The threshold appearing in these two displayed predicates is definitionally the same value \(\operatorname {thresholdOf}(\theta )=t\).

This node is the threshold-source specification restricted to the same fixed \(t\) as the rectangular bichromatic oracle specification. It supplies the declaration

\[ \operatorname {def\_ minip\_ fixed\_ threshold\_ source\_ oracle\_ spec} (\ell ,\theta ) \]

whose output is the concrete tuple

\[ \bigl( \operatorname {MonoMinIPThresholdSpec}(t), \operatorname {BiMinIPThresholdSpec}(t), \operatorname {sourceYes}_t, \operatorname {queryYes}_t, h_P,h_Q \bigr), \]

where \(h_P\) and \(h_Q\) are exactly the two displayed specification equalities. The source yes predicate and query yes predicate are projections from these two concrete threshold-\(t\) specifications. They are not independent generic predicates whose threshold happens to be written as \(\operatorname {thresholdOf}(\theta )\) while the source specification itself remains untied to \(t\).

It is not an oracle-reduction datum and it is not a proof of correctness of the whole reduction. It only fixes the matching threshold-bearing source and target specifications so later reduction data cannot instantiate the source as an unapplied threshold family, instantiate the target as \(\operatorname {BiMinIPThresholdSpec}(0)\), as a tag-only threshold problem, or as a specification whose threshold depends on a query answer or on an unrelated source-input field.

Definition 152 Oracle history to full optimization split history adapter

For the exact and \(\gamma \) split-tree variants, let \(H_{\rm raw}\in \Hist _R(V,r(V))\) be a full oracle-answer history of the oracle reduction datum whose queries are the split queries \(Q_{\operatorname {InternalIntervals}_n[s]}(V)\) and whose answers are optimization pairs \(z_s=(u_s,w_s)\). Define

\[ \operatorname {OptHist}(V,H_{\rm raw}) :\operatorname {MinIPSplitFullOptimizationHistory}(V) \]

to be the concrete full optimization history

\[ ((Q_{I_1}(V),z_1),\ldots ,(Q_{I_m}(V),z_m)), \qquad I_s=\operatorname {InternalIntervals}_n[s], \]

in the same list order as \(\operatorname {InternalIntervals}_n\), where each query component and answer component is copied from the raw query-answer entry at position \(s\).

Its defining projection equations are:

\[ \operatorname {length}(\operatorname {OptHist}(V,H_{\rm raw}))=r(V), \]
\[ \operatorname {OptHist}(V,H_{\rm raw})[s].\operatorname {query} = Q_{\operatorname {InternalIntervals}_n[s]}(V), \]

and

\[ \operatorname {OptHist}(V,H_{\rm raw})[s].\operatorname {answer}=z_s \]

for every \(1\leq s\leq r(V)\). Consequently the decoded candidates and beta values used by Definition 145 are computed from the actual oracle answers in \(H_{\rm raw}\), at the same positions.

Lean-facing, this node is the function

\[ \operatorname {def\_ minip\_ oracle\_ history\_ to\_ full\_ optimization\_ history} (V,H_{\rm raw}) = \operatorname {OptHist}(V,H_{\rm raw}). \]

It is the only adapter from the generic oracle-answer history type to \(\operatorname {MinIPSplitFullOptimizationHistory}(V)\). The exact and \(\gamma \) finish functions must therefore be stated as

\[ \operatorname {def\_ minip\_ split\_ finish\_ pair} \bigl(V,\operatorname {OptHist}(V,H_{\rm raw})\bigr), \]

not as a fixed fallback pair, an empty-history default, or a call to \(\operatorname {def\_ minip\_ split\_ finish\_ pair}\) on the raw history type itself.

Definition 153 Split-tree local phase counter schedule

For the split-tree reduction on input \(V\), define

\[ m=\operatorname {length}(\operatorname {InternalIntervals}_n), \qquad \operatorname {State}_R(V)=\{ 0,\ldots ,m\} . \]

The initial state is the counter value

\[ \operatorname {init}_R(V)=0. \]

At oracle-call phase \(s\), where \(1\leq s\leq m\), the previous compatible state is the counter value \(s-1\), and the update after any well-typed query answer is exactly

\[ \operatorname {update}_R(V,s,\sigma _{s-1},H_s,q_s,z_s)=s. \]

This state contains no query answer and no history; the full answer history remains the separate history argument of Definition 54.

Definition 154 Split-tree local phase query schedule

At oracle-call phase \(s\) with \(1\leq s\leq m\), the query constructor reads the interval

\[ I_s=\operatorname {InternalIntervals}_n[s] \]

and returns exactly the valid rectangular query view

\[ \operatorname {query}_R(V,s,\sigma _{s-1},H_s)=Q_{\operatorname {InternalIntervals}_n[s]}(V), \]

independent of the previous history argument \(H_s\) and independent of the previous counter value except for its phase-compatibility role. The query validity and its principal-size and dimension projections are those of Lemma 137.

Definition 155 Split-tree local phase variant finish functions

The final phase of the local presentation is variant tagged. For the exact optimization variant, the output type is the exact promised monochromatic Min-IP distinct-pair type and

\[ \operatorname {finish}_R^{\rm exact}(V,\sigma _m,H_{\rm raw}) = \operatorname {def\_ minip\_ split\_ finish\_ pair} \bigl(V,\operatorname {OptHist}(V,H_{\rm raw})\bigr). \]

For the \(\gamma \)-approximate optimization variant, the output type is the \(\gamma \)-approximate promised monochromatic Min-IP distinct-pair type and

\[ \operatorname {finish}_R^{\gamma }(V,\sigma _m,H_{\rm raw}) = \operatorname {def\_ minip\_ split\_ finish\_ pair} \bigl(V,\operatorname {OptHist}(V,H_{\rm raw})\bigr). \]

For the threshold decision variant, the output type is Boolean and

\[ \operatorname {finish}_R^{\rm thresh}(V,\sigma _m,H) = \operatorname {def\_ minip\_ split\_ finish\_ threshold}(H). \]

There is no common output value containing both pair and Boolean components, and no later projection chooses a component. Each variant has its own finish function with the displayed output type. In the two optimization variants the raw full oracle-answer history is first adapted by Definition 152; therefore the pair scan receives the concrete \(\operatorname {MinIPSplitFullOptimizationHistory}(V)\) required by Definition 147.

Definition 156 Split-tree Min-IP local-phase presentation

For the split-tree reduction on input \(V\), the local-phase presentation is the concrete variant-tagged presentation whose components are exactly the counter schedule, query schedule, and finish functions of Definitions 153, 154, and 155. Its oracle-call count is

\[ r(V)=\operatorname {length}(\operatorname {InternalIntervals}_n), \]

its state space is \(\{ 0,\ldots ,r(V)\} \), its initial state is \(0\), its phase-\(s\) query is the \(s\)th split query view, and its update after phase \(s\) is the counter value \(s\).

The finish component is selected by the variant tag before the presentation is formed: exact and \(\gamma \)-approximate variants use the concrete pair-valued beta-minimum scan \(\operatorname {def\_ minip\_ split\_ finish\_ pair} (V,\operatorname {OptHist}(V,H_{\rm raw}))\), while the threshold variant uses the concrete Boolean OR scan \(\operatorname {def\_ minip\_ split\_ finish\_ threshold}(H)\). The local work is precisely split-tree construction, query-view construction, counter updates, and the final scan attached to the selected variant.

Lean-facing, the declaration

\[ \operatorname {def\_ minip\_ bi\_ to\_ mono\_ local\_ phase\_ presentation} (\operatorname {variant},V) \]

returns this concrete local-phase presentation. Its component equations are definitional equations of the returned presentation:

\[ m=\operatorname {length}(\operatorname {InternalIntervals}_n),\quad \operatorname {State}_R(V)=\{ 0,\ldots ,m\} ,\quad \operatorname {init}_R(V)=0, \]

the query at phase \(s\) is exactly the \(s\)th split query view, the update is exactly the counter value \(s\), and the finish function is the variant-specific function displayed in Definition 155. The declaration must not be an abstract tuple of components that can be instantiated independently of these formulas, and it must not return a product of unrelated query, update, and finish components. The returned presentation is connected to the oracle-reduction datum by these displayed equations for all three variants. The threshold case uses only a variant value \(\operatorname {threshold}(t,h_0,h_\ell )\) from Definition 150; hence the same fixed threshold \(t\) is available before the threshold source and target specifications are selected.

Definition 157 Bichromatic-to-monochromatic Min-IP recursive reduction datum
#

Fix one of the three Min-IP variants: exact optimization, \(\gamma \)- approximation for a fixed \(\gamma \geq 1\), or threshold decision represented by a fixed threshold-indexed parameter \(\operatorname {threshold}(t,h_0,h_\ell )\) with \(0\leq t\leq \ell \). The source problem is the corresponding promised monochromatic specification from Definition 136, and the target oracle problem is the corresponding rectangular bichromatic specification from Definition 135. Given a correct rectangular bichromatic solver \(A_{\rm bi}\) for that same variant, the concrete oracle reduction datum \(R_{\rm biMinIP\to monoMinIP}\) is assembled from the helper declarations as follows.

For a valid optimization source input, the promise gives \(n\geq 2\). For a threshold source input with \(n{\lt}2\), the datum has zero oracle calls and final output \(0\). Otherwise it uses the local-phase presentation of Definition 156; hence its oracle-call count is

\[ r(V)=\operatorname {length}(\operatorname {InternalIntervals}_n), \]

and its \(s\)th query is exactly the valid rectangular query view

\[ q_s(V)=Q_{\operatorname {InternalIntervals}_n[s]}(V). \]

Query validity is provided by Lemma 137. Optimization oracle answers are decoded into original distinct indices by Definition 144; final exact and \(\gamma \) outputs are computed by the deterministic beta-minimum rule of Definition 149 after converting the raw full oracle history with Definition 152; and final threshold outputs are computed by its deterministic Boolean OR rule.

Lean-facing, the declaration

\[ \operatorname {def\_ minip\_ bi\_ to\_ mono\_ reduction\_ datum} (\operatorname {variant}) \]

returns a value whose codomain is exactly the oracle-reduction-datum type

\[ \operatorname {def\_ oracle\_ reduction\_ data} \bigl(P_{\operatorname {variant}},Q_{\operatorname {variant}}\bigr) \]

from Definition 49, where \(P_{\operatorname {variant}}\) is the selected promised monochromatic source specification and \(Q_{\operatorname {variant}}\) is the selected rectangular bichromatic oracle specification. In the threshold case these two specifications are the aligned pair

\[ P_{\operatorname {threshold}(t,h_0,h_\ell )} =\operatorname {MonoMinIPThresholdSpec}(t), \qquad Q_{\operatorname {threshold}(t,h_0,h_\ell )} =\operatorname {BiMinIPThresholdSpec}(t) \]

from Definition 151. Thus the target problem is not chosen from a threshold-erasing tag and does not default to \(t=0\). It is a concrete datum value, not a proposition, predicate, certificate, or structure saying that some datum exists. In particular, there is no declaration, field, or helper proposition named \(\operatorname {uses\_ oracle\_ reduction\_ data}\), \(\operatorname {exists\_ oracle\_ reduction\_ data}\), \(\operatorname {is\_ oracle\_ reduction\_ data}\), or any synonym. The implementation must not prove this node by introducing

\[ \exists R,\ \operatorname {def\_ oracle\_ reduction\_ data} (P_{\operatorname {variant}},Q_{\operatorname {variant}}) \]

or by returning a wrapper whose only connection to Definition 49 is such an existential proposition.

The returned datum has the following projection equations as part of this definition. Its input map, size functions, output types, and correctness relations are exactly those of Definitions 136 and 135. For an optimization source input \(V\), the valid-input projection includes the promise \(n\geq 2\). For a threshold source input with \(n{\lt}2\), the oracle-call-count projection is \(r(V)=0\) and the final-output projection is \(0\). In every other valid case, the oracle-call-count projection is

\[ r(V)=\operatorname {length}(\operatorname {InternalIntervals}_n), \]

the query projection is the total function satisfying, for every \(1\leq s\leq r(V)\),

\[ q_s(V)= Q_{\operatorname {InternalIntervals}_n[s]}(V), \]

and the query-size projections are

\[ N_Q(q_s(V))= N\! \left(Q_{\operatorname {InternalIntervals}_n[s]}(V)\right), \qquad L_Q(q_s(V))=\ell . \]

The state-space, initial-state, query-construction, update, and finish projections of the returned datum are exactly the corresponding projections of \(\operatorname {def\_ minip\_ bi\_ to\_ mono\_ local\_ phase\_ presentation} (\operatorname {variant},V)\), not caller-supplied functions. In the exact and \(\gamma \) variants the final postprocessing projection is precisely

\[ \operatorname {def\_ minip\_ split\_ finish\_ pair} \bigl(V,\operatorname {OptHist}(V,H_{\rm raw})\bigr), \]

where \(H_{\rm raw}\) is the generic full oracle-answer history received by the oracle-reduction postprocess field and \(\operatorname {OptHist}(V,H_{\rm raw})\) is the adapter of Definition 152. In the threshold variant it is precisely \(\operatorname {def\_ minip\_ split\_ finish\_ threshold}(H)\). Local-to-global decoding of optimization answers is exactly \(\operatorname {DecodePair}_I\) from Definition 144. These equations are eliminable by unfolding the returned datum itself; they are not separate assumptions and not partial constraints on an abstract \(R\).

This node therefore only assembles the concrete components into the oracle reduction datum required by Definition 49. It does not introduce new problem specifications, split-interval validity fields, local-to-global decoding fields, postprocessing fields, or local-phase compatibility fields. All such mathematical content is supplied by the helper nodes in the ist, and the projections of the resulting datum are exactly their displayed equations.

Definition 158 Exact split-history oracle-answer contract

For a valid exact-optimization split-tree run on \(V:\{ 1,\ldots ,n\} \to \{ 0,1\} ^{\ell }\), a full oracle-answer history

\[ H=((Q_{I_1}(V),z_1),\ldots ,(Q_{I_m}(V),z_m)) \]

is exact-correct when every answer \(z_s=(u_s,w_s)\) is a correct exact rectangular Min-IP answer for the actual query at the same position:

\[ \forall \, 1\leq s\leq m,\quad \operatorname {exact\_ correct} \bigl(Q_{I_s}(V),(u_s,w_s)\bigr). \]

Equivalently, writing \(A_s=\operatorname {SplitLeftRows}_{I_s}(V)\) and \(B_s=\operatorname {SplitRightRows}_{I_s}(V)\), this condition is the concrete family of inequalities

\[ \forall \, 1\leq s\leq m,\ \forall u,\ \forall w,\qquad \left\langle A_s(u_s),B_s(w_s)\right\rangle \leq \left\langle A_s(u),B_s(w)\right\rangle . \]

The decoded candidate \(\operatorname {CandPair}(V,H,s)\) and score \(\operatorname {CandBeta}(V,H,s)\) are the functions of Definition 145 applied to this same answer \(z_s\). This contract is not a global correctness tag on \(H\): it exposes one exact optimality inequality for each concrete query-list position and each local cross-pair in that query.

Lemma 159 Exact split answer is optimal after decoding

Let \(H\) satisfy Definition 158. Fix a query position \(s\) with interval \(I_s\) and answer \(z_s=(u_s,w_s)\). For every local cross-pair \(u,w\) in the same query, let

\[ (a_s,b_s)=\operatorname {CandPair}(V,H,s) \]

be the decoded global pair, and let

\[ (p,q)=\operatorname {DecodePair}_{I_s}(u,w) \]

be the decoded global pair for \((u,w)\). Then

\[ \left\langle v_{a_s},v_{b_s}\right\rangle \leq \left\langle v_p,v_q\right\rangle . \]

In particular, if a distinct original pair \((p,q)\) occurs as a cross-pair in the query at position \(s\), the decoded exact oracle answer at position \(s\) has score no larger than \(\left\langle v_p,v_q\right\rangle \).

Proof

The exact-answer contract at position \(s\) gives the local inequality

\[ \left\langle A_s(u_s),B_s(w_s)\right\rangle \leq \left\langle A_s(u),B_s(w)\right\rangle . \]

Lemma 143 rewrites the left side as the inner product of the decoded candidate \(\operatorname {CandPair}(V,H,s)=(a_s,b_s)\) and rewrites the right side as the inner product of the decoded pair \(\operatorname {DecodePair}_{I_s}(u,w)=(p,q)\). Substitution gives the displayed global inequality.

Lemma 160 Pair-valued finish scan selects a minimum candidate

For every nonempty optimization history \(H\) of length \(m{\gt}0\), let

\[ s^*=\operatorname {FirstMinBetaPos}(V,H) \]

and let

\[ (a^*,b^*)= \operatorname {def\_ minip\_ split\_ finish\_ pair}(V,H) = \operatorname {CandPair}(V,H,s^*). \]

Then for every history position \(1\leq s\leq m\),

\[ \left\langle v_{a^*},v_{b^*}\right\rangle = \operatorname {CandBeta}(V,H,s^*) = \operatorname {MinBeta}(V,H) \leq \operatorname {CandBeta}(V,H,s). \]

Thus the concrete finish function returns a decoded candidate whose score is no larger than the score of any decoded oracle-answer candidate in the same history.

Proof

By Definition 146, \(s^*\) is the first position attaining the finite minimum \(\operatorname {MinBeta}(V,H)\), so \(\operatorname {CandBeta}(V,H,s^*)=\operatorname {MinBeta}(V,H)\) and this value is at most every \(\operatorname {CandBeta}(V,H,s)\). Definition 147 identifies the returned pair with \(\operatorname {CandPair}(V,H,s^*)\), whose score is by definition \(\operatorname {CandBeta}(V,H,s^*)\).

Let \(V:\{ 1,\ldots ,n\} \to \{ 0,1\} ^{\ell }\) be a valid exact-optimization monochromatic Min-IP source input, so \(n\geq 2\). Let \(H\) be the full exact-optimization oracle-answer history generated by the concrete reduction datum of Definition 157, in the same order as \(\operatorname {InternalIntervals}_n\), and assume \(H\) satisfies the exact split-history oracle-answer contract of Definition 158. Let

\[ (a^*,b^*)= \operatorname {def\_ minip\_ split\_ finish\_ pair}(V,H) \]

be the exact variant’s final postprocessing output. Then \((a^*,b^*)\) is a valid distinct pair and

\[ \forall i,j,\ i\neq j\Rightarrow \left\langle v_{a^*},v_{b^*}\right\rangle \leq \left\langle v_i,v_j\right\rangle . \]

Equivalently, the exact split-tree reduction’s deterministic finish scan returns a global minimizer for monochromatic \(\mathrm{Min\mbox{-}IP}\).

Proof

Let \((p,q)\) be any distinct pair. By Lemma 134, it appears as a cross-pair in a unique concrete query-list position \(s\) with interval \(I_s\). Let \((u,w)\) be the corresponding local indices in that query. Lemma 159 applied to the exact-answer contract for \(H\) gives

\[ \operatorname {CandBeta}(V,H,s)\leq \left\langle v_p,v_q\right\rangle . \]

Since \(n\geq 2\), the split tree has at least one internal query, so the exact-optimization history is nonempty. Lemma 160 says that the finish pair \((a^*,b^*)\) has score no larger than \(\operatorname {CandBeta}(V,H,s)\). Combining the two inequalities gives \(\left\langle v_{a^*},v_{b^*}\right\rangle \leq \left\langle v_p,v_q\right\rangle \). The decoded candidate returned by the finish scan is a distinct pair because every \(\operatorname {DecodePair}_{I_s}\) lands in the distinct-pair subtype by Definition 144. Since \((p,q)\) was arbitrary, the returned pair is a global monochromatic Min-IP minimizer.

Lemma 162 Approximate recursive Min-IP answer combination

Assume that every internal query \(Q_I(V)\) is answered by a \(\gamma \)-approximate cross minimizer and let \((p^*,q^*)\) be a global monochromatic minimizer. If \(I_0\) is the unique internal node whose query contains \((p^*,q^*)\) as a cross-pair, then the optimum value of \(Q_{I_0}(V)\) equals the global optimum value. Consequently the final postprocessing rule of Definition 157 returns a distinct pair whose inner product is at most \(\gamma \) times the global optimum and at least the global optimum.

Proof

The query \(Q_{I_0}(V)\) contains the global minimizer, so its cross optimum is at most the global optimum. Since its feasible pairs are a subset of all distinct monochromatic pairs, its cross optimum is also at least the global optimum; hence the two optima are equal. The oracle answer at \(I_0\) has value at most \(\gamma \) times this common optimum. The final answer is the smallest value among all oracle-returned pairs, so it is no larger than the \(I_0\) returned value. Every returned pair is a valid monochromatic pair, so its value is at least the global optimum.

Lemma 163 Threshold recursive Min-IP answer combination

In the threshold variant of Definition 157, the final Boolean OR of the internal-node oracle answers is \(1\) if and only if the original monochromatic input has a distinct pair \(i\neq j\) with \(\left\langle v_i,v_j\right\rangle \leq t\).

Proof

If the final OR is \(1\), then some internal query has a correct yes answer, so that query contains a cross-pair with inner product at most \(t\); this is a distinct pair in the original input. Conversely, if the original input has a pair \((p,q)\) with value at most \(t\), then Lemma 134 places it as a cross-pair in a unique internal query. The correct threshold answer for that query is \(1\), so the final OR is \(1\).

Lemma 164 Recursive Min-IP query-size accounting

At every depth \(h\) of the balanced split tree, the internal-node intervals are disjoint and have total size at most \(n\). Each query at depth \(h\) has principal size at most the size of its parent interval. Therefore, for any \(\varepsilon \in (0,1]\),

\[ \sum _{I\text{ internal at depth }h} N_I^{2-\varepsilon } \leq n^{2-\varepsilon }2^{-h(1-\varepsilon )} \]

up to an absolute constant accounting for the floor/ceiling imbalance.

Proof

Balanced splitting makes every depth-\(h\) interval have size at most \(\lceil n/2^h\rceil \), and the intervals at the same depth are disjoint. Since each query size \(N_I\) is at most its parent interval size, the sum of \(N_I^{2-\varepsilon }\) over that depth is bounded by the number of nonempty intervals times \((\lceil n/2^h\rceil )^{2-\varepsilon }\). Absorbing the ceiling factor into an absolute constant gives the displayed geometric bound.

Suppose the rectangular bichromatic solver has running-time bound

\[ T_{\rm bi}(N,\ell )\leq C N^{2-\varepsilon }(1+\ell )^b \]

for some fixed \(\varepsilon {\gt}0\). Then every locally generated trace of \(R_{\rm biMinIP\to monoMinIP}[A_{\rm bi}]\) has total time

\[ L+\sum _{I\text{ internal in }\mathcal T(V)}T_{\rm bi}(N_I,\ell ) \leq C'n^{2-\varepsilon '}(1+\ell )^{b'} \]

for constants \(\varepsilon '{\gt}0\), \(C'{\gt}0\), and \(b'\in \mathbb {N}\) depending only on \(\varepsilon ,C,b\) and the fixed reduction, not on \(V\) or on oracle answers.

Proof

The local construction and postprocessing inspect or write only a constant number of records per tree node and at most \(O(\ell )\) coordinates for each returned pair or copied row. Across all depths this is bounded by \(C_0n(1+\ell )\lceil \log _2(n+1)\rceil \) for an absolute constant \(C_0\); in a view-based implementation the same bound holds a fortiori. For oracle time, sum the assumed bound over depths and apply Lemma 164. The geometric series in \(2^{-h(1-\varepsilon )}\) is bounded by a constant depending only on \(\varepsilon \), giving \(O(n^{2-\varepsilon }(1+\ell )^b)\) oracle time when \(0{\lt}\varepsilon {\lt}1\); if \(\varepsilon \geq 1\), reduce to any fixed smaller positive exponent. The \(n(1+\ell )\log (n+1)\) local term is absorbed by decreasing the exponent to some \(\varepsilon '{\gt}0\) and increasing \(C'\) and \(b'\).

Lemma 166 Bichromatic Min-IP is harder than monochromatic Min-IP, Lemma A.8

For each of the exact, \(\gamma \)-approximate, and threshold Min-IP variants, any truly subquadratic rectangular bichromatic solver induces the concrete monochromatic solver \(R_{\rm biMinIP\to monoMinIP}[A_{\rm bi}]\) of Definition 157. The induced solver’s oracle queries are exactly the split-tree queries \(Q_I(V)\), every distinct original pair is covered as a cross-pair in exactly one such query, the final answer is combined by the displayed minimum or Boolean-OR rule, and its total running time remains truly subquadratic up to polynomial factors in \(\ell \).

Proof

Definition 157 gives the actual composed algorithm and its concrete query schedule. Pair coverage is Lemma 134. The three answer-combination obligations are respectively Lemmas 161, 162, and 163. The running-time transfer, including local tree construction and the sum of all oracle queries, is Lemma 165. These are exactly the correctness and subquadratic-budget obligations required by Definition 101 for the concrete composed monochromatic algorithm.

Definition 167 Maximum Inner Product, Definition A.9
#

Given binary vectors \(v_1,\ldots ,v_n\in \{ 0,1\} ^{\ell }\), \(\mathrm{Max\mbox{-}IP}_{n,\ell }\) asks to find a pair \(i\neq j\) maximizing \(\left\langle v_i,v_j\right\rangle \).

Definition 168 Approximate Maximum Inner Product, Definition A.10

For \(\gamma \geq 1\), \(\gamma \)-\(\mathrm{Max\mbox{-}IP}_{n,\ell }\) asks for a pair whose inner product is a \(\gamma \)-approximation of the maximum inner product.

Definition 169 Maximum Inner Product decision version, Definition A.11

Given a threshold \(t\), \(\mathrm{Max\mbox{-}IP}_{n,\ell ,t}\) asks whether some pair \(i\neq j\) has \(\left\langle v_i,v_j\right\rangle \geq t\).

Definition 170 Bichromatic Maximum Inner Product

Given \(A,B\subseteq \{ 0,1\} ^{\ell }\) of size \(n\), the bichromatic versions of \(\mathrm{Max\mbox{-}IP}\), \(\gamma \)-\(\mathrm{Max\mbox{-}IP}\), and \(\mathrm{Max\mbox{-}IP}_{n,\ell ,t}\) optimize, approximate, or decide over pairs in \(A\times B\).

Definition 171 Bichromatic additive Maximum Inner Product

Given sets \(A,B\subseteq \{ 0,1\} ^{\ell }\) of size \(n\), an integer threshold \(\alpha \), and an additive gap \(g{\gt}0\), bichromatic \(g\)-Additive-\(\mathrm{Max\mbox{-}IP}\) distinguishes the following promised cases:

\[ \text{yes: }\exists (a,b)\in A\times B,\ \left\langle a,b\right\rangle \geq \alpha , \]

and

\[ \text{no: }\forall (a,b)\in A\times B,\ \left\langle a,b\right\rangle {\lt}\alpha -g. \]
Lemma 172 Bichromatic Max-IP is harder than monochromatic Max-IP, Lemma A.12

If any bichromatic Max-IP variant has a truly subquadratic algorithm, then the corresponding monochromatic variant has a truly subquadratic algorithm, up to polynomial factors in \(\ell \).

Proof

Use the same divide-and-recurse enumeration as in Lemma 166. Each unordered pair of input vectors is presented to exactly one bichromatic subproblem, so taking the best answer among all recursion nodes gives the monochromatic optimum, approximation, or threshold decision.

Lemma 173 Bichromatic Max-IP is OV-hard, Lemma A.13

A truly subquadratic algorithm for bichromatic \(\mathrm{Max\mbox{-}IP}_{n,\ell }\) implies a truly subquadratic algorithm for \(\mathrm{OV}_{n,\ell }\), up to polynomial factors in \(\ell \).

Proof

Partition the OV input vectors into \(S_0,\ldots ,S_\ell \), where \(S_i\) contains the vectors with exactly \(i\) ones. For each pair \((i,j)\), form \(\bar S_j\) by complementing every vector in \(S_j\) and run bichromatic Max-IP on \(S_i,\bar S_j\). For \(v\in S_i\) and \(w\in S_j\), Lemma 5 gives \(\left\langle v,\bar w\right\rangle =i-\left\langle v,w\right\rangle \). Hence \(\left\langle v,w\right\rangle =0\) exactly when \(\left\langle v,\bar w\right\rangle =i\), the largest possible value for a vector in \(S_i\). Trying all \(\ell ^2\) pairs of weight classes therefore decides whether any orthogonal pair exists.

Theorem 174 Approximate Max-IP hardness from Karthik–Manurangsi

Approximate \(\mathrm{Max\mbox{-}IP}\) in the parameter ranges used by Appendix B is hard under OVC/SETH.

Definition 175 Most Similar Documents, Definition 2.10

Given nonzero binary document embeddings \(v_1,\ldots ,v_n\in \{ 0,1\} ^{\ell }\), \(\mathrm{MSD}_{n,\ell }\) asks to find a pair \(i\neq j\) maximizing \(\left\langle v_i,v_j\right\rangle /(\| v_i\| \| v_j\| )\).

Definition 176 Approximate Most Similar Documents, Definition 2.11

For \(\gamma \geq 1\), \(\gamma \)-\(\mathrm{MSD}_{n,\ell }\) asks to find a pair \((i^*,j^*)\) whose cosine similarity is between \(1/\gamma \) times the optimum and the optimum.

Definition 177 Most Similar Documents decision version, Definition 2.12

Given \(t\in [0,1]\), \(\mathrm{MSD}_{n,\ell ,t}\) asks whether some pair \(i\neq j\) has cosine similarity at least \(t\).

Definition 178 Bichromatic Most Similar Documents

Bichromatic \(\mathrm{MSD}\) and its approximate and threshold variants are defined over pairs drawn from two input sets \(A,B\subseteq \{ 0,1\} ^{\ell }\).

Proof

For binary vectors, the value \(\left\langle v_i,v_j\right\rangle /(\| v_i\| \| v_j\| )\) is determined by three integers: \(\left\langle v_i,v_j\right\rangle \), \(\| v_i\| _1\), and \(\| v_j\| _1\), each between \(0\) and \(\ell \). Hence there are only \(O(\ell ^3)\) possible similarity values. Binary search or enumeration over this discrete set using the decision oracle finds the optimum with only a polynomial-in-\(\ell \) overhead.

Definition 180 Least Similar Documents, Definition A.14

Given nonzero binary document embeddings \(v_1,\ldots ,v_n\in \{ 0,1\} ^{\ell }\), \(\mathrm{LSD}_{n,\ell }\) asks to find a pair \(i\neq j\) minimizing \(\left\langle v_i,v_j\right\rangle /(\| v_i\| \| v_j\| )\).

Definition 181 Approximate Least Similar Documents, Definition A.15

For \(\gamma \geq 1\), \(\gamma \)-\(\mathrm{LSD}_{n,\ell }\) asks to find a pair \((i^*,j^*)\) whose cosine similarity is at least the optimum and at most \(\gamma \) times the optimum.

Definition 182 Least Similar Documents decision version, Definition A.16

Given \(t\in [0,1]\), \(\mathrm{LSD}_{n,\ell ,t}\) asks whether some pair \(i\neq j\) has cosine similarity at most \(t\).

Definition 183 Bichromatic Least Similar Documents

Bichromatic \(\mathrm{LSD}\) and its approximate and threshold variants are defined over pairs drawn from two input sets \(A,B\subseteq \{ 0,1\} ^{\ell }\).

Proof

The same \(O(\ell ^3)\) discretization used in Lemma 179 applies to cosine similarities for LSD. Searching those threshold values with an LSD decision oracle returns the minimum.

Lemma 185 Bichromatic similarity variants are harder

Truly subquadratic algorithms for bichromatic MSD or LSD variants imply truly subquadratic algorithms for the corresponding monochromatic variants.

Proof

The divide-and-recurse reduction of Lemma 166 depends only on the fact that every unordered pair appears as a cross-pair in exactly one recursive subproblem. It therefore applies verbatim to cosine-similarity maximization, minimization, approximation, and threshold decision.