Skip to main content

Exact and Numerical Model Contracts

A matrix represents a map only after its input/output spaces and coordinates are specified. A numerical answer needs additional choices: units, precision, norm, tolerances, objective and acceptance criteria.

ChoiceObligation
FieldCore theory uses real scalars; exact labs use rational inputs. Complex adjoints require conjugation.
ShapeA is m-by-n, x has n entries, b has m; state input/output bases.
Exact versus approximateFractions establish exact identities; floating residuals support tolerance-based claims.
RankExact rank is algebraic; numerical rank needs a scale, cutoff and perturbation model.
ObjectiveExact solve, unweighted least squares, weighted least squares and ridge are different problems.
EvidenceSolution, impossibility witness, reconstruction, orthogonality, residual and error bound answer different questions.

Exact systems and coordinates​

Row operations must act on both A and b. They preserve the solution set, not the original column space as a set of output vectors. Extract a column-space basis from original pivot columns. A nullspace basis must have n−rank(A) independent vectors, not merely several vectors that happen to map to zero.

For inconsistency, y^T A=0 and y^T b!=0 form a certificate: Ax=b would imply 0=y^T b. For consistency, prove the full set is x_p+Null(A). Rectangular basis matrices have coordinates determined by a solve, not by a square inverse.

Approximation, identifiability and projections​

Unweighted least squares minimizes ||Ax−b||2². All minimizers have the same fitted vector, characterized by A^T(b−Ax)=0. Coefficients are unique exactly when the columns are independent. For positive weights W, the corresponding condition is A^T W(b−Ax)=0; transform both A and b by sqrt(W).

Ridge minimizes ||Ax−b||2²+lambda*||x||2² for lambda>0. Its condition is A^T(b−Ax)=lambda*x. It changes the objective and can change the answer even with exact input and arithmetic. State which coefficients are penalized; the small exercises penalize every coefficient, including an intercept if present.

Numerical checks need a scale​

Check A≈QR and Q^TQ≈I separately. For Cholesky, check symmetry, positive diagonal in L, and A≈LL^T. A small reconstruction residual does not itself establish accurate coefficients or a reliable rank decision.

The kit reports exact infinity-norm solve diagnostics: r=b−Ax, eta=||r||/(||A||*||x||+||b||) and, when defined, relative_forward_error <= kappa(A)*||r||/||b||. The latter compares x with the exact solution of the supplied nonsingular system, not with an unknown physical truth. b=0 and zero denominators need explicit conventions. See the kit contract.

Power-iteration convergence means the returned eigenpair has a sufficiently small residual; it does not certify dominance. SVD truncation has separate operator and Frobenius error formulas. Pseudoinversion after discarding a positive singular value is pseudoinversion of a changed model.

Work and limits​

The offline kit caps dimensions at eight and validates its inputs. It is a teaching implementation, not a replacement for a numerical library. No performance claim follows from tiny tests. Explain general invariants separately from finite test evidence, and record any library version used for optional comparisons.