FA-6066 / Linear algebra / Open access
Two by two inverse rational · case 01
The adjugate is not divided by the determinant.
ROOT CAUSE
The adjugate is not divided by the determinant.
VERIFIED REPAIR
Apply the specified mathematical contract directly, preserving all terms and boundary cases: return [[str(Fraction(x,m[0][0]*m[1][1]-m[0][1]*m[1][0])) for x in row] for row in [[m[1][1],-m[0][1]],[-m[1][0],m[0][0]]]] if m[0][0]*m[1][1]!=m[0][1]*m[1][0] else None
Unsuccessful approach: Elementwise reciprocals do not invert a linear map.
Case contract
Integer matrix/vector entries, rectangular rows, compatible multiplication dimensions, and square matrices for determinant, trace, inverse, symmetry and characteristic-polynomial operations. Rational matrix outputs are reduced Fraction strings. Input is 2 by 2; return None for a singular matrix and otherwise a 2 by 2 list of reduced Fraction strings. Exact operational definition: [[str(Fraction(x,m[0][0]*m[1][1]-m[0][1]*m[1][0])) for x in row] for row in [[m[1][1],-m[0][1]],[-m[1][0],m[0][0]]]] if m[0][0]*m[1][1]!=m[0][1]*m[1][0] else None
Why this case matters
Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Linear algebra results depend on the stated convention.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR
N = 1
observations = []
def solve(m):
return [[str(x) for x in row] for row in [[m[1][1],-m[0][1]],[-m[1][0],m[0][0]]]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[2, 0], [0, 4]],)', solve(*([[2, 0], [0, 4]],)), [['1/2', '0'], ['0', '1/4']])
check('fixture 2: ([[1, 2], [3, 4]],)', solve(*([[1, 2], [3, 4]],)), [['-2', '1'], ['3/2', '-1/2']])
check('fixture 3: ([[1, 2], [2, 4]],)', solve(*([[1, 2], [2, 4]],)), None)
check('fixture 4: ([[1, 0], [0, 1]],)', solve(*([[1, 0], [0, 1]],)), [['1', '0'], ['0', '1']])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1: ([[2, 0], [0, 4]],) | [['4', '0'], ['0', '2']] | [['1/2', '0'], ['0', '1/4']] | Failed |
| fixture 2: ([[1, 2], [3, 4]],) | [['4', '-2'], ['-3', '1']] | [['-2', '1'], ['3/2', '-1/2']] | Failed |
| fixture 3: ([[1, 2], [2, 4]],) | [['4', '-2'], ['-2', '1']] | None | Failed |
| fixture 4: ([[1, 0], [0, 1]],) | [['1', '0'], ['0', '1']] | [['1', '0'], ['0', '1']] | Passed |
SHA-256 / 30f0264bd4e8d655e6bc3f21b9f75f6738e01bcc87a5055b7ac11319025d9b56
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR
N = 1
observations = []
def solve(m):
return [[str(Fraction(1,x)) if x else "0" for x in row] for row in m]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[2, 0], [0, 4]],)', solve(*([[2, 0], [0, 4]],)), [['1/2', '0'], ['0', '1/4']])
check('fixture 2: ([[1, 2], [3, 4]],)', solve(*([[1, 2], [3, 4]],)), [['-2', '1'], ['3/2', '-1/2']])
check('fixture 3: ([[1, 2], [2, 4]],)', solve(*([[1, 2], [2, 4]],)), None)
check('fixture 4: ([[1, 0], [0, 1]],)', solve(*([[1, 0], [0, 1]],)), [['1', '0'], ['0', '1']])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1: ([[2, 0], [0, 4]],) | [['1/2', '0'], ['0', '1/4']] | [['1/2', '0'], ['0', '1/4']] | Passed |
| fixture 2: ([[1, 2], [3, 4]],) | [['1', '1/2'], ['1/3', '1/4']] | [['-2', '1'], ['3/2', '-1/2']] | Failed |
| fixture 3: ([[1, 2], [2, 4]],) | [['1', '1/2'], ['1/2', '1/4']] | None | Failed |
| fixture 4: ([[1, 0], [0, 1]],) | [['1', '0'], ['0', '1']] | [['1', '0'], ['0', '1']] | Passed |
SHA-256 / 86fb3df6a436b71b0e35f1a283b2598594d726f149bce28ad3cfe9d5007a82a6
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR
N = 1
observations = []
def solve(m):
return [[str(Fraction(x,m[0][0]*m[1][1]-m[0][1]*m[1][0])) for x in row] for row in [[m[1][1],-m[0][1]],[-m[1][0],m[0][0]]]] if m[0][0]*m[1][1]!=m[0][1]*m[1][0] else None
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[2, 0], [0, 4]],)', solve(*([[2, 0], [0, 4]],)), [['1/2', '0'], ['0', '1/4']])
check('fixture 2: ([[1, 2], [3, 4]],)', solve(*([[1, 2], [3, 4]],)), [['-2', '1'], ['3/2', '-1/2']])
check('fixture 3: ([[1, 2], [2, 4]],)', solve(*([[1, 2], [2, 4]],)), None)
check('fixture 4: ([[1, 0], [0, 1]],)', solve(*([[1, 0], [0, 1]],)), [['1', '0'], ['0', '1']])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1: ([[2, 0], [0, 4]],) | [['1/2', '0'], ['0', '1/4']] | [['1/2', '0'], ['0', '1/4']] | Passed |
| fixture 2: ([[1, 2], [3, 4]],) | [['-2', '1'], ['3/2', '-1/2']] | [['-2', '1'], ['3/2', '-1/2']] | Passed |
| fixture 3: ([[1, 2], [2, 4]],) | None | None | Passed |
| fixture 4: ([[1, 0], [0, 1]],) | [['1', '0'], ['0', '1']] | [['1', '0'], ['0', '1']] | Passed |
SHA-256 / e624fd0139a84f1a0fb2e51105dc99150c52dc2c217dc04ddc33b762d170a51e
Verification & scope
This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:37:56.999706+00:00.
Case digest / b0bf0ebce921f4f6b8f4b694b581a1acad3b944ef05ca6f69395fc48f906e557