FAILURE MAP
← Case archive

FA-6071 / Linear algebra / Open access

Matrix symmetry predicate · case 01

Diagonal positivity is unrelated to transpose symmetry.

Verified by executionVariant 1 · 4 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Diagonal positivity is unrelated to transpose symmetry.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return all(m[i][j]==m[j][i] for i in range(len(m)) for j in range(len(m)))

Unsuccessful approach: The comparison range omits the immediately adjacent diagonal.

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. Matrix symmetry predicate. Exact operational definition: all(m[i][j]==m[j][i] for i in range(len(m)) for j in range(len(m)))

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 all(m[i][i]>=0 for i in range(len(m)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2], [3, 4]],)', solve(*([[1, 2], [3, 4]],)), False)
check('fixture 2: ([[1, 2], [2, 4]],)', solve(*([[1, 2], [2, 4]],)), True)
check('fixture 3: ([[-1, 0], [0, -2]],)', solve(*([[-1, 0], [0, -2]],)), True)
check('fixture 4: ([],)', solve(*([],)), True)
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 fixtureActualExpectedOutcome
fixture 1: ([[1, 2], [3, 4]],)TrueFalseFailed
fixture 2: ([[1, 2], [2, 4]],)TrueTruePassed
fixture 3: ([[-1, 0], [0, -2]],)FalseTrueFailed
fixture 4: ([],)TrueTruePassed

SHA-256 / 0982467a6f86986afe730ae6e1add0aab53a30e2d6ed11c1dde96be6bd4985d7

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 all(m[i][j]==m[j][i] for i in range(len(m)) for j in range(i-1))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2], [3, 4]],)', solve(*([[1, 2], [3, 4]],)), False)
check('fixture 2: ([[1, 2], [2, 4]],)', solve(*([[1, 2], [2, 4]],)), True)
check('fixture 3: ([[-1, 0], [0, -2]],)', solve(*([[-1, 0], [0, -2]],)), True)
check('fixture 4: ([],)', solve(*([],)), True)
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 fixtureActualExpectedOutcome
fixture 1: ([[1, 2], [3, 4]],)TrueFalseFailed
fixture 2: ([[1, 2], [2, 4]],)TrueTruePassed
fixture 3: ([[-1, 0], [0, -2]],)TrueTruePassed
fixture 4: ([],)TrueTruePassed

SHA-256 / 06ae189b5e2b9c9bf6180cecd1a3b007cd93f06a61d77c6e2fee338755dedc86

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 all(m[i][j]==m[j][i] for i in range(len(m)) for j in range(len(m)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2], [3, 4]],)', solve(*([[1, 2], [3, 4]],)), False)
check('fixture 2: ([[1, 2], [2, 4]],)', solve(*([[1, 2], [2, 4]],)), True)
check('fixture 3: ([[-1, 0], [0, -2]],)', solve(*([[-1, 0], [0, -2]],)), True)
check('fixture 4: ([],)', solve(*([],)), True)
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 fixtureActualExpectedOutcome
fixture 1: ([[1, 2], [3, 4]],)FalseFalsePassed
fixture 2: ([[1, 2], [2, 4]],)TrueTruePassed
fixture 3: ([[-1, 0], [0, -2]],)TrueTruePassed
fixture 4: ([],)TrueTruePassed

SHA-256 / a6818da3f13def06b0f4a2f99cd19217bf937cf208c7fba54e53e92b3d068811

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:57.049626+00:00.

Case digest / d5dcc1e01e8905be600df8411d04a95bfa7fcbed0e4954b179143abcca36dd5b