Alphabeta Math
AlgorithmAlgorithm: AI-adaptedProof: Not applicablePipeline-generated
How statement and proof provenance work

The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.

  • Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
  • AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
  • AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.

These labels describe origin, not correctness: citations and verification chips remain separate evidence.

Strong rank-revealing QR with finite swaps and explicit statuses

Definition

Input a real or complex matrix A∈Fm×n with m≥n, a target k with 0≤k<n, a factor f≥1, and a finite swap cap S∈N∪{0}. The exact-arithmetic version is specified below. In finite precision, A denotes the represented matrix: each real and imaginary component, and f, is a finite binary floating-point number, interpreted as its exact dyadic rational value. The arithmetic format and rounding rule are fixed for a run. A nonfinite input or required rounded intermediate returns range-failure. This mode makes no rank claim about an unspecified matrix before input rounding.

For the finite-precision rank test, copy the represented A into exact rational complex arithmetic. Scan columns from left to right with a current pivot row, select the first nonzero entry at or below that row, interchange rows, and eliminate entries below it by exact rational row operations. If no such entry exists, skip that column. Increment the pivot row only after a nonzero pivot. The number r of pivots is the reported exact represented-input rank. Return rank-deficient-input if r<n; otherwise continue with rank status full-column-rank. This test uses unbounded-size rational integers, not the rounded QR diagonal or a numerical-rank threshold. In exact mode, use the same finite row-elimination instructions over the exact input field to decide the rank condition in step 1.

The finite-precision mode additionally takes a finite real binary format F containing 0,1,−1 and closed under sign changes, a fixed rounding rule, and a certificate-pass budget C∈N0 (default 1; C=0 disables certification). Real and imaginary parts are stored separately. For a real rational result within the format's finite range, fl⁡ returns its specified nearest representable value, with a fixed tie rule, or its specified directed rounding; a result outside that range returns range-failure. Exact zeros are copied as zero. Real addition, subtraction, multiplication, and division mean their exact rational result followed by this rounding; check each divisor before dividing. A real square root of a nonnegative represented number is rounded by comparing that number with squares of the finitely many nonnegative format values: bracket its root, then use the selected directed endpoint or compare with the squared midpoint for nearest rounding. A negative argument or a root beyond the finite range returns range-failure. Thus no exact irrational arithmetic oracle or unbounded precision search is part of this mode. A nonfinite input or any failed required scalar operation immediately returns range-failure with any completed partial data.

Use the following fixed scalar conventions throughout the rounded core. For z=a+ib and w=c+id, complex addition/subtraction round their two real components; multiplication returns fl⁡(fl⁡(ac)−fl⁡(bd))+ifl⁡(fl⁡(ad)+fl⁡(bc)). For division compute d0=fl⁡(c2)+fl⁡(d2) with the addition rounded, require d0>0, compute the rounded product zw‾, and divide its two real components by d0, rounding each. Conjugation and sign changes are exact copies. For a vector, compute its squared norm by rounding each real-component square and summing them with rounding in increasing coordinate order, real part before imaginary part; apply the rounded nonnegative square root. Dot products use the above rounded complex products and a left-to-right rounded sum. These rules specify every norm and score calculation below; a nonzero vector whose required computed norm is zero returns range-failure.

The initial permutation is Π=In, with original labels 1,…,n. A rounded full QR sweep of a fixed current column order starts from B=AΠ, Q^=Im and an empty transformation record. During the initial pivoted sweep, at column j=1,…,n compute the rounded norms of B(j:m,ℓ) for ℓ=j,…,n, choose the largest, breaking ties by smallest original column label, and swap the full columns of B and their labels. A fixed-order sweep skips these pivot searches. In either sweep, if B(j+1:m,j)=0 entrywise, record no transformation and continue. Otherwise copy z=B(j:m,j), compute its rounded norm r>0, and set ϕ=1 if z1=0; if z1≠0, compute its rounded modulus a>0 and divide its two components by a to form ϕ. Set α=−fl⁡(rϕ), v1=fl⁡(z1−α) and vi=zi for i>1. Compute the rounded squared norm d^ of v, require d^>0, and put τ^=fl⁡(2/d^). Record the active index j and the exact dyadic components of this nonzero stored v before updating anything.

For each column ℓ=j,…,n, compute the rounded dot product aℓ=v∗B(j:m,ℓ) from the old column, set hℓ=fl⁡(τ^aℓ), then replace each active entry by fl⁡(Biℓ−fl⁡(vi−j+1hℓ)). For each row a=1,…,m of Q^, compute ba=Q^(a,j:m)v from its old row, set ga=fl⁡(τ^ba), and replace each active entry by fl⁡(Q^ai−fl⁡(gav‾i−j+1)). Finally set B(j+1:m,j) to exact zeros by assignment. At the end return R^=B, the full m×m candidate Q^, the final permutation and the ordered record. The imposed zeros are part of this rounded procedure, not a claim of exact annihilation; the certificate measures their effect as well as all rounding. There are at most n≤mn reflector updates per sweep. Empty active tails are skipped, and no norm or quotient is required for them.

In finite precision step 1 uses this pivoted sweep, and step 2 uses a fresh fixed-order sweep on the represented input A in its current order. Each fresh sweep resets Q^ and its transformation record. Before the triangular solves, decide singularity of its represented R^11 by the same exact rational elimination as the input rank test; if singular, return singular-selected-block. Otherwise solve R^11X=R^12 and R^11Y=Ik by rounded back-substitution: for each right-hand-side column, process rows i=k,…,1, sum R^ihxh in increasing h=i+1,…,k, subtract from the supplied right-hand side, check the diagonal divisor and use the complex division above. Compute ωi as the rounded norm of row i of Y, γj as the rounded norm of column j of R^22, and cij as the rounded modulus of Xij. Compute tij=fl⁡(ωiγj) and sij=fl⁡(fl⁡(fl⁡(cij2)+fl⁡(tij2))). Scan these finite candidate lists for the step-4 maxima and its stated tie rules. The diagnostics (X,Y,(ωi),(γj),(cij),(sij)) are rounded candidates, not exact inverse or score identities. For k=0 there are no such solves or score lists.

