Source: https://guthlabs.ai/docs/instruments/matrix-calculator-det-inverse-rref-eigen-least-squares/implementation/

instrument implementation / implementation-contract

# Matrix Calculator (det/inverse/rref/eigen/least-squares) implementation

A source-bound implementation contract for Matrix Calculator (det/inverse/rref/eigen/least-squares); deployment and executable qualification remain separate.

Status: **VERIFIED_CLEAN**Lifecycle: **implementation-contract**

## Binding contract

This record describes what an executable surface must bind and validate. It does not claim that a public calculator, package, or production route is deployed.

**Record owner**: Guth Instruments

**Lifecycle**: verified-clean

**Evidence ID**: t8-019

**Effect**: Computation or source lookup only

## Input and validation requirements

- Inverse has a division-by-zero hazard when det(A)=0; near-zero determinants require a tolerance policy rather than an exact floating-point comparison.

- LU, QR, RREF, eigenvalue, rank, and least-squares results depend on pivoting, scaling, floating-point tolerances, and iteration limits.

- Normal equations can lose significant digits for ill-conditioned design matrices; rank-deficient systems can make A^T A singular.

- Eigenvectors are non-unique up to scaling, and repeated or defective eigenvalues may not have a complete eigenbasis.

- Real-input matrices can have complex eigenvalues and eigenvectors; the output type and supported arithmetic are unspecified.

- Variable-size inputs need explicit maximum dimensions and clear errors for malformed, ragged, empty, non-square, or dimensionally incompatible matrices.

- An offline build that needs a vendored math.js library must verify that the vendored version supports all claimed operations and has no runtime network dependency.

## Required corrections

No binding erratum is attached to this unique-name record. Implementers must still preserve the declared units, domain, and failure behavior.

## Inspectable interface fixture

The sample below is evidence for interface and validation tests, not a production implementation.

````
{
  "inputs": {
    "operation": "determinant_and_inverse",
    "A": [
      [
        4,
        7
      ],
      [
        2,
        6
      ]
    ]
  },
  "expected_outputs": {
    "determinant": "10",
    "inverse": [
      [
        "3/5",
        "-7/10"
      ],
      [
        "-1/5",
        "2/5"
      ]
    ],
    "verification_product": [
      [
        1,
        0
      ],
      [
        0,
        1
      ]
    ],
    "spot_checks": [
      {
        "at": "det([[4,7],[2,6]])",
        "input_side": 10,
        "answer_side": 10
      }
    ]
  },
  "reference_data": {
    "method": "For a 2 by 2 matrix [[a,b],[c,d]], det=ad-bc and inverse=(1/(ad-bc))*[[d,-b],[-c,a]]."
  },
  "working": "det(A)=4*6-7*2=24-14=10. Therefore inverse=(1/10)*[[6,-7],[-2,4]]=[[6/10,-7/10],[-2/10,4/10]]=[[3/5,-7/10],[-1/5,2/5]]. Product check: first row, first column=4*(3/5)+7*(-1/5)=12/5-7/5=1; first row, second column=4*(-7/10)+7*(2/5)=-28/10+28/10=0; second row, first column=2*(3/5)+6*(-1/5)=6/5-6/5=0; second row, second column=2*(-7/10)+6*(2/5)=-14/10+24/10=1."
}
````

## Other records

[01**Overview**](<https://guthlabs.ai/docs/instruments/matrix-calculator-det-inverse-rref-eigen-least-squares/>)[02**Mechanism**](<https://guthlabs.ai/docs/instruments/matrix-calculator-det-inverse-rref-eigen-least-squares/mechanism/>)[04**Qualification**](<https://guthlabs.ai/docs/instruments/matrix-calculator-det-inverse-rref-eigen-least-squares/qualification/>)

## Sources and evidence

These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.

- `VERIFIED_LEDGER.json`

- `evidence-tranche8/tranche8-results.json`