The numbered instructions below specify exact arithmetic; the preceding rounded instructions replace the corresponding factorization, solve and score operations in finite precision.

  1. If A is not full column rank, return rank-deficient-input. Otherwise initialize a column permutation Π and the full column-pivoted QR factorization AΠ=QR, where Q∈Fm×m is unitary and R∈Fm×n is upper trapezoidal. At each pivot choose a remaining column of maximal residual 2-norm, resolving ties by the smallest original column index. Partition R=[R11R120R22] after the first k rows and columns. Do not return the reduced QR form. The selected first k columns then have a nonsingular leading block. For k=0, return this full factorization with success.
  2. For k>0, refactor the current fixed column order in the full QR form, without further pivoting whenever needed, using unitary Householder or Givens transformations. If the selected leading block is singular, return singular-selected-block.
  3. Form X=R11−1R12. For 1≤i≤k let ωi=∥ei∗R11−1∥2; for 1≤j≤n−k let γj=∥R22(:,j)∥2. Define the swap score sij=(∣Xij∣2+(ωiγj)2)1/2.
  4. If max⁡i,j∣Xij∣>f, choose the lexicographically first pair attaining the largest ∣Xij∣. Otherwise, if max⁡i,jsij>f, choose the lexicographically first pair attaining the largest score. If neither inequality holds, return success and the factors, permutation, X, and maximum score. The first branch retains the usual coefficient-triggered swap; the second controls the trailing residual needed for the strong spectral comparison.
  5. When a violating pair was chosen, if the swap count is already S, return swap-budget-exhausted with the current partial factors. Otherwise interchange the chosen selected and trailing columns in the current permutation. In exact arithmetic restore triangular form with Givens rotations; in finite precision discard the old factors and record, since step 2 recomputes them from A in the new fixed order. Increment the swap count and return to step 2.

The statuses are success, rank-deficient-input, singular-selected-block, swap-budget-exhausted, and range-failure. In particular, ordinary column-pivoted QR is only the initialization: the procedure does not assert that its output alone satisfies the strong bounds. Both modes return the full factor shape and available diagnostics. A finite-precision success is a candidate until the following separate certificate is verified. The rounded dense Q^ is never asserted to be unitary.

For each recorded active dyadic vector v, define the embedded exact rational matrix H=I−2vv∗v∗v on its active coordinates, with identity on the preceding coordinates. Its denominator is a strictly positive exact rational. It is exactly unitary: writing P=vv∗/(v∗v) gives P∗=P, P2=P and (I−2P)∗(I−2P)=I. Thus the ordered sweep record represents the exact unitary product W=H1⋯Ht; an empty record represents Im. This product corresponds to the final fresh sweep only, and is distinct from the rounded Q^ and the nonunitary rounded update coefficients τ^. Its rational representation requires no normalization by an irrational vector norm.

Certification is finite optional postprocessing, independent of the core status. For a nonsuccess status assign not-applicable. On success with C=0, assign uncertified. With C≥1 perform the following one exact rational pass, using unbounded-size integer numerators and denominators; no retry until success is allowed.

  • Check factor dimensions, that Π is a permutation of 1,…,n, that R^ is exactly upper trapezoidal, and that each recorded vector has the declared active dimension and is nonzero. Reconstruct each H by the displayed rational formula, multiply them in the recorded order, and verify entrywise W∗W=Im. Any failed check sets uncertified.
  • For k>0, apply exact rational elimination to R^11. If singular, the certificate is uncertified. Otherwise compute its exact inverse Y0 by elimination on [R^11  Ik], normalizing each nonzero pivot and eliminating above and below it. Form Z=Y0R^12 and the exact nonnegative rational score squares qij=∣Zij∣2+(∑a=1k∣(Y0)ia∣2)(∑b=1m−k∣(R^22)bj∣2). Set bij=qij, stored as a symbolic nonnegative square root, and check the rational inequalities qij≤f2 for every i,j. These are equivalent to all bij≤f. They certify the exact scores of the represented blocks, independently of rounded X,Y,ω,γ,s. For k=0 this list and every inverse condition are absent.
  • Compute exactly E=AΠ−WR^ and e2=∑a,b∣Eab∣2. Set ε=e2, again a symbolic nonnegative square root; then ∥AΠ−WR^∥2≤∥E∥F=ε. If all structural and score checks passed, return certified with the rational record, reconstructed W, (qij), (bij), E,e2,ε and their check outcomes; otherwise return uncertified with any completed data. There is no extra residual tolerance implicit in the certificate: its actual residual bound ε is reported, however large, and any application requiring a small bound must check that separately.

This single finite pass uses at most the prescribed positive pass budget; a supplied certificate is accepted only by recomputing these exact checks. Certification does not change the core status or rounded candidates. It gives precisely a nonsingular R^11 when k>0, rigorous combined-score bounds bij≤f, and an exact unitary representation W with the reported reconstruction bound. The bounds concern the represented input A; a claim about different intended data also needs its separately supplied input-error bound. Ordinary rounded score or residual evaluations do not establish this certificate.

Depends on

Used by

Dependency tree · two levels

11 results within two dependency steps of this one, each drawn at its shortest distance from it. An arrow runs from a result to what uses it, so the chart reads left to right and ends at this result, which carries a heavier outline. Every node is a link to that result. Click elsewhere on the chart to enlarge it.

Sources